/[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.39 - (show annotations) (download)
Wed Jan 7 21:18:01 2004 UTC (20 years, 4 months ago) by jmc
Branch: MAIN
CVS Tags: checkpoint52l_pre, hrcube4, hrcube5, checkpoint52j_pre, checkpoint52k_post, checkpoint53, checkpoint52f_post, checkpoint52i_pre, hrcube_2, hrcube_3, checkpoint52e_post, checkpoint53d_post, checkpoint52m_post, checkpoint52h_pre, hrcube_1, checkpoint52f_pre, checkpoint53c_post, checkpoint53a_post, checkpoint52i_post, checkpoint53f_post, checkpoint53b_pre, checkpoint52j_post, checkpoint52l_post, checkpoint52n_post, checkpoint53b_post, checkpoint53d_pre
Changes since 1.38: +9 -5 lines
rewrite (as in MultiDimAdvec) explicit tracer stepping (gad_calc_rhs.F)
 to work with implicit vertical advection and AB

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

  ViewVC Help
Powered by ViewVC 1.1.22