From 580ed05b8d753c408d3e99e194efe8788480c4cc Mon Sep 17 00:00:00 2001 From: akrherz Date: Wed, 6 Nov 2024 12:55:34 -0600 Subject: [PATCH 1/5] =?UTF-8?q?=F0=9F=93=9D=20Workarounds=20needed=20for?= =?UTF-8?q?=20scenario=20170?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/import/flowpath_importer.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/scripts/import/flowpath_importer.py b/scripts/import/flowpath_importer.py index 66f4ae0b..680ab409 100644 --- a/scripts/import/flowpath_importer.py +++ b/scripts/import/flowpath_importer.py @@ -37,6 +37,7 @@ MAX_POINTS_OFE = 97 GENLU_CODES = {} PROCESSING_COUNTS = { + "flowpaths_found": 0, "flowpaths_good": 0, "flowpaths_deduped": 0, "flowpaths_tooshort": 0, @@ -103,6 +104,8 @@ def get_data(filename): if HUC12RE.match(col): huc12 = col[len(PREFIX) : (len(PREFIX) + 12)] break + # Count up unique flowpaths + PROCESSING_COUNTS["flowpaths_found"] += len(df[f"fp{huc12}"].unique()) if "irrigated" not in df.columns: LOG.info("%s had no irrigated column", filename) @@ -134,6 +137,11 @@ def get_data(filename): fld_df = gpd.read_file(fldfn, engine="pyogrio").drop( columns=["OBJECTID"], ) + if "CropRotatn" in fld_df.columns: + LOG.info("Field_df renaming CropRotatn to CropRotatn_CY_2022") + fld_df = fld_df.rename( + columns={"CropRotatn": "CropRotatn_CY_2022"} + ) fld_df.index = fld_df["FBndID"].str.split("_").str[1].astype(int) # Placeholder for capturing database insert fld_df["field_id"] = -1 From e14e152d12d5302b06d3663cbcbf11ac2beb072a Mon Sep 17 00:00:00 2001 From: akrherz Date: Wed, 6 Nov 2024 12:55:58 -0600 Subject: [PATCH 2/5] =?UTF-8?q?=E2=AC=86=EF=B8=8F=20Update=20ruff?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 2fee6138..ee630d30 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,6 @@ repos: - repo: https://github.com/astral-sh/ruff-pre-commit - rev: "v0.6.9" + rev: "v0.7.2" hooks: - id: ruff args: [--fix, --exit-non-zero-on-fix] From 850659c148f1f7e1541fa0c11edfe88c38ba28b4 Mon Sep 17 00:00:00 2001 From: akrherz Date: Wed, 6 Nov 2024 12:59:51 -0600 Subject: [PATCH 3/5] =?UTF-8?q?=E2=9C=8F=EF=B8=8F=20Update=20s/ifort/ifx/?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build.yml | 6 +++--- src/wepp2010.1/makefile | 4 ++-- src/wepp2012-src/Makefile | 4 ++-- src/wepp20230117/Makefile | 4 ++-- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 564d10aa..28eca30b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -12,7 +12,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - FC: ["ifort", "gfortran"] + FC: ["ifx", "gfortran"] steps: - uses: actions/checkout@v4 @@ -29,7 +29,7 @@ jobs: make FC=gfortran - name: Install Intel Compiler - if: ${{ matrix.FC == 'ifort' }} + if: ${{ matrix.FC == 'ifx' }} run: | wget https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB sudo apt-key add GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB @@ -39,7 +39,7 @@ jobs: sudo apt-get install -y intel-oneapi-compiler-fortran - name: Build WEPP with Intel - if: ${{ matrix.FC == 'ifort' }} + if: ${{ matrix.FC == 'ifx' }} run: | source /opt/intel/oneapi/setvars.sh cd src/wepp20230117 diff --git a/src/wepp2010.1/makefile b/src/wepp2010.1/makefile index 38a28093..843f6351 100644 --- a/src/wepp2010.1/makefile +++ b/src/wepp2010.1/makefile @@ -2,7 +2,7 @@ # # makefile for solaris 8 wepp executable. # -FC_IF = ifort +FC_IF = ifx FC_G95 = g95 FC_GNU = gfortran FC_2 = f2c @@ -10,7 +10,7 @@ FFLAGS_IFORT = -mno-avx -mno-avx2 -c -autodouble -O -align dcommons FFLAGS_G95 = -c -Wall -r8 -malign-double -O3 -march=pentium4 FFLAGS_GNU = -c -fdefault-real-8 -Wall -malign-double -O2 FFLAGS_2 = -c -r -LINK_IF = ifort +LINK_IF = ifx LINK_G95 = g++ LINK_GNU = gfortran LINK_2 = g++ diff --git a/src/wepp2012-src/Makefile b/src/wepp2012-src/Makefile index cf2f06aa..ed47d2bd 100644 --- a/src/wepp2012-src/Makefile +++ b/src/wepp2012-src/Makefile @@ -3,7 +3,7 @@ # makefile for solaris 8 wepp executable. # -FC_IF = ifort +FC_IF = ifx FC_G95 = g95 FC_GNU = gfortran FC_2 = f2c @@ -12,7 +12,7 @@ FFLAGS_G95 = -c -Wall -malign-double -O3 -march=pentium4 FFLAGS_G95 = -c -Wall -malign-double -O3 -i4 FFLAGS_GNU = -c -fdefault-real-8 -Wall -malign-double -O2 FFLAGS_2 = -c -r -LINK_IF = ifort +LINK_IF = ifx LINK_G95 = g++ LINK_GNU = gfortran LINK_2 = g++ diff --git a/src/wepp20230117/Makefile b/src/wepp20230117/Makefile index 186e3730..30e0dbb9 100644 --- a/src/wepp20230117/Makefile +++ b/src/wepp20230117/Makefile @@ -3,7 +3,7 @@ # makefile for solaris 8 wepp executable. # -FC_IF = ifort +FC_IF = ifx FC_G95 = g95 FC_GNU = gfortran FC_2 = f2c @@ -12,7 +12,7 @@ FFLAGS_G95 = -c -Wall -malign-double -O3 -march=pentium4 FFLAGS_G95 = -c -Wall -malign-double -O3 -i4 FFLAGS_GNU = -c -fdefault-real-8 -Wall -malign-double -O2 FFLAGS_2 = -c -r -LINK_IF = ifort +LINK_IF = ifx LINK_G95 = g++ LINK_GNU = gfortran LINK_2 = g++ From 21a7a7060a356fcb73efff20dcae74b7330b07d4 Mon Sep 17 00:00:00 2001 From: akrherz Date: Wed, 6 Nov 2024 13:05:55 -0600 Subject: [PATCH 4/5] =?UTF-8?q?=E2=9C=85=20[test]=20Report=20stdout=20stde?= =?UTF-8?q?rr=20results=20on=20wepp=20exe=20fail?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/regression_tests/run_regressions.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/regression_tests/run_regressions.py b/src/regression_tests/run_regressions.py index 63729f8b..acaaeb1e 100644 --- a/src/regression_tests/run_regressions.py +++ b/src/regression_tests/run_regressions.py @@ -24,7 +24,17 @@ def main(): stdout=subprocess.PIPE, stderr=subprocess.PIPE, ) as proc: - proc.communicate() + (stdout, stderr) = proc.communicate() + if proc.returncode: + sys.stdout.write( + f"FAILED: {fn},\n" + f"WEPP returned {proc.returncode}\n" + "stdout:\n" + f"{stdout.decode()}\n" + "stderr:\n" + f"{stderr.decode()}\n" + ) + sys.exit(1) df = read_env("wepp_env.txt") avg_det = df["av_det"].sum() / 15.0 * 4.463 From 46fa6dbc5003693ebca8a1586f9006c6ceacd9a6 Mon Sep 17 00:00:00 2001 From: akrherz Date: Wed, 6 Nov 2024 13:27:38 -0600 Subject: [PATCH 5/5] =?UTF-8?q?=F0=9F=90=9B=20Set=20LDFLAGS=20-static-inte?= =?UTF-8?q?l?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/wepp20230117/Makefile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/wepp20230117/Makefile b/src/wepp20230117/Makefile index 30e0dbb9..b40d376e 100644 --- a/src/wepp20230117/Makefile +++ b/src/wepp20230117/Makefile @@ -22,10 +22,12 @@ ifeq ($(FC),gfortran) FFLAGS = $(FFLAGS_GNU) FC = $(FC_GNU) LINKER = $(LINK_GNU) + LDFLAGS = else FFLAGS = $(FFLAGS_IFORT) FC = $(FC_IF) LINKER = $(LINK_IF) + LDFLAGS = -static-intel endif @@ -36,7 +38,7 @@ DEST = . #LDFLAGS = -static /usr/lib/gcc-lib/i686-pc-linux-gnu/4.1.1/libgcc.a /usr/lib/gcc-lib/i686-pc-linux-gnu/4.1.1/libgcc_eh.a /usr/lib/gcc-lib/i686-pc-linux-gnu/4.1.1/libf95.a -LDFLAGS = +# LDFLAGS = .SUFFIXES: .for .o