/[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.6 by edhill, Mon Mar 8 21:15:49 2004 UTC revision 1.12 by edhill, Tue Mar 23 05:24:44 2004 UTC
# Line 6  C $Name$ Line 6  C $Name$
6  C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|  C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
7    
8        SUBROUTINE MNC_CW_RX_W_YY(        SUBROUTINE MNC_CW_RX_W_YY(
      I     myThid,  
9       I     fbname, bi,bj,       I     fbname, bi,bj,
10       I     vtype,       I     vtype,
11       I     indu,       I     var,
12       I     var )       I     myThid )
13    
14        implicit none        implicit none
15    
16  #include "netcdf.inc"  #include "netcdf.inc"
17  #include "mnc_common.h"  #include "mnc_common.h"
 #include "EEPARAMS.h"  
18  #include "SIZE.h"  #include "SIZE.h"
19    #include "EEPARAMS.h"
20    #include "PARAMS.h"
21    
22  #define mnc_rtype_YY  #define mnc_rtype_YY
23    
# Line 35  C     Local Variables Line 35  C     Local Variables
35        integer ndim, indf, err, lbi,lbj, bidim,bjdim, unlim_sz, kr        integer ndim, indf, err, lbi,lbj, bidim,bjdim, unlim_sz, kr
36        integer p(9),s(9),e(9), dimnc(9), vstart(9),vcount(9), udo(9)        integer p(9),s(9),e(9), dimnc(9), vstart(9),vcount(9), udo(9)
37        integer j1,j2,j3,j4,j5,j6,j7, k1,k2,k3,k4,k5,k6,k7        integer j1,j2,j3,j4,j5,j6,j7, k1,k2,k3,k4,k5,k6,k7
38          integer indfg, fg1,fg2, npath
39        character*(MAX_LEN_MBUF) msgbuf        character*(MAX_LEN_MBUF) msgbuf
40        character*(MNC_MAX_CHAR) fname        character*(MNC_MAX_CHAR) fname
41          character*(MNC_MAX_CHAR) path_fname
42    
43  C     Temporary storage for the simultaneous type conversion and  C     Temporary storage for the simultaneous type conversion and
44  C     re-shaping before passing to NetCDF  C     re-shaping before passing to NetCDF
# Line 53  C     re-shaping before passing to NetCD Line 55  C     re-shaping before passing to NetCD
55  C     Only do I/O if I am the master thread  C     Only do I/O if I am the master thread
56        _BEGIN_MASTER( myThid )        _BEGIN_MASTER( myThid )
57    
58    C     Get the current index for the unlimited dimension from the file
59    C     group (or base) name
60          fg1 = IFNBLNK(fbname)
61          fg2 = ILNBLNK(fbname)
62          CALL MNC_GET_IND(MNC_MAX_ID, fbname, mnc_cw_fgnm, indfg, myThid)
63          IF (indfg .LT. 1) THEN
64            write(msgbuf,'(3a)')
65         &       'MNC_CW_RX_W_YY ERROR: file group name ''',
66         &       fbname(fg1:fg2), ''' is not defined'
67            CALL print_error(msgbuf, mythid)
68            STOP 'ABNORMAL END: S/R MNC_CW_RX_W_YY'
69          ENDIF
70          indu = mnc_cw_fgud(indfg)
71    
72  C     Check that the Variable Type exists  C     Check that the Variable Type exists
73        nvf = IFNBLNK(vtype)        nvf = IFNBLNK(vtype)
74        nvl = ILNBLNK(vtype)        nvl = ILNBLNK(vtype)
75        CALL MNC_GET_IND(myThid, MNC_MAX_ID, vtype, mnc_cw_vname, indv)        CALL MNC_GET_IND(MNC_MAX_ID, vtype, mnc_cw_vname, indv, myThid)
76        IF (indv .LT. 1) THEN        IF (indv .LT. 1) THEN
77          write(msgbuf,'(3a)') 'MNC_CW_RX_W_YY ERROR: vtype ''',          write(msgbuf,'(3a)') 'MNC_CW_RX_W_YY ERROR: vtype ''',
78       &       vtype(nvf:nvl), ''' is not defined'       &       vtype(nvf:nvl), ''' is not defined'
# Line 83  C     Set the bi,bj indicies Line 99  C     Set the bi,bj indicies
99          DO lbi = bis,bie          DO lbi = bis,bie
100    
101  C         Create the file name  C         Create the file name
102            CALL MNC_CW_GET_TILE_NUM(myThid, lbi,lbj, uniq_tnum)            CALL MNC_CW_GET_TILE_NUM(lbi,lbj, uniq_tnum, myThid)
103            fname(1:MNC_MAX_CHAR) = mnc_blank_name(1:MNC_MAX_CHAR)            fname(1:MNC_MAX_CHAR) = mnc_blank_name(1:MNC_MAX_CHAR)
104            n1 = IFNBLNK(fbname)            n1 = IFNBLNK(fbname)
105            n2 = ILNBLNK(fbname)            n2 = ILNBLNK(fbname)
# Line 94  C         Create the file name Line 110  C         Create the file name
110            write(fname((ntot+1):(ntot+9)),'(i6.6,a3)') uniq_tnum, '.nc'            write(fname((ntot+1):(ntot+9)),'(i6.6,a3)') uniq_tnum, '.nc'
111            nfname = ntot+9            nfname = ntot+9
112    
113    C         Add the path to the file name
114              IF (mnc_use_outdir) THEN
115                path_fname(1:MNC_MAX_CHAR) = mnc_blank_name(1:MNC_MAX_CHAR)
116                npath = ILNBLNK(mnc_out_path)
117                path_fname(1:npath) = mnc_out_path(1:npath)
118                path_fname((npath+1):(npath+1+nfname)) = fname(1:nfname)
119                fname(1:MNC_MAX_CHAR) = path_fname(1:MNC_MAX_CHAR)
120                nfname = npath + 1 + nfname
121              ENDIF
122    
123  C         Append to an existing or create a new file  C         Append to an existing or create a new file
124            CALL MNC_CW_FILE_AORC(myThid, fname, indf)            CALL MNC_CW_FILE_AORC(fname, indf, myThid)
125            fid = mnc_f_info(indf,2)            fid = mnc_f_info(indf,2)
126    
127  C         Ensure that all the NetCDF dimensions are defined and create a  C         Ensure that all the NetCDF dimensions are defined and create a
# Line 109  C         local copy of them Line 135  C         local copy of them
135              ELSE              ELSE
136                dimnc(i) = mnc_cw_ie(i,igrid) - mnc_cw_is(i,igrid) + 1                dimnc(i) = mnc_cw_ie(i,igrid) - mnc_cw_is(i,igrid) + 1
137              ENDIF              ENDIF
138              CALL MNC_DIM_INIT(myThid,fname,              CALL MNC_DIM_INIT(fname,
139       &           mnc_cw_dn(i,igrid), dimnc(i) )       &           mnc_cw_dn(i,igrid), dimnc(i), myThid)
140            ENDDO            ENDDO
141    
142  C         Ensure that the "grid" is defined  C         Ensure that the "grid" is defined
143            CALL MNC_GRID_INIT(myThid,fname, mnc_cw_gname(igrid),            CALL MNC_GRID_INIT(fname, mnc_cw_gname(igrid),
144       &        mnc_cw_ndim(igrid), mnc_cw_dn(1,igrid))       &        mnc_cw_ndim(igrid), mnc_cw_dn(1,igrid), myThid)
145    
146  C         Ensure that the variable is defined  C         Ensure that the variable is defined
147  #ifdef  mnc_rtype_D  #ifdef  mnc_rtype_D
148        CALL MNC_VAR_INIT_DBL(myThid,fname,mnc_cw_gname(igrid),vtype)        CALL MNC_VAR_INIT_DBL(fname,mnc_cw_gname(igrid),vtype, myThid)
149  #endif  #endif
150  #ifdef  mnc_rtype_R  #ifdef  mnc_rtype_R
151        CALL MNC_VAR_INIT_REAL(myThid,fname,mnc_cw_gname(igrid),vtype)        CALL MNC_VAR_INIT_REAL(fname,mnc_cw_gname(igrid),vtype, myThid)
152  #endif  #endif
153  #ifdef  mnc_rtype_I  #ifdef  mnc_rtype_I
154        CALL MNC_VAR_INIT_INT(myThid,fname,mnc_cw_gname(igrid),vtype)        CALL MNC_VAR_INIT_INT(fname,mnc_cw_gname(igrid),vtype, myThid)
155  #endif  #endif
156            DO i = 1,mnc_fv_ids(indf,1)            DO i = 1,mnc_fv_ids(indf,1)
157              j = 2 + 3*(i - 1)              j = 2 + 3*(i - 1)
# Line 187  C               Use the indu value Line 213  C               Use the indu value
213                  udo(i) = indu - 1                  udo(i) = indu - 1
214                ELSEIF (indu .EQ. -1) THEN                ELSEIF (indu .EQ. -1) THEN
215  C               Append one to the current unlimited dim size  C               Append one to the current unlimited dim size
216                  CALL MNC_DIM_UNLIM_SIZE(myThid, fname, unlim_sz)                  CALL MNC_DIM_UNLIM_SIZE( fname, unlim_sz, myThid)
217                  udo(i) = unlim_sz                  udo(i) = unlim_sz
218                ELSE                ELSE
219  C               Use the current unlimited dim size  C               Use the current unlimited dim size
220                  CALL MNC_DIM_UNLIM_SIZE(myThid, fname, unlim_sz)                  CALL MNC_DIM_UNLIM_SIZE( fname, unlim_sz, myThid)
221                  udo(i) = unlim_sz - 1                  udo(i) = unlim_sz - 1
222                ENDIF                ENDIF
223              ENDIF              ENDIF
# Line 209  CEH3        write(*,*) 'i,p(i),s(i),e(i) Line 235  CEH3        write(*,*) 'i,p(i),s(i),e(i)
235  CEH3      ENDDO  CEH3      ENDDO
236    
237  C         Add the global attributes  C         Add the global attributes
238            CALL MNC_CW_SET_GATTR(myThid, fname, lbi,lbj, uniq_tnum)            CALL MNC_CW_SET_GATTR( fname, lbi,lbj, uniq_tnum, myThid)
239    
240  C         Add the per-variable attributes  C         Add the per-variable attributes
241            DO i = 1,mnc_cw_vnat(1,indv)            DO i = 1,mnc_cw_vnat(1,indv)
242              CALL MNC_VAR_ADD_ATTR_STR(myThid, fname, vtype,              CALL MNC_VAR_ADD_ATTR_STR( fname, vtype,
243       &           mnc_cw_vtnm(i,indv), mnc_cw_vtat(i,indv))       &           mnc_cw_vtnm(i,indv), mnc_cw_vtat(i,indv), myThid)
244            ENDDO            ENDDO
245            DO i = 1,mnc_cw_vnat(2,indv)            DO i = 1,mnc_cw_vnat(2,indv)
246              CALL MNC_VAR_ADD_ATTR_INT(myThid, fname, vtype,              CALL MNC_VAR_ADD_ATTR_INT( fname, vtype,
247       &           mnc_cw_vinm(i,indv), 1, mnc_cw_viat(i,indv))       &           mnc_cw_vinm(i,indv), 1, mnc_cw_viat(i,indv), myThid)
248            ENDDO            ENDDO
249            DO i = 1,mnc_cw_vnat(3,indv)            DO i = 1,mnc_cw_vnat(3,indv)
250              CALL MNC_VAR_ADD_ATTR_DBL(myThid, fname, vtype,              CALL MNC_VAR_ADD_ATTR_DBL( fname, vtype,
251       &           mnc_cw_vdnm(i,indv), 1, mnc_cw_vdat(i,indv))       &           mnc_cw_vdnm(i,indv), 1, mnc_cw_vdat(i,indv), myThid)
252            ENDDO            ENDDO
253    
254            CALL MNC_FILE_ENDDEF(myThid,fname)            CALL MNC_FILE_ENDDEF(fname, myThid)
255    
256              write(msgbuf,'(5a)') 'writing variable type ''',
257         &         vtype(nvf:nvl), ''' within file ''',
258         &         fname(1:nfname), ''''
259    
260  C         Write the variable one vector at a time  C         Write the variable one vector at a time
261            DO j7 = s(7),e(7)            DO j7 = s(7),e(7)
# Line 273  C         Write the variable one vector Line 303  C         Write the variable one vector
303        err = NF_PUT_VARA_INT(fid, idv, vstart, vcount, resh)        err = NF_PUT_VARA_INT(fid, idv, vstart, vcount, resh)
304  #endif  #endif
305    
306          CALL MNC_HANDLE_ERR(err, msgbuf, myThid)
307    
308                      ENDDO                      ENDDO
309                    ENDDO                    ENDDO
310                  ENDDO                  ENDDO
# Line 284  C         Sync the file Line 316  C         Sync the file
316            err = NF_SYNC(fid)            err = NF_SYNC(fid)
317            write(msgbuf,'(3a)') 'sync for file ''', fname,            write(msgbuf,'(3a)') 'sync for file ''', fname,
318       &         ''' in S/R MNC_CW_RX_W_YY'       &         ''' in S/R MNC_CW_RX_W_YY'
319            CALL MNC_HANDLE_ERR(myThid, err, msgbuf)            CALL MNC_HANDLE_ERR(err, msgbuf, myThid)
320    
321          ENDDO          ENDDO
322        ENDDO        ENDDO
# Line 299  C---+----1----+----2----+----3----+----4 Line 331  C---+----1----+----2----+----3----+----4
331    
332    
333        SUBROUTINE MNC_CW_RX_R_YY(        SUBROUTINE MNC_CW_RX_R_YY(
      I     myThid,  
334       I     fbname, bi,bj,       I     fbname, bi,bj,
335       I     vtype,       I     vtype,
336       I     indu,       I     var,
337       I     var )       I     myThid )
338    
339        implicit none        implicit none
340    
# Line 323  C     Functions Line 354  C     Functions
354        integer IFNBLNK, ILNBLNK        integer IFNBLNK, ILNBLNK
355    
356  C     Local Variables  C     Local Variables
357        integer i,k, indv,nvf,nvl, n1,n2, igrid, ntot        integer i,k, nvf,nvl, n1,n2, igrid, ntot
358        integer bis,bie, bjs,bje, uniq_tnum, nfname, fid, idv        integer bis,bie, bjs,bje, uniq_tnum, nfname, fid, idv
359        integer ndim, indf, err, lbi,lbj, bidim,bjdim, unlim_sz, kr        integer ndim, indf, err, lbi,lbj, bidim,bjdim, unlim_sz, kr
360        integer ind_fv_ids, ind_vt, ierr, atype, alen        integer ind_fv_ids, ind_vt, ierr, atype, alen
361        integer f_sNx,f_sNy, ires        integer f_sNx,f_sNy
362        integer p(9),s(9),e(9), vstart(9),vcount(9), udo(9)        integer p(9),s(9),e(9), vstart(9),vcount(9), udo(9)
363        integer j1,j2,j3,j4,j5,j6,j7, k1,k2,k3,k4,k5,k6,k7        integer j1,j2,j3,j4,j5,j6,j7, k1,k2,k3,k4,k5,k6,k7
364        character*(MAX_LEN_MBUF) msgbuf        character*(MAX_LEN_MBUF) msgbuf
365        character*(MNC_MAX_CHAR) fname        character*(MNC_MAX_CHAR) fname
366          integer indfg, fg1,fg2
367    
368  C     Temporary storage for the simultaneous type conversion and  C     Temporary storage for the simultaneous type conversion and
369  C     re-shaping before passing to NetCDF  C     re-shaping before passing to NetCDF
# Line 348  C     re-shaping before passing to NetCD Line 380  C     re-shaping before passing to NetCD
380  C     Only do I/O if I am the master thread  C     Only do I/O if I am the master thread
381        _BEGIN_MASTER( myThid )        _BEGIN_MASTER( myThid )
382    
383    C     Get the current index for the unlimited dimension from the file
384    C     group (or base) name
385          fg1 = IFNBLNK(fbname)
386          fg2 = ILNBLNK(fbname)
387          CALL MNC_GET_IND(MNC_MAX_ID, fbname, mnc_cw_fgnm, indfg, myThid)
388          IF (indfg .LT. 1) THEN
389            write(msgbuf,'(3a)')
390         &       'MNC_CW_RX_W_YY ERROR: file group name ''',
391         &       fbname(fg1:fg2), ''' is not defined'
392            CALL print_error(msgbuf, mythid)
393            STOP 'ABNORMAL END: S/R MNC_CW_RX_W_YY'
394          ENDIF
395          indu = mnc_cw_fgud(indfg)
396    
397  C     Check that the Variable Type exists  C     Check that the Variable Type exists
398        nvf = IFNBLNK(vtype)        nvf = IFNBLNK(vtype)
399        nvl = ILNBLNK(vtype)        nvl = ILNBLNK(vtype)
400        CALL MNC_GET_IND(myThid, MNC_MAX_ID, vtype, mnc_cw_vname, ind_vt)        CALL MNC_GET_IND( MNC_MAX_ID, vtype, mnc_cw_vname, ind_vt, myThid)
401        IF (indv .LT. 1) THEN        IF (ind_vt .LT. 1) THEN
402          write(msgbuf,'(3a)') 'MNC_CW_RX_R_YY ERROR: vtype ''',          write(msgbuf,'(3a)') 'MNC_CW_RX_R_YY ERROR: vtype ''',
403       &       vtype(nvf:nvl), ''' is not defined'       &       vtype(nvf:nvl), ''' is not defined'
404          CALL print_error(msgbuf, mythid)          CALL print_error(msgbuf, mythid)
# Line 382  C     Set the bi,bj indicies Line 428  C     Set the bi,bj indicies
428          DO lbi = bis,bie          DO lbi = bis,bie
429    
430  C         Create the file name  C         Create the file name
431            CALL MNC_CW_GET_TILE_NUM(myThid, lbi,lbj, uniq_tnum)            CALL MNC_CW_GET_TILE_NUM( lbi,lbj, uniq_tnum, myThid)
432            fname(1:MNC_MAX_CHAR) = mnc_blank_name(1:MNC_MAX_CHAR)            fname(1:MNC_MAX_CHAR) = mnc_blank_name(1:MNC_MAX_CHAR)
433            n1 = IFNBLNK(fbname)            n1 = IFNBLNK(fbname)
434            n2 = ILNBLNK(fbname)            n2 = ILNBLNK(fbname)
# Line 392  C         Create the file name Line 438  C         Create the file name
438            fname(ntot:ntot) = '.'            fname(ntot:ntot) = '.'
439            write(fname((ntot+1):(ntot+9)),'(i6.6,a3)') uniq_tnum, '.nc'            write(fname((ntot+1):(ntot+9)),'(i6.6,a3)') uniq_tnum, '.nc'
440            nfname = ntot+9            nfname = ntot+9
       write(*,*) 'The read file is: ', fname(1:nfname)  
441    
442  C         Open the existing file  C         Open the existing file
443            CALL MNC_FILE_TRY_READ(myThid, fname, ierr, indf)            CALL MNC_FILE_TRY_READ( fname, ierr, indf, myThid)
444    
445  C         Check that the variable (VType) is defined within the file  C         Check that the variable (VType) is defined within the file
446            CALL MNC_GET_FVINDS(myThid, fname, vtype, indf, ind_fv_ids)            CALL MNC_GET_FVINDS( fname, vtype, indf, ind_fv_ids, myThid)
447            IF ((indf .LT. 1) .OR. (ind_fv_ids .LT. 1)) THEN            IF ((indf .LT. 1) .OR. (ind_fv_ids .LT. 1)) THEN
448              write(msgbuf,'(4a)') 'MNC_CW_RX_R_YY ERROR: vtype ''',              write(msgbuf,'(4a)') 'MNC_CW_RX_R_YY ERROR: vtype ''',
449       &           vtype(nvf:nvl), ''' is not defined within file ''',       &           vtype(nvf:nvl), ''' is not defined within file ''',
# Line 409  C         Check that the variable (VType Line 454  C         Check that the variable (VType
454            fid = mnc_f_info(indf,2)            fid = mnc_f_info(indf,2)
455            idv = mnc_fv_ids(indf,ind_fv_ids+1)            idv = mnc_fv_ids(indf,ind_fv_ids+1)
456    
       write(*,*) 'indf,ind_fv_ids = ', indf,ind_fv_ids  
   
457  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
458  C         are compatible and WARN (only warn) if not  C         are compatible and WARN (only warn) if not
459            f_sNx = -1            f_sNx = -1
# Line 418  C         are compatible and WARN (only Line 461  C         are compatible and WARN (only
461            err = NF_INQ_ATT(fid,NF_GLOBAL, 'sNx',atype,alen)            err = NF_INQ_ATT(fid,NF_GLOBAL, 'sNx',atype,alen)
462            IF ((err .EQ. NF_NOERR) .AND. (alen .EQ. 1)) THEN            IF ((err .EQ. NF_NOERR) .AND. (alen .EQ. 1)) THEN
463              err = NF_GET_ATT_INT(fid, NF_GLOBAL, 'sNx', f_sNx)              err = NF_GET_ATT_INT(fid, NF_GLOBAL, 'sNx', f_sNx)
464              CALL MNC_HANDLE_ERR(myThid, err,              CALL MNC_HANDLE_ERR(err,
465       &           'reading attribute ''sNx'' in S/R MNC_CW_RX_R_YY')       &           'reading attribute ''sNx'' in S/R MNC_CW_RX_R_YY',
466         &           myThid)
467            ENDIF            ENDIF
468            err = NF_INQ_ATT(fid,NF_GLOBAL, 'sNy',atype,alen)            err = NF_INQ_ATT(fid,NF_GLOBAL, 'sNy',atype,alen)
469            IF ((err .EQ. NF_NOERR) .AND. (alen .EQ. 1)) THEN            IF ((err .EQ. NF_NOERR) .AND. (alen .EQ. 1)) THEN
470              err = NF_GET_ATT_INT(fid, NF_GLOBAL, 'sNy', f_sNy)              err = NF_GET_ATT_INT(fid, NF_GLOBAL, 'sNy', f_sNy)
471              CALL MNC_HANDLE_ERR(myThid, err,              CALL MNC_HANDLE_ERR(err,
472       &           'reading attribute ''sNy'' in S/R MNC_CW_RX_R_YY')       &           'reading attribute ''sNy'' in S/R MNC_CW_RX_R_YY',
473         &           myThid)
474            ENDIF            ENDIF
475            IF ((f_sNx .NE. sNx) .OR. (f_sNy .NE. sNy)) THEN            IF ((f_sNx .NE. sNx) .OR. (f_sNy .NE. sNy)) THEN
476              write(msgbuf,'(5a)') 'MNC_CW_RX_R_YY WARNING: the ',              write(msgbuf,'(5a)') 'MNC_CW_RX_R_YY WARNING: the ',
# Line 437  C         are compatible and WARN (only Line 482  C         are compatible and WARN (only
482    
483  C         Check that the in-memory variable and the in-file variables  C         Check that the in-memory variable and the in-file variables
484  C         are of compatible sizes  C         are of compatible sizes
485            ires = 1  C           ires = 1
486            CALL MNC_CHK_VTYP_R_NCVAR(myThid, ind_vt,  C           CALL MNC_CHK_VTYP_R_NCVAR( ind_vt,
487       &         indf, ind_fv_ids, indu, ires)  C      &         indf, ind_fv_ids, indu, ires)
488            IF (ires .LT. 0) THEN  C           IF (ires .LT. 0) THEN
489              write(msgbuf,'(7a)') 'MNC_CW_RX_R_YY WARNING: the sizes ',  C             write(msgbuf,'(7a)') 'MNC_CW_RX_R_YY WARNING: the sizes ',
490       &           'of the in-program variable ''', vtype(nvf:nvl),  C      &           'of the in-program variable ''', vtype(nvf:nvl),
491       &           ''' and the corresponding variable within file ''',  C      &           ''' and the corresponding variable within file ''',
492       &           fname(1:nfname), ''' are not compatible -- please ',  C      &           fname(1:nfname), ''' are not compatible -- please ',
493       &           'check the sizes'  C      &           'check the sizes'
494              CALL print_error(msgbuf, mythid)  C             CALL print_error(msgbuf, mythid)
495              STOP 'ABNORMAL END: S/R MNC_CW_RX_R_YY'  C             STOP 'ABNORMAL END: S/R MNC_CW_RX_R_YY'
496            ENDIF  C           ENDIF
497    
498  C         Check for bi,bj indicies  C         Check for bi,bj indicies
499            bidim = mnc_cw_vbij(1,ind_vt)            bidim = mnc_cw_vbij(1,ind_vt)
500            bjdim = mnc_cw_vbij(2,ind_vt)            bjdim = mnc_cw_vbij(2,ind_vt)
           write(*,*) 'bidim,bjdim = ', bidim,bjdim  
501    
502  C         Set the dimensions for the in-memory array  C         Set the dimensions for the in-memory array
503            ndim = mnc_cw_ndim(igrid)            ndim = mnc_cw_ndim(igrid)
# Line 495  C               Use the indu value Line 539  C               Use the indu value
539                  udo(i) = indu - 1                  udo(i) = indu - 1
540                ELSEIF (indu .EQ. -1) THEN                ELSEIF (indu .EQ. -1) THEN
541  C               Append one to the current unlimited dim size  C               Append one to the current unlimited dim size
542                  CALL MNC_DIM_UNLIM_SIZE(myThid, fname, unlim_sz)                  CALL MNC_DIM_UNLIM_SIZE( fname, unlim_sz, myThid)
543                  udo(i) = unlim_sz                  udo(i) = unlim_sz
544                ELSE                ELSE
545  C               Use the current unlimited dim size  C               Use the current unlimited dim size
546                  CALL MNC_DIM_UNLIM_SIZE(myThid, fname, unlim_sz)                  CALL MNC_DIM_UNLIM_SIZE( fname, unlim_sz, myThid)
547                  udo(i) = unlim_sz - 1                  udo(i) = unlim_sz - 1
548                ENDIF                ENDIF
549              ENDIF              ENDIF
# Line 513  C               Use the current unlimite Line 557  C               Use the current unlimite
557              e(bjdim) = lbj              e(bjdim) = lbj
558            ENDIF            ENDIF
559    
560        DO i = 9,1,-1  C     DO i = 9,1,-1
561          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)
562        ENDDO  C     ENDDO
563                        
564            CALL MNC_FILE_ENDDEF(myThid,fname)            CALL MNC_FILE_ENDDEF(fname, myThid)
565    
566            write(msgbuf,'(5a)') 'reading variable type ''',            write(msgbuf,'(5a)') 'reading variable type ''',
567       &         vtype(nvf:nvl), ''' within file ''',       &         vtype(nvf:nvl), ''' within file ''',
# Line 562  C         Read the variable one vector a Line 606  C         Read the variable one vector a
606        err = NF_GET_VARA_INT(fid, idv, vstart, vcount, resh)        err = NF_GET_VARA_INT(fid, idv, vstart, vcount, resh)
607  #endif  #endif
608    
609        CALL MNC_HANDLE_ERR(myThid, err, msgbuf)        CALL MNC_HANDLE_ERR(err, msgbuf, myThid)
610    
611        kr = 0        kr = 0
612        DO j1 = s(1),e(1)        DO j1 = s(1),e(1)
# Line 579  C         Read the variable one vector a Line 623  C         Read the variable one vector a
623              ENDDO              ENDDO
624            ENDDO            ENDDO
625    
626    C         Close the file
627              CALL MNC_FILE_CLOSE(fname, myThid)
628    
629  C         End the lbj,lbi loops  C         End the lbj,lbi loops
630          ENDDO          ENDDO
631        ENDDO        ENDDO

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

  ViewVC Help
Powered by ViewVC 1.1.22