Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature: Rename all output files #1818

Open
Julien-K opened this issue Jun 7, 2023 · 4 comments
Open

feature: Rename all output files #1818

Julien-K opened this issue Jun 7, 2023 · 4 comments
Milestone

Comments

@Julien-K
Copy link

Julien-K commented Jun 7, 2023

Dear maintainers,

I'm not sure the following described behaviour is a feature request or a bug, or something I missed in the doc.

I'm working on parametric grids; I have a ModelMuse-generated mf6 project as base model and I want to duplicate it for each case of my study.

Each case-model should be named with a pattern:

  • my base model: myModel
  • each case model: myModel_v01 .... myModel_v11

Here is a code sample:

import flopy as fp
import numpy as np
import copy
import os

simName = 'myModel'
Orig_sim = './orig'
exeName = 'c:\\local\\WRDAPP\\mf6.4.1\\bin\\mf6.exe'
 
sim = fp.mf6.MFSimulation.load(simName,exe_name=exeName,verbosity_level=1,sim_ws=Orig_sim)
case_sim = copy.deepcopy(sim) 
case_sim_path = Orig_sim + '\\test_v01'
case_sim_name = simName + '_v01'
case_sim.set_sim_path(case_sim_path)

case_sim.rename_all_packages(case_sim_name)

case_sim.write_simulation()
case_sim.run_simulation()

All input files are correctly named following the given pattern.

myModel_v01.chd
myModel_v01.disv
myModel_v01.disv.grb
myModel_v01.gnc
myModel_v01.hfb
myModel_v01.ic
myModel_v01.ims
myModel_v01.nam
myModel_v01.npf
myModel_v01.ob_gw
myModel_v01.oc
myModel_v01.sto
myModel_v01.tdis

But output file names for packages OC, OBS and IMS (at least) are not modified following the given pattern, I still get:

mfsim.lst
mfsim.nam
myModel.InnerSolution.CSV
myModel.OuterSolution.CSV
myModel.bhd
myModel.ob_gw_out_head.csv
mymodel.lst

I see from the doc that I can alter manually the 'bhd' file (OC package) and the IMS output files, but I didn't find a method for the OBS6 output files.

Is there a clean way to rename all these files?

Regards,
Julien

@Julien-K Julien-K changed the title feature: feature: Rename all output files Jun 7, 2023
@wpbonelli
Copy link
Contributor

@Julien-K apology for the delay here. Someone else more knowledgeable might jump in here and correct me but I don't think there is a clean way to do this — consistent naming for input and output files (per the given model name) seems like the ideal behavior, so this could even be considered a bug?

@ougx
Copy link
Contributor

ougx commented Dec 16, 2023

This example could be helpful: https://flopy.readthedocs.io/en/3.3.5/_notebooks/tutorial02_mf6_data.html

And mf6obs API: https://flopy.readthedocs.io/en/3.3.5/source/flopy.mf6.modflow.mfutlobs.html

It is possible that multiple obs output files can be used in the same package. Therefore, it is not applicable to use a uniform case name for all the files.

@langevin-usgs
Copy link
Contributor

@Julien-K, for better or worse, we've set up flopy and MODFLOW 6 to use a dedicated folder for each simulation. Since you are changing the folder name for each case is it necessary to change the base file name inside the folder as well? Just trying to fully understand the use case.

@Julien-K
Copy link
Author

Hi Christian, that's indeed what I was trying to do: each simulation's name is the folder's name. It works for all files but the output files (lst, bhd and csv files).

@wpbonelli wpbonelli added this to the 3.7.0 milestone May 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants