m2lines / convection-parameterization-in-CAM

Deployment of the convection parameterization scheme (previously from within SAM) deployed into the CAM model
MIT License
3 stars 2 forks source link

Comprehensive testing of conservative regridding scheme (and other interface functions) #64

Open jatkinson1000 opened 3 months ago

jatkinson1000 commented 3 months ago

As part of the work in CAM-ML (specifically #14) there were a couple of bugfixes to the regridding scheme that have been propagated to this repository in #44

As part of #44 @jatkinson1000 added tests for regridding and variable conversion. However, these should be revisited and made more robust once #44 is merged to main.

Some ideas

jatkinson1000 commented 3 months ago

This duplicated #45 which I will repeat here and close:

As part of the interfacing procedure for CAM we have to interpolate from the CAM grid to the SAM grid before applying the neural network, and then interpolate variables back to the CAM grid afterwards. At the moment we are moving ahead with interfacing, but really these should have accompanying tests to check things are working as expected and catch any potential edge cases.

A test would take the form of defining a SAM and CAM grid, and an associated variable. It would then call interp_to_sam and interp_to_cam and check the returned results against known output.

Unit tests would include:

jatkinson1000 commented 3 months ago

I have just checked, and the test.f90 code in NN_module/ is now broken in some places after the form of the nn_convection_flux function changed.

As part of this issue we should perhaps also update these. This will require running the new parameterisation and writing out the results as a 'base truth' and then reading them into new variables. The good news is the new form of the function has fewer outputs.

jatkinson1000 commented 1 month ago

Once @AdelekeBankole is back this should be broken down into sub-issues to help manage tasks and progress.