[2496] | 1 | MODULE nemogcm |
---|
[2442] | 2 | !!====================================================================== |
---|
[2496] | 3 | !! *** MODULE nemogcm *** |
---|
| 4 | !! Ocean system : NEMO GCM (ocean dynamics, on-line tracers, biochemistry and sea-ice) |
---|
[2442] | 5 | !!====================================================================== |
---|
[9598] | 6 | !! History : 3.6 ! 2015-12 (A. Ryan) Original code (from OCE/) |
---|
[7646] | 7 | !! 4.0 ! 2016-11 (G. Madec, S. Flavoni) domain configuration / user defined interface |
---|
[1593] | 8 | !!---------------------------------------------------------------------- |
---|
[3] | 9 | |
---|
| 10 | !!---------------------------------------------------------------------- |
---|
[7646] | 11 | !! nemo_gcm : solve ocean dynamics, tracer, biogeochemistry and/or sea-ice |
---|
| 12 | !! nemo_init : initialization of the NEMO system |
---|
| 13 | !! nemo_ctl : initialisation of the contol print |
---|
| 14 | !! nemo_closefile: close remaining open files |
---|
| 15 | !! nemo_alloc : dynamical allocation |
---|
[3] | 16 | !!---------------------------------------------------------------------- |
---|
[7646] | 17 | USE step_oce ! module used in the ocean time stepping module (step.F90) |
---|
| 18 | USE domain ! domain initialization (dom_init & dom_cfg routines) |
---|
| 19 | USE istate ! initial state setting (istate_init routine) |
---|
| 20 | USE phycst ! physical constant (par_cst routine) |
---|
| 21 | USE step ! NEMO time-stepping (stp routine) |
---|
| 22 | USE cpl_oasis3 ! OASIS3 coupling |
---|
| 23 | USE diaobs ! Observation diagnostics (dia_obs_init routine) |
---|
[3625] | 24 | #if defined key_nemocice_decomp |
---|
| 25 | USE ice_domain_size, only: nx_global, ny_global |
---|
| 26 | #endif |
---|
[7646] | 27 | ! ! Stand Alone Observation operator modules |
---|
| 28 | USE sao_data |
---|
| 29 | USE sao_intp |
---|
| 30 | ! |
---|
| 31 | USE lib_mpp ! distributed memory computing |
---|
| 32 | USE mppini ! shared/distributed memory setting (mpp_init routine) |
---|
| 33 | USE lbcnfd , ONLY : isendto, nsndto, nfsloop, nfeloop ! Setup of north fold exchanges |
---|
| 34 | USE lib_fortran ! Fortran utilities (allows no signed zero when 'key_nosignedzero' defined) |
---|
[1412] | 35 | #if defined key_iomput |
---|
[7646] | 36 | USE xios ! xIOserver |
---|
[1359] | 37 | #endif |
---|
[268] | 38 | |
---|
[2715] | 39 | IMPLICIT NONE |
---|
[3] | 40 | PRIVATE |
---|
| 41 | |
---|
[4829] | 42 | PUBLIC nemo_gcm ! called by model.F90 |
---|
[2496] | 43 | PUBLIC nemo_init ! needed by AGRIF |
---|
[3764] | 44 | PUBLIC nemo_alloc ! needed by TAM |
---|
[467] | 45 | |
---|
[2498] | 46 | CHARACTER(lc) :: cform_aaa="( /, 'AAAAAAAA', / ) " ! flag for output listing |
---|
[1593] | 47 | |
---|
[3] | 48 | !!---------------------------------------------------------------------- |
---|
[9598] | 49 | !! NEMO/OCE 4.0 , NEMO Consortium (2018) |
---|
[2392] | 50 | !! $Id$ |
---|
[10068] | 51 | !! Software governed by the CeCILL license (see ./LICENSE) |
---|
[3] | 52 | !!---------------------------------------------------------------------- |
---|
| 53 | CONTAINS |
---|
| 54 | |
---|
[4120] | 55 | SUBROUTINE nemo_gcm |
---|
| 56 | !!---------------------------------------------------------------------- |
---|
| 57 | !! *** SUBROUTINE offline_obs_oper *** |
---|
| 58 | !! |
---|
| 59 | !! ** Purpose : To use NEMO components to interpolate model fields |
---|
| 60 | !! to observation space. |
---|
| 61 | !! |
---|
| 62 | !! ** Method : 1. Initialise NEMO |
---|
| 63 | !! 2. Initialise offline obs_oper |
---|
| 64 | !! 3. Cycle through match ups |
---|
| 65 | !! 4. Write results to file |
---|
| 66 | !!---------------------------------------------------------------------- |
---|
[7646] | 67 | ! |
---|
| 68 | CALL nemo_init ! Initialise NEMO |
---|
| 69 | ! |
---|
| 70 | CALL sao_data_init ! Initialise Stand Alone Observation operator data |
---|
| 71 | ! |
---|
| 72 | CALL dia_obs_init ! Initialise obs_operator |
---|
| 73 | ! |
---|
| 74 | CALL sao_interp ! Interpolate to observation space |
---|
| 75 | ! |
---|
| 76 | CALL dia_obs_wri ! Pipe to output files |
---|
| 77 | ! |
---|
| 78 | CALL dia_obs_dealloc ! Reset the obs_oper between |
---|
| 79 | ! |
---|
| 80 | IF(lk_mpp) CALL mppstop ! Safely stop MPI (end mpp communications) |
---|
| 81 | ! |
---|
[4120] | 82 | END SUBROUTINE nemo_gcm |
---|
[389] | 83 | |
---|
[4829] | 84 | |
---|
[2496] | 85 | SUBROUTINE nemo_init |
---|
[389] | 86 | !!---------------------------------------------------------------------- |
---|
[2496] | 87 | !! *** ROUTINE nemo_init *** |
---|
[389] | 88 | !! |
---|
[2496] | 89 | !! ** Purpose : initialization of the NEMO GCM |
---|
[389] | 90 | !!---------------------------------------------------------------------- |
---|
[7646] | 91 | INTEGER :: ji ! dummy loop indices |
---|
| 92 | INTEGER :: ios, ilocal_comm ! local integer |
---|
| 93 | CHARACTER(len=120), DIMENSION(30) :: cltxt, cltxt2, clnam |
---|
[5600] | 94 | ! |
---|
[10570] | 95 | NAMELIST/namctl/ ln_ctl , sn_cfctl, nn_print, nn_ictls, nn_ictle, & |
---|
| 96 | & nn_isplt , nn_jsplt, nn_jctls, nn_jctle, & |
---|
[9019] | 97 | & ln_timing, ln_diacfl |
---|
[9436] | 98 | NAMELIST/namcfg/ ln_read_cfg, cn_domcfg, ln_closea, ln_write_cfg, cn_domcfg_out, ln_use_jattr |
---|
[3] | 99 | !!---------------------------------------------------------------------- |
---|
[1593] | 100 | ! |
---|
[7646] | 101 | cltxt = '' |
---|
| 102 | cltxt2 = '' |
---|
| 103 | clnam = '' |
---|
[5600] | 104 | cxios_context = 'nemo' |
---|
[2496] | 105 | ! |
---|
[4290] | 106 | ! ! Open reference namelist and configuration namelist files |
---|
| 107 | CALL ctl_opn( numnam_ref, 'namelist_ref', 'OLD', 'FORMATTED', 'SEQUENTIAL', -1, 6, .FALSE. ) |
---|
| 108 | CALL ctl_opn( numnam_cfg, 'namelist_cfg', 'OLD', 'FORMATTED', 'SEQUENTIAL', -1, 6, .FALSE. ) |
---|
[1593] | 109 | ! |
---|
[7646] | 110 | REWIND( numnam_ref ) ! Namelist namctl in reference namelist : Control prints |
---|
[4290] | 111 | READ ( numnam_ref, namctl, IOSTAT = ios, ERR = 901 ) |
---|
| 112 | 901 IF( ios /= 0 ) CALL ctl_nam ( ios , 'namctl in reference namelist', .TRUE. ) |
---|
[7646] | 113 | REWIND( numnam_cfg ) ! Namelist namctl in confguration namelist |
---|
[4290] | 114 | READ ( numnam_cfg, namctl, IOSTAT = ios, ERR = 902 ) |
---|
[9169] | 115 | 902 IF( ios > 0 ) CALL ctl_nam ( ios , 'namctl in configuration namelist', .TRUE. ) |
---|
[1593] | 116 | ! |
---|
[7646] | 117 | REWIND( numnam_ref ) ! Namelist namcfg in reference namelist : Control prints |
---|
[4290] | 118 | READ ( numnam_ref, namcfg, IOSTAT = ios, ERR = 903 ) |
---|
[9169] | 119 | 903 IF( ios /= 0 ) CALL ctl_nam ( ios , 'namcfg in reference namelist', .TRUE. ) |
---|
[4290] | 120 | REWIND( numnam_cfg ) ! Namelist namcfg in confguration namelist : Control prints & Benchmark |
---|
| 121 | READ ( numnam_cfg, namcfg, IOSTAT = ios, ERR = 904 ) |
---|
[9169] | 122 | 904 IF( ios > 0 ) CALL ctl_nam ( ios , 'namcfg in configuration namelist', .TRUE. ) |
---|
[4290] | 123 | |
---|
[7646] | 124 | ! !--------------------------! |
---|
| 125 | ! ! Set global domain size ! (control print return in cltxt2) |
---|
| 126 | ! !--------------------------! |
---|
| 127 | IF( ln_read_cfg ) THEN ! Read sizes in domain configuration file |
---|
| 128 | CALL domain_cfg ( cltxt2, cn_cfg, nn_cfg, jpiglo, jpjglo, jpkglo, jperio ) |
---|
| 129 | ! |
---|
| 130 | ELSE ! user-defined namelist |
---|
| 131 | CALL usr_def_nam( cltxt2, clnam, cn_cfg, nn_cfg, jpiglo, jpjglo, jpkglo, jperio ) |
---|
| 132 | ENDIF |
---|
| 133 | ! |
---|
| 134 | ! |
---|
[1593] | 135 | ! !--------------------------------------------! |
---|
| 136 | ! ! set communicator & select the local node ! |
---|
[4624] | 137 | ! ! NB: mynode also opens output.namelist.dyn ! |
---|
| 138 | ! ! on unit number numond on first proc ! |
---|
[1593] | 139 | ! !--------------------------------------------! |
---|
[1412] | 140 | #if defined key_iomput |
---|
[2200] | 141 | IF( Agrif_Root() ) THEN |
---|
[5600] | 142 | IF( lk_oasis ) THEN |
---|
| 143 | CALL cpl_init( "oceanx", ilocal_comm ) ! nemo local communicator given by oasis |
---|
| 144 | CALL xios_initialize( "not used",local_comm=ilocal_comm ) ! send nemo communicator to xios |
---|
| 145 | ELSE |
---|
| 146 | CALL xios_initialize( "for_xios_mpi_id",return_comm=ilocal_comm ) ! nemo local communicator given by xios |
---|
| 147 | ENDIF |
---|
[2200] | 148 | ENDIF |
---|
[5600] | 149 | ! Nodes selection (control print return in cltxt) |
---|
| 150 | narea = mynode( cltxt, 'output.namelist.dyn', numnam_ref, numnam_cfg, numond , nstop, ilocal_comm ) |
---|
[532] | 151 | #else |
---|
[5600] | 152 | IF( lk_oasis ) THEN |
---|
| 153 | IF( Agrif_Root() ) THEN |
---|
| 154 | CALL cpl_init( "oceanx", ilocal_comm ) ! nemo local communicator given by oasis |
---|
| 155 | ENDIF |
---|
| 156 | ! Nodes selection (control print return in cltxt) |
---|
| 157 | narea = mynode( cltxt, 'output.namelist.dyn', numnam_ref, numnam_cfg, numond , nstop, ilocal_comm ) |
---|
| 158 | ELSE |
---|
[9436] | 159 | ilocal_comm = 0 ! Nodes selection (control print return in cltxt) |
---|
[5600] | 160 | narea = mynode( cltxt, 'output.namelist.dyn', numnam_ref, numnam_cfg, numond , nstop ) |
---|
[2236] | 161 | ENDIF |
---|
[532] | 162 | #endif |
---|
[7646] | 163 | |
---|
[2715] | 164 | narea = narea + 1 ! mynode return the rank of proc (0 --> jpnij -1 ) |
---|
[3] | 165 | |
---|
[10570] | 166 | IF( sn_cfctl%l_config ) THEN |
---|
| 167 | ! Activate finer control of report outputs |
---|
| 168 | ! optionally switch off output from selected areas (note this only |
---|
| 169 | ! applies to output which does not involve global communications |
---|
| 170 | IF( ( narea < sn_cfctl%procmin .OR. narea > sn_cfctl%procmax ) .OR. & |
---|
| 171 | & ( MOD( narea - sn_cfctl%procmin, sn_cfctl%procincr ) /= 0 ) ) & |
---|
| 172 | & CALL nemo_set_cfctl( sn_cfctl, .FALSE., .FALSE. ) |
---|
| 173 | ELSE |
---|
| 174 | ! Use ln_ctl to turn on or off all options. |
---|
| 175 | CALL nemo_set_cfctl( sn_cfctl, ln_ctl, .TRUE. ) |
---|
| 176 | ENDIF |
---|
| 177 | |
---|
[4624] | 178 | lwm = (narea == 1) ! control of output namelists |
---|
[2715] | 179 | lwp = (narea == 1) .OR. ln_ctl ! control of all listing output print |
---|
[1579] | 180 | |
---|
[4624] | 181 | IF(lwm) THEN |
---|
| 182 | ! write merged namelists from earlier to output namelist now that the |
---|
| 183 | ! file has been opened in call to mynode. nammpp has already been |
---|
| 184 | ! written in mynode (if lk_mpp_mpi) |
---|
| 185 | WRITE( numond, namctl ) |
---|
| 186 | WRITE( numond, namcfg ) |
---|
[7646] | 187 | IF( .NOT.ln_read_cfg ) THEN |
---|
| 188 | DO ji = 1, SIZE(clnam) |
---|
| 189 | IF( TRIM(clnam(ji)) /= '' ) WRITE(numond, * ) clnam(ji) ! namusr_def print |
---|
| 190 | END DO |
---|
| 191 | ENDIF |
---|
[4624] | 192 | ENDIF |
---|
| 193 | |
---|
[1593] | 194 | IF(lwp) THEN ! open listing units |
---|
| 195 | ! |
---|
[1581] | 196 | CALL ctl_opn( numout, 'ocean.output', 'REPLACE', 'FORMATTED', 'SEQUENTIAL', -1, 6, .FALSE., narea ) |
---|
[1593] | 197 | ! |
---|
[1579] | 198 | WRITE(numout,*) |
---|
[3294] | 199 | WRITE(numout,*) ' CNRS - NERC - Met OFFICE - MERCATOR-ocean - INGV - CMCC' |
---|
[1593] | 200 | WRITE(numout,*) ' NEMO team' |
---|
[5042] | 201 | WRITE(numout,*) ' Stand Alone Observation operator' |
---|
[10570] | 202 | WRITE(numout,*) ' NEMO version 4.0 (2019) ' |
---|
[1579] | 203 | WRITE(numout,*) |
---|
[10570] | 204 | WRITE(numout,*) " ._ ._ ._ ._ ._ " |
---|
| 205 | WRITE(numout,*) " _.-._)`\_.-._)`\_.-._)`\_.-._)`\_.-._)`\_ " |
---|
[1579] | 206 | WRITE(numout,*) |
---|
[10570] | 207 | WRITE(numout,*) " o _, _, " |
---|
| 208 | WRITE(numout,*) " o .' ( .-' / " |
---|
| 209 | WRITE(numout,*) " o _/..._'. .' / " |
---|
| 210 | WRITE(numout,*) " ( o .-'` ` '-./ _.' " |
---|
| 211 | WRITE(numout,*) " ) ( o) ;= <_ ( " |
---|
| 212 | WRITE(numout,*) " ( '-.,\\__ __.-;`\ '. ) " |
---|
| 213 | WRITE(numout,*) " ) ) \) |`\ \) '. \ ( ( " |
---|
| 214 | WRITE(numout,*) " ( ( \_/ '-._\ ) ) " |
---|
| 215 | WRITE(numout,*) " ) ) ` ( ( " |
---|
| 216 | WRITE(numout,*) " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ " |
---|
| 217 | WRITE(numout,*) |
---|
[3764] | 218 | DO ji = 1, SIZE(cltxt) |
---|
[10570] | 219 | IF( TRIM(cltxt (ji)) /= '' ) WRITE(numout,*) TRIM(cltxt(ji)) ! control print of mynode |
---|
[1579] | 220 | END DO |
---|
[7646] | 221 | WRITE(numout,*) |
---|
| 222 | WRITE(numout,*) |
---|
| 223 | DO ji = 1, SIZE(cltxt2) |
---|
[10570] | 224 | IF( TRIM(cltxt2(ji)) /= '' ) WRITE(numout,*) TRIM(cltxt2(ji)) ! control print of domain size |
---|
[7646] | 225 | END DO |
---|
[1593] | 226 | ! |
---|
[7646] | 227 | WRITE(numout,cform_aaa) ! Flag AAAAAAA |
---|
| 228 | ! |
---|
[473] | 229 | ENDIF |
---|
[9436] | 230 | ! ! Domain decomposition |
---|
| 231 | CALL mpp_init ! MPP |
---|
[2715] | 232 | |
---|
[7646] | 233 | ! Now we know the dimensions of the grid and numout has been set: we can allocate arrays |
---|
[2715] | 234 | CALL nemo_alloc() |
---|
| 235 | |
---|
[2496] | 236 | ! !-------------------------------! |
---|
| 237 | ! ! NEMO general initialization ! |
---|
| 238 | ! !-------------------------------! |
---|
[473] | 239 | |
---|
[9436] | 240 | CALL nemo_ctl ! Control prints |
---|
[2382] | 241 | ! |
---|
[9436] | 242 | ! ! General initialization |
---|
| 243 | IF( ln_timing ) CALL timing_init ! timing |
---|
| 244 | IF( ln_timing ) CALL timing_start( 'nemo_init') |
---|
[3294] | 245 | ! |
---|
[9019] | 246 | CALL phy_cst ! Physical constants |
---|
| 247 | CALL eos_init ! Equation of state |
---|
[9367] | 248 | CALL dom_init('SAO') ! Domain |
---|
[413] | 249 | |
---|
[3294] | 250 | |
---|
[9019] | 251 | IF( ln_ctl ) CALL prt_ctl_init ! Print control |
---|
[2027] | 252 | |
---|
[9019] | 253 | CALL istate_init ! ocean initial state (Dynamics and tracers) |
---|
[2496] | 254 | END SUBROUTINE nemo_init |
---|
[467] | 255 | |
---|
| 256 | |
---|
[2496] | 257 | SUBROUTINE nemo_ctl |
---|
[467] | 258 | !!---------------------------------------------------------------------- |
---|
[2496] | 259 | !! *** ROUTINE nemo_ctl *** |
---|
[467] | 260 | !! |
---|
[3764] | 261 | !! ** Purpose : control print setting |
---|
[467] | 262 | !! |
---|
[2442] | 263 | !! ** Method : - print namctl information and check some consistencies |
---|
[467] | 264 | !!---------------------------------------------------------------------- |
---|
[2442] | 265 | ! |
---|
[2496] | 266 | IF(lwp) THEN ! control print |
---|
[531] | 267 | WRITE(numout,*) |
---|
[7646] | 268 | WRITE(numout,*) 'nemo_ctl: Control prints' |
---|
[9436] | 269 | WRITE(numout,*) '~~~~~~~~' |
---|
[1593] | 270 | WRITE(numout,*) ' Namelist namctl' |
---|
[1601] | 271 | WRITE(numout,*) ' run control (for debugging) ln_ctl = ', ln_ctl |
---|
[10570] | 272 | WRITE(numout,*) ' finer control over o/p sn_cfctl%l_config = ', sn_cfctl%l_config |
---|
| 273 | WRITE(numout,*) ' sn_cfctl%l_runstat = ', sn_cfctl%l_runstat |
---|
| 274 | WRITE(numout,*) ' sn_cfctl%l_trcstat = ', sn_cfctl%l_trcstat |
---|
| 275 | WRITE(numout,*) ' sn_cfctl%l_oceout = ', sn_cfctl%l_oceout |
---|
| 276 | WRITE(numout,*) ' sn_cfctl%l_layout = ', sn_cfctl%l_layout |
---|
| 277 | WRITE(numout,*) ' sn_cfctl%l_mppout = ', sn_cfctl%l_mppout |
---|
| 278 | WRITE(numout,*) ' sn_cfctl%l_mpptop = ', sn_cfctl%l_mpptop |
---|
| 279 | WRITE(numout,*) ' sn_cfctl%procmin = ', sn_cfctl%procmin |
---|
| 280 | WRITE(numout,*) ' sn_cfctl%procmax = ', sn_cfctl%procmax |
---|
| 281 | WRITE(numout,*) ' sn_cfctl%procincr = ', sn_cfctl%procincr |
---|
| 282 | WRITE(numout,*) ' sn_cfctl%ptimincr = ', sn_cfctl%ptimincr |
---|
[1601] | 283 | WRITE(numout,*) ' level of print nn_print = ', nn_print |
---|
| 284 | WRITE(numout,*) ' Start i indice for SUM control nn_ictls = ', nn_ictls |
---|
| 285 | WRITE(numout,*) ' End i indice for SUM control nn_ictle = ', nn_ictle |
---|
| 286 | WRITE(numout,*) ' Start j indice for SUM control nn_jctls = ', nn_jctls |
---|
| 287 | WRITE(numout,*) ' End j indice for SUM control nn_jctle = ', nn_jctle |
---|
| 288 | WRITE(numout,*) ' number of proc. following i nn_isplt = ', nn_isplt |
---|
| 289 | WRITE(numout,*) ' number of proc. following j nn_jsplt = ', nn_jsplt |
---|
[9019] | 290 | WRITE(numout,*) ' timing by routine ln_timing = ', ln_timing |
---|
| 291 | WRITE(numout,*) ' CFL diagnostics ln_diacfl = ', ln_diacfl |
---|
[531] | 292 | ENDIF |
---|
[2442] | 293 | ! |
---|
[1601] | 294 | nprint = nn_print ! convert DOCTOR namelist names into OLD names |
---|
| 295 | nictls = nn_ictls |
---|
| 296 | nictle = nn_ictle |
---|
| 297 | njctls = nn_jctls |
---|
| 298 | njctle = nn_jctle |
---|
| 299 | isplt = nn_isplt |
---|
| 300 | jsplt = nn_jsplt |
---|
[4829] | 301 | |
---|
| 302 | IF(lwp) THEN ! control print |
---|
| 303 | WRITE(numout,*) |
---|
| 304 | WRITE(numout,*) ' Namelist namcfg' |
---|
[7646] | 305 | WRITE(numout,*) ' read domain configuration file ln_read_cfg = ', ln_read_cfg |
---|
| 306 | WRITE(numout,*) ' filename to be read cn_domcfg = ', TRIM(cn_domcfg) |
---|
[9436] | 307 | WRITE(numout,*) ' keep closed seas in the domain (if exist) ln_closea = ', ln_closea |
---|
[10570] | 308 | WRITE(numout,*) ' create a configuration definition file ln_write_cfg = ', ln_write_cfg |
---|
[7646] | 309 | WRITE(numout,*) ' filename to be written cn_domcfg_out = ', TRIM(cn_domcfg_out) |
---|
| 310 | WRITE(numout,*) ' use file attribute if exists as i/p j-start ln_use_jattr = ', ln_use_jattr |
---|
[4829] | 311 | ENDIF |
---|
[9436] | 312 | IF( .NOT.ln_read_cfg ) ln_closea = .false. ! dealing possible only with a domcfg file |
---|
| 313 | ! |
---|
[2442] | 314 | ! ! Parameter control |
---|
[1593] | 315 | ! |
---|
| 316 | IF( ln_ctl ) THEN ! sub-domain area indices for the control prints |
---|
[3294] | 317 | IF( lk_mpp .AND. jpnij > 1 ) THEN |
---|
[2496] | 318 | isplt = jpni ; jsplt = jpnj ; ijsplt = jpni*jpnj ! the domain is forced to the real split domain |
---|
[531] | 319 | ELSE |
---|
| 320 | IF( isplt == 1 .AND. jsplt == 1 ) THEN |
---|
[1593] | 321 | CALL ctl_warn( ' - isplt & jsplt are equal to 1', & |
---|
| 322 | & ' - the print control will be done over the whole domain' ) |
---|
[531] | 323 | ENDIF |
---|
[1593] | 324 | ijsplt = isplt * jsplt ! total number of processors ijsplt |
---|
[531] | 325 | ENDIF |
---|
| 326 | IF(lwp) WRITE(numout,*)' - The total number of processors over which the' |
---|
| 327 | IF(lwp) WRITE(numout,*)' print control will be done is ijsplt : ', ijsplt |
---|
[1593] | 328 | ! |
---|
| 329 | ! ! indices used for the SUM control |
---|
| 330 | IF( nictls+nictle+njctls+njctle == 0 ) THEN ! print control done over the default area |
---|
[3764] | 331 | lsp_area = .FALSE. |
---|
[1593] | 332 | ELSE ! print control done over a specific area |
---|
[531] | 333 | lsp_area = .TRUE. |
---|
| 334 | IF( nictls < 1 .OR. nictls > jpiglo ) THEN |
---|
| 335 | CALL ctl_warn( ' - nictls must be 1<=nictls>=jpiglo, it is forced to 1' ) |
---|
| 336 | nictls = 1 |
---|
| 337 | ENDIF |
---|
| 338 | IF( nictle < 1 .OR. nictle > jpiglo ) THEN |
---|
| 339 | CALL ctl_warn( ' - nictle must be 1<=nictle>=jpiglo, it is forced to jpiglo' ) |
---|
| 340 | nictle = jpiglo |
---|
| 341 | ENDIF |
---|
| 342 | IF( njctls < 1 .OR. njctls > jpjglo ) THEN |
---|
| 343 | CALL ctl_warn( ' - njctls must be 1<=njctls>=jpjglo, it is forced to 1' ) |
---|
| 344 | njctls = 1 |
---|
| 345 | ENDIF |
---|
| 346 | IF( njctle < 1 .OR. njctle > jpjglo ) THEN |
---|
| 347 | CALL ctl_warn( ' - njctle must be 1<=njctle>=jpjglo, it is forced to jpjglo' ) |
---|
| 348 | njctle = jpjglo |
---|
| 349 | ENDIF |
---|
[1593] | 350 | ENDIF |
---|
| 351 | ENDIF |
---|
[2442] | 352 | ! |
---|
[10570] | 353 | IF( 1._wp /= SIGN(1._wp,-0._wp) ) CALL ctl_stop( 'nemo_ctl: The intrinsec SIGN function follows f2003 standard.', & |
---|
| 354 | & 'Compile with key_nosignedzero enabled:', & |
---|
| 355 | & '--> add -Dkey_nosignedzero to the definition of %CPP in your arch file' ) |
---|
[3764] | 356 | ! |
---|
[2496] | 357 | END SUBROUTINE nemo_ctl |
---|
[467] | 358 | |
---|
| 359 | |
---|
[2496] | 360 | SUBROUTINE nemo_closefile |
---|
[467] | 361 | !!---------------------------------------------------------------------- |
---|
[2496] | 362 | !! *** ROUTINE nemo_closefile *** |
---|
[467] | 363 | !! |
---|
| 364 | !! ** Purpose : Close the files |
---|
| 365 | !!---------------------------------------------------------------------- |
---|
[1593] | 366 | ! |
---|
| 367 | IF( lk_mpp ) CALL mppsync |
---|
| 368 | ! |
---|
[1685] | 369 | CALL iom_close ! close all input/output files managed by iom_* |
---|
[1593] | 370 | ! |
---|
[4829] | 371 | IF( numstp /= -1 ) CLOSE( numstp ) ! time-step file |
---|
[9019] | 372 | IF( numrun /= -1 ) CLOSE( numrun ) ! run statistics file |
---|
[4829] | 373 | IF( numnam_ref /= -1 ) CLOSE( numnam_ref ) ! oce reference namelist |
---|
| 374 | IF( numnam_cfg /= -1 ) CLOSE( numnam_cfg ) ! oce configuration namelist |
---|
| 375 | IF( lwm.AND.numond /= -1 ) CLOSE( numond ) ! oce output namelist |
---|
| 376 | IF( numnam_ice_ref /= -1 ) CLOSE( numnam_ice_ref ) ! ice reference namelist |
---|
| 377 | IF( numnam_ice_cfg /= -1 ) CLOSE( numnam_ice_cfg ) ! ice configuration namelist |
---|
| 378 | IF( lwm.AND.numoni /= -1 ) CLOSE( numoni ) ! ice output namelist |
---|
| 379 | IF( numevo_ice /= -1 ) CLOSE( numevo_ice ) ! ice variables (temp. evolution) |
---|
| 380 | IF( numout /= 6 ) CLOSE( numout ) ! standard model output file |
---|
| 381 | IF( numdct_vol /= -1 ) CLOSE( numdct_vol ) ! volume transports |
---|
| 382 | IF( numdct_heat /= -1 ) CLOSE( numdct_heat ) ! heat transports |
---|
| 383 | IF( numdct_salt /= -1 ) CLOSE( numdct_salt ) ! salt transports |
---|
[1593] | 384 | ! |
---|
[2442] | 385 | numout = 6 ! redefine numout in case it is used after this point... |
---|
| 386 | ! |
---|
[2496] | 387 | END SUBROUTINE nemo_closefile |
---|
[467] | 388 | |
---|
[2715] | 389 | |
---|
| 390 | SUBROUTINE nemo_alloc |
---|
| 391 | !!---------------------------------------------------------------------- |
---|
| 392 | !! *** ROUTINE nemo_alloc *** |
---|
| 393 | !! |
---|
| 394 | !! ** Purpose : Allocate all the dynamic arrays of the OPA modules |
---|
| 395 | !! |
---|
| 396 | !! ** Method : |
---|
| 397 | !!---------------------------------------------------------------------- |
---|
| 398 | USE diawri , ONLY: dia_wri_alloc |
---|
| 399 | USE dom_oce , ONLY: dom_oce_alloc |
---|
| 400 | ! |
---|
| 401 | INTEGER :: ierr |
---|
| 402 | !!---------------------------------------------------------------------- |
---|
| 403 | ! |
---|
[3764] | 404 | ierr = oce_alloc () ! ocean |
---|
[2715] | 405 | ierr = ierr + dia_wri_alloc () |
---|
| 406 | ierr = ierr + dom_oce_alloc () ! ocean domain |
---|
| 407 | ! |
---|
[10425] | 408 | CALL mpp_sum( 'nemogcm', ierr ) |
---|
[2715] | 409 | IF( ierr /= 0 ) CALL ctl_stop( 'STOP', 'nemo_alloc : unable to allocate standard ocean arrays' ) |
---|
| 410 | ! |
---|
| 411 | END SUBROUTINE nemo_alloc |
---|
| 412 | |
---|
[10570] | 413 | SUBROUTINE nemo_set_cfctl(sn_cfctl, setto, for_all ) |
---|
| 414 | !!---------------------------------------------------------------------- |
---|
| 415 | !! *** ROUTINE nemo_set_cfctl *** |
---|
| 416 | !! |
---|
| 417 | !! ** Purpose : Set elements of the output control structure to setto. |
---|
| 418 | !! for_all should be .false. unless all areas are to be |
---|
| 419 | !! treated identically. |
---|
| 420 | !! |
---|
| 421 | !! ** Method : Note this routine can be used to switch on/off some |
---|
| 422 | !! types of output for selected areas but any output types |
---|
| 423 | !! that involve global communications (e.g. mpp_max, glob_sum) |
---|
| 424 | !! should be protected from selective switching by the |
---|
| 425 | !! for_all argument |
---|
| 426 | !!---------------------------------------------------------------------- |
---|
| 427 | LOGICAL :: setto, for_all |
---|
[10601] | 428 | TYPE(sn_ctl) :: sn_cfctl |
---|
[10570] | 429 | !!---------------------------------------------------------------------- |
---|
| 430 | IF( for_all ) THEN |
---|
| 431 | sn_cfctl%l_runstat = setto |
---|
| 432 | sn_cfctl%l_trcstat = setto |
---|
| 433 | ENDIF |
---|
| 434 | sn_cfctl%l_oceout = setto |
---|
| 435 | sn_cfctl%l_layout = setto |
---|
| 436 | sn_cfctl%l_mppout = setto |
---|
| 437 | sn_cfctl%l_mpptop = setto |
---|
| 438 | END SUBROUTINE nemo_set_cfctl |
---|
| 439 | |
---|
[3] | 440 | !!====================================================================== |
---|
[2496] | 441 | END MODULE nemogcm |
---|
[4829] | 442 | |
---|