Changeset 4822 for palm/trunk/SOURCE/biometeorology_mod.f90
- Timestamp:
- Dec 11, 2020 2:18:43 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
palm/trunk/SOURCE/biometeorology_mod.f90
r4807 r4822 26 26 ! ----------------- 27 27 ! $Id$ 28 ! reading of namelist file and actions in case of namelist errors revised so that statement labels 29 ! and goto statements are not required any more 30 ! 31 ! 4807 2020-12-02 21:02:28Z gronemeier 28 32 ! Add checks for setup of UV exposure (only workaround!); corrected formatting errors. 29 33 ! … … 1383 1387 ! 1384 1388 !-- Internal variables 1385 CHARACTER (LEN=80) :: line !< Dummy string for current line in parameter file 1389 CHARACTER (LEN=100) :: line !< Dummy string for current line in parameter file 1390 1391 INTEGER(iwp) :: io_status !< Status after reading the namelist file 1386 1392 1387 1393 NAMELIST /biometeorology_parameters/ clothing, & … … 1393 1399 uv_exposure 1394 1400 1395 1396 !-- Try to find biometeorology_parameters namelist 1397 REWIND ( 11 ) 1398 line = ' ' 1399 DO WHILE ( INDEX( line, '&biometeorology_parameters' ) == 0 ) 1400 READ ( 11, '(A)', END = 20 ) line 1401 ENDDO 1402 BACKSPACE ( 11 ) 1403 1404 ! 1405 !-- Read biometeorology_parameters namelist 1406 READ ( 11, biometeorology_parameters, ERR = 10, END = 20 ) 1407 1408 ! 1409 !-- Set flag that indicates that the biomet_module is switched on 1410 biometeorology = .TRUE. 1411 1412 GOTO 20 1413 1414 ! 1415 !-- In case of error 1416 10 BACKSPACE( 11 ) 1417 READ( 11 , '(A)') line 1418 CALL parin_fail_message( 'biometeorology_parameters', line ) 1419 1420 ! 1421 !-- Complete 1422 20 CONTINUE 1423 1401 ! 1402 !-- Move to the beginning of the namelist file and try to find and read the namelist named 1403 !-- biometeorology_parameters. 1404 REWIND( 11 ) 1405 READ( 11, biometeorology_parameters, IOSTAT=io_status ) 1406 ! 1407 !-- Action depending on the READ status 1408 IF ( io_status == 0 ) THEN 1409 ! 1410 !-- biometeorology_parameters namelist was found and read correctly. Set flag that 1411 !-- biometeorology_mod is switched on. 1412 biometeorology = .TRUE. 1413 1414 ELSEIF ( io_status > 0 ) THEN 1415 ! 1416 !-- biometeorology_parameters namelist was found, but contained errors. Print an error message 1417 !-- containing the line that caused the problem. 1418 BACKSPACE( 11 ) 1419 READ( 11 , '(A)') line 1420 CALL parin_fail_message( 'biometeorology_parameters', line ) 1421 1422 ENDIF 1424 1423 1425 1424 END SUBROUTINE bio_parin 1425 1426 1426 1427 1427 !--------------------------------------------------------------------------------------------------!
Note: See TracChangeset
for help on using the changeset viewer.