- Timestamp:
- 2016-08-01T15:37:15+02:00 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2016/dev_r6409_SIMPLIF_2_usrdef_tools/NEMOGCM/NEMO/OPA_SRC/nemogcm.F90
r6152 r6827 48 48 USE mppini ! shared/distributed memory setting (mpp_init routine) 49 49 USE domain ! domain initialization (dom_init routine) 50 #if defined key_nemocice_decomp51 USE ice_domain_size, only: nx_global, ny_global52 #endif53 USE tideini ! tidal components initialization (tide_ini routine)54 USE bdyini ! open boundary cond. setting (bdy_init routine)55 USE bdydta ! open boundary cond. setting (bdy_dta_init routine)56 USE bdytides ! open boundary cond. setting (bdytide_init routine)57 USE sbctide, ONLY : lk_tide58 USE istate ! initial state setting (istate_init routine)59 USE ldfdyn ! lateral viscosity setting (ldfdyn_init routine)60 USE ldftra ! lateral diffusivity setting (ldftra_init routine)61 USE zdfini ! vertical physics setting (zdf_init routine)62 50 USE phycst ! physical constant (par_cst routine) 63 USE trdini ! dyn/tra trends initialization (trd_init routine)64 USE asminc ! assimilation increments65 USE asmbkg ! writing out state trajectory66 USE diaptr ! poleward transports (dia_ptr_init routine)67 USE diadct ! sections transports (dia_dct_init routine)68 USE diaobs ! Observation diagnostics (dia_obs_init routine)69 USE diacfl ! CFL diagnostics (dia_cfl_init routine)70 51 USE lib_fortran ! Fortran utilities (allows no signed zero when 'key_nosignedzero' defined) 71 USE step ! NEMO time-stepping (stp routine)72 USE icbini ! handle bergs, initialisation73 USE icbstp ! handle bergs, calving, themodynamics and transport74 USE cpl_oasis3 ! OASIS3 coupling75 USE c1d ! 1D configuration76 USE step_c1d ! Time stepping loop for the 1D configuration77 USE dyndmp ! Momentum damping78 USE stopar ! Stochastic param.: ???79 USE stopts ! Stochastic param.: ???80 #if defined key_top81 USE trcini ! passive tracer initialisation82 #endif83 52 USE lib_mpp ! distributed memory computing 84 USE diurnal_bulk ! diurnal bulk SST85 USE step_diu ! diurnal bulk SST timestepping (called from here if run offline)86 53 #if defined key_iomput 87 54 USE xios ! xIOserver 88 55 #endif 89 USE crsini ! initialise grid coarsening utility90 56 USE lbcnfd , ONLY : isendto, nsndto, nfsloop, nfeloop ! Setup of north fold exchanges 91 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 57 96 58 IMPLICIT NONE … … 137 99 CALL Agrif_Declare_Var_dom ! AGRIF: set the meshes for DOM 138 100 CALL Agrif_Declare_Var ! " " " " " DYN/TRA 139 # if defined key_top140 CALL Agrif_Declare_Var_top ! " " " " " TOP141 # endif142 # if defined key_lim2143 CALL Agrif_Declare_Var_lim2 ! " " " " " LIM144 # endif145 101 #endif 146 102 ! check that all process are still there... If some process have an error, … … 151 107 152 108 ! !-----------------------! 153 ! !== time stepping ==!154 ! !-----------------------!155 istp = nit000156 #if defined key_c1d157 DO WHILE ( istp <= nitend .AND. nstop == 0 )158 CALL stp_c1d( istp )159 istp = istp + 1160 END DO161 #else162 IF( lk_asminc ) THEN163 IF( ln_bkgwri ) CALL asm_bkg_wri( nit000 - 1 ) ! Output background fields164 IF( ln_asmdin ) THEN ! Direct initialization165 IF( ln_trainc ) CALL tra_asm_inc( nit000 - 1 ) ! Tracers166 IF( ln_dyninc ) CALL dyn_asm_inc( nit000 - 1 ) ! Dynamics167 IF( ln_sshinc ) CALL ssh_asm_inc( nit000 - 1 ) ! SSH168 ENDIF169 ENDIF170 171 #if defined key_agrif172 CALL Agrif_Regrid()173 #endif174 175 DO WHILE ( istp <= nitend .AND. nstop == 0 )176 #if defined key_agrif177 CALL stp ! AGRIF: time stepping178 #else179 IF ( .NOT. ln_diurnal_only ) THEN180 CALL stp( istp ) ! standard time stepping181 ELSE182 CALL stp_diurnal( istp ) ! time step only the diurnal SST183 ENDIF184 #endif185 istp = istp + 1186 IF( lk_mpp ) CALL mpp_max( nstop )187 END DO188 #endif189 190 IF( ln_diaobs ) CALL dia_obs_wri191 !192 IF( ln_icebergs ) CALL icb_end( nitend )193 194 ! !------------------------!195 109 ! !== finalize the run ==! 196 110 ! !------------------------! 197 IF(lwp) WRITE(numout,cform_aaa) ! Flag AAAAAAA198 111 ! 199 112 IF( nstop /= 0 .AND. lwp ) THEN ! error print … … 204 117 #if defined key_agrif 205 118 IF( .NOT. Agrif_Root() ) THEN 206 CALL Agrif_ParentGrid_To_ChildGrid() 207 IF( ln_diaobs ) CALL dia_obs_wri 119 CALL Agrif_ParentGrid_To_ChildGrid() 208 120 IF( nn_timing == 1 ) CALL timing_finalize 209 121 CALL Agrif_ChildGrid_To_ParentGrid() … … 216 128 #if defined key_iomput 217 129 CALL xios_finalize ! end mpp communications with xios 218 IF( lk_oasis ) CALL cpl_finalize ! end coupling and mpp communications with OASIS219 130 #else 220 IF( lk_oasis ) THEN 221 CALL cpl_finalize ! end coupling and mpp communications with OASIS 222 ELSE 223 IF( lk_mpp ) CALL mppstop ! end mpp communications 224 ENDIF 131 IF( lk_mpp ) CALL mppstop ! end mpp communications 225 132 #endif 226 133 ! … … 294 201 #if defined key_iomput 295 202 IF( Agrif_Root() ) THEN 296 IF( lk_oasis ) THEN297 CALL cpl_init( "oceanx", ilocal_comm ) ! nemo local communicator given by oasis298 CALL xios_initialize( "not used",local_comm=ilocal_comm ) ! send nemo communicator to xios299 ELSE300 203 CALL xios_initialize( "for_xios_mpi_id",return_comm=ilocal_comm ) ! nemo local communicator given by xios 301 ENDIF302 204 ENDIF 303 205 ! Nodes selection (control print return in cltxt) 304 206 narea = mynode( cltxt, 'output.namelist.dyn', numnam_ref, numnam_cfg, numond , nstop, ilocal_comm ) 305 207 #else 306 IF( lk_oasis ) THEN307 IF( Agrif_Root() ) THEN308 CALL cpl_init( "oceanx", ilocal_comm ) ! nemo local communicator given by oasis309 ENDIF310 ! Nodes selection (control print return in cltxt)311 narea = mynode( cltxt, 'output.namelist.dyn', numnam_ref, numnam_cfg, numond , nstop, ilocal_comm )312 ELSE313 208 ilocal_comm = 0 314 209 ! Nodes selection (control print return in cltxt) 315 210 narea = mynode( cltxt, 'output.namelist.dyn', numnam_ref, numnam_cfg, numond , nstop ) 316 ENDIF317 211 #endif 318 212 narea = narea + 1 ! mynode return the rank of proc (0 --> jpnij -1 ) … … 402 296 CALL phy_cst ! Physical constants 403 297 CALL eos_init ! Equation of state 404 IF( lk_c1d ) CALL c1d_init ! 1D column configuration405 CALL wad_init ! Wetting and drying options406 298 CALL dom_cfg ! Domain configuration 407 299 CALL dom_init ! Domain 408 IF( ln_crs ) CALL crs_init ! coarsened grid: domain initialization409 IF( ln_nnogather ) CALL nemo_northcomms! northfold neighbour lists (must be done after the masks are defined)410 300 IF( ln_ctl ) CALL prt_ctl_init ! Print control 411 412 CALL diurnal_sst_bulk_init ! diurnal sst413 IF ( ln_diurnal ) CALL diurnal_sst_coolskin_init ! cool skin414 415 ! IF ln_diurnal_only, then we only want a subset of the initialisation routines416 IF ( ln_diurnal_only ) THEN417 CALL istate_init ! ocean initial state (Dynamics and tracers)418 CALL sbc_init ! Forcings : surface module419 CALL tra_qsr_init ! penetrative solar radiation qsr420 IF( ln_diaobs ) THEN ! Observation & model comparison421 CALL dia_obs_init ! Initialize observational data422 CALL dia_obs( nit000 - 1 ) ! Observation operator for restart423 ENDIF424 ! ! Assimilation increments425 IF( lk_asminc ) CALL asm_inc_init ! Initialize assimilation increments426 427 IF(lwp) WRITE(numout,*) 'Euler time step switch is ', neuler428 RETURN429 ENDIF430 431 CALL istate_init ! ocean initial state (Dynamics and tracers)432 433 ! ! external forcing434 !!gm to be added : creation and call of sbc_apr_init435 IF( lk_tide ) CALL tide_init ! tidal harmonics436 CALL sbc_init ! surface boundary conditions (including sea-ice)437 !!gm ==>> bdy_init should call bdy_dta_init and bdytide_init NOT in nemogcm !!!438 IF( lk_bdy ) CALL bdy_init ! Open boundaries initialisation439 IF( lk_bdy ) CALL bdy_dta_init ! Open boundaries initialisation of external data arrays440 IF( lk_bdy .AND. lk_tide ) &441 & CALL bdytide_init ! Open boundaries initialisation of tidal harmonic forcing442 443 ! ! Ocean physics444 ! ! Vertical physics445 CALL zdf_init ! namelist read446 CALL zdf_bfr_init ! bottom friction447 IF( lk_zdfric ) CALL zdf_ric_init ! Richardson number dependent Kz448 IF( lk_zdftke ) CALL zdf_tke_init ! TKE closure scheme449 IF( lk_zdfgls ) CALL zdf_gls_init ! GLS closure scheme450 IF( lk_zdftmx ) CALL zdf_tmx_init ! tidal vertical mixing451 IF( lk_zdfddm ) CALL zdf_ddm_init ! double diffusive mixing452 453 ! ! Lateral physics454 CALL ldf_tra_init ! Lateral ocean tracer physics455 CALL ldf_eiv_init ! eddy induced velocity param.456 CALL ldf_dyn_init ! Lateral ocean momentum physics457 458 ! ! Active tracers459 CALL tra_qsr_init ! penetrative solar radiation qsr460 CALL tra_bbc_init ! bottom heat flux461 IF( lk_trabbl ) CALL tra_bbl_init ! advective (and/or diffusive) bottom boundary layer scheme462 CALL tra_dmp_init ! internal tracer damping463 CALL tra_adv_init ! horizontal & vertical advection464 CALL tra_ldf_init ! lateral mixing465 CALL tra_zdf_init ! vertical mixing and after tracer fields466 467 ! ! Dynamics468 IF( lk_c1d ) CALL dyn_dmp_init ! internal momentum damping469 CALL dyn_adv_init ! advection (vector or flux form)470 CALL dyn_vor_init ! vorticity term including Coriolis471 CALL dyn_ldf_init ! lateral mixing472 CALL dyn_hpg_init ! horizontal gradient of Hydrostatic pressure473 CALL dyn_zdf_init ! vertical diffusion474 CALL dyn_spg_init ! surface pressure gradient475 476 #if defined key_top477 ! ! Passive tracers478 CALL trc_init479 #endif480 IF( l_ldfslp ) CALL ldf_slp_init ! slope of lateral mixing481 482 ! ! Icebergs483 CALL icb_init( rdt, nit000) ! initialise icebergs instance484 485 ! ! Misc. options486 CALL sto_par_init ! Stochastic parametrization487 IF( ln_sto_eos ) CALL sto_pts_init ! RRandom T/S fluctuations488 489 ! ! Diagnostics490 IF( lk_floats ) CALL flo_init ! drifting Floats491 CALL dia_cfl_init ! Initialise CFL diagnostics492 IF( lk_diaar5 ) CALL dia_ar5_init ! ar5 diag493 CALL dia_ptr_init ! Poleward TRansports initialization494 IF( lk_diadct ) CALL dia_dct_init ! Sections tranports495 CALL dia_hsb_init ! heat content, salt content and volume budgets496 CALL trd_init ! Mixed-layer/Vorticity/Integral constraints trends497 CALL dia_obs_init ! Initialize observational data498 IF( ln_diaobs ) CALL dia_obs( nit000 - 1 ) ! Observation operator for restart499 500 ! ! Assimilation increments501 IF( lk_asminc ) CALL asm_inc_init ! Initialize assimilation increments502 IF(lwp) WRITE(numout,*) 'Euler time step switch is ', neuler503 CALL dia_tmb_init ! TMB outputs504 CALL dia_25h_init ! 25h mean outputs505 506 301 ! 507 302 END SUBROUTINE nemo_init … … 600 395 ENDIF 601 396 ! 602 IF( nbench == 1 ) THEN ! Benchmark603 SELECT CASE ( cp_cfg )604 CASE ( 'gyre' ) ; CALL ctl_warn( ' The Benchmark is activated ' )605 CASE DEFAULT ; CALL ctl_stop( ' The Benchmark is based on the GYRE configuration:', &606 & ' cp_cfg = "gyre" in namelist &namcfg or set nbench = 0' )607 END SELECT608 ENDIF609 !610 397 IF( 1_wp /= SIGN(1._wp,-0._wp) ) CALL ctl_stop( 'nemo_ctl: The intrinsec SIGN function follows ', & 611 398 & 'f2003 standard. ' , & … … 653 440 !! ** Method : 654 441 !!---------------------------------------------------------------------- 655 USE diawri , ONLY: dia_wri_alloc656 442 USE dom_oce , ONLY: dom_oce_alloc 657 USE trc_oce , ONLY: trc_oce_alloc658 #if defined key_diadct659 USE diadct , ONLY: diadct_alloc660 #endif661 #if defined key_bdy662 USE bdy_oce , ONLY: bdy_oce_alloc663 #endif664 443 ! 665 444 INTEGER :: ierr … … 667 446 ! 668 447 ierr = oce_alloc () ! ocean 669 ierr = ierr + dia_wri_alloc ()670 448 ierr = ierr + dom_oce_alloc () ! ocean domain 671 ierr = ierr + zdf_oce_alloc () ! ocean vertical physics672 !673 ierr = ierr + trc_oce_alloc () ! shared TRC / TRA arrays674 !675 #if defined key_diadct676 ierr = ierr + diadct_alloc () !677 #endif678 #if defined key_bdy679 ierr = ierr + bdy_oce_alloc () ! bdy masks (incl. initialization)680 #endif681 449 ! 682 450 IF( lk_mpp ) CALL mpp_sum( ierr )
Note: See TracChangeset
for help on using the changeset viewer.