Changeset 4099 for palm


Ignore:
Timestamp:
Jul 15, 2019 3:29:37 PM (5 years ago)
Author:
suehring
Message:

Bugfix in opening the parameter file (unit 11) in case of ocean precursor runs

File:
1 edited

Legend:

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

    r4069 r4099  
    2525! -----------------
    2626! $Id$
     27! Bugfix in opening the parameter file (unit 11) in case of ocean precursor
     28! runs.
     29!
     30! 4069 2019-07-01 14:05:51Z Giersch
    2731! Masked output running index mid has been introduced as a local variable to
    2832! avoid runtime error (Loop variable has been modified) in time_integration
     
    233237    INTEGER(iwp) ::  mid         !< masked output running index
    234238   
     239    LOGICAL ::  file_exist       !< file check
    235240    LOGICAL ::  netcdf_extend    !<
    236241
     
    311316
    312317       CASE ( 11 )
    313 
    314           OPEN ( 11, FILE='PARIN'//TRIM( coupling_char ), FORM='FORMATTED',    &
    315                      STATUS='OLD' )
     318!
     319!--       Read the parameter file. Therefore, inquire whether the file exist or
     320!--       not. This is required for the ocean-atmoshere coupling. For an ocean
     321!--       precursor run palmrun provides a PARIN_O file instead of a PARIN
     322!--       file. Actually this should be considered in coupling_char, however,
     323!--       in pmc_init the parameter file is already opened to read the
     324!--       nesting parameters and decide whether it is a nested run or not,
     325!--       but coupling_char is still not set at that moment (must be set after
     326!-        the nesting setup is read).
     327!--       This, however, leads to the situation that for ocean
     328!--       precursor runs PARIN is not available and the run crashes. Thus,
     329!--       if the file is not there, PARIN_O will be read. An ocean precursor
     330!--       run will be the only situation where this can happen.
     331          INQUIRE( FILE = 'PARIN' // TRIM( coupling_char ),                    &
     332                   EXIST = file_exist )
     333                   
     334          IF ( file_exist )  THEN
     335             filename = 'PARIN' // TRIM( coupling_char )
     336          ELSE
     337             filename = 'PARIN_O'
     338          ENDIF
     339
     340          OPEN ( 11, FILE= TRIM( filename ), FORM='FORMATTED', STATUS='OLD' )
    316341
    317342       CASE ( 13 )
Note: See TracChangeset for help on using the changeset viewer.