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

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

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


Revision 1.8 - (show annotations) (download)
Mon Nov 7 20:20:31 2011 UTC (12 years, 6 months ago) by jmc
Branch: MAIN
CVS Tags: checkpoint63g, checkpoint64, checkpoint63p, checkpoint63q, checkpoint63r, checkpoint63s, checkpoint63l, checkpoint63m, checkpoint63n, checkpoint63o, checkpoint63h, checkpoint63i, checkpoint63j, checkpoint63k, checkpoint63f, checkpoint64a, checkpoint64c, checkpoint64b, checkpoint64d
Changes since 1.7: +17 -15 lines
re-arrange extrapolation calculation (affects machine truncation)
and add output argument for Adams-Bashforth tendency increment.

1 C $Header: /u/gcmpack/MITgcm/model/src/adams_bashforth2.F,v 1.7 2007/10/19 14:41:39 jmc Exp $
2 C $Name: $
3
4 #include "CPP_OPTIONS.h"
5
6 CBOP
7 C !ROUTINE: ADAMS_BASHFORTH2
8 C !INTERFACE:
9 SUBROUTINE ADAMS_BASHFORTH2(
10 I bi, bj, k,
11 U gTracer, gTrNm1,
12 O AB_gTr,
13 I startAB, myIter, myThid )
14 C !DESCRIPTION: \bv
15 C *==========================================================*
16 C | S/R ADAMS_BASHFORTH2
17 C | o Extrapolate tendencies 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
29 C !INPUT/OUTPUT PARAMETERS:
30 C == Routine Arguments ==
31 C bi,bj,k :: Tile and level indices
32 C gTracer :: in: Tendency at current time ( generally units of quantity/sec )
33 C :: out: Extrapolated Tendency at current time ( same units )
34 C gTrNm1 :: in: Tendency at previous time ( same units )
35 C :: out: Save tendency at current time ( same units )
36 C AB_gTr :: Adams-Bashforth tendency increment
37 C startAB :: number of previous time level available to start/restart AB
38 C myIter :: Current time step number
39 C myThid :: my Thread Id. number
40 INTEGER bi,bj,k
41 _RL gTracer(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr,nSx,nSy)
42 _RL gTrNm1 (1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr,nSx,nSy)
43 _RL AB_gTr (1-OLx:sNx+OLx,1-OLy:sNy+OLy)
44 INTEGER startAB
45 INTEGER myIter, myThid
46
47 C !LOCAL VARIABLES:
48 C == Local variables ==
49 C i,j :: Loop counters
50 C abFac :: Adams bashforth extrapolation factor
51 INTEGER i,j
52 _RL abFac
53 CEOP
54
55 C Adams-Bashforth extrapolation factor
56 IF ( myIter.EQ.nIter0 .AND. startAB.EQ.0 ) THEN
57 abFac = 0. _d 0
58 ELSE
59 abFac = 0.5 _d 0 + 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 AB_gTr(i,j) = abFac
68 & *( gTracer(i,j,k,bi,bj)- 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) = gTracer(i,j,k,bi,bj) + AB_gTr(i,j)
71 ENDDO
72 ENDDO
73
74 RETURN
75 END

  ViewVC Help
Powered by ViewVC 1.1.22