Changeset 11624
- Timestamp:
- 2019-10-01T15:07:45+02:00 (3 years ago)
- Location:
- NEMO/branches/2019/dev_r11613_ENHANCE-04_namelists_as_internalfiles/src
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
NEMO/branches/2019/dev_r11613_ENHANCE-04_namelists_as_internalfiles/src/ICE/icestp.F90
r11536 r11624 232 232 IF(lwp) WRITE(numout,*) '~~~~~~~~' 233 233 ! 234 ! ! Open the reference and configuration namelist files andnamelist output file235 CALL ctl_opn( numnam_ice_ref, 'namelist_ice_ref', 'OLD', 'FORMATTED', 'SEQUENTIAL', -1,numout, lwp )236 CALL ctl_opn( numnam_ice_cfg, 'namelist_ice_cfg', 'OLD', 'FORMATTED', 'SEQUENTIAL', -1,numout, lwp )237 IF(lwm) CALL ctl_opn( numoni , 'output.namelist.ice', 'UNKNOWN', 'FORMATTED', 'SEQUENTIAL', -1, numout, lwp, 1 )234 ! ! Load the reference and configuration namelist files and open namelist output file 235 CALL load_nml( numnam_ice_ref, 'namelist_ice_ref', numout, lwp ) 236 CALL load_nml( numnam_ice_cfg, 'namelist_ice_cfg', numout, lwp ) 237 IF(lwm) CALL ctl_opn( numoni , 'output.namelist.ice', 'UNKNOWN', 'FORMATTED', 'SEQUENTIAL', -1, numout, lwp, 1 ) 238 238 ! 239 239 CALL par_init ! set some ice run parameters … … 301 301 !!------------------------------------------------------------------- 302 302 ! 303 REWIND( numnam_ice_ref ) ! Namelist nampar in reference namelist : Parameters for ice304 303 READ ( numnam_ice_ref, nampar, IOSTAT = ios, ERR = 901) 305 304 901 IF( ios /= 0 ) CALL ctl_nam ( ios , 'nampar in reference namelist' ) 306 REWIND( numnam_ice_cfg ) ! Namelist nampar in configuration namelist : Parameters for ice307 305 READ ( numnam_ice_cfg, nampar, IOSTAT = ios, ERR = 902 ) 308 306 902 IF( ios > 0 ) CALL ctl_nam ( ios , 'nampar in configuration namelist' ) -
NEMO/branches/2019/dev_r11613_ENHANCE-04_namelists_as_internalfiles/src/OCE/IOM/in_out_manager.F90
r11536 r11624 139 139 INTEGER :: numnul = -1 !: logical unit for /dev/null 140 140 ! ! early output can be collected; do not change 141 INTEGER :: numnam_ref = -1 !: logical unit for reference namelist142 INTEGER :: numnam_cfg = -1 !: logical unit for configuration specific namelist143 141 INTEGER :: numond = -1 !: logical unit for Output Namelist Dynamics 144 INTEGER :: numnam_ice_ref = -1 !: logical unit for ice reference namelist145 INTEGER :: numnam_ice_cfg = -1 !: logical unit for ice reference namelist146 142 INTEGER :: numoni = -1 !: logical unit for Output Namelist Ice 147 143 INTEGER :: numevo_ice = -1 !: logical unit for ice variables (temp. evolution) 148 144 INTEGER :: numrun = -1 !: logical unit for run statistics 149 145 INTEGER :: numdct_in = -1 !: logical unit for transports computing 150 INTEGER :: numdct_vol = -1 !: logical unit for vo ulume transports output151 INTEGER :: numdct_heat = -1 !: logical unit for heat 152 INTEGER :: numdct_salt = -1 !: logical unit for salt 146 INTEGER :: numdct_vol = -1 !: logical unit for volume transports output 147 INTEGER :: numdct_heat = -1 !: logical unit for heat transports output 148 INTEGER :: numdct_salt = -1 !: logical unit for salt transports output 153 149 INTEGER :: numfl = -1 !: logical unit for floats ascii output 154 150 INTEGER :: numflo = -1 !: logical unit for floats ascii output 151 ! 152 CHARACTER(LEN=:), ALLOCATABLE :: numnam_ref !: character buffer for reference namelist 153 CHARACTER(LEN=:), ALLOCATABLE :: numnam_cfg !: character buffer for configuration specific namelist 154 CHARACTER(LEN=:), ALLOCATABLE :: numnam_ice_ref !: character buffer for ice reference namelist 155 CHARACTER(LEN=:), ALLOCATABLE :: numnam_ice_cfg !: character buffer for ice configuration specific namelist 155 156 156 157 !!---------------------------------------------------------------------- -
NEMO/branches/2019/dev_r11613_ENHANCE-04_namelists_as_internalfiles/src/OCE/LBC/lib_mpp.F90
r11536 r11624 32 32 !! ctl_opn : Open file and check if required file is available. 33 33 !! ctl_nam : Prints informations when an error occurs while reading a namelist 34 !! load_nml : Read, condense and buffer namelist file into character array for use as an internal file 34 35 !!---------------------------------------------------------------------- 35 36 !!---------------------------------------------------------------------- … … 57 58 PRIVATE 58 59 ! 59 PUBLIC ctl_stop, ctl_warn, ctl_opn, ctl_nam 60 PUBLIC ctl_stop, ctl_warn, ctl_opn, ctl_nam, load_nml 60 61 PUBLIC mpp_start, mppstop, mppsync, mpp_comm_free 61 62 PUBLIC mpp_ini_north … … 1068 1069 1069 1070 !!---------------------------------------------------------------------- 1070 !! ctl_stop, ctl_warn, get_unit, ctl_opn, ctl_nam routines1071 !! ctl_stop, ctl_warn, get_unit, ctl_opn, ctl_nam, load_nml routines 1071 1072 !!---------------------------------------------------------------------- 1072 1073 … … 1279 1280 END FUNCTION get_unit 1280 1281 1282 SUBROUTINE load_nml( cdnambuff , cdnamfile, kout, ldwp) 1283 CHARACTER(LEN=:) , ALLOCATABLE, INTENT(INOUT) :: cdnambuff 1284 CHARACTER(LEN=*), INTENT(IN ) :: cdnamfile 1285 CHARACTER(LEN=256) :: chline 1286 INTEGER, INTENT(IN) :: kout 1287 LOGICAL, INTENT(IN) :: ldwp 1288 INTEGER :: itot, iun, iltc, inl, ios 1289 ! 1290 ! Check if the namelist buffer has already been allocated. Return if it has. 1291 ! 1292 IF ( ALLOCATED( cdnambuff ) ) RETURN 1293 ! 1294 ! Open namelist file 1295 ! 1296 CALL ctl_opn( iun, cdnamfile, 'OLD', 'FORMATTED', 'SEQUENTIAL', -1, kout, ldwp ) 1297 ! 1298 ! First pass: count characters excluding comments and trimable white space 1299 ! 1300 itot=0 1301 10 READ(iun,'(A256)',END=20,ERR=20) chline 1302 iltc = LEN_TRIM(chline) 1303 IF ( iltc.GT.0 ) THEN 1304 inl = INDEX(chline, '!') 1305 IF( inl.eq.0 ) THEN 1306 itot = itot + iltc + 1 ! +1 for the newline character 1307 ELSEIF( inl.GT.0 .AND. LEN_TRIM( chline(1:inl-1) ).GT.0 ) THEN 1308 itot = itot + inl ! includes +1 for the newline character 1309 ENDIF 1310 ENDIF 1311 GOTO 10 1312 20 CONTINUE 1313 ! 1314 ! Allocate text cdnambuff for condensed namelist 1315 ! 1316 ALLOCATE( CHARACTER(LEN=itot) :: cdnambuff ) 1317 WRITE(*,*) 'ALLOCATED ', itot 1318 ! 1319 ! Second pass: read and transfer pruned characters into cdnambuff 1320 ! 1321 REWIND(iun) 1322 itot=1 1323 30 READ(iun,'(A256)',END=40,ERR=40) chline 1324 iltc = LEN_TRIM(chline) 1325 IF ( iltc.GT.0 ) THEN 1326 inl = INDEX(chline, '!') 1327 IF( inl.eq.0 ) THEN 1328 inl = iltc 1329 ELSE 1330 inl = inl - 1 1331 ENDIF 1332 IF( inl.GT.0 .AND. LEN_TRIM( chline(1:inl) ).GT.0 ) THEN 1333 cdnambuff(itot:itot+inl-1) = chline(1:inl) 1334 WRITE( cdnambuff(itot+inl:itot+inl), '(a)' ) NEW_LINE('A') 1335 itot = itot + inl + 1 1336 ENDIF 1337 ENDIF 1338 GOTO 30 1339 40 CONTINUE 1340 WRITE(*,*) 'ASSIGNED ',itot - 1 1341 ! 1342 ! Close namelist file 1343 ! 1344 CLOSE(iun) 1345 !write(*,'(32A)') cdnambuff 1346 END SUBROUTINE load_nml 1347 1348 1281 1349 !!---------------------------------------------------------------------- 1282 1350 END MODULE lib_mpp -
NEMO/branches/2019/dev_r11613_ENHANCE-04_namelists_as_internalfiles/src/OCE/nemogcm.F90
r11536 r11624 307 307 IF( lwm ) CALL ctl_opn( numout, 'ocean.output', 'REPLACE', 'FORMATTED', 'SEQUENTIAL', -1, -1, .FALSE. ) 308 308 ! open reference and configuration namelist files 309 CALL ctl_opn( numnam_ref, 'namelist_ref', 'OLD', 'FORMATTED', 'SEQUENTIAL', -1,-1, .FALSE. )310 CALL ctl_opn( numnam_cfg, 'namelist_cfg', 'OLD', 'FORMATTED', 'SEQUENTIAL', -1,-1, .FALSE. )309 CALL load_nml( numnam_ref, 'namelist_ref', -1, .FALSE. ) 310 CALL load_nml( numnam_cfg, 'namelist_cfg', -1, .FALSE. ) 311 311 IF( lwm ) CALL ctl_opn( numond, 'output.namelist.dyn', 'REPLACE', 'FORMATTED', 'SEQUENTIAL', -1, -1, .FALSE. ) 312 312 ! open /dev/null file to be able to supress output write easily … … 317 317 ! !--------------------! 318 318 ! 319 REWIND( numnam_ref ) ! Namelist namctl in reference namelist320 319 READ ( numnam_ref, namctl, IOSTAT = ios, ERR = 901 ) 321 320 901 IF( ios /= 0 ) CALL ctl_nam ( ios , 'namctl in reference namelist' ) 322 REWIND( numnam_cfg ) ! Namelist namctl in confguration namelist323 321 READ ( numnam_cfg, namctl, IOSTAT = ios, ERR = 902 ) 324 322 902 IF( ios > 0 ) CALL ctl_nam ( ios , 'namctl in configuration namelist' ) … … 375 373 ! !------------------------------------! 376 374 ! 377 REWIND( numnam_ref ) ! Namelist namcfg in reference namelist378 375 READ ( numnam_ref, namcfg, IOSTAT = ios, ERR = 903 ) 379 376 903 IF( ios /= 0 ) CALL ctl_nam ( ios , 'namcfg in reference namelist' ) 380 REWIND( numnam_cfg ) ! Namelist namcfg in confguration namelist381 377 READ ( numnam_cfg, namcfg, IOSTAT = ios, ERR = 904 ) 382 378 904 IF( ios > 0 ) CALL ctl_nam ( ios , 'namcfg in configuration namelist' ) … … 619 615 IF( numstp /= -1 ) CLOSE( numstp ) ! time-step file 620 616 IF( numrun /= -1 ) CLOSE( numrun ) ! run statistics file 621 IF( numnam_ref /= -1 ) CLOSE( numnam_ref ) ! oce reference namelist622 IF( numnam_cfg /= -1 ) CLOSE( numnam_cfg ) ! oce configuration namelist623 617 IF( lwm.AND.numond /= -1 ) CLOSE( numond ) ! oce output namelist 624 IF( numnam_ice_ref /= -1 ) CLOSE( numnam_ice_ref ) ! ice reference namelist625 IF( numnam_ice_cfg /= -1 ) CLOSE( numnam_ice_cfg ) ! ice configuration namelist626 618 IF( lwm.AND.numoni /= -1 ) CLOSE( numoni ) ! ice output namelist 627 619 IF( numevo_ice /= -1 ) CLOSE( numevo_ice ) ! ice variables (temp. evolution) -
NEMO/branches/2019/dev_r11613_ENHANCE-04_namelists_as_internalfiles/src/OFF/nemogcm.F90
r11536 r11624 192 192 IF( lwm ) CALL ctl_opn( numout, 'ocean.output', 'REPLACE', 'FORMATTED', 'SEQUENTIAL', -1, -1, .FALSE. ) 193 193 ! open reference and configuration namelist files 194 CALL ctl_opn( numnam_ref, 'namelist_ref', 'OLD', 'FORMATTED', 'SEQUENTIAL', -1,-1, .FALSE. )195 CALL ctl_opn( numnam_cfg, 'namelist_cfg', 'OLD', 'FORMATTED', 'SEQUENTIAL', -1,-1, .FALSE. )194 CALL load_nml( numnam_ref, 'namelist_ref', -1, .FALSE. ) 195 CALL load_nml( numnam_cfg, 'namelist_cfg', -1, .FALSE. ) 196 196 IF( lwm ) CALL ctl_opn( numond, 'output.namelist.dyn', 'REPLACE', 'FORMATTED', 'SEQUENTIAL', -1, -1, .FALSE. ) 197 197 ! open /dev/null file to be able to supress output write easily … … 202 202 ! !--------------------! 203 203 ! 204 REWIND( numnam_ref ) ! Namelist namctl in reference namelist205 204 READ ( numnam_ref, namctl, IOSTAT = ios, ERR = 901 ) 206 205 901 IF( ios /= 0 ) CALL ctl_nam ( ios , 'namctl in reference namelist' ) 207 REWIND( numnam_cfg ) ! Namelist namctl in confguration namelist208 206 READ ( numnam_cfg, namctl, IOSTAT = ios, ERR = 902 ) 209 207 902 IF( ios > 0 ) CALL ctl_nam ( ios , 'namctl in configuration namelist' ) … … 260 258 ! !------------------------------------! 261 259 ! 262 REWIND( numnam_ref ) ! Namelist namcfg in reference namelist263 260 READ ( numnam_ref, namcfg, IOSTAT = ios, ERR = 903 ) 264 261 903 IF( ios /= 0 ) CALL ctl_nam ( ios , 'namcfg in reference namelist' ) 265 REWIND( numnam_cfg ) ! Namelist namcfg in confguration namelist266 262 READ ( numnam_cfg, namcfg, IOSTAT = ios, ERR = 904 ) 267 263 904 IF( ios > 0 ) CALL ctl_nam ( ios , 'namcfg in configuration namelist' ) … … 446 442 ! 447 443 IF( numstp /= -1 ) CLOSE( numstp ) ! time-step file 448 IF( numnam_ref /= -1 ) CLOSE( numnam_ref ) ! oce reference namelist449 IF( numnam_cfg /= -1 ) CLOSE( numnam_cfg ) ! oce configuration namelist450 IF( numout /= 6 ) CLOSE( numout ) ! standard model output file451 444 IF( lwm.AND.numond /= -1 ) CLOSE( numond ) ! oce output namelist 452 445 ! -
NEMO/branches/2019/dev_r11613_ENHANCE-04_namelists_as_internalfiles/src/SAO/nemogcm.F90
r11536 r11624 135 135 IF( lwm ) CALL ctl_opn( numout, 'ocean.output', 'REPLACE', 'FORMATTED', 'SEQUENTIAL', -1, -1, .FALSE. ) 136 136 ! open reference and configuration namelist files 137 CALL ctl_opn( numnam_ref, 'namelist_ref', 'OLD', 'FORMATTED', 'SEQUENTIAL', -1,-1, .FALSE. )138 CALL ctl_opn( numnam_cfg, 'namelist_cfg', 'OLD', 'FORMATTED', 'SEQUENTIAL', -1,-1, .FALSE. )137 CALL load_nml( numnam_ref, 'namelist_ref', -1, .FALSE. ) 138 CALL load_nml( numnam_cfg, 'namelist_cfg', -1, .FALSE. ) 139 139 IF( lwm ) CALL ctl_opn( numond, 'output.namelist.dyn', 'REPLACE', 'FORMATTED', 'SEQUENTIAL', -1, -1, .FALSE. ) 140 140 ! open /dev/null file to be able to supress output write easily … … 145 145 ! !--------------------! 146 146 ! 147 REWIND( numnam_ref ) ! Namelist namctl in reference namelist148 147 READ ( numnam_ref, namctl, IOSTAT = ios, ERR = 901 ) 149 148 901 IF( ios /= 0 ) CALL ctl_nam ( ios , 'namctl in reference namelist' ) 150 REWIND( numnam_cfg ) ! Namelist namctl in confguration namelist151 149 READ ( numnam_cfg, namctl, IOSTAT = ios, ERR = 902 ) 152 150 902 IF( ios > 0 ) CALL ctl_nam ( ios , 'namctl in configuration namelist' ) … … 203 201 ! !------------------------------------! 204 202 ! 205 REWIND( numnam_ref ) ! Namelist namcfg in reference namelist206 203 READ ( numnam_ref, namcfg, IOSTAT = ios, ERR = 903 ) 207 204 903 IF( ios /= 0 ) CALL ctl_nam ( ios , 'namcfg in reference namelist' ) 208 REWIND( numnam_cfg ) ! Namelist namcfg in confguration namelist209 205 READ ( numnam_cfg, namcfg, IOSTAT = ios, ERR = 904 ) 210 206 904 IF( ios > 0 ) CALL ctl_nam ( ios , 'namcfg in configuration namelist' ) … … 363 359 IF( numstp /= -1 ) CLOSE( numstp ) ! time-step file 364 360 IF( numrun /= -1 ) CLOSE( numrun ) ! run statistics file 365 IF( numnam_ref /= -1 ) CLOSE( numnam_ref ) ! oce reference namelist366 IF( numnam_cfg /= -1 ) CLOSE( numnam_cfg ) ! oce configuration namelist367 361 IF( lwm.AND.numond /= -1 ) CLOSE( numond ) ! oce output namelist 368 IF( numnam_ice_ref /= -1 ) CLOSE( numnam_ice_ref ) ! ice reference namelist369 IF( numnam_ice_cfg /= -1 ) CLOSE( numnam_ice_cfg ) ! ice configuration namelist370 362 IF( lwm.AND.numoni /= -1 ) CLOSE( numoni ) ! ice output namelist 371 363 IF( numevo_ice /= -1 ) CLOSE( numevo_ice ) ! ice variables (temp. evolution) -
NEMO/branches/2019/dev_r11613_ENHANCE-04_namelists_as_internalfiles/src/SAS/nemogcm.F90
r11536 r11624 230 230 ! open ocean.output as soon as possible to get all output prints (including errors messages) 231 231 IF( lk_oasis ) THEN 232 IF( lwm ) CALL ctl_opn( numout, 'sas.output', 'REPLACE', 'FORMATTED', 'SEQUENTIAL', -1, -1, .FALSE. )232 IF( lwm ) CALL ctl_opn( numout, 'sas.output', 'REPLACE', 'FORMATTED', 'SEQUENTIAL', -1, -1, .FALSE. ) 233 233 ! open reference and configuration namelist files 234 CALL ctl_opn( numnam_ref, 'namelist_sas_ref', 'OLD', 'FORMATTED', 'SEQUENTIAL', -1,-1, .FALSE. )235 CALL ctl_opn( numnam_cfg, 'namelist_sas_cfg', 'OLD', 'FORMATTED', 'SEQUENTIAL', -1,-1, .FALSE. )236 IF( lwm ) CALL ctl_opn( numond, 'output.namelist_sas.dyn', 'REPLACE', 'FORMATTED', 'SEQUENTIAL', -1, -1, .FALSE. )234 CALL load_nml( numnam_ref, 'namelist_sas_ref', -1, .FALSE. ) 235 CALL load_nml( numnam_cfg, 'namelist_sas_cfg', -1, .FALSE. ) 236 IF( lwm ) CALL ctl_opn( numond, 'output.namelist_sas.dyn', 'REPLACE', 'FORMATTED', 'SEQUENTIAL', -1, -1, .FALSE. ) 237 237 ELSE 238 IF( lwm ) CALL ctl_opn( numout, 'ocean.output', 'REPLACE', 'FORMATTED', 'SEQUENTIAL', -1, -1, .FALSE. )238 IF( lwm ) CALL ctl_opn( numout, 'ocean.output', 'REPLACE', 'FORMATTED', 'SEQUENTIAL', -1, -1, .FALSE. ) 239 239 ! open reference and configuration namelist files 240 CALL ctl_opn( numnam_ref, 'namelist_ref', 'OLD', 'FORMATTED', 'SEQUENTIAL', -1,-1, .FALSE. )241 CALL ctl_opn( numnam_cfg, 'namelist_cfg', 'OLD', 'FORMATTED', 'SEQUENTIAL', -1,-1, .FALSE. )242 IF( lwm ) CALL ctl_opn( numond, 'output.namelist.dyn', 'REPLACE', 'FORMATTED', 'SEQUENTIAL', -1, -1, .FALSE. )240 CALL load_nml( numnam_ref, 'namelist_ref', -1, .FALSE. ) 241 CALL load_nml( numnam_cfg, 'namelist_cfg', -1, .FALSE. ) 242 IF( lwm ) CALL ctl_opn( numond, 'output.namelist.dyn', 'REPLACE', 'FORMATTED', 'SEQUENTIAL', -1, -1, .FALSE. ) 243 243 ENDIF 244 244 ! open /dev/null file to be able to supress output write easily … … 249 249 ! !--------------------! 250 250 ! 251 REWIND( numnam_ref ) ! Namelist namctl in reference namelist252 251 READ ( numnam_ref, namctl, IOSTAT = ios, ERR = 901 ) 253 252 901 IF( ios /= 0 ) CALL ctl_nam ( ios , 'namctl in reference namelist' ) 254 REWIND( numnam_cfg ) ! Namelist namctl in confguration namelist255 253 READ ( numnam_cfg, namctl, IOSTAT = ios, ERR = 902 ) 256 254 902 IF( ios > 0 ) CALL ctl_nam ( ios , 'namctl in configuration namelist' ) … … 311 309 ! !------------------------------------! 312 310 ! 313 REWIND( numnam_ref ) ! Namelist namcfg in reference namelist314 311 READ ( numnam_ref, namcfg, IOSTAT = ios, ERR = 903 ) 315 312 903 IF( ios /= 0 ) CALL ctl_nam ( ios , 'namcfg in reference namelist' ) 316 REWIND( numnam_cfg ) ! Namelist namcfg in confguration namelist317 313 READ ( numnam_cfg, namcfg, IOSTAT = ios, ERR = 904 ) 318 314 904 IF( ios > 0 ) CALL ctl_nam ( ios , 'namcfg in configuration namelist' ) … … 489 485 IF( numstp /= -1 ) CLOSE( numstp ) ! time-step file 490 486 IF( numrun /= -1 ) CLOSE( numrun ) ! run statistics file 491 IF( numnam_ref /= -1 ) CLOSE( numnam_ref ) ! oce reference namelist492 IF( numnam_cfg /= -1 ) CLOSE( numnam_cfg ) ! oce configuration namelist493 487 IF( lwm.AND.numond /= -1 ) CLOSE( numond ) ! oce output namelist 494 IF( numnam_ice_ref /= -1 ) CLOSE( numnam_ice_ref ) ! ice reference namelist495 IF( numnam_ice_cfg /= -1 ) CLOSE( numnam_ice_cfg ) ! ice configuration namelist496 488 IF( lwm.AND.numoni /= -1 ) CLOSE( numoni ) ! ice output namelist 497 489 IF( numevo_ice /= -1 ) CLOSE( numevo_ice ) ! ice variables (temp. evolution) -
NEMO/branches/2019/dev_r11613_ENHANCE-04_namelists_as_internalfiles/src/TOP/PISCES/SED/sedini.F90
r11536 r11624 406 406 !!---------------------------------------------------------------------- 407 407 408 INTEGER :: numnamsed_ref = -1 !! Logical units fornamelist sediment409 INTEGER :: numnamsed_cfg = -1 !! Logical units fornamelist sediment408 CHARACTER(:), ALLOCATABLE :: numnamsed_ref !! Character buffer for reference namelist sediment 409 CHARACTER(:), ALLOCATABLE :: numnamsed_cfg !! Character buffer for configuration namelist sediment 410 410 INTEGER :: ios ! Local integer output status for namelist read 411 411 CHARACTER(LEN=20) :: clname … … 452 452 IF(lwp) WRITE(numsed,*) ' sed_init_nam : read SEDIMENT namelist' 453 453 IF(lwp) WRITE(numsed,*) ' ~~~~~~~~~~~~~~' 454 CALL ctl_opn( numnamsed_ref, TRIM( clname )//'_ref', 'OLD' , 'FORMATTED', 'SEQUENTIAL', -1, numout, .FALSE. )455 CALL ctl_opn( numnamsed_cfg, TRIM( clname )//'_cfg', 'OLD' , 'FORMATTED', 'SEQUENTIAL', -1, numout, .FALSE. )454 CALL load_nml( numnamsed_ref, TRIM( clname )//'_ref', numout, .FALSE. ) 455 CALL load_nml( numnamsed_cfg, TRIM( clname )//'_cfg', numout, .FALSE. ) 456 456 457 457 nitsed000 = nittrc000 458 458 nitsedend = nitend 459 459 ! Namelist nam_run 460 REWIND( numnamsed_ref ) ! Namelist nam_run in reference namelist : Pisces variables461 460 READ ( numnamsed_ref, nam_run, IOSTAT = ios, ERR = 901) 462 461 901 IF( ios /= 0 ) CALL ctl_nam ( ios , 'nam_run in reference namelist' ) 463 462 464 REWIND( numnamsed_cfg ) ! Namelist nam_run in reference namelist : Pisces variables465 463 READ ( numnamsed_cfg, nam_run, IOSTAT = ios, ERR = 902) 466 464 902 IF( ios /= 0 ) CALL ctl_nam ( ios , 'nam_run in configuration namelist' ) … … 474 472 IF ( ln_p5z .AND. ln_sed_2way ) CALL ctl_stop( '2 ways coupling with sediment cannot be activated with PISCES-QUOTA' ) 475 473 476 REWIND( numnamsed_ref ) ! Namelist nam_geom in reference namelist : Pisces variables477 474 READ ( numnamsed_ref, nam_geom, IOSTAT = ios, ERR = 903) 478 475 903 IF( ios /= 0 ) CALL ctl_nam ( ios , 'nam_geom in reference namelist' ) 479 476 480 REWIND( numnamsed_cfg ) ! Namelist nam_geom in reference namelist : Pisces variables481 477 READ ( numnamsed_cfg, nam_geom, IOSTAT = ios, ERR = 904) 482 478 904 IF( ios /= 0 ) CALL ctl_nam ( ios , 'nam_geom in configuration namelist' ) … … 497 493 dtsed = r2dttrc 498 494 499 REWIND( numnamsed_ref ) ! Namelist nam_trased in reference namelist : Pisces variables500 495 READ ( numnamsed_ref, nam_trased, IOSTAT = ios, ERR = 905) 501 496 905 IF( ios /= 0 ) CALL ctl_nam ( ios , 'nam_trased in reference namelist' ) 502 497 503 REWIND( numnamsed_cfg ) ! Namelist nam_trased in reference namelist : Pisces variables504 498 READ ( numnamsed_cfg, nam_trased, IOSTAT = ios, ERR = 906) 505 499 906 IF( ios /= 0 ) CALL ctl_nam ( ios , 'nam_trased in configuration namelist' ) … … 530 524 ENDIF 531 525 532 REWIND( numnamsed_ref ) ! Namelist nam_diased in reference namelist : Pisces variables533 526 READ ( numnamsed_ref, nam_diased, IOSTAT = ios, ERR = 907) 534 527 907 IF( ios /= 0 ) CALL ctl_nam ( ios , 'nam_diased in reference namelist' ) 535 528 536 REWIND( numnamsed_cfg ) ! Namelist nam_diased in reference namelist : Pisces variables537 529 READ ( numnamsed_cfg, nam_diased, IOSTAT = ios, ERR = 908) 538 530 908 IF( ios /= 0 ) CALL ctl_nam ( ios , 'nam_diased in configuration namelist' ) … … 572 564 ! Inorganic chemistry parameters 573 565 !---------------------------------- 574 REWIND( numnamsed_ref ) ! Namelist nam_inorg in reference namelist : Pisces variables575 566 READ ( numnamsed_ref, nam_inorg, IOSTAT = ios, ERR = 909) 576 567 909 IF( ios /= 0 ) CALL ctl_nam ( ios , 'nam_inorg in reference namelist' ) 577 568 578 REWIND( numnamsed_cfg ) ! Namelist nam_inorg in reference namelist : Pisces variables579 569 READ ( numnamsed_cfg, nam_inorg, IOSTAT = ios, ERR = 910) 580 570 910 IF( ios /= 0 ) CALL ctl_nam ( ios , 'nam_inorg in configuration namelist' ) … … 598 588 ! Additional parameter linked to POC/O2/No3/Po4 599 589 !---------------------------------------------- 600 REWIND( numnamsed_ref ) ! Namelist nam_poc in reference namelist : Pisces variables601 590 READ ( numnamsed_ref, nam_poc, IOSTAT = ios, ERR = 911) 602 591 911 IF( ios /= 0 ) CALL ctl_nam ( ios , 'nam_poc in reference namelist' ) 603 592 604 REWIND( numnamsed_cfg ) ! Namelist nam_poc in reference namelist : Pisces variables605 593 READ ( numnamsed_cfg, nam_poc, IOSTAT = ios, ERR = 912) 606 594 912 IF( ios /= 0 ) CALL ctl_nam ( ios , 'nam_poc in configuration namelist' ) … … 650 638 ! Bioturbation parameter 651 639 !------------------------ 652 REWIND( numnamsed_ref ) ! Namelist nam_btb in reference namelist : Pisces variables653 640 READ ( numnamsed_ref, nam_btb, IOSTAT = ios, ERR = 913) 654 641 913 IF( ios /= 0 ) CALL ctl_nam ( ios , 'nam_btb in reference namelist' ) 655 642 656 REWIND( numnamsed_cfg ) ! Namelist nam_btb in reference namelist : Pisces variables657 643 READ ( numnamsed_cfg, nam_btb, IOSTAT = ios, ERR = 914) 658 644 914 IF( ios /= 0 ) CALL ctl_nam ( ios , 'nam_btb in configuration namelist' ) … … 671 657 ! Initial value (t=0) for sediment pore water and solid components 672 658 !---------------------------------------------------------------- 673 REWIND( numnamsed_ref ) ! Namelist nam_rst in reference namelist : Pisces variables674 659 READ ( numnamsed_ref, nam_rst, IOSTAT = ios, ERR = 915) 675 660 915 IF( ios /= 0 ) CALL ctl_nam ( ios , 'nam_rst in reference namelist' ) 676 661 677 REWIND( numnamsed_cfg ) ! Namelist nam_rst in reference namelist : Pisces variables678 662 READ ( numnamsed_cfg, nam_rst, IOSTAT = ios, ERR = 916) 679 663 916 IF( ios /= 0 ) CALL ctl_nam ( ios , 'nam_rst in configuration namelist' ) … … 686 670 nn_dtsed = nn_dttrc 687 671 688 CLOSE( numnamsed_cfg )689 CLOSE( numnamsed_ref )690 672 691 673 END SUBROUTINE sed_init_nam -
NEMO/branches/2019/dev_r11613_ENHANCE-04_namelists_as_internalfiles/src/TOP/PISCES/sms_pisces.F90
r10788 r11624 13 13 PUBLIC 14 14 15 INTEGER :: numnatp_ref = -1 !! Logical units fornamelist pisces16 INTEGER :: numnatp_cfg = -1 !! Logical units fornamelist pisces17 INTEGER :: numonp = -1 !! Logical unit for namelist pisces output15 CHARACTER(:), ALLOCATABLE :: numnatp_ref !! Character buffer for reference namelist pisces 16 CHARACTER(:), ALLOCATABLE :: numnatp_cfg !! Character buffer for configuration namelist pisces 17 INTEGER :: numonp = -1 !! Logical unit for namelist pisces output 18 18 19 19 ! !: PISCES : silicon dependant half saturation -
NEMO/branches/2019/dev_r11613_ENHANCE-04_namelists_as_internalfiles/src/TOP/PISCES/trcnam_pisces.F90
r11536 r11624 51 51 IF(lwp) WRITE(numout,*) 'trc_nam_pisces : read PISCES namelist' 52 52 IF(lwp) WRITE(numout,*) '~~~~~~~~~~~~~~' 53 CALL ctl_opn( numnatp_ref, TRIM( clname )//'_ref', 'OLD' , 'FORMATTED', 'SEQUENTIAL', -1, numout, .FALSE. )54 CALL ctl_opn( numnatp_cfg, TRIM( clname )//'_cfg', 'OLD' , 'FORMATTED', 'SEQUENTIAL', -1, numout, .FALSE. )53 CALL load_nml( numnatp_ref, TRIM( clname )//'_ref', numout, .FALSE. ) 54 CALL load_nml( numnatp_cfg, TRIM( clname )//'_cfg', numout, .FALSE. ) 55 55 IF(lwm) CALL ctl_opn( numonp , 'output.namelist.pis' , 'UNKNOWN', 'FORMATTED', 'SEQUENTIAL', -1, numout, .FALSE. ) 56 56 ! 57 REWIND( numnatp_ref ) ! Namelist nampisbio in reference namelist : Pisces variables58 57 READ ( numnatp_ref, nampismod, IOSTAT = ios, ERR = 901) 59 58 901 IF( ios /= 0 ) CALL ctl_nam ( ios , 'nampismod in reference namelist' ) 60 REWIND( numnatp_cfg ) ! Namelist nampisbio in configuration namelist : Pisces variables61 59 READ ( numnatp_cfg, nampismod, IOSTAT = ios, ERR = 902 ) 62 60 902 IF( ios > 0 ) CALL ctl_nam ( ios , 'nampismod in configuration namelist' ) -
NEMO/branches/2019/dev_r11613_ENHANCE-04_namelists_as_internalfiles/src/TOP/trc.F90
r10425 r11624 18 18 19 19 ! !!- logical units of passive tracers 20 INTEGER, PUBLIC :: numnat_ref = -1 !: reference passive tracer namelist_top_ref21 INTEGER, PUBLIC :: numnat_cfg = -1 !: reference passive tracer namelist_top_cfg22 20 INTEGER, PUBLIC :: numont = -1 !: reference passive tracer namelist output output.namelist.top 23 INTEGER, PUBLIC :: numtrc_ref = -1 !: reference passive tracer namelist_top_ref24 INTEGER, PUBLIC :: numtrc_cfg = -1 !: reference passive tracer namelist_top_cfg25 21 INTEGER, PUBLIC :: numonr = -1 !: reference passive tracer namelist output output.namelist.top 26 22 INTEGER, PUBLIC :: numstr !: tracer statistics 27 23 INTEGER, PUBLIC :: numrtr !: trc restart (read ) 28 24 INTEGER, PUBLIC :: numrtw !: trc restart ( write ) 25 CHARACTER(:), ALLOCATABLE, PUBLIC :: numnat_ref !: character buffer for reference passive tracer namelist_top_ref 26 CHARACTER(:), ALLOCATABLE, PUBLIC :: numnat_cfg !: character buffer for configuration specific passive tracer namelist_top_cfg 27 CHARACTER(:), ALLOCATABLE, PUBLIC :: numtrc_ref !: character buffer for reference passive tracer namelist_trc_ref 28 CHARACTER(:), ALLOCATABLE, PUBLIC :: numtrc_cfg !: character buffer for configuration specific passive tracer namelist_trc_cfg 29 29 30 30 !! passive tracers fields (before,now,after) -
NEMO/branches/2019/dev_r11613_ENHANCE-04_namelists_as_internalfiles/src/TOP/trcnam.F90
r11536 r11624 108 108 IF(lwp) WRITE(numout,*) '~~~~~~~~~~~' 109 109 ! 110 CALL ctl_opn( numnat_ref, 'namelist_top_ref' , 'OLD' , 'FORMATTED', 'SEQUENTIAL', -1, numout, .FALSE. )111 CALL ctl_opn( numnat_cfg, 'namelist_top_cfg' , 'OLD' , 'FORMATTED', 'SEQUENTIAL', -1, numout, .FALSE. )110 CALL load_nml( numnat_ref, 'namelist_top_ref' , numout, .FALSE. ) 111 CALL load_nml( numnat_cfg, 'namelist_top_cfg' , numout, .FALSE. ) 112 112 IF(lwm) CALL ctl_opn( numont, 'output.namelist.top', 'UNKNOWN', 'FORMATTED', 'SEQUENTIAL', -1, numout, .FALSE., 1 ) 113 113 ! 114 REWIND( numnat_ref ) ! Namelist namtrc in reference namelist : Passive tracer variables115 114 READ ( numnat_ref, namtrc_run, IOSTAT = ios, ERR = 901) 116 115 901 IF( ios /= 0 ) CALL ctl_nam ( ios , 'namtrc in reference namelist' ) 117 REWIND( numnat_cfg ) ! Namelist namtrc in configuration namelist : Passive tracer variables118 116 READ ( numnat_cfg, namtrc_run, IOSTAT = ios, ERR = 902 ) 119 117 902 IF( ios > 0 ) CALL ctl_nam ( ios , 'namtrc in configuration namelist' ) … … 158 156 IF(lwp) WRITE(numout,*) '~~~~~~~~~~~' 159 157 160 REWIND( numnat_ref ) ! Namelist namtrc in reference namelist : Passive tracer variables161 158 READ ( numnat_ref, namtrc, IOSTAT = ios, ERR = 901) 162 159 901 IF( ios /= 0 ) CALL ctl_nam ( ios , 'namtrc in reference namelist' ) 163 REWIND( numnat_cfg ) ! Namelist namtrc in configuration namelist : Passive tracer variables164 160 READ ( numnat_cfg, namtrc, IOSTAT = ios, ERR = 902 ) 165 161 902 IF( ios > 0 ) CALL ctl_nam ( ios , 'namtrc in configuration namelist' ) … … 228 224 IF( ll_cfc .OR. ln_c14 ) THEN 229 225 ! ! Open namelist files 230 CALL ctl_opn( numtrc_ref, 'namelist_trc_ref' , 'OLD', 'FORMATTED', 'SEQUENTIAL', -1, numout, .FALSE. )231 CALL ctl_opn( numtrc_cfg, 'namelist_trc_cfg' , 'OLD', 'FORMATTED', 'SEQUENTIAL', -1, numout, .FALSE. )226 CALL load_nml( numtrc_ref, 'namelist_trc_ref' , numout, .FALSE. ) 227 CALL load_nml( numtrc_cfg, 'namelist_trc_cfg' , numout, .FALSE. ) 232 228 IF(lwm) CALL ctl_opn( numonr, 'output.namelist.trc', 'UNKNOWN', 'FORMATTED', 'SEQUENTIAL', -1, numout, .FALSE. ) 233 229 ! … … 261 257 ALLOCATE( ln_trdtrc(jptra) ) 262 258 ! 263 REWIND( numnat_ref ) ! Namelist namtrc_trd in reference namelist : Passive tracer trends264 259 READ ( numnat_ref, namtrc_trd, IOSTAT = ios, ERR = 905) 265 260 905 IF( ios /= 0 ) CALL ctl_nam ( ios , 'namtrc_trd in reference namelist' ) 266 REWIND( numnat_cfg ) ! Namelist namtrc_trd in configuration namelist : Passive tracer trends267 261 READ ( numnat_cfg, namtrc_trd, IOSTAT = ios, ERR = 906 ) 268 262 906 IF( ios > 0 ) CALL ctl_nam ( ios , 'namtrc_trd in configuration namelist' )
Note: See TracChangeset
for help on using the changeset viewer.