4 |
#include "MNC_OPTIONS.h" |
#include "MNC_OPTIONS.h" |
5 |
|
|
6 |
C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----| |
C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----| |
7 |
|
CBOP 0 |
8 |
|
C !ROUTINE: MNC_CW_RX_W |
9 |
|
|
10 |
SUBROUTINE MNC_CW_RX_W_YY( |
C !INTERFACE: |
11 |
|
SUBROUTINE MNC_CW_RX_W( |
12 |
|
I stype, |
13 |
I fbname, bi,bj, |
I fbname, bi,bj, |
14 |
I vtype, |
I vtype, |
15 |
I var, |
I var, |
16 |
I myThid ) |
I myThid ) |
17 |
|
|
18 |
|
C !DESCRIPTION: |
19 |
|
C This subroutine writes one variable to a file or a file group, |
20 |
|
C depending upon the tile indicies. |
21 |
|
|
22 |
|
C !USES: |
23 |
implicit none |
implicit none |
|
|
|
24 |
#include "netcdf.inc" |
#include "netcdf.inc" |
25 |
#include "mnc_common.h" |
#include "mnc_common.h" |
26 |
#include "SIZE.h" |
#include "SIZE.h" |
27 |
#include "EEPARAMS.h" |
#include "EEPARAMS.h" |
28 |
#include "PARAMS.h" |
#include "PARAMS.h" |
29 |
|
#include "MNC_PARAMS.h" |
30 |
|
|
31 |
#define mnc_rtype_YY |
C !INPUT PARAMETERS: |
|
|
|
|
C Arguments |
|
32 |
integer myThid, bi,bj, indu |
integer myThid, bi,bj, indu |
33 |
character*(*) fbname, vtype |
character*(*) stype, fbname, vtype |
34 |
__V var(*) |
__V var(*) |
35 |
|
CEOP |
36 |
|
|
37 |
C Functions |
C !LOCAL VARIABLES: |
|
integer IFNBLNK, ILNBLNK |
|
|
|
|
|
C Local Variables |
|
38 |
integer i,j,k, indv,nvf,nvl, n1,n2, igrid, ntot |
integer i,j,k, indv,nvf,nvl, n1,n2, igrid, ntot |
39 |
integer bis,bie, bjs,bje, uniq_tnum, nfname, fid, idv, indvids |
integer bis,bie, bjs,bje, uniq_tnum, nfname |
40 |
integer ndim, indf, err, lbi,lbj, bidim,bjdim, unlim_sz, kr |
integer fid, idv, indvids, ndim, indf, err |
41 |
integer p(9),s(9),e(9), dimnc(9), vstart(9),vcount(9), udo(9) |
integer lbi,lbj, bidim,bjdim, unlim_sz, kr |
42 |
|
integer p(9),s(9),e(9), dimnc(9) |
43 |
|
integer vstart(9),vcount(9), udo(9) |
44 |
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 |
45 |
integer indfg, fg1,fg2, npath |
integer indfg, fg1,fg2, npath |
46 |
character*(MAX_LEN_MBUF) msgbuf |
character*(MAX_LEN_MBUF) msgbuf |
47 |
character*(MNC_MAX_CHAR) fname |
character*(MNC_MAX_CHAR) fname |
48 |
character*(MNC_MAX_CHAR) path_fname |
character*(MNC_MAX_CHAR) path_fname |
49 |
|
REAL*8 resh_d( sNx + 2*OLx + sNy + 2*OLy ) |
50 |
|
REAL*4 resh_r( sNx + 2*OLx + sNy + 2*OLy ) |
51 |
|
INTEGER resh_i( sNx + 2*OLx + sNy + 2*OLy ) |
52 |
|
|
53 |
C Temporary storage for the simultaneous type conversion and |
C Functions |
54 |
C re-shaping before passing to NetCDF |
integer IFNBLNK, ILNBLNK |
|
#ifdef mnc_rtype_D |
|
|
REAL*8 resh( sNx + 2*OLx + sNy + 2*OLy ) |
|
|
#endif |
|
|
#ifdef mnc_rtype_R |
|
|
REAL*4 resh( sNx + 2*OLx + sNy + 2*OLy ) |
|
|
#endif |
|
|
#ifdef mnc_rtype_I |
|
|
INTEGER resh( sNx + 2*OLx + sNy + 2*OLy ) |
|
|
#endif |
|
55 |
|
|
56 |
C Only do I/O if I am the master thread |
C Only do I/O if I am the master thread |
57 |
_BEGIN_MASTER( myThid ) |
_BEGIN_MASTER( myThid ) |
63 |
CALL MNC_GET_IND(MNC_MAX_ID, fbname, mnc_cw_fgnm, indfg, myThid) |
CALL MNC_GET_IND(MNC_MAX_ID, fbname, mnc_cw_fgnm, indfg, myThid) |
64 |
IF (indfg .LT. 1) THEN |
IF (indfg .LT. 1) THEN |
65 |
write(msgbuf,'(3a)') |
write(msgbuf,'(3a)') |
66 |
& 'MNC_CW_RX_W_YY ERROR: file group name ''', |
& 'MNC_CW_RX_W ERROR: file group name ''', |
67 |
& fbname(fg1:fg2), ''' is not defined' |
& fbname(fg1:fg2), ''' is not defined' |
68 |
CALL print_error(msgbuf, mythid) |
CALL print_error(msgbuf, mythid) |
69 |
STOP 'ABNORMAL END: S/R MNC_CW_RX_W_YY' |
STOP 'ABNORMAL END: S/R MNC_CW_RX_W' |
70 |
ENDIF |
ENDIF |
71 |
indu = mnc_cw_fgud(indfg) |
indu = mnc_cw_fgud(indfg) |
72 |
|
|
75 |
nvl = ILNBLNK(vtype) |
nvl = ILNBLNK(vtype) |
76 |
CALL MNC_GET_IND(MNC_MAX_ID, vtype, mnc_cw_vname, indv, myThid) |
CALL MNC_GET_IND(MNC_MAX_ID, vtype, mnc_cw_vname, indv, myThid) |
77 |
IF (indv .LT. 1) THEN |
IF (indv .LT. 1) THEN |
78 |
write(msgbuf,'(3a)') 'MNC_CW_RX_W_YY ERROR: vtype ''', |
write(msgbuf,'(3a)') 'MNC_CW_RX_W ERROR: vtype ''', |
79 |
& vtype(nvf:nvl), ''' is not defined' |
& vtype(nvf:nvl), ''' is not defined' |
80 |
CALL print_error(msgbuf, mythid) |
CALL print_error(msgbuf, mythid) |
81 |
STOP 'ABNORMAL END: S/R MNC_CW_RX_W_YY' |
STOP 'ABNORMAL END: S/R MNC_CW_RX_W' |
82 |
ENDIF |
ENDIF |
83 |
igrid = mnc_cw_vgind(indv) |
igrid = mnc_cw_vgind(indv) |
84 |
|
|
116 |
path_fname(1:MNC_MAX_CHAR) = mnc_blank_name(1:MNC_MAX_CHAR) |
path_fname(1:MNC_MAX_CHAR) = mnc_blank_name(1:MNC_MAX_CHAR) |
117 |
npath = ILNBLNK(mnc_out_path) |
npath = ILNBLNK(mnc_out_path) |
118 |
path_fname(1:npath) = mnc_out_path(1:npath) |
path_fname(1:npath) = mnc_out_path(1:npath) |
119 |
path_fname((npath+1):(npath+1+nfname)) = fname(1:nfname) |
path_fname((npath+1):(npath+nfname)) = fname(1:nfname) |
120 |
fname(1:MNC_MAX_CHAR) = path_fname(1:MNC_MAX_CHAR) |
fname(1:MNC_MAX_CHAR) = path_fname(1:MNC_MAX_CHAR) |
121 |
nfname = npath + 1 + nfname |
nfname = npath + nfname |
122 |
ENDIF |
ENDIF |
123 |
|
|
124 |
C Append to an existing or create a new file |
C Append to an existing or create a new file |
145 |
& mnc_cw_ndim(igrid), mnc_cw_dn(1,igrid), myThid) |
& mnc_cw_ndim(igrid), mnc_cw_dn(1,igrid), myThid) |
146 |
|
|
147 |
C Ensure that the variable is defined |
C Ensure that the variable is defined |
148 |
#ifdef mnc_rtype_D |
IF (stype(1:1) .EQ. 'D') |
149 |
CALL MNC_VAR_INIT_DBL(fname,mnc_cw_gname(igrid),vtype, myThid) |
& CALL MNC_VAR_INIT_DBL( |
150 |
#endif |
& fname, mnc_cw_gname(igrid), vtype, myThid) |
151 |
#ifdef mnc_rtype_R |
IF (stype(1:1) .EQ. 'R') |
152 |
CALL MNC_VAR_INIT_REAL(fname,mnc_cw_gname(igrid),vtype, myThid) |
& CALL MNC_VAR_INIT_REAL( |
153 |
#endif |
& fname, mnc_cw_gname(igrid), vtype, myThid) |
154 |
#ifdef mnc_rtype_I |
IF (stype(1:1) .EQ. 'I') |
155 |
CALL MNC_VAR_INIT_INT(fname,mnc_cw_gname(igrid),vtype, myThid) |
& CALL MNC_VAR_INIT_INT( |
156 |
#endif |
& fname, mnc_cw_gname(igrid), vtype, myThid) |
157 |
|
|
158 |
DO i = 1,mnc_fv_ids(indf,1) |
DO i = 1,mnc_fv_ids(indf,1) |
159 |
j = 2 + 3*(i - 1) |
j = 2 + 3*(i - 1) |
160 |
IF (mnc_v_names(mnc_fv_ids(indf,j)) .EQ. vtype) THEN |
IF (mnc_v_names(mnc_fv_ids(indf,j)) .EQ. vtype) THEN |
164 |
GOTO 10 |
GOTO 10 |
165 |
ENDIF |
ENDIF |
166 |
ENDDO |
ENDDO |
167 |
write(msgbuf,'(4a)') 'MNC_MNC_CW_RX_W_YY ERROR: ', |
write(msgbuf,'(4a)') 'MNC_MNC_CW_RX_W ERROR: ', |
168 |
& 'cannot reference variable ''', vtype, '''' |
& 'cannot reference variable ''', vtype, '''' |
169 |
CALL print_error(msgbuf, mythid) |
CALL print_error(msgbuf, mythid) |
170 |
STOP 'ABNORMAL END: package MNC' |
STOP 'ABNORMAL END: package MNC' |
286 |
vcount(2) = 1 |
vcount(2) = 1 |
287 |
|
|
288 |
kr = 0 |
kr = 0 |
|
DO j1 = s(1),e(1) |
|
|
k1 = k2 + j1 |
|
|
kr = kr + 1 |
|
|
resh(kr) = var(k1) |
|
|
ENDDO |
|
|
|
|
289 |
vstart(1) = udo(1) + 1 |
vstart(1) = udo(1) + 1 |
290 |
vcount(1) = e(1) - s(1) + 1 |
vcount(1) = e(1) - s(1) + 1 |
291 |
|
|
292 |
#ifdef mnc_rtype_D |
IF (stype(1:1) .EQ. 'D') THEN |
293 |
err = NF_PUT_VARA_DOUBLE(fid, idv, vstart, vcount, resh) |
DO j1 = s(1),e(1) |
294 |
#endif |
k1 = k2 + j1 |
295 |
#ifdef mnc_rtype_R |
kr = kr + 1 |
296 |
err = NF_PUT_VARA_REAL(fid, idv, vstart, vcount, resh) |
resh_d(kr) = var(k1) |
297 |
#endif |
ENDDO |
298 |
#ifdef mnc_rtype_I |
err = NF_PUT_VARA_DOUBLE(fid, idv, vstart, vcount, resh_d) |
299 |
err = NF_PUT_VARA_INT(fid, idv, vstart, vcount, resh) |
ENDIF |
300 |
#endif |
IF (stype(1:1) .EQ. 'R') THEN |
301 |
|
DO j1 = s(1),e(1) |
302 |
|
k1 = k2 + j1 |
303 |
|
kr = kr + 1 |
304 |
|
resh_r(kr) = var(k1) |
305 |
|
ENDDO |
306 |
|
err = NF_PUT_VARA_REAL(fid, idv, vstart, vcount, resh_r) |
307 |
|
ENDIF |
308 |
|
IF (stype(1:1) .EQ. 'I') THEN |
309 |
|
DO j1 = s(1),e(1) |
310 |
|
k1 = k2 + j1 |
311 |
|
kr = kr + 1 |
312 |
|
resh_i(kr) = var(k1) |
313 |
|
ENDDO |
314 |
|
err = NF_PUT_VARA_INT(fid, idv, vstart, vcount, resh_i) |
315 |
|
ENDIF |
316 |
|
|
317 |
CALL MNC_HANDLE_ERR(err, msgbuf, myThid) |
CALL MNC_HANDLE_ERR(err, msgbuf, myThid) |
318 |
|
|
326 |
C Sync the file |
C Sync the file |
327 |
err = NF_SYNC(fid) |
err = NF_SYNC(fid) |
328 |
write(msgbuf,'(3a)') 'sync for file ''', fname, |
write(msgbuf,'(3a)') 'sync for file ''', fname, |
329 |
& ''' in S/R MNC_CW_RX_W_YY' |
& ''' in S/R MNC_CW_RX_W' |
330 |
CALL MNC_HANDLE_ERR(err, msgbuf, myThid) |
CALL MNC_HANDLE_ERR(err, msgbuf, myThid) |
331 |
|
|
332 |
ENDDO |
ENDDO |
339 |
|
|
340 |
|
|
341 |
C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----| |
C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----| |
342 |
|
CBOP 0 |
343 |
|
C !ROUTINE: MNC_CW_RX_R |
344 |
|
|
345 |
|
C !INTERFACE: |
346 |
SUBROUTINE MNC_CW_RX_R_YY( |
SUBROUTINE MNC_CW_RX_R( |
347 |
|
I stype, |
348 |
I fbname, bi,bj, |
I fbname, bi,bj, |
349 |
I vtype, |
I vtype, |
350 |
I var, |
I var, |
351 |
I myThid ) |
I myThid ) |
352 |
|
|
353 |
|
C !DESCRIPTION: |
354 |
|
C This subroutine reads one variable from a file or a file group, |
355 |
|
C depending upon the tile indicies. |
356 |
|
|
357 |
|
C !USES: |
358 |
implicit none |
implicit none |
|
|
|
359 |
#include "netcdf.inc" |
#include "netcdf.inc" |
360 |
#include "mnc_common.h" |
#include "mnc_common.h" |
|
#include "EEPARAMS.h" |
|
361 |
#include "SIZE.h" |
#include "SIZE.h" |
362 |
|
#include "EEPARAMS.h" |
363 |
|
#include "PARAMS.h" |
364 |
|
#include "MNC_PARAMS.h" |
365 |
|
|
366 |
#define mnc_rtype_YY |
C !INPUT PARAMETERS: |
|
|
|
|
C Arguments |
|
367 |
integer myThid, bi,bj, indu |
integer myThid, bi,bj, indu |
368 |
character*(*) fbname, vtype |
character*(*) stype, fbname, vtype |
369 |
__V var(*) |
__V var(*) |
370 |
|
CEOP |
371 |
|
|
372 |
C Functions |
C !LOCAL VARIABLES: |
|
integer IFNBLNK, ILNBLNK |
|
|
|
|
|
C Local Variables |
|
373 |
integer i,k, nvf,nvl, n1,n2, igrid, ntot |
integer i,k, nvf,nvl, n1,n2, igrid, ntot |
374 |
integer bis,bie, bjs,bje, uniq_tnum, nfname, fid, idv |
integer bis,bie, bjs,bje, uniq_tnum, nfname, fid, idv |
375 |
integer ndim, indf, err, lbi,lbj, bidim,bjdim, unlim_sz, kr |
integer ndim, indf, err, lbi,lbj, bidim,bjdim, unlim_sz, kr |
376 |
integer ind_fv_ids, ind_vt, ierr, atype, alen |
integer ind_fv_ids, ind_vt, ierr, atype, alen |
377 |
integer f_sNx,f_sNy |
integer f_sNx,f_sNy, npath |
378 |
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) |
379 |
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 |
380 |
character*(MAX_LEN_MBUF) msgbuf |
character*(MAX_LEN_MBUF) msgbuf |
381 |
character*(MNC_MAX_CHAR) fname |
character*(MNC_MAX_CHAR) fname |
382 |
|
character*(MNC_MAX_CHAR) path_fname |
383 |
integer indfg, fg1,fg2 |
integer indfg, fg1,fg2 |
384 |
|
REAL*8 resh_d( sNx + 2*OLx + sNy + 2*OLy ) |
385 |
|
REAL*4 resh_r( sNx + 2*OLx + sNy + 2*OLy ) |
386 |
|
INTEGER resh_i( sNx + 2*OLx + sNy + 2*OLy ) |
387 |
|
|
388 |
C Temporary storage for the simultaneous type conversion and |
C Functions |
389 |
C re-shaping before passing to NetCDF |
integer IFNBLNK, ILNBLNK |
|
#ifdef mnc_rtype_D |
|
|
REAL*8 resh( sNx + 2*OLx + sNy + 2*OLy ) |
|
|
#endif |
|
|
#ifdef mnc_rtype_R |
|
|
REAL*4 resh( sNx + 2*OLx + sNy + 2*OLy ) |
|
|
#endif |
|
|
#ifdef mnc_rtype_I |
|
|
INTEGER resh( sNx + 2*OLx + sNy + 2*OLy ) |
|
|
#endif |
|
390 |
|
|
391 |
C Only do I/O if I am the master thread |
C Only do I/O if I am the master thread |
392 |
_BEGIN_MASTER( myThid ) |
_BEGIN_MASTER( myThid ) |
398 |
CALL MNC_GET_IND(MNC_MAX_ID, fbname, mnc_cw_fgnm, indfg, myThid) |
CALL MNC_GET_IND(MNC_MAX_ID, fbname, mnc_cw_fgnm, indfg, myThid) |
399 |
IF (indfg .LT. 1) THEN |
IF (indfg .LT. 1) THEN |
400 |
write(msgbuf,'(3a)') |
write(msgbuf,'(3a)') |
401 |
& 'MNC_CW_RX_W_YY ERROR: file group name ''', |
& 'MNC_CW_RX_W ERROR: file group name ''', |
402 |
& fbname(fg1:fg2), ''' is not defined' |
& fbname(fg1:fg2), ''' is not defined' |
403 |
CALL print_error(msgbuf, mythid) |
CALL print_error(msgbuf, mythid) |
404 |
STOP 'ABNORMAL END: S/R MNC_CW_RX_W_YY' |
STOP 'ABNORMAL END: S/R MNC_CW_RX_W' |
405 |
ENDIF |
ENDIF |
406 |
indu = mnc_cw_fgud(indfg) |
indu = mnc_cw_fgud(indfg) |
407 |
|
|
410 |
nvl = ILNBLNK(vtype) |
nvl = ILNBLNK(vtype) |
411 |
CALL MNC_GET_IND( MNC_MAX_ID, vtype, mnc_cw_vname, ind_vt, myThid) |
CALL MNC_GET_IND( MNC_MAX_ID, vtype, mnc_cw_vname, ind_vt, myThid) |
412 |
IF (ind_vt .LT. 1) THEN |
IF (ind_vt .LT. 1) THEN |
413 |
write(msgbuf,'(3a)') 'MNC_CW_RX_R_YY ERROR: vtype ''', |
write(msgbuf,'(3a)') 'MNC_CW_RX_R ERROR: vtype ''', |
414 |
& vtype(nvf:nvl), ''' is not defined' |
& vtype(nvf:nvl), ''' is not defined' |
415 |
CALL print_error(msgbuf, mythid) |
CALL print_error(msgbuf, mythid) |
416 |
STOP 'ABNORMAL END: S/R MNC_CW_RX_R_YY' |
STOP 'ABNORMAL END: S/R MNC_CW_RX_R' |
417 |
ENDIF |
ENDIF |
418 |
igrid = mnc_cw_vgind(ind_vt) |
igrid = mnc_cw_vgind(ind_vt) |
419 |
|
|
450 |
write(fname((ntot+1):(ntot+9)),'(i6.6,a3)') uniq_tnum, '.nc' |
write(fname((ntot+1):(ntot+9)),'(i6.6,a3)') uniq_tnum, '.nc' |
451 |
nfname = ntot+9 |
nfname = ntot+9 |
452 |
|
|
453 |
|
C Add the path to the file name |
454 |
|
IF (mnc_use_indir) THEN |
455 |
|
path_fname(1:MNC_MAX_CHAR) = mnc_blank_name(1:MNC_MAX_CHAR) |
456 |
|
npath = ILNBLNK(mnc_indir_str) |
457 |
|
path_fname(1:npath) = mnc_indir_str(1:npath) |
458 |
|
path_fname((npath+1):(npath+nfname)) = fname(1:nfname) |
459 |
|
fname(1:MNC_MAX_CHAR) = path_fname(1:MNC_MAX_CHAR) |
460 |
|
nfname = npath + nfname |
461 |
|
ENDIF |
462 |
|
|
463 |
C Open the existing file |
C Open the existing file |
464 |
CALL MNC_FILE_TRY_READ( fname, ierr, indf, myThid) |
CALL MNC_FILE_TRY_READ( fname, ierr, indf, myThid) |
465 |
|
|
466 |
C Check that the variable (VType) is defined within the file |
C Check that the variable (VType) is defined within the file |
467 |
CALL MNC_GET_FVINDS( fname, vtype, indf, ind_fv_ids, myThid) |
CALL MNC_GET_FVINDS( fname, vtype, indf, ind_fv_ids, myThid) |
468 |
IF ((indf .LT. 1) .OR. (ind_fv_ids .LT. 1)) THEN |
IF ((indf .LT. 1) .OR. (ind_fv_ids .LT. 1)) THEN |
469 |
write(msgbuf,'(4a)') 'MNC_CW_RX_R_YY ERROR: vtype ''', |
write(msgbuf,'(4a)') 'MNC_CW_RX_R ERROR: vtype ''', |
470 |
& vtype(nvf:nvl), ''' is not defined within file ''', |
& vtype(nvf:nvl), ''' is not defined within file ''', |
471 |
& fname(1:nfname) |
& fname(1:nfname) |
472 |
CALL print_error(msgbuf, mythid) |
CALL print_error(msgbuf, mythid) |
473 |
STOP 'ABNORMAL END: S/R MNC_CW_RX_R_YY' |
STOP 'ABNORMAL END: S/R MNC_CW_RX_R' |
474 |
ENDIF |
ENDIF |
475 |
fid = mnc_f_info(indf,2) |
fid = mnc_f_info(indf,2) |
476 |
idv = mnc_fv_ids(indf,ind_fv_ids+1) |
idv = mnc_fv_ids(indf,ind_fv_ids+1) |
483 |
IF ((err .EQ. NF_NOERR) .AND. (alen .EQ. 1)) THEN |
IF ((err .EQ. NF_NOERR) .AND. (alen .EQ. 1)) THEN |
484 |
err = NF_GET_ATT_INT(fid, NF_GLOBAL, 'sNx', f_sNx) |
err = NF_GET_ATT_INT(fid, NF_GLOBAL, 'sNx', f_sNx) |
485 |
CALL MNC_HANDLE_ERR(err, |
CALL MNC_HANDLE_ERR(err, |
486 |
& 'reading attribute ''sNx'' in S/R MNC_CW_RX_R_YY', |
& 'reading attribute ''sNx'' in S/R MNC_CW_RX_R', |
487 |
& myThid) |
& myThid) |
488 |
ENDIF |
ENDIF |
489 |
err = NF_INQ_ATT(fid,NF_GLOBAL, 'sNy',atype,alen) |
err = NF_INQ_ATT(fid,NF_GLOBAL, 'sNy',atype,alen) |
490 |
IF ((err .EQ. NF_NOERR) .AND. (alen .EQ. 1)) THEN |
IF ((err .EQ. NF_NOERR) .AND. (alen .EQ. 1)) THEN |
491 |
err = NF_GET_ATT_INT(fid, NF_GLOBAL, 'sNy', f_sNy) |
err = NF_GET_ATT_INT(fid, NF_GLOBAL, 'sNy', f_sNy) |
492 |
CALL MNC_HANDLE_ERR(err, |
CALL MNC_HANDLE_ERR(err, |
493 |
& 'reading attribute ''sNy'' in S/R MNC_CW_RX_R_YY', |
& 'reading attribute ''sNy'' in S/R MNC_CW_RX_R', |
494 |
& myThid) |
& myThid) |
495 |
ENDIF |
ENDIF |
496 |
IF ((f_sNx .NE. sNx) .OR. (f_sNy .NE. sNy)) THEN |
IF ((f_sNx .NE. sNx) .OR. (f_sNy .NE. sNy)) THEN |
497 |
write(msgbuf,'(5a)') 'MNC_CW_RX_R_YY WARNING: the ', |
write(msgbuf,'(5a)') 'MNC_CW_RX_R WARNING: the ', |
498 |
& 'attributes ''sNx'' and ''sNy'' within the file ''', |
& 'attributes ''sNx'' and ''sNy'' within the file ''', |
499 |
& fname(1:nfname), ''' do not exist or do not match ', |
& fname(1:nfname), ''' do not exist or do not match ', |
500 |
& 'the current sizes within the model' |
& 'the current sizes within the model' |
507 |
C CALL MNC_CHK_VTYP_R_NCVAR( ind_vt, |
C CALL MNC_CHK_VTYP_R_NCVAR( ind_vt, |
508 |
C & indf, ind_fv_ids, indu, ires) |
C & indf, ind_fv_ids, indu, ires) |
509 |
C IF (ires .LT. 0) THEN |
C IF (ires .LT. 0) THEN |
510 |
C write(msgbuf,'(7a)') 'MNC_CW_RX_R_YY WARNING: the sizes ', |
C write(msgbuf,'(7a)') 'MNC_CW_RX_R WARNING: the sizes ', |
511 |
C & 'of the in-program variable ''', vtype(nvf:nvl), |
C & 'of the in-program variable ''', vtype(nvf:nvl), |
512 |
C & ''' and the corresponding variable within file ''', |
C & ''' and the corresponding variable within file ''', |
513 |
C & fname(1:nfname), ''' are not compatible -- please ', |
C & fname(1:nfname), ''' are not compatible -- please ', |
514 |
C & 'check the sizes' |
C & 'check the sizes' |
515 |
C CALL print_error(msgbuf, mythid) |
C CALL print_error(msgbuf, mythid) |
516 |
C STOP 'ABNORMAL END: S/R MNC_CW_RX_R_YY' |
C STOP 'ABNORMAL END: S/R MNC_CW_RX_R' |
517 |
C ENDIF |
C ENDIF |
518 |
|
|
519 |
C Check for bi,bj indicies |
C Check for bi,bj indicies |
614 |
vstart(2) = udo(2) + j2 - s(2) + 1 |
vstart(2) = udo(2) + j2 - s(2) + 1 |
615 |
vcount(2) = 1 |
vcount(2) = 1 |
616 |
|
|
617 |
|
kr = 0 |
618 |
vstart(1) = udo(1) + 1 |
vstart(1) = udo(1) + 1 |
619 |
vcount(1) = e(1) - s(1) + 1 |
vcount(1) = e(1) - s(1) + 1 |
620 |
|
|
621 |
#ifdef mnc_rtype_D |
IF (stype(1:1) .EQ. 'D') THEN |
622 |
err = NF_GET_VARA_DOUBLE(fid, idv, vstart, vcount, resh) |
err = NF_GET_VARA_DOUBLE(fid, idv, vstart, vcount, resh_d) |
623 |
#endif |
CALL MNC_HANDLE_ERR(err, msgbuf, myThid) |
624 |
#ifdef mnc_rtype_R |
DO j1 = s(1),e(1) |
625 |
err = NF_GET_VARA_REAL(fid, idv, vstart, vcount, resh) |
k1 = k2 + j1 |
626 |
#endif |
kr = kr + 1 |
627 |
#ifdef mnc_rtype_I |
var(k1) = resh_d(kr) |
628 |
err = NF_GET_VARA_INT(fid, idv, vstart, vcount, resh) |
ENDDO |
629 |
#endif |
ENDIF |
630 |
|
IF (stype(1:1) .EQ. 'R') THEN |
631 |
CALL MNC_HANDLE_ERR(err, msgbuf, myThid) |
err = NF_GET_VARA_REAL(fid, idv, vstart, vcount, resh_r) |
632 |
|
CALL MNC_HANDLE_ERR(err, msgbuf, myThid) |
633 |
|
DO j1 = s(1),e(1) |
634 |
|
k1 = k2 + j1 |
635 |
|
kr = kr + 1 |
636 |
|
var(k1) = resh_r(kr) |
637 |
|
ENDDO |
638 |
|
ENDIF |
639 |
|
IF (stype(1:1) .EQ. 'I') THEN |
640 |
|
err = NF_GET_VARA_INT(fid, idv, vstart, vcount, resh_i) |
641 |
|
CALL MNC_HANDLE_ERR(err, msgbuf, myThid) |
642 |
|
DO j1 = s(1),e(1) |
643 |
|
k1 = k2 + j1 |
644 |
|
kr = kr + 1 |
645 |
|
var(k1) = resh_i(kr) |
646 |
|
ENDDO |
647 |
|
ENDIF |
648 |
|
|
|
kr = 0 |
|
|
DO j1 = s(1),e(1) |
|
|
k1 = k2 + j1 |
|
|
kr = kr + 1 |
|
|
var(k1) = resh(kr) |
|
|
ENDDO |
|
649 |
|
|
650 |
|
|
651 |
ENDDO |
ENDDO |