File indexing completed on 2019-11-07 06:10:41 UTC
view on githubraw file Latest commit ff78c255 on 2019-10-21 13:43:41 UTC
c90c060abd Ed H*0001 #include "DIAG_OPTIONS.h"
ab685e6b35 Jean*0002
c83206cd4e Jean*0003
0004
0005
8ce775c441 Jean*0006 SUBROUTINE DIAGNOSTICS_FILL_STATE( selectVars, myIter, myThid )
c90c060abd Ed H*0007
c83206cd4e Jean*0008
0009
0010
0011
0012
0013
0014
0015
0016 IMPLICIT NONE
0017
2e735ea21e Andr*0018 #include "SIZE.h"
0019 #include "EEPARAMS.h"
d316948822 Andr*0020 #include "PARAMS.h"
2e735ea21e Andr*0021 #include "GRID.h"
0ef6d0142d Jean*0022 #include "SURFACE.h"
5b0d80d77c Jean*0023 #include "DYNVARS.h"
0024 #include "NH_VARS.h"
8ce775c441 Jean*0025 #ifdef ALLOW_GENERIC_ADVDIFF
0026 # include "GAD.h"
0027 #endif
2e735ea21e Andr*0028
c83206cd4e Jean*0029
0030
0031
0032
0033
0034
7b936be362 Andr*0035
8ce775c441 Jean*0036
c83206cd4e Jean*0037
9ba8ef70b1 Jean*0038 INTEGER selectVars
8ce775c441 Jean*0039 INTEGER myIter
9ba8ef70b1 Jean*0040 INTEGER myThid
ab685e6b35 Jean*0041
0042 #ifdef ALLOW_DIAGNOSTICS
c83206cd4e Jean*0043
0044
337bea277a Jean*0045 LOGICAL DIAGNOSTICS_IS_ON
0046 EXTERNAL DIAGNOSTICS_IS_ON
0047 _RL tmpMk(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr,nSx,nSy)
0048 _RL tmp1k(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
06349ecfd7 Jean*0049 _RL tmpU (1-OLx:sNx+OLx,1-OLy:sNy+OLy)
0050 _RL tmpV (1-OLx:sNx+OLx,1-OLy:sNy+OLy)
84d01e10aa Jean*0051 _RL tmpFac, uBarC, vBarC
b21f2d376f Jean*0052 #ifdef ALLOW_FIZHI
d316948822 Andr*0053 _RL dummy1, dummy2, dummy3, dummy4, kappa, getcon
b21f2d376f Jean*0054 #endif
8ce775c441 Jean*0055 #ifdef ALLOW_ADAMSBASHFORTH_3
0056 INTEGER m1
0057 #endif
0058 INTEGER i,j,k,bi,bj
337bea277a Jean*0059 INTEGER km1
9ba8ef70b1 Jean*0060
7b936be362 Andr*0061 IF ( selectVars.EQ.2 .OR. selectVars.EQ.3 ) THEN
c83206cd4e Jean*0062
0063
62f9c88755 Jean*0064 CALL DIAGNOSTICS_FILL(etaN, 'ETAN ',0, 1,0,1,1,myThid)
ee04343829 Andr*0065
0066 IF ( DIAGNOSTICS_IS_ON('RSURF ',myThid) ) THEN
0067 DO bj = myByLo(myThid), myByHi(myThid)
0068 DO bi = myBxLo(myThid), myBxHi(myThid)
0069 DO j = 1,sNy
0070 DO i = 1,sNx
0071 tmp1k(i,j,bi,bj) = Ro_surf(i,j,bi,bj) + etaH(i,j,bi,bj)
0072 ENDDO
0073 ENDDO
0074 ENDDO
0075 ENDDO
0076 CALL DIAGNOSTICS_FILL(tmp1k,'RSURF ',0,1,0,1,1,myThid)
0077 ENDIF
0078
d9055b137d Jean*0079 CALL DIAGNOSTICS_SCALE_FILL( etaN, oneRL, 2,
62f9c88755 Jean*0080 & 'ETANSQ ',0, 1,0,1,1,myThid)
9ba8ef70b1 Jean*0081
0ef6d0142d Jean*0082 #ifdef EXACT_CONSERV
d9055b137d Jean*0083 CALL DIAGNOSTICS_SCALE_FILL( dEtaHdt, oneRL, 2,
62f9c88755 Jean*0084 & 'DETADT2 ',0, 1,0,1,1,myThid)
0ef6d0142d Jean*0085 #endif
5b0d80d77c Jean*0086 #ifdef ALLOW_NONHYDROSTATIC
0087 IF ( use3Dsolver ) THEN
0088 CALL DIAGNOSTICS_FILL( phi_nh,'PHI_NH ',0,Nr,0,1,1,myThid )
0089 ENDIF
0090 #endif
9ba8ef70b1 Jean*0091
ff78c25591 Jean*0092 IF ( nonlinFreeSurf.GT.0 ) THEN
0093 CALL DIAGNOSTICS_FILL_RS( hFacW,'hFactorW',0,Nr,0,1,1,myThid )
0094 CALL DIAGNOSTICS_FILL_RS( hFacS,'hFactorS',0,Nr,0,1,1,myThid )
0095 ENDIF
0096
c83206cd4e Jean*0097 CALL DIAGNOSTICS_FILL(uVel, 'UVEL ',0,Nr,0,1,1,myThid)
0098 CALL DIAGNOSTICS_FILL(vVel, 'VVEL ',0,Nr,0,1,1,myThid)
0099 CALL DIAGNOSTICS_FILL(wVel, 'WVEL ',0,Nr,0,1,1,myThid)
9ba8ef70b1 Jean*0100
d9055b137d Jean*0101 CALL DIAGNOSTICS_SCALE_FILL( uVel, oneRL, 2,
62f9c88755 Jean*0102 & 'UVELSQ ',0,Nr,0,1,1,myThid)
d9055b137d Jean*0103 CALL DIAGNOSTICS_SCALE_FILL( vVel, oneRL, 2,
62f9c88755 Jean*0104 & 'VVELSQ ',0,Nr,0,1,1,myThid)
d9055b137d Jean*0105 CALL DIAGNOSTICS_SCALE_FILL( wVel, oneRL, 2,
62f9c88755 Jean*0106 & 'WVELSQ ',0,Nr,0,1,1,myThid)
0107
c83206cd4e Jean*0108
0109
06349ecfd7 Jean*0110 IF ( DIAGNOSTICS_IS_ON('UE_VEL_C',myThid) .OR.
0111 & DIAGNOSTICS_IS_ON('VN_VEL_C',myThid) .OR.
0112 & DIAGNOSTICS_IS_ON('UV_VEL_C',myThid) ) THEN
c83206cd4e Jean*0113 DO bj = myByLo(myThid), myByHi(myThid)
0114 DO bi = myBxLo(myThid), myBxHi(myThid)
8ce775c441 Jean*0115 DO k=1,Nr
337bea277a Jean*0116 DO j = 1,sNy
c83206cd4e Jean*0117 DO i = 1,sNx
84d01e10aa Jean*0118 uBarC = 0.5 _d 0
8ce775c441 Jean*0119 & *(uVel(i,j,k,bi,bj)+uVel(i+1,j,k,bi,bj))
84d01e10aa Jean*0120 vBarC = 0.5 _d 0
8ce775c441 Jean*0121 & *(vVel(i,j,k,bi,bj)+vVel(i,j+1,k,bi,bj))
06349ecfd7 Jean*0122 tmpU(i,j) = angleCosC(i,j,bi,bj)*uBarC
0123 & -angleSinC(i,j,bi,bj)*vBarC
0124 tmpV(i,j) = angleSinC(i,j,bi,bj)*uBarC
0125 & +angleCosC(i,j,bi,bj)*vBarC
8ce775c441 Jean*0126 tmpMk(i,j,k,bi,bj) = tmpU(i,j)*tmpV(i,j)
c83206cd4e Jean*0127 ENDDO
337bea277a Jean*0128 ENDDO
06349ecfd7 Jean*0129 CALL DIAGNOSTICS_FILL(tmpU,'UE_VEL_C',k,1,2,bi,bj,myThid)
0130 CALL DIAGNOSTICS_FILL(tmpV,'VN_VEL_C',k,1,2,bi,bj,myThid)
c83206cd4e Jean*0131 ENDDO
337bea277a Jean*0132 ENDDO
c83206cd4e Jean*0133 ENDDO
0134 CALL DIAGNOSTICS_FILL(tmpMk,'UV_VEL_C',0,Nr,0,1,1,myThid)
0135 ENDIF
9ba8ef70b1 Jean*0136
c83206cd4e Jean*0137 IF ( DIAGNOSTICS_IS_ON('UV_VEL_Z',myThid) ) THEN
0138 DO bj = myByLo(myThid), myByHi(myThid)
0139 DO bi = myBxLo(myThid), myBxHi(myThid)
8ce775c441 Jean*0140 DO k=1,Nr
c83206cd4e Jean*0141 DO j = 1,sNy+1
0142 DO i = 1,sNx+1
8ce775c441 Jean*0143 tmpMk(i,j,k,bi,bj) = 0.25 _d 0
0144 & *(uVel(i,j-1,k,bi,bj)+uVel(i,j,k,bi,bj))
0145 & *(vVel(i-1,j,k,bi,bj)+vVel(i,j,k,bi,bj))
c83206cd4e Jean*0146 ENDDO
337bea277a Jean*0147 ENDDO
c83206cd4e Jean*0148 ENDDO
337bea277a Jean*0149 ENDDO
c83206cd4e Jean*0150 ENDDO
0151 CALL DIAGNOSTICS_FILL(tmpMk,'UV_VEL_Z',0,Nr,0,1,1,myThid)
0152 ENDIF
9ba8ef70b1 Jean*0153
6df3568a20 Jean*0154 IF ( DIAGNOSTICS_IS_ON('WU_VEL ',myThid) ) THEN
0155 DO bj = myByLo(myThid), myByHi(myThid)
0156 DO bi = myBxLo(myThid), myBxHi(myThid)
8ce775c441 Jean*0157 DO k=1,Nr
6df3568a20 Jean*0158 km1 = MAX(k-1,1)
0159 DO j = 1,sNy
0160 DO i = 1,sNx+1
8ce775c441 Jean*0161 tmpMk(i,j,k,bi,bj) = 0.25 _d 0
0162 & *(uVel(i,j,km1,bi,bj)+uVel(i,j,k,bi,bj))
0163 & *(wVel(i-1,j,k,bi,bj)*rA(i-1,j,bi,bj)
0164 & +wVel( i ,j,k,bi,bj)*rA( i ,j,bi,bj)
6df3568a20 Jean*0165 & )*recip_rAw(i,j,bi,bj)
0166 ENDDO
0167 ENDDO
0168 ENDDO
0169 ENDDO
0170 ENDDO
0171 CALL DIAGNOSTICS_FILL(tmpMk,'WU_VEL ',0,Nr,0,1,1,myThid)
0172 ENDIF
0173
0174 IF ( DIAGNOSTICS_IS_ON('WV_VEL ',myThid) ) THEN
0175 DO bj = myByLo(myThid), myByHi(myThid)
0176 DO bi = myBxLo(myThid), myBxHi(myThid)
8ce775c441 Jean*0177 DO k=1,Nr
6df3568a20 Jean*0178 km1 = MAX(k-1,1)
0179 DO j = 1,sNy+1
0180 DO i = 1,sNx
8ce775c441 Jean*0181 tmpMk(i,j,k,bi,bj) = 0.25 _d 0
0182 & *(vVel(i,j,km1,bi,bj)+vVel(i,j,k,bi,bj))
0183 & *(wVel(i,j-1,k,bi,bj)*rA(i,j-1,bi,bj)
0184 & +wVel(i, j ,k,bi,bj)*rA(i, j ,bi,bj)
6df3568a20 Jean*0185 & )*recip_rAs(i,j,bi,bj)
0186 ENDDO
0187 ENDDO
0188 ENDDO
0189 ENDDO
0190 ENDDO
0191 CALL DIAGNOSTICS_FILL(tmpMk,'WV_VEL ',0,Nr,0,1,1,myThid)
0192 ENDIF
0193
c83206cd4e Jean*0194
0195
0196 IF ( DIAGNOSTICS_IS_ON('UVELTH ',myThid) ) THEN
0197 DO bj = myByLo(myThid), myByHi(myThid)
0198 DO bi = myBxLo(myThid), myBxHi(myThid)
8ce775c441 Jean*0199 DO k=1,Nr
337bea277a Jean*0200 DO j = 1,sNy
c83206cd4e Jean*0201 DO i = 1,sNx+1
8ce775c441 Jean*0202 tmpMk(i,j,k,bi,bj) = uVel(i,j,k,bi,bj)*0.5 _d 0
0203 & *(theta(i,j,k,bi,bj)+theta(i-1,j,k,bi,bj))
c83206cd4e Jean*0204 ENDDO
337bea277a Jean*0205 ENDDO
c83206cd4e Jean*0206 ENDDO
337bea277a Jean*0207 ENDDO
c83206cd4e Jean*0208 ENDDO
0209 CALL DIAGNOSTICS_FILL(tmpMk,'UVELTH ',0,Nr,0,1,1,myThid)
0210 ENDIF
9ba8ef70b1 Jean*0211
c83206cd4e Jean*0212 IF ( DIAGNOSTICS_IS_ON('VVELTH ',myThid) ) THEN
0213 DO bj = myByLo(myThid), myByHi(myThid)
0214 DO bi = myBxLo(myThid), myBxHi(myThid)
8ce775c441 Jean*0215 DO k=1,Nr
c83206cd4e Jean*0216 DO j = 1,sNy+1
0217 DO i = 1,sNx
8ce775c441 Jean*0218 tmpMk(i,j,k,bi,bj) = vVel(i,j,k,bi,bj)*0.5 _d 0
0219 & *(theta(i,j,k,bi,bj)+theta(i,j-1,k,bi,bj))
c83206cd4e Jean*0220 ENDDO
337bea277a Jean*0221 ENDDO
c83206cd4e Jean*0222 ENDDO
337bea277a Jean*0223 ENDDO
c83206cd4e Jean*0224 ENDDO
0225 CALL DIAGNOSTICS_FILL(tmpMk,'VVELTH ',0,Nr,0,1,1,myThid)
0226 ENDIF
9ba8ef70b1 Jean*0227
c83206cd4e Jean*0228 IF ( DIAGNOSTICS_IS_ON('WVELTH ',myThid) ) THEN
0229 DO bj = myByLo(myThid), myByHi(myThid)
0230 DO bi = myBxLo(myThid), myBxHi(myThid)
8ce775c441 Jean*0231 DO k=1,Nr
47146cb74f Ed H*0232 km1 = MAX(k-1,1)
337bea277a Jean*0233 DO j = 1,sNy
c83206cd4e Jean*0234 DO i = 1,sNx
8ce775c441 Jean*0235 tmpMk(i,j,k,bi,bj) = wVel(i,j,k,bi,bj)*0.5 _d 0
0236 & *(theta(i,j,k,bi,bj)+theta(i,j,km1,bi,bj))
c83206cd4e Jean*0237 ENDDO
337bea277a Jean*0238 ENDDO
c83206cd4e Jean*0239 ENDDO
337bea277a Jean*0240 ENDDO
c83206cd4e Jean*0241 ENDDO
0242 CALL DIAGNOSTICS_FILL(tmpMk,'WVELTH ',0,Nr,0,1,1,myThid)
0243 ENDIF
9ba8ef70b1 Jean*0244
c83206cd4e Jean*0245 IF ( DIAGNOSTICS_IS_ON('UVELSLT ',myThid) ) THEN
0246 DO bj = myByLo(myThid), myByHi(myThid)
0247 DO bi = myBxLo(myThid), myBxHi(myThid)
8ce775c441 Jean*0248 DO k=1,Nr
337bea277a Jean*0249 DO j = 1,sNy
c83206cd4e Jean*0250 DO i = 1,sNx+1
8ce775c441 Jean*0251 tmpMk(i,j,k,bi,bj) = uVel(i,j,k,bi,bj)*0.5 _d 0
0252 & *(salt(i,j,k,bi,bj)+salt(i-1,j,k,bi,bj))
c83206cd4e Jean*0253 ENDDO
337bea277a Jean*0254 ENDDO
c83206cd4e Jean*0255 ENDDO
337bea277a Jean*0256 ENDDO
c83206cd4e Jean*0257 ENDDO
0258 CALL DIAGNOSTICS_FILL(tmpMk,'UVELSLT ',0,Nr,0,1,1,myThid)
0259 ENDIF
9ba8ef70b1 Jean*0260
c83206cd4e Jean*0261 IF ( DIAGNOSTICS_IS_ON('VVELSLT ',myThid) ) THEN
0262 DO bj = myByLo(myThid), myByHi(myThid)
0263 DO bi = myBxLo(myThid), myBxHi(myThid)
8ce775c441 Jean*0264 DO k=1,Nr
c83206cd4e Jean*0265 DO j = 1,sNy+1
0266 DO i = 1,sNx
8ce775c441 Jean*0267 tmpMk(i,j,k,bi,bj) = vVel(i,j,k,bi,bj)*0.5 _d 0
0268 & *(salt(i,j,k,bi,bj)+salt(i,j-1,k,bi,bj))
c83206cd4e Jean*0269 ENDDO
337bea277a Jean*0270 ENDDO
c83206cd4e Jean*0271 ENDDO
337bea277a Jean*0272 ENDDO
c83206cd4e Jean*0273 ENDDO
0274 CALL DIAGNOSTICS_FILL(tmpMk,'VVELSLT ',0,Nr,0,1,1,myThid)
0275 ENDIF
2e735ea21e Andr*0276
c83206cd4e Jean*0277 IF ( DIAGNOSTICS_IS_ON('WVELSLT ',myThid) ) THEN
0278 DO bj = myByLo(myThid), myByHi(myThid)
0279 DO bi = myBxLo(myThid), myBxHi(myThid)
8ce775c441 Jean*0280 DO k=1,Nr
47146cb74f Ed H*0281 km1 = MAX(k-1,1)
337bea277a Jean*0282 DO j = 1,sNy
c83206cd4e Jean*0283 DO i = 1,sNx
8ce775c441 Jean*0284 tmpMk(i,j,k,bi,bj) = wVel(i,j,k,bi,bj)*0.5 _d 0
0285 & *(salt(i,j,k,bi,bj)+salt(i,j,km1,bi,bj))
c83206cd4e Jean*0286 ENDDO
337bea277a Jean*0287 ENDDO
c83206cd4e Jean*0288 ENDDO
337bea277a Jean*0289 ENDDO
c83206cd4e Jean*0290 ENDDO
0291 CALL DIAGNOSTICS_FILL(tmpMk,'WVELSLT ',0,Nr,0,1,1,myThid)
0292 ENDIF
9ba8ef70b1 Jean*0293
fefa9e1c60 Andr*0294 IF ( DIAGNOSTICS_IS_ON('UVELPHI ',myThid) ) THEN
0295 DO bj = myByLo(myThid), myByHi(myThid)
0296 DO bi = myBxLo(myThid), myBxHi(myThid)
8ce775c441 Jean*0297 DO k=1,Nr
fefa9e1c60 Andr*0298 DO j = 1,sNy
0299 DO i = 1,sNx+1
8ce775c441 Jean*0300 tmpMk(i,j,k,bi,bj) = uVel(i,j,k,bi,bj)*hFacW(i,j,k,bi,bj)
0301 & *0.5 _d 0*(totPhiHyd(i,j,k,bi,bj)+totPhiHyd(i-1,j,k,bi,bj))
fefa9e1c60 Andr*0302 ENDDO
0303 ENDDO
0304 ENDDO
0305 ENDDO
0306 ENDDO
0307 CALL DIAGNOSTICS_FILL(tmpMk,'UVELPHI ',0,Nr,0,1,1,myThid)
0308 ENDIF
9ba8ef70b1 Jean*0309
fefa9e1c60 Andr*0310 IF ( DIAGNOSTICS_IS_ON('VVELPHI ',myThid) ) THEN
0311 DO bj = myByLo(myThid), myByHi(myThid)
0312 DO bi = myBxLo(myThid), myBxHi(myThid)
8ce775c441 Jean*0313 DO k=1,Nr
fefa9e1c60 Andr*0314 DO j = 1,sNy+1
0315 DO i = 1,sNx
8ce775c441 Jean*0316 tmpMk(i,j,k,bi,bj) = vVel(i,j,k,bi,bj)*hFacS(i,j,k,bi,bj)
0317 & *0.5 _d 0*(totPhiHyd(i,j,k,bi,bj)+totPhiHyd(i,j-1,k,bi,bj))
fefa9e1c60 Andr*0318 ENDDO
0319 ENDDO
0320 ENDDO
0321 ENDDO
0322 ENDDO
0323 CALL DIAGNOSTICS_FILL(tmpMk,'VVELPHI ',0,Nr,0,1,1,myThid)
0324 ENDIF
9ba8ef70b1 Jean*0325
ee8b184348 Jean*0326 IF ( DIAGNOSTICS_IS_ON('RCENTER ',myThid) ) THEN
e4ea461a62 Andr*0327 DO bj = myByLo(myThid), myByHi(myThid)
0328 DO bi = myBxLo(myThid), myBxHi(myThid)
57630d677b Jean*0329 DO j = 1,sNy
0330 DO i = 1,sNx
0331 tmp1k(i,j,bi,bj) = R_low(i,j,bi,bj)
0332 ENDDO
0333 ENDDO
0334 DO k = Nr,1,-1
0335 DO j = 1,sNy
0336 DO i = 1,sNx
0337 tmpMk(i,j,k,bi,bj) = tmp1k(i,j,bi,bj)
b6c3833a19 Jean*0338 & + (rF(k+1)-rC(k))*hFacC(i,j,k,bi,bj)*rkSign
4c2a1393c6 Jean*0339
0340
57630d677b Jean*0341 tmp1k(i,j,bi,bj) = tmp1k(i,j,bi,bj)
0342 & + drF(k)*hFacC(i,j,k,bi,bj)
0343 ENDDO
0344 ENDDO
0345 ENDDO
e4ea461a62 Andr*0346 ENDDO
0347 ENDDO
ee8b184348 Jean*0348 CALL DIAGNOSTICS_FILL(tmpMk,'RCENTER ',0,Nr,0,1,1,myThid)
e4ea461a62 Andr*0349 ENDIF
0350
7b936be362 Andr*0351
0352
0353
0354
d9055b137d Jean*0355 tmpFac = -86400. _d 0/deltaTMom
0356 CALL DIAGNOSTICS_SCALE_FILL( uVel, tmpFac, 1,
0357 & 'TOTUTEND',0,Nr,0,1,1,myThid )
0358 CALL DIAGNOSTICS_SCALE_FILL( vVel, tmpFac, 1,
0359 & 'TOTVTEND',0,Nr,0,1,1,myThid )
9ba8ef70b1 Jean*0360
7b936be362 Andr*0361 IF ( DIAGNOSTICS_IS_ON('TOTTTEND',myThid) ) THEN
0362 DO bj = myByLo(myThid), myByHi(myThid)
0363 DO bi = myBxLo(myThid), myBxHi(myThid)
8ce775c441 Jean*0364 DO k=1,Nr
d9055b137d Jean*0365 tmpFac = -86400. _d 0/dTtracerLev(k)
7b936be362 Andr*0366 DO j = 1,sNy
0367 DO i = 1,sNx
d9055b137d Jean*0368 tmpMk(i,j,k,bi,bj) = tmpFac*theta(i,j,k,bi,bj)
7b936be362 Andr*0369 ENDDO
0370 ENDDO
0371 ENDDO
0372 ENDDO
0373 ENDDO
0374 CALL DIAGNOSTICS_FILL(tmpMk,'TOTTTEND',0,Nr,0,1,1,myThid)
edd113ba3f Ryan*0375 #ifdef ALLOW_LAYERS
0376 IF ( useLayers ) THEN
0377 CALL LAYERS_FILL(tmpMk,1,'TOT',0,Nr,0,1,1,myThid)
0378 ENDIF
ff78c25591 Jean*0379 #endif /* ALLOW_LAYERS */
7b936be362 Andr*0380 ENDIF
9ba8ef70b1 Jean*0381
7b936be362 Andr*0382 IF ( DIAGNOSTICS_IS_ON('TOTSTEND',myThid) ) THEN
0383 DO bj = myByLo(myThid), myByHi(myThid)
0384 DO bi = myBxLo(myThid), myBxHi(myThid)
8ce775c441 Jean*0385 DO k=1,Nr
d9055b137d Jean*0386 tmpFac = -86400. _d 0/dTtracerLev(k)
7b936be362 Andr*0387 DO j = 1,sNy
0388 DO i = 1,sNx
d9055b137d Jean*0389 tmpMk(i,j,k,bi,bj) = tmpFac*salt(i,j,k,bi,bj)
7b936be362 Andr*0390 ENDDO
0391 ENDDO
0392 ENDDO
0393 ENDDO
0394 ENDDO
0395 CALL DIAGNOSTICS_FILL(tmpMk,'TOTSTEND',0,Nr,0,1,1,myThid)
edd113ba3f Ryan*0396 #ifdef ALLOW_LAYERS
0397 IF ( useLayers ) THEN
0398 CALL LAYERS_FILL(tmpMk,2,'TOT',0,Nr,0,1,1,myThid)
0399 ENDIF
0400 #endif /* ALLOW_LAYERS */
7b936be362 Andr*0401 ENDIF
0402
c83206cd4e Jean*0403
337bea277a Jean*0404 ENDIF
c83206cd4e Jean*0405
0406
0407
0408 IF ( selectVars.EQ.1 .OR. selectVars.EQ.3 ) THEN
0409
0410
ff78c25591 Jean*0411 IF ( nonlinFreeSurf.GT.0 ) THEN
0412 CALL DIAGNOSTICS_FILL_RS( hFacC,'hFactorC',0,Nr,0,1,1,myThid )
0413 ENDIF
0414
c83206cd4e Jean*0415 CALL DIAGNOSTICS_FILL(theta,'THETA ',0,Nr,0,1,1,myThid)
0416 CALL DIAGNOSTICS_FILL(salt, 'SALT ',0,Nr,0,1,1,myThid)
62f9c88755 Jean*0417
d316948822 Andr*0418 #ifdef ALLOW_FIZHI
8ce775c441 Jean*0419 IF ( useFIZHI .AND. DIAGNOSTICS_IS_ON('RELHUM ',myThid) ) THEN
d316948822 Andr*0420 kappa = getcon('KAPPA')
8ce775c441 Jean*0421 DO bj = myByLo(myThid), myByHi(myThid)
0422 DO bi = myBxLo(myThid), myBxHi(myThid)
0423 DO j = 1,sNy
0424 DO i = 1,sNx
0425 DO k = 1,Nr
0426 dummy1 = theta(i,j,k,bi,bj) * ((rC(k)/100.)/1000.)**kappa
0427 dummy2 = rC(k) / 100.
0428 CALL QSAT(dummy1,dummy2,dummy3,dummy4,.false.)
0429 tmpMk(i,j,k,bi,bj) = hFacC(i,j,k,bi,bj)
0430 & *salt(i,j,k,bi,bj)*100. / dummy3
0431 ENDDO
0432 ENDDO
0433 ENDDO
0434 ENDDO
0435 ENDDO
d316948822 Andr*0436 CALL DIAGNOSTICS_FILL(tmpMk, 'RELHUM ',0,Nr,0,1,1,myThid)
0437 ENDIF
0438 #endif /* ALLOW_FIZHI */
0439
d9055b137d Jean*0440 CALL DIAGNOSTICS_SCALE_FILL( theta, oneRL, 2,
62f9c88755 Jean*0441 & 'THETASQ ',0,Nr,0,1,1,myThid)
d9055b137d Jean*0442 CALL DIAGNOSTICS_SCALE_FILL( salt, oneRL, 2,
62f9c88755 Jean*0443 & 'SALTSQ ',0,Nr,0,1,1,myThid)
9ba8ef70b1 Jean*0444
8ce775c441 Jean*0445 #ifdef ALLOW_GENERIC_ADVDIFF
0446 # ifdef ALLOW_ADAMSBASHFORTH_3
0447 IF ( selectVars.EQ.1 ) THEN
0448
0449 m1 = 1 + MOD(myIter,2)
0450 ELSE
0451
0452 m1 = 1 + MOD(myIter+1,2)
0453 ENDIF
0454 IF ( AdamsBashforthGt )
0455 & CALL DIAGNOSTICS_FILL( gtNm(1-OLx,1-OLy,1,1,1,m1),
0456 & 'gTinAB ',0,Nr,0,1,1,myThid )
0457 IF ( AdamsBashforthGs )
0458 & CALL DIAGNOSTICS_FILL( gsNm(1-OLx,1-OLy,1,1,1,m1),
0459 & 'gSinAB ',0,Nr,0,1,1,myThid )
0460 # else /* ALLOW_ADAMSBASHFORTH_3 */
0461 IF ( AdamsBashforthGt )
0462 & CALL DIAGNOSTICS_FILL( gtNm1,'gTinAB ',0,Nr,0,1,1,myThid )
0463 IF ( AdamsBashforthGs )
0464 & CALL DIAGNOSTICS_FILL( gsNm1,'gSinAB ',0,Nr,0,1,1,myThid )
0465 # endif /* ALLOW_ADAMSBASHFORTH_3 */
0466 #endif /* ALLOW_GENERIC_ADVDIFF */
0467
b21f2d376f Jean*0468
0469
0470
0471
0472
0473
0474
0475
0476
0477
0478
0479
9ba8ef70b1 Jean*0480
b21f2d376f Jean*0481
0482
0483
0484
0485
0486
0487
0488
0489
0490
0491
0492
c83206cd4e Jean*0493
9ba8ef70b1 Jean*0494 IF ( fluidIsWater .AND.
0495 & ( DIAGNOSTICS_IS_ON('SALTanom',myThid)
0496 & .OR.DIAGNOSTICS_IS_ON('SALTSQan',myThid) ) ) THEN
23753a76a9 Dimi*0497 DO bj = myByLo(myThid), myByHi(myThid)
0498 DO bi = myBxLo(myThid), myBxHi(myThid)
8ce775c441 Jean*0499 DO k=1,Nr
23753a76a9 Dimi*0500 DO j = 1,sNy
0501 DO i = 1,sNx
8ce775c441 Jean*0502 tmpMk(i,j,k,bi,bj) = salt(i,j,k,bi,bj)-35. _d 0
23753a76a9 Dimi*0503 ENDDO
0504 ENDDO
0505 ENDDO
0506 ENDDO
0507 ENDDO
9ba8ef70b1 Jean*0508 CALL DIAGNOSTICS_FILL( tmpMk,'SALTanom',0,Nr,0,1,1,myThid)
d9055b137d Jean*0509 CALL DIAGNOSTICS_SCALE_FILL( tmpMk, oneRL, 2,
9ba8ef70b1 Jean*0510 & 'SALTSQan',0,Nr,0,1,1,myThid)
23753a76a9 Dimi*0511 ENDIF
9ba8ef70b1 Jean*0512
c83206cd4e Jean*0513
0514
0515 IF ( DIAGNOSTICS_IS_ON('UVELMASS',myThid) ) THEN
0516 DO bj = myByLo(myThid), myByHi(myThid)
0517 DO bi = myBxLo(myThid), myBxHi(myThid)
8ce775c441 Jean*0518 DO k=1,Nr
337bea277a Jean*0519 DO j = 1,sNy
e2067c2922 Jean*0520 DO i = 1,sNx+1
8ce775c441 Jean*0521 tmpMk(i,j,k,bi,bj)
0522 & = uVel(i,j,k,bi,bj)*hFacW(i,j,k,bi,bj)
337bea277a Jean*0523 ENDDO
0524 ENDDO
c83206cd4e Jean*0525 ENDDO
337bea277a Jean*0526 ENDDO
c83206cd4e Jean*0527 ENDDO
0528 CALL DIAGNOSTICS_FILL(tmpMk,'UVELMASS',0,Nr,0,1,1,myThid)
0529 ENDIF
2e735ea21e Andr*0530
c83206cd4e Jean*0531 IF ( DIAGNOSTICS_IS_ON('VVELMASS',myThid) ) THEN
0532 DO bj = myByLo(myThid), myByHi(myThid)
0533 DO bi = myBxLo(myThid), myBxHi(myThid)
8ce775c441 Jean*0534 DO k=1,Nr
e2067c2922 Jean*0535 DO j = 1,sNy+1
337bea277a Jean*0536 DO i = 1,sNx
8ce775c441 Jean*0537 tmpMk(i,j,k,bi,bj)
0538 & = vVel(i,j,k,bi,bj)*hFacS(i,j,k,bi,bj)
337bea277a Jean*0539 ENDDO
0540 ENDDO
c83206cd4e Jean*0541 ENDDO
337bea277a Jean*0542 ENDDO
c83206cd4e Jean*0543 ENDDO
0544 CALL DIAGNOSTICS_FILL(tmpMk,'VVELMASS',0,Nr,0,1,1,myThid)
0545 ENDIF
2e735ea21e Andr*0546
c83206cd4e Jean*0547 CALL DIAGNOSTICS_FILL(wVel, 'WVELMASS',0,Nr,0,1,1,myThid)
0548
0549 IF ( DIAGNOSTICS_IS_ON('UTHMASS ',myThid) ) THEN
0550 DO bj = myByLo(myThid), myByHi(myThid)
0551 DO bi = myBxLo(myThid), myBxHi(myThid)
8ce775c441 Jean*0552 DO k=1,Nr
337bea277a Jean*0553 DO j = 1,sNy
c83206cd4e Jean*0554 DO i = 1,sNx+1
8ce775c441 Jean*0555 tmpMk(i,j,k,bi,bj) = uVel(i,j,k,bi,bj)*0.5 _d 0
0556 & *(theta(i,j,k,bi,bj)+theta(i-1,j,k,bi,bj))
0557 & * hFacW(i,j,k,bi,bj)
c83206cd4e Jean*0558 ENDDO
337bea277a Jean*0559 ENDDO
c83206cd4e Jean*0560 ENDDO
337bea277a Jean*0561 ENDDO
c83206cd4e Jean*0562 ENDDO
0563 CALL DIAGNOSTICS_FILL(tmpMk,'UTHMASS ',0,Nr,0,1,1,myThid)
0564 ENDIF
2e735ea21e Andr*0565
c83206cd4e Jean*0566 IF ( DIAGNOSTICS_IS_ON('VTHMASS ',myThid) ) THEN
0567 DO bj = myByLo(myThid), myByHi(myThid)
0568 DO bi = myBxLo(myThid), myBxHi(myThid)
8ce775c441 Jean*0569 DO k=1,Nr
c83206cd4e Jean*0570 DO j = 1,sNy+1
0571 DO i = 1,sNx
8ce775c441 Jean*0572 tmpMk(i,j,k,bi,bj) = vVel(i,j,k,bi,bj)*0.5 _d 0
0573 & *(theta(i,j,k,bi,bj)+theta(i,j-1,k,bi,bj))
0574 & * hFacS(i,j,k,bi,bj)
c83206cd4e Jean*0575 ENDDO
337bea277a Jean*0576 ENDDO
c83206cd4e Jean*0577 ENDDO
337bea277a Jean*0578 ENDDO
c83206cd4e Jean*0579 ENDDO
0580 CALL DIAGNOSTICS_FILL(tmpMk,'VTHMASS ',0,Nr,0,1,1,myThid)
0581 ENDIF
9ba8ef70b1 Jean*0582
c83206cd4e Jean*0583 IF ( DIAGNOSTICS_IS_ON('WTHMASS ',myThid) ) THEN
0584 DO bj = myByLo(myThid), myByHi(myThid)
0585 DO bi = myBxLo(myThid), myBxHi(myThid)
8ce775c441 Jean*0586 DO k=1,Nr
c83206cd4e Jean*0587 km1 = MAX(k-1,1)
337bea277a Jean*0588 DO j = 1,sNy
c83206cd4e Jean*0589 DO i = 1,sNx
8ce775c441 Jean*0590 tmpMk(i,j,k,bi,bj) = wVel(i,j,k,bi,bj)*0.5 _d 0
0591 & *(theta(i,j,k,bi,bj)+theta(i,j,km1,bi,bj))
c83206cd4e Jean*0592 ENDDO
0593 ENDDO
0594 ENDDO
0595 ENDDO
0596 ENDDO
0597 CALL DIAGNOSTICS_FILL(tmpMk,'WTHMASS ',0,Nr,0,1,1,myThid)
0598 ENDIF
0599
0600 IF ( DIAGNOSTICS_IS_ON('USLTMASS',myThid) ) THEN
0601 DO bj = myByLo(myThid), myByHi(myThid)
0602 DO bi = myBxLo(myThid), myBxHi(myThid)
8ce775c441 Jean*0603 DO k=1,Nr
c83206cd4e Jean*0604 DO j = 1,sNy
0605 DO i = 1,sNx+1
8ce775c441 Jean*0606 tmpMk(i,j,k,bi,bj) = uVel(i,j,k,bi,bj)*0.5 _d 0
0607 & *(salt(i,j,k,bi,bj)+salt(i-1,j,k,bi,bj))
0608 & * hFacW(i,j,k,bi,bj)
c83206cd4e Jean*0609 ENDDO
337bea277a Jean*0610 ENDDO
c83206cd4e Jean*0611 ENDDO
337bea277a Jean*0612 ENDDO
c83206cd4e Jean*0613 ENDDO
0614 CALL DIAGNOSTICS_FILL(tmpMk,'USLTMASS',0,Nr,0,1,1,myThid)
0615 ENDIF
2e735ea21e Andr*0616
c83206cd4e Jean*0617 IF ( DIAGNOSTICS_IS_ON('VSLTMASS',myThid) ) THEN
0618 DO bj = myByLo(myThid), myByHi(myThid)
0619 DO bi = myBxLo(myThid), myBxHi(myThid)
8ce775c441 Jean*0620 DO k=1,Nr
c83206cd4e Jean*0621 DO j = 1,sNy+1
0622 DO i = 1,sNx
8ce775c441 Jean*0623 tmpMk(i,j,k,bi,bj) = vVel(i,j,k,bi,bj)*0.5 _d 0
0624 & *(salt(i,j,k,bi,bj)+salt(i,j-1,k,bi,bj))
0625 & * hFacS(i,j,k,bi,bj)
c83206cd4e Jean*0626 ENDDO
337bea277a Jean*0627 ENDDO
c83206cd4e Jean*0628 ENDDO
337bea277a Jean*0629 ENDDO
c83206cd4e Jean*0630 ENDDO
0631 CALL DIAGNOSTICS_FILL(tmpMk,'VSLTMASS',0,Nr,0,1,1,myThid)
0632 ENDIF
9ba8ef70b1 Jean*0633
c83206cd4e Jean*0634 IF ( DIAGNOSTICS_IS_ON('WSLTMASS',myThid) ) THEN
0635 DO bj = myByLo(myThid), myByHi(myThid)
0636 DO bi = myBxLo(myThid), myBxHi(myThid)
8ce775c441 Jean*0637 DO k=1,Nr
c83206cd4e Jean*0638 km1 = MAX(k-1,1)
0639 DO j = 1,sNy
0640 DO i = 1,sNx
8ce775c441 Jean*0641 tmpMk(i,j,k,bi,bj) = wVel(i,j,k,bi,bj)*0.5 _d 0
0642 & *(salt(i,j,k,bi,bj)+salt(i,j,km1,bi,bj))
c83206cd4e Jean*0643 ENDDO
0644 ENDDO
0645 ENDDO
0646 ENDDO
0647 ENDDO
0648 CALL DIAGNOSTICS_FILL(tmpMk,'WSLTMASS',0,Nr,0,1,1,myThid)
0649 ENDIF
9ba8ef70b1 Jean*0650
c83206cd4e Jean*0651
0652 ENDIF
0653
7b936be362 Andr*0654 IF ( selectVars.EQ.4 ) THEN
0655
3ab2854677 Dimi*0656
d9055b137d Jean*0657
7b936be362 Andr*0658
d9055b137d Jean*0659 tmpFac = 86400. _d 0/deltaTMom
0660 DO bj = myByLo(myThid), myByHi(myThid)
0661 DO bi = myBxLo(myThid), myBxHi(myThid)
0662 CALL DIAGNOSTICS_SCALE_FILL( uVel, tmpFac, 1,
0663 & 'TOTUTEND',0,Nr,-1,bi,bj,myThid )
0664 CALL DIAGNOSTICS_SCALE_FILL( vVel, tmpFac, 1,
0665 & 'TOTVTEND',0,Nr,-1,bi,bj,myThid )
7b936be362 Andr*0666 ENDDO
d9055b137d Jean*0667 ENDDO
9ba8ef70b1 Jean*0668
7b936be362 Andr*0669 IF ( DIAGNOSTICS_IS_ON('TOTTTEND',myThid) ) THEN
0670 DO bj = myByLo(myThid), myByHi(myThid)
0671 DO bi = myBxLo(myThid), myBxHi(myThid)
8ce775c441 Jean*0672 DO k=1,Nr
d9055b137d Jean*0673 tmpFac = 86400. _d 0/dTtracerLev(k)
7b936be362 Andr*0674 DO j = 1,sNy
0675 DO i = 1,sNx
d9055b137d Jean*0676 tmpMk(i,j,k,bi,bj) = tmpFac*theta(i,j,k,bi,bj)
7b936be362 Andr*0677 ENDDO
0678 ENDDO
0679 ENDDO
0680 CALL DIAGNOSTICS_FILL(tmpMk,'TOTTTEND',0,Nr,-1,bi,bj,myThid)
edd113ba3f Ryan*0681 #ifdef ALLOW_LAYERS
0682 IF ( useLayers ) THEN
0683 CALL LAYERS_FILL(tmpMk,1,'TOT',0,Nr,-1,bi,bj,myThid)
0684 ENDIF
ff78c25591 Jean*0685 #endif /* ALLOW_LAYERS */
7b936be362 Andr*0686 ENDDO
0687 ENDDO
0688 ENDIF
9ba8ef70b1 Jean*0689
7b936be362 Andr*0690 IF ( DIAGNOSTICS_IS_ON('TOTSTEND',myThid) ) THEN
0691 DO bj = myByLo(myThid), myByHi(myThid)
0692 DO bi = myBxLo(myThid), myBxHi(myThid)
8ce775c441 Jean*0693 DO k=1,Nr
d9055b137d Jean*0694 tmpFac = 86400. _d 0/dTtracerLev(k)
7b936be362 Andr*0695 DO j = 1,sNy
0696 DO i = 1,sNx
d9055b137d Jean*0697 tmpMk(i,j,k,bi,bj) = tmpFac*salt(i,j,k,bi,bj)
7b936be362 Andr*0698 ENDDO
0699 ENDDO
0700 ENDDO
0701 CALL DIAGNOSTICS_FILL(tmpMk,'TOTSTEND',0,Nr,-1,bi,bj,myThid)
edd113ba3f Ryan*0702 #ifdef ALLOW_LAYERS
0703 IF ( useLayers ) THEN
0704 CALL LAYERS_FILL(tmpMk,2,'TOT',0,Nr,-1,bi,bj,myThid)
0705 ENDIF
ff78c25591 Jean*0706 #endif /* ALLOW_LAYERS */
7b936be362 Andr*0707 ENDDO
0708 ENDDO
0709 ENDIF
0710
0711
0712 ENDIF
0713
ab685e6b35 Jean*0714 #endif /* ALLOW_DIAGNOSTICS */
9ba8ef70b1 Jean*0715
0716 RETURN
337bea277a Jean*0717 END