Changeset 22636


Ignore:
Timestamp:
03/27/18 20:15:23 (7 years ago)
Author:
dmenemen
Message:

fixing a bug in cpl_issm

Location:
issm/trunk-jpl/test/MITgcm/code
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/test/MITgcm/code/cpl_issm.F

    r22629 r22636  
    4545#ifdef ALLOW_CPL_ISSM
    4646#include "EESUPPORT.h"
    47       COMMON /CPL_MPI_ID/
    48      &     mpiMyWid, toissmcomm
     47      COMMON /CPL_MPI_ID/ mpiMyWid, toissmcomm
    4948      INTEGER mpiMyWid, toissmcomm, mpiRC
    50       integer mpistatus(MPI_STATUS_SIZE)
    51       real*8 CouplingTime, IceModelTime
    52       integer i, j, bi, bj, buffsize
    53       Real*8 xfer_array(Nx,Ny)
    54       _RL    local(1:sNx,1:sNy,nSx,nSy)
     49      INTEGER mpistatus(MPI_STATUS_SIZE)
     50      INTEGER i, j, bi, bj, buffsize
     51      _R8 CouplingTime, IceModelTime
     52      _R8 xfer_array(Nx,Ny)
     53      _R8 local(1:sNx,1:sNy,nSx,nSy)
    5554
    5655      IF( myTime .EQ. startTime ) THEN
    5756
    58 C     Send deltatimestep
    59          _BEGIN_MASTER( myThid )
    60          call MPI_Recv(CouplingTime,1,MPI_DOUBLE,0,10001000,toissmcomm,
    61      &        mpistatus,mpiRC)
    62          print*, 'Ocean received CouplingTime: ', CouplingTime
    63          call MPI_Recv(IceModelTime,1,MPI_DOUBLE,0,10001001,toissmcomm,
    64      &        mpistatus,mpiRC)
    65          print*, 'Ocean received IceModelTime: ', IceModelTime
    66          call MPI_Send(myTime,1,MPI_DOUBLE,0,10001002,toissmcomm,
    67      &        mpistatus)
    68          call MPI_Send(Nx,1,MPI_INT,0,10001003,toissmcomm,
    69      &        mpistatus)
    70          call MPI_Send(Ny,1,MPI_INT,0,10001004,toissmcomm,
    71      &        mpistatus)
    72          _END_MASTER( myThid )
     57C     Send/receive scalar values
     58         IF( myProcId .EQ. 0 ) THEN
     59            _BEGIN_MASTER( myThid )         
     60            call MPI_Recv(CouplingTime,1,MPI_DOUBLE,0,10001000,
     61     &           toissmcomm,mpistatus,mpiRC)
     62            print*, 'Ocean received CouplingTime: ', CouplingTime
     63            call MPI_Recv(IceModelTime,1,MPI_DOUBLE,0,10001001,
     64     &           toissmcomm,mpistatus,mpiRC)
     65            print*, 'Ocean received IceModelTime: ', IceModelTime
     66            call MPI_Send(myTime,1,MPI_DOUBLE,0,10001002,
     67     &           toissmcomm,mpistatus)
     68            call MPI_Send(Nx,1,MPI_INT,0,10001003,
     69     &           toissmcomm,mpistatus)
     70            call MPI_Send(Ny,1,MPI_INT,0,10001004,
     71     &           toissmcomm,mpistatus)
     72            _END_MASTER( myThid )
     73         endif
    7374
    7475C     Send longitude East of center of cell
     76         print*,'this is xC',xC
    7577         DO bj=1,nSy
    7678            DO bi=1,nSx
     
    8284            ENDDO
    8385         ENDDO
    84 CDM         CALL GATHER_2D_R8( xfer_array, local, myThid )
    85          _BEGIN_MASTER( myThid )
    86          buffsize = Nx*Ny
    87          CALL MPI_SEND(xfer_array,buffsize,MPI_DOUBLE_PRECISION,
    88      &        0,10001005,toissmcomm,mpistatus)
    89          _END_MASTER( myThid )
    90          
     86         print*,'this is local xC',local
     87         CALL BAR2( myThid )
     88         CALL GATHER_2D_R8( xfer_array, local, Nx, Ny,
     89     &        .FALSE., .FALSE., myThid )
     90         print*,'this is global XC',xfer_array
     91         IF( myProcId .EQ. 0 ) THEN
     92            _BEGIN_MASTER( myThid )
     93            buffsize = Nx*Ny
     94            CALL MPI_SEND(xfer_array,buffsize,MPI_DOUBLE_PRECISION,
     95     &           0,10001005,toissmcomm,mpistatus)
     96            _END_MASTER( myThid )
     97         ENDIF
     98         CALL BAR2( myThid )
     99
    91100C     Send latitude North of center of cell
     101         print*,'this is yC',yC
    92102         DO bj=1,nSy
    93103            DO bi=1,nSx
     
    99109            ENDDO
    100110         ENDDO
    101 CDM         CALL GATHER_2D_R8( xfer_array, local, myThid )
    102          _BEGIN_MASTER( myThid )
    103          buffsize = Nx*Ny
    104          CALL MPI_SEND(xfer_array,buffsize,MPI_DOUBLE_PRECISION,
    105      &        0,10001006,toissmcomm,mpistatus)
    106          _END_MASTER( myThid )
     111         print*,'this is local yC',local
     112         CALL BAR2( myThid )
     113         CALL GATHER_2D_R8( xfer_array, local, Nx, Ny,
     114     &                      .FALSE., .FALSE., myThid )
     115         print*,'this is global YC',xfer_array
     116         IF( myProcId .EQ. 0 ) THEN
     117            _BEGIN_MASTER( myThid )
     118            buffsize = Nx*Ny
     119            CALL MPI_SEND(xfer_array,buffsize,MPI_DOUBLE_PRECISION,
     120     &           0,10001006,toissmcomm,mpistatus)
     121            _END_MASTER( myThid )
     122         ENDIF
     123         CALL BAR2( myThid )
     124         print*,'Done Sending XC/YC arrays.'
    107125
    108126      ENDIF
    109 
    110       print*,'Done Sending XC/YC arrays.'
    111127
    112128#endif /* ALLOW_CPL_MPMICE */
  • issm/trunk-jpl/test/MITgcm/code/eeboot_minimal.F

    r22532 r22636  
    6666#endif
    6767#ifdef ALLOW_CPL_ISSM
    68       COMMON /CPL_MPI_ID/
    69      &     mpiMyWid, toissmcomm
    70       INTEGER mpiMyWid, toissmcomm
    71       integer my_local_rank,my_local_size, numprocsworld
    72       integer dummy1(1),dummy2(1)
    73       integer status(MPI_STATUS_SIZE)
     68      COMMON /CPL_MPI_ID/ mpiMyWid, toissmcomm
     69      INTEGER             mpiMyWid, toissmcomm
     70      INTEGER my_local_rank,my_local_size, numprocsworld
     71      INTEGER dummy1(1),dummy2(1)
     72      INTEGER status(MPI_STATUS_SIZE)
    7473#endif /* ALLOW_CPL_ISSM */
    7574#if defined(ALLOW_NEST_PARENT) || defined(ALLOW_NEST_CHILD)
Note: See TracChangeset for help on using the changeset viewer.