/[MITgcm]/MITgcm/pkg/flt/flt_traj.F
ViewVC logotype

Diff of /MITgcm/pkg/flt/flt_traj.F

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

revision 1.11 by jahn, Wed Dec 22 21:25:18 2010 UTC revision 1.12 by jmc, Mon Dec 27 19:21:23 2010 UTC
# Line 34  C     == routine arguments == Line 34  C     == routine arguments ==
34        INTEGER myIter, myThid        INTEGER myIter, myThid
35    
36  C     === Functions ==  C     === Functions ==
       INTEGER ILNBLNK  
37        _RL FLT_MAP_K2R        _RL FLT_MAP_K2R
       EXTERNAL ILNBLNK  
38        EXTERNAL FLT_MAP_K2R        EXTERNAL FLT_MAP_K2R
39    
40  C     == local variables ==  C     == local variables ==
# Line 46  C     == local variables == Line 44  C     == local variables ==
44        _RL ix, jy, i0x, j0y, xx, yy, zz        _RL ix, jy, i0x, j0y, xx, yy, zz
45        _RL uu, vv, tt, ss, pp        _RL uu, vv, tt, ss, pp
46    
       INTEGER ioUnit, irecord  
47        _RL tmp(imax)        _RL tmp(imax)
48        _RL npart_read,npart_times        _RL npart_read,npart_times
49        _RS dummyRS(1)        _RS dummyRS(1)
50          INTEGER fp, ioUnit, irecord
51        CHARACTER*(MAX_LEN_FNAM) fn        CHARACTER*(MAX_LEN_FNAM) fn
52        CHARACTER*(MAX_LEN_MBUF) msgBuf        CHARACTER*(MAX_LEN_MBUF) msgBuf
       CHARACTER*(80) dataFName  
       INTEGER iG,jG,IL  
53  #ifdef ALLOW_EXCH2  #ifdef ALLOW_EXCH2
54        INTEGER nT        INTEGER nT
55  #endif  #endif
       LOGICAL exst  
       LOGICAL globalFile  
56    
57  C     == end of interface ==  C     == end of interface ==
58    
59        fn = 'float_trajectories'        fn = 'float_trajectories'
60          fp = writeBinaryPrec
61    
62        DO bj=myByLo(myThid),myByHi(myThid)        DO bj=myByLo(myThid),myByHi(myThid)
63         DO bi=myBxLo(myThid),myBxHi(myThid)         DO bi=myBxLo(myThid),myBxHi(myThid)
64    
65  C (1) read actual number floats from file (if exists)  C (1) read actual number floats from file (if exists)
66           IL=ILNBLNK( fn )           ioUnit = -2
67           iG=bi+(myXGlobalLo-1)/sNx ! Kludge until unstructered tiles           CALL MDS_READVEC_LOC(  fn, fp, ioUnit,
68           jG=bj+(myYGlobalLo-1)/sNy ! Kludge until unstructered tiles       &                          'RL', imax, tmp, dummyRS,
69           WRITE(dataFname(1:80),'(2a,i3.3,a,i3.3,a)')       &                           bi, bj, 1, myThid )
70       &              fn(1:IL),'.',iG,'.',jG,'.data'           IF ( ioUnit.GT. 0 ) THEN
          INQUIRE( file=dataFname, exist=exst )  
          IF (exst) THEN  
             CALL FLT_MDSREADVECTOR(fn,globalFile,precFloat64,'RL',  
      &                             imax,tmp,bi,bj,1,myThid)  
71              npart_read  = tmp(1)              npart_read  = tmp(1)
72              npart_times = tmp(5)              npart_times = tmp(5)
73    C-       close the read-unit (safer to use a different unit for writing)
74                CLOSE( ioUnit )
75           ELSE           ELSE
76              npart_read  = 0.              npart_read  = 0.
77              npart_times = 0.              npart_times = 0.
# Line 105  C total number of floats Line 98  C total number of floats
98           ENDDO           ENDDO
99    
100           ioUnit = -1           ioUnit = -1
101           CALL MDS_WRITEVEC_LOC( fn, precFloat64, ioUnit,           CALL MDS_WRITEVEC_LOC( fn, fp, ioUnit,
102       &                          'RL', imax, tmp, dummyRS,       &                          'RL', imax, tmp, dummyRS,
103       &                           bi,bj,-1, myIter, myThid )       &                           bi,bj,-1, myIter, myThid )
104    
# Line 175  C-- jmc: not sure if this is right but a Line 168  C-- jmc: not sure if this is right but a
168  C (3) WRITE float positions into file  C (3) WRITE float positions into file
169              irecord = npart_read+ip+1              irecord = npart_read+ip+1
170              IF ( ip.NE.npart_tile(bi,bj) ) irecord = -irecord              IF ( ip.NE.npart_tile(bi,bj) ) irecord = -irecord
171              CALL MDS_WRITEVEC_LOC( fn, precFloat64, ioUnit,              CALL MDS_WRITEVEC_LOC( fn, fp, ioUnit,
172       &                            'RL', imax, tmp, dummyRS,       &                            'RL', imax, tmp, dummyRS,
173       &                             bi,bj,irecord, myIter, myThid )       &                             bi,bj,irecord, myIter, myThid )
174    

Legend:
Removed from v.1.11  
changed lines
  Added in v.1.12

  ViewVC Help
Powered by ViewVC 1.1.22