-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCO2chemMod.F90
88 lines (63 loc) · 2.04 KB
/
CO2chemMod.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
module CO2chem_mod
implicit none
! !PUBLIC TYPES:
!
PRIVATE
PUBLIC CO2_prodloss
CONTAINS
subroutine CO2_prodloss( CO2inst, OH, CO, RC )
! !USES:
use types_mod
use global_mod
use utils_mod
implicit none
! !INPUT PARAMETERS:
type(gas_instance), pointer, intent(inout) :: CO2inst(:)
! Reactants
real, pointer, intent(in) :: OH(:,:,:)
real, pointer, intent(in) :: CO(:,:,:)
! !OUTPUT PARAMETERS:
integer, intent(out) :: rc
INTEGER :: im, jm, km, ispc, nst
INTEGER :: i, j, k, n
! Chem parameters
real, allocatable :: cvfac(:,:,:) ! Conversion factor
real, allocatable :: k_(:,:,:) ! Rate constant
real, pointer :: prod(:,:,:), loss(:,:,:), CO2(:,:,:)
integer :: STATUS
! Initialize local variables
! --------------------------
rc = 0
! <<>> currently unused so lets just get out of here
return
if (.not. associated(CO2inst) .or. size(CO2inst) .eq. 0) return ! Nothing to do
im = params%im
jm = params%jm
km = params%km
ispc = ispecies('CO2')
! 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
! Process the prod terms into the residual
nst = size(CO2inst)
prod => CO2inst(nst)%prod(:,:,:)
! Production due to CO oxidation
! -------------------------------
! CO + OH -> CO2 + ...
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
! CO is in mol/mol.
! prod = prod + k_*CO*OH*cvfac
prod => null()
! Housekeeping
! ------------
deallocate(cvfac, stat=RC)
deallocate(k_, stat=RC)
return
end subroutine CO2_prodloss
end module CO2chem_mod