- Timestamp:
- 2016-11-06T17:31:33+01:00 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2016/dev_r6409_SIMPLIF_2_usrdef/NEMOGCM/NEMO/OPA_SRC/nemogcm.F90
r7188 r7200 46 46 !!---------------------------------------------------------------------- 47 47 USE step_oce ! module used in the ocean time stepping module (step.F90) 48 USE mppini ! shared/distributed memory setting (mpp_init routine) 49 USE domain ! domain initialization (dom_init routine) 50 #if defined key_nemocice_decomp 51 USE ice_domain_size, only: nx_global, ny_global 52 #endif 48 USE phycst ! physical constant (par_cst routine) 49 USE domain ! domain initialization (dom_init & dom_cfg routines) 50 USE usrdef_nam ! user defined configuration 53 51 USE tideini ! tidal components initialization (tide_ini routine) 54 52 USE bdyini ! open boundary cond. setting (bdy_init routine) … … 60 58 USE ldftra ! lateral diffusivity setting (ldftra_init routine) 61 59 USE zdfini ! vertical physics setting (zdf_init routine) 62 USE phycst ! physical constant (par_cst routine)63 60 USE trdini ! dyn/tra trends initialization (trd_init routine) 64 61 USE asminc ! assimilation increments … … 68 65 USE diaobs ! Observation diagnostics (dia_obs_init routine) 69 66 USE diacfl ! CFL diagnostics (dia_cfl_init routine) 70 USE lib_fortran ! Fortran utilities (allows no signed zero when 'key_nosignedzero' defined)71 67 USE step ! NEMO time-stepping (stp routine) 72 68 USE icbini ! handle bergs, initialisation … … 78 74 USE stopar ! Stochastic param.: ??? 79 75 USE stopts ! Stochastic param.: ??? 76 USE diurnal_bulk ! diurnal bulk SST 77 USE step_diu ! diurnal bulk SST timestepping (called from here if run offline) 78 USE crsini ! initialise grid coarsening utility 79 USE diatmb ! Top,middle,bottom output 80 USE dia25h ! 25h mean output 81 USE sbc_oce , ONLY : lk_oasis 82 USE wet_dry ! Wetting and drying setting (wad_init routine) 80 83 #if defined key_top 81 84 USE trcini ! passive tracer initialisation 82 85 #endif 86 #if defined key_nemocice_decomp 87 USE ice_domain_size, only: nx_global, ny_global 88 #endif 89 ! 83 90 USE lib_mpp ! distributed memory computing 84 USE diurnal_bulk ! diurnal bulk SST 85 USE step_diu ! diurnal bulk SST timestepping (called from here if run offline) 91 USE mppini ! shared/distributed memory setting (mpp_init routine) 92 USE lbcnfd , ONLY : isendto, nsndto, nfsloop, nfeloop ! Setup of north fold exchanges 93 USE lib_fortran ! Fortran utilities (allows no signed zero when 'key_nosignedzero' defined) 86 94 #if defined key_iomput 87 95 USE xios ! xIOserver 88 96 #endif 89 USE crsini ! initialise grid coarsening utility90 USE lbcnfd , ONLY : isendto, nsndto, nfsloop, nfeloop ! Setup of north fold exchanges91 USE sbc_oce, ONLY : lk_oasis92 USE diatmb ! Top,middle,bottom output93 USE dia25h ! 25h mean output94 USE wet_dry ! Wetting and drying setting (wad_init routine)95 USE usrdef_nam ! user defined configuration96 97 97 98 IMPLICIT NONE … … 125 126 !! Madec, 2008, internal report, IPSL. 126 127 !!---------------------------------------------------------------------- 127 INTEGER :: istp 128 INTEGER :: istp ! time step index 128 129 !!---------------------------------------------------------------------- 129 130 ! … … 196 197 ! !== finalize the run ==! 197 198 ! !------------------------! 198 IF(lwp) WRITE(numout,cform_aaa) ! Flag AAAAAAA199 ! 200 IF( nstop /= 0 .AND. lwp ) THEN ! error print199 IF(lwp) WRITE(numout,cform_aaa) ! Flag AAAAAAA 200 ! 201 IF( nstop /= 0 .AND. lwp ) THEN ! error print 201 202 WRITE(numout,cform_err) 202 203 WRITE(numout,*) nstop, ' error have been found' … … 216 217 ! 217 218 #if defined key_iomput 218 CALL xios_finalize ! end mpp communications with xios219 IF( lk_oasis ) CALL cpl_finalize ! end coupling and mpp communications with OASIS219 CALL xios_finalize ! end mpp communications with xios 220 IF( lk_oasis ) CALL cpl_finalize ! end coupling and mpp communications with OASIS 220 221 #else 221 222 IF( lk_oasis ) THEN 222 CALL cpl_finalize ! end coupling and mpp communications with OASIS223 CALL cpl_finalize ! end coupling and mpp communications with OASIS 223 224 ELSE 224 IF( lk_mpp ) CALL mppstop ! end mpp communications225 IF( lk_mpp ) CALL mppstop ! end mpp communications 225 226 ENDIF 226 227 #endif … … 235 236 !! ** Purpose : initialization of the NEMO GCM 236 237 !!---------------------------------------------------------------------- 237 INTEGER :: ji ! dummy loop indices 238 INTEGER :: ilocal_comm ! local integer 239 INTEGER :: ios, inum ! - - 240 REAL(wp) :: ziglo, zjglo, zkglo, zperio ! local scalars 238 INTEGER :: ji ! dummy loop indices 239 INTEGER :: ios, ilocal_comm ! local integer 241 240 CHARACTER(len=120), DIMENSION(30) :: cltxt, cltxt2, clnam 242 241 ! … … 244 243 & nn_isplt , nn_jsplt, nn_jctls, nn_jctle, & 245 244 & nn_timing, nn_diacfl 246 NAMELIST/namcfg/ ln_read_cfg, ln_write_cfg, cp_cfg, jp_cfg, ln_use_jattr245 NAMELIST/namcfg/ ln_read_cfg, cn_domcfg, ln_write_cfg, cn_domcfg_out, ln_use_jattr 247 246 !!---------------------------------------------------------------------- 248 247 ! … … 260 259 901 IF( ios /= 0 ) CALL ctl_nam ( ios , 'namctl in reference namelist', .TRUE. ) 261 260 ! 262 REWIND( numnam_cfg ) ! Namelist namctl in confguration namelist : Control prints261 REWIND( numnam_cfg ) ! Namelist namctl in confguration namelist 263 262 READ ( numnam_cfg, namctl, IOSTAT = ios, ERR = 902 ) 264 263 902 IF( ios /= 0 ) CALL ctl_nam ( ios , 'namctl in configuration namelist', .TRUE. ) 265 264 ! 266 REWIND( numnam_ref ) ! Namelist namcfg in reference namelist 265 REWIND( numnam_ref ) ! Namelist namcfg in reference namelist : Control prints 267 266 READ ( numnam_ref, namcfg, IOSTAT = ios, ERR = 903 ) 268 267 903 IF( ios /= 0 ) CALL ctl_nam ( ios , 'namcfg in reference namelist', .TRUE. ) 269 ! 270 REWIND( numnam_cfg ) ! Namelist namcfg in confguration namelist 268 269 REWIND( numnam_cfg ) ! Namelist namcfg in confguration namelist : Control prints & Benchmark 271 270 READ ( numnam_cfg, namcfg, IOSTAT = ios, ERR = 904 ) 272 271 904 IF( ios /= 0 ) CALL ctl_nam ( ios , 'namcfg in configuration namelist', .TRUE. ) … … 275 274 ! ! Set global domain size ! (control print return in cltxt2) 276 275 ! !--------------------------! 277 IF( ln_read_cfg ) THEN ! Read sizes in configuration "domain_cfg" file 278 CALL iom_open( 'domain_cfg', inum ) 279 CALL iom_get( inum, 'jpiglo', ziglo ) ; jpiglo = INT( ziglo ) 280 CALL iom_get( inum, 'jpjglo', zjglo ) ; jpjglo = INT( zjglo ) 281 CALL iom_get( inum, 'jpkglo', zkglo ) ; jpkglo = INT( zkglo ) 282 CALL iom_get( inum, 'jperio', zperio ) ; jperio = INT( zperio ) 283 CALL iom_close( inum ) 284 WRITE(cltxt2(1),*) ' ' 285 WRITE(cltxt2(2),*) 'domain_cfg : domain size read in "domain_cfg" file ' 286 WRITE(cltxt2(3),*) '~~~~~~~~~~ ' 287 WRITE(cltxt2(4),*) ' jpiglo = ', jpiglo, ' jpjglo = ', jpjglo, ' jpkglo = ', jpkglo 288 WRITE(cltxt2(5),*) ' global domain type of lateral boundary jperio = ', jperio 289 ! 276 IF( ln_read_cfg ) THEN ! Read sizes in domain configuration file 277 CALL domain_cfg ( cltxt2, clnam, cn_cfg, nn_cfg, jpiglo, jpjglo, jpkglo, jperio ) 278 ! 290 279 ELSE ! user-defined namelist 291 CALL usr_def_nam( cltxt2, clnam, jpiglo, jpjglo, jpkglo, jperio ) 292 ENDIF 293 jpk = jpkglo 280 CALL usr_def_nam( cltxt2, clnam, cn_cfg, nn_cfg, jpiglo, jpjglo, jpkglo, jperio ) 281 ENDIF 282 ! 283 jpk = jpkglo 294 284 ! 295 285 #if defined key_agrif … … 313 303 IF( Agrif_Root() ) THEN 314 304 IF( lk_oasis ) THEN 315 CALL cpl_init( "oceanx", ilocal_comm ) ! nemo local communicator given by oasis316 CALL xios_initialize( "not used" ,local_comm=ilocal_comm ) ! send nemo communicator to xios305 CALL cpl_init( "oceanx", ilocal_comm ) ! nemo local communicator given by oasis 306 CALL xios_initialize( "not used" ,local_comm= ilocal_comm ) ! send nemo communicator to xios 317 307 ELSE 318 308 CALL xios_initialize( "for_xios_mpi_id",return_comm=ilocal_comm ) ! nemo local communicator given by xios … … 324 314 IF( lk_oasis ) THEN 325 315 IF( Agrif_Root() ) THEN 326 CALL cpl_init( "oceanx", ilocal_comm ) 316 CALL cpl_init( "oceanx", ilocal_comm ) ! nemo local communicator given by oasis 327 317 ENDIF 328 318 ! Nodes selection (control print return in cltxt) 329 319 narea = mynode( cltxt, 'output.namelist.dyn', numnam_ref, numnam_cfg, numond , nstop, ilocal_comm ) 330 320 ELSE 331 ilocal_comm = 0 332 ! Nodes selection (control print return in cltxt) 321 ilocal_comm = 0 ! Nodes selection (control print return in cltxt) 333 322 narea = mynode( cltxt, 'output.namelist.dyn', numnam_ref, numnam_cfg, numond , nstop ) 334 323 ENDIF … … 340 329 lwp = (narea == 1) .OR. ln_ctl ! control of all listing output print 341 330 342 IF(lwm) THEN 343 ! write merged namelists from earlier to output namelist now that the 344 ! file has been opened in call to mynode. nammpp has already been 345 ! written in mynode (if lk_mpp_mpi) 331 IF(lwm) THEN ! write merged namelists from earlier to output namelist 332 ! ! now that the file has been opened in call to mynode. 333 ! ! NB: nammpp has already been written in mynode (if lk_mpp_mpi) 346 334 WRITE( numond, namctl ) 347 335 WRITE( numond, namcfg ) 348 336 IF( .NOT.ln_read_cfg ) THEN 349 337 DO ji = 1, SIZE(clnam) 350 IF( TRIM(clnam (ji)) /= '' ) WRITE(numond, * ) clnam(ji)! namusr_def print338 IF( TRIM(clnam(ji)) /= '' ) WRITE(numond, * ) clnam(ji) ! namusr_def print 351 339 END DO 352 340 ENDIF … … 394 382 CALL ctl_opn( numout, 'ocean.output', 'REPLACE', 'FORMATTED', 'SEQUENTIAL', -1, 6, .FALSE., narea ) 395 383 ! 396 397 398 384 WRITE(numout,*) 399 385 WRITE(numout,*) ' CNRS - NERC - Met OFFICE - MERCATOR-ocean - INGV - CMCC' 400 386 WRITE(numout,*) ' NEMO team' 401 387 WRITE(numout,*) ' Ocean General Circulation Model' 402 WRITE(numout,*) ' 388 WRITE(numout,*) ' NEMO version 3.7 (2016) ' 403 389 WRITE(numout,*) 404 390 WRITE(numout,*) 405 391 DO ji = 1, SIZE(cltxt) 406 IF( TRIM(cltxt (ji)) /= '' ) WRITE(numout,*) cltxt(ji) 392 IF( TRIM(cltxt (ji)) /= '' ) WRITE(numout,*) cltxt(ji) ! control print of mynode 407 393 END DO 408 394 WRITE(numout,*) 409 395 WRITE(numout,*) 410 396 DO ji = 1, SIZE(cltxt2) 411 IF( cltxt2(ji) /= '' ) WRITE(numout,*) cltxt2(ji)! control print of domain size397 IF( TRIM(cltxt2(ji)) /= '' ) WRITE(numout,*) cltxt2(ji) ! control print of domain size 412 398 END DO 413 399 ! 414 WRITE(numout,cform_aaa) 400 WRITE(numout,cform_aaa) ! Flag AAAAAAA 415 401 ! 416 402 ENDIF … … 418 404 ! Now we know the dimensions of the grid and numout has been set: we can allocate arrays 419 405 CALL nemo_alloc() 406 420 407 ! !-------------------------------! 421 408 ! ! NEMO general initialization ! … … 534 521 CALL dia_tmb_init ! TMB outputs 535 522 CALL dia_25h_init ! 25h mean outputs 536 537 523 ! 538 524 END SUBROUTINE nemo_init … … 577 563 WRITE(numout,*) '~~~~~~~ ' 578 564 WRITE(numout,*) ' Namelist namcfg' 579 WRITE(numout,*) ' read configuration definition files ln_read_cfg = ', ln_read_cfg 580 WRITE(numout,*) ' configuration name cp_cfg = ', TRIM(cp_cfg) 581 WRITE(numout,*) ' configuration resolution jp_cfg = ', jp_cfg 582 WRITE(numout,*) ' use file attribute if exists as i/p j-start ln_use_jattr = ', ln_use_jattr 565 WRITE(numout,*) ' read domain configuration file ln_read_cfg = ', ln_read_cfg 566 WRITE(numout,*) ' filename to be read cn_domcfg = ', TRIM(cn_domcfg) 567 WRITE(numout,*) ' write configuration definition file ln_write_cfg = ', ln_write_cfg 568 WRITE(numout,*) ' filename to be written cn_domcfg_out = ', TRIM(cn_domcfg_out) 569 WRITE(numout,*) ' use file attribute if exists as i/p j-start ln_use_jattr = ', ln_use_jattr 583 570 ENDIF 584 571 ! ! Parameter control … … 679 666 !!---------------------------------------------------------------------- 680 667 ! 681 ierr = oce_alloc () ! ocean 668 ierr = oce_alloc () ! ocean 682 669 ierr = ierr + dia_wri_alloc () 683 670 ierr = ierr + dom_oce_alloc () ! ocean domain … … 855 842 IF ((sxM .gt. sxT) .AND. (sxM .lt. dxT)) THEN 856 843 nsndto = nsndto + 1 857 844 isendto(nsndto) = jn 858 845 ELSEIF ((sxM .le. sxT) .AND. (dxM .ge. dxT)) THEN 859 846 nsndto = nsndto + 1 860 847 isendto(nsndto) = jn 861 848 ELSEIF ((dxM .lt. dxT) .AND. (sxT .lt. dxM)) THEN 862 849 nsndto = nsndto + 1 863 864 END 850 isendto(nsndto) = jn 851 ENDIF 865 852 END DO 866 853 nfsloop = 1
Note: See TracChangeset
for help on using the changeset viewer.