1 | MODULE nemogcm |
---|
2 | !!====================================================================== |
---|
3 | !! *** MODULE nemogcm *** |
---|
4 | !! STATION_ASF (SAS meets C1D) |
---|
5 | !!====================================================================== |
---|
6 | !! History : 3.6 ! 2011-11 (S. Alderson, G. Madec) original code |
---|
7 | !! - ! 2013-06 (I. Epicoco, S. Mocavero, CMCC) nemo_northcomms: setup avoiding MPI communication |
---|
8 | !! - ! 2014-12 (G. Madec) remove KPP scheme and cross-land advection (cla) |
---|
9 | !! 4.0 ! 2016-10 (G. Madec, S. Flavoni) domain configuration / user defined interface |
---|
10 | !! 4.x ! 2019-12 (L. Brodeau) STATION_ASF test-case |
---|
11 | !!---------------------------------------------------------------------- |
---|
12 | |
---|
13 | !!---------------------------------------------------------------------- |
---|
14 | !! nemo_gcm : solve ocean dynamics, tracer, biogeochemistry and/or sea-ice |
---|
15 | !! nemo_init : initialization of the NEMO system |
---|
16 | !! nemo_ctl : initialisation of the contol print |
---|
17 | !! nemo_closefile: close remaining open files |
---|
18 | !! nemo_alloc : dynamical allocation |
---|
19 | !!---------------------------------------------------------------------- |
---|
20 | USE step_oce ! module used in the ocean time stepping module (step.F90) |
---|
21 | USE phycst ! physical constant (par_cst routine) |
---|
22 | USE domain ! domain initialization (dom_init & dom_cfg routines) |
---|
23 | USE closea ! treatment of closed seas (for ln_closea) |
---|
24 | USE usrdef_nam ! user defined configuration |
---|
25 | USE istate ! initial state setting (istate_init routine) |
---|
26 | USE step, ONLY : Nbb, Nnn, Naa, Nrhs ! time level indices |
---|
27 | USE daymod ! calendar |
---|
28 | USE restart ! open restart file |
---|
29 | USE c1d ! 1D configuration |
---|
30 | USE step_c1d ! Time stepping loop for the 1D configuration |
---|
31 | ! |
---|
32 | USE in_out_manager ! I/O manager |
---|
33 | USE lib_mpp ! distributed memory computing |
---|
34 | USE mppini ! shared/distributed memory setting (mpp_init routine) |
---|
35 | USE lib_fortran ! Fortran utilities (allows no signed zero when 'key_nosignedzero' defined) |
---|
36 | #if defined key_iomput |
---|
37 | USE xios ! xIOserver |
---|
38 | #endif |
---|
39 | |
---|
40 | IMPLICIT NONE |
---|
41 | PRIVATE |
---|
42 | |
---|
43 | PUBLIC nemo_gcm ! called by model.F90 |
---|
44 | PUBLIC nemo_init ! needed by AGRIF |
---|
45 | |
---|
46 | CHARACTER(lc) :: cform_aaa="( /, 'AAAAAAAA', / ) " ! flag for output listing |
---|
47 | |
---|
48 | !!---------------------------------------------------------------------- |
---|
49 | !! NEMO/OCE 4.0 , NEMO Consortium (2018) |
---|
50 | !! $Id: nemogcm.F90 12489 2020-02-28 15:55:11Z davestorkey $ |
---|
51 | !! Software governed by the CeCILL license (see ./LICENSE) |
---|
52 | !!---------------------------------------------------------------------- |
---|
53 | CONTAINS |
---|
54 | |
---|
55 | SUBROUTINE nemo_gcm |
---|
56 | !!---------------------------------------------------------------------- |
---|
57 | !! *** ROUTINE nemo_gcm *** |
---|
58 | !! |
---|
59 | !! ** Purpose : NEMO solves the primitive equations on an orthogonal |
---|
60 | !! curvilinear mesh on the sphere. |
---|
61 | !! |
---|
62 | !! ** Method : - model general initialization |
---|
63 | !! - launch the time-stepping (stp routine) |
---|
64 | !! - finalize the run by closing files and communications |
---|
65 | !! |
---|
66 | !! References : Madec, Delecluse, Imbard, and Levy, 1997: internal report, IPSL. |
---|
67 | !! Madec, 2008, internal report, IPSL. |
---|
68 | !!---------------------------------------------------------------------- |
---|
69 | INTEGER :: istp ! time step index |
---|
70 | REAL(wp):: zstptiming ! elapsed time for 1 time step |
---|
71 | !!---------------------------------------------------------------------- |
---|
72 | ! |
---|
73 | ! !-----------------------! |
---|
74 | CALL nemo_init !== Initialisations ==! |
---|
75 | ! !-----------------------! |
---|
76 | ! check that all process are still there... If some process have an error, |
---|
77 | ! they will never enter in step and other processes will wait until the end of the cpu time! |
---|
78 | CALL mpp_max( 'nemogcm', nstop ) |
---|
79 | |
---|
80 | IF(lwp) WRITE(numout,cform_aaa) ! Flag AAAAAAA |
---|
81 | |
---|
82 | ! !-----------------------! |
---|
83 | ! !== time stepping ==! |
---|
84 | ! !-----------------------! |
---|
85 | ! |
---|
86 | ! !== set the model time-step ==! |
---|
87 | ! |
---|
88 | istp = nit000 |
---|
89 | ! |
---|
90 | DO WHILE ( istp <= nitend .AND. nstop == 0 ) !== C1D time-stepping ==! |
---|
91 | CALL stp_c1d( istp ) |
---|
92 | istp = istp + 1 |
---|
93 | END DO |
---|
94 | ! |
---|
95 | ! !------------------------! |
---|
96 | ! !== finalize the run ==! |
---|
97 | ! !------------------------! |
---|
98 | IF(lwp) WRITE(numout,cform_aaa) ! Flag AAAAAAA |
---|
99 | ! |
---|
100 | IF( nstop /= 0 .AND. lwp ) THEN ! error print |
---|
101 | WRITE(ctmp1,*) ' ==>>> nemo_gcm: a total of ', nstop, ' errors have been found' |
---|
102 | WRITE(ctmp2,*) ' Look for "E R R O R" messages in all existing ocean_output* files' |
---|
103 | CALL ctl_stop( ' ', ctmp1, ' ', ctmp2 ) |
---|
104 | ENDIF |
---|
105 | ! |
---|
106 | IF( ln_timing ) CALL timing_finalize |
---|
107 | ! |
---|
108 | CALL nemo_closefile |
---|
109 | ! |
---|
110 | #if defined key_iomput |
---|
111 | CALL xios_finalize ! end mpp communications with xios |
---|
112 | #else |
---|
113 | IF( lk_mpp ) CALL mppstop ! end mpp communications |
---|
114 | #endif |
---|
115 | ! |
---|
116 | IF(lwm) THEN |
---|
117 | IF( nstop == 0 ) THEN ; STOP 0 |
---|
118 | ELSE ; STOP 123 |
---|
119 | ENDIF |
---|
120 | ENDIF |
---|
121 | ! |
---|
122 | END SUBROUTINE nemo_gcm |
---|
123 | |
---|
124 | |
---|
125 | SUBROUTINE nemo_init |
---|
126 | !!---------------------------------------------------------------------- |
---|
127 | !! *** ROUTINE nemo_init *** |
---|
128 | !! |
---|
129 | !! ** Purpose : initialization of the NEMO GCM |
---|
130 | !!---------------------------------------------------------------------- |
---|
131 | INTEGER :: ios, ilocal_comm ! local integers |
---|
132 | !! |
---|
133 | NAMELIST/namctl/ sn_cfctl, nn_print, nn_ictls, nn_ictle, & |
---|
134 | & nn_isplt , nn_jsplt, nn_jctls, nn_jctle, & |
---|
135 | & ln_timing, ln_diacfl |
---|
136 | NAMELIST/namcfg/ ln_read_cfg, cn_domcfg, ln_closea, ln_write_cfg, cn_domcfg_out, ln_use_jattr |
---|
137 | !!---------------------------------------------------------------------- |
---|
138 | ! |
---|
139 | cxios_context = 'nemo' |
---|
140 | ! |
---|
141 | ! !-------------------------------------------------! |
---|
142 | ! ! set communicator & select the local rank ! |
---|
143 | ! ! must be done as soon as possible to get narea ! |
---|
144 | ! !-------------------------------------------------! |
---|
145 | ! |
---|
146 | #if defined key_iomput |
---|
147 | IF( Agrif_Root() ) THEN |
---|
148 | CALL xios_initialize( "for_xios_mpi_id", return_comm=ilocal_comm ) ! nemo local communicator given by xios |
---|
149 | ENDIF |
---|
150 | CALL mpp_start( ilocal_comm ) |
---|
151 | #else |
---|
152 | CALL mpp_start( ) |
---|
153 | #endif |
---|
154 | ! |
---|
155 | narea = mpprank + 1 ! mpprank: the rank of proc (0 --> mppsize -1 ) |
---|
156 | lwm = (narea == 1) ! control of output namelists |
---|
157 | ! |
---|
158 | ! !---------------------------------------------------------------! |
---|
159 | ! ! Open output files, reference and configuration namelist files ! |
---|
160 | ! !---------------------------------------------------------------! |
---|
161 | ! |
---|
162 | ! open ocean.output as soon as possible to get all output prints (including errors messages) |
---|
163 | IF( lwm ) CALL ctl_opn( numout, 'ocean.output', 'REPLACE', 'FORMATTED', 'SEQUENTIAL', -1, -1, .FALSE. ) |
---|
164 | ! open reference and configuration namelist files |
---|
165 | CALL load_nml( numnam_ref, 'namelist_ref', -1, lwm ) |
---|
166 | CALL load_nml( numnam_cfg, 'namelist_cfg', -1, lwm ) |
---|
167 | IF( lwm ) CALL ctl_opn( numond, 'output.namelist.dyn', 'REPLACE', 'FORMATTED', 'SEQUENTIAL', -1, -1, .FALSE. ) |
---|
168 | ! open /dev/null file to be able to supress output write easily |
---|
169 | IF( Agrif_Root() ) THEN |
---|
170 | CALL ctl_opn( numnul, '/dev/null', 'REPLACE', 'FORMATTED', 'SEQUENTIAL', -1, -1, .FALSE. ) |
---|
171 | #ifdef key_agrif |
---|
172 | ELSE |
---|
173 | numnul = Agrif_Parent(numnul) |
---|
174 | #endif |
---|
175 | ENDIF |
---|
176 | ! |
---|
177 | ! !--------------------! |
---|
178 | ! ! Open listing units ! -> need sn_cfctl from namctl to define lwp |
---|
179 | ! !--------------------! |
---|
180 | ! |
---|
181 | READ ( numnam_ref, namctl, IOSTAT = ios, ERR = 901 ) |
---|
182 | 901 IF( ios /= 0 ) CALL ctl_nam ( ios , 'namctl in reference namelist' ) |
---|
183 | READ ( numnam_cfg, namctl, IOSTAT = ios, ERR = 902 ) |
---|
184 | 902 IF( ios > 0 ) CALL ctl_nam ( ios , 'namctl in configuration namelist' ) |
---|
185 | ! |
---|
186 | ! finalize the definition of namctl variables |
---|
187 | IF( narea < sn_cfctl%procmin .OR. narea > sn_cfctl%procmax .OR. MOD( narea - sn_cfctl%procmin, sn_cfctl%procincr ) /= 0 ) & |
---|
188 | & CALL nemo_set_cfctl( sn_cfctl, .FALSE. ) |
---|
189 | ! |
---|
190 | lwp = (narea == 1) .OR. sn_cfctl%l_oceout ! control of all listing output print |
---|
191 | ! |
---|
192 | IF(lwp) THEN ! open listing units |
---|
193 | ! |
---|
194 | IF( .NOT. lwm ) & ! alreay opened for narea == 1 |
---|
195 | & CALL ctl_opn( numout, 'ocean.output', 'REPLACE', 'FORMATTED', 'SEQUENTIAL', -1, -1, .FALSE., narea ) |
---|
196 | ! |
---|
197 | WRITE(numout,*) |
---|
198 | WRITE(numout,*) ' CNRS - NERC - Met OFFICE - MERCATOR-ocean - CMCC' |
---|
199 | WRITE(numout,*) ' NEMO team' |
---|
200 | WRITE(numout,*) ' Ocean General Circulation Model' |
---|
201 | WRITE(numout,*) ' NEMO version 4.0 (2019) ' |
---|
202 | WRITE(numout,*) ' STATION_ASF ' |
---|
203 | WRITE(numout,*) " ._ ._ ._ ._ ._ " |
---|
204 | WRITE(numout,*) " _.-._)`\_.-._)`\_.-._)`\_.-._)`\_.-._)`\_ " |
---|
205 | WRITE(numout,*) |
---|
206 | WRITE(numout,*) " o _, _, " |
---|
207 | WRITE(numout,*) " o .' ( .-' / " |
---|
208 | WRITE(numout,*) " o _/..._'. .' / " |
---|
209 | WRITE(numout,*) " ( o .-'` ` '-./ _.' " |
---|
210 | WRITE(numout,*) " ) ( o) ;= <_ ( " |
---|
211 | WRITE(numout,*) " ( '-.,\\__ __.-;`\ '. ) " |
---|
212 | WRITE(numout,*) " ) ) \) |`\ \) '. \ ( ( " |
---|
213 | WRITE(numout,*) " ( ( \_/ '-._\ ) ) " |
---|
214 | WRITE(numout,*) " ) ) jgs ` ( ( " |
---|
215 | WRITE(numout,*) " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ " |
---|
216 | WRITE(numout,*) |
---|
217 | ! |
---|
218 | WRITE(numout,cform_aaa) ! Flag AAAAAAA |
---|
219 | ! |
---|
220 | ENDIF |
---|
221 | ! |
---|
222 | IF(lwm) WRITE( numond, namctl ) |
---|
223 | ! |
---|
224 | ! !------------------------------------! |
---|
225 | ! ! Set global domain size parameters ! |
---|
226 | ! !------------------------------------! |
---|
227 | ! |
---|
228 | READ ( numnam_ref, namcfg, IOSTAT = ios, ERR = 903 ) |
---|
229 | 903 IF( ios /= 0 ) CALL ctl_nam ( ios , 'namcfg in reference namelist' ) |
---|
230 | READ ( numnam_cfg, namcfg, IOSTAT = ios, ERR = 904 ) |
---|
231 | 904 IF( ios > 0 ) CALL ctl_nam ( ios , 'namcfg in configuration namelist' ) |
---|
232 | ! |
---|
233 | IF( ln_read_cfg ) THEN ! Read sizes in domain configuration file |
---|
234 | CALL domain_cfg ( cn_cfg, nn_cfg, jpiglo, jpjglo, jpkglo, jperio ) |
---|
235 | ELSE ! user-defined namelist |
---|
236 | CALL usr_def_nam( cn_cfg, nn_cfg, jpiglo, jpjglo, jpkglo, jperio ) |
---|
237 | ENDIF |
---|
238 | ! |
---|
239 | IF(lwm) WRITE( numond, namcfg ) |
---|
240 | ! |
---|
241 | ! !-----------------------------------------! |
---|
242 | ! ! mpp parameters and domain decomposition ! |
---|
243 | ! !-----------------------------------------! |
---|
244 | CALL mpp_init |
---|
245 | |
---|
246 | ! Now we know the dimensions of the grid and numout has been set: we can allocate arrays |
---|
247 | CALL nemo_alloc() |
---|
248 | |
---|
249 | ! Initialise time level indices |
---|
250 | Nbb = 1; Nnn = 2; Naa = 3; Nrhs = Naa |
---|
251 | |
---|
252 | ! !-------------------------------! |
---|
253 | ! ! NEMO general initialization ! |
---|
254 | ! !-------------------------------! |
---|
255 | |
---|
256 | CALL nemo_ctl ! Control prints |
---|
257 | ! |
---|
258 | ! ! General initialization |
---|
259 | IF( ln_timing ) CALL timing_init ! timing |
---|
260 | IF( ln_timing ) CALL timing_start( 'nemo_init') |
---|
261 | ! |
---|
262 | CALL phy_cst ! Physical constants |
---|
263 | CALL eos_init ! Equation of state |
---|
264 | IF( lk_c1d ) CALL c1d_init ! 1D column configuration |
---|
265 | CALL dom_init( Nbb, Nnn, Naa, "OPA") ! Domain |
---|
266 | IF( sn_cfctl%l_prtctl ) & |
---|
267 | & CALL prt_ctl_init ! Print control |
---|
268 | ! |
---|
269 | |
---|
270 | CALL istate_init( Nbb, Nnn, Naa ) ! ocean initial state (Dynamics and tracers) |
---|
271 | |
---|
272 | ! ! external forcing |
---|
273 | CALL sbc_init( Nbb, Nnn, Naa ) ! surface boundary conditions (including sea-ice) |
---|
274 | |
---|
275 | ! |
---|
276 | IF(lwp) WRITE(numout,cform_aaa) ! Flag AAAAAAA |
---|
277 | ! |
---|
278 | IF( ln_timing ) CALL timing_stop( 'nemo_init') |
---|
279 | ! |
---|
280 | END SUBROUTINE nemo_init |
---|
281 | |
---|
282 | |
---|
283 | SUBROUTINE nemo_ctl |
---|
284 | !!---------------------------------------------------------------------- |
---|
285 | !! *** ROUTINE nemo_ctl *** |
---|
286 | !! |
---|
287 | !! ** Purpose : control print setting |
---|
288 | !! |
---|
289 | !! ** Method : - print namctl and namcfg information and check some consistencies |
---|
290 | !!---------------------------------------------------------------------- |
---|
291 | ! |
---|
292 | IF(lwp) THEN ! control print |
---|
293 | WRITE(numout,*) |
---|
294 | WRITE(numout,*) 'nemo_ctl: Control prints' |
---|
295 | WRITE(numout,*) '~~~~~~~~' |
---|
296 | WRITE(numout,*) ' Namelist namctl' |
---|
297 | WRITE(numout,*) ' sn_cfctl%l_runstat = ', sn_cfctl%l_runstat |
---|
298 | WRITE(numout,*) ' sn_cfctl%l_trcstat = ', sn_cfctl%l_trcstat |
---|
299 | WRITE(numout,*) ' sn_cfctl%l_oceout = ', sn_cfctl%l_oceout |
---|
300 | WRITE(numout,*) ' sn_cfctl%l_layout = ', sn_cfctl%l_layout |
---|
301 | WRITE(numout,*) ' sn_cfctl%l_prtctl = ', sn_cfctl%l_prtctl |
---|
302 | WRITE(numout,*) ' sn_cfctl%l_prttrc = ', sn_cfctl%l_prttrc |
---|
303 | WRITE(numout,*) ' sn_cfctl%l_oasout = ', sn_cfctl%l_oasout |
---|
304 | WRITE(numout,*) ' sn_cfctl%procmin = ', sn_cfctl%procmin |
---|
305 | WRITE(numout,*) ' sn_cfctl%procmax = ', sn_cfctl%procmax |
---|
306 | WRITE(numout,*) ' sn_cfctl%procincr = ', sn_cfctl%procincr |
---|
307 | WRITE(numout,*) ' sn_cfctl%ptimincr = ', sn_cfctl%ptimincr |
---|
308 | WRITE(numout,*) ' level of print nn_print = ', nn_print |
---|
309 | WRITE(numout,*) ' Start i indice for SUM control nn_ictls = ', nn_ictls |
---|
310 | WRITE(numout,*) ' End i indice for SUM control nn_ictle = ', nn_ictle |
---|
311 | WRITE(numout,*) ' Start j indice for SUM control nn_jctls = ', nn_jctls |
---|
312 | WRITE(numout,*) ' End j indice for SUM control nn_jctle = ', nn_jctle |
---|
313 | WRITE(numout,*) ' number of proc. following i nn_isplt = ', nn_isplt |
---|
314 | WRITE(numout,*) ' number of proc. following j nn_jsplt = ', nn_jsplt |
---|
315 | WRITE(numout,*) ' timing by routine ln_timing = ', ln_timing |
---|
316 | WRITE(numout,*) ' CFL diagnostics ln_diacfl = ', ln_diacfl |
---|
317 | ENDIF |
---|
318 | ! |
---|
319 | nprint = nn_print ! convert DOCTOR namelist names into OLD names |
---|
320 | nictls = nn_ictls |
---|
321 | nictle = nn_ictle |
---|
322 | njctls = nn_jctls |
---|
323 | njctle = nn_jctle |
---|
324 | isplt = nn_isplt |
---|
325 | jsplt = nn_jsplt |
---|
326 | |
---|
327 | IF(lwp) THEN ! control print |
---|
328 | WRITE(numout,*) |
---|
329 | WRITE(numout,*) ' Namelist namcfg' |
---|
330 | WRITE(numout,*) ' read domain configuration file ln_read_cfg = ', ln_read_cfg |
---|
331 | WRITE(numout,*) ' filename to be read cn_domcfg = ', TRIM(cn_domcfg) |
---|
332 | WRITE(numout,*) ' keep closed seas in the domain (if exist) ln_closea = ', ln_closea |
---|
333 | WRITE(numout,*) ' create a configuration definition file ln_write_cfg = ', ln_write_cfg |
---|
334 | WRITE(numout,*) ' filename to be written cn_domcfg_out = ', TRIM(cn_domcfg_out) |
---|
335 | WRITE(numout,*) ' use file attribute if exists as i/p j-start ln_use_jattr = ', ln_use_jattr |
---|
336 | ENDIF |
---|
337 | IF( .NOT.ln_read_cfg ) ln_closea = .false. ! dealing possible only with a domcfg file |
---|
338 | ! |
---|
339 | ! ! Parameter control |
---|
340 | ! |
---|
341 | IF( sn_cfctl%l_prtctl .OR. sn_cfctl%l_prttrc ) THEN ! sub-domain area indices for the control prints |
---|
342 | IF( lk_mpp .AND. jpnij > 1 ) THEN |
---|
343 | isplt = jpni ; jsplt = jpnj ; ijsplt = jpni*jpnj ! the domain is forced to the real split domain |
---|
344 | ELSE |
---|
345 | IF( isplt == 1 .AND. jsplt == 1 ) THEN |
---|
346 | CALL ctl_warn( ' - isplt & jsplt are equal to 1', & |
---|
347 | & ' - the print control will be done over the whole domain' ) |
---|
348 | ENDIF |
---|
349 | ijsplt = isplt * jsplt ! total number of processors ijsplt |
---|
350 | ENDIF |
---|
351 | IF(lwp) WRITE(numout,*)' - The total number of processors over which the' |
---|
352 | IF(lwp) WRITE(numout,*)' print control will be done is ijsplt : ', ijsplt |
---|
353 | ! |
---|
354 | ! ! indices used for the SUM control |
---|
355 | IF( nictls+nictle+njctls+njctle == 0 ) THEN ! print control done over the default area |
---|
356 | lsp_area = .FALSE. |
---|
357 | ELSE ! print control done over a specific area |
---|
358 | lsp_area = .TRUE. |
---|
359 | IF( nictls < 1 .OR. nictls > jpiglo ) THEN |
---|
360 | CALL ctl_warn( ' - nictls must be 1<=nictls>=jpiglo, it is forced to 1' ) |
---|
361 | nictls = 1 |
---|
362 | ENDIF |
---|
363 | IF( nictle < 1 .OR. nictle > jpiglo ) THEN |
---|
364 | CALL ctl_warn( ' - nictle must be 1<=nictle>=jpiglo, it is forced to jpiglo' ) |
---|
365 | nictle = jpiglo |
---|
366 | ENDIF |
---|
367 | IF( njctls < 1 .OR. njctls > jpjglo ) THEN |
---|
368 | CALL ctl_warn( ' - njctls must be 1<=njctls>=jpjglo, it is forced to 1' ) |
---|
369 | njctls = 1 |
---|
370 | ENDIF |
---|
371 | IF( njctle < 1 .OR. njctle > jpjglo ) THEN |
---|
372 | CALL ctl_warn( ' - njctle must be 1<=njctle>=jpjglo, it is forced to jpjglo' ) |
---|
373 | njctle = jpjglo |
---|
374 | ENDIF |
---|
375 | ENDIF |
---|
376 | ENDIF |
---|
377 | ! |
---|
378 | IF( 1._wp /= SIGN(1._wp,-0._wp) ) CALL ctl_stop( 'nemo_ctl: The intrinsec SIGN function follows f2003 standard.', & |
---|
379 | & 'Compile with key_nosignedzero enabled:', & |
---|
380 | & '--> add -Dkey_nosignedzero to the definition of %CPP in your arch file' ) |
---|
381 | ! |
---|
382 | END SUBROUTINE nemo_ctl |
---|
383 | |
---|
384 | |
---|
385 | SUBROUTINE nemo_closefile |
---|
386 | !!---------------------------------------------------------------------- |
---|
387 | !! *** ROUTINE nemo_closefile *** |
---|
388 | !! |
---|
389 | !! ** Purpose : Close the files |
---|
390 | !!---------------------------------------------------------------------- |
---|
391 | ! |
---|
392 | IF( lk_mpp ) CALL mppsync |
---|
393 | ! |
---|
394 | CALL iom_close ! close all input/output files managed by iom_* |
---|
395 | ! |
---|
396 | IF( numstp /= -1 ) CLOSE( numstp ) ! time-step file |
---|
397 | IF( numrun /= -1 ) CLOSE( numrun ) ! run statistics file |
---|
398 | IF( lwm.AND.numond /= -1 ) CLOSE( numond ) ! oce output namelist |
---|
399 | IF( lwm.AND.numoni /= -1 ) CLOSE( numoni ) ! ice output namelist |
---|
400 | IF( numevo_ice /= -1 ) CLOSE( numevo_ice ) ! ice variables (temp. evolution) |
---|
401 | IF( numout /= 6 ) CLOSE( numout ) ! standard model output file |
---|
402 | ! |
---|
403 | numout = 6 ! redefine numout in case it is used after this point... |
---|
404 | ! |
---|
405 | END SUBROUTINE nemo_closefile |
---|
406 | |
---|
407 | |
---|
408 | SUBROUTINE nemo_alloc |
---|
409 | !!---------------------------------------------------------------------- |
---|
410 | !! *** ROUTINE nemo_alloc *** |
---|
411 | !! |
---|
412 | !! ** Purpose : Allocate all the dynamic arrays of the OPA modules |
---|
413 | !! |
---|
414 | !! ** Method : |
---|
415 | !!---------------------------------------------------------------------- |
---|
416 | USE diawri , ONLY : dia_wri_alloc |
---|
417 | USE dom_oce , ONLY : dom_oce_alloc |
---|
418 | ! |
---|
419 | INTEGER :: ierr |
---|
420 | !!---------------------------------------------------------------------- |
---|
421 | ! |
---|
422 | ierr = oce_alloc () ! ocean |
---|
423 | ierr = ierr + dia_wri_alloc() |
---|
424 | ierr = ierr + dom_oce_alloc() ! ocean domain |
---|
425 | ! |
---|
426 | CALL mpp_sum( 'nemogcm', ierr ) |
---|
427 | IF( ierr /= 0 ) CALL ctl_stop( 'STOP', 'nemo_alloc: unable to allocate standard ocean arrays' ) |
---|
428 | ! |
---|
429 | END SUBROUTINE nemo_alloc |
---|
430 | |
---|
431 | |
---|
432 | SUBROUTINE nemo_set_cfctl(sn_cfctl, setto ) |
---|
433 | !!---------------------------------------------------------------------- |
---|
434 | !! *** ROUTINE nemo_set_cfctl *** |
---|
435 | !! |
---|
436 | !! ** Purpose : Set elements of the output control structure to setto. |
---|
437 | !! |
---|
438 | !! ** Method : Note this routine can be used to switch on/off some |
---|
439 | !! types of output for selected areas. |
---|
440 | !!---------------------------------------------------------------------- |
---|
441 | TYPE(sn_ctl), INTENT(inout) :: sn_cfctl |
---|
442 | LOGICAL , INTENT(in ) :: setto |
---|
443 | !!---------------------------------------------------------------------- |
---|
444 | sn_cfctl%l_runstat = setto |
---|
445 | sn_cfctl%l_trcstat = setto |
---|
446 | sn_cfctl%l_oceout = setto |
---|
447 | sn_cfctl%l_layout = setto |
---|
448 | sn_cfctl%l_prtctl = setto |
---|
449 | sn_cfctl%l_prttrc = setto |
---|
450 | sn_cfctl%l_oasout = setto |
---|
451 | END SUBROUTINE nemo_set_cfctl |
---|
452 | |
---|
453 | !!====================================================================== |
---|
454 | END MODULE nemogcm |
---|
455 | |
---|