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.
The inputs are interpolated linearly, whilst the outputs use conservative regridding to improve conservation.
These have been written as part of the nn_interface_CAM.f90 module.
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:
Mapping between interlocking grids
Mapping between overlapping grids
Handling end points when grids don't start/end at same point
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.
The inputs are interpolated linearly, whilst the outputs use conservative regridding to improve conservation.
These have been written as part of the
nn_interface_CAM.f90
module. 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
andinterp_to_cam
and check the returned results against known output.Unit tests would include: