1 |
jmc |
1.5 |
C $Header: /u/gcmpack/models/MITgcmUV/verification/hs94.cs-32x32x5/code/external_forcing.F,v 1.4 2001/06/06 20:31:48 adcroft Exp $ |
2 |
adcroft |
1.3 |
C $Name: $ |
3 |
adcroft |
1.2 |
|
4 |
|
|
#include "CPP_OPTIONS.h" |
5 |
|
|
|
6 |
|
|
CStartOfInterface |
7 |
|
|
SUBROUTINE EXTERNAL_FORCING_U( |
8 |
|
|
I iMin, iMax, jMin, jMax,bi,bj,kLev, |
9 |
|
|
I myCurrentTime,myThid) |
10 |
|
|
C /==========================================================\ |
11 |
|
|
C | S/R EXTERNAL_FORCING_U | |
12 |
|
|
C | o Contains problem specific forcing for zonal velocity. | |
13 |
|
|
C |==========================================================| |
14 |
|
|
C | Adds terms to gU for forcing by external sources | |
15 |
|
|
C | e.g. wind stress, bottom friction etc.................. | |
16 |
|
|
C \==========================================================/ |
17 |
|
|
IMPLICIT NONE |
18 |
|
|
|
19 |
|
|
C == Global data == |
20 |
|
|
#include "SIZE.h" |
21 |
|
|
#include "EEPARAMS.h" |
22 |
|
|
#include "PARAMS.h" |
23 |
|
|
#include "GRID.h" |
24 |
|
|
#include "DYNVARS.h" |
25 |
|
|
#include "FFIELDS.h" |
26 |
|
|
|
27 |
|
|
C == Routine arguments == |
28 |
|
|
C iMin - Working range of tile for applying forcing. |
29 |
|
|
C iMax |
30 |
|
|
C jMin |
31 |
|
|
C jMax |
32 |
|
|
C kLev |
33 |
|
|
INTEGER iMin, iMax, jMin, jMax, kLev, bi, bj |
34 |
|
|
_RL myCurrentTime |
35 |
|
|
INTEGER myThid |
36 |
|
|
CEndOfInterface |
37 |
|
|
|
38 |
|
|
C == Local variables == |
39 |
|
|
C Loop counters |
40 |
|
|
INTEGER I, J |
41 |
|
|
C _RL uKf |
42 |
|
|
C _RL levelOfGround |
43 |
|
|
C _RL criticalLevel |
44 |
|
|
C _RL levelOfVelPoint |
45 |
|
|
C _RL dist1 |
46 |
|
|
C _RL dist2 |
47 |
|
|
C _RL decayFac |
48 |
|
|
C _RL velDragHeightFac |
49 |
jmc |
1.5 |
_RL recip_P0g,termP,kV,kF,sigma_b |
50 |
adcroft |
1.2 |
|
51 |
|
|
C-- Forcing term(s) |
52 |
adcroft |
1.3 |
kF=1. _d 0/86400. _d 0 |
53 |
jmc |
1.5 |
sigma_b = 0.7 _d 0 |
54 |
|
|
c DO J=jMin,jMax |
55 |
|
|
c DO I=iMin,iMax |
56 |
|
|
DO J=1,sNy |
57 |
|
|
DO I=1,sNx+1 |
58 |
|
|
IF ( hFacW(i,j,kLev,bi,bj) .GT. 0. ) THEN |
59 |
|
|
recip_P0g=MAX(recip_Rcol(I,J,bi,bj),recip_Rcol(I-1,J,bi,bj)) |
60 |
|
|
termP=0.5 _d 0*( MIN(rF(kLev)*recip_P0g,1. _d 0) |
61 |
|
|
& +rF(kLev+1)*recip_P0g ) |
62 |
|
|
c termP=0.5 _d 0*( rF(kLev) + rF(kLev+1) )*recip_P0g |
63 |
|
|
kV=kF*MAX( 0. _d 0, (termP-sigma_b)/(1. _d 0-sigma_b) ) |
64 |
adcroft |
1.2 |
gU(i,j,kLev,bi,bj)=gU(i,j,kLev,bi,bj) |
65 |
|
|
& -kV*uVel(i,j,kLev,bi,bj) |
66 |
|
|
ENDIF |
67 |
|
|
ENDDO |
68 |
|
|
ENDDO |
69 |
|
|
|
70 |
|
|
RETURN |
71 |
|
|
END |
72 |
|
|
CStartOfInterface |
73 |
|
|
SUBROUTINE EXTERNAL_FORCING_V( |
74 |
|
|
I iMin, iMax, jMin, jMax,bi,bj,kLev, |
75 |
|
|
I myCurrentTime,myThid) |
76 |
|
|
C /==========================================================\ |
77 |
|
|
C | S/R EXTERNAL_FORCING_V | |
78 |
|
|
C | o Contains problem specific forcing for merid velocity. | |
79 |
|
|
C |==========================================================| |
80 |
|
|
C | Adds terms to gV for forcing by external sources | |
81 |
|
|
C | e.g. wind stress, bottom friction etc.................. | |
82 |
|
|
C \==========================================================/ |
83 |
|
|
IMPLICIT NONE |
84 |
|
|
|
85 |
|
|
C == Global data == |
86 |
|
|
#include "SIZE.h" |
87 |
|
|
#include "EEPARAMS.h" |
88 |
|
|
#include "PARAMS.h" |
89 |
|
|
#include "GRID.h" |
90 |
|
|
#include "DYNVARS.h" |
91 |
|
|
#include "FFIELDS.h" |
92 |
|
|
|
93 |
|
|
|
94 |
|
|
C == Routine arguments == |
95 |
|
|
C iMin - Working range of tile for applying forcing. |
96 |
|
|
C iMax |
97 |
|
|
C jMin |
98 |
|
|
C jMax |
99 |
|
|
C kLev |
100 |
|
|
INTEGER iMin, iMax, jMin, jMax, kLev, bi, bj |
101 |
|
|
_RL myCurrentTime |
102 |
|
|
INTEGER myThid |
103 |
|
|
CEndOfInterface |
104 |
|
|
C == Local variables == |
105 |
|
|
C Loop counters |
106 |
|
|
INTEGER I, J |
107 |
|
|
C _RL uKf |
108 |
|
|
C _RL levelOfGround |
109 |
|
|
C _RL criticalLevel |
110 |
|
|
C _RL levelOfVelPoint |
111 |
|
|
C _RL dist1 |
112 |
|
|
C _RL dist2 |
113 |
|
|
C _RL decayFac |
114 |
|
|
C _RL velDragHeightFac |
115 |
jmc |
1.5 |
_RL recip_P0g,termP,kV,kF,sigma_b |
116 |
adcroft |
1.2 |
|
117 |
|
|
C-- Forcing term(s) |
118 |
adcroft |
1.3 |
kF=1. _d 0/86400. _d 0 |
119 |
jmc |
1.5 |
sigma_b = 0.7 _d 0 |
120 |
|
|
c DO J=jMin,jMax |
121 |
|
|
c DO I=iMin,iMax |
122 |
|
|
DO J=1,sNy+1 |
123 |
|
|
DO I=1,sNx |
124 |
|
|
IF ( hFacS(i,j,kLev,bi,bj) .GT. 0. ) THEN |
125 |
|
|
recip_P0g=MAX(recip_Rcol(I,J,bi,bj),recip_Rcol(I,J-1,bi,bj)) |
126 |
|
|
termP=0.5 _d 0*( MIN(rF(kLev)*recip_P0g,1. _d 0) |
127 |
|
|
& +rF(kLev+1)*recip_P0g ) |
128 |
|
|
c termP=0.5 _d 0*( rF(kLev) + rF(kLev+1) )*recip_P0g |
129 |
|
|
kV=kF*MAX( 0. _d 0, (termP-sigma_b)/(1. _d 0-sigma_b) ) |
130 |
adcroft |
1.2 |
gV(i,j,kLev,bi,bj)=gV(i,j,kLev,bi,bj) |
131 |
|
|
& -kV*vVel(i,j,kLev,bi,bj) |
132 |
|
|
ENDIF |
133 |
|
|
ENDDO |
134 |
|
|
ENDDO |
135 |
|
|
|
136 |
|
|
RETURN |
137 |
|
|
END |
138 |
|
|
CStartOfInterface |
139 |
|
|
SUBROUTINE EXTERNAL_FORCING_T( |
140 |
|
|
I iMin, iMax, jMin, jMax,bi,bj,kLev, |
141 |
|
|
I myCurrentTime,myThid) |
142 |
|
|
C /==========================================================\ |
143 |
|
|
C | S/R EXTERNAL_FORCING_T | |
144 |
|
|
C | o Contains problem specific forcing for temperature. | |
145 |
|
|
C |==========================================================| |
146 |
|
|
C | Adds terms to gT for forcing by external sources | |
147 |
|
|
C | e.g. heat flux, climatalogical relaxation.............. | |
148 |
|
|
C \==========================================================/ |
149 |
|
|
IMPLICIT NONE |
150 |
|
|
|
151 |
|
|
C == Global data == |
152 |
|
|
#include "SIZE.h" |
153 |
|
|
#include "EEPARAMS.h" |
154 |
|
|
#include "PARAMS.h" |
155 |
|
|
#include "GRID.h" |
156 |
|
|
#include "DYNVARS.h" |
157 |
|
|
#include "FFIELDS.h" |
158 |
|
|
|
159 |
|
|
C == Routine arguments == |
160 |
|
|
C iMin - Working range of tile for applying forcing. |
161 |
|
|
C iMax |
162 |
|
|
C jMin |
163 |
|
|
C jMax |
164 |
|
|
C kLev |
165 |
|
|
INTEGER iMin, iMax, jMin, jMax, kLev, bi, bj |
166 |
|
|
_RL myCurrentTime |
167 |
|
|
INTEGER myThid |
168 |
|
|
CEndOfInterface |
169 |
|
|
|
170 |
|
|
C == Local variables == |
171 |
|
|
C Loop counters |
172 |
|
|
INTEGER I, J |
173 |
jmc |
1.5 |
_RL thetaLim,kT,ka,ks,sigma_b,term1,term2,thetaEq,termP |
174 |
adcroft |
1.2 |
|
175 |
|
|
C-- Forcing term(s) |
176 |
adcroft |
1.3 |
ka=1. _d 0/(40. _d 0*86400. _d 0) |
177 |
|
|
ks=1. _d 0/(4. _d 0 *86400. _d 0) |
178 |
jmc |
1.5 |
sigma_b = 0.7 _d 0 |
179 |
adcroft |
1.2 |
DO J=jMin,jMax |
180 |
|
|
DO I=iMin,iMax |
181 |
jmc |
1.5 |
term1=60. _d 0*(sin(yC(I,J,bi,bj)*deg2rad)**2) |
182 |
|
|
termP=0.5 _d 0*( rF(kLev) + rF(kLev+1) ) |
183 |
|
|
term2=10. _d 0*log(termP/atm_po) |
184 |
|
|
& *(cos(yC(I,J,bi,bj)*deg2rad)**2) |
185 |
|
|
thetaLim = 200. _d 0/ ((termP/atm_po)**atm_kappa) |
186 |
|
|
thetaEq=315. _d 0-term1-term2 |
187 |
|
|
thetaEq=MAX(thetaLim,thetaEq) |
188 |
|
|
termP=0.5 _d 0*( MIN(rF(kLev),Ro_surf(I,J,bi,bj))+rF(kLev+1) ) |
189 |
|
|
kT=ka+(ks-ka) |
190 |
|
|
& *MAX(0. _d 0, |
191 |
|
|
& (termP*recip_Rcol(I,J,bi,bj)-sigma_b)/(1. _d 0-sigma_b) ) |
192 |
|
|
& *COS((yC(I,J,bi,bj)*deg2rad))**4 |
193 |
adcroft |
1.2 |
gT(i,j,kLev,bi,bj)=gT(i,j,kLev,bi,bj) |
194 |
|
|
& - kT*( theta(I,J,kLev,bi,bj)-thetaEq ) |
195 |
|
|
& *maskC(i,j,kLev,bi,bj) |
196 |
|
|
ENDDO |
197 |
|
|
ENDDO |
198 |
|
|
|
199 |
|
|
RETURN |
200 |
|
|
END |
201 |
|
|
CStartOfInterface |
202 |
|
|
SUBROUTINE EXTERNAL_FORCING_S( |
203 |
|
|
I iMin, iMax, jMin, jMax,bi,bj,kLev, |
204 |
|
|
I myCurrentTime,myThid) |
205 |
|
|
C /==========================================================\ |
206 |
|
|
C | S/R EXTERNAL_FORCING_S | |
207 |
|
|
C | o Contains problem specific forcing for merid velocity. | |
208 |
|
|
C |==========================================================| |
209 |
|
|
C | Adds terms to gS for forcing by external sources | |
210 |
|
|
C | e.g. fresh-water flux, climatalogical relaxation....... | |
211 |
|
|
C \==========================================================/ |
212 |
|
|
IMPLICIT NONE |
213 |
|
|
|
214 |
|
|
C == Global data == |
215 |
|
|
#include "SIZE.h" |
216 |
|
|
#include "EEPARAMS.h" |
217 |
|
|
#include "PARAMS.h" |
218 |
|
|
#include "GRID.h" |
219 |
|
|
#include "DYNVARS.h" |
220 |
|
|
#include "FFIELDS.h" |
221 |
|
|
|
222 |
|
|
C == Routine arguments == |
223 |
|
|
C iMin - Working range of tile for applying forcing. |
224 |
|
|
C iMax |
225 |
|
|
C jMin |
226 |
|
|
C jMax |
227 |
|
|
C kLev |
228 |
|
|
INTEGER iMin, iMax, jMin, jMax, kLev, bi, bj |
229 |
|
|
_RL myCurrentTime |
230 |
|
|
INTEGER myThid |
231 |
|
|
CEndOfInterface |
232 |
|
|
|
233 |
|
|
C == Local variables == |
234 |
|
|
C Loop counters |
235 |
|
|
INTEGER I, J |
236 |
|
|
|
237 |
|
|
C-- Forcing term(s) |
238 |
|
|
|
239 |
|
|
RETURN |
240 |
|
|
END |