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) |
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 |
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 |
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) |
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 |
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) |
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 |
|
|
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 |