/[MITgcm]/MITgcm/pkg/mnc/mnc_cw_readwrite.template
ViewVC logotype

Diff of /MITgcm/pkg/mnc/mnc_cw_readwrite.template

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

revision 1.7 by edhill, Tue Mar 9 14:43:16 2004 UTC revision 1.8 by edhill, Wed Mar 10 05:50:16 2004 UTC
# Line 227  C         Add the per-variable attribute Line 227  C         Add the per-variable attribute
227    
228            CALL MNC_FILE_ENDDEF(myThid,fname)            CALL MNC_FILE_ENDDEF(myThid,fname)
229    
230              write(msgbuf,'(5a)') 'writing variable type ''',
231         &         vtype(nvf:nvl), ''' within file ''',
232         &         fname(1:nfname), ''''
233    
234  C         Write the variable one vector at a time  C         Write the variable one vector at a time
235            DO j7 = s(7),e(7)            DO j7 = s(7),e(7)
236              k7 = (j7 - 1)*p(6)              k7 = (j7 - 1)*p(6)
# Line 273  C         Write the variable one vector Line 277  C         Write the variable one vector
277        err = NF_PUT_VARA_INT(fid, idv, vstart, vcount, resh)        err = NF_PUT_VARA_INT(fid, idv, vstart, vcount, resh)
278  #endif  #endif
279    
280          CALL MNC_HANDLE_ERR(myThid, err, msgbuf)
281    
282                      ENDDO                      ENDDO
283                    ENDDO                    ENDDO
284                  ENDDO                  ENDDO
# Line 323  C     Functions Line 329  C     Functions
329        integer IFNBLNK, ILNBLNK        integer IFNBLNK, ILNBLNK
330    
331  C     Local Variables  C     Local Variables
332        integer i,k, indv,nvf,nvl, n1,n2, igrid, ntot        integer i,k, nvf,nvl, n1,n2, igrid, ntot
333        integer bis,bie, bjs,bje, uniq_tnum, nfname, fid, idv        integer bis,bie, bjs,bje, uniq_tnum, nfname, fid, idv
334        integer ndim, indf, err, lbi,lbj, bidim,bjdim, unlim_sz, kr        integer ndim, indf, err, lbi,lbj, bidim,bjdim, unlim_sz, kr
335        integer ind_fv_ids, ind_vt, ierr, atype, alen        integer ind_fv_ids, ind_vt, ierr, atype, alen
# Line 392  C         Create the file name Line 398  C         Create the file name
398            fname(ntot:ntot) = '.'            fname(ntot:ntot) = '.'
399            write(fname((ntot+1):(ntot+9)),'(i6.6,a3)') uniq_tnum, '.nc'            write(fname((ntot+1):(ntot+9)),'(i6.6,a3)') uniq_tnum, '.nc'
400            nfname = ntot+9            nfname = ntot+9
       write(*,*) 'The read file is: ', fname(1:nfname)  
401    
402  C         Open the existing file  C         Open the existing file
403            CALL MNC_FILE_TRY_READ(myThid, fname, ierr, indf)            CALL MNC_FILE_TRY_READ(myThid, fname, ierr, indf)
# Line 409  C         Check that the variable (VType Line 414  C         Check that the variable (VType
414            fid = mnc_f_info(indf,2)            fid = mnc_f_info(indf,2)
415            idv = mnc_fv_ids(indf,ind_fv_ids+1)            idv = mnc_fv_ids(indf,ind_fv_ids+1)
416    
       write(*,*) 'indf,ind_fv_ids = ', indf,ind_fv_ids  
   
417  C         Check that the current sNy,sNy values and the in-file values  C         Check that the current sNy,sNy values and the in-file values
418  C         are compatible and WARN (only warn) if not  C         are compatible and WARN (only warn) if not
419            f_sNx = -1            f_sNx = -1
# Line 437  C         are compatible and WARN (only Line 440  C         are compatible and WARN (only
440    
441  C         Check that the in-memory variable and the in-file variables  C         Check that the in-memory variable and the in-file variables
442  C         are of compatible sizes  C         are of compatible sizes
443            ires = 1  C           ires = 1
444            CALL MNC_CHK_VTYP_R_NCVAR(myThid, ind_vt,  C           CALL MNC_CHK_VTYP_R_NCVAR(myThid, ind_vt,
445       &         indf, ind_fv_ids, indu, ires)  C      &         indf, ind_fv_ids, indu, ires)
446            IF (ires .LT. 0) THEN  C           IF (ires .LT. 0) THEN
447              write(msgbuf,'(7a)') 'MNC_CW_RX_R_YY WARNING: the sizes ',  C             write(msgbuf,'(7a)') 'MNC_CW_RX_R_YY WARNING: the sizes ',
448       &           'of the in-program variable ''', vtype(nvf:nvl),  C      &           'of the in-program variable ''', vtype(nvf:nvl),
449       &           ''' and the corresponding variable within file ''',  C      &           ''' and the corresponding variable within file ''',
450       &           fname(1:nfname), ''' are not compatible -- please ',  C      &           fname(1:nfname), ''' are not compatible -- please ',
451       &           'check the sizes'  C      &           'check the sizes'
452              CALL print_error(msgbuf, mythid)  C             CALL print_error(msgbuf, mythid)
453              STOP 'ABNORMAL END: S/R MNC_CW_RX_R_YY'  C             STOP 'ABNORMAL END: S/R MNC_CW_RX_R_YY'
454            ENDIF  C           ENDIF
455    
456  C         Check for bi,bj indicies  C         Check for bi,bj indicies
457            bidim = mnc_cw_vbij(1,ind_vt)            bidim = mnc_cw_vbij(1,ind_vt)
458            bjdim = mnc_cw_vbij(2,ind_vt)            bjdim = mnc_cw_vbij(2,ind_vt)
           write(*,*) 'bidim,bjdim = ', bidim,bjdim  
459    
460  C         Set the dimensions for the in-memory array  C         Set the dimensions for the in-memory array
461            ndim = mnc_cw_ndim(igrid)            ndim = mnc_cw_ndim(igrid)
# Line 513  C               Use the current unlimite Line 515  C               Use the current unlimite
515              e(bjdim) = lbj              e(bjdim) = lbj
516            ENDIF            ENDIF
517    
518        DO i = 9,1,-1  C     DO i = 9,1,-1
519          write(*,*) 'i,p(i),s(i),e(i) = ', i,': ',p(i),s(i),e(i)  C     write(*,*) 'i,p(i),s(i),e(i) = ', i,': ',p(i),s(i),e(i)
520        ENDDO  C     ENDDO
521                        
522            CALL MNC_FILE_ENDDEF(myThid,fname)            CALL MNC_FILE_ENDDEF(myThid,fname)
523    
# Line 579  C         Read the variable one vector a Line 581  C         Read the variable one vector a
581              ENDDO              ENDDO
582            ENDDO            ENDDO
583    
584    C         Close the file
585              CALL MNC_FILE_CLOSE(myThid, fname)
586    
587  C         End the lbj,lbi loops  C         End the lbj,lbi loops
588          ENDDO          ENDDO
589        ENDDO        ENDDO

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

  ViewVC Help
Powered by ViewVC 1.1.22