1 |
edhill |
1.10 |
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 |
adcroft |
1.4 |
C $Name: $ |
3 |
heimbach |
1.1 |
|
4 |
edhill |
1.10 |
#include "PACKAGES_CONFIG.h" |
5 |
heimbach |
1.1 |
#include "CPP_OPTIONS.h" |
6 |
|
|
|
7 |
cnh |
1.6 |
CBOP |
8 |
|
|
C !ROUTINE: CALC_GTR1 |
9 |
|
|
C !INTERFACE: |
10 |
heimbach |
1.1 |
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 |
adcroft |
1.4 |
I myTime,myIter,myThid ) |
16 |
cnh |
1.6 |
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 |
heimbach |
1.1 |
IMPLICIT NONE |
24 |
|
|
C == GLobal variables == |
25 |
|
|
#include "SIZE.h" |
26 |
|
|
#include "DYNVARS.h" |
27 |
|
|
#include "EEPARAMS.h" |
28 |
|
|
#include "PARAMS.h" |
29 |
adcroft |
1.3 |
#include "GAD.h" |
30 |
jmc |
1.9 |
#ifdef ALLOW_PASSIVE_TRACER |
31 |
heimbach |
1.1 |
#include "TR1.h" |
32 |
jmc |
1.9 |
#endif |
33 |
heimbach |
1.1 |
|
34 |
cnh |
1.6 |
C !INPUT/OUTPUT PARAMETERS: |
35 |
heimbach |
1.1 |
C == Routine arguments == |
36 |
cnh |
1.6 |
C fVerT :: Flux of temperature (T) in the vertical |
37 |
heimbach |
1.1 |
C direction at the upper(U) and lower(D) faces of a cell. |
38 |
cnh |
1.6 |
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 |
heimbach |
1.1 |
C results will be set. |
46 |
adcroft |
1.3 |
C myThid - Instance number for this innvocation of CALC_GT |
47 |
heimbach |
1.1 |
_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 |
adcroft |
1.4 |
_RL myTime |
58 |
|
|
INTEGER myIter |
59 |
heimbach |
1.1 |
INTEGER myThid |
60 |
|
|
|
61 |
cnh |
1.6 |
CEOP |
62 |
edhill |
1.10 |
|
63 |
|
|
ceh3 needs an IF ( usePASSIVE_TRACER ) THEN |
64 |
heimbach |
1.1 |
|
65 |
jmc |
1.7 |
#ifdef ALLOW_PASSIVE_TRACER |
66 |
|
|
C === Local variables === |
67 |
|
|
LOGICAL calcAdvection |
68 |
|
|
|
69 |
heimbach |
1.1 |
#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 |
jmc |
1.7 |
calcAdvection = .NOT.tr1_MultiDimAdvec |
76 |
adcroft |
1.3 |
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 |
jmc |
1.7 |
I GAD_TR1, tracerAdvScheme, calcAdvection, |
81 |
adcroft |
1.3 |
U fVerT, gTr1, |
82 |
|
|
I myThid ) |
83 |
heimbach |
1.1 |
|
84 |
adcroft |
1.3 |
#ifdef INCLUDE_TR_FORCING_CODE |
85 |
jmc |
1.7 |
C-- External forcing term(s) inside Adams-Bashforth: |
86 |
|
|
IF ( forcing_In_AB ) |
87 |
|
|
& CALL EXTERNAL_FORCING_TR( |
88 |
heimbach |
1.1 |
I iMin,iMax,jMin,jMax,bi,bj,k, |
89 |
adcroft |
1.4 |
I myTime,myThid) |
90 |
adcroft |
1.3 |
#endif /* INCLUDE_TR_FORCING_CODE */ |
91 |
adcroft |
1.4 |
|
92 |
jmc |
1.7 |
IF ( tr1_AdamsBashforth ) THEN |
93 |
adcroft |
1.4 |
CALL ADAMS_BASHFORTH2( |
94 |
|
|
I bi, bj, K, |
95 |
adcroft |
1.5 |
U gTr1, gTr1nm1, |
96 |
adcroft |
1.4 |
I myIter, myThid ) |
97 |
|
|
ENDIF |
98 |
|
|
|
99 |
jmc |
1.7 |
#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 |
adcroft |
1.4 |
#ifdef NONLIN_FRSURF |
108 |
|
|
IF (nonlinFreeSurf.GT.0) THEN |
109 |
|
|
CALL FREESURF_RESCALE_G( |
110 |
|
|
I bi, bj, K, |
111 |
|
|
U gTr1, |
112 |
jmc |
1.8 |
I myThid ) |
113 |
|
|
IF ( tr1_AdamsBashforth ) |
114 |
|
|
& CALL FREESURF_RESCALE_G( |
115 |
|
|
I bi, bj, K, |
116 |
|
|
U gTr1nm1, |
117 |
adcroft |
1.4 |
I myThid ) |
118 |
|
|
ENDIF |
119 |
|
|
#endif /* NONLIN_FRSURF */ |
120 |
jmc |
1.7 |
|
121 |
|
|
#endif /* ALLOW_PASSIVE_TRACER */ |
122 |
heimbach |
1.1 |
|
123 |
|
|
RETURN |
124 |
|
|
END |