/[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.38 - (show annotations) (download)
Thu Jun 20 23:45:30 2002 UTC (21 years, 10 months ago) by jmc
Branch: MAIN
CVS Tags: checkpoint46n_post, checkpoint51k_post, checkpoint47e_post, checkpoint46l_post, checkpoint46g_pre, checkpoint47c_post, checkpoint50c_post, checkpoint46f_post, checkpoint52d_pre, checkpoint48e_post, checkpoint50g_post, checkpoint46b_post, checkpoint51o_pre, checkpoint48c_post, checkpoint51l_post, checkpoint48i_post, checkpoint46l_pre, checkpoint50d_pre, checkpoint51, checkpoint52, checkpoint50d_post, checkpoint50b_pre, checkpoint51f_post, checkpoint48b_post, checkpoint51d_post, checkpoint48c_pre, checkpoint47d_pre, checkpoint51t_post, checkpoint51n_post, checkpoint51s_post, checkpoint47a_post, checkpoint48d_pre, checkpoint51j_post, checkpoint47i_post, checkpoint52e_pre, checkpoint51n_pre, checkpoint47d_post, checkpoint46d_pre, checkpoint48d_post, checkpoint48f_post, checkpoint45d_post, checkpoint52b_pre, checkpoint46j_pre, checkpoint51l_pre, checkpoint48h_post, checkpoint51q_post, checkpoint51b_pre, checkpoint46a_post, checkpoint47g_post, checkpoint52b_post, checkpoint52c_post, checkpoint46j_post, checkpoint51h_pre, checkpoint46k_post, checkpoint46b_pre, checkpoint50f_post, checkpoint50a_post, checkpoint50f_pre, checkpoint47j_post, branch-exfmods-tag, branchpoint-genmake2, checkpoint46e_pre, checkpoint51r_post, checkpoint51i_post, checkpoint51b_post, checkpoint46c_pre, checkpoint46, checkpoint47b_post, checkpoint46h_pre, checkpoint52d_post, checkpoint46m_post, checkpoint46a_pre, checkpoint50c_pre, checkpoint46g_post, checkpoint51c_post, checkpoint52a_pre, checkpoint50h_post, checkpoint50e_pre, checkpoint50i_post, checkpoint51i_pre, checkpoint48a_post, checkpoint47f_post, checkpoint50e_post, checkpoint46i_post, checkpoint46c_post, branch-netcdf, checkpoint46e_post, checkpoint51e_post, checkpoint47, checkpoint48, checkpoint49, checkpoint46h_post, checkpoint51o_post, checkpoint50, checkpoint51f_pre, checkpoint47h_post, checkpoint52a_post, checkpoint51g_post, ecco_c52_e35, checkpoint46d_post, checkpoint50b_post, checkpoint51m_post, checkpoint51a_post, checkpoint51p_post, checkpoint48g_post, checkpoint51u_post
Branch point for: branch-exfmods-curt, branch-genmake2, branch-nonh, tg2-branch, netcdf-sm0, checkpoint51n_branch
Changes since 1.37: +6 -1 lines
apply rescaling (NONLIN_FRSURF) also to gNm1 to get a better conservation

1 C $Header: /u/gcmpack/MITgcm/model/src/calc_gt.F,v 1.37 2002/06/15 03:28:39 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,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 through cell face
62 C bi, bj, iMin, iMax, jMin, jMax :: Range of points for which calculation
63 C results will be set.
64 C myThid :: Instance number for this innvocation of CALC_GT
65 _RL fVerT (1-OLx:sNx+OLx,1-OLy:sNy+OLy,2)
66 _RS xA (1-OLx:sNx+OLx,1-OLy:sNy+OLy)
67 _RS yA (1-OLx:sNx+OLx,1-OLy:sNy+OLy)
68 _RL uTrans(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
69 _RL vTrans(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
70 _RL rTrans(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
71 _RS maskUp(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
72 _RL KappaRT(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr)
73 INTEGER k,kUp,kDown,kM1
74 INTEGER bi,bj,iMin,iMax,jMin,jMax
75 _RL myTime
76 INTEGER myIter
77 INTEGER myThid
78 CEOP
79
80 C === Local variables ===
81 LOGICAL calcAdvection
82
83 #ifdef ALLOW_AUTODIFF_TAMC
84 C-- only the kUp part of fverT is set in this subroutine
85 C-- the kDown is still required
86 fVerT(1,1,kDown) = fVerT(1,1,kDown)
87 #endif
88
89 calcAdvection = tempAdvection .AND. .NOT.tempMultiDimAdvec
90 CALL GAD_CALC_RHS(
91 I bi,bj,iMin,iMax,jMin,jMax,k,kM1,kUp,kDown,
92 I xA,yA,uTrans,vTrans,rTrans,maskUp,
93 I diffKhT, diffK4T, KappaRT, theta,
94 I GAD_TEMPERATURE, tempAdvScheme, calcAdvection,
95 U fVerT, gT,
96 I myThid )
97
98 C-- External thermal forcing term(s) inside Adams-Bashforth:
99 IF ( tempForcing .AND. forcing_In_AB )
100 & CALL EXTERNAL_FORCING_T(
101 I iMin,iMax,jMin,jMax,bi,bj,k,
102 I myTime,myThid)
103
104 IF ( tempAdamsBashforth ) THEN
105 CALL ADAMS_BASHFORTH2(
106 I bi, bj, K,
107 U gT, gTnm1,
108 I myIter, myThid )
109 ENDIF
110
111 C-- External thermal forcing term(s) outside Adams-Bashforth:
112 IF ( tempForcing .AND. .NOT.forcing_In_AB )
113 & CALL EXTERNAL_FORCING_T(
114 I iMin,iMax,jMin,jMax,bi,bj,k,
115 I myTime,myThid)
116
117 #ifdef NONLIN_FRSURF
118 IF (nonlinFreeSurf.GT.0) THEN
119 CALL FREESURF_RESCALE_G(
120 I bi, bj, K,
121 U gT,
122 I myThid )
123 IF ( tempAdamsBashforth )
124 & CALL FREESURF_RESCALE_G(
125 I bi, bj, K,
126 U gTnm1,
127 I myThid )
128 ENDIF
129 #endif /* NONLIN_FRSURF */
130
131 RETURN
132 END

  ViewVC Help
Powered by ViewVC 1.1.22