7 |
CBOP |
CBOP |
8 |
C !ROUTINE: CALC_GT |
C !ROUTINE: CALC_GT |
9 |
C !INTERFACE: |
C !INTERFACE: |
10 |
SUBROUTINE CALC_GT( |
SUBROUTINE CALC_GT( |
11 |
I bi,bj,iMin,iMax,jMin,jMax,k,kM1,kUp,kDown, |
I bi,bj,iMin,iMax,jMin,jMax,k,kM1,kUp,kDown, |
12 |
I xA,yA,uTrans,vTrans,rTrans,rTransKp1,maskUp, |
I xA, yA, maskUp, uFld, vFld, wFld, |
13 |
|
I uTrans, vTrans, rTrans, rTransKp1, |
14 |
I KappaRT, |
I KappaRT, |
15 |
U fVerT, |
U fVerT, |
16 |
I myTime,myIter,myThid ) |
I myTime,myIter,myThid ) |
17 |
C !DESCRIPTION: \bv |
C !DESCRIPTION: \bv |
18 |
C *==========================================================* |
C *==========================================================* |
19 |
C | SUBROUTINE CALC_GT |
C | SUBROUTINE CALC_GT |
20 |
C | o Calculate the temperature tendency terms. |
C | o Calculate the temperature tendency terms. |
21 |
C *==========================================================* |
C *==========================================================* |
22 |
C | A procedure called EXTERNAL_FORCING_T is called from |
C | A procedure called EXTERNAL_FORCING_T is called from |
23 |
C | here. These procedures can be used to add per problem |
C | here. These procedures can be used to add per problem |
24 |
C | heat flux source terms. |
C | heat flux source terms. |
25 |
C | Note: Although it is slightly counter-intuitive the |
C | Note: Although it is slightly counter-intuitive the |
26 |
C | EXTERNAL_FORCING routine is not the place to put |
C | EXTERNAL_FORCING routine is not the place to put |
27 |
C | file I/O. Instead files that are required to |
C | file I/O. Instead files that are required to |
28 |
C | calculate the external source terms are generally |
C | calculate the external source terms are generally |
29 |
C | read during the model main loop. This makes the |
C | read during the model main loop. This makes the |
30 |
C | logisitics of multi-processing simpler and also |
C | logisitics of multi-processing simpler and also |
31 |
C | makes the adjoint generation simpler. It also |
C | makes the adjoint generation simpler. It also |
32 |
C | allows for I/O to overlap computation where that |
C | allows for I/O to overlap computation where that |
33 |
C | is supported by hardware. |
C | is supported by hardware. |
34 |
C | Aside from the problem specific term the code here |
C | Aside from the problem specific term the code here |
35 |
C | forms the tendency terms due to advection and mixing |
C | forms the tendency terms due to advection and mixing |
36 |
C | The baseline implementation here uses a centered |
C | The baseline implementation here uses a centered |
37 |
C | difference form for the advection term and a tensorial |
C | difference form for the advection term and a tensorial |
38 |
C | divergence of a flux form for the diffusive term. The |
C | divergence of a flux form for the diffusive term. The |
39 |
C | diffusive term is formulated so that isopycnal mixing and |
C | diffusive term is formulated so that isopycnal mixing and |
40 |
C | GM-style subgrid-scale terms can be incorporated b simply |
C | GM-style subgrid-scale terms can be incorporated b simply |
41 |
C | setting the diffusion tensor terms appropriately. |
C | setting the diffusion tensor terms appropriately. |
42 |
C *==========================================================* |
C *==========================================================* |
43 |
C \ev |
C \ev |
44 |
|
|
59 |
|
|
60 |
C !INPUT/OUTPUT PARAMETERS: |
C !INPUT/OUTPUT PARAMETERS: |
61 |
C == Routine arguments == |
C == Routine arguments == |
62 |
C fVerT :: Flux of temperature (T) in the vertical |
C bi, bj, :: tile indices |
63 |
C direction at the upper(U) and lower(D) faces of a cell. |
C iMin,iMax :: loop range for called routines |
64 |
C maskUp :: Land mask used to denote base of the domain. |
C jMin,jMax :: loop range for called routines |
65 |
C xA :: Tracer cell face area normal to X |
C k :: vertical index |
66 |
C yA :: Tracer cell face area normal to X |
C kM1 :: =k-1 for k>1, =1 for k=1 |
67 |
C uTrans :: Zonal volume transport through cell face |
C kUp :: index into 2 1/2D array, toggles between 1|2 |
68 |
C vTrans :: Meridional volume transport through cell face |
C kDown :: index into 2 1/2D array, toggles between 2|1 |
69 |
C rTrans :: Vertical volume transport at interface k |
C xA :: Tracer cell face area normal to X |
70 |
|
C yA :: Tracer cell face area normal to X |
71 |
|
C maskUp :: Land mask used to denote base of the domain. |
72 |
|
C uFld,vFld :: Local copy of horizontal velocity field |
73 |
|
C wFld :: Local copy of vertical velocity field |
74 |
|
C uTrans :: Zonal volume transport through cell face |
75 |
|
C vTrans :: Meridional volume transport through cell face |
76 |
|
C rTrans :: Vertical volume transport at interface k |
77 |
C rTransKp1 :: Vertical volume transport at inteface k+1 |
C rTransKp1 :: Vertical volume transport at inteface k+1 |
78 |
C bi, bj, iMin, iMax, jMin, jMax :: Range of points for which calculation |
C KappaRT :: Vertical diffusion for Tempertature |
79 |
C results will be set. |
C fVerT :: Flux of temperature (T) in the vertical direction |
80 |
C myThid :: Instance number for this innvocation of CALC_GT |
C at the upper(U) and lower(D) faces of a cell. |
81 |
_RL fVerT (1-OLx:sNx+OLx,1-OLy:sNy+OLy,2) |
C myTime :: current time |
82 |
_RS xA (1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
C myIter :: current iteration number |
83 |
_RS yA (1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
C myThid :: my Thread Id. number |
84 |
_RL uTrans(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
INTEGER bi,bj,iMin,iMax,jMin,jMax |
85 |
_RL vTrans(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
INTEGER k,kUp,kDown,kM1 |
86 |
_RL rTrans(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
_RS xA (1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
87 |
|
_RS yA (1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
88 |
|
_RS maskUp (1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
89 |
|
_RL uFld (1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
90 |
|
_RL vFld (1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
91 |
|
_RL wFld (1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
92 |
|
_RL uTrans (1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
93 |
|
_RL vTrans (1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
94 |
|
_RL rTrans (1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
95 |
_RL rTransKp1(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
_RL rTransKp1(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
|
_RS maskUp(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
|
96 |
_RL KappaRT(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
_RL KappaRT(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
97 |
INTEGER k,kUp,kDown,kM1 |
_RL fVerT (1-OLx:sNx+OLx,1-OLy:sNy+OLy,2) |
|
INTEGER bi,bj,iMin,iMax,jMin,jMax |
|
98 |
_RL myTime |
_RL myTime |
99 |
INTEGER myIter |
INTEGER myIter |
100 |
INTEGER myThid |
INTEGER myThid |
145 |
m2 = 1 + MOD( iterNb ,2) |
m2 = 1 + MOD( iterNb ,2) |
146 |
CALL GAD_CALC_RHS( |
CALL GAD_CALC_RHS( |
147 |
I bi,bj,iMin,iMax,jMin,jMax,k,kM1,kUp,kDown, |
I bi,bj,iMin,iMax,jMin,jMax,k,kM1,kUp,kDown, |
148 |
I xA,yA,uTrans,vTrans,rTrans,rTransKp1,maskUp, |
I xA, yA, maskUp, uFld, vFld, wFld, |
149 |
I uVel, vVel, wVel, |
I uTrans, vTrans, rTrans, rTransKp1, |
150 |
I diffKhT, diffK4T, KappaRT, |
I diffKhT, diffK4T, KappaRT, |
151 |
I gtNm(1-Olx,1-Oly,1,1,1,m2), theta, |
I gtNm(1-Olx,1-Oly,1,1,1,m2), theta, |
152 |
I GAD_TEMPERATURE, tempAdvScheme, tempVertAdvScheme, |
I GAD_TEMPERATURE, tempAdvScheme, tempVertAdvScheme, |
156 |
#else /* ALLOW_ADAMSBASHFORTH_3 */ |
#else /* ALLOW_ADAMSBASHFORTH_3 */ |
157 |
CALL GAD_CALC_RHS( |
CALL GAD_CALC_RHS( |
158 |
I bi,bj,iMin,iMax,jMin,jMax,k,kM1,kUp,kDown, |
I bi,bj,iMin,iMax,jMin,jMax,k,kM1,kUp,kDown, |
159 |
I xA,yA,uTrans,vTrans,rTrans,rTransKp1,maskUp, |
I xA, yA, maskUp, uFld, vFld, wFld, |
160 |
I uVel, vVel, wVel, |
I uTrans, vTrans, rTrans, rTransKp1, |
161 |
I diffKhT, diffK4T, KappaRT, gtNm1, theta, |
I diffKhT, diffK4T, KappaRT, gtNm1, theta, |
162 |
I GAD_TEMPERATURE, tempAdvScheme, tempVertAdvScheme, |
I GAD_TEMPERATURE, tempAdvScheme, tempVertAdvScheme, |
163 |
I calcAdvection, tempImplVertAdv, AdamsBashforth_T, |
I calcAdvection, tempImplVertAdv, AdamsBashforth_T, |