1 |
cnh |
1.6 |
C $Header: /home/ubuntu/mnt/e9_copy/MITgcm/model/src/Attic/calc_gtr1.F,v 1.6 2001/09/26 18:09:14 cnh Exp $ |
2 |
adcroft |
1.4 |
C $Name: $ |
3 |
heimbach |
1.1 |
|
4 |
|
|
#include "CPP_OPTIONS.h" |
5 |
|
|
|
6 |
cnh |
1.6 |
CBOP |
7 |
|
|
C !ROUTINE: CALC_GTR1 |
8 |
|
|
C !INTERFACE: |
9 |
heimbach |
1.1 |
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 |
adcroft |
1.4 |
I myTime,myIter,myThid ) |
15 |
cnh |
1.6 |
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 |
heimbach |
1.1 |
IMPLICIT NONE |
23 |
|
|
C == GLobal variables == |
24 |
|
|
#include "SIZE.h" |
25 |
|
|
#include "DYNVARS.h" |
26 |
|
|
#include "EEPARAMS.h" |
27 |
|
|
#include "PARAMS.h" |
28 |
adcroft |
1.3 |
#include "GAD.h" |
29 |
heimbach |
1.1 |
#include "TR1.h" |
30 |
|
|
|
31 |
cnh |
1.6 |
C !INPUT/OUTPUT PARAMETERS: |
32 |
heimbach |
1.1 |
C == Routine arguments == |
33 |
cnh |
1.6 |
C fVerT :: Flux of temperature (T) in the vertical |
34 |
heimbach |
1.1 |
C direction at the upper(U) and lower(D) faces of a cell. |
35 |
cnh |
1.6 |
C maskUp :: Land mask used to denote base of the domain. |
36 |
|
|
C xA :: Tracer cell face area normal to X |
37 |
|
|
C yA :: Tracer cell face area normal to X |
38 |
|
|
C uTrans :: Zonal volume transport through cell face |
39 |
|
|
C vTrans :: Meridional volume transport through cell face |
40 |
|
|
C rTrans :: Vertical volume transport through cell face |
41 |
|
|
C bi, bj, iMin, iMax, jMin, jMax :: Range of points for which calculation |
42 |
heimbach |
1.1 |
C results will be set. |
43 |
adcroft |
1.3 |
C myThid - Instance number for this innvocation of CALC_GT |
44 |
heimbach |
1.1 |
_RL fVerT (1-OLx:sNx+OLx,1-OLy:sNy+OLy,2) |
45 |
|
|
_RS xA (1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
46 |
|
|
_RS yA (1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
47 |
|
|
_RL uTrans(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
48 |
|
|
_RL vTrans(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
49 |
|
|
_RL rTrans(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
50 |
|
|
_RS maskUp(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
51 |
|
|
_RL KappaRT(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr) |
52 |
|
|
INTEGER k,kUp,kDown,kM1 |
53 |
|
|
INTEGER bi,bj,iMin,iMax,jMin,jMax |
54 |
adcroft |
1.4 |
_RL myTime |
55 |
|
|
INTEGER myIter |
56 |
heimbach |
1.1 |
INTEGER myThid |
57 |
|
|
|
58 |
cnh |
1.6 |
CEOP |
59 |
heimbach |
1.1 |
|
60 |
|
|
#ifdef ALLOW_AUTODIFF_TAMC |
61 |
|
|
C-- only the kUp part of fverT is set in this subroutine |
62 |
|
|
C-- the kDown is still required |
63 |
|
|
fVerT(1,1,kDown) = fVerT(1,1,kDown) |
64 |
|
|
#endif |
65 |
|
|
|
66 |
adcroft |
1.3 |
CALL GAD_CALC_RHS( |
67 |
|
|
I bi,bj,iMin,iMax,jMin,jMax,k,kM1,kUp,kDown, |
68 |
|
|
I xA,yA,uTrans,vTrans,rTrans,maskUp, |
69 |
|
|
I diffKhT, diffK4T, KappaRT, tr1, |
70 |
|
|
I GAD_TR1, tracerAdvScheme, |
71 |
|
|
U fVerT, gTr1, |
72 |
|
|
I myThid ) |
73 |
heimbach |
1.1 |
|
74 |
adcroft |
1.3 |
#ifdef INCLUDE_TR_FORCING_CODE |
75 |
heimbach |
1.1 |
C-- External thermal forcing term(s) |
76 |
adcroft |
1.3 |
CALL EXTERNAL_FORCING_TR( |
77 |
heimbach |
1.1 |
I iMin,iMax,jMin,jMax,bi,bj,k, |
78 |
adcroft |
1.4 |
I myTime,myThid) |
79 |
adcroft |
1.3 |
#endif /* INCLUDE_TR_FORCING_CODE */ |
80 |
adcroft |
1.4 |
|
81 |
|
|
IF ( tracerAdvScheme.EQ.ENUM_CENTERED_2ND |
82 |
|
|
& .OR.tracerAdvScheme.EQ.ENUM_UPWIND_3RD |
83 |
|
|
& .OR.tracerAdvScheme.EQ.ENUM_CENTERED_4TH ) THEN |
84 |
|
|
CALL ADAMS_BASHFORTH2( |
85 |
|
|
I bi, bj, K, |
86 |
adcroft |
1.5 |
U gTr1, gTr1nm1, |
87 |
adcroft |
1.4 |
I myIter, myThid ) |
88 |
|
|
ENDIF |
89 |
|
|
|
90 |
|
|
#ifdef NONLIN_FRSURF |
91 |
|
|
IF (nonlinFreeSurf.GT.0) THEN |
92 |
|
|
CALL FREESURF_RESCALE_G( |
93 |
|
|
I bi, bj, K, |
94 |
|
|
U gTr1, |
95 |
|
|
I myThid ) |
96 |
|
|
ENDIF |
97 |
|
|
#endif /* NONLIN_FRSURF */ |
98 |
heimbach |
1.1 |
|
99 |
|
|
RETURN |
100 |
|
|
END |