Skip to content

Commit

Permalink
EAMxx: fix nc file names in some standalone tests
Browse files Browse the repository at this point in the history
  • Loading branch information
bartgol committed Oct 3, 2024
1 parent 51b4bf2 commit c991060
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ TEST_CASE("nudging_tests") {
const int nlevs_fine = 2*nlevs_data -1;

// Files names
auto postfix = ".INSTANT.nsteps_x1." + get_t0().to_string() + ".nc";
auto postfix = ".INSTANT.nsteps_x1.np*." + get_t0().to_string() + ".nc";
auto nudging_data = "nudging_data" + postfix;
auto nudging_data_filled = "nudging_data_filled" + postfix;
auto map_file = "map_ncol" + std::to_string(ngcols_data)
Expand Down
8 changes: 5 additions & 3 deletions components/eamxx/src/share/io/tests/io_utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,10 @@ TEST_CASE ("find_filename_in_rpointer") {
bar_c.frequency = 1; bar_c.frequency_units = "ndays";
bar2_c.frequency = 6; bar2_c.frequency_units = "nhours";

std::string foo_fname = "foo.r.INSTANT.nsteps_x3." + t0.to_string() + ".nc";
std::string bar_fname = "bar.rhist.AVERAGE.ndays_x1." + t0.to_string() + ".nc";
std::string bar2_fname = "bar.rhist.AVERAGE.nhours_x6." + t0.to_string() + ".nc";
std::string suffix = ".np" + std::to_string(comm.size()) + "." + t0.to_string() + ".nc";
std::string foo_fname = "foo.r.INSTANT.nsteps_x3" + suffix;
std::string bar_fname = "bar.rhist.AVERAGE.ndays_x1" + suffix;
std::string bar2_fname = "bar.rhist.AVERAGE.nhours_x6" + suffix;

rpointer << foo_fname<< "\n";
rpointer << bar_fname<< "\n";
Expand All @@ -44,6 +45,7 @@ TEST_CASE ("find_filename_in_rpointer") {
REQUIRE_THROWS (find_filename_in_rpointer("foo",false,comm,t0,INST,foo_c)); // foo is model restart
REQUIRE_THROWS (find_filename_in_rpointer("foo",true,comm,t0,AVG)); // model restart MUST be INSTANT

auto test = find_filename_in_rpointer("bar",false,comm,t0,AVG,bar_c);
REQUIRE (find_filename_in_rpointer("bar",false,comm,t0,AVG,bar_c)==bar_fname);
REQUIRE (find_filename_in_rpointer("bar",false,comm,t0,AVG,bar2_c)==bar2_fname);
REQUIRE (find_filename_in_rpointer("foo",true, comm,t0)==foo_fname);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ atmosphere_processes:
p3:
max_total_ni: 720.0e3
nudging:
nudging_filenames_patterns: [shoc_p3_source_data_${POSTFIX}.INSTANT.nsteps_x${NUM_STEPS}.${RUN_T0}.nc]
nudging_filenames_patterns: [shoc_p3_source_data_${POSTFIX}.INSTANT.nsteps_x${NUM_STEPS}.np1.${RUN_T0}.nc]
nudging_fields: ["T_mid", "qv"]
nudging_timescale: 1000
use_nudging_weights: true
Expand Down

0 comments on commit c991060

Please sign in to comment.