I implemented the GetValues class for ROMS, but I get the following error when running the unit tests:
ufo_geovals_analytic_init: pressure coordinate not defined
It seems that the GeoVaLs test is only designed for atmospheric models (like FV3). I implemented my analytical functions for ROMS state fields:
ana_fields (field_name, mask, lon, lat, z, h, value)
where z is the depth (meters; negative) and h is the bathymetry. It returns the value for the requested state field name. It also needs to know the land/sea mask at the (lon, lat) location. Ocean models do not use pressure coordinates. My analytical function can be used to get values at the GeoVaLs locations (lon, lat, z). ROMS is a different class of ocean models from the ones used previously in JEDI (like MOM6). It is a terrain-following coordinate model where the level thickness is a function of the vertical stretching parameters and the bathymetry. The figure below shows an example of a grid application cross-section:
I don’t know if this kind of configuration is currently possible when testing the GeoVaLs since we will need the depths of the discretized water column at (lon, lat). Recall that the GeoVaLs are interpolated at the full water column. The depths, bathymetry, and land/sea mask needed for my analytical function can be easily interpolated from the geometry object at the requested (lon, lat).
I coded my own analytical function into GetValues.cc but I don’t know how to overwrite the one in the UFO operator (ufo/src/ufo/ufo_geovals_mod.F90) to test the interpolations.
void GetValues::AnalyticInit(const Geometry & geom,
const eckit::Configuration & config,
const ufo::Locations & locs,
ufo::GeoVaLs & geovals) const {
oops::Log::trace() << “GetValues::analytic_init starting” << std::endl;
if (config.has(“analytic_init”)) {
roms_getvalues_analytic_init_f90(keyGetValues_,
geom_->toFortran(),
locs,
geovals.toFortran());
}
oops::Log::trace() << “AnalyticInit::analytic_init done” << std::endl;
}
I haven’t found the specific keyword and value parameters in the YAML file to overwrite the current behavior about pressure levels. I checkout soca but it seems that the analytical test was bypassed. I think that changes are needed in UFO, oops/src//interface/GetValues., and maybe in other places for this test to work for me. I think that I am in good shape from the ROMS-JEDI implementation. I am learning lots of stuff. However, currently, my skills and privileges are limited and I will need some help from the JEDI developers to solve the issues that I am having.
Sorry for the long posting. Thank you!
My current implementation of the GetValues object is in the branch feature/getvalues of roms-jedi repository.