- Timestamp:
- 2014-03-27T11:25:15+01:00 (10 years ago)
- Location:
- branches/2012/dev_v3_4_STABLE_2012/NEMOGCM/NEMO
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2012/dev_v3_4_STABLE_2012/NEMOGCM/NEMO/OPATAM_SRC/mt19937ar.f90
r4598 r4600 271 271 l_mtinit = .TRUE. 272 272 273 END SUBROUTINE mtrand_seedre 273 END SUBROUTINE mtrand_seedread 274 274 275 275 END MODULE mt19937ar -
branches/2012/dev_v3_4_STABLE_2012/NEMOGCM/NEMO/OPATAM_SRC/nemogcm_tam.F90
r3658 r4600 38 38 !! nemo_init : initialization of the NEMO system 39 39 !! nemo_ctl : initialisation of the contol print 40 !! nemo_closefile : close remaining open files41 40 !! nemo_alloc : dynamical allocation 42 41 !! nemo_partition : calculate MPP domain decomposition … … 88 87 USE tamctl 89 88 USE lib_mpp_tam 89 USE paresp 90 90 !USE tamtrj 91 91 USE trj_tam … … 123 123 ! !-----------------------! 124 124 ! !== Initialisations ==! 125 CALL nemo_init_tam !-----------------------! 125 CALL nemo_init !-----------------------! 126 CALL nemo_init_tam 126 127 ! 127 128 ! check that all process are still there... If some process have an error, … … 185 186 !!---------------------------------------------------------------------- 186 187 ! 187 cltxt = ''188 !189 ! ! open Namelist file190 CALL ctl_opn( numnam, 'namelist', 'OLD', 'FORMATTED', 'SEQUENTIAL', -1, 6, .FALSE. )191 !!192 READ( numnam, namctl ) ! Namelist namctl : Control prints & Benchmark193 !194 ! !--------------------------------------------!195 ! ! set communicator & select the local node !196 ! !--------------------------------------------!197 ilocal_comm = 0198 narea = mynode( cltxt, numnam, nstop ) ! Nodes selection (control print return in cltxt)199 narea = narea + 1 ! mynode return the rank of proc (0 --> jpnij -1 )200 201 lwp = (narea == 1) .OR. ln_ctl ! control of all listing output print202 203 ! If dimensions of processor grid weren't specified in the namelist file204 ! then we calculate them here now that we have our communicator size205 IF( (jpni < 1) .OR. (jpnj < 1) )THEN206 #if defined key_mpp_mpi207 IF( Agrif_Root() ) CALL nemo_partition(mppsize)208 #else209 jpni = 1210 jpnj = 1211 jpnij = jpni*jpnj212 #endif213 END IF214 215 ! Calculate domain dimensions given calculated jpni and jpnj216 ! This used to be done in par_oce.F90 when they were parameters rather217 ! than variables218 IF( Agrif_Root() ) THEN219 jpi = ( jpiglo-2*jpreci + (jpni-1) ) / jpni + 2*jpreci ! first dim.220 jpj = ( jpjglo-2*jprecj + (jpnj-1) ) / jpnj + 2*jprecj ! second dim.221 jpk = jpkdta ! third dim222 jpim1 = jpi-1 ! inner domain indices223 jpjm1 = jpj-1 ! " "224 jpkm1 = jpk-1 ! " "225 jpij = jpi*jpj ! jpi x j226 ENDIF227 228 IF(lwp) THEN ! open listing units229 !230 CALL ctl_opn( numout, 'ocean.output', 'REPLACE', 'FORMATTED', 'SEQUENTIAL', -1, 6, .FALSE., narea )231 !232 WRITE(numout,*)233 WRITE(numout,*) ' CNRS - NERC - Met OFFICE - MERCATOR-ocean - INGV - CMCC'234 WRITE(numout,*) ' NEMO team'235 WRITE(numout,*) ' Ocean General Circulation Model'236 WRITE(numout,*) ' version 3.4 (2011) '237 WRITE(numout,*) ' NEMOTAM '238 WRITE(numout,*)239 WRITE(numout,*)240 DO ji = 1, SIZE(cltxt)241 IF( TRIM(cltxt(ji)) /= '' ) WRITE(numout,*) cltxt(ji) ! control print of mynode242 END DO243 WRITE(numout,cform_aaa) ! Flag AAAAAAA244 !245 ENDIF246 247 ! Now we know the dimensions of the grid and numout has been set we canhttp://forge.ipsl.jussieu.fr/nemo/changeset/3640248 ! allocate arrays249 CALL nemo_alloc()250 251 ! ! Domain decomposition252 IF( jpni*jpnj == jpnij ) THEN ; CALL mpp_init ! standard cutting out253 ELSE ; CALL mpp_init2 ! eliminate land processors254 ENDIF255 !256 IF( nn_timing == 1 ) CALL timing_init257 !258 ! ! General initialization259 CALL phy_cst ! Physical constants260 CALL eos_init ! Equation of state261 CALL dom_cfg ! Domain configuration262 CALL dom_init ! Domain263 264 IF( ln_nnogather ) CALL nemo_northcomms ! Initialise the northfold neighbour lists (must be done after the masks are defined)265 266 IF( ln_ctl ) CALL prt_ctl_init ! Print control267 268 IF( lk_obc ) CALL obc_init ! Open boundaries269 IF( lk_bdy ) CALL bdy_init ! Open boundaries initialisation270 IF( lk_bdy ) CALL bdy_dta_init ! Open boundaries initialisation of external data arrays271 IF( lk_bdy ) CALL tide_init ! Open boundaries initialisation of tidal harmonic forcing272 273 CALL flush(numout)274 CALL dyn_nept_init ! simplified form of Neptune effect275 CALL flush(numout)276 277 CALL istate_init ! ocean initial state (Dynamics and tracers)278 279 ! ! Ocean physics280 CALL sbc_init ! Forcings : surface module281 ! ! Vertical physics282 CALL zdf_init ! namelist read283 CALL zdf_bfr_init ! bottom friction284 IF( lk_zdfric ) CALL zdf_ric_init ! Richardson number dependent Kz285 IF( lk_zdftke ) CALL zdf_tke_init ! TKE closure scheme286 IF( lk_zdfgls ) CALL zdf_gls_init ! GLS closure scheme287 IF( lk_zdfkpp ) CALL zdf_kpp_init ! KPP closure scheme288 IF( lk_zdftmx ) CALL zdf_tmx_init ! tidal vertical mixing289 IF( lk_zdfddm .AND. .NOT. lk_zdfkpp ) &290 & CALL zdf_ddm_init ! double diffusive mixing291 ! ! Lateral physics292 CALL ldf_tra_init ! Lateral ocean tracer physics293 CALL ldf_dyn_init ! Lateral ocean momentum physics294 IF( lk_ldfslp ) CALL ldf_slp_init ! slope of lateral mixing295 296 ! ! Active tracers297 CALL tra_qsr_init ! penetrative solar radiation qsr298 CALL tra_bbc_init ! bottom heat flux299 IF( lk_trabbl ) CALL tra_bbl_init ! advective (and/or diffusive) bottom boundary layer scheme300 IF( ln_tradmp ) CALL tra_dmp_init ! internal damping trends301 CALL tra_adv_init ! horizontal & vertical advection302 CALL tra_ldf_init ! lateral mixing303 CALL tra_zdf_init ! vertical mixing and after tracer fields304 305 ! ! Dynamics306 CALL dyn_adv_init ! advection (vector or flux form)307 CALL dyn_vor_init ! vorticity term including Coriolis308 CALL dyn_ldf_init ! lateral mixing309 CALL dyn_hpg_init ! horizontal gradient of Hydrostatic pressure310 CALL dyn_zdf_init ! vertical diffusion311 CALL dyn_spg_init ! surface pressure gradient312 313 ! ! Misc. options314 IF( nn_cla == 1 ) CALL cla_init ! Cross Land Advection315 316 #if defined key_top317 ! ! Passive tracers318 CALL trc_init319 #endif320 ! ! Diagnostics321 IF( lk_floats ) CALL flo_init ! drifting Floats322 CALL iom_init ! iom_put initialization323 IF( lk_diaar5 ) CALL dia_ar5_init ! ar5 diag324 CALL dia_ptr_init ! Poleward TRansports initialization325 IF( lk_diadct ) CALL dia_dct_init ! Sections tranports326 CALL dia_hsb_init ! heat content, salt content and volume budgets327 CALL trd_mod_init ! Mixed-layer/Vorticity/Integral constraints trends328 IF( lk_diaobs ) THEN ! Observation & model comparison329 CALL dia_obs_init ! Initialize observational data330 CALL dia_obs( nit000 - 1 ) ! Observation operator for restart331 ENDIF332 ! ! Assimilation increments333 IF( lk_asminc ) CALL asm_inc_init ! Initialize assimilation increments334 !335 188 IF( ln_rnf ) CALL sbc_rnf_init 336 189 !!!!!!!!!!!!! TAM initialisation !!!!!!!!!!!!!!!!!!!!!!!!!!! … … 343 196 CALL sbc_init_tam ! Forcings : surface module 344 197 CALL sbc_ssr_ini_tam ! Forcings : surface module 345 ! ! Vertical physics 346 ! CALL zdf_init_tam ! namelist read 347 !IF( lk_zdfric ) CALL zdf_ric_init ! Richardson number dependent Kz 348 !IF( lk_zdftke ) CALL zdf_tke_init ! TKE closure scheme 349 !IF( lk_zdfgls ) CALL zdf_gls_init ! GLS closure scheme 350 !IF( lk_zdfkpp ) CALL zdf_kpp_init ! KPP closure scheme 351 !IF( lk_zdftmx ) CALL zdf_tmx_init ! tidal vertical mixing 352 !IF( lk_zdfddm .AND. .NOT. lk_zdfkpp ) & 353 !& CALL zdf_ddm_init ! double diffusive mixing 354 ! ! Lateral physics 355 !CALL ldf_tra_init ! Lateral ocean tracer physics 356 !CALL ldf_dyn_init ! Lateral ocean momentum physics 357 !IF( lk_ldfslp ) CALL ldf_slp_init ! slope of lateral mixing 358 359 ! ! Active tracers 198 ! ! Active tracers 360 199 CALL tra_qsr_init_tam ! penetrative solar radiation qsr 361 200 IF( lk_trabbl ) CALL tra_bbl_init_tam ! advective (and/or diffusive) bottom boundary layer scheme … … 376 215 IF( nn_cla == 1 ) CALL cla_init_tam ! Cross Land Advection 377 216 CALL sbc_rnf_init_tam 378 !#if defined key_top 379 !! ! Passive tracers 380 !CALL trc_init 381 !#endif 382 !! ! Diagnostics 383 !IF( lk_floats ) CALL flo_init ! drifting Floats 384 !CALL iom_init ! iom_put initialization 385 !IF( lk_diaar5 ) CALL dia_ar5_init ! ar5 diag 386 !CALL dia_ptr_init ! Poleward TRansports initialization 387 !IF( lk_diadct ) CALL dia_dct_init ! Sections tranports 388 !CALL dia_hsb_init ! heat content, salt content and volume budgets 389 !CALL trd_mod_init ! Mixed-layer/Vorticity/Integral constraints trends 390 !IF( lk_diaobs ) THEN ! Observation & model comparison 391 !CALL dia_obs_init ! Initialize observational data 392 !CALL dia_obs( nit000 - 1 ) ! Observation operator for restart 393 !ENDIF 394 !! ! Assimilation increments 395 !IF( lk_asminc ) CALL asm_inc_init ! Initialize assimilation increments 396 !IF(lwp) WRITE(numout,*) 'Euler time step switch is ', neuler 397 ! 398 CALL tam_trj_init 217 399 218 CALL tam_tst_init 400 219 CALL tl_trj_ini 401 220 END SUBROUTINE nemo_init_tam 402 403 221 404 222 SUBROUTINE nemo_ctl_tam … … 488 306 END SUBROUTINE nemo_ctl_tam 489 307 490 491 SUBROUTINE nemo_closefile492 !!----------------------------------------------------------------------493 !! *** ROUTINE nemo_closefile ***494 !!495 !! ** Purpose : Close the files496 !!----------------------------------------------------------------------497 !498 IF( lk_mpp ) CALL mppsync499 !500 CALL iom_close ! close all input/output files managed by iom_*501 !502 IF( numstp /= -1 ) CLOSE( numstp ) ! time-step file503 IF( numsol /= -1 ) CLOSE( numsol ) ! solver file504 IF( numnam /= -1 ) CLOSE( numnam ) ! oce namelist505 IF( numnam_ice /= -1 ) CLOSE( numnam_ice ) ! ice namelist506 IF( numevo_ice /= -1 ) CLOSE( numevo_ice ) ! ice variables (temp. evolution)507 IF( numout /= 6 ) CLOSE( numout ) ! standard model output file508 IF( numdct_vol /= -1 ) CLOSE( numdct_vol ) ! volume transports509 IF( numdct_heat /= -1 ) CLOSE( numdct_heat ) ! heat transports510 IF( numdct_salt /= -1 ) CLOSE( numdct_salt ) ! salt transports511 !512 numout = 6 ! redefine numout in case it is used after this point...513 !514 END SUBROUTINE nemo_closefile515 516 517 308 SUBROUTINE nemo_alloc_tam 518 309 !!---------------------------------------------------------------------- … … 539 330 ! 540 331 END SUBROUTINE nemo_alloc_tam 541 542 543 SUBROUTINE nemo_partition( num_pes )544 !!----------------------------------------------------------------------545 !! *** ROUTINE nemo_partition ***546 !!547 !! ** Purpose :548 !!549 !! ** Method :550 !!----------------------------------------------------------------------551 INTEGER, INTENT(in) :: num_pes ! The number of MPI processes we have552 !553 INTEGER, PARAMETER :: nfactmax = 20554 INTEGER :: nfact ! The no. of factors returned555 INTEGER :: ierr ! Error flag556 INTEGER :: ji557 INTEGER :: idiff, mindiff, imin ! For choosing pair of factors that are closest in value558 INTEGER, DIMENSION(nfactmax) :: ifact ! Array of factors559 !!----------------------------------------------------------------------560 561 ierr = 0562 563 CALL factorise( ifact, nfactmax, nfact, num_pes, ierr )564 565 IF( nfact <= 1 ) THEN566 WRITE (numout, *) 'WARNING: factorisation of number of PEs failed'567 WRITE (numout, *) ' : using grid of ',num_pes,' x 1'568 jpnj = 1569 jpni = num_pes570 ELSE571 ! Search through factors for the pair that are closest in value572 mindiff = 1000000573 imin = 1574 DO ji = 1, nfact-1, 2575 idiff = ABS( ifact(ji) - ifact(ji+1) )576 IF( idiff < mindiff ) THEN577 mindiff = idiff578 imin = ji579 ENDIF580 END DO581 jpnj = ifact(imin)582 jpni = ifact(imin + 1)583 ENDIF584 !585 jpnij = jpni*jpnj586 !587 END SUBROUTINE nemo_partition588 589 332 590 333 SUBROUTINE factorise( kfax, kmaxfax, knfax, kn, kerr ) -
branches/2012/dev_v3_4_STABLE_2012/NEMOGCM/NEMO/OPA_SRC/nemogcm.F90
r3604 r4600 84 84 PUBLIC nemo_init ! needed by AGRIF 85 85 PUBLIC nemo_alloc ! needed by TAM 86 PUBLIC nemo_closefile ! Needed by NEMOTAM 87 PUBLIC nemo_partition ! needed by NEMOTAM 86 88 87 89 CHARACTER(lc) :: cform_aaa="( /, 'AAAAAAAA', / ) " ! flag for output listing
Note: See TracChangeset
for help on using the changeset viewer.