1 |
C $Header: /u/gcmpack/MITgcm/model/src/taueddy_tendency_apply.F,v 1.1 2014/07/09 17:03:35 jmc Exp $ |
2 |
C $Name: $ |
3 |
|
4 |
#include "PACKAGES_CONFIG.h" |
5 |
#include "CPP_OPTIONS.h" |
6 |
#ifdef ALLOW_GMREDI |
7 |
# include "GMREDI_OPTIONS.h" |
8 |
#endif |
9 |
|
10 |
C-- File taueddy_tendency_apply.F: Routines to apply TAUEDDY tendencies |
11 |
C-- Contents |
12 |
C-- o TAUEDDY_TENDENCY_APPLY_U |
13 |
C-- o TAUEDDY_TENDENCY_APPLY_V |
14 |
|
15 |
C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----| |
16 |
CBOP |
17 |
C !ROUTINE: TAUEDDY_TENDENCY_APPLY_U |
18 |
C !INTERFACE: |
19 |
SUBROUTINE TAUEDDY_TENDENCY_APPLY_U( |
20 |
U gU_arr, |
21 |
I iMin,iMax,jMin,jMax, k, bi, bj, |
22 |
I myTime, myIter, myThid ) |
23 |
C !DESCRIPTION: \bv |
24 |
C *==========================================================* |
25 |
C | S/R TAUEDDY_TENDENCY_APPLY_U |
26 |
C | o Contains problem specific forcing for zonal velocity. |
27 |
C *==========================================================* |
28 |
C | Adds terms to gU for forcing by external sources |
29 |
C | e.g. wind stress, bottom friction etc.................. |
30 |
C *==========================================================* |
31 |
C \ev |
32 |
|
33 |
C !USES: |
34 |
IMPLICIT NONE |
35 |
C == Global data == |
36 |
#include "SIZE.h" |
37 |
#include "EEPARAMS.h" |
38 |
#include "PARAMS.h" |
39 |
#include "GRID.h" |
40 |
#include "FFIELDS.h" |
41 |
#ifdef ALLOW_GMREDI |
42 |
# include "GMREDI.h" |
43 |
#endif |
44 |
|
45 |
C !INPUT/OUTPUT PARAMETERS: |
46 |
C gU_arr :: the tendency array |
47 |
C iMin,iMax :: Working range of x-index for applying forcing. |
48 |
C jMin,jMax :: Working range of y-index for applying forcing. |
49 |
C k :: Current vertical level index |
50 |
C bi,bj :: Current tile indices |
51 |
C myTime :: Current time in simulation |
52 |
C myIter :: Current iteration number |
53 |
C myThid :: my Thread Id number |
54 |
_RL gU_arr(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
55 |
INTEGER iMin, iMax, jMin, jMax |
56 |
INTEGER k, bi, bj |
57 |
_RL myTime |
58 |
INTEGER myIter |
59 |
INTEGER myThid |
60 |
CEOP |
61 |
|
62 |
#ifdef ALLOW_EDDYPSI |
63 |
C !LOCAL VARIABLES: |
64 |
C i, j :: Loop counters |
65 |
INTEGER i, j |
66 |
INTEGER kp1 |
67 |
_RL maskm1, maskp1 |
68 |
|
69 |
C Add zonal eddy momentum impulse into the layer |
70 |
#ifdef ALLOW_GMREDI |
71 |
IF ( GM_InMomAsStress ) THEN |
72 |
#endif |
73 |
kp1 = MIN(k+1,Nr) |
74 |
maskp1 = 1. |
75 |
maskm1 = 1. |
76 |
IF (k.EQ.Nr) maskp1 = 0. |
77 |
IF (k.EQ.1) maskm1 = 0. |
78 |
DO j=jMin,jMax |
79 |
DO i=iMin,iMax |
80 |
gU_arr(i,j) = gU_arr(i,j) |
81 |
& +foFacMom*recip_rhoConst* |
82 |
& ( maskm1*_maskW(i,j, k ,bi,bj)*tauxEddy(i,j, k ,bi,bj) |
83 |
& - maskp1*_maskW(i,j,kp1,bi,bj)*tauxEddy(i,j,kp1,bi,bj) ) |
84 |
& *recip_drF(k)*_recip_hFacW(i,j,k,bi,bj) |
85 |
ENDDO |
86 |
ENDDO |
87 |
#ifdef ALLOW_GMREDI |
88 |
ENDIF |
89 |
#endif |
90 |
|
91 |
#endif /* ALLOW_EDDYPSI */ |
92 |
|
93 |
RETURN |
94 |
END |
95 |
|
96 |
C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----| |
97 |
CBOP |
98 |
C !ROUTINE: TAUEDDY_TENDENCY_APPLY_V |
99 |
C !INTERFACE: |
100 |
SUBROUTINE TAUEDDY_TENDENCY_APPLY_V( |
101 |
U gV_arr, |
102 |
I iMin,iMax,jMin,jMax, k, bi, bj, |
103 |
I myTime, myIter, myThid ) |
104 |
C !DESCRIPTION: \bv |
105 |
C *==========================================================* |
106 |
C | S/R TAUEDDY_TENDENCY_APPLY_V |
107 |
C | o Contains problem specific forcing for merid velocity. |
108 |
C *==========================================================* |
109 |
C | Adds terms to gV for forcing by external sources |
110 |
C | e.g. wind stress, bottom friction etc.................. |
111 |
C *==========================================================* |
112 |
C \ev |
113 |
|
114 |
C !USES: |
115 |
IMPLICIT NONE |
116 |
C == Global data == |
117 |
#include "SIZE.h" |
118 |
#include "EEPARAMS.h" |
119 |
#include "PARAMS.h" |
120 |
#include "GRID.h" |
121 |
#include "FFIELDS.h" |
122 |
#ifdef ALLOW_GMREDI |
123 |
#include "GMREDI.h" |
124 |
#endif |
125 |
|
126 |
C !INPUT/OUTPUT PARAMETERS: |
127 |
C gV_arr :: the tendency array |
128 |
C iMin,iMax :: Working range of x-index for applying forcing. |
129 |
C jMin,jMax :: Working range of y-index for applying forcing. |
130 |
C k :: Current vertical level index |
131 |
C bi,bj :: Current tile indices |
132 |
C myTime :: Current time in simulation |
133 |
C myIter :: Current iteration number |
134 |
C myThid :: my Thread Id number |
135 |
_RL gV_arr(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
136 |
INTEGER iMin, iMax, jMin, jMax |
137 |
INTEGER k, bi, bj |
138 |
_RL myTime |
139 |
INTEGER myIter |
140 |
INTEGER myThid |
141 |
CEOP |
142 |
|
143 |
#ifdef ALLOW_EDDYPSI |
144 |
C !LOCAL VARIABLES: |
145 |
C i, j :: Loop counters |
146 |
INTEGER i, j |
147 |
INTEGER kp1 |
148 |
_RL maskm1, maskp1 |
149 |
|
150 |
C Add meridional eddy momentum impulse into the layer |
151 |
#ifdef ALLOW_GMREDI |
152 |
IF ( GM_InMomAsStress ) THEN |
153 |
#endif |
154 |
kp1 = MIN(k+1,Nr) |
155 |
maskp1 = 1. |
156 |
maskm1 = 1. |
157 |
IF (k.EQ.Nr) maskp1 = 0. |
158 |
IF (k.EQ.1) maskm1 = 0. |
159 |
DO j=jMin,jMax |
160 |
DO i=iMin,iMax |
161 |
gV_arr(i,j) = gV_arr(i,j) |
162 |
& +foFacMom*recip_rhoConst* |
163 |
& ( maskm1*_maskS(i,j, k ,bi,bj)*tauyEddy(i,j, k ,bi,bj) |
164 |
& - maskp1*_maskS(i,j,kp1,bi,bj)*tauyEddy(i,j,kp1,bi,bj) ) |
165 |
& *recip_drF(k)*_recip_hFacS(i,j,k,bi,bj) |
166 |
ENDDO |
167 |
ENDDO |
168 |
#ifdef ALLOW_GMREDI |
169 |
ENDIF |
170 |
#endif |
171 |
|
172 |
#endif /* ALLOW_EDDYPSI */ |
173 |
|
174 |
RETURN |
175 |
END |