From be21fd613219b283e5a1bf972ef7336a8fa19ef1 Mon Sep 17 00:00:00 2001 From: John Halley Gotway Date: Wed, 18 Jan 2023 15:52:10 -0700 Subject: [PATCH 1/9] Per #2412, add functions to compare 2 unixtimes and compute the seconds of day difference and seconds of year difference. --- src/basic/vx_cal/doyhms_to_unix.cc | 58 ++++++++++++++++++++++++++++++ src/basic/vx_cal/vx_cal.h | 10 ++++++ 2 files changed, 68 insertions(+) diff --git a/src/basic/vx_cal/doyhms_to_unix.cc b/src/basic/vx_cal/doyhms_to_unix.cc index 8c03137841..3da2ffcccd 100644 --- a/src/basic/vx_cal/doyhms_to_unix.cc +++ b/src/basic/vx_cal/doyhms_to_unix.cc @@ -97,8 +97,23 @@ return ( s ); } + +//////////////////////////////////////////////////////////////////////// + +int unix_to_sec_of_year(unixtime u) { + +int mon, day, yr, hr, min, sec; + +unix_to_mdyhms(u, mon, day, yr, hr, min, sec); + +return ( (int) mdyhms_to_unix(mon, day, 1970, hr, min, sec) ); + +} + + //////////////////////////////////////////////////////////////////////// + long unix_to_long_yyyymmddhh(unixtime u) { int mon, day, yr, hr, min, sec; @@ -112,4 +127,47 @@ return ( yyyymmddhh ); } + +//////////////////////////////////////////////////////////////////////// + + +int sec_of_day_diff(unixtime ut1, unixtime ut2) { + +int sec_per_day = 60 * 60 * 24; + +int s1 = unix_to_sec_of_day(ut1); + +int s2 = unix_to_sec_of_day(ut2); + +int ds = s2 - s1; + + if ( ds < -1 * sec_per_day/2 ) ds += sec_per_day; +else if ( ds > sec_per_day/2 ) ds -= sec_per_day; + +return ( ds ); + +} + + +//////////////////////////////////////////////////////////////////////// + + +int sec_of_year_diff(unixtime ut1, unixtime ut2) { + +int sec_per_year = 60 * 60 * 24 * 365; + +int s1 = unix_to_sec_of_year(ut1); + +int s2 = unix_to_sec_of_year(ut2); + +int ds = s2 - s1; + + if ( ds < -1 * sec_per_year/2 ) ds += sec_per_year; +else if ( ds > sec_per_year/2 ) ds -= sec_per_year; + +return ( ds ); + +} + + //////////////////////////////////////////////////////////////////////// diff --git a/src/basic/vx_cal/vx_cal.h b/src/basic/vx_cal/vx_cal.h index b06b6fc7fe..ddddd9576e 100644 --- a/src/basic/vx_cal/vx_cal.h +++ b/src/basic/vx_cal/vx_cal.h @@ -81,6 +81,8 @@ extern int hms_to_sec (int hour, int min, int sec); extern int unix_to_sec_of_day (unixtime u); +extern int unix_to_sec_of_year (unixtime u); + extern long unix_to_long_yyyymmddhh (unixtime u); // Parse time strings @@ -128,6 +130,14 @@ extern ConcatString sec_to_timestring(int); //////////////////////////////////////////////////////////////////////// +extern int sec_of_day_diff (unixtime ut1, unixtime ut2); + +extern int sec_of_year_diff (unixtime ut1, unixtime ut2); + + +//////////////////////////////////////////////////////////////////////// + + extern bool is_datestring(const char * text); extern bool is_yyyymmdd(const char * text); From d3ea512e768fa181a10084628bdb3bb8cae9a2db Mon Sep 17 00:00:00 2001 From: John Halley Gotway Date: Wed, 18 Jan 2023 15:57:00 -0700 Subject: [PATCH 2/9] Per #2412, overhaul the logic in the read_climo_file() function to fix the year wrapping bug. --- src/libcode/vx_statistics/read_climo.cc | 96 ++++++++----------------- 1 file changed, 31 insertions(+), 65 deletions(-) diff --git a/src/libcode/vx_statistics/read_climo.cc b/src/libcode/vx_statistics/read_climo.cc index cb6a0efb17..4fc7a3eec2 100644 --- a/src/libcode/vx_statistics/read_climo.cc +++ b/src/libcode/vx_statistics/read_climo.cc @@ -150,21 +150,19 @@ void read_climo_file(const char *climo_file, GrdFileType ctype, int day_ts, int hour_ts, const Grid &vx_grid, const RegridInfo ®rid_info, DataPlaneArray &dpa) { + Met2dDataFileFactory mtddf_factory; Met2dDataFile *mtddf = (Met2dDataFile *) 0; VarInfoFactory info_factory; VarInfo *info = (VarInfo *) 0; - DataPlaneArray cur_dpa; + DataPlaneArray clm_dpa; DataPlane dp; - int n_climo, i; - int vld_mon, vld_day, vld_yr, vld_hr, vld_min, vld_sec; - int clm_mon, clm_day, clm_yr, clm_hr, clm_min, clm_sec; - unixtime ut; + int n_clm, i, dsec_of_day, dsec_of_year; - ConcatString cur_ut_cs; + ConcatString clm_ut_cs; // Allocate memory for data file if(!(mtddf = mtddf_factory.new_met_2d_data_file(climo_file, ctype))) { @@ -179,94 +177,62 @@ void read_climo_file(const char *climo_file, GrdFileType ctype, info->set_dict(*dict); // Read data planes - n_climo = mtddf->data_plane_array(*info, cur_dpa); - - // Compute the valid month and day - unix_to_mdyhms(vld_ut, vld_mon, vld_day, vld_yr, - vld_hr, vld_min, vld_sec); + n_clm = mtddf->data_plane_array(*info, clm_dpa); // Loop through matching records - for(i=0; i= hour_ts) { - mlog << Debug(3) << "Skipping the " << cur_ut_cs << " \"" + // Check the hour time step + if(!is_bad_data(hour_ts) && abs(dsec_of_day) >= hour_ts) { + mlog << Debug(3) << "Skipping the " << clm_ut_cs << " \"" << info->magic_str() << "\" climatology field since the time offset (" - << labs(ut - vld_ut) - << " seconds) >= the \"" << conf_key_hour_interval + << abs(dsec_of_day) << " seconds) >= the \"" << conf_key_hour_interval << "\" entry (" << hour_ts << " seconds) from file: " << climo_file << "\n"; continue; } - // Recompute the unixtime to check the day of the year. - // Use the valid YYYY and climo MMDD_HHMMSS. - ut = mdyhms_to_unix(clm_mon, clm_day, vld_yr, - clm_hr, clm_min, clm_sec); - - // Check the day time step. - if(!is_bad_data(day_ts)) { - - // For daily climatology, check the hour timestep. - if(day_ts <= 3600*24 && labs(ut - vld_ut) >= hour_ts) { - mlog << Debug(3) << "Skipping the " << cur_ut_cs << " \"" - << info->magic_str() - << "\" climatology field since the time offset (" - << labs(ut - vld_ut) << " seconds) >= the \"" - << conf_key_hour_interval << "\" entry (" << hour_ts - << " seconds) from daily climatology file: " - << climo_file << "\n"; - continue; - } - // For non-daily climatology, check the day timestep. - else if(labs(ut - vld_ut) >= day_ts) { - mlog << Debug(3) << "Skipping the " << cur_ut_cs << " \"" - << info->magic_str() - << "\" climatology field since the time offset (" - << labs(ut - vld_ut) << " seconds) >= the \"" - << conf_key_day_interval << "\" entry (" << day_ts - << " seconds) from file: " << climo_file << "\n"; - continue; - } + // Check the day time step + if(!is_bad_data(day_ts) && abs(dsec_of_year) >= day_ts) { + mlog << Debug(3) << "Skipping the " << clm_ut_cs << " \"" + << info->magic_str() + << "\" climatology field since the time offset (" + << abs(dsec_of_year) << " seconds) >= the \"" + << conf_key_day_interval << "\" entry (" << day_ts + << " seconds) from file: " << climo_file << "\n"; + continue; } // Print log message for matching record - mlog << Debug(4) - << "Found matching " << cur_ut_cs << " \"" + mlog << Debug(4) << "Found matching " << clm_ut_cs << " \"" << info->magic_str() << "\" climatology field in file \"" << climo_file << "\".\n"; // Regrid, if needed if(!(mtddf->grid() == vx_grid)) { - mlog << Debug(2) - << "Regridding the " << cur_ut_cs << " \"" + mlog << Debug(2) << "Regridding the " << clm_ut_cs << " \"" << info->magic_str() << "\" climatology field to the verification grid.\n"; - dp = met_regrid(cur_dpa[i], mtddf->grid(), vx_grid, + dp = met_regrid(clm_dpa[i], mtddf->grid(), vx_grid, regrid_info); } else { - dp = cur_dpa[i]; + dp = clm_dpa[i]; } - // Set the climo time as valid YYYY and climo MMDD_HHMMSS. - dp.set_valid(ut); + // Set the climo time relative to the valid time + dp.set_valid(vld_ut + dsec_of_year); // Store the match - dpa.add(dp, cur_dpa.lower(i), cur_dpa.upper(i)); + dpa.add(dp, clm_dpa.lower(i), clm_dpa.upper(i)); } // end for i From de4aca799f461457d4a55a9a7c6cf17aececc412 Mon Sep 17 00:00:00 2001 From: John Halley Gotway Date: Wed, 18 Jan 2023 17:46:41 -0700 Subject: [PATCH 3/9] Per #2142, ci-run-unit refine climo log messages to list time offsets in hours and days instead of seconds. --- src/libcode/vx_statistics/read_climo.cc | 29 +++++++++++++------------ 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/src/libcode/vx_statistics/read_climo.cc b/src/libcode/vx_statistics/read_climo.cc index 4fc7a3eec2..514b1b108f 100644 --- a/src/libcode/vx_statistics/read_climo.cc +++ b/src/libcode/vx_statistics/read_climo.cc @@ -191,34 +191,35 @@ void read_climo_file(const char *climo_file, GrdFileType ctype, // Check the hour time step if(!is_bad_data(hour_ts) && abs(dsec_of_day) >= hour_ts) { - mlog << Debug(3) << "Skipping the " << clm_ut_cs << " \"" - << info->magic_str() - << "\" climatology field since the time offset (" - << abs(dsec_of_day) << " seconds) >= the \"" << conf_key_hour_interval - << "\" entry (" << hour_ts << " seconds) from file: " + mlog << Debug(3) << "Skipping " << clm_ut_cs << " \"" << info->magic_str() + << "\" climatology field with \"" << conf_key_hour_interval + << "\" offset (" << abs(dsec_of_day) / (double) sec_per_hour + << " >= " << hour_ts / (double) sec_per_hour << " hours) in file: " << climo_file << "\n"; continue; } // Check the day time step if(!is_bad_data(day_ts) && abs(dsec_of_year) >= day_ts) { - mlog << Debug(3) << "Skipping the " << clm_ut_cs << " \"" - << info->magic_str() - << "\" climatology field since the time offset (" - << abs(dsec_of_year) << " seconds) >= the \"" - << conf_key_day_interval << "\" entry (" << day_ts - << " seconds) from file: " << climo_file << "\n"; + mlog << Debug(3) << "Skipping " << clm_ut_cs << " \"" << info->magic_str() + << "\" climatology field with \"" << conf_key_day_interval + << "\" offset (" << abs(dsec_of_year) / (double) sec_per_day + << " >= " << day_ts / (double) sec_per_day << " days) in file: " + << climo_file << "\n"; continue; } // Print log message for matching record - mlog << Debug(4) << "Found matching " << clm_ut_cs << " \"" - << info->magic_str() << "\" climatology field in file \"" + mlog << Debug(3) << "Matching " << clm_ut_cs << " \"" << info->magic_str() + << "\" climatology field with \"" << conf_key_hour_interval << "\" offset (" + << abs(dsec_of_day) / (double) sec_per_hour << " hours) and \"" + << conf_key_day_interval << "\" offset (" + << abs(dsec_of_year) / (double) sec_per_day << " days) in file: " << climo_file << "\".\n"; // Regrid, if needed if(!(mtddf->grid() == vx_grid)) { - mlog << Debug(2) << "Regridding the " << clm_ut_cs << " \"" + mlog << Debug(2) << "Regridding " << clm_ut_cs << " \"" << info->magic_str() << "\" climatology field to the verification grid.\n"; dp = met_regrid(clm_dpa[i], mtddf->grid(), vx_grid, From b271c5d4b6add5392724eda12b5993cf8e594165 Mon Sep 17 00:00:00 2001 From: MET Tools Test Account Date: Thu, 19 Jan 2023 09:00:06 -0700 Subject: [PATCH 4/9] Per #2142, testing interpolation for the date 20220214_12 revealed another bug. With day_interval = 31, it find climo data for Jan 15, Feb 15, and Mar 15. The climo_hms_interp() function is smart enough to correctly interpolate between Jan 15 and Feb 15 and ignore Mar 15. However, there was a bug in the computation of the target valid time. --- src/libcode/vx_statistics/read_climo.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libcode/vx_statistics/read_climo.cc b/src/libcode/vx_statistics/read_climo.cc index 514b1b108f..e1a67cac77 100644 --- a/src/libcode/vx_statistics/read_climo.cc +++ b/src/libcode/vx_statistics/read_climo.cc @@ -343,7 +343,7 @@ DataPlaneArray climo_time_interp(const DataPlaneArray &dpa, int day_ts, // For equality, do a single time interpolation. if(prv_hms == nxt_hms) { - ut = (vld_ut / sec_per_day) + prv_hms; + ut = (vld_ut / sec_per_day)*sec_per_day + prv_hms; interp_dpa.add(climo_hms_interp( dpa, it->second, ut, mthd), dpa.lower(it->second[0]), From c2a998448c80f6bfcdd3524f2420df0db90cf573 Mon Sep 17 00:00:00 2001 From: MET Tools Test Account Date: Thu, 19 Jan 2023 12:01:01 -0700 Subject: [PATCH 5/9] Per #2412, fix typo in error message changing \t to \n. --- src/basic/vx_util/interp_util.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/basic/vx_util/interp_util.cc b/src/basic/vx_util/interp_util.cc index bdaf7a573d..1e69e154d7 100644 --- a/src/basic/vx_util/interp_util.cc +++ b/src/basic/vx_util/interp_util.cc @@ -1287,7 +1287,7 @@ DataPlane valid_time_interp(const DataPlane &in1, const DataPlane &in2, // Range check the times if(dp1.valid() > to_ut || dp2.valid() < to_ut || dp1.valid() == dp2.valid()) { - mlog << Error << "\time_interp() -> " + mlog << Error << "\ntime_interp() -> " << "the interpolation time " << unix_to_yyyymmdd_hhmmss(to_ut) << " must fall between the input times: " << unix_to_yyyymmdd_hhmmss(dp1.valid()) << " and " From 36f3ffa1b7823b23c17fec3cd448acc520ecc198 Mon Sep 17 00:00:00 2001 From: MET Tools Test Account Date: Thu, 19 Jan 2023 13:10:58 -0700 Subject: [PATCH 6/9] Per #2412, update logic in valid_time_interp() function. If the two inputs have the same valid time, just return the first field rather than erorring out. --- src/basic/vx_util/interp_util.cc | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/basic/vx_util/interp_util.cc b/src/basic/vx_util/interp_util.cc index 1e69e154d7..b123e972ce 100644 --- a/src/basic/vx_util/interp_util.cc +++ b/src/basic/vx_util/interp_util.cc @@ -1280,13 +1280,15 @@ DataPlane valid_time_interp(const DataPlane &in1, const DataPlane &in2, double w1 = bad_data_double; double w2 = bad_data_double; - // Store min and max valid times. + // Store min and max valid times dp1 = (in1.valid() <= in2.valid() ? in1 : in2); dp2 = (in1.valid() > in2.valid() ? in1 : in2); + // Check for matching valid times + if(dp1.valid() == dp2.valid()) return(dp1); + // Range check the times - if(dp1.valid() > to_ut || dp2.valid() < to_ut || - dp1.valid() == dp2.valid()) { + if(dp1.valid() > to_ut || dp2.valid() < to_ut) { mlog << Error << "\ntime_interp() -> " << "the interpolation time " << unix_to_yyyymmdd_hhmmss(to_ut) << " must fall between the input times: " From cbfffba06a64d0a62df6729f6054a5c8c38fa992 Mon Sep 17 00:00:00 2001 From: John Halley Gotway Date: Fri, 20 Jan 2023 12:43:07 -0700 Subject: [PATCH 7/9] Per #2412, switch from using sec_of_year_diff() to day_of_year_diff(). --- src/basic/vx_cal/doyhms_to_unix.cc | 35 ++++++++++++++++++------------ src/basic/vx_cal/vx_cal.h | 4 ++-- 2 files changed, 23 insertions(+), 16 deletions(-) diff --git a/src/basic/vx_cal/doyhms_to_unix.cc b/src/basic/vx_cal/doyhms_to_unix.cc index 3da2ffcccd..2c130131bb 100644 --- a/src/basic/vx_cal/doyhms_to_unix.cc +++ b/src/basic/vx_cal/doyhms_to_unix.cc @@ -100,13 +100,18 @@ return ( s ); //////////////////////////////////////////////////////////////////////// -int unix_to_sec_of_year(unixtime u) { + +int unix_to_day_of_year(unixtime u) { int mon, day, yr, hr, min, sec; unix_to_mdyhms(u, mon, day, yr, hr, min, sec); -return ( (int) mdyhms_to_unix(mon, day, 1970, hr, min, sec) ); +int sec_of_year = mdyhms_to_unix(mon, day, 1970, 0, 0, 0); + +int sec_per_day = 60 * 60 * 24; + +return ( sec_of_year / sec_per_day ); } @@ -139,12 +144,12 @@ int s1 = unix_to_sec_of_day(ut1); int s2 = unix_to_sec_of_day(ut2); -int ds = s2 - s1; +int dt = s2 - s1; - if ( ds < -1 * sec_per_day/2 ) ds += sec_per_day; -else if ( ds > sec_per_day/2 ) ds -= sec_per_day; + if ( dt < -1 * sec_per_day/2 ) dt += sec_per_day; +else if ( dt > sec_per_day/2 ) dt -= sec_per_day; -return ( ds ); +return ( dt ); } @@ -152,20 +157,22 @@ return ( ds ); //////////////////////////////////////////////////////////////////////// -int sec_of_year_diff(unixtime ut1, unixtime ut2) { +int day_of_year_diff(unixtime ut1, unixtime ut2) { + -int sec_per_year = 60 * 60 * 24 * 365; +int sec_per_day = 60 * 60 * 24; +int day_per_year = 365; -int s1 = unix_to_sec_of_year(ut1); +int d1 = unix_to_day_of_year(ut1); -int s2 = unix_to_sec_of_year(ut2); +int d2 = unix_to_day_of_year(ut2); -int ds = s2 - s1; +int dt = d2 - d1; - if ( ds < -1 * sec_per_year/2 ) ds += sec_per_year; -else if ( ds > sec_per_year/2 ) ds -= sec_per_year; + if ( dt < -1 * day_per_year/2.0 ) dt += day_per_year; +else if ( dt > day_per_year/2.0 ) dt -= day_per_year; -return ( ds ); +return ( dt ); } diff --git a/src/basic/vx_cal/vx_cal.h b/src/basic/vx_cal/vx_cal.h index ddddd9576e..74353e1e91 100644 --- a/src/basic/vx_cal/vx_cal.h +++ b/src/basic/vx_cal/vx_cal.h @@ -81,7 +81,7 @@ extern int hms_to_sec (int hour, int min, int sec); extern int unix_to_sec_of_day (unixtime u); -extern int unix_to_sec_of_year (unixtime u); +extern int unix_to_day_of_year (unixtime u); extern long unix_to_long_yyyymmddhh (unixtime u); @@ -132,7 +132,7 @@ extern ConcatString sec_to_timestring(int); extern int sec_of_day_diff (unixtime ut1, unixtime ut2); -extern int sec_of_year_diff (unixtime ut1, unixtime ut2); +extern int day_of_year_diff (unixtime ut1, unixtime ut2); //////////////////////////////////////////////////////////////////////// From 0549f2f18d7e15025173efe330fa73660ca13062 Mon Sep 17 00:00:00 2001 From: John Halley Gotway Date: Sun, 22 Jan 2023 12:33:00 -0700 Subject: [PATCH 8/9] Per #2412 ci-run-unit check the day offset before the hour offset to make the log messages a bit more intuitive. --- src/libcode/vx_statistics/read_climo.cc | 48 +++++++++++++------------ 1 file changed, 25 insertions(+), 23 deletions(-) diff --git a/src/libcode/vx_statistics/read_climo.cc b/src/libcode/vx_statistics/read_climo.cc index e1a67cac77..142833337f 100644 --- a/src/libcode/vx_statistics/read_climo.cc +++ b/src/libcode/vx_statistics/read_climo.cc @@ -160,7 +160,7 @@ void read_climo_file(const char *climo_file, GrdFileType ctype, DataPlaneArray clm_dpa; DataPlane dp; - int n_clm, i, dsec_of_day, dsec_of_year; + int i, n_clm, day_diff_sec, hms_diff_sec; ConcatString clm_ut_cs; @@ -185,37 +185,39 @@ void read_climo_file(const char *climo_file, GrdFileType ctype, // Store climo time string clm_ut_cs = unix_to_yyyymmdd_hhmmss(clm_dpa[i].valid()); - // Compute hour and day time offsets - dsec_of_day = sec_of_day_diff (vld_ut, clm_dpa[i].valid()); - dsec_of_year = sec_of_year_diff(vld_ut, clm_dpa[i].valid()); + // Compute day and hour time offsets in seconds + day_diff_sec = day_of_year_diff(vld_ut, clm_dpa[i].valid()) * sec_per_day; + hms_diff_sec = sec_of_day_diff (vld_ut, clm_dpa[i].valid()); - // Check the hour time step - if(!is_bad_data(hour_ts) && abs(dsec_of_day) >= hour_ts) { + // Check the day time step + if(!is_bad_data(day_ts) && abs(day_diff_sec) >= day_ts) { mlog << Debug(3) << "Skipping " << clm_ut_cs << " \"" << info->magic_str() - << "\" climatology field with \"" << conf_key_hour_interval - << "\" offset (" << abs(dsec_of_day) / (double) sec_per_hour - << " >= " << hour_ts / (double) sec_per_hour << " hours) in file: " - << climo_file << "\n"; + << "\" climatology field with " << day_diff_sec / sec_per_day + << " day offset (" << conf_key_day_interval << " = " + << day_ts / sec_per_day << ") from file \"" + << climo_file << "\".\n"; continue; } - // Check the day time step - if(!is_bad_data(day_ts) && abs(dsec_of_year) >= day_ts) { + // Check the hour time step + if(!is_bad_data(hour_ts) && abs(hms_diff_sec) >= hour_ts) { mlog << Debug(3) << "Skipping " << clm_ut_cs << " \"" << info->magic_str() - << "\" climatology field with \"" << conf_key_day_interval - << "\" offset (" << abs(dsec_of_year) / (double) sec_per_day - << " >= " << day_ts / (double) sec_per_day << " days) in file: " - << climo_file << "\n"; + << "\" climatology field with " << (double) hms_diff_sec / sec_per_hour + << " hour offset (" << conf_key_hour_interval << " = " + << hour_ts / sec_per_hour << ") from file \"" + << climo_file << "\".\n"; continue; } + // Compute climo timestamp relative to the valid time + unixtime clm_vld_ut = vld_ut + day_diff_sec + hms_diff_sec; + // Print log message for matching record - mlog << Debug(3) << "Matching " << clm_ut_cs << " \"" << info->magic_str() - << "\" climatology field with \"" << conf_key_hour_interval << "\" offset (" - << abs(dsec_of_day) / (double) sec_per_hour << " hours) and \"" - << conf_key_day_interval << "\" offset (" - << abs(dsec_of_year) / (double) sec_per_day << " days) in file: " - << climo_file << "\".\n"; + mlog << Debug(3) << "Storing " << clm_ut_cs << " \"" << info->magic_str() + << "\" climatology field with " << day_diff_sec / sec_per_day + << " day, " << (double) hms_diff_sec / sec_per_hour << " hour offset as time " + << unix_to_yyyymmdd_hhmmss(clm_vld_ut) << " from file \"" + << climo_file << "\".\n"; // Regrid, if needed if(!(mtddf->grid() == vx_grid)) { @@ -230,7 +232,7 @@ void read_climo_file(const char *climo_file, GrdFileType ctype, } // Set the climo time relative to the valid time - dp.set_valid(vld_ut + dsec_of_year); + dp.set_valid(clm_vld_ut); // Store the match dpa.add(dp, clm_dpa.lower(i), clm_dpa.upper(i)); From 9e056e391ebbec181487976b6881c4c03668ac32 Mon Sep 17 00:00:00 2001 From: John Halley Gotway Date: Tue, 24 Jan 2023 11:11:06 -0700 Subject: [PATCH 9/9] Per #2412, unrelated to this issue but adding the -j option to the make commands in build_met_docker.sh. This should improve the speed of compilation job in GitHub actions. Using 'make -j install' improves the compilation time from 8m40s to 2m58s. So definitely worth trying! --- internal/scripts/docker/build_met_docker.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/scripts/docker/build_met_docker.sh b/internal/scripts/docker/build_met_docker.sh index 3e900f3a90..873df8e0aa 100755 --- a/internal/scripts/docker/build_met_docker.sh +++ b/internal/scripts/docker/build_met_docker.sh @@ -15,14 +15,14 @@ fi LOG_FILE=/met/MET-${MET_GIT_NAME}/make_install.log echo "Compiling MET ${MET_GIT_NAME} and writing log file ${LOG_FILE}" -make install > ${LOG_FILE} +make -j install > ${LOG_FILE} if [ $? != 0 ]; then exit 1 fi LOG_FILE=/met/logs/MET-${MET_GIT_NAME}_make_test.log echo "Testing MET ${MET_GIT_NAME} and writing log file ${LOG_FILE}" -make test > ${LOG_FILE} 2>&1 +make -j test > ${LOG_FILE} 2>&1 if [ $? != 0 ]; then exit 1 fi