74 |
ipointer = 0 |
ipointer = 0 |
75 |
DO n=1,nlists |
DO n=1,nlists |
76 |
DO m=1,nActive(n) |
DO m=1,nActive(n) |
77 |
IF ( chardiag.EQ.flds(m,n) ) THEN |
IF ( chardiag.EQ.flds(m,n) .AND. idiag(m,n).GT.0 ) THEN |
78 |
ndiagnum = jdiag(m,n) |
ndiagnum = jdiag(m,n) |
79 |
IF (ndiag(ndiagnum).GE.0) ipointer = idiag(ndiagnum) |
ipointer = idiag(m,n) |
80 |
ENDIF |
IF ( ndiagnum.NE.0 .AND. ndiag(ipointer,1,1).GE.0 ) THEN |
81 |
ENDDO |
C-- do the filling: start here: |
82 |
ENDDO |
|
83 |
|
IF ( (ABS(kLev).LE.1) .AND. (npeice.eq.1) ) THEN |
84 |
C If-sequence to see if we are a valid and an active diagnostic |
C Increment the counter for the diagnostic |
85 |
|
ndiag(ipointer,bi,bj) = ndiag(ipointer,bi,bj) + 1 |
86 |
IF ( ndiagnum.NE.0 .AND. ipointer.NE.0 ) THEN |
ENDIF |
|
|
|
|
C Increment the counter for the diagnostic (if we are at bi=bj=myThid=1) |
|
|
_BEGIN_MASTER(myThid) |
|
|
IF((bi.EQ.1).AND.(bj.EQ.1).AND.(ABS(kLev).LE.1) |
|
|
. .AND.(npeice.eq.1)) |
|
|
. ndiag(ndiagnum) = ndiag(ndiagnum) + 1 |
|
|
_END_MASTER(myThid) |
|
87 |
|
|
88 |
offset = ib*(npeice-1) |
offset = ib*(npeice-1) |
89 |
Lena = min(ib,numpts-offset) |
Lena = min(ib,numpts-offset) |
142 |
undef = getcon('UNDEF') |
undef = getcon('UNDEF') |
143 |
do i= 1,Lena |
do i= 1,Lena |
144 |
jindx = 1 + int((indx(i+offset-1)-1)/sNx) |
jindx = 1 + int((indx(i+offset-1)-1)/sNx) |
145 |
newindx = indx(i+offset-1)+(jindx-1)*2*Olx+(sNx+2*Olx)*Oly+Olx |
newindx = indx(i+offset-1)+(jindx-1)*2*Olx |
146 |
if(qdiag(newindx,1,kd,bi,bj).eq.undef |
if(qdiag(newindx,1,kd,bi,bj).eq.undef |
147 |
. .or.field(i,k).eq.undef)then |
. .or.field(i,k).eq.undef)then |
148 |
qdiag(newindx,1,kd,bi,bj) = undef |
qdiag(newindx,1,kd,bi,bj) = undef |
149 |
else |
else |
150 |
qdiag(newindx,1,kd,bi,bj)=qdiag(newindx,1,kd,bi,bj)+ |
qdiag(newindx,1,kd,bi,bj)=qdiag(newindx,1,kd,bi,bj)+ |
151 |
. field(i,k)*chfr(i) |
. field(i,k)*chfr(i) |
152 |
endif |
endif |
153 |
enddo |
enddo |
154 |
else |
else |
155 |
do i= 1,Lena |
do i= 1,Lena |
156 |
jindx = 1 + int((indx(i+offset-1)-1)/sNx) |
jindx = 1 + int((indx(i+offset-1)-1)/sNx) |
157 |
newindx = indx(i+offset-1)+(jindx-1)*2*Olx+(sNx+2*Olx)*Oly+Olx |
newindx = indx(i+offset-1)+(jindx-1)*2*Olx |
158 |
qdiag(newindx,1,kd,bi,bj)=qdiag(newindx,1,kd,bi,bj)+ |
qdiag(newindx,1,kd,bi,bj)=qdiag(newindx,1,kd,bi,bj)+ |
159 |
. field(i,k)*chfr(i) |
. field(i,k)*chfr(i) |
160 |
enddo |
enddo |
161 |
endif |
endif |
162 |
ENDDO |
ENDDO |
163 |
|
|
164 |
ELSE |
C-- do the filling: ends here. |
165 |
C IF (myThid.EQ.1) WRITE(6,1000) chardiag |
ENDIF |
166 |
ENDIF |
ENDIF |
167 |
|
ENDDO |
168 |
|
ENDDO |
169 |
|
|
170 |
1000 format(' ',' Warning: Trying to write to diagnostic ',a8, |
1000 format(' ',' Warning: Trying to write to diagnostic ',a8, |
171 |
. ' But it is not a valid (or active) name ') |
. ' But it is not a valid (or active) name ') |