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/.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] 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 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 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..b40d376e 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++ @@ -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