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

Add TUV-x height grid updates #134

Open
wants to merge 23 commits into
base: development
Choose a base branch
from
Open

Conversation

boulderdaze
Copy link
Collaborator

@boulderdaze boulderdaze commented Oct 15, 2024

Updates TUV-x height grid with CAM-SIMA state data before calculating rate constants.

Uses geopontential height values to calculate actual heights above sea level, as currently done in the CAMChem gas-phase chemistry module. If there is a better way to get these height values, we can update this PR.

Closes #94


Notes (Jiwon):

  • Replaced TUVX-X edges with interface


type(grid_t), intent(inout) :: height_grid
real(kind_phys), intent(in) :: host_midpoints(:) ! km
real(kind_phys), intent(in) :: host_edges(:) ! km
Copy link
Collaborator Author

@boulderdaze boulderdaze Oct 15, 2024

Choose a reason for hiding this comment

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

Is the term edge equivalent to interface? If so, can we use interface across the code base to enhance the consistency and readability?

Suggested change
real(kind_phys), intent(in) :: host_edges(:) ! km
real(kind_phys), intent(in) :: host_interface(:) ! km

Comment on lines 62 to 64
num_columns = size(constituents, dim=1)
num_layers = size(constituents, dim=2)
num_constituents = size(constituents, dim=3)
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Can we still do this when the intent of constituents is out?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I think maybe the intent can be inout to get the dimension?

real(kind_phys), intent(inout) :: constituents(:,:,:)  ! kg kg-1

Copy link
Collaborator

Choose a reason for hiding this comment

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

Using intent(inout) should definitely work here, and is probably the safest bet.

@boulderdaze boulderdaze self-assigned this Oct 16, 2024
Comment on lines 63 to 65
num_columns = size(constituents, dim=1)
num_layers = size(constituents, dim=2)
num_constituents = size(constituents, dim=3)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
num_columns = size(constituents, dim=1)
num_layers = size(constituents, dim=2)
num_constituents = size(constituents, dim=3)
num_columns = size(micm_constituents, dim=1)
num_layers = size(micm_constituents, dim=2)
num_constituents = size(micm_constituents, dim=3)

Should it be this instead?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yeah I found this possibly confusing. The function reshape_into_ccpp_arr() takes 1-D micm array and reshape it into 3-D CCPP array. It doesn't seem straightforward to get the dimension of CCPP array from micm array because this function does not want to know the number of columns and layers that are set when MCIM species are registered. (unless we want to do this way) I made CCPP array with intent(inout) instead of intent(out) solely to get the dimensions for the array. Any thoughts on this? I was also questioning about this.

!> Reshape array (1D -> 3D) and convert type (c_double -> kind_phys)
subroutine reshape_into_ccpp_arr(micm_constituents, constituents)

test/musica/CMakeLists.txt Show resolved Hide resolved
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.

4 participants