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 |
|
|
34 |
integer ndim, indf, err, lbi,lbj, bidim,bjdim, unlim_sz, kr |
integer ndim, indf, err, lbi,lbj, bidim,bjdim, unlim_sz, kr |
35 |
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) |
36 |
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 |
37 |
|
integer indfg, fg1,fg2, npath |
38 |
character*(MAX_LEN_MBUF) msgbuf |
character*(MAX_LEN_MBUF) msgbuf |
39 |
character*(MNC_MAX_CHAR) fname |
character*(MNC_MAX_CHAR) fname |
40 |
|
character*(MNC_MAX_CHAR) path_fname |
41 |
|
|
42 |
C Temporary storage for the simultaneous type conversion and |
C Temporary storage for the simultaneous type conversion and |
43 |
C re-shaping before passing to NetCDF |
C re-shaping before passing to NetCDF |
54 |
C Only do I/O if I am the master thread |
C Only do I/O if I am the master thread |
55 |
_BEGIN_MASTER( myThid ) |
_BEGIN_MASTER( myThid ) |
56 |
|
|
57 |
|
C Get the current index for the unlimited dimension from the file |
58 |
|
C group (or base) name |
59 |
|
fg1 = IFNBLNK(fbname) |
60 |
|
fg2 = ILNBLNK(fbname) |
61 |
|
CALL MNC_GET_IND(MNC_MAX_ID, fbname, mnc_cw_fgnm, indfg, myThid) |
62 |
|
IF (indfg .LT. 1) THEN |
63 |
|
write(msgbuf,'(3a)') |
64 |
|
& 'MNC_CW_RX_W_YY ERROR: file group name ''', |
65 |
|
& fbname(fg1:fg2), ''' is not defined' |
66 |
|
CALL print_error(msgbuf, mythid) |
67 |
|
STOP 'ABNORMAL END: S/R MNC_CW_RX_W_YY' |
68 |
|
ENDIF |
69 |
|
indu = mnc_cw_fgud(indfg) |
70 |
|
|
71 |
C Check that the Variable Type exists |
C Check that the Variable Type exists |
72 |
nvf = IFNBLNK(vtype) |
nvf = IFNBLNK(vtype) |
73 |
nvl = ILNBLNK(vtype) |
nvl = ILNBLNK(vtype) |
74 |
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) |
75 |
IF (indv .LT. 1) THEN |
IF (indv .LT. 1) THEN |
76 |
write(msgbuf,'(3a)') 'MNC_CW_RX_W_YY ERROR: vtype ''', |
write(msgbuf,'(3a)') 'MNC_CW_RX_W_YY ERROR: vtype ''', |
77 |
& vtype(nvf:nvl), ''' is not defined' |
& vtype(nvf:nvl), ''' is not defined' |
98 |
DO lbi = bis,bie |
DO lbi = bis,bie |
99 |
|
|
100 |
C Create the file name |
C Create the file name |
101 |
CALL MNC_CW_GET_TILE_NUM(myThid, lbi,lbj, uniq_tnum) |
CALL MNC_CW_GET_TILE_NUM(lbi,lbj, uniq_tnum, myThid) |
102 |
fname(1:MNC_MAX_CHAR) = mnc_blank_name(1:MNC_MAX_CHAR) |
fname(1:MNC_MAX_CHAR) = mnc_blank_name(1:MNC_MAX_CHAR) |
103 |
n1 = IFNBLNK(fbname) |
n1 = IFNBLNK(fbname) |
104 |
n2 = ILNBLNK(fbname) |
n2 = ILNBLNK(fbname) |
109 |
write(fname((ntot+1):(ntot+9)),'(i6.6,a3)') uniq_tnum, '.nc' |
write(fname((ntot+1):(ntot+9)),'(i6.6,a3)') uniq_tnum, '.nc' |
110 |
nfname = ntot+9 |
nfname = ntot+9 |
111 |
|
|
112 |
|
C Add the path to the file name |
113 |
|
c path_fname(1:MNC_MAX_CHAR) = mnc_blank_name(1:MNC_MAX_CHAR) |
114 |
|
c npath = ILNBLNK(mnc_out_path) |
115 |
|
c path_fname(1:npath) = mnc_out_path(1:npath) |
116 |
|
c path_fname((npath+1):(npath+1+nfname)) = fname(1:nfname) |
117 |
|
c fname(1:MNC_MAX_CHAR) = path_fname(1:MNC_MAX_CHAR) |
118 |
|
|
119 |
C Append to an existing or create a new file |
C Append to an existing or create a new file |
120 |
CALL MNC_CW_FILE_AORC(myThid, fname, indf) |
CALL MNC_CW_FILE_AORC(fname, indf, myThid) |
121 |
fid = mnc_f_info(indf,2) |
fid = mnc_f_info(indf,2) |
122 |
|
|
123 |
C Ensure that all the NetCDF dimensions are defined and create a |
C Ensure that all the NetCDF dimensions are defined and create a |
131 |
ELSE |
ELSE |
132 |
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 |
133 |
ENDIF |
ENDIF |
134 |
CALL MNC_DIM_INIT(myThid,fname, |
CALL MNC_DIM_INIT(fname, |
135 |
& mnc_cw_dn(i,igrid), dimnc(i) ) |
& mnc_cw_dn(i,igrid), dimnc(i), myThid) |
136 |
ENDDO |
ENDDO |
137 |
|
|
138 |
C Ensure that the "grid" is defined |
C Ensure that the "grid" is defined |
139 |
CALL MNC_GRID_INIT(myThid,fname, mnc_cw_gname(igrid), |
CALL MNC_GRID_INIT(fname, mnc_cw_gname(igrid), |
140 |
& mnc_cw_ndim(igrid), mnc_cw_dn(1,igrid)) |
& mnc_cw_ndim(igrid), mnc_cw_dn(1,igrid), myThid) |
141 |
|
|
142 |
C Ensure that the variable is defined |
C Ensure that the variable is defined |
143 |
#ifdef mnc_rtype_D |
#ifdef mnc_rtype_D |
144 |
CALL MNC_VAR_INIT_DBL(myThid,fname,mnc_cw_gname(igrid),vtype) |
CALL MNC_VAR_INIT_DBL(fname,mnc_cw_gname(igrid),vtype, myThid) |
145 |
#endif |
#endif |
146 |
#ifdef mnc_rtype_R |
#ifdef mnc_rtype_R |
147 |
CALL MNC_VAR_INIT_REAL(myThid,fname,mnc_cw_gname(igrid),vtype) |
CALL MNC_VAR_INIT_REAL(fname,mnc_cw_gname(igrid),vtype, myThid) |
148 |
#endif |
#endif |
149 |
#ifdef mnc_rtype_I |
#ifdef mnc_rtype_I |
150 |
CALL MNC_VAR_INIT_INT(myThid,fname,mnc_cw_gname(igrid),vtype) |
CALL MNC_VAR_INIT_INT(fname,mnc_cw_gname(igrid),vtype, myThid) |
151 |
#endif |
#endif |
152 |
DO i = 1,mnc_fv_ids(indf,1) |
DO i = 1,mnc_fv_ids(indf,1) |
153 |
j = 2 + 3*(i - 1) |
j = 2 + 3*(i - 1) |
209 |
udo(i) = indu - 1 |
udo(i) = indu - 1 |
210 |
ELSEIF (indu .EQ. -1) THEN |
ELSEIF (indu .EQ. -1) THEN |
211 |
C Append one to the current unlimited dim size |
C Append one to the current unlimited dim size |
212 |
CALL MNC_DIM_UNLIM_SIZE(myThid, fname, unlim_sz) |
CALL MNC_DIM_UNLIM_SIZE( fname, unlim_sz, myThid) |
213 |
udo(i) = unlim_sz |
udo(i) = unlim_sz |
214 |
ELSE |
ELSE |
215 |
C Use the current unlimited dim size |
C Use 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 - 1 |
udo(i) = unlim_sz - 1 |
218 |
ENDIF |
ENDIF |
219 |
ENDIF |
ENDIF |
231 |
CEH3 ENDDO |
CEH3 ENDDO |
232 |
|
|
233 |
C Add the global attributes |
C Add the global attributes |
234 |
CALL MNC_CW_SET_GATTR(myThid, fname, lbi,lbj, uniq_tnum) |
CALL MNC_CW_SET_GATTR( fname, lbi,lbj, uniq_tnum, myThid) |
235 |
|
|
236 |
C Add the per-variable attributes |
C Add the per-variable attributes |
237 |
DO i = 1,mnc_cw_vnat(1,indv) |
DO i = 1,mnc_cw_vnat(1,indv) |
238 |
CALL MNC_VAR_ADD_ATTR_STR(myThid, fname, vtype, |
CALL MNC_VAR_ADD_ATTR_STR( fname, vtype, |
239 |
& mnc_cw_vtnm(i,indv), mnc_cw_vtat(i,indv)) |
& mnc_cw_vtnm(i,indv), mnc_cw_vtat(i,indv), myThid) |
240 |
ENDDO |
ENDDO |
241 |
DO i = 1,mnc_cw_vnat(2,indv) |
DO i = 1,mnc_cw_vnat(2,indv) |
242 |
CALL MNC_VAR_ADD_ATTR_INT(myThid, fname, vtype, |
CALL MNC_VAR_ADD_ATTR_INT( fname, vtype, |
243 |
& mnc_cw_vinm(i,indv), 1, mnc_cw_viat(i,indv)) |
& mnc_cw_vinm(i,indv), 1, mnc_cw_viat(i,indv), myThid) |
244 |
ENDDO |
ENDDO |
245 |
DO i = 1,mnc_cw_vnat(3,indv) |
DO i = 1,mnc_cw_vnat(3,indv) |
246 |
CALL MNC_VAR_ADD_ATTR_DBL(myThid, fname, vtype, |
CALL MNC_VAR_ADD_ATTR_DBL( fname, vtype, |
247 |
& mnc_cw_vdnm(i,indv), 1, mnc_cw_vdat(i,indv)) |
& mnc_cw_vdnm(i,indv), 1, mnc_cw_vdat(i,indv), myThid) |
248 |
ENDDO |
ENDDO |
249 |
|
|
250 |
CALL MNC_FILE_ENDDEF(myThid,fname) |
CALL MNC_FILE_ENDDEF(fname, myThid) |
251 |
|
|
252 |
|
write(msgbuf,'(5a)') 'writing variable type ''', |
253 |
|
& vtype(nvf:nvl), ''' within file ''', |
254 |
|
& fname(1:nfname), '''' |
255 |
|
|
256 |
C Write the variable one vector at a time |
C Write the variable one vector at a time |
257 |
DO j7 = s(7),e(7) |
DO j7 = s(7),e(7) |
299 |
err = NF_PUT_VARA_INT(fid, idv, vstart, vcount, resh) |
err = NF_PUT_VARA_INT(fid, idv, vstart, vcount, resh) |
300 |
#endif |
#endif |
301 |
|
|
302 |
|
CALL MNC_HANDLE_ERR(err, msgbuf, myThid) |
303 |
|
|
304 |
ENDDO |
ENDDO |
305 |
ENDDO |
ENDDO |
306 |
ENDDO |
ENDDO |
312 |
err = NF_SYNC(fid) |
err = NF_SYNC(fid) |
313 |
write(msgbuf,'(3a)') 'sync for file ''', fname, |
write(msgbuf,'(3a)') 'sync for file ''', fname, |
314 |
& ''' in S/R MNC_CW_RX_W_YY' |
& ''' in S/R MNC_CW_RX_W_YY' |
315 |
CALL MNC_HANDLE_ERR(myThid, err, msgbuf) |
CALL MNC_HANDLE_ERR(err, msgbuf, myThid) |
316 |
|
|
317 |
ENDDO |
ENDDO |
318 |
ENDDO |
ENDDO |
327 |
|
|
328 |
|
|
329 |
SUBROUTINE MNC_CW_RX_R_YY( |
SUBROUTINE MNC_CW_RX_R_YY( |
|
I myThid, |
|
330 |
I fbname, bi,bj, |
I fbname, bi,bj, |
331 |
I vtype, |
I vtype, |
332 |
I indu, |
I var, |
333 |
I var ) |
I myThid ) |
334 |
|
|
335 |
implicit none |
implicit none |
336 |
|
|
350 |
integer IFNBLNK, ILNBLNK |
integer IFNBLNK, ILNBLNK |
351 |
|
|
352 |
C Local Variables |
C Local Variables |
353 |
integer i,k, indv,nvf,nvl, n1,n2, igrid, ntot |
integer i,k, nvf,nvl, n1,n2, igrid, ntot |
354 |
integer bis,bie, bjs,bje, uniq_tnum, nfname, fid, idv |
integer bis,bie, bjs,bje, uniq_tnum, nfname, fid, idv |
355 |
integer ndim, indf, err, lbi,lbj, bidim,bjdim, unlim_sz, kr |
integer ndim, indf, err, lbi,lbj, bidim,bjdim, unlim_sz, kr |
356 |
integer ind_fv_ids, ind_vt, ierr, atype, alen |
integer ind_fv_ids, ind_vt, ierr, atype, alen |
357 |
integer f_sNx,f_sNy, ires |
integer f_sNx,f_sNy |
358 |
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) |
359 |
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 |
360 |
character*(MAX_LEN_MBUF) msgbuf |
character*(MAX_LEN_MBUF) msgbuf |
361 |
character*(MNC_MAX_CHAR) fname |
character*(MNC_MAX_CHAR) fname |
362 |
|
integer indfg, fg1,fg2 |
363 |
|
|
364 |
C Temporary storage for the simultaneous type conversion and |
C Temporary storage for the simultaneous type conversion and |
365 |
C re-shaping before passing to NetCDF |
C re-shaping before passing to NetCDF |
376 |
C Only do I/O if I am the master thread |
C Only do I/O if I am the master thread |
377 |
_BEGIN_MASTER( myThid ) |
_BEGIN_MASTER( myThid ) |
378 |
|
|
379 |
|
C Get the current index for the unlimited dimension from the file |
380 |
|
C group (or base) name |
381 |
|
fg1 = IFNBLNK(fbname) |
382 |
|
fg2 = ILNBLNK(fbname) |
383 |
|
CALL MNC_GET_IND(MNC_MAX_ID, fbname, mnc_cw_fgnm, indfg, myThid) |
384 |
|
IF (indfg .LT. 1) THEN |
385 |
|
write(msgbuf,'(3a)') |
386 |
|
& 'MNC_CW_RX_W_YY ERROR: file group name ''', |
387 |
|
& fbname(fg1:fg2), ''' is not defined' |
388 |
|
CALL print_error(msgbuf, mythid) |
389 |
|
STOP 'ABNORMAL END: S/R MNC_CW_RX_W_YY' |
390 |
|
ENDIF |
391 |
|
indu = mnc_cw_fgud(indfg) |
392 |
|
|
393 |
C Check that the Variable Type exists |
C Check that the Variable Type exists |
394 |
nvf = IFNBLNK(vtype) |
nvf = IFNBLNK(vtype) |
395 |
nvl = ILNBLNK(vtype) |
nvl = ILNBLNK(vtype) |
396 |
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) |
397 |
IF (indv .LT. 1) THEN |
IF (ind_vt .LT. 1) THEN |
398 |
write(msgbuf,'(3a)') 'MNC_CW_RX_R_YY ERROR: vtype ''', |
write(msgbuf,'(3a)') 'MNC_CW_RX_R_YY ERROR: vtype ''', |
399 |
& vtype(nvf:nvl), ''' is not defined' |
& vtype(nvf:nvl), ''' is not defined' |
400 |
CALL print_error(msgbuf, mythid) |
CALL print_error(msgbuf, mythid) |
424 |
DO lbi = bis,bie |
DO lbi = bis,bie |
425 |
|
|
426 |
C Create the file name |
C Create the file name |
427 |
CALL MNC_CW_GET_TILE_NUM(myThid, lbi,lbj, uniq_tnum) |
CALL MNC_CW_GET_TILE_NUM( lbi,lbj, uniq_tnum, myThid) |
428 |
fname(1:MNC_MAX_CHAR) = mnc_blank_name(1:MNC_MAX_CHAR) |
fname(1:MNC_MAX_CHAR) = mnc_blank_name(1:MNC_MAX_CHAR) |
429 |
n1 = IFNBLNK(fbname) |
n1 = IFNBLNK(fbname) |
430 |
n2 = ILNBLNK(fbname) |
n2 = ILNBLNK(fbname) |
434 |
fname(ntot:ntot) = '.' |
fname(ntot:ntot) = '.' |
435 |
write(fname((ntot+1):(ntot+9)),'(i6.6,a3)') uniq_tnum, '.nc' |
write(fname((ntot+1):(ntot+9)),'(i6.6,a3)') uniq_tnum, '.nc' |
436 |
nfname = ntot+9 |
nfname = ntot+9 |
|
write(*,*) 'The read file is: ', fname(1:nfname) |
|
437 |
|
|
438 |
C Open the existing file |
C Open the existing file |
439 |
CALL MNC_FILE_TRY_READ(myThid, fname, ierr, indf) |
CALL MNC_FILE_TRY_READ( fname, ierr, indf, myThid) |
440 |
|
|
441 |
C Check that the variable (VType) is defined within the file |
C Check that the variable (VType) is defined within the file |
442 |
CALL MNC_GET_FVINDS(myThid, fname, vtype, indf, ind_fv_ids) |
CALL MNC_GET_FVINDS( fname, vtype, indf, ind_fv_ids, myThid) |
443 |
IF ((indf .LT. 1) .OR. (ind_fv_ids .LT. 1)) THEN |
IF ((indf .LT. 1) .OR. (ind_fv_ids .LT. 1)) THEN |
444 |
write(msgbuf,'(4a)') 'MNC_CW_RX_R_YY ERROR: vtype ''', |
write(msgbuf,'(4a)') 'MNC_CW_RX_R_YY ERROR: vtype ''', |
445 |
& vtype(nvf:nvl), ''' is not defined within file ''', |
& vtype(nvf:nvl), ''' is not defined within file ''', |
450 |
fid = mnc_f_info(indf,2) |
fid = mnc_f_info(indf,2) |
451 |
idv = mnc_fv_ids(indf,ind_fv_ids+1) |
idv = mnc_fv_ids(indf,ind_fv_ids+1) |
452 |
|
|
|
write(*,*) 'indf,ind_fv_ids = ', indf,ind_fv_ids |
|
|
|
|
453 |
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 |
454 |
C are compatible and WARN (only warn) if not |
C are compatible and WARN (only warn) if not |
455 |
f_sNx = -1 |
f_sNx = -1 |
457 |
err = NF_INQ_ATT(fid,NF_GLOBAL, 'sNx',atype,alen) |
err = NF_INQ_ATT(fid,NF_GLOBAL, 'sNx',atype,alen) |
458 |
IF ((err .EQ. NF_NOERR) .AND. (alen .EQ. 1)) THEN |
IF ((err .EQ. NF_NOERR) .AND. (alen .EQ. 1)) THEN |
459 |
err = NF_GET_ATT_INT(fid, NF_GLOBAL, 'sNx', f_sNx) |
err = NF_GET_ATT_INT(fid, NF_GLOBAL, 'sNx', f_sNx) |
460 |
CALL MNC_HANDLE_ERR(myThid, err, |
CALL MNC_HANDLE_ERR(err, |
461 |
& 'reading attribute ''sNx'' in S/R MNC_CW_RX_R_YY') |
& 'reading attribute ''sNx'' in S/R MNC_CW_RX_R_YY', |
462 |
|
& myThid) |
463 |
ENDIF |
ENDIF |
464 |
err = NF_INQ_ATT(fid,NF_GLOBAL, 'sNy',atype,alen) |
err = NF_INQ_ATT(fid,NF_GLOBAL, 'sNy',atype,alen) |
465 |
IF ((err .EQ. NF_NOERR) .AND. (alen .EQ. 1)) THEN |
IF ((err .EQ. NF_NOERR) .AND. (alen .EQ. 1)) THEN |
466 |
err = NF_GET_ATT_INT(fid, NF_GLOBAL, 'sNy', f_sNy) |
err = NF_GET_ATT_INT(fid, NF_GLOBAL, 'sNy', f_sNy) |
467 |
CALL MNC_HANDLE_ERR(myThid, err, |
CALL MNC_HANDLE_ERR(err, |
468 |
& 'reading attribute ''sNy'' in S/R MNC_CW_RX_R_YY') |
& 'reading attribute ''sNy'' in S/R MNC_CW_RX_R_YY', |
469 |
|
& myThid) |
470 |
ENDIF |
ENDIF |
471 |
IF ((f_sNx .NE. sNx) .OR. (f_sNy .NE. sNy)) THEN |
IF ((f_sNx .NE. sNx) .OR. (f_sNy .NE. sNy)) THEN |
472 |
write(msgbuf,'(5a)') 'MNC_CW_RX_R_YY WARNING: the ', |
write(msgbuf,'(5a)') 'MNC_CW_RX_R_YY WARNING: the ', |
478 |
|
|
479 |
C Check that the in-memory variable and the in-file variables |
C Check that the in-memory variable and the in-file variables |
480 |
C are of compatible sizes |
C are of compatible sizes |
481 |
ires = 1 |
C ires = 1 |
482 |
CALL MNC_CHK_VTYP_R_NCVAR(myThid, ind_vt, |
C CALL MNC_CHK_VTYP_R_NCVAR( ind_vt, |
483 |
& indf, ind_fv_ids, indu, ires) |
C & indf, ind_fv_ids, indu, ires) |
484 |
IF (ires .LT. 0) THEN |
C IF (ires .LT. 0) THEN |
485 |
write(msgbuf,'(7a)') 'MNC_CW_RX_R_YY WARNING: the sizes ', |
C write(msgbuf,'(7a)') 'MNC_CW_RX_R_YY WARNING: the sizes ', |
486 |
& 'of the in-program variable ''', vtype(nvf:nvl), |
C & 'of the in-program variable ''', vtype(nvf:nvl), |
487 |
& ''' and the corresponding variable within file ''', |
C & ''' and the corresponding variable within file ''', |
488 |
& fname(1:nfname), ''' are not compatible -- please ', |
C & fname(1:nfname), ''' are not compatible -- please ', |
489 |
& 'check the sizes' |
C & 'check the sizes' |
490 |
CALL print_error(msgbuf, mythid) |
C CALL print_error(msgbuf, mythid) |
491 |
STOP 'ABNORMAL END: S/R MNC_CW_RX_R_YY' |
C STOP 'ABNORMAL END: S/R MNC_CW_RX_R_YY' |
492 |
ENDIF |
C ENDIF |
493 |
|
|
494 |
C Check for bi,bj indicies |
C Check for bi,bj indicies |
495 |
bidim = mnc_cw_vbij(1,ind_vt) |
bidim = mnc_cw_vbij(1,ind_vt) |
496 |
bjdim = mnc_cw_vbij(2,ind_vt) |
bjdim = mnc_cw_vbij(2,ind_vt) |
|
write(*,*) 'bidim,bjdim = ', bidim,bjdim |
|
497 |
|
|
498 |
C Set the dimensions for the in-memory array |
C Set the dimensions for the in-memory array |
499 |
ndim = mnc_cw_ndim(igrid) |
ndim = mnc_cw_ndim(igrid) |
535 |
udo(i) = indu - 1 |
udo(i) = indu - 1 |
536 |
ELSEIF (indu .EQ. -1) THEN |
ELSEIF (indu .EQ. -1) THEN |
537 |
C Append one to the current unlimited dim size |
C Append one to the current unlimited dim size |
538 |
CALL MNC_DIM_UNLIM_SIZE(myThid, fname, unlim_sz) |
CALL MNC_DIM_UNLIM_SIZE( fname, unlim_sz, myThid) |
539 |
udo(i) = unlim_sz |
udo(i) = unlim_sz |
540 |
ELSE |
ELSE |
541 |
C Use the current unlimited dim size |
C Use 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 - 1 |
udo(i) = unlim_sz - 1 |
544 |
ENDIF |
ENDIF |
545 |
ENDIF |
ENDIF |
553 |
e(bjdim) = lbj |
e(bjdim) = lbj |
554 |
ENDIF |
ENDIF |
555 |
|
|
556 |
DO i = 9,1,-1 |
C DO i = 9,1,-1 |
557 |
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) |
558 |
ENDDO |
C ENDDO |
559 |
|
|
560 |
CALL MNC_FILE_ENDDEF(myThid,fname) |
CALL MNC_FILE_ENDDEF(fname, myThid) |
561 |
|
|
562 |
write(msgbuf,'(5a)') 'reading variable type ''', |
write(msgbuf,'(5a)') 'reading variable type ''', |
563 |
& vtype(nvf:nvl), ''' within file ''', |
& vtype(nvf:nvl), ''' within file ''', |
602 |
err = NF_GET_VARA_INT(fid, idv, vstart, vcount, resh) |
err = NF_GET_VARA_INT(fid, idv, vstart, vcount, resh) |
603 |
#endif |
#endif |
604 |
|
|
605 |
CALL MNC_HANDLE_ERR(myThid, err, msgbuf) |
CALL MNC_HANDLE_ERR(err, msgbuf, myThid) |
606 |
|
|
607 |
kr = 0 |
kr = 0 |
608 |
DO j1 = s(1),e(1) |
DO j1 = s(1),e(1) |
619 |
ENDDO |
ENDDO |
620 |
ENDDO |
ENDDO |
621 |
|
|
622 |
|
C Close the file |
623 |
|
CALL MNC_FILE_CLOSE(fname, myThid) |
624 |
|
|
625 |
C End the lbj,lbi loops |
C End the lbj,lbi loops |
626 |
ENDDO |
ENDDO |
627 |
ENDDO |
ENDDO |