From 63e79f6af58060b8289e77c1ed15667b29fb8457 Mon Sep 17 00:00:00 2001 From: mjreno Date: Wed, 26 Jun 2024 17:09:54 -0400 Subject: [PATCH] feat(netcdf): support model ugrid layered mesh exports (#1868) * update definitions and add netcdf utility input * add netcdf export source * integrate export and update build * add netcdf tests and update ci * install xugrid/xarray in ci test * update prt dis dfns * install netcdf4 in ci env * update msvs build * preliminary support for variable chunking and compression * remove ncf6 and netcdf from docs for now * update memorylist to memorystore * rebuild makefiles * exclude netcdf dependent files from make build * remove unintended definition file * update msvs build * rebuild makefiles * update netcdf transport dispersion test to remove packagedata keyword * update pixi version in CI extended test --------- Co-authored-by: mjreno --- .github/actions/test-extended/action.yml | 104 ++ .github/common/check_format.py | 4 +- .github/workflows/ci.yml | 46 + autotest/conftest.py | 14 + autotest/pytest.ini | 3 +- autotest/test_netcdf_gwe_cnd.py | 568 +++++++++ autotest/test_netcdf_gwf_disv.py | 202 ++++ autotest/test_netcdf_gwf_sto01.py | 460 +++++++ autotest/test_netcdf_gwt_dsp01.py | 476 ++++++++ autotest/test_netcdf_gwt_prudic2004t2.py | 1061 +++++++++++++++++ doc/mf6io/mf6ivar/dfn/gwe-cnd.dfn | 9 + doc/mf6io/mf6ivar/dfn/gwe-dis.dfn | 50 + doc/mf6io/mf6ivar/dfn/gwe-disv.dfn | 50 + doc/mf6io/mf6ivar/dfn/gwe-ic.dfn | 9 + doc/mf6io/mf6ivar/dfn/gwe-nam.dfn | 9 + doc/mf6io/mf6ivar/dfn/gwf-dis.dfn | 52 +- doc/mf6io/mf6ivar/dfn/gwf-disv.dfn | 52 +- doc/mf6io/mf6ivar/dfn/gwf-ic.dfn | 9 + doc/mf6io/mf6ivar/dfn/gwf-nam.dfn | 9 + doc/mf6io/mf6ivar/dfn/gwf-npf.dfn | 9 + doc/mf6io/mf6ivar/dfn/gwf-sto.dfn | 9 + doc/mf6io/mf6ivar/dfn/gwt-dis.dfn | 50 + doc/mf6io/mf6ivar/dfn/gwt-disv.dfn | 50 + doc/mf6io/mf6ivar/dfn/gwt-dsp.dfn | 9 + doc/mf6io/mf6ivar/dfn/gwt-ic.dfn | 9 + doc/mf6io/mf6ivar/dfn/gwt-nam.dfn | 9 + doc/mf6io/mf6ivar/dfn/prt-dis.dfn | 49 + doc/mf6io/mf6ivar/dfn/prt-disv.dfn | 49 + doc/mf6io/mf6ivar/dfn/utl-ncf.dfn | 64 + make/makedefaults | 2 +- make/makefile | 86 +- meson.build | 35 +- msvs/mf6core.vfproj | 27 +- pymake/excludefiles.txt | 4 + src/Idm/exg-gwegweidm.f90 | 35 + src/Idm/exg-gwfgweidm.f90 | 9 + src/Idm/exg-gwfgwfidm.f90 | 39 + src/Idm/exg-gwfgwtidm.f90 | 9 + src/Idm/exg-gwfprtidm.f90 | 9 + src/Idm/exg-gwtgwtidm.f90 | 35 + src/Idm/exg-swfgwfidm.f90 | 18 + src/Idm/gwe-cndidm.f90 | 38 + src/Idm/gwe-ctpidm.f90 | 26 + src/Idm/gwe-disidm.f90 | 122 ++ src/Idm/gwe-disuidm.f90 | 37 + src/Idm/gwe-disvidm.f90 | 129 ++ src/Idm/gwe-icidm.f90 | 30 + src/Idm/gwe-namidm.f90 | 35 + src/Idm/gwf-chdidm.f90 | 27 + src/Idm/gwf-disidm.f90 | 122 ++ src/Idm/gwf-disuidm.f90 | 37 + src/Idm/gwf-disvidm.f90 | 129 ++ src/Idm/gwf-drnidm.f90 | 30 + src/Idm/gwf-evtaidm.f90 | 27 + src/Idm/gwf-evtidm.f90 | 34 + src/Idm/gwf-ghbidm.f90 | 28 + src/Idm/gwf-icidm.f90 | 30 + src/Idm/gwf-namidm.f90 | 38 + src/Idm/gwf-npfidm.f90 | 63 + src/Idm/gwf-rchaidm.f90 | 25 + src/Idm/gwf-rchidm.f90 | 27 + src/Idm/gwf-rividm.f90 | 29 + src/Idm/gwf-stoidm.f90 | 43 + src/Idm/gwf-welidm.f90 | 32 + src/Idm/gwt-cncidm.f90 | 26 + src/Idm/gwt-disidm.f90 | 122 ++ src/Idm/gwt-disuidm.f90 | 37 + src/Idm/gwt-disvidm.f90 | 129 ++ src/Idm/gwt-dspidm.f90 | 37 + src/Idm/gwt-icidm.f90 | 30 + src/Idm/gwt-namidm.f90 | 35 + src/Idm/prt-disidm.f90 | 122 ++ src/Idm/prt-disvidm.f90 | 129 ++ src/Idm/prt-mipidm.f90 | 12 + src/Idm/prt-namidm.f90 | 15 + src/Idm/selector/IdmDfnSelector.f90 | 30 + src/Idm/selector/IdmExgDfnSelector.f90 | 30 + src/Idm/selector/IdmGweDfnSelector.f90 | 30 + src/Idm/selector/IdmGwfDfnSelector.f90 | 48 + src/Idm/selector/IdmGwtDfnSelector.f90 | 30 + src/Idm/selector/IdmPrtDfnSelector.f90 | 24 + src/Idm/selector/IdmSimDfnSelector.f90 | 20 + src/Idm/selector/IdmSwfDfnSelector.f90 | 40 + src/Idm/selector/IdmUtlDfnSelector.f90 | 31 + src/Idm/sim-namidm.f90 | 31 + src/Idm/sim-tdisidm.f90 | 18 + src/Idm/swf-cdbidm.f90 | 23 + src/Idm/swf-chdidm.f90 | 26 + src/Idm/swf-cxsidm.f90 | 17 + src/Idm/swf-dfwidm.f90 | 22 + src/Idm/swf-dis2didm.f90 | 20 + src/Idm/swf-disidm.f90 | 332 ------ src/Idm/swf-disv1didm.f90 | 28 + src/Idm/swf-disv2didm.f90 | 27 + src/Idm/swf-flwidm.f90 | 26 + src/Idm/swf-icidm.f90 | 10 + src/Idm/swf-namidm.f90 | 18 + src/Idm/swf-stoidm.f90 | 12 + src/Idm/swf-zdgidm.f90 | 28 + src/Idm/utl-hpcidm.f90 | 11 + src/Idm/utl-ncfidm.f90 | 202 ++++ src/Timing/tdis.f90 | 2 +- src/Utilities/Export/DisNCMesh.f90 | 992 +++++++++++++++ src/Utilities/Export/DisvNCMesh.f90 | 784 ++++++++++++ src/Utilities/Export/MeshNCModel.f90 | 554 +++++++++ src/Utilities/Export/ModelExport.f90 | 252 ++++ src/Utilities/Export/NCExportCreate.f90 | 142 +++ src/Utilities/Export/NCModel.f90 | 263 ++++ src/Utilities/Idm/IdmLoad.f90 | 68 +- src/Utilities/Idm/InputDefinition.f90 | 1 + src/Utilities/Idm/InputLoadType.f90 | 205 +++- src/Utilities/Idm/SourceLoad.F90 | 36 +- .../Idm/mf6blockfile/LoadMf6File.f90 | 20 +- src/meson.build | 14 + src/mf6core.f90 | 10 + utils/idmloader/dfns.txt | 1 + utils/idmloader/scripts/dfn2f90.py | 98 +- utils/mf5to6/make/makedefaults | 2 +- utils/mf5to6/make/makefile | 10 +- utils/zonebudget/make/makedefaults | 2 +- utils/zonebudget/make/makefile | 2 +- 121 files changed, 9790 insertions(+), 436 deletions(-) create mode 100644 .github/actions/test-extended/action.yml create mode 100644 autotest/test_netcdf_gwe_cnd.py create mode 100644 autotest/test_netcdf_gwf_disv.py create mode 100644 autotest/test_netcdf_gwf_sto01.py create mode 100644 autotest/test_netcdf_gwt_dsp01.py create mode 100644 autotest/test_netcdf_gwt_prudic2004t2.py create mode 100644 doc/mf6io/mf6ivar/dfn/utl-ncf.dfn delete mode 100644 src/Idm/swf-disidm.f90 create mode 100644 src/Idm/utl-ncfidm.f90 create mode 100644 src/Utilities/Export/DisNCMesh.f90 create mode 100644 src/Utilities/Export/DisvNCMesh.f90 create mode 100644 src/Utilities/Export/MeshNCModel.f90 create mode 100644 src/Utilities/Export/ModelExport.f90 create mode 100644 src/Utilities/Export/NCExportCreate.f90 create mode 100644 src/Utilities/Export/NCModel.f90 diff --git a/.github/actions/test-extended/action.yml b/.github/actions/test-extended/action.yml new file mode 100644 index 00000000000..93051866832 --- /dev/null +++ b/.github/actions/test-extended/action.yml @@ -0,0 +1,104 @@ +name: Test Extended MF6 +description: Build and test Extended MODFLOW 6 +runs: + using: "composite" + steps: + + - name: Setup GNU Fortran + uses: fortran-lang/setup-fortran@v1 + with: + compiler: gcc + version: 13 + + - name: Checkout PETSc + uses: actions/checkout@v4 + with: + repository: petsc/petsc + path: petsc + ref: release + + - name: Configure environment + if: runner.os == 'Linux' + shell: bash + run: | + echo "PKG_CONFIG_PATH=$GITHUB_WORKSPACE/petsc/linux-gnu/lib/pkgconfig" >> $GITHUB_ENV + echo "$GITHUB_WORKSPACE/petsc/linux-gnu/bin" >> $GITHUB_PATH + + - name: Configure environment + if: runner.os == 'macOS' + shell: bash + run: | + echo "PKG_CONFIG_PATH=$GITHUB_WORKSPACE/petsc/arch-darwin-gcc/lib/pkgconfig" >> $GITHUB_ENV + echo "$GITHUB_WORKSPACE/petsc/arch-darwin-gcc/bin" >> $GITHUB_PATH + + - name: Configure PETSc + if: runner.os == 'Linux' + shell: bash + working-directory: petsc + run: | + sudo wget -P $GITHUB_WORKSPACE/petsc https://download.open-mpi.org/release/open-mpi/v5.0/openmpi-5.0.2.tar.gz + sudo ./configure PETSC_ARCH=linux-gnu --download-fblaslapack --download-openmpi=$GITHUB_WORKSPACE/petsc/openmpi-5.0.2.tar.gz + sudo make all + + - name: Configure PETSc + if: runner.os == 'macOS' + shell: bash + working-directory: petsc + run: | + sudo ./configure PETSC_DIR="$GITHUB_WORKSPACE/petsc" PETSC_ARCH=arch-darwin-gcc --download-fblaslapack --download-openmpi --with-debugging=0 + sudo make all + + - name: Install netcdf + if: runner.os == 'Linux' + shell: bash + run: | + sudo apt-get update + sudo apt-get install build-essential \ + libnetcdf-dev \ + libnetcdff-dev \ + netcdf-bin + nc-config --all + nf-config --all + + - name: Install netcdf + if: runner.os == 'macOS' + shell: bash + run: | + bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" + brew install netcdf-fortran + brew install gcc@13 + nc-config --all + nf-config + + - name: Build modflow6 + shell: bash + working-directory: modflow6 + run: | + pixi run setup -Dparallel=true builddir + pixi run build builddir + pixi run test builddir + + - name: Show Meson logs + if: failure() + shell: bash + working-directory: modflow6 + run: cat builddir/meson-logs/meson-log.txt + + - name: Update flopy + shell: bash + working-directory: modflow6 + run: pixi run update-flopy + + - name: Get executables + shell: bash + working-directory: modflow6 + env: + GITHUB_TOKEN: ${{ github.token }} + run: pixi run get-exes + + - name: Test programs + shell: bash + working-directory: modflow6 + env: + REPOS_PATH: ${{ github.workspace }} + run: pixi run autotest --parallel --netcdf -k "test_par or test_netcdf" diff --git a/.github/common/check_format.py b/.github/common/check_format.py index e9a49bcdeb0..f06a71be394 100644 --- a/.github/common/check_format.py +++ b/.github/common/check_format.py @@ -24,7 +24,9 @@ ] # exclude these files from checks -excludefiles = [] +excludefiles = [ + PROJ_ROOT / "src" / "Idm" / "gwf-stoidm.f90" +] # commands fprettify = "fprettify -c .fprettify.yaml" diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bc301f79bd9..25913278293 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -476,3 +476,49 @@ jobs: with: name: failed-${{ matrix.os }} path: modflow6/autotest/.failed + + extended_test: + name: Extended executable testing + needs: + - lint + - build + - smoke_test + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [ ubuntu-22.04, macos-12 ] + defaults: + run: + shell: bash + + steps: + + - name: Checkout modflow6 + uses: actions/checkout@v4 + with: + path: modflow6 + + - name: Setup pixi + uses: prefix-dev/setup-pixi@v0.8.1 + with: + pixi-version: v0.24.2 + manifest-path: "modflow6/pixi.toml" + + - name: Custom pixi install + working-directory: modflow6 + run: pixi run install + + - name: Install additional netcdf testing packages + working-directory: modflow6 + run: pixi run pip install xugrid xarray netcdf4 + + - name: Test Extended MF6 + uses: ./modflow6/.github/actions/test-extended + + - name: Upload failed test output + if: failure() + uses: actions/upload-artifact@v4 + with: + name: failed-${{ matrix.os }} + path: modflow6/autotest/.failed diff --git a/autotest/conftest.py b/autotest/conftest.py index e436b8092e7..f3bfadfa6a8 100644 --- a/autotest/conftest.py +++ b/autotest/conftest.py @@ -119,6 +119,12 @@ def pytest_addoption(parser): default=False, help="include parallel test cases", ) + parser.addoption( + "--netcdf", + action="store_true", + default=False, + help="include netcdf test cases", + ) def pytest_collection_modifyitems(config, items): @@ -129,3 +135,11 @@ def pytest_collection_modifyitems(config, items): for item in items: if "parallel" in item.keywords: item.add_marker(skip_parallel) + + if config.getoption("--netcdf"): + # --netcdf given in cli: do not skip netcdf tests + return + skip_netcdf = pytest.mark.skip(reason="need --netcdf option to run") + for item in items: + if "netcdf" in item.keywords: + item.add_marker(skip_netcdf) diff --git a/autotest/pytest.ini b/autotest/pytest.ini index ead5d4c4ff1..59870b94cf2 100644 --- a/autotest/pytest.ini +++ b/autotest/pytest.ini @@ -15,8 +15,9 @@ markers = lak: tests for lake package maw: tests for multi-aquifer well package parallel: test relying on a parallel (MPI+PETSc) build + netcdf: test relying on a netcdf (NetCDF-FORTRAN) build filterwarnings = # from python-dateutil, used by arrow, jupyter_client, matplotlib, pandas ignore:datetime.datetime.utcfromtimestamp # from pandas, see https://github.com/pandas-dev/pandas/issues/54466 - ignore:\n.*Pyarrow \ No newline at end of file + ignore:\n.*Pyarrow diff --git a/autotest/test_netcdf_gwe_cnd.py b/autotest/test_netcdf_gwe_cnd.py new file mode 100644 index 00000000000..46589e2ca04 --- /dev/null +++ b/autotest/test_netcdf_gwe_cnd.py @@ -0,0 +1,568 @@ +""" +Test problem for GWE + +One-Dimensional Transport in a Uniform Flow Field. +The purpose of this script is to test the new heat transport model developed +for MODFLOW 6. To that end, this problem uses the setup of the first MT3DMS +test problem but adapts it for heat. MODFLOW 6 is setup using the new GWE +model with input parameters entered in their native units. + +It may be possible to find a 1D heat transport analytical solution in the +future. +""" + +# Imports + +import os +import numpy as np +import pytest + +try: + import xarray as xa + import xugrid as xu +except ImportError: + pytest.skip("xuarray and xugrid not found", allow_module_level=True) + +try: + import pymake +except: + msg = "Error. Pymake package is not available.\n" + msg += "Try installing using the following command:\n" + msg += " pip install https://github.com/modflowpy/pymake/zipball/master" + raise Exception(msg) + +try: + import flopy +except: + msg = "Error. FloPy package is not available.\n" + msg += "Try installing using the following command:\n" + msg += " pip install flopy" + raise Exception(msg) + + +from framework import TestFramework + +# Base simulation and model name and workspace + +viscosity_on = [False] +cases = ["cnd01"] + +# Model units + +length_units = "meters" +time_units = "days" + +# Table MODFLOW 6 GWE comparison to MT3DMS + +nper = 1 # Number of periods +nlay = 1 # Number of layers +ncol = 101 # Number of columns +nrow = 1 # Number of rows +delr = 10.0 # Column width ($m$) +delc = 1.0 # Row width ($m$) +top = 0.0 # Top of the model ($m$) +botm = -1.0 # Layer bottom elevations ($m$) +prsity = 0.25 # Porosity +perlen = 2000 # Simulation time ($days$) +k11 = 1.0 # Horizontal hydraulic conductivity ($m/d$) + +# Set some static model parameter values + +k33 = k11 # Vertical hydraulic conductivity ($m/d$) +laytyp = 1 +nstp = 100.0 +dt0 = perlen / nstp +Lx = (ncol - 1) * delr +v = 0.24 +q = v * prsity +h1 = q * Lx +strt = np.zeros((nlay, nrow, ncol), dtype=float) +strt[0, 0, 0] = h1 # Starting head ($m$) +l = 1000.0 # Needed for plots +icelltype = 1 # Cell conversion type +ibound = np.ones((nlay, nrow, ncol), dtype=int) +ibound[0, 0, 0] = -1 +ibound[0, 0, -1] = -1 + +# Set some static transport related model parameter values + +mixelm = 0 # FD +rhob = 1110.0 +sp2 = 0.0 # read, but not used in this problem +kd = 1.8168e-4 +strt_temp = np.zeros((nlay, nrow, ncol), dtype=float) +dispersivity = 1.0 +dmcoef = 3.2519e-7 # Molecular diffusion coefficient + +# Set some static heat transport related model parameter values +cpw = 4183.0 +rhow = 1000.0 +lhv = 2454.0 + +# Set solver parameter values (and related) +nouter, ninner = 100, 300 +hclose, rclose, relax = 1e-6, 1e-6, 1.0 +ttsmult = 1.0 +dceps = 1.0e-5 # HMOC parameters in case they are invoked +nplane = 1 # HMOC +npl = 0 # HMOC +nph = 4 # HMOC +npmin = 0 # HMOC +npmax = 8 # HMOC +nlsink = nplane # HMOC +npsink = nph # HMOC + +# Static temporal data used by TDIS file + +tdis_rc = [] +tdis_rc.append((perlen, nstp, 1.0)) + +# ### Create MODFLOW 6 GWE MT3DMS Example 1 Boundary Conditions +# +# Constant head cells are specified on both ends of the model + +chdspd = [[(0, 0, 0), h1], [(0, 0, ncol - 1), 0.0]] +c0 = 40.0 +ctpspd = [[(0, 0, 0), c0]] + + +def build_models(idx, test): + # Base MF6 GWE model type + ws = test.workspace + name = cases[idx] + + print("Building MF6 model...()".format(name)) + + # generate names for each model + gwfname = "gwf-" + name + gwename = "gwe-" + name + + sim_ws = os.path.join(ws, name) + sim = flopy.mf6.MFSimulation( + sim_name=name, sim_ws=ws, exe_name="mf6", version="mf6" + ) + + # Instantiating MODFLOW 6 time discretization + flopy.mf6.ModflowTdis( + sim, nper=nper, perioddata=tdis_rc, time_units=time_units, start_date_time="2041-01-01T00:00:00-05:00", + ) + + # Instantiating MODFLOW 6 groundwater flow model + gwf = flopy.mf6.ModflowGwf( + sim, + modelname=gwfname, + save_flows=True, + model_nam_file="{}.nam".format(gwfname), + ) + + # Instantiating MODFLOW 6 solver for flow model + imsgwf = flopy.mf6.ModflowIms( + sim, + print_option="SUMMARY", + outer_dvclose=hclose, + outer_maximum=nouter, + under_relaxation="NONE", + inner_maximum=ninner, + inner_dvclose=hclose, + rcloserecord=rclose, + linear_acceleration="CG", + scaling_method="NONE", + reordering_method="NONE", + relaxation_factor=relax, + filename="{}.ims".format(gwfname), + ) + sim.register_ims_package(imsgwf, [gwfname]) + + # Instantiating MODFLOW 6 discretization package + flopy.mf6.ModflowGwfdis( + gwf, + length_units=length_units, + nlay=nlay, + nrow=nrow, + ncol=ncol, + delr=delr, + delc=delc, + top=top, + botm=botm, + idomain=np.ones((nlay, nrow, ncol), dtype=int), + filename="{}.dis".format(gwfname), + ) + + # Instantiating MODFLOW 6 node-property flow package + flopy.mf6.ModflowGwfnpf( + gwf, + save_flows=False, + icelltype=icelltype, + k=k11, + k33=k33, + save_specific_discharge=True, + filename="{}.npf".format(gwfname), + ) + + # Instantiating MODFLOW 6 initial conditions package for flow model + flopy.mf6.ModflowGwfic(gwf, strt=strt, filename="{}.ic".format(gwfname)) + + # Instantiating VSC + if viscosity_on[idx]: + # Instantiate viscosity (VSC) package + vsc_filerecord = "{}.vsc.bin".format(gwfname) + vsc_pd = [(0, 0.0, 20.0, gwename, "temperature")] + flopy.mf6.ModflowGwfvsc( + gwf, + viscref=8.904e-4, + viscosity_filerecord=vsc_filerecord, + thermal_formulation="nonlinear", + thermal_a2=10.0, + thermal_a3=248.37, + thermal_a4=133.16, + nviscspecies=len(vsc_pd), + packagedata=vsc_pd, + pname="vsc", + filename="{}.vsc".format(gwfname), + ) + + # Instantiating MODFLOW 6 constant head package + flopy.mf6.ModflowGwfchd( + gwf, + maxbound=len(chdspd), + stress_period_data=chdspd, + save_flows=False, + pname="CHD-1", + filename="{}.chd".format(gwfname), + ) + + # Instantiating MODFLOW 6 output control package for flow model + flopy.mf6.ModflowGwfoc( + gwf, + head_filerecord="{}.hds".format(gwfname), + budget_filerecord="{}.cbc".format(gwfname), + headprintrecord=[("COLUMNS", 10, "WIDTH", 15, "DIGITS", 6, "GENERAL")], + saverecord=[("HEAD", "ALL"), ("BUDGET", "ALL")], + printrecord=[("HEAD", "ALL"), ("BUDGET", "ALL")], + ) + + # Instantiating MODFLOW 6 groundwater transport package + gwe = flopy.mf6.MFModel( + sim, + model_type="gwe6", + modelname=gwename, + model_nam_file="{}.nam".format(gwename), + ) + gwe.name_file.save_flows = True + gwe.name_file.export_netcdf = "ugrid" + imsgwe = flopy.mf6.ModflowIms( + sim, + print_option="SUMMARY", + outer_dvclose=hclose, + outer_maximum=nouter, + under_relaxation="NONE", + inner_maximum=ninner, + inner_dvclose=hclose, + rcloserecord=rclose, + linear_acceleration="BICGSTAB", + scaling_method="NONE", + reordering_method="NONE", + relaxation_factor=relax, + filename="{}.ims".format(gwename), + ) + sim.register_ims_package(imsgwe, [gwe.name]) + + # Instantiating MODFLOW 6 transport discretization package + flopy.mf6.ModflowGwedis( + gwe, + nogrb=True, + export_array_netcdf=True, + nlay=nlay, + nrow=nrow, + ncol=ncol, + delr=delr, + delc=delc, + top=top, + botm=botm, + idomain=1, + filename="{}.dis".format(gwename), + ) + + # Instantiating MODFLOW 6 transport initial concentrations + flopy.mf6.ModflowGweic( + gwe, export_array_netcdf=True, strt=strt_temp, filename="{}.ic".format(gwename) + ) + + # Instantiating MODFLOW 6 transport advection package + if mixelm == 0: + scheme = "UPSTREAM" + elif mixelm == -1: + scheme = "TVD" + else: + raise Exception() + flopy.mf6.ModflowGweadv( + gwe, scheme=scheme, filename="{}.adv".format(gwename) + ) + + # Instantiating MODFLOW 6 transport dispersion package + if dispersivity != 0: + flopy.mf6.ModflowGwecnd( + gwe, + xt3d_off=True, + export_array_netcdf=True, + alh=dispersivity, + ath1=dispersivity, + ktw=0.5918, + kts=0.2700, + filename="{}.cnd".format(gwename), + ) + + # Instantiating MODFLOW 6 transport mass storage package (formerly "reaction" package in MT3DMS) + flopy.mf6.ModflowGweest( + gwe, + save_flows=True, + heat_capacity_water=cpw, + density_water=rhow, + porosity=prsity, + cps=760.0, + rhos=1500.0, + filename="{}.est".format(gwename), + ) + + # Instantiating MODFLOW 6 transport constant concentration package + flopy.mf6.ModflowGwectp( + gwe, + maxbound=len(ctpspd), + stress_period_data=ctpspd, + save_flows=False, + pname="CTP-1", + filename="{}.ctp".format(gwename), + ) + + # Instantiating MODFLOW 6 transport source-sink mixing package + flopy.mf6.ModflowGwessm( + gwe, sources=[[]], filename="{}.ssm".format(gwename) + ) + + # Instantiate MODFLOW 6 heat transport output control package + flopy.mf6.ModflowGweoc( + gwe, + budget_filerecord="{}.cbc".format(gwename), + temperature_filerecord="{}.ucn".format(gwename), + temperatureprintrecord=[ + ("COLUMNS", 10, "WIDTH", 15, "DIGITS", 6, "GENERAL") + ], + saverecord=[("TEMPERATURE", "ALL"), ("BUDGET", "ALL")], + printrecord=[("TEMPERATURE", "ALL"), ("BUDGET", "ALL")], + ) + + # Instantiating MODFLOW 6 flow-transport exchange mechanism + flopy.mf6.ModflowGwfgwe( + sim, + exgtype="GWF6-GWE6", + exgmnamea=gwfname, + exgmnameb=gwename, + filename="{}.gwfgwe".format(name), + ) + + return sim, None + + +def check_output(idx, test): + print("evaluating results...") + + # read transport results from GWE model + name = cases[idx] + gwename = "gwe-" + name + + fpth = os.path.join(test.workspace, f"{gwename}.ucn") + try: + # load temperatures + cobj = flopy.utils.HeadFile( + fpth, precision="double", text="TEMPERATURE" + ) + conc1 = cobj.get_alldata() + except: + assert False, f'could not load concentration data from "{fpth}"' + + # This is the answer + c_ans = [ + 4.00000000e01, + 3.99999983e01, + 3.99999898e01, + 3.99999566e01, + 3.99998462e01, + 3.99995197e01, + 3.99986427e01, + 3.99964775e01, + 3.99915230e01, + 3.99809477e01, + 3.99597839e01, + 3.99198995e01, + 3.98488519e01, + 3.97288247e01, + 3.95359427e01, + 3.92403042e01, + 3.88070317e01, + 3.81985089e01, + 3.73777505e01, + 3.63125911e01, + 3.49801399e01, + 3.33708033e01, + 3.14911723e01, + 2.93652158e01, + 2.70334931e01, + 2.45504338e01, + 2.19800532e01, + 1.93907148e01, + 1.68496655e01, + 1.44180473e01, + 1.21469471e01, + 1.00748333e01, + 8.22648357e00, + 6.61329449e00, + 5.23470060e00, + 4.08034410e00, + 3.13261741e00, + 2.36924164e00, + 1.76562010e00, + 1.29679741e00, + 9.38944408e-01, + 6.70362685e-01, + 4.72056032e-01, + 3.27947150e-01, + 2.24829892e-01, + 1.52144844e-01, + 1.01654320e-01, + 6.70766201e-02, + 4.37223104e-02, + 2.81598160e-02, + 1.79249349e-02, + 1.12795213e-02, + 7.01828727e-03, + 4.31895689e-03, + 2.62924728e-03, + 1.58374083e-03, + 9.44125798e-04, + 5.57133590e-04, + 3.25507431e-04, + 1.88330495e-04, + 1.07925092e-04, + 6.12700035e-05, + 3.44648666e-05, + 1.92125906e-05, + 1.06157638e-05, + 5.81494908e-06, + 3.15821246e-06, + 1.70101068e-06, + 9.08679391e-07, + 4.81524218e-07, + 2.53159103e-07, + 1.32068539e-07, + 6.83748562e-08, + 3.51353218e-08, + 1.79225415e-08, + 9.07652498e-09, + 4.56413759e-09, + 2.27913640e-09, + 1.13033292e-09, + 5.56823550e-10, + 2.72491770e-10, + 1.32483548e-10, + 6.40015158e-11, + 3.07244529e-11, + 1.46584603e-11, + 6.95098705e-12, + 3.27643160e-12, + 1.53530190e-12, + 7.15261898e-13, + 3.31325318e-13, + 1.52616350e-13, + 6.99104644e-14, + 3.18504005e-14, + 1.44329547e-14, + 6.50576657e-15, + 2.91728603e-15, + 1.30145909e-15, + 5.77678170e-16, + 2.55141072e-16, + 1.12178999e-16, + 5.01900830e-17, + ] + + msg = f"gwe temperatures do not match stored concentrations" + assert np.allclose(conc1[-1, 0, 0, :], c_ans, atol=1e-5), msg + + nc_fpth = os.path.join(test.workspace, f"{gwename}.nc") + ds = xu.open_dataset(nc_fpth) + xds = ds.ugrid.to_dataset() + + # Compare NetCDF head arrays with binary headfile temperatures + gwe = test.sims[0].gwe[0] + dis = getattr(gwe, "dis") + tdis = getattr(test.sims[0], "tdis") + nper = getattr(tdis, "nper").data + nlay = getattr(dis, "nlay").data + pd = getattr(tdis, "perioddata").array + print(pd) + timestep = 0 + for i in range(nper): + for j in range(int(pd[i][1])): + rec = cobj.get_data(kstpkper=(j, i)) + for l in range(nlay): + assert np.allclose( + np.array(rec[l]).flatten(), + xds[f"temperature_l{l+1}"][timestep, :].data, + ), f"NetCDF-temperature comparison failure in timestep {timestep+1}" + timestep += 1 + + vlist = [ + "dis_delr", + "dis_delc", + "dis_top", + "dis_botm_l", + "dis_idomain_l", + "ic_strt_l", + "cnd_alh_l", + "cnd_ath1_l", + "cnd_ktw_l", + "cnd_kts_l", + ] + layer_vlist = [ + "dis_botm_l", + "dis_idomain_l", + "ic_strt_l", + "cnd_alh_l", + "cnd_ath1_l", + "cnd_ktw_l", + "cnd_kts_l", + ] + + # Compare NetCDF package input arrays with FloPy arrays + gwe = test.sims[0].gwe[0] + for i, var in enumerate(vlist): + tokens = var.split("_", 1) + package_name = tokens[0] + array_name = tokens[1].split("_")[0] + package = getattr(gwe, package_name) + b = getattr(package, array_name).array + if var in layer_vlist: + for l in range(nlay): + assert np.allclose( + np.array(b[l]).flatten(), xds[f"{var}{l+1}"].data + ), f"NetCDF input array comparison failure, variable={var}{l+1}" + else: + assert np.allclose( + np.array(b).flatten(), xds[var].data + ), f"NetCDF input array comparison failure, variable={var}" + + +# - No need to change any code below +@pytest.mark.parametrize( + "idx, name", + list(enumerate(cases)), +) +def test_mf6model(idx, name, function_tmpdir, targets): + test = TestFramework( + name=name, + workspace=function_tmpdir, + build=lambda t: build_models(idx, t), + check=lambda t: check_output(idx, t), + targets=targets, + ) + test.run() diff --git a/autotest/test_netcdf_gwf_disv.py b/autotest/test_netcdf_gwf_disv.py new file mode 100644 index 00000000000..f44cc546644 --- /dev/null +++ b/autotest/test_netcdf_gwf_disv.py @@ -0,0 +1,202 @@ +""" +Test of GWF DISV Package. Use the flopy disv tool to create +a simple regular grid example, but using DISV instead of DIS. +Use a large offset for x and y vertices to ensure that the area +calculation in MODFLOW 6 is correct. For the second case, set +one of the cells inactive and test to make sure connectivity +in binary grid file is correct. +""" + +import os + +import flopy +import numpy as np +import pytest +from flopy.utils.gridutil import get_disv_kwargs + +from framework import TestFramework + +try: + import xarray as xa + import xugrid as xu +except ImportError: + pytest.skip("xuarray and xugrid not found", allow_module_level=True) + +cases = ["disv01a_ncf", "disv01b_ncf"] + +wkt = ( + 'PROJCS["NAD83 / UTM zone 18N", ' + 'GEOGCS["NAD83", ' + 'DATUM["North_American_Datum_1983", ' + 'SPHEROID["GRS 1980",6378137,298.257222101], ' + 'TOWGS84[0,0,0,0,0,0,0]], ' + 'PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]], ' + 'UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]], ' + 'AUTHORITY["EPSG","4269"]], ' + 'PROJECTION["Transverse_Mercator"], ' + 'PARAMETER["latitude_of_origin",0], ' + 'PARAMETER["central_meridian",-75], ' + 'PARAMETER["scale_factor",0.9996], ' + 'PARAMETER["false_easting",500000], ' + 'PARAMETER["false_northing",0], ' + 'UNIT["metre",1,AUTHORITY["EPSG","9001"]], ' + 'AXIS["Easting",EAST], ' + 'AXIS["Northing",NORTH], ' + 'AUTHORITY["EPSG","26918"]]' +) + + +def build_models(idx, test): + name = cases[idx] + ws = test.workspace + nlay = 3 + nrow = 3 + ncol = 3 + delr = 10.0 + delc = 10.0 + top = 0 + botm = [-10, -20, -30] + xoff = 100000000.0 + yoff = 100000000.0 + disvkwargs = get_disv_kwargs( + nlay, + nrow, + ncol, + delr, + delc, + top, + botm, + xoff, + yoff, + ) + disvkwargs["export_array_netcdf"] = True + if idx == 1: + # for the second test, set one cell to idomain = 0 + idomain = np.ones((nlay, nrow * ncol), dtype=int) + idomain[0, 1] = 0 + disvkwargs["idomain"] = idomain + + sim = flopy.mf6.MFSimulation( + sim_name=name, + version="mf6", + exe_name="mf6", + sim_ws=ws, + ) + tdis = flopy.mf6.ModflowTdis( + sim, time_units="DAYS", start_date_time="2041-01-01T00:00:00-05:00" + ) + gwf = flopy.mf6.ModflowGwf(sim, modelname=name, export_netcdf="ugrid") + ims = flopy.mf6.ModflowIms(sim, print_option="SUMMARY") + disv = flopy.mf6.ModflowGwfdisv(gwf, **disvkwargs) + # netcdf configuration + ncf = flopy.mf6.ModflowUtlncf(disv, ogc_wkt=wkt, filename=f"{name}.disv.ncf") + ic = flopy.mf6.ModflowGwfic(gwf, export_array_netcdf=True, strt=0.0) + npf = flopy.mf6.ModflowGwfnpf(gwf, export_array_netcdf=True) + spd = {0: [[(0, 0), 1.0], [(0, nrow * ncol - 1), 0.0]]} + chd = flopy.mf6.modflow.mfgwfchd.ModflowGwfchd(gwf, stress_period_data=spd) + # output control + oc = flopy.mf6.ModflowGwfoc( + gwf, + # budget_filerecord=f"{name}.cbc", + head_filerecord=f"{name}.hds", + # headprintrecord=[("COLUMNS", 10, "WIDTH", 15, "DIGITS", 6, "GENERAL")], + # saverecord=[("HEAD", "ALL"), ("BUDGET", "ALL")], + saverecord=[ + ("HEAD", "ALL"), + ], + # printrecord=[("HEAD", "LAST"), ("BUDGET", "ALL")], + ) + return sim, None + + +def check_output(idx, test): + name = test.name + + fname = os.path.join(test.workspace, name + ".disv.grb") + grbobj = flopy.mf6.utils.MfGrdFile(fname) + ncpl = grbobj._datadict["NCPL"] + ia = grbobj._datadict["IA"] + ja = grbobj._datadict["JA"] + + if idx == 1: + # assert ncpl == disvkwargs["ncpl"] + assert np.array_equal(ia[0:4], np.array([1, 4, 4, 7])) + assert np.array_equal(ja[:6], np.array([1, 4, 10, 3, 6, 12])) + assert ia[-1] == 127 + assert ia.shape[0] == 28, "ia should have size of 28" + assert ja.shape[0] == 126, "ja should have size of 126" + + # Check NetCDF output + nc_fpth = os.path.join(test.workspace, name + ".nc") + ds = xu.open_dataset(nc_fpth) + xds = ds.ugrid.to_dataset() + + hds_fpth = os.path.join(test.workspace, name + ".hds") + hds = flopy.utils.HeadFile(hds_fpth, precision="double") + + # Compare NetCDF head arrays with binary headfile + gwf = test.sims[0].gwf[0] + disv = getattr(gwf, "disv") + tdis = getattr(test.sims[0], "tdis") + nper = getattr(tdis, "nper").data + nlay = getattr(disv, "nlay").data + pd = getattr(tdis, "perioddata").array + timestep = 0 + for i in range(nper): + for j in range(pd[i][1]): + rec = hds.get_data(kstpkper=(j, i)) + for l in range(nlay): + assert np.allclose( + np.array(rec[l]).flatten(), + #xds[f"head_l{l+1}"][timestep, :].data, + xds[f"head_l{l+1}"][timestep, :].fillna(1.00000000e+30).data, + ), f"NetCDF-Headfile comparison failure in timestep {timestep+1}" + timestep += 1 + + # NetCDF variables + vlist = [ + "disv_top", + "disv_botm_l", + "npf_icelltype_l", + "npf_k_l", + "ic_strt_l", + ] + + # NetCDF layered variable basenames + layer_vlist = [ + "disv_botm_l", + "npf_icelltype_l", + "npf_k_l", + "ic_strt_l", + ] + + # Compare NetCDF package input arrays with FloPy arrays + for i, var in enumerate(vlist): + tokens = var.split("_", 1) + package_name = tokens[0] + array_name = tokens[1].split("_")[0] + package = getattr(gwf, package_name) + b = getattr(package, array_name).array + if var in layer_vlist: + for l in range(nlay): + assert np.allclose( + np.array(b[l]).flatten(), xds[f"{var}{l+1}"].data + ), f"NetCDF input array comparison failure, variable={var}{l+1}" + else: + assert np.allclose( + np.array(b).flatten(), xds[var].data + ), f"NetCDF input array comparison failure, variable={var}" + + +@pytest.mark.netcdf +@pytest.mark.parametrize("idx, name", enumerate(cases)) +def test_mf6model(idx, name, function_tmpdir, targets): + test = TestFramework( + name=name, + workspace=function_tmpdir, + targets=targets, + build=lambda t: build_models(idx, t), + check=lambda t: check_output(idx, t), + compare=None, + ) + test.run() diff --git a/autotest/test_netcdf_gwf_sto01.py b/autotest/test_netcdf_gwf_sto01.py new file mode 100644 index 00000000000..fee90e12f4b --- /dev/null +++ b/autotest/test_netcdf_gwf_sto01.py @@ -0,0 +1,460 @@ +import os + +import flopy +import numpy as np +import pytest + +from framework import TestFramework +from conftest import try_get_target + +try: + import xarray as xa + import xugrid as xu +except ImportError: + pytest.skip("xuarray and xugrid not found", allow_module_level=True) + +cases = ["gwf_sto01_ncf"] +cmppth = "mfnwt" +tops = [0.0] +htol = [None for _ in range(len(cases))] +dtol = 1e-3 +budtol = 1e-2 +bud_lst = ["STO-SS_IN", "STO-SS_OUT", "STO-SY_IN", "STO-SY_OUT"] + +# static model data +# temporal discretization +nper = 31 +perlen = [1.0] + [365.2500000 for _ in range(nper - 1)] +nstp = [1] + [6 for _ in range(nper - 1)] +tsmult = [1.0] + [1.3 for _ in range(nper - 1)] +# tsmult = [1.0] + [1.0 for i in range(nper - 1)] +steady = [True] + [False for _ in range(nper - 1)] +tdis_rc = [] +for i in range(nper): + tdis_rc.append((perlen[i], nstp[i], tsmult[i])) + +# spatial discretization data +nlay, nrow, ncol = 3, 10, 10 +shape3d = (nlay, nrow, ncol) +size3d = nlay * nrow * ncol +delr, delc = 1000.0, 2000.0 +botm = [-100, -150.0, -350.0] +strt = 0.0 +hnoflo = 1e30 +hdry = -1e30 + +# calculate hk +hk1fact = 1.0 / 50.0 +hk1 = np.ones((nrow, ncol), dtype=float) * 0.5 * hk1fact +hk1[0, :] = 1000.0 * hk1fact +hk1[-1, :] = 1000.0 * hk1fact +hk1[:, 0] = 1000.0 * hk1fact +hk1[:, -1] = 1000.0 * hk1fact +hk = [20.0, hk1, 5.0] + +# calculate vka +vka = [1e6, 7.5e-5, 1e6] + +# all cells are active and layer 1 is convertible +ib = 1 +laytyp = [1, 0, 0] + +# solver options +nouter, ninner = 500, 300 +hclose, rclose, relax = 1e-9, 1e-6, 1.0 +newtonoptions = "NEWTON" +imsla = "BICGSTAB" + +# chd data +c = [] +c6 = [] +ccol = [3, 4, 5, 6] +for j in ccol: + c.append([0, nrow - 1, j, strt, strt]) + c6.append([(0, nrow - 1, j), strt]) +cd = {0: c} +cd6 = {0: c6} +maxchd = len(cd[0]) + +# pumping well data +wr = [0, 0, 0, 0, 1, 1, 2, 2, 3, 3] +wc = [0, 1, 8, 9, 0, 9, 0, 9, 0, 0] +wrp = [2, 2, 3, 3] +wcp = [5, 6, 5, 6] +wq = [-14000.0, -8000.0, -5000.0, -3000.0] +d = [] +d6 = [] +for r, c, q in zip(wrp, wcp, wq): + d.append([2, r, c, q]) + d6.append([(2, r, c), q]) +wd = {1: d} +wd6 = {1: d6} +maxwel = len(wd[1]) + +# recharge data +q = 3000.0 / (delr * delc) +v = np.zeros((nrow, ncol), dtype=float) +for r, c in zip(wr, wc): + v[r, c] = q +rech = {0: v} + +# storage and compaction data +ske = [6e-4, 3e-4, 6e-4] + +wkt = ( + 'PROJCS["NAD83 / UTM zone 18N", ' + 'GEOGCS["NAD83", ' + 'DATUM["North_American_Datum_1983", ' + 'SPHEROID["GRS 1980",6378137,298.257222101], ' + 'TOWGS84[0,0,0,0,0,0,0]], ' + 'PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]], ' + 'UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]], ' + 'AUTHORITY["EPSG","4269"]], ' + 'PROJECTION["Transverse_Mercator"], ' + 'PARAMETER["latitude_of_origin",0], ' + 'PARAMETER["central_meridian",-75], ' + 'PARAMETER["scale_factor",0.9996], ' + 'PARAMETER["false_easting",500000], ' + 'PARAMETER["false_northing",0], ' + 'UNIT["metre",1,AUTHORITY["EPSG","9001"]], ' + 'AXIS["Easting",EAST], ' + 'AXIS["Northing",NORTH], ' + 'AUTHORITY["EPSG","26918"]]' +) + + +# variant SUB package problem 3 +def build_models(idx, test): + name = cases[idx] + + # build MODFLOW 6 files + ws = test.workspace + sim = flopy.mf6.MFSimulation( + sim_name=name, version="mf6", exe_name="mf6", sim_ws=ws + ) + # create tdis package + tdis = flopy.mf6.ModflowTdis( + sim, + time_units="DAYS", + start_date_time="2041-01-01T00:00:00-05:00", + nper=nper, + perioddata=tdis_rc, + ) + + # create gwf model + top = tops[idx] + zthick = [top - botm[0], botm[0] - botm[1], botm[1] - botm[2]] + elevs = [top] + botm + + gwf = flopy.mf6.ModflowGwf( + sim, + modelname=name, + newtonoptions=newtonoptions, + save_flows=True, + export_netcdf="ugrid", + ) + + # create iterative model solution and register the gwf model with it + ims = flopy.mf6.ModflowIms( + sim, + print_option="SUMMARY", + outer_dvclose=hclose, + outer_maximum=nouter, + under_relaxation="NONE", + inner_maximum=ninner, + inner_dvclose=hclose, + rcloserecord=rclose, + linear_acceleration=imsla, + scaling_method="NONE", + reordering_method="NONE", + relaxation_factor=relax, + ) + sim.register_ims_package(ims, [gwf.name]) + + dis = flopy.mf6.ModflowGwfdis( + gwf, + export_array_netcdf=True, + nlay=nlay, + nrow=nrow, + ncol=ncol, + delr=delr, + delc=delc, + top=top, + botm=botm, + filename=f"{name}.dis", + ) + + # netcdf configuration + flopy.mf6.ModflowUtlncf( + dis, + ogc_wkt=wkt, + filename=f"{name}.dis.ncf", + ) + + # initial conditions + ic = flopy.mf6.ModflowGwfic( + gwf, export_array_netcdf=True, strt=strt, filename=f"{name}.ic" + ) + + # node property flow + npf = flopy.mf6.ModflowGwfnpf( + gwf, + save_flows=False, + export_array_netcdf=True, + # dev_modflowusg_upstream_weighted_saturation=True, + icelltype=laytyp, + k=hk, + k33=vka, + ) + # storage + sto = flopy.mf6.ModflowGwfsto( + gwf, + save_flows=False, + iconvert=laytyp, + ss=ske, + sy=0, + storagecoefficient=None, + steady_state={0: True}, + transient={1: True}, + ) + + # recharge + rch = flopy.mf6.ModflowGwfrcha(gwf, readasarrays=True, recharge=rech) + + # wel file + wel = flopy.mf6.ModflowGwfwel( + gwf, + print_input=True, + print_flows=True, + maxbound=maxwel, + stress_period_data=wd6, + save_flows=False, + ) + + # chd files + chd = flopy.mf6.modflow.mfgwfchd.ModflowGwfchd( + gwf, maxbound=maxchd, stress_period_data=cd6, save_flows=False + ) + + # output control + oc = flopy.mf6.ModflowGwfoc( + gwf, + budget_filerecord=f"{name}.cbc", + head_filerecord=f"{name}.hds", + headprintrecord=[("COLUMNS", 10, "WIDTH", 15, "DIGITS", 6, "GENERAL")], + saverecord=[("HEAD", "ALL"), ("BUDGET", "ALL")], + printrecord=[("HEAD", "LAST"), ("BUDGET", "ALL")], + ) + + # build MODFLOW-NWT files + cpth = cmppth + ws = os.path.join(test.workspace, cpth) + mc = flopy.modflow.Modflow( + name, + model_ws=ws, + version=cpth, + exe_name=try_get_target(test.targets, "mfnwt"), + ) + dis = flopy.modflow.ModflowDis( + mc, + nlay=nlay, + nrow=nrow, + ncol=ncol, + nper=nper, + perlen=perlen, + nstp=nstp, + tsmult=tsmult, + steady=steady, + delr=delr, + delc=delc, + top=top, + botm=botm, + ) + bas = flopy.modflow.ModflowBas( + mc, ibound=ib, strt=strt, hnoflo=hnoflo, stoper=0.01 + ) + upw = flopy.modflow.ModflowUpw( + mc, + laytyp=laytyp, + ipakcb=1001, + hk=hk, + vka=vka, + ss=ske, + sy=0.0, + hdry=hdry, + ) + chd = flopy.modflow.ModflowChd(mc, stress_period_data=cd) + rch = flopy.modflow.ModflowRch(mc, rech=rech) + wel = flopy.modflow.ModflowWel(mc, stress_period_data=wd) + oc = flopy.modflow.ModflowOc( + mc, + stress_period_data=None, + save_every=1, + save_types=["save head", "save budget"], + ) + fluxtol = (float(nlay * nrow * ncol) - 4.0) * rclose + nwt = flopy.modflow.ModflowNwt( + mc, + headtol=hclose, + fluxtol=fluxtol, + maxiterout=nouter, + linmeth=2, + maxitinner=ninner, + unitnumber=132, + options="SPECIFIED", + backflag=0, + idroptol=0, + ) + return sim, mc + + +def check_output(idx, test): + # get results from listing file + fpth = os.path.join(test.workspace, f"{os.path.basename(test.name)}.lst") + budl = flopy.utils.Mf6ListBudget(fpth) + names = list(bud_lst) + d0 = budl.get_budget(names=names)[0] + dtype = d0.dtype + nbud = d0.shape[0] + + # get results from cbc file + cbc_bud = ["STO-SS", "STO-SY"] + d = np.recarray(nbud, dtype=dtype) + for key in bud_lst: + d[key] = 0.0 + fpth = os.path.join(test.workspace, f"{os.path.basename(test.name)}.cbc") + cobj = flopy.utils.CellBudgetFile(fpth, precision="double") + kk = cobj.get_kstpkper() + times = cobj.get_times() + for i, (k, t) in enumerate(zip(kk, times)): + for text in cbc_bud: + qin = 0.0 + qout = 0.0 + v = cobj.get_data(kstpkper=k, text=text)[0] + if isinstance(v, np.recarray): + vt = np.zeros(size3d, dtype=float) + for jdx, node in enumerate(v["node"]): + vt[node - 1] += v["q"][jdx] + v = vt.reshape(shape3d) + for kk in range(v.shape[0]): + for ii in range(v.shape[1]): + for jj in range(v.shape[2]): + vv = v[kk, ii, jj] + if vv < 0.0: + qout -= vv + else: + qin += vv + d["totim"][i] = t + d["time_step"][i] = k[0] + d["stress_period"] = k[1] + key = f"{text}_IN" + d[key][i] = qin + key = f"{text}_OUT" + d[key][i] = qout + + diff = np.zeros((nbud, len(bud_lst)), dtype=float) + for i, key in enumerate(bud_lst): + diff[:, i] = d0[key] - d[key] + diffmax = np.abs(diff).max() + msg = f"maximum absolute total-budget difference ({diffmax}) " + + # write summary + fpth = os.path.join( + test.workspace, f"{os.path.basename(test.name)}.bud.cmp.out" + ) + with open(fpth, "w") as f: + for i in range(diff.shape[0]): + if i == 0: + line = f"{'TIME':>10s}" + for key in bud_lst: + line += f"{key + '_LST':>25s}" + line += f"{key + '_CBC':>25s}" + line += f"{key + '_DIF':>25s}" + f.write(line + "\n") + line = f"{d['totim'][i]:10g}" + for ii, key in enumerate(bud_lst): + line += f"{d0[key][i]:25g}" + line += f"{d[key][i]:25g}" + line += f"{diff[i, ii]:25g}" + f.write(line + "\n") + + if diffmax > budtol: + test.success = False + msg += f"exceeds {dtol}" + assert diffmax < dtol, msg + else: + test.success = True + print(" " + msg) + + # Check NetCDF output + nc_fname = f"{os.path.basename(test.name)}.nc" + nc_fpth = os.path.join(test.workspace, nc_fname) + ds = xu.open_dataset(nc_fpth) + xds = ds.ugrid.to_dataset() + + hds_fpth = os.path.join( + test.workspace, f"{os.path.basename(test.name)}.hds" + ) + hds = flopy.utils.HeadFile(hds_fpth, precision="double") + + # Compare NetCDF head arrays with binary headfile + timestep = 0 + for i in range(nper): + for j in range(nstp[i]): + rec = hds.get_data(kstpkper=(j, i)) + for l in range(nlay): + assert np.allclose( + np.array(rec[l]).flatten(), + xds[f"head_l{l+1}"][timestep, :].data, + ), f"NetCDF-Headfile comparison failure in timestep {timestep+1}" + timestep += 1 + + vlist = [ + "dis_delr", + "dis_delc", + "dis_top", + "dis_botm_l", + "npf_icelltype_l", # int + "npf_k_l", + "npf_k33_l", + "ic_strt_l", + ] + layer_vlist = [ + "dis_botm_l", + "npf_icelltype_l", + "npf_k_l", + "npf_k33_l", + "ic_strt_l", + ] + + # Compare NetCDF package input arrays with FloPy arrays + gwf = test.sims[0].gwf[0] + for i, var in enumerate(vlist): + tokens = var.split("_", 1) + package_name = tokens[0] + array_name = tokens[1].split("_")[0] + package = getattr(gwf, package_name) + b = getattr(package, array_name).array + if var in layer_vlist: + for l in range(nlay): + assert np.allclose( + np.array(b[l]).flatten(), xds[f"{var}{l+1}"].data + ), f"NetCDF input array comparison failure, variable={var}{l+1}" + else: + assert np.allclose( + np.array(b).flatten(), xds[var].data + ), f"NetCDF input array comparison failure, variable={var}" + + +@pytest.mark.netcdf +@pytest.mark.parametrize("idx, name", enumerate(cases)) +def test_mf6model(idx, name, function_tmpdir, targets): + test = TestFramework( + name=name, + workspace=function_tmpdir, + build=lambda t: build_models(idx, t), + check=lambda t: check_output(idx, t), + targets=targets, + htol=htol[idx], + ) + test.run() diff --git a/autotest/test_netcdf_gwt_dsp01.py b/autotest/test_netcdf_gwt_dsp01.py new file mode 100644 index 00000000000..96da1fd8125 --- /dev/null +++ b/autotest/test_netcdf_gwt_dsp01.py @@ -0,0 +1,476 @@ +import os + +import flopy +import numpy as np +import pytest + +from framework import TestFramework + +try: + import xarray as xa + import xugrid as xu +except ImportError: + pytest.skip("xuarray and xugrid not found", allow_module_level=True) + +cases = ["dsp01a_ncf", "dsp01b_ncf"] +xt3d = [False, True] + + +def build_models(idx, test): + nlay, nrow, ncol = 1, 1, 100 + nper = 1 + perlen = [5.0] + nstp = [200] + tsmult = [1.0] + steady = [True] + delr = 1.0 + delc = 1.0 + top = 1.0 + laytyp = 0 + ss = 0.0 + sy = 0.1 + botm = [0.0] + strt = 1.0 + hnoflo = 1e30 + hdry = -1e30 + hk = 1.0 + + c = {0: [[(0, 0, 0), 0.0000000], [(0, 0, 99), 0.0000000]]} + + nouter, ninner = 100, 300 + hclose, rclose, relax = 1e-6, 1e-6, 1.0 + + tdis_rc = [] + for i in range(nper): + tdis_rc.append((perlen[i], nstp[i], tsmult[i])) + + name = cases[idx] + + # build MODFLOW 6 files + ws = test.workspace + sim = flopy.mf6.MFSimulation( + sim_name=name, version="mf6", exe_name="mf6", sim_ws=ws + ) + # create tdis package + tdis = flopy.mf6.ModflowTdis( + sim, + time_units="DAYS", + start_date_time="2041-01-01T00:00:00-05:00", + nper=nper, + perioddata=tdis_rc, + ) + + # create gwf model + gwfname = "gwf_" + name + gwf = flopy.mf6.MFModel( + sim, + model_type="gwf6", + modelname=gwfname, + model_nam_file=f"{gwfname}.nam", + ) + gwf.name_file.save_flows = True + + # create iterative model solution and register the gwf model with it + imsgwf = flopy.mf6.ModflowIms( + sim, + print_option="SUMMARY", + outer_dvclose=hclose, + outer_maximum=nouter, + under_relaxation="NONE", + inner_maximum=ninner, + inner_dvclose=hclose, + rcloserecord=rclose, + linear_acceleration="CG", + scaling_method="NONE", + reordering_method="NONE", + relaxation_factor=relax, + filename=f"{gwfname}.ims", + ) + sim.register_ims_package(imsgwf, [gwf.name]) + + dis = flopy.mf6.ModflowGwfdis( + gwf, + nlay=nlay, + nrow=nrow, + ncol=ncol, + delr=delr, + delc=delc, + top=top, + botm=botm, + idomain=np.ones((nlay, nrow, ncol), dtype=int), + filename=f"{gwfname}.dis", + ) + + # initial conditions + ic = flopy.mf6.ModflowGwfic(gwf, strt=strt, filename=f"{gwfname}.ic") + + # node property flow + npf = flopy.mf6.ModflowGwfnpf( + gwf, save_specific_discharge=True, icelltype=laytyp, k=hk, k33=hk + ) + + # chd files + chd = flopy.mf6.ModflowGwfchd( + gwf, + maxbound=len(c), + stress_period_data=c, + save_flows=False, + print_flows=True, + pname="CHD-1", + ) + + # output control + oc = flopy.mf6.ModflowGwfoc( + gwf, + budget_filerecord=f"{gwfname}.cbc", + head_filerecord=f"{gwfname}.hds", + headprintrecord=[("COLUMNS", 10, "WIDTH", 15, "DIGITS", 6, "GENERAL")], + saverecord=[("HEAD", "LAST"), ("BUDGET", "LAST")], + printrecord=[("HEAD", "LAST"), ("BUDGET", "LAST")], + ) + + # create gwt model + gwtname = "gwt_" + name + gwt = flopy.mf6.MFModel( + sim, + model_type="gwt6", + modelname=gwtname, + model_nam_file=f"{gwtname}.nam", + ) + gwt.name_file.save_flows = True + gwt.name_file.export_netcdf = "ugrid" + + # create iterative model solution and register the gwt model with it + imsgwt = flopy.mf6.ModflowIms( + sim, + print_option="SUMMARY", + outer_dvclose=hclose, + outer_maximum=nouter, + under_relaxation="NONE", + inner_maximum=ninner, + inner_dvclose=hclose, + rcloserecord=rclose, + linear_acceleration="BICGSTAB", + scaling_method="NONE", + reordering_method="NONE", + relaxation_factor=relax, + filename=f"{gwtname}.ims", + ) + sim.register_ims_package(imsgwt, [gwt.name]) + + dis = flopy.mf6.ModflowGwtdis( + gwt, + export_array_netcdf=True, + nlay=nlay, + nrow=nrow, + ncol=ncol, + delr=delr, + delc=delc, + top=top, + botm=botm, + idomain=1, + filename=f"{gwtname}.dis", + ) + + # initial conditions + ic = flopy.mf6.ModflowGwtic( + gwt, export_array_netcdf=True, strt=0.0, filename=f"{gwtname}.ic" + ) + + # advection + adv = flopy.mf6.ModflowGwtadv( + gwt, scheme="UPSTREAM", filename=f"{gwtname}.adv" + ) + + # dispersion + xt3d_off = not xt3d[idx] + dsp = flopy.mf6.ModflowGwtdsp( + gwt, + export_array_netcdf=True, + xt3d_off=xt3d_off, + diffc=100.0, + alh=0.0, + alv=0.0, + ath1=0.0, + atv=0.0, + filename=f"{gwtname}.dsp", + ) + + # constant concentration + fname = gwtname + ".cnc.obs.csv" + cnc_obs = {(fname): [("cnc000", "cnc", (0, 0, 0))]} + cnc_obs["digits"] = 15 + cncs = {0: [[(0, 0, 0), 1.0]]} + cnc = flopy.mf6.ModflowGwtcnc( + gwt, + maxbound=len(cncs), + stress_period_data=cncs, + print_flows=True, + save_flows=False, + observations=cnc_obs, + pname="CNC-1", + ) + + # mass storage and transfer + mst = flopy.mf6.ModflowGwtmst(gwt, porosity=0.1) + + # sources + ssm = flopy.mf6.ModflowGwtssm( + gwt, sources=[[]], print_flows=True, filename=f"{gwtname}.ssm" + ) + + # output control + oc = flopy.mf6.ModflowGwtoc( + gwt, + budget_filerecord=f"{gwtname}.cbc", + concentration_filerecord=f"{gwtname}.ucn", + concentrationprintrecord=[ + ("COLUMNS", 10, "WIDTH", 15, "DIGITS", 6, "GENERAL") + ], + # saverecord=[("CONCENTRATION", "LAST"), ("BUDGET", "LAST")], + # printrecord=[("CONCENTRATION", "LAST"), ("BUDGET", "LAST")], + saverecord=[("CONCENTRATION", "ALL")], + printrecord=[("CONCENTRATION", "ALL"), ("BUDGET", "ALL")], + ) + + # observations + obs_data0 = [("flow1", "flow-ja-face", (0, 0, 0), (0, 0, 1))] + obs_recarray = {f"{gwtname}.obs.csv": obs_data0} + obs = flopy.mf6.ModflowUtlobs( + gwt, + pname="gwt_obs", + filename=f"{gwtname}.obs", + digits=15, + print_input=True, + continuous=obs_recarray, + ) + + # GWF GWT exchange + gwfgwt = flopy.mf6.ModflowGwfgwt( + sim, + exgtype="GWF6-GWT6", + exgmnamea=gwfname, + exgmnameb=gwtname, + filename=f"{name}.gwfgwt", + ) + + return sim, None + + +def check_output(idx, test): + name = cases[idx] + gwtname = "gwt_" + name + + fpth = os.path.join(test.workspace, f"{gwtname}.ucn") + try: + cobj = flopy.utils.HeadFile( + fpth, precision="double", text="CONCENTRATION" + ) + conc = cobj.get_data() + except: + assert False, f'could not load data from "{fpth}"' + + # This is the answer to this problem. These concentrations are for + # time step 200. + cres = [ + [ + [ + 1.0, + 0.97472443, + 0.94947431, + 0.92427504, + 0.89915185, + 0.87412972, + 0.84923335, + 0.82448706, + 0.79991471, + 0.77553964, + 0.75138462, + 0.72747174, + 0.70382241, + 0.68045725, + 0.65739608, + 0.63465784, + 0.61226053, + 0.59022124, + 0.56855604, + 0.54727998, + 0.52640705, + 0.50595018, + 0.4859212, + 0.46633085, + 0.44718873, + 0.42850336, + 0.41028211, + 0.39253126, + 0.37525599, + 0.35846038, + 0.34214746, + 0.32631921, + 0.31097658, + 0.29611954, + 0.28174707, + 0.26785727, + 0.2544473, + 0.24151351, + 0.22905142, + 0.21705579, + 0.20552066, + 0.19443937, + 0.18380466, + 0.17360869, + 0.16384304, + 0.15449886, + 0.14556682, + 0.13703721, + 0.12889996, + 0.12114473, + 0.1137609, + 0.10673763, + 0.10006394, + 0.09372869, + 0.08772068, + 0.08202862, + 0.07664126, + 0.07154731, + 0.06673558, + 0.06219493, + 0.05791434, + 0.05388294, + 0.05009, + 0.04652499, + 0.04317758, + 0.04003765, + 0.03709534, + 0.03434103, + 0.03176537, + 0.0293593, + 0.02711402, + 0.02502107, + 0.02307224, + 0.02125967, + 0.01957579, + 0.01801336, + 0.01656542, + 0.01522538, + 0.01398691, + 0.01284404, + 0.01179109, + 0.01082267, + 0.00993375, + 0.00911954, + 0.0083756, + 0.00769775, + 0.00708212, + 0.00652511, + 0.00602341, + 0.00557398, + 0.00517407, + 0.00482116, + 0.00451303, + 0.0042477, + 0.00402344, + 0.00383879, + 0.00369253, + 0.00358368, + 0.00351152, + 0.00347556, + ] + ] + ] + cres = np.array(cres) + assert np.allclose( + cres, conc + ), "simulated concentrations do not match with known solution." + + # load the gwt observation file + fname = gwtname + ".obs.csv" + fname = os.path.join(test.workspace, fname) + gwtobs = np.genfromtxt(fname, names=True, delimiter=",", deletechars="") + + # load the cnc observation file + fname = gwtname + ".cnc.obs.csv" + fname = os.path.join(test.workspace, fname) + cncobs = np.genfromtxt(fname, names=True, delimiter=",", deletechars="") + + # ensure flow right face for first cell is equal to cnc flows + errmsg = f"observations not equal:\n{gwtobs}\n{cncobs}" + assert np.allclose(gwtobs["FLOW1"], -cncobs["CNC000"]), errmsg + + # netcdf + nc_fpth = os.path.join(test.workspace, f"{gwtname}.nc") + ds = xu.open_dataset(nc_fpth) + xds = ds.ugrid.to_dataset() + + # Compare NetCDF head arrays with binary headfile concentrations + gwt = test.sims[0].gwt[0] + dis = getattr(gwt, "dis") + tdis = getattr(test.sims[0], "tdis") + nper = getattr(tdis, "nper").data + nlay = getattr(dis, "nlay").data + pd = getattr(tdis, "perioddata").array + timestep = 0 + for i in range(nper): + for j in range(pd[i][1]): + rec = cobj.get_data(kstpkper=(j, i)) + for l in range(nlay): + assert np.allclose( + np.array(rec[l]).flatten(), + xds[f"concentration_l{l+1}"][timestep, :].data, + ), f"NetCDF-concentration comparison failure in timestep {timestep+1}" + timestep += 1 + + vlist = [ + "dis_delr", + "dis_delc", + "dis_top", + "dis_botm_l", + "dis_idomain_l", + "ic_strt_l", + "dsp_diffc_l", + "dsp_alh_l", + "dsp_alv_l", + "dsp_ath1_l", + "dsp_atv_l", + ] + layer_vlist = [ + "dis_botm_l", + "dis_idomain_l", + "ic_strt_l", + "dsp_diffc_l", + "dsp_alh_l", + "dsp_alv_l", + "dsp_ath1_l", + "dsp_atv_l", + ] + + # Compare NetCDF package input arrays with FloPy arrays + gwt = test.sims[0].gwt[0] + for i, var in enumerate(vlist): + tokens = var.split("_", 1) + package_name = tokens[0] + array_name = tokens[1].split("_")[0] + package = getattr(gwt, package_name) + b = getattr(package, array_name).array + if var in layer_vlist: + for l in range(nlay): + assert np.allclose( + np.array(b[l]).flatten(), xds[f"{var}{l+1}"].data + ), f"NetCDF input array comparison failure, variable={var}{l+1}" + else: + assert np.allclose( + np.array(b).flatten(), xds[var].data + ), f"NetCDF input array comparison failure, variable={var}" + + +@pytest.mark.netcdf +@pytest.mark.parametrize("idx, name", enumerate(cases)) +def test_mf6model(idx, name, function_tmpdir, targets): + test = TestFramework( + name=name, + workspace=function_tmpdir, + targets=targets, + build=lambda t: build_models(idx, t), + check=lambda t: check_output(idx, t), + ) + test.run() diff --git a/autotest/test_netcdf_gwt_prudic2004t2.py b/autotest/test_netcdf_gwt_prudic2004t2.py new file mode 100644 index 00000000000..b8db8def9ff --- /dev/null +++ b/autotest/test_netcdf_gwt_prudic2004t2.py @@ -0,0 +1,1061 @@ +""" +Second problem described by Prudic et al (2004) +This problem involves transport through an aquifers, lakes and streams. +It requires the use of the Water Mover Package to send water from a stream, +into a lake, and then back into another stream. Solute is also transport +through the system. +""" + +import os +import sys + +import flopy +import numpy as np +import pytest + +from conftest import project_root_path +from framework import TestFramework + +try: + import xarray as xa + import xugrid as xu +except ImportError: + pytest.skip("xuarray and xugrid not found", allow_module_level=True) + +cases = ["prudic2004t2"] +data_path = project_root_path / "autotest" / "data" +model_path = data_path / "prudic2004test2" +fname = str(model_path / "lakibd.dat") +lakibd = np.loadtxt(fname, dtype=int) + + +def build_models(idx, test): + ws = test.workspace + name = cases[idx] + gwfname = "gwf_" + name + gwtname = "gwt_" + name + sim = flopy.mf6.MFSimulation( + sim_name=name, + version="mf6", + exe_name="mf6", + sim_ws=ws, + continue_=False, + memory_print_option="ALL", + ) + + # number of time steps for period 2 are reduced from 12 * 25 to 25 in + # order to speed up this autotest + tdis_rc = [(1.0, 1, 1.0), (365.25 * 25, 25, 1.0)] + nper = len(tdis_rc) + tdis = flopy.mf6.ModflowTdis( + sim, + time_units="DAYS", + start_date_time="2041-01-01T00:00:00-05:00", + nper=nper, + perioddata=tdis_rc, + ) + + gwf = flopy.mf6.ModflowGwf(sim, modelname=gwfname) + + # ims + hclose = 0.001 + rclose = 0.1 + nouter = 1000 + ninner = 100 + relax = 0.99 + imsgwf = flopy.mf6.ModflowIms( + sim, + print_option="ALL", + outer_dvclose=hclose, + outer_maximum=nouter, + under_relaxation="NONE", + inner_maximum=ninner, + inner_dvclose=hclose, + rcloserecord=rclose, + linear_acceleration="CG", + scaling_method="NONE", + reordering_method="NONE", + relaxation_factor=relax, + filename=f"{gwfname}.ims", + ) + + nlay = 8 + nrow = 36 + ncol = 23 + delr = 405.665 + delc = 403.717 + top = 100.0 + fname = str(model_path / "bot1.dat") + bot0 = np.loadtxt(fname) + botm = [bot0] + [bot0 - (15.0 * k) for k in range(1, nlay)] + fname = str(model_path / "idomain1.dat") + idomain0 = np.loadtxt(fname, dtype=int) + idomain = nlay * [idomain0] + dis = flopy.mf6.ModflowGwfdis( + gwf, + nlay=nlay, + nrow=nrow, + ncol=ncol, + delr=delr, + delc=delc, + top=top, + botm=botm, + idomain=idomain, + ) + idomain = dis.idomain.array + + ic = flopy.mf6.ModflowGwfic(gwf, strt=50.0) + + npf = flopy.mf6.ModflowGwfnpf( + gwf, + xt3doptions=False, + save_flows=True, + save_specific_discharge=True, + icelltype=[1] + 7 * [0], + k=250.0, + k33=125.0, + ) + + sto_on = False + if sto_on: + sto = flopy.mf6.ModflowGwfsto( + gwf, + save_flows=True, + iconvert=[1] + 7 * [0], + ss=1.0e-5, + sy=0.3, + steady_state={0: True}, + transient={1: False}, + ) + + oc = flopy.mf6.ModflowGwfoc( + gwf, + budget_filerecord=f"{gwfname}.bud", + head_filerecord=f"{gwfname}.hds", + headprintrecord=[ + ("COLUMNS", ncol, "WIDTH", 15, "DIGITS", 6, "GENERAL") + ], + saverecord=[("HEAD", "ALL"), ("BUDGET", "ALL")], + printrecord=[("HEAD", "ALL"), ("BUDGET", "ALL")], + ) + + rch_on = True + if rch_on: + rch = flopy.mf6.ModflowGwfrcha( + gwf, recharge={0: 4.79e-3}, pname="RCH-1" + ) + + chdlist = [] + fname = str(model_path / "chd.dat") + for line in open(fname, "r").readlines(): + ll = line.strip().split() + if len(ll) == 4: + k, i, j, hd = ll + chdlist.append( + [ + ( + int(k) - 1, + int(i) - 1, + int(j) - 1, + ), + float(hd), + ] + ) + chd = flopy.mf6.ModflowGwfchd( + gwf, stress_period_data=chdlist, pname="CHD-1" + ) + + rivlist = [] + fname = str(model_path / "riv.dat") + for line in open(fname, "r").readlines(): + ll = line.strip().split() + if len(ll) == 7: + k, i, j, s, c, rb, bn = ll + rivlist.append( + [ + ( + int(k) - 1, + int(i) - 1, + int(j) - 1, + ), + float(s), + float(c), + float(rb), + bn, + ] + ) + rivra = flopy.mf6.ModflowGwfriv.stress_period_data.empty( + gwf, maxbound=len(rivlist), boundnames=True + )[0] + for i, t in enumerate(rivlist): + rivra[i] = tuple(t) + sfrpd = np.genfromtxt(model_path / "sfr-packagedata.dat", names=True) + sfrpackagedata = flopy.mf6.ModflowGwfsfr.packagedata.empty( + gwf, boundnames=True, maxbound=sfrpd.shape[0] + ) + for name in sfrpackagedata.dtype.names: + if name in rivra.dtype.names: + sfrpackagedata[name] = rivra[name] + for name in sfrpackagedata.dtype.names: + if name in sfrpd.dtype.names: + sfrpackagedata[name] = sfrpd[name] + sfrpackagedata["boundname"] = rivra["boundname"] + with open(model_path / "sfr-connectiondata.dat") as f: + lines = f.readlines() + sfrconnectiondata = [] + for line in lines: + t = line.split() + c = [] + for v in t: + i = int(v) + c.append(i) + sfrconnectiondata.append(c) + sfrperioddata = {0: [[0, "inflow", 86400], [18, "inflow", 8640.0]]} + + sfr_on = True + if sfr_on: + sfr = flopy.mf6.ModflowGwfsfr( + gwf, + print_stage=True, + print_flows=True, + stage_filerecord=gwfname + ".sfr.bin", + budget_filerecord=gwfname + ".sfr.bud", + mover=True, + pname="SFR-1", + length_conversion=3.28084, + time_conversion=86400.0, + boundnames=True, + nreaches=len(rivlist), + packagedata=sfrpackagedata, + connectiondata=sfrconnectiondata, + perioddata=sfrperioddata, + ) + + lakeconnectiondata = [] + nlakecon = [0, 0] + lak_leakance = 1.0 + for i in range(nrow): + for j in range(ncol): + if lakibd[i, j] == 0: + continue + else: + ilak = lakibd[i, j] - 1 + # back + if i > 0: + if lakibd[i - 1, j] == 0 and idomain[0, i - 1, j]: + h = [ + ilak, + nlakecon[ilak], + (0, i - 1, j), + "horizontal", + lak_leakance, + 0.0, + 0.0, + delc / 2.0, + delr, + ] + nlakecon[ilak] += 1 + lakeconnectiondata.append(h) + # left + if j > 0: + if lakibd[i, j - 1] and idomain[0, i, j - 1] == 0: + h = [ + ilak, + nlakecon[ilak], + (0, i, j - 1), + "horizontal", + lak_leakance, + 0.0, + 0.0, + delr / 2.0, + delc, + ] + nlakecon[ilak] += 1 + lakeconnectiondata.append(h) + # right + if j < ncol - 1: + if lakibd[i, j + 1] == 0 and idomain[0, i, j + 1]: + h = [ + ilak, + nlakecon[ilak], + (0, i, j + 1), + "horizontal", + lak_leakance, + 0.0, + 0.0, + delr / 2.0, + delc, + ] + nlakecon[ilak] += 1 + lakeconnectiondata.append(h) + # front + if i < nrow - 1: + if lakibd[i + 1, j] == 0 and idomain[0, i + 1, j]: + h = [ + ilak, + nlakecon[ilak], + (0, i + 1, j), + "horizontal", + lak_leakance, + 0.0, + 0.0, + delc / 2.0, + delr, + ] + nlakecon[ilak] += 1 + lakeconnectiondata.append(h) + # vertical + v = [ + ilak, + nlakecon[ilak], + (1, i, j), + "vertical", + lak_leakance, + 0.0, + 0.0, + 0.0, + 0.0, + ] + nlakecon[ilak] += 1 + lakeconnectiondata.append(v) + + i, j = np.where(lakibd > 0) + idomain[0, i, j] = 0 + gwf.dis.idomain.set_data(idomain[0], layer=0, multiplier=[1]) + + lakpackagedata = [ + [0, 44.0, nlakecon[0], "lake1"], + [1, 35.2, nlakecon[1], "lake2"], + ] + # + outlets = [[0, 0, -1, "MANNING", 44.5, 5.000000, 0.03, 0.2187500e-02]] + + lake_on = True + if lake_on: + lak = flopy.mf6.ModflowGwflak( + gwf, + time_conversion=86400.000, + print_stage=True, + print_flows=True, + stage_filerecord=gwfname + ".lak.bin", + budget_filerecord=gwfname + ".lak.bud", + mover=True, + pname="LAK-1", + boundnames=True, + nlakes=2, + noutlets=len(outlets), + outlets=outlets, + packagedata=lakpackagedata, + connectiondata=lakeconnectiondata, + ) + + mover_on = True + if mover_on: + maxmvr, maxpackages = 2, 2 + mvrpack = [["SFR-1"], ["LAK-1"]] + mvrperioddata = [ + ["SFR-1", 5, "LAK-1", 0, "FACTOR", 1.0], + ["LAK-1", 0, "SFR-1", 6, "FACTOR", 1.0], + ] + mvr = flopy.mf6.ModflowGwfmvr( + gwf, + maxmvr=maxmvr, + print_flows=True, + maxpackages=maxpackages, + packages=mvrpack, + perioddata=mvrperioddata, + ) + + transport = True + if transport: + gwt = flopy.mf6.ModflowGwt(sim, modelname=gwtname) + gwt.name_file.export_netcdf = "ugrid" + + # ims + hclose = 0.001 + rclose = 0.001 + nouter = 50 + ninner = 20 + relax = 0.97 + imsgwt = flopy.mf6.ModflowIms( + sim, + print_option="ALL", + outer_dvclose=hclose, + outer_maximum=nouter, + inner_maximum=ninner, + under_relaxation="DBD", + under_relaxation_theta=0.7, + inner_dvclose=hclose, + rcloserecord=rclose, + linear_acceleration="BICGSTAB", + scaling_method="NONE", + reordering_method="NONE", + relaxation_factor=relax, + filename=f"{gwtname}.ims", + ) + sim.register_ims_package(imsgwt, [gwt.name]) + + dis = flopy.mf6.ModflowGwtdis( + gwt, + export_array_netcdf=True, + nlay=nlay, + nrow=nrow, + ncol=ncol, + delr=delr, + delc=delc, + top=top, + botm=botm, + idomain=idomain, + ) + ic = flopy.mf6.ModflowGwtic(gwt, export_array_netcdf=True, strt=0.0) + mst = flopy.mf6.ModflowGwtmst(gwt, porosity=0.3) + adv = flopy.mf6.ModflowGwtadv(gwt, scheme="TVD") + dsp = flopy.mf6.ModflowGwtdsp( + gwt, export_array_netcdf=True, alh=20.0, ath1=2, atv=0.2 + ) + sourcerecarray = [()] + ssm = flopy.mf6.ModflowGwtssm(gwt, sources=sourcerecarray) + cnclist = [ + [(0, 0, 11), 500.0], + [(0, 0, 12), 500.0], + [(0, 0, 13), 500.0], + [(0, 0, 14), 500.0], + [(1, 0, 11), 500.0], + [(1, 0, 12), 500.0], + [(1, 0, 13), 500.0], + [(1, 0, 14), 500.0], + ] + cnc = flopy.mf6.ModflowGwtcnc( + gwt, + maxbound=len(cnclist), + stress_period_data=cnclist, + save_flows=False, + pname="CNC-1", + ) + + lktpackagedata = [ + (0, 0.0, 99.0, 999.0, "mylake1"), + (1, 0.0, 99.0, 999.0, "mylake2"), + ] + lktperioddata = [ + (0, "STATUS", "ACTIVE"), + (1, "STATUS", "ACTIVE"), + ] + + lkt_obs = {} + for obstype in [ + "CONCENTRATION", + "STORAGE", + "CONSTANT", + "FROM-MVR", + "TO-MVR", + "RAINFALL", + "EVAPORATION", + "RUNOFF", + "EXT-INFLOW", + "WITHDRAWAL", + "EXT-OUTFLOW", + ]: + fname = f"{gwtname}.lkt.obs.{obstype.lower()}.csv" + obs1 = [] + ncv = 2 + if obstype == "TO-MVR": + ncv = 1 + obs1 = [(f"lkt{i + 1}", obstype, i + 1) for i in range(ncv)] + obs2 = [ + (f"blkt{i + 1}", obstype, f"mylake{i + 1}") for i in range(ncv) + ] + lkt_obs[fname] = obs1 + obs2 + + # add LKT specific obs + obstype = "LKT" + ncv = 2 + nconn = [67, 32] + fname = f"{gwtname}.lkt.obs.{obstype.lower()}.csv" + obs1 = [ + (f"lkt{1}-{iconn + 1}", obstype, 1, iconn + 1) + for iconn in range(nconn[0]) # lake 1 + ] + [ + (f"lkt{2}-{iconn + 1}", obstype, 2, iconn + 1) + for iconn in range(nconn[1]) # lake 2 + ] + obs2 = [ + (f"blkt{i + 1}", obstype, f"mylake{i + 1}") for i in range(ncv) + ] + lkt_obs[fname] = obs1 + obs2 + + lkt_obs["digits"] = 15 + lkt_obs["print_input"] = True + lkt_obs["filename"] = gwtname + ".lkt.obs" + + lkt_on = True + if lkt_on: + lkt = flopy.mf6.modflow.ModflowGwtlkt( + gwt, + boundnames=True, + save_flows=True, + print_input=True, + print_flows=True, + print_concentration=True, + concentration_filerecord=gwtname + ".lkt.bin", + budget_filerecord=gwtname + ".lkt.bud", + packagedata=lktpackagedata, + lakeperioddata=lktperioddata, + observations=lkt_obs, + pname="LAK-1", + auxiliary=["aux1", "aux2"], + ) + + sftpackagedata = [] + for irno in range(sfrpd.shape[0]): + t = (irno, 0.0, 99.0, 999.0, f"myreach{irno + 1}") + sftpackagedata.append(t) + + sftperioddata = [(0, "STATUS", "ACTIVE"), (0, "CONCENTRATION", 0.0)] + + sft_obs = {} + for obstype in [ + "CONCENTRATION", + "STORAGE", + "CONSTANT", + "FROM-MVR", + "TO-MVR", + "SFT", + "RAINFALL", + "EVAPORATION", + "RUNOFF", + "EXT-INFLOW", + "EXT-OUTFLOW", + ]: + fname = f"{gwtname}.sft.obs.{obstype.lower()}.csv" + obs1 = [ + (f"sft{i + 1}", obstype, i + 1) for i in range(sfrpd.shape[0]) + ] + obs2 = [ + (f"bsft{i + 1}", obstype, f"myreach{i + 1}") + for i in range(sfrpd.shape[0]) + ] + sft_obs[fname] = obs1 + obs2 + + obstype = "FLOW-JA-FACE" + fname = f"{gwtname}.sft.obs.{obstype.lower()}.csv" + obs1 = [] + for id1, reach_connections in enumerate(sfrconnectiondata): + for id2 in reach_connections: + id2 = abs(id2) + if id1 != id2: + obs1.append( + (f"sft{id1 + 1}x{id2 + 1}", obstype, id1 + 1, id2 + 1) + ) + obs2 = [ + (f"bsft{i + 1}", obstype, f"myreach{i + 1}") + for i in range(sfrpd.shape[0]) + ] + sft_obs[fname] = obs1 + obs2 + + # append additional obs attributes to obs dictionary + sft_obs["digits"] = 15 + sft_obs["print_input"] = True + sft_obs["filename"] = gwtname + ".sft.obs" + + sft_on = True + if sft_on: + sft = flopy.mf6.modflow.ModflowGwtsft( + gwt, + boundnames=True, + save_flows=True, + print_input=True, + print_flows=True, + print_concentration=True, + concentration_filerecord=gwtname + ".sft.bin", + budget_filerecord=gwtname + ".sft.bud", + packagedata=sftpackagedata, + reachperioddata=sftperioddata, + observations=sft_obs, + pname="SFR-1", + auxiliary=["aux1", "aux2"], + ) + + # mover transport package + mvt = flopy.mf6.modflow.ModflowGwtmvt(gwt) + + oc = flopy.mf6.ModflowGwtoc( + gwt, + budget_filerecord=f"{gwtname}.cbc", + concentration_filerecord=f"{gwtname}.ucn", + concentrationprintrecord=[ + ("COLUMNS", ncol, "WIDTH", 15, "DIGITS", 6, "GENERAL") + ], + saverecord=[("CONCENTRATION", "ALL"), ("BUDGET", "ALL")], + printrecord=[("CONCENTRATION", "ALL"), ("BUDGET", "ALL")], + ) + + # GWF GWT exchange + gwfgwt = flopy.mf6.ModflowGwfgwt( + sim, exgtype="GWF6-GWT6", exgmnamea=gwfname, exgmnameb=gwtname + ) + + return sim, None + + +def make_concentration_vs_time(sim): + print("making plot of concentration versus time...") + name = sim.name + ws = sim.workspace + sim = flopy.mf6.MFSimulation.load(sim_ws=ws) + gwfname = "gwf_" + name + gwtname = "gwt_" + name + gwf = sim.get_model(gwfname) + gwt = sim.get_model(gwtname) + + bobj = gwt.lkt.output.concentration() + lkaconc = bobj.get_alldata()[:, 0, 0, :] + times = bobj.times + bobj.file.close() + + bobj = gwt.sft.output.concentration() + sfaconc = bobj.get_alldata()[:, 0, 0, :] + times = bobj.times + bobj.file.close() + + import matplotlib.pyplot as plt + + plt.figure(figsize=(8, 5)) + times = np.array(times) / 365.0 + plt.plot(times, lkaconc[:, 0], "b-", label="Lake 1") + plt.plot(times, sfaconc[:, 30], "r-", label="Stream segment 3") + plt.plot(times, sfaconc[:, 37], "g-", label="Stream segment 4") + plt.legend() + plt.ylim(0, 50) + plt.xlim(0, 25) + plt.xlabel("TIME, IN YEARS") + plt.ylabel("SIMULATED BORON CONCENTRATION,\nIN MICROGRAMS PER LITER") + plt.draw() + fname = os.path.join(ws, "fig-concentration_vs_time.png") + print(f"Creating {fname}") + plt.savefig(fname) + + return + + +def make_concentration_map(sim): + print("making concentration map...") + + import matplotlib.pyplot as plt + + levels = [ + 1, + 10, + 25, + 50, + 100, + 150, + 200, + 250, + 300, + 350, + 400, + 450, + 500, + ] + + name = sim.name + ws = sim.workspace + simfp = flopy.mf6.MFSimulation.load(sim_ws=ws) + gwfname = "gwf_" + name + gwtname = "gwt_" + name + gwf = simfp.get_model(gwfname) + gwt = simfp.get_model(gwtname) + conc = gwt.output.concentration().get_data() + lakconc = gwt.lak.output.concentration().get_data().flatten() + + il, jl = np.where(lakibd > 0) + for i, j in zip(il, jl): + ilak = lakibd[i, j] - 1 + lake_conc = lakconc[ilak] + conc[0, i, j] = lake_conc + + fig, axs = plt.subplots(2, 2, figsize=(5, 7), dpi=300, tight_layout=True) + + # plot layers 1, 3, 5, and 8 + for iplot, ilay in enumerate([0, 2, 4, 7]): + ax = axs.flatten()[iplot] + pmv = flopy.plot.PlotMapView(model=gwt, ax=ax, layer=ilay) + # pmv.plot_grid() + pmv.plot_array(lakibd, masked_values=[0], alpha=0.2) + pmv.plot_inactive(color_noflow="gray", alpha=0.25) + # pmv.plot_bc(name="CHD-1", color="blue") + cs = pmv.contour_array(conc, levels=levels, masked_values=[1.0e30]) + ax.clabel(cs, cs.levels[::1], fmt="%1.0f", colors="b") + ax.set_title(f"Model layer {ilay + 1}") + + fname = os.path.join(ws, "fig-concentration.png") + print(f"Creating {fname}") + plt.savefig(fname) + + return + + +def check_obs(sim): + print("checking obs...") + name = sim.name + ws = sim.workspace + sim = flopy.mf6.MFSimulation.load(sim_ws=ws) + gwfname = "gwf_" + name + gwtname = "gwt_" + name + gwf = sim.get_model(gwfname) + gwt = sim.get_model(gwtname) + + # ensure SFT obs are the same whether specified by + # boundname or by reach + csvfiles = gwt.sft.obs.output.obs_names + for csvfile in csvfiles: + if ".flow-ja-face.csv" in csvfile: + continue + print(f"Checking csv file: {csvfile}") + conc_ra = gwt.sft.obs.output.obs(f=csvfile).data + # save a couple entries for comparison with lake + if ".to-mvr." in csvfile: + sft6tomvr = conc_ra[f"BSFT6"] + if ".from-mvr." in csvfile: + sft7tomvr = conc_ra[f"BSFT7"] + success = True + for ireach in range(38): + # print(f" Checking reach {ireach + 1}") + is_same = np.allclose( + conc_ra[f"SFT{ireach + 1}"], conc_ra[f"BSFT{ireach + 1}"] + ) + if not is_same: + success = False + for t, x, y in zip( + conc_ra["totim"], + conc_ra[f"SFT{ireach + 1}"], + conc_ra[f"BSFT{ireach + 1}"], + ): + print(t, x, y) + + # process the sft values and make sure the individual connection rates add up to the boundname rate + csvfile = "gwt_prudic2004t2.sft.obs.flow-ja-face.csv" + print(f"Checking csv file: {csvfile}") + conc_ra = gwt.sft.obs.output.obs(f=csvfile).data + ntimes = conc_ra.shape[0] + for ireach in range(38): + connection_sum = np.zeros(ntimes) + for column_name in conc_ra.dtype.names: + if f"SFT{ireach + 1}X" in column_name: + connection_sum += conc_ra[column_name] + is_same = np.allclose(connection_sum, conc_ra[f"BSFT{ireach + 1}"]) + if not is_same: + success = False + diff = connection_sum - conc_ra[f"BSFT{ireach + 1}"] + print( + f"Problem with SFT {ireach + 1}; mindiff {diff.min()} and maxdiff {diff.max()}" + ) + # for itime, (cs, bsft) in enumerate(zip(connection_sum, conc_ra[f"BSFT{ireach + 1}"])): + # print(itime, cs, bsft) + + assert success, "One or more SFT obs checks did not pass" + + # ensure LKT obs are the same whether specified by + # boundname or by reach + csvfiles = gwt.lkt.obs.output.obs_names + for csvfile in csvfiles: + if ".lkt.csv" in csvfile: + continue + print(f"Checking csv file: {csvfile}") + conc_ra = gwt.lkt.obs.output.obs(f=csvfile).data + if ".from-mvr." in csvfile: + lkt1frommvr = conc_ra[f"BLKT1"] + if ".to-mvr." in csvfile: + lkt1tomvr = conc_ra[f"BLKT1"] + success = True + if ".to-mvr." in csvfile: + numvalues = 1 # outlet + else: + numvalues = 2 # lakes + for ilake in range(numvalues): + # print(f" Checking lake {ilake + 1}") + is_same = np.allclose( + conc_ra[f"LKT{ilake + 1}"], conc_ra[f"BLKT{ilake + 1}"] + ) + if not is_same: + success = False + for t, x, y in zip( + conc_ra["totim"], + conc_ra[f"LKT{ilake + 1}"], + conc_ra[f"BLKT{ilake + 1}"], + ): + print(t, x, y) + + # process the lkt values and make sure the individual connection rates add up to the boundname rate + csvfile = "gwt_prudic2004t2.lkt.obs.lkt.csv" + print(f"Checking csv file: {csvfile}") + conc_ra = gwt.lkt.obs.output.obs(f=csvfile).data + ntimes = conc_ra.shape[0] + for ilake in [0, 1]: + connection_sum = np.zeros(ntimes) + for column_name in conc_ra.dtype.names: + if f"LKT{ilake + 1}" in column_name and column_name.startswith( + "LKT" + ): + connection_sum += conc_ra[column_name] + is_same = np.allclose(connection_sum, conc_ra[f"BLKT{ilake + 1}"]) + if not is_same: + success = False + print(f"Problem with Lake {ilake + 1}") + for itime, (cs, blkt) in enumerate( + zip(connection_sum, conc_ra[f"BLKT1"]) + ): + print(itime, cs, blkt) + + assert success, "One or more LKT obs checks did not pass" + + # check that SFT6 to-mvr is equal to LKT1 from-mvr + success = True + is_same = np.allclose(-sft6tomvr, lkt1frommvr, atol=0.1) + if not is_same: + success = False + print(f"Problem with sft6tomvr comparison to lkt1frommvr") + for itime, (a, b) in enumerate(zip(-sft6tomvr, lkt1frommvr)): + print(itime, a, b) + + is_same = np.allclose(-lkt1tomvr, sft7tomvr) + if not is_same: + success = False + print(f"Problem with lkt1tomvr comparison to sft7tomvr") + for itime, (a, b) in enumerate(zip(-lkt1tomvr, sft7tomvr)): + print(itime, a, b) + + assert success, "One or more SFT-LKT obs checks did not pass" + + +def check_output(idx, test): + makeplot = False + for arg in sys.argv: + if arg.lower() == "--makeplot": + makeplot = True + + if makeplot: + make_concentration_vs_time(test) + make_concentration_map(test) + + # ensure concentrations were saved + ws = test.workspace + name = test.name + gwtname = "gwt_" + name + + check_obs(test) + + fname = gwtname + ".lkt.bin" + fname = os.path.join(ws, fname) + bobj = flopy.utils.HeadFile( + fname, precision="double", text="concentration" + ) + lkaconc = bobj.get_alldata()[:, 0, 0, :] + times = bobj.times + bobj.file.close() + + fname = gwtname + ".sft.bin" + fname = os.path.join(ws, fname) + bobj = flopy.utils.HeadFile( + fname, precision="double", text="concentration" + ) + sfaconc = bobj.get_alldata()[:, 0, 0, :] + times = bobj.times + bobj.file.close() + + # set atol + atol = 0.02 + + # check simulated concentration in lak 1 and 2 sfr reaches + res_lak1 = lkaconc[:, 0] + ans_lak1 = [ + -1.73249951e-19, + 5.97398983e-02, + 4.18358112e-01, + 1.48857598e00, + 3.63202585e00, + 6.92925430e00, + 1.11162776e01, + 1.57328143e01, + 2.03088745e01, + 2.45013060e01, + 2.81200704e01, + 3.11132152e01, + 3.34833369e01, + 3.53028319e01, + 3.66693021e01, + 3.76781530e01, + 3.84188513e01, + 3.89615387e01, + 3.93577458e01, + 3.96464993e01, + 3.98598113e01, + 4.00184878e01, + 4.01377654e01, + 4.02288674e01, + 4.02998291e01, + 4.03563314e01, + ] + ans_lak1 = np.array(ans_lak1) + d = res_lak1 - ans_lak1 + msg = f"{res_lak1} {ans_lak1} {d}" + assert np.allclose(res_lak1, ans_lak1, atol=atol), msg + + res_sfr3 = sfaconc[:, 30] + ans_sfr3 = [ + -7.67944651e-23, + 5.11358249e-03, + 3.76169957e-02, + 1.42055634e-01, + 3.72438193e-01, + 7.74112522e-01, + 1.37336373e00, + 2.18151231e00, + 3.19993561e00, + 4.42853144e00, + 5.85660993e00, + 7.46619448e00, + 9.22646330e00, + 1.11069607e01, + 1.30764504e01, + 1.50977917e01, + 1.71329980e01, + 1.91636634e01, + 2.11530199e01, + 2.30688490e01, + 2.48821059e01, + 2.65691424e01, + 2.81080543e01, + 2.94838325e01, + 3.06909748e01, + 3.17352915e01, + ] + ans_sfr3 = np.array(ans_sfr3) + d = res_sfr3 - ans_sfr3 + msg = f"{res_sfr3} {ans_sfr3} {d}" + assert np.allclose(res_sfr3, ans_sfr3, atol=atol), msg + + res_sfr4 = sfaconc[:, 37] + ans_sfr4 = [ + -2.00171747e-20, + 3.55076535e-02, + 2.49465789e-01, + 8.91299656e-01, + 2.18622372e00, + 4.19920114e00, + 6.79501651e00, + 9.72255743e00, + 1.27208739e01, + 1.55989390e01, + 1.82462345e01, + 2.06258607e01, + 2.27255881e01, + 2.45721928e01, + 2.62061367e01, + 2.76640442e01, + 2.89788596e01, + 3.01814571e01, + 3.12842113e01, + 3.22945541e01, + 3.32174210e01, + 3.40539043e01, + 3.48027700e01, + 3.54636082e01, + 3.60384505e01, + 3.65330352e01, + ] + ans_sfr4 = np.array(ans_sfr4) + d = res_sfr4 - ans_sfr4 + msg = f"{res_sfr4} {ans_sfr4} {d}" + assert np.allclose(res_sfr4, ans_sfr4, atol=atol), msg + + # used to make results for the gwtgwt version of this problem + # fname = os.path.join(ws, f"result_conc_lak1.txt") + # np.savetxt(fname, res_lak1) + # fname = os.path.join(ws, f"result_conc_sfr3.txt") + # np.savetxt(fname, res_sfr3) + # fname = os.path.join(ws, f"result_conc_sfr4.txt") + # np.savetxt(fname, res_sfr4) + + # netcdf + nc_fpth = os.path.join(ws, f"{gwtname}.nc") + print(nc_fpth) + ds = xu.open_dataset(nc_fpth) + xds = ds.ugrid.to_dataset() + + cobj = flopy.utils.HeadFile( + os.path.join(ws, f"{gwtname}.ucn"), + precision="double", + text="CONCENTRATION", + ) + + # Compare NetCDF head arrays with binary headfile concentrations + gwt = test.sims[0].gwt[0] + dis = getattr(gwt, "dis") + tdis = getattr(test.sims[0], "tdis") + nper = getattr(tdis, "nper").data + nlay = getattr(dis, "nlay").data + pd = getattr(tdis, "perioddata").array + timestep = 0 + for i in range(nper): + for j in range(pd[i][1]): + rec = cobj.get_data(kstpkper=(j, i)) + for l in range(nlay): + assert np.allclose( + np.array(rec[l]).flatten(), + #xds[f"concentration_l{l+1}"][timestep, :].data, + xds[f"concentration_l{l+1}"][timestep, :].fillna(1.00000000e+30).data, + ), f"NetCDF-concentration comparison failure in timestep {timestep+1}" + timestep += 1 + + vlist = [ + "dis_delr", + "dis_delc", + "dis_top", + "dis_botm_l", + "dis_idomain_l", + "ic_strt_l", + "dsp_alh_l", + "dsp_ath1_l", + "dsp_atv_l", + ] + layer_vlist = [ + "dis_botm_l", + "dis_idomain_l", + "ic_strt_l", + "dsp_alh_l", + "dsp_ath1_l", + "dsp_atv_l", + ] + + # Compare NetCDF package input arrays with FloPy arrays + gwt = test.sims[0].gwt[0] + for i, var in enumerate(vlist): + tokens = var.split("_", 1) + package_name = tokens[0] + array_name = tokens[1].split("_")[0] + package = getattr(gwt, package_name) + b = getattr(package, array_name).array + if var in layer_vlist: + for l in range(nlay): + assert np.allclose( + np.array(b[l]).flatten(), xds[f"{var}{l+1}"].data + ), f"NetCDF input array comparison failure, variable={var}{l+1}" + else: + assert np.allclose( + np.array(b).flatten(), xds[var].data + ), f"NetCDF input array comparison failure, variable={var}" + + +@pytest.mark.slow +@pytest.mark.parametrize("idx, name", enumerate(cases)) +def test_mf6model(idx, name, function_tmpdir, targets): + test = TestFramework( + name=name, + workspace=function_tmpdir, + targets=targets, + build=lambda t: build_models(idx, t), + check=lambda t: check_output(idx, t), + ) + test.run() diff --git a/doc/mf6io/mf6ivar/dfn/gwe-cnd.dfn b/doc/mf6io/mf6ivar/dfn/gwe-cnd.dfn index d9d51b3011a..5214018101c 100644 --- a/doc/mf6io/mf6ivar/dfn/gwe-cnd.dfn +++ b/doc/mf6io/mf6ivar/dfn/gwe-cnd.dfn @@ -27,6 +27,15 @@ mf6internal export_ascii longname export array variables to layered ascii files. description keyword that specifies input griddata arrays should be written to layered ascii output files. +block options +name export_array_netcdf +type keyword +reader urword +optional true +mf6internal export_nc +longname export array variables to netcdf output files. +description keyword that specifies input griddata arrays should be written to the model output netcdf file. + # --------------------- gwe cnd griddata --------------------- block griddata diff --git a/doc/mf6io/mf6ivar/dfn/gwe-dis.dfn b/doc/mf6io/mf6ivar/dfn/gwe-dis.dfn index 2326105aa04..d8c771250ee 100644 --- a/doc/mf6io/mf6ivar/dfn/gwe-dis.dfn +++ b/doc/mf6io/mf6ivar/dfn/gwe-dis.dfn @@ -1,4 +1,5 @@ # --------------------- gwe dis options --------------------- +# mf6 subpackage utl-ncf block options name length_units @@ -49,6 +50,55 @@ mf6internal export_ascii longname export array variables to layered ascii files. description keyword that specifies input griddata arrays should be written to layered ascii output files. +block options +name export_array_netcdf +type keyword +reader urword +optional true +mf6internal export_nc +longname export array variables to netcdf output files. +description keyword that specifies input griddata arrays should be written to the model output netcdf file. + +block options +name ncf_filerecord +type record ncf6 filein ncf6_filename +reader urword +tagged true +optional true +longname +description + +block options +name ncf6 +type keyword +in_record true +reader urword +tagged true +optional false +longname ncf keyword +description keyword to specify that record corresponds to a netcdf configuration (NCF) file. + +block options +name filein +type keyword +in_record true +reader urword +tagged true +optional false +longname file keyword +description keyword to specify that an input filename is expected next. + +block options +name ncf6_filename +type string +preserve_case true +in_record true +reader urword +optional false +tagged false +longname file name of NCF information +description defines a netcdf configuration (NCF) input file. + # --------------------- gwe dis dimensions --------------------- block dimensions diff --git a/doc/mf6io/mf6ivar/dfn/gwe-disv.dfn b/doc/mf6io/mf6ivar/dfn/gwe-disv.dfn index ff91ef0cfd8..9216bb243e9 100644 --- a/doc/mf6io/mf6ivar/dfn/gwe-disv.dfn +++ b/doc/mf6io/mf6ivar/dfn/gwe-disv.dfn @@ -1,4 +1,5 @@ # --------------------- gwe disv options --------------------- +# mf6 subpackage utl-ncf block options name length_units @@ -49,6 +50,55 @@ mf6internal export_ascii longname export array variables to layered ascii files. description keyword that specifies input griddata arrays should be written to layered ascii output files. +block options +name export_array_netcdf +type keyword +reader urword +optional true +mf6internal export_nc +longname export array variables to netcdf output files. +description keyword that specifies input griddata arrays should be written to the model output netcdf file. + +block options +name ncf_filerecord +type record ncf6 filein ncf6_filename +reader urword +tagged true +optional true +longname +description + +block options +name ncf6 +type keyword +in_record true +reader urword +tagged true +optional false +longname ncf keyword +description keyword to specify that record corresponds to a netcdf configuration (NCF) file. + +block options +name filein +type keyword +in_record true +reader urword +tagged true +optional false +longname file keyword +description keyword to specify that an input filename is expected next. + +block options +name ncf6_filename +type string +preserve_case true +in_record true +reader urword +optional false +tagged false +longname file name of NCF information +description defines a netcdf configuration (NCF) input file. + # --------------------- gwe disv dimensions --------------------- block dimensions diff --git a/doc/mf6io/mf6ivar/dfn/gwe-ic.dfn b/doc/mf6io/mf6ivar/dfn/gwe-ic.dfn index 6bd80b3de63..ed8a1feab43 100644 --- a/doc/mf6io/mf6ivar/dfn/gwe-ic.dfn +++ b/doc/mf6io/mf6ivar/dfn/gwe-ic.dfn @@ -9,6 +9,15 @@ mf6internal export_ascii longname export array variables to layered ascii files. description keyword that specifies input griddata arrays should be written to layered ascii output files. +block options +name export_array_netcdf +type keyword +reader urword +optional true +mf6internal export_nc +longname export array variables to netcdf output files. +description keyword that specifies input griddata arrays should be written to the model output netcdf file. + # --------------------- gwe ic griddata --------------------- block griddata diff --git a/doc/mf6io/mf6ivar/dfn/gwe-nam.dfn b/doc/mf6io/mf6ivar/dfn/gwe-nam.dfn index 31aa8fd84b5..3f9f3b9e99f 100644 --- a/doc/mf6io/mf6ivar/dfn/gwe-nam.dfn +++ b/doc/mf6io/mf6ivar/dfn/gwe-nam.dfn @@ -33,6 +33,15 @@ optional true longname save flows for all packages to budget file description REPLACE save_flows {'{#1}': 'all model package'} +block options +name export_netcdf +type string +reader urword +optional true +mf6internal export_netcdf +longname export model output netcdf file. +description keyword that specifies timeseries data for the dependent variable should be written to a model output netcdf file. No value or ``UGRID'' (ugrid based export) values are supported. + # --------------------- gwe nam packages --------------------- block packages diff --git a/doc/mf6io/mf6ivar/dfn/gwf-dis.dfn b/doc/mf6io/mf6ivar/dfn/gwf-dis.dfn index 4406a57be44..fd6c553eb6d 100644 --- a/doc/mf6io/mf6ivar/dfn/gwf-dis.dfn +++ b/doc/mf6io/mf6ivar/dfn/gwf-dis.dfn @@ -1,4 +1,5 @@ # --------------------- gwf dis options --------------------- +# mf6 subpackage utl-ncf block options name length_units @@ -49,6 +50,55 @@ mf6internal export_ascii longname export array variables to layered ascii files. description keyword that specifies input griddata arrays should be written to layered ascii output files. +block options +name export_array_netcdf +type keyword +reader urword +optional true +mf6internal export_nc +longname export array variables to netcdf output files. +description keyword that specifies input griddata arrays should be written to the model output netcdf file. + +block options +name ncf_filerecord +type record ncf6 filein ncf6_filename +reader urword +tagged true +optional true +longname +description + +block options +name ncf6 +type keyword +in_record true +reader urword +tagged true +optional false +longname ncf keyword +description keyword to specify that record corresponds to a netcdf configuration (NCF) file. + +block options +name filein +type keyword +in_record true +reader urword +tagged true +optional false +longname file keyword +description keyword to specify that an input filename is expected next. + +block options +name ncf6_filename +type string +preserve_case true +in_record true +reader urword +optional false +tagged false +longname file name of NCF information +description defines a netcdf configuration (NCF) input file. + # --------------------- gwf dis dimensions --------------------- block dimensions @@ -126,5 +176,3 @@ layered true optional true longname idomain existence array description is an optional array that characterizes the existence status of a cell. If the IDOMAIN array is not specified, then all model cells exist within the solution. If the IDOMAIN value for a cell is 0, the cell does not exist in the simulation. Input and output values will be read and written for the cell, but internal to the program, the cell is excluded from the solution. If the IDOMAIN value for a cell is 1 or greater, the cell exists in the simulation. If the IDOMAIN value for a cell is -1, the cell does not exist in the simulation. Furthermore, the first existing cell above will be connected to the first existing cell below. This type of cell is referred to as a ``vertical pass through'' cell. - - diff --git a/doc/mf6io/mf6ivar/dfn/gwf-disv.dfn b/doc/mf6io/mf6ivar/dfn/gwf-disv.dfn index 17152994f5f..fe3a70db334 100644 --- a/doc/mf6io/mf6ivar/dfn/gwf-disv.dfn +++ b/doc/mf6io/mf6ivar/dfn/gwf-disv.dfn @@ -1,4 +1,5 @@ # --------------------- gwf disv options --------------------- +# mf6 subpackage utl-ncf block options name length_units @@ -47,7 +48,56 @@ reader urword optional true mf6internal export_ascii longname export array variables to layered ascii files. -description keyword that specifies input griddata arrays should be written to layered ascii output files. +description keyword that specifies input griddata arrays should be written to layered ascii output files. + +block options +name export_array_netcdf +type keyword +reader urword +optional true +mf6internal export_nc +longname export array variables to netcdf output files. +description keyword that specifies input griddata arrays should be written to the model output netcdf file. + +block options +name ncf_filerecord +type record ncf6 filein ncf6_filename +reader urword +tagged true +optional true +longname +description + +block options +name ncf6 +type keyword +in_record true +reader urword +tagged true +optional false +longname ncf keyword +description keyword to specify that record corresponds to a netcdf configuration (NCF) file. + +block options +name filein +type keyword +in_record true +reader urword +tagged true +optional false +longname file keyword +description keyword to specify that an input filename is expected next. + +block options +name ncf6_filename +type string +preserve_case true +in_record true +reader urword +optional false +tagged false +longname file name of NCF information +description defines a netcdf configuration (NCF) input file. # --------------------- gwf disv dimensions --------------------- diff --git a/doc/mf6io/mf6ivar/dfn/gwf-ic.dfn b/doc/mf6io/mf6ivar/dfn/gwf-ic.dfn index de93f781c33..f580987dea2 100644 --- a/doc/mf6io/mf6ivar/dfn/gwf-ic.dfn +++ b/doc/mf6io/mf6ivar/dfn/gwf-ic.dfn @@ -9,6 +9,15 @@ mf6internal export_ascii longname export array variables to layered ascii files. description keyword that specifies input griddata arrays should be written to layered ascii output files. +block options +name export_array_netcdf +type keyword +reader urword +optional true +mf6internal export_nc +longname export array variables to netcdf output files. +description keyword that specifies input griddata arrays should be written to the model output netcdf file. + # --------------------- gwf ic griddata --------------------- block griddata diff --git a/doc/mf6io/mf6ivar/dfn/gwf-nam.dfn b/doc/mf6io/mf6ivar/dfn/gwf-nam.dfn index f4e6ba4839f..70f22f2253c 100644 --- a/doc/mf6io/mf6ivar/dfn/gwf-nam.dfn +++ b/doc/mf6io/mf6ivar/dfn/gwf-nam.dfn @@ -58,6 +58,15 @@ optional true longname keyword to activate Newton-Raphson UNDER_RELAXATION option description keyword that indicates whether the groundwater head in a cell will be under-relaxed when water levels fall below the bottom of the model below any given cell. By default, Newton-Raphson UNDER\_RELAXATION is not applied. +block options +name export_netcdf +type string +reader urword +optional true +mf6internal export_netcdf +longname export model output netcdf file. +description keyword that specifies timeseries data for the dependent variable should be written to a model output netcdf file. No value or ``UGRID'' (ugrid based export) values are supported. + # --------------------- gwf nam packages --------------------- block packages diff --git a/doc/mf6io/mf6ivar/dfn/gwf-npf.dfn b/doc/mf6io/mf6ivar/dfn/gwf-npf.dfn index 23cb314c2ab..3937ea2eca0 100644 --- a/doc/mf6io/mf6ivar/dfn/gwf-npf.dfn +++ b/doc/mf6io/mf6ivar/dfn/gwf-npf.dfn @@ -233,6 +233,15 @@ mf6internal export_ascii longname export array variables to layered ascii files. description keyword that specifies input griddata arrays should be written to layered ascii output files. +block options +name export_array_netcdf +type keyword +reader urword +optional true +mf6internal export_nc +longname export array variables to netcdf output files. +description keyword that specifies input griddata arrays should be written to the model output netcdf file. + # dev options block options diff --git a/doc/mf6io/mf6ivar/dfn/gwf-sto.dfn b/doc/mf6io/mf6ivar/dfn/gwf-sto.dfn index 5c4042b492e..a658947a03c 100644 --- a/doc/mf6io/mf6ivar/dfn/gwf-sto.dfn +++ b/doc/mf6io/mf6ivar/dfn/gwf-sto.dfn @@ -78,6 +78,15 @@ mf6internal export_ascii longname export array variables to layered ascii files. description keyword that specifies input grid arrays, which already support the layered keyword, should be written to layered ascii output files. +block options +name export_array_netcdf +type keyword +reader urword +optional true +mf6internal export_nc +longname export array variables to netcdf output files. +description keyword that specifies input griddata arrays should be written to the model output netcdf file. + # dev options block options name dev_original_specific_storage diff --git a/doc/mf6io/mf6ivar/dfn/gwt-dis.dfn b/doc/mf6io/mf6ivar/dfn/gwt-dis.dfn index ac03a5e1a3f..a11f0ef487d 100644 --- a/doc/mf6io/mf6ivar/dfn/gwt-dis.dfn +++ b/doc/mf6io/mf6ivar/dfn/gwt-dis.dfn @@ -1,4 +1,5 @@ # --------------------- gwt dis options --------------------- +# mf6 subpackage utl-ncf block options name length_units @@ -49,6 +50,55 @@ mf6internal export_ascii longname export array variables to layered ascii files. description keyword that specifies input griddata arrays should be written to layered ascii output files. +block options +name export_array_netcdf +type keyword +reader urword +optional true +mf6internal export_nc +longname export array variables to netcdf output files. +description keyword that specifies input griddata arrays should be written to the model output netcdf file. + +block options +name ncf_filerecord +type record ncf6 filein ncf6_filename +reader urword +tagged true +optional true +longname +description + +block options +name ncf6 +type keyword +in_record true +reader urword +tagged true +optional false +longname ncf keyword +description keyword to specify that record corresponds to a netcdf configuration (NCF) file. + +block options +name filein +type keyword +in_record true +reader urword +tagged true +optional false +longname file keyword +description keyword to specify that an input filename is expected next. + +block options +name ncf6_filename +type string +preserve_case true +in_record true +reader urword +optional false +tagged false +longname file name of NCF information +description defines a netcdf configuration (NCF) input file. + # --------------------- gwt dis dimensions --------------------- block dimensions diff --git a/doc/mf6io/mf6ivar/dfn/gwt-disv.dfn b/doc/mf6io/mf6ivar/dfn/gwt-disv.dfn index b06062b6f93..119f33bd133 100644 --- a/doc/mf6io/mf6ivar/dfn/gwt-disv.dfn +++ b/doc/mf6io/mf6ivar/dfn/gwt-disv.dfn @@ -1,4 +1,5 @@ # --------------------- gwt disv options --------------------- +# mf6 subpackage utl-ncf block options name length_units @@ -49,6 +50,55 @@ mf6internal export_ascii longname export array variables to layered ascii files. description keyword that specifies input griddata arrays should be written to layered ascii output files. +block options +name export_array_netcdf +type keyword +reader urword +optional true +mf6internal export_nc +longname export array variables to netcdf output files. +description keyword that specifies input griddata arrays should be written to the model output netcdf file. + +block options +name ncf_filerecord +type record ncf6 filein ncf6_filename +reader urword +tagged true +optional true +longname +description + +block options +name ncf6 +type keyword +in_record true +reader urword +tagged true +optional false +longname ncf keyword +description keyword to specify that record corresponds to a netcdf configuration (NCF) file. + +block options +name filein +type keyword +in_record true +reader urword +tagged true +optional false +longname file keyword +description keyword to specify that an input filename is expected next. + +block options +name ncf6_filename +type string +preserve_case true +in_record true +reader urword +optional false +tagged false +longname file name of NCF information +description defines a netcdf configuration (NCF) input file. + # --------------------- gwt disv dimensions --------------------- block dimensions diff --git a/doc/mf6io/mf6ivar/dfn/gwt-dsp.dfn b/doc/mf6io/mf6ivar/dfn/gwt-dsp.dfn index 0b425db955e..5412ca694c7 100644 --- a/doc/mf6io/mf6ivar/dfn/gwt-dsp.dfn +++ b/doc/mf6io/mf6ivar/dfn/gwt-dsp.dfn @@ -27,6 +27,15 @@ mf6internal export_ascii longname export array variables to layered ascii files. description keyword that specifies input griddata arrays should be written to layered ascii output files. +block options +name export_array_netcdf +type keyword +reader urword +optional true +mf6internal export_nc +longname export array variables to netcdf output files. +description keyword that specifies input griddata arrays should be written to the model output netcdf file. + # --------------------- gwt dsp griddata --------------------- block griddata diff --git a/doc/mf6io/mf6ivar/dfn/gwt-ic.dfn b/doc/mf6io/mf6ivar/dfn/gwt-ic.dfn index d6d113d5c55..d9c3a89225d 100644 --- a/doc/mf6io/mf6ivar/dfn/gwt-ic.dfn +++ b/doc/mf6io/mf6ivar/dfn/gwt-ic.dfn @@ -9,6 +9,15 @@ mf6internal export_ascii longname export array variables to layered ascii files. description keyword that specifies input griddata arrays should be written to layered ascii output files. +block options +name export_array_netcdf +type keyword +reader urword +optional true +mf6internal export_nc +longname export array variables to netcdf output files. +description keyword that specifies input griddata arrays should be written to the model output netcdf file. + # --------------------- gwt ic griddata --------------------- block griddata diff --git a/doc/mf6io/mf6ivar/dfn/gwt-nam.dfn b/doc/mf6io/mf6ivar/dfn/gwt-nam.dfn index a06795e2439..db34298830b 100644 --- a/doc/mf6io/mf6ivar/dfn/gwt-nam.dfn +++ b/doc/mf6io/mf6ivar/dfn/gwt-nam.dfn @@ -33,6 +33,15 @@ optional true longname save flows for all packages to budget file description REPLACE save_flows {'{#1}': 'all model package'} +block options +name export_netcdf +type string +reader urword +optional true +mf6internal export_netcdf +longname export model output netcdf file. +description keyword that specifies timeseries data for the dependent variable should be written to a model output netcdf file. No value or ``UGRID'' (ugrid based export) values are supported. + # --------------------- gwt nam packages --------------------- block packages diff --git a/doc/mf6io/mf6ivar/dfn/prt-dis.dfn b/doc/mf6io/mf6ivar/dfn/prt-dis.dfn index 7d4724f0aed..fc0a5669991 100644 --- a/doc/mf6io/mf6ivar/dfn/prt-dis.dfn +++ b/doc/mf6io/mf6ivar/dfn/prt-dis.dfn @@ -49,6 +49,55 @@ mf6internal export_ascii longname export array variables to layered ascii files. description keyword that specifies input griddata arrays should be written to layered ascii output files. +block options +name export_array_netcdf +type keyword +reader urword +optional true +mf6internal export_nc +longname export array variables to netcdf output files. +description keyword that specifies input griddata arrays should be written to the model output netcdf file. + +block options +name ncf_filerecord +type record ncf6 filein ncf6_filename +reader urword +tagged true +optional true +longname +description + +block options +name ncf6 +type keyword +in_record true +reader urword +tagged true +optional false +longname ncf keyword +description keyword to specify that record corresponds to a netcdf configuration (NCF) file. + +block options +name filein +type keyword +in_record true +reader urword +tagged true +optional false +longname file keyword +description keyword to specify that an input filename is expected next. + +block options +name ncf6_filename +type string +preserve_case true +in_record true +reader urword +optional false +tagged false +longname file name of NCF information +description defines a netcdf configuration (NCF) input file. + # --------------------- prt dis dimensions --------------------- block dimensions diff --git a/doc/mf6io/mf6ivar/dfn/prt-disv.dfn b/doc/mf6io/mf6ivar/dfn/prt-disv.dfn index 1bec85b5a7b..540d70a016e 100644 --- a/doc/mf6io/mf6ivar/dfn/prt-disv.dfn +++ b/doc/mf6io/mf6ivar/dfn/prt-disv.dfn @@ -49,6 +49,55 @@ mf6internal export_ascii longname export array variables to layered ascii files. description keyword that specifies input griddata arrays should be written to layered ascii output files. +block options +name export_array_netcdf +type keyword +reader urword +optional true +mf6internal export_nc +longname export array variables to netcdf output files. +description keyword that specifies input griddata arrays should be written to the model output netcdf file. + +block options +name ncf_filerecord +type record ncf6 filein ncf6_filename +reader urword +tagged true +optional true +longname +description + +block options +name ncf6 +type keyword +in_record true +reader urword +tagged true +optional false +longname ncf keyword +description keyword to specify that record corresponds to a netcdf configuration (NCF) file. + +block options +name filein +type keyword +in_record true +reader urword +tagged true +optional false +longname file keyword +description keyword to specify that an input filename is expected next. + +block options +name ncf6_filename +type string +preserve_case true +in_record true +reader urword +optional false +tagged false +longname file name of NCF information +description defines a netcdf configuration (NCF) input file. + # --------------------- prt disv dimensions --------------------- block dimensions diff --git a/doc/mf6io/mf6ivar/dfn/utl-ncf.dfn b/doc/mf6io/mf6ivar/dfn/utl-ncf.dfn new file mode 100644 index 00000000000..c7d24b9ad76 --- /dev/null +++ b/doc/mf6io/mf6ivar/dfn/utl-ncf.dfn @@ -0,0 +1,64 @@ +# flopy subpackage ncf_filerecord ncf packagedata packagedata +# flopy parent_name_type parent_package MFPackage + +# --------------------- gwf ncf options --------------------- + +block options +name ogc_wkt +type string +shape lenbigline +reader urword +optional true +longname CRS well-known text (WKT) string +description is the CRS well-known text (WKT) string. + +block options +name deflate +type integer +reader urword +optional true +longname variable compression deflate level +description is the deflate level (0=min, 9=max) for per variable compression in the netcdf file. Defining the parameter activates per variable compression in the export file at the level specified. + +block options +name shuffle +type keyword +reader urword +optional true +longname +description is the keyword used to turn on the netcdf variable shuffle filter when the deflate option is also set. The shuffle filter has the effect of storing the first byte of all of a variable's values in a chunk contiguously, followed by all the second bytes, etc. This can be an optimization for compression with certain types of data. + +block options +name ugc_record +type record chunking_ugrid ugc_time ugc_face +reader urword +optional true +longname ugrid time and face dimension chunking parameters +description ugrid chunking record + +block options +name chunking_ugrid +type keyword +in_record true +reader urword +optional false +longname keyword when defining ugrid chunking parameters +description is a keyword for providing ugrid dimension chunk sizes. Chunking can dramatically impact data access times and is highly dependent on access patterns (timeseries vs spatial, for example). It can also significanlty impact compressibility of the data. + +block options +name ugc_time +type integer +in_record true +reader urword +optional false +longname chunking parameter for the time dimension +description is the keyword used to provide a ugrid time dimension chunk size. + +block options +name ugc_face +type integer +in_record true +reader urword +optional false +longname chunking parameter for the face dimension +description is the keyword used to provide a ugrid face dimension chunk size. diff --git a/make/makedefaults b/make/makedefaults index cc213db2fa9..fbc271913d7 100644 --- a/make/makedefaults +++ b/make/makedefaults @@ -1,4 +1,4 @@ -# makedefaults created by pymake (version 1.2.11.dev0) for the 'mf6' executable. +# makedefaults created by pymake (version 1.2.10) for the 'mf6' executable. # determine OS ifeq ($(OS), Windows_NT) diff --git a/make/makefile b/make/makefile index 9ec70daf465..ac6b9b3e39f 100644 --- a/make/makefile +++ b/make/makefile @@ -1,47 +1,48 @@ -# makefile created by pymake (version 1.2.11.dev0) for the 'mf6' executable. +# makefile created by pymake (version 1.2.10) for the 'mf6' executable. include ./makedefaults # Define the source file directories SOURCEDIR1=../src -SOURCEDIR2=../src/Idm -SOURCEDIR3=../src/Idm/selector -SOURCEDIR4=../src/Exchange -SOURCEDIR5=../src/Distributed -SOURCEDIR6=../src/Solution -SOURCEDIR7=../src/Solution/LinearMethods -SOURCEDIR8=../src/Solution/ParticleTracker -SOURCEDIR9=../src/Solution/PETSc -SOURCEDIR10=../src/Timing -SOURCEDIR11=../src/Utilities -SOURCEDIR12=../src/Utilities/Idm -SOURCEDIR13=../src/Utilities/Idm/mf6blockfile -SOURCEDIR14=../src/Utilities/TimeSeries -SOURCEDIR15=../src/Utilities/Memory -SOURCEDIR16=../src/Utilities/OutputControl -SOURCEDIR17=../src/Utilities/ArrayRead -SOURCEDIR18=../src/Utilities/Libraries -SOURCEDIR19=../src/Utilities/Libraries/rcm -SOURCEDIR20=../src/Utilities/Libraries/blas -SOURCEDIR21=../src/Utilities/Libraries/sparskit2 -SOURCEDIR22=../src/Utilities/Libraries/daglib -SOURCEDIR23=../src/Utilities/Libraries/sparsekit -SOURCEDIR24=../src/Utilities/Vector -SOURCEDIR25=../src/Utilities/Matrix -SOURCEDIR26=../src/Utilities/Observation -SOURCEDIR27=../src/Model -SOURCEDIR28=../src/Model/Connection -SOURCEDIR29=../src/Model/ParticleTracking -SOURCEDIR30=../src/Model/SurfaceWaterFlow -SOURCEDIR31=../src/Model/GroundWaterTransport -SOURCEDIR32=../src/Model/ModelUtilities -SOURCEDIR33=../src/Model/GroundWaterFlow -SOURCEDIR34=../src/Model/GroundWaterFlow/submodules -SOURCEDIR35=../src/Model/Discretization -SOURCEDIR36=../src/Model/TransportModel -SOURCEDIR37=../src/Model/Geometry -SOURCEDIR38=../src/Model/GroundWaterEnergy +SOURCEDIR2=../src/Exchange +SOURCEDIR3=../src/Idm +SOURCEDIR4=../src/Idm/selector +SOURCEDIR5=../src/Timing +SOURCEDIR6=../src/Model +SOURCEDIR7=../src/Model/Connection +SOURCEDIR8=../src/Model/Discretization +SOURCEDIR9=../src/Model/ModelUtilities +SOURCEDIR10=../src/Model/GroundWaterFlow +SOURCEDIR11=../src/Model/GroundWaterFlow/submodules +SOURCEDIR12=../src/Model/Geometry +SOURCEDIR13=../src/Model/TransportModel +SOURCEDIR14=../src/Model/GroundWaterTransport +SOURCEDIR15=../src/Model/SurfaceWaterFlow +SOURCEDIR16=../src/Model/ParticleTracking +SOURCEDIR17=../src/Model/GroundWaterEnergy +SOURCEDIR18=../src/Solution +SOURCEDIR19=../src/Solution/ParticleTracker +SOURCEDIR20=../src/Solution/LinearMethods +SOURCEDIR21=../src/Solution/PETSc +SOURCEDIR22=../src/Distributed +SOURCEDIR23=../src/Utilities +SOURCEDIR24=../src/Utilities/Export +SOURCEDIR25=../src/Utilities/TimeSeries +SOURCEDIR26=../src/Utilities/Idm +SOURCEDIR27=../src/Utilities/Idm/mf6blockfile +SOURCEDIR28=../src/Utilities/ArrayRead +SOURCEDIR29=../src/Utilities/Memory +SOURCEDIR30=../src/Utilities/Matrix +SOURCEDIR31=../src/Utilities/Vector +SOURCEDIR32=../src/Utilities/Observation +SOURCEDIR33=../src/Utilities/OutputControl +SOURCEDIR34=../src/Utilities/Libraries +SOURCEDIR35=../src/Utilities/Libraries/rcm +SOURCEDIR36=../src/Utilities/Libraries/sparskit2 +SOURCEDIR37=../src/Utilities/Libraries/sparsekit +SOURCEDIR38=../src/Utilities/Libraries/blas +SOURCEDIR39=../src/Utilities/Libraries/daglib VPATH = \ ${SOURCEDIR1} \ @@ -81,7 +82,8 @@ ${SOURCEDIR34} \ ${SOURCEDIR35} \ ${SOURCEDIR36} \ ${SOURCEDIR37} \ -${SOURCEDIR38} +${SOURCEDIR38} \ +${SOURCEDIR39} .SUFFIXES: .f90 .F90 .o @@ -113,6 +115,7 @@ $(OBJDIR)/InputDefinition.o \ $(OBJDIR)/ListIterator.o \ $(OBJDIR)/PtrHashTable.o \ $(OBJDIR)/MemoryContainerIterator.o \ +$(OBJDIR)/utl-ncfidm.o \ $(OBJDIR)/utl-hpcidm.o \ $(OBJDIR)/swf-zdgidm.o \ $(OBJDIR)/swf-stoidm.o \ @@ -415,6 +418,7 @@ $(OBJDIR)/exg-gwegwe.o \ $(OBJDIR)/RouterFactory.o \ $(OBJDIR)/NumericalSolution.o \ $(OBJDIR)/MappedMemory.o \ +$(OBJDIR)/NCModel.o \ $(OBJDIR)/Mf6FileStoInput.o \ $(OBJDIR)/Mf6FileListInput.o \ $(OBJDIR)/Mf6FileGridInput.o \ @@ -426,6 +430,7 @@ $(OBJDIR)/GwfGwfConnection.o \ $(OBJDIR)/GweGweConnection.o \ $(OBJDIR)/VirtualDataManager.o \ $(OBJDIR)/Mapper.o \ +$(OBJDIR)/ModelExport.o \ $(OBJDIR)/IdmMf6File.o \ $(OBJDIR)/ModelPackageInput.o \ $(OBJDIR)/VirtualGwtModel.o \ @@ -462,8 +467,7 @@ $(OBJDIR)/gwf-sfr-steady.o \ $(OBJDIR)/gwf-sfr-constant.o \ $(OBJDIR)/RectangularGeometry.o \ $(OBJDIR)/CircularGeometry.o \ -$(OBJDIR)/ExplicitModel.o \ -$(OBJDIR)/swf-disidm.o +$(OBJDIR)/ExplicitModel.o # Define the objects that make up the program $(PROGRAM) : $(OBJECTS) diff --git a/meson.build b/meson.build index 4fa38e2b86c..fc90c2ebe7f 100644 --- a/meson.build +++ b/meson.build @@ -43,13 +43,6 @@ if fc_id == 'gcc' '-Wno-uninitialized', ] - # Options specific to profile - if profile == 'release' - compile_args += ['-ffpe-summary=overflow', '-ffpe-trap=overflow,zero,invalid'] - elif profile == 'develop' - compile_args += ['-fcheck=all', '-ffpe-trap=overflow,zero,invalid'] - endif - # Define OS with gfortran for OS specific code # These are identical to pre-defined macros available with ifort system = build_machine.system() @@ -172,17 +165,19 @@ if is_extended_build # find netcdf if build_machine.system() != 'windows' - netcdf = dependency('netcdf', language : 'fortran', required : false) + netcdff = dependency('netcdf', language : 'fortran', required : false) else # For CI testing only; Windows not yet supported nc_dir = meson.project_source_root() / '..' / 'ncf' / 'netcdf-fortran-4.6.1' / 'fortran' - netcdf = fc.find_library('netcdff', dirs: [ nc_dir ], required : false, static : false) + netcdff = fc.find_library('netcdff', dirs: [ nc_dir ], required : false, static : false) #nc_incdir = include_directories([ nc_dir ]) endif - if netcdf.found() + if netcdff.found() with_netcdf = true extra_cmp_args += [ '-D__WITH_NETCDF__' ] - dependencies += [ netcdf ] + dependencies += [ netcdff ] + else + with_netcdf = false endif else with_netcdf = false @@ -190,6 +185,24 @@ else with_mpi = false endif +# GCC profile options need to be netcdf aware due to HDF5 issue +if fc_id == 'gcc' + if with_netcdf and build_machine.system() == 'darwin' + # HDF5 1.14.3 invalid fpe trap issue: https://github.com/HDFGroup/hdf5/issues/3831 + if profile == 'release' + compile_args += ['-ffpe-summary=overflow', '-ffpe-trap=overflow,zero'] + elif profile == 'develop' + compile_args += ['-fcheck=all', '-ffpe-trap=overflow,zero'] + endif + else + if profile == 'release' + compile_args += ['-ffpe-summary=overflow', '-ffpe-trap=overflow,zero,invalid'] + elif profile == 'develop' + compile_args += ['-fcheck=all', '-ffpe-trap=overflow,zero,invalid'] + endif + endif +endif + compile_args += extra_cmp_args add_project_arguments(fc.get_supported_arguments(compile_args), language: 'fortran') diff --git a/msvs/mf6core.vfproj b/msvs/mf6core.vfproj index edc57680892..b66c2a9962f 100644 --- a/msvs/mf6core.vfproj +++ b/msvs/mf6core.vfproj @@ -176,7 +176,6 @@ - @@ -184,7 +183,8 @@ - + + @@ -413,6 +413,29 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/pymake/excludefiles.txt b/pymake/excludefiles.txt index c2677d02b3d..fd0a70b7883 100644 --- a/pymake/excludefiles.txt +++ b/pymake/excludefiles.txt @@ -10,3 +10,7 @@ ../src/Distributed/MpiRunControl.F90 ../src/Distributed/MpiUnitCache.f90 ../src/Distributed/MpiWorld.f90 +../src/Utilities/Export/DisNCMesh.f90 +../src/Utilities/Export/DisvNCMesh.f90 +../src/Utilities/Export/MeshNCModel.f90 +../src/Utilities/Export/NCExportCreate.f90 diff --git a/src/Idm/exg-gwegweidm.f90 b/src/Idm/exg-gwegweidm.f90 index 5581f5e9098..2206cc40d4d 100644 --- a/src/Idm/exg-gwegweidm.f90 +++ b/src/Idm/exg-gwegweidm.f90 @@ -9,6 +9,7 @@ module ExgGwegweInputModule public exg_gwegwe_block_definitions public ExgGwegweParamFoundType public exg_gwegwe_multi_package + public exg_gwegwe_subpackages type ExgGwegweParamFoundType logical :: gwfmodelname1 = .false. @@ -42,6 +43,12 @@ module ExgGwegweInputModule logical :: exg_gwegwe_multi_package = .true. + character(len=16), parameter :: & + exg_gwegwe_subpackages(*) = & + [ & + ' ' & + ] + type(InputParamDefinitionType), parameter :: & exggwegwe_gwfmodelname1 = InputParamDefinitionType & ( & @@ -52,6 +59,7 @@ module ExgGwegweInputModule 'GWFMODELNAME1', & ! fortran variable 'STRING', & ! type '', & ! shape + 'keyword to specify name of first corresponding GWF Model', & ! longname .true., & ! required .false., & ! multi-record .false., & ! preserve case @@ -69,6 +77,7 @@ module ExgGwegweInputModule 'GWFMODELNAME2', & ! fortran variable 'STRING', & ! type '', & ! shape + 'keyword to specify name of second corresponding GWF Model', & ! longname .true., & ! required .false., & ! multi-record .false., & ! preserve case @@ -86,6 +95,7 @@ module ExgGwegweInputModule 'AUXILIARY', & ! fortran variable 'STRING', & ! type 'NAUX', & ! shape + 'keyword to specify aux variables', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -103,6 +113,7 @@ module ExgGwegweInputModule 'BOUNDNAMES', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + '', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -120,6 +131,7 @@ module ExgGwegweInputModule 'IPRPAK', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'keyword to print input to list file', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -137,6 +149,7 @@ module ExgGwegweInputModule 'IPRFLOW', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'keyword to print gwfgwf flows to list file', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -154,6 +167,7 @@ module ExgGwegweInputModule 'IPAKCB', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'keyword to save GWFGWF flows', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -171,6 +185,7 @@ module ExgGwegweInputModule 'ADV_SCHEME', & ! fortran variable 'STRING', & ! type '', & ! shape + 'advective scheme', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -188,6 +203,7 @@ module ExgGwegweInputModule 'CND_XT3D_OFF', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'deactivate xt3d', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -205,6 +221,7 @@ module ExgGwegweInputModule 'CND_XT3D_RHS', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'xt3d on right-hand side', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -222,6 +239,7 @@ module ExgGwegweInputModule 'FILEIN', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'file keyword', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -239,6 +257,7 @@ module ExgGwegweInputModule 'MVE_FILERECORD', & ! fortran variable 'RECORD MVE6 FILEIN MVE6_FILENAME', & ! type '', & ! shape + '', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -256,6 +275,7 @@ module ExgGwegweInputModule 'MVE6', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'obs keyword', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -273,6 +293,7 @@ module ExgGwegweInputModule 'MVE6_FILENAME', & ! fortran variable 'STRING', & ! type '', & ! shape + 'mve6 input filename', & ! longname .true., & ! required .true., & ! multi-record .true., & ! preserve case @@ -290,6 +311,7 @@ module ExgGwegweInputModule 'OBS_FILERECORD', & ! fortran variable 'RECORD OBS6 FILEIN OBS6_FILENAME', & ! type '', & ! shape + '', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -307,6 +329,7 @@ module ExgGwegweInputModule 'OBS6', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'obs keyword', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -324,6 +347,7 @@ module ExgGwegweInputModule 'OBS6_FILENAME', & ! fortran variable 'STRING', & ! type '', & ! shape + 'obs6 input filename', & ! longname .true., & ! required .true., & ! multi-record .true., & ! preserve case @@ -341,6 +365,7 @@ module ExgGwegweInputModule 'DEV_IFMOD_ON', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'activate interface model on exchange', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -358,6 +383,7 @@ module ExgGwegweInputModule 'NEXG', & ! fortran variable 'INTEGER', & ! type '', & ! shape + 'number of exchanges', & ! longname .true., & ! required .false., & ! multi-record .false., & ! preserve case @@ -375,6 +401,7 @@ module ExgGwegweInputModule 'CELLIDM1', & ! fortran variable 'INTEGER1D', & ! type 'NCELLDIM', & ! shape + 'cellid of first cell', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -392,6 +419,7 @@ module ExgGwegweInputModule 'CELLIDM2', & ! fortran variable 'INTEGER1D', & ! type 'NCELLDIM', & ! shape + 'cellid of second cell', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -409,6 +437,7 @@ module ExgGwegweInputModule 'IHC', & ! fortran variable 'INTEGER', & ! type '', & ! shape + 'integer flag for connection type', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -426,6 +455,7 @@ module ExgGwegweInputModule 'CL1', & ! fortran variable 'DOUBLE', & ! type '', & ! shape + 'connection distance', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -443,6 +473,7 @@ module ExgGwegweInputModule 'CL2', & ! fortran variable 'DOUBLE', & ! type '', & ! shape + 'connection distance', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -460,6 +491,7 @@ module ExgGwegweInputModule 'HWVA', & ! fortran variable 'DOUBLE', & ! type '', & ! shape + 'horizontal cell width or area for vertical flow', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -477,6 +509,7 @@ module ExgGwegweInputModule 'AUXVAR', & ! fortran variable 'DOUBLE1D', & ! type 'NAUX', & ! shape + 'auxiliary variables', & ! longname .false., & ! required .true., & ! multi-record .false., & ! preserve case @@ -494,6 +527,7 @@ module ExgGwegweInputModule 'BOUNDNAME', & ! fortran variable 'STRING', & ! type '', & ! shape + 'exchange boundname', & ! longname .false., & ! required .true., & ! multi-record .false., & ! preserve case @@ -543,6 +577,7 @@ module ExgGwegweInputModule 'EXCHANGEDATA', & ! fortran variable 'RECARRAY CELLIDM1 CELLIDM2 IHC CL1 CL2 HWVA AUX BOUNDNAME', & ! type 'NEXG', & ! shape + 'exchange data', & ! longname .true., & ! required .false., & ! multi-record .false., & ! preserve case diff --git a/src/Idm/exg-gwfgweidm.f90 b/src/Idm/exg-gwfgweidm.f90 index bc69319b14c..64bfe9b7063 100644 --- a/src/Idm/exg-gwfgweidm.f90 +++ b/src/Idm/exg-gwfgweidm.f90 @@ -9,12 +9,19 @@ module ExgGwfgweInputModule public exg_gwfgwe_block_definitions public ExgGwfgweParamFoundType public exg_gwfgwe_multi_package + public exg_gwfgwe_subpackages type ExgGwfgweParamFoundType end type ExgGwfgweParamFoundType logical :: exg_gwfgwe_multi_package = .false. + character(len=16), parameter :: & + exg_gwfgwe_subpackages(*) = & + [ & + ' ' & + ] + type(InputParamDefinitionType), parameter :: & exg_gwfgwe_param_definitions(*) = & [ & @@ -27,6 +34,7 @@ module ExgGwfgweInputModule '', & ! fortran variable '', & ! type '', & ! shape + '', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -47,6 +55,7 @@ module ExgGwfgweInputModule '', & ! fortran variable '', & ! type '', & ! shape + '', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case diff --git a/src/Idm/exg-gwfgwfidm.f90 b/src/Idm/exg-gwfgwfidm.f90 index 85f433aed80..0eb2d02c2da 100644 --- a/src/Idm/exg-gwfgwfidm.f90 +++ b/src/Idm/exg-gwfgwfidm.f90 @@ -9,6 +9,7 @@ module ExgGwfgwfInputModule public exg_gwfgwf_block_definitions public ExgGwfgwfParamFoundType public exg_gwfgwf_multi_package + public exg_gwfgwf_subpackages type ExgGwfgwfParamFoundType logical :: auxiliary = .false. @@ -46,6 +47,12 @@ module ExgGwfgwfInputModule logical :: exg_gwfgwf_multi_package = .true. + character(len=16), parameter :: & + exg_gwfgwf_subpackages(*) = & + [ & + ' ' & + ] + type(InputParamDefinitionType), parameter :: & exggwfgwf_auxiliary = InputParamDefinitionType & ( & @@ -56,6 +63,7 @@ module ExgGwfgwfInputModule 'AUXILIARY', & ! fortran variable 'STRING', & ! type 'NAUX', & ! shape + 'keyword to specify aux variables', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -73,6 +81,7 @@ module ExgGwfgwfInputModule 'BOUNDNAMES', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + '', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -90,6 +99,7 @@ module ExgGwfgwfInputModule 'IPRPAK', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'keyword to print input to list file', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -107,6 +117,7 @@ module ExgGwfgwfInputModule 'IPRFLOW', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'keyword to print gwfgwf flows to list file', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -124,6 +135,7 @@ module ExgGwfgwfInputModule 'IPAKCB', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'keyword to save GWFGWF flows', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -141,6 +153,7 @@ module ExgGwfgwfInputModule 'CELL_AVERAGING', & ! fortran variable 'STRING', & ! type '', & ! shape + 'conductance weighting option', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -158,6 +171,7 @@ module ExgGwfgwfInputModule 'CVOPTIONS', & ! fortran variable 'RECORD VARIABLECV DEWATERED', & ! type '', & ! shape + 'vertical conductance options', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -175,6 +189,7 @@ module ExgGwfgwfInputModule 'VARIABLECV', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'keyword to activate VARIABLECV option', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -192,6 +207,7 @@ module ExgGwfgwfInputModule 'DEWATERED', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'keyword to activate DEWATERED option', & ! longname .false., & ! required .true., & ! multi-record .false., & ! preserve case @@ -209,6 +225,7 @@ module ExgGwfgwfInputModule 'NEWTON', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'keyword to activate Newton-Raphson', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -226,6 +243,7 @@ module ExgGwfgwfInputModule 'XT3D', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'keyword to activate XT3D', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -243,6 +261,7 @@ module ExgGwfgwfInputModule 'GNC_FILERECORD', & ! fortran variable 'RECORD GNC6 FILEIN GNC6_FILENAME', & ! type '', & ! shape + '', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -260,6 +279,7 @@ module ExgGwfgwfInputModule 'FILEIN', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'file keyword', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -277,6 +297,7 @@ module ExgGwfgwfInputModule 'GNC6', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'gnc6 keyword', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -294,6 +315,7 @@ module ExgGwfgwfInputModule 'GNC6_FILENAME', & ! fortran variable 'STRING', & ! type '', & ! shape + 'gnc6 input filename', & ! longname .true., & ! required .true., & ! multi-record .true., & ! preserve case @@ -311,6 +333,7 @@ module ExgGwfgwfInputModule 'MVR_FILERECORD', & ! fortran variable 'RECORD MVR6 FILEIN MVR6_FILENAME', & ! type '', & ! shape + '', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -328,6 +351,7 @@ module ExgGwfgwfInputModule 'MVR6', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'obs keyword', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -345,6 +369,7 @@ module ExgGwfgwfInputModule 'MVR6_FILENAME', & ! fortran variable 'STRING', & ! type '', & ! shape + 'mvr6 input filename', & ! longname .true., & ! required .true., & ! multi-record .true., & ! preserve case @@ -362,6 +387,7 @@ module ExgGwfgwfInputModule 'OBS_FILERECORD', & ! fortran variable 'RECORD OBS6 FILEIN OBS6_FILENAME', & ! type '', & ! shape + '', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -379,6 +405,7 @@ module ExgGwfgwfInputModule 'OBS6', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'obs keyword', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -396,6 +423,7 @@ module ExgGwfgwfInputModule 'OBS6_FILENAME', & ! fortran variable 'STRING', & ! type '', & ! shape + 'obs6 input filename', & ! longname .true., & ! required .true., & ! multi-record .true., & ! preserve case @@ -413,6 +441,7 @@ module ExgGwfgwfInputModule 'DEV_IFMOD_ON', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'activate interface model on exchange', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -430,6 +459,7 @@ module ExgGwfgwfInputModule 'NEXG', & ! fortran variable 'INTEGER', & ! type '', & ! shape + 'number of exchanges', & ! longname .true., & ! required .false., & ! multi-record .false., & ! preserve case @@ -447,6 +477,7 @@ module ExgGwfgwfInputModule 'CELLIDM1', & ! fortran variable 'INTEGER1D', & ! type 'NCELLDIM', & ! shape + 'cellid of first cell', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -464,6 +495,7 @@ module ExgGwfgwfInputModule 'CELLIDM2', & ! fortran variable 'INTEGER1D', & ! type 'NCELLDIM', & ! shape + 'cellid of second cell', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -481,6 +513,7 @@ module ExgGwfgwfInputModule 'IHC', & ! fortran variable 'INTEGER', & ! type '', & ! shape + 'integer flag for connection type', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -498,6 +531,7 @@ module ExgGwfgwfInputModule 'CL1', & ! fortran variable 'DOUBLE', & ! type '', & ! shape + 'connection distance', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -515,6 +549,7 @@ module ExgGwfgwfInputModule 'CL2', & ! fortran variable 'DOUBLE', & ! type '', & ! shape + 'connection distance', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -532,6 +567,7 @@ module ExgGwfgwfInputModule 'HWVA', & ! fortran variable 'DOUBLE', & ! type '', & ! shape + 'horizontal cell width or area for vertical flow', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -549,6 +585,7 @@ module ExgGwfgwfInputModule 'AUXVAR', & ! fortran variable 'DOUBLE1D', & ! type 'NAUX', & ! shape + 'auxiliary variables', & ! longname .false., & ! required .true., & ! multi-record .false., & ! preserve case @@ -566,6 +603,7 @@ module ExgGwfgwfInputModule 'BOUNDNAME', & ! fortran variable 'STRING', & ! type '', & ! shape + 'exchange boundname', & ! longname .false., & ! required .true., & ! multi-record .false., & ! preserve case @@ -619,6 +657,7 @@ module ExgGwfgwfInputModule 'EXCHANGEDATA', & ! fortran variable 'RECARRAY CELLIDM1 CELLIDM2 IHC CL1 CL2 HWVA AUX BOUNDNAME', & ! type 'NEXG', & ! shape + 'exchange data', & ! longname .true., & ! required .false., & ! multi-record .false., & ! preserve case diff --git a/src/Idm/exg-gwfgwtidm.f90 b/src/Idm/exg-gwfgwtidm.f90 index 30374514be3..f2b009720e2 100644 --- a/src/Idm/exg-gwfgwtidm.f90 +++ b/src/Idm/exg-gwfgwtidm.f90 @@ -9,12 +9,19 @@ module ExgGwfgwtInputModule public exg_gwfgwt_block_definitions public ExgGwfgwtParamFoundType public exg_gwfgwt_multi_package + public exg_gwfgwt_subpackages type ExgGwfgwtParamFoundType end type ExgGwfgwtParamFoundType logical :: exg_gwfgwt_multi_package = .false. + character(len=16), parameter :: & + exg_gwfgwt_subpackages(*) = & + [ & + ' ' & + ] + type(InputParamDefinitionType), parameter :: & exg_gwfgwt_param_definitions(*) = & [ & @@ -27,6 +34,7 @@ module ExgGwfgwtInputModule '', & ! fortran variable '', & ! type '', & ! shape + '', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -47,6 +55,7 @@ module ExgGwfgwtInputModule '', & ! fortran variable '', & ! type '', & ! shape + '', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case diff --git a/src/Idm/exg-gwfprtidm.f90 b/src/Idm/exg-gwfprtidm.f90 index 25f8c662a93..c61172be94e 100644 --- a/src/Idm/exg-gwfprtidm.f90 +++ b/src/Idm/exg-gwfprtidm.f90 @@ -9,12 +9,19 @@ module ExgGwfprtInputModule public exg_gwfprt_block_definitions public ExgGwfprtParamFoundType public exg_gwfprt_multi_package + public exg_gwfprt_subpackages type ExgGwfprtParamFoundType end type ExgGwfprtParamFoundType logical :: exg_gwfprt_multi_package = .false. + character(len=16), parameter :: & + exg_gwfprt_subpackages(*) = & + [ & + ' ' & + ] + type(InputParamDefinitionType), parameter :: & exg_gwfprt_param_definitions(*) = & [ & @@ -27,6 +34,7 @@ module ExgGwfprtInputModule '', & ! fortran variable '', & ! type '', & ! shape + '', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -47,6 +55,7 @@ module ExgGwfprtInputModule '', & ! fortran variable '', & ! type '', & ! shape + '', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case diff --git a/src/Idm/exg-gwtgwtidm.f90 b/src/Idm/exg-gwtgwtidm.f90 index 76255bc488a..55712ee479d 100644 --- a/src/Idm/exg-gwtgwtidm.f90 +++ b/src/Idm/exg-gwtgwtidm.f90 @@ -9,6 +9,7 @@ module ExgGwtgwtInputModule public exg_gwtgwt_block_definitions public ExgGwtgwtParamFoundType public exg_gwtgwt_multi_package + public exg_gwtgwt_subpackages type ExgGwtgwtParamFoundType logical :: gwfmodelname1 = .false. @@ -42,6 +43,12 @@ module ExgGwtgwtInputModule logical :: exg_gwtgwt_multi_package = .true. + character(len=16), parameter :: & + exg_gwtgwt_subpackages(*) = & + [ & + ' ' & + ] + type(InputParamDefinitionType), parameter :: & exggwtgwt_gwfmodelname1 = InputParamDefinitionType & ( & @@ -52,6 +59,7 @@ module ExgGwtgwtInputModule 'GWFMODELNAME1', & ! fortran variable 'STRING', & ! type '', & ! shape + 'keyword to specify name of first corresponding GWF Model', & ! longname .true., & ! required .false., & ! multi-record .false., & ! preserve case @@ -69,6 +77,7 @@ module ExgGwtgwtInputModule 'GWFMODELNAME2', & ! fortran variable 'STRING', & ! type '', & ! shape + 'keyword to specify name of second corresponding GWF Model', & ! longname .true., & ! required .false., & ! multi-record .false., & ! preserve case @@ -86,6 +95,7 @@ module ExgGwtgwtInputModule 'AUXILIARY', & ! fortran variable 'STRING', & ! type 'NAUX', & ! shape + 'keyword to specify aux variables', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -103,6 +113,7 @@ module ExgGwtgwtInputModule 'BOUNDNAMES', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + '', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -120,6 +131,7 @@ module ExgGwtgwtInputModule 'IPRPAK', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'keyword to print input to list file', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -137,6 +149,7 @@ module ExgGwtgwtInputModule 'IPRFLOW', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'keyword to print gwfgwf flows to list file', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -154,6 +167,7 @@ module ExgGwtgwtInputModule 'IPAKCB', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'keyword to save GWFGWF flows', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -171,6 +185,7 @@ module ExgGwtgwtInputModule 'ADV_SCHEME', & ! fortran variable 'STRING', & ! type '', & ! shape + 'advective scheme', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -188,6 +203,7 @@ module ExgGwtgwtInputModule 'DSP_XT3D_OFF', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'deactivate xt3d', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -205,6 +221,7 @@ module ExgGwtgwtInputModule 'DSP_XT3D_RHS', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'xt3d on right-hand side', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -222,6 +239,7 @@ module ExgGwtgwtInputModule 'FILEIN', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'file keyword', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -239,6 +257,7 @@ module ExgGwtgwtInputModule 'MVT_FILERECORD', & ! fortran variable 'RECORD MVT6 FILEIN MVT6_FILENAME', & ! type '', & ! shape + '', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -256,6 +275,7 @@ module ExgGwtgwtInputModule 'MVT6', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'obs keyword', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -273,6 +293,7 @@ module ExgGwtgwtInputModule 'MVT6_FILENAME', & ! fortran variable 'STRING', & ! type '', & ! shape + 'mvt6 input filename', & ! longname .true., & ! required .true., & ! multi-record .true., & ! preserve case @@ -290,6 +311,7 @@ module ExgGwtgwtInputModule 'OBS_FILERECORD', & ! fortran variable 'RECORD OBS6 FILEIN OBS6_FILENAME', & ! type '', & ! shape + '', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -307,6 +329,7 @@ module ExgGwtgwtInputModule 'OBS6', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'obs keyword', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -324,6 +347,7 @@ module ExgGwtgwtInputModule 'OBS6_FILENAME', & ! fortran variable 'STRING', & ! type '', & ! shape + 'obs6 input filename', & ! longname .true., & ! required .true., & ! multi-record .true., & ! preserve case @@ -341,6 +365,7 @@ module ExgGwtgwtInputModule 'DEV_IFMOD_ON', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'activate interface model on exchange', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -358,6 +383,7 @@ module ExgGwtgwtInputModule 'NEXG', & ! fortran variable 'INTEGER', & ! type '', & ! shape + 'number of exchanges', & ! longname .true., & ! required .false., & ! multi-record .false., & ! preserve case @@ -375,6 +401,7 @@ module ExgGwtgwtInputModule 'CELLIDM1', & ! fortran variable 'INTEGER1D', & ! type 'NCELLDIM', & ! shape + 'cellid of first cell', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -392,6 +419,7 @@ module ExgGwtgwtInputModule 'CELLIDM2', & ! fortran variable 'INTEGER1D', & ! type 'NCELLDIM', & ! shape + 'cellid of second cell', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -409,6 +437,7 @@ module ExgGwtgwtInputModule 'IHC', & ! fortran variable 'INTEGER', & ! type '', & ! shape + 'integer flag for connection type', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -426,6 +455,7 @@ module ExgGwtgwtInputModule 'CL1', & ! fortran variable 'DOUBLE', & ! type '', & ! shape + 'connection distance', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -443,6 +473,7 @@ module ExgGwtgwtInputModule 'CL2', & ! fortran variable 'DOUBLE', & ! type '', & ! shape + 'connection distance', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -460,6 +491,7 @@ module ExgGwtgwtInputModule 'HWVA', & ! fortran variable 'DOUBLE', & ! type '', & ! shape + 'horizontal cell width or area for vertical flow', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -477,6 +509,7 @@ module ExgGwtgwtInputModule 'AUXVAR', & ! fortran variable 'DOUBLE1D', & ! type 'NAUX', & ! shape + 'auxiliary variables', & ! longname .false., & ! required .true., & ! multi-record .false., & ! preserve case @@ -494,6 +527,7 @@ module ExgGwtgwtInputModule 'BOUNDNAME', & ! fortran variable 'STRING', & ! type '', & ! shape + 'exchange boundname', & ! longname .false., & ! required .true., & ! multi-record .false., & ! preserve case @@ -543,6 +577,7 @@ module ExgGwtgwtInputModule 'EXCHANGEDATA', & ! fortran variable 'RECARRAY CELLIDM1 CELLIDM2 IHC CL1 CL2 HWVA AUX BOUNDNAME', & ! type 'NEXG', & ! shape + 'exchange data', & ! longname .true., & ! required .false., & ! multi-record .false., & ! preserve case diff --git a/src/Idm/exg-swfgwfidm.f90 b/src/Idm/exg-swfgwfidm.f90 index a1abd93f6e8..b633e6fa6c8 100644 --- a/src/Idm/exg-swfgwfidm.f90 +++ b/src/Idm/exg-swfgwfidm.f90 @@ -9,6 +9,7 @@ module ExgSwfgwfInputModule public exg_swfgwf_block_definitions public ExgSwfgwfParamFoundType public exg_swfgwf_multi_package + public exg_swfgwf_subpackages type ExgSwfgwfParamFoundType logical :: ipr_input = .false. @@ -25,6 +26,12 @@ module ExgSwfgwfInputModule logical :: exg_swfgwf_multi_package = .true. + character(len=16), parameter :: & + exg_swfgwf_subpackages(*) = & + [ & + ' ' & + ] + type(InputParamDefinitionType), parameter :: & exgswfgwf_ipr_input = InputParamDefinitionType & ( & @@ -35,6 +42,7 @@ module ExgSwfgwfInputModule 'IPR_INPUT', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'keyword to print input to list file', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -52,6 +60,7 @@ module ExgSwfgwfInputModule 'IPR_FLOW', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'keyword to print swfgwf flows to list file', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -69,6 +78,7 @@ module ExgSwfgwfInputModule 'OBS_FILERECORD', & ! fortran variable 'RECORD OBS6 FILEIN OBS6_FILENAME', & ! type '', & ! shape + '', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -86,6 +96,7 @@ module ExgSwfgwfInputModule 'OBS6', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'obs keyword', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -103,6 +114,7 @@ module ExgSwfgwfInputModule 'FILEIN', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'file keyword', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -120,6 +132,7 @@ module ExgSwfgwfInputModule 'OBS6_FILENAME', & ! fortran variable 'STRING', & ! type '', & ! shape + 'obs6 input filename', & ! longname .true., & ! required .true., & ! multi-record .true., & ! preserve case @@ -137,6 +150,7 @@ module ExgSwfgwfInputModule 'NEXG', & ! fortran variable 'INTEGER', & ! type '', & ! shape + 'number of exchanges', & ! longname .true., & ! required .false., & ! multi-record .false., & ! preserve case @@ -154,6 +168,7 @@ module ExgSwfgwfInputModule 'CELLIDM1', & ! fortran variable 'INTEGER1D', & ! type 'NCELLDIM', & ! shape + 'cellid of first cell', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -171,6 +186,7 @@ module ExgSwfgwfInputModule 'CELLIDM2', & ! fortran variable 'INTEGER1D', & ! type 'NCELLDIM', & ! shape + 'cellid of second cell', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -188,6 +204,7 @@ module ExgSwfgwfInputModule 'COND', & ! fortran variable 'DOUBLE', & ! type '', & ! shape + 'conductance', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -220,6 +237,7 @@ module ExgSwfgwfInputModule 'EXCHANGEDATA', & ! fortran variable 'RECARRAY CELLIDM1 CELLIDM2 COND', & ! type 'NEXG', & ! shape + 'exchange data', & ! longname .true., & ! required .false., & ! multi-record .false., & ! preserve case diff --git a/src/Idm/gwe-cndidm.f90 b/src/Idm/gwe-cndidm.f90 index 43beafaa1c6..71a3971c604 100644 --- a/src/Idm/gwe-cndidm.f90 +++ b/src/Idm/gwe-cndidm.f90 @@ -9,11 +9,13 @@ module GweCndInputModule public gwe_cnd_block_definitions public GweCndParamFoundType public gwe_cnd_multi_package + public gwe_cnd_subpackages type GweCndParamFoundType logical :: xt3d_off = .false. logical :: xt3d_rhs = .false. logical :: export_ascii = .false. + logical :: export_nc = .false. logical :: alh = .false. logical :: alv = .false. logical :: ath1 = .false. @@ -25,6 +27,12 @@ module GweCndInputModule logical :: gwe_cnd_multi_package = .false. + character(len=16), parameter :: & + gwe_cnd_subpackages(*) = & + [ & + ' ' & + ] + type(InputParamDefinitionType), parameter :: & gwecnd_xt3d_off = InputParamDefinitionType & ( & @@ -35,6 +43,7 @@ module GweCndInputModule 'XT3D_OFF', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'deactivate xt3d', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -52,6 +61,7 @@ module GweCndInputModule 'XT3D_RHS', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'xt3d on right-hand side', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -69,6 +79,25 @@ module GweCndInputModule 'EXPORT_ASCII', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'export array variables to layered ascii files.', & ! longname + .false., & ! required + .false., & ! multi-record + .false., & ! preserve case + .false., & ! layered + .false. & ! timeseries + ) + + type(InputParamDefinitionType), parameter :: & + gwecnd_export_nc = InputParamDefinitionType & + ( & + 'GWE', & ! component + 'CND', & ! subcomponent + 'OPTIONS', & ! block + 'EXPORT_ARRAY_NETCDF', & ! tag name + 'EXPORT_NC', & ! fortran variable + 'KEYWORD', & ! type + '', & ! shape + 'export array variables to netcdf output files.', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -86,6 +115,7 @@ module GweCndInputModule 'ALH', & ! fortran variable 'DOUBLE1D', & ! type 'NODES', & ! shape + 'longitudinal dispersivity in horizontal direction', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -103,6 +133,7 @@ module GweCndInputModule 'ALV', & ! fortran variable 'DOUBLE1D', & ! type 'NODES', & ! shape + 'longitudinal dispersivity in vertical direction', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -120,6 +151,7 @@ module GweCndInputModule 'ATH1', & ! fortran variable 'DOUBLE1D', & ! type 'NODES', & ! shape + 'transverse dispersivity in horizontal direction', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -137,6 +169,7 @@ module GweCndInputModule 'ATH2', & ! fortran variable 'DOUBLE1D', & ! type 'NODES', & ! shape + 'transverse dispersivity in horizontal direction', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -154,6 +187,7 @@ module GweCndInputModule 'ATV', & ! fortran variable 'DOUBLE1D', & ! type 'NODES', & ! shape + 'transverse dispersivity when flow is in vertical direction', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -171,6 +205,7 @@ module GweCndInputModule 'KTW', & ! fortran variable 'DOUBLE1D', & ! type 'NODES', & ! shape + 'thermal conductivity of the simulated fluid', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -188,6 +223,7 @@ module GweCndInputModule 'KTS', & ! fortran variable 'DOUBLE1D', & ! type 'NODES', & ! shape + 'thermal conductivity of the aquifer material', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -201,6 +237,7 @@ module GweCndInputModule gwecnd_xt3d_off, & gwecnd_xt3d_rhs, & gwecnd_export_ascii, & + gwecnd_export_nc, & gwecnd_alh, & gwecnd_alv, & gwecnd_ath1, & @@ -222,6 +259,7 @@ module GweCndInputModule '', & ! fortran variable '', & ! type '', & ! shape + '', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case diff --git a/src/Idm/gwe-ctpidm.f90 b/src/Idm/gwe-ctpidm.f90 index 3b2ca0a2889..9a2c9553c3e 100644 --- a/src/Idm/gwe-ctpidm.f90 +++ b/src/Idm/gwe-ctpidm.f90 @@ -9,6 +9,7 @@ module GweCtpInputModule public gwe_ctp_block_definitions public GweCtpParamFoundType public gwe_ctp_multi_package + public gwe_ctp_subpackages type GweCtpParamFoundType logical :: auxiliary = .false. @@ -33,6 +34,12 @@ module GweCtpInputModule logical :: gwe_ctp_multi_package = .true. + character(len=16), parameter :: & + gwe_ctp_subpackages(*) = & + [ & + ' ' & + ] + type(InputParamDefinitionType), parameter :: & gwectp_auxiliary = InputParamDefinitionType & ( & @@ -43,6 +50,7 @@ module GweCtpInputModule 'AUXILIARY', & ! fortran variable 'STRING', & ! type 'NAUX', & ! shape + 'keyword to specify aux variables', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -60,6 +68,7 @@ module GweCtpInputModule 'AUXMULTNAME', & ! fortran variable 'STRING', & ! type '', & ! shape + 'name of auxiliary variable for multiplier', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -77,6 +86,7 @@ module GweCtpInputModule 'BOUNDNAMES', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + '', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -94,6 +104,7 @@ module GweCtpInputModule 'IPRFLOW', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'print input to listing file', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -111,6 +122,7 @@ module GweCtpInputModule 'IPAKCB', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'print calculated flows to listing file', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -128,6 +140,7 @@ module GweCtpInputModule 'IPRPAK', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'save constant temperature flows to budget file', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -145,6 +158,7 @@ module GweCtpInputModule 'TS_FILERECORD', & ! fortran variable 'RECORD TS6 FILEIN TS6_FILENAME', & ! type '', & ! shape + '', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -162,6 +176,7 @@ module GweCtpInputModule 'TS6', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'time series keyword', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -179,6 +194,7 @@ module GweCtpInputModule 'FILEIN', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'file keyword', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -196,6 +212,7 @@ module GweCtpInputModule 'TS6_FILENAME', & ! fortran variable 'STRING', & ! type '', & ! shape + 'file name of time series information', & ! longname .true., & ! required .true., & ! multi-record .true., & ! preserve case @@ -213,6 +230,7 @@ module GweCtpInputModule 'OBS_FILERECORD', & ! fortran variable 'RECORD OBS6 FILEIN OBS6_FILENAME', & ! type '', & ! shape + '', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -230,6 +248,7 @@ module GweCtpInputModule 'OBS6', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'obs keyword', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -247,6 +266,7 @@ module GweCtpInputModule 'OBS6_FILENAME', & ! fortran variable 'STRING', & ! type '', & ! shape + 'obs6 input filename', & ! longname .true., & ! required .true., & ! multi-record .true., & ! preserve case @@ -264,6 +284,7 @@ module GweCtpInputModule 'MAXBOUND', & ! fortran variable 'INTEGER', & ! type '', & ! shape + 'maximum number of constant temperatures', & ! longname .true., & ! required .false., & ! multi-record .false., & ! preserve case @@ -281,6 +302,7 @@ module GweCtpInputModule 'CELLID', & ! fortran variable 'INTEGER1D', & ! type 'NCELLDIM', & ! shape + 'cell identifier', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -298,6 +320,7 @@ module GweCtpInputModule 'TSPVAR', & ! fortran variable 'DOUBLE', & ! type '', & ! shape + 'constant temperature value', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -315,6 +338,7 @@ module GweCtpInputModule 'AUXVAR', & ! fortran variable 'DOUBLE1D', & ! type 'NAUX', & ! shape + 'auxiliary variables', & ! longname .false., & ! required .true., & ! multi-record .false., & ! preserve case @@ -332,6 +356,7 @@ module GweCtpInputModule 'BOUNDNAME', & ! fortran variable 'STRING', & ! type '', & ! shape + 'constant temperature name', & ! longname .false., & ! required .true., & ! multi-record .false., & ! preserve case @@ -372,6 +397,7 @@ module GweCtpInputModule 'SPD', & ! fortran variable 'RECARRAY CELLID TEMP AUX BOUNDNAME', & ! type 'MAXBOUND', & ! shape + '', & ! longname .true., & ! required .false., & ! multi-record .false., & ! preserve case diff --git a/src/Idm/gwe-disidm.f90 b/src/Idm/gwe-disidm.f90 index b9c538328fe..33de803d554 100644 --- a/src/Idm/gwe-disidm.f90 +++ b/src/Idm/gwe-disidm.f90 @@ -9,6 +9,7 @@ module GweDisInputModule public gwe_dis_block_definitions public GweDisParamFoundType public gwe_dis_multi_package + public gwe_dis_subpackages type GweDisParamFoundType logical :: length_units = .false. @@ -17,6 +18,11 @@ module GweDisInputModule logical :: yorigin = .false. logical :: angrot = .false. logical :: export_ascii = .false. + logical :: export_nc = .false. + logical :: ncf_filerecord = .false. + logical :: ncf6 = .false. + logical :: filein = .false. + logical :: ncf6_filename = .false. logical :: nlay = .false. logical :: nrow = .false. logical :: ncol = .false. @@ -29,6 +35,12 @@ module GweDisInputModule logical :: gwe_dis_multi_package = .false. + character(len=16), parameter :: & + gwe_dis_subpackages(*) = & + [ & + 'UTL-NCF ' & + ] + type(InputParamDefinitionType), parameter :: & gwedis_length_units = InputParamDefinitionType & ( & @@ -39,6 +51,7 @@ module GweDisInputModule 'LENGTH_UNITS', & ! fortran variable 'STRING', & ! type '', & ! shape + 'model length units', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -56,6 +69,7 @@ module GweDisInputModule 'NOGRB', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'do not write binary grid file', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -73,6 +87,7 @@ module GweDisInputModule 'XORIGIN', & ! fortran variable 'DOUBLE', & ! type '', & ! shape + 'x-position of the model grid origin', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -90,6 +105,7 @@ module GweDisInputModule 'YORIGIN', & ! fortran variable 'DOUBLE', & ! type '', & ! shape + 'y-position of the model grid origin', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -107,6 +123,7 @@ module GweDisInputModule 'ANGROT', & ! fortran variable 'DOUBLE', & ! type '', & ! shape + 'rotation angle', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -124,6 +141,25 @@ module GweDisInputModule 'EXPORT_ASCII', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'export array variables to layered ascii files.', & ! longname + .false., & ! required + .false., & ! multi-record + .false., & ! preserve case + .false., & ! layered + .false. & ! timeseries + ) + + type(InputParamDefinitionType), parameter :: & + gwedis_export_nc = InputParamDefinitionType & + ( & + 'GWE', & ! component + 'DIS', & ! subcomponent + 'OPTIONS', & ! block + 'EXPORT_ARRAY_NETCDF', & ! tag name + 'EXPORT_NC', & ! fortran variable + 'KEYWORD', & ! type + '', & ! shape + 'export array variables to netcdf output files.', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -131,6 +167,78 @@ module GweDisInputModule .false. & ! timeseries ) + type(InputParamDefinitionType), parameter :: & + gwedis_ncf_filerecord = InputParamDefinitionType & + ( & + 'GWE', & ! component + 'DIS', & ! subcomponent + 'OPTIONS', & ! block + 'NCF_FILERECORD', & ! tag name + 'NCF_FILERECORD', & ! fortran variable + 'RECORD NCF6 FILEIN NCF6_FILENAME', & ! type + '', & ! shape + '', & ! longname + .false., & ! required + .false., & ! multi-record + .false., & ! preserve case + .false., & ! layered + .false. & ! timeseries + ) + + type(InputParamDefinitionType), parameter :: & + gwedis_ncf6 = InputParamDefinitionType & + ( & + 'GWE', & ! component + 'DIS', & ! subcomponent + 'OPTIONS', & ! block + 'NCF6', & ! tag name + 'NCF6', & ! fortran variable + 'KEYWORD', & ! type + '', & ! shape + 'ncf keyword', & ! longname + .true., & ! required + .true., & ! multi-record + .false., & ! preserve case + .false., & ! layered + .false. & ! timeseries + ) + + type(InputParamDefinitionType), parameter :: & + gwedis_filein = InputParamDefinitionType & + ( & + 'GWE', & ! component + 'DIS', & ! subcomponent + 'OPTIONS', & ! block + 'FILEIN', & ! tag name + 'FILEIN', & ! fortran variable + 'KEYWORD', & ! type + '', & ! shape + 'file keyword', & ! longname + .true., & ! required + .true., & ! multi-record + .false., & ! preserve case + .false., & ! layered + .false. & ! timeseries + ) + + type(InputParamDefinitionType), parameter :: & + gwedis_ncf6_filename = InputParamDefinitionType & + ( & + 'GWE', & ! component + 'DIS', & ! subcomponent + 'OPTIONS', & ! block + 'NCF6_FILENAME', & ! tag name + 'NCF6_FILENAME', & ! fortran variable + 'STRING', & ! type + '', & ! shape + 'file name of NCF information', & ! longname + .true., & ! required + .true., & ! multi-record + .true., & ! preserve case + .false., & ! layered + .false. & ! timeseries + ) + type(InputParamDefinitionType), parameter :: & gwedis_nlay = InputParamDefinitionType & ( & @@ -141,6 +249,7 @@ module GweDisInputModule 'NLAY', & ! fortran variable 'INTEGER', & ! type '', & ! shape + 'number of layers', & ! longname .true., & ! required .false., & ! multi-record .false., & ! preserve case @@ -158,6 +267,7 @@ module GweDisInputModule 'NROW', & ! fortran variable 'INTEGER', & ! type '', & ! shape + 'number of rows', & ! longname .true., & ! required .false., & ! multi-record .false., & ! preserve case @@ -175,6 +285,7 @@ module GweDisInputModule 'NCOL', & ! fortran variable 'INTEGER', & ! type '', & ! shape + 'number of columns', & ! longname .true., & ! required .false., & ! multi-record .false., & ! preserve case @@ -192,6 +303,7 @@ module GweDisInputModule 'DELR', & ! fortran variable 'DOUBLE1D', & ! type 'NCOL', & ! shape + 'spacing along a row', & ! longname .true., & ! required .false., & ! multi-record .false., & ! preserve case @@ -209,6 +321,7 @@ module GweDisInputModule 'DELC', & ! fortran variable 'DOUBLE1D', & ! type 'NROW', & ! shape + 'spacing along a column', & ! longname .true., & ! required .false., & ! multi-record .false., & ! preserve case @@ -226,6 +339,7 @@ module GweDisInputModule 'TOP', & ! fortran variable 'DOUBLE2D', & ! type 'NCOL NROW', & ! shape + 'cell top elevation', & ! longname .true., & ! required .false., & ! multi-record .false., & ! preserve case @@ -243,6 +357,7 @@ module GweDisInputModule 'BOTM', & ! fortran variable 'DOUBLE3D', & ! type 'NCOL NROW NLAY', & ! shape + 'cell bottom elevation', & ! longname .true., & ! required .false., & ! multi-record .false., & ! preserve case @@ -260,6 +375,7 @@ module GweDisInputModule 'IDOMAIN', & ! fortran variable 'INTEGER3D', & ! type 'NCOL NROW NLAY', & ! shape + 'idomain existence array', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -276,6 +392,11 @@ module GweDisInputModule gwedis_yorigin, & gwedis_angrot, & gwedis_export_ascii, & + gwedis_export_nc, & + gwedis_ncf_filerecord, & + gwedis_ncf6, & + gwedis_filein, & + gwedis_ncf6_filename, & gwedis_nlay, & gwedis_nrow, & gwedis_ncol, & @@ -298,6 +419,7 @@ module GweDisInputModule '', & ! fortran variable '', & ! type '', & ! shape + '', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case diff --git a/src/Idm/gwe-disuidm.f90 b/src/Idm/gwe-disuidm.f90 index 70e6553516b..344223f502b 100644 --- a/src/Idm/gwe-disuidm.f90 +++ b/src/Idm/gwe-disuidm.f90 @@ -9,6 +9,7 @@ module GweDisuInputModule public gwe_disu_block_definitions public GweDisuParamFoundType public gwe_disu_multi_package + public gwe_disu_subpackages type GweDisuParamFoundType logical :: length_units = .false. @@ -43,6 +44,12 @@ module GweDisuInputModule logical :: gwe_disu_multi_package = .false. + character(len=16), parameter :: & + gwe_disu_subpackages(*) = & + [ & + ' ' & + ] + type(InputParamDefinitionType), parameter :: & gwedisu_length_units = InputParamDefinitionType & ( & @@ -53,6 +60,7 @@ module GweDisuInputModule 'LENGTH_UNITS', & ! fortran variable 'STRING', & ! type '', & ! shape + 'model length units', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -70,6 +78,7 @@ module GweDisuInputModule 'NOGRB', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'do not write binary grid file', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -87,6 +96,7 @@ module GweDisuInputModule 'XORIGIN', & ! fortran variable 'DOUBLE', & ! type '', & ! shape + 'x-position origin of the model grid coordinate system', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -104,6 +114,7 @@ module GweDisuInputModule 'YORIGIN', & ! fortran variable 'DOUBLE', & ! type '', & ! shape + 'y-position origin of the model grid coordinate system', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -121,6 +132,7 @@ module GweDisuInputModule 'ANGROT', & ! fortran variable 'DOUBLE', & ! type '', & ! shape + 'rotation angle', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -138,6 +150,7 @@ module GweDisuInputModule 'VOFFSETTOL', & ! fortran variable 'DOUBLE', & ! type '', & ! shape + 'vertical length dimension for top and bottom checking', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -155,6 +168,7 @@ module GweDisuInputModule 'EXPORT_ASCII', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'export array variables to layered ascii files.', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -172,6 +186,7 @@ module GweDisuInputModule 'NODES', & ! fortran variable 'INTEGER', & ! type '', & ! shape + 'number of layers', & ! longname .true., & ! required .false., & ! multi-record .false., & ! preserve case @@ -189,6 +204,7 @@ module GweDisuInputModule 'NJA', & ! fortran variable 'INTEGER', & ! type '', & ! shape + 'number of columns', & ! longname .true., & ! required .false., & ! multi-record .false., & ! preserve case @@ -206,6 +222,7 @@ module GweDisuInputModule 'NVERT', & ! fortran variable 'INTEGER', & ! type '', & ! shape + 'number of vertices', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -223,6 +240,7 @@ module GweDisuInputModule 'TOP', & ! fortran variable 'DOUBLE1D', & ! type 'NODES', & ! shape + 'cell top elevation', & ! longname .true., & ! required .false., & ! multi-record .false., & ! preserve case @@ -240,6 +258,7 @@ module GweDisuInputModule 'BOT', & ! fortran variable 'DOUBLE1D', & ! type 'NODES', & ! shape + 'cell bottom elevation', & ! longname .true., & ! required .false., & ! multi-record .false., & ! preserve case @@ -257,6 +276,7 @@ module GweDisuInputModule 'AREA', & ! fortran variable 'DOUBLE1D', & ! type 'NODES', & ! shape + 'cell surface area', & ! longname .true., & ! required .false., & ! multi-record .false., & ! preserve case @@ -274,6 +294,7 @@ module GweDisuInputModule 'IDOMAIN', & ! fortran variable 'INTEGER1D', & ! type 'NODES', & ! shape + 'idomain existence array', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -291,6 +312,7 @@ module GweDisuInputModule 'IAC', & ! fortran variable 'INTEGER1D', & ! type 'NODES', & ! shape + 'number of cell connections', & ! longname .true., & ! required .false., & ! multi-record .false., & ! preserve case @@ -308,6 +330,7 @@ module GweDisuInputModule 'JA', & ! fortran variable 'INTEGER1D', & ! type 'NJA', & ! shape + 'grid connectivity', & ! longname .true., & ! required .false., & ! multi-record .false., & ! preserve case @@ -325,6 +348,7 @@ module GweDisuInputModule 'IHC', & ! fortran variable 'INTEGER1D', & ! type 'NJA', & ! shape + 'connection type', & ! longname .true., & ! required .false., & ! multi-record .false., & ! preserve case @@ -342,6 +366,7 @@ module GweDisuInputModule 'CL12', & ! fortran variable 'DOUBLE1D', & ! type 'NJA', & ! shape + 'connection lengths', & ! longname .true., & ! required .false., & ! multi-record .false., & ! preserve case @@ -359,6 +384,7 @@ module GweDisuInputModule 'HWVA', & ! fortran variable 'DOUBLE1D', & ! type 'NJA', & ! shape + 'connection lengths', & ! longname .true., & ! required .false., & ! multi-record .false., & ! preserve case @@ -376,6 +402,7 @@ module GweDisuInputModule 'ANGLDEGX', & ! fortran variable 'DOUBLE1D', & ! type 'NJA', & ! shape + 'angle of face normal to connection', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -393,6 +420,7 @@ module GweDisuInputModule 'IV', & ! fortran variable 'INTEGER', & ! type '', & ! shape + 'vertex number', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -410,6 +438,7 @@ module GweDisuInputModule 'XV', & ! fortran variable 'DOUBLE', & ! type '', & ! shape + 'x-coordinate for vertex', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -427,6 +456,7 @@ module GweDisuInputModule 'YV', & ! fortran variable 'DOUBLE', & ! type '', & ! shape + 'y-coordinate for vertex', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -444,6 +474,7 @@ module GweDisuInputModule 'ICELL2D', & ! fortran variable 'INTEGER', & ! type '', & ! shape + 'cell2d number', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -461,6 +492,7 @@ module GweDisuInputModule 'XC', & ! fortran variable 'DOUBLE', & ! type '', & ! shape + 'x-coordinate for cell center', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -478,6 +510,7 @@ module GweDisuInputModule 'YC', & ! fortran variable 'DOUBLE', & ! type '', & ! shape + 'y-coordinate for cell center', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -495,6 +528,7 @@ module GweDisuInputModule 'NCVERT', & ! fortran variable 'INTEGER', & ! type '', & ! shape + 'number of cell vertices', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -512,6 +546,7 @@ module GweDisuInputModule 'ICVERT', & ! fortran variable 'INTEGER1D', & ! type 'NCVERT', & ! shape + 'array of vertex numbers', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -562,6 +597,7 @@ module GweDisuInputModule 'VERTICES', & ! fortran variable 'RECARRAY IV XV YV', & ! type 'NVERT', & ! shape + 'vertices data', & ! longname .true., & ! required .false., & ! multi-record .false., & ! preserve case @@ -579,6 +615,7 @@ module GweDisuInputModule 'CELL2D', & ! fortran variable 'RECARRAY ICELL2D XC YC NCVERT ICVERT', & ! type 'NODES', & ! shape + 'cell2d data', & ! longname .true., & ! required .false., & ! multi-record .false., & ! preserve case diff --git a/src/Idm/gwe-disvidm.f90 b/src/Idm/gwe-disvidm.f90 index bf36ed545a6..d26432017d8 100644 --- a/src/Idm/gwe-disvidm.f90 +++ b/src/Idm/gwe-disvidm.f90 @@ -9,6 +9,7 @@ module GweDisvInputModule public gwe_disv_block_definitions public GweDisvParamFoundType public gwe_disv_multi_package + public gwe_disv_subpackages type GweDisvParamFoundType logical :: length_units = .false. @@ -17,6 +18,11 @@ module GweDisvInputModule logical :: yorigin = .false. logical :: angrot = .false. logical :: export_ascii = .false. + logical :: export_nc = .false. + logical :: ncf_filerecord = .false. + logical :: ncf6 = .false. + logical :: filein = .false. + logical :: ncf6_filename = .false. logical :: nlay = .false. logical :: ncpl = .false. logical :: nvert = .false. @@ -35,6 +41,12 @@ module GweDisvInputModule logical :: gwe_disv_multi_package = .false. + character(len=16), parameter :: & + gwe_disv_subpackages(*) = & + [ & + 'UTL-NCF ' & + ] + type(InputParamDefinitionType), parameter :: & gwedisv_length_units = InputParamDefinitionType & ( & @@ -45,6 +57,7 @@ module GweDisvInputModule 'LENGTH_UNITS', & ! fortran variable 'STRING', & ! type '', & ! shape + 'model length units', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -62,6 +75,7 @@ module GweDisvInputModule 'NOGRB', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'do not write binary grid file', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -79,6 +93,7 @@ module GweDisvInputModule 'XORIGIN', & ! fortran variable 'DOUBLE', & ! type '', & ! shape + 'x-position origin of the model grid coordinate system', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -96,6 +111,7 @@ module GweDisvInputModule 'YORIGIN', & ! fortran variable 'DOUBLE', & ! type '', & ! shape + 'y-position origin of the model grid coordinate system', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -113,6 +129,7 @@ module GweDisvInputModule 'ANGROT', & ! fortran variable 'DOUBLE', & ! type '', & ! shape + 'rotation angle', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -130,6 +147,43 @@ module GweDisvInputModule 'EXPORT_ASCII', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'export array variables to layered ascii files.', & ! longname + .false., & ! required + .false., & ! multi-record + .false., & ! preserve case + .false., & ! layered + .false. & ! timeseries + ) + + type(InputParamDefinitionType), parameter :: & + gwedisv_export_nc = InputParamDefinitionType & + ( & + 'GWE', & ! component + 'DISV', & ! subcomponent + 'OPTIONS', & ! block + 'EXPORT_ARRAY_NETCDF', & ! tag name + 'EXPORT_NC', & ! fortran variable + 'KEYWORD', & ! type + '', & ! shape + 'export array variables to netcdf output files.', & ! longname + .false., & ! required + .false., & ! multi-record + .false., & ! preserve case + .false., & ! layered + .false. & ! timeseries + ) + + type(InputParamDefinitionType), parameter :: & + gwedisv_ncf_filerecord = InputParamDefinitionType & + ( & + 'GWE', & ! component + 'DISV', & ! subcomponent + 'OPTIONS', & ! block + 'NCF_FILERECORD', & ! tag name + 'NCF_FILERECORD', & ! fortran variable + 'RECORD NCF6 FILEIN NCF6_FILENAME', & ! type + '', & ! shape + '', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -137,6 +191,60 @@ module GweDisvInputModule .false. & ! timeseries ) + type(InputParamDefinitionType), parameter :: & + gwedisv_ncf6 = InputParamDefinitionType & + ( & + 'GWE', & ! component + 'DISV', & ! subcomponent + 'OPTIONS', & ! block + 'NCF6', & ! tag name + 'NCF6', & ! fortran variable + 'KEYWORD', & ! type + '', & ! shape + 'ncf keyword', & ! longname + .true., & ! required + .true., & ! multi-record + .false., & ! preserve case + .false., & ! layered + .false. & ! timeseries + ) + + type(InputParamDefinitionType), parameter :: & + gwedisv_filein = InputParamDefinitionType & + ( & + 'GWE', & ! component + 'DISV', & ! subcomponent + 'OPTIONS', & ! block + 'FILEIN', & ! tag name + 'FILEIN', & ! fortran variable + 'KEYWORD', & ! type + '', & ! shape + 'file keyword', & ! longname + .true., & ! required + .true., & ! multi-record + .false., & ! preserve case + .false., & ! layered + .false. & ! timeseries + ) + + type(InputParamDefinitionType), parameter :: & + gwedisv_ncf6_filename = InputParamDefinitionType & + ( & + 'GWE', & ! component + 'DISV', & ! subcomponent + 'OPTIONS', & ! block + 'NCF6_FILENAME', & ! tag name + 'NCF6_FILENAME', & ! fortran variable + 'STRING', & ! type + '', & ! shape + 'file name of NCF information', & ! longname + .true., & ! required + .true., & ! multi-record + .true., & ! preserve case + .false., & ! layered + .false. & ! timeseries + ) + type(InputParamDefinitionType), parameter :: & gwedisv_nlay = InputParamDefinitionType & ( & @@ -147,6 +255,7 @@ module GweDisvInputModule 'NLAY', & ! fortran variable 'INTEGER', & ! type '', & ! shape + 'number of layers', & ! longname .true., & ! required .false., & ! multi-record .false., & ! preserve case @@ -164,6 +273,7 @@ module GweDisvInputModule 'NCPL', & ! fortran variable 'INTEGER', & ! type '', & ! shape + 'number of cells per layer', & ! longname .true., & ! required .false., & ! multi-record .false., & ! preserve case @@ -181,6 +291,7 @@ module GweDisvInputModule 'NVERT', & ! fortran variable 'INTEGER', & ! type '', & ! shape + 'number of columns', & ! longname .true., & ! required .false., & ! multi-record .false., & ! preserve case @@ -198,6 +309,7 @@ module GweDisvInputModule 'TOP', & ! fortran variable 'DOUBLE1D', & ! type 'NCPL', & ! shape + 'model top elevation', & ! longname .true., & ! required .false., & ! multi-record .false., & ! preserve case @@ -215,6 +327,7 @@ module GweDisvInputModule 'BOTM', & ! fortran variable 'DOUBLE2D', & ! type 'NCPL NLAY', & ! shape + 'model bottom elevation', & ! longname .true., & ! required .false., & ! multi-record .false., & ! preserve case @@ -232,6 +345,7 @@ module GweDisvInputModule 'IDOMAIN', & ! fortran variable 'INTEGER2D', & ! type 'NCPL NLAY', & ! shape + 'idomain existence array', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -249,6 +363,7 @@ module GweDisvInputModule 'IV', & ! fortran variable 'INTEGER', & ! type '', & ! shape + 'vertex number', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -266,6 +381,7 @@ module GweDisvInputModule 'XV', & ! fortran variable 'DOUBLE', & ! type '', & ! shape + 'x-coordinate for vertex', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -283,6 +399,7 @@ module GweDisvInputModule 'YV', & ! fortran variable 'DOUBLE', & ! type '', & ! shape + 'y-coordinate for vertex', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -300,6 +417,7 @@ module GweDisvInputModule 'ICELL2D', & ! fortran variable 'INTEGER', & ! type '', & ! shape + 'cell2d number', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -317,6 +435,7 @@ module GweDisvInputModule 'XC', & ! fortran variable 'DOUBLE', & ! type '', & ! shape + 'x-coordinate for cell center', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -334,6 +453,7 @@ module GweDisvInputModule 'YC', & ! fortran variable 'DOUBLE', & ! type '', & ! shape + 'y-coordinate for cell center', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -351,6 +471,7 @@ module GweDisvInputModule 'NCVERT', & ! fortran variable 'INTEGER', & ! type '', & ! shape + 'number of cell vertices', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -368,6 +489,7 @@ module GweDisvInputModule 'ICVERT', & ! fortran variable 'INTEGER1D', & ! type 'NCVERT', & ! shape + 'array of vertex numbers', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -384,6 +506,11 @@ module GweDisvInputModule gwedisv_yorigin, & gwedisv_angrot, & gwedisv_export_ascii, & + gwedisv_export_nc, & + gwedisv_ncf_filerecord, & + gwedisv_ncf6, & + gwedisv_filein, & + gwedisv_ncf6_filename, & gwedisv_nlay, & gwedisv_ncpl, & gwedisv_nvert, & @@ -410,6 +537,7 @@ module GweDisvInputModule 'VERTICES', & ! fortran variable 'RECARRAY IV XV YV', & ! type 'NVERT', & ! shape + 'vertices data', & ! longname .true., & ! required .false., & ! multi-record .false., & ! preserve case @@ -427,6 +555,7 @@ module GweDisvInputModule 'CELL2D', & ! fortran variable 'RECARRAY ICELL2D XC YC NCVERT ICVERT', & ! type 'NCPL', & ! shape + 'cell2d data', & ! longname .true., & ! required .false., & ! multi-record .false., & ! preserve case diff --git a/src/Idm/gwe-icidm.f90 b/src/Idm/gwe-icidm.f90 index ba5694bb75f..d2d5d18c1bd 100644 --- a/src/Idm/gwe-icidm.f90 +++ b/src/Idm/gwe-icidm.f90 @@ -9,14 +9,22 @@ module GweIcInputModule public gwe_ic_block_definitions public GweIcParamFoundType public gwe_ic_multi_package + public gwe_ic_subpackages type GweIcParamFoundType logical :: export_ascii = .false. + logical :: export_nc = .false. logical :: strt = .false. end type GweIcParamFoundType logical :: gwe_ic_multi_package = .false. + character(len=16), parameter :: & + gwe_ic_subpackages(*) = & + [ & + ' ' & + ] + type(InputParamDefinitionType), parameter :: & gweic_export_ascii = InputParamDefinitionType & ( & @@ -27,6 +35,25 @@ module GweIcInputModule 'EXPORT_ASCII', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'export array variables to layered ascii files.', & ! longname + .false., & ! required + .false., & ! multi-record + .false., & ! preserve case + .false., & ! layered + .false. & ! timeseries + ) + + type(InputParamDefinitionType), parameter :: & + gweic_export_nc = InputParamDefinitionType & + ( & + 'GWE', & ! component + 'IC', & ! subcomponent + 'OPTIONS', & ! block + 'EXPORT_ARRAY_NETCDF', & ! tag name + 'EXPORT_NC', & ! fortran variable + 'KEYWORD', & ! type + '', & ! shape + 'export array variables to netcdf output files.', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -44,6 +71,7 @@ module GweIcInputModule 'STRT', & ! fortran variable 'DOUBLE1D', & ! type 'NODES', & ! shape + 'starting temperature', & ! longname .true., & ! required .false., & ! multi-record .false., & ! preserve case @@ -55,6 +83,7 @@ module GweIcInputModule gwe_ic_param_definitions(*) = & [ & gweic_export_ascii, & + gweic_export_nc, & gweic_strt & ] @@ -70,6 +99,7 @@ module GweIcInputModule '', & ! fortran variable '', & ! type '', & ! shape + '', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case diff --git a/src/Idm/gwe-namidm.f90 b/src/Idm/gwe-namidm.f90 index 14d85843018..72754fbefb6 100644 --- a/src/Idm/gwe-namidm.f90 +++ b/src/Idm/gwe-namidm.f90 @@ -9,12 +9,14 @@ module GweNamInputModule public gwe_nam_block_definitions public GweNamParamFoundType public gwe_nam_multi_package + public gwe_nam_subpackages type GweNamParamFoundType logical :: list = .false. logical :: print_input = .false. logical :: print_flows = .false. logical :: save_flows = .false. + logical :: export_netcdf = .false. logical :: ftype = .false. logical :: fname = .false. logical :: pname = .false. @@ -22,6 +24,12 @@ module GweNamInputModule logical :: gwe_nam_multi_package = .false. + character(len=16), parameter :: & + gwe_nam_subpackages(*) = & + [ & + ' ' & + ] + type(InputParamDefinitionType), parameter :: & gwenam_list = InputParamDefinitionType & ( & @@ -32,6 +40,7 @@ module GweNamInputModule 'LIST', & ! fortran variable 'STRING', & ! type '', & ! shape + 'name of listing file', & ! longname .false., & ! required .false., & ! multi-record .true., & ! preserve case @@ -49,6 +58,7 @@ module GweNamInputModule 'PRINT_INPUT', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'print input to listing file', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -66,6 +76,7 @@ module GweNamInputModule 'PRINT_FLOWS', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'print calculated flows to listing file', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -83,6 +94,25 @@ module GweNamInputModule 'SAVE_FLOWS', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'save flows for all packages to budget file', & ! longname + .false., & ! required + .false., & ! multi-record + .false., & ! preserve case + .false., & ! layered + .false. & ! timeseries + ) + + type(InputParamDefinitionType), parameter :: & + gwenam_export_netcdf = InputParamDefinitionType & + ( & + 'GWE', & ! component + 'NAM', & ! subcomponent + 'OPTIONS', & ! block + 'EXPORT_NETCDF', & ! tag name + 'EXPORT_NETCDF', & ! fortran variable + 'STRING', & ! type + '', & ! shape + 'export model output netcdf file.', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -100,6 +130,7 @@ module GweNamInputModule 'FTYPE', & ! fortran variable 'STRING', & ! type '', & ! shape + 'package type', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -117,6 +148,7 @@ module GweNamInputModule 'FNAME', & ! fortran variable 'STRING', & ! type '', & ! shape + 'file name', & ! longname .true., & ! required .true., & ! multi-record .true., & ! preserve case @@ -134,6 +166,7 @@ module GweNamInputModule 'PNAME', & ! fortran variable 'STRING', & ! type '', & ! shape + 'user name for package', & ! longname .false., & ! required .true., & ! multi-record .false., & ! preserve case @@ -148,6 +181,7 @@ module GweNamInputModule gwenam_print_input, & gwenam_print_flows, & gwenam_save_flows, & + gwenam_export_netcdf, & gwenam_ftype, & gwenam_fname, & gwenam_pname & @@ -163,6 +197,7 @@ module GweNamInputModule 'PACKAGES', & ! fortran variable 'RECARRAY FTYPE FNAME PNAME', & ! type '', & ! shape + 'package list', & ! longname .true., & ! required .false., & ! multi-record .false., & ! preserve case diff --git a/src/Idm/gwf-chdidm.f90 b/src/Idm/gwf-chdidm.f90 index 78f5c565e44..9806ad252c6 100644 --- a/src/Idm/gwf-chdidm.f90 +++ b/src/Idm/gwf-chdidm.f90 @@ -9,6 +9,7 @@ module GwfChdInputModule public gwf_chd_block_definitions public GwfChdParamFoundType public gwf_chd_multi_package + public gwf_chd_subpackages type GwfChdParamFoundType logical :: auxiliary = .false. @@ -34,6 +35,12 @@ module GwfChdInputModule logical :: gwf_chd_multi_package = .true. + character(len=16), parameter :: & + gwf_chd_subpackages(*) = & + [ & + ' ' & + ] + type(InputParamDefinitionType), parameter :: & gwfchd_auxiliary = InputParamDefinitionType & ( & @@ -44,6 +51,7 @@ module GwfChdInputModule 'AUXILIARY', & ! fortran variable 'STRING', & ! type 'NAUX', & ! shape + 'keyword to specify aux variables', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -61,6 +69,7 @@ module GwfChdInputModule 'AUXMULTNAME', & ! fortran variable 'STRING', & ! type '', & ! shape + 'name of auxiliary variable for multiplier', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -78,6 +87,7 @@ module GwfChdInputModule 'BOUNDNAMES', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + '', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -95,6 +105,7 @@ module GwfChdInputModule 'IPRPAK', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'print input to listing file', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -112,6 +123,7 @@ module GwfChdInputModule 'IPRFLOW', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'print CHD flows to listing file', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -129,6 +141,7 @@ module GwfChdInputModule 'IPAKCB', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'save CHD flows to budget file', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -146,6 +159,7 @@ module GwfChdInputModule 'TS_FILERECORD', & ! fortran variable 'RECORD TS6 FILEIN TS6_FILENAME', & ! type '', & ! shape + '', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -163,6 +177,7 @@ module GwfChdInputModule 'TS6', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'head keyword', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -180,6 +195,7 @@ module GwfChdInputModule 'FILEIN', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'file keyword', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -197,6 +213,7 @@ module GwfChdInputModule 'TS6_FILENAME', & ! fortran variable 'STRING', & ! type '', & ! shape + 'file name of time series information', & ! longname .true., & ! required .true., & ! multi-record .true., & ! preserve case @@ -214,6 +231,7 @@ module GwfChdInputModule 'OBS_FILERECORD', & ! fortran variable 'RECORD OBS6 FILEIN OBS6_FILENAME', & ! type '', & ! shape + '', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -231,6 +249,7 @@ module GwfChdInputModule 'OBS6', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'obs keyword', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -248,6 +267,7 @@ module GwfChdInputModule 'OBS6_FILENAME', & ! fortran variable 'STRING', & ! type '', & ! shape + 'obs6 input filename', & ! longname .true., & ! required .true., & ! multi-record .true., & ! preserve case @@ -265,6 +285,7 @@ module GwfChdInputModule 'INEWTON', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'turn off Newton for unconfined cells', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -282,6 +303,7 @@ module GwfChdInputModule 'MAXBOUND', & ! fortran variable 'INTEGER', & ! type '', & ! shape + 'maximum number of constant heads', & ! longname .true., & ! required .false., & ! multi-record .false., & ! preserve case @@ -299,6 +321,7 @@ module GwfChdInputModule 'CELLID', & ! fortran variable 'INTEGER1D', & ! type 'NCELLDIM', & ! shape + 'cell identifier', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -316,6 +339,7 @@ module GwfChdInputModule 'HEAD', & ! fortran variable 'DOUBLE', & ! type '', & ! shape + 'head value assigned to constant head', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -333,6 +357,7 @@ module GwfChdInputModule 'AUXVAR', & ! fortran variable 'DOUBLE1D', & ! type 'NAUX', & ! shape + 'auxiliary variables', & ! longname .false., & ! required .true., & ! multi-record .false., & ! preserve case @@ -350,6 +375,7 @@ module GwfChdInputModule 'BOUNDNAME', & ! fortran variable 'STRING', & ! type '', & ! shape + 'constant head boundary name', & ! longname .false., & ! required .true., & ! multi-record .false., & ! preserve case @@ -391,6 +417,7 @@ module GwfChdInputModule 'SPD', & ! fortran variable 'RECARRAY CELLID HEAD AUX BOUNDNAME', & ! type 'MAXBOUND', & ! shape + '', & ! longname .true., & ! required .false., & ! multi-record .false., & ! preserve case diff --git a/src/Idm/gwf-disidm.f90 b/src/Idm/gwf-disidm.f90 index 358df5e544b..62b1aa2185e 100644 --- a/src/Idm/gwf-disidm.f90 +++ b/src/Idm/gwf-disidm.f90 @@ -9,6 +9,7 @@ module GwfDisInputModule public gwf_dis_block_definitions public GwfDisParamFoundType public gwf_dis_multi_package + public gwf_dis_subpackages type GwfDisParamFoundType logical :: length_units = .false. @@ -17,6 +18,11 @@ module GwfDisInputModule logical :: yorigin = .false. logical :: angrot = .false. logical :: export_ascii = .false. + logical :: export_nc = .false. + logical :: ncf_filerecord = .false. + logical :: ncf6 = .false. + logical :: filein = .false. + logical :: ncf6_filename = .false. logical :: nlay = .false. logical :: nrow = .false. logical :: ncol = .false. @@ -29,6 +35,12 @@ module GwfDisInputModule logical :: gwf_dis_multi_package = .false. + character(len=16), parameter :: & + gwf_dis_subpackages(*) = & + [ & + 'UTL-NCF ' & + ] + type(InputParamDefinitionType), parameter :: & gwfdis_length_units = InputParamDefinitionType & ( & @@ -39,6 +51,7 @@ module GwfDisInputModule 'LENGTH_UNITS', & ! fortran variable 'STRING', & ! type '', & ! shape + 'model length units', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -56,6 +69,7 @@ module GwfDisInputModule 'NOGRB', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'do not write binary grid file', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -73,6 +87,7 @@ module GwfDisInputModule 'XORIGIN', & ! fortran variable 'DOUBLE', & ! type '', & ! shape + 'x-position of the model grid origin', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -90,6 +105,7 @@ module GwfDisInputModule 'YORIGIN', & ! fortran variable 'DOUBLE', & ! type '', & ! shape + 'y-position of the model grid origin', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -107,6 +123,7 @@ module GwfDisInputModule 'ANGROT', & ! fortran variable 'DOUBLE', & ! type '', & ! shape + 'rotation angle', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -124,6 +141,25 @@ module GwfDisInputModule 'EXPORT_ASCII', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'export array variables to layered ascii files.', & ! longname + .false., & ! required + .false., & ! multi-record + .false., & ! preserve case + .false., & ! layered + .false. & ! timeseries + ) + + type(InputParamDefinitionType), parameter :: & + gwfdis_export_nc = InputParamDefinitionType & + ( & + 'GWF', & ! component + 'DIS', & ! subcomponent + 'OPTIONS', & ! block + 'EXPORT_ARRAY_NETCDF', & ! tag name + 'EXPORT_NC', & ! fortran variable + 'KEYWORD', & ! type + '', & ! shape + 'export array variables to netcdf output files.', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -131,6 +167,78 @@ module GwfDisInputModule .false. & ! timeseries ) + type(InputParamDefinitionType), parameter :: & + gwfdis_ncf_filerecord = InputParamDefinitionType & + ( & + 'GWF', & ! component + 'DIS', & ! subcomponent + 'OPTIONS', & ! block + 'NCF_FILERECORD', & ! tag name + 'NCF_FILERECORD', & ! fortran variable + 'RECORD NCF6 FILEIN NCF6_FILENAME', & ! type + '', & ! shape + '', & ! longname + .false., & ! required + .false., & ! multi-record + .false., & ! preserve case + .false., & ! layered + .false. & ! timeseries + ) + + type(InputParamDefinitionType), parameter :: & + gwfdis_ncf6 = InputParamDefinitionType & + ( & + 'GWF', & ! component + 'DIS', & ! subcomponent + 'OPTIONS', & ! block + 'NCF6', & ! tag name + 'NCF6', & ! fortran variable + 'KEYWORD', & ! type + '', & ! shape + 'ncf keyword', & ! longname + .true., & ! required + .true., & ! multi-record + .false., & ! preserve case + .false., & ! layered + .false. & ! timeseries + ) + + type(InputParamDefinitionType), parameter :: & + gwfdis_filein = InputParamDefinitionType & + ( & + 'GWF', & ! component + 'DIS', & ! subcomponent + 'OPTIONS', & ! block + 'FILEIN', & ! tag name + 'FILEIN', & ! fortran variable + 'KEYWORD', & ! type + '', & ! shape + 'file keyword', & ! longname + .true., & ! required + .true., & ! multi-record + .false., & ! preserve case + .false., & ! layered + .false. & ! timeseries + ) + + type(InputParamDefinitionType), parameter :: & + gwfdis_ncf6_filename = InputParamDefinitionType & + ( & + 'GWF', & ! component + 'DIS', & ! subcomponent + 'OPTIONS', & ! block + 'NCF6_FILENAME', & ! tag name + 'NCF6_FILENAME', & ! fortran variable + 'STRING', & ! type + '', & ! shape + 'file name of NCF information', & ! longname + .true., & ! required + .true., & ! multi-record + .true., & ! preserve case + .false., & ! layered + .false. & ! timeseries + ) + type(InputParamDefinitionType), parameter :: & gwfdis_nlay = InputParamDefinitionType & ( & @@ -141,6 +249,7 @@ module GwfDisInputModule 'NLAY', & ! fortran variable 'INTEGER', & ! type '', & ! shape + 'number of layers', & ! longname .true., & ! required .false., & ! multi-record .false., & ! preserve case @@ -158,6 +267,7 @@ module GwfDisInputModule 'NROW', & ! fortran variable 'INTEGER', & ! type '', & ! shape + 'number of rows', & ! longname .true., & ! required .false., & ! multi-record .false., & ! preserve case @@ -175,6 +285,7 @@ module GwfDisInputModule 'NCOL', & ! fortran variable 'INTEGER', & ! type '', & ! shape + 'number of columns', & ! longname .true., & ! required .false., & ! multi-record .false., & ! preserve case @@ -192,6 +303,7 @@ module GwfDisInputModule 'DELR', & ! fortran variable 'DOUBLE1D', & ! type 'NCOL', & ! shape + 'spacing along a row', & ! longname .true., & ! required .false., & ! multi-record .false., & ! preserve case @@ -209,6 +321,7 @@ module GwfDisInputModule 'DELC', & ! fortran variable 'DOUBLE1D', & ! type 'NROW', & ! shape + 'spacing along a column', & ! longname .true., & ! required .false., & ! multi-record .false., & ! preserve case @@ -226,6 +339,7 @@ module GwfDisInputModule 'TOP', & ! fortran variable 'DOUBLE2D', & ! type 'NCOL NROW', & ! shape + 'cell top elevation', & ! longname .true., & ! required .false., & ! multi-record .false., & ! preserve case @@ -243,6 +357,7 @@ module GwfDisInputModule 'BOTM', & ! fortran variable 'DOUBLE3D', & ! type 'NCOL NROW NLAY', & ! shape + 'cell bottom elevation', & ! longname .true., & ! required .false., & ! multi-record .false., & ! preserve case @@ -260,6 +375,7 @@ module GwfDisInputModule 'IDOMAIN', & ! fortran variable 'INTEGER3D', & ! type 'NCOL NROW NLAY', & ! shape + 'idomain existence array', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -276,6 +392,11 @@ module GwfDisInputModule gwfdis_yorigin, & gwfdis_angrot, & gwfdis_export_ascii, & + gwfdis_export_nc, & + gwfdis_ncf_filerecord, & + gwfdis_ncf6, & + gwfdis_filein, & + gwfdis_ncf6_filename, & gwfdis_nlay, & gwfdis_nrow, & gwfdis_ncol, & @@ -298,6 +419,7 @@ module GwfDisInputModule '', & ! fortran variable '', & ! type '', & ! shape + '', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case diff --git a/src/Idm/gwf-disuidm.f90 b/src/Idm/gwf-disuidm.f90 index f3a82ea63cc..2819d756930 100644 --- a/src/Idm/gwf-disuidm.f90 +++ b/src/Idm/gwf-disuidm.f90 @@ -9,6 +9,7 @@ module GwfDisuInputModule public gwf_disu_block_definitions public GwfDisuParamFoundType public gwf_disu_multi_package + public gwf_disu_subpackages type GwfDisuParamFoundType logical :: length_units = .false. @@ -43,6 +44,12 @@ module GwfDisuInputModule logical :: gwf_disu_multi_package = .false. + character(len=16), parameter :: & + gwf_disu_subpackages(*) = & + [ & + ' ' & + ] + type(InputParamDefinitionType), parameter :: & gwfdisu_length_units = InputParamDefinitionType & ( & @@ -53,6 +60,7 @@ module GwfDisuInputModule 'LENGTH_UNITS', & ! fortran variable 'STRING', & ! type '', & ! shape + 'model length units', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -70,6 +78,7 @@ module GwfDisuInputModule 'NOGRB', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'do not write binary grid file', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -87,6 +96,7 @@ module GwfDisuInputModule 'XORIGIN', & ! fortran variable 'DOUBLE', & ! type '', & ! shape + 'x-position origin of the model grid coordinate system', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -104,6 +114,7 @@ module GwfDisuInputModule 'YORIGIN', & ! fortran variable 'DOUBLE', & ! type '', & ! shape + 'y-position origin of the model grid coordinate system', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -121,6 +132,7 @@ module GwfDisuInputModule 'ANGROT', & ! fortran variable 'DOUBLE', & ! type '', & ! shape + 'rotation angle', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -138,6 +150,7 @@ module GwfDisuInputModule 'VOFFSETTOL', & ! fortran variable 'DOUBLE', & ! type '', & ! shape + 'vertical length dimension for top and bottom checking', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -155,6 +168,7 @@ module GwfDisuInputModule 'EXPORT_ASCII', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'export array variables to layered ascii files.', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -172,6 +186,7 @@ module GwfDisuInputModule 'NODES', & ! fortran variable 'INTEGER', & ! type '', & ! shape + 'number of layers', & ! longname .true., & ! required .false., & ! multi-record .false., & ! preserve case @@ -189,6 +204,7 @@ module GwfDisuInputModule 'NJA', & ! fortran variable 'INTEGER', & ! type '', & ! shape + 'number of columns', & ! longname .true., & ! required .false., & ! multi-record .false., & ! preserve case @@ -206,6 +222,7 @@ module GwfDisuInputModule 'NVERT', & ! fortran variable 'INTEGER', & ! type '', & ! shape + 'number of vertices', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -223,6 +240,7 @@ module GwfDisuInputModule 'TOP', & ! fortran variable 'DOUBLE1D', & ! type 'NODES', & ! shape + 'cell top elevation', & ! longname .true., & ! required .false., & ! multi-record .false., & ! preserve case @@ -240,6 +258,7 @@ module GwfDisuInputModule 'BOT', & ! fortran variable 'DOUBLE1D', & ! type 'NODES', & ! shape + 'cell bottom elevation', & ! longname .true., & ! required .false., & ! multi-record .false., & ! preserve case @@ -257,6 +276,7 @@ module GwfDisuInputModule 'AREA', & ! fortran variable 'DOUBLE1D', & ! type 'NODES', & ! shape + 'cell surface area', & ! longname .true., & ! required .false., & ! multi-record .false., & ! preserve case @@ -274,6 +294,7 @@ module GwfDisuInputModule 'IDOMAIN', & ! fortran variable 'INTEGER1D', & ! type 'NODES', & ! shape + 'idomain existence array', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -291,6 +312,7 @@ module GwfDisuInputModule 'IAC', & ! fortran variable 'INTEGER1D', & ! type 'NODES', & ! shape + 'number of cell connections', & ! longname .true., & ! required .false., & ! multi-record .false., & ! preserve case @@ -308,6 +330,7 @@ module GwfDisuInputModule 'JA', & ! fortran variable 'INTEGER1D', & ! type 'NJA', & ! shape + 'grid connectivity', & ! longname .true., & ! required .false., & ! multi-record .false., & ! preserve case @@ -325,6 +348,7 @@ module GwfDisuInputModule 'IHC', & ! fortran variable 'INTEGER1D', & ! type 'NJA', & ! shape + 'connection type', & ! longname .true., & ! required .false., & ! multi-record .false., & ! preserve case @@ -342,6 +366,7 @@ module GwfDisuInputModule 'CL12', & ! fortran variable 'DOUBLE1D', & ! type 'NJA', & ! shape + 'connection lengths', & ! longname .true., & ! required .false., & ! multi-record .false., & ! preserve case @@ -359,6 +384,7 @@ module GwfDisuInputModule 'HWVA', & ! fortran variable 'DOUBLE1D', & ! type 'NJA', & ! shape + 'connection lengths', & ! longname .true., & ! required .false., & ! multi-record .false., & ! preserve case @@ -376,6 +402,7 @@ module GwfDisuInputModule 'ANGLDEGX', & ! fortran variable 'DOUBLE1D', & ! type 'NJA', & ! shape + 'angle of face normal to connection', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -393,6 +420,7 @@ module GwfDisuInputModule 'IV', & ! fortran variable 'INTEGER', & ! type '', & ! shape + 'vertex number', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -410,6 +438,7 @@ module GwfDisuInputModule 'XV', & ! fortran variable 'DOUBLE', & ! type '', & ! shape + 'x-coordinate for vertex', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -427,6 +456,7 @@ module GwfDisuInputModule 'YV', & ! fortran variable 'DOUBLE', & ! type '', & ! shape + 'y-coordinate for vertex', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -444,6 +474,7 @@ module GwfDisuInputModule 'ICELL2D', & ! fortran variable 'INTEGER', & ! type '', & ! shape + 'cell2d number', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -461,6 +492,7 @@ module GwfDisuInputModule 'XC', & ! fortran variable 'DOUBLE', & ! type '', & ! shape + 'x-coordinate for cell center', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -478,6 +510,7 @@ module GwfDisuInputModule 'YC', & ! fortran variable 'DOUBLE', & ! type '', & ! shape + 'y-coordinate for cell center', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -495,6 +528,7 @@ module GwfDisuInputModule 'NCVERT', & ! fortran variable 'INTEGER', & ! type '', & ! shape + 'number of cell vertices', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -512,6 +546,7 @@ module GwfDisuInputModule 'ICVERT', & ! fortran variable 'INTEGER1D', & ! type 'NCVERT', & ! shape + 'array of vertex numbers', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -562,6 +597,7 @@ module GwfDisuInputModule 'VERTICES', & ! fortran variable 'RECARRAY IV XV YV', & ! type 'NVERT', & ! shape + 'vertices data', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -579,6 +615,7 @@ module GwfDisuInputModule 'CELL2D', & ! fortran variable 'RECARRAY ICELL2D XC YC NCVERT ICVERT', & ! type 'NODES', & ! shape + 'cell2d data', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case diff --git a/src/Idm/gwf-disvidm.f90 b/src/Idm/gwf-disvidm.f90 index 5f028cd764a..acc709310c7 100644 --- a/src/Idm/gwf-disvidm.f90 +++ b/src/Idm/gwf-disvidm.f90 @@ -9,6 +9,7 @@ module GwfDisvInputModule public gwf_disv_block_definitions public GwfDisvParamFoundType public gwf_disv_multi_package + public gwf_disv_subpackages type GwfDisvParamFoundType logical :: length_units = .false. @@ -17,6 +18,11 @@ module GwfDisvInputModule logical :: yorigin = .false. logical :: angrot = .false. logical :: export_ascii = .false. + logical :: export_nc = .false. + logical :: ncf_filerecord = .false. + logical :: ncf6 = .false. + logical :: filein = .false. + logical :: ncf6_filename = .false. logical :: nlay = .false. logical :: ncpl = .false. logical :: nvert = .false. @@ -35,6 +41,12 @@ module GwfDisvInputModule logical :: gwf_disv_multi_package = .false. + character(len=16), parameter :: & + gwf_disv_subpackages(*) = & + [ & + 'UTL-NCF ' & + ] + type(InputParamDefinitionType), parameter :: & gwfdisv_length_units = InputParamDefinitionType & ( & @@ -45,6 +57,7 @@ module GwfDisvInputModule 'LENGTH_UNITS', & ! fortran variable 'STRING', & ! type '', & ! shape + 'model length units', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -62,6 +75,7 @@ module GwfDisvInputModule 'NOGRB', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'do not write binary grid file', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -79,6 +93,7 @@ module GwfDisvInputModule 'XORIGIN', & ! fortran variable 'DOUBLE', & ! type '', & ! shape + 'x-position origin of the model grid coordinate system', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -96,6 +111,7 @@ module GwfDisvInputModule 'YORIGIN', & ! fortran variable 'DOUBLE', & ! type '', & ! shape + 'y-position origin of the model grid coordinate system', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -113,6 +129,7 @@ module GwfDisvInputModule 'ANGROT', & ! fortran variable 'DOUBLE', & ! type '', & ! shape + 'rotation angle', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -130,6 +147,43 @@ module GwfDisvInputModule 'EXPORT_ASCII', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'export array variables to layered ascii files.', & ! longname + .false., & ! required + .false., & ! multi-record + .false., & ! preserve case + .false., & ! layered + .false. & ! timeseries + ) + + type(InputParamDefinitionType), parameter :: & + gwfdisv_export_nc = InputParamDefinitionType & + ( & + 'GWF', & ! component + 'DISV', & ! subcomponent + 'OPTIONS', & ! block + 'EXPORT_ARRAY_NETCDF', & ! tag name + 'EXPORT_NC', & ! fortran variable + 'KEYWORD', & ! type + '', & ! shape + 'export array variables to netcdf output files.', & ! longname + .false., & ! required + .false., & ! multi-record + .false., & ! preserve case + .false., & ! layered + .false. & ! timeseries + ) + + type(InputParamDefinitionType), parameter :: & + gwfdisv_ncf_filerecord = InputParamDefinitionType & + ( & + 'GWF', & ! component + 'DISV', & ! subcomponent + 'OPTIONS', & ! block + 'NCF_FILERECORD', & ! tag name + 'NCF_FILERECORD', & ! fortran variable + 'RECORD NCF6 FILEIN NCF6_FILENAME', & ! type + '', & ! shape + '', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -137,6 +191,60 @@ module GwfDisvInputModule .false. & ! timeseries ) + type(InputParamDefinitionType), parameter :: & + gwfdisv_ncf6 = InputParamDefinitionType & + ( & + 'GWF', & ! component + 'DISV', & ! subcomponent + 'OPTIONS', & ! block + 'NCF6', & ! tag name + 'NCF6', & ! fortran variable + 'KEYWORD', & ! type + '', & ! shape + 'ncf keyword', & ! longname + .true., & ! required + .true., & ! multi-record + .false., & ! preserve case + .false., & ! layered + .false. & ! timeseries + ) + + type(InputParamDefinitionType), parameter :: & + gwfdisv_filein = InputParamDefinitionType & + ( & + 'GWF', & ! component + 'DISV', & ! subcomponent + 'OPTIONS', & ! block + 'FILEIN', & ! tag name + 'FILEIN', & ! fortran variable + 'KEYWORD', & ! type + '', & ! shape + 'file keyword', & ! longname + .true., & ! required + .true., & ! multi-record + .false., & ! preserve case + .false., & ! layered + .false. & ! timeseries + ) + + type(InputParamDefinitionType), parameter :: & + gwfdisv_ncf6_filename = InputParamDefinitionType & + ( & + 'GWF', & ! component + 'DISV', & ! subcomponent + 'OPTIONS', & ! block + 'NCF6_FILENAME', & ! tag name + 'NCF6_FILENAME', & ! fortran variable + 'STRING', & ! type + '', & ! shape + 'file name of NCF information', & ! longname + .true., & ! required + .true., & ! multi-record + .true., & ! preserve case + .false., & ! layered + .false. & ! timeseries + ) + type(InputParamDefinitionType), parameter :: & gwfdisv_nlay = InputParamDefinitionType & ( & @@ -147,6 +255,7 @@ module GwfDisvInputModule 'NLAY', & ! fortran variable 'INTEGER', & ! type '', & ! shape + 'number of layers', & ! longname .true., & ! required .false., & ! multi-record .false., & ! preserve case @@ -164,6 +273,7 @@ module GwfDisvInputModule 'NCPL', & ! fortran variable 'INTEGER', & ! type '', & ! shape + 'number of cells per layer', & ! longname .true., & ! required .false., & ! multi-record .false., & ! preserve case @@ -181,6 +291,7 @@ module GwfDisvInputModule 'NVERT', & ! fortran variable 'INTEGER', & ! type '', & ! shape + 'number of columns', & ! longname .true., & ! required .false., & ! multi-record .false., & ! preserve case @@ -198,6 +309,7 @@ module GwfDisvInputModule 'TOP', & ! fortran variable 'DOUBLE1D', & ! type 'NCPL', & ! shape + 'model top elevation', & ! longname .true., & ! required .false., & ! multi-record .false., & ! preserve case @@ -215,6 +327,7 @@ module GwfDisvInputModule 'BOTM', & ! fortran variable 'DOUBLE2D', & ! type 'NCPL NLAY', & ! shape + 'model bottom elevation', & ! longname .true., & ! required .false., & ! multi-record .false., & ! preserve case @@ -232,6 +345,7 @@ module GwfDisvInputModule 'IDOMAIN', & ! fortran variable 'INTEGER2D', & ! type 'NCPL NLAY', & ! shape + 'idomain existence array', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -249,6 +363,7 @@ module GwfDisvInputModule 'IV', & ! fortran variable 'INTEGER', & ! type '', & ! shape + 'vertex number', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -266,6 +381,7 @@ module GwfDisvInputModule 'XV', & ! fortran variable 'DOUBLE', & ! type '', & ! shape + 'x-coordinate for vertex', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -283,6 +399,7 @@ module GwfDisvInputModule 'YV', & ! fortran variable 'DOUBLE', & ! type '', & ! shape + 'y-coordinate for vertex', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -300,6 +417,7 @@ module GwfDisvInputModule 'ICELL2D', & ! fortran variable 'INTEGER', & ! type '', & ! shape + 'cell2d number', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -317,6 +435,7 @@ module GwfDisvInputModule 'XC', & ! fortran variable 'DOUBLE', & ! type '', & ! shape + 'x-coordinate for cell center', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -334,6 +453,7 @@ module GwfDisvInputModule 'YC', & ! fortran variable 'DOUBLE', & ! type '', & ! shape + 'y-coordinate for cell center', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -351,6 +471,7 @@ module GwfDisvInputModule 'NCVERT', & ! fortran variable 'INTEGER', & ! type '', & ! shape + 'number of cell vertices', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -368,6 +489,7 @@ module GwfDisvInputModule 'ICVERT', & ! fortran variable 'INTEGER1D', & ! type 'NCVERT', & ! shape + 'array of vertex numbers', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -384,6 +506,11 @@ module GwfDisvInputModule gwfdisv_yorigin, & gwfdisv_angrot, & gwfdisv_export_ascii, & + gwfdisv_export_nc, & + gwfdisv_ncf_filerecord, & + gwfdisv_ncf6, & + gwfdisv_filein, & + gwfdisv_ncf6_filename, & gwfdisv_nlay, & gwfdisv_ncpl, & gwfdisv_nvert, & @@ -410,6 +537,7 @@ module GwfDisvInputModule 'VERTICES', & ! fortran variable 'RECARRAY IV XV YV', & ! type 'NVERT', & ! shape + 'vertices data', & ! longname .true., & ! required .false., & ! multi-record .false., & ! preserve case @@ -427,6 +555,7 @@ module GwfDisvInputModule 'CELL2D', & ! fortran variable 'RECARRAY ICELL2D XC YC NCVERT ICVERT', & ! type 'NCPL', & ! shape + 'cell2d data', & ! longname .true., & ! required .false., & ! multi-record .false., & ! preserve case diff --git a/src/Idm/gwf-drnidm.f90 b/src/Idm/gwf-drnidm.f90 index ddd87932b4c..8d2e7c34bcb 100644 --- a/src/Idm/gwf-drnidm.f90 +++ b/src/Idm/gwf-drnidm.f90 @@ -9,6 +9,7 @@ module GwfDrnInputModule public gwf_drn_block_definitions public GwfDrnParamFoundType public gwf_drn_multi_package + public gwf_drn_subpackages type GwfDrnParamFoundType logical :: auxiliary = .false. @@ -37,6 +38,12 @@ module GwfDrnInputModule logical :: gwf_drn_multi_package = .true. + character(len=16), parameter :: & + gwf_drn_subpackages(*) = & + [ & + ' ' & + ] + type(InputParamDefinitionType), parameter :: & gwfdrn_auxiliary = InputParamDefinitionType & ( & @@ -47,6 +54,7 @@ module GwfDrnInputModule 'AUXILIARY', & ! fortran variable 'STRING', & ! type 'NAUX', & ! shape + 'keyword to specify aux variables', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -64,6 +72,7 @@ module GwfDrnInputModule 'AUXMULTNAME', & ! fortran variable 'STRING', & ! type '', & ! shape + 'name of auxiliary variable for multiplier', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -81,6 +90,7 @@ module GwfDrnInputModule 'AUXDEPTHNAME', & ! fortran variable 'STRING', & ! type '', & ! shape + 'name of auxiliary variable for drainage depth', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -98,6 +108,7 @@ module GwfDrnInputModule 'BOUNDNAMES', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + '', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -115,6 +126,7 @@ module GwfDrnInputModule 'IPRPAK', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'print input to listing file', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -132,6 +144,7 @@ module GwfDrnInputModule 'IPRFLOW', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'print calculated flows to listing file', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -149,6 +162,7 @@ module GwfDrnInputModule 'IPAKCB', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'save CHD flows to budget file', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -166,6 +180,7 @@ module GwfDrnInputModule 'TS_FILERECORD', & ! fortran variable 'RECORD TS6 FILEIN TS6_FILENAME', & ! type '', & ! shape + '', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -183,6 +198,7 @@ module GwfDrnInputModule 'TS6', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'head keyword', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -200,6 +216,7 @@ module GwfDrnInputModule 'FILEIN', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'file keyword', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -217,6 +234,7 @@ module GwfDrnInputModule 'TS6_FILENAME', & ! fortran variable 'STRING', & ! type '', & ! shape + 'file name of time series information', & ! longname .true., & ! required .true., & ! multi-record .true., & ! preserve case @@ -234,6 +252,7 @@ module GwfDrnInputModule 'OBS_FILERECORD', & ! fortran variable 'RECORD OBS6 FILEIN OBS6_FILENAME', & ! type '', & ! shape + '', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -251,6 +270,7 @@ module GwfDrnInputModule 'OBS6', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'obs keyword', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -268,6 +288,7 @@ module GwfDrnInputModule 'OBS6_FILENAME', & ! fortran variable 'STRING', & ! type '', & ! shape + 'obs6 input filename', & ! longname .true., & ! required .true., & ! multi-record .true., & ! preserve case @@ -285,6 +306,7 @@ module GwfDrnInputModule 'MOVER', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + '', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -302,6 +324,7 @@ module GwfDrnInputModule 'ICUBICSFAC', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'cubic-scaling', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -319,6 +342,7 @@ module GwfDrnInputModule 'MAXBOUND', & ! fortran variable 'INTEGER', & ! type '', & ! shape + 'maximum number of drains', & ! longname .true., & ! required .false., & ! multi-record .false., & ! preserve case @@ -336,6 +360,7 @@ module GwfDrnInputModule 'CELLID', & ! fortran variable 'INTEGER1D', & ! type 'NCELLDIM', & ! shape + 'cell identifier', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -353,6 +378,7 @@ module GwfDrnInputModule 'ELEV', & ! fortran variable 'DOUBLE', & ! type '', & ! shape + 'drain elevation', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -370,6 +396,7 @@ module GwfDrnInputModule 'COND', & ! fortran variable 'DOUBLE', & ! type '', & ! shape + 'drain conductance', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -387,6 +414,7 @@ module GwfDrnInputModule 'AUXVAR', & ! fortran variable 'DOUBLE1D', & ! type 'NAUX', & ! shape + 'auxiliary variables', & ! longname .false., & ! required .true., & ! multi-record .false., & ! preserve case @@ -404,6 +432,7 @@ module GwfDrnInputModule 'BOUNDNAME', & ! fortran variable 'STRING', & ! type '', & ! shape + 'drain name', & ! longname .false., & ! required .true., & ! multi-record .false., & ! preserve case @@ -448,6 +477,7 @@ module GwfDrnInputModule 'SPD', & ! fortran variable 'RECARRAY CELLID ELEV COND AUX BOUNDNAME', & ! type 'MAXBOUND', & ! shape + '', & ! longname .true., & ! required .false., & ! multi-record .false., & ! preserve case diff --git a/src/Idm/gwf-evtaidm.f90 b/src/Idm/gwf-evtaidm.f90 index a5f9a6ea56d..4820a429347 100644 --- a/src/Idm/gwf-evtaidm.f90 +++ b/src/Idm/gwf-evtaidm.f90 @@ -9,6 +9,7 @@ module GwfEvtaInputModule public gwf_evta_block_definitions public GwfEvtaParamFoundType public gwf_evta_multi_package + public gwf_evta_subpackages type GwfEvtaParamFoundType logical :: readasarrays = .false. @@ -34,6 +35,12 @@ module GwfEvtaInputModule logical :: gwf_evta_multi_package = .true. + character(len=16), parameter :: & + gwf_evta_subpackages(*) = & + [ & + ' ' & + ] + type(InputParamDefinitionType), parameter :: & gwfevta_readasarrays = InputParamDefinitionType & ( & @@ -44,6 +51,7 @@ module GwfEvtaInputModule 'READASARRAYS', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'use array-based input', & ! longname .true., & ! required .false., & ! multi-record .false., & ! preserve case @@ -61,6 +69,7 @@ module GwfEvtaInputModule 'FIXED_CELL', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'if cell is dry do not apply evapotranspiration to underlying cell', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -78,6 +87,7 @@ module GwfEvtaInputModule 'AUXILIARY', & ! fortran variable 'STRING', & ! type 'NAUX', & ! shape + 'keyword to specify aux variables', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -95,6 +105,7 @@ module GwfEvtaInputModule 'AUXMULTNAME', & ! fortran variable 'STRING', & ! type '', & ! shape + 'name of auxiliary variable for multiplier', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -112,6 +123,7 @@ module GwfEvtaInputModule 'IPRPAK', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'print input to listing file', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -129,6 +141,7 @@ module GwfEvtaInputModule 'IPRFLOW', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'print evapotranspiration rates to listing file', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -146,6 +159,7 @@ module GwfEvtaInputModule 'IPAKCB', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'save CHD flows to budget file', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -163,6 +177,7 @@ module GwfEvtaInputModule 'TAS_FILERECORD', & ! fortran variable 'RECORD TAS6 FILEIN TAS6_FILENAME', & ! type '', & ! shape + '', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -180,6 +195,7 @@ module GwfEvtaInputModule 'TAS6', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'head keyword', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -197,6 +213,7 @@ module GwfEvtaInputModule 'FILEIN', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'file keyword', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -214,6 +231,7 @@ module GwfEvtaInputModule 'TAS6_FILENAME', & ! fortran variable 'STRING', & ! type '', & ! shape + 'file name of time series information', & ! longname .true., & ! required .true., & ! multi-record .true., & ! preserve case @@ -231,6 +249,7 @@ module GwfEvtaInputModule 'OBS_FILERECORD', & ! fortran variable 'RECORD OBS6 FILEIN OBS6_FILENAME', & ! type '', & ! shape + '', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -248,6 +267,7 @@ module GwfEvtaInputModule 'OBS6', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'obs keyword', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -265,6 +285,7 @@ module GwfEvtaInputModule 'OBS6_FILENAME', & ! fortran variable 'STRING', & ! type '', & ! shape + 'obs6 input filename', & ! longname .true., & ! required .true., & ! multi-record .true., & ! preserve case @@ -282,6 +303,7 @@ module GwfEvtaInputModule 'IEVT', & ! fortran variable 'INTEGER1D', & ! type 'NCPL', & ! shape + 'layer number for evapotranspiration', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -299,6 +321,7 @@ module GwfEvtaInputModule 'SURFACE', & ! fortran variable 'DOUBLE1D', & ! type 'NCPL', & ! shape + 'evapotranspiration surface', & ! longname .true., & ! required .false., & ! multi-record .false., & ! preserve case @@ -316,6 +339,7 @@ module GwfEvtaInputModule 'RATE', & ! fortran variable 'DOUBLE1D', & ! type 'NCPL', & ! shape + 'evapotranspiration surface', & ! longname .true., & ! required .false., & ! multi-record .false., & ! preserve case @@ -333,6 +357,7 @@ module GwfEvtaInputModule 'DEPTH', & ! fortran variable 'DOUBLE1D', & ! type 'NCPL', & ! shape + 'extinction depth', & ! longname .true., & ! required .false., & ! multi-record .false., & ! preserve case @@ -350,6 +375,7 @@ module GwfEvtaInputModule 'AUXVAR', & ! fortran variable 'DOUBLE2D', & ! type 'NAUX NCPL', & ! shape + 'auxiliary variable iaux', & ! longname .true., & ! required .false., & ! multi-record .false., & ! preserve case @@ -393,6 +419,7 @@ module GwfEvtaInputModule '', & ! fortran variable '', & ! type '', & ! shape + '', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case diff --git a/src/Idm/gwf-evtidm.f90 b/src/Idm/gwf-evtidm.f90 index 9ed6fe5ba12..818df5e1f94 100644 --- a/src/Idm/gwf-evtidm.f90 +++ b/src/Idm/gwf-evtidm.f90 @@ -9,6 +9,7 @@ module GwfEvtInputModule public gwf_evt_block_definitions public GwfEvtParamFoundType public gwf_evt_multi_package + public gwf_evt_subpackages type GwfEvtParamFoundType logical :: fixed_cell = .false. @@ -41,6 +42,12 @@ module GwfEvtInputModule logical :: gwf_evt_multi_package = .true. + character(len=16), parameter :: & + gwf_evt_subpackages(*) = & + [ & + ' ' & + ] + type(InputParamDefinitionType), parameter :: & gwfevt_fixed_cell = InputParamDefinitionType & ( & @@ -51,6 +58,7 @@ module GwfEvtInputModule 'FIXED_CELL', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'if cell is dry do not apply evapotranspiration to underlying cell', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -68,6 +76,7 @@ module GwfEvtInputModule 'AUXILIARY', & ! fortran variable 'STRING', & ! type 'NAUX', & ! shape + 'keyword to specify aux variables', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -85,6 +94,7 @@ module GwfEvtInputModule 'AUXMULTNAME', & ! fortran variable 'STRING', & ! type '', & ! shape + 'name of auxiliary variable for multiplier', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -102,6 +112,7 @@ module GwfEvtInputModule 'BOUNDNAMES', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + '', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -119,6 +130,7 @@ module GwfEvtInputModule 'IPRPAK', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'print input to listing file', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -136,6 +148,7 @@ module GwfEvtInputModule 'IPRFLOW', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'print evapotranspiration rates to listing file', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -153,6 +166,7 @@ module GwfEvtInputModule 'IPAKCB', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'save evapotranspiration rates to budget file', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -170,6 +184,7 @@ module GwfEvtInputModule 'TS_FILERECORD', & ! fortran variable 'RECORD TS6 FILEIN TS6_FILENAME', & ! type '', & ! shape + '', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -187,6 +202,7 @@ module GwfEvtInputModule 'TS6', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'head keyword', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -204,6 +220,7 @@ module GwfEvtInputModule 'FILEIN', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'file keyword', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -221,6 +238,7 @@ module GwfEvtInputModule 'TS6_FILENAME', & ! fortran variable 'STRING', & ! type '', & ! shape + 'file name of time series information', & ! longname .true., & ! required .true., & ! multi-record .true., & ! preserve case @@ -238,6 +256,7 @@ module GwfEvtInputModule 'OBS_FILERECORD', & ! fortran variable 'RECORD OBS6 FILEIN OBS6_FILENAME', & ! type '', & ! shape + '', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -255,6 +274,7 @@ module GwfEvtInputModule 'OBS6', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'obs keyword', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -272,6 +292,7 @@ module GwfEvtInputModule 'OBS6_FILENAME', & ! fortran variable 'STRING', & ! type '', & ! shape + 'obs6 input filename', & ! longname .true., & ! required .true., & ! multi-record .true., & ! preserve case @@ -289,6 +310,7 @@ module GwfEvtInputModule 'SURFRATESPEC', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'specify proportion of evapotranspiration rate at ET surface', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -306,6 +328,7 @@ module GwfEvtInputModule 'MAXBOUND', & ! fortran variable 'INTEGER', & ! type '', & ! shape + 'maximum number of evapotranspiration cells', & ! longname .true., & ! required .false., & ! multi-record .false., & ! preserve case @@ -323,6 +346,7 @@ module GwfEvtInputModule 'NSEG', & ! fortran variable 'INTEGER', & ! type '', & ! shape + 'number of ET segments', & ! longname .true., & ! required .false., & ! multi-record .false., & ! preserve case @@ -340,6 +364,7 @@ module GwfEvtInputModule 'CELLID', & ! fortran variable 'INTEGER1D', & ! type 'NCELLDIM', & ! shape + 'cell identifier', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -357,6 +382,7 @@ module GwfEvtInputModule 'SURFACE', & ! fortran variable 'DOUBLE', & ! type '', & ! shape + 'ET surface', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -374,6 +400,7 @@ module GwfEvtInputModule 'RATE', & ! fortran variable 'DOUBLE', & ! type '', & ! shape + 'maximum ET rate', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -391,6 +418,7 @@ module GwfEvtInputModule 'DEPTH', & ! fortran variable 'DOUBLE', & ! type '', & ! shape + 'ET extinction depth', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -408,6 +436,7 @@ module GwfEvtInputModule 'PXDP', & ! fortran variable 'DOUBLE1D', & ! type 'NSEG-1', & ! shape + 'proportion of ET extinction depth', & ! longname .false., & ! required .true., & ! multi-record .false., & ! preserve case @@ -425,6 +454,7 @@ module GwfEvtInputModule 'PETM', & ! fortran variable 'DOUBLE1D', & ! type 'NSEG-1', & ! shape + 'proportion of maximum ET rate', & ! longname .false., & ! required .true., & ! multi-record .false., & ! preserve case @@ -442,6 +472,7 @@ module GwfEvtInputModule 'PETM0', & ! fortran variable 'DOUBLE', & ! type '', & ! shape + 'proportion of maximum ET rate at ET surface', & ! longname .false., & ! required .true., & ! multi-record .false., & ! preserve case @@ -459,6 +490,7 @@ module GwfEvtInputModule 'AUXVAR', & ! fortran variable 'DOUBLE1D', & ! type 'NAUX', & ! shape + 'auxiliary variables', & ! longname .false., & ! required .true., & ! multi-record .false., & ! preserve case @@ -476,6 +508,7 @@ module GwfEvtInputModule 'BOUNDNAME', & ! fortran variable 'STRING', & ! type '', & ! shape + 'evapotranspiration name', & ! longname .false., & ! required .true., & ! multi-record .false., & ! preserve case @@ -524,6 +557,7 @@ module GwfEvtInputModule 'SPD', & ! fortran variable 'RECARRAY CELLID SURFACE RATE DEPTH PXDP PETM PETM0 AUX BOUNDNAME', & ! type 'MAXBOUND', & ! shape + '', & ! longname .true., & ! required .false., & ! multi-record .false., & ! preserve case diff --git a/src/Idm/gwf-ghbidm.f90 b/src/Idm/gwf-ghbidm.f90 index 2774d26c883..823da798cb5 100644 --- a/src/Idm/gwf-ghbidm.f90 +++ b/src/Idm/gwf-ghbidm.f90 @@ -9,6 +9,7 @@ module GwfGhbInputModule public gwf_ghb_block_definitions public GwfGhbParamFoundType public gwf_ghb_multi_package + public gwf_ghb_subpackages type GwfGhbParamFoundType logical :: auxiliary = .false. @@ -35,6 +36,12 @@ module GwfGhbInputModule logical :: gwf_ghb_multi_package = .true. + character(len=16), parameter :: & + gwf_ghb_subpackages(*) = & + [ & + ' ' & + ] + type(InputParamDefinitionType), parameter :: & gwfghb_auxiliary = InputParamDefinitionType & ( & @@ -45,6 +52,7 @@ module GwfGhbInputModule 'AUXILIARY', & ! fortran variable 'STRING', & ! type 'NAUX', & ! shape + 'keyword to specify aux variables', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -62,6 +70,7 @@ module GwfGhbInputModule 'AUXMULTNAME', & ! fortran variable 'STRING', & ! type '', & ! shape + 'name of auxiliary variable for multiplier', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -79,6 +88,7 @@ module GwfGhbInputModule 'BOUNDNAMES', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + '', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -96,6 +106,7 @@ module GwfGhbInputModule 'IPRPAK', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'print input to listing file', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -113,6 +124,7 @@ module GwfGhbInputModule 'IPRFLOW', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'print calculated flows to listing file', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -130,6 +142,7 @@ module GwfGhbInputModule 'IPAKCB', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'save CHD flows to budget file', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -147,6 +160,7 @@ module GwfGhbInputModule 'TS_FILERECORD', & ! fortran variable 'RECORD TS6 FILEIN TS6_FILENAME', & ! type '', & ! shape + '', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -164,6 +178,7 @@ module GwfGhbInputModule 'TS6', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'head keyword', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -181,6 +196,7 @@ module GwfGhbInputModule 'FILEIN', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'file keyword', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -198,6 +214,7 @@ module GwfGhbInputModule 'TS6_FILENAME', & ! fortran variable 'STRING', & ! type '', & ! shape + 'file name of time series information', & ! longname .true., & ! required .true., & ! multi-record .true., & ! preserve case @@ -215,6 +232,7 @@ module GwfGhbInputModule 'OBS_FILERECORD', & ! fortran variable 'RECORD OBS6 FILEIN OBS6_FILENAME', & ! type '', & ! shape + '', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -232,6 +250,7 @@ module GwfGhbInputModule 'OBS6', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'obs keyword', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -249,6 +268,7 @@ module GwfGhbInputModule 'OBS6_FILENAME', & ! fortran variable 'STRING', & ! type '', & ! shape + 'obs6 input filename', & ! longname .true., & ! required .true., & ! multi-record .true., & ! preserve case @@ -266,6 +286,7 @@ module GwfGhbInputModule 'MOVER', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + '', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -283,6 +304,7 @@ module GwfGhbInputModule 'MAXBOUND', & ! fortran variable 'INTEGER', & ! type '', & ! shape + 'maximum number of general-head boundaries', & ! longname .true., & ! required .false., & ! multi-record .false., & ! preserve case @@ -300,6 +322,7 @@ module GwfGhbInputModule 'CELLID', & ! fortran variable 'INTEGER1D', & ! type 'NCELLDIM', & ! shape + 'cell identifier', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -317,6 +340,7 @@ module GwfGhbInputModule 'BHEAD', & ! fortran variable 'DOUBLE', & ! type '', & ! shape + 'boundary head', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -334,6 +358,7 @@ module GwfGhbInputModule 'COND', & ! fortran variable 'DOUBLE', & ! type '', & ! shape + 'boundary conductance', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -351,6 +376,7 @@ module GwfGhbInputModule 'AUXVAR', & ! fortran variable 'DOUBLE1D', & ! type 'NAUX', & ! shape + 'auxiliary variables', & ! longname .false., & ! required .true., & ! multi-record .false., & ! preserve case @@ -368,6 +394,7 @@ module GwfGhbInputModule 'BOUNDNAME', & ! fortran variable 'STRING', & ! type '', & ! shape + 'general-head boundary name', & ! longname .false., & ! required .true., & ! multi-record .false., & ! preserve case @@ -410,6 +437,7 @@ module GwfGhbInputModule 'SPD', & ! fortran variable 'RECARRAY CELLID BHEAD COND AUX BOUNDNAME', & ! type 'MAXBOUND', & ! shape + '', & ! longname .true., & ! required .false., & ! multi-record .false., & ! preserve case diff --git a/src/Idm/gwf-icidm.f90 b/src/Idm/gwf-icidm.f90 index ec39a109cc6..3f42ffc4534 100644 --- a/src/Idm/gwf-icidm.f90 +++ b/src/Idm/gwf-icidm.f90 @@ -9,14 +9,22 @@ module GwfIcInputModule public gwf_ic_block_definitions public GwfIcParamFoundType public gwf_ic_multi_package + public gwf_ic_subpackages type GwfIcParamFoundType logical :: export_ascii = .false. + logical :: export_nc = .false. logical :: strt = .false. end type GwfIcParamFoundType logical :: gwf_ic_multi_package = .false. + character(len=16), parameter :: & + gwf_ic_subpackages(*) = & + [ & + ' ' & + ] + type(InputParamDefinitionType), parameter :: & gwfic_export_ascii = InputParamDefinitionType & ( & @@ -27,6 +35,25 @@ module GwfIcInputModule 'EXPORT_ASCII', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'export array variables to layered ascii files.', & ! longname + .false., & ! required + .false., & ! multi-record + .false., & ! preserve case + .false., & ! layered + .false. & ! timeseries + ) + + type(InputParamDefinitionType), parameter :: & + gwfic_export_nc = InputParamDefinitionType & + ( & + 'GWF', & ! component + 'IC', & ! subcomponent + 'OPTIONS', & ! block + 'EXPORT_ARRAY_NETCDF', & ! tag name + 'EXPORT_NC', & ! fortran variable + 'KEYWORD', & ! type + '', & ! shape + 'export array variables to netcdf output files.', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -44,6 +71,7 @@ module GwfIcInputModule 'STRT', & ! fortran variable 'DOUBLE1D', & ! type 'NODES', & ! shape + 'starting head', & ! longname .true., & ! required .false., & ! multi-record .false., & ! preserve case @@ -55,6 +83,7 @@ module GwfIcInputModule gwf_ic_param_definitions(*) = & [ & gwfic_export_ascii, & + gwfic_export_nc, & gwfic_strt & ] @@ -70,6 +99,7 @@ module GwfIcInputModule '', & ! fortran variable '', & ! type '', & ! shape + '', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case diff --git a/src/Idm/gwf-namidm.f90 b/src/Idm/gwf-namidm.f90 index 8b8acf82eeb..bb9c13d2b8b 100644 --- a/src/Idm/gwf-namidm.f90 +++ b/src/Idm/gwf-namidm.f90 @@ -9,6 +9,7 @@ module GwfNamInputModule public gwf_nam_block_definitions public GwfNamParamFoundType public gwf_nam_multi_package + public gwf_nam_subpackages type GwfNamParamFoundType logical :: list = .false. @@ -18,6 +19,7 @@ module GwfNamInputModule logical :: newtonoptions = .false. logical :: newton = .false. logical :: under_relaxation = .false. + logical :: export_netcdf = .false. logical :: ftype = .false. logical :: fname = .false. logical :: pname = .false. @@ -25,6 +27,12 @@ module GwfNamInputModule logical :: gwf_nam_multi_package = .false. + character(len=16), parameter :: & + gwf_nam_subpackages(*) = & + [ & + ' ' & + ] + type(InputParamDefinitionType), parameter :: & gwfnam_list = InputParamDefinitionType & ( & @@ -35,6 +43,7 @@ module GwfNamInputModule 'LIST', & ! fortran variable 'STRING', & ! type '', & ! shape + 'name of listing file', & ! longname .false., & ! required .false., & ! multi-record .true., & ! preserve case @@ -52,6 +61,7 @@ module GwfNamInputModule 'PRINT_INPUT', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'print input to listing file', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -69,6 +79,7 @@ module GwfNamInputModule 'PRINT_FLOWS', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'print calculated flows to listing file', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -86,6 +97,7 @@ module GwfNamInputModule 'SAVE_FLOWS', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'save flows for all packages to budget file', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -103,6 +115,7 @@ module GwfNamInputModule 'NEWTONOPTIONS', & ! fortran variable 'RECORD NEWTON UNDER_RELAXATION', & ! type '', & ! shape + 'newton keyword and options', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -120,6 +133,7 @@ module GwfNamInputModule 'NEWTON', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'keyword to activate Newton-Raphson formulation', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -137,6 +151,7 @@ module GwfNamInputModule 'UNDER_RELAXATION', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'keyword to activate Newton-Raphson UNDER_RELAXATION option', & ! longname .false., & ! required .true., & ! multi-record .false., & ! preserve case @@ -144,6 +159,24 @@ module GwfNamInputModule .false. & ! timeseries ) + type(InputParamDefinitionType), parameter :: & + gwfnam_export_netcdf = InputParamDefinitionType & + ( & + 'GWF', & ! component + 'NAM', & ! subcomponent + 'OPTIONS', & ! block + 'EXPORT_NETCDF', & ! tag name + 'EXPORT_NETCDF', & ! fortran variable + 'STRING', & ! type + '', & ! shape + 'export model output netcdf file.', & ! longname + .false., & ! required + .false., & ! multi-record + .false., & ! preserve case + .false., & ! layered + .false. & ! timeseries + ) + type(InputParamDefinitionType), parameter :: & gwfnam_ftype = InputParamDefinitionType & ( & @@ -154,6 +187,7 @@ module GwfNamInputModule 'FTYPE', & ! fortran variable 'STRING', & ! type '', & ! shape + 'package type', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -171,6 +205,7 @@ module GwfNamInputModule 'FNAME', & ! fortran variable 'STRING', & ! type '', & ! shape + 'file name', & ! longname .true., & ! required .true., & ! multi-record .true., & ! preserve case @@ -188,6 +223,7 @@ module GwfNamInputModule 'PNAME', & ! fortran variable 'STRING', & ! type '', & ! shape + 'user name for package', & ! longname .false., & ! required .true., & ! multi-record .false., & ! preserve case @@ -205,6 +241,7 @@ module GwfNamInputModule gwfnam_newtonoptions, & gwfnam_newton, & gwfnam_under_relaxation, & + gwfnam_export_netcdf, & gwfnam_ftype, & gwfnam_fname, & gwfnam_pname & @@ -220,6 +257,7 @@ module GwfNamInputModule 'PACKAGES', & ! fortran variable 'RECARRAY FTYPE FNAME PNAME', & ! type '', & ! shape + 'package list', & ! longname .true., & ! required .false., & ! multi-record .false., & ! preserve case diff --git a/src/Idm/gwf-npfidm.f90 b/src/Idm/gwf-npfidm.f90 index 0587978e09f..454d46e9684 100644 --- a/src/Idm/gwf-npfidm.f90 +++ b/src/Idm/gwf-npfidm.f90 @@ -9,6 +9,7 @@ module GwfNpfInputModule public gwf_npf_block_definitions public GwfNpfParamFoundType public gwf_npf_multi_package + public gwf_npf_subpackages type GwfNpfParamFoundType logical :: ipakcb = .false. @@ -36,6 +37,7 @@ module GwfNpfInputModule logical :: filein = .false. logical :: tvk6_filename = .false. logical :: export_ascii = .false. + logical :: export_nc = .false. logical :: inewton = .false. logical :: satomega = .false. logical :: icelltype = .false. @@ -50,6 +52,12 @@ module GwfNpfInputModule logical :: gwf_npf_multi_package = .false. + character(len=16), parameter :: & + gwf_npf_subpackages(*) = & + [ & + ' ' & + ] + type(InputParamDefinitionType), parameter :: & gwfnpf_ipakcb = InputParamDefinitionType & ( & @@ -60,6 +68,7 @@ module GwfNpfInputModule 'IPAKCB', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'keyword to save NPF flows', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -77,6 +86,7 @@ module GwfNpfInputModule 'IPRFLOW', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'keyword to print NPF flows to listing file', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -94,6 +104,7 @@ module GwfNpfInputModule 'CELLAVG', & ! fortran variable 'STRING', & ! type '', & ! shape + 'conductance weighting option', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -111,6 +122,7 @@ module GwfNpfInputModule 'ITHICKSTRT', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'keyword to activate THICKSTRT option', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -128,6 +140,7 @@ module GwfNpfInputModule 'CVOPTIONS', & ! fortran variable 'RECORD VARIABLECV DEWATERED', & ! type '', & ! shape + 'vertical conductance options', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -145,6 +158,7 @@ module GwfNpfInputModule 'IVARCV', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'keyword to activate VARIABLECV option', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -162,6 +176,7 @@ module GwfNpfInputModule 'IDEWATCV', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'keyword to activate DEWATERED option', & ! longname .false., & ! required .true., & ! multi-record .false., & ! preserve case @@ -179,6 +194,7 @@ module GwfNpfInputModule 'IPERCHED', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'keyword to activate PERCHED option', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -196,6 +212,7 @@ module GwfNpfInputModule 'REWET_RECORD', & ! fortran variable 'RECORD REWET WETFCT IWETIT IHDWET', & ! type '', & ! shape + '', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -213,6 +230,7 @@ module GwfNpfInputModule 'IREWET', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'keyword to activate rewetting', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -230,6 +248,7 @@ module GwfNpfInputModule 'WETFCT', & ! fortran variable 'DOUBLE', & ! type '', & ! shape + 'wetting factor to use for rewetting', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -247,6 +266,7 @@ module GwfNpfInputModule 'IWETIT', & ! fortran variable 'INTEGER', & ! type '', & ! shape + 'interval to use for rewetting', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -264,6 +284,7 @@ module GwfNpfInputModule 'IHDWET', & ! fortran variable 'INTEGER', & ! type '', & ! shape + 'flag to determine wetting equation', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -281,6 +302,7 @@ module GwfNpfInputModule 'XT3DOPTIONS', & ! fortran variable 'RECORD XT3D RHS', & ! type '', & ! shape + 'keyword to activate XT3D', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -298,6 +320,7 @@ module GwfNpfInputModule 'IXT3D', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'keyword to activate XT3D', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -315,6 +338,7 @@ module GwfNpfInputModule 'IXT3DRHS', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'keyword to XT3D on right hand side', & ! longname .false., & ! required .true., & ! multi-record .false., & ! preserve case @@ -332,6 +356,7 @@ module GwfNpfInputModule 'ISAVSPDIS', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'keyword to save specific discharge', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -349,6 +374,7 @@ module GwfNpfInputModule 'ISAVSAT', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'keyword to save saturation', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -366,6 +392,7 @@ module GwfNpfInputModule 'IK22OVERK', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'keyword to indicate that specified K22 is a ratio', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -383,6 +410,7 @@ module GwfNpfInputModule 'IK33OVERK', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'keyword to indicate that specified K33 is a ratio', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -400,6 +428,7 @@ module GwfNpfInputModule 'TVK_FILERECORD', & ! fortran variable 'RECORD TVK6 FILEIN TVK6_FILENAME', & ! type '', & ! shape + '', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -417,6 +446,7 @@ module GwfNpfInputModule 'TVK6', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'tvk keyword', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -434,6 +464,7 @@ module GwfNpfInputModule 'FILEIN', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'file keyword', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -451,6 +482,7 @@ module GwfNpfInputModule 'TVK6_FILENAME', & ! fortran variable 'STRING', & ! type '', & ! shape + 'file name of TVK information', & ! longname .true., & ! required .true., & ! multi-record .true., & ! preserve case @@ -468,6 +500,25 @@ module GwfNpfInputModule 'EXPORT_ASCII', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'export array variables to layered ascii files.', & ! longname + .false., & ! required + .false., & ! multi-record + .false., & ! preserve case + .false., & ! layered + .false. & ! timeseries + ) + + type(InputParamDefinitionType), parameter :: & + gwfnpf_export_nc = InputParamDefinitionType & + ( & + 'GWF', & ! component + 'NPF', & ! subcomponent + 'OPTIONS', & ! block + 'EXPORT_ARRAY_NETCDF', & ! tag name + 'EXPORT_NC', & ! fortran variable + 'KEYWORD', & ! type + '', & ! shape + 'export array variables to netcdf output files.', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -485,6 +536,7 @@ module GwfNpfInputModule 'INEWTON', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'turn off Newton for unconfined cells', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -502,6 +554,7 @@ module GwfNpfInputModule 'SATOMEGA', & ! fortran variable 'DOUBLE', & ! type '', & ! shape + 'set saturation omega value', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -519,6 +572,7 @@ module GwfNpfInputModule 'ICELLTYPE', & ! fortran variable 'INTEGER1D', & ! type 'NODES', & ! shape + 'confined or convertible indicator', & ! longname .true., & ! required .false., & ! multi-record .false., & ! preserve case @@ -536,6 +590,7 @@ module GwfNpfInputModule 'K', & ! fortran variable 'DOUBLE1D', & ! type 'NODES', & ! shape + 'hydraulic conductivity (L/T)', & ! longname .true., & ! required .false., & ! multi-record .false., & ! preserve case @@ -553,6 +608,7 @@ module GwfNpfInputModule 'K22', & ! fortran variable 'DOUBLE1D', & ! type 'NODES', & ! shape + 'hydraulic conductivity of second ellipsoid axis', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -570,6 +626,7 @@ module GwfNpfInputModule 'K33', & ! fortran variable 'DOUBLE1D', & ! type 'NODES', & ! shape + 'hydraulic conductivity of third ellipsoid axis (L/T)', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -587,6 +644,7 @@ module GwfNpfInputModule 'ANGLE1', & ! fortran variable 'DOUBLE1D', & ! type 'NODES', & ! shape + 'first anisotropy rotation angle (degrees)', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -604,6 +662,7 @@ module GwfNpfInputModule 'ANGLE2', & ! fortran variable 'DOUBLE1D', & ! type 'NODES', & ! shape + 'second anisotropy rotation angle (degrees)', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -621,6 +680,7 @@ module GwfNpfInputModule 'ANGLE3', & ! fortran variable 'DOUBLE1D', & ! type 'NODES', & ! shape + 'third anisotropy rotation angle (degrees)', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -638,6 +698,7 @@ module GwfNpfInputModule 'WETDRY', & ! fortran variable 'DOUBLE1D', & ! type 'NODES', & ! shape + 'wetdry threshold and factor', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -673,6 +734,7 @@ module GwfNpfInputModule gwfnpf_filein, & gwfnpf_tvk6_filename, & gwfnpf_export_ascii, & + gwfnpf_export_nc, & gwfnpf_inewton, & gwfnpf_satomega, & gwfnpf_icelltype, & @@ -697,6 +759,7 @@ module GwfNpfInputModule '', & ! fortran variable '', & ! type '', & ! shape + '', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case diff --git a/src/Idm/gwf-rchaidm.f90 b/src/Idm/gwf-rchaidm.f90 index d692d12ee29..a80daa67182 100644 --- a/src/Idm/gwf-rchaidm.f90 +++ b/src/Idm/gwf-rchaidm.f90 @@ -9,6 +9,7 @@ module GwfRchaInputModule public gwf_rcha_block_definitions public GwfRchaParamFoundType public gwf_rcha_multi_package + public gwf_rcha_subpackages type GwfRchaParamFoundType logical :: readasarrays = .false. @@ -32,6 +33,12 @@ module GwfRchaInputModule logical :: gwf_rcha_multi_package = .true. + character(len=16), parameter :: & + gwf_rcha_subpackages(*) = & + [ & + ' ' & + ] + type(InputParamDefinitionType), parameter :: & gwfrcha_readasarrays = InputParamDefinitionType & ( & @@ -42,6 +49,7 @@ module GwfRchaInputModule 'READASARRAYS', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'use array-based input', & ! longname .true., & ! required .false., & ! multi-record .false., & ! preserve case @@ -59,6 +67,7 @@ module GwfRchaInputModule 'FIXED_CELL', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'if cell is dry do not apply recharge to underlying cell', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -76,6 +85,7 @@ module GwfRchaInputModule 'AUXILIARY', & ! fortran variable 'STRING', & ! type 'NAUX', & ! shape + 'keyword to specify aux variables', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -93,6 +103,7 @@ module GwfRchaInputModule 'AUXMULTNAME', & ! fortran variable 'STRING', & ! type '', & ! shape + 'name of auxiliary variable for multiplier', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -110,6 +121,7 @@ module GwfRchaInputModule 'IPRPAK', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'print input to listing file', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -127,6 +139,7 @@ module GwfRchaInputModule 'IPRFLOW', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'print recharge rates to listing file', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -144,6 +157,7 @@ module GwfRchaInputModule 'IPAKCB', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'save CHD flows to budget file', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -161,6 +175,7 @@ module GwfRchaInputModule 'TAS_FILERECORD', & ! fortran variable 'RECORD TAS6 FILEIN TAS6_FILENAME', & ! type '', & ! shape + '', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -178,6 +193,7 @@ module GwfRchaInputModule 'TAS6', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'head keyword', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -195,6 +211,7 @@ module GwfRchaInputModule 'FILEIN', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'file keyword', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -212,6 +229,7 @@ module GwfRchaInputModule 'TAS6_FILENAME', & ! fortran variable 'STRING', & ! type '', & ! shape + 'file name of time series information', & ! longname .true., & ! required .true., & ! multi-record .true., & ! preserve case @@ -229,6 +247,7 @@ module GwfRchaInputModule 'OBS_FILERECORD', & ! fortran variable 'RECORD OBS6 FILEIN OBS6_FILENAME', & ! type '', & ! shape + '', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -246,6 +265,7 @@ module GwfRchaInputModule 'OBS6', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'obs keyword', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -263,6 +283,7 @@ module GwfRchaInputModule 'OBS6_FILENAME', & ! fortran variable 'STRING', & ! type '', & ! shape + 'obs6 input filename', & ! longname .true., & ! required .true., & ! multi-record .true., & ! preserve case @@ -280,6 +301,7 @@ module GwfRchaInputModule 'IRCH', & ! fortran variable 'INTEGER1D', & ! type 'NCPL', & ! shape + 'layer number for recharge', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -297,6 +319,7 @@ module GwfRchaInputModule 'RECHARGE', & ! fortran variable 'DOUBLE1D', & ! type 'NCPL', & ! shape + 'recharge rate', & ! longname .true., & ! required .false., & ! multi-record .false., & ! preserve case @@ -314,6 +337,7 @@ module GwfRchaInputModule 'AUXVAR', & ! fortran variable 'DOUBLE2D', & ! type 'NAUX NCPL', & ! shape + 'auxiliary variable iaux', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -355,6 +379,7 @@ module GwfRchaInputModule '', & ! fortran variable '', & ! type '', & ! shape + '', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case diff --git a/src/Idm/gwf-rchidm.f90 b/src/Idm/gwf-rchidm.f90 index a39fff2acda..a3a7503f59e 100644 --- a/src/Idm/gwf-rchidm.f90 +++ b/src/Idm/gwf-rchidm.f90 @@ -9,6 +9,7 @@ module GwfRchInputModule public gwf_rch_block_definitions public GwfRchParamFoundType public gwf_rch_multi_package + public gwf_rch_subpackages type GwfRchParamFoundType logical :: fixed_cell = .false. @@ -34,6 +35,12 @@ module GwfRchInputModule logical :: gwf_rch_multi_package = .true. + character(len=16), parameter :: & + gwf_rch_subpackages(*) = & + [ & + ' ' & + ] + type(InputParamDefinitionType), parameter :: & gwfrch_fixed_cell = InputParamDefinitionType & ( & @@ -44,6 +51,7 @@ module GwfRchInputModule 'FIXED_CELL', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'if cell is dry do not apply recharge to underlying cell', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -61,6 +69,7 @@ module GwfRchInputModule 'AUXILIARY', & ! fortran variable 'STRING', & ! type 'NAUX', & ! shape + 'keyword to specify aux variables', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -78,6 +87,7 @@ module GwfRchInputModule 'AUXMULTNAME', & ! fortran variable 'STRING', & ! type '', & ! shape + 'name of auxiliary variable for multiplier', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -95,6 +105,7 @@ module GwfRchInputModule 'BOUNDNAMES', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + '', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -112,6 +123,7 @@ module GwfRchInputModule 'IPRPAK', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'print input to listing file', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -129,6 +141,7 @@ module GwfRchInputModule 'IPRFLOW', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'print recharge rates to listing file', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -146,6 +159,7 @@ module GwfRchInputModule 'IPAKCB', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'save recharge to budget file', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -163,6 +177,7 @@ module GwfRchInputModule 'TS_FILERECORD', & ! fortran variable 'RECORD TS6 FILEIN TS6_FILENAME', & ! type '', & ! shape + '', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -180,6 +195,7 @@ module GwfRchInputModule 'TS6', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'head keyword', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -197,6 +213,7 @@ module GwfRchInputModule 'FILEIN', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'file keyword', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -214,6 +231,7 @@ module GwfRchInputModule 'TS6_FILENAME', & ! fortran variable 'STRING', & ! type '', & ! shape + 'file name of time series information', & ! longname .true., & ! required .true., & ! multi-record .true., & ! preserve case @@ -231,6 +249,7 @@ module GwfRchInputModule 'OBS_FILERECORD', & ! fortran variable 'RECORD OBS6 FILEIN OBS6_FILENAME', & ! type '', & ! shape + '', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -248,6 +267,7 @@ module GwfRchInputModule 'OBS6', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'obs keyword', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -265,6 +285,7 @@ module GwfRchInputModule 'OBS6_FILENAME', & ! fortran variable 'STRING', & ! type '', & ! shape + 'obs6 input filename', & ! longname .true., & ! required .true., & ! multi-record .true., & ! preserve case @@ -282,6 +303,7 @@ module GwfRchInputModule 'MAXBOUND', & ! fortran variable 'INTEGER', & ! type '', & ! shape + 'maximum number of recharge cells', & ! longname .true., & ! required .false., & ! multi-record .false., & ! preserve case @@ -299,6 +321,7 @@ module GwfRchInputModule 'CELLID', & ! fortran variable 'INTEGER1D', & ! type 'NCELLDIM', & ! shape + 'cell identifier', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -316,6 +339,7 @@ module GwfRchInputModule 'RECHARGE', & ! fortran variable 'DOUBLE', & ! type '', & ! shape + 'recharge rate', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -333,6 +357,7 @@ module GwfRchInputModule 'AUXVAR', & ! fortran variable 'DOUBLE1D', & ! type 'NAUX', & ! shape + 'auxiliary variables', & ! longname .false., & ! required .true., & ! multi-record .false., & ! preserve case @@ -350,6 +375,7 @@ module GwfRchInputModule 'BOUNDNAME', & ! fortran variable 'STRING', & ! type '', & ! shape + 'recharge name', & ! longname .false., & ! required .true., & ! multi-record .false., & ! preserve case @@ -391,6 +417,7 @@ module GwfRchInputModule 'SPD', & ! fortran variable 'RECARRAY CELLID RECHARGE AUX BOUNDNAME', & ! type 'MAXBOUND', & ! shape + '', & ! longname .true., & ! required .false., & ! multi-record .false., & ! preserve case diff --git a/src/Idm/gwf-rividm.f90 b/src/Idm/gwf-rividm.f90 index b32255ad30f..e7b6a0767e0 100644 --- a/src/Idm/gwf-rividm.f90 +++ b/src/Idm/gwf-rividm.f90 @@ -9,6 +9,7 @@ module GwfRivInputModule public gwf_riv_block_definitions public GwfRivParamFoundType public gwf_riv_multi_package + public gwf_riv_subpackages type GwfRivParamFoundType logical :: auxiliary = .false. @@ -36,6 +37,12 @@ module GwfRivInputModule logical :: gwf_riv_multi_package = .true. + character(len=16), parameter :: & + gwf_riv_subpackages(*) = & + [ & + ' ' & + ] + type(InputParamDefinitionType), parameter :: & gwfriv_auxiliary = InputParamDefinitionType & ( & @@ -46,6 +53,7 @@ module GwfRivInputModule 'AUXILIARY', & ! fortran variable 'STRING', & ! type 'NAUX', & ! shape + 'keyword to specify aux variables', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -63,6 +71,7 @@ module GwfRivInputModule 'AUXMULTNAME', & ! fortran variable 'STRING', & ! type '', & ! shape + 'name of auxiliary variable for multiplier', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -80,6 +89,7 @@ module GwfRivInputModule 'BOUNDNAMES', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + '', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -97,6 +107,7 @@ module GwfRivInputModule 'IPRPAK', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'print input to listing file', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -114,6 +125,7 @@ module GwfRivInputModule 'IPRFLOW', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'print calculated flows to listing file', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -131,6 +143,7 @@ module GwfRivInputModule 'IPAKCB', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'save CHD flows to budget file', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -148,6 +161,7 @@ module GwfRivInputModule 'TS_FILERECORD', & ! fortran variable 'RECORD TS6 FILEIN TS6_FILENAME', & ! type '', & ! shape + '', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -165,6 +179,7 @@ module GwfRivInputModule 'TS6', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'head keyword', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -182,6 +197,7 @@ module GwfRivInputModule 'FILEIN', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'file keyword', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -199,6 +215,7 @@ module GwfRivInputModule 'TS6_FILENAME', & ! fortran variable 'STRING', & ! type '', & ! shape + 'file name of time series information', & ! longname .true., & ! required .true., & ! multi-record .true., & ! preserve case @@ -216,6 +233,7 @@ module GwfRivInputModule 'OBS_FILERECORD', & ! fortran variable 'RECORD OBS6 FILEIN OBS6_FILENAME', & ! type '', & ! shape + '', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -233,6 +251,7 @@ module GwfRivInputModule 'OBS6', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'obs keyword', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -250,6 +269,7 @@ module GwfRivInputModule 'OBS6_FILENAME', & ! fortran variable 'STRING', & ! type '', & ! shape + 'obs6 input filename', & ! longname .true., & ! required .true., & ! multi-record .true., & ! preserve case @@ -267,6 +287,7 @@ module GwfRivInputModule 'MOVER', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + '', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -284,6 +305,7 @@ module GwfRivInputModule 'MAXBOUND', & ! fortran variable 'INTEGER', & ! type '', & ! shape + 'maximum number of rivers', & ! longname .true., & ! required .false., & ! multi-record .false., & ! preserve case @@ -301,6 +323,7 @@ module GwfRivInputModule 'CELLID', & ! fortran variable 'INTEGER1D', & ! type 'NCELLDIM', & ! shape + 'cell identifier', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -318,6 +341,7 @@ module GwfRivInputModule 'STAGE', & ! fortran variable 'DOUBLE', & ! type '', & ! shape + 'river stage', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -335,6 +359,7 @@ module GwfRivInputModule 'COND', & ! fortran variable 'DOUBLE', & ! type '', & ! shape + 'river conductance', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -352,6 +377,7 @@ module GwfRivInputModule 'RBOT', & ! fortran variable 'DOUBLE', & ! type '', & ! shape + 'river bottom elevation', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -369,6 +395,7 @@ module GwfRivInputModule 'AUXVAR', & ! fortran variable 'DOUBLE1D', & ! type 'NAUX', & ! shape + 'auxiliary variables', & ! longname .false., & ! required .true., & ! multi-record .false., & ! preserve case @@ -386,6 +413,7 @@ module GwfRivInputModule 'BOUNDNAME', & ! fortran variable 'STRING', & ! type '', & ! shape + 'drain name', & ! longname .false., & ! required .true., & ! multi-record .false., & ! preserve case @@ -429,6 +457,7 @@ module GwfRivInputModule 'SPD', & ! fortran variable 'RECARRAY CELLID STAGE COND RBOT AUX BOUNDNAME', & ! type 'MAXBOUND', & ! shape + '', & ! longname .true., & ! required .false., & ! multi-record .false., & ! preserve case diff --git a/src/Idm/gwf-stoidm.f90 b/src/Idm/gwf-stoidm.f90 index f47c5e2a1ae..1efb63b6ff6 100644 --- a/src/Idm/gwf-stoidm.f90 +++ b/src/Idm/gwf-stoidm.f90 @@ -9,6 +9,7 @@ module GwfStoInputModule public gwf_sto_block_definitions public GwfStoParamFoundType public gwf_sto_multi_package + public gwf_sto_subpackages type GwfStoParamFoundType logical :: ipakcb = .false. @@ -19,6 +20,7 @@ module GwfStoInputModule logical :: filein = .false. logical :: tvs6_filename = .false. logical :: export_ascii = .false. + logical :: export_nc = .false. logical :: iorig_ss = .false. logical :: iconf_ss = .false. logical :: iconvert = .false. @@ -30,6 +32,12 @@ module GwfStoInputModule logical :: gwf_sto_multi_package = .false. + character(len=16), parameter :: & + gwf_sto_subpackages(*) = & + [ & + ' ' & + ] + type(InputParamDefinitionType), parameter :: & gwfsto_ipakcb = InputParamDefinitionType & ( & @@ -40,6 +48,7 @@ module GwfStoInputModule 'IPAKCB', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'keyword to save NPF flows', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -57,6 +66,7 @@ module GwfStoInputModule 'ISTOR_COEF', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'keyword to indicate SS is read as storage coefficient', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -74,6 +84,7 @@ module GwfStoInputModule 'SS_CONFINED_ONLY', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'keyword to indicate specific storage only applied under confined conditions', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -91,6 +102,7 @@ module GwfStoInputModule 'TVS_FILERECORD', & ! fortran variable 'RECORD TVS6 FILEIN TVS6_FILENAME', & ! type '', & ! shape + '', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -108,6 +120,7 @@ module GwfStoInputModule 'TVS6', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'tvs keyword', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -125,6 +138,7 @@ module GwfStoInputModule 'FILEIN', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'file keyword', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -142,6 +156,7 @@ module GwfStoInputModule 'TVS6_FILENAME', & ! fortran variable 'STRING', & ! type '', & ! shape + 'file name of TVS information', & ! longname .true., & ! required .true., & ! multi-record .true., & ! preserve case @@ -159,6 +174,25 @@ module GwfStoInputModule 'EXPORT_ASCII', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'export array variables to layered ascii files.', & ! longname + .false., & ! required + .false., & ! multi-record + .false., & ! preserve case + .false., & ! layered + .false. & ! timeseries + ) + + type(InputParamDefinitionType), parameter :: & + gwfsto_export_nc = InputParamDefinitionType & + ( & + 'GWF', & ! component + 'STO', & ! subcomponent + 'OPTIONS', & ! block + 'EXPORT_ARRAY_NETCDF', & ! tag name + 'EXPORT_NC', & ! fortran variable + 'KEYWORD', & ! type + '', & ! shape + 'export array variables to netcdf output files.', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -176,6 +210,7 @@ module GwfStoInputModule 'IORIG_SS', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'development option for original specific storage', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -193,6 +228,7 @@ module GwfStoInputModule 'ICONF_SS', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'development option flag for old storage formulation', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -210,6 +246,7 @@ module GwfStoInputModule 'ICONVERT', & ! fortran variable 'INTEGER1D', & ! type 'NODES', & ! shape + 'convertible indicator', & ! longname .true., & ! required .false., & ! multi-record .false., & ! preserve case @@ -227,6 +264,7 @@ module GwfStoInputModule 'SS', & ! fortran variable 'DOUBLE1D', & ! type 'NODES', & ! shape + 'specific storage', & ! longname .true., & ! required .false., & ! multi-record .false., & ! preserve case @@ -244,6 +282,7 @@ module GwfStoInputModule 'SY', & ! fortran variable 'DOUBLE1D', & ! type 'NODES', & ! shape + 'specific yield', & ! longname .true., & ! required .false., & ! multi-record .false., & ! preserve case @@ -261,6 +300,7 @@ module GwfStoInputModule 'STEADY_STATE', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'steady state indicator', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -278,6 +318,7 @@ module GwfStoInputModule 'TRANSIENT', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'transient indicator', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -296,6 +337,7 @@ module GwfStoInputModule gwfsto_filein, & gwfsto_tvs6_filename, & gwfsto_export_ascii, & + gwfsto_export_nc, & gwfsto_iorig_ss, & gwfsto_iconf_ss, & gwfsto_iconvert, & @@ -317,6 +359,7 @@ module GwfStoInputModule '', & ! fortran variable '', & ! type '', & ! shape + '', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case diff --git a/src/Idm/gwf-welidm.f90 b/src/Idm/gwf-welidm.f90 index 5b3b6b68d2f..beebea2e162 100644 --- a/src/Idm/gwf-welidm.f90 +++ b/src/Idm/gwf-welidm.f90 @@ -9,6 +9,7 @@ module GwfWelInputModule public gwf_wel_block_definitions public GwfWelParamFoundType public gwf_wel_multi_package + public gwf_wel_subpackages type GwfWelParamFoundType logical :: auxiliary = .false. @@ -39,6 +40,12 @@ module GwfWelInputModule logical :: gwf_wel_multi_package = .true. + character(len=16), parameter :: & + gwf_wel_subpackages(*) = & + [ & + ' ' & + ] + type(InputParamDefinitionType), parameter :: & gwfwel_auxiliary = InputParamDefinitionType & ( & @@ -49,6 +56,7 @@ module GwfWelInputModule 'AUXILIARY', & ! fortran variable 'STRING', & ! type 'NAUX', & ! shape + 'keyword to specify aux variables', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -66,6 +74,7 @@ module GwfWelInputModule 'AUXMULTNAME', & ! fortran variable 'STRING', & ! type '', & ! shape + 'name of auxiliary variable for multiplier', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -83,6 +92,7 @@ module GwfWelInputModule 'BOUNDNAMES', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + '', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -100,6 +110,7 @@ module GwfWelInputModule 'IPRPAK', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'print input to listing file', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -117,6 +128,7 @@ module GwfWelInputModule 'IPRFLOW', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'print calculated flows to listing file', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -134,6 +146,7 @@ module GwfWelInputModule 'IPAKCB', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'save well flows to budget file', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -151,6 +164,7 @@ module GwfWelInputModule 'FLOWRED', & ! fortran variable 'DOUBLE', & ! type '', & ! shape + 'cell fractional thickness for reduced pumping', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -168,6 +182,7 @@ module GwfWelInputModule 'AFRCSV_REC', & ! fortran variable 'RECORD AUTO_FLOW_REDUCE_CSV FILEOUT AFRCSVFILE', & ! type '', & ! shape + '', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -185,6 +200,7 @@ module GwfWelInputModule 'AFRCSV', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'budget keyword', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -202,6 +218,7 @@ module GwfWelInputModule 'FILEOUT', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'file keyword', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -219,6 +236,7 @@ module GwfWelInputModule 'AFRCSVFILE', & ! fortran variable 'STRING', & ! type '', & ! shape + 'file keyword', & ! longname .true., & ! required .true., & ! multi-record .true., & ! preserve case @@ -236,6 +254,7 @@ module GwfWelInputModule 'TS_FILERECORD', & ! fortran variable 'RECORD TS6 FILEIN TS6_FILENAME', & ! type '', & ! shape + '', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -253,6 +272,7 @@ module GwfWelInputModule 'TS6', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'head keyword', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -270,6 +290,7 @@ module GwfWelInputModule 'FILEIN', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'file keyword', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -287,6 +308,7 @@ module GwfWelInputModule 'TS6_FILENAME', & ! fortran variable 'STRING', & ! type '', & ! shape + 'file name of time series information', & ! longname .true., & ! required .true., & ! multi-record .true., & ! preserve case @@ -304,6 +326,7 @@ module GwfWelInputModule 'OBS_FILERECORD', & ! fortran variable 'RECORD OBS6 FILEIN OBS6_FILENAME', & ! type '', & ! shape + '', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -321,6 +344,7 @@ module GwfWelInputModule 'OBS6', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'obs keyword', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -338,6 +362,7 @@ module GwfWelInputModule 'OBS6_FILENAME', & ! fortran variable 'STRING', & ! type '', & ! shape + 'obs6 input filename', & ! longname .true., & ! required .true., & ! multi-record .true., & ! preserve case @@ -355,6 +380,7 @@ module GwfWelInputModule 'MOVER', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + '', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -372,6 +398,7 @@ module GwfWelInputModule 'MAXBOUND', & ! fortran variable 'INTEGER', & ! type '', & ! shape + 'maximum number of wells', & ! longname .true., & ! required .false., & ! multi-record .false., & ! preserve case @@ -389,6 +416,7 @@ module GwfWelInputModule 'CELLID', & ! fortran variable 'INTEGER1D', & ! type 'NCELLDIM', & ! shape + 'cell identifier', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -406,6 +434,7 @@ module GwfWelInputModule 'Q', & ! fortran variable 'DOUBLE', & ! type '', & ! shape + 'well rate', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -423,6 +452,7 @@ module GwfWelInputModule 'AUXVAR', & ! fortran variable 'DOUBLE1D', & ! type 'NAUX', & ! shape + 'auxiliary variables', & ! longname .false., & ! required .true., & ! multi-record .false., & ! preserve case @@ -440,6 +470,7 @@ module GwfWelInputModule 'BOUNDNAME', & ! fortran variable 'STRING', & ! type '', & ! shape + 'well name', & ! longname .false., & ! required .true., & ! multi-record .false., & ! preserve case @@ -486,6 +517,7 @@ module GwfWelInputModule 'SPD', & ! fortran variable 'RECARRAY CELLID Q AUX BOUNDNAME', & ! type 'MAXBOUND', & ! shape + '', & ! longname .true., & ! required .false., & ! multi-record .false., & ! preserve case diff --git a/src/Idm/gwt-cncidm.f90 b/src/Idm/gwt-cncidm.f90 index 2edbab4bfe5..23d58302332 100644 --- a/src/Idm/gwt-cncidm.f90 +++ b/src/Idm/gwt-cncidm.f90 @@ -9,6 +9,7 @@ module GwtCncInputModule public gwt_cnc_block_definitions public GwtCncParamFoundType public gwt_cnc_multi_package + public gwt_cnc_subpackages type GwtCncParamFoundType logical :: auxiliary = .false. @@ -33,6 +34,12 @@ module GwtCncInputModule logical :: gwt_cnc_multi_package = .true. + character(len=16), parameter :: & + gwt_cnc_subpackages(*) = & + [ & + ' ' & + ] + type(InputParamDefinitionType), parameter :: & gwtcnc_auxiliary = InputParamDefinitionType & ( & @@ -43,6 +50,7 @@ module GwtCncInputModule 'AUXILIARY', & ! fortran variable 'STRING', & ! type 'NAUX', & ! shape + 'keyword to specify aux variables', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -60,6 +68,7 @@ module GwtCncInputModule 'AUXMULTNAME', & ! fortran variable 'STRING', & ! type '', & ! shape + 'name of auxiliary variable for multiplier', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -77,6 +86,7 @@ module GwtCncInputModule 'BOUNDNAMES', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + '', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -94,6 +104,7 @@ module GwtCncInputModule 'IPRFLOW', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'print input to listing file', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -111,6 +122,7 @@ module GwtCncInputModule 'IPAKCB', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'print calculated flows to listing file', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -128,6 +140,7 @@ module GwtCncInputModule 'IPRPAK', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'save constant concentration flows to budget file', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -145,6 +158,7 @@ module GwtCncInputModule 'TS_FILERECORD', & ! fortran variable 'RECORD TS6 FILEIN TS6_FILENAME', & ! type '', & ! shape + '', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -162,6 +176,7 @@ module GwtCncInputModule 'TS6', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'time series keyword', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -179,6 +194,7 @@ module GwtCncInputModule 'FILEIN', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'file keyword', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -196,6 +212,7 @@ module GwtCncInputModule 'TS6_FILENAME', & ! fortran variable 'STRING', & ! type '', & ! shape + 'file name of time series information', & ! longname .true., & ! required .true., & ! multi-record .true., & ! preserve case @@ -213,6 +230,7 @@ module GwtCncInputModule 'OBS_FILERECORD', & ! fortran variable 'RECORD OBS6 FILEIN OBS6_FILENAME', & ! type '', & ! shape + '', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -230,6 +248,7 @@ module GwtCncInputModule 'OBS6', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'obs keyword', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -247,6 +266,7 @@ module GwtCncInputModule 'OBS6_FILENAME', & ! fortran variable 'STRING', & ! type '', & ! shape + 'obs6 input filename', & ! longname .true., & ! required .true., & ! multi-record .true., & ! preserve case @@ -264,6 +284,7 @@ module GwtCncInputModule 'MAXBOUND', & ! fortran variable 'INTEGER', & ! type '', & ! shape + 'maximum number of constant concentrations', & ! longname .true., & ! required .false., & ! multi-record .false., & ! preserve case @@ -281,6 +302,7 @@ module GwtCncInputModule 'CELLID', & ! fortran variable 'INTEGER1D', & ! type 'NCELLDIM', & ! shape + 'cell identifier', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -298,6 +320,7 @@ module GwtCncInputModule 'TSPVAR', & ! fortran variable 'DOUBLE', & ! type '', & ! shape + 'constant concentration value', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -315,6 +338,7 @@ module GwtCncInputModule 'AUXVAR', & ! fortran variable 'DOUBLE1D', & ! type 'NAUX', & ! shape + 'auxiliary variables', & ! longname .false., & ! required .true., & ! multi-record .false., & ! preserve case @@ -332,6 +356,7 @@ module GwtCncInputModule 'BOUNDNAME', & ! fortran variable 'STRING', & ! type '', & ! shape + 'constant concentration name', & ! longname .false., & ! required .true., & ! multi-record .false., & ! preserve case @@ -372,6 +397,7 @@ module GwtCncInputModule 'SPD', & ! fortran variable 'RECARRAY CELLID CONC AUX BOUNDNAME', & ! type 'MAXBOUND', & ! shape + '', & ! longname .true., & ! required .false., & ! multi-record .false., & ! preserve case diff --git a/src/Idm/gwt-disidm.f90 b/src/Idm/gwt-disidm.f90 index 90ee1241e21..cf0103120d7 100644 --- a/src/Idm/gwt-disidm.f90 +++ b/src/Idm/gwt-disidm.f90 @@ -9,6 +9,7 @@ module GwtDisInputModule public gwt_dis_block_definitions public GwtDisParamFoundType public gwt_dis_multi_package + public gwt_dis_subpackages type GwtDisParamFoundType logical :: length_units = .false. @@ -17,6 +18,11 @@ module GwtDisInputModule logical :: yorigin = .false. logical :: angrot = .false. logical :: export_ascii = .false. + logical :: export_nc = .false. + logical :: ncf_filerecord = .false. + logical :: ncf6 = .false. + logical :: filein = .false. + logical :: ncf6_filename = .false. logical :: nlay = .false. logical :: nrow = .false. logical :: ncol = .false. @@ -29,6 +35,12 @@ module GwtDisInputModule logical :: gwt_dis_multi_package = .false. + character(len=16), parameter :: & + gwt_dis_subpackages(*) = & + [ & + 'UTL-NCF ' & + ] + type(InputParamDefinitionType), parameter :: & gwtdis_length_units = InputParamDefinitionType & ( & @@ -39,6 +51,7 @@ module GwtDisInputModule 'LENGTH_UNITS', & ! fortran variable 'STRING', & ! type '', & ! shape + 'model length units', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -56,6 +69,7 @@ module GwtDisInputModule 'NOGRB', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'do not write binary grid file', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -73,6 +87,7 @@ module GwtDisInputModule 'XORIGIN', & ! fortran variable 'DOUBLE', & ! type '', & ! shape + 'x-position of the model grid origin', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -90,6 +105,7 @@ module GwtDisInputModule 'YORIGIN', & ! fortran variable 'DOUBLE', & ! type '', & ! shape + 'y-position of the model grid origin', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -107,6 +123,7 @@ module GwtDisInputModule 'ANGROT', & ! fortran variable 'DOUBLE', & ! type '', & ! shape + 'rotation angle', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -124,6 +141,25 @@ module GwtDisInputModule 'EXPORT_ASCII', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'export array variables to layered ascii files.', & ! longname + .false., & ! required + .false., & ! multi-record + .false., & ! preserve case + .false., & ! layered + .false. & ! timeseries + ) + + type(InputParamDefinitionType), parameter :: & + gwtdis_export_nc = InputParamDefinitionType & + ( & + 'GWT', & ! component + 'DIS', & ! subcomponent + 'OPTIONS', & ! block + 'EXPORT_ARRAY_NETCDF', & ! tag name + 'EXPORT_NC', & ! fortran variable + 'KEYWORD', & ! type + '', & ! shape + 'export array variables to netcdf output files.', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -131,6 +167,78 @@ module GwtDisInputModule .false. & ! timeseries ) + type(InputParamDefinitionType), parameter :: & + gwtdis_ncf_filerecord = InputParamDefinitionType & + ( & + 'GWT', & ! component + 'DIS', & ! subcomponent + 'OPTIONS', & ! block + 'NCF_FILERECORD', & ! tag name + 'NCF_FILERECORD', & ! fortran variable + 'RECORD NCF6 FILEIN NCF6_FILENAME', & ! type + '', & ! shape + '', & ! longname + .false., & ! required + .false., & ! multi-record + .false., & ! preserve case + .false., & ! layered + .false. & ! timeseries + ) + + type(InputParamDefinitionType), parameter :: & + gwtdis_ncf6 = InputParamDefinitionType & + ( & + 'GWT', & ! component + 'DIS', & ! subcomponent + 'OPTIONS', & ! block + 'NCF6', & ! tag name + 'NCF6', & ! fortran variable + 'KEYWORD', & ! type + '', & ! shape + 'ncf keyword', & ! longname + .true., & ! required + .true., & ! multi-record + .false., & ! preserve case + .false., & ! layered + .false. & ! timeseries + ) + + type(InputParamDefinitionType), parameter :: & + gwtdis_filein = InputParamDefinitionType & + ( & + 'GWT', & ! component + 'DIS', & ! subcomponent + 'OPTIONS', & ! block + 'FILEIN', & ! tag name + 'FILEIN', & ! fortran variable + 'KEYWORD', & ! type + '', & ! shape + 'file keyword', & ! longname + .true., & ! required + .true., & ! multi-record + .false., & ! preserve case + .false., & ! layered + .false. & ! timeseries + ) + + type(InputParamDefinitionType), parameter :: & + gwtdis_ncf6_filename = InputParamDefinitionType & + ( & + 'GWT', & ! component + 'DIS', & ! subcomponent + 'OPTIONS', & ! block + 'NCF6_FILENAME', & ! tag name + 'NCF6_FILENAME', & ! fortran variable + 'STRING', & ! type + '', & ! shape + 'file name of NCF information', & ! longname + .true., & ! required + .true., & ! multi-record + .true., & ! preserve case + .false., & ! layered + .false. & ! timeseries + ) + type(InputParamDefinitionType), parameter :: & gwtdis_nlay = InputParamDefinitionType & ( & @@ -141,6 +249,7 @@ module GwtDisInputModule 'NLAY', & ! fortran variable 'INTEGER', & ! type '', & ! shape + 'number of layers', & ! longname .true., & ! required .false., & ! multi-record .false., & ! preserve case @@ -158,6 +267,7 @@ module GwtDisInputModule 'NROW', & ! fortran variable 'INTEGER', & ! type '', & ! shape + 'number of rows', & ! longname .true., & ! required .false., & ! multi-record .false., & ! preserve case @@ -175,6 +285,7 @@ module GwtDisInputModule 'NCOL', & ! fortran variable 'INTEGER', & ! type '', & ! shape + 'number of columns', & ! longname .true., & ! required .false., & ! multi-record .false., & ! preserve case @@ -192,6 +303,7 @@ module GwtDisInputModule 'DELR', & ! fortran variable 'DOUBLE1D', & ! type 'NCOL', & ! shape + 'spacing along a row', & ! longname .true., & ! required .false., & ! multi-record .false., & ! preserve case @@ -209,6 +321,7 @@ module GwtDisInputModule 'DELC', & ! fortran variable 'DOUBLE1D', & ! type 'NROW', & ! shape + 'spacing along a column', & ! longname .true., & ! required .false., & ! multi-record .false., & ! preserve case @@ -226,6 +339,7 @@ module GwtDisInputModule 'TOP', & ! fortran variable 'DOUBLE2D', & ! type 'NCOL NROW', & ! shape + 'cell top elevation', & ! longname .true., & ! required .false., & ! multi-record .false., & ! preserve case @@ -243,6 +357,7 @@ module GwtDisInputModule 'BOTM', & ! fortran variable 'DOUBLE3D', & ! type 'NCOL NROW NLAY', & ! shape + 'cell bottom elevation', & ! longname .true., & ! required .false., & ! multi-record .false., & ! preserve case @@ -260,6 +375,7 @@ module GwtDisInputModule 'IDOMAIN', & ! fortran variable 'INTEGER3D', & ! type 'NCOL NROW NLAY', & ! shape + 'idomain existence array', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -276,6 +392,11 @@ module GwtDisInputModule gwtdis_yorigin, & gwtdis_angrot, & gwtdis_export_ascii, & + gwtdis_export_nc, & + gwtdis_ncf_filerecord, & + gwtdis_ncf6, & + gwtdis_filein, & + gwtdis_ncf6_filename, & gwtdis_nlay, & gwtdis_nrow, & gwtdis_ncol, & @@ -298,6 +419,7 @@ module GwtDisInputModule '', & ! fortran variable '', & ! type '', & ! shape + '', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case diff --git a/src/Idm/gwt-disuidm.f90 b/src/Idm/gwt-disuidm.f90 index 2315f4aafff..32d401f3c61 100644 --- a/src/Idm/gwt-disuidm.f90 +++ b/src/Idm/gwt-disuidm.f90 @@ -9,6 +9,7 @@ module GwtDisuInputModule public gwt_disu_block_definitions public GwtDisuParamFoundType public gwt_disu_multi_package + public gwt_disu_subpackages type GwtDisuParamFoundType logical :: length_units = .false. @@ -43,6 +44,12 @@ module GwtDisuInputModule logical :: gwt_disu_multi_package = .false. + character(len=16), parameter :: & + gwt_disu_subpackages(*) = & + [ & + ' ' & + ] + type(InputParamDefinitionType), parameter :: & gwtdisu_length_units = InputParamDefinitionType & ( & @@ -53,6 +60,7 @@ module GwtDisuInputModule 'LENGTH_UNITS', & ! fortran variable 'STRING', & ! type '', & ! shape + 'model length units', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -70,6 +78,7 @@ module GwtDisuInputModule 'NOGRB', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'do not write binary grid file', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -87,6 +96,7 @@ module GwtDisuInputModule 'XORIGIN', & ! fortran variable 'DOUBLE', & ! type '', & ! shape + 'x-position origin of the model grid coordinate system', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -104,6 +114,7 @@ module GwtDisuInputModule 'YORIGIN', & ! fortran variable 'DOUBLE', & ! type '', & ! shape + 'y-position origin of the model grid coordinate system', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -121,6 +132,7 @@ module GwtDisuInputModule 'ANGROT', & ! fortran variable 'DOUBLE', & ! type '', & ! shape + 'rotation angle', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -138,6 +150,7 @@ module GwtDisuInputModule 'VOFFSETTOL', & ! fortran variable 'DOUBLE', & ! type '', & ! shape + 'vertical length dimension for top and bottom checking', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -155,6 +168,7 @@ module GwtDisuInputModule 'EXPORT_ASCII', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'export array variables to layered ascii files.', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -172,6 +186,7 @@ module GwtDisuInputModule 'NODES', & ! fortran variable 'INTEGER', & ! type '', & ! shape + 'number of layers', & ! longname .true., & ! required .false., & ! multi-record .false., & ! preserve case @@ -189,6 +204,7 @@ module GwtDisuInputModule 'NJA', & ! fortran variable 'INTEGER', & ! type '', & ! shape + 'number of columns', & ! longname .true., & ! required .false., & ! multi-record .false., & ! preserve case @@ -206,6 +222,7 @@ module GwtDisuInputModule 'NVERT', & ! fortran variable 'INTEGER', & ! type '', & ! shape + 'number of vertices', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -223,6 +240,7 @@ module GwtDisuInputModule 'TOP', & ! fortran variable 'DOUBLE1D', & ! type 'NODES', & ! shape + 'cell top elevation', & ! longname .true., & ! required .false., & ! multi-record .false., & ! preserve case @@ -240,6 +258,7 @@ module GwtDisuInputModule 'BOT', & ! fortran variable 'DOUBLE1D', & ! type 'NODES', & ! shape + 'cell bottom elevation', & ! longname .true., & ! required .false., & ! multi-record .false., & ! preserve case @@ -257,6 +276,7 @@ module GwtDisuInputModule 'AREA', & ! fortran variable 'DOUBLE1D', & ! type 'NODES', & ! shape + 'cell surface area', & ! longname .true., & ! required .false., & ! multi-record .false., & ! preserve case @@ -274,6 +294,7 @@ module GwtDisuInputModule 'IDOMAIN', & ! fortran variable 'INTEGER1D', & ! type 'NODES', & ! shape + 'idomain existence array', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -291,6 +312,7 @@ module GwtDisuInputModule 'IAC', & ! fortran variable 'INTEGER1D', & ! type 'NODES', & ! shape + 'number of cell connections', & ! longname .true., & ! required .false., & ! multi-record .false., & ! preserve case @@ -308,6 +330,7 @@ module GwtDisuInputModule 'JA', & ! fortran variable 'INTEGER1D', & ! type 'NJA', & ! shape + 'grid connectivity', & ! longname .true., & ! required .false., & ! multi-record .false., & ! preserve case @@ -325,6 +348,7 @@ module GwtDisuInputModule 'IHC', & ! fortran variable 'INTEGER1D', & ! type 'NJA', & ! shape + 'connection type', & ! longname .true., & ! required .false., & ! multi-record .false., & ! preserve case @@ -342,6 +366,7 @@ module GwtDisuInputModule 'CL12', & ! fortran variable 'DOUBLE1D', & ! type 'NJA', & ! shape + 'connection lengths', & ! longname .true., & ! required .false., & ! multi-record .false., & ! preserve case @@ -359,6 +384,7 @@ module GwtDisuInputModule 'HWVA', & ! fortran variable 'DOUBLE1D', & ! type 'NJA', & ! shape + 'connection lengths', & ! longname .true., & ! required .false., & ! multi-record .false., & ! preserve case @@ -376,6 +402,7 @@ module GwtDisuInputModule 'ANGLDEGX', & ! fortran variable 'DOUBLE1D', & ! type 'NJA', & ! shape + 'angle of face normal to connection', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -393,6 +420,7 @@ module GwtDisuInputModule 'IV', & ! fortran variable 'INTEGER', & ! type '', & ! shape + 'vertex number', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -410,6 +438,7 @@ module GwtDisuInputModule 'XV', & ! fortran variable 'DOUBLE', & ! type '', & ! shape + 'x-coordinate for vertex', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -427,6 +456,7 @@ module GwtDisuInputModule 'YV', & ! fortran variable 'DOUBLE', & ! type '', & ! shape + 'y-coordinate for vertex', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -444,6 +474,7 @@ module GwtDisuInputModule 'ICELL2D', & ! fortran variable 'INTEGER', & ! type '', & ! shape + 'cell2d number', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -461,6 +492,7 @@ module GwtDisuInputModule 'XC', & ! fortran variable 'DOUBLE', & ! type '', & ! shape + 'x-coordinate for cell center', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -478,6 +510,7 @@ module GwtDisuInputModule 'YC', & ! fortran variable 'DOUBLE', & ! type '', & ! shape + 'y-coordinate for cell center', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -495,6 +528,7 @@ module GwtDisuInputModule 'NCVERT', & ! fortran variable 'INTEGER', & ! type '', & ! shape + 'number of cell vertices', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -512,6 +546,7 @@ module GwtDisuInputModule 'ICVERT', & ! fortran variable 'INTEGER1D', & ! type 'NCVERT', & ! shape + 'array of vertex numbers', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -562,6 +597,7 @@ module GwtDisuInputModule 'VERTICES', & ! fortran variable 'RECARRAY IV XV YV', & ! type 'NVERT', & ! shape + 'vertices data', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -579,6 +615,7 @@ module GwtDisuInputModule 'CELL2D', & ! fortran variable 'RECARRAY ICELL2D XC YC NCVERT ICVERT', & ! type 'NODES', & ! shape + 'cell2d data', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case diff --git a/src/Idm/gwt-disvidm.f90 b/src/Idm/gwt-disvidm.f90 index 96b1d58bb37..5462a07a959 100644 --- a/src/Idm/gwt-disvidm.f90 +++ b/src/Idm/gwt-disvidm.f90 @@ -9,6 +9,7 @@ module GwtDisvInputModule public gwt_disv_block_definitions public GwtDisvParamFoundType public gwt_disv_multi_package + public gwt_disv_subpackages type GwtDisvParamFoundType logical :: length_units = .false. @@ -17,6 +18,11 @@ module GwtDisvInputModule logical :: yorigin = .false. logical :: angrot = .false. logical :: export_ascii = .false. + logical :: export_nc = .false. + logical :: ncf_filerecord = .false. + logical :: ncf6 = .false. + logical :: filein = .false. + logical :: ncf6_filename = .false. logical :: nlay = .false. logical :: ncpl = .false. logical :: nvert = .false. @@ -35,6 +41,12 @@ module GwtDisvInputModule logical :: gwt_disv_multi_package = .false. + character(len=16), parameter :: & + gwt_disv_subpackages(*) = & + [ & + 'UTL-NCF ' & + ] + type(InputParamDefinitionType), parameter :: & gwtdisv_length_units = InputParamDefinitionType & ( & @@ -45,6 +57,7 @@ module GwtDisvInputModule 'LENGTH_UNITS', & ! fortran variable 'STRING', & ! type '', & ! shape + 'model length units', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -62,6 +75,7 @@ module GwtDisvInputModule 'NOGRB', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'do not write binary grid file', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -79,6 +93,7 @@ module GwtDisvInputModule 'XORIGIN', & ! fortran variable 'DOUBLE', & ! type '', & ! shape + 'x-position origin of the model grid coordinate system', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -96,6 +111,7 @@ module GwtDisvInputModule 'YORIGIN', & ! fortran variable 'DOUBLE', & ! type '', & ! shape + 'y-position origin of the model grid coordinate system', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -113,6 +129,7 @@ module GwtDisvInputModule 'ANGROT', & ! fortran variable 'DOUBLE', & ! type '', & ! shape + 'rotation angle', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -130,6 +147,43 @@ module GwtDisvInputModule 'EXPORT_ASCII', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'export array variables to layered ascii files.', & ! longname + .false., & ! required + .false., & ! multi-record + .false., & ! preserve case + .false., & ! layered + .false. & ! timeseries + ) + + type(InputParamDefinitionType), parameter :: & + gwtdisv_export_nc = InputParamDefinitionType & + ( & + 'GWT', & ! component + 'DISV', & ! subcomponent + 'OPTIONS', & ! block + 'EXPORT_ARRAY_NETCDF', & ! tag name + 'EXPORT_NC', & ! fortran variable + 'KEYWORD', & ! type + '', & ! shape + 'export array variables to netcdf output files.', & ! longname + .false., & ! required + .false., & ! multi-record + .false., & ! preserve case + .false., & ! layered + .false. & ! timeseries + ) + + type(InputParamDefinitionType), parameter :: & + gwtdisv_ncf_filerecord = InputParamDefinitionType & + ( & + 'GWT', & ! component + 'DISV', & ! subcomponent + 'OPTIONS', & ! block + 'NCF_FILERECORD', & ! tag name + 'NCF_FILERECORD', & ! fortran variable + 'RECORD NCF6 FILEIN NCF6_FILENAME', & ! type + '', & ! shape + '', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -137,6 +191,60 @@ module GwtDisvInputModule .false. & ! timeseries ) + type(InputParamDefinitionType), parameter :: & + gwtdisv_ncf6 = InputParamDefinitionType & + ( & + 'GWT', & ! component + 'DISV', & ! subcomponent + 'OPTIONS', & ! block + 'NCF6', & ! tag name + 'NCF6', & ! fortran variable + 'KEYWORD', & ! type + '', & ! shape + 'ncf keyword', & ! longname + .true., & ! required + .true., & ! multi-record + .false., & ! preserve case + .false., & ! layered + .false. & ! timeseries + ) + + type(InputParamDefinitionType), parameter :: & + gwtdisv_filein = InputParamDefinitionType & + ( & + 'GWT', & ! component + 'DISV', & ! subcomponent + 'OPTIONS', & ! block + 'FILEIN', & ! tag name + 'FILEIN', & ! fortran variable + 'KEYWORD', & ! type + '', & ! shape + 'file keyword', & ! longname + .true., & ! required + .true., & ! multi-record + .false., & ! preserve case + .false., & ! layered + .false. & ! timeseries + ) + + type(InputParamDefinitionType), parameter :: & + gwtdisv_ncf6_filename = InputParamDefinitionType & + ( & + 'GWT', & ! component + 'DISV', & ! subcomponent + 'OPTIONS', & ! block + 'NCF6_FILENAME', & ! tag name + 'NCF6_FILENAME', & ! fortran variable + 'STRING', & ! type + '', & ! shape + 'file name of NCF information', & ! longname + .true., & ! required + .true., & ! multi-record + .true., & ! preserve case + .false., & ! layered + .false. & ! timeseries + ) + type(InputParamDefinitionType), parameter :: & gwtdisv_nlay = InputParamDefinitionType & ( & @@ -147,6 +255,7 @@ module GwtDisvInputModule 'NLAY', & ! fortran variable 'INTEGER', & ! type '', & ! shape + 'number of layers', & ! longname .true., & ! required .false., & ! multi-record .false., & ! preserve case @@ -164,6 +273,7 @@ module GwtDisvInputModule 'NCPL', & ! fortran variable 'INTEGER', & ! type '', & ! shape + 'number of cells per layer', & ! longname .true., & ! required .false., & ! multi-record .false., & ! preserve case @@ -181,6 +291,7 @@ module GwtDisvInputModule 'NVERT', & ! fortran variable 'INTEGER', & ! type '', & ! shape + 'number of columns', & ! longname .true., & ! required .false., & ! multi-record .false., & ! preserve case @@ -198,6 +309,7 @@ module GwtDisvInputModule 'TOP', & ! fortran variable 'DOUBLE1D', & ! type 'NCPL', & ! shape + 'model top elevation', & ! longname .true., & ! required .false., & ! multi-record .false., & ! preserve case @@ -215,6 +327,7 @@ module GwtDisvInputModule 'BOTM', & ! fortran variable 'DOUBLE2D', & ! type 'NCPL NLAY', & ! shape + 'model bottom elevation', & ! longname .true., & ! required .false., & ! multi-record .false., & ! preserve case @@ -232,6 +345,7 @@ module GwtDisvInputModule 'IDOMAIN', & ! fortran variable 'INTEGER2D', & ! type 'NCPL NLAY', & ! shape + 'idomain existence array', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -249,6 +363,7 @@ module GwtDisvInputModule 'IV', & ! fortran variable 'INTEGER', & ! type '', & ! shape + 'vertex number', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -266,6 +381,7 @@ module GwtDisvInputModule 'XV', & ! fortran variable 'DOUBLE', & ! type '', & ! shape + 'x-coordinate for vertex', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -283,6 +399,7 @@ module GwtDisvInputModule 'YV', & ! fortran variable 'DOUBLE', & ! type '', & ! shape + 'y-coordinate for vertex', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -300,6 +417,7 @@ module GwtDisvInputModule 'ICELL2D', & ! fortran variable 'INTEGER', & ! type '', & ! shape + 'cell2d number', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -317,6 +435,7 @@ module GwtDisvInputModule 'XC', & ! fortran variable 'DOUBLE', & ! type '', & ! shape + 'x-coordinate for cell center', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -334,6 +453,7 @@ module GwtDisvInputModule 'YC', & ! fortran variable 'DOUBLE', & ! type '', & ! shape + 'y-coordinate for cell center', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -351,6 +471,7 @@ module GwtDisvInputModule 'NCVERT', & ! fortran variable 'INTEGER', & ! type '', & ! shape + 'number of cell vertices', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -368,6 +489,7 @@ module GwtDisvInputModule 'ICVERT', & ! fortran variable 'INTEGER1D', & ! type 'NCVERT', & ! shape + 'array of vertex numbers', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -384,6 +506,11 @@ module GwtDisvInputModule gwtdisv_yorigin, & gwtdisv_angrot, & gwtdisv_export_ascii, & + gwtdisv_export_nc, & + gwtdisv_ncf_filerecord, & + gwtdisv_ncf6, & + gwtdisv_filein, & + gwtdisv_ncf6_filename, & gwtdisv_nlay, & gwtdisv_ncpl, & gwtdisv_nvert, & @@ -410,6 +537,7 @@ module GwtDisvInputModule 'VERTICES', & ! fortran variable 'RECARRAY IV XV YV', & ! type 'NVERT', & ! shape + 'vertices data', & ! longname .true., & ! required .false., & ! multi-record .false., & ! preserve case @@ -427,6 +555,7 @@ module GwtDisvInputModule 'CELL2D', & ! fortran variable 'RECARRAY ICELL2D XC YC NCVERT ICVERT', & ! type 'NCPL', & ! shape + 'cell2d data', & ! longname .true., & ! required .false., & ! multi-record .false., & ! preserve case diff --git a/src/Idm/gwt-dspidm.f90 b/src/Idm/gwt-dspidm.f90 index ccab6b36aef..bbaccb7438f 100644 --- a/src/Idm/gwt-dspidm.f90 +++ b/src/Idm/gwt-dspidm.f90 @@ -9,11 +9,13 @@ module GwtDspInputModule public gwt_dsp_block_definitions public GwtDspParamFoundType public gwt_dsp_multi_package + public gwt_dsp_subpackages type GwtDspParamFoundType logical :: xt3d_off = .false. logical :: xt3d_rhs = .false. logical :: export_ascii = .false. + logical :: export_nc = .false. logical :: diffc = .false. logical :: alh = .false. logical :: alv = .false. @@ -24,6 +26,12 @@ module GwtDspInputModule logical :: gwt_dsp_multi_package = .false. + character(len=16), parameter :: & + gwt_dsp_subpackages(*) = & + [ & + ' ' & + ] + type(InputParamDefinitionType), parameter :: & gwtdsp_xt3d_off = InputParamDefinitionType & ( & @@ -34,6 +42,7 @@ module GwtDspInputModule 'XT3D_OFF', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'deactivate xt3d', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -51,6 +60,7 @@ module GwtDspInputModule 'XT3D_RHS', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'xt3d on right-hand side', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -68,6 +78,25 @@ module GwtDspInputModule 'EXPORT_ASCII', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'export array variables to layered ascii files.', & ! longname + .false., & ! required + .false., & ! multi-record + .false., & ! preserve case + .false., & ! layered + .false. & ! timeseries + ) + + type(InputParamDefinitionType), parameter :: & + gwtdsp_export_nc = InputParamDefinitionType & + ( & + 'GWT', & ! component + 'DSP', & ! subcomponent + 'OPTIONS', & ! block + 'EXPORT_ARRAY_NETCDF', & ! tag name + 'EXPORT_NC', & ! fortran variable + 'KEYWORD', & ! type + '', & ! shape + 'export array variables to netcdf output files.', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -85,6 +114,7 @@ module GwtDspInputModule 'DIFFC', & ! fortran variable 'DOUBLE1D', & ! type 'NODES', & ! shape + 'effective molecular diffusion coefficient', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -102,6 +132,7 @@ module GwtDspInputModule 'ALH', & ! fortran variable 'DOUBLE1D', & ! type 'NODES', & ! shape + 'longitudinal dispersivity in horizontal direction', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -119,6 +150,7 @@ module GwtDspInputModule 'ALV', & ! fortran variable 'DOUBLE1D', & ! type 'NODES', & ! shape + 'longitudinal dispersivity in vertical direction', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -136,6 +168,7 @@ module GwtDspInputModule 'ATH1', & ! fortran variable 'DOUBLE1D', & ! type 'NODES', & ! shape + 'transverse dispersivity in horizontal direction', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -153,6 +186,7 @@ module GwtDspInputModule 'ATH2', & ! fortran variable 'DOUBLE1D', & ! type 'NODES', & ! shape + 'transverse dispersivity in horizontal direction', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -170,6 +204,7 @@ module GwtDspInputModule 'ATV', & ! fortran variable 'DOUBLE1D', & ! type 'NODES', & ! shape + 'transverse dispersivity when flow is in vertical direction', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -183,6 +218,7 @@ module GwtDspInputModule gwtdsp_xt3d_off, & gwtdsp_xt3d_rhs, & gwtdsp_export_ascii, & + gwtdsp_export_nc, & gwtdsp_diffc, & gwtdsp_alh, & gwtdsp_alv, & @@ -203,6 +239,7 @@ module GwtDspInputModule '', & ! fortran variable '', & ! type '', & ! shape + '', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case diff --git a/src/Idm/gwt-icidm.f90 b/src/Idm/gwt-icidm.f90 index 91a37592efc..63d49e38329 100644 --- a/src/Idm/gwt-icidm.f90 +++ b/src/Idm/gwt-icidm.f90 @@ -9,14 +9,22 @@ module GwtIcInputModule public gwt_ic_block_definitions public GwtIcParamFoundType public gwt_ic_multi_package + public gwt_ic_subpackages type GwtIcParamFoundType logical :: export_ascii = .false. + logical :: export_nc = .false. logical :: strt = .false. end type GwtIcParamFoundType logical :: gwt_ic_multi_package = .false. + character(len=16), parameter :: & + gwt_ic_subpackages(*) = & + [ & + ' ' & + ] + type(InputParamDefinitionType), parameter :: & gwtic_export_ascii = InputParamDefinitionType & ( & @@ -27,6 +35,25 @@ module GwtIcInputModule 'EXPORT_ASCII', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'export array variables to layered ascii files.', & ! longname + .false., & ! required + .false., & ! multi-record + .false., & ! preserve case + .false., & ! layered + .false. & ! timeseries + ) + + type(InputParamDefinitionType), parameter :: & + gwtic_export_nc = InputParamDefinitionType & + ( & + 'GWT', & ! component + 'IC', & ! subcomponent + 'OPTIONS', & ! block + 'EXPORT_ARRAY_NETCDF', & ! tag name + 'EXPORT_NC', & ! fortran variable + 'KEYWORD', & ! type + '', & ! shape + 'export array variables to netcdf output files.', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -44,6 +71,7 @@ module GwtIcInputModule 'STRT', & ! fortran variable 'DOUBLE1D', & ! type 'NODES', & ! shape + 'starting concentration', & ! longname .true., & ! required .false., & ! multi-record .false., & ! preserve case @@ -55,6 +83,7 @@ module GwtIcInputModule gwt_ic_param_definitions(*) = & [ & gwtic_export_ascii, & + gwtic_export_nc, & gwtic_strt & ] @@ -70,6 +99,7 @@ module GwtIcInputModule '', & ! fortran variable '', & ! type '', & ! shape + '', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case diff --git a/src/Idm/gwt-namidm.f90 b/src/Idm/gwt-namidm.f90 index d2289c5c688..57583a23209 100644 --- a/src/Idm/gwt-namidm.f90 +++ b/src/Idm/gwt-namidm.f90 @@ -9,12 +9,14 @@ module GwtNamInputModule public gwt_nam_block_definitions public GwtNamParamFoundType public gwt_nam_multi_package + public gwt_nam_subpackages type GwtNamParamFoundType logical :: list = .false. logical :: print_input = .false. logical :: print_flows = .false. logical :: save_flows = .false. + logical :: export_netcdf = .false. logical :: ftype = .false. logical :: fname = .false. logical :: pname = .false. @@ -22,6 +24,12 @@ module GwtNamInputModule logical :: gwt_nam_multi_package = .false. + character(len=16), parameter :: & + gwt_nam_subpackages(*) = & + [ & + ' ' & + ] + type(InputParamDefinitionType), parameter :: & gwtnam_list = InputParamDefinitionType & ( & @@ -32,6 +40,7 @@ module GwtNamInputModule 'LIST', & ! fortran variable 'STRING', & ! type '', & ! shape + 'name of listing file', & ! longname .false., & ! required .false., & ! multi-record .true., & ! preserve case @@ -49,6 +58,7 @@ module GwtNamInputModule 'PRINT_INPUT', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'print input to listing file', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -66,6 +76,7 @@ module GwtNamInputModule 'PRINT_FLOWS', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'print calculated flows to listing file', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -83,6 +94,25 @@ module GwtNamInputModule 'SAVE_FLOWS', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'save flows for all packages to budget file', & ! longname + .false., & ! required + .false., & ! multi-record + .false., & ! preserve case + .false., & ! layered + .false. & ! timeseries + ) + + type(InputParamDefinitionType), parameter :: & + gwtnam_export_netcdf = InputParamDefinitionType & + ( & + 'GWT', & ! component + 'NAM', & ! subcomponent + 'OPTIONS', & ! block + 'EXPORT_NETCDF', & ! tag name + 'EXPORT_NETCDF', & ! fortran variable + 'STRING', & ! type + '', & ! shape + 'export model output netcdf file.', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -100,6 +130,7 @@ module GwtNamInputModule 'FTYPE', & ! fortran variable 'STRING', & ! type '', & ! shape + 'package type', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -117,6 +148,7 @@ module GwtNamInputModule 'FNAME', & ! fortran variable 'STRING', & ! type '', & ! shape + 'file name', & ! longname .true., & ! required .true., & ! multi-record .true., & ! preserve case @@ -134,6 +166,7 @@ module GwtNamInputModule 'PNAME', & ! fortran variable 'STRING', & ! type '', & ! shape + 'user name for package', & ! longname .false., & ! required .true., & ! multi-record .false., & ! preserve case @@ -148,6 +181,7 @@ module GwtNamInputModule gwtnam_print_input, & gwtnam_print_flows, & gwtnam_save_flows, & + gwtnam_export_netcdf, & gwtnam_ftype, & gwtnam_fname, & gwtnam_pname & @@ -163,6 +197,7 @@ module GwtNamInputModule 'PACKAGES', & ! fortran variable 'RECARRAY FTYPE FNAME PNAME', & ! type '', & ! shape + 'package list', & ! longname .true., & ! required .false., & ! multi-record .false., & ! preserve case diff --git a/src/Idm/prt-disidm.f90 b/src/Idm/prt-disidm.f90 index c178966bee7..d6008955da5 100644 --- a/src/Idm/prt-disidm.f90 +++ b/src/Idm/prt-disidm.f90 @@ -9,6 +9,7 @@ module PrtDisInputModule public prt_dis_block_definitions public PrtDisParamFoundType public prt_dis_multi_package + public prt_dis_subpackages type PrtDisParamFoundType logical :: length_units = .false. @@ -17,6 +18,11 @@ module PrtDisInputModule logical :: yorigin = .false. logical :: angrot = .false. logical :: export_ascii = .false. + logical :: export_nc = .false. + logical :: ncf_filerecord = .false. + logical :: ncf6 = .false. + logical :: filein = .false. + logical :: ncf6_filename = .false. logical :: nlay = .false. logical :: nrow = .false. logical :: ncol = .false. @@ -29,6 +35,12 @@ module PrtDisInputModule logical :: prt_dis_multi_package = .false. + character(len=16), parameter :: & + prt_dis_subpackages(*) = & + [ & + ' ' & + ] + type(InputParamDefinitionType), parameter :: & prtdis_length_units = InputParamDefinitionType & ( & @@ -39,6 +51,7 @@ module PrtDisInputModule 'LENGTH_UNITS', & ! fortran variable 'STRING', & ! type '', & ! shape + 'model length units', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -56,6 +69,7 @@ module PrtDisInputModule 'NOGRB', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'do not write binary grid file', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -73,6 +87,7 @@ module PrtDisInputModule 'XORIGIN', & ! fortran variable 'DOUBLE', & ! type '', & ! shape + 'x-position of the model grid origin', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -90,6 +105,7 @@ module PrtDisInputModule 'YORIGIN', & ! fortran variable 'DOUBLE', & ! type '', & ! shape + 'y-position of the model grid origin', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -107,6 +123,7 @@ module PrtDisInputModule 'ANGROT', & ! fortran variable 'DOUBLE', & ! type '', & ! shape + 'rotation angle', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -124,6 +141,25 @@ module PrtDisInputModule 'EXPORT_ASCII', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'export array variables to layered ascii files.', & ! longname + .false., & ! required + .false., & ! multi-record + .false., & ! preserve case + .false., & ! layered + .false. & ! timeseries + ) + + type(InputParamDefinitionType), parameter :: & + prtdis_export_nc = InputParamDefinitionType & + ( & + 'PRT', & ! component + 'DIS', & ! subcomponent + 'OPTIONS', & ! block + 'EXPORT_ARRAY_NETCDF', & ! tag name + 'EXPORT_NC', & ! fortran variable + 'KEYWORD', & ! type + '', & ! shape + 'export array variables to netcdf output files.', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -131,6 +167,78 @@ module PrtDisInputModule .false. & ! timeseries ) + type(InputParamDefinitionType), parameter :: & + prtdis_ncf_filerecord = InputParamDefinitionType & + ( & + 'PRT', & ! component + 'DIS', & ! subcomponent + 'OPTIONS', & ! block + 'NCF_FILERECORD', & ! tag name + 'NCF_FILERECORD', & ! fortran variable + 'RECORD NCF6 FILEIN NCF6_FILENAME', & ! type + '', & ! shape + '', & ! longname + .false., & ! required + .false., & ! multi-record + .false., & ! preserve case + .false., & ! layered + .false. & ! timeseries + ) + + type(InputParamDefinitionType), parameter :: & + prtdis_ncf6 = InputParamDefinitionType & + ( & + 'PRT', & ! component + 'DIS', & ! subcomponent + 'OPTIONS', & ! block + 'NCF6', & ! tag name + 'NCF6', & ! fortran variable + 'KEYWORD', & ! type + '', & ! shape + 'ncf keyword', & ! longname + .true., & ! required + .true., & ! multi-record + .false., & ! preserve case + .false., & ! layered + .false. & ! timeseries + ) + + type(InputParamDefinitionType), parameter :: & + prtdis_filein = InputParamDefinitionType & + ( & + 'PRT', & ! component + 'DIS', & ! subcomponent + 'OPTIONS', & ! block + 'FILEIN', & ! tag name + 'FILEIN', & ! fortran variable + 'KEYWORD', & ! type + '', & ! shape + 'file keyword', & ! longname + .true., & ! required + .true., & ! multi-record + .false., & ! preserve case + .false., & ! layered + .false. & ! timeseries + ) + + type(InputParamDefinitionType), parameter :: & + prtdis_ncf6_filename = InputParamDefinitionType & + ( & + 'PRT', & ! component + 'DIS', & ! subcomponent + 'OPTIONS', & ! block + 'NCF6_FILENAME', & ! tag name + 'NCF6_FILENAME', & ! fortran variable + 'STRING', & ! type + '', & ! shape + 'file name of NCF information', & ! longname + .true., & ! required + .true., & ! multi-record + .true., & ! preserve case + .false., & ! layered + .false. & ! timeseries + ) + type(InputParamDefinitionType), parameter :: & prtdis_nlay = InputParamDefinitionType & ( & @@ -141,6 +249,7 @@ module PrtDisInputModule 'NLAY', & ! fortran variable 'INTEGER', & ! type '', & ! shape + 'number of layers', & ! longname .true., & ! required .false., & ! multi-record .false., & ! preserve case @@ -158,6 +267,7 @@ module PrtDisInputModule 'NROW', & ! fortran variable 'INTEGER', & ! type '', & ! shape + 'number of rows', & ! longname .true., & ! required .false., & ! multi-record .false., & ! preserve case @@ -175,6 +285,7 @@ module PrtDisInputModule 'NCOL', & ! fortran variable 'INTEGER', & ! type '', & ! shape + 'number of columns', & ! longname .true., & ! required .false., & ! multi-record .false., & ! preserve case @@ -192,6 +303,7 @@ module PrtDisInputModule 'DELR', & ! fortran variable 'DOUBLE1D', & ! type 'NCOL', & ! shape + 'spacing along a row', & ! longname .true., & ! required .false., & ! multi-record .false., & ! preserve case @@ -209,6 +321,7 @@ module PrtDisInputModule 'DELC', & ! fortran variable 'DOUBLE1D', & ! type 'NROW', & ! shape + 'spacing along a column', & ! longname .true., & ! required .false., & ! multi-record .false., & ! preserve case @@ -226,6 +339,7 @@ module PrtDisInputModule 'TOP', & ! fortran variable 'DOUBLE2D', & ! type 'NCOL NROW', & ! shape + 'cell top elevation', & ! longname .true., & ! required .false., & ! multi-record .false., & ! preserve case @@ -243,6 +357,7 @@ module PrtDisInputModule 'BOTM', & ! fortran variable 'DOUBLE3D', & ! type 'NCOL NROW NLAY', & ! shape + 'cell bottom elevation', & ! longname .true., & ! required .false., & ! multi-record .false., & ! preserve case @@ -260,6 +375,7 @@ module PrtDisInputModule 'IDOMAIN', & ! fortran variable 'INTEGER3D', & ! type 'NCOL NROW NLAY', & ! shape + 'idomain existence array', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -276,6 +392,11 @@ module PrtDisInputModule prtdis_yorigin, & prtdis_angrot, & prtdis_export_ascii, & + prtdis_export_nc, & + prtdis_ncf_filerecord, & + prtdis_ncf6, & + prtdis_filein, & + prtdis_ncf6_filename, & prtdis_nlay, & prtdis_nrow, & prtdis_ncol, & @@ -298,6 +419,7 @@ module PrtDisInputModule '', & ! fortran variable '', & ! type '', & ! shape + '', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case diff --git a/src/Idm/prt-disvidm.f90 b/src/Idm/prt-disvidm.f90 index e1f2f3fe063..1986271b6f8 100644 --- a/src/Idm/prt-disvidm.f90 +++ b/src/Idm/prt-disvidm.f90 @@ -9,6 +9,7 @@ module PrtDisvInputModule public prt_disv_block_definitions public PrtDisvParamFoundType public prt_disv_multi_package + public prt_disv_subpackages type PrtDisvParamFoundType logical :: length_units = .false. @@ -17,6 +18,11 @@ module PrtDisvInputModule logical :: yorigin = .false. logical :: angrot = .false. logical :: export_ascii = .false. + logical :: export_nc = .false. + logical :: ncf_filerecord = .false. + logical :: ncf6 = .false. + logical :: filein = .false. + logical :: ncf6_filename = .false. logical :: nlay = .false. logical :: ncpl = .false. logical :: nvert = .false. @@ -35,6 +41,12 @@ module PrtDisvInputModule logical :: prt_disv_multi_package = .false. + character(len=16), parameter :: & + prt_disv_subpackages(*) = & + [ & + ' ' & + ] + type(InputParamDefinitionType), parameter :: & prtdisv_length_units = InputParamDefinitionType & ( & @@ -45,6 +57,7 @@ module PrtDisvInputModule 'LENGTH_UNITS', & ! fortran variable 'STRING', & ! type '', & ! shape + 'model length units', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -62,6 +75,7 @@ module PrtDisvInputModule 'NOGRB', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'do not write binary grid file', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -79,6 +93,7 @@ module PrtDisvInputModule 'XORIGIN', & ! fortran variable 'DOUBLE', & ! type '', & ! shape + 'x-position origin of the model grid coordinate system', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -96,6 +111,7 @@ module PrtDisvInputModule 'YORIGIN', & ! fortran variable 'DOUBLE', & ! type '', & ! shape + 'y-position origin of the model grid coordinate system', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -113,6 +129,7 @@ module PrtDisvInputModule 'ANGROT', & ! fortran variable 'DOUBLE', & ! type '', & ! shape + 'rotation angle', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -130,6 +147,43 @@ module PrtDisvInputModule 'EXPORT_ASCII', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'export array variables to layered ascii files.', & ! longname + .false., & ! required + .false., & ! multi-record + .false., & ! preserve case + .false., & ! layered + .false. & ! timeseries + ) + + type(InputParamDefinitionType), parameter :: & + prtdisv_export_nc = InputParamDefinitionType & + ( & + 'PRT', & ! component + 'DISV', & ! subcomponent + 'OPTIONS', & ! block + 'EXPORT_ARRAY_NETCDF', & ! tag name + 'EXPORT_NC', & ! fortran variable + 'KEYWORD', & ! type + '', & ! shape + 'export array variables to netcdf output files.', & ! longname + .false., & ! required + .false., & ! multi-record + .false., & ! preserve case + .false., & ! layered + .false. & ! timeseries + ) + + type(InputParamDefinitionType), parameter :: & + prtdisv_ncf_filerecord = InputParamDefinitionType & + ( & + 'PRT', & ! component + 'DISV', & ! subcomponent + 'OPTIONS', & ! block + 'NCF_FILERECORD', & ! tag name + 'NCF_FILERECORD', & ! fortran variable + 'RECORD NCF6 FILEIN NCF6_FILENAME', & ! type + '', & ! shape + '', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -137,6 +191,60 @@ module PrtDisvInputModule .false. & ! timeseries ) + type(InputParamDefinitionType), parameter :: & + prtdisv_ncf6 = InputParamDefinitionType & + ( & + 'PRT', & ! component + 'DISV', & ! subcomponent + 'OPTIONS', & ! block + 'NCF6', & ! tag name + 'NCF6', & ! fortran variable + 'KEYWORD', & ! type + '', & ! shape + 'ncf keyword', & ! longname + .true., & ! required + .true., & ! multi-record + .false., & ! preserve case + .false., & ! layered + .false. & ! timeseries + ) + + type(InputParamDefinitionType), parameter :: & + prtdisv_filein = InputParamDefinitionType & + ( & + 'PRT', & ! component + 'DISV', & ! subcomponent + 'OPTIONS', & ! block + 'FILEIN', & ! tag name + 'FILEIN', & ! fortran variable + 'KEYWORD', & ! type + '', & ! shape + 'file keyword', & ! longname + .true., & ! required + .true., & ! multi-record + .false., & ! preserve case + .false., & ! layered + .false. & ! timeseries + ) + + type(InputParamDefinitionType), parameter :: & + prtdisv_ncf6_filename = InputParamDefinitionType & + ( & + 'PRT', & ! component + 'DISV', & ! subcomponent + 'OPTIONS', & ! block + 'NCF6_FILENAME', & ! tag name + 'NCF6_FILENAME', & ! fortran variable + 'STRING', & ! type + '', & ! shape + 'file name of NCF information', & ! longname + .true., & ! required + .true., & ! multi-record + .true., & ! preserve case + .false., & ! layered + .false. & ! timeseries + ) + type(InputParamDefinitionType), parameter :: & prtdisv_nlay = InputParamDefinitionType & ( & @@ -147,6 +255,7 @@ module PrtDisvInputModule 'NLAY', & ! fortran variable 'INTEGER', & ! type '', & ! shape + 'number of layers', & ! longname .true., & ! required .false., & ! multi-record .false., & ! preserve case @@ -164,6 +273,7 @@ module PrtDisvInputModule 'NCPL', & ! fortran variable 'INTEGER', & ! type '', & ! shape + 'number of cells per layer', & ! longname .true., & ! required .false., & ! multi-record .false., & ! preserve case @@ -181,6 +291,7 @@ module PrtDisvInputModule 'NVERT', & ! fortran variable 'INTEGER', & ! type '', & ! shape + 'number of columns', & ! longname .true., & ! required .false., & ! multi-record .false., & ! preserve case @@ -198,6 +309,7 @@ module PrtDisvInputModule 'TOP', & ! fortran variable 'DOUBLE1D', & ! type 'NCPL', & ! shape + 'model top elevation', & ! longname .true., & ! required .false., & ! multi-record .false., & ! preserve case @@ -215,6 +327,7 @@ module PrtDisvInputModule 'BOTM', & ! fortran variable 'DOUBLE2D', & ! type 'NCPL NLAY', & ! shape + 'model bottom elevation', & ! longname .true., & ! required .false., & ! multi-record .false., & ! preserve case @@ -232,6 +345,7 @@ module PrtDisvInputModule 'IDOMAIN', & ! fortran variable 'INTEGER2D', & ! type 'NCPL NLAY', & ! shape + 'idomain existence array', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -249,6 +363,7 @@ module PrtDisvInputModule 'IV', & ! fortran variable 'INTEGER', & ! type '', & ! shape + 'vertex number', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -266,6 +381,7 @@ module PrtDisvInputModule 'XV', & ! fortran variable 'DOUBLE', & ! type '', & ! shape + 'x-coordinate for vertex', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -283,6 +399,7 @@ module PrtDisvInputModule 'YV', & ! fortran variable 'DOUBLE', & ! type '', & ! shape + 'y-coordinate for vertex', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -300,6 +417,7 @@ module PrtDisvInputModule 'ICELL2D', & ! fortran variable 'INTEGER', & ! type '', & ! shape + 'cell2d number', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -317,6 +435,7 @@ module PrtDisvInputModule 'XC', & ! fortran variable 'DOUBLE', & ! type '', & ! shape + 'x-coordinate for cell center', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -334,6 +453,7 @@ module PrtDisvInputModule 'YC', & ! fortran variable 'DOUBLE', & ! type '', & ! shape + 'y-coordinate for cell center', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -351,6 +471,7 @@ module PrtDisvInputModule 'NCVERT', & ! fortran variable 'INTEGER', & ! type '', & ! shape + 'number of cell vertices', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -368,6 +489,7 @@ module PrtDisvInputModule 'ICVERT', & ! fortran variable 'INTEGER1D', & ! type 'NCVERT', & ! shape + 'array of vertex numbers', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -384,6 +506,11 @@ module PrtDisvInputModule prtdisv_yorigin, & prtdisv_angrot, & prtdisv_export_ascii, & + prtdisv_export_nc, & + prtdisv_ncf_filerecord, & + prtdisv_ncf6, & + prtdisv_filein, & + prtdisv_ncf6_filename, & prtdisv_nlay, & prtdisv_ncpl, & prtdisv_nvert, & @@ -410,6 +537,7 @@ module PrtDisvInputModule 'VERTICES', & ! fortran variable 'RECARRAY IV XV YV', & ! type 'NVERT', & ! shape + 'vertices data', & ! longname .true., & ! required .false., & ! multi-record .false., & ! preserve case @@ -427,6 +555,7 @@ module PrtDisvInputModule 'CELL2D', & ! fortran variable 'RECARRAY ICELL2D XC YC NCVERT ICVERT', & ! type 'NCPL', & ! shape + 'cell2d data', & ! longname .true., & ! required .false., & ! multi-record .false., & ! preserve case diff --git a/src/Idm/prt-mipidm.f90 b/src/Idm/prt-mipidm.f90 index 48807bf5991..b0af08fbfdb 100644 --- a/src/Idm/prt-mipidm.f90 +++ b/src/Idm/prt-mipidm.f90 @@ -9,6 +9,7 @@ module PrtMipInputModule public prt_mip_block_definitions public PrtMipParamFoundType public prt_mip_multi_package + public prt_mip_subpackages type PrtMipParamFoundType logical :: export_ascii = .false. @@ -19,6 +20,12 @@ module PrtMipInputModule logical :: prt_mip_multi_package = .false. + character(len=16), parameter :: & + prt_mip_subpackages(*) = & + [ & + ' ' & + ] + type(InputParamDefinitionType), parameter :: & prtmip_export_ascii = InputParamDefinitionType & ( & @@ -29,6 +36,7 @@ module PrtMipInputModule 'EXPORT_ASCII', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'export array variables to layered ascii files.', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -46,6 +54,7 @@ module PrtMipInputModule 'POROSITY', & ! fortran variable 'DOUBLE1D', & ! type 'NODES', & ! shape + 'porosity', & ! longname .true., & ! required .false., & ! multi-record .false., & ! preserve case @@ -63,6 +72,7 @@ module PrtMipInputModule 'RETFACTOR', & ! fortran variable 'DOUBLE1D', & ! type 'NODES', & ! shape + 'retardation factor', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -80,6 +90,7 @@ module PrtMipInputModule 'IZONE', & ! fortran variable 'INTEGER1D', & ! type 'NODES', & ! shape + 'zone number', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -108,6 +119,7 @@ module PrtMipInputModule '', & ! fortran variable '', & ! type '', & ! shape + '', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case diff --git a/src/Idm/prt-namidm.f90 b/src/Idm/prt-namidm.f90 index e1414a1e7fc..d30a17aa28a 100644 --- a/src/Idm/prt-namidm.f90 +++ b/src/Idm/prt-namidm.f90 @@ -9,6 +9,7 @@ module PrtNamInputModule public prt_nam_block_definitions public PrtNamParamFoundType public prt_nam_multi_package + public prt_nam_subpackages type PrtNamParamFoundType logical :: list = .false. @@ -22,6 +23,12 @@ module PrtNamInputModule logical :: prt_nam_multi_package = .false. + character(len=16), parameter :: & + prt_nam_subpackages(*) = & + [ & + ' ' & + ] + type(InputParamDefinitionType), parameter :: & prtnam_list = InputParamDefinitionType & ( & @@ -32,6 +39,7 @@ module PrtNamInputModule 'LIST', & ! fortran variable 'STRING', & ! type '', & ! shape + 'name of listing file', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -49,6 +57,7 @@ module PrtNamInputModule 'PRINT_INPUT', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'print input to listing file', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -66,6 +75,7 @@ module PrtNamInputModule 'PRINT_FLOWS', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'print calculated flows to listing file', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -83,6 +93,7 @@ module PrtNamInputModule 'SAVE_FLOWS', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'save flows for all packages to budget file', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -100,6 +111,7 @@ module PrtNamInputModule 'FTYPE', & ! fortran variable 'STRING', & ! type '', & ! shape + 'package type', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -117,6 +129,7 @@ module PrtNamInputModule 'FNAME', & ! fortran variable 'STRING', & ! type '', & ! shape + 'file name', & ! longname .true., & ! required .true., & ! multi-record .true., & ! preserve case @@ -134,6 +147,7 @@ module PrtNamInputModule 'PNAME', & ! fortran variable 'STRING', & ! type '', & ! shape + 'user name for package', & ! longname .false., & ! required .true., & ! multi-record .false., & ! preserve case @@ -163,6 +177,7 @@ module PrtNamInputModule 'PACKAGES', & ! fortran variable 'RECARRAY FTYPE FNAME PNAME', & ! type '', & ! shape + 'package list', & ! longname .true., & ! required .false., & ! multi-record .false., & ! preserve case diff --git a/src/Idm/selector/IdmDfnSelector.f90 b/src/Idm/selector/IdmDfnSelector.f90 index 61c83d085ec..f473f2b0858 100644 --- a/src/Idm/selector/IdmDfnSelector.f90 +++ b/src/Idm/selector/IdmDfnSelector.f90 @@ -20,6 +20,7 @@ module IdmDfnSelectorModule public :: aggregate_definitions public :: block_definitions public :: idm_multi_package + public :: idm_subpackages public :: idm_integrated public :: idm_component @@ -135,6 +136,35 @@ function idm_multi_package(component, subcomponent) result(multi_package) return end function idm_multi_package + function idm_subpackages(component, subcomponent) result(subpackages) + character(len=*), intent(in) :: component + character(len=*), intent(in) :: subcomponent + character(len=16), dimension(:), pointer :: subpackages + select case (component) + case ('SIM') + subpackages => sim_idm_subpackages(subcomponent) + case ('GWF') + subpackages => gwf_idm_subpackages(subcomponent) + case ('GWT') + subpackages => gwt_idm_subpackages(subcomponent) + case ('GWE') + subpackages => gwe_idm_subpackages(subcomponent) + case ('SWF') + subpackages => swf_idm_subpackages(subcomponent) + case ('PRT') + subpackages => prt_idm_subpackages(subcomponent) + case ('EXG') + subpackages => exg_idm_subpackages(subcomponent) + case ('UTL') + subpackages => utl_idm_subpackages(subcomponent) + case default + call store_error('Idm selector component not found; '//& + &'component="'//trim(component)//& + &'", subcomponent="'//trim(subcomponent)//'".', .true.) + end select + return + end function idm_subpackages + function idm_integrated(component, subcomponent) result(integrated) character(len=*), intent(in) :: component character(len=*), intent(in) :: subcomponent diff --git a/src/Idm/selector/IdmExgDfnSelector.f90 b/src/Idm/selector/IdmExgDfnSelector.f90 index ac464834577..2ee06b14d09 100644 --- a/src/Idm/selector/IdmExgDfnSelector.f90 +++ b/src/Idm/selector/IdmExgDfnSelector.f90 @@ -19,6 +19,7 @@ module IdmExgDfnSelectorModule public :: exg_aggregate_definitions public :: exg_block_definitions public :: exg_idm_multi_package + public :: exg_idm_subpackages public :: exg_idm_integrated contains @@ -35,6 +36,12 @@ subroutine set_block_pointer(input_dfn, input_dfn_target) input_dfn => input_dfn_target end subroutine set_block_pointer + subroutine set_subpkg_pointer(subpkg_list, subpkg_list_target) + character(len=16), dimension(:), pointer :: subpkg_list + character(len=16), dimension(:), target :: subpkg_list_target + subpkg_list => subpkg_list_target + end subroutine set_subpkg_pointer + function exg_param_definitions(subcomponent) result(input_definition) character(len=*), intent(in) :: subcomponent type(InputParamDefinitionType), dimension(:), pointer :: input_definition @@ -133,6 +140,29 @@ function exg_idm_multi_package(subcomponent) result(multi_package) return end function exg_idm_multi_package + function exg_idm_subpackages(subcomponent) result(subpackages) + character(len=*), intent(in) :: subcomponent + character(len=16), dimension(:), pointer :: subpackages + select case (subcomponent) + case ('GWFGWF') + call set_subpkg_pointer(subpackages, exg_gwfgwf_subpackages) + case ('GWFGWT') + call set_subpkg_pointer(subpackages, exg_gwfgwt_subpackages) + case ('GWTGWT') + call set_subpkg_pointer(subpackages, exg_gwtgwt_subpackages) + case ('GWFGWE') + call set_subpkg_pointer(subpackages, exg_gwfgwe_subpackages) + case ('GWEGWE') + call set_subpkg_pointer(subpackages, exg_gwegwe_subpackages) + case ('SWFGWF') + call set_subpkg_pointer(subpackages, exg_swfgwf_subpackages) + case ('GWFPRT') + call set_subpkg_pointer(subpackages, exg_gwfprt_subpackages) + case default + end select + return + end function exg_idm_subpackages + function exg_idm_integrated(subcomponent) result(integrated) character(len=*), intent(in) :: subcomponent logical :: integrated diff --git a/src/Idm/selector/IdmGweDfnSelector.f90 b/src/Idm/selector/IdmGweDfnSelector.f90 index 780ee0d64a3..07200de48a0 100644 --- a/src/Idm/selector/IdmGweDfnSelector.f90 +++ b/src/Idm/selector/IdmGweDfnSelector.f90 @@ -19,6 +19,7 @@ module IdmGweDfnSelectorModule public :: gwe_aggregate_definitions public :: gwe_block_definitions public :: gwe_idm_multi_package + public :: gwe_idm_subpackages public :: gwe_idm_integrated contains @@ -35,6 +36,12 @@ subroutine set_block_pointer(input_dfn, input_dfn_target) input_dfn => input_dfn_target end subroutine set_block_pointer + subroutine set_subpkg_pointer(subpkg_list, subpkg_list_target) + character(len=16), dimension(:), pointer :: subpkg_list + character(len=16), dimension(:), target :: subpkg_list_target + subpkg_list => subpkg_list_target + end subroutine set_subpkg_pointer + function gwe_param_definitions(subcomponent) result(input_definition) character(len=*), intent(in) :: subcomponent type(InputParamDefinitionType), dimension(:), pointer :: input_definition @@ -133,6 +140,29 @@ function gwe_idm_multi_package(subcomponent) result(multi_package) return end function gwe_idm_multi_package + function gwe_idm_subpackages(subcomponent) result(subpackages) + character(len=*), intent(in) :: subcomponent + character(len=16), dimension(:), pointer :: subpackages + select case (subcomponent) + case ('NAM') + call set_subpkg_pointer(subpackages, gwe_nam_subpackages) + case ('IC') + call set_subpkg_pointer(subpackages, gwe_ic_subpackages) + case ('CTP') + call set_subpkg_pointer(subpackages, gwe_ctp_subpackages) + case ('CND') + call set_subpkg_pointer(subpackages, gwe_cnd_subpackages) + case ('DISV') + call set_subpkg_pointer(subpackages, gwe_disv_subpackages) + case ('DISU') + call set_subpkg_pointer(subpackages, gwe_disu_subpackages) + case ('DIS') + call set_subpkg_pointer(subpackages, gwe_dis_subpackages) + case default + end select + return + end function gwe_idm_subpackages + function gwe_idm_integrated(subcomponent) result(integrated) character(len=*), intent(in) :: subcomponent logical :: integrated diff --git a/src/Idm/selector/IdmGwfDfnSelector.f90 b/src/Idm/selector/IdmGwfDfnSelector.f90 index 2705775bac2..bf9998308c7 100644 --- a/src/Idm/selector/IdmGwfDfnSelector.f90 +++ b/src/Idm/selector/IdmGwfDfnSelector.f90 @@ -28,6 +28,7 @@ module IdmGwfDfnSelectorModule public :: gwf_aggregate_definitions public :: gwf_block_definitions public :: gwf_idm_multi_package + public :: gwf_idm_subpackages public :: gwf_idm_integrated contains @@ -44,6 +45,12 @@ subroutine set_block_pointer(input_dfn, input_dfn_target) input_dfn => input_dfn_target end subroutine set_block_pointer + subroutine set_subpkg_pointer(subpkg_list, subpkg_list_target) + character(len=16), dimension(:), pointer :: subpkg_list + character(len=16), dimension(:), target :: subpkg_list_target + subpkg_list => subpkg_list_target + end subroutine set_subpkg_pointer + function gwf_param_definitions(subcomponent) result(input_definition) character(len=*), intent(in) :: subcomponent type(InputParamDefinitionType), dimension(:), pointer :: input_definition @@ -214,6 +221,47 @@ function gwf_idm_multi_package(subcomponent) result(multi_package) return end function gwf_idm_multi_package + function gwf_idm_subpackages(subcomponent) result(subpackages) + character(len=*), intent(in) :: subcomponent + character(len=16), dimension(:), pointer :: subpackages + select case (subcomponent) + case ('NAM') + call set_subpkg_pointer(subpackages, gwf_nam_subpackages) + case ('CHD') + call set_subpkg_pointer(subpackages, gwf_chd_subpackages) + case ('DIS') + call set_subpkg_pointer(subpackages, gwf_dis_subpackages) + case ('DISU') + call set_subpkg_pointer(subpackages, gwf_disu_subpackages) + case ('DISV') + call set_subpkg_pointer(subpackages, gwf_disv_subpackages) + case ('DRN') + call set_subpkg_pointer(subpackages, gwf_drn_subpackages) + case ('EVT') + call set_subpkg_pointer(subpackages, gwf_evt_subpackages) + case ('EVTA') + call set_subpkg_pointer(subpackages, gwf_evta_subpackages) + case ('GHB') + call set_subpkg_pointer(subpackages, gwf_ghb_subpackages) + case ('IC') + call set_subpkg_pointer(subpackages, gwf_ic_subpackages) + case ('NPF') + call set_subpkg_pointer(subpackages, gwf_npf_subpackages) + case ('RCH') + call set_subpkg_pointer(subpackages, gwf_rch_subpackages) + case ('RCHA') + call set_subpkg_pointer(subpackages, gwf_rcha_subpackages) + case ('RIV') + call set_subpkg_pointer(subpackages, gwf_riv_subpackages) + case ('STO') + call set_subpkg_pointer(subpackages, gwf_sto_subpackages) + case ('WEL') + call set_subpkg_pointer(subpackages, gwf_wel_subpackages) + case default + end select + return + end function gwf_idm_subpackages + function gwf_idm_integrated(subcomponent) result(integrated) character(len=*), intent(in) :: subcomponent logical :: integrated diff --git a/src/Idm/selector/IdmGwtDfnSelector.f90 b/src/Idm/selector/IdmGwtDfnSelector.f90 index 8273f18a82a..c355e2c97ca 100644 --- a/src/Idm/selector/IdmGwtDfnSelector.f90 +++ b/src/Idm/selector/IdmGwtDfnSelector.f90 @@ -19,6 +19,7 @@ module IdmGwtDfnSelectorModule public :: gwt_aggregate_definitions public :: gwt_block_definitions public :: gwt_idm_multi_package + public :: gwt_idm_subpackages public :: gwt_idm_integrated contains @@ -35,6 +36,12 @@ subroutine set_block_pointer(input_dfn, input_dfn_target) input_dfn => input_dfn_target end subroutine set_block_pointer + subroutine set_subpkg_pointer(subpkg_list, subpkg_list_target) + character(len=16), dimension(:), pointer :: subpkg_list + character(len=16), dimension(:), target :: subpkg_list_target + subpkg_list => subpkg_list_target + end subroutine set_subpkg_pointer + function gwt_param_definitions(subcomponent) result(input_definition) character(len=*), intent(in) :: subcomponent type(InputParamDefinitionType), dimension(:), pointer :: input_definition @@ -133,6 +140,29 @@ function gwt_idm_multi_package(subcomponent) result(multi_package) return end function gwt_idm_multi_package + function gwt_idm_subpackages(subcomponent) result(subpackages) + character(len=*), intent(in) :: subcomponent + character(len=16), dimension(:), pointer :: subpackages + select case (subcomponent) + case ('NAM') + call set_subpkg_pointer(subpackages, gwt_nam_subpackages) + case ('DIS') + call set_subpkg_pointer(subpackages, gwt_dis_subpackages) + case ('DISU') + call set_subpkg_pointer(subpackages, gwt_disu_subpackages) + case ('DISV') + call set_subpkg_pointer(subpackages, gwt_disv_subpackages) + case ('DSP') + call set_subpkg_pointer(subpackages, gwt_dsp_subpackages) + case ('CNC') + call set_subpkg_pointer(subpackages, gwt_cnc_subpackages) + case ('IC') + call set_subpkg_pointer(subpackages, gwt_ic_subpackages) + case default + end select + return + end function gwt_idm_subpackages + function gwt_idm_integrated(subcomponent) result(integrated) character(len=*), intent(in) :: subcomponent logical :: integrated diff --git a/src/Idm/selector/IdmPrtDfnSelector.f90 b/src/Idm/selector/IdmPrtDfnSelector.f90 index 2a99cf6fca5..7b27b3f1ebd 100644 --- a/src/Idm/selector/IdmPrtDfnSelector.f90 +++ b/src/Idm/selector/IdmPrtDfnSelector.f90 @@ -16,6 +16,7 @@ module IdmPrtDfnSelectorModule public :: prt_aggregate_definitions public :: prt_block_definitions public :: prt_idm_multi_package + public :: prt_idm_subpackages public :: prt_idm_integrated contains @@ -32,6 +33,12 @@ subroutine set_block_pointer(input_dfn, input_dfn_target) input_dfn => input_dfn_target end subroutine set_block_pointer + subroutine set_subpkg_pointer(subpkg_list, subpkg_list_target) + character(len=16), dimension(:), pointer :: subpkg_list + character(len=16), dimension(:), target :: subpkg_list_target + subpkg_list => subpkg_list_target + end subroutine set_subpkg_pointer + function prt_param_definitions(subcomponent) result(input_definition) character(len=*), intent(in) :: subcomponent type(InputParamDefinitionType), dimension(:), pointer :: input_definition @@ -106,6 +113,23 @@ function prt_idm_multi_package(subcomponent) result(multi_package) return end function prt_idm_multi_package + function prt_idm_subpackages(subcomponent) result(subpackages) + character(len=*), intent(in) :: subcomponent + character(len=16), dimension(:), pointer :: subpackages + select case (subcomponent) + case ('NAM') + call set_subpkg_pointer(subpackages, prt_nam_subpackages) + case ('DIS') + call set_subpkg_pointer(subpackages, prt_dis_subpackages) + case ('DISV') + call set_subpkg_pointer(subpackages, prt_disv_subpackages) + case ('MIP') + call set_subpkg_pointer(subpackages, prt_mip_subpackages) + case default + end select + return + end function prt_idm_subpackages + function prt_idm_integrated(subcomponent) result(integrated) character(len=*), intent(in) :: subcomponent logical :: integrated diff --git a/src/Idm/selector/IdmSimDfnSelector.f90 b/src/Idm/selector/IdmSimDfnSelector.f90 index d5701798ccb..bf73857f93e 100644 --- a/src/Idm/selector/IdmSimDfnSelector.f90 +++ b/src/Idm/selector/IdmSimDfnSelector.f90 @@ -14,6 +14,7 @@ module IdmSimDfnSelectorModule public :: sim_aggregate_definitions public :: sim_block_definitions public :: sim_idm_multi_package + public :: sim_idm_subpackages public :: sim_idm_integrated contains @@ -30,6 +31,12 @@ subroutine set_block_pointer(input_dfn, input_dfn_target) input_dfn => input_dfn_target end subroutine set_block_pointer + subroutine set_subpkg_pointer(subpkg_list, subpkg_list_target) + character(len=16), dimension(:), pointer :: subpkg_list + character(len=16), dimension(:), target :: subpkg_list_target + subpkg_list => subpkg_list_target + end subroutine set_subpkg_pointer + function sim_param_definitions(subcomponent) result(input_definition) character(len=*), intent(in) :: subcomponent type(InputParamDefinitionType), dimension(:), pointer :: input_definition @@ -88,6 +95,19 @@ function sim_idm_multi_package(subcomponent) result(multi_package) return end function sim_idm_multi_package + function sim_idm_subpackages(subcomponent) result(subpackages) + character(len=*), intent(in) :: subcomponent + character(len=16), dimension(:), pointer :: subpackages + select case (subcomponent) + case ('NAM') + call set_subpkg_pointer(subpackages, sim_nam_subpackages) + case ('TDIS') + call set_subpkg_pointer(subpackages, sim_tdis_subpackages) + case default + end select + return + end function sim_idm_subpackages + function sim_idm_integrated(subcomponent) result(integrated) character(len=*), intent(in) :: subcomponent logical :: integrated diff --git a/src/Idm/selector/IdmSwfDfnSelector.f90 b/src/Idm/selector/IdmSwfDfnSelector.f90 index 30483461446..dd881700d1c 100644 --- a/src/Idm/selector/IdmSwfDfnSelector.f90 +++ b/src/Idm/selector/IdmSwfDfnSelector.f90 @@ -24,6 +24,7 @@ module IdmSwfDfnSelectorModule public :: swf_aggregate_definitions public :: swf_block_definitions public :: swf_idm_multi_package + public :: swf_idm_subpackages public :: swf_idm_integrated contains @@ -40,6 +41,12 @@ subroutine set_block_pointer(input_dfn, input_dfn_target) input_dfn => input_dfn_target end subroutine set_block_pointer + subroutine set_subpkg_pointer(subpkg_list, subpkg_list_target) + character(len=16), dimension(:), pointer :: subpkg_list + character(len=16), dimension(:), target :: subpkg_list_target + subpkg_list => subpkg_list_target + end subroutine set_subpkg_pointer + function swf_param_definitions(subcomponent) result(input_definition) character(len=*), intent(in) :: subcomponent type(InputParamDefinitionType), dimension(:), pointer :: input_definition @@ -178,6 +185,39 @@ function swf_idm_multi_package(subcomponent) result(multi_package) return end function swf_idm_multi_package + function swf_idm_subpackages(subcomponent) result(subpackages) + character(len=*), intent(in) :: subcomponent + character(len=16), dimension(:), pointer :: subpackages + select case (subcomponent) + case ('NAM') + call set_subpkg_pointer(subpackages, swf_nam_subpackages) + case ('DISV1D') + call set_subpkg_pointer(subpackages, swf_disv1d_subpackages) + case ('DIS2D') + call set_subpkg_pointer(subpackages, swf_dis2d_subpackages) + case ('DISV2D') + call set_subpkg_pointer(subpackages, swf_disv2d_subpackages) + case ('CXS') + call set_subpkg_pointer(subpackages, swf_cxs_subpackages) + case ('DFW') + call set_subpkg_pointer(subpackages, swf_dfw_subpackages) + case ('IC') + call set_subpkg_pointer(subpackages, swf_ic_subpackages) + case ('CDB') + call set_subpkg_pointer(subpackages, swf_cdb_subpackages) + case ('CHD') + call set_subpkg_pointer(subpackages, swf_chd_subpackages) + case ('FLW') + call set_subpkg_pointer(subpackages, swf_flw_subpackages) + case ('STO') + call set_subpkg_pointer(subpackages, swf_sto_subpackages) + case ('ZDG') + call set_subpkg_pointer(subpackages, swf_zdg_subpackages) + case default + end select + return + end function swf_idm_subpackages + function swf_idm_integrated(subcomponent) result(integrated) character(len=*), intent(in) :: subcomponent logical :: integrated diff --git a/src/Idm/selector/IdmUtlDfnSelector.f90 b/src/Idm/selector/IdmUtlDfnSelector.f90 index 1024107f7f1..1a3d125b206 100644 --- a/src/Idm/selector/IdmUtlDfnSelector.f90 +++ b/src/Idm/selector/IdmUtlDfnSelector.f90 @@ -6,6 +6,7 @@ module IdmUtlDfnSelectorModule use InputDefinitionModule, only: InputParamDefinitionType, & InputBlockDefinitionType use UtlHpcInputModule + use UtlNcfInputModule implicit none private @@ -13,6 +14,7 @@ module IdmUtlDfnSelectorModule public :: utl_aggregate_definitions public :: utl_block_definitions public :: utl_idm_multi_package + public :: utl_idm_subpackages public :: utl_idm_integrated contains @@ -29,6 +31,12 @@ subroutine set_block_pointer(input_dfn, input_dfn_target) input_dfn => input_dfn_target end subroutine set_block_pointer + subroutine set_subpkg_pointer(subpkg_list, subpkg_list_target) + character(len=16), dimension(:), pointer :: subpkg_list + character(len=16), dimension(:), target :: subpkg_list_target + subpkg_list => subpkg_list_target + end subroutine set_subpkg_pointer + function utl_param_definitions(subcomponent) result(input_definition) character(len=*), intent(in) :: subcomponent type(InputParamDefinitionType), dimension(:), pointer :: input_definition @@ -36,6 +44,8 @@ function utl_param_definitions(subcomponent) result(input_definition) select case (subcomponent) case ('HPC') call set_param_pointer(input_definition, utl_hpc_param_definitions) + case ('NCF') + call set_param_pointer(input_definition, utl_ncf_param_definitions) case default end select return @@ -48,6 +58,8 @@ function utl_aggregate_definitions(subcomponent) result(input_definition) select case (subcomponent) case ('HPC') call set_param_pointer(input_definition, utl_hpc_aggregate_definitions) + case ('NCF') + call set_param_pointer(input_definition, utl_ncf_aggregate_definitions) case default end select return @@ -60,6 +72,8 @@ function utl_block_definitions(subcomponent) result(input_definition) select case (subcomponent) case ('HPC') call set_block_pointer(input_definition, utl_hpc_block_definitions) + case ('NCF') + call set_block_pointer(input_definition, utl_ncf_block_definitions) case default end select return @@ -71,6 +85,8 @@ function utl_idm_multi_package(subcomponent) result(multi_package) select case (subcomponent) case ('HPC') multi_package = utl_hpc_multi_package + case ('NCF') + multi_package = utl_ncf_multi_package case default call store_error('Idm selector subcomponent not found; '//& &'component="UTL"'//& @@ -79,6 +95,19 @@ function utl_idm_multi_package(subcomponent) result(multi_package) return end function utl_idm_multi_package + function utl_idm_subpackages(subcomponent) result(subpackages) + character(len=*), intent(in) :: subcomponent + character(len=16), dimension(:), pointer :: subpackages + select case (subcomponent) + case ('HPC') + call set_subpkg_pointer(subpackages, utl_hpc_subpackages) + case ('NCF') + call set_subpkg_pointer(subpackages, utl_ncf_subpackages) + case default + end select + return + end function utl_idm_subpackages + function utl_idm_integrated(subcomponent) result(integrated) character(len=*), intent(in) :: subcomponent logical :: integrated @@ -86,6 +115,8 @@ function utl_idm_integrated(subcomponent) result(integrated) select case (subcomponent) case ('HPC') integrated = .true. + case ('NCF') + integrated = .true. case default end select return diff --git a/src/Idm/sim-namidm.f90 b/src/Idm/sim-namidm.f90 index 46c56aa221f..21d91522715 100644 --- a/src/Idm/sim-namidm.f90 +++ b/src/Idm/sim-namidm.f90 @@ -9,6 +9,7 @@ module SimNamInputModule public sim_nam_block_definitions public SimNamParamFoundType public sim_nam_multi_package + public sim_nam_subpackages type SimNamParamFoundType logical :: continue = .false. @@ -36,6 +37,12 @@ module SimNamInputModule logical :: sim_nam_multi_package = .false. + character(len=16), parameter :: & + sim_nam_subpackages(*) = & + [ & + ' ' & + ] + type(InputParamDefinitionType), parameter :: & simnam_continue = InputParamDefinitionType & ( & @@ -46,6 +53,7 @@ module SimNamInputModule 'CONTINUE', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'continue if not converged', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -63,6 +71,7 @@ module SimNamInputModule 'NOCHECK', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'turn off checking', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -80,6 +89,7 @@ module SimNamInputModule 'PRMEM', & ! fortran variable 'STRING', & ! type '', & ! shape + 'memory print option', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -97,6 +107,7 @@ module SimNamInputModule 'MAXERRORS', & ! fortran variable 'INTEGER', & ! type '', & ! shape + 'maximum number of errors', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -114,6 +125,7 @@ module SimNamInputModule 'PRINT_INPUT', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'print input to listing file', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -131,6 +143,7 @@ module SimNamInputModule 'HPC_FILERECORD', & ! fortran variable 'RECORD HPC6 FILEIN HPC6_FILENAME', & ! type '', & ! shape + '', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -148,6 +161,7 @@ module SimNamInputModule 'HPC6', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'head keyword', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -165,6 +179,7 @@ module SimNamInputModule 'FILEIN', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'file keyword', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -182,6 +197,7 @@ module SimNamInputModule 'HPC6_FILENAME', & ! fortran variable 'STRING', & ! type '', & ! shape + 'file name of time series information', & ! longname .true., & ! required .true., & ! multi-record .true., & ! preserve case @@ -199,6 +215,7 @@ module SimNamInputModule 'TDIS6', & ! fortran variable 'STRING', & ! type '', & ! shape + 'name of tdis input file', & ! longname .true., & ! required .false., & ! multi-record .true., & ! preserve case @@ -216,6 +233,7 @@ module SimNamInputModule 'MTYPE', & ! fortran variable 'STRING', & ! type '', & ! shape + 'model type', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -233,6 +251,7 @@ module SimNamInputModule 'MFNAME', & ! fortran variable 'STRING', & ! type '', & ! shape + 'file name for model name file', & ! longname .true., & ! required .true., & ! multi-record .true., & ! preserve case @@ -250,6 +269,7 @@ module SimNamInputModule 'MNAME', & ! fortran variable 'STRING', & ! type '', & ! shape + 'name of model', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -267,6 +287,7 @@ module SimNamInputModule 'EXGTYPE', & ! fortran variable 'STRING', & ! type '', & ! shape + 'exchange type', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -284,6 +305,7 @@ module SimNamInputModule 'EXGFILE', & ! fortran variable 'STRING', & ! type '', & ! shape + 'input file for exchange', & ! longname .true., & ! required .true., & ! multi-record .true., & ! preserve case @@ -301,6 +323,7 @@ module SimNamInputModule 'EXGMNAMEA', & ! fortran variable 'STRING', & ! type '', & ! shape + 'name of model A', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -318,6 +341,7 @@ module SimNamInputModule 'EXGMNAMEB', & ! fortran variable 'STRING', & ! type '', & ! shape + 'name of model B', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -335,6 +359,7 @@ module SimNamInputModule 'MXITER', & ! fortran variable 'INTEGER', & ! type '', & ! shape + 'maximum solution group iterations', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -352,6 +377,7 @@ module SimNamInputModule 'SLNTYPE', & ! fortran variable 'STRING', & ! type '', & ! shape + 'type of solution', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -369,6 +395,7 @@ module SimNamInputModule 'SLNFNAME', & ! fortran variable 'STRING', & ! type '', & ! shape + 'file name for solution input', & ! longname .true., & ! required .true., & ! multi-record .true., & ! preserve case @@ -386,6 +413,7 @@ module SimNamInputModule 'SLNMNAMES', & ! fortran variable 'STRING', & ! type ':', & ! shape + 'array of model names in this solution', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -429,6 +457,7 @@ module SimNamInputModule 'MODELS', & ! fortran variable 'RECARRAY MTYPE MFNAME MNAME', & ! type '', & ! shape + 'list of models', & ! longname .true., & ! required .false., & ! multi-record .false., & ! preserve case @@ -446,6 +475,7 @@ module SimNamInputModule 'EXCHANGES', & ! fortran variable 'RECARRAY EXGTYPE EXGFILE EXGMNAMEA EXGMNAMEB', & ! type '', & ! shape + 'list of exchanges', & ! longname .true., & ! required .false., & ! multi-record .false., & ! preserve case @@ -463,6 +493,7 @@ module SimNamInputModule 'SOLUTIONGROUP', & ! fortran variable 'RECARRAY SLNTYPE SLNFNAME SLNMNAMES', & ! type '', & ! shape + 'solution type and models in the solution', & ! longname .true., & ! required .false., & ! multi-record .false., & ! preserve case diff --git a/src/Idm/sim-tdisidm.f90 b/src/Idm/sim-tdisidm.f90 index e5de3a1787f..c05265133bc 100644 --- a/src/Idm/sim-tdisidm.f90 +++ b/src/Idm/sim-tdisidm.f90 @@ -9,6 +9,7 @@ module SimTdisInputModule public sim_tdis_block_definitions public SimTdisParamFoundType public sim_tdis_multi_package + public sim_tdis_subpackages type SimTdisParamFoundType logical :: time_units = .false. @@ -25,6 +26,12 @@ module SimTdisInputModule logical :: sim_tdis_multi_package = .false. + character(len=16), parameter :: & + sim_tdis_subpackages(*) = & + [ & + ' ' & + ] + type(InputParamDefinitionType), parameter :: & simtdis_time_units = InputParamDefinitionType & ( & @@ -35,6 +42,7 @@ module SimTdisInputModule 'TIME_UNITS', & ! fortran variable 'STRING', & ! type '', & ! shape + 'time unit', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -52,6 +60,7 @@ module SimTdisInputModule 'START_DATE_TIME', & ! fortran variable 'STRING', & ! type '', & ! shape + 'starting date and time', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -69,6 +78,7 @@ module SimTdisInputModule 'ATS_FILERECORD', & ! fortran variable 'RECORD ATS6 FILEIN ATS6_FILENAME', & ! type '', & ! shape + '', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -86,6 +96,7 @@ module SimTdisInputModule 'ATS6', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'ats keyword', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -103,6 +114,7 @@ module SimTdisInputModule 'FILEIN', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'file keyword', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -120,6 +132,7 @@ module SimTdisInputModule 'ATS6_FILENAME', & ! fortran variable 'STRING', & ! type '', & ! shape + 'file name of adaptive time series information', & ! longname .true., & ! required .true., & ! multi-record .true., & ! preserve case @@ -137,6 +150,7 @@ module SimTdisInputModule 'NPER', & ! fortran variable 'INTEGER', & ! type '', & ! shape + 'number of stress periods', & ! longname .true., & ! required .false., & ! multi-record .false., & ! preserve case @@ -154,6 +168,7 @@ module SimTdisInputModule 'PERLEN', & ! fortran variable 'DOUBLE', & ! type '', & ! shape + 'length of stress period', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -171,6 +186,7 @@ module SimTdisInputModule 'NSTP', & ! fortran variable 'INTEGER', & ! type '', & ! shape + 'number of time steps', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -188,6 +204,7 @@ module SimTdisInputModule 'TSMULT', & ! fortran variable 'DOUBLE', & ! type '', & ! shape + 'number of time steps', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -220,6 +237,7 @@ module SimTdisInputModule 'PERIODDATA', & ! fortran variable 'RECARRAY PERLEN NSTP TSMULT', & ! type '', & ! shape + 'stress period time information', & ! longname .true., & ! required .false., & ! multi-record .false., & ! preserve case diff --git a/src/Idm/swf-cdbidm.f90 b/src/Idm/swf-cdbidm.f90 index 6ecfa6ad2b2..b065457cca3 100644 --- a/src/Idm/swf-cdbidm.f90 +++ b/src/Idm/swf-cdbidm.f90 @@ -9,6 +9,7 @@ module SwfCdbInputModule public swf_cdb_block_definitions public SwfCdbParamFoundType public swf_cdb_multi_package + public swf_cdb_subpackages type SwfCdbParamFoundType logical :: auxiliary = .false. @@ -30,6 +31,12 @@ module SwfCdbInputModule logical :: swf_cdb_multi_package = .true. + character(len=16), parameter :: & + swf_cdb_subpackages(*) = & + [ & + ' ' & + ] + type(InputParamDefinitionType), parameter :: & swfcdb_auxiliary = InputParamDefinitionType & ( & @@ -40,6 +47,7 @@ module SwfCdbInputModule 'AUXILIARY', & ! fortran variable 'STRING', & ! type 'NAUX', & ! shape + 'keyword to specify aux variables', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -57,6 +65,7 @@ module SwfCdbInputModule 'BOUNDNAMES', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + '', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -74,6 +83,7 @@ module SwfCdbInputModule 'IPRPAK', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'print input to listing file', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -91,6 +101,7 @@ module SwfCdbInputModule 'IPRFLOW', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'print calculated flows to listing file', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -108,6 +119,7 @@ module SwfCdbInputModule 'IPAKCB', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'save flows to budget file', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -125,6 +137,7 @@ module SwfCdbInputModule 'FILEIN', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'file keyword', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -142,6 +155,7 @@ module SwfCdbInputModule 'OBS_FILERECORD', & ! fortran variable 'RECORD OBS6 FILEIN OBS6_FILENAME', & ! type '', & ! shape + '', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -159,6 +173,7 @@ module SwfCdbInputModule 'OBS6', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'obs keyword', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -176,6 +191,7 @@ module SwfCdbInputModule 'OBS6_FILENAME', & ! fortran variable 'STRING', & ! type '', & ! shape + 'obs6 input filename', & ! longname .true., & ! required .true., & ! multi-record .true., & ! preserve case @@ -193,6 +209,7 @@ module SwfCdbInputModule 'MAXBOUND', & ! fortran variable 'INTEGER', & ! type '', & ! shape + 'maximum number of critical depth boundaries', & ! longname .true., & ! required .false., & ! multi-record .false., & ! preserve case @@ -210,6 +227,7 @@ module SwfCdbInputModule 'CELLID', & ! fortran variable 'INTEGER1D', & ! type 'NCELLDIM', & ! shape + 'cell identifier', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -227,6 +245,7 @@ module SwfCdbInputModule 'IDCXS', & ! fortran variable 'INTEGER', & ! type '', & ! shape + 'cross section identifier', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -244,6 +263,7 @@ module SwfCdbInputModule 'WIDTH', & ! fortran variable 'DOUBLE', & ! type '', & ! shape + 'width of the zero-depth gradient boundary', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -261,6 +281,7 @@ module SwfCdbInputModule 'AUXVAR', & ! fortran variable 'DOUBLE1D', & ! type 'NAUX', & ! shape + 'auxiliary variables', & ! longname .false., & ! required .true., & ! multi-record .false., & ! preserve case @@ -278,6 +299,7 @@ module SwfCdbInputModule 'BOUNDNAME', & ! fortran variable 'STRING', & ! type '', & ! shape + 'zero-depth-gradient boundary name', & ! longname .false., & ! required .true., & ! multi-record .false., & ! preserve case @@ -315,6 +337,7 @@ module SwfCdbInputModule 'SPD', & ! fortran variable 'RECARRAY CELLID IDCXS WIDTH AUX BOUNDNAME', & ! type 'MAXBOUND', & ! shape + '', & ! longname .true., & ! required .false., & ! multi-record .false., & ! preserve case diff --git a/src/Idm/swf-chdidm.f90 b/src/Idm/swf-chdidm.f90 index 69b1de85564..c43323f340a 100644 --- a/src/Idm/swf-chdidm.f90 +++ b/src/Idm/swf-chdidm.f90 @@ -9,6 +9,7 @@ module SwfChdInputModule public swf_chd_block_definitions public SwfChdParamFoundType public swf_chd_multi_package + public swf_chd_subpackages type SwfChdParamFoundType logical :: auxiliary = .false. @@ -33,6 +34,12 @@ module SwfChdInputModule logical :: swf_chd_multi_package = .true. + character(len=16), parameter :: & + swf_chd_subpackages(*) = & + [ & + ' ' & + ] + type(InputParamDefinitionType), parameter :: & swfchd_auxiliary = InputParamDefinitionType & ( & @@ -43,6 +50,7 @@ module SwfChdInputModule 'AUXILIARY', & ! fortran variable 'STRING', & ! type 'NAUX', & ! shape + 'keyword to specify aux variables', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -60,6 +68,7 @@ module SwfChdInputModule 'AUXMULTNAME', & ! fortran variable 'STRING', & ! type '', & ! shape + 'name of auxiliary variable for multiplier', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -77,6 +86,7 @@ module SwfChdInputModule 'BOUNDNAMES', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + '', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -94,6 +104,7 @@ module SwfChdInputModule 'PRINT_INPUT', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'print input to listing file', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -111,6 +122,7 @@ module SwfChdInputModule 'PRINT_FLOWS', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'print CHD flows to listing file', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -128,6 +140,7 @@ module SwfChdInputModule 'SAVE_FLOWS', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'save CHD flows to budget file', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -145,6 +158,7 @@ module SwfChdInputModule 'TS_FILERECORD', & ! fortran variable 'RECORD TS6 FILEIN TS6_FILENAME', & ! type '', & ! shape + '', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -162,6 +176,7 @@ module SwfChdInputModule 'TS6', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'head keyword', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -179,6 +194,7 @@ module SwfChdInputModule 'FILEIN', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'file keyword', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -196,6 +212,7 @@ module SwfChdInputModule 'TS6_FILENAME', & ! fortran variable 'STRING', & ! type '', & ! shape + 'file name of time series information', & ! longname .true., & ! required .true., & ! multi-record .true., & ! preserve case @@ -213,6 +230,7 @@ module SwfChdInputModule 'OBS_FILERECORD', & ! fortran variable 'RECORD OBS6 FILEIN OBS6_FILENAME', & ! type '', & ! shape + '', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -230,6 +248,7 @@ module SwfChdInputModule 'OBS6', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'obs keyword', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -247,6 +266,7 @@ module SwfChdInputModule 'OBS6_FILENAME', & ! fortran variable 'STRING', & ! type '', & ! shape + 'obs6 input filename', & ! longname .true., & ! required .true., & ! multi-record .true., & ! preserve case @@ -264,6 +284,7 @@ module SwfChdInputModule 'MAXBOUND', & ! fortran variable 'INTEGER', & ! type '', & ! shape + 'maximum number of constant heads', & ! longname .true., & ! required .false., & ! multi-record .false., & ! preserve case @@ -281,6 +302,7 @@ module SwfChdInputModule 'CELLID', & ! fortran variable 'INTEGER1D', & ! type 'NCELLDIM', & ! shape + 'cell identifier', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -298,6 +320,7 @@ module SwfChdInputModule 'HEAD', & ! fortran variable 'DOUBLE', & ! type '', & ! shape + 'head value assigned to constant head', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -315,6 +338,7 @@ module SwfChdInputModule 'AUX', & ! fortran variable 'DOUBLE1D', & ! type 'NAUX', & ! shape + 'auxiliary variables', & ! longname .false., & ! required .true., & ! multi-record .false., & ! preserve case @@ -332,6 +356,7 @@ module SwfChdInputModule 'BOUNDNAME', & ! fortran variable 'STRING', & ! type '', & ! shape + 'constant head boundary name', & ! longname .false., & ! required .true., & ! multi-record .false., & ! preserve case @@ -372,6 +397,7 @@ module SwfChdInputModule 'SPD', & ! fortran variable 'RECARRAY CELLID HEAD AUX BOUNDNAME', & ! type 'MAXBOUND', & ! shape + '', & ! longname .true., & ! required .false., & ! multi-record .false., & ! preserve case diff --git a/src/Idm/swf-cxsidm.f90 b/src/Idm/swf-cxsidm.f90 index 987e897a8f0..a0be93fbbe9 100644 --- a/src/Idm/swf-cxsidm.f90 +++ b/src/Idm/swf-cxsidm.f90 @@ -9,6 +9,7 @@ module SwfCxsInputModule public swf_cxs_block_definitions public SwfCxsParamFoundType public swf_cxs_multi_package + public swf_cxs_subpackages type SwfCxsParamFoundType logical :: iprpak = .false. @@ -23,6 +24,12 @@ module SwfCxsInputModule logical :: swf_cxs_multi_package = .false. + character(len=16), parameter :: & + swf_cxs_subpackages(*) = & + [ & + ' ' & + ] + type(InputParamDefinitionType), parameter :: & swfcxs_iprpak = InputParamDefinitionType & ( & @@ -33,6 +40,7 @@ module SwfCxsInputModule 'IPRPAK', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'print input to listing file', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -50,6 +58,7 @@ module SwfCxsInputModule 'NSECTIONS', & ! fortran variable 'INTEGER', & ! type '', & ! shape + 'number of reaches', & ! longname .true., & ! required .false., & ! multi-record .false., & ! preserve case @@ -67,6 +76,7 @@ module SwfCxsInputModule 'NPOINTS', & ! fortran variable 'INTEGER', & ! type '', & ! shape + 'total number of points defined for all reaches', & ! longname .true., & ! required .false., & ! multi-record .false., & ! preserve case @@ -84,6 +94,7 @@ module SwfCxsInputModule 'IDCXS', & ! fortran variable 'INTEGER', & ! type '', & ! shape + 'reach number for this entry', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -101,6 +112,7 @@ module SwfCxsInputModule 'NXSPOINTS', & ! fortran variable 'INTEGER', & ! type '', & ! shape + 'number of points used to define cross section', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -118,6 +130,7 @@ module SwfCxsInputModule 'XFRACTION', & ! fortran variable 'DOUBLE', & ! type '', & ! shape + 'fractional width', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -135,6 +148,7 @@ module SwfCxsInputModule 'HEIGHT', & ! fortran variable 'DOUBLE', & ! type '', & ! shape + 'depth', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -152,6 +166,7 @@ module SwfCxsInputModule 'MANFRACTION', & ! fortran variable 'DOUBLE', & ! type '', & ! shape + 'Mannings roughness coefficient', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -182,6 +197,7 @@ module SwfCxsInputModule 'PACKAGEDATA', & ! fortran variable 'RECARRAY IDCXS NXSPOINTS', & ! type 'NSECTIONS', & ! shape + '', & ! longname .true., & ! required .false., & ! multi-record .false., & ! preserve case @@ -199,6 +215,7 @@ module SwfCxsInputModule 'CROSSSECTIONDATA', & ! fortran variable 'RECARRAY XFRACTION HEIGHT MANFRACTION', & ! type 'NPOINTS', & ! shape + '', & ! longname .true., & ! required .false., & ! multi-record .false., & ! preserve case diff --git a/src/Idm/swf-dfwidm.f90 b/src/Idm/swf-dfwidm.f90 index 75b9692fd2e..fc4d5344054 100644 --- a/src/Idm/swf-dfwidm.f90 +++ b/src/Idm/swf-dfwidm.f90 @@ -9,6 +9,7 @@ module SwfDfwInputModule public swf_dfw_block_definitions public SwfDfwParamFoundType public swf_dfw_multi_package + public swf_dfw_subpackages type SwfDfwParamFoundType logical :: icentral = .false. @@ -29,6 +30,12 @@ module SwfDfwInputModule logical :: swf_dfw_multi_package = .false. + character(len=16), parameter :: & + swf_dfw_subpackages(*) = & + [ & + ' ' & + ] + type(InputParamDefinitionType), parameter :: & swfdfw_icentral = InputParamDefinitionType & ( & @@ -39,6 +46,7 @@ module SwfDfwInputModule 'ICENTRAL', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'use central in space weighting', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -56,6 +64,7 @@ module SwfDfwInputModule 'LENGTHCONV', & ! fortran variable 'DOUBLE', & ! type '', & ! shape + 'length conversion factor', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -73,6 +82,7 @@ module SwfDfwInputModule 'TIMECONV', & ! fortran variable 'DOUBLE', & ! type '', & ! shape + 'time conversion factor', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -90,6 +100,7 @@ module SwfDfwInputModule 'IPAKCB', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'keyword to save DFW flows', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -107,6 +118,7 @@ module SwfDfwInputModule 'IPRFLOW', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'keyword to print DFW flows to listing file', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -124,6 +136,7 @@ module SwfDfwInputModule 'ISAVVELOCITY', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'keyword to save velocity', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -141,6 +154,7 @@ module SwfDfwInputModule 'OBS_FILERECORD', & ! fortran variable 'RECORD OBS6 FILEIN OBS6_FILENAME', & ! type '', & ! shape + '', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -158,6 +172,7 @@ module SwfDfwInputModule 'OBS6', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'obs keyword', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -175,6 +190,7 @@ module SwfDfwInputModule 'FILEIN', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'file keyword', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -192,6 +208,7 @@ module SwfDfwInputModule 'OBS6_FILENAME', & ! fortran variable 'STRING', & ! type '', & ! shape + 'obs6 input filename', & ! longname .true., & ! required .true., & ! multi-record .true., & ! preserve case @@ -209,6 +226,7 @@ module SwfDfwInputModule 'EXPORT_ASCII', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'export array variables to layered ascii files.', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -226,6 +244,7 @@ module SwfDfwInputModule 'ISWRCOND', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'use SWR conductance formulation', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -243,6 +262,7 @@ module SwfDfwInputModule 'MANNINGSN', & ! fortran variable 'DOUBLE1D', & ! type 'NODES', & ! shape + 'mannings roughness coefficient', & ! longname .true., & ! required .false., & ! multi-record .false., & ! preserve case @@ -260,6 +280,7 @@ module SwfDfwInputModule 'IDCXS', & ! fortran variable 'INTEGER1D', & ! type 'NODES', & ! shape + 'cross section number', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -298,6 +319,7 @@ module SwfDfwInputModule '', & ! fortran variable '', & ! type '', & ! shape + '', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case diff --git a/src/Idm/swf-dis2didm.f90 b/src/Idm/swf-dis2didm.f90 index 38857f34ab8..f46547a178c 100644 --- a/src/Idm/swf-dis2didm.f90 +++ b/src/Idm/swf-dis2didm.f90 @@ -9,6 +9,7 @@ module SwfDis2DInputModule public swf_dis2d_block_definitions public SwfDis2dParamFoundType public swf_dis2d_multi_package + public swf_dis2d_subpackages type SwfDis2dParamFoundType logical :: length_units = .false. @@ -27,6 +28,12 @@ module SwfDis2DInputModule logical :: swf_dis2d_multi_package = .false. + character(len=16), parameter :: & + swf_dis2d_subpackages(*) = & + [ & + ' ' & + ] + type(InputParamDefinitionType), parameter :: & swfdis2d_length_units = InputParamDefinitionType & ( & @@ -37,6 +44,7 @@ module SwfDis2DInputModule 'LENGTH_UNITS', & ! fortran variable 'STRING', & ! type '', & ! shape + 'model length units', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -54,6 +62,7 @@ module SwfDis2DInputModule 'NOGRB', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'do not write binary grid file', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -71,6 +80,7 @@ module SwfDis2DInputModule 'XORIGIN', & ! fortran variable 'DOUBLE', & ! type '', & ! shape + 'x-position of the model grid origin', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -88,6 +98,7 @@ module SwfDis2DInputModule 'YORIGIN', & ! fortran variable 'DOUBLE', & ! type '', & ! shape + 'y-position of the model grid origin', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -105,6 +116,7 @@ module SwfDis2DInputModule 'ANGROT', & ! fortran variable 'DOUBLE', & ! type '', & ! shape + 'rotation angle', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -122,6 +134,7 @@ module SwfDis2DInputModule 'EXPORT_ASCII', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'export array variables to layered ascii files.', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -139,6 +152,7 @@ module SwfDis2DInputModule 'NROW', & ! fortran variable 'INTEGER', & ! type '', & ! shape + 'number of rows', & ! longname .true., & ! required .false., & ! multi-record .false., & ! preserve case @@ -156,6 +170,7 @@ module SwfDis2DInputModule 'NCOL', & ! fortran variable 'INTEGER', & ! type '', & ! shape + 'number of columns', & ! longname .true., & ! required .false., & ! multi-record .false., & ! preserve case @@ -173,6 +188,7 @@ module SwfDis2DInputModule 'DELR', & ! fortran variable 'DOUBLE1D', & ! type 'NCOL', & ! shape + 'spacing along a row', & ! longname .true., & ! required .false., & ! multi-record .false., & ! preserve case @@ -190,6 +206,7 @@ module SwfDis2DInputModule 'DELC', & ! fortran variable 'DOUBLE1D', & ! type 'NROW', & ! shape + 'spacing along a column', & ! longname .true., & ! required .false., & ! multi-record .false., & ! preserve case @@ -207,6 +224,7 @@ module SwfDis2DInputModule 'BOTM', & ! fortran variable 'DOUBLE2D', & ! type 'NCOL NROW', & ! shape + 'cell bottom elevation', & ! longname .true., & ! required .false., & ! multi-record .false., & ! preserve case @@ -224,6 +242,7 @@ module SwfDis2DInputModule 'IDOMAIN', & ! fortran variable 'INTEGER2D', & ! type 'NCOL NROW', & ! shape + 'idomain existence array', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -260,6 +279,7 @@ module SwfDis2DInputModule '', & ! fortran variable '', & ! type '', & ! shape + '', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case diff --git a/src/Idm/swf-disidm.f90 b/src/Idm/swf-disidm.f90 deleted file mode 100644 index 1433a6bf4bc..00000000000 --- a/src/Idm/swf-disidm.f90 +++ /dev/null @@ -1,332 +0,0 @@ -! ** Do Not Modify! MODFLOW 6 system generated file. ** -module SwfDisInputModule - use ConstantsModule, only: LENVARNAME - use InputDefinitionModule, only: InputParamDefinitionType, & - InputBlockDefinitionType - private - public swf_dis_param_definitions - public swf_dis_aggregate_definitions - public swf_dis_block_definitions - public SwfDisParamFoundType - public swf_dis_multi_package - - type SwfDisParamFoundType - logical :: length_units = .false. - logical :: nogrb = .false. - logical :: xorigin = .false. - logical :: yorigin = .false. - logical :: angrot = .false. - logical :: export_ascii = .false. - logical :: nlay = .false. - logical :: nrow = .false. - logical :: ncol = .false. - logical :: delr = .false. - logical :: delc = .false. - logical :: top = .false. - logical :: botm = .false. - logical :: idomain = .false. - end type SwfDisParamFoundType - - logical :: swf_dis_multi_package = .false. - - type(InputParamDefinitionType), parameter :: & - swfdis_length_units = InputParamDefinitionType & - ( & - 'SWF', & ! component - 'DIS', & ! subcomponent - 'OPTIONS', & ! block - 'LENGTH_UNITS', & ! tag name - 'LENGTH_UNITS', & ! fortran variable - 'STRING', & ! type - '', & ! shape - .false., & ! required - .false., & ! multi-record - .false., & ! preserve case - .false., & ! layered - .false. & ! timeseries - ) - - type(InputParamDefinitionType), parameter :: & - swfdis_nogrb = InputParamDefinitionType & - ( & - 'SWF', & ! component - 'DIS', & ! subcomponent - 'OPTIONS', & ! block - 'NOGRB', & ! tag name - 'NOGRB', & ! fortran variable - 'KEYWORD', & ! type - '', & ! shape - .false., & ! required - .false., & ! multi-record - .false., & ! preserve case - .false., & ! layered - .false. & ! timeseries - ) - - type(InputParamDefinitionType), parameter :: & - swfdis_xorigin = InputParamDefinitionType & - ( & - 'SWF', & ! component - 'DIS', & ! subcomponent - 'OPTIONS', & ! block - 'XORIGIN', & ! tag name - 'XORIGIN', & ! fortran variable - 'DOUBLE', & ! type - '', & ! shape - .false., & ! required - .false., & ! multi-record - .false., & ! preserve case - .false., & ! layered - .false. & ! timeseries - ) - - type(InputParamDefinitionType), parameter :: & - swfdis_yorigin = InputParamDefinitionType & - ( & - 'SWF', & ! component - 'DIS', & ! subcomponent - 'OPTIONS', & ! block - 'YORIGIN', & ! tag name - 'YORIGIN', & ! fortran variable - 'DOUBLE', & ! type - '', & ! shape - .false., & ! required - .false., & ! multi-record - .false., & ! preserve case - .false., & ! layered - .false. & ! timeseries - ) - - type(InputParamDefinitionType), parameter :: & - swfdis_angrot = InputParamDefinitionType & - ( & - 'SWF', & ! component - 'DIS', & ! subcomponent - 'OPTIONS', & ! block - 'ANGROT', & ! tag name - 'ANGROT', & ! fortran variable - 'DOUBLE', & ! type - '', & ! shape - .false., & ! required - .false., & ! multi-record - .false., & ! preserve case - .false., & ! layered - .false. & ! timeseries - ) - - type(InputParamDefinitionType), parameter :: & - swfdis_export_ascii = InputParamDefinitionType & - ( & - 'SWF', & ! component - 'DIS', & ! subcomponent - 'OPTIONS', & ! block - 'EXPORT_ARRAY_ASCII', & ! tag name - 'EXPORT_ASCII', & ! fortran variable - 'KEYWORD', & ! type - '', & ! shape - .false., & ! required - .false., & ! multi-record - .false., & ! preserve case - .false., & ! layered - .false. & ! timeseries - ) - - type(InputParamDefinitionType), parameter :: & - swfdis_nlay = InputParamDefinitionType & - ( & - 'SWF', & ! component - 'DIS', & ! subcomponent - 'DIMENSIONS', & ! block - 'NLAY', & ! tag name - 'NLAY', & ! fortran variable - 'INTEGER', & ! type - '', & ! shape - .true., & ! required - .false., & ! multi-record - .false., & ! preserve case - .false., & ! layered - .false. & ! timeseries - ) - - type(InputParamDefinitionType), parameter :: & - swfdis_nrow = InputParamDefinitionType & - ( & - 'SWF', & ! component - 'DIS', & ! subcomponent - 'DIMENSIONS', & ! block - 'NROW', & ! tag name - 'NROW', & ! fortran variable - 'INTEGER', & ! type - '', & ! shape - .true., & ! required - .false., & ! multi-record - .false., & ! preserve case - .false., & ! layered - .false. & ! timeseries - ) - - type(InputParamDefinitionType), parameter :: & - swfdis_ncol = InputParamDefinitionType & - ( & - 'SWF', & ! component - 'DIS', & ! subcomponent - 'DIMENSIONS', & ! block - 'NCOL', & ! tag name - 'NCOL', & ! fortran variable - 'INTEGER', & ! type - '', & ! shape - .true., & ! required - .false., & ! multi-record - .false., & ! preserve case - .false., & ! layered - .false. & ! timeseries - ) - - type(InputParamDefinitionType), parameter :: & - swfdis_delr = InputParamDefinitionType & - ( & - 'SWF', & ! component - 'DIS', & ! subcomponent - 'GRIDDATA', & ! block - 'DELR', & ! tag name - 'DELR', & ! fortran variable - 'DOUBLE1D', & ! type - 'NCOL', & ! shape - .true., & ! required - .false., & ! multi-record - .false., & ! preserve case - .false., & ! layered - .false. & ! timeseries - ) - - type(InputParamDefinitionType), parameter :: & - swfdis_delc = InputParamDefinitionType & - ( & - 'SWF', & ! component - 'DIS', & ! subcomponent - 'GRIDDATA', & ! block - 'DELC', & ! tag name - 'DELC', & ! fortran variable - 'DOUBLE1D', & ! type - 'NROW', & ! shape - .true., & ! required - .false., & ! multi-record - .false., & ! preserve case - .false., & ! layered - .false. & ! timeseries - ) - - type(InputParamDefinitionType), parameter :: & - swfdis_top = InputParamDefinitionType & - ( & - 'SWF', & ! component - 'DIS', & ! subcomponent - 'GRIDDATA', & ! block - 'TOP', & ! tag name - 'TOP', & ! fortran variable - 'DOUBLE2D', & ! type - 'NCOL NROW', & ! shape - .true., & ! required - .false., & ! multi-record - .false., & ! preserve case - .false., & ! layered - .false. & ! timeseries - ) - - type(InputParamDefinitionType), parameter :: & - swfdis_botm = InputParamDefinitionType & - ( & - 'SWF', & ! component - 'DIS', & ! subcomponent - 'GRIDDATA', & ! block - 'BOTM', & ! tag name - 'BOTM', & ! fortran variable - 'DOUBLE3D', & ! type - 'NCOL NROW NLAY', & ! shape - .true., & ! required - .false., & ! multi-record - .false., & ! preserve case - .true., & ! layered - .false. & ! timeseries - ) - - type(InputParamDefinitionType), parameter :: & - swfdis_idomain = InputParamDefinitionType & - ( & - 'SWF', & ! component - 'DIS', & ! subcomponent - 'GRIDDATA', & ! block - 'IDOMAIN', & ! tag name - 'IDOMAIN', & ! fortran variable - 'INTEGER3D', & ! type - 'NCOL NROW NLAY', & ! shape - .false., & ! required - .false., & ! multi-record - .false., & ! preserve case - .true., & ! layered - .false. & ! timeseries - ) - - type(InputParamDefinitionType), parameter :: & - swf_dis_param_definitions(*) = & - [ & - swfdis_length_units, & - swfdis_nogrb, & - swfdis_xorigin, & - swfdis_yorigin, & - swfdis_angrot, & - swfdis_export_ascii, & - swfdis_nlay, & - swfdis_nrow, & - swfdis_ncol, & - swfdis_delr, & - swfdis_delc, & - swfdis_top, & - swfdis_botm, & - swfdis_idomain & - ] - - type(InputParamDefinitionType), parameter :: & - swf_dis_aggregate_definitions(*) = & - [ & - InputParamDefinitionType & - ( & - '', & ! component - '', & ! subcomponent - '', & ! block - '', & ! tag name - '', & ! fortran variable - '', & ! type - '', & ! shape - .false., & ! required - .false., & ! multi-record - .false., & ! preserve case - .false., & ! layered - .false. & ! timeseries - ) & - ] - - type(InputBlockDefinitionType), parameter :: & - swf_dis_block_definitions(*) = & - [ & - InputBlockDefinitionType( & - 'OPTIONS', & ! blockname - .false., & ! required - .false., & ! aggregate - .false. & ! block_variable - ), & - InputBlockDefinitionType( & - 'DIMENSIONS', & ! blockname - .true., & ! required - .false., & ! aggregate - .false. & ! block_variable - ), & - InputBlockDefinitionType( & - 'GRIDDATA', & ! blockname - .true., & ! required - .false., & ! aggregate - .false. & ! block_variable - ) & - ] - -end module SwfDisInputModule diff --git a/src/Idm/swf-disv1didm.f90 b/src/Idm/swf-disv1didm.f90 index 3534fe20b3c..8ac4c5119e0 100644 --- a/src/Idm/swf-disv1didm.f90 +++ b/src/Idm/swf-disv1didm.f90 @@ -9,6 +9,7 @@ module SwfDisv1DInputModule public swf_disv1d_block_definitions public SwfDisv1dParamFoundType public swf_disv1d_multi_package + public swf_disv1d_subpackages type SwfDisv1dParamFoundType logical :: length_units = .false. @@ -34,6 +35,12 @@ module SwfDisv1DInputModule logical :: swf_disv1d_multi_package = .false. + character(len=16), parameter :: & + swf_disv1d_subpackages(*) = & + [ & + ' ' & + ] + type(InputParamDefinitionType), parameter :: & swfdisv1d_length_units = InputParamDefinitionType & ( & @@ -44,6 +51,7 @@ module SwfDisv1DInputModule 'LENGTH_UNITS', & ! fortran variable 'STRING', & ! type '', & ! shape + 'model length units', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -61,6 +69,7 @@ module SwfDisv1DInputModule 'NOGRB', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'do not write binary grid file', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -78,6 +87,7 @@ module SwfDisv1DInputModule 'XORIGIN', & ! fortran variable 'DOUBLE', & ! type '', & ! shape + 'x-position origin of the model grid coordinate system', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -95,6 +105,7 @@ module SwfDisv1DInputModule 'YORIGIN', & ! fortran variable 'DOUBLE', & ! type '', & ! shape + 'y-position origin of the model grid coordinate system', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -112,6 +123,7 @@ module SwfDisv1DInputModule 'ANGROT', & ! fortran variable 'DOUBLE', & ! type '', & ! shape + 'rotation angle', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -129,6 +141,7 @@ module SwfDisv1DInputModule 'EXPORT_ASCII', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'export array variables to layered ascii files.', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -146,6 +159,7 @@ module SwfDisv1DInputModule 'NODES', & ! fortran variable 'INTEGER', & ! type '', & ! shape + 'number of linear features', & ! longname .true., & ! required .false., & ! multi-record .false., & ! preserve case @@ -163,6 +177,7 @@ module SwfDisv1DInputModule 'NVERT', & ! fortran variable 'INTEGER', & ! type '', & ! shape + 'number of columns', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -180,6 +195,7 @@ module SwfDisv1DInputModule 'LENGTH', & ! fortran variable 'DOUBLE1D', & ! type 'NODES', & ! shape + 'length', & ! longname .true., & ! required .false., & ! multi-record .false., & ! preserve case @@ -197,6 +213,7 @@ module SwfDisv1DInputModule 'WIDTH', & ! fortran variable 'DOUBLE1D', & ! type 'NODES', & ! shape + 'width', & ! longname .true., & ! required .false., & ! multi-record .false., & ! preserve case @@ -214,6 +231,7 @@ module SwfDisv1DInputModule 'BOTTOM', & ! fortran variable 'DOUBLE1D', & ! type 'NODES', & ! shape + 'bottom elevation for the one-dimensional cell', & ! longname .true., & ! required .false., & ! multi-record .false., & ! preserve case @@ -231,6 +249,7 @@ module SwfDisv1DInputModule 'IDOMAIN', & ! fortran variable 'INTEGER1D', & ! type 'NODES', & ! shape + 'idomain existence array', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -248,6 +267,7 @@ module SwfDisv1DInputModule 'IV', & ! fortran variable 'INTEGER', & ! type '', & ! shape + 'vertex number', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -265,6 +285,7 @@ module SwfDisv1DInputModule 'XV', & ! fortran variable 'DOUBLE', & ! type '', & ! shape + 'x-coordinate for vertex', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -282,6 +303,7 @@ module SwfDisv1DInputModule 'YV', & ! fortran variable 'DOUBLE', & ! type '', & ! shape + 'y-coordinate for vertex', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -299,6 +321,7 @@ module SwfDisv1DInputModule 'ICELL2D', & ! fortran variable 'INTEGER', & ! type '', & ! shape + 'cell2d number', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -316,6 +339,7 @@ module SwfDisv1DInputModule 'FDC', & ! fortran variable 'DOUBLE', & ! type '', & ! shape + 'fractional distance to the cell center', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -333,6 +357,7 @@ module SwfDisv1DInputModule 'NCVERT', & ! fortran variable 'INTEGER', & ! type '', & ! shape + 'number of cell vertices', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -350,6 +375,7 @@ module SwfDisv1DInputModule 'ICVERT', & ! fortran variable 'INTEGER1D', & ! type 'NCVERT', & ! shape + 'number of cell vertices', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -391,6 +417,7 @@ module SwfDisv1DInputModule 'VERTICES', & ! fortran variable 'RECARRAY IV XV YV', & ! type 'NVERT', & ! shape + 'vertices data', & ! longname .true., & ! required .false., & ! multi-record .false., & ! preserve case @@ -408,6 +435,7 @@ module SwfDisv1DInputModule 'CELL2D', & ! fortran variable 'RECARRAY ICELL2D FDC NCVERT ICVERT', & ! type 'NODES', & ! shape + 'cell2d data', & ! longname .true., & ! required .false., & ! multi-record .false., & ! preserve case diff --git a/src/Idm/swf-disv2didm.f90 b/src/Idm/swf-disv2didm.f90 index d119a1866a2..679b37110b9 100644 --- a/src/Idm/swf-disv2didm.f90 +++ b/src/Idm/swf-disv2didm.f90 @@ -9,6 +9,7 @@ module SwfDisv2DInputModule public swf_disv2d_block_definitions public SwfDisv2dParamFoundType public swf_disv2d_multi_package + public swf_disv2d_subpackages type SwfDisv2dParamFoundType logical :: length_units = .false. @@ -33,6 +34,12 @@ module SwfDisv2DInputModule logical :: swf_disv2d_multi_package = .false. + character(len=16), parameter :: & + swf_disv2d_subpackages(*) = & + [ & + ' ' & + ] + type(InputParamDefinitionType), parameter :: & swfdisv2d_length_units = InputParamDefinitionType & ( & @@ -43,6 +50,7 @@ module SwfDisv2DInputModule 'LENGTH_UNITS', & ! fortran variable 'STRING', & ! type '', & ! shape + 'model length units', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -60,6 +68,7 @@ module SwfDisv2DInputModule 'NOGRB', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'do not write binary grid file', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -77,6 +86,7 @@ module SwfDisv2DInputModule 'XORIGIN', & ! fortran variable 'DOUBLE', & ! type '', & ! shape + 'x-position of the model grid origin', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -94,6 +104,7 @@ module SwfDisv2DInputModule 'YORIGIN', & ! fortran variable 'DOUBLE', & ! type '', & ! shape + 'y-position of the model grid origin', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -111,6 +122,7 @@ module SwfDisv2DInputModule 'ANGROT', & ! fortran variable 'DOUBLE', & ! type '', & ! shape + 'rotation angle', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -128,6 +140,7 @@ module SwfDisv2DInputModule 'EXPORT_ASCII', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'export array variables to layered ascii files.', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -145,6 +158,7 @@ module SwfDisv2DInputModule 'NODES', & ! fortran variable 'INTEGER', & ! type '', & ! shape + 'number of cells per layer', & ! longname .true., & ! required .false., & ! multi-record .false., & ! preserve case @@ -162,6 +176,7 @@ module SwfDisv2DInputModule 'NVERT', & ! fortran variable 'INTEGER', & ! type '', & ! shape + 'number of columns', & ! longname .true., & ! required .false., & ! multi-record .false., & ! preserve case @@ -179,6 +194,7 @@ module SwfDisv2DInputModule 'BOTTOM', & ! fortran variable 'DOUBLE1D', & ! type 'NODES', & ! shape + 'model bottom elevation', & ! longname .true., & ! required .false., & ! multi-record .false., & ! preserve case @@ -196,6 +212,7 @@ module SwfDisv2DInputModule 'IDOMAIN', & ! fortran variable 'INTEGER1D', & ! type 'NODES', & ! shape + 'idomain existence array', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -213,6 +230,7 @@ module SwfDisv2DInputModule 'IV', & ! fortran variable 'INTEGER', & ! type '', & ! shape + 'vertex number', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -230,6 +248,7 @@ module SwfDisv2DInputModule 'XV', & ! fortran variable 'DOUBLE', & ! type '', & ! shape + 'x-coordinate for vertex', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -247,6 +266,7 @@ module SwfDisv2DInputModule 'YV', & ! fortran variable 'DOUBLE', & ! type '', & ! shape + 'y-coordinate for vertex', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -264,6 +284,7 @@ module SwfDisv2DInputModule 'ICELL2D', & ! fortran variable 'INTEGER', & ! type '', & ! shape + 'cell2d number', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -281,6 +302,7 @@ module SwfDisv2DInputModule 'XC', & ! fortran variable 'DOUBLE', & ! type '', & ! shape + 'x-coordinate for cell center', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -298,6 +320,7 @@ module SwfDisv2DInputModule 'YC', & ! fortran variable 'DOUBLE', & ! type '', & ! shape + 'y-coordinate for cell center', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -315,6 +338,7 @@ module SwfDisv2DInputModule 'NCVERT', & ! fortran variable 'INTEGER', & ! type '', & ! shape + 'number of cell vertices', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -332,6 +356,7 @@ module SwfDisv2DInputModule 'ICVERT', & ! fortran variable 'INTEGER1D', & ! type 'NCVERT', & ! shape + 'array of vertex numbers', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -372,6 +397,7 @@ module SwfDisv2DInputModule 'VERTICES', & ! fortran variable 'RECARRAY IV XV YV', & ! type 'NVERT', & ! shape + 'vertices data', & ! longname .true., & ! required .false., & ! multi-record .false., & ! preserve case @@ -389,6 +415,7 @@ module SwfDisv2DInputModule 'CELL2D', & ! fortran variable 'RECARRAY ICELL2D XC YC NCVERT ICVERT', & ! type 'NODES', & ! shape + 'cell2d data', & ! longname .true., & ! required .false., & ! multi-record .false., & ! preserve case diff --git a/src/Idm/swf-flwidm.f90 b/src/Idm/swf-flwidm.f90 index a5a624ba8cb..ec4cd203839 100644 --- a/src/Idm/swf-flwidm.f90 +++ b/src/Idm/swf-flwidm.f90 @@ -9,6 +9,7 @@ module SwfFlwInputModule public swf_flw_block_definitions public SwfFlwParamFoundType public swf_flw_multi_package + public swf_flw_subpackages type SwfFlwParamFoundType logical :: auxiliary = .false. @@ -33,6 +34,12 @@ module SwfFlwInputModule logical :: swf_flw_multi_package = .true. + character(len=16), parameter :: & + swf_flw_subpackages(*) = & + [ & + ' ' & + ] + type(InputParamDefinitionType), parameter :: & swfflw_auxiliary = InputParamDefinitionType & ( & @@ -43,6 +50,7 @@ module SwfFlwInputModule 'AUXILIARY', & ! fortran variable 'STRING', & ! type 'NAUX', & ! shape + 'keyword to specify aux variables', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -60,6 +68,7 @@ module SwfFlwInputModule 'AUXMULTNAME', & ! fortran variable 'STRING', & ! type '', & ! shape + 'name of auxiliary variable for multiplier', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -77,6 +86,7 @@ module SwfFlwInputModule 'BOUNDNAMES', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + '', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -94,6 +104,7 @@ module SwfFlwInputModule 'PRINT_INPUT', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'print input to listing file', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -111,6 +122,7 @@ module SwfFlwInputModule 'PRINT_FLOWS', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'print calculated flows to listing file', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -128,6 +140,7 @@ module SwfFlwInputModule 'SAVE_FLOWS', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'save well flows to budget file', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -145,6 +158,7 @@ module SwfFlwInputModule 'TS_FILERECORD', & ! fortran variable 'RECORD TS6 FILEIN TS6_FILENAME', & ! type '', & ! shape + '', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -162,6 +176,7 @@ module SwfFlwInputModule 'TS6', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'head keyword', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -179,6 +194,7 @@ module SwfFlwInputModule 'FILEIN', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'file keyword', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -196,6 +212,7 @@ module SwfFlwInputModule 'TS6_FILENAME', & ! fortran variable 'STRING', & ! type '', & ! shape + 'file name of time series information', & ! longname .true., & ! required .true., & ! multi-record .true., & ! preserve case @@ -213,6 +230,7 @@ module SwfFlwInputModule 'OBS_FILERECORD', & ! fortran variable 'RECORD OBS6 FILEIN OBS6_FILENAME', & ! type '', & ! shape + '', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -230,6 +248,7 @@ module SwfFlwInputModule 'OBS6', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'obs keyword', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -247,6 +266,7 @@ module SwfFlwInputModule 'OBS6_FILENAME', & ! fortran variable 'STRING', & ! type '', & ! shape + 'obs6 input filename', & ! longname .true., & ! required .true., & ! multi-record .true., & ! preserve case @@ -264,6 +284,7 @@ module SwfFlwInputModule 'MAXBOUND', & ! fortran variable 'INTEGER', & ! type '', & ! shape + 'maximum number of inflow', & ! longname .true., & ! required .false., & ! multi-record .false., & ! preserve case @@ -281,6 +302,7 @@ module SwfFlwInputModule 'CELLID', & ! fortran variable 'INTEGER1D', & ! type 'NCELLDIM', & ! shape + 'cell identifier', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -298,6 +320,7 @@ module SwfFlwInputModule 'Q', & ! fortran variable 'DOUBLE', & ! type '', & ! shape + 'well rate', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -315,6 +338,7 @@ module SwfFlwInputModule 'AUX', & ! fortran variable 'DOUBLE1D', & ! type 'NAUX', & ! shape + 'auxiliary variables', & ! longname .false., & ! required .true., & ! multi-record .false., & ! preserve case @@ -332,6 +356,7 @@ module SwfFlwInputModule 'BOUNDNAME', & ! fortran variable 'STRING', & ! type '', & ! shape + 'inflow name', & ! longname .false., & ! required .true., & ! multi-record .false., & ! preserve case @@ -372,6 +397,7 @@ module SwfFlwInputModule 'SPD', & ! fortran variable 'RECARRAY CELLID Q AUX BOUNDNAME', & ! type 'MAXBOUND', & ! shape + '', & ! longname .true., & ! required .false., & ! multi-record .false., & ! preserve case diff --git a/src/Idm/swf-icidm.f90 b/src/Idm/swf-icidm.f90 index 1cc90e5bdfb..849374f4226 100644 --- a/src/Idm/swf-icidm.f90 +++ b/src/Idm/swf-icidm.f90 @@ -9,6 +9,7 @@ module SwfIcInputModule public swf_ic_block_definitions public SwfIcParamFoundType public swf_ic_multi_package + public swf_ic_subpackages type SwfIcParamFoundType logical :: export_ascii = .false. @@ -17,6 +18,12 @@ module SwfIcInputModule logical :: swf_ic_multi_package = .false. + character(len=16), parameter :: & + swf_ic_subpackages(*) = & + [ & + ' ' & + ] + type(InputParamDefinitionType), parameter :: & swfic_export_ascii = InputParamDefinitionType & ( & @@ -27,6 +34,7 @@ module SwfIcInputModule 'EXPORT_ASCII', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'export array variables to layered ascii files.', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -44,6 +52,7 @@ module SwfIcInputModule 'STRT', & ! fortran variable 'DOUBLE1D', & ! type 'NODES', & ! shape + 'starting concentration', & ! longname .true., & ! required .false., & ! multi-record .false., & ! preserve case @@ -70,6 +79,7 @@ module SwfIcInputModule '', & ! fortran variable '', & ! type '', & ! shape + '', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case diff --git a/src/Idm/swf-namidm.f90 b/src/Idm/swf-namidm.f90 index 4c2a1879210..19ace90ab8a 100644 --- a/src/Idm/swf-namidm.f90 +++ b/src/Idm/swf-namidm.f90 @@ -9,6 +9,7 @@ module SwfNamInputModule public swf_nam_block_definitions public SwfNamParamFoundType public swf_nam_multi_package + public swf_nam_subpackages type SwfNamParamFoundType logical :: list = .false. @@ -25,6 +26,12 @@ module SwfNamInputModule logical :: swf_nam_multi_package = .false. + character(len=16), parameter :: & + swf_nam_subpackages(*) = & + [ & + ' ' & + ] + type(InputParamDefinitionType), parameter :: & swfnam_list = InputParamDefinitionType & ( & @@ -35,6 +42,7 @@ module SwfNamInputModule 'LIST', & ! fortran variable 'STRING', & ! type '', & ! shape + 'name of listing file', & ! longname .false., & ! required .false., & ! multi-record .true., & ! preserve case @@ -52,6 +60,7 @@ module SwfNamInputModule 'PRINT_INPUT', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'print input to listing file', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -69,6 +78,7 @@ module SwfNamInputModule 'PRINT_FLOWS', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'print calculated flows to listing file', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -86,6 +96,7 @@ module SwfNamInputModule 'SAVE_FLOWS', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'save flows for all packages to budget file', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -103,6 +114,7 @@ module SwfNamInputModule 'NEWTONOPTIONS', & ! fortran variable 'RECORD NEWTON UNDER_RELAXATION', & ! type '', & ! shape + 'newton keyword and options', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -120,6 +132,7 @@ module SwfNamInputModule 'NEWTON', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'keyword to activate Newton-Raphson formulation', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -137,6 +150,7 @@ module SwfNamInputModule 'UNDER_RELAXATION', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'keyword to activate Newton-Raphson UNDER_RELAXATION option', & ! longname .false., & ! required .true., & ! multi-record .false., & ! preserve case @@ -154,6 +168,7 @@ module SwfNamInputModule 'FTYPE', & ! fortran variable 'STRING', & ! type '', & ! shape + 'package type', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -171,6 +186,7 @@ module SwfNamInputModule 'FNAME', & ! fortran variable 'STRING', & ! type '', & ! shape + 'file name', & ! longname .true., & ! required .true., & ! multi-record .true., & ! preserve case @@ -188,6 +204,7 @@ module SwfNamInputModule 'PNAME', & ! fortran variable 'STRING', & ! type '', & ! shape + 'user name for package', & ! longname .false., & ! required .true., & ! multi-record .false., & ! preserve case @@ -220,6 +237,7 @@ module SwfNamInputModule 'PACKAGES', & ! fortran variable 'RECARRAY FTYPE FNAME PNAME', & ! type '', & ! shape + 'package list', & ! longname .true., & ! required .false., & ! multi-record .false., & ! preserve case diff --git a/src/Idm/swf-stoidm.f90 b/src/Idm/swf-stoidm.f90 index 67ff87a5a74..9d9ec8a518e 100644 --- a/src/Idm/swf-stoidm.f90 +++ b/src/Idm/swf-stoidm.f90 @@ -9,6 +9,7 @@ module SwfStoInputModule public swf_sto_block_definitions public SwfStoParamFoundType public swf_sto_multi_package + public swf_sto_subpackages type SwfStoParamFoundType logical :: ipakcb = .false. @@ -19,6 +20,12 @@ module SwfStoInputModule logical :: swf_sto_multi_package = .false. + character(len=16), parameter :: & + swf_sto_subpackages(*) = & + [ & + ' ' & + ] + type(InputParamDefinitionType), parameter :: & swfsto_ipakcb = InputParamDefinitionType & ( & @@ -29,6 +36,7 @@ module SwfStoInputModule 'IPAKCB', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'keyword to save NPF flows', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -46,6 +54,7 @@ module SwfStoInputModule 'EXPORT_ASCII', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'export array variables to layered ascii files.', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -63,6 +72,7 @@ module SwfStoInputModule 'STEADY_STATE', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'steady state indicator', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -80,6 +90,7 @@ module SwfStoInputModule 'TRANSIENT', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'transient indicator', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -108,6 +119,7 @@ module SwfStoInputModule '', & ! fortran variable '', & ! type '', & ! shape + '', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case diff --git a/src/Idm/swf-zdgidm.f90 b/src/Idm/swf-zdgidm.f90 index 568d242cc91..071660cafa4 100644 --- a/src/Idm/swf-zdgidm.f90 +++ b/src/Idm/swf-zdgidm.f90 @@ -9,6 +9,7 @@ module SwfZdgInputModule public swf_zdg_block_definitions public SwfZdgParamFoundType public swf_zdg_multi_package + public swf_zdg_subpackages type SwfZdgParamFoundType logical :: auxiliary = .false. @@ -35,6 +36,12 @@ module SwfZdgInputModule logical :: swf_zdg_multi_package = .true. + character(len=16), parameter :: & + swf_zdg_subpackages(*) = & + [ & + ' ' & + ] + type(InputParamDefinitionType), parameter :: & swfzdg_auxiliary = InputParamDefinitionType & ( & @@ -45,6 +52,7 @@ module SwfZdgInputModule 'AUXILIARY', & ! fortran variable 'STRING', & ! type 'NAUX', & ! shape + 'keyword to specify aux variables', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -62,6 +70,7 @@ module SwfZdgInputModule 'BOUNDNAMES', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + '', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -79,6 +88,7 @@ module SwfZdgInputModule 'IPRPAK', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'print input to listing file', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -96,6 +106,7 @@ module SwfZdgInputModule 'IPRFLOW', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'print calculated flows to listing file', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -113,6 +124,7 @@ module SwfZdgInputModule 'IPAKCB', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'save flows to budget file', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -130,6 +142,7 @@ module SwfZdgInputModule 'TS_FILERECORD', & ! fortran variable 'RECORD TS6 FILEIN TS6_FILENAME', & ! type '', & ! shape + '', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -147,6 +160,7 @@ module SwfZdgInputModule 'TS6', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'head keyword', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -164,6 +178,7 @@ module SwfZdgInputModule 'FILEIN', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'file keyword', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -181,6 +196,7 @@ module SwfZdgInputModule 'TS6_FILENAME', & ! fortran variable 'STRING', & ! type '', & ! shape + 'file name of time series information', & ! longname .true., & ! required .true., & ! multi-record .true., & ! preserve case @@ -198,6 +214,7 @@ module SwfZdgInputModule 'OBS_FILERECORD', & ! fortran variable 'RECORD OBS6 FILEIN OBS6_FILENAME', & ! type '', & ! shape + '', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -215,6 +232,7 @@ module SwfZdgInputModule 'OBS6', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'obs keyword', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -232,6 +250,7 @@ module SwfZdgInputModule 'OBS6_FILENAME', & ! fortran variable 'STRING', & ! type '', & ! shape + 'obs6 input filename', & ! longname .true., & ! required .true., & ! multi-record .true., & ! preserve case @@ -249,6 +268,7 @@ module SwfZdgInputModule 'MAXBOUND', & ! fortran variable 'INTEGER', & ! type '', & ! shape + 'maximum number of zero-depth-gradient boundaries', & ! longname .true., & ! required .false., & ! multi-record .false., & ! preserve case @@ -266,6 +286,7 @@ module SwfZdgInputModule 'CELLID', & ! fortran variable 'INTEGER1D', & ! type 'NCELLDIM', & ! shape + 'cell identifier', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -283,6 +304,7 @@ module SwfZdgInputModule 'IDCXS', & ! fortran variable 'INTEGER', & ! type '', & ! shape + 'cross section identifier', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -300,6 +322,7 @@ module SwfZdgInputModule 'WIDTH', & ! fortran variable 'DOUBLE', & ! type '', & ! shape + 'width of the zero-depth gradient boundary', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -317,6 +340,7 @@ module SwfZdgInputModule 'SLOPE', & ! fortran variable 'DOUBLE', & ! type '', & ! shape + 'channel slope', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -334,6 +358,7 @@ module SwfZdgInputModule 'ROUGH', & ! fortran variable 'DOUBLE', & ! type '', & ! shape + 'channel roughness', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -351,6 +376,7 @@ module SwfZdgInputModule 'AUXVAR', & ! fortran variable 'DOUBLE1D', & ! type 'NAUX', & ! shape + 'auxiliary variables', & ! longname .false., & ! required .true., & ! multi-record .false., & ! preserve case @@ -368,6 +394,7 @@ module SwfZdgInputModule 'BOUNDNAME', & ! fortran variable 'STRING', & ! type '', & ! shape + 'zero-depth-gradient boundary name', & ! longname .false., & ! required .true., & ! multi-record .false., & ! preserve case @@ -410,6 +437,7 @@ module SwfZdgInputModule 'SPD', & ! fortran variable 'RECARRAY CELLID IDCXS WIDTH SLOPE ROUGH AUX BOUNDNAME', & ! type 'MAXBOUND', & ! shape + '', & ! longname .true., & ! required .false., & ! multi-record .false., & ! preserve case diff --git a/src/Idm/utl-hpcidm.f90 b/src/Idm/utl-hpcidm.f90 index a6456293d23..fa935056962 100644 --- a/src/Idm/utl-hpcidm.f90 +++ b/src/Idm/utl-hpcidm.f90 @@ -9,6 +9,7 @@ module UtlHpcInputModule public utl_hpc_block_definitions public UtlHpcParamFoundType public utl_hpc_multi_package + public utl_hpc_subpackages type UtlHpcParamFoundType logical :: dev_log_mpi = .false. @@ -18,6 +19,12 @@ module UtlHpcInputModule logical :: utl_hpc_multi_package = .false. + character(len=16), parameter :: & + utl_hpc_subpackages(*) = & + [ & + ' ' & + ] + type(InputParamDefinitionType), parameter :: & utlhpc_dev_log_mpi = InputParamDefinitionType & ( & @@ -28,6 +35,7 @@ module UtlHpcInputModule 'DEV_LOG_MPI', & ! fortran variable 'KEYWORD', & ! type '', & ! shape + 'log mpi traffic', & ! longname .false., & ! required .false., & ! multi-record .false., & ! preserve case @@ -45,6 +53,7 @@ module UtlHpcInputModule 'MNAME', & ! fortran variable 'STRING', & ! type '', & ! shape + 'model name', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -62,6 +71,7 @@ module UtlHpcInputModule 'MRANK', & ! fortran variable 'INTEGER', & ! type '', & ! shape + 'model rank', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -87,6 +97,7 @@ module UtlHpcInputModule 'PARTITIONS', & ! fortran variable 'RECARRAY MNAME MRANK', & ! type '', & ! shape + 'list of partition numbers', & ! longname .true., & ! required .false., & ! multi-record .false., & ! preserve case diff --git a/src/Idm/utl-ncfidm.f90 b/src/Idm/utl-ncfidm.f90 new file mode 100644 index 00000000000..1e5988601af --- /dev/null +++ b/src/Idm/utl-ncfidm.f90 @@ -0,0 +1,202 @@ +! ** Do Not Modify! MODFLOW 6 system generated file. ** +module UtlNcfInputModule + use ConstantsModule, only: LENVARNAME + use InputDefinitionModule, only: InputParamDefinitionType, & + InputBlockDefinitionType + private + public utl_ncf_param_definitions + public utl_ncf_aggregate_definitions + public utl_ncf_block_definitions + public UtlNcfParamFoundType + public utl_ncf_multi_package + public utl_ncf_subpackages + + type UtlNcfParamFoundType + logical :: ogc_wkt = .false. + logical :: deflate = .false. + logical :: shuffle = .false. + logical :: ugc_record = .false. + logical :: chunking_ugrid = .false. + logical :: ugc_time = .false. + logical :: ugc_face = .false. + end type UtlNcfParamFoundType + + logical :: utl_ncf_multi_package = .false. + + character(len=16), parameter :: & + utl_ncf_subpackages(*) = & + [ & + ' ' & + ] + + type(InputParamDefinitionType), parameter :: & + utlncf_ogc_wkt = InputParamDefinitionType & + ( & + 'UTL', & ! component + 'NCF', & ! subcomponent + 'OPTIONS', & ! block + 'OGC_WKT', & ! tag name + 'OGC_WKT', & ! fortran variable + 'STRING', & ! type + 'LENBIGLINE', & ! shape + 'CRS well-known text (WKT) string', & ! longname + .false., & ! required + .false., & ! multi-record + .false., & ! preserve case + .false., & ! layered + .false. & ! timeseries + ) + + type(InputParamDefinitionType), parameter :: & + utlncf_deflate = InputParamDefinitionType & + ( & + 'UTL', & ! component + 'NCF', & ! subcomponent + 'OPTIONS', & ! block + 'DEFLATE', & ! tag name + 'DEFLATE', & ! fortran variable + 'INTEGER', & ! type + '', & ! shape + 'variable compression deflate level', & ! longname + .false., & ! required + .false., & ! multi-record + .false., & ! preserve case + .false., & ! layered + .false. & ! timeseries + ) + + type(InputParamDefinitionType), parameter :: & + utlncf_shuffle = InputParamDefinitionType & + ( & + 'UTL', & ! component + 'NCF', & ! subcomponent + 'OPTIONS', & ! block + 'SHUFFLE', & ! tag name + 'SHUFFLE', & ! fortran variable + 'KEYWORD', & ! type + '', & ! shape + '', & ! longname + .false., & ! required + .false., & ! multi-record + .false., & ! preserve case + .false., & ! layered + .false. & ! timeseries + ) + + type(InputParamDefinitionType), parameter :: & + utlncf_ugc_record = InputParamDefinitionType & + ( & + 'UTL', & ! component + 'NCF', & ! subcomponent + 'OPTIONS', & ! block + 'UGC_RECORD', & ! tag name + 'UGC_RECORD', & ! fortran variable + 'RECORD CHUNKING_UGRID UGC_TIME UGC_FACE', & ! type + '', & ! shape + 'ugrid time and face dimension chunking parameters', & ! longname + .false., & ! required + .false., & ! multi-record + .false., & ! preserve case + .false., & ! layered + .false. & ! timeseries + ) + + type(InputParamDefinitionType), parameter :: & + utlncf_chunking_ugrid = InputParamDefinitionType & + ( & + 'UTL', & ! component + 'NCF', & ! subcomponent + 'OPTIONS', & ! block + 'CHUNKING_UGRID', & ! tag name + 'CHUNKING_UGRID', & ! fortran variable + 'KEYWORD', & ! type + '', & ! shape + 'keyword when defining ugrid chunking parameters', & ! longname + .true., & ! required + .true., & ! multi-record + .false., & ! preserve case + .false., & ! layered + .false. & ! timeseries + ) + + type(InputParamDefinitionType), parameter :: & + utlncf_ugc_time = InputParamDefinitionType & + ( & + 'UTL', & ! component + 'NCF', & ! subcomponent + 'OPTIONS', & ! block + 'UGC_TIME', & ! tag name + 'UGC_TIME', & ! fortran variable + 'INTEGER', & ! type + '', & ! shape + 'chunking parameter for the time dimension', & ! longname + .true., & ! required + .true., & ! multi-record + .false., & ! preserve case + .false., & ! layered + .false. & ! timeseries + ) + + type(InputParamDefinitionType), parameter :: & + utlncf_ugc_face = InputParamDefinitionType & + ( & + 'UTL', & ! component + 'NCF', & ! subcomponent + 'OPTIONS', & ! block + 'UGC_FACE', & ! tag name + 'UGC_FACE', & ! fortran variable + 'INTEGER', & ! type + '', & ! shape + 'chunking parameter for the face dimension', & ! longname + .true., & ! required + .true., & ! multi-record + .false., & ! preserve case + .false., & ! layered + .false. & ! timeseries + ) + + type(InputParamDefinitionType), parameter :: & + utl_ncf_param_definitions(*) = & + [ & + utlncf_ogc_wkt, & + utlncf_deflate, & + utlncf_shuffle, & + utlncf_ugc_record, & + utlncf_chunking_ugrid, & + utlncf_ugc_time, & + utlncf_ugc_face & + ] + + type(InputParamDefinitionType), parameter :: & + utl_ncf_aggregate_definitions(*) = & + [ & + InputParamDefinitionType & + ( & + '', & ! component + '', & ! subcomponent + '', & ! block + '', & ! tag name + '', & ! fortran variable + '', & ! type + '', & ! shape + '', & ! longname + .false., & ! required + .false., & ! multi-record + .false., & ! preserve case + .false., & ! layered + .false. & ! timeseries + ) & + ] + + type(InputBlockDefinitionType), parameter :: & + utl_ncf_block_definitions(*) = & + [ & + InputBlockDefinitionType( & + 'OPTIONS', & ! blockname + .false., & ! required + .false., & ! aggregate + .false. & ! block_variable + ) & + ] + +end module UtlNcfInputModule diff --git a/src/Timing/tdis.f90 b/src/Timing/tdis.f90 index a3cf0bb36b4..536e34bfe7e 100644 --- a/src/Timing/tdis.f90 +++ b/src/Timing/tdis.f90 @@ -38,7 +38,7 @@ module TdisModule real(DP), public, dimension(:), pointer, contiguous :: perlen => null() !< length of each stress period integer(I4B), public, dimension(:), pointer, contiguous :: nstp => null() !< number of time steps in each stress period real(DP), public, dimension(:), pointer, contiguous :: tsmult => null() !< time step multiplier for each stress period - character(len=LENDATETIME), pointer :: datetime0 => null() !< starting date and time for the simulation + character(len=LENDATETIME), public, pointer :: datetime0 => null() !< starting date and time for the simulation character(len=LENMEMPATH), pointer :: input_mempath => null() !< input context mempath for tdis character(len=LINELENGTH), pointer :: input_fname => null() !< input filename for tdis ! diff --git a/src/Utilities/Export/DisNCMesh.f90 b/src/Utilities/Export/DisNCMesh.f90 new file mode 100644 index 00000000000..cd2215568c5 --- /dev/null +++ b/src/Utilities/Export/DisNCMesh.f90 @@ -0,0 +1,992 @@ +!> @brief This module contains the MeshDisModelModule +!! +!! This module defines UGRID layered mesh compliant netcdf +!! export type for DIS models. It is dependent on netcdf +!! libraries. +!! +!< +module MeshDisModelModule + + use KindModule, only: DP, I4B, LGP + use ConstantsModule, only: LINELENGTH, LENBIGLINE, LENCOMPONENTNAME, & + LENMEMPATH + use MemoryManagerModule, only: mem_setptr + use InputDefinitionModule, only: InputParamDefinitionType + use CharacterStringModule, only: CharacterStringType + use MeshModelModule, only: nf_verify, Mesh2dModelType, & + MeshNCDimIdType, MeshNCVarIdType + use DisModule, only: DisType + use netcdf + + implicit none + private + public :: Mesh2dDisExportType + + ! -- UGRID layered mesh (ULM) DIS + type, extends(Mesh2dModelType) :: Mesh2dDisExportType + class(DisType), pointer :: dis => null() !< pointer to model dis package + integer(I4B) :: x_dim !< ncol dimension id + integer(I4B) :: y_dim !< nrow dimension id + contains + procedure :: init => dis_export_init + procedure :: destroy => dis_export_destroy + procedure :: df + procedure :: step + procedure :: export_input_array + procedure :: define_dim + procedure :: add_mesh_data + end type Mesh2dDisExportType + +contains + + !> @brief netcdf export dis init + !< + subroutine dis_export_init(this, modelname, modeltype, modelfname, disenum, & + nctype, iout) + use ArrayHandlersModule, only: expandarray + class(Mesh2dDisExportType), intent(inout) :: this + character(len=*), intent(in) :: modelname + character(len=*), intent(in) :: modeltype + character(len=*), intent(in) :: modelfname + integer(I4B), intent(in) :: disenum + integer(I4B), intent(in) :: nctype + integer(I4B), intent(in) :: iout + ! + ! -- set nlay + this%nlay = this%dis%nlay + ! + ! allocate var_id arrays + allocate (this%var_ids%dependent(this%nlay)) + ! + ! -- initialize base class + call this%mesh_init(modelname, modeltype, modelfname, disenum, nctype, iout) + end subroutine dis_export_init + + !> @brief netcdf export dis destroy + !< + subroutine dis_export_destroy(this) + use SimVariablesModule, only: idm_context + use MemoryManagerExtModule, only: memorystore_remove + class(Mesh2dDisExportType), intent(inout) :: this + call nf_verify(nf90_close(this%ncid), this%ncid, this%iout) + ! + ! -- destroy base class + call this%NCModelExportType%destroy() + ! + ! -- Deallocate idm memory + if (this%ncf_mempath /= '') then + call memorystore_remove(this%modelname, 'NCF', idm_context) + end if + end subroutine dis_export_destroy + + !> @brief netcdf export define + !< + subroutine df(this) + class(Mesh2dDisExportType), intent(inout) :: this + ! -- put root group file scope attributes + call this%add_global_att() + ! -- define root group dimensions and coordinate variables + call this%define_dim() + ! -- define mesh variables + call this%create_mesh() + ! -- define the dependent variable + call this%define_dependent() + ! -- exit define mode + call nf_verify(nf90_enddef(this%ncid), this%ncid, this%iout) + ! -- create mesh + call this%add_mesh_data() + ! -- define and set package input griddata + call this%add_pkg_data() + ! -- define and set gridmap variable + call this%define_gridmap() + ! -- synchronize file + call nf_verify(nf90_sync(this%ncid), this%ncid, this%iout) + end subroutine df + + !> @brief netcdf export step + !< + subroutine step(this) + use ConstantsModule, only: DHNOFLO + use TdisModule, only: totim + class(Mesh2dDisExportType), intent(inout) :: this + real(DP), dimension(:), pointer, contiguous :: dbl1d + integer(I4B) :: n, k + integer(I4B), dimension(2) :: dis_shape + real(DP), dimension(:, :), pointer, contiguous :: dbl2d + ! + ! -- increment step + this%stepcnt = this%stepcnt + 1 + ! + dis_shape(1) = this%dis%ncol * this%dis%nrow + dis_shape(2) = this%dis%nlay + allocate (dbl2d(dis_shape(1), dis_shape(2))) + ! + ! -- add data to dependent variable + if (size(this%dis%nodeuser) < & + size(this%dis%nodereduced)) then + ! + ! -- allocate nodereduced size 1d array + allocate (dbl1d(size(this%dis%nodereduced))) + ! + ! -- initialize DHNOFLO for non-active cells + dbl1d = DHNOFLO + ! + ! -- update active cells + do n = 1, size(this%dis%nodereduced) + if (this%dis%nodereduced(n) > 0) then + dbl1d(n) = this%x(this%dis%nodereduced(n)) + end if + end do + ! + dbl2d = reshape(dbl1d, dis_shape) + ! + deallocate (dbl1d) + else + ! + dbl2d = reshape(this%x, dis_shape) + ! + end if + ! + do k = 1, this%dis%nlay + ! -- extend array with step data + call nf_verify(nf90_put_var(this%ncid, & + this%var_ids%dependent(k), dbl2d(:, k), & + start=(/1, this%stepcnt/), & + count=(/(this%dis%ncol * this%dis%nrow), 1/)), & + this%ncid, this%iout) + end do + ! + ! -- write to time coordinate variable + call nf_verify(nf90_put_var(this%ncid, this%var_ids%time, & + totim, start=(/this%stepcnt/)), & + this%ncid, this%iout) + ! + ! -- update file + call nf_verify(nf90_sync(this%ncid), this%ncid, this%iout) + ! + ! --cleanup + deallocate (dbl2d) + end subroutine step + + !> @brief netcdf export an input array + !< + subroutine export_input_array(this, pkgname, mempath, idt) + use InputOutputModule, only: lowcase + class(Mesh2dDisExportType), intent(inout) :: this + character(len=*), intent(in) :: pkgname + character(len=*), intent(in) :: mempath + type(InputParamDefinitionType), pointer, intent(in) :: idt + integer(I4B), dimension(:), pointer, contiguous :: int1d + integer(I4B), dimension(:, :), pointer, contiguous :: int2d + integer(I4B), dimension(:, :, :), pointer, contiguous :: int3d + real(DP), dimension(:), pointer, contiguous :: dbl1d + real(DP), dimension(:, :), pointer, contiguous :: dbl2d + real(DP), dimension(:, :, :), pointer, contiguous :: dbl3d + character(len=LINELENGTH) :: pname, vname, nc_varname, gridmap + ! + ! -- set package name + pname = pkgname + call lowcase(pname) + ! -- set variable name + vname = idt%tagname + call lowcase(vname) + ! -- set variable name written to file + nc_varname = trim(pname)//'_'//trim(vname) + ! + if (this%ogc_wkt /= '') then + ! -- set gridmap variable name + gridmap = this%gridmap_name + else + gridmap = '' + end if + ! + select case (idt%datatype) + case ('INTEGER1D') + call mem_setptr(int1d, idt%mf6varname, mempath) + call nc_export_int1d(this%ncid, this%dim_ids, this%x_dim, this%y_dim, & + this%var_ids, this%dis, int1d, nc_varname, pkgname, & + idt%tagname, gridmap, idt%shape, idt%longname, & + this%deflate, this%shuffle, this%ugc_face, this%iout) + case ('INTEGER2D') + call mem_setptr(int2d, idt%mf6varname, mempath) + call nc_export_int2d(this%ncid, this%dim_ids, this%var_ids, this%dis, & + int2d, nc_varname, pkgname, idt%tagname, gridmap, & + idt%shape, idt%longname, this%deflate, this%shuffle, & + this%ugc_face, this%iout) + case ('INTEGER3D') + call mem_setptr(int3d, idt%mf6varname, mempath) + call nc_export_int3d(this%ncid, this%dim_ids, this%var_ids, this%dis, & + int3d, nc_varname, pkgname, idt%tagname, gridmap, & + idt%shape, idt%longname, this%deflate, this%shuffle, & + this%ugc_face, this%iout) + case ('DOUBLE1D') + call mem_setptr(dbl1d, idt%mf6varname, mempath) + call nc_export_dbl1d(this%ncid, this%dim_ids, this%x_dim, this%y_dim, & + this%var_ids, this%dis, dbl1d, nc_varname, pkgname, & + idt%tagname, gridmap, idt%shape, idt%longname, & + this%deflate, this%shuffle, this%ugc_face, this%iout) + case ('DOUBLE2D') + call mem_setptr(dbl2d, idt%mf6varname, mempath) + call nc_export_dbl2d(this%ncid, this%dim_ids, this%var_ids, this%dis, & + dbl2d, nc_varname, pkgname, idt%tagname, gridmap, & + idt%shape, idt%longname, this%deflate, this%shuffle, & + this%ugc_face, this%iout) + case ('DOUBLE3D') + call mem_setptr(dbl3d, idt%mf6varname, mempath) + call nc_export_dbl3d(this%ncid, this%dim_ids, this%var_ids, this%dis, & + dbl3d, nc_varname, pkgname, idt%tagname, gridmap, & + idt%shape, idt%longname, this%deflate, this%shuffle, & + this%ugc_face, this%iout) + case default + ! -- no-op, no other datatypes exported + end select + end subroutine export_input_array + + !> @brief netcdf export define dimensions + !< + subroutine define_dim(this) + class(Mesh2dDisExportType), intent(inout) :: this + ! + ! -- time + call nf_verify(nf90_def_dim(this%ncid, 'time', this%totnstp, & + this%dim_ids%time), this%ncid, this%iout) + call nf_verify(nf90_def_var(this%ncid, 'time', NF90_DOUBLE, & + this%dim_ids%time, this%var_ids%time), & + this%ncid, this%iout) + call nf_verify(nf90_put_att(this%ncid, this%var_ids%time, 'calendar', & + 'standard'), this%ncid, this%iout) + call nf_verify(nf90_put_att(this%ncid, this%var_ids%time, 'units', & + this%datetime), this%ncid, this%iout) + call nf_verify(nf90_put_att(this%ncid, this%var_ids%time, 'axis', 'T'), & + this%ncid, this%iout) + call nf_verify(nf90_put_att(this%ncid, this%var_ids%time, 'standard_name', & + 'time'), this%ncid, this%iout) + call nf_verify(nf90_put_att(this%ncid, this%var_ids%time, 'long_name', & + 'time'), this%ncid, this%iout) + ! + ! -- mesh + call nf_verify(nf90_def_dim(this%ncid, 'nmesh_node', & + ((this%dis%ncol + 1) * (this%dis%nrow + 1)), & + this%dim_ids%nmesh_node), this%ncid, this%iout) + call nf_verify(nf90_def_dim(this%ncid, 'nmesh_face', & + (this%dis%ncol * this%dis%nrow), & + this%dim_ids%nmesh_face), this%ncid, this%iout) + call nf_verify(nf90_def_dim(this%ncid, 'max_nmesh_face_nodes', 4, & + this%dim_ids%max_nmesh_face_nodes), & + this%ncid, this%iout) + ! + ! -- x, y, nlay + call nf_verify(nf90_def_dim(this%ncid, 'nlay', this%dis%nlay, & + this%dim_ids%nlay), this%ncid, this%iout) + call nf_verify(nf90_def_dim(this%ncid, 'x', this%dis%ncol, & + this%x_dim), this%ncid, this%iout) + call nf_verify(nf90_def_dim(this%ncid, 'y', this%dis%nrow, & + this%y_dim), this%ncid, this%iout) + end subroutine define_dim + + !> @brief netcdf export add mesh information + !< + subroutine add_mesh_data(this) + class(Mesh2dDisExportType), intent(inout) :: this + integer(I4B) :: cnt, maxvert, m + integer(I4B), dimension(:), allocatable :: verts + real(DP), dimension(:), allocatable :: bnds + integer(I4B) :: i, j + real(DP) :: x, y + real(DP), dimension(:), allocatable :: node_x, node_y + real(DP), dimension(:), allocatable :: cell_x, cell_y + ! + ! -- initialize max vertices required to define cell + maxvert = 4 + ! + ! -- set mesh container variable value to 1 + call nf_verify(nf90_put_var(this%ncid, this%var_ids%mesh, 1), & + this%ncid, this%iout) + ! + ! -- allocate temporary arrays + allocate (verts(maxvert)) + allocate (bnds(maxvert)) + allocate (node_x(((this%dis%ncol + 1) * (this%dis%nrow + 1)))) + allocate (node_y(((this%dis%ncol + 1) * (this%dis%nrow + 1)))) + allocate (cell_x((this%dis%ncol * this%dis%nrow))) + allocate (cell_y((this%dis%ncol * this%dis%nrow))) + ! + ! -- set node_x and node_y arrays + cnt = 0 + node_x = NF90_FILL_DOUBLE + node_y = NF90_FILL_DOUBLE + y = this%dis%yorigin + sum(this%dis%delc) + do j = this%dis%nrow, 0, -1 + x = this%dis%xorigin + do i = this%dis%ncol, 0, -1 + cnt = cnt + 1 + node_x(cnt) = x + node_y(cnt) = y + if (i > 0) x = x + this%dis%delr(i) + end do + if (j > 0) y = y - this%dis%delc(j) + end do + ! + ! -- write node_x and node_y arrays to netcdf file + call nf_verify(nf90_put_var(this%ncid, this%var_ids%mesh_node_x, node_x), & + this%ncid, this%iout) + call nf_verify(nf90_put_var(this%ncid, this%var_ids%mesh_node_y, node_y), & + this%ncid, this%iout) + ! + ! -- set cell_x and cell_y arrays + cnt = 1 + cell_x = NF90_FILL_DOUBLE + cell_y = NF90_FILL_DOUBLE + do j = 1, this%dis%nrow + x = this%dis%xorigin + y = this%dis%celly(j) + this%dis%yorigin + do i = 1, this%dis%ncol + cell_x(cnt) = x + cell_y(cnt) = y + cnt = cnt + 1 + x = this%dis%cellx(i) + this%dis%xorigin + end do + end do + ! + ! -- write face_x and face_y arrays to netcdf file + call nf_verify(nf90_put_var(this%ncid, this%var_ids%mesh_face_x, cell_x), & + this%ncid, this%iout) + call nf_verify(nf90_put_var(this%ncid, this%var_ids%mesh_face_y, cell_y), & + this%ncid, this%iout) + ! + ! -- set face nodes array + cnt = 0 + do i = 1, this%dis%nrow + do j = 1, this%dis%ncol + cnt = cnt + 1 + verts = NF90_FILL_INT + verts(1) = cnt + this%dis%ncol + i + verts(2) = cnt + this%dis%ncol + i + 1 + if (i > 1) then + verts(3) = cnt + i + verts(4) = cnt + i - 1 + else + verts(3) = cnt + 1 + verts(4) = cnt + end if + ! + ! -- write face nodes array to netcdf file + call nf_verify(nf90_put_var(this%ncid, this%var_ids%mesh_face_nodes, & + verts, start=(/1, cnt/), & + count=(/maxvert, 1/)), & + this%ncid, this%iout) + ! + ! -- set face y bounds array + bnds = NF90_FILL_DOUBLE + do m = 1, size(bnds) + if (verts(m) /= NF90_FILL_INT) then + bnds(m) = node_y(verts(m)) + end if + ! -- write face y bounds array to netcdf file + call nf_verify(nf90_put_var(this%ncid, this%var_ids%mesh_face_ybnds, & + bnds, start=(/1, cnt/), & + count=(/maxvert, 1/)), & + this%ncid, this%iout) + end do + ! + ! -- set face x bounds array + bnds = NF90_FILL_DOUBLE + do m = 1, size(bnds) + if (verts(m) /= NF90_FILL_INT) then + bnds(m) = node_x(verts(m)) + end if + ! -- write face x bounds array to netcdf file + call nf_verify(nf90_put_var(this%ncid, this%var_ids%mesh_face_xbnds, & + bnds, start=(/1, cnt/), & + count=(/maxvert, 1/)), & + this%ncid, this%iout) + end do + end do + end do + ! + ! -- cleanup + deallocate (bnds) + deallocate (verts) + deallocate (node_x) + deallocate (node_y) + deallocate (cell_x) + deallocate (cell_y) + end subroutine add_mesh_data + + !> @brief netcdf export 1D integer + !< + subroutine nc_export_int1d(ncid, dim_ids, x_dim, y_dim, var_ids, dis, p_mem, & + nc_varname, pkgname, tagname, gridmap_name, & + shapestr, longname, deflate, shuffle, ugc_face, iout) + use InputOutputModule, only: lowcase + integer(I4B), intent(in) :: ncid + type(MeshNCDimIdType), intent(inout) :: dim_ids + integer(I4B), intent(in) :: x_dim + integer(I4B), intent(in) :: y_dim + type(MeshNCVarIdType), intent(inout) :: var_ids + type(DisType), pointer, intent(in) :: dis + integer(I4B), dimension(:), pointer, contiguous, intent(in) :: p_mem + character(len=*), intent(in) :: nc_varname + character(len=*), intent(in) :: pkgname + character(len=*), intent(in) :: tagname + character(len=*), intent(in) :: gridmap_name + character(len=*), intent(in) :: shapestr + character(len=*), intent(in) :: longname + integer(I4B), intent(in) :: deflate + integer(I4B), intent(in) :: shuffle + integer(I4B), intent(in) :: ugc_face + integer(I4B), intent(in) :: iout + ! -- local + integer(I4B), dimension(3) :: dis_shape + integer(I4B), dimension(1) :: layer_shape + integer(I4B), dimension(:, :, :), pointer, contiguous :: int3d + integer(I4B), dimension(:), pointer, contiguous :: int1d + integer(I4B) :: axis_dim, k + integer(I4B), dimension(:), allocatable :: var_id + character(len=LINELENGTH) :: longname_l, varname_l + ! + if (shapestr == 'NROW' .or. & + shapestr == 'NCOL') then + ! + if (shapestr == 'NROW') then + axis_dim = y_dim + else + axis_dim = x_dim + end if + ! -- set long_name attribute + if (longname /= '') then + longname_l = trim(longname) + else + longname_l = trim(pkgname)//' '//trim(tagname) + end if + ! + allocate (var_id(1)) + ! + ! -- reenter define mode and create variable + call nf_verify(nf90_redef(ncid), ncid, iout) + call nf_verify(nf90_def_var(ncid, nc_varname, NF90_INT, & + (/axis_dim/), var_id(1)), & + ncid, iout) + ! + ! -- NROW/NCOL shapes use default chunking + if (deflate >= 0) then + call nf_verify(nf90_def_var_deflate(ncid, var_id(1), shuffle=shuffle, & + deflate=1, deflate_level=deflate), & + ncid, iout) + end if + ! + call nf_verify(nf90_put_att(ncid, var_id(1), '_FillValue', & + (/NF90_FILL_INT/)), ncid, iout) + call nf_verify(nf90_put_att(ncid, var_id(1), 'long_name', & + longname_l), ncid, iout) + ! + ! -- exit define mode and write data + call nf_verify(nf90_enddef(ncid), ncid, iout) + call nf_verify(nf90_put_var(ncid, var_id(1), p_mem), & + ncid, iout) + + else + allocate (var_id(dis%nlay)) + ! + ! -- reenter define mode and create variable + call nf_verify(nf90_redef(ncid), ncid, iout) + do k = 1, dis%nlay + write (varname_l, '(a,i0)') trim(nc_varname)//'_l', k + if (longname /= '') then + write (longname_l, '(a,i0,a)') trim(longname)//' (layer ', k, ')' + else + write (longname_l, '(a,i0,a)') trim(pkgname)//' '//trim(tagname)// & + ' (layer ', k, ')' + end if + call nf_verify(nf90_def_var(ncid, varname_l, NF90_INT, & + (/dim_ids%nmesh_face/), var_id(k)), & + ncid, iout) + ! + ! -- apply chunking parameters + if (ugc_face > 0) then + call nf_verify(nf90_def_var_chunking(ncid, var_id(k), NF90_CHUNKED, & + (/ugc_face/)), ncid, iout) + end if + ! -- deflate and shuffle + if (deflate >= 0) then + call nf_verify(nf90_def_var_deflate(ncid, var_id(k), shuffle=shuffle, & + deflate=1, deflate_level=deflate), & + ncid, iout) + end if + ! + call nf_verify(nf90_put_att(ncid, var_id(k), '_FillValue', & + (/NF90_FILL_INT/)), ncid, iout) + call nf_verify(nf90_put_att(ncid, var_id(k), 'long_name', & + longname_l), ncid, iout) + if (gridmap_name /= '') then + call nf_verify(nf90_put_att(ncid, var_id(k), 'coordinates', & + 'mesh_face_x mesh_face_y'), ncid, iout) + call nf_verify(nf90_put_att(ncid, var_id(k), 'grid_mapping', & + gridmap_name), ncid, iout) + end if + end do + ! + ! -- allocate temporary 3d and reshape input + dis_shape(1) = dis%ncol + dis_shape(2) = dis%nrow + dis_shape(3) = dis%nlay + allocate (int3d(dis_shape(1), dis_shape(2), dis_shape(3))) + int3d = reshape(p_mem, dis_shape) + ! + ! -- exit define mode and write data + call nf_verify(nf90_enddef(ncid), ncid, iout) + allocate (int1d(dis%nrow * dis%ncol)) + layer_shape(1) = dis%nrow * dis%ncol + do k = 1, dis%nlay + int1d = reshape(int3d(:, :, k), layer_shape) + call nf_verify(nf90_put_var(ncid, var_id(k), int1d), ncid, iout) + end do + ! + ! -- cleanup + deallocate (int1d) + deallocate (int3d) + deallocate (var_id) + end if + end subroutine nc_export_int1d + + !> @brief netcdf export 2D integer + !< + subroutine nc_export_int2d(ncid, dim_ids, var_ids, dis, p_mem, nc_varname, & + pkgname, tagname, gridmap_name, shapestr, longname, & + deflate, shuffle, ugc_face, iout) + integer(I4B), intent(in) :: ncid + type(MeshNCDimIdType), intent(inout) :: dim_ids + type(MeshNCVarIdType), intent(inout) :: var_ids + type(DisType), pointer, intent(in) :: dis + integer(I4B), dimension(:, :), pointer, contiguous, intent(in) :: p_mem + character(len=*), intent(in) :: nc_varname + character(len=*), intent(in) :: pkgname + character(len=*), intent(in) :: tagname + character(len=*), intent(in) :: gridmap_name + character(len=*), intent(in) :: shapestr + character(len=*), intent(in) :: longname + integer(I4B), intent(in) :: deflate + integer(I4B), intent(in) :: shuffle + integer(I4B), intent(in) :: ugc_face + integer(I4B), intent(in) :: iout + ! -- local + integer(I4B) :: var_id + integer(I4B), dimension(:), pointer, contiguous :: int1d + integer(I4B), dimension(1) :: layer_shape + character(len=LINELENGTH) :: longname_l + ! + ! -- set long_name attribute + if (longname /= '') then + longname_l = trim(longname) + else + longname_l = trim(pkgname)//' '//trim(tagname) + end if + ! + ! -- reenter define mode and create variable + call nf_verify(nf90_redef(ncid), ncid, iout) + call nf_verify(nf90_def_var(ncid, nc_varname, NF90_INT, & + (/dim_ids%nmesh_face/), var_id), & + ncid, iout) + ! + ! -- apply chunking parameters + if (ugc_face > 0) then + call nf_verify(nf90_def_var_chunking(ncid, var_id, NF90_CHUNKED, & + (/ugc_face/)), ncid, iout) + end if + ! -- deflate and shuffle + if (deflate >= 0) then + call nf_verify(nf90_def_var_deflate(ncid, var_id, shuffle=shuffle, & + deflate=1, deflate_level=deflate), & + ncid, iout) + end if + ! + call nf_verify(nf90_put_att(ncid, var_id, '_FillValue', & + (/NF90_FILL_INT/)), ncid, iout) + call nf_verify(nf90_put_att(ncid, var_id, 'long_name', & + longname_l), ncid, iout) + if (gridmap_name /= '') then + call nf_verify(nf90_put_att(ncid, var_id, 'coordinates', & + 'mesh_face_x mesh_face_y'), ncid, iout) + call nf_verify(nf90_put_att(ncid, var_id, 'grid_mapping', gridmap_name), & + ncid, iout) + end if + ! + ! -- exit define mode and write data + call nf_verify(nf90_enddef(ncid), ncid, iout) + allocate (int1d(dis%nrow * dis%ncol)) + layer_shape(1) = dis%nrow * dis%ncol + int1d = reshape(p_mem, layer_shape) + call nf_verify(nf90_put_var(ncid, var_id, int1d), ncid, iout) + deallocate (int1d) + end subroutine nc_export_int2d + + !> @brief netcdf export 3D integer + !< + subroutine nc_export_int3d(ncid, dim_ids, var_ids, dis, p_mem, nc_varname, & + pkgname, tagname, gridmap_name, shapestr, longname, & + deflate, shuffle, ugc_face, iout) + use InputOutputModule, only: lowcase + integer(I4B), intent(in) :: ncid + type(MeshNCDimIdType), intent(inout) :: dim_ids + type(MeshNCVarIdType), intent(inout) :: var_ids + type(DisType), pointer, intent(in) :: dis + integer(I4B), dimension(:, :, :), pointer, contiguous, intent(in) :: p_mem + character(len=*), intent(in) :: nc_varname + character(len=*), intent(in) :: pkgname + character(len=*), intent(in) :: tagname + character(len=*), intent(in) :: gridmap_name + character(len=*), intent(in) :: shapestr + character(len=*), intent(in) :: longname + integer(I4B), intent(in) :: deflate + integer(I4B), intent(in) :: shuffle + integer(I4B), intent(in) :: ugc_face + integer(I4B), intent(in) :: iout + ! -- local + integer(I4B), dimension(:), allocatable :: var_id + integer(I4B), dimension(:), pointer, contiguous :: int1d + character(len=LINELENGTH) :: longname_l, varname_l + integer(I4B), dimension(1) :: layer_shape + integer(I4B) :: k + ! + allocate (var_id(dis%nlay)) + ! + ! -- reenter define mode and create variable + call nf_verify(nf90_redef(ncid), ncid, iout) + do k = 1, dis%nlay + write (varname_l, '(a,i0)') trim(nc_varname)//'_l', k + if (longname /= '') then + write (longname_l, '(a,i0,a)') trim(longname)//' (layer ', k, ')' + else + write (longname_l, '(a,i0,a)') trim(pkgname)//' '//trim(tagname)// & + ' (layer ', k, ')' + end if + call nf_verify(nf90_def_var(ncid, varname_l, NF90_INT, & + (/dim_ids%nmesh_face/), var_id(k)), & + ncid, iout) + ! + ! -- apply chunking parameters + if (ugc_face > 0) then + call nf_verify(nf90_def_var_chunking(ncid, var_id(k), NF90_CHUNKED, & + (/ugc_face/)), ncid, iout) + end if + ! -- deflate and shuffle + if (deflate >= 0) then + call nf_verify(nf90_def_var_deflate(ncid, var_id(k), shuffle=shuffle, & + deflate=1, deflate_level=deflate), & + ncid, iout) + end if + ! + call nf_verify(nf90_put_att(ncid, var_id(k), '_FillValue', & + (/NF90_FILL_INT/)), ncid, iout) + call nf_verify(nf90_put_att(ncid, var_id(k), 'long_name', & + longname_l), ncid, iout) + if (gridmap_name /= '') then + call nf_verify(nf90_put_att(ncid, var_id(k), 'coordinates', & + 'mesh_face_x mesh_face_y'), ncid, iout) + call nf_verify(nf90_put_att(ncid, var_id(k), 'grid_mapping', & + gridmap_name), ncid, iout) + end if + end do + ! + ! -- exit define mode and write data + call nf_verify(nf90_enddef(ncid), ncid, iout) + allocate (int1d(dis%nrow * dis%ncol)) + layer_shape(1) = dis%nrow * dis%ncol + do k = 1, dis%nlay + int1d = reshape(p_mem(:, :, k), layer_shape) + call nf_verify(nf90_put_var(ncid, var_id(k), int1d), ncid, iout) + end do + ! + deallocate (int1d) + deallocate (var_id) + end subroutine nc_export_int3d + + !> @brief netcdf export 1D double + !< + subroutine nc_export_dbl1d(ncid, dim_ids, x_dim, y_dim, var_ids, dis, p_mem, & + nc_varname, pkgname, tagname, gridmap_name, & + shapestr, longname, deflate, shuffle, ugc_face, iout) + use InputOutputModule, only: lowcase + integer(I4B), intent(in) :: ncid + type(MeshNCDimIdType), intent(inout) :: dim_ids + integer(I4B), intent(in) :: x_dim + integer(I4B), intent(in) :: y_dim + type(MeshNCVarIdType), intent(inout) :: var_ids + type(DisType), pointer, intent(in) :: dis + real(DP), dimension(:), pointer, contiguous, intent(in) :: p_mem + character(len=*), intent(in) :: nc_varname + character(len=*), intent(in) :: pkgname + character(len=*), intent(in) :: tagname + character(len=*), intent(in) :: gridmap_name + character(len=*), intent(in) :: shapestr + character(len=*), intent(in) :: longname + integer(I4B), intent(in) :: deflate + integer(I4B), intent(in) :: shuffle + integer(I4B), intent(in) :: ugc_face + integer(I4B), intent(in) :: iout + ! -- local + integer(I4B), dimension(3) :: dis_shape + integer(I4B), dimension(1) :: layer_shape + real(DP), dimension(:, :, :), pointer, contiguous :: dbl3d + real(DP), dimension(:), pointer, contiguous :: dbl1d + integer(I4B) :: axis_dim, k + integer(I4B), dimension(:), allocatable :: var_id + character(len=LINELENGTH) :: longname_l, varname_l + ! + if (shapestr == 'NROW' .or. & + shapestr == 'NCOL') then + ! + if (shapestr == 'NROW') then + axis_dim = y_dim + else + axis_dim = x_dim + end if + ! -- set long_name attribute + if (longname /= '') then + longname_l = trim(longname) + else + longname_l = trim(pkgname)//' '//trim(tagname) + end if + ! + allocate (var_id(1)) + ! + ! -- reenter define mode and create variable + call nf_verify(nf90_redef(ncid), ncid, iout) + call nf_verify(nf90_def_var(ncid, nc_varname, NF90_DOUBLE, & + (/axis_dim/), var_id(1)), & + ncid, iout) + ! + ! -- NROW/NCOL shapes use default chunking + if (deflate >= 0) then + call nf_verify(nf90_def_var_deflate(ncid, var_id(1), shuffle=shuffle, & + deflate=1, deflate_level=deflate), & + ncid, iout) + end if + ! + call nf_verify(nf90_put_att(ncid, var_id(1), '_FillValue', & + (/NF90_FILL_DOUBLE/)), ncid, iout) + call nf_verify(nf90_put_att(ncid, var_id(1), 'long_name', & + longname_l), ncid, iout) + ! + ! -- exit define mode and write data + call nf_verify(nf90_enddef(ncid), ncid, iout) + call nf_verify(nf90_put_var(ncid, var_id(1), p_mem), & + ncid, iout) + + else + allocate (var_id(dis%nlay)) + ! + ! -- reenter define mode and create variable + call nf_verify(nf90_redef(ncid), ncid, iout) + do k = 1, dis%nlay + write (varname_l, '(a,i0)') trim(nc_varname)//'_l', k + if (longname /= '') then + write (longname_l, '(a,i0,a)') trim(longname)//' (layer ', k, ')' + else + write (longname_l, '(a,i0,a)') trim(pkgname)//' '//trim(tagname)// & + ' (layer ', k, ')' + end if + call nf_verify(nf90_def_var(ncid, varname_l, NF90_DOUBLE, & + (/dim_ids%nmesh_face/), var_id(k)), & + ncid, iout) + ! + ! -- apply chunking parameters + if (ugc_face > 0) then + call nf_verify(nf90_def_var_chunking(ncid, var_id(k), NF90_CHUNKED, & + (/ugc_face/)), ncid, iout) + end if + ! -- deflate and shuffle + if (deflate >= 0) then + call nf_verify(nf90_def_var_deflate(ncid, var_id(k), shuffle=shuffle, & + deflate=1, deflate_level=deflate), & + ncid, iout) + end if + ! + call nf_verify(nf90_put_att(ncid, var_id(k), '_FillValue', & + (/NF90_FILL_DOUBLE/)), ncid, iout) + call nf_verify(nf90_put_att(ncid, var_id(k), 'long_name', & + longname_l), ncid, iout) + if (gridmap_name /= '') then + call nf_verify(nf90_put_att(ncid, var_id(k), 'coordinates', & + 'mesh_face_x mesh_face_y'), ncid, iout) + call nf_verify(nf90_put_att(ncid, var_id(k), 'grid_mapping', & + gridmap_name), ncid, iout) + end if + end do + ! + ! -- allocate temporary 3d and reshape input + dis_shape(1) = dis%ncol + dis_shape(2) = dis%nrow + dis_shape(3) = dis%nlay + allocate (dbl3d(dis_shape(1), dis_shape(2), dis_shape(3))) + dbl3d = reshape(p_mem, dis_shape) + ! + ! -- exit define mode and write data + call nf_verify(nf90_enddef(ncid), ncid, iout) + allocate (dbl1d(dis%nrow * dis%ncol)) + layer_shape(1) = dis%nrow * dis%ncol + do k = 1, dis%nlay + dbl1d = reshape(dbl3d(:, :, k), layer_shape) + call nf_verify(nf90_put_var(ncid, var_id(k), dbl1d), ncid, iout) + end do + ! + ! -- cleanup + deallocate (dbl1d) + deallocate (dbl3d) + deallocate (var_id) + end if + end subroutine nc_export_dbl1d + + !> @brief netcdf export 2D double + !< + subroutine nc_export_dbl2d(ncid, dim_ids, var_ids, dis, p_mem, nc_varname, & + pkgname, tagname, gridmap_name, shapestr, longname, & + deflate, shuffle, ugc_face, iout) + integer(I4B), intent(in) :: ncid + type(MeshNCDimIdType), intent(inout) :: dim_ids + type(MeshNCVarIdType), intent(inout) :: var_ids + type(DisType), pointer, intent(in) :: dis + real(DP), dimension(:, :), pointer, contiguous, intent(in) :: p_mem + character(len=*), intent(in) :: nc_varname + character(len=*), intent(in) :: pkgname + character(len=*), intent(in) :: tagname + character(len=*), intent(in) :: gridmap_name + character(len=*), intent(in) :: shapestr + character(len=*), intent(in) :: longname + integer(I4B), intent(in) :: deflate + integer(I4B), intent(in) :: shuffle + integer(I4B), intent(in) :: ugc_face + integer(I4B), intent(in) :: iout + ! -- local + integer(I4B) :: var_id + character(len=LINELENGTH) :: longname_l + real(DP), dimension(:), pointer, contiguous :: dbl1d + integer(I4B), dimension(1) :: layer_shape + ! + ! -- set long_name attribute + if (longname /= '') then + longname_l = trim(longname) + else + longname_l = trim(pkgname)//' '//trim(tagname) + end if + ! + ! -- reenter define mode and create variable + call nf_verify(nf90_redef(ncid), ncid, iout) + call nf_verify(nf90_def_var(ncid, nc_varname, NF90_DOUBLE, & + (/dim_ids%nmesh_face/), var_id), & + ncid, iout) + ! + ! -- apply chunking parameters + if (ugc_face > 0) then + call nf_verify(nf90_def_var_chunking(ncid, var_id, NF90_CHUNKED, & + (/ugc_face/)), ncid, iout) + end if + ! -- deflate and shuffle + if (deflate >= 0) then + call nf_verify(nf90_def_var_deflate(ncid, var_id, shuffle=shuffle, & + deflate=1, deflate_level=deflate), & + ncid, iout) + end if + ! + call nf_verify(nf90_put_att(ncid, var_id, '_FillValue', & + (/NF90_FILL_DOUBLE/)), ncid, iout) + call nf_verify(nf90_put_att(ncid, var_id, 'long_name', & + longname_l), ncid, iout) + if (gridmap_name /= '') then + call nf_verify(nf90_put_att(ncid, var_id, 'coordinates', & + 'mesh_face_x mesh_face_y'), ncid, iout) + call nf_verify(nf90_put_att(ncid, var_id, 'grid_mapping', gridmap_name), & + ncid, iout) + end if + ! + ! -- exit define mode and write data + call nf_verify(nf90_enddef(ncid), ncid, iout) + allocate (dbl1d(dis%nrow * dis%ncol)) + layer_shape(1) = dis%nrow * dis%ncol + dbl1d = reshape(p_mem, layer_shape) + call nf_verify(nf90_put_var(ncid, var_id, dbl1d), ncid, iout) + deallocate (dbl1d) + end subroutine nc_export_dbl2d + + !> @brief netcdf export 3D double + !< + subroutine nc_export_dbl3d(ncid, dim_ids, var_ids, dis, p_mem, nc_varname, & + pkgname, tagname, gridmap_name, shapestr, longname, & + deflate, shuffle, ugc_face, iout) + use InputOutputModule, only: lowcase + integer(I4B), intent(in) :: ncid + type(MeshNCDimIdType), intent(inout) :: dim_ids + type(MeshNCVarIdType), intent(inout) :: var_ids + type(DisType), pointer, intent(in) :: dis + real(DP), dimension(:, :, :), pointer, contiguous, intent(in) :: p_mem + character(len=*), intent(in) :: nc_varname + character(len=*), intent(in) :: pkgname + character(len=*), intent(in) :: tagname + character(len=*), intent(in) :: gridmap_name + character(len=*), intent(in) :: shapestr + character(len=*), intent(in) :: longname + integer(I4B), intent(in) :: deflate + integer(I4B), intent(in) :: shuffle + integer(I4B), intent(in) :: ugc_face + integer(I4B), intent(in) :: iout + ! -- local + integer(I4B), dimension(:), allocatable :: var_id + real(DP), dimension(:), pointer, contiguous :: dbl1d + character(len=LINELENGTH) :: longname_l, varname_l + integer(I4B), dimension(1) :: layer_shape + integer(I4B) :: k + ! + allocate (var_id(dis%nlay)) + ! + ! -- reenter define mode and create variable + call nf_verify(nf90_redef(ncid), ncid, iout) + do k = 1, dis%nlay + write (varname_l, '(a,i0)') trim(nc_varname)//'_l', k + if (longname /= '') then + write (longname_l, '(a,i0,a)') trim(longname)//' (layer ', k, ')' + else + write (longname_l, '(a,i0,a)') trim(pkgname)//' '//trim(tagname)// & + ' (layer ', k, ')' + end if + call nf_verify(nf90_def_var(ncid, varname_l, NF90_DOUBLE, & + (/dim_ids%nmesh_face/), var_id(k)), & + ncid, iout) + ! + ! -- apply chunking parameters + if (ugc_face > 0) then + call nf_verify(nf90_def_var_chunking(ncid, var_id(k), NF90_CHUNKED, & + (/ugc_face/)), ncid, iout) + end if + ! -- deflate and shuffle + if (deflate >= 0) then + call nf_verify(nf90_def_var_deflate(ncid, var_id(k), shuffle=shuffle, & + deflate=1, deflate_level=deflate), & + ncid, iout) + end if + ! + call nf_verify(nf90_put_att(ncid, var_id(k), '_FillValue', & + (/NF90_FILL_DOUBLE/)), ncid, iout) + call nf_verify(nf90_put_att(ncid, var_id(k), 'long_name', & + longname_l), ncid, iout) + if (gridmap_name /= '') then + call nf_verify(nf90_put_att(ncid, var_id(k), 'coordinates', & + 'mesh_face_x mesh_face_y'), ncid, iout) + call nf_verify(nf90_put_att(ncid, var_id(k), 'grid_mapping', & + gridmap_name), ncid, iout) + end if + end do + ! + ! -- exit define mode and write data + call nf_verify(nf90_enddef(ncid), ncid, iout) + allocate (dbl1d(dis%nrow * dis%ncol)) + layer_shape(1) = dis%nrow * dis%ncol + do k = 1, dis%nlay + dbl1d = reshape(p_mem(:, :, k), layer_shape) + call nf_verify(nf90_put_var(ncid, var_id(k), dbl1d), ncid, iout) + end do + ! + deallocate (dbl1d) + deallocate (var_id) + end subroutine nc_export_dbl3d + +end module MeshDisModelModule diff --git a/src/Utilities/Export/DisvNCMesh.f90 b/src/Utilities/Export/DisvNCMesh.f90 new file mode 100644 index 00000000000..e7d56fc75e1 --- /dev/null +++ b/src/Utilities/Export/DisvNCMesh.f90 @@ -0,0 +1,784 @@ +!> @brief This module contains the MeshDisvModelModule +!! +!! This module defines UGRID layered mesh compliant netcdf +!! export type for DISV models. It is dependent on netcdf +!! libraries. +!! +!< +module MeshDisvModelModule + + use KindModule, only: DP, I4B, LGP + use ConstantsModule, only: LINELENGTH, LENBIGLINE, LENCOMPONENTNAME, & + LENMEMPATH + use MemoryManagerModule, only: mem_setptr + use InputDefinitionModule, only: InputParamDefinitionType + use CharacterStringModule, only: CharacterStringType + use MeshModelModule, only: nf_verify, Mesh2dModelType, & + MeshNCDimIdType, MeshNCVarIdType + use DisvModule, only: DisvType + use netcdf + + implicit none + private + public :: Mesh2dDisvExportType + + ! -- UGRID layered mesh DISV + type, extends(Mesh2dModelType) :: Mesh2dDisvExportType + class(DisvType), pointer :: disv => null() !< pointer to model disv package + contains + procedure :: init => disv_export_init + procedure :: destroy => disv_export_destroy + procedure :: df + procedure :: step + procedure :: export_input_array + procedure :: define_dim + procedure :: add_mesh_data + end type Mesh2dDisvExportType + +contains + + !> @brief netcdf export disv init + !< + subroutine disv_export_init(this, modelname, modeltype, modelfname, disenum, & + nctype, iout) + use ArrayHandlersModule, only: expandarray + class(Mesh2dDisvExportType), intent(inout) :: this + character(len=*), intent(in) :: modelname + character(len=*), intent(in) :: modeltype + character(len=*), intent(in) :: modelfname + integer(I4B), intent(in) :: disenum + integer(I4B), intent(in) :: nctype + integer(I4B), intent(in) :: iout + ! + ! -- set nlay + this%nlay = this%disv%nlay + ! + ! allocate var_id arrays + allocate (this%var_ids%dependent(this%nlay)) + ! + ! -- initialize base class + call this%mesh_init(modelname, modeltype, modelfname, disenum, nctype, iout) + end subroutine disv_export_init + + !> @brief netcdf export disv destroy + !< + subroutine disv_export_destroy(this) + use SimVariablesModule, only: idm_context + use MemoryManagerExtModule, only: memorystore_remove + class(Mesh2dDisvExportType), intent(inout) :: this + call nf_verify(nf90_close(this%ncid), this%ncid, this%iout) + ! + ! -- destroy base class + call this%NCModelExportType%destroy() + ! + ! -- Deallocate idm memory + if (this%ncf_mempath /= '') then + call memorystore_remove(this%modelname, 'NCF', idm_context) + end if + end subroutine disv_export_destroy + + !> @brief netcdf export define + !< + subroutine df(this) + class(Mesh2dDisvExportType), intent(inout) :: this + ! -- put root group file scope attributes + call this%add_global_att() + ! -- define root group dimensions and coordinate variables + call this%define_dim() + ! -- define mesh variables + call this%create_mesh() + ! -- define the dependent variable + call this%define_dependent() + ! -- exit define mode + call nf_verify(nf90_enddef(this%ncid), this%ncid, this%iout) + ! -- create mesh + call this%add_mesh_data() + ! -- define and set package input griddata + call this%add_pkg_data() + ! -- define and set gridmap variable + call this%define_gridmap() + ! -- synchronize file + call nf_verify(nf90_sync(this%ncid), this%ncid, this%iout) + end subroutine df + + !> @brief netcdf export step + !< + subroutine step(this) + use ConstantsModule, only: DHNOFLO + use TdisModule, only: totim + class(Mesh2dDisvExportType), intent(inout) :: this + real(DP), dimension(:), pointer, contiguous :: dbl1d + integer(I4B) :: n, k + integer(I4B), dimension(2) :: dis_shape + real(DP), dimension(:, :), pointer, contiguous :: dbl2d + ! + ! -- increment step + this%stepcnt = this%stepcnt + 1 + ! + dis_shape(1) = this%disv%ncpl + dis_shape(2) = this%disv%nlay + allocate (dbl2d(dis_shape(1), dis_shape(2))) + ! + ! -- add data to dependent variable + if (size(this%disv%nodeuser) < & + size(this%disv%nodereduced)) then + ! + ! -- allocate nodereduced size 1d array + allocate (dbl1d(size(this%disv%nodereduced))) + ! + ! -- initialize DHNOFLO for non-active cells + dbl1d = DHNOFLO + ! + ! -- update active cells + do n = 1, size(this%disv%nodereduced) + if (this%disv%nodereduced(n) > 0) then + dbl1d(n) = this%x(this%disv%nodereduced(n)) + end if + end do + ! + dbl2d = reshape(dbl1d, dis_shape) + ! + deallocate (dbl1d) + else + ! + dbl2d = reshape(this%x, dis_shape) + ! + end if + ! + do k = 1, this%disv%nlay + ! -- extend array with step data + call nf_verify(nf90_put_var(this%ncid, & + this%var_ids%dependent(k), dbl2d(:, k), & + start=(/1, this%stepcnt/), & + count=(/this%disv%ncpl, 1/)), & + this%ncid, this%iout) + end do + ! + ! -- write to time coordinate variable + call nf_verify(nf90_put_var(this%ncid, this%var_ids%time, & + totim, start=(/this%stepcnt/)), & + this%ncid, this%iout) + ! + ! -- update file + call nf_verify(nf90_sync(this%ncid), this%ncid, this%iout) + ! + ! -- cleanup + deallocate (dbl2d) + end subroutine step + + !> @brief netcdf export an input array + !< + subroutine export_input_array(this, pkgname, mempath, idt) + use InputOutputModule, only: lowcase + class(Mesh2dDisvExportType), intent(inout) :: this + character(len=*), intent(in) :: pkgname + character(len=*), intent(in) :: mempath + type(InputParamDefinitionType), pointer, intent(in) :: idt + integer(I4B), dimension(:), pointer, contiguous :: int1d + integer(I4B), dimension(:, :), pointer, contiguous :: int2d + real(DP), dimension(:), pointer, contiguous :: dbl1d + real(DP), dimension(:, :), pointer, contiguous :: dbl2d + character(len=LINELENGTH) :: pname, vname, nc_varname, gridmap + ! + ! -- set package name + pname = pkgname + call lowcase(pname) + ! -- set variable name + vname = idt%tagname + call lowcase(vname) + ! -- set variable name written to file + nc_varname = trim(pname)//'_'//trim(vname) + ! + if (this%ogc_wkt /= '') then + ! -- set gridmap variable name + gridmap = this%gridmap_name + else + gridmap = '' + end if + ! + select case (idt%datatype) + case ('INTEGER1D') + call mem_setptr(int1d, idt%mf6varname, mempath) + call nc_export_int1d(this%ncid, this%dim_ids, this%var_ids, this%disv, & + int1d, nc_varname, pkgname, idt%tagname, gridmap, & + idt%shape, idt%longname, this%deflate, this%shuffle, & + this%ugc_face, this%iout) + case ('INTEGER2D') + call mem_setptr(int2d, idt%mf6varname, mempath) + call nc_export_int2d(this%ncid, this%dim_ids, this%var_ids, this%disv, & + int2d, nc_varname, pkgname, idt%tagname, gridmap, & + idt%shape, idt%longname, this%deflate, this%shuffle, & + this%ugc_face, this%iout) + case ('DOUBLE1D') + call mem_setptr(dbl1d, idt%mf6varname, mempath) + call nc_export_dbl1d(this%ncid, this%dim_ids, this%var_ids, this%disv, & + dbl1d, nc_varname, pkgname, idt%tagname, gridmap, & + idt%shape, idt%longname, this%deflate, this%shuffle, & + this%ugc_face, this%iout) + case ('DOUBLE2D') + call mem_setptr(dbl2d, idt%mf6varname, mempath) + call nc_export_dbl2d(this%ncid, this%dim_ids, this%var_ids, this%disv, & + dbl2d, nc_varname, pkgname, idt%tagname, gridmap, & + idt%shape, idt%longname, this%deflate, this%shuffle, & + this%ugc_face, this%iout) + case default + ! -- no-op, no other datatypes exported + end select + end subroutine export_input_array + + !> @brief netcdf export define dimensions + !< + subroutine define_dim(this) + class(Mesh2dDisvExportType), intent(inout) :: this + integer(I4B), dimension(:), contiguous, pointer :: ncvert + integer(I4B) :: ncpl_dim + ! + ! -- set pointers to input context + call mem_setptr(ncvert, 'NCVERT', this%dis_mempath) + ! + ! -- time + call nf_verify(nf90_def_dim(this%ncid, 'time', this%totnstp, & + this%dim_ids%time), this%ncid, this%iout) + call nf_verify(nf90_def_var(this%ncid, 'time', NF90_DOUBLE, & + this%dim_ids%time, this%var_ids%time), & + this%ncid, this%iout) + call nf_verify(nf90_put_att(this%ncid, this%var_ids%time, 'calendar', & + 'standard'), this%ncid, this%iout) + call nf_verify(nf90_put_att(this%ncid, this%var_ids%time, 'units', & + this%datetime), this%ncid, this%iout) + call nf_verify(nf90_put_att(this%ncid, this%var_ids%time, 'axis', 'T'), & + this%ncid, this%iout) + call nf_verify(nf90_put_att(this%ncid, this%var_ids%time, 'standard_name', & + 'time'), this%ncid, this%iout) + call nf_verify(nf90_put_att(this%ncid, this%var_ids%time, 'long_name', & + 'time'), this%ncid, this%iout) + ! + ! -- mesh + call nf_verify(nf90_def_dim(this%ncid, 'nmesh_node', this%disv%nvert, & + this%dim_ids%nmesh_node), this%ncid, this%iout) + call nf_verify(nf90_def_dim(this%ncid, 'nmesh_face', this%disv%ncpl, & + this%dim_ids%nmesh_face), this%ncid, this%iout) + call nf_verify(nf90_def_dim(this%ncid, 'max_nmesh_face_nodes', & + maxval(ncvert), & + this%dim_ids%max_nmesh_face_nodes), & + this%ncid, this%iout) + ! + ! -- ncpl, nlay + call nf_verify(nf90_def_dim(this%ncid, 'nlay', this%disv%nlay, & + this%dim_ids%nlay), this%ncid, this%iout) + call nf_verify(nf90_def_dim(this%ncid, 'ncpl', this%disv%ncpl, & + ncpl_dim), this%ncid, this%iout) + end subroutine define_dim + + !> @brief netcdf export add mesh information + !< + subroutine add_mesh_data(this) + class(Mesh2dDisvExportType), intent(inout) :: this + integer(I4B), dimension(:), contiguous, pointer :: icell2d => null() + integer(I4B), dimension(:), contiguous, pointer :: ncvert => null() + integer(I4B), dimension(:), contiguous, pointer :: icvert => null() + real(DP), dimension(:), contiguous, pointer :: cell_x => null() + real(DP), dimension(:), contiguous, pointer :: cell_y => null() + real(DP), dimension(:), contiguous, pointer :: vert_x => null() + real(DP), dimension(:), contiguous, pointer :: vert_y => null() + integer(I4B) :: n, m, idx, cnt, iv, maxvert + integer(I4B), dimension(:), allocatable :: verts + real(DP), dimension(:), allocatable :: bnds + integer(I4B) :: istop + ! + ! -- set pointers to input context + call mem_setptr(icell2d, 'ICELL2D', this%dis_mempath) + call mem_setptr(ncvert, 'NCVERT', this%dis_mempath) + call mem_setptr(icvert, 'ICVERT', this%dis_mempath) + call mem_setptr(cell_x, 'XC', this%dis_mempath) + call mem_setptr(cell_y, 'YC', this%dis_mempath) + call mem_setptr(vert_x, 'XV', this%dis_mempath) + call mem_setptr(vert_y, 'YV', this%dis_mempath) + ! + ! -- initialize max vertices required to define cell + maxvert = maxval(ncvert) + ! + ! -- set mesh container variable value to 1 + call nf_verify(nf90_put_var(this%ncid, this%var_ids%mesh, 1), & + this%ncid, this%iout) + ! + ! -- allocate temporary arrays + allocate (verts(maxvert)) + allocate (bnds(maxvert)) + ! + ! -- write node_x and node_y arrays to netcdf file + call nf_verify(nf90_put_var(this%ncid, this%var_ids%mesh_node_x, & + vert_x + this%disv%xorigin), this%ncid, this%iout) + call nf_verify(nf90_put_var(this%ncid, this%var_ids%mesh_node_y, & + vert_y + this%disv%yorigin), this%ncid, this%iout) + ! + ! -- write face_x and face_y arrays to netcdf file + call nf_verify(nf90_put_var(this%ncid, this%var_ids%mesh_face_x, & + cell_x + this%disv%xorigin), this%ncid, this%iout) + call nf_verify(nf90_put_var(this%ncid, this%var_ids%mesh_face_y, & + cell_y + this%disv%yorigin), this%ncid, this%iout) + ! + ! -- set face nodes array + cnt = 0 + do n = 1, size(ncvert) + verts = NF90_FILL_INT + idx = cnt + ncvert(n) + iv = 0 + istop = cnt + 1 + do m = idx, istop, -1 + cnt = cnt + 1 + iv = iv + 1 + verts(iv) = icvert(m) + end do + ! + ! -- write face nodes array to netcdf file + call nf_verify(nf90_put_var(this%ncid, this%var_ids%mesh_face_nodes, & + verts, start=(/1, n/), & + count=(/maxvert, 1/)), & + this%ncid, this%iout) + ! + ! -- set face y bounds array + bnds = NF90_FILL_DOUBLE + do m = 1, size(bnds) + if (verts(m) /= NF90_FILL_INT) then + bnds(m) = vert_y(verts(m)) + end if + ! -- write face y bounds array to netcdf file + call nf_verify(nf90_put_var(this%ncid, this%var_ids%mesh_face_ybnds, & + bnds, start=(/1, n/), & + count=(/maxvert, 1/)), & + this%ncid, this%iout) + end do + ! + ! -- set face x bounds array + bnds = NF90_FILL_DOUBLE + do m = 1, size(bnds) + if (verts(m) /= NF90_FILL_INT) then + bnds(m) = vert_x(verts(m)) + end if + ! -- write face x bounds array to netcdf file + call nf_verify(nf90_put_var(this%ncid, this%var_ids%mesh_face_xbnds, & + bnds, start=(/1, n/), & + count=(/maxvert, 1/)), & + this%ncid, this%iout) + end do + end do + ! + ! -- cleanup + deallocate (bnds) + deallocate (verts) + end subroutine add_mesh_data + + !> @brief netcdf export 1D integer array + !< + subroutine nc_export_int1d(ncid, dim_ids, var_ids, dis, p_mem, nc_varname, & + pkgname, tagname, gridmap_name, shapestr, longname, & + deflate, shuffle, ugc_face, iout) + use InputOutputModule, only: lowcase + integer(I4B), intent(in) :: ncid + type(MeshNCDimIdType), intent(inout) :: dim_ids + type(MeshNCVarIdType), intent(inout) :: var_ids + type(DisvType), pointer, intent(in) :: dis + integer(I4B), dimension(:), pointer, contiguous, intent(in) :: p_mem + character(len=*), intent(in) :: nc_varname + character(len=*), intent(in) :: pkgname + character(len=*), intent(in) :: tagname + character(len=*), intent(in) :: gridmap_name + character(len=*), intent(in) :: shapestr + character(len=*), intent(in) :: longname + integer(I4B), intent(in) :: deflate + integer(I4B), intent(in) :: shuffle + integer(I4B), intent(in) :: ugc_face + integer(I4B), intent(in) :: iout + ! -- local + integer(I4B), dimension(2) :: dis_shape + integer(I4B), dimension(:, :), pointer, contiguous :: int2d + integer(I4B) :: axis_sz, k + integer(I4B), dimension(:), allocatable :: var_id + character(len=LINELENGTH) :: longname_l, varname_l + ! + if (shapestr == 'NCPL') then + ! -- set long_name attribute + if (longname /= '') then + longname_l = trim(longname) + else + longname_l = trim(pkgname)//' '//trim(tagname) + end if + ! + allocate (var_id(1)) + axis_sz = dim_ids%nmesh_face + ! + ! -- reenter define mode and create variable + call nf_verify(nf90_redef(ncid), ncid, iout) + call nf_verify(nf90_def_var(ncid, nc_varname, NF90_INT, & + (/axis_sz/), var_id(1)), & + ncid, iout) + ! + ! -- apply chunking parameters + if (ugc_face > 0) then + call nf_verify(nf90_def_var_chunking(ncid, var_id(1), NF90_CHUNKED, & + (/ugc_face/)), ncid, iout) + end if + ! -- deflate and shuffle + if (deflate >= 0) then + call nf_verify(nf90_def_var_deflate(ncid, var_id(1), shuffle=shuffle, & + deflate=1, deflate_level=deflate), & + ncid, iout) + end if + ! + call nf_verify(nf90_put_att(ncid, var_id(1), '_FillValue', & + (/NF90_FILL_INT/)), ncid, iout) + call nf_verify(nf90_put_att(ncid, var_id(1), 'long_name', & + longname_l), ncid, iout) + if (gridmap_name /= '') then + call nf_verify(nf90_put_att(ncid, var_id(1), 'coordinates', & + 'mesh_face_x mesh_face_y'), ncid, iout) + call nf_verify(nf90_put_att(ncid, var_id(1), 'grid_mapping', & + gridmap_name), ncid, iout) + end if + ! + ! -- exit define mode and write data + call nf_verify(nf90_enddef(ncid), ncid, iout) + call nf_verify(nf90_put_var(ncid, var_id(1), p_mem), & + ncid, iout) + + else + allocate (var_id(dis%nlay)) + ! + ! -- reenter define mode and create variable + call nf_verify(nf90_redef(ncid), ncid, iout) + do k = 1, dis%nlay + write (varname_l, '(a,i0)') trim(nc_varname)//'_l', k + if (longname /= '') then + write (longname_l, '(a,i0,a)') trim(longname)//' (layer ', k, ')' + else + write (longname_l, '(a,i0,a)') trim(pkgname)//' '//trim(tagname)// & + ' (layer ', k, ')' + end if + call nf_verify(nf90_def_var(ncid, varname_l, NF90_INT, & + (/dim_ids%nmesh_face/), var_id(k)), & + ncid, iout) + ! + ! -- apply chunking parameters + if (ugc_face > 0) then + call nf_verify(nf90_def_var_chunking(ncid, var_id(k), NF90_CHUNKED, & + (/ugc_face/)), ncid, iout) + end if + ! -- deflate and shuffle + if (deflate >= 0) then + call nf_verify(nf90_def_var_deflate(ncid, var_id(k), shuffle=shuffle, & + deflate=1, deflate_level=deflate), & + ncid, iout) + end if + ! + call nf_verify(nf90_put_att(ncid, var_id(k), '_FillValue', & + (/NF90_FILL_INT/)), ncid, iout) + call nf_verify(nf90_put_att(ncid, var_id(k), 'long_name', & + longname_l), ncid, iout) + if (gridmap_name /= '') then + call nf_verify(nf90_put_att(ncid, var_id(k), 'coordinates', & + 'mesh_face_x mesh_face_y'), ncid, iout) + call nf_verify(nf90_put_att(ncid, var_id(k), 'grid_mapping', & + gridmap_name), ncid, iout) + end if + end do + ! + ! -- allocate temporary 3d and reshape input + dis_shape(1) = dis%ncpl + dis_shape(2) = dis%nlay + allocate (int2d(dis_shape(1), dis_shape(2))) + int2d = reshape(p_mem, dis_shape) + ! + ! -- exit define mode and write data + call nf_verify(nf90_enddef(ncid), ncid, iout) + do k = 1, dis%nlay + call nf_verify(nf90_put_var(ncid, var_id(k), int2d(:, k)), ncid, iout) + end do + ! + ! -- cleanup + deallocate (int2d) + deallocate (var_id) + end if + end subroutine nc_export_int1d + + !> @brief netcdf export 2D integer array + !< + subroutine nc_export_int2d(ncid, dim_ids, var_ids, disv, p_mem, nc_varname, & + pkgname, tagname, gridmap_name, shapestr, longname, & + deflate, shuffle, ugc_face, iout) + integer(I4B), intent(in) :: ncid + type(MeshNCDimIdType), intent(inout) :: dim_ids + type(MeshNCVarIdType), intent(inout) :: var_ids + type(DisvType), pointer, intent(in) :: disv + integer(I4B), dimension(:, :), pointer, contiguous, intent(in) :: p_mem + character(len=*), intent(in) :: nc_varname + character(len=*), intent(in) :: pkgname + character(len=*), intent(in) :: tagname + character(len=*), intent(in) :: gridmap_name + character(len=*), intent(in) :: shapestr + character(len=*), intent(in) :: longname + integer(I4B), intent(in) :: deflate + integer(I4B), intent(in) :: shuffle + integer(I4B), intent(in) :: ugc_face + integer(I4B), intent(in) :: iout + ! -- local + integer(I4B), dimension(:), allocatable :: var_id + character(len=LINELENGTH) :: longname_l, varname_l + integer(I4B) :: k + ! + allocate (var_id(disv%nlay)) + ! + ! -- reenter define mode and create variable + call nf_verify(nf90_redef(ncid), ncid, iout) + do k = 1, disv%nlay + write (varname_l, '(a,i0)') trim(nc_varname)//'_l', k + if (longname /= '') then + write (longname_l, '(a,i0,a)') trim(longname)//' (layer ', k, ')' + else + write (longname_l, '(a,i0,a)') trim(pkgname)//' '//trim(tagname)// & + ' (layer ', k, ')' + end if + call nf_verify(nf90_def_var(ncid, varname_l, NF90_INT, & + (/dim_ids%nmesh_face/), var_id(k)), & + ncid, iout) + ! + ! -- apply chunking parameters + if (ugc_face > 0) then + call nf_verify(nf90_def_var_chunking(ncid, var_id(k), NF90_CHUNKED, & + (/ugc_face/)), ncid, iout) + end if + ! -- deflate and shuffle + if (deflate >= 0) then + call nf_verify(nf90_def_var_deflate(ncid, var_id(k), shuffle=shuffle, & + deflate=1, deflate_level=deflate), & + ncid, iout) + end if + ! + call nf_verify(nf90_put_att(ncid, var_id(k), '_FillValue', & + (/NF90_FILL_INT/)), ncid, iout) + call nf_verify(nf90_put_att(ncid, var_id(k), 'long_name', & + longname_l), ncid, iout) + if (gridmap_name /= '') then + call nf_verify(nf90_put_att(ncid, var_id(k), 'coordinates', & + 'mesh_face_x mesh_face_y'), ncid, iout) + call nf_verify(nf90_put_att(ncid, var_id(k), 'grid_mapping', & + gridmap_name), ncid, iout) + end if + end do + ! + ! -- exit define mode and write data + call nf_verify(nf90_enddef(ncid), ncid, iout) + do k = 1, disv%nlay + call nf_verify(nf90_put_var(ncid, var_id(k), p_mem(:, k)), ncid, iout) + end do + ! + deallocate (var_id) + end subroutine nc_export_int2d + + !> @brief netcdf export 1D double array + !< + subroutine nc_export_dbl1d(ncid, dim_ids, var_ids, dis, p_mem, nc_varname, & + pkgname, tagname, gridmap_name, shapestr, longname, & + deflate, shuffle, ugc_face, iout) + use InputOutputModule, only: lowcase + integer(I4B), intent(in) :: ncid + type(MeshNCDimIdType), intent(inout) :: dim_ids + type(MeshNCVarIdType), intent(inout) :: var_ids + type(DisvType), pointer, intent(in) :: dis + real(DP), dimension(:), pointer, contiguous, intent(in) :: p_mem + character(len=*), intent(in) :: nc_varname + character(len=*), intent(in) :: pkgname + character(len=*), intent(in) :: tagname + character(len=*), intent(in) :: gridmap_name + character(len=*), intent(in) :: shapestr + character(len=*), intent(in) :: longname + integer(I4B), intent(in) :: deflate + integer(I4B), intent(in) :: shuffle + integer(I4B), intent(in) :: ugc_face + integer(I4B), intent(in) :: iout + ! -- local + integer(I4B), dimension(2) :: dis_shape + real(DP), dimension(:, :), pointer, contiguous :: dbl2d + integer(I4B) :: axis_sz, k + integer(I4B), dimension(:), allocatable :: var_id + character(len=LINELENGTH) :: longname_l, varname_l + ! + if (shapestr == 'NCPL') then + ! -- set long_name attribute + if (longname /= '') then + longname_l = trim(longname) + else + longname_l = trim(pkgname)//' '//trim(tagname) + end if + ! + allocate (var_id(1)) + axis_sz = dim_ids%nmesh_face + ! + ! -- reenter define mode and create variable + call nf_verify(nf90_redef(ncid), ncid, iout) + call nf_verify(nf90_def_var(ncid, nc_varname, NF90_DOUBLE, & + (/axis_sz/), var_id(1)), & + ncid, iout) + ! + ! -- apply chunking parameters + if (ugc_face > 0) then + call nf_verify(nf90_def_var_chunking(ncid, var_id(1), NF90_CHUNKED, & + (/ugc_face/)), ncid, iout) + end if + ! -- deflate and shuffle + if (deflate >= 0) then + call nf_verify(nf90_def_var_deflate(ncid, var_id(1), shuffle=shuffle, & + deflate=1, deflate_level=deflate), & + ncid, iout) + end if + ! + call nf_verify(nf90_put_att(ncid, var_id(1), '_FillValue', & + (/NF90_FILL_DOUBLE/)), ncid, iout) + call nf_verify(nf90_put_att(ncid, var_id(1), 'long_name', & + longname_l), ncid, iout) + if (gridmap_name /= '') then + call nf_verify(nf90_put_att(ncid, var_id(1), 'coordinates', & + 'mesh_face_x mesh_face_y'), ncid, iout) + call nf_verify(nf90_put_att(ncid, var_id(1), 'grid_mapping', & + gridmap_name), ncid, iout) + end if + ! + ! -- exit define mode and write data + call nf_verify(nf90_enddef(ncid), ncid, iout) + call nf_verify(nf90_put_var(ncid, var_id(1), p_mem), & + ncid, iout) + + else + allocate (var_id(dis%nlay)) + ! + ! -- reenter define mode and create variable + call nf_verify(nf90_redef(ncid), ncid, iout) + do k = 1, dis%nlay + write (varname_l, '(a,i0)') trim(nc_varname)//'_l', k + if (longname /= '') then + write (longname_l, '(a,i0,a)') trim(longname)//' (layer ', k, ')' + else + write (longname_l, '(a,i0,a)') trim(pkgname)//' '//trim(tagname)// & + ' (layer ', k, ')' + end if + call nf_verify(nf90_def_var(ncid, varname_l, NF90_DOUBLE, & + (/dim_ids%nmesh_face/), var_id(k)), & + ncid, iout) + ! + ! -- apply chunking parameters + if (ugc_face > 0) then + call nf_verify(nf90_def_var_chunking(ncid, var_id(k), NF90_CHUNKED, & + (/ugc_face/)), ncid, iout) + end if + ! -- deflate and shuffle + if (deflate >= 0) then + call nf_verify(nf90_def_var_deflate(ncid, var_id(k), shuffle=shuffle, & + deflate=1, deflate_level=deflate), & + ncid, iout) + end if + ! + call nf_verify(nf90_put_att(ncid, var_id(k), '_FillValue', & + (/NF90_FILL_DOUBLE/)), ncid, iout) + call nf_verify(nf90_put_att(ncid, var_id(k), 'long_name', & + longname_l), ncid, iout) + if (gridmap_name /= '') then + call nf_verify(nf90_put_att(ncid, var_id(k), 'coordinates', & + 'mesh_face_x mesh_face_y'), ncid, iout) + call nf_verify(nf90_put_att(ncid, var_id(k), 'grid_mapping', & + gridmap_name), ncid, iout) + end if + end do + ! + ! -- allocate temporary 3d and reshape input + dis_shape(1) = dis%ncpl + dis_shape(2) = dis%nlay + allocate (dbl2d(dis_shape(1), dis_shape(2))) + dbl2d = reshape(p_mem, dis_shape) + ! + ! -- exit define mode and write data + call nf_verify(nf90_enddef(ncid), ncid, iout) + do k = 1, dis%nlay + call nf_verify(nf90_put_var(ncid, var_id(k), dbl2d(:, k)), ncid, iout) + end do + ! + ! -- cleanup + deallocate (dbl2d) + deallocate (var_id) + end if + end subroutine nc_export_dbl1d + + !> @brief netcdf export 2D double array + !< + subroutine nc_export_dbl2d(ncid, dim_ids, var_ids, disv, p_mem, nc_varname, & + pkgname, tagname, gridmap_name, shapestr, longname, & + deflate, shuffle, ugc_face, iout) + integer(I4B), intent(in) :: ncid + type(MeshNCDimIdType), intent(inout) :: dim_ids + type(MeshNCVarIdType), intent(inout) :: var_ids + type(DisvType), pointer, intent(in) :: disv + real(DP), dimension(:, :), pointer, contiguous, intent(in) :: p_mem + character(len=*), intent(in) :: nc_varname + character(len=*), intent(in) :: pkgname + character(len=*), intent(in) :: tagname + character(len=*), intent(in) :: gridmap_name + character(len=*), intent(in) :: shapestr + character(len=*), intent(in) :: longname + integer(I4B), intent(in) :: deflate + integer(I4B), intent(in) :: shuffle + integer(I4B), intent(in) :: ugc_face + integer(I4B), intent(in) :: iout + ! -- local + integer(I4B), dimension(:), allocatable :: var_id + character(len=LINELENGTH) :: longname_l, varname_l + integer(I4B) :: k + ! + allocate (var_id(disv%nlay)) + ! + ! -- reenter define mode and create variable + call nf_verify(nf90_redef(ncid), ncid, iout) + do k = 1, disv%nlay + write (varname_l, '(a,i0)') trim(nc_varname)//'_l', k + if (longname /= '') then + write (longname_l, '(a,i0,a)') trim(longname)//' (layer ', k, ')' + else + write (longname_l, '(a,i0)') trim(pkgname)//' '//trim(tagname)// & + ' (layer ', k, ')' + end if + call nf_verify(nf90_def_var(ncid, varname_l, NF90_DOUBLE, & + (/dim_ids%nmesh_face/), var_id(k)), & + ncid, iout) + ! + ! -- apply chunking parameters + if (ugc_face > 0) then + call nf_verify(nf90_def_var_chunking(ncid, var_id(k), NF90_CHUNKED, & + (/ugc_face/)), ncid, iout) + end if + ! -- deflate and shuffle + if (deflate >= 0) then + call nf_verify(nf90_def_var_deflate(ncid, var_id(k), shuffle=shuffle, & + deflate=1, deflate_level=deflate), & + ncid, iout) + end if + ! + call nf_verify(nf90_put_att(ncid, var_id(k), '_FillValue', & + (/NF90_FILL_DOUBLE/)), ncid, iout) + call nf_verify(nf90_put_att(ncid, var_id(k), 'long_name', & + longname_l), ncid, iout) + if (gridmap_name /= '') then + call nf_verify(nf90_put_att(ncid, var_id(k), 'coordinates', & + 'mesh_face_x mesh_face_y'), ncid, iout) + call nf_verify(nf90_put_att(ncid, var_id(k), 'grid_mapping', & + gridmap_name), ncid, iout) + end if + end do + ! + ! -- exit define mode and write data + call nf_verify(nf90_enddef(ncid), ncid, iout) + do k = 1, disv%nlay + call nf_verify(nf90_put_var(ncid, var_id(k), p_mem(:, k)), ncid, iout) + end do + ! + deallocate (var_id) + end subroutine nc_export_dbl2d + +end module MeshDisvModelModule diff --git a/src/Utilities/Export/MeshNCModel.f90 b/src/Utilities/Export/MeshNCModel.f90 new file mode 100644 index 00000000000..1f7139edd00 --- /dev/null +++ b/src/Utilities/Export/MeshNCModel.f90 @@ -0,0 +1,554 @@ +!> @brief This module contains the MeshModelModule +!! +!! This module defines a base class for UGRID based +!! (mesh) model netcdf exports. It is dependent on +!! external netcdf libraries. +!< +module MeshModelModule + + use KindModule, only: DP, I4B, LGP + use ConstantsModule, only: LINELENGTH, LENCOMPONENTNAME, LENMEMPATH, & + DNODATA, DHNOFLO + use SimVariablesModule, only: errmsg + use SimModule, only: store_error, store_error_filename + use MemoryManagerModule, only: mem_setptr + use InputDefinitionModule, only: InputParamDefinitionType + use CharacterStringModule, only: CharacterStringType + use NCModelExportModule, only: NCBaseModelExportType + use netcdf + + implicit none + private + public :: nf_verify + public :: MeshNCDimIdType, MeshNCVarIdType + public :: Mesh2dModelType + + !> @brief type for storing model export dimension ids + !< + type :: MeshNCDimIdType + integer(I4B) :: nmesh_node !< number of nodes in mesh + integer(I4B) :: nmesh_face !< number of faces in mesh + integer(I4B) :: max_nmesh_face_nodes !< max number of nodes in a single face + integer(I4B) :: nlay !< number of layers + integer(I4B) :: time !< number of steps + contains + end type MeshNCDimIdType + + !> @brief type for storing model export variable ids + !< + type :: MeshNCVarIdType + integer(I4B) :: mesh !< mesh container variable + integer(I4B) :: mesh_node_x !< mesh nodes x array + integer(I4B) :: mesh_node_y !< mesh nodes y array + integer(I4B) :: mesh_face_x !< mesh faces x location array + integer(I4B) :: mesh_face_y !< mesh faces y location array + integer(I4B) :: mesh_face_xbnds !< mesh faces 2D x bounds array + integer(I4B) :: mesh_face_ybnds !< mesh faces 2D y bounds array + integer(I4B) :: mesh_face_nodes !< mesh faces 2D nodes array + integer(I4B) :: time !< time coordinate variable + integer(I4B), dimension(:), allocatable :: dependent !< layered dependent variables array + contains + end type MeshNCVarIdType + + !> @brief base ugrid netcdf export type + !< + type, abstract, extends(NCBaseModelExportType) :: MeshModelType + type(MeshNCDimIdType) :: dim_ids !< dimension ids + type(MeshNCVarIdType) :: var_ids !< variable ids + integer(I4B) :: nlay !< number of layers + integer(I4B), pointer :: ugc_time !< chunking parameter for time dimension + integer(I4B), pointer :: ugc_face !< chunking parameter for face dimension + contains + procedure :: mesh_init + procedure :: add_global_att + procedure(nc_array_export_if), deferred :: export_input_array + procedure :: export_input_arrays + procedure :: add_pkg_data + procedure :: define_dependent + procedure :: define_gridmap + end type MeshModelType + + !> @brief abstract interfaces for derived ugrid netcd export types + !< + abstract interface + subroutine nc_array_export_if(this, pkgname, mempath, idt) + import MeshModelType, InputParamDefinitionType, LGP + class(MeshModelType), intent(inout) :: this + character(len=*), intent(in) :: pkgname + character(len=*), intent(in) :: mempath + type(InputParamDefinitionType), pointer, intent(in) :: idt + end subroutine + end interface + + type, abstract, extends(MeshModelType) :: Mesh2dModelType + contains + procedure :: create_mesh + end type Mesh2dModelType + +contains + + !> @brief initialize + !< + subroutine mesh_init(this, modelname, modeltype, modelfname, disenum, & + nctype, iout) + use MemoryManagerExtModule, only: mem_set_value + class(MeshModelType), intent(inout) :: this + character(len=*), intent(in) :: modelname + character(len=*), intent(in) :: modeltype + character(len=*), intent(in) :: modelfname + integer(I4B), intent(in) :: disenum + integer(I4B), intent(in) :: nctype + integer(I4B), intent(in) :: iout + logical(LGP) :: found + ! + ! -- initialize base class + call this%NCModelExportType%init(modelname, modeltype, modelfname, disenum, & + nctype, iout) + ! + ! -- allocate and initialize + allocate (this%ugc_time) + allocate (this%ugc_face) + this%ugc_time = -1 + this%ugc_face = -1 + ! + ! -- update values from input context + if (this%ncf_mempath /= '') then + call mem_set_value(this%ugc_time, 'UGC_TIME', this%ncf_mempath, found) + call mem_set_value(this%ugc_face, 'UGC_FACE', this%ncf_mempath, found) + end if + ! + ! -- create the netcdf file + call nf_verify(nf90_create(this%nc_filename, & + IOR(NF90_CLOBBER, NF90_NETCDF4), this%ncid), & + this%ncid, this%iout) + end subroutine mesh_init + + !> @brief create file (group) attributes + !< + subroutine add_global_att(this) + class(MeshModelType), intent(inout) :: this + ! -- file scoped title + call nf_verify(nf90_put_att(this%ncid, NF90_GLOBAL, 'title', & + this%annotation%title), this%ncid, this%iout) + ! -- source (MODFLOW 6) + call nf_verify(nf90_put_att(this%ncid, NF90_GLOBAL, 'source', & + this%annotation%source), this%ncid, this%iout) + ! -- MODFLOW 6 model type + call nf_verify(nf90_put_att(this%ncid, NF90_GLOBAL, 'model', & + this%annotation%model), this%ncid, this%iout) + ! -- generation datetime + call nf_verify(nf90_put_att(this%ncid, NF90_GLOBAL, 'history', & + this%annotation%history), this%ncid, this%iout) + ! -- supported conventions + call nf_verify(nf90_put_att(this%ncid, NF90_GLOBAL, 'Conventions', & + this%annotation%conventions), & + this%ncid, this%iout) + end subroutine add_global_att + + !> @brief write package gridded input data + !< + subroutine export_input_arrays(this, pkgname, mempath, param_dfns) + use MemoryManagerModule, only: get_isize + class(MeshModelType), intent(inout) :: this + character(len=*), intent(in) :: pkgname + character(len=*), intent(in) :: mempath + type(InputParamDefinitionType), dimension(:), pointer, & + intent(in) :: param_dfns + type(InputParamDefinitionType), pointer :: idt + integer(I4B) :: iparam, isize + ! + ! -- export griddata block parameters + do iparam = 1, size(param_dfns) + ! -- assign param definition pointer + idt => param_dfns(iparam) + ! -- for now + if (idt%blockname == 'GRIDDATA') then + ! -- veriy variable is allocated + call get_isize(idt%mf6varname, mempath, isize) + ! + if (isize > 0) then + call this%export_input_array(pkgname, mempath, idt) + end if + end if + end do + end subroutine export_input_arrays + + !> @brief determine packages to write gridded input + !< + subroutine add_pkg_data(this) + use SimVariablesModule, only: idm_context + use MemoryManagerExtModule, only: mem_set_value + use MemoryHelperModule, only: create_mem_path + use IdmDfnSelectorModule, only: param_definitions + use SourceCommonModule, only: idm_subcomponent_type + use IdmDfnSelectorModule, only: idm_multi_package + class(MeshModelType), intent(inout) :: this + character(LENCOMPONENTNAME) :: ptype, pname, pkgtype + character(len=LENMEMPATH) :: input_mempath + type(CharacterStringType), dimension(:), contiguous, & + pointer :: pkgtypes => null() + type(CharacterStringType), dimension(:), contiguous, & + pointer :: pkgnames => null() + type(CharacterStringType), dimension(:), contiguous, & + pointer :: mempaths => null() + type(InputParamDefinitionType), dimension(:), pointer :: param_dfns + character(len=LENMEMPATH) :: mempath + integer(I4B) :: n + integer(I4B), pointer :: export_arrays + logical(LGP) :: found + ! + input_mempath = create_mem_path(component=this%modelname, context=idm_context) + ! + ! -- set pointers to model path package info + call mem_setptr(pkgtypes, 'PKGTYPES', input_mempath) + call mem_setptr(pkgnames, 'PKGNAMES', input_mempath) + call mem_setptr(mempaths, 'MEMPATHS', input_mempath) + ! + allocate (export_arrays) + ! + do n = 1, size(mempaths) + ! + ! -- initialize export_arrays + export_arrays = 0 + ! + ! -- set package attributes + mempath = mempaths(n) + pname = pkgnames(n) + ptype = pkgtypes(n) + ! + ! -- export input arrays + if (mempath /= '') then + ! -- update export + call mem_set_value(export_arrays, 'EXPORT_NC', mempath, found) + ! + if (export_arrays > 0) then + pkgtype = idm_subcomponent_type(this%modeltype, ptype) + param_dfns => param_definitions(this%modeltype, pkgtype) + if (idm_multi_package(this%modeltype, pkgtype)) then + call this%export_input_arrays(pname, mempath, param_dfns) + else + call this%export_input_arrays(pkgtype, mempath, param_dfns) + end if + end if + end if + end do + ! + ! -- cleanup + deallocate (export_arrays) + end subroutine add_pkg_data + + !> @brief create the model layer dependent variables + !< + subroutine define_dependent(this) + class(MeshModelType), intent(inout) :: this + character(len=LINELENGTH) :: varname, longname + integer(I4B) :: k + ! + ! -- create a dependent variable for each layer + do k = 1, this%nlay + ! + ! -- initialize names + varname = '' + longname = '' + ! + ! -- set layer variable and longnames + write (varname, '(a,i0)') trim(this%xname)//'_l', k + write (longname, '(a,i0,a)') trim(this%annotation%longname)// & + ' (layer ', k, ')' + ! + ! -- create the netcdf dependent layer variable + call nf_verify(nf90_def_var(this%ncid, varname, NF90_DOUBLE, & + (/this%dim_ids%nmesh_face, & + this%dim_ids%time/), & + this%var_ids%dependent(k)), & + this%ncid, this%iout) + ! + ! -- apply chunking parameters + if (this%ugc_time > 0 .and. this%ugc_face > 0) then + call nf_verify(nf90_def_var_chunking(this%ncid, & + this%var_ids%dependent(k), & + NF90_CHUNKED, & + (/this%ugc_face, this%ugc_time/)), & + this%ncid, this%iout) + end if + ! -- deflate and shuffle + if (this%deflate >= 0) then + call nf_verify(nf90_def_var_deflate(this%ncid, & + this%var_ids%dependent(k), & + shuffle=this%shuffle, deflate=1, & + deflate_level=this%deflate), & + this%ncid, this%iout) + end if + ! + ! -- assign variable attributes + call nf_verify(nf90_put_att(this%ncid, this%var_ids%dependent(k), & + 'units', 'm'), this%ncid, this%iout) + call nf_verify(nf90_put_att(this%ncid, this%var_ids%dependent(k), & + 'standard_name', this%annotation%stdname), & + this%ncid, this%iout) + call nf_verify(nf90_put_att(this%ncid, this%var_ids%dependent(k), & + 'long_name', longname), this%ncid, this%iout) + call nf_verify(nf90_put_att(this%ncid, this%var_ids%dependent(k), & + '_FillValue', (/DHNOFLO/)), & + this%ncid, this%iout) + call nf_verify(nf90_put_att(this%ncid, this%var_ids%dependent(k), & + 'mesh', this%mesh_name), this%ncid, this%iout) + call nf_verify(nf90_put_att(this%ncid, this%var_ids%dependent(k), & + 'location', 'face'), this%ncid, this%iout) + ! + if (this%ogc_wkt /= '') then + ! -- associate with projection + call nf_verify(nf90_put_att(this%ncid, this%var_ids%dependent(k), & + 'coordinates', 'mesh_face_x mesh_face_y'), & + this%ncid, this%iout) + call nf_verify(nf90_put_att(this%ncid, this%var_ids%dependent(k), & + 'grid_mapping', this%gridmap_name), & + this%ncid, this%iout) + end if + end do + end subroutine define_dependent + + !> @brief create the file grid mapping container variable + !< + subroutine define_gridmap(this) + class(MeshModelType), intent(inout) :: this + integer(I4B) :: var_id + ! + ! -- was projection info provided + if (this%ogc_wkt /= '') then + ! + ! -- create projection variable + call nf_verify(nf90_redef(this%ncid), this%ncid, this%iout) + call nf_verify(nf90_def_var(this%ncid, this%gridmap_name, NF90_INT, & + var_id), this%ncid, this%iout) + ! -- cf-conventions prefers 'crs_wkt' + !call nf_verify(nf90_put_att(this%ncid, var_id, 'crs_wkt', this%ogc_wkt), & + ! this%ncid, this%iout) + ! -- QGIS recognizes 'wkt' + call nf_verify(nf90_put_att(this%ncid, var_id, 'wkt', this%ogc_wkt), & + this%ncid, this%iout) + call nf_verify(nf90_enddef(this%ncid), this%ncid, this%iout) + call nf_verify(nf90_put_var(this%ncid, var_id, 1), & + this%ncid, this%iout) + end if + end subroutine define_gridmap + + !> @brief create the file mesh container variable + !< + subroutine create_mesh(this) + class(Mesh2dModelType), intent(inout) :: this + ! + ! -- create mesh container variable + call nf_verify(nf90_def_var(this%ncid, this%mesh_name, NF90_INT, & + this%var_ids%mesh), this%ncid, this%iout) + ! + ! -- assign container variable attributes + call nf_verify(nf90_put_att(this%ncid, this%var_ids%mesh, 'cf_role', & + 'mesh_topology'), this%ncid, this%iout) + call nf_verify(nf90_put_att(this%ncid, this%var_ids%mesh, 'long_name', & + '2D mesh topology'), this%ncid, this%iout) + call nf_verify(nf90_put_att(this%ncid, this%var_ids%mesh, & + 'topology_dimension', 2), this%ncid, this%iout) + call nf_verify(nf90_put_att(this%ncid, this%var_ids%mesh, 'face_dimension', & + 'nmesh_face'), this%ncid, this%iout) + call nf_verify(nf90_put_att(this%ncid, this%var_ids%mesh, & + 'node_coordinates', 'mesh_node_x mesh_node_y'), & + this%ncid, this%iout) + call nf_verify(nf90_put_att(this%ncid, this%var_ids%mesh, & + 'face_coordinates', 'mesh_face_x mesh_face_y'), & + this%ncid, this%iout) + call nf_verify(nf90_put_att(this%ncid, this%var_ids%mesh, & + 'face_node_connectivity', 'mesh_face_nodes'), & + this%ncid, this%iout) + + ! -- create mesh x node (mesh vertex) variable + call nf_verify(nf90_def_var(this%ncid, 'mesh_node_x', NF90_DOUBLE, & + (/this%dim_ids%nmesh_node/), & + this%var_ids%mesh_node_x), this%ncid, this%iout) + ! + ! -- assign mesh x node variable attributes + call nf_verify(nf90_put_att(this%ncid, this%var_ids%mesh_node_x, & + 'units', 'm'), this%ncid, this%iout) + call nf_verify(nf90_put_att(this%ncid, this%var_ids%mesh_node_x, & + 'standard_name', 'projection_x_coordinate'), & + this%ncid, this%iout) + call nf_verify(nf90_put_att(this%ncid, this%var_ids%mesh_node_x, & + 'long_name', 'Easting'), this%ncid, this%iout) + ! + if (this%ogc_wkt /= '') then + ! -- associate with projection + call nf_verify(nf90_put_att(this%ncid, this%var_ids%mesh_node_x, & + 'grid_mapping', this%gridmap_name), & + this%ncid, this%iout) + end if + + ! -- create mesh y node (mesh vertex) variable + call nf_verify(nf90_def_var(this%ncid, 'mesh_node_y', NF90_DOUBLE, & + (/this%dim_ids%nmesh_node/), & + this%var_ids%mesh_node_y), this%ncid, this%iout) + ! + ! -- assign mesh y variable attributes + call nf_verify(nf90_put_att(this%ncid, this%var_ids%mesh_node_y, & + 'units', 'm'), this%ncid, this%iout) + call nf_verify(nf90_put_att(this%ncid, this%var_ids%mesh_node_y, & + 'standard_name', 'projection_y_coordinate'), & + this%ncid, this%iout) + call nf_verify(nf90_put_att(this%ncid, this%var_ids%mesh_node_y, & + 'long_name', 'Northing'), this%ncid, this%iout) + ! + if (this%ogc_wkt /= '') then + ! -- associate with projection + call nf_verify(nf90_put_att(this%ncid, this%var_ids%mesh_node_y, & + 'grid_mapping', this%gridmap_name), & + this%ncid, this%iout) + end if + + ! -- create mesh x face (cell vertex) variable + call nf_verify(nf90_def_var(this%ncid, 'mesh_face_x', NF90_DOUBLE, & + (/this%dim_ids%nmesh_face/), & + this%var_ids%mesh_face_x), this%ncid, this%iout) + ! + ! -- assign mesh x face variable attributes + call nf_verify(nf90_put_att(this%ncid, this%var_ids%mesh_face_x, & + 'units', 'm'), this%ncid, this%iout) + call nf_verify(nf90_put_att(this%ncid, this%var_ids%mesh_face_x, & + 'standard_name', 'projection_x_coordinate'), & + this%ncid, this%iout) + call nf_verify(nf90_put_att(this%ncid, this%var_ids%mesh_face_x, & + 'long_name', 'Easting'), this%ncid, this%iout) + call nf_verify(nf90_put_att(this%ncid, this%var_ids%mesh_face_x, 'bounds', & + 'mesh_face_xbnds'), this%ncid, this%iout) + if (this%ogc_wkt /= '') then + ! -- associate with projection + call nf_verify(nf90_put_att(this%ncid, this%var_ids%mesh_face_x, & + 'grid_mapping', this%gridmap_name), & + this%ncid, this%iout) + end if + + ! -- create mesh x cell bounds variable + call nf_verify(nf90_def_var(this%ncid, 'mesh_face_xbnds', NF90_DOUBLE, & + (/this%dim_ids%max_nmesh_face_nodes, & + this%dim_ids%nmesh_face/), & + this%var_ids%mesh_face_xbnds), & + this%ncid, this%iout) + ! + ! -- create mesh y face (cell vertex) variable + call nf_verify(nf90_def_var(this%ncid, 'mesh_face_y', NF90_DOUBLE, & + (/this%dim_ids%nmesh_face/), & + this%var_ids%mesh_face_y), this%ncid, this%iout) + ! + ! -- assign mesh y face variable attributes + call nf_verify(nf90_put_att(this%ncid, this%var_ids%mesh_face_y, & + 'units', 'm'), this%ncid, this%iout) + call nf_verify(nf90_put_att(this%ncid, this%var_ids%mesh_face_y, & + 'standard_name', 'projection_y_coordinate'), & + this%ncid, this%iout) + call nf_verify(nf90_put_att(this%ncid, this%var_ids%mesh_face_y, & + 'long_name', 'Northing'), this%ncid, this%iout) + call nf_verify(nf90_put_att(this%ncid, this%var_ids%mesh_face_y, 'bounds', & + 'mesh_face_ybnds'), this%ncid, this%iout) + ! + if (this%ogc_wkt /= '') then + ! -- associate with projection + call nf_verify(nf90_put_att(this%ncid, this%var_ids%mesh_face_y, & + 'grid_mapping', this%gridmap_name), & + this%ncid, this%iout) + end if + + ! -- create mesh y cell bounds variable + call nf_verify(nf90_def_var(this%ncid, 'mesh_face_ybnds', NF90_DOUBLE, & + (/this%dim_ids%max_nmesh_face_nodes, & + this%dim_ids%nmesh_face/), & + this%var_ids%mesh_face_ybnds), & + this%ncid, this%iout) + ! + ! -- create mesh face nodes variable + call nf_verify(nf90_def_var(this%ncid, 'mesh_face_nodes', NF90_INT, & + (/this%dim_ids%max_nmesh_face_nodes, & + this%dim_ids%nmesh_face/), & + this%var_ids%mesh_face_nodes), & + this%ncid, this%iout) + ! + ! -- assign variable attributes + call nf_verify(nf90_put_att(this%ncid, this%var_ids%mesh_face_nodes, & + 'cf_role', 'face_node_connectivity'), & + this%ncid, this%iout) + call nf_verify(nf90_put_att(this%ncid, this%var_ids%mesh_face_nodes, & + 'long_name', & + 'Vertices bounding cell (counterclockwise)'), & + this%ncid, this%iout) + ! -- TODO: saw QGIS access violations and xugrid issues without this + call nf_verify(nf90_put_att(this%ncid, this%var_ids%mesh_face_nodes, & + '_FillValue', (/NF90_FILL_INT/)), & + this%ncid, this%iout) + call nf_verify(nf90_put_att(this%ncid, this%var_ids%mesh_face_nodes, & + 'start_index', 1), this%ncid, this%iout) + end subroutine create_mesh + + !> @brief error check a netcdf-fortran interface call + !< + subroutine nf_verify(res, ncid, iout) + integer(I4B), intent(in) :: res + integer(I4B), intent(in) :: ncid + integer(I4B), intent(in) :: iout + ! -- local variables + character(len=LINELENGTH) :: errstr + ! + ! -- strings are set for a subset of errors + ! but the exit status will always be reported + if (res /= NF90_NOERR) then + ! + select case (res) + + case (NF90_EINVAL) ! (-36) + errstr = 'Invalid Argument' + case (NF90_EPERM) ! (-37) + errstr = 'Write to read only' + case (-38) ! (NC_ENOTINDEFINE) + errstr = 'Operation not allowed in data mode' + case (-39) ! (NC_EINDEFINE) + errstr = 'Operation not allowed in define mode' + case (NF90_EINVALCOORDS) ! (-40) + errstr = 'Index exceeds dimension bound' + case (NF90_ENAMEINUSE) ! (-42) + errstr = 'String match to name in use' + case (NF90_ENOTATT) ! (-43) + errstr = 'Attribute not found' + case (-45) ! (NC_EBADTYPE) + errstr = 'Not a netcdf data type' + case (NF90_EBADDIM) ! (-46) + errstr = 'Invalid dimension id or name' + case (NF90_ENOTVAR) ! (-49) + errstr = 'Variable not found' + case (NF90_ENOTNC) ! (-51) + errstr = 'Not a netcdf file' + case (NF90_ECHAR) ! (-56) + errstr = 'Attempt to convert between text & numbers' + case (NF90_EEDGE) ! (-57) + errstr = 'Edge+start exceeds dimension bound' + case (NF90_ESTRIDE) ! (-58) + errstr = 'Illegal stride' + case (NF90_EBADNAME) ! (-59) + errstr = 'Attribute or variable name contains illegal characters' + case (-127) ! (NC_EBADCHUNK) + errstr = 'Bad chunksize.' + case default + errstr = '' + end select + ! + if (errstr /= '') then + write (errmsg, '(a,a,a,i0,a,i0,a)') 'NetCDF library error [error="', & + trim(errstr), '", exit code=', res, ', ncid=', ncid, '].' + else + write (errmsg, '(a,i0,a,i0,a)') 'NetCDF library error [exit code=', & + res, ', ncid=', ncid, '].' + end if + ! + call store_error(errmsg, .true.) + end if + ! + ! -- return + return + end subroutine nf_verify + +end module MeshModelModule diff --git a/src/Utilities/Export/ModelExport.f90 b/src/Utilities/Export/ModelExport.f90 new file mode 100644 index 00000000000..fa527084351 --- /dev/null +++ b/src/Utilities/Export/ModelExport.f90 @@ -0,0 +1,252 @@ +!> @brief This module contains the ModelExportModule +!! +!! This modeule defines the local list of model exports. +!! It is not dependent on netcdf or other external +!! libraries. +!! +!< +module ModelExportModule + + use KindModule, only: DP, I4B, LGP + use ConstantsModule, only: LINELENGTH, LENMODELNAME, LENCOMPONENTNAME, & + LENMEMPATH + use ListModule, only: ListType + use NCModelExportModule, only: NCBaseModelExportType + + implicit none + private + public :: modelexports_create + public :: modelexports_post_step + public :: modelexports_destroy + public :: nc_export_active + public :: export_models + public :: get_export_model + public :: ExportModelType + + type(ListType) :: export_models + + !> @brief export model type + !! + !! This is a container variable which can + !! contain objects which manage various model + !! scoped exports. + !! + !< + type :: ExportModelType + character(len=LENMODELNAME) :: modelname !< name of model + character(len=LENCOMPONENTNAME) :: modeltype !< type of model + character(len=LINELENGTH) :: modelfname !< name of model input file + class(NCBaseModelExportType), pointer :: nc_export => null() !< netcdf export object pointer + integer(I4B) :: nctype !< type of netcdf export + integer(I4B) :: disenum !< type of discretization + integer(I4B) :: iout !< lst file descriptor + contains + procedure :: init + procedure :: post_step + procedure :: destroy + end type ExportModelType + +contains + + !> @brief is netcdf export configured for any model + !! + function nc_export_active() result(active) + use NCModelExportModule, only: NETCDF_UNDEF + logical(LGP) :: active + integer(I4B) :: n + type(ExportModelType), pointer :: export_model + active = .false. + ! + do n = 1, export_models%Count() + export_model => get_export_model(n) + if (export_model%nctype /= NETCDF_UNDEF) then + active = .true. + exit + end if + end do + end function nc_export_active + + !> @brief create export container variable for all local models + !! + subroutine modelexports_create(iout) + use InputLoadTypeModule, only: ModelDynamicPkgsType + use InputLoadTypeModule, only: model_dynamic_pkgs + use MemoryManagerModule, only: mem_setptr + use MemoryManagerExtModule, only: mem_set_value + use MemoryHelperModule, only: create_mem_path + use InputLoadTypeModule, only: GetDynamicModelFromList + use SimVariablesModule, only: idm_context + use NCModelExportModule, only: NETCDF_UGRID, NETCDF_STRUCTURED + integer(I4B), intent(in) :: iout + type(ModelDynamicPkgsType), pointer :: model_dynamic_input + type(ExportModelType), pointer :: export_model + character(len=LENMEMPATH) :: modelnam_mempath, model_mempath + integer(I4B), pointer :: disenum + character(len=LINELENGTH) :: exportstr + integer(I4B) :: n + logical(LGP) :: found + ! + do n = 1, model_dynamic_pkgs%Count() + ! + ! -- allocate and initialize + allocate (export_model) + ! + ! -- set pointer to dynamic input model instance + model_dynamic_input => GetDynamicModelFromList(model_dynamic_pkgs, n) + ! + ! --set input mempaths + modelnam_mempath = & + create_mem_path(component=model_dynamic_input%modelname, & + subcomponent='NAM', context=idm_context) + model_mempath = create_mem_path(component=model_dynamic_input%modelname, & + context=idm_context) + ! -- set pointer to dis enum type + call mem_setptr(disenum, 'DISENUM', model_mempath) + ! + ! -- initialize model + call export_model%init(model_dynamic_input%modelname, & + model_dynamic_input%modeltype, & + model_dynamic_input%modelfname, disenum, iout) + ! + ! -- update EXPORT_NETCDF string if provided + call mem_set_value(exportstr, 'EXPORT_NETCDF', modelnam_mempath, found) + if (found) then + if (exportstr == 'STRUCTURED') then + export_model%nctype = NETCDF_STRUCTURED + else + export_model%nctype = NETCDF_UGRID + end if + end if + ! + ! -- add model to list + call add_export_model(export_model) + end do + end subroutine modelexports_create + + !> @brief deallocate export model list + !! + subroutine modelexports_post_step() + ! -- local variables + class(*), pointer :: obj + class(ExportModelType), pointer :: export_model + integer(I4B) :: n + ! + do n = 1, export_models%Count() + obj => export_models%GetItem(n) + if (associated(obj)) then + select type (obj) + class is (ExportModelType) + export_model => obj + call export_model%post_step() + end select + end if + end do + end subroutine modelexports_post_step + + !> @brief deallocate export model list + !! + subroutine modelexports_destroy() + ! -- local variables + class(*), pointer :: obj + class(ExportModelType), pointer :: export_model + integer(I4B) :: n + ! + do n = 1, export_models%Count() + obj => export_models%GetItem(n) + if (associated(obj)) then + select type (obj) + class is (ExportModelType) + export_model => obj + call export_model%destroy() + deallocate (export_model) + nullify (export_model) + end select + end if + end do + ! + call export_models%clear() + end subroutine modelexports_destroy + + !> @brief initialize model export container + !! + !< + subroutine init(this, modelname, modeltype, modelfname, disenum, iout) + use NCModelExportModule, only: NETCDF_UNDEF + class(ExportModelType), intent(inout) :: this + character(len=*), intent(in) :: modelname + character(len=*), intent(in) :: modeltype + character(len=*), intent(in) :: modelfname + integer(I4B), intent(in) :: disenum + integer(I4B), intent(in) :: iout + ! + this%modelname = modelname + this%modeltype = modeltype + this%modelfname = modelfname + this%nctype = NETCDF_UNDEF + this%disenum = disenum + this%iout = iout + ! + nullify (this%nc_export) + end subroutine init + + !> @brief model export container post step + !! + !< + subroutine post_step(this) + class(ExportModelType), intent(inout) :: this + ! + if (associated(this%nc_export)) then + call this%nc_export%step() + end if + end subroutine post_step + + !> @brief destroy model export container + !! + !< + subroutine destroy(this) + class(ExportModelType), intent(inout) :: this + ! + if (associated(this%nc_export)) then + call this%nc_export%destroy() + deallocate (this%nc_export) + nullify (this%nc_export) + end if + end subroutine destroy + + !> @brief add model export object to list + !! + !< + subroutine add_export_model(export_model) + ! -- dummy variables + type(ExportModelType), pointer, intent(inout) :: export_model + ! -- local variables + class(*), pointer :: obj + ! + obj => export_model + call export_models%Add(obj) + end subroutine add_export_model + + !> @brief get model export object by index + !! + !< + function get_export_model(idx) result(res) + ! -- dummy variables + integer(I4B), intent(in) :: idx !< package number + ! -- local variables + class(ExportModelType), pointer :: res + class(*), pointer :: obj + ! + ! -- initialize res + nullify (res) + ! + ! -- get the object from the list + obj => export_models%GetItem(idx) + if (associated(obj)) then + select type (obj) + class is (ExportModelType) + res => obj + end select + end if + end function get_export_model + +end module ModelExportModule diff --git a/src/Utilities/Export/NCExportCreate.f90 b/src/Utilities/Export/NCExportCreate.f90 new file mode 100644 index 00000000000..97ebc933ee4 --- /dev/null +++ b/src/Utilities/Export/NCExportCreate.f90 @@ -0,0 +1,142 @@ +!> @brief This module contains the NCExportCreateModule +!! +!! This module creates derived model netcdf export +!! objects. It is dependent on netcdf libraries. +!! +!< +module NCExportCreateModule + + use KindModule, only: DP, I4B, LGP + use SimVariablesModule, only: errmsg + use ConstantsModule, only: DIS, DISU, DISV + use SimModule, only: store_error, store_error_filename + use NumericalModelModule, only: NumericalModelType + use BaseDisModule, only: DisBaseType + use DisModule, only: DisType + use DisvModule, only: DisvType + use DisuModule, only: DisuType + use ModelExportModule, only: export_models, get_export_model + use ModelExportModule, only: ExportModelType + + implicit none + private + public :: nc_export_create + +contains + + !> @brief create model netcdf export type + !! + subroutine create_nc_export(export_model, num_model) + use NCModelExportModule, only: NETCDF_UGRID + use MeshDisModelModule, only: Mesh2dDisExportType + use MeshDisvModelModule, only: Mesh2dDisvExportType + type(ExportModelType), pointer, intent(inout) :: export_model + class(NumericalModelType), pointer, intent(in) :: num_model + class(Mesh2dDisExportType), pointer :: ugrid_dis + class(Mesh2dDisvExportType), pointer :: ugrid_disv + class(DisBaseType), pointer :: disbase + ! + select case (export_model%disenum) + case (DIS) + ! -- allocate nc structured grid export object + if (export_model%nctype == NETCDF_UGRID) then + ! + ! -- allocate nc structured grid export object + allocate (ugrid_dis) + ! + ! -- set dis base type + disbase => num_model%dis + select type (disbase) + type is (DisType) + ugrid_dis%dis => disbase + end select + ! + ! -- initialize export object + call ugrid_dis%init(export_model%modelname, export_model%modeltype, & + export_model%modelfname, export_model%disenum, & + NETCDF_UGRID, export_model%iout) + ! + ! -- define export object + call ugrid_dis%df() + ! + ! -- set base pointer + export_model%nc_export => ugrid_dis + else + errmsg = 'DIS model discretization only & + &supported as UGRID NetCDF export. & + &Model='//trim(export_model%modelname)//'.' + call store_error(errmsg) + call store_error_filename(export_model%modelfname) + end if + case (DISV) + if (export_model%nctype == NETCDF_UGRID) then + ! -- allocate nc structured grid export object + allocate (ugrid_disv) + ! + ! -- set dis base type + disbase => num_model%dis + select type (disbase) + type is (DisvType) + ugrid_disv%disv => disbase + end select + ! + ! -- initialize export object + call ugrid_disv%init(export_model%modelname, export_model%modeltype, & + export_model%modelfname, export_model%disenum, & + NETCDF_UGRID, export_model%iout) + ! + ! -- define export object + call ugrid_disv%df() + ! + ! -- set base pointer + export_model%nc_export => ugrid_disv + else + errmsg = 'DISV model discretization only & + &supported as UGRID NetCDF export. & + &Model='//trim(export_model%modelname)//'.' + call store_error(errmsg) + call store_error_filename(export_model%modelfname) + end if + case default + errmsg = 'Unsupported discretization for NetCDF model export. & + &Model='//trim(export_model%modelname)//'.' + call store_error(errmsg) + call store_error_filename(export_model%modelfname) + end select + end subroutine create_nc_export + + !> @brief initialize netcdf model export type + !! + subroutine nc_export_create() + use NumericalModelModule, only: GetNumericalModelFromList + use ListsModule, only: basemodellist + use NCModelExportModule, only: NETCDF_UNDEF + integer(I4B) :: n + type(ExportModelType), pointer :: export_model + class(NumericalModelType), pointer :: num_model + integer(I4B) :: im + ! + do n = 1, export_models%Count() + ! -- set pointer to export model + export_model => get_export_model(n) + if (export_model%nctype /= NETCDF_UNDEF) then + ! + ! -- netcdf export is active identify model + do im = 1, basemodellist%Count() + ! + ! -- set model pointer + num_model => GetNumericalModelFromList(basemodellist, im) + if (num_model%name == export_model%modelname .and. & + num_model%macronym == export_model%modeltype) then + ! + ! -- allocate and initialize nc export model + call create_nc_export(export_model, num_model) + exit + ! + end if + end do + end if + end do + end subroutine nc_export_create + +end module NCExportCreateModule diff --git a/src/Utilities/Export/NCModel.f90 b/src/Utilities/Export/NCModel.f90 new file mode 100644 index 00000000000..a968f288129 --- /dev/null +++ b/src/Utilities/Export/NCModel.f90 @@ -0,0 +1,263 @@ +!> @brief This module contains the NCModelExportModule +!! +!! This module defines a model export and base type for +!! supported netcdf files. It is not not dependent on +!! netcdf libraries. +!! +!< +module NCModelExportModule + + use KindModule, only: DP, I4B, LGP + use ConstantsModule, only: LINELENGTH, LENCOMPONENTNAME, LENMODELNAME, & + LENMEMPATH, LENBIGLINE, DIS, DISU, DISV + use SimVariablesModule, only: errmsg + use SimModule, only: store_error, store_error_filename + + implicit none + private + public :: NCBaseModelExportType + public :: NCExportAnnotation + public :: NETCDF_UNDEF, NETCDF_STRUCTURED, NETCDF_UGRID + + !> @brief netcdf export types enumerator + !< + ENUM, BIND(C) + ENUMERATOR :: NETCDF_UNDEF = 0 !< undefined netcdf export type + ENUMERATOR :: NETCDF_STRUCTURED = 1 !< netcdf structrured export + ENUMERATOR :: NETCDF_UGRID = 2 !< netcdf mesh export + END ENUM + + !> @brief netcdf export attribute annotations + !< + type :: NCExportAnnotation + character(len=LINELENGTH) :: title !< file scoped title attribute + character(len=LINELENGTH) :: model !< file scoped model attribute + character(len=LINELENGTH) :: history !< file scoped history attribute + character(len=LINELENGTH) :: source !< file scoped source attribute + character(len=LINELENGTH) :: conventions !< file scoped conventions attribute + character(len=LINELENGTH) :: stdname !< dependent variable standard name + character(len=LINELENGTH) :: longname !< dependent variable long name + contains + procedure :: set + end type NCExportAnnotation + + !> @brief base class for an export model + !< + type :: NCModelExportType + character(len=LENMODELNAME) :: modelname !< name of model + character(len=LENCOMPONENTNAME) :: modeltype !< type of model + character(len=LINELENGTH) :: modelfname !< name of model input file + character(len=LINELENGTH) :: nc_filename !< name of netcdf export file + character(len=LINELENGTH) :: gridmap_name = 'projection' !< name of grid mapping variable + character(len=LINELENGTH) :: mesh_name = 'mesh' !< name of mesh container variable + character(len=LENMEMPATH) :: dis_mempath !< discretization input mempath + character(len=LENMEMPATH) :: ncf_mempath !< netcdf utility package input mempath + character(len=LENBIGLINE) :: ogc_wkt !< wkt user string + character(len=LINELENGTH) :: datetime !< export file creation time + character(len=LINELENGTH) :: xname !< dependent variable name + type(NCExportAnnotation) :: annotation !< export file annotation + real(DP), dimension(:), pointer, contiguous :: x !< dependent variable pointer + integer(I4B) :: disenum !< type of discretization + integer(I4B) :: ncid !< netcdf file descriptor + integer(I4B) :: stepcnt !< simulation step count + integer(I4B) :: totnstp !< simulation total number of steps + integer(I4B), pointer :: deflate !< variable deflate level + integer(I4B), pointer :: shuffle !< variable shuffle filter + integer(I4B) :: iout !< lst file descriptor + contains + procedure :: init => export_init + procedure :: destroy => export_destroy + end type NCModelExportType + + !> @brief abstract type for model netcdf export type + !< + type, abstract, extends(NCModelExportType) :: NCBaseModelExportType + contains + procedure(model_define_if), deferred :: df + procedure(model_step_if), deferred :: step + end type NCBaseModelExportType + + !> @brief abstract interfaces for model netcdf export type + !< + abstract interface + subroutine model_define_if(this) + import NCBaseModelExportType + class(NCBaseModelExportType), intent(inout) :: this + end subroutine + subroutine model_step_if(this) + import NCBaseModelExportType + class(NCBaseModelExportType), intent(inout) :: this + end subroutine + end interface + +contains + + !> @brief set netcdf file scoped attributes + !< + subroutine set(this, modelname, modeltype, modelfname, nctype) + use VersionModule, only: VERSION + class(NCExportAnnotation), intent(inout) :: this + character(len=*), intent(in) :: modelname + character(len=*), intent(in) :: modeltype + character(len=*), intent(in) :: modelfname + integer(I4B), intent(in) :: nctype + character(len=LINELENGTH) :: fullname + integer :: values(8) + ! + this%title = '' + this%model = '' + this%history = '' + this%source = '' + this%conventions = '' + this%stdname = '' + this%longname = '' + ! + ! -- set file conventions + this%conventions = 'CF-1.11' + if (nctype == NETCDF_UGRID) this%conventions = & + trim(this%conventions)//' UGRID-1.0' + ! + ! -- set model specific attributes + select case (modeltype) + case ('GWF') + fullname = 'Groundwater Flow' + this%title = trim(modelname)//' hydraulic head' + this%longname = 'head' + case ('GWT') + fullname = 'Groundwater Transport' + this%title = trim(modelname)//' concentration' + this%longname = 'concentration' + case ('GWE') + fullname = 'Groundwater Energy' + this%title = trim(modelname)//' temperature' + this%longname = 'temperature' + case default + errmsg = trim(modeltype)//' models not supported for NetCDF export.' + call store_error(errmsg) + call store_error_filename(modelfname) + end select + ! + ! -- model description string + this%model = trim(modelname)//': MODFLOW 6 '//trim(fullname)// & + ' ('//trim(modeltype)//') model' + ! + ! -- modflow6 version string + this%source = 'MODFLOW 6 '//trim(adjustl(VERSION)) + ! + ! -- create timestamp + call date_and_time(values=values) + write (this%history, '(a,i0,a,i0,a,i0,a,i0,a,i0,a,i0,a,i0)') & + 'first created ', values(1), '/', values(2), '/', values(3), ' ', & + values(5), ':', values(6), ':', values(7), '.', values(8) + end subroutine set + + !> @brief initialization of model netcdf export + !< + subroutine export_init(this, modelname, modeltype, modelfname, disenum, & + nctype, iout) + use SimVariablesModule, only: idm_context + use TdisModule, only: datetime0, nstp + use MemoryManagerModule, only: mem_setptr + use MemoryHelperModule, only: create_mem_path + use MemoryManagerExtModule, only: mem_set_value + use InputOutputModule, only: lowcase + use UtlNcfInputModule, only: UtlNcfParamFoundType + class(NCModelExportType), intent(inout) :: this + character(len=*), intent(in) :: modelname + character(len=*), intent(in) :: modeltype + character(len=*), intent(in) :: modelfname + integer(I4B), intent(in) :: disenum + integer(I4B), intent(in) :: nctype + integer(I4B), intent(in) :: iout + character(len=LENMEMPATH) :: model_mempath + type(UtlNcfParamFoundType) :: found + logical(LGP) :: found_mempath + ! + ! -- allocate + allocate (this%deflate) + allocate (this%shuffle) + ! + ! -- initialize + this%modelname = modelname + this%modeltype = modeltype + this%modelfname = modelfname + this%nc_filename = trim(modelname)//'.nc' + call lowcase(this%nc_filename) + this%ncf_mempath = '' + this%ogc_wkt = '' + this%datetime = '' + this%xname = '' + this%disenum = disenum + this%ncid = 0 + this%stepcnt = 0 + this%totnstp = 0 + this%deflate = -1 + this%shuffle = 0 + this%iout = iout + ! + ! -- set file scoped attributes + call this%annotation%set(modelname, modeltype, modelfname, nctype) + ! + ! -- set dependent variable basename + select case (modeltype) + case ('GWF') + this%xname = 'head' + case ('GWT') + this%xname = 'concentration' + case ('GWE') + this%xname = 'temperature' + case default + errmsg = trim(modeltype)//' models not supported for NetCDF export.' + call store_error(errmsg) + call store_error_filename(modelfname) + end select + ! + ! -- set discretization input mempath + if (disenum == DIS) then + this%dis_mempath = create_mem_path(modelname, 'DIS', idm_context) + else if (disenum == DISU) then + this%dis_mempath = create_mem_path(modelname, 'DISU', idm_context) + else if (disenum == DISV) then + this%dis_mempath = create_mem_path(modelname, 'DISV', idm_context) + end if + ! + ! -- set dependent variable pointer + model_mempath = create_mem_path(component=modelname) + call mem_setptr(this%x, 'X', model_mempath) + ! + ! --set ncf_mempath if provided + call mem_set_value(this%ncf_mempath, 'NCF6_MEMPATH', this%dis_mempath, & + found_mempath) + ! + if (found_mempath) then + call mem_set_value(this%ogc_wkt, 'OGC_WKT', this%ncf_mempath, & + found%ogc_wkt) + call mem_set_value(this%deflate, 'DEFLATE', this%ncf_mempath, & + found%deflate) + call mem_set_value(this%shuffle, 'SHUFFLE', this%ncf_mempath, & + found%shuffle) + end if + ! + ! -- set datetime string + if (datetime0 == '') then + errmsg = 'TDIS parameter START_DATE_TIME required for NetCDF export.' + call store_error(errmsg) + call store_error_filename(modelfname) + else + this%datetime = 'days since '//trim(datetime0) + end if + ! + ! -- set total nstp + this%totnstp = sum(nstp) + end subroutine export_init + + !> @brief destroy model netcdf export object + !< + subroutine export_destroy(this) + class(NCModelExportType), intent(inout) :: this + ! -- override in derived class + deallocate (this%deflate) + deallocate (this%shuffle) + end subroutine export_destroy + +end module NCModelExportModule diff --git a/src/Utilities/Idm/IdmLoad.f90 b/src/Utilities/Idm/IdmLoad.f90 index 11d0a4be7c1..6244bc6b897 100644 --- a/src/Utilities/Idm/IdmLoad.f90 +++ b/src/Utilities/Idm/IdmLoad.f90 @@ -14,7 +14,8 @@ module IdmLoadModule use ListModule, only: ListType use InputLoadTypeModule, only: StaticPkgLoadBaseType, & DynamicPkgLoadBaseType, & - ModelDynamicPkgsType + ModelDynamicPkgsType, & + model_dynamic_pkgs use InputDefinitionModule, only: InputParamDefinitionType use ModflowInputModule, only: ModflowInputType, getModflowInput @@ -29,8 +30,6 @@ module IdmLoadModule public :: idm_ad public :: idm_da - type(ListType) :: model_dynamic_pkgs - contains !> @brief advance package dynamic data for period steps @@ -122,29 +121,27 @@ end subroutine idm_da !> @brief load an integrated model package from supported source !< - subroutine model_pkg_load(model_pkg_inputs, itype, ipkg, iout) + recursive subroutine input_load(component_type, subcomponent_type, modelname, & + pkgname, pkgtype, filename, modelfname, iout) use ModelPackageInputsModule, only: ModelPackageInputsType use SourceLoadModule, only: create_input_loader - type(ModelPackageInputsType), intent(in) :: model_pkg_inputs - integer(I4B), intent(in) :: itype - integer(I4B), intent(in) :: ipkg + character(len=*), intent(in) :: component_type + character(len=*), intent(in) :: subcomponent_type + character(len=*), intent(in) :: pkgname + character(len=*), intent(in) :: pkgtype + character(len=*), intent(in) :: filename + character(len=*), intent(in) :: modelname + character(len=*), intent(in) :: modelfname integer(I4B), intent(in) :: iout class(StaticPkgLoadBaseType), pointer :: static_loader class(DynamicPkgLoadBaseType), pointer :: dynamic_loader class(ModelDynamicPkgsType), pointer :: dynamic_pkgs - ! - ! -- initialize - nullify (dynamic_pkgs) + integer(I4B) :: n ! ! -- create model package loader static_loader => & - create_input_loader(model_pkg_inputs%component_type, & - model_pkg_inputs%pkglist(itype)%subcomponent_type, & - model_pkg_inputs%modelname, & - model_pkg_inputs%pkglist(itype)%pkgnames(ipkg), & - model_pkg_inputs%pkglist(itype)%pkgtype, & - model_pkg_inputs%pkglist(itype)%filenames(ipkg), & - model_pkg_inputs%modelfname) + create_input_loader(component_type, subcomponent_type, modelname, pkgname, & + pkgtype, filename, modelfname) ! ! -- load static input and set dynamic loader dynamic_loader => static_loader%load(iout) @@ -152,22 +149,38 @@ subroutine model_pkg_load(model_pkg_inputs, itype, ipkg, iout) if (associated(dynamic_loader)) then ! ! -- set pointer to model dynamic packages list - dynamic_pkgs => dynamic_model_pkgs(model_pkg_inputs%modelname, & - static_loader%component_input_name, & - iout) + dynamic_pkgs => & + dynamic_model_pkgs(static_loader%mf6_input%component_type, modelname, & + static_loader%component_input_name, iout) ! ! -- add dynamic pkg loader to list call dynamic_pkgs%add(dynamic_loader) ! end if ! + ! -- create subpackage list + call static_loader%create_subpkg_list() + ! + ! -- load idm integrated subpackages + do n = 1, static_loader%subpkg_list%pnum + ! + ! -- load subpackage + call input_load(static_loader%subpkg_list%component_types(n), & + static_loader%subpkg_list%subcomponent_types(n), & + static_loader%mf6_input%component_name, & + static_loader%subpkg_list%subcomponent_types(n), & + static_loader%subpkg_list%pkgtypes(n), & + static_loader%subpkg_list%filenames(n), & + modelfname, iout) + end do + ! ! -- cleanup call static_loader%destroy() deallocate (static_loader) ! ! -- return return - end subroutine model_pkg_load + end subroutine input_load !> @brief load integrated model package files !< @@ -190,7 +203,13 @@ subroutine load_model_pkgs(model_pkg_inputs, iout) then ! ! -- only load if model pkg can read from input context - call model_pkg_load(model_pkg_inputs, itype, ipkg, iout) + call input_load(model_pkg_inputs%component_type, & + model_pkg_inputs%pkglist(itype)%subcomponent_type, & + model_pkg_inputs%modelname, & + model_pkg_inputs%pkglist(itype)%pkgnames(ipkg), & + model_pkg_inputs%pkglist(itype)%pkgtype, & + model_pkg_inputs%pkglist(itype)%filenames(ipkg), & + model_pkg_inputs%modelfname, iout) else ! ! -- open input file for package parser @@ -488,9 +507,10 @@ end subroutine simtdis_load !> @brief retrieve list of model dynamic loaders !< - function dynamic_model_pkgs(modelname, modelfname, iout) & + function dynamic_model_pkgs(modeltype, modelname, modelfname, iout) & result(model_dynamic_input) use InputLoadTypeModule, only: AddDynamicModelToList, GetDynamicModelFromList + character(len=*), intent(in) :: modeltype character(len=*), intent(in) :: modelname character(len=*), intent(in) :: modelfname integer(I4B), intent(in) :: iout @@ -513,7 +533,7 @@ function dynamic_model_pkgs(modelname, modelfname, iout) & ! -- create if not found if (.not. associated(model_dynamic_input)) then allocate (model_dynamic_input) - call model_dynamic_input%init(modelname, modelfname, iout) + call model_dynamic_input%init(modeltype, modelname, modelfname, iout) call AddDynamicModelToList(model_dynamic_pkgs, model_dynamic_input) end if ! diff --git a/src/Utilities/Idm/InputDefinition.f90 b/src/Utilities/Idm/InputDefinition.f90 index e02d22b1a54..52863a9b6df 100644 --- a/src/Utilities/Idm/InputDefinition.f90 +++ b/src/Utilities/Idm/InputDefinition.f90 @@ -28,6 +28,7 @@ module InputDefinitionModule character(len=LENVARNAME) :: mf6varname = '' !< parameter internal managed memory name character(len=LINELENGTH) :: datatype = '' !< parameter data type character(len=LINELENGTH) :: shape = '' !< shape of data type + character(len=LINELENGTH) :: longname = '' !< description of variable logical(LGP) :: required = .false. !< is the parameter required logical(LGP) :: in_record = .false. !< is the parameter within an input record logical(LGP) :: preserve_case = .false. !< should string case be preserved diff --git a/src/Utilities/Idm/InputLoadType.f90 b/src/Utilities/Idm/InputLoadType.f90 index e3563d01775..58387c7fdac 100644 --- a/src/Utilities/Idm/InputLoadType.f90 +++ b/src/Utilities/Idm/InputLoadType.f90 @@ -7,7 +7,8 @@ module InputLoadTypeModule use KindModule, only: DP, I4B, LGP - use ConstantsModule, only: LINELENGTH, LENCOMPONENTNAME, LENMODELNAME + use ConstantsModule, only: LINELENGTH, LENCOMPONENTNAME, LENMODELNAME, & + LENMEMPATH, LENVARNAME, LENFTYPE use SimVariablesModule, only: errmsg use SimModule, only: store_error, store_error_filename use ModflowInputModule, only: ModflowInputType @@ -21,6 +22,23 @@ module InputLoadTypeModule public :: ModelDynamicPkgsType public :: AddDynamicModelToList, GetDynamicModelFromList public :: StaticPkgLoadType, DynamicPkgLoadType + public :: model_dynamic_pkgs + + !> @brief type representing package subpackage list + type :: SubPackageListType + character(len=LENCOMPONENTNAME), dimension(:), allocatable :: pkgtypes + character(len=LENCOMPONENTNAME), dimension(:), allocatable :: component_types + character(len=LENCOMPONENTNAME), dimension(:), & + allocatable :: subcomponent_types + character(len=LINELENGTH), dimension(:), allocatable :: filenames + character(len=LENMEMPATH) :: mempath + character(len=LENCOMPONENTNAME) :: component_name + integer(I4B) :: pnum + contains + procedure :: create => subpkg_create + procedure :: add => subpkg_add + procedure :: destroy => subpkg_destroy + end type SubPackageListType !> @brief Static loader type !! @@ -33,8 +51,10 @@ module InputLoadTypeModule character(len=LINELENGTH) :: component_input_name !< component input name, e.g. model name file character(len=LINELENGTH) :: input_name !< input name, e.g. package *.chd file integer(I4B) :: iperblock !< index of period block on block definition list + type(SubPackageListType) :: subpkg_list !< list of input subpackages contains procedure :: init => static_init + procedure :: create_subpkg_list procedure :: destroy => static_destroy end type StaticPkgLoadType @@ -102,9 +122,10 @@ subroutine period_load_if(this) !! !< type :: ModelDynamicPkgsType + character(len=LENCOMPONENTNAME) :: modeltype !< type of model character(len=LENMODELNAME) :: modelname !< name of model character(len=LINELENGTH) :: modelfname !< name of model input file - type(ListType) :: pkglist !< list of pointers to model dynamic package loaders + type(ListType) :: pkglist !< model package list integer(I4B) :: iout contains procedure :: init => dynamicpkgs_init @@ -117,8 +138,118 @@ subroutine period_load_if(this) procedure :: destroy => dynamicpkgs_destroy end type ModelDynamicPkgsType + type(ListType) :: model_dynamic_pkgs + contains + !> @brief create a new package type + !< + subroutine subpkg_create(this, mempath, component_name) + ! -- modules + ! -- dummy + class(SubPackageListType) :: this + character(len=*), intent(in) :: mempath + character(len=*), intent(in) :: component_name + ! -- local + ! + ! -- initialize + this%pnum = 0 + this%mempath = mempath + this%component_name = component_name + ! + ! -- allocate arrays + allocate (this%pkgtypes(0)) + allocate (this%component_types(0)) + allocate (this%subcomponent_types(0)) + allocate (this%filenames(0)) + ! + ! -- return + return + end subroutine subpkg_create + + !> @brief create a new package type + !< + subroutine subpkg_add(this, pkgtype, component_type, subcomponent_type, & + tagname, filename) + ! -- modules + use ArrayHandlersModule, only: expandarray + use MemoryHelperModule, only: create_mem_path + use MemoryManagerModule, only: mem_allocate + use SimVariablesModule, only: idm_context + ! -- dummy + class(SubPackageListType) :: this + character(len=*), intent(in) :: pkgtype + character(len=*), intent(in) :: component_type + character(len=*), intent(in) :: subcomponent_type + character(len=*), intent(in) :: tagname + character(len=*), intent(in) :: filename + ! -- local + character(len=LENVARNAME) :: mempath_tag + character(len=LENMEMPATH), pointer :: subpkg_mempath + character(len=LINELENGTH), pointer :: input_fname + integer(I4B) :: idx, trimlen + ! + ! -- reallocate + call expandarray(this%pkgtypes) + call expandarray(this%component_types) + call expandarray(this%subcomponent_types) + call expandarray(this%filenames) + ! + ! -- add new package instance + this%pnum = this%pnum + 1 + this%pkgtypes(this%pnum) = pkgtype + this%component_types(this%pnum) = component_type + this%subcomponent_types(this%pnum) = subcomponent_type + this%filenames(this%pnum) = filename + ! + ! -- initialize mempath tag + mempath_tag = tagname + trimlen = len_trim(tagname) + idx = 0 + ! + ! -- create mempath tagname + idx = index(tagname, '_') + if (idx > 0) then + if (tagname(idx + 1:trimlen) == 'FILENAME') then + write (mempath_tag, '(a)') tagname(1:idx)//'MEMPATH' + end if + end if + ! + ! -- allocate mempath variable for subpackage + call mem_allocate(subpkg_mempath, LENMEMPATH, mempath_tag, & + this%mempath) + ! + ! -- create and set the mempath + subpkg_mempath = & + create_mem_path(this%component_name, & + subcomponent_type, idm_context) + ! + ! -- allocate and initialize filename for subpackage + call mem_allocate(input_fname, LINELENGTH, 'INPUT_FNAME', subpkg_mempath) + input_fname = filename + ! + ! -- return + return + end subroutine subpkg_add + + !> @brief create a new package type + !< + subroutine subpkg_destroy(this) + ! -- modules + ! -- dummy + class(SubPackageListType) :: this + ! -- local + ! + ! -- allocate arrays + deallocate (this%pkgtypes) + deallocate (this%component_types) + deallocate (this%subcomponent_types) + deallocate (this%filenames) + ! + ! -- return + return + end subroutine subpkg_destroy + !> @brief initialize static package loader !! !< @@ -137,6 +268,10 @@ subroutine static_init(this, mf6_input, component_name, component_input_name, & this%input_name = input_name this%iperblock = 0 ! + ! -- create subpackage list + call this%subpkg_list%create(this%mf6_input%mempath, & + this%mf6_input%component_name) + ! ! -- identify period block definition do iblock = 1, size(mf6_input%block_dfns) ! @@ -149,9 +284,71 @@ subroutine static_init(this, mf6_input, component_name, component_input_name, & return end subroutine static_init + !> @brief create the subpackage list + !! + !< + subroutine create_subpkg_list(this) + use IdmDfnSelectorModule, only: idm_subpackages, idm_integrated, & + idm_multi_package + use SourceCommonModule, only: filein_fname + class(StaticPkgLoadType), intent(inout) :: this + character(len=16), dimension(:), pointer :: subpkgs + character(len=LINELENGTH) :: tag, fname, pkgtype + character(len=LENFTYPE) :: c_type, sc_type + character(len=16) :: subpkg + integer(I4B) :: idx, n + ! + ! -- set pointer to package (idm integrated) subpackage list + subpkgs => idm_subpackages(this%mf6_input%component_type, & + this%mf6_input%subcomponent_type) + ! + ! -- check if tag matches subpackage + do n = 1, size(subpkgs) + subpkg = subpkgs(n) + idx = index(subpkg, '-') + ! -- split sp string into component/subcomponent + if (idx > 0) then + ! -- split string in component/subcomponent types + c_type = subpkg(1:idx - 1) + sc_type = subpkg(idx + 1:len_trim(subpkg)) + ! + if (idm_integrated(c_type, sc_type)) then + ! + ! -- set pkgtype and input filename tag + pkgtype = trim(sc_type)//'6' + tag = trim(pkgtype)//'_FILENAME' + ! + ! -- support single instance of each subpackage + if (idm_multi_package(c_type, sc_type)) then + errmsg = 'Multi-instance subpackages not supported. Remove dfn & + &subpackage tagline for package "'//trim(subpkg)//'".' + call store_error(errmsg) + call store_error_filename(this%input_name) + else + if (filein_fname(fname, tag, this%mf6_input%mempath, & + this%input_name)) then + call this%subpkg_list%add(pkgtype, c_type, sc_type, & + trim(tag), trim(fname)) + end if + end if + else + errmsg = 'Identified subpackage is not IDM integrated. Remove dfn & + &subpackage tagline for package "'//trim(subpkg)//'".' + call store_error(errmsg) + call store_error_filename(this%input_name) + end if + end if + end do + ! + ! -- return + return + end subroutine create_subpkg_list + subroutine static_destroy(this) class(StaticPkgLoadType), intent(inout) :: this ! + call this%subpkg_list%destroy() + ! return end subroutine static_destroy @@ -243,12 +440,14 @@ end subroutine dynamic_destroy !> @brief model dynamic packages init !! !< - subroutine dynamicpkgs_init(this, modelname, modelfname, iout) + subroutine dynamicpkgs_init(this, modeltype, modelname, modelfname, iout) class(ModelDynamicPkgsType), intent(inout) :: this + character(len=*), intent(in) :: modeltype character(len=*), intent(in) :: modelname character(len=*), intent(in) :: modelfname integer(I4B), intent(in) :: iout ! + this%modeltype = modeltype this%modelname = modelname this%modelfname = modelfname this%iout = iout diff --git a/src/Utilities/Idm/SourceLoad.F90 b/src/Utilities/Idm/SourceLoad.F90 index 5576bc89e39..ac2fa40dbac 100644 --- a/src/Utilities/Idm/SourceLoad.F90 +++ b/src/Utilities/Idm/SourceLoad.F90 @@ -8,7 +8,7 @@ module SourceLoadModule use KindModule, only: DP, I4B, LGP - use SimVariablesModule, only: errmsg + use SimVariablesModule, only: errmsg, iout use ConstantsModule, only: LINELENGTH, LENMEMPATH, LENMODELNAME, LENFTYPE, & LENPACKAGETYPE, LENPACKAGENAME use SimModule, only: store_error, store_error_filename @@ -20,6 +20,7 @@ module SourceLoadModule public :: open_source_file public :: load_modelnam, load_simnam, load_simtdis public :: remote_model_ndim + public :: export_cr, export_post_step, export_da contains @@ -147,7 +148,7 @@ end subroutine load_modelnam subroutine load_simnam() use SimVariablesModule, only: simfile, iout - use MemoryManagerModule, only: mem_setptr, mem_print_detailed + use MemoryManagerModule, only: mem_setptr use MessageModule, only: write_message use IdmMf6FileModule, only: input_load use SourceCommonModule, only: filein_fname @@ -325,4 +326,35 @@ function remote_model_ndim(mtype, mfname) result(ncelldim) return end function remote_model_ndim + subroutine export_cr() + ! -- modules + use ModelExportModule, only: modelexports_create, nc_export_active +#if defined(__WITH_NETCDF__) + use NCExportCreateModule, only: nc_export_create +#endif + call modelexports_create(iout) + if (nc_export_active()) then +#if defined(__WITH_NETCDF__) + call nc_export_create() +#else + write (errmsg, '(a)') & + 'Model namefile EXPORT_NETCDF option configured but NetCDF libraries are & + ¬ available.' + call store_error(errmsg, .true.) +#endif + end if + end subroutine export_cr + + subroutine export_post_step() + ! -- modules + use ModelExportModule, only: modelexports_post_step + call modelexports_post_step() + end subroutine export_post_step + + subroutine export_da() + ! -- modules + use ModelExportModule, only: modelexports_destroy + call modelexports_destroy() + end subroutine export_da + end module SourceLoadModule diff --git a/src/Utilities/Idm/mf6blockfile/LoadMf6File.f90 b/src/Utilities/Idm/mf6blockfile/LoadMf6File.f90 index b39679d3271..956aa36e4c8 100644 --- a/src/Utilities/Idm/mf6blockfile/LoadMf6File.f90 +++ b/src/Utilities/Idm/mf6blockfile/LoadMf6File.f90 @@ -711,20 +711,30 @@ end subroutine load_keyword_type !> @brief load type string !< subroutine load_string_type(parser, idt, memoryPath, iout) + use ConstantsModule, only: LENBIGLINE type(BlockParserType), intent(inout) :: parser !< block parser type(InputParamDefinitionType), intent(in) :: idt !< input data type object describing this record character(len=*), intent(in) :: memoryPath !< memorypath to put loaded information integer(I4B), intent(in) :: iout !< unit number for output character(len=LINELENGTH), pointer :: cstr + character(len=LENBIGLINE), pointer :: bigcstr integer(I4B) :: ilen - ilen = LINELENGTH - call mem_allocate(cstr, ilen, idt%mf6varname, memoryPath) - call parser%GetString(cstr, (.not. idt%preserve_case)) - call idm_log_var(cstr, idt%tagname, memoryPath, iout) + select case (idt%shape) + case ('LENBIGLINE') + ilen = LENBIGLINE + call mem_allocate(bigcstr, ilen, idt%mf6varname, memoryPath) + call parser%GetString(bigcstr, (.not. idt%preserve_case)) + call idm_log_var(bigcstr, idt%tagname, memoryPath, iout) + case default + ilen = LINELENGTH + call mem_allocate(cstr, ilen, idt%mf6varname, memoryPath) + call parser%GetString(cstr, (.not. idt%preserve_case)) + call idm_log_var(cstr, idt%tagname, memoryPath, iout) + end select return end subroutine load_string_type - !> @brief load type string + !> @brief load io tag !< subroutine load_io_tag(parser, idt, memoryPath, which, iout) use MemoryManagerModule, only: mem_allocate, mem_reallocate, & diff --git a/src/meson.build b/src/meson.build index 30594e28c36..a95275c042a 100644 --- a/src/meson.build +++ b/src/meson.build @@ -96,6 +96,7 @@ modflow_sources = files( 'Idm' / 'prt-disvidm.f90', 'Idm' / 'prt-mipidm.f90', 'Idm' / 'utl-hpcidm.f90', + 'Idm' / 'utl-ncfidm.f90', 'Idm' / 'selector' / 'IdmDfnSelector.f90', 'Idm' / 'selector' / 'IdmExgDfnSelector.f90', 'Idm' / 'selector' / 'IdmGweDfnSelector.f90', @@ -277,6 +278,8 @@ modflow_sources = files( 'Utilities' / 'ArrayRead' / 'Integer1dReader.f90', 'Utilities' / 'ArrayRead' / 'Integer2dReader.f90', 'Utilities' / 'ArrayRead' / 'LayeredArrayReader.f90', + 'Utilities' / 'Export' / 'ModelExport.f90', + 'Utilities' / 'Export' / 'NCModel.f90', 'Utilities' / 'Idm' / 'BoundInputContext.f90', 'Utilities' / 'Idm' / 'DefinitionSelect.f90', 'Utilities' / 'Idm' / 'DynamicPackageParams.f90', @@ -399,6 +402,13 @@ modflow_mpi_sources = files( 'Solution' / 'ParallelSolution.f90' ) +modflow_netcdf_sources = files( + 'Utilities' / 'Export' / 'DisNCMesh.f90', + 'Utilities' / 'Export' / 'DisvNCMesh.f90', + 'Utilities' / 'Export' / 'MeshNCModel.f90', + 'Utilities' / 'Export' / 'NCExportCreate.f90' +) + if with_petsc modflow_sources += modflow_petsc_sources endif @@ -407,6 +417,10 @@ if with_mpi modflow_sources += modflow_mpi_sources endif +if with_netcdf + modflow_sources += modflow_netcdf_sources +endif + mf6_external = static_library('mf6_external', external_libraries) message('MODFLOW 6 executable name: ' + buildname) diff --git a/src/mf6core.f90 b/src/mf6core.f90 index 549bd0f3679..159c9d501f6 100644 --- a/src/mf6core.f90 +++ b/src/mf6core.f90 @@ -70,6 +70,7 @@ subroutine Mf6Initialize() ! -- modules use RunControlFactoryModule, only: create_run_control use SimulationCreateModule, only: simulation_cr + use SourceLoadModule, only: export_cr ! -- get the run controller for sequential or parallel builds run_ctrl => create_run_control() @@ -93,6 +94,9 @@ subroutine Mf6Initialize() ! -- allocate and read call simulation_ar() + ! -- create model exports + call export_cr() + end subroutine Mf6Initialize !> @brief Run a time step @@ -131,6 +135,7 @@ subroutine Mf6Finalize() use SimulationCreateModule, only: simulation_da use TdisModule, only: tdis_da use IdmLoadModule, only: idm_da + use SourceLoadModule, only: export_da use SimVariablesModule, only: iout ! -- local variables integer(I4B) :: im @@ -203,6 +208,7 @@ subroutine Mf6Finalize() end do ! call idm_da(iout) + call export_da() call simulation_da() call lists_da() ! @@ -675,6 +681,7 @@ function Mf6FinalizeTimestep() result(hasConverged) use BaseSolutionModule, only: BaseSolutionType, GetBaseSolutionFromList use SimModule, only: converge_check use SimVariablesModule, only: isim_mode + use SourceLoadModule, only: export_post_step ! -- return variable logical(LGP) :: hasConverged ! -- local variables @@ -730,6 +737,9 @@ function Mf6FinalizeTimestep() result(hasConverged) end do end select ! + ! -- update exports + call export_post_step() + ! ! -- Check if we're done call converge_check(hasConverged) ! diff --git a/utils/idmloader/dfns.txt b/utils/idmloader/dfns.txt index 61a2d12092e..e547a7cff8d 100644 --- a/utils/idmloader/dfns.txt +++ b/utils/idmloader/dfns.txt @@ -73,3 +73,4 @@ exg-gwfprt.dfn # utils utl-hpc.dfn +utl-ncf.dfn diff --git a/utils/idmloader/scripts/dfn2f90.py b/utils/idmloader/scripts/dfn2f90.py index 287cf6e8b21..cfa3a389129 100644 --- a/utils/idmloader/scripts/dfn2f90.py +++ b/utils/idmloader/scripts/dfn2f90.py @@ -31,6 +31,7 @@ def __init__(self, dfnfspec: str = None, verbose: bool = False): self._aggregate_varnames = [] self._warnings = [] self._multi_package = False + self._subpackage = [] self._verbose = verbose self.component, self.subcomponent = self._dfnfspec.stem.upper().split( @@ -81,6 +82,17 @@ def write_f90(self, ofspec=None): f"{self.subcomponent.lower()}_multi_package = {smult}\n\n" ) + # subpackage + f.write( + f" character(len=16), parameter :: &\n" + f" {self.component.lower()}_{self.subcomponent.lower()}_subpackages(*) = &\n" + ) + if not len(self._subpackage): + self._subpackage.append(''.ljust(16)) + f.write(f" [ &\n") + f.write(" '" + "', &\n '" .join(self._subpackage) + "' &\n") + f.write(f" ]\n\n") + # params if len(self._param_varnames): f.write(self._param_str) @@ -196,6 +208,10 @@ def _set_var_d(self): # flopy multi-package if "flopy multi-package" in line.strip(): self._multi_package = True + elif "mf6 subpackage" in line.strip(): + sp = line.replace("# mf6 subpackage ", "").strip() + sp = sp.upper() + self._subpackage.append(sp.ljust(16)) continue ll = line.strip().split() @@ -292,6 +308,7 @@ def _set_param_strs(self): self._param_str += " '', & ! fortran variable\n" self._param_str += " '', & ! type\n" self._param_str += " '', & ! shape\n" + self._param_str += " '', & ! longname\n" self._param_str += " .false., & ! required\n" self._param_str += " .false., & ! multi-record\n" self._param_str += " .false., & ! preserve case\n" @@ -309,6 +326,7 @@ def _set_param_strs(self): self._aggregate_str += " '', & ! fortran variable\n" self._aggregate_str += " '', & ! type\n" self._aggregate_str += " '', & ! shape\n" + self._aggregate_str += " '', & ! longname\n" self._aggregate_str += " .false., & ! required\n" self._aggregate_str += " .false., & ! multi-record\n" self._aggregate_str += " .false., & ! preserve case\n" @@ -403,6 +421,10 @@ def _set_blk_param_strs(self, blockname, component, subcomponent): ): t = f"{t}{ndim}D" + longname = "" + if "longname" in v: + longname = v["longname"].replace("'", "") + inrec = ".false." if "in_record" in v: if v["in_record"] == "true": @@ -448,6 +470,7 @@ def _set_blk_param_strs(self, blockname, component, subcomponent): (mf6vn, "fortran variable"), (t, "type"), (shape, "shape"), + (longname, "longname"), (r, "required"), (inrec, "multi-record"), (preserve_case, "preserve case"), @@ -520,7 +543,9 @@ def _source_file_header(self, component, subcomponent): f" public {component.capitalize()}{subcomponent.capitalize()}" f"ParamFoundType\n" f" public {component.lower()}_{subcomponent.lower()}_" - f"multi_package\n\n" + f"multi_package\n" + f" public {component.lower()}_{subcomponent.lower()}_" + f"subpackages\n\n" ) return s @@ -588,6 +613,7 @@ def _write_master(self): self._write_master_defn(fh, defn="aggregate", dtype="param") self._write_master_defn(fh, defn="block", dtype="block") self._write_master_multi(fh) + self._write_master_sub(fh) self._write_master_integration(fh) self._write_master_component(fh) fh.write(f"end module IdmDfnSelectorModule\n") @@ -620,6 +646,7 @@ def _write_selectors(self): dtype="block", ) self._write_selector_multi(fh, component=c, sc_list=self._d[c]) + self._write_selector_sub(fh, component=c, sc_list=self._d[c]) self._write_selector_integration( fh, component=c, sc_list=self._d[c] ) @@ -652,6 +679,7 @@ def _write_selector_decl(self, fh=None, component=None, sc_list=None): f" public :: {c.lower()}_aggregate_definitions\n" f" public :: {c.lower()}_block_definitions\n" f" public :: {c.lower()}_idm_multi_package\n" + f" public :: {c.lower()}_idm_subpackages\n" f" public :: {c.lower()}_idm_integrated\n\n" ) s += f"contains\n\n" @@ -679,6 +707,16 @@ def _write_selector_helpers(self, fh=None): f" end subroutine set_block_pointer\n\n" ) + s += ( + f" subroutine set_subpkg_pointer(subpkg_list, subpkg_list_target)\n" + f" character(len=16), dimension(:), " + f"pointer :: subpkg_list\n" + f" character(len=16), dimension(:), " + f"target :: subpkg_list_target\n" + f" subpkg_list => subpkg_list_target\n" + f" end subroutine set_subpkg_pointer\n\n" + ) + fh.write(s) def _write_selector_defn( @@ -744,6 +782,33 @@ def _write_selector_multi(self, fh=None, component=None, sc_list=None): fh.write(s) + def _write_selector_sub(self, fh=None, component=None, sc_list=None): + c = component + + s = ( + f" function {c.lower()}_idm_subpackages(subcomponent) " + f"result(subpackages)\n" + f" character(len=*), intent(in) :: subcomponent\n" + f" character(len=16), dimension(:), pointer :: subpackages\n" + f" select case (subcomponent)\n" + ) + + for sc in sc_list: + s += ( + f" case ('{sc}')\n" + f" call set_subpkg_pointer(subpackages, " + f"{c.lower()}_{sc.lower()}_subpackages)\n" + ) + + s += ( + f" case default\n" + f" end select\n" + f" return\n" + f" end function {c.lower()}_idm_subpackages\n\n" + ) + + fh.write(s) + def _write_selector_integration( self, fh=None, component=None, sc_list=None ): @@ -795,6 +860,7 @@ def _write_master_decl(self, fh=None): f" public :: aggregate_definitions\n" f" public :: block_definitions\n" f" public :: idm_multi_package\n" + f" public :: idm_subpackages\n" f" public :: idm_integrated\n" f" public :: idm_component\n\n" f"contains\n\n" @@ -860,6 +926,36 @@ def _write_master_multi(self, fh=None): fh.write(s) + def _write_master_sub(self, fh=None): + s = ( + f" function idm_subpackages(component, subcomponent) " + f"result(subpackages)\n" + f" character(len=*), intent(in) :: component\n" + f" character(len=*), intent(in) :: subcomponent\n" + f" character(len=16), dimension(:), pointer :: subpackages\n" + f" select case (component)\n" + ) + + for c in dfn_d: + s += ( + f" case ('{c}')\n" + f" subpackages => {c.lower()}_idm_" + f"subpackages(subcomponent)\n" + ) + + s += ( + f" case default\n" + f" call store_error('Idm selector component not found; '//&\n" + f" &'component=\"'//trim(component)//&\n" + f" &'\", subcomponent=\"'//trim(subcomponent)" + f"//'\".', .true.)\n" + f" end select\n" + f" return\n" + f" end function idm_subpackages\n\n" + ) + + fh.write(s) + def _write_master_integration(self, fh=None): s = ( f" function idm_integrated(component, subcomponent) " diff --git a/utils/mf5to6/make/makedefaults b/utils/mf5to6/make/makedefaults index 482562ab0b7..bd14743c5f7 100644 --- a/utils/mf5to6/make/makedefaults +++ b/utils/mf5to6/make/makedefaults @@ -1,4 +1,4 @@ -# makedefaults created by pymake (version 1.2.10.dev0) for the 'mf5to6' executable. +# makedefaults created by pymake (version 1.2.10) for the 'mf5to6' executable. # determine OS ifeq ($(OS), Windows_NT) diff --git a/utils/mf5to6/make/makefile b/utils/mf5to6/make/makefile index 45d74af0db8..a9a49163fe6 100644 --- a/utils/mf5to6/make/makefile +++ b/utils/mf5to6/make/makefile @@ -1,14 +1,14 @@ -# makefile created by pymake (version 1.2.10.dev0) for the 'mf5to6' executable. +# makefile created by pymake (version 1.2.10) for the 'mf5to6' executable. include ./makedefaults # Define the source file directories SOURCEDIR1=../src -SOURCEDIR2=../src/NWT -SOURCEDIR3=../src/LGR -SOURCEDIR4=../src/Preproc -SOURCEDIR5=../src/MF2005 +SOURCEDIR2=../src/MF2005 +SOURCEDIR3=../src/NWT +SOURCEDIR4=../src/LGR +SOURCEDIR5=../src/Preproc SOURCEDIR6=../../../src/Utilities/Memory SOURCEDIR7=../../../src/Utilities/TimeSeries SOURCEDIR8=../../../src/Utilities diff --git a/utils/zonebudget/make/makedefaults b/utils/zonebudget/make/makedefaults index dbbf549c9db..741467b2273 100644 --- a/utils/zonebudget/make/makedefaults +++ b/utils/zonebudget/make/makedefaults @@ -1,4 +1,4 @@ -# makedefaults created by pymake (version 1.2.10.dev0) for the 'zbud6' executable. +# makedefaults created by pymake (version 1.2.10) for the 'zbud6' executable. # determine OS ifeq ($(OS), Windows_NT) diff --git a/utils/zonebudget/make/makefile b/utils/zonebudget/make/makefile index ac915d92e25..d5792851040 100644 --- a/utils/zonebudget/make/makefile +++ b/utils/zonebudget/make/makefile @@ -1,4 +1,4 @@ -# makefile created by pymake (version 1.2.9) for the 'zbud6' executable. +# makefile created by pymake (version 1.2.10) for the 'zbud6' executable. include ./makedefaults