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

debug land albedo regridding #818

Closed
wants to merge 1 commit into from
Closed

debug land albedo regridding #818

wants to merge 1 commit into from

Conversation

juliasloan25
Copy link
Member

@juliasloan25 juliasloan25 commented May 24, 2024

Purpose

see #764 description and thread for details

what we know:

  • changing the regridder_type passed to the albedo constructor between InterpolationRegridder and TempestRegridder changes the quality of the plot produced (only tempest is messed up)
  • tempest produces an unrealistic plot for both the temporal and static maps,
    • this is true whether we use a space constructed with spacefillingcurve in ClimaCoupler or not

To-do

Content

Plots

  • AMIP and slabplanet look the same
  • plot looks the same after init and after 1day simulation
  • mostly using slabplanet_temporal_map.yml config with h_elem: 16, but tested with AMIP too

Interpolations regridder

albedo_init_amip

Tempest regridder

looks the same with or without spacefillingcurve in ClimaCoupler
slabplanet_tempest_albedo_before_step

Static map

Interpolation regridder

static_map_helem16_before_solve

Tempest regridder

tempest_static_map_before_solve


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

@Sbozzolo
Copy link
Member

The problem is in boundary_space somehow. I created a horzspace from scratch from the coupler and it works. What I noticed is that the boundary_space mesh has a different elemorder compared to a fresh horzspace

julia> boundary_space.grid.topology.elemorder
2400-element Vector{CartesianIndex{3}}:
 CartesianIndex(1, 1, 1)
.....

julia> horzspace.grid.topology.elemorder
CartesianIndices((20, 20, 6))

These are not equivalent.

Interestingly,

julia> extrema(parent(good) .- parent(bad))
(0.0, 0.0)

where good and bad are albedo obtained using horzspace or boundary_space respectively.

@juliasloan25
Copy link
Member Author

The problem is in boundary_space somehow. I created a horzspace from scratch from the coupler and it works. What I noticed is that the boundary_space mesh has a different elemorder compared to a fresh horzspace

julia> boundary_space.grid.topology.elemorder
2400-element Vector{CartesianIndex{3}}:
 CartesianIndex(1, 1, 1)
.....

julia> horzspace.grid.topology.elemorder
CartesianIndices((20, 20, 6))

These are not equivalent.

Interestingly,

julia> extrema(parent(good) .- parent(bad))
(0.0, 0.0)

where good and bad are albedo obtained using horzspace or boundary_space respectively.

ClimaAtmos and ClimaCoupler both create spaces using a spacefillingcurve (e.g. here in ClimaCoupler.Regridder), whereas ClimaLand and ClimaUtilities both create spaces without a spacefillingcurve (e.g. here in ClimaUtilities.TempestRegridder). This is why the two spaces have different element orders.

I had to add a TempestRemap GPU workaround in ClimaLand to force the regridding to happen on the CPU (this involves creating a new CPU context and space), and I noticed that if I created the undistributed space with a spacefillingcurve, space_distributed == space_undistributed was not true. This is why ClimaLand (and ClimaUtilities) don't use the spacefillingcurve. We should unify this across all repos, but I'm not sure which approach we should take

@juliasloan25
Copy link
Member Author

resolved - see #764

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.

2 participants