Ignore:
Timestamp:
Jan 14, 2021 10:42:28 AM (3 years ago)
Author:
raasch
Message:

reading of namelist file and actions in case of namelist errors revised so that statement labels and goto statements are not required any more, deprecated namelists removed

File:
1 edited

Legend:

Unmodified
Added
Removed
  • palm/trunk/SOURCE/indoor_model_mod.f90

    r4828 r4842  
    2525! -----------------
    2626! $Id$
     27! reading of namelist file and actions in case of namelist errors revised so that statement labels
     28! and goto statements are not required any more
     29!
     30! 4828 2021-01-05 11:21:41Z Giersch
    2731! Change parameters for summer_pars and winter_pars (responsible: S. Rissmann)
    2832!
     
    19031907        CASE ( 'im_t_indoor_wall_win' )
    19041908           unit = 'K'
    1905            
     1909
    19061910        CASE ( 'im_t_indoor_wall' )
    19071911           unit = 'K'
     
    21232127
    21242128
    2125     CHARACTER (LEN=80) ::  line  !< string containing current line of file PARIN
     2129    CHARACTER(LEN=100) ::  line  !< string containing current line of file PARIN
     2130
     2131    INTEGER(iwp)  ::  io_status  !< status after reading the namelist file
     2132
    21262133
    21272134    NAMELIST /indoor_parameters/  indoor_during_spinup,                                            &
    21282135                                  initial_indoor_temperature
    21292136
    2130 
    2131 !
    2132 !-- Try to find indoor model package
    2133     REWIND ( 11 )
    2134     line = ' '
    2135     DO  WHILE ( INDEX( line, '&indoor_parameters' ) == 0 )
    2136        READ ( 11, '(A)', END=10 )  line
    2137     ENDDO
    2138     BACKSPACE ( 11 )
    2139 
    2140 !
    2141 !-- Read user-defined namelist
    2142     READ ( 11, indoor_parameters )
    2143 !
    2144 !-- Set flag that indicates that the indoor model is switched on
    2145     indoor_model = .TRUE.
     2137!
     2138!-- Move to the beginning of the namelist file and try to find and read the namelist.
     2139    REWIND( 11 )
     2140    READ( 11, indoor_parameters, IOSTAT=io_status )
     2141
     2142!
     2143!-- Action depending on the READ status
     2144    IF ( io_status == 0 )  THEN
     2145!
     2146!--    indoor_parameters namelist was found and read correctly. Set flag that indicates that the
     2147!--    indoor model is switched on.
     2148       indoor_model = .TRUE.
     2149
     2150    ELSEIF ( io_status > 0 )  THEN
     2151!
     2152!--    indoor_parameters namelist was found, but contained errors. Print an error message including
     2153!--    the line that caused the problem.
     2154       BACKSPACE( 11 )
     2155       READ( 11 , '(A)' ) line
     2156       CALL parin_fail_message( 'indoor_parameters', line )
     2157
     2158    ENDIF
    21462159
    21472160!
     
    21562169!        ENDIF
    21572170
    2158  10 CONTINUE
    2159 
    21602171 END SUBROUTINE im_parin
    21612172
Note: See TracChangeset for help on using the changeset viewer.