25 |
#include "SIZE.h" |
#include "SIZE.h" |
26 |
#include "EEPARAMS.h" |
#include "EEPARAMS.h" |
27 |
#include "CG2D.h" |
#include "CG2D.h" |
28 |
|
#include "DYNVARS.h" |
29 |
|
|
30 |
C == Routine arguments == |
C == Routine arguments == |
31 |
C myThid - Thread number for this instance of the routine. |
C myThid - Thread number for this instance of the routine. |
77 |
_RL fVerU (1-OLx:sNx+OLx,1-OLy:sNy+OLy,2) |
_RL fVerU (1-OLx:sNx+OLx,1-OLy:sNy+OLy,2) |
78 |
_RL fVerV (1-OLx:sNx+OLx,1-OLy:sNy+OLy,2) |
_RL fVerV (1-OLx:sNx+OLx,1-OLy:sNy+OLy,2) |
79 |
_RL pH (1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nz) |
_RL pH (1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nz) |
80 |
|
_RL rhokm1(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
81 |
|
_RL rhokp1(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
82 |
INTEGER iMin, iMax |
INTEGER iMin, iMax |
83 |
INTEGER jMin, jMax |
INTEGER jMin, jMax |
84 |
INTEGER bi, bj |
INTEGER bi, bj |
106 |
DO K=1,nZ |
DO K=1,nZ |
107 |
pH (i,j,k) = 0.*1. _d 37 |
pH (i,j,k) = 0.*1. _d 37 |
108 |
ENDDO |
ENDDO |
109 |
|
rhokm1(i,j) = 0. _d 0 |
110 |
|
rhokp1(i,j) = 0. _d 0 |
111 |
ENDDO |
ENDDO |
112 |
ENDDO |
ENDDO |
113 |
C-- Set up work arrays that need valid initial values |
C-- Set up work arrays that need valid initial values |
128 |
DO bj=myByLo(myThid),myByHi(myThid) |
DO bj=myByLo(myThid),myByHi(myThid) |
129 |
DO bi=myBxLo(myThid),myBxHi(myThid) |
DO bi=myBxLo(myThid),myBxHi(myThid) |
130 |
|
|
131 |
|
C-- Boundary condition on hydrostatic pressure is pH(z=0)=0 |
132 |
|
DO j=1-OLy,sNy+OLy |
133 |
|
DO i=1-OLx,sNx+OLx |
134 |
|
pH(i,j,1) = 0. _d 0 |
135 |
|
ENDDO |
136 |
|
ENDDO |
137 |
|
|
138 |
iMin = 1-OLx+1 |
iMin = 1-OLx+1 |
139 |
iMax = sNx+OLx |
iMax = sNx+OLx |
140 |
jMin = 1-OLy+1 |
jMin = 1-OLy+1 |
144 |
CALL TIMESTEP( |
CALL TIMESTEP( |
145 |
I bi,bj,iMin,iMax,jMin,jMax,myThid) |
I bi,bj,iMin,iMax,jMin,jMax,myThid) |
146 |
|
|
147 |
C-- Calculate rho with the appropriate equation of state |
DO K=2,Nz |
148 |
CALL FIND_RHO( |
C Density of K-1 level (above W(K)) reference to K level |
149 |
I bi,bj,iMin,iMax,jMin,jMax,myThid) |
CALL FIND_RHO( |
150 |
|
I bi, bj, iMin, iMax, jMin, jMax, K-1, K, 'LINEAR', |
151 |
|
O rhoKm1, |
152 |
|
I myThid ) |
153 |
|
C Density of K level (below W(K)) reference to K level |
154 |
|
CALL FIND_RHO( |
155 |
|
I bi, bj, iMin, iMax, jMin, jMax, K, K, 'LINEAR', |
156 |
|
O rhoKp1, |
157 |
|
I myThid ) |
158 |
C-- Calculate static stability and mix where convectively unstable |
C-- Calculate static stability and mix where convectively unstable |
159 |
CALL CONVECT( |
CALL CONVECT( |
160 |
I bi,bj,iMin,iMax,jMin,jMax,myThid) |
I bi,bj,iMin,iMax,jMin,jMax,K,rhoKm1,rhoKp1,myThid) |
161 |
|
C Density of K-1 level (above W(K)) reference to K-1 level |
162 |
|
CALL FIND_RHO( |
163 |
|
I bi, bj, iMin, iMax, jMin, jMax, K-1, K-1, 'LINEAR', |
164 |
|
O rhoKm1, |
165 |
|
I myThid ) |
166 |
|
C-- Integrate hydrostatic balance for pH with BC of pH(z=0)=0 |
167 |
|
CALL CALC_PH( |
168 |
|
I bi,bj,iMin,iMax,jMin,jMax,K,rhoKm1, |
169 |
|
U pH, |
170 |
|
I myThid ) |
171 |
|
ENDDO ! K |
172 |
|
|
173 |
|
C Density of Nz level (bottom level) reference to Nz level |
174 |
|
CALL FIND_RHO( |
175 |
|
I bi, bj, iMin, iMax, jMin, jMax, Nz, Nz, 'LINEAR', |
176 |
|
O rhoKm1, |
177 |
|
I myThid ) |
178 |
C-- Integrate hydrostatic balance for pH with BC of pH(z=0)=0 |
C-- Integrate hydrostatic balance for pH with BC of pH(z=0)=0 |
179 |
CALL CALC_PH( |
CALL CALC_PH( |
180 |
I bi,bj,iMin,iMax,jMin,jMax, |
I bi,bj,iMin,iMax,jMin,jMax,Nz+1,rhoKm1, |
181 |
O pH, |
U pH, |
182 |
I myThid ) |
I myThid ) |
183 |
|
|
184 |
DO K = Nz, 1, -1 |
DO K = Nz, 1, -1 |