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

Is there a document for the variables used? #32

Open
MostafaGomaa93 opened this issue Dec 19, 2023 · 4 comments
Open

Is there a document for the variables used? #32

MostafaGomaa93 opened this issue Dec 19, 2023 · 4 comments

Comments

@MostafaGomaa93
Copy link

MostafaGomaa93 commented Dec 19, 2023

Hi, I have some questions, please

1- To know the available variables, I had to use the .advanced_vars argument. However, I don't know the meaning of all variables. For example, for the UZF package, there is "gwpet", which I think is the groundwater potential evapotranspiration, right? Is there any document for the meaning of the variables?

2- Is there a page or so (something like FloPy) that explains how to use the MODFLOWAPI arguments? The only information I got so far is from the notebook examples

Thanks a lot in advance

@pya
Copy link

pya commented Jan 22, 2025

Same problem here. Does looking into the MODFLOW 6 Fortran code help? If so, what would be the strategy to find all advanced_vars for a package?

@emorway-usgs
Copy link

For the time being, have you used the MEMORY_PRINT_OPTION available in the simulation-level name file? If you set it to SUMMARY and run the simulation the available variables will be printed at the bottom of mfsim.lst. I can't speak to whether there is a way of retrieving all available variables directly through the API.

@jlarsen-usgs
Copy link
Contributor

@MostafaGomaa93

The easiest way to get all available API variables is to set the _develop=True flag in the run_simulation() call. This will write a file of all of the available variable addresses in your simulation. Here's the documentation for that option:

def run_simulation(dll, sim_path, callback, verbose=False, _develop=False):
    """
    Method to run a Modflow simulation using the MODFLOW-API
    with a callback function

    Parameters
    ----------
    dll : str
        path to the Modflow6 shared object
    sim_path : str
        path to the Modflow6 simulation
    callback : method
        user defined method that intercepts the simulation
        progress and allows for input variable adjustments on the fly
    verbose : bool
        flag for verbose output from the simulation runner
    _develop : bool
        flag that dumps a list of all mf6 api variable addresses to text
        file named "var_list.txt". This is primarily used for extensions
        development purposes and bug fixes within the modflowapi python
        package.
    """

Another option is to instantiate a ModflowApi() object and then dump out the variables using API/BMI functions. Here's an example:

mf6 = ModflowApi(dll, working_directory=sim_path)
mf6.initialize()
with open("var_list.txt", "w") as foo:
    for name in mf6.get_input_var_names():
        foo.write(f"{name}\n")

@MostafaGomaa93
Copy link
Author

I am aware already of the suggestion by @emorway-usgs, but the other one by @jlarsen-usgs is also helpful. Thanks to you both.

Final thing: the meaning of the variables is not documented yet, right?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants