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 | !!---------------------------------------------------------------------- |
---|
46 | USE dom_oce ! ocean space and time domain variables |
---|
47 | USE in_out_manager ! I/O manager |
---|
48 | USE iom ! |
---|
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 |
---|
66 | |
---|
67 | #if defined key_agrif |
---|
68 | external agrif_boundary_connections, agrif_update_all, agrif_recompute_scalefactors |
---|
69 | #endif |
---|
70 | |
---|
71 | !!---------------------------------------------------------------------- |
---|
72 | !! NEMO/OPA 3.7 , NEMO Consortium (2015) |
---|
73 | !! $Id: nemogcm.F90 6152 2015-12-21 22:33:57Z acc $ |
---|
74 | !! Software governed by the CeCILL licence (./LICENSE) |
---|
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 | ! |
---|
95 | #if defined key_agrif |
---|
96 | CALL Agrif_Init_Grids() ! AGRIF: set the meshes |
---|
97 | #endif |
---|
98 | ! !-----------------------! |
---|
99 | CALL nemo_init !== Initialisations ==! |
---|
100 | ! !-----------------------! |
---|
101 | PRINT *, 'end nemo init' |
---|
102 | |
---|
103 | #if defined key_agrif |
---|
104 | CALL Agrif_Regrid() |
---|
105 | |
---|
106 | CALL Agrif_Step_Child(agrif_boundary_connections) |
---|
107 | |
---|
108 | CALL Agrif_Step_Child_adj(agrif_update_all) |
---|
109 | |
---|
110 | CALL Agrif_Step_Child(agrif_recompute_scalefactors) |
---|
111 | |
---|
112 | CALL Agrif_Step_Child(cfg_write) |
---|
113 | #endif |
---|
114 | |
---|
115 | ! check that all process are still there... If some process have an error, |
---|
116 | ! they will never enter in step and other processes will wait until the end of the cpu time! |
---|
117 | IF( lk_mpp ) CALL mpp_max( 'nemogcm',nstop ) |
---|
118 | |
---|
119 | IF(lwp) WRITE(numout,cform_aaa) ! Flag AAAAAAA |
---|
120 | |
---|
121 | ! !-----------------------! |
---|
122 | ! !== finalize the run ==! |
---|
123 | ! !------------------------! |
---|
124 | ! |
---|
125 | IF( nstop /= 0 .AND. lwp ) THEN ! error print |
---|
126 | WRITE(numout,cform_err) |
---|
127 | WRITE(numout,*) nstop, ' error have been found' |
---|
128 | ENDIF |
---|
129 | ! |
---|
130 | ! |
---|
131 | PRINT *, 'close file' |
---|
132 | CALL nemo_closefile |
---|
133 | PRINT *, 'The end' |
---|
134 | ! |
---|
135 | ! |
---|
136 | END SUBROUTINE nemo_gcm |
---|
137 | |
---|
138 | |
---|
139 | SUBROUTINE nemo_init |
---|
140 | !!---------------------------------------------------------------------- |
---|
141 | !! *** ROUTINE nemo_init *** |
---|
142 | !! |
---|
143 | !! ** Purpose : initialization of the NEMO GCM |
---|
144 | !!---------------------------------------------------------------------- |
---|
145 | INTEGER :: ji ! dummy loop indices |
---|
146 | INTEGER :: ios, ilocal_comm ! local integers |
---|
147 | CHARACTER(len=120), DIMENSION(60) :: cltxt, cltxt2, clnam |
---|
148 | !! |
---|
149 | NAMELIST/namctl/ ln_ctl , sn_cfctl, nn_print, nn_ictls, nn_ictle, & |
---|
150 | & nn_isplt , nn_jsplt, nn_jctls, nn_jctle, & |
---|
151 | & ln_timing, ln_diacfl |
---|
152 | NAMELIST/namcfg/ ln_e3_dep, & |
---|
153 | & cp_cfg, cp_cfz, jp_cfg, jpidta, jpjdta, jpkdta, jpiglo, jpjglo, & |
---|
154 | & jpizoom, jpjzoom, jperio, ln_use_jattr |
---|
155 | !!---------------------------------------------------------------------- |
---|
156 | ! |
---|
157 | cltxt = '' |
---|
158 | ! |
---|
159 | ! ! Open reference namelist and configuration namelist files |
---|
160 | CALL ctl_opn( numnam_ref, 'namelist_ref', 'OLD', 'FORMATTED', 'SEQUENTIAL', -1, 6, .FALSE. ) |
---|
161 | CALL ctl_opn( numnam_cfg, 'namelist_cfg', 'OLD', 'FORMATTED', 'SEQUENTIAL', -1, 6, .FALSE. ) |
---|
162 | ! |
---|
163 | REWIND( numnam_ref ) ! Namelist namctl in reference namelist |
---|
164 | READ ( numnam_ref, namctl, IOSTAT = ios, ERR = 901 ) |
---|
165 | 901 IF( ios /= 0 ) CALL ctl_nam ( ios , 'namctl in reference namelist', .TRUE. ) |
---|
166 | REWIND( numnam_cfg ) ! Namelist namctl in confguration namelist |
---|
167 | READ ( numnam_cfg, namctl, IOSTAT = ios, ERR = 902 ) |
---|
168 | 902 IF( ios > 0 ) CALL ctl_nam ( ios , 'namctl in configuration namelist', .TRUE. ) |
---|
169 | ! |
---|
170 | REWIND( numnam_ref ) ! Namelist namcfg in reference namelist |
---|
171 | READ ( numnam_ref, namcfg, IOSTAT = ios, ERR = 903 ) |
---|
172 | 903 IF( ios /= 0 ) CALL ctl_nam ( ios , 'namcfg in reference namelist', .TRUE. ) |
---|
173 | REWIND( numnam_cfg ) ! Namelist namcfg in confguration namelist |
---|
174 | READ ( numnam_cfg, namcfg, IOSTAT = ios, ERR = 904 ) |
---|
175 | 904 IF( ios > 0 ) CALL ctl_nam ( ios , 'namcfg in configuration namelist', .TRUE. ) |
---|
176 | |
---|
177 | ! Force values for AGRIF zoom (cf. agrif_user.F90) |
---|
178 | ! |
---|
179 | ! !--------------------------------------------! |
---|
180 | ! ! set communicator & select the local node ! |
---|
181 | ! ! NB: mynode also opens output.namelist.dyn ! |
---|
182 | ! ! on unit number numond on first proc ! |
---|
183 | ! !--------------------------------------------! |
---|
184 | ! Nodes selection (control print return in cltxt) |
---|
185 | narea = mynode( cltxt, 'output.namelist.dyn', numnam_ref, numnam_cfg, numond , nstop ) |
---|
186 | narea = narea + 1 ! mynode return the rank of proc (0 --> jpnij -1 ) |
---|
187 | |
---|
188 | lwm = (narea == 1) ! control of output namelists |
---|
189 | lwp = (narea == 1) .OR. ln_ctl ! control of all listing output print |
---|
190 | |
---|
191 | IF(lwm) THEN |
---|
192 | ! write merged namelists from earlier to output namelist now that the |
---|
193 | ! file has been opened in call to mynode. nammpp has already been |
---|
194 | ! written in mynode (if lk_mpp_mpi) |
---|
195 | WRITE( numond, namctl ) |
---|
196 | WRITE( numond, namcfg ) |
---|
197 | ENDIF |
---|
198 | |
---|
199 | IF(lwp) THEN ! open listing units |
---|
200 | ! |
---|
201 | CALL ctl_opn( numout, 'ocean.output', 'REPLACE', 'FORMATTED', 'SEQUENTIAL', -1, 6, .FALSE., narea ) |
---|
202 | ! |
---|
203 | WRITE(numout,*) |
---|
204 | WRITE(numout,*) ' CNRS - NERC - Met OFFICE - MERCATOR-ocean - INGV - CMCC' |
---|
205 | WRITE(numout,*) ' NEMO team' |
---|
206 | WRITE(numout,*) ' Ocean General Circulation Model' |
---|
207 | WRITE(numout,*) ' NEMO version 4.0 (2019) ' |
---|
208 | WRITE(numout,*) |
---|
209 | WRITE(numout,*) " ._ ._ ._ ._ ._ " |
---|
210 | WRITE(numout,*) " _.-._)`\_.-._)`\_.-._)`\_.-._)`\_.-._)`\_ " |
---|
211 | WRITE(numout,*) |
---|
212 | WRITE(numout,*) " o _, _, " |
---|
213 | WRITE(numout,*) " o .' ( .-' / " |
---|
214 | WRITE(numout,*) " o _/..._'. .' / " |
---|
215 | WRITE(numout,*) " ( o .-'` ` '-./ _.' " |
---|
216 | WRITE(numout,*) " ) ( o) ;= <_ ( " |
---|
217 | WRITE(numout,*) " ( '-.,\\__ __.-;`\ '. ) " |
---|
218 | WRITE(numout,*) " ) ) \) |`\ \) '. \ ( ( " |
---|
219 | WRITE(numout,*) " ( ( \_/ '-._\ ) ) " |
---|
220 | WRITE(numout,*) " ) ) ` ( ( " |
---|
221 | WRITE(numout,*) " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ " |
---|
222 | WRITE(numout,*) |
---|
223 | |
---|
224 | DO ji = 1, SIZE(cltxt) |
---|
225 | IF( TRIM(cltxt (ji)) /= '' ) WRITE(numout,*) TRIM(cltxt(ji)) ! control print of mynode |
---|
226 | END DO |
---|
227 | WRITE(numout,*) |
---|
228 | WRITE(numout,*) |
---|
229 | ! DO ji = 1, SIZE(cltxt2) |
---|
230 | ! IF( TRIM(cltxt2(ji)) /= '' ) WRITE(numout,*) TRIM(cltxt2(ji)) ! control print of domain size |
---|
231 | ! END DO |
---|
232 | ! |
---|
233 | WRITE(numout,cform_aaa) ! Flag AAAAAAA |
---|
234 | ! |
---|
235 | ENDIF |
---|
236 | ! open /dev/null file to be able to supress output write easily |
---|
237 | ! CALL ctl_opn( numnul, '/dev/null', 'REPLACE', 'FORMATTED', 'SEQUENTIAL', -1, 6, .FALSE. ) |
---|
238 | ! |
---|
239 | ! ! Domain decomposition |
---|
240 | CALL mpp_init ! MPP |
---|
241 | |
---|
242 | ! IF( Agrif_Root() ) THEN |
---|
243 | ! jpi = ( jpiglo -2*jpreci + (jpni-1) ) / jpni + 2*jpreci ! first dim. |
---|
244 | ! jpj = ( jpjglo -2*jprecj + (jpnj-1) ) / jpnj + 2*jprecj ! second dim. |
---|
245 | ! ENDIF |
---|
246 | jpk = jpkdta ! third dim |
---|
247 | jpim1 = jpi-1 ! inner domain indices |
---|
248 | jpjm1 = jpj-1 ! " " |
---|
249 | jpkm1 = jpk-1 ! " " |
---|
250 | jpij = jpi*jpj ! jpi x j |
---|
251 | |
---|
252 | #if defined key_agrif |
---|
253 | CALL Agrif_Declare_Var |
---|
254 | #endif |
---|
255 | |
---|
256 | ! Now we know the dimensions of the grid and numout has been set: we can allocate arrays |
---|
257 | CALL nemo_alloc() |
---|
258 | |
---|
259 | ! !-------------------------------! |
---|
260 | ! ! NEMO general initialization ! |
---|
261 | ! !-------------------------------! |
---|
262 | |
---|
263 | CALL nemo_ctl ! Control prints & Benchmark |
---|
264 | |
---|
265 | ! ! Domain decomposition |
---|
266 | ! |
---|
267 | ! ! General initialization |
---|
268 | CALL phy_cst ! Physical constants |
---|
269 | CALL dom_cfg ! Domain configuration |
---|
270 | CALL dom_init ! Domain |
---|
271 | ! |
---|
272 | END SUBROUTINE nemo_init |
---|
273 | |
---|
274 | |
---|
275 | SUBROUTINE nemo_ctl |
---|
276 | !!---------------------------------------------------------------------- |
---|
277 | !! *** ROUTINE nemo_ctl *** |
---|
278 | !! |
---|
279 | !! ** Purpose : control print setting |
---|
280 | !! |
---|
281 | !! ** Method : - print namctl information and check some consistencies |
---|
282 | !!---------------------------------------------------------------------- |
---|
283 | ! |
---|
284 | IF(lwp) THEN ! control print |
---|
285 | WRITE(numout,*) |
---|
286 | WRITE(numout,*) 'nemo_ctl: Control prints' |
---|
287 | WRITE(numout,*) '~~~~~~~~' |
---|
288 | WRITE(numout,*) ' Namelist namctl' |
---|
289 | WRITE(numout,*) ' run control (for debugging) ln_ctl = ', ln_ctl |
---|
290 | WRITE(numout,*) ' finer control over o/p sn_cfctl%l_config = ', sn_cfctl%l_config |
---|
291 | WRITE(numout,*) ' sn_cfctl%l_runstat = ', sn_cfctl%l_runstat |
---|
292 | WRITE(numout,*) ' sn_cfctl%l_trcstat = ', sn_cfctl%l_trcstat |
---|
293 | WRITE(numout,*) ' sn_cfctl%l_oceout = ', sn_cfctl%l_oceout |
---|
294 | WRITE(numout,*) ' sn_cfctl%l_layout = ', sn_cfctl%l_layout |
---|
295 | WRITE(numout,*) ' sn_cfctl%l_mppout = ', sn_cfctl%l_mppout |
---|
296 | WRITE(numout,*) ' sn_cfctl%l_mpptop = ', sn_cfctl%l_mpptop |
---|
297 | WRITE(numout,*) ' sn_cfctl%procmin = ', sn_cfctl%procmin |
---|
298 | WRITE(numout,*) ' sn_cfctl%procmax = ', sn_cfctl%procmax |
---|
299 | WRITE(numout,*) ' sn_cfctl%procincr = ', sn_cfctl%procincr |
---|
300 | WRITE(numout,*) ' sn_cfctl%ptimincr = ', sn_cfctl%ptimincr |
---|
301 | WRITE(numout,*) ' level of print nn_print = ', nn_print |
---|
302 | WRITE(numout,*) ' Start i indice for SUM control nn_ictls = ', nn_ictls |
---|
303 | WRITE(numout,*) ' End i indice for SUM control nn_ictle = ', nn_ictle |
---|
304 | WRITE(numout,*) ' Start j indice for SUM control nn_jctls = ', nn_jctls |
---|
305 | WRITE(numout,*) ' End j indice for SUM control nn_jctle = ', nn_jctle |
---|
306 | WRITE(numout,*) ' number of proc. following i nn_isplt = ', nn_isplt |
---|
307 | WRITE(numout,*) ' number of proc. following j nn_jsplt = ', nn_jsplt |
---|
308 | WRITE(numout,*) ' timing by routine ln_timing = ', ln_timing |
---|
309 | WRITE(numout,*) ' CFL diagnostics ln_diacfl = ', ln_diacfl |
---|
310 | ENDIF |
---|
311 | ! |
---|
312 | nprint = nn_print ! convert DOCTOR namelist names into OLD names |
---|
313 | nictls = nn_ictls |
---|
314 | nictle = nn_ictle |
---|
315 | njctls = nn_jctls |
---|
316 | njctle = nn_jctle |
---|
317 | isplt = nn_isplt |
---|
318 | jsplt = nn_jsplt |
---|
319 | |
---|
320 | ! IF( .NOT.ln_read_cfg ) ln_closea = .false. ! dealing possible only with a domcfg file |
---|
321 | ! |
---|
322 | ! ! Parameter control |
---|
323 | ! |
---|
324 | IF( ln_ctl ) THEN ! sub-domain area indices for the control prints |
---|
325 | IF( lk_mpp .AND. jpnij > 1 ) THEN |
---|
326 | isplt = jpni ; jsplt = jpnj ; ijsplt = jpni*jpnj ! the domain is forced to the real split domain |
---|
327 | ELSE |
---|
328 | IF( isplt == 1 .AND. jsplt == 1 ) THEN |
---|
329 | CALL ctl_warn( ' - isplt & jsplt are equal to 1', & |
---|
330 | & ' - the print control will be done over the whole domain' ) |
---|
331 | ENDIF |
---|
332 | ijsplt = isplt * jsplt ! total number of processors ijsplt |
---|
333 | ENDIF |
---|
334 | IF(lwp) WRITE(numout,*)' - The total number of processors over which the' |
---|
335 | IF(lwp) WRITE(numout,*)' print control will be done is ijsplt : ', ijsplt |
---|
336 | ! |
---|
337 | ! ! indices used for the SUM control |
---|
338 | IF( nictls+nictle+njctls+njctle == 0 ) THEN ! print control done over the default area |
---|
339 | lsp_area = .FALSE. |
---|
340 | ELSE ! print control done over a specific area |
---|
341 | lsp_area = .TRUE. |
---|
342 | IF( nictls < 1 .OR. nictls > jpiglo ) THEN |
---|
343 | CALL ctl_warn( ' - nictls must be 1<=nictls>=jpiglo, it is forced to 1' ) |
---|
344 | nictls = 1 |
---|
345 | ENDIF |
---|
346 | IF( nictle < 1 .OR. nictle > jpiglo ) THEN |
---|
347 | CALL ctl_warn( ' - nictle must be 1<=nictle>=jpiglo, it is forced to jpiglo' ) |
---|
348 | nictle = jpiglo |
---|
349 | ENDIF |
---|
350 | IF( njctls < 1 .OR. njctls > jpjglo ) THEN |
---|
351 | CALL ctl_warn( ' - njctls must be 1<=njctls>=jpjglo, it is forced to 1' ) |
---|
352 | njctls = 1 |
---|
353 | ENDIF |
---|
354 | IF( njctle < 1 .OR. njctle > jpjglo ) THEN |
---|
355 | CALL ctl_warn( ' - njctle must be 1<=njctle>=jpjglo, it is forced to jpjglo' ) |
---|
356 | njctle = jpjglo |
---|
357 | ENDIF |
---|
358 | ENDIF |
---|
359 | ENDIF |
---|
360 | ! |
---|
361 | ! IF( 1._wp /= SIGN(1._wp,-0._wp) ) CALL ctl_stop( 'nemo_ctl: The intrinsec SIGN function follows f2003 standard.', & |
---|
362 | ! & 'Compile with key_nosignedzero enabled:', & |
---|
363 | ! & '--> add -Dkey_nosignedzero to the definition of %CPP in your arch file' ) |
---|
364 | ! |
---|
365 | #if defined key_agrif |
---|
366 | IF( ln_timing ) CALL ctl_stop( 'AGRIF not implemented with ln_timing = true') |
---|
367 | #endif |
---|
368 | ! |
---|
369 | END SUBROUTINE nemo_ctl |
---|
370 | |
---|
371 | |
---|
372 | SUBROUTINE nemo_closefile |
---|
373 | !!---------------------------------------------------------------------- |
---|
374 | !! *** ROUTINE nemo_closefile *** |
---|
375 | !! |
---|
376 | !! ** Purpose : Close the files |
---|
377 | !!---------------------------------------------------------------------- |
---|
378 | ! |
---|
379 | IF( lk_mpp ) CALL mppsync |
---|
380 | ! |
---|
381 | CALL iom_close ! close all input/output files managed by iom_* |
---|
382 | ! |
---|
383 | IF( numstp /= -1 ) CLOSE( numstp ) ! time-step file |
---|
384 | IF( numnam_ref /= -1 ) CLOSE( numnam_ref ) ! oce reference namelist |
---|
385 | IF( numnam_cfg /= -1 ) CLOSE( numnam_cfg ) ! oce configuration namelist |
---|
386 | IF( lwm.AND.numond /= -1 ) CLOSE( numond ) ! oce output namelist |
---|
387 | IF( numnam_ice_ref /= -1 ) CLOSE( numnam_ice_ref ) ! ice reference namelist |
---|
388 | IF( numnam_ice_cfg /= -1 ) CLOSE( numnam_ice_cfg ) ! ice configuration namelist |
---|
389 | IF( lwm.AND.numoni /= -1 ) CLOSE( numoni ) ! ice output namelist |
---|
390 | IF( numevo_ice /= -1 ) CLOSE( numevo_ice ) ! ice variables (temp. evolution) |
---|
391 | IF( numout /= 6 ) CLOSE( numout ) ! standard model output file |
---|
392 | IF( numdct_vol /= -1 ) CLOSE( numdct_vol ) ! volume transports |
---|
393 | IF( numdct_heat /= -1 ) CLOSE( numdct_heat ) ! heat transports |
---|
394 | IF( numdct_salt /= -1 ) CLOSE( numdct_salt ) ! salt transports |
---|
395 | ! |
---|
396 | numout = 6 ! redefine numout in case it is used after this point... |
---|
397 | ! |
---|
398 | END SUBROUTINE nemo_closefile |
---|
399 | |
---|
400 | |
---|
401 | SUBROUTINE nemo_alloc |
---|
402 | !!---------------------------------------------------------------------- |
---|
403 | !! *** ROUTINE nemo_alloc *** |
---|
404 | !! |
---|
405 | !! ** Purpose : Allocate all the dynamic arrays of the OPA modules |
---|
406 | !! |
---|
407 | !! ** Method : |
---|
408 | !!---------------------------------------------------------------------- |
---|
409 | USE dom_oce , ONLY: dom_oce_alloc |
---|
410 | ! |
---|
411 | INTEGER :: ierr |
---|
412 | !!---------------------------------------------------------------------- |
---|
413 | ! |
---|
414 | ierr = dom_oce_alloc () ! ocean domain |
---|
415 | ! |
---|
416 | CALL mpp_sum( 'nemogcm', ierr ) |
---|
417 | IF( ierr /= 0 ) CALL ctl_stop( 'STOP', 'nemo_alloc : unable to allocate standard ocean arrays' ) |
---|
418 | ! |
---|
419 | END SUBROUTINE nemo_alloc |
---|
420 | |
---|
421 | |
---|
422 | |
---|
423 | !!====================================================================== |
---|
424 | END MODULE nemogcm |
---|
425 | |
---|