Skip to content

Commit

Permalink
fix(backspace): remove Fortran backspace (#1310)
Browse files Browse the repository at this point in the history
* remove backspace so that ifx can be used to compile
* update meson for ifx
* fix initialization error in mf5to6 ghost node writer
* introduce LongLineReader as a way to emulate backspace functionality
* update vscode tasks.json for consistent build group definition
  • Loading branch information
langevin-usgs authored Jul 26, 2023
1 parent e60ab0f commit d6b4350
Show file tree
Hide file tree
Showing 29 changed files with 656 additions and 476 deletions.
40 changes: 32 additions & 8 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,10 @@
"release",
"build",
],
"group": "build",
"group": {
"kind": "build",
"isDefault": true
},
"presentation": {
"clear": true
}
Expand All @@ -53,7 +56,10 @@
"release",
"rebuild",
],
"group": "build",
"group": {
"kind": "build",
"isDefault": true
},
"presentation": {
"clear": true
}
Expand Down Expand Up @@ -81,7 +87,10 @@
"release",
"build",
],
"group": "build",
"group": {
"kind": "build",
"isDefault": true
},
"presentation": {
"clear": true
}
Expand All @@ -108,7 +117,10 @@
"release",
"rebuild",
],
"group": "build",
"group": {
"kind": "build",
"isDefault": true
},
"presentation": {
"clear": true
}
Expand Down Expand Up @@ -136,7 +148,10 @@
"debug",
"build",
],
"group": "build",
"group": {
"kind": "build",
"isDefault": true
},
"presentation": {
"clear": true
}
Expand All @@ -163,7 +178,10 @@
"debug",
"rebuild",
],
"group": "build",
"group": {
"kind": "build",
"isDefault": true
},
"presentation": {
"clear": true
}
Expand Down Expand Up @@ -191,7 +209,10 @@
"debug",
"build",
],
"group": "build",
"group": {
"kind": "build",
"isDefault": true
},
"presentation": {
"clear": true
}
Expand All @@ -218,7 +239,10 @@
"debug",
"rebuild",
],
"group": "build",
"group": {
"kind": "build",
"isDefault": true
},
"presentation": {
"clear": true
}
Expand Down
9 changes: 7 additions & 2 deletions autotest/test_cli.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,21 @@
import subprocess
import platform

from conftest import project_root_path

bin_path = project_root_path / "bin"

app = "mf6"
ext = ".exe" if platform.system() == "Windows" else ""
app = f"{app}{ext}"


def test_cli_version():
output = " ".join(
subprocess.check_output([str(bin_path / "mf6"), "-v"]).decode().split()
subprocess.check_output([str(bin_path / app), "-v"]).decode().split()
)
print(output)
assert output.startswith("mf6:")
assert output.startswith(f"{app}:"), f"found: {output}"

version = (
output.lower().split(' ')[1]
Expand Down
2 changes: 1 addition & 1 deletion make/makedefaults
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# makedefaults created by pymake (version 1.2.7) for the 'mf6' executable.
# makedefaults created by pymake (version 1.2.9.dev0) for the 'mf6' executable.

# determine OS
ifeq ($(OS), Windows_NT)
Expand Down
35 changes: 18 additions & 17 deletions make/makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# makefile created by pymake (version 1.2.7) for the 'mf6' executable.
# makefile created by pymake (version 1.2.9.dev0) for the 'mf6' executable.


include ./makedefaults
Expand Down Expand Up @@ -88,6 +88,7 @@ $(OBJDIR)/MemoryHelper.o \
$(OBJDIR)/CharString.o \
$(OBJDIR)/Memory.o \
$(OBJDIR)/List.o \
$(OBJDIR)/LongLineReader.o \
$(OBJDIR)/MemoryList.o \
$(OBJDIR)/TimeSeriesRecord.o \
$(OBJDIR)/BlockParser.o \
Expand Down Expand Up @@ -122,28 +123,21 @@ $(OBJDIR)/PackageMover.o \
$(OBJDIR)/Obs3.o \
$(OBJDIR)/NumericalPackage.o \
$(OBJDIR)/Budget.o \
$(OBJDIR)/SeqVector.o \
$(OBJDIR)/sort.o \
$(OBJDIR)/SfrCrossSectionUtils.o \
$(OBJDIR)/BudgetTerm.o \
$(OBJDIR)/BoundaryPackage.o \
$(OBJDIR)/BaseModel.o \
$(OBJDIR)/SparseMatrix.o \
$(OBJDIR)/LinearSolverBase.o \
$(OBJDIR)/ims8reordering.o \
$(OBJDIR)/VirtualBase.o \
$(OBJDIR)/STLVecInt.o \
$(OBJDIR)/BoundaryPackage.o \
$(OBJDIR)/BaseModel.o \
$(OBJDIR)/InputDefinition.o \
$(OBJDIR)/SfrCrossSectionManager.o \
$(OBJDIR)/dag_module.o \
$(OBJDIR)/BudgetObject.o \
$(OBJDIR)/NumericalModel.o \
$(OBJDIR)/BaseExchange.o \
$(OBJDIR)/ImsLinearSolver.o \
$(OBJDIR)/ims8base.o \
$(OBJDIR)/VirtualDataLists.o \
$(OBJDIR)/VirtualDataContainer.o \
$(OBJDIR)/SimStages.o \
$(OBJDIR)/NumericalModel.o \
$(OBJDIR)/simnamidm.o \
$(OBJDIR)/gwt1idm.o \
$(OBJDIR)/gwt1dsp1idm.o \
Expand All @@ -168,13 +162,9 @@ $(OBJDIR)/gwf3lak8.o \
$(OBJDIR)/GwfVscInputData.o \
$(OBJDIR)/gwf3ghb8.o \
$(OBJDIR)/gwf3drn8.o \
$(OBJDIR)/Timer.o \
$(OBJDIR)/NumericalExchange.o \
$(OBJDIR)/LinearSolverFactory.o \
$(OBJDIR)/ims8linear.o \
$(OBJDIR)/BaseSolution.o \
$(OBJDIR)/IndexMap.o \
$(OBJDIR)/VirtualModel.o \
$(OBJDIR)/BaseExchange.o \
$(OBJDIR)/IdmSimDfnSelector.o \
$(OBJDIR)/IdmGwtDfnSelector.o \
$(OBJDIR)/IdmGwfDfnSelector.o \
Expand All @@ -187,9 +177,10 @@ $(OBJDIR)/gwf3tvk8.o \
$(OBJDIR)/MemoryManagerExt.o \
$(OBJDIR)/gwf3vsc8.o \
$(OBJDIR)/GwfNpfOptions.o \
$(OBJDIR)/NumericalSolution.o \
$(OBJDIR)/InterfaceMap.o \
$(OBJDIR)/SeqVector.o \
$(OBJDIR)/CellWithNbrs.o \
$(OBJDIR)/NumericalExchange.o \
$(OBJDIR)/IdmDfnSelector.o \
$(OBJDIR)/gwf3uzf8.o \
$(OBJDIR)/gwt1apt1.o \
Expand All @@ -207,6 +198,9 @@ $(OBJDIR)/GwfMvrPeriodData.o \
$(OBJDIR)/ims8misc.o \
$(OBJDIR)/GwfBuyInputData.o \
$(OBJDIR)/VirtualSolution.o \
$(OBJDIR)/SparseMatrix.o \
$(OBJDIR)/LinearSolverBase.o \
$(OBJDIR)/ims8reordering.o \
$(OBJDIR)/ArrayReaderBase.o \
$(OBJDIR)/VirtualExchange.o \
$(OBJDIR)/gwf3disu8.o \
Expand Down Expand Up @@ -244,12 +238,18 @@ $(OBJDIR)/GhostNode.o \
$(OBJDIR)/gwf3evt8.o \
$(OBJDIR)/gwf3chd8.o \
$(OBJDIR)/RouterBase.o \
$(OBJDIR)/ImsLinearSolver.o \
$(OBJDIR)/ims8base.o \
$(OBJDIR)/Integer2dReader.o \
$(OBJDIR)/GridConnection.o \
$(OBJDIR)/DistributedVariable.o \
$(OBJDIR)/gwt1.o \
$(OBJDIR)/gwf3.o \
$(OBJDIR)/SerialRouter.o \
$(OBJDIR)/Timer.o \
$(OBJDIR)/LinearSolverFactory.o \
$(OBJDIR)/ims8linear.o \
$(OBJDIR)/BaseSolution.o \
$(OBJDIR)/StructVector.o \
$(OBJDIR)/IdmLogger.o \
$(OBJDIR)/Integer1dReader.o \
Expand All @@ -262,6 +262,7 @@ $(OBJDIR)/GwtGwtExchange.o \
$(OBJDIR)/GwfInterfaceModel.o \
$(OBJDIR)/GwfGwfExchange.o \
$(OBJDIR)/RouterFactory.o \
$(OBJDIR)/NumericalSolution.o \
$(OBJDIR)/MappedMemory.o \
$(OBJDIR)/StructArray.o \
$(OBJDIR)/ModflowInput.o \
Expand Down
18 changes: 17 additions & 1 deletion meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ message('The used profile is:', profile)
# parse compiler options
fc = meson.get_compiler('fortran')
fc_id = fc.get_id()
message('The fc_id is:', fc_id)
compile_args = []
link_args = []

Expand Down Expand Up @@ -85,8 +86,23 @@ elif fc_id == 'intel'
'-diag-disable:5268', # Line too long
]
link_args += '-static-intel'
endif

# Command line options for ifx
elif fc_id == 'intel-llvm-cl'
# windows
compile_args += ['/fpe:0', # Activate all floating point exceptions
'/heap-arrays:0',
'/traceback',
'/fpp', # Activate preprocessing
'/Qdiag-disable:7416', # f2008 warning
'/Qdiag-disable:7025', # f2008 warning
'/Qdiag-disable:5268', # Line too long
]
link_args += ['/ignore:4217', # access through ddlimport might be inefficient
'/ignore:4286' # same as 4217, but more general
]

endif

# parallel build options
is_parallel_build = get_option('parallel')
Expand Down
Loading

0 comments on commit d6b4350

Please sign in to comment.