pyemu icon indicating copy to clipboard operation
pyemu copied to clipboard

Update modflow input files with calibrated values.

Open DStrom1987 opened this issue 1 year ago • 2 comments

Hi,

I'm struggling a bit with how to update my modflow files with the parameters from my final pest run or from a set of acceptable results in an ensamble run.

I use to do this with parrep in the pest utilities. Is there a way of doing this if you want to run the optimized model outside of the python shell?

Sincerely David

DStrom1987 avatar Sep 01 '23 15:09 DStrom1987

you can still use parrep with .base.par file that ies writes each iteration, either with pyemu or with the parrep utility (assuming the format of the .par file hasnt changed in PEST recently...). If you want a realization other than base, then you'll need to do something more clever to extract that parameter vector from the ensemble file and get it into a control file.

Once you have the desired par values into the control file, then the standard noptmax=0 run will gen the underlying model input and output files - same as it ever was...

jtwhite79 avatar Sep 02 '23 02:09 jtwhite79

Right.. Ill give it another go. I'm not entirely sure what went wrong. But as I have used a simplifyed workflow (being an avid gui user) where all inputs and outputs including. pst-file, pilotpoints etc were generated by model muse, the Kx parameter field following a pest run ends up in a subfolder called "array" where the output to this folder is written by plproc using the RunModel.bat after preparing the .pst-file with the latest .par-file using parrep. This workflow has been working fine with the old pest-site, but for whatever reason the kx-array remains unchanged.

DStrom1987 avatar Sep 02 '23 09:09 DStrom1987

@DStrom1987, did you get to the bottom of this issue? If not it would be good to get a bit more detail, on what you are trying to achieve, what steps you are taking, and what is going wrong.

briochh avatar Mar 27 '24 20:03 briochh

Hi,

Thanks for asking. I managed achieve what I wanted by following Jeremys advice and some hints in other threads.

The step I’m trying to achieve is in itself quite obsolete really. Its just that I’m not coming from a programing background and still rely quite heavily on GUIs. Which is why I needed to be able to read in the posterior parameters into model muse.

I realize it kind of defeats the purpose of running ensembles if I’m still picking out a few good members of the posterior. For this reason I’m nog working on another workflow where I can run the posterior ensemble with pestpp-swp output heads of my posterior and some predictive case of interest to compare head outputs and get an ensemble of drawdown contours.

getting there slowly.. but I’m still struggling since I cant follow the steps of the tutorials regarding pst_from with a quadtree grid.

the tools are great though!

Sincerely David

DStrom1987 avatar Mar 27 '24 21:03 DStrom1987

If you are happy to dig around in the pyemu library there is a pst_from test that works with a quadtree version of freyberg, here (thanks due to @rhugman-intera). It might not perfectly match your usage but there may be some tricks in there. @rhugman-intera, is there a quadtree demo notebook anywhere?

Being able to view resultant fields is definitely an important step, for both sense checking and communications. There is work to be done making this easier with ensemble outputs.

Will close this issue now.

briochh avatar Mar 27 '24 21:03 briochh

Thanks, I’ll sure give it another go. So far I’ve sort of met roads end when trying to pass the SpatialReference since it only seems to work with structured grids.

I believe Jeremy pointed me to the pypestutils repo and i tried using get_grid_info_from_mf6_grb function but couldnt figure out how to further implement it at that time.

Antway, Ill look into the example you refered to. Thanks!

ons 27 mars 2024 kl. 22:32 skrev Brioch Hemmings @.***>:

If you are happy to dig around in the pyemu library there is a pst_from test that works with a quadtree version of freyberg, here https://github.com/pypest/pyemu/blob/e31ef7672b01033990928299f357d8b66a5d2d22/autotest/pst_from_tests.py#L4589 (thanks due to @rhugman-intera https://github.com/rhugman-intera). It might not perfectly match your usage but there may be some tricks in there. @rhugman-intera https://github.com/rhugman-intera, is there a quadtree demo notebook anywhere?

Being able to view resultant fields is definitely an important step, for both sense checking and communications. There is work to be done making this easier with ensemble outputs.

Will close this issue now.

— Reply to this email directly, view it on GitHub https://github.com/pypest/pyemu/issues/458#issuecomment-2024027749, or unsubscribe https://github.com/notifications/unsubscribe-auth/ARYO5IDUXD3N5RRCYSVDSY3Y2M3IRAVCNFSM6AAAAAA4HWNN7SVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMRUGAZDONZUHE . You are receiving this because you were mentioned.Message ID: @.***>

DStrom1987 avatar Mar 27 '24 21:03 DStrom1987

pstfrom should accept none structured flopy model grid object (subject to maintaining inter-dependancies!). This may be linked to #466.

briochh avatar Mar 27 '24 21:03 briochh