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

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

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


Revision 1.20 - (show annotations) (download)
Wed Jan 7 21:18:01 2004 UTC (20 years, 5 months ago) by jmc
Branch: MAIN
CVS Tags: checkpoint57m_post, checkpoint52l_pre, hrcube4, hrcube5, checkpoint57g_pre, checkpoint57s_post, checkpoint58b_post, checkpoint57b_post, checkpoint57g_post, checkpoint56b_post, checkpoint57y_post, checkpoint52j_pre, checkpoint54d_post, checkpoint54e_post, checkpoint57r_post, checkpoint57d_post, checkpoint57i_post, checkpoint52k_post, checkpoint58, checkpoint55, checkpoint54, checkpoint57, checkpoint56, checkpoint53, checkpoint58f_post, checkpoint52f_post, checkpoint57n_post, checkpoint58d_post, checkpoint58a_post, checkpoint57z_post, checkpoint54f_post, checkpoint55i_post, checkpoint57l_post, checkpoint52i_pre, checkpoint57h_post, hrcube_2, hrcube_3, checkpoint57t_post, checkpoint55c_post, checkpoint57v_post, checkpoint57f_post, checkpoint52e_post, checkpoint53d_post, checkpoint57a_post, checkpoint57h_pre, checkpoint57x_post, checkpoint54b_post, checkpoint52m_post, checkpoint57y_pre, checkpoint55g_post, checkpoint52h_pre, checkpoint57c_post, hrcube_1, checkpoint52f_pre, checkpoint55d_post, checkpoint58e_post, checkpoint54a_pre, checkpoint53c_post, checkpoint55d_pre, checkpoint57c_pre, checkpoint55j_post, checkpoint54a_post, checkpoint55h_post, checkpoint57e_post, checkpoint55b_post, checkpoint53a_post, checkpoint55f_post, checkpoint53g_post, checkpoint57p_post, checkpint57u_post, checkpoint57q_post, eckpoint57e_pre, checkpoint52i_post, checkpoint56a_post, checkpoint53f_post, checkpoint53b_pre, checkpoint57h_done, checkpoint52j_post, checkpoint57j_post, checkpoint57f_pre, checkpoint58g_post, checkpoint52l_post, checkpoint52n_post, checkpoint58h_post, checkpoint56c_post, checkpoint58j_post, checkpoint57a_pre, checkpoint55a_post, checkpoint57o_post, checkpoint57k_post, checkpoint53b_post, checkpoint57w_post, checkpoint58i_post, checkpoint58c_post, checkpoint53d_pre, checkpoint55e_post, checkpoint54c_post
Changes since 1.19: +2 -2 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_common_factors.F,v 1.19 2003/10/09 04:19:18 edhill Exp $
2 C $Name: $
3
4 #include "CPP_OPTIONS.h"
5
6 CBOP
7 C !ROUTINE: CALC_COMMON_FACTORS
8 C !INTERFACE:
9 SUBROUTINE CALC_COMMON_FACTORS(
10 I bi,bj,iMin,iMax,jMin,jMax,k,
11 O xA,yA,uTrans,vTrans,rTrans,maskUp,
12 I myThid)
13 C !DESCRIPTION: \bv
14 C *==========================================================*
15 C | SUBROUTINE CALC_COMMON_FACTORS
16 C | o Calculate common data (such as volume flux) for use
17 C | by "Right hand side" subroutines.
18 C *==========================================================*
19 C | Here, we calculate terms or spatially varying factors
20 C | that are used at various points in the "RHS" subroutines.
21 C | This reduces the amount of total work, total memory
22 C | and therefore execution time and is generally a good
23 C | idea.
24 C *==========================================================*
25 C \ev
26
27 C !USES:
28 IMPLICIT NONE
29 C == GLobal variables ==
30 #include "SIZE.h"
31 #include "DYNVARS.h"
32 #include "EEPARAMS.h"
33 #include "PARAMS.h"
34 #include "GRID.h"
35
36 C !INPUT/OUTPUT PARAMETERS:
37 C == Routine arguments ==
38 C bi, bj, iMin, iMax, jMin, jMax :: Range of points for which calculation
39 C results will be set.
40 C xA :: Tracer cell face area normal to X
41 C yA :: Tracer cell face area normal to X
42 C uTrans :: Zonal volume transport through cell face
43 C vTrans :: Meridional volume transport through cell face
44 C rTrans :: R-direction volume transport through cell face
45 C maskUp :: land/water mask for Wvel points (above tracer level)
46 C myThid ::Instance number for this innvocation of CALC_COMMON_FACTORS
47 C
48 INTEGER bi,bj,iMin,iMax,jMin,jMax,k
49 _RS xA (1-OLx:sNx+OLx,1-OLy:sNy+OLy)
50 _RS yA (1-OLx:sNx+OLx,1-OLy:sNy+OLy)
51 _RL uTrans(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
52 _RL vTrans(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
53 _RL rTrans(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
54 _RS maskUp(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
55 C
56 INTEGER myThid
57
58 C !LOCAL VARIABLES:
59 C == Local variables ==
60 C I, J :: Loop counters
61 INTEGER i,j
62 CEOP
63
64 C-- Initialisation
65 DO j=1-OLy,sNy+OLy
66 DO i=1-OLx,sNx+OLx
67 xA(i,j) = 0. _d 0
68 yA(i,j) = 0. _d 0
69 uTrans(i,j) = 0. _d 0
70 vTrans(i,j) = 0. _d 0
71 rTrans(i,j) = 0. _d 0
72 ENDDO
73 ENDDO
74
75 C-- Calculate mask for tracer cells (0 => land, 1 => water)
76 IF (K .EQ. 1) THEN
77 DO j=jMin,jMax
78 DO i=iMin,iMax
79 maskUp(i,j) = 0.
80 ENDDO
81 ENDDO
82 ELSE
83 DO j=jMin,jMax
84 DO i=iMin,iMax
85 maskUp(i,j) = maskC(i,j,k-1,bi,bj)*maskC(i,j,k,bi,bj)
86 ENDDO
87 ENDDO
88 ENDIF
89
90 C-- Calculate tracer cell face open areas
91 DO j=jMin,jMax
92 DO i=iMin,iMax
93 xA(i,j) = _dyG(i,j,bi,bj)
94 & *drF(k)*_hFacW(i,j,k,bi,bj)
95 yA(i,j) = _dxG(i,j,bi,bj)
96 & *drF(k)*_hFacS(i,j,k,bi,bj)
97 ENDDO
98 ENDDO
99
100 C-- Calculate velocity field "volume transports" through
101 C-- tracer cell faces.
102 DO j=jMin,jMax
103 DO i=iMin,iMax
104 uTrans(i,j) = uVel(i,j,k,bi,bj)*xA(i,j)
105 vTrans(i,j) = vVel(i,j,k,bi,bj)*yA(i,j)
106 ENDDO
107 ENDDO
108
109 C-- Calculate vertical "volume transport" through
110 C-- tracer cell face *above* this level.
111 DO j=jMin,jMax
112 DO i=iMin,iMax
113 rTrans(i,j) = wVel(i,j,k,bi,bj)*rA(i,j,bi,bj)*maskUp(i,j)
114 ENDDO
115 ENDDO
116
117 RETURN
118 END

  ViewVC Help
Powered by ViewVC 1.1.22