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 high resolution clm data artifact #1007

Merged
merged 1 commit into from
Feb 12, 2025
Merged

Conversation

imreddyTeja
Copy link
Contributor

@imreddyTeja imreddyTeja commented Feb 3, 2025

Purpose

Along with the accompanying ClimaArtifacts PR, this
closes #999

Content

Adds a higher resolution clm data artifact, named
clm_data_0.125x0.125. The previous artifact is renamed
to clm_data_0.9x1.25.

The clm_data_folder_path function takes in the lowres
flag as a kwarg, and returns the correct folder based on
that.

This also adds the lowres kwarg to the
clm_canopy_parameters and default_spatially_varying_soil_parameters
functions. The default value of lowres is determined by the
use_lowres_clm function. If given a cubed sphere mesh, the function
compares the results of ClimaCore.Meshes.element_horizontal_length_scale
to the approximate horizontal scale of both clm data artifacts
in meters. If given a rectilinear mesh, it does the same but in
degrees.


  • I have read and checked the items on the review checklist.

@imreddyTeja imreddyTeja force-pushed the tr/add-high-res-clm-data branch from 09b5088 to 477838c Compare February 3, 2025 22:30
@imreddyTeja imreddyTeja marked this pull request as ready for review February 3, 2025 23:34
Copy link
Member

@Sbozzolo Sbozzolo left a comment

Choose a reason for hiding this comment

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

The highres artifact is only 2 MB. I think we can just switch to using it all the time.

@imreddyTeja imreddyTeja force-pushed the tr/add-high-res-clm-data branch from 51ae294 to 058042a Compare February 4, 2025 16:30
Copy link
Member

@kmdeck kmdeck left a comment

Choose a reason for hiding this comment

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

looks great! Thanks!

@braghiere
Copy link
Member

Looks good. Can we just be more precise in terms of the resolution. High vs low res is relative. Can we call it 0.125 instead?

@imreddyTeja
Copy link
Contributor Author

Looks good. Can we just be more precise in terms of the resolution. High vs low res is relative. Can we call it 0.125 instead?

The name is now changed to "clm_data_0.125"

@imreddyTeja imreddyTeja force-pushed the tr/add-high-res-clm-data branch 2 times, most recently from 93b94dc to ff7d319 Compare February 10, 2025 21:43
@imreddyTeja imreddyTeja requested a review from Sbozzolo February 11, 2025 00:04
Comment on lines 23 to 26
# scale in meters
element_scale = ClimaCore.Meshes.element_horizontal_length_scale(mesh)
return abs(lowres_scale - element_scale) <
abs(highres_scale - element_scale)
Copy link
Member

Choose a reason for hiding this comment

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

I think we want to check the distance between nodes, not elements. So you might want to use node_horizontal_length_scale instead

)
surface_space = domain.space.surface
surface_mesh = ClimaCore.Spaces.topology(surface_space).mesh
@test ClimaLand.use_lowres_clm(surface_mesh) == false
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
@test ClimaLand.use_lowres_clm(surface_mesh) == false
@test !(ClimaLand.use_lowres_clm(surface_mesh))

)
surface_space = domain.space.surface
surface_mesh = ClimaCore.Spaces.topology(surface_space).mesh
@test ClimaLand.use_lowres_clm(surface_mesh) == true
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
@test ClimaLand.use_lowres_clm(surface_mesh) == true
@test ClimaLand.use_lowres_clm(surface_mesh)

)
surface_space = domain.space.surface
surface_mesh = ClimaCore.Spaces.topology(surface_space).mesh
@test ClimaLand.use_lowres_clm(surface_mesh) == false
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
@test ClimaLand.use_lowres_clm(surface_mesh) == false
@test !(ClimaLand.use_lowres_clm(surface_mesh))

# test `use_lowres_clm` on the sphere domain, and then again with a sphere domain with 2x
# the horizontal resolution. Then repeat with plane domains.
surface_mesh = ClimaCore.Spaces.topology(surface_space).mesh
@test ClimaLand.use_lowres_clm(surface_mesh) == true
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
@test ClimaLand.use_lowres_clm(surface_mesh) == true
@test ClimaLand.use_lowres_clm(surface_mesh)

Adds a higher resolution clm data artifact, named
clm_data_0.125x0.125. The previous artifact is renamed
to clm_data_0.9x1.25.

The clm_data_folder_path function takes in the `lowres`
flag as a kwarg, and returns the correct folder based on
that.

This also adds the `lowres` kwarg to the
`clm_canopy_parameters` and `default_spatially_varying_soil_parameters`
functions. The default value of `lowres` is determined by the
`use_lowres_clm` function. If given a cubed sphere mesh, the function
compares the results of ClimaCore.Meshes.element_horizontal_length_scale
to the approximate horizontal scale of both clm data artifacts
in meters. If given a rectilinear mesh, it does the same but in
degrees.

adjust test

use node horizontal length scale
@imreddyTeja imreddyTeja force-pushed the tr/add-high-res-clm-data branch from ff7d319 to 081179c Compare February 11, 2025 01:56
@imreddyTeja imreddyTeja merged commit 3a9daa4 into main Feb 12, 2025
16 checks passed
@imreddyTeja imreddyTeja deleted the tr/add-high-res-clm-data branch February 12, 2025 23:58
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.

Obtain higher resolution surface data
4 participants