1 | MODULE mppini |
---|
2 | !!============================================================================== |
---|
3 | !! *** MODULE mppini *** |
---|
4 | !! Ocean initialization : distributed memory computing initialization |
---|
5 | !!============================================================================== |
---|
6 | |
---|
7 | !!---------------------------------------------------------------------- |
---|
8 | !! mpp_init : Lay out the global domain over processors |
---|
9 | !! mpp_init2 : Lay out the global domain over processors |
---|
10 | !! with land processor elimination |
---|
11 | !! mpp_init_ioispl: IOIPSL initialization in mpp |
---|
12 | !!---------------------------------------------------------------------- |
---|
13 | !! * Modules used |
---|
14 | USE dom_oce ! ocean space and time domain |
---|
15 | USE in_out_manager ! I/O Manager |
---|
16 | USE sol_oce ! ocean elliptic solver |
---|
17 | USE lib_mpp ! distribued memory computing library |
---|
18 | USE ioipsl |
---|
19 | |
---|
20 | IMPLICIT NONE |
---|
21 | PRIVATE |
---|
22 | |
---|
23 | !! * Routine accessibility |
---|
24 | PUBLIC mpp_init ! called by opa.F90 |
---|
25 | PUBLIC mpp_init2 ! called by opa.F90 |
---|
26 | |
---|
27 | !! * Substitutions |
---|
28 | # include "domzgr_substitute.h90" |
---|
29 | !!---------------------------------------------------------------------- |
---|
30 | !! OPA 9.0 , LOCEAN-IPSL (2005) |
---|
31 | !! $Header$ |
---|
32 | !! This software is governed by the CeCILL licence see modipsl/doc/NEMO_CeCILL.txt |
---|
33 | !!---------------------------------------------------------------------- |
---|
34 | |
---|
35 | CONTAINS |
---|
36 | |
---|
37 | #if ! defined key_mpp_mpi && ! defined key_mpp_shmem |
---|
38 | !!---------------------------------------------------------------------- |
---|
39 | !! Default option : shared memory computing |
---|
40 | !!---------------------------------------------------------------------- |
---|
41 | |
---|
42 | SUBROUTINE mpp_init |
---|
43 | !!---------------------------------------------------------------------- |
---|
44 | !! *** ROUTINE mpp_init *** |
---|
45 | !! |
---|
46 | !! ** Purpose : Lay out the global domain over processors. |
---|
47 | !! |
---|
48 | !! ** Method : Shared memory computing, set the local processor |
---|
49 | !! variables to the value of the global domain |
---|
50 | !! |
---|
51 | !! History : |
---|
52 | !! 9.0 ! 04-01 (G. Madec, J.M. Molines) F90 : free form, north fold jpni >1 |
---|
53 | !!---------------------------------------------------------------------- |
---|
54 | ! No mpp computation |
---|
55 | |
---|
56 | nimpp = 1 |
---|
57 | njmpp = 1 |
---|
58 | nlci = jpi |
---|
59 | nlcj = jpj |
---|
60 | nldi = 1 |
---|
61 | nldj = 1 |
---|
62 | nlei = jpi |
---|
63 | nlej = jpj |
---|
64 | nperio = jperio |
---|
65 | nbondi = 2 |
---|
66 | nbondj = 2 |
---|
67 | nidom = FLIO_DOM_NONE |
---|
68 | |
---|
69 | IF(lwp) THEN |
---|
70 | WRITE(numout,*) |
---|
71 | WRITE(numout,*) 'mpp_init(2) : NO massively parallel processing' |
---|
72 | WRITE(numout,*) '~~~~~~~~~~~: ' |
---|
73 | WRITE(numout,*) ' nperio = ', nperio |
---|
74 | WRITE(numout,*) ' npolj = ', npolj |
---|
75 | WRITE(numout,*) ' nimpp = ', nimpp |
---|
76 | WRITE(numout,*) ' njmpp = ', njmpp |
---|
77 | ENDIF |
---|
78 | |
---|
79 | IF( jpni /= 1 .OR. jpnj /= 1 .OR. jpnij /= 1 ) THEN |
---|
80 | IF(lwp)WRITE(numout,cform_err) |
---|
81 | IF(lwp)WRITE(numout,*) 'equality jpni = jpnj = jpnij = 1 is not satisfied' |
---|
82 | IF(lwp)WRITE(numout,*) 'the domain is lay out for distributed memory computing! ' |
---|
83 | nstop = nstop + 1 |
---|
84 | ENDIF |
---|
85 | |
---|
86 | END SUBROUTINE mpp_init |
---|
87 | |
---|
88 | |
---|
89 | SUBROUTINE mpp_init2 |
---|
90 | CALL mpp_init ! same routine as mpp_init |
---|
91 | END SUBROUTINE mpp_init2 |
---|
92 | |
---|
93 | #else |
---|
94 | !!---------------------------------------------------------------------- |
---|
95 | !! 'key_mpp_mpi' OR MPI massively parallel processing |
---|
96 | !! 'key_mpp_shmem' SHMEM massively parallel processing |
---|
97 | !!---------------------------------------------------------------------- |
---|
98 | |
---|
99 | SUBROUTINE mpp_init |
---|
100 | !!---------------------------------------------------------------------- |
---|
101 | !! *** ROUTINE mpp_init *** |
---|
102 | !! |
---|
103 | !! ** Purpose : Lay out the global domain over processors. |
---|
104 | !! |
---|
105 | !! ** Method : Global domain is distributed in smaller local domains. |
---|
106 | !! Periodic condition is a function of the local domain position |
---|
107 | !! (global boundary or neighbouring domain) and of the global |
---|
108 | !! periodic |
---|
109 | !! Type : jperio global periodic condition |
---|
110 | !! nperio local periodic condition |
---|
111 | !! |
---|
112 | !! ** Action : - set domain parameters |
---|
113 | !! nimpp : longitudinal index |
---|
114 | !! njmpp : latitudinal index |
---|
115 | !! nperio : lateral condition type |
---|
116 | !! narea : number for local area |
---|
117 | !! nlci : first dimension |
---|
118 | !! nlcj : second dimension |
---|
119 | !! nbondi : mark for "east-west local boundary" |
---|
120 | !! nbondj : mark for "north-south local boundary" |
---|
121 | !! nproc : number for local processor |
---|
122 | !! noea : number for local neighboring processor |
---|
123 | !! nowe : number for local neighboring processor |
---|
124 | !! noso : number for local neighboring processor |
---|
125 | !! nono : number for local neighboring processor |
---|
126 | !! |
---|
127 | !! History : |
---|
128 | !! ! 94-11 (M. Guyon) Original code |
---|
129 | !! ! 95-04 (J. Escobar, M. Imbard) |
---|
130 | !! ! 98-02 (M. Guyon) FETI method |
---|
131 | !! ! 98-05 (M. Imbard, J. Escobar, L. Colombet ) SHMEM and MPI versions |
---|
132 | !! 8.5 ! 02-08 (G. Madec) F90 : free form |
---|
133 | !!---------------------------------------------------------------------- |
---|
134 | !! * Local variables |
---|
135 | INTEGER :: ji, jj, jn ! dummy loop indices |
---|
136 | INTEGER :: & |
---|
137 | ii, ij, ifreq, il1, il2, & ! temporary integers |
---|
138 | iresti, irestj, ijm1, imil, & ! " " |
---|
139 | inum ! temporary logical unit |
---|
140 | |
---|
141 | INTEGER, DIMENSION(jpni,jpnj) :: & |
---|
142 | iimppt, ijmppt, ilcit, ilcjt ! temporary workspace |
---|
143 | REAL(wp) :: zidom, zjdom ! temporary scalars |
---|
144 | !!---------------------------------------------------------------------- |
---|
145 | |
---|
146 | #if defined key_mpp_shmem |
---|
147 | IF(lwp) WRITE(numout,*) |
---|
148 | IF(lwp) WRITE(numout,*) 'mpp_init : Message Passing PVM T3E + SHMEM' |
---|
149 | IF(lwp) WRITE(numout,*) '~~~~~~~~' |
---|
150 | |
---|
151 | CALL mppshmem ! Initialisation of shmem array |
---|
152 | |
---|
153 | #endif |
---|
154 | #if defined key_mpp_mpi |
---|
155 | IF(lwp) WRITE(numout,*) |
---|
156 | IF(lwp) WRITE(numout,*) 'mpp_init : Message Passing MPI' |
---|
157 | IF(lwp) WRITE(numout,*) '~~~~~~~~' |
---|
158 | #endif |
---|
159 | |
---|
160 | |
---|
161 | ! 1. Dimension arrays for subdomains |
---|
162 | ! ----------------------------------- |
---|
163 | ! Computation of local domain sizes ilcit() ilcjt() |
---|
164 | ! These dimensions depend on global sizes jpni,jpnj and jpiglo,jpjglo |
---|
165 | ! The subdomains are squares leeser than or equal to the global |
---|
166 | ! dimensions divided by the number of processors minus the overlap |
---|
167 | ! array (cf. par_oce.F90). |
---|
168 | |
---|
169 | nreci = 2 * jpreci |
---|
170 | nrecj = 2 * jprecj |
---|
171 | iresti = MOD( jpiglo - nreci , jpni ) |
---|
172 | irestj = MOD( jpjglo - nrecj , jpnj ) |
---|
173 | |
---|
174 | IF( iresti == 0 ) iresti = jpni |
---|
175 | DO jj = 1, jpnj |
---|
176 | DO ji = 1, iresti |
---|
177 | ilcit(ji,jj) = jpi |
---|
178 | END DO |
---|
179 | DO ji = iresti+1, jpni |
---|
180 | ilcit(ji,jj) = jpi -1 |
---|
181 | END DO |
---|
182 | END DO |
---|
183 | |
---|
184 | IF( irestj == 0 ) irestj = jpnj |
---|
185 | DO ji = 1, jpni |
---|
186 | DO jj = 1, irestj |
---|
187 | ilcjt(ji,jj) = jpj |
---|
188 | END DO |
---|
189 | DO jj = irestj+1, jpnj |
---|
190 | ilcjt(ji,jj) = jpj -1 |
---|
191 | END DO |
---|
192 | END DO |
---|
193 | |
---|
194 | IF(lwp) THEN |
---|
195 | WRITE(numout,*) |
---|
196 | WRITE(numout,*) ' defines mpp subdomains' |
---|
197 | WRITE(numout,*) ' ----------------------' |
---|
198 | WRITE(numout,*) ' iresti=',iresti,' irestj=',irestj |
---|
199 | WRITE(numout,*) ' jpni=',jpni,' jpnj=',jpnj |
---|
200 | ifreq = 4 |
---|
201 | il1 = 1 |
---|
202 | DO jn = 1, (jpni-1)/ifreq+1 |
---|
203 | il2 = MIN( jpni, il1+ifreq-1 ) |
---|
204 | WRITE(numout,*) |
---|
205 | WRITE(numout,9201) (ji,ji = il1,il2) |
---|
206 | WRITE(numout,9200) ('***',ji = il1,il2-1) |
---|
207 | DO jj = 1, jpnj |
---|
208 | WRITE(numout,9203) (' ',ji = il1,il2-1) |
---|
209 | WRITE(numout,9202) jj, ( ilcit(ji,jj),ilcjt(ji,jj),ji = il1,il2 ) |
---|
210 | WRITE(numout,9203) (' ',ji = il1,il2-1) |
---|
211 | WRITE(numout,9200) ('***',ji = il1,il2-1) |
---|
212 | END DO |
---|
213 | il1 = il1+ifreq |
---|
214 | END DO |
---|
215 | 9200 FORMAT(' ***',20('*************',a3)) |
---|
216 | 9203 FORMAT(' * ',20(' * ',a3)) |
---|
217 | 9201 FORMAT(' ',20(' ',i3,' ')) |
---|
218 | 9202 FORMAT(' ',i3,' * ',20(i3,' x',i3,' * ')) |
---|
219 | ENDIF |
---|
220 | |
---|
221 | zidom = nreci |
---|
222 | DO ji = 1, jpni |
---|
223 | zidom = zidom + ilcit(ji,1) - nreci |
---|
224 | END DO |
---|
225 | IF(lwp) WRITE(numout,*) |
---|
226 | IF(lwp) WRITE(numout,*)' sum ilcit(i,1) = ', zidom, ' jpiglo = ', jpiglo |
---|
227 | |
---|
228 | zjdom = nrecj |
---|
229 | DO jj = 1, jpnj |
---|
230 | zjdom = zjdom + ilcjt(1,jj) - nrecj |
---|
231 | END DO |
---|
232 | IF(lwp) WRITE(numout,*)' sum ilcit(1,j) = ', zjdom, ' jpjglo = ', jpjglo |
---|
233 | IF(lwp) WRITE(numout,*) |
---|
234 | |
---|
235 | |
---|
236 | ! 2. Index arrays for subdomains |
---|
237 | ! ------------------------------- |
---|
238 | |
---|
239 | iimppt(:,:) = 1 |
---|
240 | ijmppt(:,:) = 1 |
---|
241 | |
---|
242 | IF( jpni > 1 ) THEN |
---|
243 | DO jj = 1, jpnj |
---|
244 | DO ji = 2, jpni |
---|
245 | iimppt(ji,jj) = iimppt(ji-1,jj) + ilcit(ji-1,jj) - nreci |
---|
246 | END DO |
---|
247 | END DO |
---|
248 | ENDIF |
---|
249 | |
---|
250 | IF( jpnj > 1 ) THEN |
---|
251 | DO jj = 2, jpnj |
---|
252 | DO ji = 1, jpni |
---|
253 | ijmppt(ji,jj) = ijmppt(ji,jj-1)+ilcjt(ji,jj-1)-nrecj |
---|
254 | END DO |
---|
255 | END DO |
---|
256 | ENDIF |
---|
257 | |
---|
258 | ! 3. Subdomain description |
---|
259 | ! ------------------------ |
---|
260 | |
---|
261 | DO jn = 1, jpnij |
---|
262 | ii = 1 + MOD( jn-1, jpni ) |
---|
263 | ij = 1 + (jn-1) / jpni |
---|
264 | nimppt(jn) = iimppt(ii,ij) |
---|
265 | njmppt(jn) = ijmppt(ii,ij) |
---|
266 | nlcit (jn) = ilcit (ii,ij) |
---|
267 | nlci = nlcit (jn) |
---|
268 | nlcjt (jn) = ilcjt (ii,ij) |
---|
269 | nlcj = nlcjt (jn) |
---|
270 | nbondj = -1 ! general case |
---|
271 | IF( jn > jpni ) nbondj = 0 ! first row of processor |
---|
272 | IF( jn > (jpnj-1)*jpni ) nbondj = 1 ! last row of processor |
---|
273 | IF( jpnj == 1 ) nbondj = 2 ! one processor only in j-direction |
---|
274 | ibonjt(jn) = nbondj |
---|
275 | |
---|
276 | nbondi = 0 ! |
---|
277 | IF( MOD( jn, jpni ) == 1 ) nbondi = -1 ! |
---|
278 | IF( MOD( jn, jpni ) == 0 ) nbondi = 1 ! |
---|
279 | IF( jpni == 1 ) nbondi = 2 ! one processor only in i-direction |
---|
280 | ibonit(jn) = nbondi |
---|
281 | |
---|
282 | nldi = 1 + jpreci |
---|
283 | nlei = nlci - jpreci |
---|
284 | IF( nbondi == -1 .OR. nbondi == 2 ) nldi = 1 |
---|
285 | IF( nbondi == 1 .OR. nbondi == 2 ) nlei = nlci |
---|
286 | nldj = 1 + jprecj |
---|
287 | nlej = nlcj - jprecj |
---|
288 | IF( nbondj == -1 .OR. nbondj == 2 ) nldj = 1 |
---|
289 | IF( nbondj == 1 .OR. nbondj == 2 ) nlej = nlcj |
---|
290 | nldit(jn) = nldi |
---|
291 | nleit(jn) = nlei |
---|
292 | nldjt(jn) = nldj |
---|
293 | nlejt(jn) = nlej |
---|
294 | END DO |
---|
295 | |
---|
296 | |
---|
297 | ! 4. From global to local |
---|
298 | ! ----------------------- |
---|
299 | |
---|
300 | nperio = 0 |
---|
301 | IF( jperio == 2 .AND. nbondj == -1 ) nperio = 2 |
---|
302 | |
---|
303 | |
---|
304 | ! 5. Subdomain neighbours |
---|
305 | ! ---------------------- |
---|
306 | |
---|
307 | nproc = narea - 1 |
---|
308 | noso = nproc - jpni |
---|
309 | nowe = nproc - 1 |
---|
310 | noea = nproc + 1 |
---|
311 | nono = nproc + jpni |
---|
312 | ! great neighbours |
---|
313 | npnw = nono - 1 |
---|
314 | npne = nono + 1 |
---|
315 | npsw = noso - 1 |
---|
316 | npse = noso + 1 |
---|
317 | nbsw = 1 |
---|
318 | nbnw = 1 |
---|
319 | IF( MOD( nproc, jpni ) == 0 ) THEN |
---|
320 | nbsw = 0 |
---|
321 | nbnw = 0 |
---|
322 | ENDIF |
---|
323 | nbse = 1 |
---|
324 | nbne = 1 |
---|
325 | IF( MOD( nproc, jpni ) == jpni-1 ) THEN |
---|
326 | nbse = 0 |
---|
327 | nbne = 0 |
---|
328 | ENDIF |
---|
329 | IF(nproc < jpni) THEN |
---|
330 | nbsw = 0 |
---|
331 | nbse = 0 |
---|
332 | ENDIF |
---|
333 | IF( nproc >= (jpnj-1)*jpni ) THEN |
---|
334 | nbnw = 0 |
---|
335 | nbne = 0 |
---|
336 | ENDIF |
---|
337 | nlcj = nlcjt(narea) |
---|
338 | nlci = nlcit(narea) |
---|
339 | nldi = nldit(narea) |
---|
340 | nlei = nleit(narea) |
---|
341 | nldj = nldjt(narea) |
---|
342 | nlej = nlejt(narea) |
---|
343 | nbondi = ibonit(narea) |
---|
344 | nbondj = ibonjt(narea) |
---|
345 | nimpp = nimppt(narea) |
---|
346 | njmpp = njmppt(narea) |
---|
347 | |
---|
348 | ! Save processor layout in layout.dat file |
---|
349 | IF (lwp) THEN |
---|
350 | CALL ctlopn( inum, 'layout.dat', 'UNKNOWN', 'FORMATTED', 'SEQUENTIAL', & |
---|
351 | & 1, numout, .FALSE., 1 ) |
---|
352 | WRITE(inum,'(6i8)') jpnij,jpi,jpj,jpk,jpiglo,jpjglo |
---|
353 | WRITE(inum,'(a)') 'NAREA nlci nlcj nldi nldj nlei nlej nimpp njmpp' |
---|
354 | |
---|
355 | DO jn = 1, jpnij |
---|
356 | WRITE(inum,'(9i5)') jn, nlcit(jn), nlcjt(jn), & |
---|
357 | nldit(jn), nldjt(jn), & |
---|
358 | nleit(jn), nlejt(jn), & |
---|
359 | nimppt(jn), njmppt(jn) |
---|
360 | END DO |
---|
361 | CLOSE(inum) |
---|
362 | END IF |
---|
363 | |
---|
364 | |
---|
365 | ! w a r n i n g narea (zone) /= nproc (processors)! |
---|
366 | |
---|
367 | IF( jperio == 1 .OR. jperio == 4 .OR. jperio == 6 ) THEN |
---|
368 | IF( jpni == 1 )THEN |
---|
369 | nbondi = 2 |
---|
370 | nperio = 1 |
---|
371 | ELSE |
---|
372 | nbondi = 0 |
---|
373 | ENDIF |
---|
374 | IF( MOD( narea, jpni ) == 0 ) THEN |
---|
375 | noea = nproc-(jpni-1) |
---|
376 | npne = npne-jpni |
---|
377 | npse = npse-jpni |
---|
378 | ENDIF |
---|
379 | IF( MOD( narea, jpni ) == 1 ) THEN |
---|
380 | nowe = nproc+(jpni-1) |
---|
381 | npnw = npnw+jpni |
---|
382 | npsw = npsw+jpni |
---|
383 | ENDIF |
---|
384 | nbsw = 1 |
---|
385 | nbnw = 1 |
---|
386 | nbse = 1 |
---|
387 | nbne = 1 |
---|
388 | IF( nproc < jpni ) THEN |
---|
389 | nbsw = 0 |
---|
390 | nbse = 0 |
---|
391 | ENDIF |
---|
392 | IF( nproc >= (jpnj-1)*jpni ) THEN |
---|
393 | nbnw = 0 |
---|
394 | nbne = 0 |
---|
395 | ENDIF |
---|
396 | ENDIF |
---|
397 | npolj = 0 |
---|
398 | IF( jperio == 3 .OR. jperio == 4 ) THEN |
---|
399 | ijm1 = jpni*(jpnj-1) |
---|
400 | imil = ijm1+(jpni+1)/2 |
---|
401 | IF( narea > ijm1 ) npolj = 3 |
---|
402 | IF( MOD(jpni,2) == 1 .AND. narea == imil ) npolj = 4 |
---|
403 | IF( npolj == 3 ) nono = jpni*jpnj-narea+ijm1 |
---|
404 | ENDIF |
---|
405 | IF( jperio == 5 .OR. jperio == 6 ) THEN |
---|
406 | ijm1 = jpni*(jpnj-1) |
---|
407 | imil = ijm1+(jpni+1)/2 |
---|
408 | IF( narea > ijm1) npolj = 5 |
---|
409 | IF( MOD(jpni,2) == 1 .AND. narea == imil ) npolj = 6 |
---|
410 | IF( npolj == 5 ) nono = jpni*jpnj-narea+ijm1 |
---|
411 | ENDIF |
---|
412 | |
---|
413 | ! FETI method |
---|
414 | |
---|
415 | IF( nperio == 1 .AND. nsolv == 3 ) THEN |
---|
416 | |
---|
417 | ! general case : Earth == infinite tube |
---|
418 | |
---|
419 | nbnw = 1 |
---|
420 | npnw = narea |
---|
421 | nbne = 1 |
---|
422 | npne = narea |
---|
423 | nbsw = 1 |
---|
424 | npsw = (narea-2) |
---|
425 | nbse = 1 |
---|
426 | npse = (narea-2) |
---|
427 | |
---|
428 | ! REAL boundary condition |
---|
429 | |
---|
430 | IF( nbondj == -1 .OR. nbondj == 2 ) THEN |
---|
431 | nbsw = 0 |
---|
432 | nbse = 0 |
---|
433 | ENDIF |
---|
434 | |
---|
435 | IF( nbondj == -1 .OR. nbondj == 2 ) THEN |
---|
436 | nbsw = 0 |
---|
437 | nbse = 0 |
---|
438 | ENDIF |
---|
439 | |
---|
440 | IF( nbondj == 1 .OR. nbondj == 2 ) THEN |
---|
441 | nbnw = 0 |
---|
442 | nbne = 0 |
---|
443 | ENDIF |
---|
444 | ENDIF |
---|
445 | |
---|
446 | ! Periodicity : no corner if nbondi = 2 and nperio != 1 |
---|
447 | |
---|
448 | IF(lwp) THEN |
---|
449 | WRITE(numout,*) ' nproc = ', nproc |
---|
450 | WRITE(numout,*) ' nowe = ', nowe , ' noea = ', noea |
---|
451 | WRITE(numout,*) ' nono = ', nono , ' noso = ', noso |
---|
452 | WRITE(numout,*) ' nbondi = ', nbondi |
---|
453 | WRITE(numout,*) ' nbondj = ', nbondj |
---|
454 | WRITE(numout,*) ' npolj = ', npolj |
---|
455 | WRITE(numout,*) ' nperio = ', nperio |
---|
456 | WRITE(numout,*) ' nlci = ', nlci |
---|
457 | WRITE(numout,*) ' nlcj = ', nlcj |
---|
458 | WRITE(numout,*) ' nimpp = ', nimpp |
---|
459 | WRITE(numout,*) ' njmpp = ', njmpp |
---|
460 | WRITE(numout,*) ' nbse = ', nbse , ' npse = ', npse |
---|
461 | WRITE(numout,*) ' nbsw = ', nbsw , ' npsw = ', npsw |
---|
462 | WRITE(numout,*) ' nbne = ', nbne , ' npne = ', npne |
---|
463 | WRITE(numout,*) ' nbnw = ', nbnw , ' npnw = ', npnw |
---|
464 | ENDIF |
---|
465 | |
---|
466 | IF( nperio == 1 .AND. jpni /= 1 )THEN |
---|
467 | IF(lwp) WRITE(numout,cform_err) |
---|
468 | IF(lwp) WRITE(numout,*) ' mpp_init: error on cyclicity' |
---|
469 | nstop = nstop + 1 |
---|
470 | ENDIF |
---|
471 | |
---|
472 | ! Prepare mpp north fold |
---|
473 | |
---|
474 | IF (jperio >= 3 .AND. jperio <= 6 .AND. jpni > 1 ) THEN |
---|
475 | CALL mpp_ini_north |
---|
476 | END IF |
---|
477 | |
---|
478 | ! Prepare NetCDF output file (if necessary) |
---|
479 | CALL mpp_init_ioipsl |
---|
480 | |
---|
481 | END SUBROUTINE mpp_init |
---|
482 | |
---|
483 | # include "mppini_2.h90" |
---|
484 | |
---|
485 | # if defined key_dimgout |
---|
486 | !!---------------------------------------------------------------------- |
---|
487 | !! 'key_dimgout' NO use of NetCDF files |
---|
488 | !!---------------------------------------------------------------------- |
---|
489 | SUBROUTINE mpp_init_ioipsl ! Dummy routine |
---|
490 | END SUBROUTINE mpp_init_ioipsl |
---|
491 | # else |
---|
492 | SUBROUTINE mpp_init_ioipsl |
---|
493 | !!---------------------------------------------------------------------- |
---|
494 | !! *** ROUTINE mpp_init_ioipsl *** |
---|
495 | !! |
---|
496 | !! ** Purpose : |
---|
497 | !! |
---|
498 | !! ** Method : |
---|
499 | !! |
---|
500 | !! History : |
---|
501 | !! 9.0 ! 04-03 (G. Madec) MPP-IOIPSL |
---|
502 | !!---------------------------------------------------------------------- |
---|
503 | !! Local declarations |
---|
504 | |
---|
505 | INTEGER, DIMENSION(2) :: & |
---|
506 | iglo, iloc, iabsf, iabsl, ihals, ihale, idid |
---|
507 | INTEGER :: & |
---|
508 | inbondi, inbondj |
---|
509 | !!---------------------------------------------------------------------- |
---|
510 | |
---|
511 | ! The domain is splitted only horizontally along i- or/and j- direction |
---|
512 | ! So we need at the most only 1D arrays with 2 elements |
---|
513 | iglo(1) = jpiglo |
---|
514 | iglo(2) = jpjglo |
---|
515 | iloc(1) = nlci |
---|
516 | iloc(2) = nlcj |
---|
517 | iabsf(1) = nimppt(narea) |
---|
518 | iabsf(2) = njmppt(narea) |
---|
519 | iabsl(:) = iabsf(:) + iloc(:) - 1 |
---|
520 | ihals(1) = jpreci |
---|
521 | ihals(2) = jprecj |
---|
522 | ihale(1) = jpreci |
---|
523 | ihale(2) = jprecj |
---|
524 | idid(1) = 1 |
---|
525 | idid(2) = 2 |
---|
526 | |
---|
527 | inbondj = -1 ! general case |
---|
528 | IF( narea > jpni ) inbondj = 0 ! first row of processor |
---|
529 | IF( narea > (jpnj-1)*jpni ) inbondj = 1 ! last row of processor |
---|
530 | IF( jpnj == 1 ) inbondj = 2 ! one processor only in j-direction |
---|
531 | IF( inbondj == -1 .OR. inbondj == 2 ) ihals(2) = 0 |
---|
532 | IF( inbondj == 1 .OR. inbondj == 2 ) ihale(2) = 0 |
---|
533 | |
---|
534 | inbondi = 0 ! |
---|
535 | IF( MOD( narea, jpni ) == 1 ) inbondi = -1 ! |
---|
536 | IF( MOD( narea, jpni ) == 0 ) inbondi = 1 ! |
---|
537 | IF( jpni == 1 ) inbondi = 2 ! one processor only in i-direction |
---|
538 | IF( inbondi == -1 .OR. inbondi == 2 ) ihals(1) = 0 |
---|
539 | IF( inbondi == 1 .OR. inbondi == 2 ) ihale(1) = 0 |
---|
540 | |
---|
541 | |
---|
542 | IF(lwp) THEN |
---|
543 | WRITE(numout,*) 'mpp_init_ioipsl : iloc = ', iloc (1), iloc (2) |
---|
544 | WRITE(numout,*) '~~~~~~~~~~~~~~~ iabsf = ', iabsf(1), iabsf(2) |
---|
545 | WRITE(numout,*) ' ihals = ', ihals(1), ihals(2) |
---|
546 | WRITE(numout,*) ' ihale = ', ihale(1), ihale(2) |
---|
547 | ENDIF |
---|
548 | |
---|
549 | CALL flio_dom_set ( jpnij, nproc, idid, iglo, iloc, iabsf, iabsl, ihals, ihale, 'BOX', nidom) |
---|
550 | |
---|
551 | END SUBROUTINE mpp_init_ioipsl |
---|
552 | |
---|
553 | # endif |
---|
554 | #endif |
---|
555 | |
---|
556 | !!====================================================================== |
---|
557 | END MODULE mppini |
---|