/[MITgcm]/MITgcm/model/src/calc_gt.F
ViewVC logotype

Contents of /MITgcm/model/src/calc_gt.F

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.43 - (show annotations) (download)
Fri Dec 3 15:39:11 2004 UTC (19 years, 7 months ago) by jmc
Branch: MAIN
CVS Tags: checkpoint57g_pre, checkpoint57b_post, checkpoint57d_post, checkpoint57, checkpoint57f_post, checkpoint57a_post, checkpoint57c_post, checkpoint57c_pre, checkpoint57e_post, eckpoint57e_pre, checkpoint57f_pre, checkpoint57a_pre
Changes since 1.42: +7 -1 lines
allow to compile without generic_advdiff pkg.

1 C $Header: /u/gcmpack/MITgcm/model/src/calc_gt.F,v 1.42 2004/10/21 21:25:33 jmc Exp $
2 C $Name: $
3
4 #include "PACKAGES_CONFIG.h"
5 #include "CPP_OPTIONS.h"
6
7 CBOP
8 C !ROUTINE: CALC_GT
9 C !INTERFACE:
10 SUBROUTINE CALC_GT(
11 I bi,bj,iMin,iMax,jMin,jMax,k,kM1,kUp,kDown,
12 I xA,yA,uTrans,vTrans,rTrans,rTransKp1,maskUp,
13 I KappaRT,
14 U fVerT,
15 I myTime,myIter,myThid )
16 C !DESCRIPTION: \bv
17 C *==========================================================*
18 C | SUBROUTINE CALC_GT
19 C | o Calculate the temperature tendency terms.
20 C *==========================================================*
21 C | A procedure called EXTERNAL_FORCING_T is called from
22 C | here. These procedures can be used to add per problem
23 C | heat flux source terms.
24 C | Note: Although it is slightly counter-intuitive the
25 C | EXTERNAL_FORCING routine is not the place to put
26 C | file I/O. Instead files that are required to
27 C | calculate the external source terms are generally
28 C | read during the model main loop. This makes the
29 C | logisitics of multi-processing simpler and also
30 C | makes the adjoint generation simpler. It also
31 C | allows for I/O to overlap computation where that
32 C | is supported by hardware.
33 C | Aside from the problem specific term the code here
34 C | forms the tendency terms due to advection and mixing
35 C | The baseline implementation here uses a centered
36 C | difference form for the advection term and a tensorial
37 C | divergence of a flux form for the diffusive term. The
38 C | diffusive term is formulated so that isopycnal mixing and
39 C | GM-style subgrid-scale terms can be incorporated b simply
40 C | setting the diffusion tensor terms appropriately.
41 C *==========================================================*
42 C \ev
43
44 C !USES:
45 IMPLICIT NONE
46 C == GLobal variables ==
47 #include "SIZE.h"
48 #include "DYNVARS.h"
49 #include "EEPARAMS.h"
50 #include "PARAMS.h"
51 #ifdef ALLOW_GENERIC_ADVDIFF
52 #include "GAD.h"
53 #endif
54
55 C !INPUT/OUTPUT PARAMETERS:
56 C == Routine arguments ==
57 C fVerT :: Flux of temperature (T) in the vertical
58 C direction at the upper(U) and lower(D) faces of a cell.
59 C maskUp :: Land mask used to denote base of the domain.
60 C xA :: Tracer cell face area normal to X
61 C yA :: Tracer cell face area normal to X
62 C uTrans :: Zonal volume transport through cell face
63 C vTrans :: Meridional volume transport through cell face
64 C rTrans :: Vertical volume transport at interface k
65 C rTransKp1 :: Vertical volume transport at inteface k+1
66 C bi, bj, iMin, iMax, jMin, jMax :: Range of points for which calculation
67 C results will be set.
68 C myThid :: Instance number for this innvocation of CALC_GT
69 _RL fVerT (1-OLx:sNx+OLx,1-OLy:sNy+OLy,2)
70 _RS xA (1-OLx:sNx+OLx,1-OLy:sNy+OLy)
71 _RS yA (1-OLx:sNx+OLx,1-OLy:sNy+OLy)
72 _RL uTrans(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
73 _RL vTrans(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
74 _RL rTrans(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
75 _RL rTransKp1(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
76 _RS maskUp(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
77 _RL KappaRT(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
78 INTEGER k,kUp,kDown,kM1
79 INTEGER bi,bj,iMin,iMax,jMin,jMax
80 _RL myTime
81 INTEGER myIter
82 INTEGER myThid
83 CEOP
84
85 #ifdef ALLOW_GENERIC_ADVDIFF
86 C === Local variables ===
87 LOGICAL calcAdvection
88
89 #ifdef ALLOW_AUTODIFF_TAMC
90 C-- only the kUp part of fverT is set in this subroutine
91 C-- the kDown is still required
92 fVerT(1,1,kDown) = fVerT(1,1,kDown)
93 #endif
94
95 calcAdvection = tempAdvection .AND. .NOT.tempMultiDimAdvec
96 CALL GAD_CALC_RHS(
97 I bi,bj,iMin,iMax,jMin,jMax,k,kM1,kUp,kDown,
98 I xA,yA,uTrans,vTrans,rTrans,rTransKp1,maskUp,
99 I uVel, vVel, wVel,
100 I diffKhT, diffK4T, KappaRT, theta,
101 I GAD_TEMPERATURE, tempAdvScheme, tempVertAdvScheme,
102 I calcAdvection, tempImplVertAdv,
103 U fVerT, gT,
104 I myTime, myIter, myThid )
105
106 C-- External thermal forcing term(s) inside Adams-Bashforth:
107 IF ( tempForcing .AND. forcing_In_AB )
108 & CALL EXTERNAL_FORCING_T(
109 I iMin,iMax,jMin,jMax,bi,bj,k,
110 I myTime,myThid)
111
112 IF ( tempAdamsBashforth ) THEN
113 CALL ADAMS_BASHFORTH2(
114 I bi, bj, K,
115 U gT, gTnm1,
116 I myIter, myThid )
117 ENDIF
118
119 C-- External thermal forcing term(s) outside Adams-Bashforth:
120 IF ( tempForcing .AND. .NOT.forcing_In_AB )
121 & CALL EXTERNAL_FORCING_T(
122 I iMin,iMax,jMin,jMax,bi,bj,k,
123 I myTime,myThid)
124
125 #ifdef NONLIN_FRSURF
126 IF (nonlinFreeSurf.GT.0) THEN
127 CALL FREESURF_RESCALE_G(
128 I bi, bj, K,
129 U gT,
130 I myThid )
131 IF ( tempAdamsBashforth )
132 & CALL FREESURF_RESCALE_G(
133 I bi, bj, K,
134 U gTnm1,
135 I myThid )
136 ENDIF
137 #endif /* NONLIN_FRSURF */
138
139 #endif /* ALLOW_GENERIC_ADVDIFF */
140
141 RETURN
142 END

  ViewVC Help
Powered by ViewVC 1.1.22