1 |
cnh |
1.18 |
C $Header: /u/gcmpack/models/MITgcmUV/model/src/calc_common_factors.F,v 1.17 2001/07/30 20:20:43 heimbach Exp $ |
2 |
|
|
C $Name: $ |
3 |
cnh |
1.1 |
|
4 |
cnh |
1.10 |
#include "CPP_OPTIONS.h" |
5 |
cnh |
1.1 |
|
6 |
cnh |
1.18 |
CBOP |
7 |
|
|
C !ROUTINE: CALC_COMMON_FACTORS |
8 |
|
|
C !INTERFACE: |
9 |
cnh |
1.1 |
SUBROUTINE CALC_COMMON_FACTORS( |
10 |
adcroft |
1.16 |
I bi,bj,iMin,iMax,jMin,jMax,k, |
11 |
|
|
O xA,yA,uTrans,vTrans,rTrans,maskUp, |
12 |
cnh |
1.1 |
I myThid) |
13 |
cnh |
1.18 |
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 |
cnh |
1.1 |
|
27 |
cnh |
1.18 |
C !USES: |
28 |
cnh |
1.1 |
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 |
adcroft |
1.11 |
#ifdef ALLOW_NONHYDROSTATIC |
36 |
|
|
#include "GW.h" |
37 |
|
|
#endif |
38 |
cnh |
1.1 |
|
39 |
cnh |
1.18 |
C !INPUT/OUTPUT PARAMETERS: |
40 |
cnh |
1.1 |
C == Routine arguments == |
41 |
cnh |
1.18 |
C bi, bj, iMin, iMax, jMin, jMax :: Range of points for which calculation |
42 |
cnh |
1.1 |
C results will be set. |
43 |
cnh |
1.18 |
C xA :: Tracer cell face area normal to X |
44 |
|
|
C yA :: Tracer cell face area normal to X |
45 |
|
|
C uTrans :: Zonal volume transport through cell face |
46 |
|
|
C vTrans :: Meridional volume transport through cell face |
47 |
|
|
C rTrans :: R-direction volume transport through cell face |
48 |
|
|
C maskUp :: land/water mask for Wvel points (above tracer level) |
49 |
|
|
C myThid ::Instance number for this innvocation of CALC_COMMON_FACTORS |
50 |
cnh |
1.1 |
C |
51 |
adcroft |
1.16 |
INTEGER bi,bj,iMin,iMax,jMin,jMax,k |
52 |
cnh |
1.1 |
_RS xA (1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
53 |
|
|
_RS yA (1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
54 |
|
|
_RL uTrans(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
55 |
|
|
_RL vTrans(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
56 |
cnh |
1.7 |
_RL rTrans(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
57 |
cnh |
1.1 |
_RS maskUp(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
58 |
|
|
C |
59 |
|
|
INTEGER myThid |
60 |
|
|
|
61 |
cnh |
1.18 |
C !LOCAL VARIABLES: |
62 |
cnh |
1.1 |
C == Local variables == |
63 |
cnh |
1.18 |
C I, J :: Loop counters |
64 |
cnh |
1.1 |
INTEGER i,j |
65 |
cnh |
1.18 |
CEOP |
66 |
heimbach |
1.17 |
|
67 |
|
|
C-- Initialisation |
68 |
|
|
DO j=1-OLy,sNy+OLy |
69 |
|
|
DO i=1-OLx,sNx+OLx |
70 |
|
|
xA(i,j) = 0. _d 0 |
71 |
|
|
yA(i,j) = 0. _d 0 |
72 |
|
|
uTrans(i,j) = 0. _d 0 |
73 |
|
|
vTrans(i,j) = 0. _d 0 |
74 |
|
|
rTrans(i,j) = 0. _d 0 |
75 |
|
|
ENDDO |
76 |
|
|
ENDDO |
77 |
cnh |
1.6 |
|
78 |
adcroft |
1.11 |
C-- Calculate mask for tracer cells (0 => land, 1 => water) |
79 |
adcroft |
1.16 |
IF (K .EQ. 1) THEN |
80 |
|
|
DO j=jMin,jMax |
81 |
|
|
DO i=iMin,iMax |
82 |
|
|
maskUp(i,j) = 0. |
83 |
|
|
ENDDO |
84 |
|
|
ENDDO |
85 |
|
|
ELSE |
86 |
|
|
DO j=jMin,jMax |
87 |
|
|
DO i=iMin,iMax |
88 |
|
|
maskUp(i,j) = maskC(i,j,k-1,bi,bj)*maskC(i,j,k,bi,bj) |
89 |
|
|
ENDDO |
90 |
|
|
ENDDO |
91 |
|
|
ENDIF |
92 |
adcroft |
1.11 |
|
93 |
cnh |
1.6 |
C-- Calculate tracer cell face open areas |
94 |
cnh |
1.1 |
DO j=jMin,jMax |
95 |
|
|
DO i=iMin,iMax |
96 |
cnh |
1.9 |
xA(i,j) = _dyG(i,j,bi,bj) |
97 |
|
|
& *drF(k)*_hFacW(i,j,k,bi,bj) |
98 |
|
|
yA(i,j) = _dxG(i,j,bi,bj) |
99 |
|
|
& *drF(k)*_hFacS(i,j,k,bi,bj) |
100 |
cnh |
1.1 |
ENDDO |
101 |
|
|
ENDDO |
102 |
|
|
|
103 |
cnh |
1.6 |
C-- Calculate velocity field "volume transports" through |
104 |
|
|
C-- tracer cell faces. |
105 |
cnh |
1.1 |
DO j=jMin,jMax |
106 |
|
|
DO i=iMin,iMax |
107 |
|
|
uTrans(i,j) = uVel(i,j,k,bi,bj)*xA(i,j) |
108 |
|
|
vTrans(i,j) = vVel(i,j,k,bi,bj)*yA(i,j) |
109 |
|
|
ENDDO |
110 |
|
|
ENDDO |
111 |
|
|
|
112 |
cnh |
1.6 |
C-- Calculate vertical "volume transport" through |
113 |
|
|
C-- tracer cell face *above* this level. |
114 |
adcroft |
1.13 |
DO j=jMin,jMax |
115 |
adcroft |
1.11 |
DO i=iMin,iMax |
116 |
jmc |
1.15 |
rTrans(i,j) = wVel(i,j,k,bi,bj)*rA(i,j,bi,bj) |
117 |
adcroft |
1.11 |
ENDDO |
118 |
cnh |
1.6 |
ENDDO |
119 |
cnh |
1.1 |
|
120 |
|
|
RETURN |
121 |
|
|
END |