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