30 |
integer myTime, myIter, myThid |
integer myTime, myIter, myThid |
31 |
|
|
32 |
c pe on dynamics and physics grid refers to bottom edge |
c pe on dynamics and physics grid refers to bottom edge |
33 |
|
_RL pephy4fiz(1-OLx:sNx+Olx,1-Oly:sNy+Oly,Nrphys+1,nSx,nSy) |
34 |
_RL pephy(1-OLx:sNx+Olx,1-Oly:sNy+Oly,Nrphys+1,nSx,nSy) |
_RL pephy(1-OLx:sNx+Olx,1-Oly:sNy+Oly,Nrphys+1,nSx,nSy) |
35 |
_RL pedyn(1-Olx:sNx+Olx,1-Oly:sNy+Oly,Nr+1,nSx,nSy) |
_RL pedyn(1-Olx:sNx+Olx,1-Oly:sNy+Oly,Nr+1,nSx,nSy) |
36 |
|
_RL tempphy(1-OLx:sNx+Olx,1-Oly:sNy+Oly,Nrphys,nSx,nSy) |
37 |
|
|
38 |
integer i, j, L, Lbotij, bi, bj |
integer i, j, L, Lbotij, bi, bj |
39 |
integer im1, im2, jm1, jm2, idim1, idim2, jdim1, jdim2 |
integer im1, im2, jm1, jm2, idim1, idim2, jdim1, jdim2 |
50 |
do bj = myByLo(myThid), myByHi(myThid) |
do bj = myByLo(myThid), myByHi(myThid) |
51 |
do bi = myBxLo(myThid), myBxHi(myThid) |
do bi = myBxLo(myThid), myBxHi(myThid) |
52 |
|
|
53 |
c Construct the physics grid pressures |
c Construct the physics grid pressures |
54 |
|
C Note: Need one array to send to fizhi (top-down) and another |
55 |
|
C For the interpolations between physics and dynamics (bottom-up) |
56 |
do j = 1,sNy |
do j = 1,sNy |
57 |
do i = 1,sNx |
do i = 1,sNx |
58 |
pephy(i,j,1,bi,bj)=(Ro_surf(i,j,bi,bj) + etaH(i,j,bi,bj))/ |
pephy(i,j,1,bi,bj)=(Ro_surf(i,j,bi,bj) + etaH(i,j,bi,bj))/ |
61 |
pephy(i,j,L,bi,bj)=pephy(i,j,L-1,bi,bj)-dpphys(i,j,L-1,bi,bj) |
pephy(i,j,L,bi,bj)=pephy(i,j,L-1,bi,bj)-dpphys(i,j,L-1,bi,bj) |
62 |
enddo |
enddo |
63 |
c Do not use a zero field as the top edge pressure for interpolation |
c Do not use a zero field as the top edge pressure for interpolation |
64 |
|
do L = 1,Nrphys+1 |
65 |
|
pephy4fiz(i,j,Nrphys+2-L,bi,bj)=pephy(i,j,L,bi,bj) |
66 |
|
enddo |
67 |
if(pephy(i,j,Nrphys+1,bi,bj).lt.1.e-5) |
if(pephy(i,j,Nrphys+1,bi,bj).lt.1.e-5) |
68 |
. pephy(i,j,Nrphys+1,bi,bj) = 1.e-5 |
. pephy(i,j,Nrphys+1,bi,bj) = 1.e-5 |
69 |
enddo |
enddo |
104 |
do bi = myBxLo(myThid), myBxHi(myThid) |
do bi = myBxLo(myThid), myBxHi(myThid) |
105 |
c |
c |
106 |
c Compute physics increments |
c Compute physics increments |
107 |
call do_fizhi(uphy,vphy,thphy,sphy,pephy, |
call do_fizhi(uphy,vphy,thphy,sphy,pephy4fiz, |
108 |
. ctmt,xxmt,yymt,zetamt,xlmt,khmt,tke, |
. ctmt,xxmt,yymt,zetamt,xlmt,khmt,tke, |
109 |
. xC,yC, |
. xC,yC, |
110 |
. im1,im2,jm1,jm2,Nrphys,Nsx,Nsy,1,sNx,1,sNy,bi,bj,nchp, |
. im1,im2,jm1,jm2,Nrphys,Nsx,Nsy,1,sNx,1,sNy,bi,bj,nchp, |
117 |
do bj = myByLo(myThid), myByHi(myThid) |
do bj = myByLo(myThid), myByHi(myThid) |
118 |
do bi = myBxLo(myThid), myBxHi(myThid) |
do bi = myBxLo(myThid), myBxHi(myThid) |
119 |
c Interpolate (A-Grid) physics increments to dynamics grid |
c Interpolate (A-Grid) physics increments to dynamics grid |
120 |
call phys2dyn(duphy,pephy,im1,im2,jm1,jm2,Nrphys,Nsx,Nsy, |
C First flip the physics arrays (which are top-down) |
121 |
|
C into bottom-up arrays for interpolation to dynamics grid |
122 |
|
do j = 1,sNy |
123 |
|
do i = 1,sNx |
124 |
|
do L = 1,Nrphys |
125 |
|
tempphys(i,j,Nrphys+1-L,bi,bj)=duphy(i,j,L,bi,bj) |
126 |
|
enddo |
127 |
|
enddo |
128 |
|
enddo |
129 |
|
call phys2dyn(tmpphys,pephy,im1,im2,jm1,jm2,Nrphys,Nsx,Nsy, |
130 |
. 1,sNx,1,sNy,bi,bj,pedyn,ksurfC,Nr,nlperdyn,guphy) |
. 1,sNx,1,sNy,bi,bj,pedyn,ksurfC,Nr,nlperdyn,guphy) |
131 |
call phys2dyn(dvphy,pephy,im1,im2,jm1,jm2,Nrphys,Nsx,Nsy, |
do j = 1,sNy |
132 |
|
do i = 1,sNx |
133 |
|
do L = 1,Nrphys |
134 |
|
tempphys(i,j,Nrphys+1-L,bi,bj)=dvphy(i,j,L,bi,bj) |
135 |
|
enddo |
136 |
|
enddo |
137 |
|
enddo |
138 |
|
call phys2dyn(tmpphys,pephy,im1,im2,jm1,jm2,Nrphys,Nsx,Nsy, |
139 |
. 1,sNx,1,sNy,bi,bj,pedyn,ksurfC,Nr,nlperdyn,gvphy) |
. 1,sNx,1,sNy,bi,bj,pedyn,ksurfC,Nr,nlperdyn,gvphy) |
140 |
call phys2dyn(dthphy,pephy,im1,im2,jm1,jm2,Nrphys,Nsx,Nsy, |
do j = 1,sNy |
141 |
|
do i = 1,sNx |
142 |
|
do L = 1,Nrphys |
143 |
|
tempphys(i,j,Nrphys+1-L,bi,bj)=dthphy(i,j,L,bi,bj) |
144 |
|
enddo |
145 |
|
enddo |
146 |
|
enddo |
147 |
|
call phys2dyn(tmpphys,pephy,im1,im2,jm1,jm2,Nrphys,Nsx,Nsy, |
148 |
. 1,sNx,1,sNy,bi,bj,pedyn,ksurfC,Nr,nlperdyn,gthphy) |
. 1,sNx,1,sNy,bi,bj,pedyn,ksurfC,Nr,nlperdyn,gthphy) |
149 |
call phys2dyn(dsphy,pephy,im1,im2,jm1,jm2,Nrphys,Nsx,Nsy, |
do j = 1,sNy |
150 |
|
do i = 1,sNx |
151 |
|
do L = 1,Nrphys |
152 |
|
tempphys(i,j,Nrphys+1-L,bi,bj)=dsphy(i,j,L,bi,bj) |
153 |
|
enddo |
154 |
|
enddo |
155 |
|
enddo |
156 |
|
call phys2dyn(tmpphys,pephy,im1,im2,jm1,jm2,Nrphys,Nsx,Nsy, |
157 |
. 1,sNx,1,sNy,bi,bj,pedyn,ksurfC,Nr,nlperdyn,gsphy) |
. 1,sNx,1,sNy,bi,bj,pedyn,ksurfC,Nr,nlperdyn,gsphy) |
158 |
|
|
159 |
enddo |
enddo |