Line data Source code
1 :
2 : module mo_sim_dat
3 :
4 : private
5 : public :: set_sim_dat
6 :
7 : contains
8 :
9 1536 : subroutine set_sim_dat
10 :
11 : use chem_mods, only : clscnt, cls_rxt_cnt, clsmap, permute, adv_mass, fix_mass, crb_mass
12 : use chem_mods, only : diag_map
13 : use chem_mods, only : phtcnt, rxt_tag_cnt, rxt_tag_lst, rxt_tag_map
14 : use chem_mods, only : pht_alias_lst, pht_alias_mult
15 : use chem_mods, only : extfrc_lst, inv_lst, slvd_lst
16 : use chem_mods, only : enthalpy_cnt, cph_enthalpy, cph_rid, num_rnts, rxntot
17 : use cam_abortutils,only : endrun
18 : use mo_tracname, only : solsym
19 : use chem_mods, only : frc_from_dataset
20 : use chem_mods, only : is_scalar, is_vector
21 : use shr_kind_mod, only : r8 => shr_kind_r8
22 : use cam_logfile, only : iulog
23 :
24 : implicit none
25 :
26 : !--------------------------------------------------------------
27 : ! ... local variables
28 : !--------------------------------------------------------------
29 : integer :: ios
30 :
31 1536 : is_scalar = .true.
32 1536 : is_vector = .false.
33 :
34 1536 : clscnt(:) = (/ 1, 0, 0, 30, 0 /)
35 :
36 7680 : cls_rxt_cnt(:,1) = (/ 0, 0, 0, 1 /)
37 7680 : cls_rxt_cnt(:,4) = (/ 1, 14, 0, 30 /)
38 :
39 : solsym(: 31) = (/ 'bc_a1 ','bc_a4 ','CFC11 ','CFC12 ','CH4 ', &
40 : 'CO2 ','DMS ','dst_a1 ','dst_a2 ','dst_a3 ', &
41 : 'H2O2 ','H2SO4 ','N2O ','ncl_a1 ','ncl_a2 ', &
42 : 'ncl_a3 ','num_a1 ','num_a2 ','num_a3 ','num_a4 ', &
43 : 'pom_a1 ','pom_a4 ','SO2 ','so4_a1 ','so4_a2 ', &
44 : 'so4_a3 ','soa_a1 ','soa_a2 ','SOAE ','SOAG ', &
45 49152 : 'H2O ' /)
46 :
47 : adv_mass(: 31) = (/ 12.011000_r8, 12.011000_r8, 137.367503_r8, 120.913206_r8, 16.040600_r8, &
48 : 44.009800_r8, 62.132400_r8, 135.064039_r8, 135.064039_r8, 135.064039_r8, &
49 : 34.013600_r8, 98.078400_r8, 44.012880_r8, 58.442468_r8, 58.442468_r8, &
50 : 58.442468_r8, 1.007400_r8, 1.007400_r8, 1.007400_r8, 1.007400_r8, &
51 : 12.011000_r8, 12.011000_r8, 64.064800_r8, 115.107340_r8, 115.107340_r8, &
52 : 115.107340_r8, 12.011000_r8, 12.011000_r8, 12.011000_r8, 12.011000_r8, &
53 1536 : 18.014200_r8 /)
54 :
55 : crb_mass(: 31) = (/ 12.011000_r8, 12.011000_r8, 12.011000_r8, 12.011000_r8, 12.011000_r8, &
56 : 12.011000_r8, 24.022000_r8, 0.000000_r8, 0.000000_r8, 0.000000_r8, &
57 : 0.000000_r8, 0.000000_r8, 0.000000_r8, 0.000000_r8, 0.000000_r8, &
58 : 0.000000_r8, 0.000000_r8, 0.000000_r8, 0.000000_r8, 0.000000_r8, &
59 : 12.011000_r8, 12.011000_r8, 0.000000_r8, 0.000000_r8, 0.000000_r8, &
60 : 0.000000_r8, 12.011000_r8, 12.011000_r8, 12.011000_r8, 12.011000_r8, &
61 1536 : 0.000000_r8 /)
62 :
63 : fix_mass(: 8) = (/ 0.00000000_r8, 31.9988000_r8, 28.0134800_r8, 33.0062000_r8, 17.0068000_r8, &
64 1536 : 62.0049400_r8, 47.9982000_r8, 137.367503_r8 /)
65 :
66 3072 : clsmap(: 1,1) = (/ 6 /)
67 : clsmap(: 30,4) = (/ 1, 2, 3, 4, 5, 7, 8, 9, 10, 11, &
68 : 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, &
69 47616 : 22, 23, 24, 25, 26, 27, 28, 29, 30, 31 /)
70 :
71 : permute(: 30,4) = (/ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, &
72 : 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, &
73 47616 : 21, 22, 23, 24, 25, 26, 27, 28, 29, 30 /)
74 :
75 : diag_map(: 30) = (/ 1, 2, 3, 4, 5, 7, 9, 10, 11, 12, &
76 : 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, &
77 1536 : 24, 26, 27, 28, 29, 30, 31, 32, 34, 35 /)
78 :
79 : extfrc_lst(: 11) = (/ 'bc_a1 ','bc_a4 ','H2O ','num_a1 ','num_a2 ', &
80 : 'num_a4 ','pom_a1 ','pom_a4 ','SO2 ','so4_a1 ', &
81 18432 : 'so4_a2 ' /)
82 :
83 : frc_from_dataset(: 11) = (/ .true., .true., .true., .true., .true., &
84 : .true., .true., .true., .true., .true., &
85 1536 : .true. /)
86 :
87 : inv_lst(: 8) = (/ 'M ', 'O2 ', 'N2 ', 'HO2 ', 'OH ', &
88 13824 : 'NO3 ', 'O3 ', 'HALONS ' /)
89 :
90 1536 : if( allocated( rxt_tag_lst ) ) then
91 0 : deallocate( rxt_tag_lst )
92 : end if
93 1536 : allocate( rxt_tag_lst(rxt_tag_cnt),stat=ios )
94 1536 : if( ios /= 0 ) then
95 0 : write(iulog,*) 'set_sim_dat: failed to allocate rxt_tag_lst; error = ',ios
96 0 : call endrun
97 : end if
98 1536 : if( allocated( rxt_tag_map ) ) then
99 0 : deallocate( rxt_tag_map )
100 : end if
101 1536 : allocate( rxt_tag_map(rxt_tag_cnt),stat=ios )
102 1536 : if( ios /= 0 ) then
103 0 : write(iulog,*) 'set_sim_dat: failed to allocate rxt_tag_map; error = ',ios
104 0 : call endrun
105 : end if
106 1536 : rxt_tag_lst( 1: 15) = (/ 'jh2o2 ', 'jsoa_a1 ', &
107 : 'jsoa_a2 ', 'lyman_alpha ', &
108 : 'OH_H2O2 ', 'usr_HO2_HO2 ', &
109 : 'n2o_loss ', 'cfc11_loss ', &
110 : 'cfc12_loss ', 'ch4_loss ', &
111 : 'DMS_NO3 ', 'DMS_OHa ', &
112 : 'SO2_OH_M ', 'usr_DMS_OH ', &
113 26112 : 'SOAE_tau ' /)
114 0 : rxt_tag_map(:rxt_tag_cnt) = (/ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, &
115 26112 : 11, 12, 13, 14, 15 /)
116 1536 : if( allocated( pht_alias_lst ) ) then
117 0 : deallocate( pht_alias_lst )
118 : end if
119 1536 : allocate( pht_alias_lst(phtcnt,2),stat=ios )
120 1536 : if( ios /= 0 ) then
121 0 : write(iulog,*) 'set_sim_dat: failed to allocate pht_alias_lst; error = ',ios
122 0 : call endrun
123 : end if
124 1536 : if( allocated( pht_alias_mult ) ) then
125 0 : deallocate( pht_alias_mult )
126 : end if
127 1536 : allocate( pht_alias_mult(phtcnt,2),stat=ios )
128 1536 : if( ios /= 0 ) then
129 0 : write(iulog,*) 'set_sim_dat: failed to allocate pht_alias_mult; error = ',ios
130 0 : call endrun
131 : end if
132 6144 : pht_alias_lst(:,1) = (/ ' ', ' ', ' ' /)
133 6144 : pht_alias_lst(:,2) = (/ ' ', 'jno2 ', 'jno2 ' /)
134 6144 : pht_alias_mult(:,1) = (/ 1._r8, 1._r8, 1._r8 /)
135 6144 : pht_alias_mult(:,2) = (/ 1._r8, .0004_r8, .0004_r8 /)
136 1536 : allocate( num_rnts(rxntot-phtcnt),stat=ios )
137 1536 : if( ios /= 0 ) then
138 0 : write(iulog,*) 'set_sim_dat: failed to allocate num_rnts; error = ',ios
139 0 : call endrun
140 : end if
141 : num_rnts(:) = (/ 1, 2, 2, 1, 1, 1, 1, 2, 2, 3, &
142 19968 : 2, 1 /)
143 :
144 1536 : end subroutine set_sim_dat
145 :
146 : end module mo_sim_dat
|