39 |
C == Local variables |
C == Local variables |
40 |
C xA, yA - Per block temporaries holding face areas |
C xA, yA - Per block temporaries holding face areas |
41 |
C uTrans, vTrans, wTrans - Per block temporaries holding flow transport |
C uTrans, vTrans, wTrans - Per block temporaries holding flow transport |
42 |
C o uTrans: Zonal transport |
C wVel o uTrans: Zonal transport |
43 |
C o vTrans: Meridional transport |
C o vTrans: Meridional transport |
44 |
C o wTrans: Vertical transport |
C o wTrans: Vertical transport |
45 |
|
C o wVel: Vertical velocity at upper and lower |
46 |
|
C cell faces. |
47 |
C maskC,maskUp o maskC: land/water mask for tracer cells |
C maskC,maskUp o maskC: land/water mask for tracer cells |
48 |
C o maskUp: land/water mask for W points |
C o maskUp: land/water mask for W points |
49 |
C aTerm, xTerm, cTerm - Work arrays for holding separate terms in |
C aTerm, xTerm, cTerm - Work arrays for holding separate terms in |
70 |
_RL uTrans(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
_RL uTrans(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
71 |
_RL vTrans(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
_RL vTrans(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
72 |
_RL wTrans(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
_RL wTrans(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
73 |
|
_RL wVel (1-OLx:sNx+OLx,1-OLy:sNy+OLy,2) |
74 |
_RS maskC (1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
_RS maskC (1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
75 |
_RS maskUp(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
_RS maskUp(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
76 |
_RL aTerm (1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
_RL aTerm (1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
95 |
_RL K33 (1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nz) |
_RL K33 (1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nz) |
96 |
_RL KapGM (1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
_RL KapGM (1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
97 |
_RL KappaZT(1-Olx:sNx+Olx,1-Oly:sNy+Oly,Nz) |
_RL KappaZT(1-Olx:sNx+Olx,1-Oly:sNy+Oly,Nz) |
98 |
|
_RL KappaZS(1-Olx:sNx+Olx,1-Oly:sNy+Oly,Nz) |
99 |
|
|
100 |
INTEGER iMin, iMax |
INTEGER iMin, iMax |
101 |
INTEGER jMin, jMax |
INTEGER jMin, jMax |
175 |
rhokm1(i,j) = 0. _d 0 |
rhokm1(i,j) = 0. _d 0 |
176 |
rhokp1(i,j) = 0. _d 0 |
rhokp1(i,j) = 0. _d 0 |
177 |
rhotmp(i,j) = 0. _d 0 |
rhotmp(i,j) = 0. _d 0 |
178 |
|
maskC (i,j) = 0. _d 0 |
179 |
ENDDO |
ENDDO |
180 |
ENDDO |
ENDDO |
181 |
|
|
186 |
DO j=1-OLy,sNy+OLy |
DO j=1-OLy,sNy+OLy |
187 |
DO i=1-OLx,sNx+OLx |
DO i=1-OLx,sNx+OLx |
188 |
wTrans(i,j) = 0. _d 0 |
wTrans(i,j) = 0. _d 0 |
189 |
|
wVel (i,j,1) = 0. _d 0 |
190 |
|
wVel (i,j,2) = 0. _d 0 |
191 |
fVerT(i,j,1) = 0. _d 0 |
fVerT(i,j,1) = 0. _d 0 |
192 |
fVerT(i,j,2) = 0. _d 0 |
fVerT(i,j,2) = 0. _d 0 |
193 |
fVerS(i,j,1) = 0. _d 0 |
fVerS(i,j,1) = 0. _d 0 |
229 |
I bi,bj,iMin,iMax,jMin,jMax,1,rhoKm1,rhoKm1, |
I bi,bj,iMin,iMax,jMin,jMax,1,rhoKm1,rhoKm1, |
230 |
U pH, |
U pH, |
231 |
I myThid ) |
I myThid ) |
232 |
DO J=1-Oly,sNy+Oly |
DO J=jMin,jMax |
233 |
DO I=1-Olx,sNx+Olx |
DO I=iMin,iMax |
234 |
rhoKp1(I,J)=rhoKm1(I,J) |
rhoKp1(I,J)=rhoKm1(I,J) |
235 |
ENDDO |
ENDDO |
236 |
ENDDO |
ENDDO |
245 |
copt O rhoKm1, |
copt O rhoKm1, |
246 |
copt I myThid ) |
copt I myThid ) |
247 |
C rhoKm1=rhoKp1 |
C rhoKm1=rhoKp1 |
248 |
DO J=1-Oly,sNy+Oly |
DO J=jMin,jMax |
249 |
DO I=1-Olx,sNx+Olx |
DO I=iMin,iMax |
250 |
rhoKm1(I,J)=rhoKp1(I,J) |
rhoKm1(I,J)=rhoKp1(I,J) |
251 |
ENDDO |
ENDDO |
252 |
ENDDO |
ENDDO |
268 |
I myThid ) |
I myThid ) |
269 |
C-- Calculate static stability and mix where convectively unstable |
C-- Calculate static stability and mix where convectively unstable |
270 |
CALL CONVECT( |
CALL CONVECT( |
271 |
I bi,bj,iMin,iMax,jMin,jMax,K,rhoKm1,rhoKp1, |
I bi,bj,iMin,iMax,jMin,jMax,K,rhotmp,rhoKp1, |
272 |
I myTime,myIter,myThid) |
I myTime,myIter,myThid) |
273 |
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 |
274 |
CALL FIND_RHO( |
CALL FIND_RHO( |
307 |
C-- Get temporary terms used by tendency routines |
C-- Get temporary terms used by tendency routines |
308 |
CALL CALC_COMMON_FACTORS ( |
CALL CALC_COMMON_FACTORS ( |
309 |
I bi,bj,iMin,iMax,jMin,jMax,k,kM1,kUp,kDown, |
I bi,bj,iMin,iMax,jMin,jMax,k,kM1,kUp,kDown, |
310 |
O xA,yA,uTrans,vTrans,wTrans,maskC,maskUp, |
O xA,yA,uTrans,vTrans,wTrans,wVel,maskC,maskUp, |
311 |
I myThid) |
I myThid) |
312 |
|
|
313 |
C-- Calculate the total vertical diffusivity |
C-- Calculate the total vertical diffusivity |
314 |
CALL CALC_DIFFUSIVITY( |
CALL CALC_DIFFUSIVITY( |
315 |
I bi,bj,iMin,iMax,jMin,jMax,K, |
I bi,bj,iMin,iMax,jMin,jMax,K, |
316 |
I maskC,maskUp,KapGM,K33, |
I maskC,maskUp,KapGM,K33, |
317 |
O KappaZT, |
O KappaZT,KappaZS, |
318 |
I myThid) |
I myThid) |
319 |
|
|
|
|
|
320 |
C-- Calculate accelerations in the momentum equations |
C-- Calculate accelerations in the momentum equations |
321 |
IF ( momStepping ) THEN |
IF ( momStepping ) THEN |
322 |
CALL CALC_MOM_RHS( |
CALL CALC_MOM_RHS( |
323 |
I bi,bj,iMin,iMax,jMin,jMax,k,kM1,kUp,kDown, |
I bi,bj,iMin,iMax,jMin,jMax,k,kM1,kUp,kDown, |
324 |
I xA,yA,uTrans,vTrans,wTrans,maskC, |
I xA,yA,uTrans,vTrans,wTrans,wVel,maskC, |
325 |
I pH, |
I pH, |
326 |
U aTerm,xTerm,cTerm,mTerm,pTerm, |
U aTerm,xTerm,cTerm,mTerm,pTerm, |
327 |
U fZon, fMer, fVerU, fVerV, |
U fZon, fMer, fVerU, fVerV, |
337 |
U aTerm,xTerm,fZon,fMer,fVerT, |
U aTerm,xTerm,fZon,fMer,fVerT, |
338 |
I myThid) |
I myThid) |
339 |
ENDIF |
ENDIF |
340 |
Cdbg CALL CALC_GS( |
IF ( saltStepping ) THEN |
341 |
Cdbg I bi,bj,iMin,iMax,jMin,jMax, k,kM1,kUp,kDown, |
CALL CALC_GS( |
342 |
Cdbg I xA,yA,uTrans,vTrans,wTrans,maskUp, |
I bi,bj,iMin,iMax,jMin,jMax, k,kM1,kUp,kDown, |
343 |
Cdbg I K13,K23,K33,KapGM, |
I xA,yA,uTrans,vTrans,wTrans,maskUp, |
344 |
Cdbg U aTerm,xTerm,fZon,fMer,fVerS, |
I K13,K23,KappaZS,KapGM, |
345 |
Cdbg I myThid) |
U aTerm,xTerm,fZon,fMer,fVerS, |
346 |
|
I myThid) |
347 |
|
ENDIF |
348 |
|
|
349 |
C-- Prediction step (step forward all model variables) |
C-- Prediction step (step forward all model variables) |
350 |
CALL TIMESTEP( |
CALL TIMESTEP( |
362 |
C-- Implicit diffusion |
C-- Implicit diffusion |
363 |
IF (implicitDiffusion) THEN |
IF (implicitDiffusion) THEN |
364 |
CALL IMPLDIFF( bi, bj, iMin, iMax, jMin, jMax, |
CALL IMPLDIFF( bi, bj, iMin, iMax, jMin, jMax, |
365 |
I KappaZT, |
I KappaZT,KappaZS, |
366 |
I myThid ) |
I myThid ) |
367 |
ENDIF |
ENDIF |
368 |
|
|
369 |
ENDDO |
ENDDO |
370 |
ENDDO |
ENDDO |
371 |
|
|
372 |
write(0,*) 'dynamics: pS',minval(cg2d_x),maxval(cg2d_x) |
write(0,*) 'dynamics: pS ',minval(cg2d_x(1:sNx,1:sNy,:,:)), |
373 |
write(0,*) 'dynamics: U',minval(uVel(1:sNx,1:sNy,:,:,:)), |
& maxval(cg2d_x(1:sNx,1:sNy,:,:)) |
374 |
& maxval(uVel(1:sNx,1:sNy,:,:,:)) |
write(0,*) 'dynamics: U ',minval(uVel(1:sNx,1:sNy,:,:,:)), |
375 |
write(0,*) 'dynamics: V',minval(vVel(1:sNx,1:sNy,:,:,:)), |
& maxval(uVel(1:sNx,1:sNy,:,:,:)) |
376 |
& maxval(vVel(1:sNx,1:sNy,:,:,:)) |
write(0,*) 'dynamics: V ',minval(vVel(1:sNx,1:sNy,:,:,:)), |
377 |
write(0,*) 'dynamics: K13',minval(K13(1:sNx,1:sNy,:)), |
& maxval(vVel(1:sNx,1:sNy,:,:,:)) |
378 |
& maxval(K13(1:sNx,1:sNy,:)) |
cblk write(0,*) 'dynamics: K13',minval(K13(1:sNx,1:sNy,:)), |
379 |
write(0,*) 'dynamics: K23',minval(K23(1:sNx,1:sNy,:)), |
cblk & maxval(K13(1:sNx,1:sNy,:)) |
380 |
& maxval(K23(1:sNx,1:sNy,:)) |
cblk write(0,*) 'dynamics: K23',minval(K23(1:sNx,1:sNy,:)), |
381 |
write(0,*) 'dynamics: K33',minval(K33(1:sNx,1:sNy,:)), |
cblk & maxval(K23(1:sNx,1:sNy,:)) |
382 |
& maxval(K33(1:sNx,1:sNy,:)) |
cblk write(0,*) 'dynamics: K33',minval(K33(1:sNx,1:sNy,:)), |
383 |
write(0,*) 'dynamics: gT',minval(gT(1:sNx,1:sNy,:,:,:)), |
cblk & maxval(K33(1:sNx,1:sNy,:)) |
384 |
& maxval(gT(1:sNx,1:sNy,:,:,:)) |
write(0,*) 'dynamics: gT ',minval(gT(1:sNx,1:sNy,:,:,:)), |
385 |
write(0,*) 'dynamics: T',minval(Theta(1:sNx,1:sNy,:,:,:)), |
& maxval(gT(1:sNx,1:sNy,:,:,:)) |
386 |
& maxval(Theta(1:sNx,1:sNy,:,:,:)) |
write(0,*) 'dynamics: T ',minval(Theta(1:sNx,1:sNy,:,:,:)), |
387 |
write(0,*) 'dynamics: pH',minval(pH/(Gravity*Rhonil)), |
& maxval(Theta(1:sNx,1:sNy,:,:,:)) |
388 |
& maxval(pH/(Gravity*Rhonil)) |
write(0,*) 'dynamics: gS ',minval(gS(1:sNx,1:sNy,:,:,:)), |
389 |
|
& maxval(gS(1:sNx,1:sNy,:,:,:)) |
390 |
|
write(0,*) 'dynamics: S ',minval(salt(1:sNx,1:sNy,:,:,:)), |
391 |
|
& maxval(salt(1:sNx,1:sNy,:,:,:)) |
392 |
|
cblk write(0,*) 'dynamics: pH ',minval(pH/(Gravity*Rhonil)), |
393 |
|
cblk & maxval(pH/(Gravity*Rhonil)) |
394 |
|
|
395 |
RETURN |
RETURN |
396 |
END |
END |