Skip to content

Commit

Permalink
Merge pull request #288 from akrherz/240924
Browse files Browse the repository at this point in the history
Omnibus
  • Loading branch information
akrherz authored Nov 6, 2024
2 parents 65d4c5f + 46fa6db commit b1c44d8
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 12 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
FC: ["ifort", "gfortran"]
FC: ["ifx", "gfortran"]
steps:
- uses: actions/checkout@v4

Expand All @@ -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
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -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]
Expand Down
8 changes: 8 additions & 0 deletions scripts/import/flowpath_importer.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
MAX_POINTS_OFE = 97
GENLU_CODES = {}
PROCESSING_COUNTS = {
"flowpaths_found": 0,
"flowpaths_good": 0,
"flowpaths_deduped": 0,
"flowpaths_tooshort": 0,
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down
12 changes: 11 additions & 1 deletion src/regression_tests/run_regressions.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/wepp2010.1/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
#
# makefile for solaris 8 wepp executable.
#
FC_IF = ifort
FC_IF = ifx
FC_G95 = g95
FC_GNU = gfortran
FC_2 = f2c
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++
Expand Down
4 changes: 2 additions & 2 deletions src/wepp2012-src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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++
Expand Down
8 changes: 5 additions & 3 deletions src/wepp20230117/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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++
Expand All @@ -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


Expand All @@ -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

Expand Down

0 comments on commit b1c44d8

Please sign in to comment.