[Mitgcm-support] exchange of floats

mitgcm-support at dev.mitgcm.org mitgcm-support at dev.mitgcm.org
Wed Jul 9 15:52:02 EDT 2003


Alistair,

sorry to bother you again, but your help saved me already a lot of time
(nevertheless I promise to limit my mails to one per day...)

When I exchange the floats from one tile to another, I check first if
the position of the float is outside of the tile. In that case the
direction is checked, the new tile calculated and the data are exchanged
with that tile. The float on the former tile will be set to zero.

The problem is now, that I am doing a check about the location, and only
if that is not on the tile I do the sending and receiving (see piece of
code below). But the target tile does not proceed the if-statement and
therefore does not receive the data.

One possibility would be that ALL tiles send and receive the data
regardless the float has left the tile or not. But that would cost a lot
of unnecessary communication. Do you have any idea how to solve that?

Arne


c loop over floats

      do ip=1,npart

c     skip those that are not on this tile or that are not started yet
c
         if(myCurrentTime.lt.daypart(ip,bi,bj)*86400.) goto 100

         if (xpart(ip,bi,bj) .ge. xc(1,  1,bi,bj) .and. 
     &       xpart(ip,bi,bj) .le. xc(sNx,1,bi,bj) .and.
     &       ypart(ip,bi,bj) .ge. yc(1,  1,bi,bj) .and. 
     &       ypart(ip,bi,bj) .le. yc(1,sNy,bi,bj)) goto 100

...calculate target tile (biTo,bjTo)
         _BARRIER
c
c pack values for one float on one array and exchange
c
         exch_array(1) =      daypart(ip,bi,bj)
         exch_array(2) =        xpart(ip,bi,bj)
         exch_array(3) =        ypart(ip,bi,bj)
         exch_array(4) = FLOAT( kpart(ip,bi,bj))
         exch_array(5) = FLOAT(kfloat(ip,bi,bj))
         exch_array(6) = FLOAT(  iup(ip,bi,bj))
c
c send/receive
c
         CALL EXCH_VEC_RL_SEND_PUT( exch_array, 6, bi, bj, biTo,  
     I                bjTo, bPidTo, bTagTo, CommMode, myThid )

c this point is never rreached on the target tile because the position
c is zero and the if statement does deny!

         CALL EXCH_VEC_RL_RECV_GET( exch_array, 6, bi, bj, biTo,
     I                bjTo, myPid, bTagTo, CommMode, myThid )

c
c unpack values on new tile
c      
         daypart(ip,biTo,bjTo) =     exch_array(1)
         xpart(ip,biTo,bjTo)   =     exch_array(2)
         ypart(ip,biTo,bjTo)   =     exch_array(3)
         kpart(ip,biTo,bjTo)   = INT(exch_array(4))
         kfloat(ip,biTo,bjTo)  = INT(exch_array(5))
         iup(ip,biTo,bjTo)     = INT(exch_array(6))
c
c set old values to zero to delete float on former tile
c      
         daypart(ip,bi,bj) = 0.
         xpart(ip,bi,bj)   = 0.
         ypart(ip,bi,bj)   = 0.
         kpart(ip,bi,bj)   = 0
         kfloat(ip,bi,bj)  = 0
         iup(ip,bi,bj)     = 0

         _BARRIER

 100        continue
      enddo
-- 

Dr. Arne Biastoch
Scripps Institution of Oceanography        phone: +1-858-822-3787
Physical Oceanography Research Division    fax  : +1-858-534-9820
MS: 0230                                   email: abiastoch at ucsd.edu
8605 La Jolla Shores Dr.            
La Jolla, CA 92093-0230, U.S.A.   http://www.ecco.ucsd.edu/~biastoch




More information about the MITgcm-support mailing list