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

Contents of /MITgcm/model/src/timestep.F

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


Revision 1.33 - (show annotations) (download)
Thu Oct 9 04:19:18 2003 UTC (20 years, 8 months ago) by edhill
Branch: MAIN
CVS Tags: checkpoint51k_post, checkpoint51o_pre, checkpoint51l_post, checkpoint51n_post, checkpoint51n_pre, checkpoint51l_pre, checkpoint51i_post, checkpoint51o_post, checkpoint51m_post
Branch point for: tg2-branch, checkpoint51n_branch
Changes since 1.32: +3 -1 lines
 o first check-in for the "branch-genmake2" merge
 o verification suite as run on shelley (gcc 3.2.2):

Wed Oct  8 23:42:29 EDT 2003
                T           S           U           V
G D M    c        m  s        m  s        m  s        m  s
E p a R  g  m  m  e  .  m  m  e  .  m  m  e  .  m  m  e  .
N n k u  2  i  a  a  d  i  a  a  d  i  a  a  d  i  a  a  d
2 d e n  d  n  x  n  .  n  x  n  .  n  x  n  .  n  x  n  .

OPTFILE=NONE

Y Y Y Y 13 16 16 16  0 16 16 16 16 16 16 16 16 13 12  0  0 pass  adjustment.128x64x1
Y Y Y Y 16 16 16 16  0 16 16 16 16 16 16  0  0 16 16  0  0 pass  adjustment.cs-32x32x1
Y Y Y Y 16 16 16 16  0 16 16 16 16 16 16 22  0 16 16 22  0 pass  adjust_nlfs.cs-32x32x1
Y Y Y Y -- 13 13 16 16 13 13 13 13 16 16 16 16 16 16 16 16 N/O   advect_cs
Y Y Y Y -- 22 16 16 16 16 16 16 13 16 16 16 16 16 16 16 16 N/O   advect_xy
Y Y Y Y -- 13 16 13 16 16 16 16 16 16 16 22 16 16 16 16 16 N/O   advect_xz
Y Y Y Y 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 pass  aim.5l_cs
Y Y Y Y 14 16 16 16 16 16 16 16 16 13 16 16 16 16 16 13 16 pass  aim.5l_Equatorial_Channel
Y Y Y Y 16 16 16 16 16 16 16 16 16 16 16 13 16 16 13 13 16 pass  aim.5l_LatLon
Y Y Y Y 13 16 16 16 16 16 16 16 16 16 13 12 13 13 16 13 16 pass  exp0
Y Y Y Y 14 16 16 16 16 16 16 16 22 16 16 16 13 16 16 22 16 pass  exp1
Y Y Y Y 13 13 16 13 16 16 16 16 16 13 13 16 16 13 13 13 13 pass  exp2
Y Y Y Y 16 16 16 16 16 16 16 16 22 16 16 16 16 16 16 16 16 pass  exp4
Y Y Y Y 16 16 16 16 16 16 16 16 16 16 16 22 16 16 16 22 16 pass  exp5
Y Y Y Y 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 pass  front_relax
Y Y Y Y 14 16 16 13 13 16 16 13 13 16 13 13 16 12 13 13 16 pass  global_ocean.90x40x15
Y Y Y Y 10 16 16 13 13 16 13 16 16 13 13 13 13 16 16 13 16 FAIL  global_ocean.cs32x15
Y Y Y Y  6 11 12 13 13 12 13 16 13  9  9  9  9 10  9  9 11 FAIL  global_ocean_pressure
Y Y Y Y 14 16 16 13 16 16 16 13 13 13 13 13 16 12 16 13 16 pass  global_with_exf
Y Y Y Y 14 16 16 16 16 16 16 16 16 11 13 22 13 16 16  9 16 pass  hs94.128x64x5
Y Y Y Y 13 16 16 16 16 16 16 16 16 11 16 16 16 13 16 22 13 pass  hs94.1x64x5
Y Y Y Y 14 16 16 16 16 16 16 16 16 13 16 13 13 16 16 22 13 pass  hs94.cs-32x32x5
Y Y Y Y 10 10 16 13 13 16 16 16 22 16 13 13 13 13 13 22 13 FAIL  ideal_2D_oce
Y Y Y Y  8 16 16 16 16 16 16 16 16 13 13  8 16 16 16 16 16 FAIL  internal_wave
Y Y Y Y 14 16 16 16 16 16 16 16 16 13 13 22 13 13 13 22 16 pass  inverted_barometer
Y Y Y Y 12 16 16 16 16 16 16 16 16 16 13 12 13 13 13 13 13 FAIL  lab_sea
Y Y Y Y 11 16 16 16 16 16 16 16 13 13 13 12 13 16 13 12 13 FAIL  natl_box
Y Y Y Y 16 16 16 16 16 16 16 16 22 16 16 16 16 16 16 16 16 pass  plume_on_slope
Y Y Y Y 13 16 16 16 16 13 16 16 16 16 16 16 16 13 16 16 16 pass  solid-body.cs-32x32x1

1 C $Header: /u/u3/gcmpack/MITgcm/model/src/timestep.F,v 1.32.2.1 2003/10/08 02:39:25 adcroft Exp $
2 C $Name: $
3
4 #include "CPP_OPTIONS.h"
5
6 CBOP
7 C !ROUTINE: TIMESTEP
8 C !INTERFACE:
9 SUBROUTINE TIMESTEP( bi, bj, iMin, iMax, jMin, jMax, k,
10 I dPhiHydX,dPhiHydY, phiSurfX, phiSurfY,
11 I myTime, myIter, myThid )
12 C !DESCRIPTION: \bv
13 C *==========================================================*
14 C | S/R TIMESTEP
15 C | o Step model fields forward in time
16 C *==========================================================*
17 C \ev
18
19 C !USES:
20 IMPLICIT NONE
21 C == Global variables ==
22 #include "SIZE.h"
23 #include "DYNVARS.h"
24 #include "EEPARAMS.h"
25 #include "PARAMS.h"
26 #include "GRID.h"
27 #include "SURFACE.h"
28
29 C !INPUT/OUTPUT PARAMETERS:
30 C == Routine Arguments ==
31 C dPhiHydX,Y :: Gradient (X & Y directions) of Hydrostatic Potential
32 C phiSurfX :: gradient of Surface potential (Pressure/rho, ocean)
33 C phiSurfY :: or geopotential (atmos) in X and Y direction
34 INTEGER bi,bj,iMin,iMax,jMin,jMax
35 INTEGER k
36 _RL dPhiHydX(1-Olx:sNx+Olx,1-Oly:sNy+Oly)
37 _RL dPhiHydY(1-Olx:sNx+Olx,1-Oly:sNy+Oly)
38 _RL phiSurfX(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
39 _RL phiSurfY(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
40 _RL myTime
41 INTEGER myIter, myThid
42
43 C !LOCAL VARIABLES:
44 C == Local variables ==
45 LOGICAL momForcing_In_AB
46 INTEGER i,j
47 _RL ab15,ab05
48 _RL phxFac,phyFac, psFac
49 _RL gUtmp(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
50 _RL gVtmp(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
51 #ifdef INCLUDE_CD_CODE
52 _RL guCor(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
53 _RL gvCor(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
54 #endif
55 CEOP
56
57 C Adams-Bashforth timestepping weights
58 IF (myIter .EQ. 0) THEN
59 ab15=1.0
60 ab05=0.0
61 ELSE
62 ab15=1.5+abeps
63 ab05=-0.5-abeps
64 ENDIF
65
66 C-- stagger time step: grad Phi_Hyp is not in gU,gV => add it in this S/R
67 IF (staggerTimeStep) THEN
68 phxFac = pfFacMom
69 phyFac = pfFacMom
70 ELSE
71 phxFac = 0.
72 phyFac = 0.
73 ENDIF
74
75 C-- explicit part of the surface potential gradient is added in this S/R
76 psFac = pfFacMom*(1. _d 0 - implicSurfPress)
77
78 C-- including or excluding momentum forcing from Adams-Bashforth:
79 momForcing_In_AB = forcing_In_AB
80 momForcing_In_AB = .TRUE.
81
82 C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
83
84 C- Initialize local arrays (not really necessary but safer)
85 DO j=1-Oly,sNy+Oly
86 DO i=1-Olx,sNx+Olx
87 gUtmp(i,j) = 0. _d 0
88 gVtmp(i,j) = 0. _d 0
89 #ifdef INCLUDE_CD_CODE
90 guCor(i,j) = 0. _d 0
91 gvCor(i,j) = 0. _d 0
92 #endif
93 ENDDO
94 ENDDO
95
96 C-- Forcing term inside the Adams-Bashforth:
97 IF (momForcing .AND. momForcing_In_AB) THEN
98 CALL EXTERNAL_FORCING_U(
99 I iMin,iMax,jMin,jMax,bi,bj,k,
100 I myTime,myThid)
101 CALL EXTERNAL_FORCING_V(
102 I iMin,iMax,jMin,jMax,bi,bj,k,
103 I myTime,myThid)
104 ENDIF
105
106 C- Compute effective gU,gV_[n+1/2] terms (including Adams-Bashforth weights)
107 C and save gU,gV_[n] into guNm1,gvNm1 for the next time step.
108 DO j=jMin,jMax
109 DO i=iMin,iMax
110 gUtmp(i,j) = ab15*gU(i,j,k,bi,bj)
111 & + ab05*guNm1(i,j,k,bi,bj)
112 gVtmp(i,j) = ab15*gV(i,j,k,bi,bj)
113 & + ab05*gvNm1(i,j,k,bi,bj)
114 guNm1(i,j,k,bi,bj)= gU(i,j,k,bi,bj)
115 gvNm1(i,j,k,bi,bj)= gV(i,j,k,bi,bj)
116 gU(i,j,k,bi,bj) = gUtmp(i,j)
117 gV(i,j,k,bi,bj) = gVtmp(i,j)
118 ENDDO
119 ENDDO
120
121 C-- Forcing term outside the Adams-Bashforth:
122 C (not recommanded with CD-scheme ON)
123 IF (momForcing .AND. .NOT.momForcing_In_AB) THEN
124 CALL EXTERNAL_FORCING_U(
125 I iMin,iMax,jMin,jMax,bi,bj,k,
126 I myTime,myThid)
127 CALL EXTERNAL_FORCING_V(
128 I iMin,iMax,jMin,jMax,bi,bj,k,
129 I myTime,myThid)
130 IF (useCDscheme) THEN
131 C- for CD-scheme, compute gU,Vtmp = gU,V^n + forcing
132 DO j=jMin,jMax
133 DO i=iMin,iMax
134 gUtmp(i,j) = gU(i,j,k,bi,bj)-gUtmp(i,j)
135 & + guNm1(i,j,k,bi,bj)
136 gVtmp(i,j) = gV(i,j,k,bi,bj)-gVtmp(i,j)
137 & + gvNm1(i,j,k,bi,bj)
138 ENDDO
139 ENDDO
140 ELSE
141 DO j=jMin,jMax
142 DO i=iMin,iMax
143 gUtmp(i,j) = gU(i,j,k,bi,bj)
144 gVtmp(i,j) = gV(i,j,k,bi,bj)
145 ENDDO
146 ENDDO
147 ENDIF
148 ELSEIF ( useCDscheme) THEN
149 DO j=jMin,jMax
150 DO i=iMin,iMax
151 gUtmp(i,j) = guNm1(i,j,k,bi,bj)
152 gVtmp(i,j) = gvNm1(i,j,k,bi,bj)
153 ENDDO
154 ENDDO
155 ENDIF
156
157 #ifdef INCLUDE_CD_CODE
158 #ifdef ALLOW_MOM_FLUXFORM
159 IF (useCDscheme) THEN
160 C- Step forward D-grid velocity using C-grid gU,Vtmp = gU,V^n + forcing
161 C and return coriolis terms on C-grid (guCor,gvCor)
162 CALL MOM_CDSCHEME(
163 I bi,bj,k, dPhiHydX,dPhiHydY, gUtmp,gVtmp,
164 O guCor,gvCor,
165 I myTime, myIter, myThid)
166 DO j=jMin,jMax
167 DO i=iMin,iMax
168 gUtmp(i,j) = gU(i,j,k,bi,bj)
169 & + guCor(i,j)
170 gVtmp(i,j) = gV(i,j,k,bi,bj)
171 & + gvCor(i,j)
172 ENDDO
173 ENDDO
174 ENDIF
175 #endif /* ALLOW_MOM_FLUXFORM */
176 #endif /* INCLUDE_CD_CODE */
177
178 #ifdef NONLIN_FRSURF
179 IF (.NOT. vectorInvariantMomentum
180 & .AND. nonlinFreeSurf.GT.1) THEN
181 IF (select_rStar.GT.0) THEN
182 DO j=jMin,jMax
183 DO i=iMin,iMax
184 gUtmp(i,j) = gUtmp(i,j)/rStarExpW(i,j,bi,bj)
185 gVtmp(i,j) = gVtmp(i,j)/rStarExpS(i,j,bi,bj)
186 ENDDO
187 ENDDO
188 ELSE
189 DO j=jMin,jMax
190 DO i=iMin,iMax
191 IF ( k.EQ.ksurfW(i,j,bi,bj) ) THEN
192 gUtmp(i,j) = gUtmp(i,j)
193 & *hFacW(i,j,k,bi,bj)/hFac_surfW(i,j,bi,bj)
194 ENDIF
195 IF ( k.EQ.ksurfS(i,j,bi,bj) ) THEN
196 gVtmp(i,j) = gVtmp(i,j)
197 & *hFacS(i,j,k,bi,bj)/hFac_surfS(i,j,bi,bj)
198 ENDIF
199 ENDDO
200 ENDDO
201 ENDIF
202 ENDIF
203 #endif /* NONLIN_FRSURF */
204
205 C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
206
207 C Step forward zonal velocity (store in Gu)
208 DO j=jMin,jMax
209 DO i=iMin,iMax
210 gU(i,j,k,bi,bj) = uVel(i,j,k,bi,bj)
211 & +deltaTmom*(
212 & gUtmp(i,j)
213 & - psFac*phiSurfX(i,j)
214 & - phxFac*dPhiHydX(i,j)
215 & )*_maskW(i,j,k,bi,bj)
216 ENDDO
217 ENDDO
218
219 C Step forward meridional velocity (store in Gv)
220 DO j=jMin,jMax
221 DO i=iMin,iMax
222 gV(i,j,k,bi,bj) = vVel(i,j,k,bi,bj)
223 & +deltaTmom*(
224 & gVtmp(i,j)
225 & - psFac*phiSurfY(i,j)
226 & - phyFac*dPhiHydY(i,j)
227 & )*_maskS(i,j,k,bi,bj)
228 ENDDO
229 ENDDO
230
231 RETURN
232 END

  ViewVC Help
Powered by ViewVC 1.1.22