1 |
adcroft |
1.24 |
C $Header: /u/gcmpack/models/MITgcmUV/model/src/timestep.F,v 1.23 2001/03/08 20:27:33 jmc Exp $ |
2 |
jmc |
1.21 |
C $Name: $ |
3 |
cnh |
1.1 |
|
4 |
adcroft |
1.10 |
#include "CPP_OPTIONS.h" |
5 |
cnh |
1.1 |
|
6 |
|
|
C /==========================================================\ |
7 |
|
|
C | S/R TIMESTEP | |
8 |
|
|
C | o Step model fields forward in time | |
9 |
|
|
C \==========================================================/ |
10 |
jmc |
1.21 |
SUBROUTINE TIMESTEP( bi, bj, iMin, iMax, jMin, jMax, K, |
11 |
|
|
I phiHyd, phiSurfX, phiSurfY, |
12 |
adcroft |
1.17 |
I myIter, myThid ) |
13 |
jmc |
1.21 |
IMPLICIT NONE |
14 |
heimbach |
1.18 |
|
15 |
|
|
C == Global variables == |
16 |
cnh |
1.1 |
#include "SIZE.h" |
17 |
|
|
#include "DYNVARS.h" |
18 |
cnh |
1.11 |
#include "EEPARAMS.h" |
19 |
cnh |
1.1 |
#include "PARAMS.h" |
20 |
|
|
#include "GRID.h" |
21 |
heimbach |
1.18 |
|
22 |
cnh |
1.1 |
C == Routine Arguments == |
23 |
jmc |
1.23 |
C phiHyd - Hydrostatic Potential (ocean: pressure/rho) |
24 |
|
|
C (atmos: geopotentiel) |
25 |
jmc |
1.21 |
C phiSurfX, - gradient of Surface potentiel (Pressure/rho, ocean) |
26 |
|
|
C phiSurfY or geopotentiel (atmos) in X and Y direction |
27 |
cnh |
1.1 |
INTEGER bi,bj,iMin,iMax,jMin,jMax |
28 |
adcroft |
1.4 |
INTEGER K |
29 |
adcroft |
1.19 |
_RL phiHyd(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr) |
30 |
jmc |
1.21 |
_RL phiSurfX(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
31 |
|
|
_RL phiSurfY(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
32 |
adcroft |
1.17 |
INTEGER myIter, myThid |
33 |
heimbach |
1.18 |
|
34 |
cnh |
1.1 |
C == Local variables == |
35 |
adcroft |
1.4 |
INTEGER i,j |
36 |
adcroft |
1.7 |
_RL ab15,ab05 |
37 |
jmc |
1.21 |
_RL phxFac,phyFac, psFac |
38 |
cnh |
1.1 |
|
39 |
|
|
C Adams-Bashforth timestepping weights |
40 |
adcroft |
1.17 |
Caja IF (myIter .EQ. 0) THEN |
41 |
|
|
Caja ab15=1.0 |
42 |
|
|
Caja ab05=0.0 |
43 |
|
|
Caja ELSE |
44 |
|
|
ab15=1.5+abeps |
45 |
|
|
ab05=-0.5-abeps |
46 |
|
|
Caja ENDIF |
47 |
cnh |
1.1 |
|
48 |
adcroft |
1.7 |
C Step forward zonal velocity (store in Gu) |
49 |
jmc |
1.21 |
psFac = pfFacMom*(1. _d 0 - implicSurfPress) |
50 |
adcroft |
1.19 |
DO j=jMin,jMax |
51 |
cnh |
1.1 |
DO i=iMin,iMax |
52 |
jmc |
1.21 |
gUNm1(i,j,k,bi,bj)=uVel(i,j,k,bi,bj) + deltaTmom * ( |
53 |
|
|
& ab15*gU(i,j,k,bi,bj)+ab05*gUNm1(i,j,k,bi,bj) |
54 |
|
|
& - psFac*phiSurfX(i,j) |
55 |
cnh |
1.16 |
#ifdef INCLUDE_CD_CODE |
56 |
jmc |
1.21 |
& + guCD(i,j,k,bi,bj) |
57 |
cnh |
1.9 |
#endif |
58 |
adcroft |
1.7 |
& )*_maskW(i,j,k,bi,bj) |
59 |
cnh |
1.1 |
ENDDO |
60 |
adcroft |
1.19 |
ENDDO |
61 |
|
|
|
62 |
|
|
IF (staggerTimeStep) THEN |
63 |
|
|
C-- -grad Phi_Hyd has not been incorporated to gU and is added here: |
64 |
jmc |
1.23 |
phxFac = pfFacMom*deltaTmom |
65 |
adcroft |
1.19 |
DO j=jMin,jMax |
66 |
|
|
DO i=iMin,iMax |
67 |
|
|
gUNm1(i,j,k,bi,bj)=gUNm1(i,j,k,bi,bj) |
68 |
|
|
& - _recip_dxC(i,j,bi,bj) |
69 |
|
|
& *(phiHyd(i,j,k)-phiHyd(i-1,j,k))*phxFac |
70 |
|
|
& *_maskW(i,j,k,bi,bj) |
71 |
|
|
ENDDO |
72 |
|
|
ENDDO |
73 |
|
|
ENDIF |
74 |
adcroft |
1.12 |
|
75 |
adcroft |
1.7 |
C Step forward meridional velocity (store in Gv) |
76 |
jmc |
1.21 |
psFac = pfFacMom*(1. _d 0 - implicSurfPress) |
77 |
adcroft |
1.19 |
DO j=jMin,jMax |
78 |
cnh |
1.1 |
DO i=iMin,iMax |
79 |
jmc |
1.21 |
gVNm1(i,j,k,bi,bj)=vVel(i,j,k,bi,bj) + deltaTmom * ( |
80 |
|
|
& ab15*gV(i,j,k,bi,bj)+ab05*gVNm1(i,j,k,bi,bj) |
81 |
|
|
& - psFac*phiSurfY(i,j) |
82 |
cnh |
1.16 |
#ifdef INCLUDE_CD_CODE |
83 |
jmc |
1.21 |
& + gvCD(i,j,k,bi,bj) |
84 |
cnh |
1.9 |
#endif |
85 |
adcroft |
1.7 |
& )*_maskS(i,j,k,bi,bj) |
86 |
cnh |
1.1 |
ENDDO |
87 |
adcroft |
1.19 |
ENDDO |
88 |
adcroft |
1.12 |
|
89 |
adcroft |
1.19 |
IF (staggerTimeStep) THEN |
90 |
|
|
C-- -grad Phi_Hyd has not been incorporated to gV and is added here: |
91 |
jmc |
1.23 |
phyFac = pfFacMom*deltaTmom |
92 |
adcroft |
1.19 |
DO j=jMin,jMax |
93 |
|
|
DO i=iMin,iMax |
94 |
|
|
gVNm1(i,j,k,bi,bj)=gVNm1(i,j,k,bi,bj) |
95 |
|
|
& - _recip_dyC(i,j,bi,bj) |
96 |
adcroft |
1.24 |
& *(phiHyd(i,j,k)-phiHyd(i,j-1,k))*phyFac |
97 |
adcroft |
1.19 |
& *_maskS(i,j,k,bi,bj) |
98 |
|
|
ENDDO |
99 |
adcroft |
1.12 |
ENDDO |
100 |
|
|
ENDIF |
101 |
cnh |
1.1 |
|
102 |
|
|
RETURN |
103 |
|
|
END |