102 |
IF (mId .EQ. 1) THEN |
IF (mId .EQ. 1) THEN |
103 |
C Update the record dimension by writing the iteration number |
C Update the record dimension by writing the iteration number |
104 |
CALL MNC_CW_SET_UDIM(diag_mnc_bn, -1, myThid) |
CALL MNC_CW_SET_UDIM(diag_mnc_bn, -1, myThid) |
105 |
CALL MNC_CW_RL_W_S('D',diag_mnc_bn,0,0,'T',myTime,myThid) |
CALL MNC_CW_RL_W_S('D',diag_mnc_bn,1,1,'T',myTime,myThid) |
106 |
CALL MNC_CW_SET_UDIM(diag_mnc_bn, 0, myThid) |
CALL MNC_CW_SET_UDIM(diag_mnc_bn, 0, myThid) |
107 |
CALL MNC_CW_I_W_S('I',diag_mnc_bn,0,0,'iter',myIter,myThid) |
CALL MNC_CW_I_W_S('I',diag_mnc_bn,1,1,'iter',myIter,myThid) |
108 |
ENDIF |
ENDIF |
109 |
|
|
110 |
#ifdef DIAGST_MNC_NEEDSWORK |
#ifdef DIAGST_MNC_NEEDSWORK |
130 |
& 'Idicies of vertical levels within the source arrays', |
& 'Idicies of vertical levels within the source arrays', |
131 |
& myThid) |
& myThid) |
132 |
|
|
133 |
CALL MNC_CW_RL_W('D',diag_mnc_bn,0,0, |
CALL MNC_CW_RL_W('D',diag_mnc_bn,1,1, |
134 |
& 'diag_levels', levs(1,listId), myThid) |
& 'diag_levels', levs(1,listId), myThid) |
135 |
|
|
136 |
CALL MNC_CW_DEL_VNAME('diag_levels', myThid) |
CALL MNC_CW_DEL_VNAME('diag_levels', myThid) |
174 |
& 'Dimensional coordinate value at the lower point', |
& 'Dimensional coordinate value at the lower point', |
175 |
& myThid) |
& myThid) |
176 |
ENDIF |
ENDIF |
177 |
CALL MNC_CW_RS_W('D',diag_mnc_bn,0,0, dn(1), ztmp, myThid) |
CALL MNC_CW_RS_W('D',diag_mnc_bn,1,1, dn(1), ztmp, myThid) |
178 |
CALL MNC_CW_DEL_VNAME(dn(1), myThid) |
CALL MNC_CW_DEL_VNAME(dn(1), myThid) |
179 |
CALL MNC_CW_DEL_GNAME(dn(1), myThid) |
CALL MNC_CW_DEL_GNAME(dn(1), myThid) |
180 |
ENDDO |
ENDDO |
186 |
ENDDO |
ENDDO |
187 |
|
|
188 |
C Z is special since it varies |
C Z is special since it varies |
189 |
WRITE(dn(1),'(a,i6.6)') 'Zd', nlevels(listId) |
WRITE(dn(1),'(a,i6.6)') 'Zd', kdiag(ndId) |
190 |
IF ( (gdiag(ndId)(10:10) .EQ. 'R') |
IF ( (gdiag(ndId)(10:10) .EQ. 'R') |
191 |
& .AND. (gdiag(ndId)(9:9) .EQ. 'M') ) THEN |
& .AND. (gdiag(ndId)(9:9) .EQ. 'M') ) THEN |
192 |
WRITE(dn(1),'(a,i6.6)') 'Zmd', nlevels(listId) |
WRITE(dn(1),'(a,i6.6)') 'Zmd', kdiag(ndId) |
193 |
ENDIF |
ENDIF |
194 |
IF ( (gdiag(ndId)(10:10) .EQ. 'R') |
IF ( (gdiag(ndId)(10:10) .EQ. 'R') |
195 |
& .AND. (gdiag(ndId)(9:9) .EQ. 'L') ) THEN |
& .AND. (gdiag(ndId)(9:9) .EQ. 'L') ) THEN |
196 |
WRITE(dn(1),'(a,i6.6)') 'Zld', nlevels(listId) |
WRITE(dn(1),'(a,i6.6)') 'Zld', kdiag(ndId) |
197 |
ENDIF |
ENDIF |
198 |
IF ( (gdiag(ndId)(10:10) .EQ. 'R') |
IF ( (gdiag(ndId)(10:10) .EQ. 'R') |
199 |
& .AND. (gdiag(ndId)(9:9) .EQ. 'U') ) THEN |
& .AND. (gdiag(ndId)(9:9) .EQ. 'U') ) THEN |
200 |
WRITE(dn(1),'(a,i6.6)') 'Zud', nlevels(listId) |
WRITE(dn(1),'(a,i6.6)') 'Zud', kdiag(ndId) |
201 |
ENDIF |
ENDIF |
202 |
dim(1) = Nr+Nrphys+1 |
dim(1) = Nr+Nrphys+1 |
203 |
ib(1) = 1 |
ib(1) = 1 |
238 |
DO i = 1,MAX_LEN_FNAM |
DO i = 1,MAX_LEN_FNAM |
239 |
tnam(i:i) = ' ' |
tnam(i:i) = ' ' |
240 |
ENDDO |
ENDDO |
|
ilen = ILNBLNK(cdiag(ndId)) |
|
|
WRITE(tnam,'(a,a4,a3)') |
|
|
& cdiag(ndId)(1:ilen),'_lv_',stat_typ(ist+1) |
|
|
|
|
|
CALL MNC_CW_ADD_VNAME(tnam, d_cw_gname, |
|
|
& 0,0, myThid) |
|
|
CALL MNC_CW_ADD_VATTR_TEXT(tnam,'description', |
|
|
& tdiag(ndId),myThid) |
|
|
CALL MNC_CW_ADD_VATTR_TEXT(tnam,'units', |
|
|
& udiag(ndId),myThid) |
|
|
|
|
|
C Copy the data into a temporary with the necessary shape |
|
|
DO j = 0,nRegions |
|
|
DO k = 1,kdiag(ndId) |
|
|
stmp(k,j+1) = statGlob(ist,k,j) |
|
|
ENDDO |
|
|
ENDDO |
|
|
|
|
|
IF ((fflags(listId)(1:1) .EQ. ' ') |
|
|
& .OR. (fflags(listId)(1:1) .EQ. 'R')) THEN |
|
|
|
|
|
CALL MNC_CW_RL_W('R',diag_mnc_bn,0,0, |
|
|
& tnam, stmp, myThid) |
|
|
|
|
|
ELSEIF (fflags(listId)(1:1) .EQ. 'D') THEN |
|
|
|
|
|
CALL MNC_CW_RL_W('D',diag_mnc_bn,0,0, |
|
|
& tnam, stmp, myThid) |
|
|
|
|
|
ENDIF |
|
241 |
|
|
242 |
CALL MNC_CW_DEL_VNAME(tnam, myThid) |
c IF ( kdiag(ndId) .GT. 1 ) THEN |
|
|
|
|
IF ( kdiag(ndId) .GT. 1 ) THEN |
|
243 |
|
|
244 |
ilen = ILNBLNK(cdiag(ndId)) |
ilen = ILNBLNK(cdiag(ndId)) |
245 |
WRITE(tnam,'(a,a4,a3)') |
WRITE(tnam,'(a,a1,a3)') |
246 |
& cdiag(ndId)(1:ilen),'_vi_',stat_typ(ist+1) |
& cdiag(ndId)(1:ilen),'_',stat_typ(ist+1) |
247 |
|
|
248 |
CALL MNC_CW_ADD_VNAME(tnam, d_cw_gname0, |
CALL MNC_CW_ADD_VNAME(tnam, d_cw_gname0, |
249 |
& 0,0, myThid) |
& 0,0, myThid) |
260 |
IF ((fflags(listId)(1:1) .EQ. ' ') |
IF ((fflags(listId)(1:1) .EQ. ' ') |
261 |
& .OR. (fflags(listId)(1:1) .EQ. 'R')) THEN |
& .OR. (fflags(listId)(1:1) .EQ. 'R')) THEN |
262 |
|
|
263 |
CALL MNC_CW_RL_W('R',diag_mnc_bn,0,0, |
CALL MNC_CW_RL_W('R',diag_mnc_bn,1,1, |
264 |
& tnam, stmp, myThid) |
& tnam, stmp, myThid) |
265 |
|
|
266 |
ELSEIF (fflags(listId)(1:1) .EQ. 'D') THEN |
ELSEIF (fflags(listId)(1:1) .EQ. 'D') THEN |
267 |
|
|
268 |
CALL MNC_CW_RL_W('D',diag_mnc_bn,0,0, |
CALL MNC_CW_RL_W('D',diag_mnc_bn,1,1, |
269 |
& tnam, stmp, myThid) |
& tnam, stmp, myThid) |
270 |
|
|
271 |
ENDIF |
ENDIF |
272 |
|
|
273 |
CALL MNC_CW_DEL_VNAME(tnam, myThid) |
CALL MNC_CW_DEL_VNAME(tnam, myThid) |
274 |
|
|
275 |
ENDIF |
c ENDIF |
276 |
|
|
277 |
|
IF ( kdiag(ndId) .GT. 1 ) THEN |
278 |
|
|
279 |
|
ilen = ILNBLNK(cdiag(ndId)) |
280 |
|
WRITE(tnam,'(a,a4,a3)') |
281 |
|
& cdiag(ndId)(1:ilen),'_lv_',stat_typ(ist+1) |
282 |
|
|
283 |
|
CALL MNC_CW_ADD_VNAME(tnam, d_cw_gname, |
284 |
|
& 0,0, myThid) |
285 |
|
CALL MNC_CW_ADD_VATTR_TEXT(tnam,'description', |
286 |
|
& tdiag(ndId),myThid) |
287 |
|
CALL MNC_CW_ADD_VATTR_TEXT(tnam,'units', |
288 |
|
& udiag(ndId),myThid) |
289 |
|
|
290 |
|
C Copy the data into a temporary with the necessary shape |
291 |
|
DO j = 0,nRegions |
292 |
|
DO k = 1,kdiag(ndId) |
293 |
|
stmp(k,j+1) = statGlob(ist,k,j) |
294 |
|
ENDDO |
295 |
|
ENDDO |
296 |
|
|
297 |
|
IF ((fflags(listId)(1:1) .EQ. ' ') |
298 |
|
& .OR. (fflags(listId)(1:1) .EQ. 'R')) THEN |
299 |
|
|
300 |
|
CALL MNC_CW_RL_W('R',diag_mnc_bn,1,1, |
301 |
|
& tnam, stmp, myThid) |
302 |
|
|
303 |
|
ELSEIF (fflags(listId)(1:1) .EQ. 'D') THEN |
304 |
|
|
305 |
|
CALL MNC_CW_RL_W('D',diag_mnc_bn,1,1, |
306 |
|
& tnam, stmp, myThid) |
307 |
|
|
308 |
|
ENDIF |
309 |
|
|
310 |
|
CALL MNC_CW_DEL_VNAME(tnam, myThid) |
311 |
|
|
312 |
|
ENDIF |
313 |
|
|
314 |
ENDDO |
ENDDO |
315 |
|
|
316 |
CALL MNC_CW_DEL_GNAME(d_cw_gname, myThid) |
CALL MNC_CW_DEL_GNAME(d_cw_gname, myThid) |