Skip to content

Commit dd4351e

Browse files
mjrenomjreno
authored andcommitted
store dynamic netcdf input as timeseries
1 parent 16bf403 commit dd4351e

14 files changed

+1330
-1275
lines changed

autotest/test_netcdf_gwf_rch01.py

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -198,20 +198,17 @@ def check_output(idx, test, export, gridded_input):
198198
irch = getattr(rch, "irch").array
199199
recharge = getattr(rch, "recharge").array
200200
if export == "ugrid":
201-
rl1 = xds["rcha_0_recharge_l1_p1"].data.flatten()
202-
rl2 = xds["rcha_0_recharge_l2_p1"].data.flatten()
201+
r = xds["rcha_0_recharge"].data.flatten()
203202
elif export == "structured":
204-
rl1 = xds["rcha_0_recharge_p1"].data[0].flatten()
205-
rl2 = xds["rcha_0_recharge_p1"].data[1].flatten()
203+
r = xds["rcha_0_recharge"].data[0].flatten()
206204
if idx == 1:
207205
assert np.allclose(
208206
np.array(irch).flatten() + 1,
209-
xds["rcha_0_irch_p1"].data,
207+
xds["rcha_0_irch"].data,
210208
), "NetCDF-irch comparison failure"
211-
rarr = np.where(~np.isnan(rl1), rl1, rl2)
212209
assert np.allclose(
213210
np.array(recharge).flatten(),
214-
rarr,
211+
r,
215212
), "NetCDF-recharge comparison failure"
216213

217214
vlist = [

autotest/test_netcdf_gwf_rch03.py

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -200,19 +200,16 @@ def check_output(idx, test, export, gridded_input):
200200
irch = getattr(rch, "irch").array
201201
recharge = getattr(rch, "recharge").array
202202
if export == "ugrid":
203-
rl1 = xds["rcha_0_recharge_l1_p1"].data.flatten()
204-
rl2 = xds["rcha_0_recharge_l2_p1"].data.flatten()
203+
r = xds["rcha_0_recharge"].data.flatten()
205204
elif export == "structured":
206-
rl1 = xds["rcha_0_recharge_p1"].data[0].flatten()
207-
rl2 = xds["rcha_0_recharge_p1"].data[1].flatten()
205+
r = xds["rcha_0_recharge"].data[0].flatten()
208206
assert np.allclose(
209207
np.array(irch).flatten() + 1,
210-
xds["rcha_0_irch_p1"].data,
208+
xds["rcha_0_irch"].data.flatten(),
211209
), "NetCDF-irch comparison failure"
212-
rarr = np.where(~np.isnan(rl1), rl1, rl2)
213210
assert np.allclose(
214211
np.array(recharge).flatten(),
215-
rarr,
212+
r,
216213
), "NetCDF-recharge comparison failure"
217214

218215
vlist = [

autotest/test_netcdf_gwf_vsc03_sfr.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -225,15 +225,11 @@ def check_output(idx, test, export, gridded_input):
225225
irch = getattr(rch, "irch").array
226226
recharge = getattr(rch, "recharge").array
227227
aux = getattr(rch, "aux").array
228-
if export == "ugrid":
229-
rarr = xds["rcha-1_recharge_l1_p1"].data.flatten()
230-
auxarr = xds["rcha-1_temperature_l1_p1"].data.flatten()
231-
elif export == "structured":
232-
rarr = xds["rcha-1_recharge_p1"].data[0].flatten()
233-
auxarr = xds["rcha-1_temperature_p1"].data[0].flatten()
228+
rarr = xds["rcha-1_recharge"].data[0].flatten()
229+
auxarr = xds["rcha-1_temperature"][0].data.flatten()
234230
assert np.allclose(
235231
np.array(irch[0]).flatten() + 1,
236-
xds["rcha-1_irch_p1"].data,
232+
xds["rcha-1_irch"][0].data.flatten(),
237233
), "NetCDF-irch comparison failure"
238234
assert np.allclose(
239235
np.array(recharge[0]).flatten(),

doc/mf6io/mf6ivar/dfn/gwf-ghba.dfn

Lines changed: 9 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ description REPLACE save_flows {'{#1}': 'general-head boundary'}
4848
mf6internal ipakcb
4949

5050
block options
51-
name tas_filerecord
52-
type record tas6 filein tas6_filename
51+
name obs_filerecord
52+
type record obs6 filein obs6_filename
5353
shape
5454
reader urword
5555
tagged true
@@ -58,15 +58,15 @@ longname
5858
description
5959

6060
block options
61-
name tas6
61+
name obs6
6262
type keyword
6363
shape
6464
in_record true
6565
reader urword
6666
tagged true
6767
optional false
68-
longname head keyword
69-
description keyword to specify that record corresponds to a time-array-series file.
68+
longname obs keyword
69+
description keyword to specify that record corresponds to an observations file.
7070

7171
block options
7272
name filein
@@ -79,38 +79,6 @@ optional false
7979
longname file keyword
8080
description keyword to specify that an input filename is expected next.
8181

82-
block options
83-
name tas6_filename
84-
type string
85-
preserve_case true
86-
in_record true
87-
reader urword
88-
optional false
89-
tagged false
90-
longname file name of time series information
91-
description defines a time-array-series file defining a time-array series that can be used to assign time-varying values. See the ``Time-Variable Input'' section for instructions on using the time-array series capability.
92-
93-
block options
94-
name obs_filerecord
95-
type record obs6 filein obs6_filename
96-
shape
97-
reader urword
98-
tagged true
99-
optional true
100-
longname
101-
description
102-
103-
block options
104-
name obs6
105-
type keyword
106-
shape
107-
in_record true
108-
reader urword
109-
tagged true
110-
optional false
111-
longname obs keyword
112-
description keyword to specify that record corresponds to an observations file.
113-
11482
block options
11583
name obs6_filename
11684
type string
@@ -164,7 +132,7 @@ reader readarray
164132
layered true
165133
netcdf true
166134
longname boundary head
167-
description is the boundary head. The recharge array may be defined by a time-array series (see the ``Using Time-Array Series in a Package'' section).
135+
description is the boundary head.
168136
default_value 3.e30
169137

170138
block period
@@ -175,7 +143,7 @@ reader readarray
175143
layered true
176144
netcdf true
177145
longname boundary conductance
178-
description is the hydraulic conductance of the interface between the aquifer cell and the boundary. The recharge array may be defined by a time-array series (see the ``Using Time-Array Series in a Package'' section).
146+
description is the hydraulic conductance of the interface between the aquifer cell and the boundary.
179147
default_value 3.e30
180148

181149
block period
@@ -186,6 +154,6 @@ reader readarray
186154
layered true
187155
netcdf true
188156
optional true
189-
longname recharge auxiliary variable iaux
190-
description is an array of values for auxiliary variable aux(iaux), where iaux is a value from 1 to naux, and aux(iaux) must be listed as part of the auxiliary variables. A separate array can be specified for each auxiliary variable. If an array is not specified for an auxiliary variable, then a value of zero is assigned. If the value specified here for the auxiliary variable is the same as auxmultname, then the recharge array will be multiplied by this array.
157+
longname general-head boundary auxiliary variable iaux
158+
description is an array of values for auxiliary variable aux(iaux), where iaux is a value from 1 to naux, and aux(iaux) must be listed as part of the auxiliary variables. A separate array can be specified for each auxiliary variable. If an array is not specified for an auxiliary variable, then a value of zero is assigned. If the value specified here for the auxiliary variable is the same as auxmultname, then the boundary head array will be multiplied by this array.
191159
mf6internal auxvar

src/Idm/gwf-ghbaidm.f90

Lines changed: 11 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,9 @@ module GwfGhbaInputModule
1717
logical :: iprpak = .false.
1818
logical :: iprflow = .false.
1919
logical :: ipakcb = .false.
20-
logical :: tas_filerecord = .false.
21-
logical :: tas6 = .false.
22-
logical :: filein = .false.
23-
logical :: tas6_filename = .false.
2420
logical :: obs_filerecord = .false.
2521
logical :: obs6 = .false.
22+
logical :: filein = .false.
2623
logical :: obs6_filename = .false.
2724
logical :: mover = .false.
2825
logical :: export_nc = .false.
@@ -130,14 +127,14 @@ module GwfGhbaInputModule
130127
)
131128

132129
type(InputParamDefinitionType), parameter :: &
133-
gwfghba_tas_filerecord = InputParamDefinitionType &
130+
gwfghba_obs_filerecord = InputParamDefinitionType &
134131
( &
135132
'GWF', & ! component
136133
'GHBA', & ! subcomponent
137134
'OPTIONS', & ! block
138-
'TAS_FILERECORD', & ! tag name
139-
'TAS_FILERECORD', & ! fortran variable
140-
'RECORD TAS6 FILEIN TAS6_FILENAME', & ! type
135+
'OBS_FILERECORD', & ! tag name
136+
'OBS_FILERECORD', & ! fortran variable
137+
'RECORD OBS6 FILEIN OBS6_FILENAME', & ! type
141138
'', & ! shape
142139
'', & ! longname
143140
.false., & ! required
@@ -148,16 +145,16 @@ module GwfGhbaInputModule
148145
)
149146

150147
type(InputParamDefinitionType), parameter :: &
151-
gwfghba_tas6 = InputParamDefinitionType &
148+
gwfghba_obs6 = InputParamDefinitionType &
152149
( &
153150
'GWF', & ! component
154151
'GHBA', & ! subcomponent
155152
'OPTIONS', & ! block
156-
'TAS6', & ! tag name
157-
'TAS6', & ! fortran variable
153+
'OBS6', & ! tag name
154+
'OBS6', & ! fortran variable
158155
'KEYWORD', & ! type
159156
'', & ! shape
160-
'head keyword', & ! longname
157+
'obs keyword', & ! longname
161158
.true., & ! required
162159
.true., & ! multi-record
163160
.false., & ! preserve case
@@ -183,60 +180,6 @@ module GwfGhbaInputModule
183180
.false. & ! timeseries
184181
)
185182

186-
type(InputParamDefinitionType), parameter :: &
187-
gwfghba_tas6_filename = InputParamDefinitionType &
188-
( &
189-
'GWF', & ! component
190-
'GHBA', & ! subcomponent
191-
'OPTIONS', & ! block
192-
'TAS6_FILENAME', & ! tag name
193-
'TAS6_FILENAME', & ! fortran variable
194-
'STRING', & ! type
195-
'', & ! shape
196-
'file name of time series information', & ! longname
197-
.true., & ! required
198-
.true., & ! multi-record
199-
.true., & ! preserve case
200-
.false., & ! layered
201-
.false. & ! timeseries
202-
)
203-
204-
type(InputParamDefinitionType), parameter :: &
205-
gwfghba_obs_filerecord = InputParamDefinitionType &
206-
( &
207-
'GWF', & ! component
208-
'GHBA', & ! subcomponent
209-
'OPTIONS', & ! block
210-
'OBS_FILERECORD', & ! tag name
211-
'OBS_FILERECORD', & ! fortran variable
212-
'RECORD OBS6 FILEIN OBS6_FILENAME', & ! type
213-
'', & ! shape
214-
'', & ! longname
215-
.false., & ! required
216-
.false., & ! multi-record
217-
.false., & ! preserve case
218-
.false., & ! layered
219-
.false. & ! timeseries
220-
)
221-
222-
type(InputParamDefinitionType), parameter :: &
223-
gwfghba_obs6 = InputParamDefinitionType &
224-
( &
225-
'GWF', & ! component
226-
'GHBA', & ! subcomponent
227-
'OPTIONS', & ! block
228-
'OBS6', & ! tag name
229-
'OBS6', & ! fortran variable
230-
'KEYWORD', & ! type
231-
'', & ! shape
232-
'obs keyword', & ! longname
233-
.true., & ! required
234-
.true., & ! multi-record
235-
.false., & ! preserve case
236-
.false., & ! layered
237-
.false. & ! timeseries
238-
)
239-
240183
type(InputParamDefinitionType), parameter :: &
241184
gwfghba_obs6_filename = InputParamDefinitionType &
242185
( &
@@ -337,7 +280,7 @@ module GwfGhbaInputModule
337280
'AUXVAR', & ! fortran variable
338281
'DOUBLE2D', & ! type
339282
'NAUX NODES', & ! shape
340-
'recharge auxiliary variable iaux', & ! longname
283+
'general-head boundary auxiliary variable iaux', & ! longname
341284
.false., & ! required
342285
.false., & ! multi-record
343286
.false., & ! preserve case
@@ -353,12 +296,9 @@ module GwfGhbaInputModule
353296
gwfghba_iprpak, &
354297
gwfghba_iprflow, &
355298
gwfghba_ipakcb, &
356-
gwfghba_tas_filerecord, &
357-
gwfghba_tas6, &
358-
gwfghba_filein, &
359-
gwfghba_tas6_filename, &
360299
gwfghba_obs_filerecord, &
361300
gwfghba_obs6, &
301+
gwfghba_filein, &
362302
gwfghba_obs6_filename, &
363303
gwfghba_mover, &
364304
gwfghba_export_nc, &

0 commit comments

Comments
 (0)