MODFLOW-USGS / mfusg

Public repository for MODFLOW-USG
https://water.usgs.gov/ogw/mfusg/
7 stars 4 forks source link

Bug in ETS Package #23

Closed langevin-usgs closed 7 years ago

langevin-usgs commented 7 years ago

Sorab, there is a bug in the ETS package. INIETS needs to be read for both cases. You'll note that I added it to the else statement below (and changed to 5I10).

C1------READ FLAGS SHOWING WHETHER DATA FROM PREVIOUS STRESS PERIODS ARE
C       TO BE REUSED.
      IF (NETSEG.GT.1) THEN
        IF(NETSOP.EQ.2) THEN
          IF(IFREFM.EQ.0) THEN
            READ(IN,'(5I10)') INETSS,INETSR,INETSX,INIETS,INSGDF
          ELSE
            READ(IN,*) INETSS,INETSR,INETSX,INIETS,INSGDF
          ENDIF
        ELSE
          IF(IFREFM.EQ.0) THEN
            READ(IN,'(5I10)') INETSS,INETSR,INETSX,INIETS,INSGDF
          ELSE
            READ(IN,*) INETSS,INETSR,INETSX,INIETS,INSGDF
          ENDIF
          INIETS = NODLAY(1)
        ENDIF

This also affects the input instructions. Richard Winston's page has a nice description (https://water.usgs.gov/ogw/modflow/MODFLOW-2005-Guide/index.html?ets.htm). I changed the USG input description as follows.

FOR EACH STRESS PERIOD

5. INETSS INETSR INETSX [INIETS [INSGDF]]

And revised the descriptions to be:

(this one in black)

INIETS—is the layer indicator (IETS) read flag.  It is read if the ET option (NETSOP) is equal to two or if NETSEG > 1. If NETSEG > 1 and NETSOP is not equal to two, INIETS is ignored and IETS is not read.
If INIETS ≥ 0, An array containing the layer indicators (IETS) will be read for a structured grid. For an unstructured grid, INIETS is further equal to the number of nodes for which ET values are read in the simulation, with the nodes being identified in the array IETS.

If INIETS < 0, layer indicators used during the preceding stress period will be reused.

(this one in blue)

INIETS—is the layer indicator (IETS) read flag.  It is read if the ET option (NETSOP) is equal to two or if NETSEG > 1. If NETSEG > 1 and NETSOP is not equal to two, INIETS is ignored and IETS is not read.
If INIETS ≥ 0, An array containing the layer indicators (IETS) will be read for a structured grid. For an unstructured grid, INIETS is further equal to the number of nodes for which ET values are read in the simulation, with the nodes being identified in the array IETS.

If INIETS < 0, layer indicators used during the preceding stress period will be reused.

I'll be committing a test problem that you can use to verify.

sorab commented 7 years ago

Not sure why this should be the case, Chris. NETSEG is the segments for ETS and is not connected to which nodes (layers) ET is applied. NETSOP is the flag which indicates if INIETS shold be read or not (to indicate layers or nodes to apply that ET to).

langevin-usgs commented 7 years ago

Yes, I agree. But mf2005 still reads a dummy value for IETS (even though it doesn't use it) before it reads a value for the segment reading flag.

langevin-usgs commented 7 years ago

Here is a test problem that demonstrates. A corresponding mf2005 version is in the subfolder.

test049_ets.zip

sorab commented 7 years ago

Ok thanks. Will change it in Beta as well so we are consistent.