/[MITgcm]/MITgcm/pkg/dic/dic_readparms.F
ViewVC logotype

Contents of /MITgcm/pkg/dic/dic_readparms.F

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.6 - (show annotations) (download)
Wed Apr 9 20:08:14 2008 UTC (16 years, 2 months ago) by dfer
Branch: MAIN
Changes since 1.5: +8 -3 lines
Fix for #undef DIC_BIOTIC

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

  ViewVC Help
Powered by ViewVC 1.1.22