1 | MODULE nemogcm |
---|
2 | !!====================================================================== |
---|
3 | !! *** MODULE nemogcm *** |
---|
4 | !! Ocean system : NEMO GCM (ocean dynamics, on-line tracers, biochemistry and sea-ice) |
---|
5 | !!====================================================================== |
---|
6 | !! History : 4.0 ! 2020-05 (A. Nasser, G. Madec) Original code from 4.0.2 |
---|
7 | !! - ! 2020-10 (S. Techene, G. Madec) cleanning |
---|
8 | !!---------------------------------------------------------------------- |
---|
9 | |
---|
10 | !!---------------------------------------------------------------------- |
---|
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 |
---|
16 | !!---------------------------------------------------------------------- |
---|
17 | USE step_oce ! module used in the ocean time stepping module (step.F90) |
---|
18 | ! |
---|
19 | USE phycst ! physical constant (par_cst routine) |
---|
20 | USE domain ! domain initialization (dom_init & dom_cfg routines) |
---|
21 | USE usrdef_nam ! user defined configuration |
---|
22 | USE bdyini ! open boundary cond. setting (bdy_init routine) |
---|
23 | USE istate ! initial state setting (istate_init routine) |
---|
24 | USE wet_dry , ONLY : ln_wd_il, ln_wd_dl, ln_wd_dl_bc ! switch off wetting and drying |
---|
25 | USE isf_oce , ONLY : ln_isf ! ice shelf |
---|
26 | USE trd_oce , ONLY : l_trddyn ! dynamical trend logical |
---|
27 | USE dia25h , ONLY : ln_dia25h ! 25h mean output |
---|
28 | #if defined key_RK3 |
---|
29 | USE stprk3 ! NEMO time-stepping (stp_RK3 routine) |
---|
30 | #else |
---|
31 | USE stpmlf ! NEMO time-stepping (stp_MLF routine) |
---|
32 | #endif |
---|
33 | ! |
---|
34 | USE lib_mpp ! distributed memory computing |
---|
35 | USE mppini ! shared/distributed memory setting (mpp_init routine) |
---|
36 | USE lib_fortran ! Fortran utilities (allows no signed zero when 'key_nosignedzero' defined) |
---|
37 | USE halo_mng ! halo manager |
---|
38 | |
---|
39 | IMPLICIT NONE |
---|
40 | PRIVATE |
---|
41 | |
---|
42 | PUBLIC nemo_gcm ! called by model.F90 |
---|
43 | PUBLIC nemo_init ! needed by AGRIF |
---|
44 | PUBLIC nemo_alloc ! needed by TAM |
---|
45 | |
---|
46 | CHARACTER(lc) :: cform_aaa="( /, 'AAAAAAAA', / ) " ! flag for output listing |
---|
47 | |
---|
48 | #if ! defined key_mpi_off |
---|
49 | ! need MPI_Wtime |
---|
50 | INCLUDE 'mpif.h' |
---|
51 | #endif |
---|
52 | |
---|
53 | !!---------------------------------------------------------------------- |
---|
54 | !! NEMO/OCE 4.0 , NEMO Consortium (2018) |
---|
55 | !! $Id: nemogcm.F90 12614 2020-03-26 14:59:52Z gm $ |
---|
56 | !! Software governed by the CeCILL license (see ./LICENSE) |
---|
57 | !!---------------------------------------------------------------------- |
---|
58 | CONTAINS |
---|
59 | |
---|
60 | SUBROUTINE nemo_gcm |
---|
61 | !!---------------------------------------------------------------------- |
---|
62 | !! *** ROUTINE nemo_gcm *** |
---|
63 | !! |
---|
64 | !! ** Purpose : NEMO solves the primitive equations on an orthogonal |
---|
65 | !! curvilinear mesh on the sphere. |
---|
66 | !! |
---|
67 | !! ** Method : - model general initialization |
---|
68 | !! - launch the time-stepping (stp routine) |
---|
69 | !! - finalize the run by closing files and communications |
---|
70 | !! |
---|
71 | !! References : Madec, Delecluse, Imbard, and Levy, 1997: internal report, IPSL. |
---|
72 | !! Madec, 2008, internal report, IPSL. |
---|
73 | !!---------------------------------------------------------------------- |
---|
74 | INTEGER :: istp ! time step index |
---|
75 | REAL(wp):: zstptiming ! elapsed time for 1 time step |
---|
76 | !!---------------------------------------------------------------------- |
---|
77 | ! |
---|
78 | ! !-----------------------! |
---|
79 | CALL nemo_init !== Initialisations ==! |
---|
80 | ! !-----------------------! |
---|
81 | ! check that all process are still there... If some process have an error, |
---|
82 | ! they will never enter in step and other processes will wait until the end of the cpu time! |
---|
83 | ! |
---|
84 | ! ! SWE case: only with key_qco |
---|
85 | #if ! defined key_qco |
---|
86 | CALL ctl_stop( 'nemo_gcm (SWE): shallow water model requires key_qco' ) |
---|
87 | #endif |
---|
88 | ! |
---|
89 | CALL mpp_max( 'nemogcm', nstop ) |
---|
90 | |
---|
91 | IF(lwp) WRITE(numout,cform_aaa) ! Flag AAAAAAA |
---|
92 | |
---|
93 | ! !-----------------------! |
---|
94 | ! !== time stepping ==! |
---|
95 | ! !-----------------------! |
---|
96 | ! |
---|
97 | ! !== set the model time-step ==! |
---|
98 | ! |
---|
99 | istp = nit000 |
---|
100 | ! |
---|
101 | ! !== Standard time-stepping ==! |
---|
102 | ! |
---|
103 | DO WHILE( istp <= nitend .AND. nstop == 0 ) |
---|
104 | ! |
---|
105 | ncom_stp = istp |
---|
106 | IF( ln_timing ) THEN |
---|
107 | zstptiming = MPI_Wtime() |
---|
108 | IF ( istp == ( nit000 + 1 ) ) elapsed_time = zstptiming |
---|
109 | IF ( istp == nitend ) elapsed_time = zstptiming - elapsed_time |
---|
110 | ENDIF |
---|
111 | ! |
---|
112 | #if defined key_RK3 |
---|
113 | CALL stp_RK3 ( istp ) |
---|
114 | #else |
---|
115 | CALL stp_MLF ( istp ) |
---|
116 | #endif |
---|
117 | istp = istp + 1 |
---|
118 | ! |
---|
119 | IF( lwp .AND. ln_timing ) WRITE(numtime,*) 'timing step ', istp-1, ' : ', MPI_Wtime() - zstptiming |
---|
120 | ! |
---|
121 | END DO |
---|
122 | ! |
---|
123 | ! |
---|
124 | ! !------------------------! |
---|
125 | ! !== finalize the run ==! |
---|
126 | ! !------------------------! |
---|
127 | IF(lwp) WRITE(numout,cform_aaa) ! Flag AAAAAAA |
---|
128 | ! |
---|
129 | IF( nstop /= 0 .AND. lwp ) THEN ! error print |
---|
130 | WRITE(ctmp1,*) ' ==>>> nemo_gcm: a total of ', nstop, ' errors have been found' |
---|
131 | WRITE(ctmp2,*) ' Look for "E R R O R" messages in all existing ocean_output* files' |
---|
132 | CALL ctl_stop( ' ', ctmp1, ' ', ctmp2 ) |
---|
133 | ENDIF |
---|
134 | ! |
---|
135 | IF( ln_timing ) CALL timing_finalize |
---|
136 | ! |
---|
137 | CALL nemo_closefile |
---|
138 | ! |
---|
139 | #if defined key_xios |
---|
140 | CALL xios_finalize ! end mpp communications with xios |
---|
141 | #else |
---|
142 | IF( lk_mpp ) CALL mppstop ! end mpp communications |
---|
143 | #endif |
---|
144 | ! |
---|
145 | IF(lwm) THEN |
---|
146 | IF( nstop == 0 ) THEN ; STOP 0 |
---|
147 | ELSE ; STOP 123 |
---|
148 | ENDIF |
---|
149 | ENDIF |
---|
150 | ! |
---|
151 | END SUBROUTINE nemo_gcm |
---|
152 | |
---|
153 | |
---|
154 | SUBROUTINE nemo_init |
---|
155 | !!---------------------------------------------------------------------- |
---|
156 | !! *** ROUTINE nemo_init *** |
---|
157 | !! |
---|
158 | !! ** Purpose : initialization of the NEMO GCM |
---|
159 | !!---------------------------------------------------------------------- |
---|
160 | INTEGER :: ios, ilocal_comm ! local integers |
---|
161 | !! |
---|
162 | NAMELIST/namctl/ sn_cfctl, ln_timing, ln_diacfl, nn_isplt, nn_jsplt , nn_ictls, & |
---|
163 | & nn_ictle, nn_jctls , nn_jctle |
---|
164 | NAMELIST/namcfg/ ln_read_cfg, cn_domcfg, ln_closea, ln_write_cfg, cn_domcfg_out, ln_use_jattr |
---|
165 | !!---------------------------------------------------------------------- |
---|
166 | ! |
---|
167 | cxios_context = 'nemo' |
---|
168 | ! |
---|
169 | ! !-------------------------------------------------! |
---|
170 | ! ! set communicator & select the local rank ! |
---|
171 | ! ! must be done as soon as possible to get narea ! |
---|
172 | ! !-------------------------------------------------! |
---|
173 | ! |
---|
174 | #if defined key_xios |
---|
175 | CALL xios_initialize( "for_xios_mpi_id", return_comm=ilocal_comm ) ! nemo local communicator given by xios |
---|
176 | CALL mpp_start( ilocal_comm ) |
---|
177 | #else |
---|
178 | CALL mpp_start( ) |
---|
179 | #endif |
---|
180 | ! |
---|
181 | narea = mpprank + 1 ! mpprank: the rank of proc (0 --> mppsize -1 ) |
---|
182 | lwm = (narea == 1) ! control of output namelists |
---|
183 | ! |
---|
184 | ! !---------------------------------------------------------------! |
---|
185 | ! ! Open output files, reference and configuration namelist files ! |
---|
186 | ! !---------------------------------------------------------------! |
---|
187 | ! |
---|
188 | ! open ocean.output as soon as possible to get all output prints (including errors messages) |
---|
189 | IF( lwm ) CALL ctl_opn( numout, 'ocean.output', 'REPLACE', 'FORMATTED', 'SEQUENTIAL', -1, -1, .FALSE. ) |
---|
190 | ! open reference and configuration namelist files |
---|
191 | CALL load_nml( numnam_ref, 'namelist_ref', -1, lwm ) |
---|
192 | CALL load_nml( numnam_cfg, 'namelist_cfg', -1, lwm ) |
---|
193 | IF( lwm ) CALL ctl_opn( numond, 'output.namelist.dyn', 'REPLACE', 'FORMATTED', 'SEQUENTIAL', -1, -1, .FALSE. ) |
---|
194 | ! open /dev/null file to be able to supress output write easily |
---|
195 | CALL ctl_opn( numnul, '/dev/null', 'REPLACE', 'FORMATTED', 'SEQUENTIAL', -1, -1, .FALSE. ) |
---|
196 | ! |
---|
197 | ! !--------------------! |
---|
198 | ! ! Open listing units ! -> need sn_cfctl from namctl to define lwp |
---|
199 | ! !--------------------! |
---|
200 | ! |
---|
201 | READ ( numnam_ref, namctl, IOSTAT = ios, ERR = 901 ) |
---|
202 | 901 IF( ios /= 0 ) CALL ctl_nam ( ios , 'namctl in reference namelist' ) |
---|
203 | READ ( numnam_cfg, namctl, IOSTAT = ios, ERR = 902 ) |
---|
204 | 902 IF( ios > 0 ) CALL ctl_nam ( ios , 'namctl in configuration namelist' ) |
---|
205 | ! |
---|
206 | ! finalize the definition of namctl variables |
---|
207 | IF( narea < sn_cfctl%procmin .OR. narea > sn_cfctl%procmax .OR. MOD( narea - sn_cfctl%procmin, sn_cfctl%procincr ) /= 0 ) & |
---|
208 | & CALL nemo_set_cfctl( sn_cfctl, .FALSE. ) |
---|
209 | ! |
---|
210 | lwp = (narea == 1) .OR. sn_cfctl%l_oceout ! control of all listing output print |
---|
211 | ! |
---|
212 | IF(lwp) THEN ! open listing units |
---|
213 | ! |
---|
214 | IF( .NOT. lwm ) & ! alreay opened for narea == 1 |
---|
215 | & CALL ctl_opn( numout, 'ocean.output', 'REPLACE', 'FORMATTED', 'SEQUENTIAL', -1, -1, .FALSE., narea ) |
---|
216 | ! |
---|
217 | WRITE(numout,*) |
---|
218 | WRITE(numout,*) ' CNRS - NERC - Met OFFICE - MERCATOR-ocean - CMCC' |
---|
219 | WRITE(numout,*) ' NEMO team' |
---|
220 | WRITE(numout,*) ' Ocean General Circulation Model' |
---|
221 | WRITE(numout,*) ' NEMO version 4.0 (2020) ' |
---|
222 | WRITE(numout,*) |
---|
223 | WRITE(numout,*) ' Shallow Water Equation' |
---|
224 | WRITE(numout,*) ' ======================' |
---|
225 | WRITE(numout,*) |
---|
226 | WRITE(numout,*) " ._ ._ ._ ._ ._ " |
---|
227 | WRITE(numout,*) " _.-._)`\_.-._)`\_.-._)`\_.-._)`\_.-._)`\_ " |
---|
228 | WRITE(numout,*) |
---|
229 | WRITE(numout,*) " o _, _, " |
---|
230 | WRITE(numout,*) " o .' ( .-' / " |
---|
231 | WRITE(numout,*) " o _/..._'. .' / " |
---|
232 | WRITE(numout,*) " ( o .-'` ` '-./ _.' " |
---|
233 | WRITE(numout,*) " ) ( o) ;= <_ ( " |
---|
234 | WRITE(numout,*) " ( '-.,\\__ __.-;`\ '. ) " |
---|
235 | WRITE(numout,*) " ) ) \) |`\ \) '. \ ( ( " |
---|
236 | WRITE(numout,*) " ( ( \_/ '-._\ ) ) " |
---|
237 | WRITE(numout,*) " ) ) jgs ` ( ( " |
---|
238 | WRITE(numout,*) " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ " |
---|
239 | WRITE(numout,*) |
---|
240 | ! |
---|
241 | WRITE(numout,cform_aaa) ! Flag AAAAAAA |
---|
242 | ! |
---|
243 | ! ! Control print of the working precision |
---|
244 | WRITE(numout,*) |
---|
245 | IF( wp == dp ) THEN ; WRITE(numout,*) "par_kind : wp = Working precision = dp = double-precision" |
---|
246 | ELSE ; WRITE(numout,*) "par_kind : wp = Working precision = sp = single-precision" |
---|
247 | ENDIF |
---|
248 | WRITE(numout,*) "~~~~~~~~ ****************" |
---|
249 | WRITE(numout,*) |
---|
250 | ! |
---|
251 | ENDIF |
---|
252 | ! |
---|
253 | IF(lwm) WRITE( numond, namctl ) |
---|
254 | ! |
---|
255 | ! !------------------------------------! |
---|
256 | ! ! Set global domain size parameters ! |
---|
257 | ! !------------------------------------! |
---|
258 | ! |
---|
259 | READ ( numnam_ref, namcfg, IOSTAT = ios, ERR = 903 ) |
---|
260 | 903 IF( ios /= 0 ) CALL ctl_nam ( ios , 'namcfg in reference namelist' ) |
---|
261 | READ ( numnam_cfg, namcfg, IOSTAT = ios, ERR = 904 ) |
---|
262 | 904 IF( ios > 0 ) CALL ctl_nam ( ios , 'namcfg in configuration namelist' ) |
---|
263 | ! |
---|
264 | IF( ln_read_cfg ) THEN ! Read sizes in domain configuration file |
---|
265 | CALL domain_cfg ( cn_cfg, nn_cfg, Ni0glo, Nj0glo, jpkglo, l_Iperio, l_Jperio, l_NFold, c_NFtype ) |
---|
266 | ELSE ! user-defined namelist |
---|
267 | CALL usr_def_nam( cn_cfg, nn_cfg, Ni0glo, Nj0glo, jpkglo, l_Iperio, l_Jperio, l_NFold, c_NFtype ) |
---|
268 | ENDIF |
---|
269 | ! |
---|
270 | IF(lwm) WRITE( numond, namcfg ) |
---|
271 | ! |
---|
272 | ! !-----------------------------------------! |
---|
273 | ! ! mpp parameters and domain decomposition ! |
---|
274 | ! !-----------------------------------------! |
---|
275 | CALL mpp_init |
---|
276 | |
---|
277 | #if defined key_loop_fusion |
---|
278 | IF( nn_hls == 1 ) THEN |
---|
279 | CALL ctl_stop( 'STOP', 'nemogcm : Loop fusion can be used only with extra-halo' ) |
---|
280 | ENDIF |
---|
281 | #endif |
---|
282 | |
---|
283 | CALL halo_mng_init() |
---|
284 | ! Now we know the dimensions of the grid and numout has been set: we can allocate arrays |
---|
285 | CALL nemo_alloc() |
---|
286 | |
---|
287 | ! Initialise time level indices |
---|
288 | Nbb = 1 ; Nnn = 2 ; Naa = 3 ; Nrhs = Naa |
---|
289 | |
---|
290 | ! !-------------------------------! |
---|
291 | ! ! NEMO general initialization ! |
---|
292 | ! !-------------------------------! |
---|
293 | |
---|
294 | CALL nemo_ctl ! Control prints of namctl and namcfg |
---|
295 | ! |
---|
296 | ! ! General initialization |
---|
297 | IF( ln_timing ) CALL timing_init ! timing |
---|
298 | IF( ln_timing ) CALL timing_start( 'nemo_init') |
---|
299 | ! |
---|
300 | CALL phy_cst ! Physical constants |
---|
301 | ln_wd_il = .FALSE. ; ln_wd_dl = .FALSE. ; ln_wd_dl_bc = .FALSE. ! No wetting and drying |
---|
302 | ! |
---|
303 | ! ! SWE: Set rho0 and associated variables (eosbn2 not used) |
---|
304 | rho0 = 1026._wp !: volumic mass of reference [kg/m3] |
---|
305 | rcp = 3991.86795711963_wp !: heat capacity [J/K] |
---|
306 | rho0_rcp = rho0 * rcp |
---|
307 | r1_rho0 = 1._wp / rho0 |
---|
308 | r1_rcp = 1._wp / rcp |
---|
309 | r1_rho0_rcp = 1._wp / rho0_rcp |
---|
310 | ! |
---|
311 | CALL dom_init( Nbb, Nnn, Naa ) ! Domain |
---|
312 | |
---|
313 | IF( sn_cfctl%l_prtctl ) & |
---|
314 | & CALL prt_ctl_init ! Print control |
---|
315 | |
---|
316 | CALL istate_init( Nbb, Nnn, Naa ) ! ocean initial state (Dynamics and tracers) |
---|
317 | |
---|
318 | ! ! external forcing |
---|
319 | CALL sbc_init( Nbb, Nnn, Naa ) ! surface boundary conditions (including sea-ice) |
---|
320 | |
---|
321 | ! ! Ocean physics |
---|
322 | ! ! Vertical physics |
---|
323 | ln_zdfddm = .FALSE. ; ln_zad_Aimp = .FALSE. ; ln_zdfosm = .FALSE. ! used in diawri |
---|
324 | avt(:,:,:) = 0._wp ; avm(:,:,:) = 0._wp ! used in diawri |
---|
325 | ! ! Lateral physics |
---|
326 | CALL ldf_dyn_init ! Lateral ocean momentum physics |
---|
327 | |
---|
328 | ! ! Dynamics |
---|
329 | CALL dyn_adv_init ! advection (vector or flux form) |
---|
330 | CALL dyn_vor_init ! vorticity term including Coriolis |
---|
331 | CALL dyn_ldf_init ! lateral mixing |
---|
332 | |
---|
333 | ! ! Icebergs |
---|
334 | ln_icebergs = .false. |
---|
335 | ! ! ice shelf |
---|
336 | ln_isf = .false. |
---|
337 | |
---|
338 | ! ! Diagnostics |
---|
339 | IF( ln_diacfl ) CALL dia_cfl_init ! Initialise CFL diagnostics |
---|
340 | |
---|
341 | l_trddyn = .FALSE. ! No trend diagnostics |
---|
342 | ln_dia25h = .FALSE. ! No 25h mean diagnostics (zdf_phy not used)- used in diawri |
---|
343 | |
---|
344 | IF(lwp) WRITE(numout,cform_aaa) ! Flag AAAAAAA |
---|
345 | ! |
---|
346 | IF( ln_timing ) CALL timing_stop( 'nemo_init') |
---|
347 | ! |
---|
348 | END SUBROUTINE nemo_init |
---|
349 | |
---|
350 | |
---|
351 | SUBROUTINE nemo_ctl |
---|
352 | !!---------------------------------------------------------------------- |
---|
353 | !! *** ROUTINE nemo_ctl *** |
---|
354 | !! |
---|
355 | !! ** Purpose : control print setting |
---|
356 | !! |
---|
357 | !! ** Method : - print namctl and namcfg information and check some consistencies |
---|
358 | !!---------------------------------------------------------------------- |
---|
359 | ! |
---|
360 | IF(lwp) THEN ! control print |
---|
361 | WRITE(numout,*) |
---|
362 | WRITE(numout,*) 'nemo_ctl: Control prints' |
---|
363 | WRITE(numout,*) '~~~~~~~~' |
---|
364 | WRITE(numout,*) ' Namelist namctl' |
---|
365 | WRITE(numout,*) ' sn_cfctl%l_runstat = ', sn_cfctl%l_runstat |
---|
366 | WRITE(numout,*) ' sn_cfctl%l_trcstat = ', sn_cfctl%l_trcstat |
---|
367 | WRITE(numout,*) ' sn_cfctl%l_oceout = ', sn_cfctl%l_oceout |
---|
368 | WRITE(numout,*) ' sn_cfctl%l_layout = ', sn_cfctl%l_layout |
---|
369 | WRITE(numout,*) ' sn_cfctl%l_prtctl = ', sn_cfctl%l_prtctl |
---|
370 | WRITE(numout,*) ' sn_cfctl%l_prttrc = ', sn_cfctl%l_prttrc |
---|
371 | WRITE(numout,*) ' sn_cfctl%l_oasout = ', sn_cfctl%l_oasout |
---|
372 | WRITE(numout,*) ' sn_cfctl%procmin = ', sn_cfctl%procmin |
---|
373 | WRITE(numout,*) ' sn_cfctl%procmax = ', sn_cfctl%procmax |
---|
374 | WRITE(numout,*) ' sn_cfctl%procincr = ', sn_cfctl%procincr |
---|
375 | WRITE(numout,*) ' sn_cfctl%ptimincr = ', sn_cfctl%ptimincr |
---|
376 | WRITE(numout,*) ' timing by routine ln_timing = ', ln_timing |
---|
377 | WRITE(numout,*) ' CFL diagnostics ln_diacfl = ', ln_diacfl |
---|
378 | ENDIF |
---|
379 | ! |
---|
380 | IF( .NOT.ln_read_cfg ) ln_closea = .false. ! dealing possible only with a domcfg file |
---|
381 | IF(lwp) THEN ! control print |
---|
382 | WRITE(numout,*) |
---|
383 | WRITE(numout,*) ' Namelist namcfg' |
---|
384 | WRITE(numout,*) ' read domain configuration file ln_read_cfg = ', ln_read_cfg |
---|
385 | WRITE(numout,*) ' filename to be read cn_domcfg = ', TRIM(cn_domcfg) |
---|
386 | WRITE(numout,*) ' keep closed seas in the domain (if exist) ln_closea = ', ln_closea |
---|
387 | WRITE(numout,*) ' create a configuration definition file ln_write_cfg = ', ln_write_cfg |
---|
388 | WRITE(numout,*) ' filename to be written cn_domcfg_out = ', TRIM(cn_domcfg_out) |
---|
389 | WRITE(numout,*) ' use file attribute if exists as i/p j-start ln_use_jattr = ', ln_use_jattr |
---|
390 | ENDIF |
---|
391 | ! |
---|
392 | IF( 1._wp /= SIGN(1._wp,-0._wp) ) CALL ctl_stop( 'nemo_ctl: The intrinsec SIGN function follows f2003 standard.', & |
---|
393 | & 'Compile with key_nosignedzero enabled:', & |
---|
394 | & '--> add -Dkey_nosignedzero to the definition of %CPP in your arch file' ) |
---|
395 | ! |
---|
396 | #if defined key_agrif |
---|
397 | IF( ln_timing ) CALL ctl_stop( 'AGRIF not implemented with ln_timing = true') |
---|
398 | #endif |
---|
399 | ! |
---|
400 | END SUBROUTINE nemo_ctl |
---|
401 | |
---|
402 | |
---|
403 | SUBROUTINE nemo_closefile |
---|
404 | !!---------------------------------------------------------------------- |
---|
405 | !! *** ROUTINE nemo_closefile *** |
---|
406 | !! |
---|
407 | !! ** Purpose : Close the files |
---|
408 | !!---------------------------------------------------------------------- |
---|
409 | ! |
---|
410 | IF( lk_mpp ) CALL mppsync |
---|
411 | ! |
---|
412 | CALL iom_close ! close all input/output files managed by iom_* |
---|
413 | ! |
---|
414 | IF( numstp /= -1 ) CLOSE( numstp ) ! time-step file |
---|
415 | IF( numrun /= -1 ) CLOSE( numrun ) ! run statistics file |
---|
416 | IF( lwm.AND.numond /= -1 ) CLOSE( numond ) ! oce output namelist |
---|
417 | IF( lwm.AND.numoni /= -1 ) CLOSE( numoni ) ! ice output namelist |
---|
418 | IF( numevo_ice /= -1 ) CLOSE( numevo_ice ) ! ice variables (temp. evolution) |
---|
419 | IF( numout /= 6 ) CLOSE( numout ) ! standard model output file |
---|
420 | IF( numdct_vol /= -1 ) CLOSE( numdct_vol ) ! volume transports |
---|
421 | IF( numdct_heat /= -1 ) CLOSE( numdct_heat ) ! heat transports |
---|
422 | IF( numdct_salt /= -1 ) CLOSE( numdct_salt ) ! salt transports |
---|
423 | ! |
---|
424 | numout = 6 ! redefine numout in case it is used after this point... |
---|
425 | ! |
---|
426 | END SUBROUTINE nemo_closefile |
---|
427 | |
---|
428 | |
---|
429 | SUBROUTINE nemo_alloc |
---|
430 | !!---------------------------------------------------------------------- |
---|
431 | !! *** ROUTINE nemo_alloc *** |
---|
432 | !! |
---|
433 | !! ** Purpose : Allocate all the dynamic arrays of the OCE modules |
---|
434 | !! |
---|
435 | !! ** Method : |
---|
436 | !!---------------------------------------------------------------------- |
---|
437 | USE diawri , ONLY : dia_wri_alloc |
---|
438 | USE dom_oce , ONLY : dom_oce_alloc |
---|
439 | ! |
---|
440 | INTEGER :: ierr |
---|
441 | !!---------------------------------------------------------------------- |
---|
442 | ! |
---|
443 | ierr = oce_SWE_alloc() ! ocean |
---|
444 | ierr = ierr + dia_wri_alloc() |
---|
445 | ierr = ierr + dom_oce_alloc() ! ocean domain |
---|
446 | ierr = ierr + zdf_oce_alloc() ! ocean vertical physics |
---|
447 | ! |
---|
448 | CALL mpp_sum( 'nemogcm', ierr ) |
---|
449 | IF( ierr /= 0 ) CALL ctl_stop( 'STOP', 'nemo_alloc: unable to allocate standard ocean arrays' ) |
---|
450 | ! |
---|
451 | END SUBROUTINE nemo_alloc |
---|
452 | |
---|
453 | |
---|
454 | SUBROUTINE nemo_set_cfctl(sn_cfctl, setto ) |
---|
455 | !!---------------------------------------------------------------------- |
---|
456 | !! *** ROUTINE nemo_set_cfctl *** |
---|
457 | !! |
---|
458 | !! ** Purpose : Set elements of the output control structure to setto. |
---|
459 | !! |
---|
460 | !! ** Method : Note this routine can be used to switch on/off some |
---|
461 | !! types of output for selected areas. |
---|
462 | !!---------------------------------------------------------------------- |
---|
463 | TYPE(sn_ctl), INTENT(inout) :: sn_cfctl |
---|
464 | LOGICAL , INTENT(in ) :: setto |
---|
465 | !!---------------------------------------------------------------------- |
---|
466 | sn_cfctl%l_runstat = setto |
---|
467 | sn_cfctl%l_trcstat = setto |
---|
468 | sn_cfctl%l_oceout = setto |
---|
469 | sn_cfctl%l_layout = setto |
---|
470 | sn_cfctl%l_prtctl = setto |
---|
471 | sn_cfctl%l_prttrc = setto |
---|
472 | sn_cfctl%l_oasout = setto |
---|
473 | END SUBROUTINE nemo_set_cfctl |
---|
474 | |
---|
475 | !!====================================================================== |
---|
476 | END MODULE nemogcm |
---|