/[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.27 - (show annotations) (download)
Wed Sep 26 18:09:16 2001 UTC (22 years, 7 months ago) by cnh
Branch: MAIN
CVS Tags: checkpoint46n_post, checkpoint47e_post, checkpoint44e_post, checkpoint46l_post, checkpoint46g_pre, checkpoint47c_post, release1_p13_pre, checkpoint46f_post, checkpoint44f_post, checkpoint46b_post, checkpoint43a-release1mods, release1_p13, checkpoint46l_pre, chkpt44d_post, release1_p8, release1_p9, release1_p1, release1_p2, release1_p3, release1_p4, release1_p5, release1_p6, release1_p7, checkpoint44e_pre, release1_b1, checkpoint43, checkpoint48c_pre, checkpoint47d_pre, release1_chkpt44d_post, checkpoint47a_post, checkpoint47i_post, release1_p11, checkpoint47d_post, icebear5, icebear4, icebear3, icebear2, checkpoint46d_pre, release1-branch_tutorials, checkpoint45d_post, checkpoint46j_pre, chkpt44a_post, checkpoint44h_pre, checkpoint46a_post, checkpoint47g_post, checkpoint46j_post, checkpoint46k_post, chkpt44c_pre, checkpoint48a_post, checkpoint45a_post, ecco_c44_e19, ecco_c44_e18, ecco_c44_e17, ecco_c44_e16, release1_p12, release1_p10, release1_p16, release1_p17, release1_p14, release1_p15, checkpoint47j_post, branch-exfmods-tag, checkpoint44g_post, checkpoint46e_pre, checkpoint48c_post, checkpoint45b_post, checkpoint46b_pre, release1-branch-end, release1_final_v1, checkpoint46c_pre, checkpoint46, checkpoint47b_post, checkpoint44b_post, checkpoint46h_pre, checkpoint46m_post, checkpoint46a_pre, checkpoint45c_post, ecco_ice2, ecco_ice1, checkpoint44h_post, checkpoint46g_post, release1_p12_pre, ecco_c44_e22, ecco_c44_e25, checkpoint47f_post, chkpt44a_pre, checkpoint46i_post, ecco_c44_e23, ecco_c44_e20, ecco_c44_e21, ecco_c44_e26, ecco_c44_e27, ecco_c44_e24, checkpoint46c_post, ecco-branch-mod1, ecco-branch-mod2, ecco-branch-mod3, ecco-branch-mod4, ecco-branch-mod5, checkpoint46e_post, release1_beta1, checkpoint44b_pre, checkpoint42, checkpoint41, checkpoint47, checkpoint44, checkpoint45, checkpoint48, checkpoint46h_post, chkpt44c_post, checkpoint47h_post, checkpoint44f_pre, checkpoint46d_post, release1-branch_branchpoint
Branch point for: c24_e25_ice, branch-exfmods-curt, release1_final, release1-branch, release1, ecco-branch, release1_50yr, icebear, release1_coupled
Changes since 1.26: +15 -6 lines
Bringing comments up to data and formatting for document extraction.

1 C $Header: /u/gcmpack/models/MITgcmUV/model/src/timestep.F,v 1.26 2001/08/27 18:48:57 jmc 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 phiHyd, phiSurfX, phiSurfY,
11 I 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 phiHyd - Hydrostatic Potential (ocean: pressure/rho)
32 C (atmos: geopotentiel)
33 C phiSurfX, - gradient of Surface potentiel (Pressure/rho, ocean)
34 C phiSurfY or geopotentiel (atmos) in X and Y direction
35 INTEGER bi,bj,iMin,iMax,jMin,jMax
36 INTEGER K
37 _RL phiHyd(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr)
38 _RL phiSurfX(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
39 _RL phiSurfY(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
40 INTEGER myIter, myThid
41
42 C !LOCAL VARIABLES:
43 C == Local variables ==
44 INTEGER i,j
45 _RL ab15,ab05
46 _RL phxFac,phyFac, psFac
47 _RL gUtmp(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
48 _RL gVtmp(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
49 CEOP
50
51 C Adams-Bashforth timestepping weights
52 IF (myIter .EQ. 0) THEN
53 ab15=1.0
54 ab05=0.0
55 ELSE
56 ab15=1.5+abeps
57 ab05=-0.5-abeps
58 ENDIF
59
60 C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
61 C- Compute effective gU term (including Adams-Bashforth weights) :
62 DO j=jMin,jMax
63 DO i=iMin,iMax
64 gUtmp(i,j) = ab15*gU(i,j,k,bi,bj)
65 & + ab05*gUNm1(i,j,k,bi,bj)
66 #ifdef INCLUDE_CD_CODE
67 & + guCD(i,j,k,bi,bj)
68 #endif
69 ENDDO
70 ENDDO
71
72 #ifdef NONLIN_FRSURF
73 IF (.NOT. vectorInvariantMomentum
74 & .AND. nonlinFreeSurf.GT.1) THEN
75 DO j=jMin,jMax
76 DO i=iMin,iMax
77 IF ( k.EQ.ksurfW(i,j,bi,bj) ) THEN
78 gUtmp(i,j) = gUtmp(i,j)
79 & *hFacW(i,j,k,bi,bj)/hFac_surfW(i,j,bi,bj)
80 ENDIF
81 ENDDO
82 ENDDO
83 ENDIF
84 #endif
85
86 C Step forward zonal velocity (store in Gu)
87 psFac = pfFacMom*(1. _d 0 - implicSurfPress)
88 DO j=jMin,jMax
89 DO i=iMin,iMax
90 gUNm1(i,j,k,bi,bj) = uVel(i,j,k,bi,bj)
91 & +deltaTmom*(
92 & gUtmp(i,j)
93 & - psFac*phiSurfX(i,j)
94 & )*_maskW(i,j,k,bi,bj)
95 ENDDO
96 ENDDO
97
98 IF (staggerTimeStep) THEN
99 C-- -grad Phi_Hyd has not been incorporated to gU and is added here:
100 phxFac = pfFacMom*deltaTmom
101 DO j=jMin,jMax
102 DO i=iMin,iMax
103 gUNm1(i,j,k,bi,bj)=gUNm1(i,j,k,bi,bj)
104 & - _recip_dxC(i,j,bi,bj)
105 & *(phiHyd(i,j,k)-phiHyd(i-1,j,k))*phxFac
106 & *_maskW(i,j,k,bi,bj)
107 ENDDO
108 ENDDO
109 ENDIF
110
111 C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
112 C- Compute effective gV term (including Adams-Bashforth weights) :
113 DO j=jMin,jMax
114 DO i=iMin,iMax
115 gVtmp(i,j) = ab15*gV(i,j,k,bi,bj)
116 & + ab05*gVNm1(i,j,k,bi,bj)
117 #ifdef INCLUDE_CD_CODE
118 & + gvCD(i,j,k,bi,bj)
119 #endif
120 ENDDO
121 ENDDO
122
123 #ifdef NONLIN_FRSURF
124 IF (.NOT. vectorInvariantMomentum
125 & .AND. nonlinFreeSurf.GT.1) THEN
126 DO j=jMin,jMax
127 DO i=iMin,iMax
128 IF ( k.EQ.ksurfS(i,j,bi,bj) ) THEN
129 gVtmp(i,j) = gVtmp(i,j)
130 & *hFacS(i,j,k,bi,bj)/hFac_surfS(i,j,bi,bj)
131 ENDIF
132 ENDDO
133 ENDDO
134 ENDIF
135 #endif
136
137 C Step forward meridional velocity (store in Gv)
138 psFac = pfFacMom*(1. _d 0 - implicSurfPress)
139 DO j=jMin,jMax
140 DO i=iMin,iMax
141 gVNm1(i,j,k,bi,bj) = vVel(i,j,k,bi,bj)
142 & +deltaTmom*(
143 & gVtmp(i,j)
144 & - psFac*phiSurfY(i,j)
145 & )*_maskS(i,j,k,bi,bj)
146 ENDDO
147 ENDDO
148
149 IF (staggerTimeStep) THEN
150 C-- -grad Phi_Hyd has not been incorporated to gV and is added here:
151 phyFac = pfFacMom*deltaTmom
152 DO j=jMin,jMax
153 DO i=iMin,iMax
154 gVNm1(i,j,k,bi,bj)=gVNm1(i,j,k,bi,bj)
155 & - _recip_dyC(i,j,bi,bj)
156 & *(phiHyd(i,j,k)-phiHyd(i,j-1,k))*phyFac
157 & *_maskS(i,j,k,bi,bj)
158 ENDDO
159 ENDDO
160 ENDIF
161
162 RETURN
163 END

  ViewVC Help
Powered by ViewVC 1.1.22