modflowpy / flopy

A Python package to create, run, and post-process MODFLOW-based models.
https://flopy.readthedocs.io
Other
517 stars 313 forks source link

Adding Modpath7Sim for second time replaces, but does not trigger 'replace' warning #1817

Closed mbakker7 closed 1 year ago

mbakker7 commented 1 year ago

In MP7, when a second Modpath7Sim object is added to an MP model, the first one is replaced, but flopy does not give the common WARNING: Package with type XX already exists. Replacing existing package. This may be useful, especially in this case, as adding several Modpath7Sim to the same model would actually be useful. So it is important to know that is not possible (right now) and that the new Modpath7Sim replaces the old one.

wpbonelli commented 1 year ago

I think this is a result of different verbosity defaults for mf2005 vs mf6 model base classes. With verbose=True on the Modpath7 instance I get this output from a test run with a duplicated Modpath7Sim (see warning at bottom)

$ python test.py
writing simulation...
  writing simulation name file...
  writing simulation tdis package...
  writing solution package ims...
  writing model ex01_mf6...
    writing model name file...
    writing package dis...
    writing package ic...
    writing package npf...
    writing package rcha_0...
    writing package wel_0...
    writing package riv_0...
INFORMATION: maxbound in ('gwf6', 'riv', 'dimensions') changed to 21 based on size of stress_period_data
    writing package oc...
FloPy is using the following executable to run the model: ../../../../venv/bin/mf6
                                   MODFLOW 6
                U.S. GEOLOGICAL SURVEY MODULAR HYDROLOGIC MODEL
                        VERSION 6.4.1 Release 12/09/2022

   MODFLOW 6 compiled Apr 12 2023 19:02:02 with Intel(R) Fortran Intel(R) 64
   Compiler Classic for applications running on Intel(R) 64, Version 2021.7.0
                             Build 20220726_000000

This software has been approved for release by the U.S. Geological 
Survey (USGS). Although the software has been subjected to rigorous 
review, the USGS reserves the right to update the software as needed 
pursuant to further analysis and review. No warranty, expressed or 
implied, is made by the USGS or the U.S. Government as to the 
functionality of the software and related material nor shall the 
fact of release constitute any such warranty. Furthermore, the 
software is released on condition that neither the USGS nor the U.S. 
Government shall be held liable for any damages resulting from its 
authorized or unauthorized use. Also refer to the USGS Water 
Resources Software User Rights Notice for complete use, copyright, 
and distribution information.

 Run start date and time (yyyy/mm/dd hh:mm:ss): 2023/06/08 12:16:05

 Writing simulation list file: mfsim.lst
 Using Simulation name file: mfsim.nam

    Solving:  Stress period:     1    Time step:     1

 Run end date and time (yyyy/mm/dd hh:mm:ss): 2023/06/08 12:16:06
 Elapsed run time:  0.087 Seconds

 Normal termination of simulation.
adding Package:  MPBAS
adding Package:  MPSIM

WARNING:
    Two packages of the same type, Replacing existing 'MPSIM' package.