120 |
rhokp1(i,j) = 0. _d 0 |
rhokp1(i,j) = 0. _d 0 |
121 |
ENDDO |
ENDDO |
122 |
ENDDO |
ENDDO |
|
C-- Set up work arrays that need valid initial values |
|
|
DO j=1-OLy,sNy+OLy |
|
|
DO i=1-OLx,sNx+OLx |
|
|
wTrans(i,j) = 0. _d 0 |
|
|
fVerT(i,j,1) = 0. _d 0 |
|
|
fVerT(i,j,2) = 0. _d 0 |
|
|
fVerS(i,j,1) = 0. _d 0 |
|
|
fVerS(i,j,2) = 0. _d 0 |
|
|
fVerU(i,j,1) = 0. _d 0 |
|
|
fVerU(i,j,2) = 0. _d 0 |
|
|
fVerV(i,j,1) = 0. _d 0 |
|
|
fVerV(i,j,2) = 0. _d 0 |
|
|
ENDDO |
|
|
ENDDO |
|
123 |
|
|
124 |
DO bj=myByLo(myThid),myByHi(myThid) |
DO bj=myByLo(myThid),myByHi(myThid) |
125 |
DO bi=myBxLo(myThid),myBxHi(myThid) |
DO bi=myBxLo(myThid),myBxHi(myThid) |
126 |
|
|
127 |
C-- Boundary condition on hydrostatic pressure is pH(z=0)=0 |
C-- Boundary condition on hydrostatic pressure is pH(z=0)=0 |
128 |
DO j=1-OLy,sNy+OLy |
DO j=1-OLy,sNy+OLy |
129 |
DO i=1-OLx,sNx+OLx |
DO i=1-OLx,sNx+OLx |
130 |
pH(i,j,1) = 0. _d 0 |
pH(i,j,1) = 0. _d 0 |
135 |
ENDDO |
ENDDO |
136 |
ENDDO |
ENDDO |
137 |
|
|
138 |
|
C-- Set up work arrays that need valid initial values |
139 |
|
DO j=1-OLy,sNy+OLy |
140 |
|
DO i=1-OLx,sNx+OLx |
141 |
|
wTrans(i,j) = 0. _d 0 |
142 |
|
fVerT(i,j,1) = 0. _d 0 |
143 |
|
fVerT(i,j,2) = 0. _d 0 |
144 |
|
fVerS(i,j,1) = 0. _d 0 |
145 |
|
fVerS(i,j,2) = 0. _d 0 |
146 |
|
fVerU(i,j,1) = 0. _d 0 |
147 |
|
fVerU(i,j,2) = 0. _d 0 |
148 |
|
fVerV(i,j,1) = 0. _d 0 |
149 |
|
fVerV(i,j,2) = 0. _d 0 |
150 |
|
ENDDO |
151 |
|
ENDDO |
152 |
|
|
153 |
iMin = 1-OLx+1 |
iMin = 1-OLx+1 |
154 |
iMax = sNx+OLx |
iMax = sNx+OLx |
155 |
jMin = 1-OLy+1 |
jMin = 1-OLy+1 |
165 |
CALL TIMESTEP( |
CALL TIMESTEP( |
166 |
I bi,bj,iMin,iMax,jMin,jMax,1,pSurfX,pSurfY,myThid) |
I bi,bj,iMin,iMax,jMin,jMax,1,pSurfX,pSurfY,myThid) |
167 |
|
|
168 |
C Density of 1st level (below W(1)) reference to level 1 |
C-- Density of 1st level (below W(1)) reference to level 1 |
169 |
CALL FIND_RHO( |
CALL FIND_RHO( |
170 |
I bi, bj, iMin, iMax, jMin, jMax, 1, 1, 'LINEAR', |
I bi, bj, iMin, iMax, jMin, jMax, 1, 1, 'LINEAR', |
171 |
O rhoKm1, |
O rhoKm1, |
172 |
I myThid ) |
I myThid ) |
173 |
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 |
174 |
CALL CALC_PH( |
CALL CALC_PH( |
175 |
I bi,bj,iMin,iMax,jMin,jMax,1,rhoKm1,rhoKm1, |
I bi,bj,iMin,iMax,jMin,jMax,1,rhoKm1,rhoKm1, |
176 |
U pH, |
U pH, |
177 |
I myThid ) |
I myThid ) |
178 |
|
|
179 |
DO K=2,Nz |
DO K=2,Nz |
180 |
C-- Update fields in Kth level according to tendency terms |
C-- Update fields in Kth level according to tendency terms |
181 |
CALL TIMESTEP( |
CALL TIMESTEP( |
182 |
I bi,bj,iMin,iMax,jMin,jMax,K,pSurfX,pSurfY,myThid) |
I bi,bj,iMin,iMax,jMin,jMax,K,pSurfX,pSurfY,myThid) |
183 |
C Density of K-1 level (above W(K)) reference to K level |
C-- Density of K-1 level (above W(K)) reference to K level |
184 |
CALL FIND_RHO( |
CALL FIND_RHO( |
185 |
I bi, bj, iMin, iMax, jMin, jMax, K-1, K, 'LINEAR', |
I bi, bj, iMin, iMax, jMin, jMax, K-1, K, 'LINEAR', |
186 |
O rhoKm1, |
O rhoKm1, |
187 |
I myThid ) |
I myThid ) |
188 |
C Density of K level (below W(K)) reference to K level |
C-- Density of K level (below W(K)) reference to K level |
189 |
CALL FIND_RHO( |
CALL FIND_RHO( |
190 |
I bi, bj, iMin, iMax, jMin, jMax, K, K, 'LINEAR', |
I bi, bj, iMin, iMax, jMin, jMax, K, K, 'LINEAR', |
191 |
O rhoKp1, |
O rhoKp1, |
192 |
I myThid ) |
I myThid ) |
193 |
C-- Calculate iso-neutral slopes for the GM/Redi parameterisation |
C-- Calculate iso-neutral slopes for the GM/Redi parameterisation |
194 |
CALL CALC_ISOSLOPES( |
CALL CALC_ISOSLOPES( |
195 |
I bi, bj, iMin, iMax, jMin, jMax, K, |
I bi, bj, iMin, iMax, jMin, jMax, K, |
196 |
I rhoKm1, rhoKp1, |
I rhoKm1, rhoKp1, |
197 |
O K13, K23, K33, KapGM, |
O K13, K23, K33, KapGM, |
198 |
I myThid ) |
I myThid ) |
199 |
C-- Calculate static stability and mix where convectively unstable |
C-- Calculate static stability and mix where convectively unstable |
200 |
CALL CONVECT( |
CALL CONVECT( |
201 |
I bi,bj,iMin,iMax,jMin,jMax,K,rhoKm1,rhoKp1,myThid) |
I bi,bj,iMin,iMax,jMin,jMax,K,rhoKm1,rhoKp1,myThid) |
202 |
C Density of K-1 level (above W(K)) reference to K-1 level |
C-- Density of K-1 level (above W(K)) reference to K-1 level |
203 |
CALL FIND_RHO( |
CALL FIND_RHO( |
204 |
I bi, bj, iMin, iMax, jMin, jMax, K-1, K-1, 'LINEAR', |
I bi, bj, iMin, iMax, jMin, jMax, K-1, K-1, 'LINEAR', |
205 |
O rhoKm1, |
O rhoKm1, |
206 |
I myThid ) |
I myThid ) |
207 |
C Density of K level (below W(K)) referenced to K level |
C-- Density of K level (below W(K)) referenced to K level |
208 |
CALL FIND_RHO( |
CALL FIND_RHO( |
209 |
I bi, bj, iMin, iMax, jMin, jMax, K, K, 'LINEAR', |
I bi, bj, iMin, iMax, jMin, jMax, K, K, 'LINEAR', |
210 |
O rhoKp1, |
O rhoKp1, |
211 |
I myThid ) |
I myThid ) |
212 |
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 |
213 |
CALL CALC_PH( |
CALL CALC_PH( |
214 |
I bi,bj,iMin,iMax,jMin,jMax,K,rhoKm1,rhoKp1, |
I bi,bj,iMin,iMax,jMin,jMax,K,rhoKm1,rhoKp1, |
215 |
U pH, |
U pH, |
216 |
I myThid ) |
I myThid ) |
217 |
|
|
218 |
ENDDO ! K |
ENDDO |
219 |
|
|
220 |
DO K = Nz, 1, -1 |
DO K = Nz, 1, -1 |
221 |
kM1 =max(1,k-1) ! Points to level above k (=k-1) |
kM1 =max(1,k-1) ! Points to level above k (=k-1) |
255 |
Cdbg U aTerm,xTerm,fZon,fMer,fVerS, |
Cdbg U aTerm,xTerm,fZon,fMer,fVerS, |
256 |
Cdbg I myThid) |
Cdbg I myThid) |
257 |
|
|
258 |
ENDDO ! K |
ENDDO |
259 |
|
|
260 |
ENDDO |
ENDDO |
261 |
ENDDO |
ENDDO |