/[MITgcm]/MITgcm/model/src/calc_grad_phi_hyd.F
ViewVC logotype

Diff of /MITgcm/model/src/calc_grad_phi_hyd.F

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.9 by jmc, Tue Dec 5 05:25:08 2006 UTC revision 1.10 by jmc, Mon Feb 5 03:22:44 2007 UTC
# Line 73  C      and will add later (select_rStar= Line 73  C      and will add later (select_rStar=
73  C      the slope of the r* coordinate.  C      the slope of the r* coordinate.
74         IF ( buoyancyRelation .EQ. 'ATMOSPHERIC' ) THEN         IF ( buoyancyRelation .EQ. 'ATMOSPHERIC' ) THEN
75  C-     Consistent with Phi'= Integr[ theta'.dPi ] :  C-     Consistent with Phi'= Integr[ theta'.dPi ] :
76          DO j=jMin-1,jMax          DO j=jMin,jMax
77           DO i=iMin-1,iMax           DO i=iMin,iMax
78            varLoc(i,j) = phiHydC(i,j)*rStarFacC(i,j,bi,bj)**atm_kappa            varLoc(i,j) = phiHydC(i,j)*rStarFacC(i,j,bi,bj)**atm_kappa
79       &                + phi0surf(i,j,bi,bj)       &                + phi0surf(i,j,bi,bj)
80           ENDDO           ENDDO
81          ENDDO          ENDDO
82         ELSE         ELSE
83          DO j=jMin-1,jMax          DO j=jMin,jMax
84           DO i=iMin-1,iMax           DO i=iMin,iMax
85            varLoc(i,j) = phiHydC(i,j)*rStarFacC(i,j,bi,bj)            varLoc(i,j) = phiHydC(i,j)*rStarFacC(i,j,bi,bj)
86       &                + phi0surf(i,j,bi,bj)       &                + phi0surf(i,j,bi,bj)
87           ENDDO           ENDDO
# Line 92  C-    Integral of b.dr but scaled to cor Line 92  C-    Integral of b.dr but scaled to cor
92  C      no contribution of the slope of the r* coordinate (select_rStar=1)  C      no contribution of the slope of the r* coordinate (select_rStar=1)
93         IF ( buoyancyRelation .EQ. 'ATMOSPHERIC' ) THEN         IF ( buoyancyRelation .EQ. 'ATMOSPHERIC' ) THEN
94  C-     Consistent with Phi'= Integr[ theta'.dPi ] :  C-     Consistent with Phi'= Integr[ theta'.dPi ] :
95          DO j=jMin-1,jMax          DO j=jMin,jMax
96           DO i=iMin-1,iMax           DO i=iMin,iMax
97            IF (Ro_surf(i,j,bi,bj).EQ.rC(k)) THEN            IF (Ro_surf(i,j,bi,bj).EQ.rC(k)) THEN
98             factPI=atm_Cp*( ((etaH(i,j,bi,bj)+rC(k))/atm_Po)**atm_kappa             factPI=atm_Cp*( ((etaH(i,j,bi,bj)+rC(k))/atm_Po)**atm_kappa
99       &                    -(                 rC(k) /atm_Po)**atm_kappa       &                    -(                 rC(k) /atm_Po)**atm_kappa
# Line 109  C-     Consistent with Phi'= Integr[ the Line 109  C-     Consistent with Phi'= Integr[ the
109           ENDDO           ENDDO
110          ENDDO          ENDDO
111         ELSE         ELSE
112          DO j=jMin-1,jMax          DO j=jMin,jMax
113           DO i=iMin-1,iMax           DO i=iMin,iMax
114            IF (Ro_surf(i,j,bi,bj).EQ.rC(k)) THEN            IF (Ro_surf(i,j,bi,bj).EQ.rC(k)) THEN
115             WRITE(msgBuf,'(3A)') 'CALC_GRAD_PHI_HYD: ',             WRITE(msgBuf,'(3A)') 'CALC_GRAD_PHI_HYD: ',
116       &      'Problem when Ro_surf=rC',       &      'Problem when Ro_surf=rC',
# Line 131  C-     Consistent with Phi'= Integr[ the Line 131  C-     Consistent with Phi'= Integr[ the
131  #else /* NONLIN_FRSURF */  #else /* NONLIN_FRSURF */
132        IF (.TRUE.) THEN        IF (.TRUE.) THEN
133  #endif /* NONLIN_FRSURF */  #endif /* NONLIN_FRSURF */
134         DO j=jMin-1,jMax         DO j=jMin,jMax
135          DO i=iMin-1,iMax          DO i=iMin,iMax
136           varLoc(i,j) = phiHydC(i,j)+phi0surf(i,j,bi,bj)           varLoc(i,j) = phiHydC(i,j)+phi0surf(i,j,bi,bj)
137          ENDDO          ENDDO
138         ENDDO         ENDDO
# Line 140  C-     Consistent with Phi'= Integr[ the Line 140  C-     Consistent with Phi'= Integr[ the
140    
141  C--   Zonal & Meridional gradient of potential anomaly  C--   Zonal & Meridional gradient of potential anomaly
142        DO j=jMin,jMax        DO j=jMin,jMax
143         DO i=iMin,iMax         DO i=iMin+1,iMax
144          dPhiHydX(i,j) = _recip_dxC(i,j,bi,bj)*recip_deepFacC(k)          dPhiHydX(i,j) = _recip_dxC(i,j,bi,bj)*recip_deepFacC(k)
145       &                *( varLoc(i,j)-varLoc(i-1,j) )*recip_rhoFacC(k)       &                *( varLoc(i,j)-varLoc(i-1,j) )*recip_rhoFacC(k)
146           ENDDO
147          ENDDO
148          DO j=jMin+1,jMax
149           DO i=iMin,iMax
150          dPhiHydY(i,j) = _recip_dyC(i,j,bi,bj)*recip_deepFacC(k)          dPhiHydY(i,j) = _recip_dyC(i,j,bi,bj)*recip_deepFacC(k)
151       &                *( varLoc(i,j)-varLoc(i,j-1) )*recip_rhoFacC(k)       &                *( varLoc(i,j)-varLoc(i,j-1) )*recip_rhoFacC(k)
152         ENDDO         ENDDO
# Line 153  C--   Zonal & Meridional gradient of pot Line 157  C--   Zonal & Meridional gradient of pot
157         IF ( buoyancyRelation .EQ. 'OCEANIC' ) THEN         IF ( buoyancyRelation .EQ. 'OCEANIC' ) THEN
158  C--    z* coordinate slope term: rho'/rho0 * Grad_r(g.z)  C--    z* coordinate slope term: rho'/rho0 * Grad_r(g.z)
159          factorZ = gravity*recip_rhoConst*recip_rhoFacC(k)*0.5 _d 0          factorZ = gravity*recip_rhoConst*recip_rhoFacC(k)*0.5 _d 0
160          DO j=jMin-1,jMax          DO j=jMin,jMax
161           DO i=iMin-1,iMax           DO i=iMin,iMax
162            varLoc(i,j) = etaH(i,j,bi,bj)            varLoc(i,j) = etaH(i,j,bi,bj)
163       &                *(1. _d 0 + rC(k)*recip_Rcol(i,j,bi,bj))       &                *(1. _d 0 + rC(k)*recip_Rcol(i,j,bi,bj))
164           ENDDO           ENDDO
165          ENDDO          ENDDO
166          DO j=jMin,jMax          DO j=jMin,jMax
167           DO i=iMin,iMax           DO i=iMin+1,iMax
168            dPhiHydX(i,j) = dPhiHydX(i,j)            dPhiHydX(i,j) = dPhiHydX(i,j)
169       &     +factorZ*(alphRho(i-1,j)+alphRho(i,j))       &     +factorZ*(alphRho(i-1,j)+alphRho(i,j))
170       &             *(varLoc(i,j)-varLoc(i-1,j))       &             *(varLoc(i,j)-varLoc(i-1,j))
171       &             *recip_dxC(i,j,bi,bj)*recip_deepFacC(k)       &             *recip_dxC(i,j,bi,bj)*recip_deepFacC(k)
172             ENDDO
173            ENDDO
174            DO j=jMin+1,jMax
175             DO i=iMin,iMax
176            dPhiHydY(i,j) = dPhiHydY(i,j)            dPhiHydY(i,j) = dPhiHydY(i,j)
177       &     +factorZ*(alphRho(i,j-1)+alphRho(i,j))       &     +factorZ*(alphRho(i,j-1)+alphRho(i,j))
178       &             *(varLoc(i,j)-varLoc(i,j-1))       &             *(varLoc(i,j)-varLoc(i,j-1))
# Line 175  C--    z* coordinate slope term: rho'/rh Line 183  C--    z* coordinate slope term: rho'/rh
183  C--    p* coordinate slope term: alpha' * Grad_r( p )  C--    p* coordinate slope term: alpha' * Grad_r( p )
184          factorP = 0.5 _d 0          factorP = 0.5 _d 0
185          DO j=jMin,jMax          DO j=jMin,jMax
186           DO i=iMin,iMax           DO i=iMin+1,iMax
187            dPhiHydX(i,j) = dPhiHydX(i,j)            dPhiHydX(i,j) = dPhiHydX(i,j)
188       &     +factorP*(alphRho(i-1,j)+alphRho(i,j))       &     +factorP*(alphRho(i-1,j)+alphRho(i,j))
189       &             *(rStarFacC(i,j,bi,bj)-rStarFacC(i-1,j,bi,bj))       &             *(rStarFacC(i,j,bi,bj)-rStarFacC(i-1,j,bi,bj))
190       &             *rC(k)*recip_dxC(i,j,bi,bj)*recip_deepFacC(k)       &             *rC(k)*recip_dxC(i,j,bi,bj)*recip_deepFacC(k)
191             ENDDO
192            ENDDO
193            DO j=jMin+1,jMax
194             DO i=iMin,iMax
195            dPhiHydY(i,j) = dPhiHydY(i,j)            dPhiHydY(i,j) = dPhiHydY(i,j)
196       &     +factorP*(alphRho(i,j-1)+alphRho(i,j))       &     +factorP*(alphRho(i,j-1)+alphRho(i,j))
197       &             *(rStarFacC(i,j,bi,bj)-rStarFacC(i,j-1,bi,bj))       &             *(rStarFacC(i,j,bi,bj)-rStarFacC(i,j-1,bi,bj))
# Line 191  C--    p* coordinate slope term: alpha' Line 203  C--    p* coordinate slope term: alpha'
203          conv_theta2T = (rC(k)/atm_Po)**atm_kappa          conv_theta2T = (rC(k)/atm_Po)**atm_kappa
204          factorP = (atm_Rd/rC(k))*conv_theta2T*0.5 _d 0          factorP = (atm_Rd/rC(k))*conv_theta2T*0.5 _d 0
205          DO j=jMin,jMax          DO j=jMin,jMax
206           DO i=iMin,iMax           DO i=iMin+1,iMax
207            dPhiHydX(i,j) = dPhiHydX(i,j)            dPhiHydX(i,j) = dPhiHydX(i,j)
208       &     +factorP*(alphRho(i-1,j)+alphRho(i,j))       &     +factorP*(alphRho(i-1,j)+alphRho(i,j))
209       &             *(rStarFacC(i,j,bi,bj)-rStarFacC(i-1,j,bi,bj))       &             *(rStarFacC(i,j,bi,bj)-rStarFacC(i-1,j,bi,bj))
210       &             *rC(k)*recip_dxC(i,j,bi,bj)*recip_deepFacC(k)       &             *rC(k)*recip_dxC(i,j,bi,bj)*recip_deepFacC(k)
211             ENDDO
212            ENDDO
213            DO j=jMin+1,jMax
214             DO i=iMin,iMax
215            dPhiHydY(i,j) = dPhiHydY(i,j)            dPhiHydY(i,j) = dPhiHydY(i,j)
216       &     +factorP*(alphRho(i,j-1)+alphRho(i,j))       &     +factorP*(alphRho(i,j-1)+alphRho(i,j))
217       &             *(rStarFacC(i,j,bi,bj)-rStarFacC(i,j-1,bi,bj))       &             *(rStarFacC(i,j,bi,bj)-rStarFacC(i,j-1,bi,bj))

Legend:
Removed from v.1.9  
changed lines
  Added in v.1.10

  ViewVC Help
Powered by ViewVC 1.1.22