1 |
C $Header: /u/gcmpack/MITgcm/model/src/calc_gtr1.F,v 1.8 2002/06/20 23:45:30 jmc Exp $ |
2 |
C $Name: $ |
3 |
|
4 |
#include "CPP_OPTIONS.h" |
5 |
|
6 |
CBOP |
7 |
C !ROUTINE: CALC_GTR1 |
8 |
C !INTERFACE: |
9 |
SUBROUTINE CALC_GTR1( |
10 |
I bi,bj,iMin,iMax,jMin,jMax,k,kM1,kUp,kDown, |
11 |
I xA,yA,uTrans,vTrans,rTrans,maskUp, |
12 |
I KappaRT, |
13 |
U fVerT, |
14 |
I myTime,myIter,myThid ) |
15 |
C !DESCRIPTION: \bv |
16 |
C *==========================================================* |
17 |
C | SUBROUTINE CALC_GTR1 |
18 |
C | o Calculate the passive tracer tendency terms. |
19 |
C *==========================================================* |
20 |
|
21 |
C !USES: |
22 |
IMPLICIT NONE |
23 |
C == GLobal variables == |
24 |
#include "SIZE.h" |
25 |
#include "DYNVARS.h" |
26 |
#include "EEPARAMS.h" |
27 |
#include "PARAMS.h" |
28 |
#include "GAD.h" |
29 |
#ifdef ALLOW_PASSIVE_TRACER |
30 |
#include "TR1.h" |
31 |
#endif |
32 |
|
33 |
C !INPUT/OUTPUT PARAMETERS: |
34 |
C == Routine arguments == |
35 |
C fVerT :: Flux of temperature (T) in the vertical |
36 |
C direction at the upper(U) and lower(D) faces of a cell. |
37 |
C maskUp :: Land mask used to denote base of the domain. |
38 |
C xA :: Tracer cell face area normal to X |
39 |
C yA :: Tracer cell face area normal to X |
40 |
C uTrans :: Zonal volume transport through cell face |
41 |
C vTrans :: Meridional volume transport through cell face |
42 |
C rTrans :: Vertical volume transport through cell face |
43 |
C bi, bj, iMin, iMax, jMin, jMax :: Range of points for which calculation |
44 |
C results will be set. |
45 |
C myThid - Instance number for this innvocation of CALC_GT |
46 |
_RL fVerT (1-OLx:sNx+OLx,1-OLy:sNy+OLy,2) |
47 |
_RS xA (1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
48 |
_RS yA (1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
49 |
_RL uTrans(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
50 |
_RL vTrans(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
51 |
_RL rTrans(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
52 |
_RS maskUp(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
53 |
_RL KappaRT(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr) |
54 |
INTEGER k,kUp,kDown,kM1 |
55 |
INTEGER bi,bj,iMin,iMax,jMin,jMax |
56 |
_RL myTime |
57 |
INTEGER myIter |
58 |
INTEGER myThid |
59 |
|
60 |
CEOP |
61 |
|
62 |
#ifdef ALLOW_PASSIVE_TRACER |
63 |
C === Local variables === |
64 |
LOGICAL calcAdvection |
65 |
|
66 |
#ifdef ALLOW_AUTODIFF_TAMC |
67 |
C-- only the kUp part of fverT is set in this subroutine |
68 |
C-- the kDown is still required |
69 |
fVerT(1,1,kDown) = fVerT(1,1,kDown) |
70 |
#endif |
71 |
|
72 |
calcAdvection = .NOT.tr1_MultiDimAdvec |
73 |
CALL GAD_CALC_RHS( |
74 |
I bi,bj,iMin,iMax,jMin,jMax,k,kM1,kUp,kDown, |
75 |
I xA,yA,uTrans,vTrans,rTrans,maskUp, |
76 |
I diffKhT, diffK4T, KappaRT, tr1, |
77 |
I GAD_TR1, tracerAdvScheme, calcAdvection, |
78 |
U fVerT, gTr1, |
79 |
I myThid ) |
80 |
|
81 |
#ifdef INCLUDE_TR_FORCING_CODE |
82 |
C-- External forcing term(s) inside Adams-Bashforth: |
83 |
IF ( forcing_In_AB ) |
84 |
& CALL EXTERNAL_FORCING_TR( |
85 |
I iMin,iMax,jMin,jMax,bi,bj,k, |
86 |
I myTime,myThid) |
87 |
#endif /* INCLUDE_TR_FORCING_CODE */ |
88 |
|
89 |
IF ( tr1_AdamsBashforth ) THEN |
90 |
CALL ADAMS_BASHFORTH2( |
91 |
I bi, bj, K, |
92 |
U gTr1, gTr1nm1, |
93 |
I myIter, myThid ) |
94 |
ENDIF |
95 |
|
96 |
#ifdef INCLUDE_TR_FORCING_CODE |
97 |
C-- External forcing term(s) outside Adams-Bashforth: |
98 |
IF ( .NOT.forcing_In_AB ) |
99 |
& CALL EXTERNAL_FORCING_TR( |
100 |
I iMin,iMax,jMin,jMax,bi,bj,k, |
101 |
I myTime,myThid) |
102 |
#endif /* INCLUDE_TR_FORCING_CODE */ |
103 |
|
104 |
#ifdef NONLIN_FRSURF |
105 |
IF (nonlinFreeSurf.GT.0) THEN |
106 |
CALL FREESURF_RESCALE_G( |
107 |
I bi, bj, K, |
108 |
U gTr1, |
109 |
I myThid ) |
110 |
IF ( tr1_AdamsBashforth ) |
111 |
& CALL FREESURF_RESCALE_G( |
112 |
I bi, bj, K, |
113 |
U gTr1nm1, |
114 |
I myThid ) |
115 |
ENDIF |
116 |
#endif /* NONLIN_FRSURF */ |
117 |
|
118 |
#endif /* ALLOW_PASSIVE_TRACER */ |
119 |
|
120 |
RETURN |
121 |
END |