1 |
C $Header: /u/u3/gcmpack/MITgcm/pkg/bulk_force/bulkf_formula.F,v 1.1.4.1 2003/10/02 18:18:33 adcroft Exp $ |
2 |
C $Name: $ |
3 |
c swd -- bulkf formula used in bulkf and ice pkgs |
4 |
|
5 |
#include "BULK_FORCE_OPTIONS.h" |
6 |
subroutine bulkf_formula( |
7 |
I uw, vw, us, Ta, Qa, nc, tsf_in, |
8 |
I flwup, flha, fsha, df0dT, |
9 |
I ust, vst, evp, ssq, iceornot, windread |
10 |
& ) |
11 |
|
12 |
IMPLICIT NONE |
13 |
c |
14 |
#include "EEPARAMS.h" |
15 |
#include "SIZE.h" |
16 |
#include "PARAMS.h" |
17 |
#include "DYNVARS.h" |
18 |
#include "GRID.h" |
19 |
#include "FFIELDS.h" |
20 |
#ifdef ALLOW_BULKFORMULA |
21 |
#include "BULKF_ICE_CONSTANTS.h" |
22 |
#include "BULKF.h" |
23 |
#endif |
24 |
|
25 |
c |
26 |
c calculate bulk formula fluxes over open ocean or seaice |
27 |
c |
28 |
c input |
29 |
_RL us ! wind speed |
30 |
_RL uw ! zonal wind speed (at grid center) |
31 |
_RL vw ! meridional wind speed (at grid center) |
32 |
_RL Ta ! air temperature at ht |
33 |
_RL Qa ! specific humidity at ht |
34 |
_RL tsf_in ! surface temperature (either ice or open water) |
35 |
_RL nc ! fraction cloud cover |
36 |
integer iceornot ! 0=open water, 1=ice cover |
37 |
logical windread ! |
38 |
c output |
39 |
_RL flwup ! upward long wave radiation |
40 |
_RL flha ! latent heat flux |
41 |
_RL fsha ! sensible heat flux |
42 |
_RL df0dT ! derivative of heat flux with respect to Tsf |
43 |
_RL ust ! zonal wind stress (at grid center) |
44 |
_RL vst ! meridional wind stress (at grid center) |
45 |
_RL evp ! evaporation rate (over open water) |
46 |
_RL ssq ! surface specific humidity (kg/kg) |
47 |
c |
48 |
c local variables |
49 |
_RL tsf ! surface temperature in K |
50 |
_RL ht ! reference height (m) |
51 |
_RL usm ! wind speed limited |
52 |
_RL t0 ! virtual temperature (K) |
53 |
_RL deltap ! potential temperature diff (K) |
54 |
_RL delq ! specific humidity difference |
55 |
_RL stable |
56 |
_RL lhcoef |
57 |
_RL shcoef |
58 |
_RL dflhdT ! derivative of latent heat with respect to T |
59 |
_RL dfshdT ! derivative of sensible heat with respect to T |
60 |
_RL dflwupdT ! derivative of long wave with respect to T |
61 |
_RL mixratio |
62 |
_RL ea |
63 |
|
64 |
#ifdef ALLOW_BULKFORMULA |
65 |
|
66 |
c --- external functions --- |
67 |
_RL exf_BulkCdn |
68 |
external exf_BulkCdn |
69 |
|
70 |
Qa=max(Qa,1e-7) |
71 |
Tsf=Tsf_in+Tf0kel |
72 |
ht=10 |
73 |
c Wind speed |
74 |
if (us.eq.0) then |
75 |
us = sqrt(uw*uw + vw*vw) |
76 |
endif |
77 |
usm = max(us,1.d-5) |
78 |
cQQQ try to limit drag |
79 |
usm = min(usm,5.d0) |
80 |
c |
81 |
t0 = Ta*(1.d0 + humid_fac*Qa) |
82 |
ssq = qcoef*exp(22.47*(1.d0-Tf0kel/tsf)) |
83 |
cBB debugging |
84 |
cBB print*,'ice, ssq', qcoef, ssq |
85 |
c |
86 |
deltap = ta - tsf + gamma_blk*ht |
87 |
delq = Qa - ssq |
88 |
stable = 5.d-1 + sign(5.d-1, deltap) |
89 |
cQQ -- check all of this |
90 |
c latent heat coeff. following Gill 2.4.6 and 2.6.2 formula |
91 |
lhcoef =Lvap*rhoa*usm*1.5e-3 !QQ name coeff. |
92 |
flha = lhcoef*delq |
93 |
evp= lhcoef*delq/Lvap/rhosw |
94 |
c sensible heat coeff. following Gill 2.4.5 formula |
95 |
if (stable.gt.0) then |
96 |
shcoef = 0.83e-3*rhoa*usm*cpair |
97 |
else |
98 |
shcoef = 1.10e-3*rhoa*usm*cpair |
99 |
endif |
100 |
fsha = shcoef*deltap |
101 |
c up long wave radiation |
102 |
mixratio=Qa/(1-Qa) |
103 |
ea=p0*mixratio/(0.62197+mixratio) |
104 |
flwup=-0.985*stefan*tsf**4 |
105 |
& *(0.39-0.05*sqrt(ea)) |
106 |
& *(1-0.6*nc**2) |
107 |
#ifdef ALLOW_TSEAICE |
108 |
if (iceornot.eq.1) then |
109 |
c derivatives with respect to Tsf |
110 |
dflhdT = -lhcoef*Tf0kel*ssq*22.47/(tsf**2) |
111 |
dfshdT = -shcoef |
112 |
dflwupdT=-4.*0.985*stefan*tsf**3 |
113 |
& *(0.39-0.05*sqrt(ea)) |
114 |
c total derivative with respect to surface temperature |
115 |
df0dT=dflwupdT+dfshdT+dflhdT |
116 |
cBB |
117 |
cBB print*,'derivatives:',df0dT,dflwupdT,dfshdT,dflhdT |
118 |
endif |
119 |
#endif /*ALLOW_TSEAICE*/ |
120 |
c |
121 |
c wind stress at center points |
122 |
if (.NOT.windread) then |
123 |
ust = rhoa*exf_BulkCdn(usm)*us*uw |
124 |
vst = rhoa*exf_BulkCdn(usm)*us*vw |
125 |
endif |
126 |
#endif /*ALLOW_BULKFORMULA*/ |
127 |
|
128 |
return |
129 |
end |