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

Set gas-species profiles in TUV-x and map indices between constituents and MICM #184

Merged
merged 20 commits into from
Jan 14, 2025

Conversation

boulderdaze
Copy link
Collaborator

@boulderdaze boulderdaze commented Dec 23, 2024

Originator(s): @boulderdaze

Summary (include the keyword ['closes', 'fixes', 'resolves'] and issue number):

Describe any changes made to the namelist: N/A

List all files eliminated and why: N/A

List all files added and what they do:

A       schemes/musica/musica_ccpp_species.F90
A       schemes/musica/tuvx/musica_ccpp_tuvx_gas_species.F90
A       schemes/musica/tuvx/musica_ccpp_tuvx_load_species.F90
A       test/musica/test_musica_species.F90
A       test/musica/tuvx/test_tuvx_gas_species.F90
A       test/musica/tuvx/test_tuvx_load_species.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_height_grid.F90
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
M       test/musica/tuvx/test_tuvx_height_grid.F90
M       to_be_ccppized/ccpp_tuvx_utils.F90

List any test failures: N/A

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

@boulderdaze boulderdaze marked this pull request as ready for review December 23, 2024 21:38
Comment on lines 15 to 34
! Constants
! Clould liquid water
character(len=*), parameter, public :: CLOUD_LIQUID_WATER_CONTENT_LABEL = &
'cloud_liquid_water_mixing_ratio_wrt_moist_air_and_condensed_water'
character(len=*), parameter, public :: CLOUD_LIQUID_WATER_CONTENT_LONG_NAME = &
'cloud water mass mixing ratio with respect to moist air plus all airborne condensates'
character(len=*), parameter, public :: CLOUD_LIQUID_WATER_CONTENT_UNITS = 'kg kg-1'
real(kind_phys), parameter, public :: CLOUD_LIQUID_WATER_CONTENT_MOLAR_MASS = 0.018_kind_phys ! kg mol-1
! Gas species - dry air, O2, O3
character(len=*), parameter, public :: DRY_AIR_LABEL = 'air'
character(len=*), parameter, public :: O2_LABEL = 'O2'
character(len=*), parameter, public :: O3_LABEL = 'O3'
character(len=*), parameter, public :: TUVX_GAS_SPECIES_UNITS = 'molecule cm-3'
real(kind_phys), parameter, public :: SCALE_HEIGHT_DRY_AIR = 8.01_kind_phys ! km
real(kind_phys), parameter, public :: SCALE_HEIGHT_O2 = 7.0_kind_phys ! km
real(kind_phys), parameter, public :: SCALE_HEIGHT_O3 = 7.0_kind_phys ! km
!> Molar mass value of dry air is obtained from 'CAM-SIMA/src/utils/std_atm_profile.F90'
real(kind_phys), parameter, public :: MOLAR_MASS_DRY_AIR = 0.0289644_kind_phys ! kg mol-1
real(kind_phys), parameter, public :: MOLAR_MASS_O2 = 0.0319988_kind_phys ! kg mol-1
real(kind_phys), parameter, public :: MOLAR_MASS_O3 = 0.0479982_kind_phys ! kg mol-1
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @mattldawson, @nusbaume, after discussing with Kyle, I decided not to include the TUV-x gas species in the MICM configuration, as we are planning to move the parsing features to OpenAtmos, which will offer more flexibility. Currently, the MICM parser requires species and reaction JSON files, but TUV-x does not have reaction file. I think it would be more efficient to use a separate configuration for TUV-x, as it requires additional component including cloud liquid water content and specific gas species such as O2, O3, and dry air. This module includes the constituents (or species) needed by TUV-x, with molar masses and scale heights hard-coded, as this file functions as a configuration. However, this setup may change in the future as the parser is moved to OpenAtmos.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for letting me know @boulderdaze! I think as long as MUSICA can tell CAM-SIMA what the composition of the atmosphere is (ignoring physics or dynamics-specific constituents) then whatever method(s) you all choose is fine with me!

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good to me too! We can discuss a longer-term solution when we move the parsing to OpenAtmos

@boulderdaze boulderdaze requested a review from K20shores January 6, 2025 22:11
Copy link
Member

@jimmielin jimmielin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @boulderdaze, thanks for requesting my review. I have some minor comments and a few questions about the code.

end if
end do

! TODO(jiwon) Check molar mass is non zero as it becomes a denominator for unit converison
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this TODO still needed? Or (reading from the review context) maybe replaced with a note that the framework should handle this in the future?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I added the comment. Could you review it?

schemes/musica/tuvx/musica_ccpp_tuvx_gas_species.F90 Outdated Show resolved Hide resolved
schemes/musica/tuvx/musica_ccpp_tuvx_load_species.F90 Outdated Show resolved Hide resolved
Copy link
Collaborator

@mattldawson mattldawson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good!

@jimmielin jimmielin self-requested a review January 14, 2025 16:52
Copy link
Member

@jimmielin jimmielin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @boulderdaze for addressing my comments!

@boulderdaze boulderdaze merged commit e8a29b3 into development Jan 14, 2025
3 checks passed
@boulderdaze boulderdaze deleted the 98-gas_species_profile branch January 14, 2025 17:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants