- Timestamp:
- 2016-11-21T09:55:07+01:00 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/OFF_SRC/nemogcm.F90
r6140 r7277 5 5 !!====================================================================== 6 6 !! History : 3.3 ! 2010-05 (C. Ethe) Full reorganization of the off-line: phasing with the on-line 7 !! 4.0 ! 2011-01 (C. Ethe, A. R. Porter, STFC Daresbury) dynamical allocation 7 !! 3.4 ! 2011-01 (C. Ethe, A. R. Porter, STFC Daresbury) dynamical allocation 8 !! 4.0 ! 2016-10 (C. Ethe, G. Madec, S. Flavoni) domain configuration / user defined interface 8 9 !!---------------------------------------------------------------------- 9 10 … … 17 18 USE oce ! dynamics and tracers variables 18 19 USE c1d ! 1D configuration 19 USE domcfg ! domain configuration (dom_cfg routine)20 20 USE domain ! domain initialization from coordinate & bathymetry (dom_init routine) 21 USE domrea ! domain initialization from mesh_mask (dom_init routine)21 USE usrdef_nam ! user defined configuration 22 22 USE eosbn2 ! equation of state (eos bn2 routine) 23 23 ! ! ocean physics … … 35 35 USE trcstp ! passive tracer time-stepping (trc_stp routine) 36 36 USE dtadyn ! Lecture and interpolation of the dynamical fields 37 ! ! Passive tracers needs 38 USE trc ! passive tracer : variables 39 USE trcnam ! passive tracer : namelist 40 USE trcrst ! passive tracer restart 41 USE diaptr ! Need to initialise this as some variables are used in if statements later 42 USE sbc_oce , ONLY : ln_rnf 43 USE sbcrnf ! surface boundary condition : runoffs 37 44 ! ! I/O & MPP 38 45 USE iom ! I/O library … … 48 55 USE lbcnfd, ONLY: isendto, nsndto, nfsloop, nfeloop ! Setup of north fold exchanges 49 56 50 USE trc 51 USE trcnam 52 USE trcrst 53 USE diaptr ! Need to initialise this as some variables are used in if statements later 54 USE sbc_oce, ONLY: ln_rnf 55 USE sbcrnf 57 56 58 57 59 IMPLICIT NONE … … 104 106 DO WHILE ( istp <= nitend .AND. nstop == 0 ) ! time stepping 105 107 ! 106 IF( istp /= nit000 ) CALL day ( istp ) ! Calendar (day was already called at nit000 in day_init) 107 CALL iom_setkt( istp - nit000 + 1, "nemo" ) ! say to iom that we are at time step kstp 108 CALL dta_dyn ( istp ) ! Interpolation of the dynamical fields 109 CALL trc_stp ( istp ) ! time-stepping 110 CALL stp_ctl ( istp, indic ) ! Time loop: control and print 108 IF( istp /= nit000 ) CALL day ( istp ) ! Calendar (day was already called at nit000 in day_init) 109 CALL iom_setkt ( istp - nit000 + 1, "nemo" ) ! say to iom that we are at time step kstp 110 CALL dta_dyn ( istp ) ! Interpolation of the dynamical fields 111 IF( .NOT.ln_linssh ) CALL dta_dyn_swp( istp ) ! swap of sea surface height and vertical scale factors 112 113 CALL trc_stp ( istp ) ! time-stepping 114 CALL stp_ctl ( istp, indic ) ! Time loop: control and print 111 115 istp = istp + 1 112 116 IF( lk_mpp ) CALL mpp_max( nstop ) … … 147 151 INTEGER :: ji ! dummy loop indices 148 152 INTEGER :: ilocal_comm ! local integer 149 INTEGER :: ios 150 LOGICAL :: llexist151 CHARACTER(len= 80), DIMENSION(16) :: cltxt153 INTEGER :: ios, inum 154 REAL(wp) :: ziglo, zjglo, zkglo, zperio ! local scalars 155 CHARACTER(len=120), DIMENSION(30) :: cltxt, cltxt2, clnam 152 156 !! 153 157 NAMELIST/namctl/ ln_ctl , nn_print, nn_ictls, nn_ictle, & 154 158 & nn_isplt, nn_jsplt, nn_jctls, nn_jctle, & 155 & nn_bench, nn_timing, nn_diacfl 156 NAMELIST/namcfg/ cp_cfg, cp_cfz, jp_cfg, jpidta, jpjdta, jpkdta, jpiglo, jpjglo, & 157 & jpizoom, jpjzoom, jperio, ln_use_jattr 158 !!---------------------------------------------------------------------- 159 cltxt = '' 159 & nn_timing, nn_diacfl 160 161 NAMELIST/namcfg/ ln_read_cfg, cn_domcfg, ln_write_cfg, cn_domcfg_out, ln_use_jattr 162 !!---------------------------------------------------------------------- 163 cltxt = '' 164 cltxt2 = '' 165 clnam = '' 160 166 cxios_context = 'nemo' 161 167 ! … … 181 187 904 IF( ios /= 0 ) CALL ctl_nam ( ios , 'namcfg in configuration namelist', .TRUE. ) 182 188 189 190 ! !--------------------------! 191 ! ! Set global domain size ! (control print return in cltxt2) 192 ! 193 IF( ln_read_cfg ) THEN ! Read sizes in domain configuration file 194 CALL domain_cfg ( cltxt2, cn_cfg, nn_cfg, jpiglo, jpjglo, jpkglo, jperio ) 195 ! 196 ELSE ! user-defined namelist 197 CALL usr_def_nam( cltxt2, clnam, cn_cfg, nn_cfg, jpiglo, jpjglo, jpkglo, jperio ) 198 ENDIF 199 jpk = jpkglo 183 200 ! 184 201 ! !--------------------------------------------! … … 206 223 WRITE( numond, namctl ) 207 224 WRITE( numond, namcfg ) 225 IF( .NOT.ln_read_cfg ) THEN 226 DO ji = 1, SIZE(clnam) 227 IF( TRIM(clnam (ji)) /= '' ) WRITE(numond, * ) clnam(ji) ! namusr_def print 228 END DO 229 ENDIF 208 230 ENDIF 209 231 … … 225 247 jpi = ( jpiglo-2*jpreci + (jpni-1) ) / jpni + 2*jpreci ! first dim. 226 248 jpj = ( jpjglo-2*jprecj + (jpnj-1) ) / jpnj + 2*jprecj ! second dim. 227 jpk = jpkdta ! third dim228 249 jpim1 = jpi-1 ! inner domain indices 229 250 jpjm1 = jpj-1 ! " " … … 274 295 CALL eos_init ! Equation of state 275 296 IF( lk_c1d ) CALL c1d_init ! 1D column configuration 276 CALL dom_cfg ! Domain configuration 277 ! 278 INQUIRE( FILE='coordinates.nc', EXIST = llexist ) ! Check if coordinate file exist 279 ! 280 IF( llexist ) THEN ; CALL dom_init ! compute the grid from coordinates and bathymetry 281 ELSE ; CALL dom_rea ! read grid from the meskmask 282 ENDIF 297 298 CALL dom_init ! Domain 299 283 300 CALL istate_init ! ocean initial state (Dynamics and tracers) 284 301 … … 315 332 !! *** ROUTINE nemo_ctl *** 316 333 !! 317 !! ** Purpose : control print setting 334 !! ** Purpose : control print setting 318 335 !! 319 336 !! ** Method : - print namctl information and check some consistencies 320 337 !!---------------------------------------------------------------------- 321 338 ! 322 IF(lwp) THEN ! Parameterprint339 IF(lwp) THEN ! control print 323 340 WRITE(numout,*) 324 WRITE(numout,*) 'nemo_ flg: Control prints & Benchmark'341 WRITE(numout,*) 'nemo_ctl: Control prints' 325 342 WRITE(numout,*) '~~~~~~~ ' 326 343 WRITE(numout,*) ' Namelist namctl' … … 333 350 WRITE(numout,*) ' number of proc. following i nn_isplt = ', nn_isplt 334 351 WRITE(numout,*) ' number of proc. following j nn_jsplt = ', nn_jsplt 335 WRITE(numout,*) ' benchmark parameter (0/1) nn_bench = ', nn_bench352 WRITE(numout,*) ' timing activated (0/1) nn_timing = ', nn_timing 336 353 ENDIF 337 354 ! … … 343 360 isplt = nn_isplt 344 361 jsplt = nn_jsplt 345 nbench = nn_bench 346 IF(lwp) THEN ! control print 362 363 364 IF(lwp) THEN ! control print 347 365 WRITE(numout,*) 348 366 WRITE(numout,*) 'namcfg : configuration initialization through namelist read' 349 367 WRITE(numout,*) '~~~~~~~ ' 350 368 WRITE(numout,*) ' Namelist namcfg' 351 WRITE(numout,*) ' configuration name cp_cfg = ', TRIM(cp_cfg) 352 WRITE(numout,*) ' configuration resolution jp_cfg = ', jp_cfg 353 WRITE(numout,*) ' 1st lateral dimension ( >= jpi ) jpidta = ', jpidta 354 WRITE(numout,*) ' 2nd " " ( >= jpj ) jpjdta = ', jpjdta 355 WRITE(numout,*) ' 3nd " " jpkdta = ', jpkdta 356 WRITE(numout,*) ' 1st dimension of global domain in i jpiglo = ', jpiglo 357 WRITE(numout,*) ' 2nd - - in j jpjglo = ', jpjglo 358 WRITE(numout,*) ' left bottom i index of the zoom (in data domain) jpizoom = ', jpizoom 359 WRITE(numout,*) ' left bottom j index of the zoom (in data domain) jpizoom = ', jpjzoom 360 WRITE(numout,*) ' lateral cond. type (between 0 and 6) jperio = ', jperio 361 WRITE(numout,*) ' use file attribute if exists as i/p j-start ln_use_jattr = ', ln_use_jattr 362 ENDIF 369 WRITE(numout,*) ' read domain configuration files ln_read_cfg = ', ln_read_cfg 370 WRITE(numout,*) ' filename to be read cn_domcfg = ', TRIM(cn_domcfg) 371 WRITE(numout,*) ' write configuration definition files ln_write_cfg = ', ln_write_cfg 372 WRITE(numout,*) ' filename to be written cn_domcfg_out = ', TRIM(cn_domcfg_out) 373 WRITE(numout,*) ' use file attribute if exists as i/p j-start ln_use_jattr = ', ln_use_jattr 374 ENDIF 375 363 376 ! ! Parameter control 364 377 ! 365 378 IF( ln_ctl ) THEN ! sub-domain area indices for the control prints 366 IF( lk_mpp ) THEN367 isplt = jpni ; jsplt = jpnj ; ijsplt = jpni*jpnj ! the domain is forced to the real split teddomain379 IF( lk_mpp .AND. jpnij > 1 ) THEN 380 isplt = jpni ; jsplt = jpnj ; ijsplt = jpni*jpnj ! the domain is forced to the real split domain 368 381 ELSE 369 382 IF( isplt == 1 .AND. jsplt == 1 ) THEN … … 400 413 ENDIF 401 414 ! 402 IF( nbench == 1 ) THEN ! Benchmark403 SELECT CASE ( cp_cfg )404 CASE ( 'gyre' ) ; CALL ctl_warn( ' The Benchmark is activated ' )405 CASE DEFAULT ; CALL ctl_stop( ' The Benchmark is based on the GYRE configuration:', &406 & ' cp_cfg="gyre" in namelsit &namcfg or set nbench = 0' )407 END SELECT408 ENDIF409 !410 IF( lk_c1d .AND. .NOT.lk_iomput ) CALL ctl_stop( 'nemo_ctl: The 1D configuration must be used ', &411 & 'with the IOM Input/Output manager. ' , &412 & 'Compile with key_iomput enabled' )413 !414 415 IF( 1_wp /= SIGN(1._wp,-0._wp) ) CALL ctl_stop( 'nemo_ctl: The intrinsec SIGN function follows ', & 415 416 & 'f2003 standard. ' , & … … 434 435 IF( numnam_cfg /= -1 ) CLOSE( numnam_cfg ) ! oce configuration namelist 435 436 IF( numout /= 6 ) CLOSE( numout ) ! standard model output file 437 IF( lwm.AND.numond /= -1 ) CLOSE( numond ) ! oce output namelist 438 436 439 numout = 6 ! redefine numout in case it is used after this point... 437 440 !
Note: See TracChangeset
for help on using the changeset viewer.