-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCOchemMod.F90
146 lines (110 loc) · 4.08 KB
/
COchemMod.F90
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
MODULE COchem_mod
! !USES:
IMPLICIT NONE
! !PUBLIC TYPES:
!
PRIVATE
PUBLIC CO_prodloss
!
! !DESCRIPTION:
!
! !REVISION HISTORY:
!
!EOP
!-------------------------------------------------------------------------
CONTAINS
SUBROUTINE CO_prodloss( COinst, OH, O1D, Cl, JV1, JV2, CH4, CO2, RC )
! !USES:
use types_mod
use global_mod
use utils_mod
IMPLICIT NONE
! !INPUT PARAMETERS:
type(gas_instance), pointer, intent(inout) :: COinst(:)
! Reactants
real, pointer, intent(in) :: OH(:,:,:)
real, pointer, intent(in) :: O1D(:,:,:)
real, pointer, intent(in) :: Cl(:,:,:)
real, intent(in) :: JV1(:,:,:)
real, intent(in) :: JV2(:,:,:)
real, pointer, intent(in) :: CH4(:,:,:)
real, pointer, intent(in) :: CO2(:,:,:)
! !OUTPUT PARAMETERS:
integer, intent(out) :: RC
! !REVISION HISTORY:
!
! Dec22, 2022 : M.S. Long - first crack. Adapted from GOCART's CO_GricCompMod.F90
! CVS tag 'Tbw_Heracles-5_4_p3_SLES12' (BW = Brad Weir)
!
!EOP
!-------------------------------------------------------------------------
INTEGER :: im, jm, km, nst, ios, idiag, iXj, ispc
INTEGER :: i, j, k, n
! Chem parameters
real, allocatable :: cvfac(:,:,:) ! Conversion factor
real, allocatable :: k_(:,:,:) ! Rate constant
real, pointer :: prod(:,:,:), loss(:,:,:), CO(:,:,:)
integer :: STATUS
! Initialize local variables
! --------------------------
rc = 0
if (.not. associated(COinst) .or. size(COinst) .eq. 0) return ! Nothing to do
im = params%im
jm = params%jm
km = params%km
iXj = im * jm
ispc = ispecies('CO')
! Chemistry
! ASSUMPTION: all species units are input mol/mol
! --------------------------------------------------------
allocate(k_(im,jm,km), stat=RC)
allocate(cvfac(im,jm,km), stat=RC)
cvfac = 1e-3*met%rho*params%avo/params%airmw ! mol/mol <-> molec/cm3
! cvfac = 1e-3*params%AVO*met%rho/28.0104e0 ! kg/kg <-> molec/cm3
do nst = 1,size(COinst) ! cycle over instances
loss => COinst(nst)%loss(:,:,:) ! in mol/mol/s
CO => COinst(nst)%data3d(:,:,:) ! CO pointer makes the code cleaner
! CO + OH -> ...
! --------------
! the following uses the midpoint level pressure derived from PLE
do k=1,km
k_(:,:,k) = 1.50E-13*(1.00+0.60E-05*(met%ple(:,:,k)+met%ple(:,:,k-1))*0.5e0) ! 2nd order (cm3/mcl/s): Where does this come from?
enddo
loss = loss + k_*CO*OH!*cvfac
CO => null()
loss => null()
enddo
! Process the prod terms into the residual
nst = size(COinst)
prod => COinst(nst)%prod(:,:,:)
! Production due to CH4 oxidation
! -------------------------------
! CH4 + OH -> CO + ...
k_ = 2.45e-12*exp(-1775./met%t) ! 2nd order
prod = prod + k_*CH4*OH!*cvfac
! CH4 + Cl -> CO + ...
k_ = 7.10e-12*exp(-1270./met%t) ! 2nd order
prod = prod + k_*CH4*Cl!*cvfac
! CH4 + O1D -> CO + ...
k_ = 1.75e-10 ! 2nd order
prod = prod + k_*CH4*O1D!*cvfac
! CO2 + hv -> CO + O3P
! CH4 + hv -> 2H2O + CO + ... there is a bunch of branching in this. We're assuming 100% CO yield. Is this OK?
! ----------------------------------------------------------------------------
! prod = prod + JV1*400.e-6 ! 1st order (1/s); Fixed CO2 for testing
! prod = prod + JV1*CO2 ! 1st order (1/s)
! prod = prod + JV2*CH4 ! 1st order (1/s)
prod => null()
! Surface and imported fluxes are computed externally
! by routine, Surface_ProdLoss(), and are not species
! specific. MSL
! -------------------------------------------------
! Housekeeping
! ------------
deallocate(cvfac, stat=RC)
deallocate(k_, stat=RC)
RETURN
! CONTAINS
END SUBROUTINE CO_prodloss
!-------------------------------------------------------------------------
END MODULE COchem_mod