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

Regridding Tests #82

Open
1 of 5 tasks
jatkinson1000 opened this issue Oct 18, 2024 · 7 comments · May be fixed by #68
Open
1 of 5 tasks

Regridding Tests #82

jatkinson1000 opened this issue Oct 18, 2024 · 7 comments · May be fixed by #68
Assignees
Labels

Comments

@jatkinson1000
Copy link
Member

jatkinson1000 commented Oct 18, 2024

This is a sub-issue of #64 specifically focussing on the regridding tests.

A plan of action is to:

  • Review current tests, how they work, and what passes and fails.
  • Define what tests we want to write:
    • Interpolate between identical grids
    • Interpolate from a fine to a coarse grid
    • Interpolate from a coarse to a fine grid
    • Handling when one grid is 'higher' than the origin grid
  • What do we compare
    • For conservative regridding we want to compare the integral in the column
  • How do we test multiple columns
  • How do we setup and define test arrays - this could probably be improved from what is currently there.
@jatkinson1000
Copy link
Member Author

The test test_interp_to_cam_match currently is a specialised test where the CAM and SAM grids are identical AND we use density of 1.0 across the entire column.
We then test that all interpolated cells have a density of 1.0.

We could write a more generic test that takes cells with variable density, but checks that total mass is conserved between columns (by summing var_cam and var_sam across the height). This approach could be used in other subsequent tests as well.

@jatkinson1000
Copy link
Member Author

At the moment we always assume the CAM interface pressure is equal to the bottom pressure of the column.
Can we test when this is not the case in a separate test perhaps?

@jatkinson1000
Copy link
Member Author

We currently have interpolation tests for matching SAM and CAM grids, and for when CAM is finer than SAM.

We need to add a test for when CAM is coarser than SAM (and extends higher?) as this is the realistic case we are dealing with.

@jatkinson1000
Copy link
Member Author

Some variables could be made module variables and better documented:

  • 4 could be replaced by num_cols and applied to all tests as a module variable.

@jatkinson1000
Copy link
Member Author

The setup of the coarse grids in some tests using a reshape is very unintuitive.
It would be much better to do so using a loop over column levels and setting the values at each level.
e.g. https://github.com/m2lines/convection-parameterization-in-CAM/blob/1adf4ce02eeda6d78c48577211fcfa1d1c783962/tests/test_CAM_interface/test_cam_interface.F90#L78C1-L78C124

@AdelekeBankole
Copy link
Collaborator

Some variables could be made module variables and better documented:

  • 4 could be replaced by num_cols and applied to all tests as a module variable.

This was addressed in the earlier commit.

@AdelekeBankole
Copy link
Collaborator

The setup of the coarse grids in some tests using a reshape is very unintuitive. It would be much better to do so using a loop over column levels and setting the values at each level. e.g. https://github.com/m2lines/convection-parameterization-in-CAM/blob/1adf4ce02eeda6d78c48577211fcfa1d1c783962/tests/test_CAM_interface/test_cam_interface.F90#L78C1-L78C124

This was also addressed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants