1 |
jmc |
1.3 |
C $Header: $ |
2 |
edhill |
1.2 |
C $Name: $ |
3 |
cheisey |
1.1 |
|
4 |
edhill |
1.2 |
#include "BULK_FORCE_OPTIONS.h" |
5 |
cheisey |
1.1 |
|
6 |
|
|
SUBROUTINE BULKF_READPARMS( myThid ) |
7 |
|
|
C /==========================================================\ |
8 |
jmc |
1.3 |
C | SUBROUTINE BULKF_READPARMS | |
9 |
|
|
C | o Routine to initialize BULKF variables and constants. | |
10 |
cheisey |
1.1 |
C |==========================================================| |
11 |
jmc |
1.3 |
C | Initialize BULKF parameters, read in data.blk | |
12 |
cheisey |
1.1 |
C \==========================================================/ |
13 |
|
|
IMPLICIT NONE |
14 |
|
|
|
15 |
|
|
C === Global variables === |
16 |
|
|
#include "SIZE.h" |
17 |
|
|
#include "EEPARAMS.h" |
18 |
|
|
#include "PARAMS.h" |
19 |
jmc |
1.3 |
#include "BULKF_PARAMS.h" |
20 |
cheisey |
1.1 |
#include "BULKF.h" |
21 |
|
|
#ifdef CONSERV_BULKF |
22 |
|
|
#include "BULKF_CONSERV.h" |
23 |
|
|
#endif |
24 |
|
|
|
25 |
|
|
C === Routine arguments === |
26 |
|
|
INTEGER myThid |
27 |
|
|
|
28 |
|
|
#ifdef ALLOW_BULK_FORCE |
29 |
jmc |
1.3 |
C === Local variables === |
30 |
|
|
C msgBuf - Informational/error meesage buffer |
31 |
|
|
C iUnit - Work variable for IO unit number |
32 |
|
|
CHARACTER*(MAX_LEN_MBUF) msgBuf |
33 |
|
|
INTEGER iUnit |
34 |
cheisey |
1.1 |
|
35 |
|
|
C-- Bulk Formula parameter |
36 |
jmc |
1.3 |
NAMELIST /BULKF_CONST/ |
37 |
|
|
& rhoa, rhofw, |
38 |
|
|
& cpair, cpwv, |
39 |
|
|
& Lvap, Lfresh, |
40 |
|
|
& Tf0kel, |
41 |
|
|
& cdrag_1, cdrag_2, cdrag_3, |
42 |
|
|
& stefan, xkar, Rvap, |
43 |
|
|
& p0, |
44 |
|
|
& humid_fac, saltsat, gamma_blk, |
45 |
|
|
& Lvap_ice, Rgas, |
46 |
|
|
& atm_emissivity, ocean_emissivity, |
47 |
|
|
& snow_emissivity, ice_emissivity, |
48 |
|
|
& blk_taveFreq |
49 |
|
|
|
50 |
cheisey |
1.1 |
NAMELIST /BULKF_PARM01/ |
51 |
|
|
& AirTempFile, AirHumidityFile, RainFile, |
52 |
|
|
& SolarFile, LongwaveFile, UWindFile, |
53 |
|
|
& VWindFile, RunoffFile, WSpeedFile, QnetFile, |
54 |
|
|
& EmPFile, CloudFile, readwindstress, readsurface |
55 |
|
|
|
56 |
|
|
#ifdef CONSERV_BULKF |
57 |
|
|
c- conserving qnet, empmr |
58 |
|
|
NAMELIST /BULKF_PARM02/ |
59 |
|
|
& qnet_off, empmr_off, conservcycle |
60 |
|
|
#endif |
61 |
|
|
|
62 |
|
|
|
63 |
|
|
_BEGIN_MASTER(myThid) |
64 |
|
|
|
65 |
|
|
WRITE(msgBuf,'(A)') ' BULKF_READPARMS: opening data.blk' |
66 |
|
|
CALL PRINT_MESSAGE( msgBuf, standardMessageUnit, |
67 |
|
|
& SQUEEZE_RIGHT , 1) |
68 |
|
|
|
69 |
|
|
|
70 |
|
|
CALL OPEN_COPY_DATA_FILE( |
71 |
|
|
I 'data.blk', 'BULKF_READPARMS', |
72 |
|
|
O iUnit, |
73 |
|
|
I myThid ) |
74 |
|
|
|
75 |
|
|
C-- Default values |
76 |
jmc |
1.3 |
C- Physical constant : |
77 |
|
|
rhoa = 1.3 _d 0 |
78 |
|
|
rhofw = rhoConstFresh |
79 |
|
|
cpair = atm_Cp |
80 |
|
|
cpwv = 1.81 _d 3 |
81 |
|
|
Lvap = 2.5 _d 6 |
82 |
|
|
Lfresh = 3.34 _d 5 |
83 |
|
|
Tf0kel = celsius2K |
84 |
|
|
cdrag_1= 0.0027000 _d 0 |
85 |
|
|
cdrag_2= 0.0001420 _d 0 |
86 |
|
|
cdrag_3= 0.0000764 _d 0 |
87 |
|
|
stefan = 5.67 _d -8 |
88 |
|
|
xkar = 0.4 _d 0 |
89 |
|
|
Rvap = 461. _d 0 |
90 |
|
|
p0 = atm_Po / 100. |
91 |
|
|
humid_fac = 0.606 _d 0 |
92 |
|
|
saltsat = 0.980 _d 0 |
93 |
|
|
gamma_blk = 0.010 _d 0 |
94 |
|
|
Lvap_ice = 2.83 _d 6 |
95 |
|
|
Rgas = atm_Rd |
96 |
|
|
atm_emissivity = .90 _d 0 |
97 |
|
|
ocean_emissivity= .985 _d 0 |
98 |
|
|
snow_emissivity = .98 _d 0 |
99 |
|
|
ice_emissivity = .98 _d 0 |
100 |
|
|
|
101 |
|
|
C- bulk-forcing parameters: |
102 |
|
|
blk_taveFreq = taveFreq |
103 |
|
|
|
104 |
|
|
C- Input data files names : |
105 |
cheisey |
1.1 |
AirTempFile=' ' |
106 |
|
|
AirHumidityFile=' ' |
107 |
|
|
RainFile=' ' |
108 |
|
|
SolarFile=' ' |
109 |
|
|
LongwaveFile=' ' |
110 |
|
|
UWindFile=' ' |
111 |
|
|
VWindFile=' ' |
112 |
|
|
WspeedFile=' ' |
113 |
|
|
RunoffFile=' ' |
114 |
|
|
QnetFile=' ' |
115 |
|
|
EmPFile=' ' |
116 |
|
|
CloudFile=' ' |
117 |
|
|
SnowFile=' ' |
118 |
|
|
readwindstress=.TRUE. |
119 |
|
|
readsurface=.TRUE. |
120 |
|
|
|
121 |
|
|
C-- Read parameters from open data file |
122 |
jmc |
1.3 |
READ(UNIT=iUnit,NML=BULKF_CONST) |
123 |
|
|
WRITE(msgBuf,'(A)') ' BULKF_READPARMS: read BULKF_CONST' |
124 |
|
|
CALL PRINT_MESSAGE( msgBuf, standardMessageUnit, |
125 |
|
|
& SQUEEZE_RIGHT , 1) |
126 |
|
|
|
127 |
cheisey |
1.1 |
READ(UNIT=iUnit,NML=BULKF_PARM01) |
128 |
|
|
WRITE(msgBuf,'(A)') ' BULKF_READPARMS: read BULKF_PARM01' |
129 |
|
|
CALL PRINT_MESSAGE( msgBuf, standardMessageUnit, |
130 |
|
|
& SQUEEZE_RIGHT , 1) |
131 |
|
|
|
132 |
|
|
#ifdef CONSERV_BULKF |
133 |
|
|
c -- default |
134 |
|
|
qnet_off=0.d0 |
135 |
|
|
empmr_off=0.d0 |
136 |
|
|
READ(UNIT=iUnit,NML=BULKF_PARM02) |
137 |
|
|
WRITE(msgBuf,'(A)') ' BULKF_READPARMS: read BULKF_PARM02' |
138 |
|
|
CALL PRINT_MESSAGE( msgBuf, standardMessageUnit, |
139 |
|
|
& SQUEEZE_RIGHT , 1) |
140 |
|
|
|
141 |
|
|
#endif /* CONSERV_BULKF */ |
142 |
|
|
|
143 |
|
|
C-- Close the open data file |
144 |
|
|
CLOSE(iUnit) |
145 |
jmc |
1.3 |
|
146 |
|
|
C- Define other constants (from previous ones): |
147 |
|
|
Qcoef = 6.11 _d 0 * 0.622 _d 0 / p0 |
148 |
|
|
Sha = Rgas / .286 _d 0 |
149 |
|
|
|
150 |
|
|
C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----| |
151 |
|
|
iUnit = standardMessageUnit |
152 |
|
|
c iUnit=88 |
153 |
|
|
c OPEN(iUnit,file='bulkf_check_params',status='unknown') |
154 |
|
|
WRITE(iUnit,*) 'BlkF: rhoa =',rhoa |
155 |
|
|
WRITE(iUnit,*) 'BlkF: rhofw =',rhofw |
156 |
|
|
WRITE(iUnit,*) 'BlkF: cpair =',cpair |
157 |
|
|
WRITE(iUnit,*) 'BlkF: cpwv =',cpwv |
158 |
|
|
WRITE(iUnit,*) 'BlkF: Lvap =',Lvap |
159 |
|
|
WRITE(iUnit,*) 'BlkF: Lfresh =',Lfresh |
160 |
|
|
WRITE(iUnit,*) 'BlkF: Tf0kel =',Tf0kel |
161 |
|
|
WRITE(iUnit,*) 'BlkF: cdrag_1 =',cdrag_1 |
162 |
|
|
WRITE(iUnit,*) 'BlkF: cdrag_2 =',cdrag_2 |
163 |
|
|
WRITE(iUnit,*) 'BlkF: cdrag_3 =',cdrag_3 |
164 |
|
|
WRITE(iUnit,*) 'BlkF: stefan =',stefan |
165 |
|
|
WRITE(iUnit,*) 'BlkF: xkar =',xkar |
166 |
|
|
WRITE(iUnit,*) 'BlkF: Rvap =',Rvap |
167 |
|
|
WRITE(iUnit,*) 'BlkF: p0 =',p0 |
168 |
|
|
WRITE(iUnit,*) 'BlkF: Qcoef =',Qcoef |
169 |
|
|
WRITE(iUnit,*) 'BlkF: humid_fac=',humid_fac |
170 |
|
|
WRITE(iUnit,*) 'BlkF: saltsat =',saltsat |
171 |
|
|
WRITE(iUnit,*) 'BlkF: gamma_blk=',gamma_blk |
172 |
|
|
WRITE(iUnit,*) 'BlkF: Lvap_ice =',Lvap_ice |
173 |
|
|
WRITE(iUnit,*) 'BlkF: Rgas =',Rgas |
174 |
|
|
WRITE(iUnit,*) 'BlkF: Sha =',Sha |
175 |
|
|
WRITE(iUnit,*) 'BlkF: atm_emissivity =',atm_emissivity |
176 |
|
|
WRITE(iUnit,*) 'BlkF: ocean_emissivity=',ocean_emissivity |
177 |
|
|
WRITE(iUnit,*) 'BlkF: snow_emissivity =',snow_emissivity |
178 |
|
|
WRITE(iUnit,*) 'BlkF: ice_emissivity =',ice_emissivity |
179 |
|
|
WRITE(iUnit,*) 'BlkF: blk_taveFreq=',blk_taveFreq |
180 |
|
|
IF (iUnit.EQ.88) CLOSE(iUnit) |
181 |
|
|
C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----| |
182 |
|
|
|
183 |
cheisey |
1.1 |
_END_MASTER(myThid) |
184 |
|
|
|
185 |
|
|
C-- Everyone else must wait for the parameters to be loaded |
186 |
|
|
_BARRIER |
187 |
|
|
|
188 |
|
|
#endif /* ALLOW_BULK_FORCE */ |
189 |
|
|
|
190 |
jmc |
1.3 |
RETURN |
191 |
|
|
END |