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

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

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


Revision 1.8 - (hide 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 jmc 1.8 C $Header: /u/gcmpack/MITgcm/model/src/adams_bashforth2.F,v 1.7 2007/10/19 14:41:39 jmc Exp $
2 cnh 1.2 C $Name: $
3 adcroft 1.1
4     #include "CPP_OPTIONS.h"
5    
6 cnh 1.2 CBOP
7     C !ROUTINE: ADAMS_BASHFORTH2
8     C !INTERFACE:
9 adcroft 1.1 SUBROUTINE ADAMS_BASHFORTH2(
10 jmc 1.6 I bi, bj, k,
11 adcroft 1.1 U gTracer, gTrNm1,
12 jmc 1.8 O AB_gTr,
13 jmc 1.7 I startAB, myIter, myThid )
14 cnh 1.2 C !DESCRIPTION: \bv
15     C *==========================================================*
16 jmc 1.7 C | S/R ADAMS_BASHFORTH2
17     C | o Extrapolate tendencies forward in time using
18     C | quasi-second order Adams-Bashforth method.
19 cnh 1.2 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    
29 cnh 1.2 C !INPUT/OUTPUT PARAMETERS:
30 adcroft 1.1 C == Routine Arguments ==
31 jmc 1.6 C bi,bj,k :: Tile and level indices
32 jmc 1.8 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 jmc 1.7 C startAB :: number of previous time level available to start/restart AB
38 cnh 1.2 C myIter :: Current time step number
39 jmc 1.8 C myThid :: my Thread Id. number
40 jmc 1.6 INTEGER bi,bj,k
41 adcroft 1.1 _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 jmc 1.8 _RL AB_gTr (1-OLx:sNx+OLx,1-OLy:sNy+OLy)
44 jmc 1.7 INTEGER startAB
45 adcroft 1.1 INTEGER myIter, myThid
46 cnh 1.2
47     C !LOCAL VARIABLES:
48 adcroft 1.1 C == Local variables ==
49 cnh 1.2 C i,j :: Loop counters
50 jmc 1.8 C abFac :: Adams bashforth extrapolation factor
51 adcroft 1.1 INTEGER i,j
52 jmc 1.8 _RL abFac
53 cnh 1.2 CEOP
54 adcroft 1.1
55 jmc 1.8 C Adams-Bashforth extrapolation factor
56 jmc 1.7 IF ( myIter.EQ.nIter0 .AND. startAB.EQ.0 ) THEN
57 jmc 1.8 abFac = 0. _d 0
58 adcroft 1.1 ELSE
59 jmc 1.8 abFac = 0.5 _d 0 + abEps
60 adcroft 1.1 ENDIF
61    
62 jmc 1.7 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 jmc 1.8 AB_gTr(i,j) = abFac
68     & *( gTracer(i,j,k,bi,bj)- gTrNm1(i,j,k,bi,bj) )
69 adcroft 1.1 gTrNm1(i,j,k,bi,bj) = gTracer(i,j,k,bi,bj)
70 jmc 1.8 gTracer(i,j,k,bi,bj) = gTracer(i,j,k,bi,bj) + AB_gTr(i,j)
71 adcroft 1.1 ENDDO
72     ENDDO
73    
74     RETURN
75     END

  ViewVC Help
Powered by ViewVC 1.1.22