Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update surface albedo in TUV-x prior to calculating rate constants #141

Merged
merged 22 commits into from
Oct 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
22e8c45
add surface albedo
boulderdaze Sep 26, 2024
2e04838
merge tuvx
boulderdaze Oct 17, 2024
d82773e
add updating surface albedo functions
boulderdaze Oct 18, 2024
9413340
add wavelength grid
boulderdaze Oct 18, 2024
41cccfd
Merge branch '95-update-tuvx-temp' into 96-update-surface-albedo
boulderdaze Oct 18, 2024
20ae087
Merge branch '95-update-tuvx-temp' into 96-update-surface-albedo
boulderdaze Oct 19, 2024
8ed0f15
Merge branch '95-update-tuvx-temp' into 96-update-surface-albedo
boulderdaze Oct 23, 2024
e9ece54
set wavelength grid from host (#142)
mattldawson Oct 24, 2024
674ea28
merge 'update temperature' branch
boulderdaze Oct 24, 2024
51c6f2f
fix a syntax bug
boulderdaze Oct 24, 2024
ceadfb4
add helper function for deallocating objects associated with TUV-x
boulderdaze Oct 24, 2024
162148f
Merge pull request #143 from ESCOMP/tuvx-cleanup-function
boulderdaze Oct 24, 2024
405280f
Merge branch '95-update-tuvx-temp' into 96-update-surface-albedo
boulderdaze Oct 24, 2024
a674929
add update function for surface albedo prior to calculating rate cons…
boulderdaze Oct 25, 2024
ff2a573
Merge branch '95-update-tuvx-temp' into 96-update-surface-albedo
boulderdaze Oct 25, 2024
8f00fc5
refactor the test code for minor improvements
boulderdaze Oct 25, 2024
81756ce
Merge branch 'development' into 96-update-surface-albedo
boulderdaze Oct 25, 2024
851e9a8
refactor the test code for minor improvements
boulderdaze Oct 25, 2024
0b01c77
small adjustments to the musica code
boulderdaze Oct 25, 2024
272be0f
remove surface albedo entry from json
boulderdaze Oct 25, 2024
066c847
address code review
boulderdaze Oct 28, 2024
f4b5c29
update the comment for surface albedo
boulderdaze Oct 28, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions schemes/musica/micm/musica_ccpp_micm.F90
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ module musica_ccpp_micm

contains

!> Register MICM constituent properties with the CCPP
!> Registers MICM constituent properties with the CCPP
subroutine micm_register(solver_type, num_grid_cells, constituent_props, errmsg, errcode)
use ccpp_constituent_prop_mod, only: ccpp_constituent_properties_t
use musica_micm, only: Rosenbrock, RosenbrockStandardOrder
Expand Down Expand Up @@ -76,7 +76,7 @@ subroutine micm_register(solver_type, num_grid_cells, constituent_props, errmsg,

end subroutine micm_register

!> Intitialize MICM
!> Initializes MICM
subroutine micm_init(errmsg, errcode)
character(len=512), intent(out) :: errmsg
integer, intent(out) :: errcode
Expand All @@ -86,7 +86,7 @@ subroutine micm_init(errmsg, errcode)

end subroutine micm_init

!> Solve chemistry at the current time step
!> Solves chemistry at the current time step
subroutine micm_run(time_step, temperature, pressure, dry_air_density, &
user_defined_rate_parameters, constituents, errmsg, errcode)
use musica_micm, only: solver_stats_t
Expand Down Expand Up @@ -124,7 +124,7 @@ subroutine micm_run(time_step, temperature, pressure, dry_air_density, &

end subroutine micm_run

!> Finalize MICM
!> Finalizes MICM
subroutine micm_final(errmsg, errcode)
character(len=512), intent(out) :: errmsg
integer, intent(out) :: errcode
Expand Down
25 changes: 15 additions & 10 deletions schemes/musica/musica_ccpp.F90
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,17 @@ end subroutine musica_ccpp_register
!> \section arg_table_musica_ccpp_init Argument Table
!! \htmlinclude musica_ccpp_init.html
subroutine musica_ccpp_init(vertical_layer_dimension, vertical_interface_dimension, &
errmsg, errcode)
integer, intent(in) :: vertical_layer_dimension ! (count)
integer, intent(in) :: vertical_interface_dimension ! (count)
photolysis_wavelength_grid_interfaces, errmsg, errcode)
use ccpp_kinds, only : kind_phys

integer, intent(in) :: vertical_layer_dimension ! (count)
integer, intent(in) :: vertical_interface_dimension ! (count)
real(kind_phys), intent(in) :: photolysis_wavelength_grid_interfaces(:) ! m
character(len=512), intent(out) :: errmsg
integer, intent(out) :: errcode

call tuvx_init(vertical_layer_dimension, vertical_interface_dimension, &
errmsg, errcode)
photolysis_wavelength_grid_interfaces, errmsg, errcode)
if (errcode /= 0) return
call micm_init(errmsg, errcode)
if (errcode /= 0) return
Expand All @@ -43,13 +46,14 @@ end subroutine musica_ccpp_init
!> \section arg_table_musica_ccpp_run Argument Table
!! \htmlinclude musica_ccpp_run.html
!!
!! The standard name for the variable 'surface_tempearture' is
!! `blackbody_temperature_at_surface` because this is what we have as
!! the standard name for `cam_in%ts`, whcih represents the same quantity.
!! 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, standard_gravitational_acceleration, errmsg, errcode)
surface_geopotential, surface_albedo, &
standard_gravitational_acceleration, errmsg, errcode)
use musica_ccpp_micm_util, only: reshape_into_micm_arr, reshape_into_ccpp_arr
use musica_ccpp_micm_util, only: convert_to_mol_per_cubic_meter, convert_to_mass_mixing_ratio
use ccpp_constituent_prop_mod, only: ccpp_constituent_prop_ptr_t
Expand All @@ -67,6 +71,7 @@ subroutine musica_ccpp_run(time_step, temperature, pressure, dry_air_density, co
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_albedo ! unitless
real(kind_phys), intent(in) :: standard_gravitational_acceleration ! m s-2
character(len=512), intent(out) :: errmsg
integer, intent(out) :: errcode
Expand All @@ -92,8 +97,8 @@ subroutine musica_ccpp_run(time_step, temperature, pressure, dry_air_density, co
call tuvx_run(temperature, dry_air_density, &
geopotential_height_wrt_surface_at_midpoint, &
geopotential_height_wrt_surface_at_interface, &
surface_temperature, &
surface_geopotential, &
surface_temperature, surface_geopotential, &
surface_albedo, &
standard_gravitational_acceleration, &
photolysis_rate_constants, &
errmsg, errcode)
Expand Down
12 changes: 12 additions & 0 deletions schemes/musica/musica_ccpp.meta
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@
type = integer
dimensions = ()
intent = in
[ photolysis_wavelength_grid_interfaces ]
standard_name = photolysis_wavelength_grid_interfaces
units = m
type = real | kind = kind_phys
dimensions = (photolysis_wavelength_grid_interface_dimension)
intent = in
[ errmsg ]
standard_name = ccpp_error_message
units = none
Expand Down Expand Up @@ -95,6 +101,12 @@
units = m2 s-2
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
[ standard_gravitational_acceleration ]
standard_name = standard_gravitational_acceleration
units = m s-2
Expand Down
Loading