93 |
#include "netcdf.inc" |
#include "netcdf.inc" |
94 |
#include "mnc_common.h" |
#include "mnc_common.h" |
95 |
#include "SIZE.h" |
#include "SIZE.h" |
96 |
|
#include "MNC_SIZE.h" |
97 |
#include "EEPARAMS.h" |
#include "EEPARAMS.h" |
98 |
#include "PARAMS.h" |
#include "PARAMS.h" |
99 |
#include "MNC_PARAMS.h" |
#include "MNC_PARAMS.h" |
117 |
character*(MAX_LEN_MBUF) msgbuf |
character*(MAX_LEN_MBUF) msgbuf |
118 |
character*(MNC_MAX_CHAR) fname |
character*(MNC_MAX_CHAR) fname |
119 |
character*(MNC_MAX_CHAR) path_fname |
character*(MNC_MAX_CHAR) path_fname |
120 |
REAL*8 resh_d( sNx + 2*OLx + sNy + 2*OLy ) |
REAL*8 resh_d( MNC_MAX_BUFF ) |
121 |
REAL*4 resh_r( sNx + 2*OLx + sNy + 2*OLy ) |
REAL*4 resh_r( MNC_MAX_BUFF ) |
122 |
INTEGER resh_i( sNx + 2*OLx + sNy + 2*OLy ) |
INTEGER resh_i( MNC_MAX_BUFF ) |
123 |
|
#ifdef HAVE_STAT |
124 |
|
integer ntotenc, ncenc, nbytes, fs_isdone |
125 |
|
character*(200) cenc |
126 |
|
integer ienc(200) |
127 |
|
REAL*8 fsnu |
128 |
|
#endif |
129 |
|
|
130 |
C Functions |
C Functions |
131 |
integer IFNBLNK, ILNBLNK |
integer IFNBLNK, ILNBLNK |
147 |
ENDIF |
ENDIF |
148 |
indu = mnc_cw_fgud(indfg) |
indu = mnc_cw_fgud(indfg) |
149 |
iseq = mnc_cw_fgis(indfg) |
iseq = mnc_cw_fgis(indfg) |
150 |
|
C write(*,*) 'indu,iseq = ', indu, iseq |
151 |
|
|
152 |
C Check that the Variable Type exists |
C Check that the Variable Type exists |
153 |
nvf = IFNBLNK(vtype) |
nvf = IFNBLNK(vtype) |
178 |
DO lbj = bjs,bje |
DO lbj = bjs,bje |
179 |
DO lbi = bis,bie |
DO lbi = bis,bie |
180 |
|
|
181 |
|
#ifdef HAVE_STAT |
182 |
|
fs_isdone = 0 |
183 |
|
#endif |
184 |
|
10 CONTINUE |
185 |
|
|
186 |
C Create the file name |
C Create the file name |
187 |
CALL MNC_CW_GET_TILE_NUM(lbi,lbj, uniq_tnum, myThid) |
CALL MNC_CW_GET_TILE_NUM(lbi,lbj, uniq_tnum, myThid) |
188 |
fname(1:MNC_MAX_CHAR) = mnc_blank_name(1:MNC_MAX_CHAR) |
fname(1:MNC_MAX_CHAR) = mnc_blank_name(1:MNC_MAX_CHAR) |
210 |
CALL MNC_CW_FILE_AORC(fname, indf, myThid) |
CALL MNC_CW_FILE_AORC(fname, indf, myThid) |
211 |
fid = mnc_f_info(indf,2) |
fid = mnc_f_info(indf,2) |
212 |
|
|
213 |
|
#ifdef HAVE_STAT |
214 |
|
IF ((mnc_cw_fgig(indfg) .EQ. 1) |
215 |
|
& .AND. (fs_isdone .EQ. 0)) THEN |
216 |
|
C Decide whether to append to the existing or create a new file |
217 |
|
C based on the byte count per unlimited dimension |
218 |
|
ncenc = 70 |
219 |
|
cenc(1:26) = 'abcdefghijklmnopqrstuvwxyz' |
220 |
|
cenc(27:52) = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' |
221 |
|
cenc(53:70) = '0123456789_.,+-=/~' |
222 |
|
k = nfname |
223 |
|
IF (k .GT. 200) k = 200 |
224 |
|
ntotenc = 0 |
225 |
|
DO i = 1,k |
226 |
|
DO j = 1,ncenc |
227 |
|
IF (fname(i:i) .EQ. cenc(j:j)) THEN |
228 |
|
ntotenc = ntotenc + 1 |
229 |
|
ienc(ntotenc) = j |
230 |
|
GOTO 20 |
231 |
|
ENDIF |
232 |
|
ENDDO |
233 |
|
20 CONTINUE |
234 |
|
ENDDO |
235 |
|
CALL mncfsize(ntotenc, ienc, nbytes) |
236 |
|
IF (nbytes .GT. 0) THEN |
237 |
|
CALL MNC_DIM_UNLIM_SIZE(fname, unlim_sz, myThid) |
238 |
|
fsnu = (1.0 _d 0 + 1.0 _d 0 / DBLE(unlim_sz)) |
239 |
|
& * DBLE(nbytes) |
240 |
|
IF (fsnu .GT. mnc_max_fsize) THEN |
241 |
|
iseq = iseq + 1 |
242 |
|
indu = 1 |
243 |
|
mnc_cw_fgud(indfg) = 1 |
244 |
|
mnc_cw_fgis(indfg) = iseq |
245 |
|
fs_isdone = 1 |
246 |
|
GOTO 10 |
247 |
|
ENDIF |
248 |
|
ENDIF |
249 |
|
ENDIF |
250 |
|
#endif /* HAVE_STAT */ |
251 |
|
|
252 |
C Ensure that all the NetCDF dimensions are defined and create a |
C Ensure that all the NetCDF dimensions are defined and create a |
253 |
C local copy of them |
C local copy of them |
254 |
DO i = 1,9 |
DO i = 1,9 |
285 |
idv = mnc_fv_ids(indf,j+1) |
idv = mnc_fv_ids(indf,j+1) |
286 |
indvids = mnc_fd_ind(indf, mnc_f_info(indf, |
indvids = mnc_fd_ind(indf, mnc_f_info(indf, |
287 |
& (mnc_fv_ids(indf,j+2) + 1)) ) |
& (mnc_fv_ids(indf,j+2) + 1)) ) |
288 |
GOTO 10 |
GOTO 30 |
289 |
ENDIF |
ENDIF |
290 |
ENDDO |
ENDDO |
291 |
write(msgbuf,'(4a)') 'MNC_MNC_CW_RX_W ERROR: ', |
write(msgbuf,'(4a)') 'MNC_MNC_CW_RX_W ERROR: ', |
292 |
& 'cannot reference variable ''', vtype, '''' |
& 'cannot reference variable ''', vtype, '''' |
293 |
CALL print_error(msgbuf, mythid) |
CALL print_error(msgbuf, mythid) |
294 |
STOP 'ABNORMAL END: package MNC' |
STOP 'ABNORMAL END: package MNC' |
295 |
10 CONTINUE |
30 CONTINUE |
296 |
|
|
297 |
C Check for bi,bj indicies |
C Check for bi,bj indicies |
298 |
bidim = mnc_cw_vbij(1,indv) |
bidim = mnc_cw_vbij(1,indv) |
428 |
vstart(1) = udo(1) + 1 |
vstart(1) = udo(1) + 1 |
429 |
vcount(1) = e(1) - s(1) + 1 |
vcount(1) = e(1) - s(1) + 1 |
430 |
|
|
431 |
|
IF (vcount(1) .GT. MNC_MAX_BUFF) THEN |
432 |
|
write(msgbuf,'(2a,I7,a)') 'MNC_MAX_BUFF is too small', |
433 |
|
& '--please increase to at least ', |
434 |
|
& vcount(1), ' in ''MNC_SIZE.h''' |
435 |
|
CALL PRINT_ERROR(msgBuf , 1) |
436 |
|
STOP 'ABNORMAL END: S/R MNC_CW_RX_W_OFFSET' |
437 |
|
ENDIF |
438 |
|
|
439 |
IF (stype(1:1) .EQ. 'D') THEN |
IF (stype(1:1) .EQ. 'D') THEN |
440 |
DO j1 = s(1),e(1) |
DO j1 = s(1),e(1) |
441 |
k1 = k2 + j1 |
k1 = k2 + j1 |
539 |
#include "netcdf.inc" |
#include "netcdf.inc" |
540 |
#include "mnc_common.h" |
#include "mnc_common.h" |
541 |
#include "SIZE.h" |
#include "SIZE.h" |
542 |
|
#include "MNC_SIZE.h" |
543 |
#include "EEPARAMS.h" |
#include "EEPARAMS.h" |
544 |
#include "PARAMS.h" |
#include "PARAMS.h" |
545 |
#include "MNC_PARAMS.h" |
#include "MNC_PARAMS.h" |
562 |
character*(MNC_MAX_CHAR) fname |
character*(MNC_MAX_CHAR) fname |
563 |
character*(MNC_MAX_CHAR) path_fname |
character*(MNC_MAX_CHAR) path_fname |
564 |
integer indfg, fg1,fg2 |
integer indfg, fg1,fg2 |
565 |
REAL*8 resh_d( sNx + 2*OLx + sNy + 2*OLy ) |
REAL*8 resh_d( MNC_MAX_BUFF ) |
566 |
REAL*4 resh_r( sNx + 2*OLx + sNy + 2*OLy ) |
REAL*4 resh_r( MNC_MAX_BUFF ) |
567 |
INTEGER resh_i( sNx + 2*OLx + sNy + 2*OLy ) |
INTEGER resh_i( MNC_MAX_BUFF ) |
568 |
|
|
569 |
C Functions |
C Functions |
570 |
integer IFNBLNK, ILNBLNK |
integer IFNBLNK, ILNBLNK |
798 |
kr = 0 |
kr = 0 |
799 |
vstart(1) = udo(1) + 1 |
vstart(1) = udo(1) + 1 |
800 |
vcount(1) = e(1) - s(1) + 1 |
vcount(1) = e(1) - s(1) + 1 |
801 |
|
|
802 |
|
IF (vcount(1) .GT. MNC_MAX_BUFF) THEN |
803 |
|
write(msgbuf,'(2a,I7,a)') 'MNC_MAX_BUFF is too small', |
804 |
|
& '--please increase to at least ', |
805 |
|
& vcount(1), ' in ''MNC_SIZE.h''' |
806 |
|
CALL PRINT_ERROR(msgBuf , 1) |
807 |
|
STOP 'ABNORMAL END: S/R MNC_CW_RX_R_OFFSET' |
808 |
|
ENDIF |
809 |
|
|
810 |
IF (stype(1:1) .EQ. 'D') THEN |
IF (stype(1:1) .EQ. 'D') THEN |
811 |
err = NF_GET_VARA_DOUBLE(fid, idv, vstart, vcount, resh_d) |
err = NF_GET_VARA_DOUBLE(fid, idv, vstart, vcount, resh_d) |
812 |
CALL MNC_HANDLE_ERR(err, msgbuf, myThid) |
CALL MNC_HANDLE_ERR(err, msgbuf, myThid) |