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

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

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

revision 1.7 by cnh, Wed Oct 28 03:11:35 1998 UTC revision 1.9 by adcroft, Mon May 3 21:37:55 1999 UTC
# Line 136  C      Could be periodic in X and/or Y - Line 136  C      Could be periodic in X and/or Y -
136  #endif /* CAN_PREVENT_Y_PERIODICITY */  #endif /* CAN_PREVENT_Y_PERIODICITY */
137    
138         CALL MPI_CART_CREATE(         CALL MPI_CART_CREATE(
139       I  MPI_COMM_WORLD,2,mpiGridSpec,mpiPeriodicity,_mpiTRUE_,       I  MPI_COMM_MODEL,2,mpiGridSpec,mpiPeriodicity,_mpiTRUE_,
140       O  mpiComm, mpiRC )       O  mpiComm, mpiRC )
141         IF ( mpiRC .NE. MPI_SUCCESS ) THEN         IF ( mpiRC .NE. MPI_SUCCESS ) THEN
142          eeBootError = .TRUE.          eeBootError = .TRUE.
# Line 168  C--    Get my location on the grid Line 168  C--    Get my location on the grid
168         myPy = mpiPy+1         myPy = mpiPy+1
169  C--    Get MPI id for neighboring procs.  C--    Get MPI id for neighboring procs.
170         mpiGridSpec(1) = mpiPx-1         mpiGridSpec(1) = mpiPx-1
171         IF ( mpiPeriodicity(1) .EQ. _mpiTRUE_ .AND. mpiGridSpec(1) .LT. 0 )         IF ( mpiPeriodicity(1) .EQ. _mpiTRUE_
172         &   .AND. mpiGridSpec(1) .LT. 0 )
173       &  mpiGridSpec(1) = nPx-1       &  mpiGridSpec(1) = nPx-1
174         mpiGridSpec(2) = mpiPy         mpiGridSpec(2) = mpiPy
175         CALL MPI_CART_RANK( mpiComm, mpiGridSpec, mpiPidW , mpiRC )         CALL MPI_CART_RANK( mpiComm, mpiGridSpec, mpiPidW , mpiRC )
# Line 182  C--    Get MPI id for neighboring procs. Line 183  C--    Get MPI id for neighboring procs.
183         ENDIF         ENDIF
184         pidW = mpiPidW         pidW = mpiPidW
185         mpiGridSpec(1) = mpiPx+1         mpiGridSpec(1) = mpiPx+1
186         IF ( mpiPeriodicity(1) .EQ. _mpiTRUE_ .AND. mpiGridSpec(1) .GT. nPx-1 )         IF ( mpiPeriodicity(1) .EQ. _mpiTRUE_
187         &   .AND. mpiGridSpec(1) .GT. nPx-1 )
188       &  mpiGridSpec(1) = 0       &  mpiGridSpec(1) = 0
189         mpiGridSpec(2) = mpiPy         mpiGridSpec(2) = mpiPy
190         CALL MPI_CART_RANK( mpiComm, mpiGridSpec, mpiPidE , mpiRC )         CALL MPI_CART_RANK( mpiComm, mpiGridSpec, mpiPidE , mpiRC )
# Line 197  C--    Get MPI id for neighboring procs. Line 199  C--    Get MPI id for neighboring procs.
199         pidE = mpiPidE         pidE = mpiPidE
200         mpiGridSpec(1) = mpiPx         mpiGridSpec(1) = mpiPx
201         mpiGridSpec(2) = mpiPy-1         mpiGridSpec(2) = mpiPy-1
202         IF ( mpiPeriodicity(2) .EQ. _mpiTRUE_ .AND. mpiGridSpec(2) .LT. 0 )         IF ( mpiPeriodicity(2) .EQ. _mpiTRUE_
203         &   .AND. mpiGridSpec(2) .LT. 0 )
204       &  mpiGridSpec(2) = nPy - 1       &  mpiGridSpec(2) = nPy - 1
205         CALL MPI_CART_RANK( mpiComm, mpiGridSpec, mpiPidS , mpiRC )         CALL MPI_CART_RANK( mpiComm, mpiGridSpec, mpiPidS , mpiRC )
206         IF ( mpiRC .NE. MPI_SUCCESS ) THEN         IF ( mpiRC .NE. MPI_SUCCESS ) THEN
# Line 211  C--    Get MPI id for neighboring procs. Line 214  C--    Get MPI id for neighboring procs.
214         pidS = mpiPidS         pidS = mpiPidS
215         mpiGridSpec(1) = mpiPx         mpiGridSpec(1) = mpiPx
216         mpiGridSpec(2) = mpiPy+1         mpiGridSpec(2) = mpiPy+1
217         IF ( mpiPeriodicity(2) .EQ. _mpiTRUE_ .AND. mpiGridSpec(2) .GT. nPy-1 )         IF ( mpiPeriodicity(2) .EQ. _mpiTRUE_
218         &   .AND. mpiGridSpec(2) .GT. nPy-1 )
219       &  mpiGridSpec(2) = 0       &  mpiGridSpec(2) = 0
220         CALL MPI_CART_RANK( mpiComm, mpiGridSpec, mpiPidN , mpiRC )         CALL MPI_CART_RANK( mpiComm, mpiGridSpec, mpiPidN , mpiRC )
221         IF ( mpiRC .NE. MPI_SUCCESS ) THEN         IF ( mpiRC .NE. MPI_SUCCESS ) THEN
# Line 234  C--    Print summary of processor mappin Line 238  C--    Print summary of processor mappin
238          CALL PRINT_ERROR( msgBuffer , myThid)          CALL PRINT_ERROR( msgBuffer , myThid)
239          GOTO 999          GOTO 999
240         ENDIF         ENDIF
241         WRITE(msgBuffer,'(A)') '======= Starting MPI parallel Run ========='         WRITE(msgBuffer,'(A)')
242         &   '======= Starting MPI parallel Run ========='
243         CALL PRINT_MESSAGE( msgBuffer, standardMessageUnit,         CALL PRINT_MESSAGE( msgBuffer, standardMessageUnit,
244       &  SQUEEZE_BOTH , myThid)       &  SQUEEZE_BOTH , myThid)
245         WRITE(msgBuffer,'(A,A64)') ' My Processor Name = ',         WRITE(msgBuffer,'(A,A64)') ' My Processor Name = ',
# Line 251  C--    Print summary of processor mappin Line 256  C--    Print summary of processor mappin
256       &  ') on global grid (1:',nPx*sNx*nSx,',1:',nPy*sNy*nSy,')'       &  ') on global grid (1:',nPx*sNx*nSx,',1:',nPy*sNy*nSy,')'
257         CALL PRINT_MESSAGE( msgBuffer, standardMessageUnit,         CALL PRINT_MESSAGE( msgBuffer, standardMessageUnit,
258       &  SQUEEZE_RIGHT , myThid)       &  SQUEEZE_RIGHT , myThid)
259         WRITE(msgBuffer,'(A,I4.4)') ' North neighbor = processor ', mpiPidN         WRITE(msgBuffer,'(A,I4.4)')
260         &   ' North neighbor = processor ', mpiPidN
261         CALL PRINT_MESSAGE( msgBuffer, standardMessageUnit,         CALL PRINT_MESSAGE( msgBuffer, standardMessageUnit,
262       &  SQUEEZE_RIGHT , myThid)       &  SQUEEZE_RIGHT , myThid)
263         WRITE(msgBuffer,'(A,I4.4)') ' South neighbor = processor ', mpiPidS         WRITE(msgBuffer,'(A,I4.4)')
264         &   ' South neighbor = processor ', mpiPidS
265         CALL PRINT_MESSAGE( msgBuffer, standardMessageUnit,         CALL PRINT_MESSAGE( msgBuffer, standardMessageUnit,
266       &  SQUEEZE_RIGHT , myThid)       &  SQUEEZE_RIGHT , myThid)
267         WRITE(msgBuffer,'(A,I4.4)') '  East neighbor = processor ', mpiPidE         WRITE(msgBuffer,'(A,I4.4)')
268         &   '  East neighbor = processor ', mpiPidE
269         CALL PRINT_MESSAGE( msgBuffer, standardMessageUnit,         CALL PRINT_MESSAGE( msgBuffer, standardMessageUnit,
270       &  SQUEEZE_RIGHT , myThid)       &  SQUEEZE_RIGHT , myThid)
271         WRITE(msgBuffer,'(A,I4.4)') '  West neighbor = processor ', mpiPidW         WRITE(msgBuffer,'(A,I4.4)')
272         &   '  West neighbor = processor ', mpiPidW
273         CALL PRINT_MESSAGE( msgBuffer, standardMessageUnit,         CALL PRINT_MESSAGE( msgBuffer, standardMessageUnit,
274       &  SQUEEZE_RIGHT , myThid)       &  SQUEEZE_RIGHT , myThid)
275  C  C
# Line 287  C      xFace (y=constant) for XY arrays Line 296  C      xFace (y=constant) for XY arrays
296         IF ( mpiRC .NE. MPI_SUCCESS ) THEN         IF ( mpiRC .NE. MPI_SUCCESS ) THEN
297          eeBootError = .TRUE.          eeBootError = .TRUE.
298          WRITE(msgBuffer,'(A,I)')          WRITE(msgBuffer,'(A,I)')
299       &        'S/R INI_PROCS: MPI_TYPE_VECTOR (mpiTypeXFaceBlock_xy_r4)',       &   'S/R INI_PROCS: MPI_TYPE_VECTOR (mpiTypeXFaceBlock_xy_r4)',
300       &        mpiRC       &        mpiRC
301          CALL PRINT_ERROR( msgBuffer , myThid)          CALL PRINT_ERROR( msgBuffer , myThid)
302         ENDIF         ENDIF
# Line 295  C      xFace (y=constant) for XY arrays Line 304  C      xFace (y=constant) for XY arrays
304         IF ( mpiRC .NE. MPI_SUCCESS ) THEN         IF ( mpiRC .NE. MPI_SUCCESS ) THEN
305          eeBootError = .TRUE.          eeBootError = .TRUE.
306          WRITE(msgBuffer,'(A,I)')          WRITE(msgBuffer,'(A,I)')
307       &        'S/R INI_PROCS: MPI_TYPE_COMMIT (mpiTypeXFaceBlock_xy_r4)',       &   'S/R INI_PROCS: MPI_TYPE_COMMIT (mpiTypeXFaceBlock_xy_r4)',
308       &        mpiRC       &        mpiRC
309          CALL PRINT_ERROR( msgBuffer , myThid)          CALL PRINT_ERROR( msgBuffer , myThid)
310         ENDIF         ENDIF
# Line 306  C      xFace (y=constant) for XY arrays Line 315  C      xFace (y=constant) for XY arrays
315         IF ( mpiRC .NE. MPI_SUCCESS ) THEN         IF ( mpiRC .NE. MPI_SUCCESS ) THEN
316          eeBootError = .TRUE.          eeBootError = .TRUE.
317          WRITE(msgBuffer,'(A,I)')          WRITE(msgBuffer,'(A,I)')
318       &        'S/R INI_PROCS: MPI_TYPE_VECTOR (mpiTypeXFaceBlock_xy_r8)',       &   'S/R INI_PROCS: MPI_TYPE_VECTOR (mpiTypeXFaceBlock_xy_r8)',
319       &        mpiRC       &        mpiRC
320          CALL PRINT_ERROR( msgBuffer , myThid)          CALL PRINT_ERROR( msgBuffer , myThid)
321         ENDIF         ENDIF
# Line 314  C      xFace (y=constant) for XY arrays Line 323  C      xFace (y=constant) for XY arrays
323         IF ( mpiRC .NE. MPI_SUCCESS ) THEN         IF ( mpiRC .NE. MPI_SUCCESS ) THEN
324          eeBootError = .TRUE.          eeBootError = .TRUE.
325          WRITE(msgBuffer,'(A,I)')          WRITE(msgBuffer,'(A,I)')
326       &        'S/R INI_PROCS: MPI_TYPE_COMMIT (mpiTypeXFaceBlock_xy_r8)',       &   'S/R INI_PROCS: MPI_TYPE_COMMIT (mpiTypeXFaceBlock_xy_r8)',
327       &        mpiRC       &        mpiRC
328          CALL PRINT_ERROR( msgBuffer , myThid)          CALL PRINT_ERROR( msgBuffer , myThid)
329         ENDIF         ENDIF
# Line 331  C      xFace (y=constant) for XYZ arrays Line 340  C      xFace (y=constant) for XYZ arrays
340         IF ( mpiRC .NE. MPI_SUCCESS ) THEN         IF ( mpiRC .NE. MPI_SUCCESS ) THEN
341          eeBootError = .TRUE.          eeBootError = .TRUE.
342          WRITE(msgBuffer,'(A,I)')          WRITE(msgBuffer,'(A,I)')
343       &        'S/R INI_PROCS: MPI_TYPE_HVECTOR (mpiTypeXFaceBlock_xyz_r4)',       &   'S/R INI_PROCS: MPI_TYPE_HVECTOR (mpiTypeXFaceBlock_xyz_r4)',
344       &        mpiRC       &        mpiRC
345          CALL PRINT_ERROR( msgBuffer , myThid)          CALL PRINT_ERROR( msgBuffer , myThid)
346         ENDIF         ENDIF
# Line 339  C      xFace (y=constant) for XYZ arrays Line 348  C      xFace (y=constant) for XYZ arrays
348         IF ( mpiRC .NE. MPI_SUCCESS ) THEN         IF ( mpiRC .NE. MPI_SUCCESS ) THEN
349          eeBootError = .TRUE.          eeBootError = .TRUE.
350          WRITE(msgBuffer,'(A,I)')          WRITE(msgBuffer,'(A,I)')
351       &        'S/R INI_PROCS: MPI_TYPE_COMMIT  (mpiTypeXFaceBlock_xyz_r4)',       &   'S/R INI_PROCS: MPI_TYPE_COMMIT  (mpiTypeXFaceBlock_xyz_r4)',
352       &        mpiRC       &        mpiRC
353          CALL PRINT_ERROR( msgBuffer , myThid)          CALL PRINT_ERROR( msgBuffer , myThid)
354         ENDIF         ENDIF
# Line 353  C      xFace (y=constant) for XYZ arrays Line 362  C      xFace (y=constant) for XYZ arrays
362         IF ( mpiRC .NE. MPI_SUCCESS ) THEN         IF ( mpiRC .NE. MPI_SUCCESS ) THEN
363          eeBootError = .TRUE.          eeBootError = .TRUE.
364          WRITE(msgBuffer,'(A,I)')          WRITE(msgBuffer,'(A,I)')
365       &        'S/R INI_PROCS: MPI_TYPE_HVECTOR (mpiTypeXFaceBlock_xyz_r8)',       &   'S/R INI_PROCS: MPI_TYPE_HVECTOR (mpiTypeXFaceBlock_xyz_r8)',
366       &        mpiRC       &        mpiRC
367          CALL PRINT_ERROR( msgBuffer , myThid)          CALL PRINT_ERROR( msgBuffer , myThid)
368         ENDIF         ENDIF
# Line 361  C      xFace (y=constant) for XYZ arrays Line 370  C      xFace (y=constant) for XYZ arrays
370         IF ( mpiRC .NE. MPI_SUCCESS ) THEN         IF ( mpiRC .NE. MPI_SUCCESS ) THEN
371          eeBootError = .TRUE.          eeBootError = .TRUE.
372          WRITE(msgBuffer,'(A,I)')          WRITE(msgBuffer,'(A,I)')
373       &        'S/R INI_PROCS: MPI_TYPE_COMMIT (mpiTypeXFaceBlock_xyz_r8)',       &   'S/R INI_PROCS: MPI_TYPE_COMMIT (mpiTypeXFaceBlock_xyz_r8)',
374       &        mpiRC       &        mpiRC
375          CALL PRINT_ERROR( msgBuffer , myThid)          CALL PRINT_ERROR( msgBuffer , myThid)
376         ENDIF         ENDIF
# Line 375  C      yFace (x=constant) for XY arrays Line 384  C      yFace (x=constant) for XY arrays
384         IF ( mpiRC .NE. MPI_SUCCESS ) THEN         IF ( mpiRC .NE. MPI_SUCCESS ) THEN
385          eeBootError = .TRUE.          eeBootError = .TRUE.
386          WRITE(msgBuffer,'(A,I)')          WRITE(msgBuffer,'(A,I)')
387       &        'S/R INI_PROCS: MPI_TYPE_CONTIGUOUS (mpiTypeYFaceBlock_xy_r4)',       &   'S/R INI_PROCS: MPI_TYPE_CONTIGUOUS (mpiTypeYFaceBlock_xy_r4)',
388       &        mpiRC       &        mpiRC
389          CALL PRINT_ERROR( msgBuffer , myThid)          CALL PRINT_ERROR( msgBuffer , myThid)
390         ENDIF         ENDIF
# Line 383  C      yFace (x=constant) for XY arrays Line 392  C      yFace (x=constant) for XY arrays
392         IF ( mpiRC .NE. MPI_SUCCESS ) THEN         IF ( mpiRC .NE. MPI_SUCCESS ) THEN
393          eeBootError = .TRUE.          eeBootError = .TRUE.
394          WRITE(msgBuffer,'(A,I)')          WRITE(msgBuffer,'(A,I)')
395       &        'S/R INI_PROCS: MPI_TYPE_COMMIT (mpiTypeYFaceBlock_xy_r4)',       &   'S/R INI_PROCS: MPI_TYPE_COMMIT (mpiTypeYFaceBlock_xy_r4)',
396       &        mpiRC       &        mpiRC
397          CALL PRINT_ERROR( msgBuffer , myThid)          CALL PRINT_ERROR( msgBuffer , myThid)
398         ENDIF         ENDIF
# Line 393  C      yFace (x=constant) for XY arrays Line 402  C      yFace (x=constant) for XY arrays
402         IF ( mpiRC .NE. MPI_SUCCESS ) THEN         IF ( mpiRC .NE. MPI_SUCCESS ) THEN
403          eeBootError = .TRUE.          eeBootError = .TRUE.
404          WRITE(msgBuffer,'(A,I)')          WRITE(msgBuffer,'(A,I)')
405       &        'S/R INI_PROCS: MPI_TYPE_CONTIGUOUS (mpiTypeYFaceBlock_xy_r8)',       &   'S/R INI_PROCS: MPI_TYPE_CONTIGUOUS (mpiTypeYFaceBlock_xy_r8)',
406       &        mpiRC       &        mpiRC
407          CALL PRINT_ERROR( msgBuffer , myThid)          CALL PRINT_ERROR( msgBuffer , myThid)
408         ENDIF         ENDIF
# Line 401  C      yFace (x=constant) for XY arrays Line 410  C      yFace (x=constant) for XY arrays
410         IF ( mpiRC .NE. MPI_SUCCESS ) THEN         IF ( mpiRC .NE. MPI_SUCCESS ) THEN
411          eeBootError = .TRUE.          eeBootError = .TRUE.
412          WRITE(msgBuffer,'(A,I)')          WRITE(msgBuffer,'(A,I)')
413       &        'S/R INI_PROCS: MPI_TYPE_COMMIT (mpiTypeYFaceBlock_xy_r8)',       &   'S/R INI_PROCS: MPI_TYPE_COMMIT (mpiTypeYFaceBlock_xy_r8)',
414       &        mpiRC       &        mpiRC
415          CALL PRINT_ERROR( msgBuffer , myThid)          CALL PRINT_ERROR( msgBuffer , myThid)
416         ENDIF         ENDIF
# Line 417  C      yFace (x=constant) for XYZ arrays Line 426  C      yFace (x=constant) for XYZ arrays
426         IF ( mpiRC .NE. MPI_SUCCESS ) THEN         IF ( mpiRC .NE. MPI_SUCCESS ) THEN
427          eeBootError = .TRUE.          eeBootError = .TRUE.
428          WRITE(msgBuffer,'(A,I)')          WRITE(msgBuffer,'(A,I)')
429       &        'S/R INI_PROCS: MPI_TYPE_HVECTOR (mpiTypeYFaceBlock_xyz_r4)',       &   'S/R INI_PROCS: MPI_TYPE_HVECTOR (mpiTypeYFaceBlock_xyz_r4)',
430       &        mpiRC       &        mpiRC
431          CALL PRINT_ERROR( msgBuffer , myThid)          CALL PRINT_ERROR( msgBuffer , myThid)
432         ENDIF         ENDIF
# Line 425  C      yFace (x=constant) for XYZ arrays Line 434  C      yFace (x=constant) for XYZ arrays
434         IF ( mpiRC .NE. MPI_SUCCESS ) THEN         IF ( mpiRC .NE. MPI_SUCCESS ) THEN
435          eeBootError = .TRUE.          eeBootError = .TRUE.
436          WRITE(msgBuffer,'(A,I)')          WRITE(msgBuffer,'(A,I)')
437       &        'S/R INI_PROCS: MPI_TYPE_COMMIT (mpiTypeYFaceBlock_xyz_r4)',       &   'S/R INI_PROCS: MPI_TYPE_COMMIT (mpiTypeYFaceBlock_xyz_r4)',
438       &        mpiRC       &        mpiRC
439          CALL PRINT_ERROR( msgBuffer , myThid)          CALL PRINT_ERROR( msgBuffer , myThid)
440         ENDIF         ENDIF
# Line 438  C      yFace (x=constant) for XYZ arrays Line 447  C      yFace (x=constant) for XYZ arrays
447         IF ( mpiRC .NE. MPI_SUCCESS ) THEN         IF ( mpiRC .NE. MPI_SUCCESS ) THEN
448          eeBootError = .TRUE.          eeBootError = .TRUE.
449          WRITE(msgBuffer,'(A,I)')          WRITE(msgBuffer,'(A,I)')
450       &        'S/R INI_PROCS: MPI_TYPE_HVECTOR (mpiTypeYFaceBlock_xyz_r8)',       &   'S/R INI_PROCS: MPI_TYPE_HVECTOR (mpiTypeYFaceBlock_xyz_r8)',
451       &        mpiRC       &        mpiRC
452          CALL PRINT_ERROR( msgBuffer , myThid)          CALL PRINT_ERROR( msgBuffer , myThid)
453         ENDIF         ENDIF
# Line 446  C      yFace (x=constant) for XYZ arrays Line 455  C      yFace (x=constant) for XYZ arrays
455         IF ( mpiRC .NE. MPI_SUCCESS ) THEN         IF ( mpiRC .NE. MPI_SUCCESS ) THEN
456          eeBootError = .TRUE.          eeBootError = .TRUE.
457          WRITE(msgBuffer,'(A,I)')          WRITE(msgBuffer,'(A,I)')
458       &        'S/R INI_PROCS: MPI_TYPE_COMMIT (mpiTypeYFaceBlock_xyz_r8)',       &   'S/R INI_PROCS: MPI_TYPE_COMMIT (mpiTypeYFaceBlock_xyz_r8)',
459       &        mpiRC       &        mpiRC
460          CALL PRINT_ERROR( msgBuffer , myThid)          CALL PRINT_ERROR( msgBuffer , myThid)
461         ENDIF         ENDIF
# Line 458  C--    Assign MPI values used in generat Line 467  C--    Assign MPI values used in generat
467         mpiTagN    = 4         mpiTagN    = 4
468    
469  C  C
470         CALL MPI_Barrier(MPI_COMM_WORLD,mpiRC)         CALL MPI_Barrier(MPI_COMM_MODEL,mpiRC)
471    
472    
473  C  C

Legend:
Removed from v.1.7  
changed lines
  Added in v.1.9

  ViewVC Help
Powered by ViewVC 1.1.22