1 |
adcroft |
1.6 |
C $Header: /u/gcmpack/models/MITgcmUV/model/src/timestep_tracer.F,v 1.5 2001/08/27 18:48:57 jmc Exp $ |
2 |
adcroft |
1.2 |
C $Name: $ |
3 |
adcroft |
1.1 |
|
4 |
|
|
#include "CPP_OPTIONS.h" |
5 |
|
|
|
6 |
adcroft |
1.2 |
SUBROUTINE TIMESTEP_TRACER( |
7 |
adcroft |
1.4 |
I bi, bj, iMin, iMax, jMin, jMax, K, |
8 |
|
|
I advection_scheme, |
9 |
|
|
I tracer, gTracer, |
10 |
|
|
O gTrNm1, |
11 |
adcroft |
1.2 |
I myIter, myThid ) |
12 |
adcroft |
1.1 |
C /==========================================================\ |
13 |
|
|
C | S/R TIMESTEP_TRACER | |
14 |
|
|
C | o Step model tracer field forward in time | |
15 |
|
|
C \==========================================================/ |
16 |
adcroft |
1.2 |
IMPLICIT NONE |
17 |
|
|
|
18 |
|
|
C == Global variables === |
19 |
adcroft |
1.1 |
#include "SIZE.h" |
20 |
|
|
#include "EEPARAMS.h" |
21 |
|
|
#include "PARAMS.h" |
22 |
adcroft |
1.4 |
#include "GAD.h" |
23 |
jmc |
1.5 |
#include "GRID.h" |
24 |
|
|
#include "SURFACE.h" |
25 |
adcroft |
1.2 |
|
26 |
adcroft |
1.1 |
C == Routine Arguments == |
27 |
|
|
INTEGER bi,bj,iMin,iMax,jMin,jMax,K |
28 |
adcroft |
1.4 |
INTEGER advection_scheme |
29 |
adcroft |
1.1 |
_RL tracer (1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr,nSx,nSy) |
30 |
|
|
_RL gTracer(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr,nSx,nSy) |
31 |
|
|
_RL gTrNm1 (1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr,nSx,nSy) |
32 |
|
|
INTEGER myIter, myThid |
33 |
|
|
C == Local variables == |
34 |
|
|
INTEGER i,j |
35 |
|
|
_RL ab15,ab05 |
36 |
jmc |
1.5 |
_RL gTrtmp(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
37 |
adcroft |
1.1 |
|
38 |
|
|
C Adams-Bashforth timestepping weights |
39 |
adcroft |
1.3 |
IF (myIter .EQ. 0) THEN |
40 |
|
|
ab15=1.0 |
41 |
|
|
ab05=0.0 |
42 |
|
|
ELSE |
43 |
adcroft |
1.4 |
ab15=1.5+abEps |
44 |
|
|
ab05=-(0.5+abEps) |
45 |
adcroft |
1.3 |
ENDIF |
46 |
adcroft |
1.1 |
|
47 |
jmc |
1.5 |
C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----| |
48 |
|
|
C Compute effective G-term: |
49 |
adcroft |
1.4 |
IF ( advection_scheme.EQ.ENUM_CENTERED_2ND |
50 |
|
|
& .OR.advection_scheme.EQ.ENUM_UPWIND_3RD |
51 |
|
|
& .OR.advection_scheme.EQ.ENUM_CENTERED_4TH ) THEN |
52 |
jmc |
1.5 |
|
53 |
|
|
C- with Adams-Bashforth weights: |
54 |
adcroft |
1.4 |
DO j=jMin,jMax |
55 |
adcroft |
1.1 |
DO i=iMin,iMax |
56 |
jmc |
1.5 |
gTrtmp(i,j) = ab15*gTracer(i,j,k,bi,bj) |
57 |
|
|
& + ab05*gTrNm1(i,j,k,bi,bj) |
58 |
adcroft |
1.1 |
ENDDO |
59 |
adcroft |
1.4 |
ENDDO |
60 |
jmc |
1.5 |
|
61 |
adcroft |
1.6 |
ELSEIF (advection_scheme.EQ.ENUM_FLUX_LIMIT |
62 |
|
|
& .OR.advection_scheme.EQ.ENUM_DST3 |
63 |
|
|
& .OR.advection_scheme.EQ.ENUM_DST3_FLUX_LIMIT ) THEN |
64 |
jmc |
1.5 |
|
65 |
|
|
C- with no Adams-Bashforth weights: |
66 |
adcroft |
1.4 |
DO j=jMin,jMax |
67 |
|
|
DO i=iMin,iMax |
68 |
jmc |
1.5 |
gTrtmp(i,j) = gTracer(i,j,k,bi,bj) |
69 |
adcroft |
1.4 |
ENDDO |
70 |
|
|
ENDDO |
71 |
jmc |
1.5 |
|
72 |
adcroft |
1.4 |
ELSE |
73 |
|
|
STOP 'TIMESTEP_TRACER: Bad advection_scheme' |
74 |
|
|
ENDIF |
75 |
jmc |
1.5 |
|
76 |
|
|
#ifdef NONLIN_FRSURF |
77 |
|
|
IF (nonlinFreeSurf.GT.0) THEN |
78 |
|
|
DO j=jMin,jMax |
79 |
|
|
DO i=iMin,iMax |
80 |
|
|
IF (k.EQ.ksurfC(i,j,bi,bj)) THEN |
81 |
|
|
gTrtmp(i,j) = gTrtmp(i,j) |
82 |
|
|
& *hFacC(i,j,k,bi,bj)/hFac_surfC(i,j,bi,bj) |
83 |
|
|
ENDIF |
84 |
|
|
ENDDO |
85 |
|
|
ENDDO |
86 |
|
|
ENDIF |
87 |
|
|
#endif /* NONLIN_FRSURF */ |
88 |
|
|
|
89 |
|
|
C- Step forward tracer |
90 |
|
|
DO j=jMin,jMax |
91 |
|
|
DO i=iMin,iMax |
92 |
|
|
gTrNm1(i,j,k,bi,bj)=tracer(i,j,k,bi,bj) |
93 |
|
|
& +deltaTtracer*gTrtmp(i,j) |
94 |
|
|
ENDDO |
95 |
|
|
ENDDO |
96 |
adcroft |
1.1 |
|
97 |
|
|
RETURN |
98 |
|
|
END |