From 8524adba1a7be3e66563cad8fe0e05f8c0ad9644 Mon Sep 17 00:00:00 2001 From: twsearle <14909402+twsearle@users.noreply.github.com> Date: Wed, 11 Sep 2024 17:42:09 +0100 Subject: [PATCH 1/2] Add rotated pole test data and tests --- src/tests/CMakeLists.txt | 12 ++ src/tests/Data/CMakeLists.txt | 3 + src/tests/Data/amm1_atlas_grid_spec.yaml | 2 + src/tests/Data/amm1r_atlas_grid_spec.yaml | 21 ++ src/tests/Data/amm1r_coords.nc | 3 + src/tests/Data/amm1r_nemo.nc | 3 + src/tests/Data/hofx_potm_amm1r_obs.nc | 3 + .../orca-jedi/test_nemo_io_read_server.cc | 179 +++++++++--------- src/tests/testinput/CMakeLists.txt | 3 +- src/tests/testinput/hofx3d_nc_ssh_amm1r.yaml | 52 +++++ src/tests/testinput/hofx_nc_potm_amm1r.yaml | 73 +++++++ src/tests/testoutput/CMakeLists.txt | 2 + .../testoutput/test_hofx3d_nc_ssh_amm1r.ref | 9 + .../testoutput/test_hofx_nc_potm_amm1r.ref | 15 ++ 14 files changed, 291 insertions(+), 89 deletions(-) create mode 100644 src/tests/Data/amm1r_atlas_grid_spec.yaml create mode 100644 src/tests/Data/amm1r_coords.nc create mode 100644 src/tests/Data/amm1r_nemo.nc create mode 100644 src/tests/Data/hofx_potm_amm1r_obs.nc create mode 100644 src/tests/testinput/hofx3d_nc_ssh_amm1r.yaml create mode 100644 src/tests/testinput/hofx_nc_potm_amm1r.yaml create mode 100644 src/tests/testoutput/test_hofx3d_nc_ssh_amm1r.ref create mode 100644 src/tests/testoutput/test_hofx_nc_potm_amm1r.ref diff --git a/src/tests/CMakeLists.txt b/src/tests/CMakeLists.txt index 372bd14..7b41895 100644 --- a/src/tests/CMakeLists.txt +++ b/src/tests/CMakeLists.txt @@ -59,6 +59,18 @@ ecbuild_add_test( TARGET test_orcamodel_hofx3D_ssh_amm1 ARGS testinput/hofx3d_nc_ssh_amm1.yaml COMMAND orcamodel_hofx3D.x ) +ecbuild_add_test( TARGET test_orcamodel_hofx_potm_amm1r + OMP 1 + MPI 1 + ARGS testinput/hofx_nc_potm_amm1r.yaml + COMMAND orcamodel_hofx.x ) + +ecbuild_add_test( TARGET test_orcamodel_hofx3D_ssh_amm1r + OMP 1 + MPI 1 + ARGS testinput/hofx3d_nc_ssh_amm1r.yaml + COMMAND orcamodel_hofx3D.x ) + ecbuild_add_test( TARGET test_orcamodel_hofx_ssh_parallel_serial OMP 1 MPI 2 diff --git a/src/tests/Data/CMakeLists.txt b/src/tests/Data/CMakeLists.txt index 5cc20f9..6a03860 100644 --- a/src/tests/Data/CMakeLists.txt +++ b/src/tests/Data/CMakeLists.txt @@ -23,6 +23,9 @@ hofx_ssh_obs.nc amm1_coords.nc amm1_nemo.nc amm1_atlas_grid_spec.yaml +amm1r_nemo.nc +amm1r_atlas_grid_spec.yaml +hofx_potm_amm1r_obs.nc amm_ssh_obs.nc ) diff --git a/src/tests/Data/amm1_atlas_grid_spec.yaml b/src/tests/Data/amm1_atlas_grid_spec.yaml index 8d05a7b..5275fae 100644 --- a/src/tests/Data/amm1_atlas_grid_spec.yaml +++ b/src/tests/Data/amm1_atlas_grid_spec.yaml @@ -1,3 +1,5 @@ +# (C) British Crown Copyright 2024 Met Office + type : "regional" nx : 15 ny : 19 diff --git a/src/tests/Data/amm1r_atlas_grid_spec.yaml b/src/tests/Data/amm1r_atlas_grid_spec.yaml new file mode 100644 index 0000000..01fbfb2 --- /dev/null +++ b/src/tests/Data/amm1r_atlas_grid_spec.yaml @@ -0,0 +1,21 @@ +# (C) British Crown Copyright 2024 Met Office + +type : "regional" +nx : 15 +ny : 13 +north : 10.9 +south : -7.29 +west : 8.79 +east : -10.9 +y_numbering : +1 + +projection : + type: "rotated_lonlat" + north_pole : [177, 37.5] + +check: + size: 195 + lonlat(first) : [9.262,44.463] + lonlat(last) : [-26.022,61.654] + uid: 35244078cc9483703ac9be75be0314e4 + bounding_box(n,w,s,e) : [63.401, -26.023, 44.066, 333.977] diff --git a/src/tests/Data/amm1r_coords.nc b/src/tests/Data/amm1r_coords.nc new file mode 100644 index 0000000..44dd216 --- /dev/null +++ b/src/tests/Data/amm1r_coords.nc @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7f396a6a74e8b38e71ee62fe8d62c7e421e8b9e44399d6decab084aef4b43b8d +size 14043 diff --git a/src/tests/Data/amm1r_nemo.nc b/src/tests/Data/amm1r_nemo.nc new file mode 100644 index 0000000..e339a28 --- /dev/null +++ b/src/tests/Data/amm1r_nemo.nc @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:606f2ecda57f7af1e48b31ad65201746055291d5f80bd6c81ba93da8ee79b7c0 +size 54978 diff --git a/src/tests/Data/hofx_potm_amm1r_obs.nc b/src/tests/Data/hofx_potm_amm1r_obs.nc new file mode 100644 index 0000000..c369ee5 --- /dev/null +++ b/src/tests/Data/hofx_potm_amm1r_obs.nc @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:36f2a89dddf967331209ef3fe28e01711f50a6b8fd2330e8aa1b8ac2f339e659 +size 11846 diff --git a/src/tests/orca-jedi/test_nemo_io_read_server.cc b/src/tests/orca-jedi/test_nemo_io_read_server.cc index e6baa33..cb2f6fe 100644 --- a/src/tests/orca-jedi/test_nemo_io_read_server.cc +++ b/src/tests/orca-jedi/test_nemo_io_read_server.cc @@ -35,102 +35,105 @@ namespace test { //----------------------------------------------------------------------------- // CASE("test MPI distributed reads structured grid field array view") { - eckit::PathName test_data_path("../Data/amm1_nemo.nc"); - eckit::PathName grid_spec_path("../Data/amm1_atlas_grid_spec.yaml"); - auto partitioner_names = std::vector{"serial"}; - for (std::string partitioner_name : partitioner_names) { - atlas::Grid grid{atlas::Grid::Spec{grid_spec_path}}; - - auto meshgen_config = grid.meshgenerator(); - std::cout << "meshgen_config: " << meshgen_config << std::endl; - atlas::MeshGenerator meshgen(meshgen_config); - - auto partitioner_config = grid.partitioner(); - partitioner_config.set("type", partitioner_name); - auto partitioner = atlas::grid::Partitioner(partitioner_config); - - auto mesh = meshgen.generate(grid, partitioner); - std::unique_ptr atlas_index( - AtlasIndexToBufferIndexCreator::create_unique(grid.type(), mesh)); - - auto funcSpace = atlas::functionspace::NodeColumns(mesh); - - auto eckit_timer = std::make_shared( - "Geometry(ORCA): ", oops::Log::trace()); - eckit_timer->start(); - ReadServer read_server(eckit_timer, test_data_path, mesh); - - constexpr float kgo_missing_value = -32768.; - SECTION(partitioner_name + " get field _FillValue") { - auto missing_value = read_server.read_fillvalue("sossheig"); - if (std::abs(missing_value - kgo_missing_value) >= 1e-6) { - std::cout << "missing_value: " << missing_value << " == " << kgo_missing_value - << " diff " << std::abs(missing_value - kgo_missing_value) << std::endl; - } - EXPECT(std::abs(missing_value - kgo_missing_value) < 1e-6); - - auto default_missing_value = read_server.read_fillvalue("nav_lev"); - if (std::abs(default_missing_value - std::numeric_limits::lowest()) >= 1e-6) { - std::cout << "default_missing_value: " << missing_value << " == " - << std::numeric_limits::lowest() - << " diff " << std::abs(default_missing_value - std::numeric_limits::lowest()) - << std::endl; + for (auto & gridname : std::vector{"amm1", "amm1r"}) { + eckit::PathName test_data_path("../Data/" + gridname + "_nemo.nc"); + eckit::PathName grid_spec_path("../Data/" + gridname + "_atlas_grid_spec.yaml"); + auto partitioner_names = std::vector{"serial"}; + for (std::string partitioner_name : partitioner_names) { + atlas::Grid grid{atlas::Grid::Spec{grid_spec_path}}; + + auto meshgen_config = grid.meshgenerator(); + std::cout << "meshgen_config: " << meshgen_config << std::endl; + atlas::MeshGenerator meshgen(meshgen_config); + + auto partitioner_config = grid.partitioner(); + partitioner_config.set("type", partitioner_name); + auto partitioner = atlas::grid::Partitioner(partitioner_config); + + auto mesh = meshgen.generate(grid, partitioner); + std::unique_ptr atlas_index( + AtlasIndexToBufferIndexCreator::create_unique(grid.type(), mesh)); + + auto funcSpace = atlas::functionspace::NodeColumns(mesh); + + auto eckit_timer = std::make_shared( + "Geometry(ORCA): ", oops::Log::trace()); + eckit_timer->start(); + ReadServer read_server(eckit_timer, test_data_path, mesh); + + constexpr float kgo_missing_value = -32768.; + SECTION(gridname + " " + partitioner_name + " get field _FillValue") { + auto missing_value = read_server.read_fillvalue("sossheig"); + if (std::abs(missing_value - kgo_missing_value) >= 1e-6) { + std::cout << "missing_value: " << missing_value << " == " << kgo_missing_value + << " diff " << std::abs(missing_value - kgo_missing_value) << std::endl; + } + EXPECT(std::abs(missing_value - kgo_missing_value) < 1e-6); + + auto default_missing_value = read_server.read_fillvalue("nav_lev"); + if (std::abs(default_missing_value - std::numeric_limits::lowest()) >= 1e-6) { + std::cout << "default_missing_value: " << missing_value << " == " + << std::numeric_limits::lowest() + << " diff " << std::abs(default_missing_value + - std::numeric_limits::lowest()) + << std::endl; + } + EXPECT(std::abs(default_missing_value - std::numeric_limits::lowest()) < 1e-6); } - EXPECT(std::abs(default_missing_value - std::numeric_limits::lowest()) < 1e-6); - } - SECTION(partitioner_name + " surface field") { - std::string nemo_name{"sossheig"}; - atlas::Field field(funcSpace.createField( - atlas::option::name(nemo_name) | - atlas::option::levels(1))); - auto field_view = atlas::array::make_view(field); - field.metadata().set("missing_value", kgo_missing_value); - field.metadata().set("missing_value_type", "approximately-equals"); - field.metadata().set("missing_value_epsilon", 1e-6); - - read_server.read_var(nemo_name, 0, field_view); - - std::vector raw_data; - { - NemoFieldReader field_reader(test_data_path); - raw_data = field_reader.read_var_slice(nemo_name, 0, 0); - } + SECTION(gridname + " " + partitioner_name + " surface field") { + std::string nemo_name{"sossheig"}; + atlas::Field field(funcSpace.createField( + atlas::option::name(nemo_name) | + atlas::option::levels(1))); + auto field_view = atlas::array::make_view(field); + field.metadata().set("missing_value", kgo_missing_value); + field.metadata().set("missing_value_type", "approximately-equals"); + field.metadata().set("missing_value_epsilon", 1e-6); + + read_server.read_var(nemo_name, 0, field_view); + + std::vector raw_data; + { + NemoFieldReader field_reader(test_data_path); + raw_data = field_reader.read_var_slice(nemo_name, 0, 0); + } - auto ghost = atlas::array::make_view(mesh.nodes().ghost()); - for (size_t i = 0; i < field_view.size(); ++i) { - if (ghost(i)) continue; - float raw_value = raw_data[(*atlas_index)(i)]; - if (raw_value != field_view(i, 0)) { - std::cout << "mismatch: i " << i - << " " << raw_value << " != " << field_view(i, 0) << std::endl; + auto ghost = atlas::array::make_view(mesh.nodes().ghost()); + for (size_t i = 0; i < field_view.size(); ++i) { + if (ghost(i)) continue; + float raw_value = raw_data[(*atlas_index)(i)]; + if (raw_value != field_view(i, 0)) { + std::cout << "mismatch: i " << i + << " " << raw_value << " != " << field_view(i, 0) << std::endl; + } + EXPECT_EQUAL(raw_value, field_view(i, 0)); } - EXPECT_EQUAL(raw_value, field_view(i, 0)); } - } - SECTION(partitioner_name + " volume field") { - atlas::Field field(funcSpace.createField( - atlas::option::name("votemper") | - atlas::option::levels(3))); - auto field_view = atlas::array::make_view(field); + SECTION(gridname + " " + partitioner_name + " volume field") { + atlas::Field field(funcSpace.createField( + atlas::option::name("votemper") | + atlas::option::levels(3))); + auto field_view = atlas::array::make_view(field); - NemoFieldReader field_reader(test_data_path); - read_server.read_var("votemper", 0, field_view); - - auto ghost = atlas::array::make_view(mesh.nodes().ghost()); - std::vector raw_data; - for (int k =0; k <3; k++) { - raw_data = field_reader.read_var_slice("votemper", 0, k); - for (int i = 0; i < field_view.shape(0); ++i) { - double raw_value = raw_data[(*atlas_index)(i)]; - if (ghost(i)) continue; - if (raw_value != field_view(i, k)) { - std::cout << "mismatch: " - << raw_value << " " - << " with mesh " << field_view(i, k) << std::endl; + NemoFieldReader field_reader(test_data_path); + read_server.read_var("votemper", 0, field_view); + + auto ghost = atlas::array::make_view(mesh.nodes().ghost()); + std::vector raw_data; + for (int k =0; k <3; k++) { + raw_data = field_reader.read_var_slice("votemper", 0, k); + for (int i = 0; i < field_view.shape(0); ++i) { + double raw_value = raw_data[(*atlas_index)(i)]; + if (ghost(i)) continue; + if (raw_value != field_view(i, k)) { + std::cout << "mismatch: " + << raw_value << " " + << " with mesh " << field_view(i, k) << std::endl; + } + EXPECT_EQUAL(raw_value, field_view(i, k)); } - EXPECT_EQUAL(raw_value, field_view(i, k)); } } } diff --git a/src/tests/testinput/CMakeLists.txt b/src/tests/testinput/CMakeLists.txt index ca1ee29..61c759a 100644 --- a/src/tests/testinput/CMakeLists.txt +++ b/src/tests/testinput/CMakeLists.txt @@ -1,7 +1,6 @@ # (C) British Crown Copyright 2024 Met Office list( APPEND orcajedi_test_input - basic.yaml ostia_seaice_obs_hofx3d.yaml hofx_odb_ice.yaml hofx_nc_ice.yaml @@ -10,10 +9,12 @@ list( APPEND orcajedi_test_input hofx_nc_ssh_checkerboard.yaml hofx_nc_ssh_eorca025.yaml hofx_nc_ssh_amm1.yaml + hofx_nc_potm_amm1r.yaml hofx3d_nc_sst.yaml hofx3d_nc_potm.yaml hofx3d_nc_prof_2vars.yaml hofx3d_nc_ssh_amm1.yaml + hofx3d_nc_ssh_amm1r.yaml odb_ice_query.yaml odb_ice_mapping.yaml test_name_map.yaml diff --git a/src/tests/testinput/hofx3d_nc_ssh_amm1r.yaml b/src/tests/testinput/hofx3d_nc_ssh_amm1r.yaml new file mode 100644 index 0000000..26b92dc --- /dev/null +++ b/src/tests/testinput/hofx3d_nc_ssh_amm1r.yaml @@ -0,0 +1,52 @@ +# (C) British Crown Copyright 2024 Met Office + +time window: + begin: 2021-06-28T23:00:00Z + length: P2D +geometry : + nemo variables: + - name: sea_surface_height_anomaly + nemo field name: sossheig + model space: surface + - name: sea_surface_height_anomaly_background_error + nemo field name: sossheig + model space: surface + variable type: background variance + grid name: Data/amm1r_atlas_grid_spec.yaml + number levels: 1 + partitioner: serial + source mesh halo: 1 +state : + date: 2021-06-29T23:00:00Z + state variables: + - sea_surface_height_anomaly + - sea_surface_height_anomaly_background_error + nemo field file: &field_file Data/amm1r_nemo.nc + variance field file: *field_file +observations: + observers: + - obs space: + name: Sea Surface Height + obsdatain: + engine: + type: H5File + obsfile: Data/amm_ssh_obs.nc + simulated variables: [seaSurfaceHeightAnomaly] + obsdataout: + engine: + type: H5File + obsfile: testoutput/test_hofx3d_nc_ssh_amm1r_jopa_out.nc + get values: + atlas-interpolator: + type: unstructured-bilinear-lonlat + non_linear: missing-if-all-missing-real32 + obs operator: + name: Composite + components: + - name: Identity + observation alias file: testinput/test_name_map.yaml + - name: BackgroundErrorIdentity + observation alias file: testinput/test_name_map.yaml +test: + reference filename: testoutput/test_hofx3d_nc_ssh_amm1r.ref + float absolute tolerance: 5.0e-7 # tolerance for MPI sum-order related differences diff --git a/src/tests/testinput/hofx_nc_potm_amm1r.yaml b/src/tests/testinput/hofx_nc_potm_amm1r.yaml new file mode 100644 index 0000000..87a9204 --- /dev/null +++ b/src/tests/testinput/hofx_nc_potm_amm1r.yaml @@ -0,0 +1,73 @@ +# (C) British Crown Copyright 2024 Met Office + +forecast length : P2D +time window: + begin: 2021-06-28T23:00:00Z + length: P2D +geometry : + nemo variables: + - name: depth + nemo field name: nav_lev + model space: vertical + - name: sea_water_potential_temperature + nemo field name: votemper + model space: volume + - name: sea_water_potential_temperature_background_error + nemo field name: vosaline + model space: volume + variable type: background variance + grid name: Data/amm1r_atlas_grid_spec.yaml + number levels: 1 + partitioner: serial + source mesh halo: 1 +initial condition : + date: 2021-06-28T23:00:00Z + state variables: &state_variables + - sea_water_potential_temperature + - sea_water_potential_temperature_background_error + nemo field file: &field_file Data/amm1r_nemo.nc + variance field file: *field_file +model : + name: PseudoModel + tstep: P1D + states: + - date: 2021-06-29T23:00:00Z + nemo field file: *field_file + variance field file: *field_file + state variables: *state_variables + - date: 2021-06-30T23:00:00Z + nemo field file: *field_file + variance field file: *field_file + state variables: *state_variables +observations: + observers: + - obs space: + name: Sea Temperature + obsdatain: + engine: + type: H5File + obsfile: Data/hofx_potm_amm1r_obs.nc + obsgrouping: + group variables: [ "stationIdentification" ] + sort variable: depthBelowWaterSurface + sort group: ObsValue + sort order: descending + obsdataout: + engine: + type: H5File + obsfile: testoutput/test_hofx_nc_potm_amm1r_jopa_out.nc + simulated variables: [waterPotentialTemperature] + get values: + atlas-interpolator: + type: unstructured-bilinear-lonlat + non_linear: missing-if-all-missing-real32 + obs operator: + name: Composite + components: + - name: Identity + observation alias file: testinput/test_name_map.yaml + - name: BackgroundErrorIdentity + observation alias file: testinput/test_name_map.yaml +test: + reference filename: testoutput/test_hofx_nc_potm_amm1r.ref + float absolute tolerance: 5.0e-7 # tolerance for MPI sum-order related differences diff --git a/src/tests/testoutput/CMakeLists.txt b/src/tests/testoutput/CMakeLists.txt index f0dc157..0a7e576 100644 --- a/src/tests/testoutput/CMakeLists.txt +++ b/src/tests/testoutput/CMakeLists.txt @@ -6,10 +6,12 @@ list( APPEND orcajedi_test_output test_hofx_nc_ssh.ref test_hofx_nc_ssh_eorca025.ref test_hofx_nc_ssh_amm1.ref + test_hofx_nc_potm_amm1r.ref test_hofx3d_nc_sst.ref test_hofx3d_nc_potm.ref test_hofx3d_nc_prof_2vars.ref test_hofx3d_nc_ssh_amm1.ref + test_hofx3d_nc_ssh_amm1r.ref ) foreach(FILENAME ${orcajedi_test_output}) diff --git a/src/tests/testoutput/test_hofx3d_nc_ssh_amm1r.ref b/src/tests/testoutput/test_hofx3d_nc_ssh_amm1r.ref new file mode 100644 index 0000000..6a58a0b --- /dev/null +++ b/src/tests/testoutput/test_hofx3d_nc_ssh_amm1r.ref @@ -0,0 +1,9 @@ +Test : State: +Test : Model state valid at time: 2021-06-29T23:00:00Z +Test : 2 variables: sea_surface_height_anomaly, sea_surface_height_anomaly_background_error +Test : atlas field norms: +Test : sea_surface_height_anomaly: 1.53649e-02 +Test : sea_surface_height_anomaly_background_error: 1.53649e-02 +Test : H(x): +Test : Sea Surface Height nobs= 15 Min=1.78300e-01, Max=1.82067e-01, RMS=1.80296e-01 +Test : End H(x) diff --git a/src/tests/testoutput/test_hofx_nc_potm_amm1r.ref b/src/tests/testoutput/test_hofx_nc_potm_amm1r.ref new file mode 100644 index 0000000..b063c0a --- /dev/null +++ b/src/tests/testoutput/test_hofx_nc_potm_amm1r.ref @@ -0,0 +1,15 @@ +Test : Initial state: +Test : Model state valid at time: 2021-06-28T23:00:00Z +Test : 2 variables: sea_water_potential_temperature, sea_water_potential_temperature_background_error +Test : atlas field norms: +Test : sea_water_potential_temperature: 1.58670e+00 +Test : sea_water_potential_temperature_background_error: 2.80065e+00 +Test : Final state: +Test : Model state valid at time: 2021-06-30T23:00:00Z +Test : 2 variables: sea_water_potential_temperature, sea_water_potential_temperature_background_error +Test : atlas field norms: +Test : sea_water_potential_temperature: 1.58670e+00 +Test : sea_water_potential_temperature_background_error: 2.80065e+00 +Test : H(x): +Test : Sea Temperature nobs= 10 Min=1.83026e+01, Max=1.83026e+01, RMS=1.83026e+01 +Test : End H(x) From f982f986d399a74b9107a96695bf7cc7c5fdf7f5 Mon Sep 17 00:00:00 2001 From: twsearle <14909402+twsearle@users.noreply.github.com> Date: Fri, 13 Sep 2024 10:24:09 +0100 Subject: [PATCH 2/2] improve test filename consistency --- src/tests/CMakeLists.txt | 8 +- src/tests/Data/CMakeLists.txt | 9 +- ..._seaice_obs.csv => hofx_sic_ostia_obs.csv} | 0 ...ia_seaice_obs.nc => hofx_sic_ostia_obs.nc} | 0 ..._seaice_obs.odb => hofx_sic_ostia_obs.odb} | 0 .../{amm_ssh_obs.nc => hofx_ssh_amm_obs.nc} | 0 src/tests/Data/ostia_seaice_obs.cdl | 107 ------------------ src/tests/orca-jedi/test_increment.cc | 3 +- src/tests/testinput/CMakeLists.txt | 10 +- ...ice_obs_hofx3d.yaml => hofx3d_nc_sic.yaml} | 6 +- src/tests/testinput/hofx3d_nc_ssh_amm1.yaml | 2 +- src/tests/testinput/hofx3d_nc_ssh_amm1r.yaml | 2 +- .../{hofx_nc_ice.yaml => hofx_nc_sic.yaml} | 6 +- src/tests/testinput/hofx_nc_ssh_amm1.yaml | 2 +- .../{hofx_odb_ice.yaml => hofx_odb_sic.yaml} | 6 +- ..._ice_mapping.yaml => odb_sic_mapping.yaml} | 0 ...{odb_ice_query.yaml => odb_sic_query.yaml} | 0 src/tests/testoutput/CMakeLists.txt | 4 +- ..._obs_hofx3d.ref => test_hofx3d_nc_sic.ref} | 0 ...t_hofx_nc_ice.ref => test_hofx_nc_sic.ref} | 0 20 files changed, 29 insertions(+), 136 deletions(-) rename src/tests/Data/{ostia_seaice_obs.csv => hofx_sic_ostia_obs.csv} (100%) rename src/tests/Data/{ostia_seaice_obs.nc => hofx_sic_ostia_obs.nc} (100%) rename src/tests/Data/{ostia_seaice_obs.odb => hofx_sic_ostia_obs.odb} (100%) rename src/tests/Data/{amm_ssh_obs.nc => hofx_ssh_amm_obs.nc} (100%) delete mode 100644 src/tests/Data/ostia_seaice_obs.cdl rename src/tests/testinput/{ostia_seaice_obs_hofx3d.yaml => hofx3d_nc_sic.yaml} (90%) rename src/tests/testinput/{hofx_nc_ice.yaml => hofx_nc_sic.yaml} (96%) rename src/tests/testinput/{hofx_odb_ice.yaml => hofx_odb_sic.yaml} (96%) rename src/tests/testinput/{odb_ice_mapping.yaml => odb_sic_mapping.yaml} (100%) rename src/tests/testinput/{odb_ice_query.yaml => odb_sic_query.yaml} (100%) rename src/tests/testoutput/{test_ostia_seaice_obs_hofx3d.ref => test_hofx3d_nc_sic.ref} (100%) rename src/tests/testoutput/{test_hofx_nc_ice.ref => test_hofx_nc_sic.ref} (100%) diff --git a/src/tests/CMakeLists.txt b/src/tests/CMakeLists.txt index 7b41895..337d068 100644 --- a/src/tests/CMakeLists.txt +++ b/src/tests/CMakeLists.txt @@ -8,14 +8,14 @@ ecbuild_add_test( TARGET test_orcajedi_coding_norms COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/../../tools/cpplint.py ARGS --recursive ${CMAKE_CURRENT_SOURCE_DIR}/../ ) -ecbuild_add_test( TARGET test_orcamodel_hofx_ice +ecbuild_add_test( TARGET test_orcamodel_hofx_sic OMP 1 - ARGS testinput/hofx_nc_ice.yaml + ARGS testinput/hofx_nc_sic.yaml COMMAND orcamodel_hofx.x ) -ecbuild_add_test( TARGET test_orcamodel_hofx3D_ice +ecbuild_add_test( TARGET test_orcamodel_hofx3D_sic OMP 1 - ARGS testinput/ostia_seaice_obs_hofx3d.yaml + ARGS testinput/hofx3d_nc_sic.yaml COMMAND orcamodel_hofx3D.x ) ecbuild_add_test( TARGET test_orcamodel_hofx3D_sst diff --git a/src/tests/Data/CMakeLists.txt b/src/tests/Data/CMakeLists.txt index 6a03860..e141869 100644 --- a/src/tests/Data/CMakeLists.txt +++ b/src/tests/Data/CMakeLists.txt @@ -1,20 +1,19 @@ list( APPEND orcajedi_test_data -ostia_seaice_obs.odb +hofx_sic_ostia_obs.odb hofx_sst_obs.nc eorca025_t_nemo.nc orca2_t_bkg_var.nc orca2_t_coords.nc orca2_t_nemo.nc orca1_t_nemo.nc -ostia_seaice_obs.nc +hofx_sic_ostia_obs.nc simple_nemo.nc create_orca2_t_bkg.nco create_orca2_t_bkg_var.nco hofx_sst_obs.cdl orca2_t_coords.cdl -ostia_seaice_obs.cdl -ostia_seaice_obs.csv +hofx_sic_ostia_obs.csv simple_nemo.cdl hofx_two_vars_obs.nc hofx_potm_obs.nc @@ -26,7 +25,7 @@ amm1_atlas_grid_spec.yaml amm1r_nemo.nc amm1r_atlas_grid_spec.yaml hofx_potm_amm1r_obs.nc -amm_ssh_obs.nc +hofx_ssh_amm_obs.nc ) foreach(FILENAME ${orcajedi_test_data}) diff --git a/src/tests/Data/ostia_seaice_obs.csv b/src/tests/Data/hofx_sic_ostia_obs.csv similarity index 100% rename from src/tests/Data/ostia_seaice_obs.csv rename to src/tests/Data/hofx_sic_ostia_obs.csv diff --git a/src/tests/Data/ostia_seaice_obs.nc b/src/tests/Data/hofx_sic_ostia_obs.nc similarity index 100% rename from src/tests/Data/ostia_seaice_obs.nc rename to src/tests/Data/hofx_sic_ostia_obs.nc diff --git a/src/tests/Data/ostia_seaice_obs.odb b/src/tests/Data/hofx_sic_ostia_obs.odb similarity index 100% rename from src/tests/Data/ostia_seaice_obs.odb rename to src/tests/Data/hofx_sic_ostia_obs.odb diff --git a/src/tests/Data/amm_ssh_obs.nc b/src/tests/Data/hofx_ssh_amm_obs.nc similarity index 100% rename from src/tests/Data/amm_ssh_obs.nc rename to src/tests/Data/hofx_ssh_amm_obs.nc diff --git a/src/tests/Data/ostia_seaice_obs.cdl b/src/tests/Data/ostia_seaice_obs.cdl deleted file mode 100644 index 44f8e17..0000000 --- a/src/tests/Data/ostia_seaice_obs.cdl +++ /dev/null @@ -1,107 +0,0 @@ -netcdf ostia_seaice_obs { -dimensions: - Location = 11 ; - nvars = 1 ; -variables: - float Location(Location) ; - Location:suggested_chunk_dim = 100LL ; - float nvars(nvars) ; - nvars:suggested_chunk_dim = 100LL ; - -// global attributes: - string :_ioda_layout = "ObsGroup" ; - :_ioda_layout_version = 0 ; - :nvars = 1 ; - :nco_openmp_thread_number = 1 ; - :odb_version = 2LL ; - :date_time = 2021070100 ; - :nlocs = 11 ; - :history = "Mon Aug 23 11:00:30 2021: ncks --fix_rec_dmn nlocs tmp2.nc obs_seaice_20210701T0000Z_v_reduced.nc4\nMon Aug 23 11:00:20 2021: ncrcat -d nlocs,1,,1000000 tmp.nc tmp2.nc\nSat Aug 21 17:00:19 2021: ncks --mk_rec_dmn nlocs obs_seaice_20210701T0000Z.nc4 tmp.nc" ; - :NCO = "netCDF Operators version 4.7.5 (Homepage = http://nco.sf.net, Code = http://github.com/nco/nco)" ; -data: - - Location = 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ; - - nvars = 0 ; - -group: MetaData { - variables: - string datetime(Location) ; - string datetime:_FillValue = "" ; - float latitude(Location) ; - latitude:_FillValue = 9.96921e+36f ; - float longitude(Location) ; - longitude:_FillValue = 9.96921e+36f ; - int ops_obsgroup(Location) ; - ops_obsgroup:_FillValue = -2147483647 ; - int ops_subtype(Location) ; - ops_subtype:_FillValue = -2147483647 ; - int record_number(Location) ; - record_number:_FillValue = -2147483647 ; - int sequence_number(Location) ; - sequence_number:_FillValue = -2147483647 ; - float time(Location) ; - time:_FillValue = 9.96921e+36f ; - data: - - datetime = "2021-06-29T12:00:00Z", "2021-06-29T12:00:00Z", - "2021-06-29T12:00:00Z", "2021-06-29T12:00:00Z", "2021-06-30T00:00:00Z", - "2021-06-30T00:00:00Z", "2021-06-30T00:00:00Z", "2021-06-30T00:00:00Z", - "2021-06-30T00:00:00Z", "2021-06-30T00:00:00Z", "2021-06-30T00:00:00Z" ; - - latitude = 82.02939, 62.43589, -65.28536, -51.87979, 41.8942, 22.6519, - 3.3263, -15.916, -35.2416, -54.4839, -73.7262 ; - - longitude = 168.338, 31.21495, -24.91501, -154.482, 38.443, -148.293, - 25.115, -161.621, 11.787, -174.949, -1.685 ; - - ops_obsgroup = 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30 ; - - ops_subtype = 60700, 60700, 60700, 60700, 60600, 60600, 60600, 60600, - 60600, 60600, 60600 ; - - record_number = 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ; - - sequence_number = 1, 500001, 1000001, 1500001, 2493102, 3493102, 4493102, - 5493102, 6493102, 7493102, 8493102 ; - - time = -12, -12, -12, -12, -24, -24, -24, -24, -24, -24, -24 ; - } // group MetaData - -group: ObsError { - variables: - float seaIceFraction(Location) ; - seaIceFraction:_FillValue = 9.96921e+36f ; - data: - - seaIceFraction = 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1 ; - } // group ObsError - -group: ObsValue { - variables: - float seaIceFraction(Location) ; - seaIceFraction:_FillValue = 9.96921e+36f ; - data: - - seaIceFraction = 0, _, 0.9963, 0, 0, 0, 0, 0, 0, 0, 0 ; - } // group ObsValue - -group: PreQC { - variables: - float seaIceFraction(Location) ; - seaIceFraction:_FillValue = 9.96921e+36f ; - data: - - seaIceFraction = 1e+09, 1e+09, 1e+09, 1e+09, 1e+09, 1e+09, 1e+09, 1e+09, - 1e+09, 1e+09, 1e+09 ; - } // group PreQC - -group: VarMetaData { - variables: - string variable_names(nvars) ; - string variable_names:_FillValue = "" ; - data: - - variable_names = "ice_area_fraction" ; - } // group VarMetaData -} diff --git a/src/tests/orca-jedi/test_increment.cc b/src/tests/orca-jedi/test_increment.cc index e44f474..6aa851a 100644 --- a/src/tests/orca-jedi/test_increment.cc +++ b/src/tests/orca-jedi/test_increment.cc @@ -185,7 +185,8 @@ CASE("test increment") { increment1 *=2; atlas::FieldSet incfset = atlas::FieldSet(); increment1.Increment::toFieldSet(incfset); - writeFieldsToFile("../testoutput/orca2_t_inc_fs_output.nc", geometry, datetime, incfset); + writeFieldsToFile("../testoutput/orca2_t_increment_fieldset_output.nc", + geometry, datetime, incfset); } } diff --git a/src/tests/testinput/CMakeLists.txt b/src/tests/testinput/CMakeLists.txt index 61c759a..4470af6 100644 --- a/src/tests/testinput/CMakeLists.txt +++ b/src/tests/testinput/CMakeLists.txt @@ -1,22 +1,22 @@ # (C) British Crown Copyright 2024 Met Office list( APPEND orcajedi_test_input - ostia_seaice_obs_hofx3d.yaml - hofx_odb_ice.yaml - hofx_nc_ice.yaml + hofx_odb_sic.yaml + hofx_nc_sic.yaml hofx_nc_sst.yaml hofx_nc_ssh.yaml hofx_nc_ssh_checkerboard.yaml hofx_nc_ssh_eorca025.yaml hofx_nc_ssh_amm1.yaml hofx_nc_potm_amm1r.yaml + hofx3d_nc_sic.yaml hofx3d_nc_sst.yaml hofx3d_nc_potm.yaml hofx3d_nc_prof_2vars.yaml hofx3d_nc_ssh_amm1.yaml hofx3d_nc_ssh_amm1r.yaml - odb_ice_query.yaml - odb_ice_mapping.yaml + odb_sic_query.yaml + odb_sic_mapping.yaml test_name_map.yaml ) diff --git a/src/tests/testinput/ostia_seaice_obs_hofx3d.yaml b/src/tests/testinput/hofx3d_nc_sic.yaml similarity index 90% rename from src/tests/testinput/ostia_seaice_obs_hofx3d.yaml rename to src/tests/testinput/hofx3d_nc_sic.yaml index 2d48b33..70bfd8f 100644 --- a/src/tests/testinput/ostia_seaice_obs_hofx3d.yaml +++ b/src/tests/testinput/hofx3d_nc_sic.yaml @@ -32,11 +32,11 @@ observations: obsdatain: engine: type: H5File - obsfile: Data/ostia_seaice_obs.nc + obsfile: Data/hofx_sic_ostia_obs.nc obsdataout: engine: type: H5File - obsfile: testoutput/test_ostia_seaice_obs_hofx3d_jopa.nc + obsfile: testoutput/test_hofx3d_nc_sic_jopa_out.nc simulated variables: [seaIceFraction] get values: atlas-interpolator: @@ -62,4 +62,4 @@ observations: prob density bad obs: 1.0 PGE threshold: 0.5 test: - reference filename: testoutput/test_ostia_seaice_obs_hofx3d.ref + reference filename: testoutput/test_hofx3d_nc_sic.ref diff --git a/src/tests/testinput/hofx3d_nc_ssh_amm1.yaml b/src/tests/testinput/hofx3d_nc_ssh_amm1.yaml index ef10910..783278f 100644 --- a/src/tests/testinput/hofx3d_nc_ssh_amm1.yaml +++ b/src/tests/testinput/hofx3d_nc_ssh_amm1.yaml @@ -30,7 +30,7 @@ observations: obsdatain: engine: type: H5File - obsfile: Data/amm_ssh_obs.nc + obsfile: Data/hofx_ssh_amm_obs.nc simulated variables: [seaSurfaceHeightAnomaly] get values: atlas-interpolator: diff --git a/src/tests/testinput/hofx3d_nc_ssh_amm1r.yaml b/src/tests/testinput/hofx3d_nc_ssh_amm1r.yaml index 26b92dc..fd60b3c 100644 --- a/src/tests/testinput/hofx3d_nc_ssh_amm1r.yaml +++ b/src/tests/testinput/hofx3d_nc_ssh_amm1r.yaml @@ -30,7 +30,7 @@ observations: obsdatain: engine: type: H5File - obsfile: Data/amm_ssh_obs.nc + obsfile: Data/hofx_ssh_amm_obs.nc simulated variables: [seaSurfaceHeightAnomaly] obsdataout: engine: diff --git a/src/tests/testinput/hofx_nc_ice.yaml b/src/tests/testinput/hofx_nc_sic.yaml similarity index 96% rename from src/tests/testinput/hofx_nc_ice.yaml rename to src/tests/testinput/hofx_nc_sic.yaml index d10eeb1..f4cbbe7 100644 --- a/src/tests/testinput/hofx_nc_ice.yaml +++ b/src/tests/testinput/hofx_nc_sic.yaml @@ -46,11 +46,11 @@ observations: obsdatain: engine: type: H5File - obsfile: Data/ostia_seaice_obs.nc + obsfile: Data/hofx_sic_ostia_obs.nc obsdataout: engine: type: H5File - obsfile: testoutput/test_hofx_nc_ice_jopa.nc + obsfile: testoutput/test_hofx_nc_sic_jopa.nc simulated variables: [seaIceFraction] get values: time interpolation: linear @@ -152,4 +152,4 @@ observations: flag: BayBgCheckReject - name: reject test: - reference filename: testoutput/test_hofx_nc_ice.ref + reference filename: testoutput/test_hofx_nc_sic.ref diff --git a/src/tests/testinput/hofx_nc_ssh_amm1.yaml b/src/tests/testinput/hofx_nc_ssh_amm1.yaml index 7d73d6e..10f3d01 100644 --- a/src/tests/testinput/hofx_nc_ssh_amm1.yaml +++ b/src/tests/testinput/hofx_nc_ssh_amm1.yaml @@ -43,7 +43,7 @@ observations: obsdatain: engine: type: H5File - obsfile: Data/amm_ssh_obs.nc + obsfile: Data/hofx_ssh_amm_obs.nc obsdataout: engine: type: H5File diff --git a/src/tests/testinput/hofx_odb_ice.yaml b/src/tests/testinput/hofx_odb_sic.yaml similarity index 96% rename from src/tests/testinput/hofx_odb_ice.yaml rename to src/tests/testinput/hofx_odb_sic.yaml index a2ddbbf..b45a286 100644 --- a/src/tests/testinput/hofx_odb_ice.yaml +++ b/src/tests/testinput/hofx_odb_sic.yaml @@ -50,9 +50,9 @@ observations: obsdatain: engine: type: ODB - obsfile: orca-jedi/src/tests/Data/ostia_seaice_obs.odb - mapping file: orca-jedi/src/tests/testinput/odb_ice_mapping.yaml - query file: orca-jedi/src/tests/testinput/odb_ice_query.yaml + obsfile: orca-jedi/src/tests/Data/hofx_sic_ostia_obs.odb + mapping file: orca-jedi/src/tests/testinput/odb_sic_mapping.yaml + query file: orca-jedi/src/tests/testinput/odb_sic_query.yaml obsdataout: engine: type: H5File diff --git a/src/tests/testinput/odb_ice_mapping.yaml b/src/tests/testinput/odb_sic_mapping.yaml similarity index 100% rename from src/tests/testinput/odb_ice_mapping.yaml rename to src/tests/testinput/odb_sic_mapping.yaml diff --git a/src/tests/testinput/odb_ice_query.yaml b/src/tests/testinput/odb_sic_query.yaml similarity index 100% rename from src/tests/testinput/odb_ice_query.yaml rename to src/tests/testinput/odb_sic_query.yaml diff --git a/src/tests/testoutput/CMakeLists.txt b/src/tests/testoutput/CMakeLists.txt index 0a7e576..2ecd402 100644 --- a/src/tests/testoutput/CMakeLists.txt +++ b/src/tests/testoutput/CMakeLists.txt @@ -1,12 +1,12 @@ list( APPEND orcajedi_test_output - test_ostia_seaice_obs_hofx3d.ref - test_hofx_nc_ice.ref + test_hofx_nc_sic.ref test_hofx_nc_sst.ref test_hofx_nc_ssh.ref test_hofx_nc_ssh_eorca025.ref test_hofx_nc_ssh_amm1.ref test_hofx_nc_potm_amm1r.ref + test_hofx3d_nc_sic.ref test_hofx3d_nc_sst.ref test_hofx3d_nc_potm.ref test_hofx3d_nc_prof_2vars.ref diff --git a/src/tests/testoutput/test_ostia_seaice_obs_hofx3d.ref b/src/tests/testoutput/test_hofx3d_nc_sic.ref similarity index 100% rename from src/tests/testoutput/test_ostia_seaice_obs_hofx3d.ref rename to src/tests/testoutput/test_hofx3d_nc_sic.ref diff --git a/src/tests/testoutput/test_hofx_nc_ice.ref b/src/tests/testoutput/test_hofx_nc_sic.ref similarity index 100% rename from src/tests/testoutput/test_hofx_nc_ice.ref rename to src/tests/testoutput/test_hofx_nc_sic.ref