[6951] | 1 | MODULE nemogcm |
---|
| 2 | !!====================================================================== |
---|
| 3 | !! *** MODULE nemogcm *** |
---|
| 4 | !! Ocean system : NEMO GCM (ocean dynamics, on-line tracers, biochemistry and sea-ice) |
---|
| 5 | !!====================================================================== |
---|
| 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.3 ! 2010-05 (K. Mogensen, A. Weaver, M. Martin, D. Lea) Assimilation interface |
---|
| 28 | !! - ! 2010-10 (C. Ethe, G. Madec) reorganisation of initialisation phase |
---|
| 29 | !! 3.3.1! 2011-01 (A. R. Porter, STFC Daresbury) dynamical allocation |
---|
| 30 | !! 3.4 ! 2011-10 (A. C. Coward, NOCS & J. Donners, PRACE) add nemo_northcomms |
---|
| 31 | !! - ! 2011-11 (C. Harris) decomposition changes for running with CICE |
---|
| 32 | !! 3.6 ! 2012-05 (C. Calone, J. Simeon, G. Madec, C. Ethe) Add grid coarsening |
---|
| 33 | !! - ! 2013-06 (I. Epicoco, S. Mocavero, CMCC) nemo_northcomms: setup avoiding MPI communication |
---|
| 34 | !! - ! 2014-12 (G. Madec) remove KPP scheme and cross-land advection (cla) |
---|
| 35 | !!---------------------------------------------------------------------- |
---|
| 36 | |
---|
| 37 | !!---------------------------------------------------------------------- |
---|
| 38 | !! nemo_gcm : solve ocean dynamics, tracer, biogeochemistry and/or sea-ice |
---|
| 39 | !! nemo_init : initialization of the NEMO system |
---|
| 40 | !! nemo_ctl : initialisation of the contol print |
---|
| 41 | !! nemo_closefile: close remaining open files |
---|
| 42 | !! nemo_alloc : dynamical allocation |
---|
| 43 | !! nemo_partition: calculate MPP domain decomposition |
---|
| 44 | !! factorise : calculate the factors of the no. of MPI processes |
---|
| 45 | !!---------------------------------------------------------------------- |
---|
[11129] | 46 | USE dom_oce ! ocean space and time domain variables |
---|
| 47 | USE in_out_manager ! I/O manager |
---|
| 48 | USE iom ! |
---|
[6951] | 49 | USE domcfg ! domain configuration (dom_cfg routine) |
---|
| 50 | USE mppini ! shared/distributed memory setting (mpp_init routine) |
---|
| 51 | USE domain ! domain initialization (dom_init routine) |
---|
| 52 | USE phycst ! physical constant (par_cst routine) |
---|
| 53 | USE lib_fortran ! Fortran utilities (allows no signed zero when 'key_nosignedzero' defined) |
---|
| 54 | USE lib_mpp ! distributed memory computing |
---|
| 55 | |
---|
| 56 | USE lbcnfd , ONLY : isendto, nsndto, nfsloop, nfeloop ! Setup of north fold exchanges |
---|
| 57 | |
---|
| 58 | IMPLICIT NONE |
---|
| 59 | PRIVATE |
---|
| 60 | |
---|
| 61 | PUBLIC nemo_gcm ! called by model.F90 |
---|
| 62 | PUBLIC nemo_init ! needed by AGRIF |
---|
| 63 | PUBLIC nemo_alloc ! needed by TAM |
---|
| 64 | |
---|
| 65 | CHARACTER(lc) :: cform_aaa="( /, 'AAAAAAAA', / ) " ! flag for output listing |
---|
[10727] | 66 | |
---|
| 67 | #if defined key_agrif |
---|
| 68 | external agrif_boundary_connections, agrif_update_all, agrif_recompute_scalefactors |
---|
| 69 | #endif |
---|
[6951] | 70 | |
---|
| 71 | !!---------------------------------------------------------------------- |
---|
| 72 | !! NEMO/OPA 3.7 , NEMO Consortium (2015) |
---|
| 73 | !! $Id: nemogcm.F90 6152 2015-12-21 22:33:57Z acc $ |
---|
[9598] | 74 | !! Software governed by the CeCILL licence (./LICENSE) |
---|
[6951] | 75 | !!---------------------------------------------------------------------- |
---|
| 76 | CONTAINS |
---|
| 77 | |
---|
| 78 | SUBROUTINE nemo_gcm |
---|
| 79 | !!---------------------------------------------------------------------- |
---|
| 80 | !! *** ROUTINE nemo_gcm *** |
---|
| 81 | !! |
---|
| 82 | !! ** Purpose : NEMO solves the primitive equations on an orthogonal |
---|
| 83 | !! curvilinear mesh on the sphere. |
---|
| 84 | !! |
---|
| 85 | !! ** Method : - model general initialization |
---|
| 86 | !! - launch the time-stepping (stp routine) |
---|
| 87 | !! - finalize the run by closing files and communications |
---|
| 88 | !! |
---|
| 89 | !! References : Madec, Delecluse, Imbard, and Levy, 1997: internal report, IPSL. |
---|
| 90 | !! Madec, 2008, internal report, IPSL. |
---|
| 91 | !!---------------------------------------------------------------------- |
---|
| 92 | INTEGER :: istp ! time step index |
---|
| 93 | !!---------------------------------------------------------------------- |
---|
| 94 | ! |
---|
[10727] | 95 | #if defined key_agrif |
---|
| 96 | CALL Agrif_Init_Grids() ! AGRIF: set the meshes |
---|
| 97 | #endif |
---|
[6951] | 98 | ! !-----------------------! |
---|
| 99 | CALL nemo_init !== Initialisations ==! |
---|
| 100 | ! !-----------------------! |
---|
| 101 | |
---|
[10727] | 102 | #if defined key_agrif |
---|
| 103 | CALL Agrif_Regrid() |
---|
| 104 | |
---|
| 105 | CALL Agrif_Step_Child(agrif_boundary_connections) |
---|
| 106 | |
---|
| 107 | CALL Agrif_Step_Child_adj(agrif_update_all) |
---|
| 108 | |
---|
| 109 | CALL Agrif_Step_Child(agrif_recompute_scalefactors) |
---|
| 110 | |
---|
| 111 | CALL Agrif_Step_Child(cfg_write) |
---|
| 112 | #endif |
---|
| 113 | |
---|
[6951] | 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! |
---|
[10727] | 116 | IF( lk_mpp ) CALL mpp_max( 'nemogcm',nstop ) |
---|
[6951] | 117 | |
---|
| 118 | IF(lwp) WRITE(numout,cform_aaa) ! Flag AAAAAAA |
---|
| 119 | |
---|
| 120 | ! !-----------------------! |
---|
| 121 | ! !== finalize the run ==! |
---|
| 122 | ! !------------------------! |
---|
| 123 | ! |
---|
| 124 | IF( nstop /= 0 .AND. lwp ) THEN ! error print |
---|
| 125 | WRITE(numout,cform_err) |
---|
| 126 | WRITE(numout,*) nstop, ' error have been found' |
---|
| 127 | ENDIF |
---|
| 128 | ! |
---|
| 129 | ! |
---|
| 130 | CALL nemo_closefile |
---|
| 131 | ! |
---|
| 132 | ! |
---|
| 133 | END SUBROUTINE nemo_gcm |
---|
| 134 | |
---|
| 135 | |
---|
| 136 | SUBROUTINE nemo_init |
---|
| 137 | !!---------------------------------------------------------------------- |
---|
| 138 | !! *** ROUTINE nemo_init *** |
---|
| 139 | !! |
---|
| 140 | !! ** Purpose : initialization of the NEMO GCM |
---|
| 141 | !!---------------------------------------------------------------------- |
---|
[10727] | 142 | INTEGER :: ji ! dummy loop indices |
---|
| 143 | INTEGER :: ios, ilocal_comm ! local integers |
---|
| 144 | CHARACTER(len=120), DIMENSION(60) :: cltxt, cltxt2, clnam |
---|
[11129] | 145 | !! |
---|
| 146 | NAMELIST/namctl/ ln_ctl , sn_cfctl, nn_print, nn_ictls, nn_ictle, & |
---|
| 147 | & nn_isplt , nn_jsplt, nn_jctls, nn_jctle, & |
---|
| 148 | & ln_timing, ln_diacfl |
---|
[7200] | 149 | NAMELIST/namcfg/ ln_e3_dep, & |
---|
[7189] | 150 | & cp_cfg, cp_cfz, jp_cfg, jpidta, jpjdta, jpkdta, jpiglo, jpjglo, & |
---|
[6951] | 151 | & jpizoom, jpjzoom, jperio, ln_use_jattr |
---|
| 152 | !!---------------------------------------------------------------------- |
---|
| 153 | ! |
---|
| 154 | cltxt = '' |
---|
| 155 | ! |
---|
| 156 | ! ! Open reference namelist and configuration namelist files |
---|
| 157 | CALL ctl_opn( numnam_ref, 'namelist_ref', 'OLD', 'FORMATTED', 'SEQUENTIAL', -1, 6, .FALSE. ) |
---|
| 158 | CALL ctl_opn( numnam_cfg, 'namelist_cfg', 'OLD', 'FORMATTED', 'SEQUENTIAL', -1, 6, .FALSE. ) |
---|
| 159 | ! |
---|
[11129] | 160 | REWIND( numnam_ref ) ! Namelist namctl in reference namelist |
---|
[6951] | 161 | READ ( numnam_ref, namctl, IOSTAT = ios, ERR = 901 ) |
---|
[11129] | 162 | 901 IF( ios /= 0 ) CALL ctl_nam ( ios , 'namctl in reference namelist', .TRUE. ) |
---|
| 163 | REWIND( numnam_cfg ) ! Namelist namctl in confguration namelist |
---|
[6951] | 164 | READ ( numnam_cfg, namctl, IOSTAT = ios, ERR = 902 ) |
---|
[11129] | 165 | 902 IF( ios > 0 ) CALL ctl_nam ( ios , 'namctl in configuration namelist', .TRUE. ) |
---|
[6951] | 166 | ! |
---|
[11129] | 167 | REWIND( numnam_ref ) ! Namelist namcfg in reference namelist |
---|
[6951] | 168 | READ ( numnam_ref, namcfg, IOSTAT = ios, ERR = 903 ) |
---|
[11129] | 169 | 903 IF( ios /= 0 ) CALL ctl_nam ( ios , 'namcfg in reference namelist', .TRUE. ) |
---|
| 170 | REWIND( numnam_cfg ) ! Namelist namcfg in confguration namelist |
---|
[6951] | 171 | READ ( numnam_cfg, namcfg, IOSTAT = ios, ERR = 904 ) |
---|
[11129] | 172 | 904 IF( ios > 0 ) CALL ctl_nam ( ios , 'namcfg in configuration namelist', .TRUE. ) |
---|
[6951] | 173 | |
---|
| 174 | ! Force values for AGRIF zoom (cf. agrif_user.F90) |
---|
| 175 | ! |
---|
| 176 | ! !--------------------------------------------! |
---|
| 177 | ! ! set communicator & select the local node ! |
---|
| 178 | ! ! NB: mynode also opens output.namelist.dyn ! |
---|
| 179 | ! ! on unit number numond on first proc ! |
---|
| 180 | ! !--------------------------------------------! |
---|
| 181 | ! Nodes selection (control print return in cltxt) |
---|
[9079] | 182 | narea = mynode( cltxt, 'output.namelist.dyn', numnam_ref, numnam_cfg, numond , nstop ) |
---|
[6951] | 183 | narea = narea + 1 ! mynode return the rank of proc (0 --> jpnij -1 ) |
---|
| 184 | |
---|
| 185 | lwm = (narea == 1) ! control of output namelists |
---|
| 186 | lwp = (narea == 1) .OR. ln_ctl ! control of all listing output print |
---|
| 187 | |
---|
| 188 | IF(lwm) THEN |
---|
| 189 | ! write merged namelists from earlier to output namelist now that the |
---|
| 190 | ! file has been opened in call to mynode. nammpp has already been |
---|
| 191 | ! written in mynode (if lk_mpp_mpi) |
---|
| 192 | WRITE( numond, namctl ) |
---|
| 193 | WRITE( numond, namcfg ) |
---|
| 194 | ENDIF |
---|
| 195 | |
---|
[10727] | 196 | IF(lwp) THEN ! open listing units |
---|
[6951] | 197 | ! |
---|
| 198 | CALL ctl_opn( numout, 'ocean.output', 'REPLACE', 'FORMATTED', 'SEQUENTIAL', -1, 6, .FALSE., narea ) |
---|
| 199 | ! |
---|
| 200 | WRITE(numout,*) |
---|
| 201 | WRITE(numout,*) ' CNRS - NERC - Met OFFICE - MERCATOR-ocean - INGV - CMCC' |
---|
| 202 | WRITE(numout,*) ' NEMO team' |
---|
| 203 | WRITE(numout,*) ' Ocean General Circulation Model' |
---|
[10727] | 204 | WRITE(numout,*) ' NEMO version 4.0 (2019) ' |
---|
[6951] | 205 | WRITE(numout,*) |
---|
[10727] | 206 | WRITE(numout,*) " ._ ._ ._ ._ ._ " |
---|
| 207 | WRITE(numout,*) " _.-._)`\_.-._)`\_.-._)`\_.-._)`\_.-._)`\_ " |
---|
[6951] | 208 | WRITE(numout,*) |
---|
[10727] | 209 | WRITE(numout,*) " o _, _, " |
---|
| 210 | WRITE(numout,*) " o .' ( .-' / " |
---|
| 211 | WRITE(numout,*) " o _/..._'. .' / " |
---|
| 212 | WRITE(numout,*) " ( o .-'` ` '-./ _.' " |
---|
| 213 | WRITE(numout,*) " ) ( o) ;= <_ ( " |
---|
| 214 | WRITE(numout,*) " ( '-.,\\__ __.-;`\ '. ) " |
---|
| 215 | WRITE(numout,*) " ) ) \) |`\ \) '. \ ( ( " |
---|
| 216 | WRITE(numout,*) " ( ( \_/ '-._\ ) ) " |
---|
| 217 | WRITE(numout,*) " ) ) ` ( ( " |
---|
| 218 | WRITE(numout,*) " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ " |
---|
| 219 | WRITE(numout,*) |
---|
| 220 | |
---|
[6951] | 221 | DO ji = 1, SIZE(cltxt) |
---|
[10727] | 222 | IF( TRIM(cltxt (ji)) /= '' ) WRITE(numout,*) TRIM(cltxt(ji)) ! control print of mynode |
---|
[6951] | 223 | END DO |
---|
[10727] | 224 | WRITE(numout,*) |
---|
| 225 | WRITE(numout,*) |
---|
| 226 | ! DO ji = 1, SIZE(cltxt2) |
---|
| 227 | ! IF( TRIM(cltxt2(ji)) /= '' ) WRITE(numout,*) TRIM(cltxt2(ji)) ! control print of domain size |
---|
| 228 | ! END DO |
---|
[6951] | 229 | ! |
---|
[10727] | 230 | WRITE(numout,cform_aaa) ! Flag AAAAAAA |
---|
| 231 | ! |
---|
[6951] | 232 | ENDIF |
---|
[10727] | 233 | ! open /dev/null file to be able to supress output write easily |
---|
| 234 | ! CALL ctl_opn( numnul, '/dev/null', 'REPLACE', 'FORMATTED', 'SEQUENTIAL', -1, 6, .FALSE. ) |
---|
| 235 | ! |
---|
| 236 | ! ! Domain decomposition |
---|
| 237 | CALL mpp_init ! MPP |
---|
[6951] | 238 | |
---|
[10727] | 239 | ! IF( Agrif_Root() ) THEN |
---|
| 240 | ! jpi = ( jpiglo -2*jpreci + (jpni-1) ) / jpni + 2*jpreci ! first dim. |
---|
| 241 | ! jpj = ( jpjglo -2*jprecj + (jpnj-1) ) / jpnj + 2*jprecj ! second dim. |
---|
| 242 | ! ENDIF |
---|
| 243 | jpk = jpkdta ! third dim |
---|
| 244 | jpim1 = jpi-1 ! inner domain indices |
---|
| 245 | jpjm1 = jpj-1 ! " " |
---|
| 246 | jpkm1 = jpk-1 ! " " |
---|
| 247 | jpij = jpi*jpj ! jpi x j |
---|
| 248 | |
---|
| 249 | #if defined key_agrif |
---|
| 250 | CALL Agrif_Declare_Var |
---|
| 251 | #endif |
---|
| 252 | |
---|
| 253 | ! Now we know the dimensions of the grid and numout has been set: we can allocate arrays |
---|
[6951] | 254 | CALL nemo_alloc() |
---|
| 255 | |
---|
| 256 | ! !-------------------------------! |
---|
| 257 | ! ! NEMO general initialization ! |
---|
| 258 | ! !-------------------------------! |
---|
| 259 | |
---|
| 260 | CALL nemo_ctl ! Control prints & Benchmark |
---|
| 261 | |
---|
| 262 | ! ! Domain decomposition |
---|
[10727] | 263 | ! |
---|
[6951] | 264 | ! ! General initialization |
---|
| 265 | CALL phy_cst ! Physical constants |
---|
| 266 | CALL dom_cfg ! Domain configuration |
---|
| 267 | CALL dom_init ! Domain |
---|
| 268 | ! |
---|
| 269 | END SUBROUTINE nemo_init |
---|
| 270 | |
---|
| 271 | |
---|
| 272 | SUBROUTINE nemo_ctl |
---|
| 273 | !!---------------------------------------------------------------------- |
---|
| 274 | !! *** ROUTINE nemo_ctl *** |
---|
| 275 | !! |
---|
| 276 | !! ** Purpose : control print setting |
---|
| 277 | !! |
---|
| 278 | !! ** Method : - print namctl information and check some consistencies |
---|
| 279 | !!---------------------------------------------------------------------- |
---|
| 280 | ! |
---|
| 281 | IF(lwp) THEN ! control print |
---|
| 282 | WRITE(numout,*) |
---|
[10727] | 283 | WRITE(numout,*) 'nemo_ctl: Control prints' |
---|
| 284 | WRITE(numout,*) '~~~~~~~~' |
---|
[6951] | 285 | WRITE(numout,*) ' Namelist namctl' |
---|
| 286 | WRITE(numout,*) ' run control (for debugging) ln_ctl = ', ln_ctl |
---|
[10727] | 287 | WRITE(numout,*) ' finer control over o/p sn_cfctl%l_config = ', sn_cfctl%l_config |
---|
| 288 | WRITE(numout,*) ' sn_cfctl%l_runstat = ', sn_cfctl%l_runstat |
---|
| 289 | WRITE(numout,*) ' sn_cfctl%l_trcstat = ', sn_cfctl%l_trcstat |
---|
| 290 | WRITE(numout,*) ' sn_cfctl%l_oceout = ', sn_cfctl%l_oceout |
---|
| 291 | WRITE(numout,*) ' sn_cfctl%l_layout = ', sn_cfctl%l_layout |
---|
| 292 | WRITE(numout,*) ' sn_cfctl%l_mppout = ', sn_cfctl%l_mppout |
---|
| 293 | WRITE(numout,*) ' sn_cfctl%l_mpptop = ', sn_cfctl%l_mpptop |
---|
| 294 | WRITE(numout,*) ' sn_cfctl%procmin = ', sn_cfctl%procmin |
---|
| 295 | WRITE(numout,*) ' sn_cfctl%procmax = ', sn_cfctl%procmax |
---|
| 296 | WRITE(numout,*) ' sn_cfctl%procincr = ', sn_cfctl%procincr |
---|
| 297 | WRITE(numout,*) ' sn_cfctl%ptimincr = ', sn_cfctl%ptimincr |
---|
[6951] | 298 | WRITE(numout,*) ' level of print nn_print = ', nn_print |
---|
| 299 | WRITE(numout,*) ' Start i indice for SUM control nn_ictls = ', nn_ictls |
---|
| 300 | WRITE(numout,*) ' End i indice for SUM control nn_ictle = ', nn_ictle |
---|
| 301 | WRITE(numout,*) ' Start j indice for SUM control nn_jctls = ', nn_jctls |
---|
| 302 | WRITE(numout,*) ' End j indice for SUM control nn_jctle = ', nn_jctle |
---|
| 303 | WRITE(numout,*) ' number of proc. following i nn_isplt = ', nn_isplt |
---|
| 304 | WRITE(numout,*) ' number of proc. following j nn_jsplt = ', nn_jsplt |
---|
[10727] | 305 | WRITE(numout,*) ' timing by routine ln_timing = ', ln_timing |
---|
| 306 | WRITE(numout,*) ' CFL diagnostics ln_diacfl = ', ln_diacfl |
---|
[6951] | 307 | ENDIF |
---|
| 308 | ! |
---|
| 309 | nprint = nn_print ! convert DOCTOR namelist names into OLD names |
---|
| 310 | nictls = nn_ictls |
---|
| 311 | nictle = nn_ictle |
---|
| 312 | njctls = nn_jctls |
---|
| 313 | njctle = nn_jctle |
---|
| 314 | isplt = nn_isplt |
---|
| 315 | jsplt = nn_jsplt |
---|
| 316 | |
---|
[10727] | 317 | ! IF( .NOT.ln_read_cfg ) ln_closea = .false. ! dealing possible only with a domcfg file |
---|
| 318 | ! |
---|
[6951] | 319 | ! ! Parameter control |
---|
| 320 | ! |
---|
| 321 | IF( ln_ctl ) THEN ! sub-domain area indices for the control prints |
---|
| 322 | IF( lk_mpp .AND. jpnij > 1 ) THEN |
---|
| 323 | isplt = jpni ; jsplt = jpnj ; ijsplt = jpni*jpnj ! the domain is forced to the real split domain |
---|
| 324 | ELSE |
---|
| 325 | IF( isplt == 1 .AND. jsplt == 1 ) THEN |
---|
| 326 | CALL ctl_warn( ' - isplt & jsplt are equal to 1', & |
---|
| 327 | & ' - the print control will be done over the whole domain' ) |
---|
| 328 | ENDIF |
---|
| 329 | ijsplt = isplt * jsplt ! total number of processors ijsplt |
---|
| 330 | ENDIF |
---|
| 331 | IF(lwp) WRITE(numout,*)' - The total number of processors over which the' |
---|
| 332 | IF(lwp) WRITE(numout,*)' print control will be done is ijsplt : ', ijsplt |
---|
| 333 | ! |
---|
| 334 | ! ! indices used for the SUM control |
---|
| 335 | IF( nictls+nictle+njctls+njctle == 0 ) THEN ! print control done over the default area |
---|
| 336 | lsp_area = .FALSE. |
---|
| 337 | ELSE ! print control done over a specific area |
---|
| 338 | lsp_area = .TRUE. |
---|
| 339 | IF( nictls < 1 .OR. nictls > jpiglo ) THEN |
---|
| 340 | CALL ctl_warn( ' - nictls must be 1<=nictls>=jpiglo, it is forced to 1' ) |
---|
| 341 | nictls = 1 |
---|
| 342 | ENDIF |
---|
| 343 | IF( nictle < 1 .OR. nictle > jpiglo ) THEN |
---|
| 344 | CALL ctl_warn( ' - nictle must be 1<=nictle>=jpiglo, it is forced to jpiglo' ) |
---|
| 345 | nictle = jpiglo |
---|
| 346 | ENDIF |
---|
| 347 | IF( njctls < 1 .OR. njctls > jpjglo ) THEN |
---|
| 348 | CALL ctl_warn( ' - njctls must be 1<=njctls>=jpjglo, it is forced to 1' ) |
---|
| 349 | njctls = 1 |
---|
| 350 | ENDIF |
---|
| 351 | IF( njctle < 1 .OR. njctle > jpjglo ) THEN |
---|
| 352 | CALL ctl_warn( ' - njctle must be 1<=njctle>=jpjglo, it is forced to jpjglo' ) |
---|
| 353 | njctle = jpjglo |
---|
| 354 | ENDIF |
---|
| 355 | ENDIF |
---|
| 356 | ENDIF |
---|
| 357 | ! |
---|
[10727] | 358 | ! IF( 1._wp /= SIGN(1._wp,-0._wp) ) CALL ctl_stop( 'nemo_ctl: The intrinsec SIGN function follows f2003 standard.', & |
---|
| 359 | ! & 'Compile with key_nosignedzero enabled:', & |
---|
| 360 | ! & '--> add -Dkey_nosignedzero to the definition of %CPP in your arch file' ) |
---|
[6951] | 361 | ! |
---|
[10727] | 362 | #if defined key_agrif |
---|
| 363 | IF( ln_timing ) CALL ctl_stop( 'AGRIF not implemented with ln_timing = true') |
---|
| 364 | #endif |
---|
| 365 | ! |
---|
[6951] | 366 | END SUBROUTINE nemo_ctl |
---|
| 367 | |
---|
| 368 | |
---|
| 369 | SUBROUTINE nemo_closefile |
---|
| 370 | !!---------------------------------------------------------------------- |
---|
| 371 | !! *** ROUTINE nemo_closefile *** |
---|
| 372 | !! |
---|
| 373 | !! ** Purpose : Close the files |
---|
| 374 | !!---------------------------------------------------------------------- |
---|
| 375 | ! |
---|
| 376 | IF( lk_mpp ) CALL mppsync |
---|
| 377 | ! |
---|
| 378 | CALL iom_close ! close all input/output files managed by iom_* |
---|
| 379 | ! |
---|
| 380 | IF( numstp /= -1 ) CLOSE( numstp ) ! time-step file |
---|
| 381 | IF( numnam_ref /= -1 ) CLOSE( numnam_ref ) ! oce reference namelist |
---|
| 382 | IF( numnam_cfg /= -1 ) CLOSE( numnam_cfg ) ! oce configuration namelist |
---|
| 383 | IF( lwm.AND.numond /= -1 ) CLOSE( numond ) ! oce output namelist |
---|
| 384 | IF( numnam_ice_ref /= -1 ) CLOSE( numnam_ice_ref ) ! ice reference namelist |
---|
| 385 | IF( numnam_ice_cfg /= -1 ) CLOSE( numnam_ice_cfg ) ! ice configuration namelist |
---|
| 386 | IF( lwm.AND.numoni /= -1 ) CLOSE( numoni ) ! ice output namelist |
---|
| 387 | IF( numevo_ice /= -1 ) CLOSE( numevo_ice ) ! ice variables (temp. evolution) |
---|
| 388 | IF( numout /= 6 ) CLOSE( numout ) ! standard model output file |
---|
| 389 | IF( numdct_vol /= -1 ) CLOSE( numdct_vol ) ! volume transports |
---|
| 390 | IF( numdct_heat /= -1 ) CLOSE( numdct_heat ) ! heat transports |
---|
| 391 | IF( numdct_salt /= -1 ) CLOSE( numdct_salt ) ! salt transports |
---|
| 392 | ! |
---|
| 393 | numout = 6 ! redefine numout in case it is used after this point... |
---|
| 394 | ! |
---|
| 395 | END SUBROUTINE nemo_closefile |
---|
| 396 | |
---|
| 397 | |
---|
| 398 | SUBROUTINE nemo_alloc |
---|
| 399 | !!---------------------------------------------------------------------- |
---|
| 400 | !! *** ROUTINE nemo_alloc *** |
---|
| 401 | !! |
---|
| 402 | !! ** Purpose : Allocate all the dynamic arrays of the OPA modules |
---|
| 403 | !! |
---|
| 404 | !! ** Method : |
---|
| 405 | !!---------------------------------------------------------------------- |
---|
| 406 | USE dom_oce , ONLY: dom_oce_alloc |
---|
| 407 | ! |
---|
| 408 | INTEGER :: ierr |
---|
| 409 | !!---------------------------------------------------------------------- |
---|
| 410 | ! |
---|
[11129] | 411 | ierr = dom_oce_alloc () ! ocean domain |
---|
[6951] | 412 | ! |
---|
[10727] | 413 | CALL mpp_sum( 'nemogcm', ierr ) |
---|
[6951] | 414 | IF( ierr /= 0 ) CALL ctl_stop( 'STOP', 'nemo_alloc : unable to allocate standard ocean arrays' ) |
---|
| 415 | ! |
---|
| 416 | END SUBROUTINE nemo_alloc |
---|
| 417 | |
---|
| 418 | |
---|
| 419 | |
---|
| 420 | !!====================================================================== |
---|
| 421 | END MODULE nemogcm |
---|
| 422 | |
---|