[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, |
---|
| 9 | !! P. Delecluse, C. Perigaud, G. Caniaux, B. Colot, C. Maes ) release 7.1 |
---|
| 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, |
---|
| 13 | !! P. Delecluse, L.Terray, M.A. Filiberti, J. Vialar, A.M. Treguier, M. Levy) release 8.0 |
---|
| 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 |
---|
| 27 | !!---------------------------------------------------------------------- |
---|
[3] | 28 | |
---|
| 29 | !!---------------------------------------------------------------------- |
---|
| 30 | !! opa_model : solve ocean dynamics, tracer and/or sea-ice |
---|
[467] | 31 | !! opa_init : initialization of the opa model |
---|
[3] | 32 | !! opa_flg : initialisation of algorithm flag |
---|
[300] | 33 | !! opa_closefile : close remaining files |
---|
[3] | 34 | !!---------------------------------------------------------------------- |
---|
[888] | 35 | USE oce ! dynamics and tracers variables |
---|
[3] | 36 | USE dom_oce ! ocean space domain variables |
---|
[888] | 37 | USE sbc_oce ! surface boundary condition: ocean |
---|
[216] | 38 | USE trdmod_oce ! ocean variables trends |
---|
[3] | 39 | USE domcfg ! domain configuration (dom_cfg routine) |
---|
| 40 | USE mppini ! shared/distributed memory setting (mpp_init routine) |
---|
| 41 | USE domain ! domain initialization (dom_init routine) |
---|
| 42 | USE obc_par ! open boundary cond. parameters |
---|
| 43 | USE obcini ! open boundary cond. initialization (obc_ini routine) |
---|
[911] | 44 | USE bdy_par ! unstructured open boundary cond. parameters |
---|
| 45 | USE bdyini ! unstructured open boundary cond. initialization (bdy_init routine) |
---|
[3] | 46 | USE istate ! initial state setting (istate_init routine) |
---|
[1725] | 47 | USE sbcmod ! surface boundary condition |
---|
[1593] | 48 | USE eosbn2 ! equation of state (eos_init routine) |
---|
[1601] | 49 | USE dynhpg ! hydrostatic pressure gradient |
---|
[3] | 50 | USE ldfdyn ! lateral viscosity setting (ldfdyn_init routine) |
---|
| 51 | USE ldftra ! lateral diffusivity setting (ldftra_init routine) |
---|
| 52 | USE zdfini |
---|
| 53 | USE phycst ! physical constant (par_cst routine) |
---|
[503] | 54 | USE trdmod ! momentum/tracers trends (trd_mod_init routine) |
---|
[132] | 55 | USE diaptr ! poleward transports (dia_ptr_init routine) |
---|
[3] | 56 | USE step ! OPA time-stepping (stp routine) |
---|
[532] | 57 | #if defined key_oasis3 |
---|
[1359] | 58 | USE cpl_oasis3 ! OASIS3 coupling |
---|
[599] | 59 | #elif defined key_oasis4 |
---|
[1359] | 60 | USE cpl_oasis4 ! OASIS4 coupling (not working) |
---|
[532] | 61 | #endif |
---|
| 62 | USE dynspg_oce ! Control choice of surface pressure gradient schemes |
---|
[258] | 63 | USE prtctl ! Print control (prt_ctl_init routine) |
---|
[900] | 64 | USE c1d ! 1D configuration |
---|
| 65 | USE dyncor_c1d ! Coriolis factor at T-point |
---|
| 66 | USE step_c1d ! Time stepping loop for the 1D configuration |
---|
[1594] | 67 | #if defined key_top |
---|
[1593] | 68 | USE trcini ! passive tracer initialisation |
---|
[1594] | 69 | #endif |
---|
[1593] | 70 | |
---|
[1359] | 71 | USE iom |
---|
[1593] | 72 | USE in_out_manager ! I/O manager |
---|
| 73 | USE lib_mpp ! distributed memory computing |
---|
[1412] | 74 | #if defined key_iomput |
---|
| 75 | USE mod_ioclient |
---|
[1359] | 76 | #endif |
---|
[268] | 77 | |
---|
[3] | 78 | IMPLICIT NONE |
---|
| 79 | PRIVATE |
---|
| 80 | |
---|
[1593] | 81 | PUBLIC opa_model ! called by model.F90 |
---|
| 82 | PUBLIC opa_init ! needed by AGRIF |
---|
[467] | 83 | |
---|
[1593] | 84 | CHARACTER (len=64) :: cform_aaa="( /, 'AAAAAAAA', / ) " ! flag for output listing |
---|
| 85 | |
---|
[3] | 86 | !!---------------------------------------------------------------------- |
---|
[1593] | 87 | !! NEMO/OPA 3.2 , LOCEAN-IPSL (2009) |
---|
[888] | 88 | !! $Id$ |
---|
[467] | 89 | !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt) |
---|
[3] | 90 | !!---------------------------------------------------------------------- |
---|
| 91 | |
---|
| 92 | CONTAINS |
---|
| 93 | |
---|
| 94 | SUBROUTINE opa_model |
---|
| 95 | !!---------------------------------------------------------------------- |
---|
| 96 | !! *** ROUTINE opa *** |
---|
| 97 | !! |
---|
| 98 | !! ** Purpose : opa solves the primitive equations on an orthogonal |
---|
[1593] | 99 | !! curvilinear mesh on the sphere. |
---|
[3] | 100 | !! |
---|
| 101 | !! ** Method : - model general initialization |
---|
| 102 | !! - launch the time-stepping (stp routine) |
---|
[1593] | 103 | !! - finalize the run by closing files and communications |
---|
[3] | 104 | !! |
---|
[1593] | 105 | !! References : Madec, Delecluse,Imbard, and Levy, 1997: internal report, IPSL. |
---|
| 106 | !! Madec, 2008, internal report, IPSL. |
---|
[3] | 107 | !!---------------------------------------------------------------------- |
---|
| 108 | INTEGER :: istp ! time step index |
---|
[389] | 109 | !!---------------------------------------------------------------------- |
---|
| 110 | |
---|
[392] | 111 | #if defined key_agrif |
---|
[1593] | 112 | CALL Agrif_Init_Grids() ! AGRIF: set the meshes |
---|
[389] | 113 | #endif |
---|
| 114 | |
---|
[1593] | 115 | ! !-----------------------! |
---|
| 116 | CALL opa_init !== Initialisations ==! |
---|
| 117 | ! !-----------------------! |
---|
| 118 | |
---|
[682] | 119 | ! check that all process are still there... If some process have an error, |
---|
| 120 | ! they will never enter in step and other processes will wait until the end of the cpu time! |
---|
[900] | 121 | IF( lk_mpp ) CALL mpp_max( nstop ) |
---|
[682] | 122 | |
---|
[1593] | 123 | IF(lwp) WRITE(numout,cform_aaa) ! Flag AAAAAAA |
---|
| 124 | |
---|
| 125 | ! !-----------------------! |
---|
| 126 | ! !== time stepping ==! |
---|
| 127 | ! !-----------------------! |
---|
[900] | 128 | istp = nit000 |
---|
[1593] | 129 | IF( lk_c1d ) THEN !== 1D configuration ==! |
---|
[389] | 130 | DO WHILE ( istp <= nitend .AND. nstop == 0 ) |
---|
[900] | 131 | CALL stp_c1d( istp ) |
---|
[389] | 132 | istp = istp + 1 |
---|
| 133 | END DO |
---|
[1593] | 134 | ELSE !== 3D ocean with ==! |
---|
[389] | 135 | DO WHILE ( istp <= nitend .AND. nstop == 0 ) |
---|
[392] | 136 | #if defined key_agrif |
---|
[1593] | 137 | CALL Agrif_Step( stp ) ! AGRIF: time stepping |
---|
[389] | 138 | #else |
---|
[1593] | 139 | CALL stp( istp ) ! standard time stepping |
---|
[389] | 140 | #endif |
---|
| 141 | istp = istp + 1 |
---|
[900] | 142 | IF( lk_mpp ) CALL mpp_max( nstop ) |
---|
[389] | 143 | END DO |
---|
| 144 | ENDIF |
---|
[1593] | 145 | |
---|
| 146 | ! !------------------------! |
---|
| 147 | ! !== finalize the run ==! |
---|
| 148 | ! !------------------------! |
---|
| 149 | IF(lwp) WRITE(numout,cform_aaa) ! Flag AAAAAAA |
---|
| 150 | ! |
---|
| 151 | IF( nstop /= 0 .AND. lwp ) THEN ! error print |
---|
[682] | 152 | WRITE(numout,cform_err) |
---|
| 153 | WRITE(numout,*) nstop, ' error have been found' |
---|
[389] | 154 | ENDIF |
---|
[1593] | 155 | ! |
---|
[389] | 156 | CALL opa_closefile |
---|
[532] | 157 | #if defined key_oasis3 || defined key_oasis4 |
---|
[1793] | 158 | IF( Agrif_Root() ) THEN |
---|
| 159 | CALL cpl_prism_finalize ! end coupling and mpp communications with OASIS |
---|
| 160 | ENDIF |
---|
[532] | 161 | #else |
---|
[1593] | 162 | IF( lk_mpp ) CALL mppstop ! end mpp communications |
---|
[532] | 163 | #endif |
---|
[900] | 164 | ! |
---|
[389] | 165 | END SUBROUTINE opa_model |
---|
| 166 | |
---|
| 167 | |
---|
| 168 | SUBROUTINE opa_init |
---|
| 169 | !!---------------------------------------------------------------------- |
---|
| 170 | !! *** ROUTINE opa_init *** |
---|
| 171 | !! |
---|
| 172 | !! ** Purpose : initialization of the opa model |
---|
| 173 | !! |
---|
| 174 | !!---------------------------------------------------------------------- |
---|
[1412] | 175 | #if defined key_oasis3 || defined key_oasis4 || defined key_iomput |
---|
[1593] | 176 | INTEGER :: ilocal_comm |
---|
[532] | 177 | #endif |
---|
[1581] | 178 | CHARACTER(len=80),dimension(10) :: cltxt = '' |
---|
[1593] | 179 | INTEGER :: ji ! local loop indices |
---|
| 180 | !! |
---|
[1601] | 181 | NAMELIST/namctl/ ln_ctl , nn_print, nn_ictls, nn_ictle, & |
---|
| 182 | & nn_isplt, nn_jsplt, nn_jctls, nn_jctle, nn_bench, nn_bit_cmp |
---|
[3] | 183 | !!---------------------------------------------------------------------- |
---|
[1593] | 184 | ! |
---|
| 185 | ! ! open Namelist file |
---|
[1581] | 186 | CALL ctl_opn( numnam, 'namelist', 'OLD', 'FORMATTED', 'SEQUENTIAL', -1, 6, .FALSE. ) |
---|
[1593] | 187 | ! |
---|
| 188 | READ( numnam, namctl ) ! Namelist namctl : Control prints & Benchmark |
---|
| 189 | ! |
---|
| 190 | ! !--------------------------------------------! |
---|
| 191 | ! ! set communicator & select the local node ! |
---|
| 192 | ! !--------------------------------------------! |
---|
[1412] | 193 | #if defined key_iomput |
---|
[2170] | 194 | IF( Agrif_Root() ) THEN |
---|
[1412] | 195 | # if defined key_oasis3 || defined key_oasis4 |
---|
[1793] | 196 | CALL cpl_prism_init( ilocal_comm ) ! nemo local communicator given by oasis |
---|
[2170] | 197 | # endif |
---|
| 198 | CALL init_ioclient( ilocal_comm ) ! exchange io_server nemo local communicator with the io_server |
---|
[1793] | 199 | ENDIF |
---|
[1593] | 200 | narea = mynode( cltxt, ilocal_comm ) ! Nodes selection |
---|
[532] | 201 | #else |
---|
[1412] | 202 | # if defined key_oasis3 || defined key_oasis4 |
---|
[1793] | 203 | IF( Agrif_Root() ) THEN |
---|
| 204 | CALL cpl_prism_init( ilocal_comm ) ! nemo local communicator given by oasis |
---|
| 205 | ENDIF |
---|
[1593] | 206 | narea = mynode( cltxt, ilocal_comm ) ! Nodes selection (control print return in cltxt) |
---|
[1412] | 207 | # else |
---|
[1593] | 208 | narea = mynode( cltxt ) ! Nodes selection (control print return in cltxt) |
---|
[1412] | 209 | # endif |
---|
[532] | 210 | #endif |
---|
[1593] | 211 | narea = narea + 1 ! mynode return the rank of proc (0 --> jpnij -1 ) |
---|
[3] | 212 | |
---|
[1593] | 213 | lwp = (narea == 1) .OR. ln_ctl ! control of all listing output print |
---|
[1579] | 214 | |
---|
[1593] | 215 | IF(lwp) THEN ! open listing units |
---|
| 216 | ! |
---|
[1581] | 217 | CALL ctl_opn( numout, 'ocean.output', 'REPLACE', 'FORMATTED', 'SEQUENTIAL', -1, 6, .FALSE., narea ) |
---|
[1593] | 218 | ! |
---|
[1579] | 219 | WRITE(numout,*) |
---|
[1593] | 220 | WRITE(numout,*) ' CNRS - NERC - Met OFFICE - MERCATOR-ocean' |
---|
| 221 | WRITE(numout,*) ' NEMO team' |
---|
[1579] | 222 | WRITE(numout,*) ' Ocean General Circulation Model' |
---|
[1593] | 223 | WRITE(numout,*) ' version 3.2 (2009) ' |
---|
[1579] | 224 | WRITE(numout,*) |
---|
| 225 | WRITE(numout,*) |
---|
[1593] | 226 | DO ji = 1, SIZE(cltxt) |
---|
| 227 | IF( TRIM(cltxt(ji)) /= '' ) WRITE(numout,*) cltxt(ji) ! control print of mynode |
---|
[1579] | 228 | END DO |
---|
[1593] | 229 | WRITE(numout,cform_aaa) ! Flag AAAAAAA |
---|
| 230 | ! |
---|
[473] | 231 | ENDIF |
---|
[1593] | 232 | ! !--------------------------------! |
---|
| 233 | ! ! Model general initialization ! |
---|
| 234 | ! !--------------------------------! |
---|
[473] | 235 | |
---|
[531] | 236 | CALL opa_flg ! Control prints & Benchmark |
---|
| 237 | |
---|
[3] | 238 | ! Domain decomposition |
---|
[1593] | 239 | IF( jpni*jpnj == jpnij ) THEN ; CALL mpp_init ! standard cutting out |
---|
| 240 | ELSE ; CALL mpp_init2 ! eliminate land processors |
---|
[3] | 241 | ENDIF |
---|
| 242 | |
---|
| 243 | CALL phy_cst ! Physical constants |
---|
[1493] | 244 | CALL eos_init ! Equation of state |
---|
[3] | 245 | CALL dom_cfg ! Domain configuration |
---|
| 246 | CALL dom_init ! Domain |
---|
[1593] | 247 | !!gm c1d case can be moved in dom_init routine |
---|
| 248 | IF( lk_c1d ) THEN ! 1D configuration |
---|
| 249 | CALL cor_c1d ! Coriolis defined at T-point |
---|
| 250 | umask(:,:,:) = tmask(:,:,:) ! U, V and T-points are the same |
---|
| 251 | vmask(:,:,:) = tmask(:,:,:) ! |
---|
[900] | 252 | ENDIF |
---|
[1593] | 253 | !!gm c1d end |
---|
[258] | 254 | |
---|
[1593] | 255 | IF( ln_ctl ) CALL prt_ctl_init ! Print control |
---|
[3] | 256 | |
---|
[1593] | 257 | IF( lk_obc ) CALL obc_init ! Open boundaries |
---|
| 258 | IF( lk_bdy ) CALL bdy_init ! Unstructured open boundaries |
---|
[253] | 259 | |
---|
[413] | 260 | CALL istate_init ! ocean initial state (Dynamics and tracers) |
---|
| 261 | |
---|
[3] | 262 | ! ! Ocean physics |
---|
[1725] | 263 | CALL sbc_init ! Read namsbc namelist : surface module (needed for iom_init) |
---|
[1598] | 264 | CALL ldf_tra_init ! Lateral ocean tracer physics |
---|
[3] | 265 | CALL ldf_dyn_init ! Lateral ocean momentum physics |
---|
| 266 | CALL zdf_init ! Vertical ocean physics |
---|
| 267 | |
---|
[1594] | 268 | #if defined key_top |
---|
[1359] | 269 | CALL trc_ini ! Passive tracers |
---|
[1594] | 270 | #endif |
---|
[281] | 271 | |
---|
[1593] | 272 | ! ! diagnostics |
---|
[1725] | 273 | CALL iom_init ! iom_put initialization |
---|
[1593] | 274 | CALL dia_ptr_init ! Poleward TRansports initialization |
---|
| 275 | CALL trd_mod_init ! Mixed-layer/Vorticity/Integral constraints trends |
---|
| 276 | ! |
---|
[389] | 277 | END SUBROUTINE opa_init |
---|
[467] | 278 | |
---|
| 279 | |
---|
| 280 | SUBROUTINE opa_flg |
---|
| 281 | !!---------------------------------------------------------------------- |
---|
| 282 | !! *** ROUTINE opa *** |
---|
| 283 | !! |
---|
[1593] | 284 | !! ** Purpose : Initialise logical flags that control the choice of |
---|
| 285 | !! some algorithm or control print |
---|
[467] | 286 | !! |
---|
[1593] | 287 | !! ** Method : - print namctl information |
---|
| 288 | !! - Read in namilist namflg logical flags |
---|
[467] | 289 | !!---------------------------------------------------------------------- |
---|
[1601] | 290 | NAMELIST/namdyn_hpg/ ln_hpg_zco , ln_hpg_zps , ln_hpg_sco, ln_hpg_hel, & |
---|
| 291 | & ln_hpg_wdj , ln_hpg_djc , ln_hpg_rot, rn_gamma , & |
---|
[2466] | 292 | & ln_dynhpg_imp |
---|
[467] | 293 | !!---------------------------------------------------------------------- |
---|
| 294 | |
---|
[1601] | 295 | IF(lwp) THEN ! Parameter print |
---|
[531] | 296 | WRITE(numout,*) |
---|
| 297 | WRITE(numout,*) 'opa_flg: Control prints & Benchmark' |
---|
| 298 | WRITE(numout,*) '~~~~~~~ ' |
---|
[1593] | 299 | WRITE(numout,*) ' Namelist namctl' |
---|
[1601] | 300 | WRITE(numout,*) ' run control (for debugging) ln_ctl = ', ln_ctl |
---|
| 301 | WRITE(numout,*) ' level of print nn_print = ', nn_print |
---|
| 302 | WRITE(numout,*) ' Start i indice for SUM control nn_ictls = ', nn_ictls |
---|
| 303 | WRITE(numout,*) ' End i indice for SUM control nn_ictle = ', nn_ictle |
---|
| 304 | WRITE(numout,*) ' Start j indice for SUM control nn_jctls = ', nn_jctls |
---|
| 305 | WRITE(numout,*) ' End j indice for SUM control nn_jctle = ', nn_jctle |
---|
| 306 | WRITE(numout,*) ' number of proc. following i nn_isplt = ', nn_isplt |
---|
| 307 | WRITE(numout,*) ' number of proc. following j nn_jsplt = ', nn_jsplt |
---|
| 308 | WRITE(numout,*) ' benchmark parameter (0/1) nn_bench = ', nn_bench |
---|
| 309 | WRITE(numout,*) ' bit comparison mode (0/1) nn_bit_cmp = ', nn_bit_cmp |
---|
[531] | 310 | ENDIF |
---|
| 311 | |
---|
[1601] | 312 | nprint = nn_print ! convert DOCTOR namelist names into OLD names |
---|
| 313 | nictls = nn_ictls |
---|
| 314 | nictle = nn_ictle |
---|
| 315 | njctls = nn_jctls |
---|
| 316 | njctle = nn_jctle |
---|
| 317 | isplt = nn_isplt |
---|
| 318 | jsplt = nn_jsplt |
---|
| 319 | nbench = nn_bench |
---|
| 320 | nbit_cmp = nn_bit_cmp |
---|
| 321 | |
---|
[1593] | 322 | ! ! Parameter control |
---|
| 323 | ! |
---|
| 324 | IF( ln_ctl ) THEN ! sub-domain area indices for the control prints |
---|
| 325 | IF( lk_mpp ) THEN |
---|
| 326 | isplt = jpni ; jsplt = jpnj ; ijsplt = jpni*jpnj ! the domain is forced to the real splitted domain |
---|
[531] | 327 | ELSE |
---|
| 328 | IF( isplt == 1 .AND. jsplt == 1 ) THEN |
---|
[1593] | 329 | CALL ctl_warn( ' - isplt & jsplt are equal to 1', & |
---|
| 330 | & ' - the print control will be done over the whole domain' ) |
---|
[531] | 331 | ENDIF |
---|
[1593] | 332 | ijsplt = isplt * jsplt ! total number of processors ijsplt |
---|
[531] | 333 | ENDIF |
---|
| 334 | IF(lwp) WRITE(numout,*)' - The total number of processors over which the' |
---|
| 335 | IF(lwp) WRITE(numout,*)' print control will be done is ijsplt : ', ijsplt |
---|
[1593] | 336 | ! |
---|
| 337 | ! ! indices used for the SUM control |
---|
| 338 | IF( nictls+nictle+njctls+njctle == 0 ) THEN ! print control done over the default area |
---|
| 339 | lsp_area = .FALSE. |
---|
| 340 | ELSE ! print control done over a specific area |
---|
[531] | 341 | lsp_area = .TRUE. |
---|
| 342 | IF( nictls < 1 .OR. nictls > jpiglo ) THEN |
---|
| 343 | CALL ctl_warn( ' - nictls must be 1<=nictls>=jpiglo, it is forced to 1' ) |
---|
| 344 | nictls = 1 |
---|
| 345 | ENDIF |
---|
| 346 | IF( nictle < 1 .OR. nictle > jpiglo ) THEN |
---|
| 347 | CALL ctl_warn( ' - nictle must be 1<=nictle>=jpiglo, it is forced to jpiglo' ) |
---|
| 348 | nictle = jpiglo |
---|
| 349 | ENDIF |
---|
| 350 | IF( njctls < 1 .OR. njctls > jpjglo ) THEN |
---|
| 351 | CALL ctl_warn( ' - njctls must be 1<=njctls>=jpjglo, it is forced to 1' ) |
---|
| 352 | njctls = 1 |
---|
| 353 | ENDIF |
---|
| 354 | IF( njctle < 1 .OR. njctle > jpjglo ) THEN |
---|
| 355 | CALL ctl_warn( ' - njctle must be 1<=njctle>=jpjglo, it is forced to jpjglo' ) |
---|
| 356 | njctle = jpjglo |
---|
| 357 | ENDIF |
---|
[1593] | 358 | ENDIF |
---|
| 359 | ENDIF |
---|
[531] | 360 | |
---|
[1593] | 361 | IF( nbench == 1 ) THEN ! Benchmark |
---|
[531] | 362 | SELECT CASE ( cp_cfg ) |
---|
[1593] | 363 | CASE ( 'gyre' ) ; CALL ctl_warn( ' The Benchmark is activated ' ) |
---|
| 364 | CASE DEFAULT ; CALL ctl_stop( ' The Benchmark is based on the GYRE configuration:', & |
---|
| 365 | & ' key_gyre must be used or set nbench = 0' ) |
---|
[531] | 366 | END SELECT |
---|
| 367 | ENDIF |
---|
| 368 | |
---|
[1593] | 369 | IF( nbit_cmp == 1 ) THEN ! Bit compare |
---|
| 370 | CALL ctl_warn( ' Bit comparison enabled. Single and multiple processor results must bit compare', & |
---|
| 371 | & ' WARNING: RESULTS ARE NOT PHYSICAL.' ) |
---|
[532] | 372 | ENDIF |
---|
[531] | 373 | |
---|
[1601] | 374 | REWIND( numnam ) ! Read Namelist namdyn_hpg : ln_dynhpg_imp must be read at the initialisation phase |
---|
| 375 | READ ( numnam, namdyn_hpg ) |
---|
[1593] | 376 | ! |
---|
[467] | 377 | END SUBROUTINE opa_flg |
---|
| 378 | |
---|
| 379 | |
---|
| 380 | SUBROUTINE opa_closefile |
---|
| 381 | !!---------------------------------------------------------------------- |
---|
| 382 | !! *** ROUTINE opa_closefile *** |
---|
| 383 | !! |
---|
| 384 | !! ** Purpose : Close the files |
---|
| 385 | !!---------------------------------------------------------------------- |
---|
| 386 | USE dtatem ! temperature data |
---|
| 387 | USE dtasal ! salinity data |
---|
| 388 | !!---------------------------------------------------------------------- |
---|
[1593] | 389 | ! |
---|
| 390 | IF( lk_mpp ) CALL mppsync |
---|
| 391 | ! |
---|
[1685] | 392 | CALL iom_close ! close all input/output files managed by iom_* |
---|
[1593] | 393 | ! |
---|
[1685] | 394 | IF( numstp /= -1 ) CLOSE( numstp ) ! time-step file |
---|
| 395 | IF( numsol /= -1 ) CLOSE( numsol ) ! solver file |
---|
| 396 | IF( numnam /= -1 ) CLOSE( numnam ) ! oce namelist |
---|
| 397 | IF( numnam_ice /= -1 ) CLOSE( numnam_ice ) ! ice namelist |
---|
| 398 | IF( numevo_ice /= -1 ) CLOSE( numevo_ice ) ! ice variables (temp. evolution) |
---|
| 399 | IF( numout /= 6 ) CLOSE( numout ) ! standard model output file |
---|
| 400 | numout = 6 ! redefine numout in case it is used after this point... |
---|
[1593] | 401 | ! |
---|
[467] | 402 | END SUBROUTINE opa_closefile |
---|
| 403 | |
---|
[3] | 404 | !!====================================================================== |
---|
| 405 | END MODULE opa |
---|