1 |
C $Header: /u/u3/gcmpack/MITgcm/model/src/adams_bashforth2.F,v 1.2 2001/09/26 18:09:13 cnh Exp $ |
2 |
C $Name: $ |
3 |
|
4 |
#include "PACKAGES_CONFIG.h" |
5 |
#include "CPP_OPTIONS.h" |
6 |
|
7 |
CBOP |
8 |
C !ROUTINE: ADAMS_BASHFORTH2 |
9 |
C !INTERFACE: |
10 |
SUBROUTINE ADAMS_BASHFORTH2( |
11 |
I bi, bj, K, |
12 |
U gTracer, gTrNm1, |
13 |
I myIter, myThid ) |
14 |
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 |
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 |
C !INPUT/OUTPUT PARAMETERS: |
33 |
C == Routine Arguments == |
34 |
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 |
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 |
|
44 |
C !LOCAL VARIABLES: |
45 |
C == Local variables == |
46 |
C i,j :: Loop counters |
47 |
C ab15, ab05 :: Adams bashforth extrapolation weights. |
48 |
INTEGER i,j |
49 |
_RL ab15,ab05 |
50 |
_RL gTrtmp |
51 |
CEOP |
52 |
|
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 |
C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+---- |
63 |
|
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 |