5 |
SUBROUTINE CALC_PHI_HYD( |
SUBROUTINE CALC_PHI_HYD( |
6 |
I bi, bj, iMin, iMax, jMin, jMax, K, |
I bi, bj, iMin, iMax, jMin, jMax, K, |
7 |
I theta, salt, |
I theta, salt, |
8 |
U phiHyd, phiHydInterface, |
U phiHyd, |
9 |
I myThid) |
I myThid) |
10 |
C /==========================================================\ |
C /==========================================================\ |
11 |
C | SUBROUTINE CALC_PHI_HYD | |
C | SUBROUTINE CALC_PHI_HYD | |
18 |
C | at cell centers (tracer points) | |
C | at cell centers (tracer points) | |
19 |
C | - 1:k-1 layers are valid | |
C | - 1:k-1 layers are valid | |
20 |
C | - k:Nr layers are invalid | |
C | - k:Nr layers are invalid | |
21 |
C | phiHydInterface(i,j) is the hydrostatic pressure/geop. | |
C | phiHyd(i,j,k) is the hydrostatic pressure/geop. | |
22 |
C | at cell the interface k (w point above) | |
C | at cell the interface k (w point above) | |
23 |
C | On exit: | |
C | On exit: | |
24 |
C | phiHyd(i,j,1:k) is the hydrostatic pressure/geopot. | |
C | phiHyd(i,j,1:k) is the hydrostatic pressure/geopot. | |
25 |
C | at cell centers (tracer points) | |
C | at cell centers (tracer points) | |
26 |
C | - 1:k layers are valid | |
C | - 1:k layers are valid | |
27 |
C | - k+1:Nr layers are invalid | |
C | - k+1:Nr layers are invalid | |
28 |
C | phiHydInterface(i,j) is the hydrostatic pressure/geop. | |
C | phiHyd(i,j,k+1) is the hydrostatic pressure/geop. | |
29 |
C | at cell the interface k+1 (w point below)| |
C | at cell the interface k+1 (w point below)| |
30 |
C | | |
C | | |
31 |
C \==========================================================/ |
C \==========================================================/ |
40 |
_RL theta(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr,nSx,nSy) |
_RL theta(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr,nSx,nSy) |
41 |
_RL salt(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr,nSx,nSy) |
_RL salt(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr,nSx,nSy) |
42 |
_RL phiHyd(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr) |
_RL phiHyd(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr) |
|
_RL phiHydInterface(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
|
43 |
INTEGER myThid |
INTEGER myThid |
44 |
|
|
45 |
#ifdef INCLUDE_PHIHYD_CALCULATION_CODE |
#ifdef INCLUDE_PHIHYD_CALCULATION_CODE |
70 |
DO j=jMin,jMax |
DO j=jMin,jMax |
71 |
DO i=iMin,iMax |
DO i=iMin,iMax |
72 |
C *NOTE* The loading should go here but has not been implemented yet |
C *NOTE* The loading should go here but has not been implemented yet |
|
phiHydInterface(i,j)=0. |
|
73 |
phiHyd(i,j,k)=0. |
phiHyd(i,j,k)=0. |
74 |
ENDDO |
ENDDO |
75 |
ENDDO |
ENDDO |
92 |
C which has not been used to date since it does not |
C which has not been used to date since it does not |
93 |
C conserve KE+PE exactly even though it is more natural |
C conserve KE+PE exactly even though it is more natural |
94 |
C |
C |
95 |
c phiHyd(i,j,k)=phiHydInterface(i,j)+ |
c IF (k.LT.Nr) phiHyd(i,j,k+1)=phiHyd(i,j,k)+ |
|
c & 0.5*drF(K)*gravity*alphaRho(i,j) |
|
|
c phiHydInterface(i,j)=phiHydInterface(i,j)+ |
|
96 |
c & drF(K)*gravity*alphaRho(i,j) |
c & drF(K)*gravity*alphaRho(i,j) |
97 |
|
c phiHyd(i,j,k)=phiHyd(i,j,k)+ |
98 |
|
c & 0.5*drF(K)*gravity*alphaRho(i,j) |
99 |
C----------------------------------------------------------------------- |
C----------------------------------------------------------------------- |
100 |
|
|
101 |
C---------- This discretization is the "energy conserving" form |
C---------- This discretization is the "energy conserving" form |
103 |
C |
C |
104 |
phiHyd(i,j,k)=phiHyd(i,j,k)+ |
phiHyd(i,j,k)=phiHyd(i,j,k)+ |
105 |
& 0.5*dRloc*gravity*alphaRho(i,j) |
& 0.5*dRloc*gravity*alphaRho(i,j) |
106 |
phiHyd(i,j,k+1)=phiHyd(i,j,k)+ |
IF (k.LT.Nr) phiHyd(i,j,k+1)=phiHyd(i,j,k)+ |
107 |
& 0.5*dRlocKp1*gravity*alphaRho(i,j) |
& 0.5*dRlocKp1*gravity*alphaRho(i,j) |
108 |
C----------------------------------------------------------------------- |
C----------------------------------------------------------------------- |
109 |
ENDDO |
ENDDO |