/[MITgcm]/MITgcm/eesupp/src/ini_procs.F
ViewVC logotype

Contents of /MITgcm/eesupp/src/ini_procs.F

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.14 - (show annotations) (download)
Fri Sep 21 03:54:35 2001 UTC (22 years, 8 months ago) by cnh
Branch: MAIN
CVS Tags: checkpoint46n_post, checkpoint47e_post, checkpoint44e_post, checkpoint46l_post, checkpoint46g_pre, checkpoint47c_post, checkpoint46f_post, checkpoint48e_post, checkpoint44f_post, checkpoint46b_post, checkpoint43a-release1mods, checkpoint46l_pre, chkpt44d_post, release1_p8, release1_p9, release1_p1, release1_p2, release1_p3, release1_p4, release1_p5, release1_p6, release1_p7, checkpoint44e_pre, release1_b1, checkpoint48b_post, checkpoint43, checkpoint48c_pre, checkpoint47d_pre, release1_chkpt44d_post, checkpoint47a_post, checkpoint48d_pre, checkpoint47i_post, checkpoint47d_post, icebear5, icebear4, icebear3, icebear2, checkpoint46d_pre, checkpoint48d_post, release1-branch_tutorials, checkpoint45d_post, checkpoint46j_pre, chkpt44a_post, checkpoint44h_pre, checkpoint46a_post, checkpoint47g_post, checkpoint46j_post, checkpoint46k_post, chkpt44c_pre, checkpoint48a_post, checkpoint45a_post, ecco_c44_e19, ecco_c44_e18, ecco_c44_e17, ecco_c44_e16, release1_p10, checkpoint47j_post, branch-exfmods-tag, checkpoint44g_post, checkpoint46e_pre, checkpoint48c_post, checkpoint45b_post, checkpoint46b_pre, release1-branch-end, release1_final_v1, checkpoint46c_pre, checkpoint46, checkpoint47b_post, checkpoint44b_post, checkpoint46h_pre, checkpoint46m_post, checkpoint46a_pre, checkpoint45c_post, ecco_ice2, ecco_ice1, checkpoint44h_post, checkpoint46g_post, ecco_c44_e22, ecco_c44_e25, checkpoint47f_post, chkpt44a_pre, checkpoint46i_post, ecco_c44_e23, ecco_c44_e20, ecco_c44_e21, ecco_c44_e26, ecco_c44_e27, ecco_c44_e24, checkpoint46c_post, ecco-branch-mod1, ecco-branch-mod2, ecco-branch-mod3, ecco-branch-mod4, ecco-branch-mod5, checkpoint46e_post, release1_beta1, checkpoint44b_pre, checkpoint42, checkpoint41, checkpoint47, checkpoint44, checkpoint45, checkpoint48, checkpoint46h_post, chkpt44c_post, checkpoint47h_post, checkpoint44f_pre, checkpoint46d_post, release1-branch_branchpoint
Branch point for: c24_e25_ice, branch-exfmods-curt, release1_final, release1-branch, release1, ecco-branch, icebear, release1_coupled
Changes since 1.13: +41 -33 lines
Starting to bring comments up to date and format comments
for document extraction of "prototypes".

1 C $Header: /u/gcmpack/models/MITgcmUV/eesupp/src/ini_procs.F,v 1.13 2001/08/21 17:23:45 adcroft Exp $
2 C $Name: $
3 #include "CPP_EEOPTIONS.h"
4 CBOP
5
6 C !ROUTINE: INI_PROCS
7
8 C !INTERFACE:
9 SUBROUTINE INI_PROCS
10 IMPLICIT NONE
11
12 C !DESCRIPTION:
13 C *==========================================================*
14 C | SUBROUTINE INI_PROCS
15 C | o Initialise multiple concurrent processes environment.
16 C *==========================================================*
17 C | Under MPI this routine calls various MPI service routines
18 C | that map the model grid to MPI processes. The information
19 C | is then stored in a common block for later use.
20 C | Note: This routine can also be compiled with CPP
21 C | directives set so that no multi-processing is initialise.
22 C | This is OK and should work fine.
23 C *==========================================================*
24
25 C !USES:
26 C === Global data ===
27 #include "SIZE.h"
28 #include "EEPARAMS.h"
29 #include "EESUPPORT.h"
30
31 C !LOCAL VARIABLES:
32 C === Local variables ===
33 #ifdef ALLOW_USE_MPI
34 C msgBuffer :: IO buffer
35 C myThid :: Dummy thread id
36 C mpiRC :: Error code reporting variable used
37 C with MPI.
38 C mpiGridSpec :: No. of processes in X and Y.
39 C mpiPeriodicity :: Flag indicating XY priodicity to MPI.
40 C arrElSize :: Size of an array element in bytes used
41 C to define MPI datatypes for communication
42 C operations.
43 C arrElSep :: Separation in units of array elements between
44 C blocks to be communicated.
45 C elCount :: No. of blocks that are associated with MPI
46 C datatype.
47 C elLen :: Length of an MPI datatype in terms of preexisting
48 C datatype.
49 C elStride :: Distance between starting location of elements
50 C in an MPI datatype - can be bytes of datatype
51 C units.
52 CHARACTER*(MAX_LEN_MBUF) msgBuffer
53 INTEGER mpiRC
54 INTEGER mpiGridSpec(2)
55 INTEGER mpiPeriodicity(2)
56 INTEGER mpiLProcNam
57 CHARACTER*(MPI_MAX_PROCESSOR_NAME) mpiProcNam
58 INTEGER arrElSize
59 INTEGER arrElSep
60 INTEGER elCount
61 INTEGER elLen
62 INTEGER elStride
63 #endif /* ALLOW_USE_MPI */
64 INTEGER myThid
65 CEOP
66
67 C-- Default values set to single processor case
68 C pid[W-SE] are the MPI process id of the neighbor
69 C processes. A process can be its own neighbor!
70 myThid = 1
71 myPid = 1
72 nProcs = 1
73 myPx = 1
74 myPy = 1
75 myXGlobalLo = 1
76 myYGlobalLo = 1
77 pidW = 1
78 pidE = 1
79 pidN = 1
80 pidS = 1
81 errorMessageUnit = 0
82 standardMessageUnit = 6
83
84 #ifdef ALLOW_USE_MPI
85 C--
86 C-- MPI style full multiple-process initialisation
87 C-- ==============================================
88 #ifndef ALWAYS_USE_MPI
89 IF ( usingMPI ) THEN
90 #endif
91
92 C-- Arrange MPI processes on a cartesian grid
93 C Set variable indicating which MPI process is to the north,
94 C south, east, west, south-west, south-east, north-west
95 C and north-east of me e.g.
96 C
97 C Plan view of model domain centered on process ME
98 C ================================================
99 C
100 C : : : :
101 C : : : :
102 C : : : :
103 C .....------------------------------.....
104 C | | | |
105 C | NW | N | NE |
106 C | | | |
107 C .....------------------------------.....
108 C | | | |
109 C | W | ME | E |
110 C | | | |
111 C .....------------------------------.....
112 C | | | |
113 C | SW | S | SE |
114 C | | | |
115 C .....------------------------------.....
116 C : : : :
117 C Y : : : :
118 C / \ : : : :
119 C |
120 C |
121 C |----> X
122 C
123 C-- Set default MPI communicator to XY processor grid
124 myThid = 1
125 mpiGridSpec(1) = nPx
126 mpiGridSpec(2) = nPy
127 C Could be periodic in X and/or Y - set at run time or compile time!
128 mpiPeriodicity(1) = _mpiTRUE_
129 mpiPeriodicity(2) = _mpiTRUE_
130 #ifdef CAN_PREVENT_X_PERIODICITY
131 #ifndef ALWAYS_PREVENT_X_PERIODICITY
132 IF ( notUsingXPeriodicity ) THEN
133 #endif
134 mpiPeriodicity(1) = _mpiFALSE_
135 #ifndef ALWAYS_PREVENT_X_PERIODICITY
136 ENDIF
137 #endif
138 #endif /* CAN_PREVENT_X_PERIODICITY */
139 #ifdef CAN_PREVENT_Y_PERIODICITY
140 #ifndef ALWAYS_PREVENT_Y_PERIODICITY
141 IF ( notUsingYPeriodicity ) THEN
142 #endif
143 mpiPeriodicity(2) = _mpiFALSE_
144 #ifndef ALWAYS_PREVENT_Y_PERIODICITY
145 ENDIF
146 #endif
147 #endif /* CAN_PREVENT_Y_PERIODICITY */
148
149 CALL MPI_CART_CREATE(
150 I MPI_COMM_MODEL,2,mpiGridSpec,mpiPeriodicity,_mpiTRUE_,
151 O mpiComm, mpiRC )
152 IF ( mpiRC .NE. MPI_SUCCESS ) THEN
153 eeBootError = .TRUE.
154 WRITE(msgBuffer,'(A,I5)')
155 & 'S/R INI_PROCS: MPI_CART_CREATE return code',
156 & mpiRC
157 CALL PRINT_ERROR( msgBuffer , myThid)
158 GOTO 999
159 ENDIF
160
161 C-- Get my location on the grid
162 CALL MPI_CART_COORDS( mpiComm, mpiMyId, 2, mpiGridSpec, mpiRC )
163 IF ( mpiRC .NE. MPI_SUCCESS ) THEN
164 eeBootError = .TRUE.
165 WRITE(msgBuffer,'(A,I5)')
166 & 'S/R INI_PROCS: MPI_CART_COORDS return code',
167 & mpiRC
168 CALL PRINT_ERROR( msgBuffer , myThid)
169 GOTO 999
170 ENDIF
171 myPid = mpiMyId
172 mpiPx = mpiGridSpec(1)
173 mpiPy = mpiGridSpec(2)
174 mpiXGlobalLo = 1 + sNx*nSx*(mpiPx)
175 mpiYGlobalLo = 1 + sNy*nSy*(mpiPy)
176 myXGlobalLo = mpiXGlobalLo
177 myYGlobalLo = mpiYGlobalLo
178 myPx = mpiPx+1
179 myPy = mpiPy+1
180 C-- Get MPI id for neighboring procs.
181 mpiGridSpec(1) = mpiPx-1
182 IF ( mpiPeriodicity(1) .EQ. _mpiTRUE_
183 & .AND. mpiGridSpec(1) .LT. 0 )
184 & mpiGridSpec(1) = nPx-1
185 mpiGridSpec(2) = mpiPy
186 CALL MPI_CART_RANK( mpiComm, mpiGridSpec, mpiPidW , mpiRC )
187 IF ( mpiRC .NE. MPI_SUCCESS ) THEN
188 eeBootError = .TRUE.
189 WRITE(msgBuffer,'(A,I5)')
190 & 'S/R INI_PROCS: MPI_CART_RANK (pidW) return code',
191 & mpiRC
192 CALL PRINT_ERROR( msgBuffer , myThid)
193 GOTO 999
194 ENDIF
195 pidW = mpiPidW
196 mpiGridSpec(1) = mpiPx+1
197 IF ( mpiPeriodicity(1) .EQ. _mpiTRUE_
198 & .AND. mpiGridSpec(1) .GT. nPx-1 )
199 & mpiGridSpec(1) = 0
200 mpiGridSpec(2) = mpiPy
201 CALL MPI_CART_RANK( mpiComm, mpiGridSpec, mpiPidE , mpiRC )
202 IF ( mpiRC .NE. MPI_SUCCESS ) THEN
203 eeBootError = .TRUE.
204 WRITE(msgBuffer,'(A,I5)')
205 & 'S/R INI_PROCS: MPI_CART_RANK (pidE) return code',
206 & mpiRC
207 CALL PRINT_ERROR( msgBuffer , myThid)
208 GOTO 999
209 ENDIF
210 pidE = mpiPidE
211 mpiGridSpec(1) = mpiPx
212 mpiGridSpec(2) = mpiPy-1
213 IF ( mpiPeriodicity(2) .EQ. _mpiTRUE_
214 & .AND. mpiGridSpec(2) .LT. 0 )
215 & mpiGridSpec(2) = nPy - 1
216 CALL MPI_CART_RANK( mpiComm, mpiGridSpec, mpiPidS , mpiRC )
217 IF ( mpiRC .NE. MPI_SUCCESS ) THEN
218 eeBootError = .TRUE.
219 WRITE(msgBuffer,'(A,I5)')
220 & 'S/R INI_PROCS: MPI_CART_RANK (pidS) return code',
221 & mpiRC
222 CALL PRINT_ERROR( msgBuffer , myThid)
223 GOTO 999
224 ENDIF
225 pidS = mpiPidS
226 mpiGridSpec(1) = mpiPx
227 mpiGridSpec(2) = mpiPy+1
228 IF ( mpiPeriodicity(2) .EQ. _mpiTRUE_
229 & .AND. mpiGridSpec(2) .GT. nPy-1 )
230 & mpiGridSpec(2) = 0
231 CALL MPI_CART_RANK( mpiComm, mpiGridSpec, mpiPidN , mpiRC )
232 IF ( mpiRC .NE. MPI_SUCCESS ) THEN
233 eeBootError = .TRUE.
234 WRITE(msgBuffer,'(A,I5)')
235 & 'S/R INI_PROCS: MPI_CART_RANK (pidN) return code',
236 & mpiRC
237 CALL PRINT_ERROR( msgBuffer , myThid)
238 GOTO 999
239 ENDIF
240 pidN = mpiPidN
241
242 C-- Print summary of processor mapping on standard output
243 CALL MPI_GET_PROCESSOR_NAME( mpiProcNam, mpilProcNam, mpiRC )
244 IF ( mpiRC .NE. MPI_SUCCESS ) THEN
245 eeBootError = .TRUE.
246 WRITE(msgBuffer,'(A,I5)')
247 & 'S/R INI_PROCS: MPI_GET_PROCESSOR_NAME return code',
248 & mpiRC
249 CALL PRINT_ERROR( msgBuffer , myThid)
250 GOTO 999
251 ENDIF
252 WRITE(msgBuffer,'(A)')
253 & '======= Starting MPI parallel Run ========='
254 CALL PRINT_MESSAGE( msgBuffer, standardMessageUnit,
255 & SQUEEZE_BOTH , myThid)
256 WRITE(msgBuffer,'(A,A64)') ' My Processor Name = ',
257 & mpiProcNam(1:mpilProcNam)
258 CALL PRINT_MESSAGE( msgBuffer, standardMessageUnit,
259 & SQUEEZE_RIGHT , myThid)
260 WRITE(msgBuffer,'(A,I3,A,I3,A,I3,A,I3,A)') ' Located at (',
261 & mpiPx,',',mpiPy,
262 & ') on processor grid (0:',nPx-1,',0:',nPy-1,')'
263 CALL PRINT_MESSAGE( msgBuffer, standardMessageUnit,
264 & SQUEEZE_RIGHT , myThid)
265 WRITE(msgBuffer,'(A,I4,A,I4,A,I4,A,I4,A)') ' Origin at (',
266 & mpiXGlobalLo,',',mpiYGLobalLo,
267 & ') on global grid (1:',nPx*sNx*nSx,',1:',nPy*sNy*nSy,')'
268 CALL PRINT_MESSAGE( msgBuffer, standardMessageUnit,
269 & SQUEEZE_RIGHT , myThid)
270 WRITE(msgBuffer,'(A,I4.4)')
271 & ' North neighbor = processor ', mpiPidN
272 CALL PRINT_MESSAGE( msgBuffer, standardMessageUnit,
273 & SQUEEZE_RIGHT , myThid)
274 WRITE(msgBuffer,'(A,I4.4)')
275 & ' South neighbor = processor ', mpiPidS
276 CALL PRINT_MESSAGE( msgBuffer, standardMessageUnit,
277 & SQUEEZE_RIGHT , myThid)
278 WRITE(msgBuffer,'(A,I4.4)')
279 & ' East neighbor = processor ', mpiPidE
280 CALL PRINT_MESSAGE( msgBuffer, standardMessageUnit,
281 & SQUEEZE_RIGHT , myThid)
282 WRITE(msgBuffer,'(A,I4.4)')
283 & ' West neighbor = processor ', mpiPidW
284 CALL PRINT_MESSAGE( msgBuffer, standardMessageUnit,
285 & SQUEEZE_RIGHT , myThid)
286 C
287 C-- Create MPI types for transfer of array edges.
288 C-- Four and eight byte primitive (one block only) datatypes.
289 C-- These are common to all threads in the process.
290 C Notes:
291 C ======
292 C 1. The datatypes MPI_REAL4 and MPI_REAL8 are usually predefined.
293 C If they are not defined code must be added to create them -
294 C the MPI standard leaves optional whether they exist.
295 C 2. Per thread datatypes that handle all the edges for a thread
296 C are defined based on the type defined here.
297 C--
298 C-- xFace datatypes (east<-->west messages)
299 C--
300 C xFace (y=constant) for XY arrays with real*4 declaration.
301 arrElSep = (sNx+OLx*2)
302 elCount = sNy+OLy*2
303 elLen = OLx
304 elStride = arrElSep
305 #ifdef TARGET_SGI
306 CALL MPI_TYPE_VECTOR(elCount,elLen,elStride,MPI_REAL,
307 & mpiTypeXFaceBlock_xy_r4, mpiRC)
308 #else
309 CALL MPI_TYPE_VECTOR(elCount,elLen,elStride,MPI_REAL4,
310 & mpiTypeXFaceBlock_xy_r4, mpiRC)
311 #endif
312 IF ( mpiRC .NE. MPI_SUCCESS ) THEN
313 eeBootError = .TRUE.
314 WRITE(msgBuffer,'(A,I5)')
315 & 'S/R INI_PROCS: MPI_TYPE_VECTOR (mpiTypeXFaceBlock_xy_r4)',
316 & mpiRC
317 CALL PRINT_ERROR( msgBuffer , myThid)
318 ENDIF
319 CALL MPI_TYPE_COMMIT( mpiTypeXFaceBlock_xy_r4, mpiRC)
320 IF ( mpiRC .NE. MPI_SUCCESS ) THEN
321 eeBootError = .TRUE.
322 WRITE(msgBuffer,'(A,I5)')
323 & 'S/R INI_PROCS: MPI_TYPE_COMMIT (mpiTypeXFaceBlock_xy_r4)',
324 & mpiRC
325 CALL PRINT_ERROR( msgBuffer , myThid)
326 ENDIF
327
328 C xFace (y=constant) for XY arrays with real*8 declaration.
329 #ifdef TARGET_SGI
330 CALL MPI_TYPE_VECTOR(elCount,elLen,elStride,MPI_DOUBLE_PRECISION,
331 & mpiTypeXFaceBlock_xy_r8, mpiRC)
332 #else
333 CALL MPI_TYPE_VECTOR(elCount,elLen,elStride,MPI_REAL8,
334 & mpiTypeXFaceBlock_xy_r8, mpiRC)
335 #endif
336 IF ( mpiRC .NE. MPI_SUCCESS ) THEN
337 eeBootError = .TRUE.
338 WRITE(msgBuffer,'(A,I5)')
339 & 'S/R INI_PROCS: MPI_TYPE_VECTOR (mpiTypeXFaceBlock_xy_r8)',
340 & mpiRC
341 CALL PRINT_ERROR( msgBuffer , myThid)
342 ENDIF
343 CALL MPI_TYPE_COMMIT( mpiTypeXFaceBlock_xy_r8, mpiRC)
344 IF ( mpiRC .NE. MPI_SUCCESS ) THEN
345 eeBootError = .TRUE.
346 WRITE(msgBuffer,'(A,I5)')
347 & 'S/R INI_PROCS: MPI_TYPE_COMMIT (mpiTypeXFaceBlock_xy_r8)',
348 & mpiRC
349 CALL PRINT_ERROR( msgBuffer , myThid)
350 ENDIF
351
352 C xFace (y=constant) for XYZ arrays with real*4 declaration.
353 arrElSize = 4
354 arrElSep = (sNx+OLx*2)*(sNy+OLy*2)
355 elCount = Nr
356 elLen = 1
357 elStride = arrElSize*arrElSep
358 CALL MPI_TYPE_HVECTOR(elCount,elLen,elStride,
359 & mpiTypeXFaceBlock_xy_r4,
360 & mpiTypeXFaceBlock_xyz_r4, mpiRC)
361 IF ( mpiRC .NE. MPI_SUCCESS ) THEN
362 eeBootError = .TRUE.
363 WRITE(msgBuffer,'(A,I5)')
364 & 'S/R INI_PROCS: MPI_TYPE_HVECTOR (mpiTypeXFaceBlock_xyz_r4)',
365 & mpiRC
366 CALL PRINT_ERROR( msgBuffer , myThid)
367 ENDIF
368 CALL MPI_TYPE_COMMIT( mpiTypeXFaceBlock_xyz_r4, mpiRC)
369 IF ( mpiRC .NE. MPI_SUCCESS ) THEN
370 eeBootError = .TRUE.
371 WRITE(msgBuffer,'(A,I5)')
372 & 'S/R INI_PROCS: MPI_TYPE_COMMIT (mpiTypeXFaceBlock_xyz_r4)',
373 & mpiRC
374 CALL PRINT_ERROR( msgBuffer , myThid)
375 ENDIF
376
377 C xFace (y=constant) for XYZ arrays with real*8 declaration.
378 arrElSize = 8
379 elStride = arrElSize*arrElSep
380 CALL MPI_TYPE_HVECTOR(elCount,elLen,elStride,
381 & mpiTypeXFaceBlock_xy_r8,
382 & mpiTypeXFaceBlock_xyz_r8, mpiRC)
383 IF ( mpiRC .NE. MPI_SUCCESS ) THEN
384 eeBootError = .TRUE.
385 WRITE(msgBuffer,'(A,I5)')
386 & 'S/R INI_PROCS: MPI_TYPE_HVECTOR (mpiTypeXFaceBlock_xyz_r8)',
387 & mpiRC
388 CALL PRINT_ERROR( msgBuffer , myThid)
389 ENDIF
390 CALL MPI_TYPE_COMMIT( mpiTypeXFaceBlock_xyz_r8, mpiRC)
391 IF ( mpiRC .NE. MPI_SUCCESS ) THEN
392 eeBootError = .TRUE.
393 WRITE(msgBuffer,'(A,I5)')
394 & 'S/R INI_PROCS: MPI_TYPE_COMMIT (mpiTypeXFaceBlock_xyz_r8)',
395 & mpiRC
396 CALL PRINT_ERROR( msgBuffer , myThid)
397 ENDIF
398 C--
399 C-- yFace datatypes (north<-->south messages)
400 C--
401 C yFace (x=constant) for XY arrays with real*4 declaration
402 elCount = OLy*(sNx+OLx*2)
403 #ifdef TARGET_SGI
404 CALL MPI_TYPE_CONTIGUOUS(elCount,MPI_REAL,
405 & mpiTypeYFaceBlock_xy_r4, mpiRC)
406 #else
407 CALL MPI_TYPE_CONTIGUOUS(elCount,MPI_REAL4,
408 & mpiTypeYFaceBlock_xy_r4, mpiRC)
409 #endif
410 IF ( mpiRC .NE. MPI_SUCCESS ) THEN
411 eeBootError = .TRUE.
412 WRITE(msgBuffer,'(A,I5)')
413 & 'S/R INI_PROCS: MPI_TYPE_CONTIGUOUS (mpiTypeYFaceBlock_xy_r4)',
414 & mpiRC
415 CALL PRINT_ERROR( msgBuffer , myThid)
416 ENDIF
417 CALL MPI_TYPE_COMMIT( mpiTypeYFaceBlock_xy_r4, mpiRC)
418 IF ( mpiRC .NE. MPI_SUCCESS ) THEN
419 eeBootError = .TRUE.
420 WRITE(msgBuffer,'(A,I5)')
421 & 'S/R INI_PROCS: MPI_TYPE_COMMIT (mpiTypeYFaceBlock_xy_r4)',
422 & mpiRC
423 CALL PRINT_ERROR( msgBuffer , myThid)
424 ENDIF
425 C yFace (x=constant) for XY arrays with real*8 declaration
426 #ifdef TARGET_SGI
427 CALL MPI_TYPE_CONTIGUOUS(elCount,MPI_DOUBLE_PRECISION,
428 & mpiTypeYFaceBlock_xy_r8, mpiRC)
429 #else
430 CALL MPI_TYPE_CONTIGUOUS(elCount,MPI_REAL8,
431 & mpiTypeYFaceBlock_xy_r8, mpiRC)
432 #endif
433 IF ( mpiRC .NE. MPI_SUCCESS ) THEN
434 eeBootError = .TRUE.
435 WRITE(msgBuffer,'(A,I5)')
436 & 'S/R INI_PROCS: MPI_TYPE_CONTIGUOUS (mpiTypeYFaceBlock_xy_r8)',
437 & mpiRC
438 CALL PRINT_ERROR( msgBuffer , myThid)
439 ENDIF
440 CALL MPI_TYPE_COMMIT( mpiTypeYFaceBlock_xy_r8, mpiRC)
441 IF ( mpiRC .NE. MPI_SUCCESS ) THEN
442 eeBootError = .TRUE.
443 WRITE(msgBuffer,'(A,I5)')
444 & 'S/R INI_PROCS: MPI_TYPE_COMMIT (mpiTypeYFaceBlock_xy_r8)',
445 & mpiRC
446 CALL PRINT_ERROR( msgBuffer , myThid)
447 ENDIF
448 C yFace (x=constant) for XYZ arrays with real*4 declaration
449 arrElSize = 4
450 arrElSep = (sNx+OLx*2)*(sNy+OLy*2)
451 elCount = Nr
452 elLen = 1
453 elStride = arrElSize*arrElSep
454 CALL MPI_TYPE_HVECTOR(elCount,elLen,elStride,
455 & mpiTypeYFaceBlock_xy_r4,
456 & mpiTypeYFaceBlock_xyz_r4, mpiRC)
457 IF ( mpiRC .NE. MPI_SUCCESS ) THEN
458 eeBootError = .TRUE.
459 WRITE(msgBuffer,'(A,I5)')
460 & 'S/R INI_PROCS: MPI_TYPE_HVECTOR (mpiTypeYFaceBlock_xyz_r4)',
461 & mpiRC
462 CALL PRINT_ERROR( msgBuffer , myThid)
463 ENDIF
464 CALL MPI_TYPE_COMMIT( mpiTypeYFaceBlock_xyz_r4, mpiRC)
465 IF ( mpiRC .NE. MPI_SUCCESS ) THEN
466 eeBootError = .TRUE.
467 WRITE(msgBuffer,'(A,I5)')
468 & 'S/R INI_PROCS: MPI_TYPE_COMMIT (mpiTypeYFaceBlock_xyz_r4)',
469 & mpiRC
470 CALL PRINT_ERROR( msgBuffer , myThid)
471 ENDIF
472 C yFace (x=constant) for XYZ arrays with real*8 declaration
473 arrElSize = 8
474 elStride = arrElSize*arrElSep
475 CALL MPI_TYPE_HVECTOR(elCount,elLen,elStride,
476 & mpiTypeYFaceBlock_xy_r8,
477 & mpiTypeYFaceBlock_xyz_r8, mpiRC)
478 IF ( mpiRC .NE. MPI_SUCCESS ) THEN
479 eeBootError = .TRUE.
480 WRITE(msgBuffer,'(A,I5)')
481 & 'S/R INI_PROCS: MPI_TYPE_HVECTOR (mpiTypeYFaceBlock_xyz_r8)',
482 & mpiRC
483 CALL PRINT_ERROR( msgBuffer , myThid)
484 ENDIF
485 CALL MPI_TYPE_COMMIT( mpiTypeYFaceBlock_xyz_r8, mpiRC)
486 IF ( mpiRC .NE. MPI_SUCCESS ) THEN
487 eeBootError = .TRUE.
488 WRITE(msgBuffer,'(A,I5)')
489 & 'S/R INI_PROCS: MPI_TYPE_COMMIT (mpiTypeYFaceBlock_xyz_r8)',
490 & mpiRC
491 CALL PRINT_ERROR( msgBuffer , myThid)
492 ENDIF
493
494 C-- Assign MPI values used in generating unique tags for messages.
495 mpiTagW = 1
496 mpiTagE = 2
497 mpiTagS = 3
498 mpiTagN = 4
499
500 C
501 CALL MPI_Barrier(MPI_COMM_MODEL,mpiRC)
502
503
504 C
505 #ifndef ALWAYS_USE_MPI
506 ENDIF
507 #endif
508 #endif /* ALLOW_USE_MPI */
509
510 999 CONTINUE
511
512 RETURN
513 END
514
515 C $Id: ini_procs.F,v 1.13 2001/08/21 17:23:45 adcroft Exp $

  ViewVC Help
Powered by ViewVC 1.1.22