Skip to content

Commit

Permalink
Update extraterrestrial flux in TUV-x prior to calculating rate const…
Browse files Browse the repository at this point in the history
…ants (#152)

Originator(s): @boulderdaze

Summary (include the keyword ['closes', 'fixes', 'resolves'] and issue
number):
- Update extraterrestrial flux in TUV-x prior to calculating rate
constants
- Closes #97 

Describe any changes made to the namelist: N/A

List all files eliminated and why: 
```
D       test/musica/tuvx/configs/ts1_tsmlt.json
```
We have moved the MUSICA configuration to [CAM-SIMA Chemistry
Data](https://github.com/NCAR/cam-sima-chemistry-data) repository

List all files added and what they do:
```
A       schemes/musica/tuvx/musica_ccpp_tuvx_extraterrestrial_flux.F90
A       test/musica/tuvx/test_tuvx_extraterrestrial_flux.F90
A       to_be_ccppized/ccpp_tuvx_utils.F90
```
List all existing files that have been modified, and describe the
changes:
```
M       schemes/musica/micm/musica_ccpp_micm.F90
M       schemes/musica/musica_ccpp.F90
M       schemes/musica/musica_ccpp.meta
M       schemes/musica/tuvx/musica_ccpp_tuvx.F90
M       schemes/musica/tuvx/musica_ccpp_tuvx_surface_albedo.F90
M       schemes/musica/tuvx/musica_ccpp_tuvx_temperature.F90
M       schemes/musica/tuvx/musica_ccpp_tuvx_util.F90
M       schemes/musica/tuvx/musica_ccpp_tuvx_wavelength_grid.F90
M       test/CMakeLists.txt
M       test/docker/Dockerfile.musica
M       test/docker/Dockerfile.musica.no_install
M       test/musica/CMakeLists.txt
M       test/musica/test_musica_api.F90
M       test/musica/tuvx/CMakeLists.txt
```
List any test failures: N/A

Is this a science-changing update? New physics package, algorithm
change, tuning changes, etc? No

---------

Co-authored-by: Matt Dawson <mattdawson@ucar.edu>
  • Loading branch information
boulderdaze and mattldawson authored Nov 21, 2024
1 parent 79df94a commit d755e19
Show file tree
Hide file tree
Showing 18 changed files with 586 additions and 2,274 deletions.
1 change: 0 additions & 1 deletion schemes/musica/micm/musica_ccpp_micm.F90
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,6 @@ subroutine micm_run(time_step, temperature, pressure, dry_air_density, &
type(string_t) :: solver_state
type(solver_stats_t) :: solver_stats
type(error_t) :: error
integer :: i_elem

call micm%solve(real(time_step, kind=c_double), &
c_loc(temperature), &
Expand Down
34 changes: 21 additions & 13 deletions schemes/musica/musica_ccpp.F90
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,12 @@ end subroutine musica_ccpp_init
!! The standard name for the variable 'surface_temperature' is
!! 'blackbody_temperature_at_surface' because this is what we have as
!! the standard name for 'cam_in%ts', whcih represents the same quantity.
subroutine musica_ccpp_run(time_step, temperature, pressure, dry_air_density, constituent_props, &
constituents, geopotential_height_wrt_surface_at_midpoint, &
geopotential_height_wrt_surface_at_interface, surface_temperature, &
surface_geopotential, surface_albedo, &
subroutine musica_ccpp_run(time_step, temperature, pressure, dry_air_density, constituent_props, &
constituents, geopotential_height_wrt_surface_at_midpoint, &
geopotential_height_wrt_surface_at_interface, surface_geopotential, &
surface_temperature, surface_albedo, &
number_of_photolysis_wavelength_grid_sections, &
photolysis_wavelength_grid_interfaces, extraterrestrial_flux, &
standard_gravitational_acceleration, errmsg, errcode)
use ccpp_constituent_prop_mod, only: ccpp_constituent_prop_ptr_t
use ccpp_kinds, only: kind_phys
Expand All @@ -74,9 +76,12 @@ subroutine musica_ccpp_run(time_step, temperature, pressure, dry_air_density, co
real(kind_phys), target, intent(inout) :: constituents(:,:,:) ! kg kg-1
real(kind_phys), intent(in) :: geopotential_height_wrt_surface_at_midpoint(:,:) ! m (column, layer)
real(kind_phys), intent(in) :: geopotential_height_wrt_surface_at_interface(:,:) ! m (column, interface)
real(kind_phys), intent(in) :: surface_temperature(:) ! K
real(kind_phys), intent(in) :: surface_geopotential(:) ! m2 s-2
real(kind_phys), intent(in) :: surface_temperature(:) ! K
real(kind_phys), intent(in) :: surface_albedo ! unitless
integer, intent(in) :: number_of_photolysis_wavelength_grid_sections ! (count)
real(kind_phys), intent(in) :: photolysis_wavelength_grid_interfaces(:) ! nm
real(kind_phys), intent(in) :: extraterrestrial_flux(:) ! photons cm-2 s-1 nm-1
real(kind_phys), intent(in) :: standard_gravitational_acceleration ! m s-2
character(len=512), intent(out) :: errmsg
integer, intent(out) :: errcode
Expand All @@ -89,13 +94,16 @@ subroutine musica_ccpp_run(time_step, temperature, pressure, dry_air_density, co
integer :: i_elem

! Calculate photolysis rate constants using TUV-x
call tuvx_run(temperature, dry_air_density, &
geopotential_height_wrt_surface_at_midpoint, &
geopotential_height_wrt_surface_at_interface, &
surface_temperature, surface_geopotential, &
surface_albedo, &
standard_gravitational_acceleration, &
rate_parameters, &
call tuvx_run(temperature, dry_air_density, &
geopotential_height_wrt_surface_at_midpoint, &
geopotential_height_wrt_surface_at_interface, &
surface_geopotential, surface_temperature, &
surface_albedo, &
number_of_photolysis_wavelength_grid_sections, &
photolysis_wavelength_grid_interfaces, &
extraterrestrial_flux, &
standard_gravitational_acceleration, &
rate_parameters, &
errmsg, errcode)

! Get the molar mass that is set in the call to instantiate()
Expand Down Expand Up @@ -140,4 +148,4 @@ subroutine musica_ccpp_final(errmsg, errcode)

end subroutine musica_ccpp_final

end module musica_ccpp
end module musica_ccpp
30 changes: 24 additions & 6 deletions schemes/musica/musica_ccpp.meta
Original file line number Diff line number Diff line change
Expand Up @@ -123,24 +123,42 @@
type = real | kind = kind_phys
dimensions = (horizontal_loop_extent,vertical_interface_dimension)
intent = in
[ surface_temperature ]
standard_name = blackbody_temperature_at_surface
type = real | kind = kind_phys
units = K
dimensions = (horizontal_loop_extent)
intent = in
[ surface_geopotential ]
standard_name = surface_geopotential
type = real | kind = kind_phys
units = m2 s-2
dimensions = (horizontal_loop_extent)
intent = in
[ surface_temperature ]
standard_name = blackbody_temperature_at_surface
type = real | kind = kind_phys
units = K
dimensions = (horizontal_loop_extent)
intent = in
[ surface_albedo ]
standard_name = surface_albedo_due_to_UV_and_VIS_direct
type = real | kind = kind_phys
units = None
dimensions = ()
intent = in
[ number_of_photolysis_wavelength_grid_sections ]
standard_name = number_of_photolysis_wavelength_grid_sections
type = integer
units = None
dimensions = ()
intent = in
[ photolysis_wavelength_grid_interfaces ]
standard_name = photolysis_wavelength_grid_interfaces
type = real | kind = kind_phys
units = nm
dimensions = (horizontal_loop_extent)
intent = in
[ extraterrestrial_flux ]
standard_name = extraterrestrial_radiation_flux
type = real | kind = kind_phys
units = photons cm-2 s-1 nm-1
dimensions = (horizontal_loop_extent)
intent = in
[ standard_gravitational_acceleration ]
standard_name = standard_gravitational_acceleration
units = m s-2
Expand Down
Loading

0 comments on commit d755e19

Please sign in to comment.