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