@@ -47,8 +47,8 @@ module musica_ccpp_dependencies
47
47
! > Indicator of whether MUSICA suite is being used
48
48
logical :: is_musica_suite = .false.
49
49
50
- ! > Set of species for the current MUSICA configuration
51
- type (species_t), allocatable :: musica_species (:)
50
+ ! > Set of species for TUV-x
51
+ type (species_t), allocatable :: tuvx_species (:)
52
52
53
53
! ==============================================================================
54
54
contains
@@ -84,20 +84,13 @@ subroutine initialize_musica_species_constituents(constituents_properties, &
84
84
use ccpp_const_utils, only: ccpp_const_get_idx
85
85
use cam_logfile, only: iulog
86
86
use spmd_utils, only: primary_process = > masterproc
87
- use musica_sima_namelist, only: musica_config_str
88
87
89
88
type (ccpp_constituent_prop_ptr_t), pointer :: constituents_properties(:)
90
89
character (len= 512 ), intent (out ) :: errmsg
91
90
integer , intent (out ) :: errcode
92
91
93
92
! local variables
94
- character (len=* ), parameter :: chapman_config = ' chapman'
95
- character (len=* ), parameter :: terminator_config = ' terminator'
96
- logical :: is_chapman = .false.
97
- logical :: is_terminator = .false.
98
- integer :: num_micm_species = 0
99
- integer :: num_tuvx_constituents = 1
100
- integer :: num_tuvx_only_gas_species = 0
93
+ integer , parameter :: num_tuvx_constituents = 4
101
94
integer :: position
102
95
integer :: constituent_index
103
96
integer :: i_species
@@ -108,67 +101,28 @@ subroutine initialize_musica_species_constituents(constituents_properties, &
108
101
return
109
102
end if
110
103
111
- ! Currently, we only support two types of MUSICA configurations: Chapman and Terminator,
112
- ! until the file I/O object is implemented. If the configuration is neither of these,
113
- ! an error will be thrown.
114
- if (trim (musica_config_str) == " chapman" ) then
115
- is_chapman = .true.
116
- if (primary_process) then
117
- write (iulog,* ) " [MUSICA Info] Using the Chapman configuration with stubbed dependencies."
118
- end if
119
- else if (trim (musica_config_str) == " terminator" ) then
120
- is_terminator = .true.
121
- if (primary_process) then
122
- write (iulog,* ) " [MUSICA Info] Using the Terminator configuration with stubbed dependencies."
123
- end if
124
- else
125
- errcode = 1
126
- errmsg = " [MUSICA Error] MUSICA configuration is not found."
127
- return
128
- end if
129
-
130
- if (is_chapman) then
131
- num_micm_species = 5
132
- num_tuvx_only_gas_species = 1
133
- else if (is_terminator) then
134
- num_micm_species = 2
135
- num_tuvx_only_gas_species = 3
136
- end if
137
-
138
- allocate (musica_species(num_micm_species + num_tuvx_constituents + num_tuvx_only_gas_species), &
139
- stat= errcode, errmsg= errmsg)
104
+ allocate (tuvx_species(num_tuvx_constituents), stat= errcode, errmsg= errmsg)
140
105
if (errcode /= 0 ) return
141
106
142
- musica_species (1 ) = species_t(&
107
+ tuvx_species (1 ) = species_t(&
143
108
" cloud_liquid_water_mixing_ratio_wrt_moist_air_and_condensed_water" , 0.0000060_kind_phys )
144
-
145
- if (is_chapman) then
146
- musica_species(2 ) = species_t(" O2" , 0.22474_kind_phys )
147
- musica_species(3 ) = species_t(" O" , 5.3509e-10_kind_phys )
148
- musica_species(4 ) = species_t(" O1D" , 5.3509e-10_kind_phys )
149
- musica_species(5 ) = species_t(" O3" , 0.00016_kind_phys )
150
- musica_species(6 ) = species_t(" N2" , 0.74015_kind_phys )
151
- musica_species(7 ) = species_t(" air" , 1.0_kind_phys )
152
-
153
- else if (is_terminator) then
154
- musica_species(2 ) = species_t(" Cl" , 1.0e-12_kind_phys )
155
- musica_species(3 ) = species_t(" Cl2" , 1.0e-12_kind_phys )
156
- musica_species(4 ) = species_t(" air" , 1.0_kind_phys )
157
- musica_species(5 ) = species_t(" O2" , 0.21_kind_phys )
158
- musica_species(6 ) = species_t(" O3" , 4.0e-6_kind_phys )
159
- end if
160
-
161
- do i_species = 1 , num_micm_species + num_tuvx_constituents + num_tuvx_only_gas_species
162
- call ccpp_const_get_idx(constituents_properties, trim (musica_species(i_species)% name), &
163
- musica_species(i_species)% constituent_index, errmsg, errcode)
109
+ tuvx_species(2 ) = species_t(" air" , 1.0_kind_phys )
110
+ tuvx_species(3 ) = species_t(" O2" , 0.21_kind_phys )
111
+ tuvx_species(4 ) = species_t(" O3" , 4.0e-6_kind_phys )
112
+
113
+ do i_species = 1 , num_tuvx_constituents
114
+ call ccpp_const_get_idx(constituents_properties, trim (tuvx_species(i_species)% name), &
115
+ tuvx_species(i_species)% constituent_index, errmsg, errcode)
164
116
if (errcode /= 0 ) return
165
117
end do
166
118
167
119
end subroutine initialize_musica_species_constituents
168
120
169
- subroutine set_initial_musica_concentrations (constituents_array )
121
+ subroutine set_initial_musica_concentrations (constituents_array , constituent_properties )
170
122
171
- use cam_abortutils, only: endrun
123
+ use cam_abortutils, only: endrun
124
+ use ccpp_constituent_prop_mod, only: ccpp_constituent_prop_ptr_t
125
+ use musica_ccpp_species, only: micm_species_set
172
126
173
127
!- ----------------------------------------------------------------------
174
128
!
@@ -177,22 +131,35 @@ subroutine set_initial_musica_concentrations(constituents_array)
177
131
!- ----------------------------------------------------------------------
178
132
179
133
real (kind_phys), intent (inout ) :: constituents_array(:,:,:)
134
+ type (ccpp_constituent_prop_ptr_t), pointer , intent (inout ) :: constituent_properties(:)
180
135
181
136
! local variables
182
- integer :: i_species
137
+ integer :: i_species, i_constituent
183
138
character (len= 512 ) :: errmsg
139
+ integer :: errcode
140
+ real (kind_phys) :: default_value
184
141
185
142
! Don't do anything if MUSICA suite is not being used
186
143
if (.not. is_musica_suite) return
187
144
188
- if (.not. allocated (musica_species )) then
145
+ if (.not. allocated (tuvx_species )) then
189
146
errmsg = " [MUSICA Error] MUSICA species are not initialized."
190
147
call endrun(errmsg, file= __FILE__, line= __LINE__)
191
148
end if
192
149
193
- do i_species = 1 , size (musica_species)
194
- constituents_array(:,:,musica_species(i_species)% constituent_index) = &
195
- musica_species(i_species)% initial_mixing_ratio
150
+ do i_species = 1 , size (tuvx_species)
151
+ constituents_array(:,:,tuvx_species(i_species)% constituent_index) = &
152
+ tuvx_species(i_species)% initial_mixing_ratio
153
+ end do
154
+
155
+ do i_species = 1 , size (micm_species_set)
156
+ i_constituent = micm_species_set(i_species)% index_constituent_props
157
+ call constituent_properties(i_constituent)% default_value( &
158
+ default_value, errcode, errmsg)
159
+ if (errcode /= 0 ) then
160
+ call endrun(errmsg, file= __FILE__, line= __LINE__)
161
+ end if
162
+ constituents_array(:,:,i_constituent) = default_value
196
163
end do
197
164
198
165
end subroutine set_initial_musica_concentrations
@@ -205,7 +172,6 @@ subroutine musica_ccpp_dependencies_init( &
205
172
use cam_logfile, only: iulog
206
173
use spmd_utils, only: primary_process = > masterproc
207
174
use ccpp_constituent_prop_mod, only: ccpp_constituent_prop_ptr_t
208
- use musica_sima_namelist, only: musica_config_str
209
175
210
176
!- ----------------------------------------------------------------------
211
177
!
@@ -228,12 +194,6 @@ subroutine musica_ccpp_dependencies_init( &
228
194
if (trim (phys_suite_name) /= " musica" ) return
229
195
is_musica_suite = .true.
230
196
231
- if (trim (musica_config_str) == " none" ) then
232
- errmsg = " [MUSICA Error] MUSICA configuration is not found. Please set musica_config to 'chapman' or 'terminator'."
233
- errcode = 1
234
- call endrun(errmsg, file= __FILE__, line= __LINE__)
235
- end if
236
-
237
197
if (primary_process) then
238
198
write (iulog,* ) ' WARNING: Using placeholder data for MUSICA chemistry.'
239
199
end if
0 commit comments