12 |
I tFld, sFld, |
I tFld, sFld, |
13 |
U phiHydF, |
U phiHydF, |
14 |
O phiHydC, dPhiHydX, dPhiHydY, |
O phiHydC, dPhiHydX, dPhiHydY, |
15 |
I myTime, myIter, myThid) |
I myTime, myIter, myThid ) |
16 |
C !DESCRIPTION: \bv |
C !DESCRIPTION: \bv |
17 |
C *==========================================================* |
C *==========================================================* |
18 |
C | SUBROUTINE CALC_PHI_HYD | |
C | SUBROUTINE CALC_PHI_HYD | |
19 |
C | o Integrate the hydrostatic relation to find the Hydros. | |
C | o Integrate the hydrostatic relation to find the Hydros. | |
20 |
C *==========================================================* |
C *==========================================================* |
21 |
C | Potential (ocean: Pressure/rho ; atmos = geopotential) |
C | Potential (ocean: Pressure/rho ; atmos = geopotential) |
22 |
C | On entry: |
C | On entry: |
23 |
C | tFld,sFld are the current thermodynamics quantities |
C | tFld,sFld are the current thermodynamics quantities |
24 |
C | (unchanged on exit) |
C | (unchanged on exit) |
25 |
C | phiHydF(i,j) is the hydrostatic Potential anomaly |
C | phiHydF(i,j) is the hydrostatic Potential anomaly |
26 |
C | at middle between tracer points k-1,k |
C | at middle between tracer points k-1,k |
27 |
C | On exit: |
C | On exit: |
28 |
C | phiHydC(i,j) is the hydrostatic Potential anomaly |
C | phiHydC(i,j) is the hydrostatic Potential anomaly |
29 |
C | at cell centers (tracer points), level k |
C | at cell centers (tracer points), level k |
30 |
C | phiHydF(i,j) is the hydrostatic Potential anomaly |
C | phiHydF(i,j) is the hydrostatic Potential anomaly |
31 |
C | at middle between tracer points k,k+1 |
C | at middle between tracer points k,k+1 |
32 |
C | dPhiHydX,Y hydrostatic Potential gradient (X&Y dir) |
C | dPhiHydX,Y hydrostatic Potential gradient (X&Y dir) |
33 |
C | at cell centers (tracer points), level k |
C | at cell centers (tracer points), level k |
34 |
C | integr_GeoPot allows to select one integration method |
C | integr_GeoPot allows to select one integration method |
51 |
|
|
52 |
C !INPUT/OUTPUT PARAMETERS: |
C !INPUT/OUTPUT PARAMETERS: |
53 |
C == Routine arguments == |
C == Routine arguments == |
54 |
C bi, bj, k :: tile and level indices |
C bi, bj, k :: tile and level indices |
55 |
C iMin,iMax,jMin,jMax :: computational domain |
C iMin,iMax,jMin,jMax :: computational domain |
56 |
C tFld :: potential temperature |
C tFld :: potential temperature |
57 |
C sFld :: salinity |
C sFld :: salinity |
72 |
_RL dPhiHydY(1-Olx:sNx+Olx,1-Oly:sNy+Oly) |
_RL dPhiHydY(1-Olx:sNx+Olx,1-Oly:sNy+Oly) |
73 |
_RL myTime |
_RL myTime |
74 |
INTEGER myIter, myThid |
INTEGER myIter, myThid |
75 |
|
|
76 |
#ifdef INCLUDE_PHIHYD_CALCULATION_CODE |
#ifdef INCLUDE_PHIHYD_CALCULATION_CODE |
77 |
|
|
78 |
C !LOCAL VARIABLES: |
C !LOCAL VARIABLES: |
83 |
_RL dRlocM,dRlocP, ddRloc, locAlpha |
_RL dRlocM,dRlocP, ddRloc, locAlpha |
84 |
_RL ddPIm, ddPIp, rec_dRm, rec_dRp |
_RL ddPIm, ddPIp, rec_dRm, rec_dRp |
85 |
_RL surfPhiFac |
_RL surfPhiFac |
|
INTEGER iMnLoc,jMnLoc |
|
86 |
PARAMETER ( zero= 0. _d 0 , one= 1. _d 0 , half= .5 _d 0 ) |
PARAMETER ( zero= 0. _d 0 , one= 1. _d 0 , half= .5 _d 0 ) |
87 |
LOGICAL useDiagPhiRlow, addSurfPhiAnom |
LOGICAL useDiagPhiRlow, addSurfPhiAnom |
88 |
CEOP |
CEOP |
92 |
IF (addSurfPhiAnom) surfPhiFac = 1. |
IF (addSurfPhiAnom) surfPhiFac = 1. |
93 |
|
|
94 |
C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----| |
C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----| |
95 |
C Atmosphere: |
C Atmosphere: |
96 |
C integr_GeoPot => select one option for the integration of the Geopotential: |
C integr_GeoPot => select one option for the integration of the Geopotential: |
97 |
C = 0 : Energy Conserving Form, accurate with Topo full cell; |
C = 0 : Energy Conserving Form, accurate with Topo full cell; |
98 |
C = 1 : Finite Volume Form, with Part-Cell, linear in P by Half level; |
C = 1 : Finite Volume Form, with Part-Cell, linear in P by Half level; |
99 |
C =2,3: Finite Difference Form, with Part-Cell, |
C =2,3: Finite Difference Form, with Part-Cell, |
100 |
C linear in P between 2 Tracer levels. |
C linear in P between 2 Tracer levels. |
101 |
C can handle both cases: Tracer lev at the middle of InterFace_W |
C can handle both cases: Tracer lev at the middle of InterFace_W |
102 |
C and InterFace_W at the middle of Tracer lev; |
C and InterFace_W at the middle of Tracer lev; |
103 |
C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----| |
C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----| |
104 |
|
|
119 |
& + act4*max1*max2*max3 |
& + act4*max1*max2*max3 |
120 |
#endif /* ALLOW_AUTODIFF_TAMC */ |
#endif /* ALLOW_AUTODIFF_TAMC */ |
121 |
|
|
122 |
C-- Initialize phiHydF to zero : |
C-- Initialize phiHydF to zero : |
123 |
C note: atmospheric_loading or Phi_topo anomaly are incorporated |
C note: atmospheric_loading or Phi_topo anomaly are incorporated |
124 |
C later in S/R calc_grad_phi_hyd |
C later in S/R calc_grad_phi_hyd |
125 |
IF (k.EQ.1) THEN |
IF (k.EQ.1) THEN |
135 |
C This is the hydrostatic pressure calculation for the Ocean |
C This is the hydrostatic pressure calculation for the Ocean |
136 |
C which uses the FIND_RHO() routine to calculate density |
C which uses the FIND_RHO() routine to calculate density |
137 |
C before integrating g*rho over the current layer/interface |
C before integrating g*rho over the current layer/interface |
138 |
#ifdef ALLOW_AUTODIFF_TAMC |
#ifdef ALLOW_AUTODIFF_TAMC |
139 |
CADJ GENERAL |
CADJ GENERAL |
140 |
#endif /* ALLOW_AUTODIFF_TAMC */ |
#endif /* ALLOW_AUTODIFF_TAMC */ |
141 |
|
|
142 |
|
IF ( implicitIntGravWave .OR. myIter.LT.0 ) THEN |
143 |
C--- Calculate density |
C--- Calculate density |
144 |
#ifdef ALLOW_AUTODIFF_TAMC |
#ifdef ALLOW_AUTODIFF_TAMC |
145 |
kkey = (ikey-1)*Nr + k |
kkey = (ikey-1)*Nr + k |
146 |
CADJ STORE tFld (:,:,k,bi,bj) = comlev1_bibj_k, key=kkey, byte=isbyte |
CADJ STORE tFld (:,:,k,bi,bj) = comlev1_bibj_k, key=kkey, byte=isbyte |
147 |
CADJ STORE sFld (:,:,k,bi,bj) = comlev1_bibj_k, key=kkey, byte=isbyte |
CADJ STORE sFld (:,:,k,bi,bj) = comlev1_bibj_k, key=kkey, byte=isbyte |
148 |
#endif /* ALLOW_AUTODIFF_TAMC */ |
#endif /* ALLOW_AUTODIFF_TAMC */ |
149 |
CALL FIND_RHO( bi, bj, iMin, iMax, jMin, jMax, k, k, |
CALL FIND_RHO_2D( |
150 |
& tFld, sFld, |
I iMin, iMax, jMin, jMax, k, |
151 |
& alphaRho, myThid) |
I tFld(1-OLx,1-OLy,k,bi,bj), |
152 |
|
I sFld(1-OLx,1-OLy,k,bi,bj), |
153 |
|
O alphaRho, |
154 |
|
I k, bi, bj, myThid ) |
155 |
|
ELSE |
156 |
|
DO j=jMin,jMax |
157 |
|
DO i=iMin,iMax |
158 |
|
alphaRho(i,j) = rhoInSitu(i,j,k,bi,bj) |
159 |
|
ENDDO |
160 |
|
ENDDO |
161 |
|
ENDIF |
162 |
|
|
163 |
#ifdef ALLOW_SHELFICE |
#ifdef ALLOW_SHELFICE |
164 |
C mask rho, so that there is no contribution of phiHyd from |
C mask rho, so that there is no contribution of phiHyd from |
165 |
C overlying shelfice (whose density we do not know) |
C overlying shelfice (whose density we do not know) |
166 |
IF ( useShelfIce ) THEN |
IF ( useShelfIce .AND. useDOWN_SLOPE ) THEN |
167 |
|
C- note: does not work for down_slope pkg which needs rho below the bottom. |
168 |
|
C setting rho=0 above the ice-shelf base is enough (and works in both cases) |
169 |
|
C but might be slower (--> keep original masking if not using down_slope pkg) |
170 |
|
DO j=jMin,jMax |
171 |
|
DO i=iMin,iMax |
172 |
|
IF ( k.LT.kSurfC(i,j,bi,bj) ) alphaRho(i,j) = 0. _d 0 |
173 |
|
ENDDO |
174 |
|
ENDDO |
175 |
|
ELSEIF ( useShelfIce ) THEN |
176 |
DO j=jMin,jMax |
DO j=jMin,jMax |
177 |
DO i=iMin,iMax |
DO i=iMin,iMax |
178 |
alphaRho(i,j) = alphaRho(i,j)*maskC(i,j,k,bi,bj) |
alphaRho(i,j) = alphaRho(i,j)*maskC(i,j,k,bi,bj) |
181 |
ENDIF |
ENDIF |
182 |
#endif /* ALLOW_SHELFICE */ |
#endif /* ALLOW_SHELFICE */ |
183 |
|
|
184 |
#ifdef ALLOW_DIAGNOSTICS |
#ifdef ALLOW_MOM_COMMON |
|
IF ( useDiagnostics ) |
|
|
& CALL DIAGNOSTICS_FILL(alphaRho,'RHOAnoma',k,1,2,bi,bj,myThid) |
|
|
#endif |
|
|
|
|
185 |
C Quasi-hydrostatic terms are added in as if they modify the buoyancy |
C Quasi-hydrostatic terms are added in as if they modify the buoyancy |
186 |
IF (quasiHydrostatic) THEN |
IF (quasiHydrostatic) THEN |
187 |
CALL QUASIHYDROSTATICTERMS(bi,bj,k,alphaRho,myThid) |
CALL MOM_QUASIHYDROSTATIC(bi,bj,k,uVel,vVel,alphaRho,myThid) |
188 |
ENDIF |
ENDIF |
189 |
|
#endif /* ALLOW_MOM_COMMON */ |
190 |
|
|
191 |
#ifdef NONLIN_FRSURF |
#ifdef NONLIN_FRSURF |
192 |
IF (k.EQ.1 .AND. addSurfPhiAnom) THEN |
IF (k.EQ.1 .AND. addSurfPhiAnom) THEN |
244 |
|
|
245 |
C -- end if integr_GeoPot = ... |
C -- end if integr_GeoPot = ... |
246 |
ENDIF |
ENDIF |
247 |
|
|
248 |
C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----| |
C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----| |
249 |
ELSEIF ( buoyancyRelation .EQ. 'OCEANICP' ) THEN |
ELSEIF ( buoyancyRelation .EQ. 'OCEANICP' ) THEN |
250 |
C This is the hydrostatic pressure calculation for the Ocean |
C This is the hydrostatic pressure calculation for the Ocean |
254 |
CADJ GENERAL |
CADJ GENERAL |
255 |
#endif /* ALLOW_AUTODIFF_TAMC */ |
#endif /* ALLOW_AUTODIFF_TAMC */ |
256 |
|
|
257 |
|
IF ( implicitIntGravWave .OR. myIter.LT.0 ) THEN |
258 |
C-- Calculate density |
C-- Calculate density |
259 |
#ifdef ALLOW_AUTODIFF_TAMC |
#ifdef ALLOW_AUTODIFF_TAMC |
260 |
kkey = (ikey-1)*Nr + k |
kkey = (ikey-1)*Nr + k |
261 |
CADJ STORE tFld (:,:,k,bi,bj) = comlev1_bibj_k, key=kkey, byte=isbyte |
CADJ STORE tFld (:,:,k,bi,bj) = comlev1_bibj_k, key=kkey, byte=isbyte |
262 |
CADJ STORE sFld (:,:,k,bi,bj) = comlev1_bibj_k, key=kkey, byte=isbyte |
CADJ STORE sFld (:,:,k,bi,bj) = comlev1_bibj_k, key=kkey, byte=isbyte |
263 |
#endif /* ALLOW_AUTODIFF_TAMC */ |
#endif /* ALLOW_AUTODIFF_TAMC */ |
264 |
CALL FIND_RHO( bi, bj, iMin, iMax, jMin, jMax, k, k, |
CALL FIND_RHO_2D( |
265 |
& tFld, sFld, |
I iMin, iMax, jMin, jMax, k, |
266 |
& alphaRho, myThid) |
I tFld(1-OLx,1-OLy,k,bi,bj), |
267 |
|
I sFld(1-OLx,1-OLy,k,bi,bj), |
268 |
|
O alphaRho, |
269 |
|
I k, bi, bj, myThid ) |
270 |
#ifdef ALLOW_AUTODIFF_TAMC |
#ifdef ALLOW_AUTODIFF_TAMC |
271 |
CADJ STORE alphaRho (:,:) = comlev1_bibj_k, key=kkey, byte=isbyte |
CADJ STORE alphaRho (:,:) = comlev1_bibj_k, key=kkey, byte=isbyte |
272 |
#endif /* ALLOW_AUTODIFF_TAMC */ |
#endif /* ALLOW_AUTODIFF_TAMC */ |
273 |
|
ELSE |
274 |
#ifdef ALLOW_DIAGNOSTICS |
DO j=jMin,jMax |
275 |
IF ( useDiagnostics ) |
DO i=iMin,iMax |
276 |
& CALL DIAGNOSTICS_FILL(alphaRho,'RHOAnoma',k,1,2,bi,bj,myThid) |
alphaRho(i,j) = rhoInSitu(i,j,k,bi,bj) |
277 |
#endif |
ENDDO |
278 |
|
ENDDO |
279 |
|
ENDIF |
280 |
|
|
281 |
C-- Calculate specific volume anomaly : alpha' = 1/rho - alpha_Cst |
C-- Calculate specific volume anomaly : alpha' = 1/rho - alpha_Cst |
282 |
DO j=jMin,jMax |
DO j=jMin,jMax |
299 |
C which has not been used to date since it does not |
C which has not been used to date since it does not |
300 |
C conserve KE+PE exactly even though it is more natural |
C conserve KE+PE exactly even though it is more natural |
301 |
C |
C |
302 |
IF (k.EQ.ksurfC(i,j,bi,bj)) THEN |
IF (k.EQ.kSurfC(i,j,bi,bj)) THEN |
303 |
ddRloc = Ro_surf(i,j,bi,bj)-rC(k) |
ddRloc = Ro_surf(i,j,bi,bj)-rC(k) |
304 |
#ifdef NONLIN_FRSURF |
#ifdef NONLIN_FRSURF |
305 |
ddRloc = ddRloc + surfPhiFac*etaH(i,j,bi,bj) |
ddRloc = ddRloc + surfPhiFac*etaH(i,j,bi,bj) |
306 |
#endif |
#endif |
307 |
phiHydC(i,j) = ddRloc*alphaRho(i,j) |
phiHydC(i,j) = ddRloc*alphaRho(i,j) |
308 |
c--to reproduce results of c48d_post: uncomment those 4+1 lines |
c--to reproduce results of c48d_post: uncomment those 4+1 lines |
309 |
c phiHydC(i,j)=phiHydF(i,j) |
c phiHydC(i,j)=phiHydF(i,j) |
310 |
c & +(hFacC(i,j,k,bi,bj)-half)*drF(k)*alphaRho(i,j) |
c & +(hFacC(i,j,k,bi,bj)-half)*drF(k)*alphaRho(i,j) |
311 |
c phiHydF(i,j)=phiHydF(i,j) |
c phiHydF(i,j)=phiHydF(i,j) |
338 |
|
|
339 |
C---------- This discretization is the "energy conserving" form |
C---------- This discretization is the "energy conserving" form |
340 |
|
|
341 |
IF (k.EQ.ksurfC(i,j,bi,bj)) THEN |
IF (k.EQ.kSurfC(i,j,bi,bj)) THEN |
342 |
ddRloc = Ro_surf(i,j,bi,bj)-rC(k) |
ddRloc = Ro_surf(i,j,bi,bj)-rC(k) |
343 |
#ifdef NONLIN_FRSURF |
#ifdef NONLIN_FRSURF |
344 |
ddRloc = ddRloc + surfPhiFac*etaH(i,j,bi,bj) |
ddRloc = ddRloc + surfPhiFac*etaH(i,j,bi,bj) |
366 |
DO j=jMin,jMax |
DO j=jMin,jMax |
367 |
DO i=iMin,iMax |
DO i=iMin,iMax |
368 |
alphaRho(i,j)=maskC(i,j,k,bi,bj) |
alphaRho(i,j)=maskC(i,j,k,bi,bj) |
369 |
& *( tFld(i,j,k,bi,bj)*(sFld(i,j,k,bi,bj)*atm_Rq+one) |
& *( tFld(i,j,k,bi,bj)*(sFld(i,j,k,bi,bj)*atm_Rq+one) |
370 |
& -tRef(k) ) |
& -tRef(k) ) |
371 |
ENDDO |
ENDDO |
372 |
ENDDO |
ENDDO |
377 |
C -- Energy Conserving Form, accurate with Full cell topo -- |
C -- Energy Conserving Form, accurate with Full cell topo -- |
378 |
C------------ The integration for the first level phi(k=1) is the same |
C------------ The integration for the first level phi(k=1) is the same |
379 |
C for both the "finite volume" and energy conserving methods. |
C for both the "finite volume" and energy conserving methods. |
380 |
C *NOTE* o Working with geopotential Anomaly, the geopotential boundary |
C *NOTE* o Working with geopotential Anomaly, the geopotential boundary |
381 |
C condition is simply Phi-prime(Ro_surf)=0. |
C condition is simply Phi-prime(Ro_surf)=0. |
382 |
C o convention ddPI > 0 (same as drF & drC) |
C o convention ddPI > 0 (same as drF & drC) |
383 |
C----------------------------------------------------------------------- |
C----------------------------------------------------------------------- |
393 |
& -((rF(k+1)/atm_Po)**atm_kappa) ) |
& -((rF(k+1)/atm_Po)**atm_kappa) ) |
394 |
ELSE |
ELSE |
395 |
ddPIp=atm_Cp*( ((rC( k )/atm_Po)**atm_kappa) |
ddPIp=atm_Cp*( ((rC( k )/atm_Po)**atm_kappa) |
396 |
& -((rC(k+1)/atm_Po)**atm_kappa) )*half |
& -((rC(k+1)/atm_Po)**atm_kappa) )*half |
397 |
ENDIF |
ENDIF |
398 |
C-------- This discretization is the energy conserving form |
C-------- This discretization is the energy conserving form |
399 |
DO j=jMin,jMax |
DO j=jMin,jMax |
412 |
C Note: a true Finite Volume form should be linear between 2 Interf_W : |
C Note: a true Finite Volume form should be linear between 2 Interf_W : |
413 |
C phi_C = (phi_W_k+ phi_W_k+1)/2 ; but not accurate in Stratosphere (low p) |
C phi_C = (phi_W_k+ phi_W_k+1)/2 ; but not accurate in Stratosphere (low p) |
414 |
C also: if Interface_W at the middle between tracer levels, this form |
C also: if Interface_W at the middle between tracer levels, this form |
415 |
C is close to the Energy Cons. form in the Interior, except for the |
C is close to the Energy Cons. form in the Interior, except for the |
416 |
C non-linearity in PI(p) |
C non-linearity in PI(p) |
417 |
C--------- |
C--------- |
418 |
ddPIm=atm_Cp*( ((rF( k )/atm_Po)**atm_kappa) |
ddPIm=atm_Cp*( ((rF( k )/atm_Po)**atm_kappa) |
421 |
& -((rF(k+1)/atm_Po)**atm_kappa) ) |
& -((rF(k+1)/atm_Po)**atm_kappa) ) |
422 |
DO j=jMin,jMax |
DO j=jMin,jMax |
423 |
DO i=iMin,iMax |
DO i=iMin,iMax |
424 |
IF (k.EQ.ksurfC(i,j,bi,bj)) THEN |
IF (k.EQ.kSurfC(i,j,bi,bj)) THEN |
425 |
ddRloc = Ro_surf(i,j,bi,bj)-rC(k) |
ddRloc = Ro_surf(i,j,bi,bj)-rC(k) |
426 |
#ifdef NONLIN_FRSURF |
#ifdef NONLIN_FRSURF |
427 |
ddRloc = ddRloc + surfPhiFac*etaH(i,j,bi,bj) |
ddRloc = ddRloc + surfPhiFac*etaH(i,j,bi,bj) |
439 |
|
|
440 |
ELSEIF ( integr_GeoPot.EQ.2 |
ELSEIF ( integr_GeoPot.EQ.2 |
441 |
& .OR. integr_GeoPot.EQ.3 ) THEN |
& .OR. integr_GeoPot.EQ.3 ) THEN |
442 |
C -- Finite Difference Form, with Part-Cell Topo, |
C -- Finite Difference Form, with Part-Cell Topo, |
443 |
C works with Interface_W at the middle between 2.Tracer_Level |
C works with Interface_W at the middle between 2.Tracer_Level |
444 |
C and with Tracer_Level at the middle between 2.Interface_W. |
C and with Tracer_Level at the middle between 2.Interface_W. |
445 |
C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----| |
C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----| |
446 |
C Finite Difference formulation consistent with Partial Cell, |
C Finite Difference formulation consistent with Partial Cell, |
447 |
C Valid & accurate if Interface_W at middle between tracer levels |
C Valid & accurate if Interface_W at middle between tracer levels |
448 |
C linear in p between 2 Tracer levels ; conserve energy in the Interior |
C linear in p between 2 Tracer levels ; conserve energy in the Interior |
449 |
C--------- |
C--------- |
450 |
IF (k.EQ.1) THEN |
IF (k.EQ.1) THEN |
451 |
ddPIm=atm_Cp*( ((rF( k )/atm_Po)**atm_kappa) |
ddPIm=atm_Cp*( ((rF( k )/atm_Po)**atm_kappa) |
459 |
& -((rF(k+1)/atm_Po)**atm_kappa) ) |
& -((rF(k+1)/atm_Po)**atm_kappa) ) |
460 |
ELSE |
ELSE |
461 |
ddPIp=atm_Cp*( ((rC( k )/atm_Po)**atm_kappa) |
ddPIp=atm_Cp*( ((rC( k )/atm_Po)**atm_kappa) |
462 |
& -((rC(k+1)/atm_Po)**atm_kappa) )*half |
& -((rC(k+1)/atm_Po)**atm_kappa) )*half |
463 |
ENDIF |
ENDIF |
464 |
rec_dRm = one/(rF(k)-rC(k)) |
rec_dRm = one/(rF(k)-rC(k)) |
465 |
rec_dRp = one/(rC(k)-rF(k+1)) |
rec_dRp = one/(rC(k)-rF(k+1)) |
466 |
DO j=jMin,jMax |
DO j=jMin,jMax |
467 |
DO i=iMin,iMax |
DO i=iMin,iMax |
468 |
IF (k.EQ.ksurfC(i,j,bi,bj)) THEN |
IF (k.EQ.kSurfC(i,j,bi,bj)) THEN |
469 |
ddRloc = Ro_surf(i,j,bi,bj)-rC(k) |
ddRloc = Ro_surf(i,j,bi,bj)-rC(k) |
470 |
#ifdef NONLIN_FRSURF |
#ifdef NONLIN_FRSURF |
471 |
ddRloc = ddRloc + surfPhiFac*etaH(i,j,bi,bj) |
ddRloc = ddRloc + surfPhiFac*etaH(i,j,bi,bj) |
499 |
CALL DIAGS_PHI_RLOW( |
CALL DIAGS_PHI_RLOW( |
500 |
I k, bi, bj, iMin,iMax, jMin,jMax, |
I k, bi, bj, iMin,iMax, jMin,jMax, |
501 |
I phiHydF, phiHydC, alphaRho, tFld, sFld, |
I phiHydF, phiHydC, alphaRho, tFld, sFld, |
502 |
I myTime, myIter, myThid) |
I myTime, myIter, myThid) |
503 |
ENDIF |
ENDIF |
504 |
|
|
505 |
C--- Diagnose Full Hydrostatic Potential at cell center level |
C--- Diagnose Full Hydrostatic Potential at cell center level |
508 |
I phiHydC, |
I phiHydC, |
509 |
I myTime, myIter, myThid) |
I myTime, myIter, myThid) |
510 |
|
|
511 |
IF (momPressureForcing) THEN |
IF (momPressureForcing) THEN |
|
iMnLoc = MAX(1-Olx+1,iMin) |
|
|
jMnLoc = MAX(1-Oly+1,jMin) |
|
512 |
CALL CALC_GRAD_PHI_HYD( |
CALL CALC_GRAD_PHI_HYD( |
513 |
I k, bi, bj, iMnLoc,iMax, jMnLoc,jMax, |
I k, bi, bj, iMin,iMax, jMin,jMax, |
514 |
I phiHydC, alphaRho, tFld, sFld, |
I phiHydC, alphaRho, tFld, sFld, |
515 |
O dPhiHydX, dPhiHydY, |
O dPhiHydX, dPhiHydY, |
516 |
I myTime, myIter, myThid) |
I myTime, myIter, myThid) |
517 |
ENDIF |
ENDIF |
518 |
|
|
519 |
#endif /* INCLUDE_PHIHYD_CALCULATION_CODE */ |
#endif /* INCLUDE_PHIHYD_CALCULATION_CODE */ |