/[MITgcm]/MITgcm/pkg/mdsio/mdsio_writevec_loc.F
ViewVC logotype

Diff of /MITgcm/pkg/mdsio/mdsio_writevec_loc.F

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

revision 1.5 by jmc, Tue Sep 1 19:08:27 2009 UTC revision 1.6 by jmc, Thu Dec 23 02:46:18 2010 UTC
# Line 52  C Global variables / common blocks Line 52  C Global variables / common blocks
52  #include "SIZE.h"  #include "SIZE.h"
53  #include "EEPARAMS.h"  #include "EEPARAMS.h"
54  #include "PARAMS.h"  #include "PARAMS.h"
55    #include "MDSIO_BUFF_3D.h"
56    
57  C !INPUT/OUTPUT PARAMETERS:  C !INPUT/OUTPUT PARAMETERS:
58        CHARACTER*(*) fName        CHARACTER*(*) fName
# Line 79  C !LOCAL VARIABLES: Line 80  C !LOCAL VARIABLES:
80        INTEGER iG,jG,iRec,dUnit,IL,pIL        INTEGER iG,jG,iRec,dUnit,IL,pIL
81        INTEGER dimList(3,3), nDims, map2gl(2)        INTEGER dimList(3,3), nDims, map2gl(2)
82        INTEGER length_of_rec        INTEGER length_of_rec
83        INTEGER loc_size        INTEGER buffSize
       PARAMETER( loc_size = Nx+Ny+Nr )  
       Real*4 r4seg(loc_size)  
       Real*8 r8seg(loc_size)  
84        _RL dummyRL(1)        _RL dummyRL(1)
85        CHARACTER*8 blank8c        CHARACTER*8 blank8c
86  CEOP  CEOP
# Line 114  C Record number must be >= 1 Line 112  C Record number must be >= 1
112          ENDIF          ENDIF
113    
114  C Check buffer size  C Check buffer size
115          IF ( nSize.GT.loc_size ) THEN          buffSize = sNx*sNy*size3dBuf*nSx*nSy
116            IF ( nSize.GT.buffSize ) THEN
117            WRITE(msgBuf,'(3A)')            WRITE(msgBuf,'(3A)')
118       &     ' MDS_WRITEVEC_LOC: writing to file "', fName(1:IL), '":'       &     ' MDS_WRITEVEC_LOC: writing to file "', fName(1:IL), '":'
119            CALL PRINT_ERROR( msgBuf, myThid )            CALL PRINT_ERROR( msgBuf, myThid )
# Line 122  C Check buffer size Line 121  C Check buffer size
121       &      ' MDS_WRITEVEC_LOC: dim of array to write=', nSize       &      ' MDS_WRITEVEC_LOC: dim of array to write=', nSize
122            CALL PRINT_ERROR( msgBuf, myThid )            CALL PRINT_ERROR( msgBuf, myThid )
123            WRITE(msgBuf,'(A,I9)')            WRITE(msgBuf,'(A,I9)')
124       &      ' MDS_WRITEVEC_LOC: exceeds buffer size=', loc_size       &      ' MDS_WRITEVEC_LOC: exceeds buffer size=', buffSize
125              CALL PRINT_ERROR( msgBuf, myThid )
126              WRITE(msgBuf,'(A)')
127         &    ' increase "size3dBuf" in "MDSIO_BUFF_3D.h" and recompile'
128            CALL PRINT_ERROR( msgBuf, myThid )            CALL PRINT_ERROR( msgBuf, myThid )
129            STOP 'ABNORMAL END: S/R MDS_WRITEVEC_LOC'            STOP 'ABNORMAL END: S/R MDS_WRITEVEC_LOC'
130          ENDIF          ENDIF
# Line 181  C- End if block: File Unit is already op Line 183  C- End if block: File Unit is already op
183    
184          IF (fileIsOpen) THEN          IF (fileIsOpen) THEN
185            IF ( arrType.EQ.'RS' ) THEN            IF ( arrType.EQ.'RS' ) THEN
186              CALL MDS_WR_REC_RS( fldRS, r4seg, r8seg,              CALL MDS_WR_REC_RS( fldRS, shared3dBuf_r4, shared3dBuf_r8,
187       I                          filePrec, dUnit, iRec, nSize, myThid )       I                          filePrec, dUnit, iRec, nSize, myThid )
188            ELSEIF ( arrType.EQ.'RL' ) THEN            ELSEIF ( arrType.EQ.'RL' ) THEN
189              CALL MDS_WR_REC_RL( fldRL, r4seg, r8seg,              CALL MDS_WR_REC_RL( fldRL, shared3dBuf_r4, shared3dBuf_r8,
190       I                          filePrec, dUnit, iRec, nSize, myThid )       I                          filePrec, dUnit, iRec, nSize, myThid )
191            ELSE            ELSE
192              WRITE(msgBuf,'(A)')              WRITE(msgBuf,'(A)')

Legend:
Removed from v.1.5  
changed lines
  Added in v.1.6

  ViewVC Help
Powered by ViewVC 1.1.22