Skip to content

Commit

Permalink
Worked on importing MODFLOW 6 models into ModelMuse.
Browse files Browse the repository at this point in the history
  • Loading branch information
rbwinst-usgs committed Jun 15, 2024
1 parent a30baa5 commit 25fb3f3
Show file tree
Hide file tree
Showing 9 changed files with 46 additions and 10 deletions.
9 changes: 9 additions & 0 deletions MF6InputReader/Mf6.EvtFileReaderUnit.pas
Original file line number Diff line number Diff line change
Expand Up @@ -576,6 +576,10 @@ procedure TEvtPeriod.Read(Stream: TStreamReader; Unhandled: TStreamWriter;
begin
SetLength(IEVT, Length(IEVT), Length(IEVT[0]));
end;
PriorPeriod.SURFACE.Initialize;
PriorPeriod.RATE.Initialize;
PriorPeriod.DEPTH.Initialize;
PriorPeriod.IEVT := nil;
end;
try
while not Stream.EndOfStream do
Expand Down Expand Up @@ -741,6 +745,11 @@ procedure TEvtPeriod.Read(Stream: TStreamReader; Unhandled: TStreamWriter;
begin
Cell.Frate.NumericValue := RATE.Value[RowIndex, ColIndex];
Cell.Frate.ValueType := vtNumeric;
if Cell.Frate.NumericValue = 0 then
begin
Cell.Free;
Continue;
end;
end
else
begin
Expand Down
8 changes: 8 additions & 0 deletions MF6InputReader/Mf6.ImsFileReaderUnit.pas
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,14 @@ procedure TImsOptions.Read(Stream: TStreamReader; Unhandled: TStreamWriter);
if FSplitter[0] = 'NO_PTC' then
begin
FNO_PTC := FSplitter[0];
if FSplitter.Count >= 2 then
begin
Fno_ptc_option := FSplitter[1];
if (Fno_ptc_option <> 'FIRST') and (Fno_ptc_option <> 'ALL') then
begin
Unhandled.WriteLine(StrUnrecognizedImsOp);
end;
end;
end
else if FSplitter.Count >= 2 then
begin
Expand Down
12 changes: 10 additions & 2 deletions MF6InputReader/Mf6.RchFileReaderUnit.pas
Original file line number Diff line number Diff line change
Expand Up @@ -457,19 +457,22 @@ procedure TRchPeriod.Read(Stream: TStreamReader; Unhandled: TStreamWriter;
end
else
begin
FRECHARGE.Assign(PriorPeriod.FRECHARGE);
FIRCH := PriorPeriod.FIRCH;
if FIRCH <> nil then
begin
SetLength(FIRCH, Length(FIRCH), Length(FIRCH[0]));
FRECHARGE.Assign(PriorPeriod.FRECHARGE);
for AuxIndex := 0 to PriorPeriod.AuxList.Count - 1 do
begin
AuxArray.Assign(PriorPeriod.AuxList[AuxIndex]);
AuxList.Add(AuxArray);
end;
end;
PriorPeriod.FRECHARGE.Initialize;
PriorPeriod.FIRCH := nil;
PriorPeriod.AuxList.Clear;
end;
// AuxList := TArrayItemList.Create;

try
while not Stream.EndOfStream do
begin
Expand Down Expand Up @@ -582,6 +585,11 @@ procedure TRchPeriod.Read(Stream: TStreamReader; Unhandled: TStreamWriter;
begin
Cell.Frecharge.NumericValue := FRECHARGE.Value[RowIndex, ColIndex];
Cell.Frecharge.ValueType := vtNumeric;
if Cell.Frecharge.NumericValue = 0 then
begin
Cell.Free;
Continue;
end;
end
else
begin
Expand Down
1 change: 1 addition & 0 deletions MF6InputReader/Mf6.SpcFileReaderUnit.pas
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,7 @@ procedure TSpcPeriod.Read(Stream: TStreamReader; Unhandled: TStreamWriter;
FItems.Add(SpcTimeItem);
end;
end;
Concentration.Initialize;
end;
end
else
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="../helpproject.xsl" ?>
<topic template="Default" modified="2024-06-13T14:25:18.251-04:00" lasteditedby="rbwinst" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../helpproject.xsd">
<topic template="Default" modified="2024-06-14T14:30:14.632-04:00" lasteditedby="rbwinst" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../helpproject.xsd">
<title translate="true">Import MODFLOW 6 Model Dialog Box</title>
<body>
<header>
Expand All @@ -9,14 +9,14 @@
<para styleclass="Normal"><text styleclass="Normal" translate="true">The </text><text styleclass="Strong" translate="true">Import MODFLOW 6 Model</text><text styleclass="Normal" translate="true"> dialog box is used to import existing MODFLOW 6 models. The user specifies the simulation file for flow in the first edit box (labeled </text><text styleclass="Strong" translate="true">MODFLOW 6 Simulation Name File for flow</text><text styleclass="Normal" translate="true">). It can be accessed from the </text><link displaytype="text" defaultstyle="true" type="topiclink" href="Start_Up_Dialog_Box" styleclass="Strong" translate="true">Start-Up</link><text styleclass="Normal" translate="true"> dialog box or by selecting </text><text styleclass="Strong" translate="true">File|Import|MODFLOW 6 Model</text><text styleclass="Normal" translate="true">.</text></para>
<para styleclass="Normal"><text styleclass="Normal" translate="true">If a .usgs model reference file is available, its name can be specified in the edit box labeled </text><text styleclass="Strong" translate="true">usgs.model.reference file (Optional)</text><text styleclass="Normal" translate="true">. This file includes the coordinates of the upper left corner of the model and the model rotation among other things. This information can be used to geolocate models that use a structured grid if geolocation information is absent from the .dis file.</text></para>
<para styleclass="Normal"><text styleclass="Normal" translate="true">If there are separate simulations for solute transport, their simulation name files can be entered the table labeled &quot;MODFLOW 6 Simulation Name Files for transport (optional). If groundwater flow and transport are included in the same simulation, this table should be left empty.</text></para>
<para styleclass="Normal"><text styleclass="Normal" translate="true">It is advisable to compare the results of the imported and original model. If there are substantial differences, there may have been problem in importing the model.</text></para>
<para styleclass="Heading2_atoc_"><text styleclass="Heading2_atoc_" translate="true">Limitations</text></para>
<list id="0" type="ul" listtype="bullet" formatstring="&#183;" format-charset="SYMBOL_CHARSET" levelreset="true" legalstyle="false" startfrom="1" styleclass="Normal" style="font-family:Symbol; font-size:12pt; color:#000000;">
<li styleclass="Normal"><text styleclass="Normal" translate="true">The imported model may differ from the original model in some respects. It is advisable to compare the results of the imported and original model. If there are substantial differences, there may have been problem in importing the model.</text></li>
<li styleclass="Normal"><text styleclass="Normal" translate="true">ModelMuse can not import model types other than flow models or solute transport models. Thus it can not import energy transport models or particle tracking models.</text></li>
<li styleclass="Normal"><text styleclass="Normal" translate="true">ModelMuse can not import models that use DISU grids.</text></li>
<li styleclass="Normal"><text styleclass="Normal" translate="true">If a simulation includes more than one flow model, only one of the flow models can be imported.</text></li>
<li styleclass="Normal"><text styleclass="Normal" translate="true">ModelMuse can not import exchanges between flow models or between solute transport models.</text></li>
<li styleclass="Normal"><text styleclass="Normal" translate="true">If the model contains more than one boundary package of the same type, all of the boundaries will be included in a single package.</text></li>
<li styleclass="Normal"><text styleclass="Normal" translate="true">ModelMuse can not import exchanges among multiple flow models or among multiple solute transport models.</text></li>
<li styleclass="Normal"><text styleclass="Normal" translate="true">If the model contains more than one boundary package of the same type, all of the boundaries will be included in a single package. If the options of these packages are different, this may affect the model results.</text></li>
<li styleclass="Normal"><text styleclass="Normal" translate="true">When importing the lake package, it may happen that cells outside the model area will be identified as part of a lake if the lake is close to the edge of the model. If this occurs, the model can be fixed by selecting the erroneous vertices of the lake object and deleting them.</text></li>
<li styleclass="Normal"><text styleclass="Normal" translate="true">All connections to any individual well in the Multiaquifer Well package must be vertically aligned.</text></li>
<li styleclass="Normal"><text styleclass="Normal" translate="true">The model input must be consistent with the MODFLOW input instructions.</text></li>
Expand All @@ -27,6 +27,8 @@
<li styleclass="Normal"><text styleclass="Normal" translate="true">The Ghost Node Correction package is only imported for DISV models. If this is a problem, specify the original GNC file in the </text><link displaytype="text" defaultstyle="true" type="topiclink" href="MODFLOW_Name_File_Dialog_Box" styleclass="Normal" translate="true">Model|MODFLOW Name File</link><text styleclass="Normal" translate="true"> dialog box.</text></li>
<li styleclass="Normal"><text styleclass="Normal" translate="true">The values imported for the Ghost Node Correction may differ from those in the original model. If this is a problem, replace the imported Ghost Node Correction file with the original file or specify the original GNC file in the </text><link displaytype="text" defaultstyle="true" type="topiclink" href="MODFLOW_Name_File_Dialog_Box" styleclass="Normal" translate="true">Model|MODFLOW Name File</link><text styleclass="Normal" translate="true"> dialog box.</text></li>
<li styleclass="Normal"><text styleclass="Normal" translate="true">In some cases, the encoding of a text input file may be a problem. In such cases, it may be possible to solve the problem by copying the contents of the file to another text file and then using the new file in the model in place of the old one.</text></li>
<li styleclass="Normal"><text styleclass="Normal" translate="true">When importing the Source and Sink Mixing package, boundary packages omitted from the Source and Sink Mixing package will still be included in the imported model. In addition, the Recharge and Evapotranspiration packages will always be specified as AUXMIXED in the imported model regardless of how they are specified in the imported model.</text></li>
<li styleclass="Normal"><text styleclass="Normal" translate="true">ModelMuse may run out of memory when importing very large models.</text></li>
</list>
<para styleclass="Normal"></para>
</body>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="../helpproject.xsl" ?>
<topic template="Default" modified="2022-04-28T17:09:10.223-04:00" lasteditedby="rbwinst" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../helpproject.xsd">
<topic template="Default" modified="2024-06-14T12:39:14.983-04:00" lasteditedby="rbwinst" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../helpproject.xsd">
<title translate="true">RmaMF6: Visualize Modified Model Input</title>
<body>
<header>
<para styleclass="Heading1"><text styleclass="Heading1" translate="true">RmaMF6: Visualize Modified Model Input</text></para>
</header>
<para styleclass="Normal"><text styleclass="Normal" translate="true">The model created by PEST after parameter estimation now has a different flow rate through the disposal pond and a non-uniform hydraulic conductivity distribution. ModelMuse provides ways to import both sets of data and visualize both. </text></para>
<para styleclass="Normal"><text styleclass="Normal" translate="true">The model created by PEST after parameter estimation now has a different flow rate through the disposal pond and a non-uniform hydraulic conductivity distribution. ModelMuse provides ways to import both sets of data and visualize both. In addition, ModelMuse can import entire MODFLOW 6 models with the </text><link displaytype="text" defaultstyle="true" type="topiclink" href="Import-MODFLOW-6-Model-Dialog-" styleclass="Normal" translate="true">File|Import|MODFLOW 6 Model</link><text styleclass="Normal" translate="true"> command.</text></para>
<para styleclass="Heading2_atoc_"><text styleclass="Heading2_atoc_" translate="true">Visualizing Well Flow Rates</text></para>
<para styleclass="Normal"><text styleclass="Normal" translate="true">Select </text><link displaytype="text" defaultstyle="true" type="topiclink" href="Import_MODFLOW_6_Feature_Modif" styleclass="Strong" translate="true">File|Import|MODFLOW 6 Features</link><text styleclass="Normal" translate="true">. Then select the input file for the Well package. In the dialog box, select the stress period for which to see the pumping rates. In this case there is only one stress period so choose stress period 1. ModelMuse will create a data set named Well_Pumping_Rate_SP_1 with the pumping rates in each cell. The data set will be classified under “Optional|Model Results|Model Features”. You can </text><link displaytype="text" defaultstyle="true" type="topiclink" href="Color_Grid_Dialog_Box" styleclass="Normal" translate="true">color the grid</link><text styleclass="Normal" translate="true"> with this data set. The sum of the pumping rates for the wells that are part of the disposal pond is 0.0297. The true value is 0.025. This new data set does not change how the pumping rate is defined in ModelMuse, so if you export the model input files from ModelMuse again, it will use the original pumping rates defined in ModelMuse not the ones that PEST generated.</text></para>
<para styleclass="Heading2_atoc_"><text styleclass="Heading2_atoc_" translate="true">Visualizing Kx</text></para>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="../helpproject.xsl" ?>
<topic template="Default" modified="2024-06-05T13:02:49.854-04:00" lasteditedby="rbwinst" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../helpproject.xsd">
<topic template="Default" modified="2024-06-14T12:36:35.295-04:00" lasteditedby="rbwinst" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../helpproject.xsd">
<title translate="true">Visualizing Modified Model Input</title>
<body>
<header>
Expand All @@ -9,6 +9,7 @@
<para styleclass="Normal"><text styleclass="Normal" translate="true">PEST operates by modifying the input files for MODFLOW and SUTRA. Those changes to the input files do not affect how the model is defined in ModelMuse. If you run the model again from ModelMuse, all the inputs will be the same as before parameter estimation was performed. However, ModelMuse provides ways of importing and visualizing the modified model inputs created by PEST. The methods vary depending on the type of model and the type of input. </text></para>
<para styleclass="Normal"><text styleclass="Normal" translate="true">If PEST parameters are used with a data set, a file for each layer of the data set in the model will be created in the &quot;arrays&quot; subdirectory of the working directory of the model. Data in the files can be imported into ModelMuse with the </text><link displaytype="text" defaultstyle="true" type="topiclink" href="Import_Gridded_Data_Files_Dial" styleclass="Normal" translate="true">File|Import Gridded Data Files</link><text styleclass="Normal" translate="true"> command.</text></para>
<para styleclass="Normal"><text styleclass="Normal" translate="true">For MODFLOW-2005 and related models, the entire model can be imported to a new ModelMuse project with the </text><link displaytype="text" defaultstyle="true" type="topiclink" href="Import_MODFLOW_Model_Dialog_Box" styleclass="Normal" translate="true">File|Import|MODFLOW-2005 or -NWT Model</link><text styleclass="Normal" translate="true"> command. Then any part of the model can be visualized with the </text><link displaytype="text" defaultstyle="true" type="topiclink" href="Data_Visualization_Dialog_Box" styleclass="Normal" translate="true">Data Visualization dialog box</link><text styleclass="Normal" translate="true">.</text></para>
<para styleclass="Normal"><text styleclass="Normal" translate="true">For MODFLOW 6 models, the entire model can be imported to a new ModelMuse project with the </text><link displaytype="text" defaultstyle="true" type="topiclink" href="Import-MODFLOW-6-Model-Dialog-" styleclass="Normal" translate="true">File|Import|MODFLOW 6 Model</link><text styleclass="Normal" translate="true"> command. Then any part of the model can be visualized with the </text><link displaytype="text" defaultstyle="true" type="topiclink" href="Data_Visualization_Dialog_Box" styleclass="Normal" translate="true">Data Visualization dialog box</link><text styleclass="Normal" translate="true">.</text></para>
<para styleclass="Normal"><text styleclass="Normal" translate="true">For MODFLOW 6 models, model feature values can be visualized using </text><link displaytype="text" defaultstyle="true" type="topiclink" href="Import_MODFLOW_6_Feature_Modif" styleclass="Normal" translate="true">File|Import|MODFLOW 6 Feature</link><text styleclass="Normal" translate="true">.</text></para>
<para styleclass="Normal"><text styleclass="Normal" translate="true">For SUTRA model, model feature values can be visualized using </text><link displaytype="text" defaultstyle="true" type="topiclink" href="Import_SUTRA_Feature_Modified_" styleclass="Normal" translate="true">File|Import|SUTRA Features</link><text styleclass="Normal" translate="true">. In addition, data from data sets 14B, 15B, and the SUTRA Initial Conditions file can be imported using </text><link displaytype="text" defaultstyle="true" type="topiclink" href="File" anchor="SutraFile" styleclass="Normal" translate="true">File|Import|SUTRA Files</link><text styleclass="Normal" translate="true">. SUTRA also generates boundary condition output files that indicate how boundary conditions were applied in the model. Data from these can be imported by selecting </text><link displaytype="text" defaultstyle="true" type="topiclink" href="Import_SUTRA_Model_Results_Dia" styleclass="Normal" translate="true">File|Import|Model Results</link><text styleclass="Normal" translate="true">.</text></para>
<para styleclass="Normal"><text styleclass="Normal" translate="true">Model feature data sets imported from both MODFLOW 6 and SUTRA models will be classified under &quot;Optional|Model Results|Model Features&quot; in the “Data Visualization” dialog box.</text></para>
Expand Down
2 changes: 1 addition & 1 deletion ModelMuse/ModelMuse.dproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<ProjectGuid>{DBACE99F-0221-4660-936F-15A30233FA90}</ProjectGuid>
<MainSource>ModelMuse.dpr</MainSource>
<Base>True</Base>
<Config Condition="'$(Config)'==''">Debug</Config>
<Config Condition="'$(Config)'==''">Beta</Config>
<AppType>Application</AppType>
<FrameworkType>VCL</FrameworkType>
<DCC_DCCCompiler>DCC32</DCC_DCCCompiler>
Expand Down
7 changes: 7 additions & 0 deletions ModelMuse/TaskHistory.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33202,5 +33202,12 @@ object TTaskHistory
'Import'
'MF-2015'
'Bug fix')
end
item
Date = 45457.000000000000000000
Categories.Strings = (
'Documentation'
'Import'
'MF-2015')
end>
end

0 comments on commit 25fb3f3

Please sign in to comment.