[3] | 1 | MODULE opa |
---|
| 2 | !!============================================================================== |
---|
| 3 | !! *** MODULE opa *** |
---|
| 4 | !! Ocean system : OPA ocean dynamics (including on-line tracers and sea-ice) |
---|
| 5 | !!============================================================================== |
---|
[1593] | 6 | !! History : OPA ! 1990-10 (C. Levy, G. Madec) Original code |
---|
| 7 | !! 7.0 ! 1991-11 (M. Imbard, C. Levy, G. Madec) |
---|
| 8 | !! 7.1 ! 1993-03 (M. Imbard, C. Levy, G. Madec, O. Marti, M. Guyon, A. Lazar, |
---|
[2104] | 9 | !! P. Delecluse, C. Perigaud, G. Caniaux, B. Colot, C. Maes) release 7.1 |
---|
[1593] | 10 | !! - ! 1992-06 (L.Terray) coupling implementation |
---|
| 11 | !! - ! 1993-11 (M.A. Filiberti) IGLOO sea-ice |
---|
| 12 | !! 8.0 ! 1996-03 (M. Imbard, C. Levy, G. Madec, O. Marti, M. Guyon, A. Lazar, |
---|
[2104] | 13 | !! P. Delecluse, L.Terray, M.A. Filiberti, J. Vialar, A.M. Treguier, M. Levy) release 8.0 |
---|
[1593] | 14 | !! 8.1 ! 1997-06 (M. Imbard, G. Madec) |
---|
| 15 | !! 8.2 ! 1999-11 (M. Imbard, H. Goosse) LIM sea-ice model |
---|
| 16 | !! ! 1999-12 (V. Thierry, A-M. Treguier, M. Imbard, M-A. Foujols) OPEN-MP |
---|
| 17 | !! ! 2000-07 (J-M Molines, M. Imbard) Open Boundary Conditions (CLIPPER) |
---|
| 18 | !! NEMO 1.0 ! 2002-08 (G. Madec) F90: Free form and modules |
---|
| 19 | !! - ! 2004-06 (R. Redler, NEC CCRLE, Germany) add OASIS[3/4] coupled interfaces |
---|
| 20 | !! - ! 2004-08 (C. Talandier) New trends organization |
---|
| 21 | !! - ! 2005-06 (C. Ethe) Add the 1D configuration possibility |
---|
| 22 | !! - ! 2005-11 (V. Garnier) Surface pressure gradient organization |
---|
| 23 | !! - ! 2006-03 (L. Debreu, C. Mazauric) Agrif implementation |
---|
| 24 | !! - ! 2006-04 (G. Madec, R. Benshila) Step reorganization |
---|
| 25 | !! - ! 2007-07 (J. Chanut, A. Sellar) Unstructured open boundaries (BDY) |
---|
| 26 | !! 3.2 ! 2009-08 (S. Masson) open/write in the listing file in mpp |
---|
[2236] | 27 | !! 3.3 ! 2010-05 (K. Mogensen, A. Weaver, M. Martin, D. Lea) Assimilation interface |
---|
| 28 | !! - ! 2010-10 (C. Ethe, G. Madec) reorganisation of initialisation phase |
---|
[1593] | 29 | !!---------------------------------------------------------------------- |
---|
[3] | 30 | |
---|
| 31 | !!---------------------------------------------------------------------- |
---|
| 32 | !! opa_model : solve ocean dynamics, tracer and/or sea-ice |
---|
[467] | 33 | !! opa_init : initialization of the opa model |
---|
[2104] | 34 | !! opa_ctl : initialisation of algorithm flag |
---|
[300] | 35 | !! opa_closefile : close remaining files |
---|
[3] | 36 | !!---------------------------------------------------------------------- |
---|
[2027] | 37 | |
---|
[2382] | 38 | USE step_oce ! module used in the ocean time stepping module |
---|
[888] | 39 | USE sbc_oce ! surface boundary condition: ocean |
---|
[2392] | 40 | USE cla ! cross land advection (tra_cla routine) |
---|
[3] | 41 | USE domcfg ! domain configuration (dom_cfg routine) |
---|
| 42 | USE mppini ! shared/distributed memory setting (mpp_init routine) |
---|
| 43 | USE domain ! domain initialization (dom_init routine) |
---|
| 44 | USE obcini ! open boundary cond. initialization (obc_ini routine) |
---|
[911] | 45 | USE bdyini ! unstructured open boundary cond. initialization (bdy_init routine) |
---|
[3] | 46 | USE istate ! initial state setting (istate_init routine) |
---|
| 47 | USE ldfdyn ! lateral viscosity setting (ldfdyn_init routine) |
---|
| 48 | USE ldftra ! lateral diffusivity setting (ldftra_init routine) |
---|
[2392] | 49 | USE zdfini ! vertical physics setting (zdf_init routine) |
---|
[3] | 50 | USE phycst ! physical constant (par_cst routine) |
---|
[2236] | 51 | USE trdmod ! momentum/tracers trends (trd_mod_init routine) |
---|
| 52 | USE asminc ! assimilation increments (asm_inc_init routine) |
---|
| 53 | USE asmtrj ! writing out state trajectory |
---|
| 54 | USE sshwzv ! vertical velocity used in asm |
---|
| 55 | USE diaptr ! poleward transports (dia_ptr_init routine) |
---|
| 56 | USE diaobs ! Observation diagnostics (dia_obs_init routine) |
---|
[3] | 57 | USE step ! OPA time-stepping (stp routine) |
---|
[532] | 58 | #if defined key_oasis3 |
---|
[1359] | 59 | USE cpl_oasis3 ! OASIS3 coupling |
---|
[599] | 60 | #elif defined key_oasis4 |
---|
[1359] | 61 | USE cpl_oasis4 ! OASIS4 coupling (not working) |
---|
[532] | 62 | #endif |
---|
[2236] | 63 | #if defined key_c1d |
---|
[900] | 64 | USE c1d ! 1D configuration |
---|
| 65 | USE step_c1d ! Time stepping loop for the 1D configuration |
---|
[2236] | 66 | #endif |
---|
[1594] | 67 | #if defined key_top |
---|
[1593] | 68 | USE trcini ! passive tracer initialisation |
---|
[1594] | 69 | #endif |
---|
[1593] | 70 | USE lib_mpp ! distributed memory computing |
---|
[1412] | 71 | #if defined key_iomput |
---|
| 72 | USE mod_ioclient |
---|
[1359] | 73 | #endif |
---|
[268] | 74 | |
---|
[3] | 75 | PRIVATE |
---|
| 76 | |
---|
[1593] | 77 | PUBLIC opa_model ! called by model.F90 |
---|
| 78 | PUBLIC opa_init ! needed by AGRIF |
---|
[467] | 79 | |
---|
[1593] | 80 | CHARACTER (len=64) :: cform_aaa="( /, 'AAAAAAAA', / ) " ! flag for output listing |
---|
| 81 | |
---|
[3] | 82 | !!---------------------------------------------------------------------- |
---|
[2287] | 83 | !! NEMO/OPA 3.3 , NEMO Consortium (2010) |
---|
[2392] | 84 | !! $Id$ |
---|
[2329] | 85 | !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) |
---|
[3] | 86 | !!---------------------------------------------------------------------- |
---|
| 87 | CONTAINS |
---|
| 88 | |
---|
| 89 | SUBROUTINE opa_model |
---|
| 90 | !!---------------------------------------------------------------------- |
---|
| 91 | !! *** ROUTINE opa *** |
---|
| 92 | !! |
---|
| 93 | !! ** Purpose : opa solves the primitive equations on an orthogonal |
---|
[1593] | 94 | !! curvilinear mesh on the sphere. |
---|
[3] | 95 | !! |
---|
| 96 | !! ** Method : - model general initialization |
---|
| 97 | !! - launch the time-stepping (stp routine) |
---|
[1593] | 98 | !! - finalize the run by closing files and communications |
---|
[3] | 99 | !! |
---|
[1593] | 100 | !! References : Madec, Delecluse,Imbard, and Levy, 1997: internal report, IPSL. |
---|
| 101 | !! Madec, 2008, internal report, IPSL. |
---|
[3] | 102 | !!---------------------------------------------------------------------- |
---|
| 103 | INTEGER :: istp ! time step index |
---|
[389] | 104 | !!---------------------------------------------------------------------- |
---|
[2382] | 105 | ! |
---|
[392] | 106 | #if defined key_agrif |
---|
[1593] | 107 | CALL Agrif_Init_Grids() ! AGRIF: set the meshes |
---|
[389] | 108 | #endif |
---|
| 109 | |
---|
[1593] | 110 | ! !-----------------------! |
---|
| 111 | CALL opa_init !== Initialisations ==! |
---|
| 112 | ! !-----------------------! |
---|
| 113 | |
---|
[682] | 114 | ! check that all process are still there... If some process have an error, |
---|
| 115 | ! they will never enter in step and other processes will wait until the end of the cpu time! |
---|
[900] | 116 | IF( lk_mpp ) CALL mpp_max( nstop ) |
---|
[682] | 117 | |
---|
[1593] | 118 | IF(lwp) WRITE(numout,cform_aaa) ! Flag AAAAAAA |
---|
| 119 | |
---|
| 120 | ! !-----------------------! |
---|
| 121 | ! !== time stepping ==! |
---|
| 122 | ! !-----------------------! |
---|
[900] | 123 | istp = nit000 |
---|
[2236] | 124 | #if defined key_c1d |
---|
[389] | 125 | DO WHILE ( istp <= nitend .AND. nstop == 0 ) |
---|
[900] | 126 | CALL stp_c1d( istp ) |
---|
[389] | 127 | istp = istp + 1 |
---|
| 128 | END DO |
---|
[2236] | 129 | #else |
---|
| 130 | IF( lk_asminc ) THEN |
---|
| 131 | IF( ln_bkgwri ) CALL asm_bkg_wri( nit000 - 1 ) ! Output background fields |
---|
| 132 | IF( ln_trjwri ) CALL asm_trj_wri( nit000 - 1 ) ! Output trajectory fields |
---|
| 133 | IF( ln_asmdin ) THEN ! Direct initialization |
---|
| 134 | IF( ln_trainc ) CALL tra_asm_inc( nit000 - 1 ) ! Tracers |
---|
| 135 | IF( ln_dyninc ) THEN |
---|
| 136 | CALL dyn_asm_inc( nit000 - 1 ) ! Dynamics |
---|
| 137 | IF ( ln_asmdin ) CALL ssh_wzv ( nit000 - 1 ) ! update vertical velocity |
---|
| 138 | ENDIF |
---|
| 139 | IF( ln_sshinc ) CALL ssh_asm_inc( nit000 - 1 ) ! SSH |
---|
| 140 | ENDIF |
---|
| 141 | ENDIF |
---|
| 142 | |
---|
[389] | 143 | DO WHILE ( istp <= nitend .AND. nstop == 0 ) |
---|
[392] | 144 | #if defined key_agrif |
---|
[1593] | 145 | CALL Agrif_Step( stp ) ! AGRIF: time stepping |
---|
[389] | 146 | #else |
---|
[1593] | 147 | CALL stp( istp ) ! standard time stepping |
---|
[389] | 148 | #endif |
---|
| 149 | istp = istp + 1 |
---|
[900] | 150 | IF( lk_mpp ) CALL mpp_max( nstop ) |
---|
[389] | 151 | END DO |
---|
[2236] | 152 | #endif |
---|
| 153 | |
---|
| 154 | IF( lk_diaobs ) CALL dia_obs_wri |
---|
[1593] | 155 | |
---|
| 156 | ! !------------------------! |
---|
| 157 | ! !== finalize the run ==! |
---|
| 158 | ! !------------------------! |
---|
| 159 | IF(lwp) WRITE(numout,cform_aaa) ! Flag AAAAAAA |
---|
| 160 | ! |
---|
| 161 | IF( nstop /= 0 .AND. lwp ) THEN ! error print |
---|
[682] | 162 | WRITE(numout,cform_err) |
---|
| 163 | WRITE(numout,*) nstop, ' error have been found' |
---|
[389] | 164 | ENDIF |
---|
[1593] | 165 | ! |
---|
[389] | 166 | CALL opa_closefile |
---|
[532] | 167 | #if defined key_oasis3 || defined key_oasis4 |
---|
[1976] | 168 | CALL cpl_prism_finalize ! end coupling and mpp communications with OASIS |
---|
[532] | 169 | #else |
---|
[1593] | 170 | IF( lk_mpp ) CALL mppstop ! end mpp communications |
---|
[532] | 171 | #endif |
---|
[900] | 172 | ! |
---|
[389] | 173 | END SUBROUTINE opa_model |
---|
| 174 | |
---|
| 175 | |
---|
| 176 | SUBROUTINE opa_init |
---|
| 177 | !!---------------------------------------------------------------------- |
---|
| 178 | !! *** ROUTINE opa_init *** |
---|
| 179 | !! |
---|
| 180 | !! ** Purpose : initialization of the opa model |
---|
| 181 | !! |
---|
| 182 | !!---------------------------------------------------------------------- |
---|
[1593] | 183 | INTEGER :: ilocal_comm |
---|
[1581] | 184 | CHARACTER(len=80),dimension(10) :: cltxt = '' |
---|
[1593] | 185 | INTEGER :: ji ! local loop indices |
---|
| 186 | !! |
---|
[1601] | 187 | NAMELIST/namctl/ ln_ctl , nn_print, nn_ictls, nn_ictle, & |
---|
[1976] | 188 | & nn_isplt, nn_jsplt, nn_jctls, nn_jctle, nn_bench |
---|
[3] | 189 | !!---------------------------------------------------------------------- |
---|
[1593] | 190 | ! |
---|
| 191 | ! ! open Namelist file |
---|
[1581] | 192 | CALL ctl_opn( numnam, 'namelist', 'OLD', 'FORMATTED', 'SEQUENTIAL', -1, 6, .FALSE. ) |
---|
[1593] | 193 | ! |
---|
| 194 | READ( numnam, namctl ) ! Namelist namctl : Control prints & Benchmark |
---|
| 195 | ! |
---|
| 196 | ! !--------------------------------------------! |
---|
| 197 | ! ! set communicator & select the local node ! |
---|
| 198 | ! !--------------------------------------------! |
---|
[1412] | 199 | #if defined key_iomput |
---|
[2200] | 200 | IF( Agrif_Root() ) THEN |
---|
[1412] | 201 | # if defined key_oasis3 || defined key_oasis4 |
---|
[2224] | 202 | CALL cpl_prism_init( ilocal_comm ) ! nemo local communicator given by oasis |
---|
[1412] | 203 | # endif |
---|
[2224] | 204 | CALL init_ioclient( ilocal_comm ) ! exchange io_server nemo local communicator with the io_server |
---|
[2200] | 205 | ENDIF |
---|
[1593] | 206 | narea = mynode( cltxt, ilocal_comm ) ! Nodes selection |
---|
[532] | 207 | #else |
---|
[1412] | 208 | # if defined key_oasis3 || defined key_oasis4 |
---|
[2236] | 209 | IF( Agrif_Root() ) THEN |
---|
| 210 | CALL cpl_prism_init( ilocal_comm ) ! nemo local communicator given by oasis |
---|
| 211 | ENDIF |
---|
[1593] | 212 | narea = mynode( cltxt, ilocal_comm ) ! Nodes selection (control print return in cltxt) |
---|
[1412] | 213 | # else |
---|
[2082] | 214 | ilocal_comm = 0 |
---|
[1593] | 215 | narea = mynode( cltxt ) ! Nodes selection (control print return in cltxt) |
---|
[1412] | 216 | # endif |
---|
[532] | 217 | #endif |
---|
[1593] | 218 | narea = narea + 1 ! mynode return the rank of proc (0 --> jpnij -1 ) |
---|
[3] | 219 | |
---|
[1593] | 220 | lwp = (narea == 1) .OR. ln_ctl ! control of all listing output print |
---|
[1579] | 221 | |
---|
[1593] | 222 | IF(lwp) THEN ! open listing units |
---|
| 223 | ! |
---|
[1581] | 224 | CALL ctl_opn( numout, 'ocean.output', 'REPLACE', 'FORMATTED', 'SEQUENTIAL', -1, 6, .FALSE., narea ) |
---|
[1593] | 225 | ! |
---|
[1579] | 226 | WRITE(numout,*) |
---|
[1593] | 227 | WRITE(numout,*) ' CNRS - NERC - Met OFFICE - MERCATOR-ocean' |
---|
| 228 | WRITE(numout,*) ' NEMO team' |
---|
[1579] | 229 | WRITE(numout,*) ' Ocean General Circulation Model' |
---|
[2104] | 230 | WRITE(numout,*) ' version 3.3 (2010) ' |
---|
[1579] | 231 | WRITE(numout,*) |
---|
| 232 | WRITE(numout,*) |
---|
[1593] | 233 | DO ji = 1, SIZE(cltxt) |
---|
| 234 | IF( TRIM(cltxt(ji)) /= '' ) WRITE(numout,*) cltxt(ji) ! control print of mynode |
---|
[1579] | 235 | END DO |
---|
[1593] | 236 | WRITE(numout,cform_aaa) ! Flag AAAAAAA |
---|
| 237 | ! |
---|
[473] | 238 | ENDIF |
---|
[1593] | 239 | ! !--------------------------------! |
---|
| 240 | ! ! Model general initialization ! |
---|
| 241 | ! !--------------------------------! |
---|
[473] | 242 | |
---|
[2104] | 243 | CALL opa_ctl ! Control prints & Benchmark |
---|
[531] | 244 | |
---|
[2082] | 245 | ! ! Domain decomposition |
---|
[1593] | 246 | IF( jpni*jpnj == jpnij ) THEN ; CALL mpp_init ! standard cutting out |
---|
| 247 | ELSE ; CALL mpp_init2 ! eliminate land processors |
---|
[3] | 248 | ENDIF |
---|
[2382] | 249 | ! |
---|
[2082] | 250 | ! ! General initialization |
---|
[2027] | 251 | CALL phy_cst ! Physical constants |
---|
| 252 | CALL eos_init ! Equation of state |
---|
| 253 | CALL dom_cfg ! Domain configuration |
---|
| 254 | CALL dom_init ! Domain |
---|
[413] | 255 | |
---|
[2027] | 256 | IF( ln_ctl ) CALL prt_ctl_init ! Print control |
---|
| 257 | |
---|
| 258 | IF( lk_obc ) CALL obc_init ! Open boundaries |
---|
| 259 | IF( lk_bdy ) CALL bdy_init ! Unstructured open boundaries |
---|
| 260 | |
---|
| 261 | IF( ln_zps ) CALL zps_hde_init ! Partial steps: horizontal derivative |
---|
| 262 | CALL istate_init ! ocean initial state (Dynamics and tracers) |
---|
| 263 | |
---|
[3] | 264 | ! ! Ocean physics |
---|
[2104] | 265 | CALL sbc_init ! Forcings : surface module |
---|
[2082] | 266 | ! ! Vertical physics |
---|
| 267 | CALL zdf_init ! namelist read |
---|
| 268 | CALL zdf_bfr_init ! bottom friction |
---|
| 269 | IF( lk_zdfric ) CALL zdf_ric_init ! Richardson number dependent Kz |
---|
[2329] | 270 | IF( lk_zdftke ) CALL zdf_tke_init ! TKE closure scheme |
---|
| 271 | IF( lk_zdfgls ) CALL zdf_gls_init ! GLS closure scheme |
---|
| 272 | IF( lk_zdfkpp ) CALL zdf_kpp_init ! KPP closure scheme |
---|
[2082] | 273 | IF( lk_zdftmx ) CALL zdf_tmx_init ! tidal vertical mixing |
---|
[2027] | 274 | IF( lk_zdfddm .AND. .NOT. lk_zdfkpp ) & |
---|
[2082] | 275 | & CALL zdf_ddm_init ! double diffusive mixing |
---|
| 276 | ! ! Lateral physics |
---|
| 277 | CALL ldf_tra_init ! Lateral ocean tracer physics |
---|
| 278 | CALL ldf_dyn_init ! Lateral ocean momentum physics |
---|
[2392] | 279 | IF( lk_ldfslp ) CALL ldf_slp_init ! slope of lateral mixing |
---|
[2082] | 280 | |
---|
[2027] | 281 | ! ! Active tracers |
---|
| 282 | CALL tra_qsr_init ! penetrative solar radiation qsr |
---|
[2325] | 283 | CALL tra_bbc_init ! bottom heat flux |
---|
[2027] | 284 | IF( lk_trabbl ) CALL tra_bbl_init ! advective (and/or diffusive) bottom boundary layer scheme |
---|
| 285 | IF( lk_tradmp ) CALL tra_dmp_init ! internal damping trends |
---|
| 286 | CALL tra_adv_init ! horizontal & vertical advection |
---|
| 287 | CALL tra_ldf_init ! lateral mixing |
---|
| 288 | CALL tra_zdf_init ! vertical mixing and after tracer fields |
---|
| 289 | |
---|
| 290 | ! ! Dynamics |
---|
| 291 | CALL dyn_adv_init ! advection (vector or flux form) |
---|
[2104] | 292 | CALL dyn_vor_init ! vorticity term including Coriolis |
---|
[2027] | 293 | CALL dyn_ldf_init ! lateral mixing |
---|
[2104] | 294 | CALL dyn_hpg_init ! horizontal gradient of Hydrostatic pressure |
---|
[2027] | 295 | CALL dyn_zdf_init ! vertical diffusion |
---|
| 296 | CALL dyn_spg_init ! surface pressure gradient |
---|
[2392] | 297 | |
---|
| 298 | ! ! Misc. options |
---|
| 299 | IF( nn_cla == 1 ) CALL cla_init ! Cross Land Advection |
---|
| 300 | |
---|
[1594] | 301 | #if defined key_top |
---|
[2027] | 302 | ! ! Passive tracers |
---|
[2082] | 303 | CALL trc_init |
---|
[1594] | 304 | #endif |
---|
[2382] | 305 | ! ! Diagnostics |
---|
[2027] | 306 | CALL iom_init ! iom_put initialization |
---|
[2392] | 307 | IF( lk_floats ) CALL flo_init ! drifting Floats |
---|
| 308 | IF( lk_diaar5 ) CALL dia_ar5_init ! ar5 diag |
---|
[2027] | 309 | CALL dia_ptr_init ! Poleward TRansports initialization |
---|
[2148] | 310 | CALL dia_hsb_init ! heat content, salt content and volume budgets |
---|
[2027] | 311 | CALL trd_mod_init ! Mixed-layer/Vorticity/Integral constraints trends |
---|
[2392] | 312 | IF( lk_diaobs ) THEN ! Observation & model comparison |
---|
[2382] | 313 | CALL dia_obs_init ! Initialize observational data |
---|
| 314 | CALL dia_obs( nit000 - 1 ) ! Observation operator for restart |
---|
[2236] | 315 | ENDIF |
---|
[2382] | 316 | ! ! Assimilation increments |
---|
[2392] | 317 | IF( lk_asminc ) CALL asm_inc_init ! Initialize assimilation increments |
---|
[2382] | 318 | IF(lwp) WRITE(numout,*) 'Euler time step switch is ', neuler |
---|
[1593] | 319 | ! |
---|
[389] | 320 | END SUBROUTINE opa_init |
---|
[467] | 321 | |
---|
| 322 | |
---|
[2104] | 323 | SUBROUTINE opa_ctl |
---|
[467] | 324 | !!---------------------------------------------------------------------- |
---|
| 325 | !! *** ROUTINE opa *** |
---|
| 326 | !! |
---|
[1593] | 327 | !! ** Purpose : Initialise logical flags that control the choice of |
---|
| 328 | !! some algorithm or control print |
---|
[467] | 329 | !! |
---|
[1593] | 330 | !! ** Method : - print namctl information |
---|
| 331 | !! - Read in namilist namflg logical flags |
---|
[467] | 332 | !!---------------------------------------------------------------------- |
---|
[1601] | 333 | NAMELIST/namdyn_hpg/ ln_hpg_zco , ln_hpg_zps , ln_hpg_sco, ln_hpg_hel, & |
---|
| 334 | & ln_hpg_wdj , ln_hpg_djc , ln_hpg_rot, rn_gamma , & |
---|
| 335 | & ln_dynhpg_imp, nn_dynhpg_rst |
---|
[467] | 336 | !!---------------------------------------------------------------------- |
---|
| 337 | |
---|
[1601] | 338 | IF(lwp) THEN ! Parameter print |
---|
[531] | 339 | WRITE(numout,*) |
---|
[2104] | 340 | WRITE(numout,*) 'opa_ctl: Control prints & Benchmark' |
---|
[531] | 341 | WRITE(numout,*) '~~~~~~~ ' |
---|
[1593] | 342 | WRITE(numout,*) ' Namelist namctl' |
---|
[1601] | 343 | WRITE(numout,*) ' run control (for debugging) ln_ctl = ', ln_ctl |
---|
| 344 | WRITE(numout,*) ' level of print nn_print = ', nn_print |
---|
| 345 | WRITE(numout,*) ' Start i indice for SUM control nn_ictls = ', nn_ictls |
---|
| 346 | WRITE(numout,*) ' End i indice for SUM control nn_ictle = ', nn_ictle |
---|
| 347 | WRITE(numout,*) ' Start j indice for SUM control nn_jctls = ', nn_jctls |
---|
| 348 | WRITE(numout,*) ' End j indice for SUM control nn_jctle = ', nn_jctle |
---|
| 349 | WRITE(numout,*) ' number of proc. following i nn_isplt = ', nn_isplt |
---|
| 350 | WRITE(numout,*) ' number of proc. following j nn_jsplt = ', nn_jsplt |
---|
| 351 | WRITE(numout,*) ' benchmark parameter (0/1) nn_bench = ', nn_bench |
---|
[531] | 352 | ENDIF |
---|
| 353 | |
---|
[1601] | 354 | nprint = nn_print ! convert DOCTOR namelist names into OLD names |
---|
| 355 | nictls = nn_ictls |
---|
| 356 | nictle = nn_ictle |
---|
| 357 | njctls = nn_jctls |
---|
| 358 | njctle = nn_jctle |
---|
| 359 | isplt = nn_isplt |
---|
| 360 | jsplt = nn_jsplt |
---|
| 361 | nbench = nn_bench |
---|
| 362 | |
---|
[1593] | 363 | ! ! Parameter control |
---|
| 364 | ! |
---|
| 365 | IF( ln_ctl ) THEN ! sub-domain area indices for the control prints |
---|
| 366 | IF( lk_mpp ) THEN |
---|
| 367 | isplt = jpni ; jsplt = jpnj ; ijsplt = jpni*jpnj ! the domain is forced to the real splitted domain |
---|
[531] | 368 | ELSE |
---|
| 369 | IF( isplt == 1 .AND. jsplt == 1 ) THEN |
---|
[1593] | 370 | CALL ctl_warn( ' - isplt & jsplt are equal to 1', & |
---|
| 371 | & ' - the print control will be done over the whole domain' ) |
---|
[531] | 372 | ENDIF |
---|
[1593] | 373 | ijsplt = isplt * jsplt ! total number of processors ijsplt |
---|
[531] | 374 | ENDIF |
---|
| 375 | IF(lwp) WRITE(numout,*)' - The total number of processors over which the' |
---|
| 376 | IF(lwp) WRITE(numout,*)' print control will be done is ijsplt : ', ijsplt |
---|
[1593] | 377 | ! |
---|
| 378 | ! ! indices used for the SUM control |
---|
| 379 | IF( nictls+nictle+njctls+njctle == 0 ) THEN ! print control done over the default area |
---|
| 380 | lsp_area = .FALSE. |
---|
| 381 | ELSE ! print control done over a specific area |
---|
[531] | 382 | lsp_area = .TRUE. |
---|
| 383 | IF( nictls < 1 .OR. nictls > jpiglo ) THEN |
---|
| 384 | CALL ctl_warn( ' - nictls must be 1<=nictls>=jpiglo, it is forced to 1' ) |
---|
| 385 | nictls = 1 |
---|
| 386 | ENDIF |
---|
| 387 | IF( nictle < 1 .OR. nictle > jpiglo ) THEN |
---|
| 388 | CALL ctl_warn( ' - nictle must be 1<=nictle>=jpiglo, it is forced to jpiglo' ) |
---|
| 389 | nictle = jpiglo |
---|
| 390 | ENDIF |
---|
| 391 | IF( njctls < 1 .OR. njctls > jpjglo ) THEN |
---|
| 392 | CALL ctl_warn( ' - njctls must be 1<=njctls>=jpjglo, it is forced to 1' ) |
---|
| 393 | njctls = 1 |
---|
| 394 | ENDIF |
---|
| 395 | IF( njctle < 1 .OR. njctle > jpjglo ) THEN |
---|
| 396 | CALL ctl_warn( ' - njctle must be 1<=njctle>=jpjglo, it is forced to jpjglo' ) |
---|
| 397 | njctle = jpjglo |
---|
| 398 | ENDIF |
---|
[1593] | 399 | ENDIF |
---|
| 400 | ENDIF |
---|
[531] | 401 | |
---|
[1593] | 402 | IF( nbench == 1 ) THEN ! Benchmark |
---|
[531] | 403 | SELECT CASE ( cp_cfg ) |
---|
[1593] | 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 | & ' key_gyre must be used or set nbench = 0' ) |
---|
[531] | 407 | END SELECT |
---|
| 408 | ENDIF |
---|
[1593] | 409 | ! |
---|
[2104] | 410 | END SUBROUTINE opa_ctl |
---|
[467] | 411 | |
---|
| 412 | |
---|
| 413 | SUBROUTINE opa_closefile |
---|
| 414 | !!---------------------------------------------------------------------- |
---|
| 415 | !! *** ROUTINE opa_closefile *** |
---|
| 416 | !! |
---|
| 417 | !! ** Purpose : Close the files |
---|
| 418 | !!---------------------------------------------------------------------- |
---|
| 419 | USE dtatem ! temperature data |
---|
| 420 | USE dtasal ! salinity data |
---|
| 421 | !!---------------------------------------------------------------------- |
---|
[1593] | 422 | ! |
---|
| 423 | IF( lk_mpp ) CALL mppsync |
---|
| 424 | ! |
---|
[1685] | 425 | CALL iom_close ! close all input/output files managed by iom_* |
---|
[1593] | 426 | ! |
---|
[1685] | 427 | IF( numstp /= -1 ) CLOSE( numstp ) ! time-step file |
---|
| 428 | IF( numsol /= -1 ) CLOSE( numsol ) ! solver file |
---|
| 429 | IF( numnam /= -1 ) CLOSE( numnam ) ! oce namelist |
---|
| 430 | IF( numnam_ice /= -1 ) CLOSE( numnam_ice ) ! ice namelist |
---|
| 431 | IF( numevo_ice /= -1 ) CLOSE( numevo_ice ) ! ice variables (temp. evolution) |
---|
| 432 | IF( numout /= 6 ) CLOSE( numout ) ! standard model output file |
---|
| 433 | numout = 6 ! redefine numout in case it is used after this point... |
---|
[1593] | 434 | ! |
---|
[467] | 435 | END SUBROUTINE opa_closefile |
---|
| 436 | |
---|
[3] | 437 | !!====================================================================== |
---|
| 438 | END MODULE opa |
---|