File indexing completed on 2023-10-26 05:10:18 UTC
view on githubraw file Latest commit a2c35952 on 2023-10-25 14:50:13 UTC
3a677ccb28 Davi*0001 #include "DIC_OPTIONS.h"
0002
0003
0004
0005
0006 SUBROUTINE DIC_READPARMS( myThid )
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016 IMPLICIT NONE
0017
0018
0019 #include "SIZE.h"
0020 #include "EEPARAMS.h"
0021 #include "PARAMS.h"
0022 #include "DIC_VARS.h"
f6a5c42cd4 Jean*0023 #include "PTRACERS_SIZE.h"
0024 #include "PTRACERS_PARAMS.h"
3a677ccb28 Davi*0025
0026
0027
0028
0029 INTEGER myThid
0030
0031
0032 #ifdef ALLOW_DIC
0033
0034
0035
0036
6acab690ae Jona*0037
3a677ccb28 Davi*0038 CHARACTER*(MAX_LEN_MBUF) msgBuf
0039 INTEGER iUnit
6acab690ae Jona*0040 INTEGER errCount
0041 #ifndef CARBONCHEM_SOLVESAPHE
0042 INTEGER selectBTconst, selectFTconst, selectHFconst
0043 INTEGER selectK1K2const, selectPHsolver
0044 #endif
9cfb9181db Jean*0045
3a677ccb28 Davi*0046
0047
0048
0049
ab18c0635e Jean*0050
b31669ac34 Jean*0051
0052
0053
6acab690ae Jona*0054
0055
0056
0057
0058
0059
0060
0061
0062
0063
0064
0065
0066
0067
0068
0069
0070
0071
0072
0073
0074
0075
2e3e8c330d Jona*0076
0077
0078
0079
0080
0081
0082
a2c35952f2 Jona*0083
0084
0085
0086
0087
0088
0089
0090
0091
2e3e8c330d Jona*0092
0093
0094
0095
0096
6acab690ae Jona*0097
0098
0099 NAMELIST /ABIOTIC_PARMS/
0100 & permil, Pa2Atm,
0101 & selectBTconst, selectFTconst,
0102 & selectHFconst, selectK1K2const,
2e3e8c330d Jona*0103 & selectPHsolver,
0104 & useCalciteSaturation, calcOmegaCalciteFreq,
a2c35952f2 Jona*0105 & nIterCO3, selectCalciteDissolution,
2e3e8c330d Jona*0106 & WsinkPIC, selectCalciteBottomRemin,
a2c35952f2 Jona*0107 & calciteDissolRate, calciteDissolExp,
2e3e8c330d Jona*0108 & zca
3a677ccb28 Davi*0109
0110 #ifdef DIC_BIOTIC
0111
0112
b718ae76a3 Davi*0113
3a677ccb28 Davi*0114
0115
0116
0117
0118
0119
0120
0121
0122
0123
0124
0125
0126
0127
0128
13adbda1b1 Jean*0129
0130
3a677ccb28 Davi*0131
0132
ab18c0635e Jean*0133
3a677ccb28 Davi*0134
0135
9cfb9181db Jean*0136
7dccb58cca Jean*0137
3a677ccb28 Davi*0138
7dccb58cca Jean*0139
3a677ccb28 Davi*0140
0141 NAMELIST /BIOTIC_PARMS/
0142 & DOPfraction, KDOPRemin, KRemin, zcrit,
2e3e8c330d Jona*0143 & O2crit, R_OP, R_CP, R_NP, R_FeP,
13adbda1b1 Jean*0144 & parfrac, k0, lit0, KPO4, KFE, kchl,
0145 & alpfe, fesedflux_pcm, FeIntSec, freefemax,
3a677ccb28 Davi*0146 & KScav, ligand_stab, ligand_tot,
7dccb58cca Jean*0147 & alphaUniform, rainRatioUniform
3a677ccb28 Davi*0148 #endif
0149
254eed5bf2 Davi*0150 NAMELIST /DIC_FORCING/
a1d0e455fd Hann*0151 & DIC_windFile, DIC_atmospFile, DIC_silicaFile,
0152 & DIC_deepSilicaFile, DIC_iceFile, DIC_parFile,
0153 & DIC_chlaFile, DIC_ironFile,
946d3aa393 Jean*0154 & DIC_forcingPeriod, DIC_forcingCycle,
254eed5bf2 Davi*0155 & dic_int1, dic_int2, dic_int3, dic_int4, dic_pCO2
0156
3a677ccb28 Davi*0157
0158
0159 _BEGIN_MASTER(myThid)
6acab690ae Jona*0160 errCount = 0
3a677ccb28 Davi*0161
0162 permil = 1. _d 0 / 1024.5 _d 0
0163 Pa2Atm = 1.01325 _d 5
6acab690ae Jona*0164 selectBTconst = UNSET_I
0165 selectFTconst = UNSET_I
0166 selectHFconst = UNSET_I
0167 selectK1K2const = UNSET_I
0168 selectPHsolver = UNSET_I
2e3e8c330d Jona*0169 useCalciteSaturation = .FALSE.
0170
0171
0172 calcOmegaCalciteFreq = deltaTClock
0173
0174 nIterCO3 = 10
0175
0176
0177 selectCalciteBottomRemin = 1
a2c35952f2 Jona*0178
0179 selectCalciteDissolution = 1
0180
0181 calciteDissolRate(1) = UNSET_RL
0182 calciteDissolRate(2) = UNSET_RL
0183
0184 calciteDissolExp(1) = UNSET_RL
0185 calciteDissolExp(2) = UNSET_RL
0186
0187 WsinkPIC = 100. _d 0/86400. _d 0
2e3e8c330d Jona*0188
a2c35952f2 Jona*0189 zca = 3500. _d 0
6acab690ae Jona*0190
3a677ccb28 Davi*0191 #ifdef DIC_BIOTIC
0192 DOPfraction = 0.67 _d 0
0193 KDOPRemin = 1. _d 0/(6. _d 0*30. _d 0*86400. _d 0)
0194 KRemin = 0.9 _d 0
0195 zcrit = 500. _d 0
0196 O2crit = 4. _d -3
0197 R_OP =-170. _d 0
0198 R_CP = 117. _d 0
0199 R_NP = 16. _d 0
0200 R_FeP = 0.000468 _d 0
0201 parfrac = 0.4 _d 0
0202 k0 = 0.02 _d 0
13adbda1b1 Jean*0203 kchl = 0.02 _d 0
3a677ccb28 Davi*0204 lit0 = 30. _d 0
0205 KPO4 = 5. _d -4
0206 KFE = 1.2 _d -7
0207 alpfe = 0.01 _d 0
edcef61f0d Jean*0208 fesedflux_pcm = 6.8 _d -4 * 106. _d 0
13adbda1b1 Jean*0209 FeIntSec = 0.5 _d -6 / 86400. _d 0
3a677ccb28 Davi*0210 freefemax = 3. _d -7
0211 KScav = 0.19 _d 0/(360. _d 0*86400. _d 0)
0212 ligand_stab = 1. _d 8
0213 ligand_tot = 1. _d -6
7dccb58cca Jean*0214 alphaUniform = 2. _d -3/(360. _d 0 * 86400. _d 0)
0215 rainRatioUniform = 7. _d -2
3a677ccb28 Davi*0216 #endif
a1d0e455fd Hann*0217 DIC_windFile = ' '
0218 DIC_atmospFile = ' '
0219 DIC_silicaFile = ' '
0220 DIC_deepSilicaFile = ' '
0221 DIC_iceFile = ' '
0222 DIC_parFile = ' '
0223 DIC_chlaFile = ' '
0224 DIC_ironFile = ' '
254eed5bf2 Davi*0225 dic_int1 = 0
0226 dic_int2 = 0
0227 dic_int3 = 0
0228 dic_int4 = 0
64adf6c21c Jean*0229 dic_pCO2 = 278. _d -6
2e3e8c330d Jona*0230
946d3aa393 Jean*0231 DIC_forcingPeriod = externForcingPeriod
0232 DIC_forcingCycle = externForcingCycle
3a677ccb28 Davi*0233
0234 WRITE(msgBuf,'(A)') ' DIC_READPARMS: opening data.dic'
0235 CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
0236 I SQUEEZE_RIGHT, myThid )
0237
0238 CALL OPEN_COPY_DATA_FILE( 'data.dic', 'DIC_READPARMS',
0239 O iUnit, myThid )
0240
0241
0242
0243
0244 READ(UNIT=iUnit,NML=ABIOTIC_PARMS)
0245
0246 #ifdef DIC_BIOTIC
0247
0248 READ(UNIT=iUnit,NML=BIOTIC_PARMS)
0249 #endif
0250
254eed5bf2 Davi*0251
0252 READ(UNIT=iUnit,NML=DIC_FORCING)
0253
3a677ccb28 Davi*0254 WRITE(msgBuf,'(A)')
0255 & ' DIC_READPARMS: finished reading data.dic'
0256 CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
0257 I SQUEEZE_RIGHT, myThid )
0258
0259
7a77863887 Mart*0260 #ifdef SINGLE_DISK_IO
3a677ccb28 Davi*0261 CLOSE(iUnit)
7a77863887 Mart*0262 #else
0263 CLOSE(iUnit,STATUS='DELETE')
0264 #endif /* SINGLE_DISK_IO */
3a677ccb28 Davi*0265
0266
0267
0268
6acab690ae Jona*0269
0270 IF ( selectBTconst .EQ.UNSET_I ) selectBTconst = 1
0271 IF ( selectFTconst .EQ.UNSET_I ) selectFTconst = 1
0272 IF ( selectHFconst .EQ.UNSET_I ) selectHFconst = 1
0273 IF ( selectK1K2const.EQ.UNSET_I ) selectK1K2const = 1
0274 IF ( selectPHsolver .EQ.UNSET_I ) selectPHsolver = 0
a2c35952f2 Jona*0275
0276 IF ( selectCalciteDissolution .EQ. 3 ) THEN
0277
0278
0279
0280
0281
0282 IF ( calciteDissolRate(1).EQ.UNSET_RL )
0283 & calciteDissolRate(1) = 5.22 _d -9
0284 IF ( calciteDissolRate(2).EQ.UNSET_RL )
0285 & calciteDissolRate(2) = 1.65 _d -5
0286
0287 IF ( calciteDissolExp(1).EQ.UNSET_RL )
0288 & calciteDissolExp(1) = 0.11 _d 0
0289 IF ( calciteDissolExp(2).EQ.UNSET_RL )
0290 & calciteDissolExp(2) = 4.76 _d 0
0291 ELSE
0292
0293 calciteDissolRate(2) = 0.0 _d 0
0294 calciteDissolExp(2) = 0.0 _d 0
0295
0296 IF ( selectCalciteDissolution .EQ. 0 ) THEN
0297
0298 IF ( calciteDissolRate(1).EQ.UNSET_RL )
0299 & calciteDissolRate(1) = 1 _d 0/(360 _d 0*86400.0 _d 0)
0300
0301 calciteDissolExp(1) = 0.0 _d 0
0302 ELSE
0303
0304 IF ( calciteDissolRate(1).EQ.UNSET_RL )
0305 & calciteDissolRate(1) = 7.177 _d 0
0306
0307 IF ( calciteDissolExp(1).EQ.UNSET_RL )
0308 & calciteDissolExp(1) = 4.54 _d 0
0309 ENDIF
0310 ENDIF
0311
3a677ccb28 Davi*0312 #ifdef DIC_BIOTIC
ab18c0635e Jean*0313 QSW_underice = .FALSE.
0314 #ifdef USE_QSW_UNDERICE
0315 QSW_underice = .TRUE.
0316 #elif (defined (USE_QSW))
0317
0318
0319 IF ( useSEAICE ) QSW_underice = .TRUE.
0320 IF ( useThSIce ) QSW_underice = .TRUE.
3a677ccb28 Davi*0321 #endif
0322 #endif /* DIC_BIOTIC */
0323
b718ae76a3 Davi*0324
0325
0326
0327 iUnit = standardMessageUnit
0328 WRITE(msgBuf,'(A)') ' '
0329 CALL PRINT_MESSAGE(msgBuf,iUnit,SQUEEZE_RIGHT,myThid)
0330 WRITE(msgBuf,'(A)') '// ==================================='
0331 CALL PRINT_MESSAGE(msgBuf,iUnit,SQUEEZE_RIGHT,myThid)
946d3aa393 Jean*0332 WRITE(msgBuf,'(A)') '// DIC package parameters :'
b718ae76a3 Davi*0333 CALL PRINT_MESSAGE(msgBuf,iUnit,SQUEEZE_RIGHT,myThid)
0334 WRITE(msgBuf,'(A)') '// ==================================='
0335 CALL PRINT_MESSAGE(msgBuf,iUnit,SQUEEZE_RIGHT,myThid)
0336
6acab690ae Jona*0337 #ifdef CARBONCHEM_SOLVESAPHE
0338
0339 IF ( selectPHsolver.GT.0 ) THEN
0340 WRITE(msgBuf,'(A)')
0341 & 'Using Munhoven (2013) Solvesaphe for pH/pCO2'
0342 CALL PRINT_MESSAGE(msgBuf,iUnit,SQUEEZE_RIGHT,myThid)
0343 ELSEIF ( selectPHsolver.EQ.0 ) THEN
0344 WRITE(msgBuf,'(A)')
0345 & 'Using Follows et al. (2006) for pH/pCO2'
0346 CALL PRINT_MESSAGE(msgBuf,iUnit,SQUEEZE_RIGHT,myThid)
0347 ENDIF
0348 #endif /* CARBONCHEM_SOLVESAPHE */
0349
0350
0351 #ifdef CARBONCHEM_SOLVESAPHE
0352 WRITE(msgBuf,'(A)')
0353 & 'Using Munhoven (2013) Solvesaphe carbon coefficients'
0354 CALL PRINT_MESSAGE(msgBuf,iUnit,SQUEEZE_RIGHT,myThid)
0355
0356 IF ( selectK1K2const.EQ.1 ) THEN
0357 WRITE(msgBuf,'(A)')
0358 & 'Using Millero (1995)/Mehrbach K1 and K2 coefficients'
0359 CALL PRINT_MESSAGE(msgBuf,iUnit,SQUEEZE_RIGHT,myThid)
0360 ELSEIF ( selectK1K2const.EQ.2 ) THEN
0361 WRITE(msgBuf,'(A)')
0362 & 'Using Roy et al. (1993) K1 and K2 coefficients'
0363 CALL PRINT_MESSAGE(msgBuf,iUnit,SQUEEZE_RIGHT,myThid)
0364 ELSEIF ( selectK1K2const.EQ.3 ) THEN
0365 WRITE(msgBuf,'(A)')
0366 & 'Using Millero (1995) "consensus" K1 and K2 coefficients'
0367 CALL PRINT_MESSAGE(msgBuf,iUnit,SQUEEZE_RIGHT,myThid)
0368 ELSEIF ( selectK1K2const.EQ.4 ) THEN
0369 WRITE(msgBuf,'(A)')
0370 & 'Using Luecker et al. (2000) K1 and K2 coefficients'
0371 CALL PRINT_MESSAGE(msgBuf,iUnit,SQUEEZE_RIGHT,myThid)
0372 ELSEIF ( selectK1K2const.EQ.5 ) THEN
0373 WRITE(msgBuf,'(A)')
0374 & 'Using Millero et al. (2010) K1 and K2 coefficients'
0375 CALL PRINT_MESSAGE(msgBuf,iUnit,SQUEEZE_RIGHT,myThid)
0376 ELSEIF ( selectK1K2const.EQ.6 ) THEN
0377 WRITE(msgBuf,'(A)')
0378 & 'Using Waters et al. (2014) K1 and K2 coefficients'
0379 CALL PRINT_MESSAGE(msgBuf,iUnit,SQUEEZE_RIGHT,myThid)
0380 ENDIF
0381
0382 IF ( selectHFconst.EQ.1 ) THEN
0383 WRITE(msgBuf,'(A)')
0384 & 'Using Dickson and Riley (1979) KF coefficient'
0385 CALL PRINT_MESSAGE(msgBuf,iUnit,SQUEEZE_RIGHT,myThid)
0386 ELSEIF ( selectHFconst.EQ.2 ) THEN
0387 WRITE(msgBuf,'(A)')
0388 & 'Using Perez and Fraga (1987) KF coefficient'
0389 CALL PRINT_MESSAGE(msgBuf,iUnit,SQUEEZE_RIGHT,myThid)
0390 ENDIF
0391
0392 IF ( selectBTconst.EQ.1 ) THEN
0393 WRITE(msgBuf,'(A)')
0394 & 'Using Uppstrom (1974) BT estimation from salinity'
0395 CALL PRINT_MESSAGE(msgBuf,iUnit,SQUEEZE_RIGHT,myThid)
0396 ELSEIF ( selectBTconst.EQ.2 ) THEN
0397 WRITE(msgBuf,'(A)')
0398 & 'Using Lee et al (2010) BT estimation from salinity'
0399 CALL PRINT_MESSAGE(msgBuf,iUnit,SQUEEZE_RIGHT,myThid)
0400 ENDIF
0401
0402 IF ( selectFTconst.EQ.1 ) THEN
0403 WRITE(msgBuf,'(A)')
0404 & 'Using Riley (1965) FT estimation from salinity'
0405 CALL PRINT_MESSAGE(msgBuf,iUnit,SQUEEZE_RIGHT,myThid)
0406 ELSEIF ( selectBTconst.EQ.2 ) THEN
0407 WRITE(msgBuf,'(A)')
0408 & 'Using Culkin (1965) FT estimation from salinity'
0409 CALL PRINT_MESSAGE(msgBuf,iUnit,SQUEEZE_RIGHT,myThid)
0410 ENDIF
0411 #else /* CARBONCHEM_SOLVESAPHE */
0412
0413 WRITE(msgBuf,'(A)')
0414 & 'Using Millero (1995)/Mehrbach K1 and K2 coefficients'
0415 CALL PRINT_MESSAGE(msgBuf,iUnit,SQUEEZE_RIGHT,myThid)
0416 WRITE(msgBuf,'(A)')
0417 & 'Using Dickson and Riley (1979) KF coefficient'
0418 CALL PRINT_MESSAGE(msgBuf,iUnit,SQUEEZE_RIGHT,myThid)
0419 WRITE(msgBuf,'(A)')
0420 & 'Using Uppstrom (1974) BT estimation from salinity'
0421 CALL PRINT_MESSAGE(msgBuf,iUnit,SQUEEZE_RIGHT,myThid)
0422 WRITE(msgBuf,'(A)')
0423 & 'Using Riley (1965) FT estimation from salinity'
0424 CALL PRINT_MESSAGE(msgBuf,iUnit,SQUEEZE_RIGHT,myThid)
0425 #endif /* CARBONCHEM_SOLVESAPHE */
0426
b718ae76a3 Davi*0427
4da4b49499 Jean*0428 CALL WRITE_0D_RL( permil, INDEX_NONE,'permil =',
b718ae76a3 Davi*0429 & ' /* Ref. density to convert mol/m3 to mol/kg */')
4da4b49499 Jean*0430 CALL WRITE_0D_RL( Pa2Atm, INDEX_NONE,'Pa2Atm =',
b718ae76a3 Davi*0431 & ' /* Atmosph. pressure conversion coeff (to Atm) */')
2e3e8c330d Jona*0432 CALL WRITE_0D_RL( zca, INDEX_NONE,'zca =',
0433 & ' /* Scale depth for CaCO3 remineralization (m) */')
0434 CALL WRITE_0D_L( useCalciteSaturation, INDEX_NONE,
0435 & 'useCalciteSaturation =',
0436 & ' /* Flag for omegaC calculation on/off */')
0437 IF ( useCalciteSaturation ) THEN
0438 CALL WRITE_0D_RL( calcOmegaCalciteFreq, INDEX_NONE,
0439 & 'calcOmegaCalciteFreq =',
0440 & ' /* Frequency of calcite saturation calculation (s) */')
a2c35952f2 Jona*0441 IF ( selectCalciteDissolution .LT. 3 ) THEN
0442 IF ( selectCalciteDissolution .EQ. 0 )
0443 & WRITE(msgBuf,'(A)') 'Using Constant dissolution rate method'
0444 IF ( selectCalciteDissolution .EQ. 1 )
0445 & WRITE(msgBuf,'(A)') 'Using Follows default dissolution method'
0446 IF ( selectCalciteDissolution .EQ. 2 )
0447 & WRITE(msgBuf,'(A)') 'Using Keir (1980) dissolution method'
0448 IF ( selectCalciteDissolution .GE. 0 ) THEN
0449 CALL PRINT_MESSAGE(msgBuf,iUnit,SQUEEZE_RIGHT,myThid)
0450 CALL WRITE_0D_RL( calciteDissolRate(1), INDEX_NONE,
0451 & 'calciteDissolRate =',
0452 & ' /* Rate constant for calcite dissolution (%/day) */')
0453 ENDIF
0454 IF ( selectCalciteDissolution .GE. 1 ) THEN
0455 CALL WRITE_0D_RL( calciteDissolExp(1), INDEX_NONE,
0456 & 'calciteDissolExp = ',
0457 & ' /* Rate exponent for calcite dissolution */')
0458 ENDIF
0459 ELSEIF ( selectCalciteDissolution .EQ. 3 ) THEN
0460 WRITE(msgBuf,'(A)')
0461 & 'Using Naviaux et al. (2019) dissolution rates'
0462 CALL PRINT_MESSAGE(msgBuf,iUnit,SQUEEZE_RIGHT,myThid)
0463 CALL WRITE_0D_RL( calciteDissolRate(1), INDEX_NONE,
0464 & 'calciteDissolRate(1) =',
0465 & ' /* Rate constant for dissolution (%/day), omega > 0.8272 */')
0466 CALL WRITE_0D_RL( calciteDissolRate(2), INDEX_NONE,
0467 & 'calciteDissolRate(2) =',
0468 & ' /* Rate constant for dissolution (%/day), omega < 0.8272 */')
0469 CALL WRITE_0D_RL( calciteDissolExp(1), INDEX_NONE,
0470 & 'calciteDissolExp(1) = ',
0471 & ' /* Rate exponent for dissolution, omega > 0.8272 */')
0472 CALL WRITE_0D_RL( calciteDissolExp(2), INDEX_NONE,
0473 & 'calciteDissolExp(2) = ',
0474 & ' /* Rate exponent for dissolution, omega < 0.8272 */')
0475 ENDIF
2e3e8c330d Jona*0476 CALL WRITE_0D_RL( WsinkPIC, INDEX_NONE, 'WsinkPIC =',
0477 & ' /* Sinking speed of particulate inorganic carbon (m/s) */')
0478 CALL WRITE_0D_I( selectCalciteBottomRemin, INDEX_NONE,
0479 & 'selectCalciteBottomRemin =',
0480 & ' /* Remineralize CO3 bottom flux: =0: here, =1: top layer */')
0481 ENDIF
b718ae76a3 Davi*0482
f7e1d98d25 Davi*0483 #ifdef DIC_BIOTIC
b718ae76a3 Davi*0484
4da4b49499 Jean*0485 CALL WRITE_0D_RL( DOPfraction, INDEX_NONE,'DOPfraction =',
b718ae76a3 Davi*0486 & ' /* Fraction of new production going to DOP */')
4da4b49499 Jean*0487 CALL WRITE_0D_RL( KDOPRemin, INDEX_NONE,'KDOPRemin =',
b718ae76a3 Davi*0488 & ' /* DOP remineralization rate (1/s) */')
4da4b49499 Jean*0489 CALL WRITE_0D_RL( KRemin, INDEX_NONE,'KRemin =',
b718ae76a3 Davi*0490 & ' /* Remin power law coeff. */')
4da4b49499 Jean*0491 CALL WRITE_0D_RL( zcrit, INDEX_NONE,'zcrit =',
b718ae76a3 Davi*0492 & ' /* Minimum depth for biological activity (m) */')
4da4b49499 Jean*0493 CALL WRITE_0D_RL( O2crit, INDEX_NONE,'O2crit =',
b718ae76a3 Davi*0494 & ' /* Critical oxygen level (mol/m3) */')
4da4b49499 Jean*0495 CALL WRITE_0D_RL( R_OP, INDEX_NONE,'R_OP =',
b718ae76a3 Davi*0496 & ' /* Stochiometric ratio R_OP */')
4da4b49499 Jean*0497 CALL WRITE_0D_RL( R_CP, INDEX_NONE,'R_CP =',
b718ae76a3 Davi*0498 & ' /* Stochiometric ratio R_CP */')
4da4b49499 Jean*0499 CALL WRITE_0D_RL( R_NP, INDEX_NONE,'R_NP =',
b718ae76a3 Davi*0500 & ' /* Stochiometric ratio R_NP */')
4da4b49499 Jean*0501 CALL WRITE_0D_RL( R_FeP, INDEX_NONE,'R_FeP =',
b718ae76a3 Davi*0502 & ' /* Stochiometric ratio R_FeP */')
4da4b49499 Jean*0503 CALL WRITE_0D_RL( parfrac, INDEX_NONE,'parfrac =',
b718ae76a3 Davi*0504 & ' /* Fraction of Qsw that is PAR */')
4da4b49499 Jean*0505 CALL WRITE_0D_RL( k0, INDEX_NONE,'k0 =',
13adbda1b1 Jean*0506 & ' /* Light attentuation coefficient, water (1/m) */')
0507 CALL WRITE_0D_RL( kchl, INDEX_NONE,'kchl =',
0508 & ' /* Light attentuation coefficient, chlorophyll (m2/mg) */')
4da4b49499 Jean*0509 CALL WRITE_0D_RL( lit0, INDEX_NONE,'lit0 =',
b718ae76a3 Davi*0510 & ' /* Half saturation light constant (W/m2) */')
4da4b49499 Jean*0511 CALL WRITE_0D_RL( KPO4, INDEX_NONE,'KPO4 =',
b718ae76a3 Davi*0512 & ' /* Half saturation phosphate constant (mol/m3) */')
4da4b49499 Jean*0513 CALL WRITE_0D_RL( KFE, INDEX_NONE,'KFE =',
b718ae76a3 Davi*0514 & ' /* Half saturation fe constant (mol/m3) */')
4da4b49499 Jean*0515 CALL WRITE_0D_RL( alpfe, INDEX_NONE,'alpfe =',
b718ae76a3 Davi*0516 & ' /* Solubility of aeolian fe */')
13adbda1b1 Jean*0517 CALL WRITE_0D_RL( fesedflux_pcm, INDEX_NONE,'fesedflux_pcm =',
0518 & ' /* Sediment Fe flux = fesedflux_pcm*pflux+FeIntSec */')
0519 CALL WRITE_0D_RL( FeIntSec, INDEX_NONE,'FeIntSec =',
0520 & ' /* Sediment Fe flux = fesedflux_pcm * pflux + FeIntSec */')
4da4b49499 Jean*0521 CALL WRITE_0D_RL( freefemax, INDEX_NONE,'freefemax =',
b718ae76a3 Davi*0522 & ' /* Max solubility of free iron (mol/m3) */')
4da4b49499 Jean*0523 CALL WRITE_0D_RL( KScav, INDEX_NONE,'KScav =',
b718ae76a3 Davi*0524 & ' /* Iron scavenging rate */')
4da4b49499 Jean*0525 CALL WRITE_0D_RL( ligand_stab, INDEX_NONE,'ligand_stab =',
b718ae76a3 Davi*0526 & ' /* Ligand-free iron stability constant (m3/mol) */')
4da4b49499 Jean*0527 CALL WRITE_0D_RL( ligand_tot, INDEX_NONE,'ligand_tot =',
b718ae76a3 Davi*0528 & ' /* Total free ligand (mol/m3) */')
4da4b49499 Jean*0529 CALL WRITE_0D_RL( alphaUniform, INDEX_NONE,'alphaUniform =',
9cfb9181db Jean*0530 & ' /* Timescale for biological activity */')
4da4b49499 Jean*0531 CALL WRITE_0D_RL(rainRatioUniform,INDEX_NONE,'rainRatioUniform=',
b718ae76a3 Davi*0532 & ' /* Inorganic/organic carbon rain ratio */')
f7e1d98d25 Davi*0533 CALL WRITE_0D_L( QSW_underice, INDEX_NONE, 'QSW_underice =',
0534 & ' /* Flag for Qsw under Sea-Ice (i.e. SI fract included) */')
6acab690ae Jona*0535 #endif /* DIC_BIOTIC */
f7e1d98d25 Davi*0536
0537
946d3aa393 Jean*0538 CALL WRITE_0D_C( DIC_windFile, -1, INDEX_NONE, 'DIC_windFile =',
b718ae76a3 Davi*0539 & ' /* File name of wind speeds */')
946d3aa393 Jean*0540 CALL WRITE_0D_C( DIC_atmospFile, -1,INDEX_NONE,'DIC_atmospFile=',
b718ae76a3 Davi*0541 & ' /* File name of atmospheric pressure*/')
a1d0e455fd Hann*0542 CALL WRITE_0D_C( DIC_silicaFile, -1,INDEX_NONE,
0543 & 'DIC_silicaFile=',' /* File name of surface silica */')
2e3e8c330d Jona*0544 IF ( useCalciteSaturation ) THEN
a1d0e455fd Hann*0545 CALL WRITE_0D_C( DIC_deepSilicaFile, -1,INDEX_NONE,
0546 & 'DIC_deepSilicaFile=',' /* File name of 3d silica field */')
2e3e8c330d Jona*0547 ENDIF
946d3aa393 Jean*0548 CALL WRITE_0D_C( DIC_iceFile, -1, INDEX_NONE, 'DIC_iceFile =',
b718ae76a3 Davi*0549 & ' /* File name of seaice fraction */')
10167de8af Step*0550 CALL WRITE_0D_C( DIC_parFile, -1,INDEX_NONE,'DIC_parFile=',
0551 & ' /* File name of photosynthetically available radiation */')
13adbda1b1 Jean*0552 CALL WRITE_0D_C( DIC_chlaFile, -1,INDEX_NONE,'DIC_chlaFile=',
0553 & ' /* File name of chlorophyll climatology */')
a1d0e455fd Hann*0554 CALL WRITE_0D_C( DIC_ironFile, -1, INDEX_NONE, 'DIC_ironFile =',
0555 & ' /* File name of aeolian iron flux */')
4da4b49499 Jean*0556 CALL WRITE_0D_RL( DIC_forcingPeriod,
946d3aa393 Jean*0557 & INDEX_NONE,'DIC_forcingPeriod =',
0558 & ' /* Periodic forcing parameter specific for DIC (s) */')
4da4b49499 Jean*0559 CALL WRITE_0D_RL( DIC_forcingCycle,
946d3aa393 Jean*0560 & INDEX_NONE,'DIC_forcingCycle =',
0561 & ' /* Periodic forcing parameter specific for DIC (s) */')
b718ae76a3 Davi*0562 CALL WRITE_0D_I( dic_int1, INDEX_NONE, 'dic_int1 =',
0563 & ' /* */')
0564 CALL WRITE_0D_I( dic_int2, INDEX_NONE, 'dic_int2 =',
0565 & ' /* */')
0566 CALL WRITE_0D_I( dic_int3, INDEX_NONE, 'dic_int3 =',
0567 & ' /* */')
0568 CALL WRITE_0D_I( dic_int4, INDEX_NONE, 'dic_int4 =',
0569 & ' /* */')
4da4b49499 Jean*0570 CALL WRITE_0D_RL( dic_pCO2, INDEX_NONE,'dic_pCO2 =',
b718ae76a3 Davi*0571 & ' /* Atmospheric pCO2 to be read in data.dic */')
0572
0573
0574
64adf6c21c Jean*0575 IF ( dic_int1.EQ.0 .AND. dic_pCO2.NE.278. _d -6 ) THEN
0576 WRITE(msgBuf,'(A)')
0577 & 'DIC_READPARMS: cannot change default dic_pCO2 if dic_int1=0'
0578 CALL PRINT_ERROR( msgBuf, myThid )
6acab690ae Jona*0579 errCount = errCount + 1
64adf6c21c Jean*0580 ENDIF
f6a5c42cd4 Jean*0581 #ifdef ALLOW_OLD_VIRTUALFLUX
0582 IF ( PTRACERS_EvPrRn(1).NE.UNSET_RL .OR.
0583 & PTRACERS_EvPrRn(2).NE.UNSET_RL ) THEN
0584 WRITE(msgBuf,'(2A)') 'DIC_READPARMS: ',
0585 & 'when ALLOW_OLD_VIRTUALFLUX is defined (in DIC_OPTIONS.h)'
0586 CALL PRINT_ERROR( msgBuf, myThid )
0587 IF ( PTRACERS_EvPrRn(1).NE.UNSET_RL ) THEN
0588 WRITE(msgBuf,'(2A)') 'DIC_READPARMS: ',
0589 & ' cannot set PTRACERS_EvPrRn(1) (in data.ptracers)'
0590 CALL PRINT_ERROR( msgBuf, myThid )
0591 ENDIF
0592 IF ( PTRACERS_EvPrRn(2).NE.UNSET_RL ) THEN
0593 WRITE(msgBuf,'(2A)') 'DIC_READPARMS: ',
0594 & ' cannot set PTRACERS_EvPrRn(2) (in data.ptracers)'
0595 CALL PRINT_ERROR( msgBuf, myThid )
0596 ENDIF
6acab690ae Jona*0597 errCount = errCount + 1
f6a5c42cd4 Jean*0598 ENDIF
0599 #endif /* ALLOW_OLD_VIRTUALFLUX */
64adf6c21c Jean*0600
6acab690ae Jona*0601 #ifdef CARBONCHEM_SOLVESAPHE
0602 IF ( selectHFconst.LT.1 .OR. selectHFconst.GT.2 .OR.
0603 & selectBTconst.LT.1 .OR. selectBTconst.GT.2 .OR.
0604 & selectFTconst.LT.1 .OR. selectFTconst.GT.2 ) THEN
0605 WRITE(msgBuf,'(2A)') 'DIC_READPARMS: ',
0606 & 'Invalid value for selectHF, selectBT or selectFT'
0607 CALL PRINT_ERROR( msgBuf, myThid )
0608 errCount = errCount + 1
0609 ENDIF
0610 IF ( selectK1K2const.LT.1 .OR. selectK1K2const.GT.6 ) THEN
0611 WRITE(msgBuf,'(2A)') 'DIC_READPARMS: ',
0612 & 'Invalid value for selectK1K2const (< 1 or > 6)'
0613 CALL PRINT_ERROR( msgBuf, myThid )
0614 errCount = errCount + 1
0615 ENDIF
0616 IF ( selectPHsolver.LT.0 .OR. selectPHsolver.GT.3 ) THEN
0617 WRITE(msgBuf,'(2A)') 'DIC_READPARMS: ',
0618 & 'Invalid value for selectPHsolver (< 0 or > 3)'
0619 CALL PRINT_ERROR( msgBuf, myThid )
0620 errCount = errCount + 1
0621 ENDIF
0622 #else /* CARBONCHEM_SOLVESAPHE */
0623 IF ( selectBTconst.NE.1 .OR. selectFTconst.NE.1 .OR.
0624 & selectHFconst.NE.1 .OR. selectK1K2const.NE.1 ) THEN
0625 WRITE(msgBuf,'(2A)') 'DIC_READPARMS: ',
0626 & 'to use: selectHF, selectBT, selectFT or selectK1K2const'
0627 CALL PRINT_ERROR( msgBuf, myThid )
0628 WRITE(msgBuf,'(2A)') 'DIC_READPARMS: ',
0629 & 'needs: "#define CARBONCHEM_SOLVESAPHE" in "DIC_OPTIONS.h"'
0630 CALL PRINT_ERROR( msgBuf, myThid )
0631 errCount = errCount + 1
0632 ENDIF
0633 IF ( selectPHsolver.NE.0 ) THEN
0634 WRITE(msgBuf,'(2A)') 'DIC_READPARMS: ',
0635 & 'to use: selectPHsolver > 0'
0636 CALL PRINT_ERROR( msgBuf, myThid )
0637 WRITE(msgBuf,'(2A)') 'DIC_READPARMS: ',
0638 & 'needs: "#define CARBONCHEM_SOLVESAPHE" in "DIC_OPTIONS.h"'
0639 CALL PRINT_ERROR( msgBuf, myThid )
0640 errCount = errCount + 1
0641 ENDIF
0642 #endif /* CARBONCHEM_SOLVESAPHE */
0643
2e3e8c330d Jona*0644 #ifdef DIC_CALCITE_SAT
a2c35952f2 Jona*0645
0646 IF ( ( selectCalciteDissolution .LT. 0 .OR.
0647 & selectCalciteDissolution .GT. 3 )
0648 & .AND. useCalciteSaturation ) THEN
0649 WRITE(msgBuf,'(2A,I4,A)') 'DIC_READPARMS: ',
0650 & 'selectCalciteDissolution =', selectCalciteDissolution,
0651 & ' : invalid value'
0652 CALL PRINT_ERROR( msgBuf, myThid )
0653 errCount = errCount + 1
0654 ENDIF
2e3e8c330d Jona*0655
0656
0657 IF ( DIC_deepSilicaFile .NE. ' ' .AND.
0658 & .NOT. useCalciteSaturation ) THEN
0659 WRITE(msgBuf,'(2A)') 'DIC_READPARMS: ',
0660 & 'to use: DIC_deepSilicaFile (3d silicate input)'
0661 CALL PRINT_MESSAGE(msgBuf,iUnit,SQUEEZE_RIGHT,myThid)
0662 WRITE(msgBuf,'(2A)') 'DIC_READPARMS: ',
0663 & 'needs: "useCalciteSaturation=.TRUE." in "data.dic"'
0664 CALL PRINT_MESSAGE(msgBuf,iUnit,SQUEEZE_RIGHT,myThid)
0665 ENDIF
0666 #else
0667
0668
0669 IF ( useCalciteSaturation ) THEN
0670 WRITE(msgBuf,'(2A)') 'DIC_READPARMS: ',
0671 & 'to enable: useCalciteSaturation'
0672 CALL PRINT_ERROR( msgBuf, myThid )
0673 WRITE(msgBuf,'(2A)') 'DIC_READPARMS: ',
0674 & 'needs: "#define DIC_CALCITE_SAT" in "DIC_OPTIONS.h"'
0675 CALL PRINT_ERROR( msgBuf, myThid )
0676 errCount = errCount + 1
0677 ENDIF
0678
0679
0680
0681 IF ( DIC_deepSilicaFile .NE. ' ' ) THEN
0682 WRITE(msgBuf,'(2A)') 'DIC_READPARMS: ',
0683 & 'to use: DIC_deepSilicaFile (3d silicate input)'
0684 CALL PRINT_ERROR( msgBuf, myThid )
0685 WRITE(msgBuf,'(2A)') 'DIC_READPARMS: ',
0686 & 'needs: "#define DIC_CALCITE_SAT" in "DIC_OPTIONS.h"'
0687 CALL PRINT_ERROR( msgBuf, myThid )
0688 errCount = errCount + 1
0689 ENDIF
0690 #endif /* DIC_CALCITE_SAT */
0691
6acab690ae Jona*0692 IF ( errCount.GE.1 ) THEN
0693 WRITE(msgBuf,'(A,I3,A)')
0694 & 'DIC_READPARMS: detected', errCount,' fatal error(s)'
0695 CALL PRINT_ERROR( msgBuf, myThid )
0696 CALL ALL_PROC_DIE( 0 )
0697 STOP 'ABNORMAL END: S/R DIC_READPARMS'
0698 ENDIF
3a677ccb28 Davi*0699 _END_MASTER(myThid)
0700
0701
0702 _BARRIER
0703
0704
0705
0706 #endif /* ALLOW_DIC */
0707
0708 RETURN
0709 END