/[MITgcm]/MITgcm/pkg/mom_fluxform/mom_cdscheme.F
ViewVC logotype

Contents of /MITgcm/pkg/mom_fluxform/mom_cdscheme.F

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


Revision 1.3 - (show annotations) (download)
Wed Sep 26 19:05:21 2001 UTC (22 years, 8 months ago) by adcroft
Branch: MAIN
CVS Tags: checkpoint46b_post, checkpoint46n_post, ecco_c44_e18, checkpoint47j_post, ecco_c44_e16, checkpoint44b_post, branch-exfmods-tag, checkpoint47e_post, checkpoint43a-release1mods, checkpoint44h_pre, checkpoint47i_post, ecco_c44_e19, release1_p12, release1_p13, release1_p10, release1_p11, release1_p16, release1_p17, release1_p14, release1_p15, ecco_c44_e17, checkpoint47f_post, checkpoint47c_post, release1_p13_pre, checkpoint46i_post, checkpoint47d_post, ecco_c44_e21, ecco_c44_e26, ecco_c44_e27, ecco_c44_e24, ecco_c44_e25, icebear5, icebear4, checkpoint44f_pre, checkpoint47a_post, icebear3, icebear2, checkpoint46f_post, checkpoint46d_pre, release1_beta1, checkpoint46e_post, release1-branch_tutorials, checkpoint46c_post, checkpoint44g_post, checkpoint44h_post, checkpoint46l_post, checkpoint46k_post, ecco-branch-mod1, checkpoint46e_pre, ecco-branch-mod3, ecco-branch-mod4, ecco-branch-mod5, checkpoint45d_post, checkpoint46j_pre, checkpoint45b_post, checkpoint48c_post, chkpt44a_pre, release1-branch-end, release1_final_v1, release1_p12_pre, checkpoint47d_pre, checkpoint47, checkpoint44, checkpoint45, checkpoint48, checkpoint44f_post, checkpoint47b_post, checkpoint46l_pre, release1_b1, chkpt44d_post, checkpoint42, release1_p9, checkpoint46h_pre, checkpoint47h_post, release1_p8, checkpoint46g_pre, release1_p2, release1_p3, release1_p4, release1_p6, release1_p7, checkpoint46a_post, checkpoint47g_post, chkpt44a_post, checkpoint44b_pre, checkpoint44e_post, release1_p1, checkpoint46m_post, checkpoint46j_post, checkpoint46a_pre, checkpoint45c_post, release1_p5, checkpoint44e_pre, checkpoint46b_pre, ecco_ice2, ecco_ice1, checkpoint46d_post, ecco-branch-mod2, checkpoint48b_post, checkpoint46g_post, checkpoint45a_post, checkpoint46c_pre, checkpoint43, checkpoint48c_pre, release1-branch_branchpoint, ecco_c44_e22, checkpoint41, ecco_c44_e23, checkpoint46, ecco_c44_e20, checkpoint46h_post, release1_chkpt44d_post, chkpt44c_pre, checkpoint48a_post, chkpt44c_post
Branch point for: c24_e25_ice, ecco-branch, release1, branch-exfmods-curt, release1_coupled, icebear, release1_final, release1-branch, release1_50yr
Changes since 1.2: +22 -7 lines
Added comments in form compatible with "protex".

1 C $Header: /u/gcmpack/models/MITgcmUV/pkg/mom_fluxform/mom_cdscheme.F,v 1.2 2001/05/29 14:01:38 adcroft Exp $
2 C $Name: $
3
4 #include "CPP_OPTIONS.h"
5
6 CBOP
7 C !ROUTINE: MOM_CDSCHEME
8
9 C !INTERFACE: ==========================================================
10 SUBROUTINE MOM_CDSCHEME(
11 I bi,bj,k,phi_hyd,
12 I myThid)
13
14 C !DESCRIPTION:
15 C The C-D scheme. The less said the better :-)
16
17 C !USES: ===============================================================
18 C == Global variables ==
19 IMPLICIT NONE
20 #include "SIZE.h"
21 #include "DYNVARS.h"
22 #include "EEPARAMS.h"
23 #include "PARAMS.h"
24 #include "GRID.h"
25 #include "SURFACE.h"
26
27 C !INPUT PARAMETERS: ===================================================
28 C bi,bj :: tile indices
29 C k :: vertical level
30 C phi_hyd :: hydrostatic pressure
31 C myThid :: thread number
32 INTEGER bi,bj,K
33 _RL phi_hyd(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr)
34 INTEGER myThid
35
36
37 C !LOCAL VARIABLES: ====================================================
38 #ifdef INCLUDE_CD_CODE
39 C i,j :: loop indices
40 C pF :: pressure gradient
41 C vF :: work space
42 C aF :: work space
43 _RL pF(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
44 _RL vF(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
45 _RL aF(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
46 INTEGER i,j,iMin,iMax,jMin,jMax
47 _RL ab15,ab05
48 CEOP
49
50 C Compute ranges
51 iMin=1-Olx+1
52 iMax=sNx+Olx-1
53 jMin=1-Oly+1
54 jMax=sNy+Oly-1
55
56 C Adams-Bashforth weighting factors
57 ab15 = 1.5 + abEps
58 ab05 = -0.5 - abEps
59
60 C Pressure extrapolated forward in time
61 DO j=1-Oly,sNy+Oly
62 DO i=1-Olx,sNx+Olx
63 pf(i,j) =
64 & ab15*( etaN(i,j,bi,bj)*Bo_surf(i,j,bi,bj) )
65 & +ab05*(etaNm1(i,j,bi,bj)*Bo_surf(i,j,bi,bj) )
66 ENDDO
67 ENDDO
68 IF (staggerTimeStep) THEN
69 DO j=jMin,jMax
70 DO i=iMin,iMax
71 pf(i,j) = pf(i,j)+phi_hyd(i,j,k)
72 ENDDO
73 ENDDO
74 ENDIF
75
76 C-- Zonal velocity coriolis term
77 C Note. As coded here, coriolis will not work with "thin walls"
78 C-- Coriolis with CD scheme allowed
79 C grady(p) + gV
80 DO j=1-Oly+1,sNy+Oly
81 DO i=1-Olx,sNx+Olx
82 af(i,j) = -_maskS(i,j,k,bi,bj)
83 & *_recip_dyC(i,j,bi,bj)
84 & *(pf(i,j)-pf(i,j-1))
85 & +gV(i,j,k,bi,bj)
86 ENDDO
87 ENDDO
88 C Average to Vd point and add coriolis
89 DO j=jMin,jMax
90 DO i=iMin,iMax
91 vf(i,j) =
92 & 0.25*( af(i ,j)+af(i ,j+1)
93 & +af(i-1,j)+af(i-1,j+1)
94 & )*_maskW(i,j,k,bi,bj)
95 & -0.5*(_fCori(i,j,bi,bj)+
96 & _fCori(i-1,j,bi,bj))
97 & *uVel(i,j,k,bi,bj)
98 ENDDO
99 ENDDO
100 C Step forward Vd
101 DO j=jMin,jMax
102 DO i=iMin,iMax
103 vVelD(i,j,k,bi,bj) = vVelD(i,j,k,bi,bj) +
104 & deltaTmom*vf(i,j)
105 ENDDO
106 ENDDO
107 C Relax D grid V to C grid V
108 DO j=jMin,jMax
109 DO i=iMin,iMax
110 vVelD(i,j,k,bi,bj) = rCD*vVelD(i,j,k,bi,bj)
111 & +(1. - rCD)*(
112 & ab15*0.25*(
113 & vVel(i ,j ,k,bi,bj)+vVel(i ,j+1,k,bi,bj)
114 & +vVel(i-1,j ,k,bi,bj)+vVel(i-1,j+1,k,bi,bj)
115 & )*_maskW(i,j,k,bi,bj)
116 & +
117 & ab05*0.25*(
118 & vNM1(i ,j ,k,bi,bj)+vNM1(i ,j+1,k,bi,bj)
119 & +vNM1(i-1,j ,k,bi,bj)+vNM1(i-1,j+1,k,bi,bj)
120 & )*_maskW(i,j,k,bi,bj)
121 & )
122 ENDDO
123 ENDDO
124 C Calculate coriolis force on U
125 DO j=jMin,jMax
126 DO i=iMin,iMax
127 guCD(i,j,k,bi,bj) =
128 & 0.5*( _fCori(i ,j,bi,bj) +
129 & _fCori(i-1,j,bi,bj) )
130 & *vVelD(i,j,k,bi,bj)*cfFacMom
131 ENDDO
132 ENDDO
133
134 C-- Meridional velocity coriolis term
135 C gradx(p)+gU
136 DO j=1-Oly,sNy+Oly
137 DO i=1-Olx+1,sNx+Olx
138 af(i,j) = -_maskW(i,j,k,bi,bj)
139 & *_recip_dxC(i,j,bi,bj)*
140 & (pf(i,j)-pf(i-1,j))
141 & +gU(i,j,k,bi,bj)
142 ENDDO
143 ENDDO
144 C Average to Ud point and add coriolis
145 DO j=jMin,jMax
146 DO i=iMin,iMax
147 vf(i,j) =
148 & 0.25*( af(i ,j)+af(i ,j-1)
149 & +af(i+1,j)+af(i+1,j-1)
150 & )*_maskS(i,j,k,bi,bj)
151 & +0.5*( _fCori(i,j,bi,bj)
152 & +_fCori(i,j-1,bi,bj))
153 & *vVel(i,j,k,bi,bj)
154 ENDDO
155 ENDDO
156 C Step forward Ud
157 DO j=jMin,jMax
158 DO i=iMin,iMax
159 uVelD(i,j,k,bi,bj) = uVelD(i,j,k,bi,bj) +
160 & deltaTmom*vf(i,j)*_maskS(i,j,k,bi,bj)
161 ENDDO
162 ENDDO
163 C Relax D grid U to C grid U
164 DO j=jMin,jMax
165 DO i=iMin,iMax
166 uVelD(i,j,k,bi,bj) = rCD*uVelD(i,j,k,bi,bj)
167 & +(1. - rCD)*(
168 & ab15*0.25*(
169 & uVel(i,j ,k,bi,bj)+uVel(i+1,j ,k,bi,bj)
170 & +uVel(i,j-1,k,bi,bj)+uVel(i+1,j-1,k,bi,bj)
171 & )*_maskS(i,j,k,bi,bj)
172 & +
173 & ab05*0.25*(
174 & uNM1(i,j ,k,bi,bj)+uNM1(i+1,j ,k,bi,bj)
175 & +uNM1(i,j-1,k,bi,bj)+uNM1(i+1,j-1,k,bi,bj)
176 & )*_maskS(i,j,k,bi,bj)
177 & )
178 ENDDO
179 ENDDO
180 C Calculate coriolis force on V
181 DO j=jMin,jMax
182 DO i=iMin,iMax
183 gvCD(i,j,k,bi,bj) =
184 & -0.5*( _fCori(i ,j,bi,bj)
185 & +_fCori(i,j-1,bi,bj) )
186 & *uVelD(i,j,k,bi,bj)*_maskS(i,j,k,bi,bj)*cfFacMom
187 ENDDO
188 ENDDO
189
190 C-- Save "previous time level" variables
191 DO j=1-OLy,sNy+OLy
192 DO i=1-OLx,sNx+OLx
193 uNM1(i,j,k,bi,bj) = uVel(i,j,k,bi,bj)
194 vNM1(i,j,k,bi,bj) = vVel(i,j,k,bi,bj)
195 ENDDO
196 ENDDO
197
198 #endif /* INCLUDE_CD_CODE */
199
200 RETURN
201 END

  ViewVC Help
Powered by ViewVC 1.1.22