1 |
edhill |
1.3 |
C $Header: /u/u3/gcmpack/MITgcm/model/src/adams_bashforth2.F,v 1.2 2001/09/26 18:09:13 cnh Exp $ |
2 |
cnh |
1.2 |
C $Name: $ |
3 |
adcroft |
1.1 |
|
4 |
edhill |
1.3 |
#include "PACKAGES_CONFIG.h" |
5 |
adcroft |
1.1 |
#include "CPP_OPTIONS.h" |
6 |
|
|
|
7 |
cnh |
1.2 |
CBOP |
8 |
|
|
C !ROUTINE: ADAMS_BASHFORTH2 |
9 |
|
|
C !INTERFACE: |
10 |
adcroft |
1.1 |
SUBROUTINE ADAMS_BASHFORTH2( |
11 |
|
|
I bi, bj, K, |
12 |
|
|
U gTracer, gTrNm1, |
13 |
|
|
I myIter, myThid ) |
14 |
cnh |
1.2 |
C !DESCRIPTION: \bv |
15 |
|
|
C *==========================================================* |
16 |
|
|
C | S/R ADAMS_BASHFORTH2 |
17 |
|
|
C | o Extrapolate tendancies forward in time using |
18 |
|
|
C | quasi-second order Adams-Bashforth method. |
19 |
|
|
C *==========================================================* |
20 |
|
|
C \ev |
21 |
|
|
|
22 |
|
|
C !USES: |
23 |
adcroft |
1.1 |
IMPLICIT NONE |
24 |
|
|
C == Global variables === |
25 |
|
|
#include "SIZE.h" |
26 |
|
|
#include "EEPARAMS.h" |
27 |
|
|
#include "PARAMS.h" |
28 |
|
|
#include "GAD.h" |
29 |
|
|
#include "GRID.h" |
30 |
|
|
#include "SURFACE.h" |
31 |
|
|
|
32 |
cnh |
1.2 |
C !INPUT/OUTPUT PARAMETERS: |
33 |
adcroft |
1.1 |
C == Routine Arguments == |
34 |
cnh |
1.2 |
C bi,bj,K :: Tile and level indices |
35 |
|
|
C gTracer :: Tendency at current time ( generally units of quantity/sec ) |
36 |
|
|
C gTrNm1 :: Tendency at previous time ( generally units of quantity/sec ) |
37 |
|
|
C myIter :: Current time step number |
38 |
|
|
C myThid :: Thread number of this thread |
39 |
adcroft |
1.1 |
INTEGER bi,bj,K |
40 |
|
|
_RL gTracer(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr,nSx,nSy) |
41 |
|
|
_RL gTrNm1 (1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr,nSx,nSy) |
42 |
|
|
INTEGER myIter, myThid |
43 |
cnh |
1.2 |
|
44 |
|
|
C !LOCAL VARIABLES: |
45 |
adcroft |
1.1 |
C == Local variables == |
46 |
cnh |
1.2 |
C i,j :: Loop counters |
47 |
|
|
C ab15, ab05 :: Adams bashforth extrapolation weights. |
48 |
adcroft |
1.1 |
INTEGER i,j |
49 |
|
|
_RL ab15,ab05 |
50 |
|
|
_RL gTrtmp |
51 |
cnh |
1.2 |
CEOP |
52 |
adcroft |
1.1 |
|
53 |
|
|
C Adams-Bashforth timestepping weights |
54 |
|
|
IF (myIter .EQ. 0) THEN |
55 |
|
|
ab15=1.0 |
56 |
|
|
ab05=0.0 |
57 |
|
|
ELSE |
58 |
|
|
ab15=1.5+abEps |
59 |
|
|
ab05=-(0.5+abEps) |
60 |
|
|
ENDIF |
61 |
|
|
|
62 |
cnh |
1.2 |
C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+---- |
63 |
adcroft |
1.1 |
|
64 |
|
|
C- Compute effective G-term with Adams-Bashforth weights: |
65 |
|
|
DO j=1-Oly,sNy+Oly |
66 |
|
|
DO i=1-Olx,sNx+Olx |
67 |
|
|
gTrtmp = ab15*gTracer(i,j,k,bi,bj) |
68 |
|
|
& + ab05*gTrNm1(i,j,k,bi,bj) |
69 |
|
|
gTrNm1(i,j,k,bi,bj) = gTracer(i,j,k,bi,bj) |
70 |
|
|
gTracer(i,j,k,bi,bj) = gTrtmp |
71 |
|
|
ENDDO |
72 |
|
|
ENDDO |
73 |
|
|
|
74 |
|
|
RETURN |
75 |
|
|
END |