1 |
C $Header: /u/gcmpack/MITgcm/pkg/dic/dic_readparms.F,v 1.6 2008/04/09 20:08:14 dfer Exp $ |
2 |
C $Name: $ |
3 |
|
4 |
#include "DIC_OPTIONS.h" |
5 |
|
6 |
CBOP |
7 |
C !ROUTINE: DIC_READPARMS |
8 |
C !INTERFACE: ========================================================== |
9 |
SUBROUTINE DIC_READPARMS( myThid ) |
10 |
|
11 |
C !DESCRIPTION: \bv |
12 |
C *==========================================================* |
13 |
C | S/R DIC_READPARMS |
14 |
C | o Initialise and read dic package parameters |
15 |
C *==========================================================* |
16 |
C \ev |
17 |
|
18 |
C !USES: |
19 |
IMPLICIT NONE |
20 |
|
21 |
C === Global variables === |
22 |
#include "SIZE.h" |
23 |
#include "EEPARAMS.h" |
24 |
#include "PARAMS.h" |
25 |
#include "DIC_VARS.h" |
26 |
|
27 |
C !INPUT/OUTPUT PARAMETERS: |
28 |
C === Routine arguments === |
29 |
C myThid :: My Thread Id. number |
30 |
INTEGER myThid |
31 |
CEOP |
32 |
|
33 |
#ifdef ALLOW_DIC |
34 |
|
35 |
C === Local variables === |
36 |
C msgBuf :: Informational/error message buffer |
37 |
C iUnit :: Work variable for IO unit number |
38 |
CHARACTER*(MAX_LEN_MBUF) msgBuf |
39 |
INTEGER iUnit |
40 |
INTEGER i,j,bi,bj |
41 |
_RL alphaloc, rain_ratioloc |
42 |
|
43 |
C- jmc: Add this local common bloc to fix the multi-threaded version |
44 |
COMMON / DIC_READPARMS_LOCAL / |
45 |
& alphaloc, rain_ratioloc |
46 |
|
47 |
C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----| |
48 |
|
49 |
C-- Abiotic dic parameters: |
50 |
C permil :: set carbon mol/m3 <---> mol/kg conversion factor |
51 |
C default permil = 1024.5 kg/m3 |
52 |
C Pa2Atm :: Conversion factor for atmospheric pressure pLoad (when coupled |
53 |
C to atmospheric model) into Atm. Default assumes pLoad in Pascal |
54 |
C 1 Atm = 1.01325e5 Pa = 1013.25 mb |
55 |
|
56 |
NAMELIST /ABIOTIC_PARMS/ permil, Pa2Atm |
57 |
|
58 |
#ifdef DIC_BIOTIC |
59 |
|
60 |
C-- Biotic dic parameters: |
61 |
C DOPfraction :: fraction of new production going to DOP |
62 |
C KDOPRemin :: DOP remineralization rate (1/s) = 1/(6 month) |
63 |
C KRemin :: remin power law coeff |
64 |
C zcrit :: Minimum Depth (m) over which biological activity |
65 |
C is computed --> determines nlev as the indice of the |
66 |
C first layer deeper than -zcrit |
67 |
C O2crit :: critical oxygen level (mol/m3) |
68 |
C R_OP, R_CP :: stochiometric ratios |
69 |
C R_NP, R_FeP |
70 |
C zca :: scale depth for CaCO3 remineralization (m) |
71 |
CC Parameters for light/nutrient limited bioac |
72 |
C parfrac :: fraction of Qsw that is PAR |
73 |
C k0 :: light attentuation coefficient (1/m) |
74 |
C lit0 :: half saturation light constant (W/m2) |
75 |
C KPO4 :: half saturation phosphate constant (mol/m3) |
76 |
C KFE :: half saturation fe constant (mol/m3) |
77 |
CC Iron chemisty values |
78 |
C alpfe :: solubility of aeolian fe |
79 |
C freefemax :: max solubility of free iron (mol/m3) |
80 |
CC Control variables |
81 |
C KScav :: iron scavenging rate QQ |
82 |
C ligand_stab :: ligand-free iron stability constant (m3/mol) |
83 |
C ligand_tot :: total free ligand (mol/m3) |
84 |
C alpha :: timescale for biological activity |
85 |
C read in alphaloc and filled in 2d array alpha |
86 |
C rain_ratio :: inorganic/organic carbon rain ratio |
87 |
C read in rain_ratioloc and filled in 2d array rain_ratio |
88 |
|
89 |
NAMELIST /BIOTIC_PARMS/ |
90 |
& DOPfraction, KDOPRemin, KRemin, zcrit, |
91 |
& O2crit, R_OP, R_CP, R_NP, R_FeP, zca, |
92 |
& parfrac, k0, lit0, KPO4, KFE, |
93 |
& alpfe, freefemax, |
94 |
& KScav, ligand_stab, ligand_tot, |
95 |
& alphaloc, rain_ratioloc |
96 |
#endif |
97 |
|
98 |
NAMELIST /DIC_FORCING/ |
99 |
& DIC_windFile, DIC_atmospFile, DIC_iceFile, |
100 |
& DIC_ironFile, DIC_silicaFile, |
101 |
& DIC_forcingPeriod, DIC_forcingCycle, |
102 |
& dic_int1, dic_int2, dic_int3, dic_int4, dic_pCO2 |
103 |
|
104 |
C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----| |
105 |
|
106 |
_BEGIN_MASTER(myThid) |
107 |
|
108 |
permil = 1. _d 0 / 1024.5 _d 0 |
109 |
Pa2Atm = 1.01325 _d 5 |
110 |
#ifdef DIC_BIOTIC |
111 |
DOPfraction = 0.67 _d 0 |
112 |
KDOPRemin = 1. _d 0/(6. _d 0*30. _d 0*86400. _d 0) |
113 |
KRemin = 0.9 _d 0 |
114 |
zcrit = 500. _d 0 |
115 |
O2crit = 4. _d -3 |
116 |
R_OP =-170. _d 0 |
117 |
R_CP = 117. _d 0 |
118 |
R_NP = 16. _d 0 |
119 |
R_FeP = 0.000468 _d 0 |
120 |
zca = 3500. _d 0 |
121 |
parfrac = 0.4 _d 0 |
122 |
k0 = 0.02 _d 0 |
123 |
lit0 = 30. _d 0 |
124 |
KPO4 = 5. _d -4 |
125 |
KFE = 1.2 _d -7 |
126 |
alpfe = 0.01 _d 0 |
127 |
freefemax = 3. _d -7 |
128 |
KScav = 0.19 _d 0/(360. _d 0*86400. _d 0) |
129 |
ligand_stab = 1. _d 8 |
130 |
ligand_tot = 1. _d -6 |
131 |
alphaloc = 2. _d -3/(360. _d 0 * 86400. _d 0) |
132 |
rain_ratioloc = 7. _d -2 |
133 |
#endif |
134 |
DIC_windFile = ' ' |
135 |
DIC_atmospFile= ' ' |
136 |
DIC_iceFile = ' ' |
137 |
DIC_ironFile = ' ' |
138 |
DIC_silicaFile= ' ' |
139 |
dic_int1 = 0 |
140 |
dic_int2 = 0 |
141 |
dic_int3 = 0 |
142 |
dic_int4 = 0 |
143 |
dic_pCO2 = 0. _d 0 |
144 |
c default periodic forcing to same as for physics |
145 |
DIC_forcingPeriod = externForcingPeriod |
146 |
DIC_forcingCycle = externForcingCycle |
147 |
|
148 |
WRITE(msgBuf,'(A)') ' DIC_READPARMS: opening data.dic' |
149 |
CALL PRINT_MESSAGE( msgBuf, standardMessageUnit, |
150 |
I SQUEEZE_RIGHT, myThid ) |
151 |
|
152 |
CALL OPEN_COPY_DATA_FILE( 'data.dic', 'DIC_READPARMS', |
153 |
O iUnit, myThid ) |
154 |
|
155 |
C-- Read parameters from open data file: |
156 |
|
157 |
C- Abiotic parameters |
158 |
READ(UNIT=iUnit,NML=ABIOTIC_PARMS) |
159 |
|
160 |
#ifdef DIC_BIOTIC |
161 |
C- Biotic parameters |
162 |
READ(UNIT=iUnit,NML=BIOTIC_PARMS) |
163 |
#endif |
164 |
|
165 |
C- forcing filenames and parameters |
166 |
READ(UNIT=iUnit,NML=DIC_FORCING) |
167 |
|
168 |
WRITE(msgBuf,'(A)') |
169 |
& ' DIC_READPARMS: finished reading data.dic' |
170 |
CALL PRINT_MESSAGE( msgBuf, standardMessageUnit, |
171 |
I SQUEEZE_RIGHT, myThid ) |
172 |
|
173 |
C-- Close the open data file |
174 |
CLOSE(iUnit) |
175 |
|
176 |
C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----| |
177 |
C- derive other parameters: |
178 |
|
179 |
#ifdef DIC_BIOTIC |
180 |
QSW_underice = .FALSE. |
181 |
#ifdef USE_QSW_UNDERICE |
182 |
QSW_underice = .TRUE. |
183 |
#elif (defined (USE_QSW)) |
184 |
C if using Qsw and seaice, then ice fraction is already |
185 |
C taken into account |
186 |
IF ( useSEAICE ) QSW_underice = .TRUE. |
187 |
IF ( useThSIce ) QSW_underice = .TRUE. |
188 |
#endif |
189 |
#endif /* DIC_BIOTIC */ |
190 |
|
191 |
C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----| |
192 |
C-- Print out parameter values : |
193 |
|
194 |
iUnit = standardMessageUnit |
195 |
WRITE(msgBuf,'(A)') ' ' |
196 |
CALL PRINT_MESSAGE(msgBuf,iUnit,SQUEEZE_RIGHT,myThid) |
197 |
WRITE(msgBuf,'(A)') '// ===================================' |
198 |
CALL PRINT_MESSAGE(msgBuf,iUnit,SQUEEZE_RIGHT,myThid) |
199 |
WRITE(msgBuf,'(A)') '// DIC package parameters :' |
200 |
CALL PRINT_MESSAGE(msgBuf,iUnit,SQUEEZE_RIGHT,myThid) |
201 |
WRITE(msgBuf,'(A)') '// ===================================' |
202 |
CALL PRINT_MESSAGE(msgBuf,iUnit,SQUEEZE_RIGHT,myThid) |
203 |
|
204 |
C- namelist ABIOTIC_PARMS |
205 |
CALL WRITE_0D_R8( permil, INDEX_NONE,'permil =', |
206 |
& ' /* Ref. density to convert mol/m3 to mol/kg */') |
207 |
CALL WRITE_0D_R8( Pa2Atm, INDEX_NONE,'Pa2Atm =', |
208 |
& ' /* Atmosph. pressure conversion coeff (to Atm) */') |
209 |
|
210 |
#ifdef DIC_BIOTIC |
211 |
C- namelist BIOTIC_PARMS |
212 |
CALL WRITE_0D_R8( DOPfraction, INDEX_NONE,'DOPfraction =', |
213 |
& ' /* Fraction of new production going to DOP */') |
214 |
CALL WRITE_0D_R8( KDOPRemin, INDEX_NONE,'KDOPRemin =', |
215 |
& ' /* DOP remineralization rate (1/s) */') |
216 |
CALL WRITE_0D_R8( KRemin, INDEX_NONE,'KRemin =', |
217 |
& ' /* Remin power law coeff. */') |
218 |
CALL WRITE_0D_R8( zcrit, INDEX_NONE,'zcrit =', |
219 |
& ' /* Minimum depth for biological activity (m) */') |
220 |
CALL WRITE_0D_R8( O2crit, INDEX_NONE,'O2crit =', |
221 |
& ' /* Critical oxygen level (mol/m3) */') |
222 |
CALL WRITE_0D_R8( R_OP, INDEX_NONE,'R_OP =', |
223 |
& ' /* Stochiometric ratio R_OP */') |
224 |
CALL WRITE_0D_R8( R_CP, INDEX_NONE,'R_CP =', |
225 |
& ' /* Stochiometric ratio R_CP */') |
226 |
CALL WRITE_0D_R8( R_NP, INDEX_NONE,'R_NP =', |
227 |
& ' /* Stochiometric ratio R_NP */') |
228 |
CALL WRITE_0D_R8( R_FeP, INDEX_NONE,'R_FeP =', |
229 |
& ' /* Stochiometric ratio R_FeP */') |
230 |
CALL WRITE_0D_R8( zca, INDEX_NONE,'zca =', |
231 |
& ' /* Scale depth for CaCO3 remineralization (m) */') |
232 |
CALL WRITE_0D_R8( parfrac, INDEX_NONE,'parfrac =', |
233 |
& ' /* Fraction of Qsw that is PAR */') |
234 |
CALL WRITE_0D_R8( k0, INDEX_NONE,'k0 =', |
235 |
& ' /* Light attentuation coefficient (1/m) */') |
236 |
CALL WRITE_0D_R8( lit0, INDEX_NONE,'lit0 =', |
237 |
& ' /* Half saturation light constant (W/m2) */') |
238 |
CALL WRITE_0D_R8( KPO4, INDEX_NONE,'KPO4 =', |
239 |
& ' /* Half saturation phosphate constant (mol/m3) */') |
240 |
CALL WRITE_0D_R8( KFE, INDEX_NONE,'KFE =', |
241 |
& ' /* Half saturation fe constant (mol/m3) */') |
242 |
CALL WRITE_0D_R8( alpfe, INDEX_NONE,'alpfe =', |
243 |
& ' /* Solubility of aeolian fe */') |
244 |
CALL WRITE_0D_R8( freefemax, INDEX_NONE,'freefemax =', |
245 |
& ' /* Max solubility of free iron (mol/m3) */') |
246 |
CALL WRITE_0D_R8( KScav, INDEX_NONE,'KScav =', |
247 |
& ' /* Iron scavenging rate */') |
248 |
CALL WRITE_0D_R8( ligand_stab, INDEX_NONE,'ligand_stab =', |
249 |
& ' /* Ligand-free iron stability constant (m3/mol) */') |
250 |
CALL WRITE_0D_R8( ligand_tot, INDEX_NONE,'ligand_tot =', |
251 |
& ' /* Total free ligand (mol/m3) */') |
252 |
CALL WRITE_0D_R8( alphaloc, INDEX_NONE,'alphaloc =', |
253 |
& ' /* Timescale for biological activity */') |
254 |
CALL WRITE_0D_R8( rain_ratioloc, INDEX_NONE,'rain_ratioloc =', |
255 |
& ' /* Inorganic/organic carbon rain ratio */') |
256 |
|
257 |
CALL WRITE_0D_L( QSW_underice, INDEX_NONE, 'QSW_underice =', |
258 |
& ' /* Flag for Qsw under Sea-Ice (i.e. SI fract included) */') |
259 |
#endif |
260 |
|
261 |
C- namelist DIC_FORCING |
262 |
CALL WRITE_0D_C( DIC_windFile, -1, INDEX_NONE, 'DIC_windFile =', |
263 |
& ' /* File name of wind speeds */') |
264 |
CALL WRITE_0D_C( DIC_atmospFile, -1,INDEX_NONE,'DIC_atmospFile=', |
265 |
& ' /* File name of atmospheric pressure*/') |
266 |
CALL WRITE_0D_C( DIC_iceFile, -1, INDEX_NONE, 'DIC_iceFile =', |
267 |
& ' /* File name of seaice fraction */') |
268 |
CALL WRITE_0D_C( DIC_ironFile, -1, INDEX_NONE, 'DIC_ironFile =', |
269 |
& ' /* File name of aeolian iron flux */') |
270 |
CALL WRITE_0D_C( DIC_silicaFile, -1,INDEX_NONE,'DIC_silicaFile=', |
271 |
& ' /* File name of surface silica */') |
272 |
CALL WRITE_0D_R8( DIC_forcingPeriod, |
273 |
& INDEX_NONE,'DIC_forcingPeriod =', |
274 |
& ' /* Periodic forcing parameter specific for DIC (s) */') |
275 |
CALL WRITE_0D_R8( DIC_forcingCycle, |
276 |
& INDEX_NONE,'DIC_forcingCycle =', |
277 |
& ' /* Periodic forcing parameter specific for DIC (s) */') |
278 |
CALL WRITE_0D_I( dic_int1, INDEX_NONE, 'dic_int1 =', |
279 |
& ' /* */') |
280 |
CALL WRITE_0D_I( dic_int2, INDEX_NONE, 'dic_int2 =', |
281 |
& ' /* */') |
282 |
CALL WRITE_0D_I( dic_int3, INDEX_NONE, 'dic_int3 =', |
283 |
& ' /* */') |
284 |
CALL WRITE_0D_I( dic_int4, INDEX_NONE, 'dic_int4 =', |
285 |
& ' /* */') |
286 |
CALL WRITE_0D_R8( dic_pCO2, INDEX_NONE,'dic_pCO2 =', |
287 |
& ' /* Atmospheric pCO2 to be read in data.dic */') |
288 |
|
289 |
C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----| |
290 |
|
291 |
_END_MASTER(myThid) |
292 |
|
293 |
C-- Everyone else must wait for the parameters to be loaded |
294 |
_BARRIER |
295 |
|
296 |
#ifdef DIC_BIOTIC |
297 |
DO bj = myByLo(myThid), myByHi(myThid) |
298 |
DO bi = myBxLo(myThid), myBxHi(myThid) |
299 |
DO j=1-Oly,sNy+Oly |
300 |
DO i=1-Olx,sNx+Olx |
301 |
alpha(i,j,bi,bj) = alphaloc |
302 |
rain_ratio(i,j,bi,bj)= rain_ratioloc |
303 |
ENDDO |
304 |
ENDDO |
305 |
ENDDO |
306 |
ENDDO |
307 |
#endif /* DIC_BIOTIC */ |
308 |
|
309 |
C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----| |
310 |
|
311 |
#endif /* ALLOW_DIC */ |
312 |
|
313 |
RETURN |
314 |
END |