MODFLOW 6  version 6.7.0.dev0
USGS Modular Hydrologic Model
gwegweconnectionmodule Module Reference

Data Types

type  gwegweconnectiontype
 Connects a GWE model to other GWE models in space. Derives from NumericalExchangeType so the solution can use it to fetch the coefficients for this connection. More...
 

Functions/Subroutines

subroutine gwegweconnection_ctor (this, model, gweEx)
 Basic construction of the connection. More...
 
subroutine allocate_scalars (this)
 Allocate scalar variables for this connection. More...
 
subroutine gwegwecon_df (this)
 define the GWE-GWE connection More...
 
subroutine cfg_dist_vars (this)
 Configure distributed variables for this interface model. More...
 
subroutine allocate_arrays (this)
 Allocate array variables for this connection. More...
 
subroutine setgridextent (this)
 Set required extent of the interface grid from. More...
 
subroutine gwegwecon_ar (this)
 allocate and read/set the connection's data structures More...
 
subroutine validateconnection (this)
 validate this connection prior to constructing More...
 
subroutine gwegwecon_rp (this)
 
subroutine gwegwecon_ad (this)
 Advance this connection. More...
 
subroutine gwegwecon_fc (this, kiter, matrix_sln, rhs_sln, inwtflag)
 
subroutine gwegwecon_cq (this, icnvg, isuppress_output, isolnid)
 
subroutine setflowtoexchange (this)
 Set the flows (flowja from interface model) to the. More...
 
subroutine gwegwecon_bd (this, icnvg, isuppress_output, isolnid)
 
subroutine gwegwecon_ot (this)
 
subroutine validategweexchange (this)
 Validate the exchange, intercepting those cases where two models have to be connected with an interface model, where the individual configurations don't allow this. More...
 
subroutine gwegwecon_da (this)
 Deallocate all resources. More...
 
class(gwegweconnectiontype) function, pointer, public castasgwegweconnection (obj)
 Cast to GweGweConnectionType. More...
 

Function/Subroutine Documentation

◆ allocate_arrays()

subroutine gwegweconnectionmodule::allocate_arrays ( class(gwegweconnectiontype this)
private
Parameters
thisthe connection

Definition at line 246 of file GweGweConnection.f90.

247  class(GweGweConnectionType) :: this !< the connection
248 
249  call mem_allocate(this%exgflowjaGwe, this%ig_builder%nrOfBoundaryCells, &
250  'EXGFLOWJAGWT', this%memoryPath)
251 

◆ allocate_scalars()

subroutine gwegweconnectionmodule::allocate_scalars ( class(gwegweconnectiontype this)
Parameters
thisthe connection

Definition at line 141 of file GweGweConnection.f90.

142  ! dummy
143  class(GweGweConnectionType) :: this !< the connection
144 
145  call mem_allocate(this%iIfaceAdvScheme, 'IADVSCHEME', this%memoryPath)
146  call mem_allocate(this%iIfaceXt3d, 'IXT3D', this%memoryPath)
147  call mem_allocate(this%exgflowSign, 'EXGFLOWSIGN', this%memoryPath)
148 

◆ castasgwegweconnection()

class(gwegweconnectiontype) function, pointer, public gwegweconnectionmodule::castasgwegweconnection ( class(*), intent(inout), pointer  obj)
Parameters
[in,out]objobject to be cast
Returns
the GweGweConnection

Definition at line 601 of file GweGweConnection.f90.

602  implicit none
603  ! dummy
604  class(*), pointer, intent(inout) :: obj !< object to be cast
605  ! return
606  class(GweGweConnectionType), pointer :: res !< the GweGweConnection
607 
608  res => null()
609  if (.not. associated(obj)) return
610 
611  select type (obj)
612  class is (gwegweconnectiontype)
613  res => obj
614  end select
615 
Here is the caller graph for this function:

◆ cfg_dist_vars()

subroutine gwegweconnectionmodule::cfg_dist_vars ( class(gwegweconnectiontype this)
private
Parameters
thisthe connection

Definition at line 211 of file GweGweConnection.f90.

212  ! dummy
213  class(GweGweConnectionType) :: this !< the connection
214 
215  call this%cfg_dv('X', '', sync_nds, &
216  (/stg_bfr_con_ar, stg_bfr_exg_ad, stg_bfr_exg_cf/))
217  call this%cfg_dv('IBOUND', '', sync_nds, (/stg_bfr_con_ar/))
218  call this%cfg_dv('TOP', 'DIS', sync_nds, (/stg_bfr_con_ar/))
219  call this%cfg_dv('BOT', 'DIS', sync_nds, (/stg_bfr_con_ar/))
220  call this%cfg_dv('AREA', 'DIS', sync_nds, (/stg_bfr_con_ar/))
221 
222  if (this%gweInterfaceModel%cnd%idisp > 0) then
223  call this%cfg_dv('ALH', 'CND', sync_nds, (/stg_bfr_con_ar/))
224  call this%cfg_dv('ALV', 'CND', sync_nds, (/stg_bfr_con_ar/))
225  call this%cfg_dv('ATH1', 'CND', sync_nds, (/stg_bfr_con_ar/))
226  call this%cfg_dv('ATH2', 'CND', sync_nds, (/stg_bfr_con_ar/))
227  call this%cfg_dv('ATV', 'CND', sync_nds, (/stg_bfr_con_ar/))
228  call this%cfg_dv('KTW', 'CND', sync_nds, (/stg_bfr_con_ar/))
229  call this%cfg_dv('KTS', 'CND', sync_nds, (/stg_bfr_con_ar/))
230  end if
231  call this%cfg_dv('GWFHEAD', 'FMI', sync_nds, (/stg_bfr_exg_ad/))
232  call this%cfg_dv('GWFSAT', 'FMI', sync_nds, (/stg_bfr_exg_ad/))
233  call this%cfg_dv('GWFSPDIS', 'FMI', sync_nds, (/stg_bfr_exg_ad/))
234  call this%cfg_dv('GWFFLOWJA', 'FMI', sync_con, (/stg_bfr_exg_ad/))
235  call this%cfg_dv('GWFFLOWJA', 'FMI', sync_exg, (/stg_bfr_exg_ad/), &
236  exg_var_name='GWFSIMVALS')
237  ! fill porosity from est packages, needed for cnd
238  if (this%gweModel%incnd > 0 .and. this%gweModel%inest > 0) then
239  call this%cfg_dv('POROSITY', 'EST', sync_nds, (/stg_aft_con_ar/))
240  end if
241 

◆ gwegwecon_ad()

subroutine gwegweconnectionmodule::gwegwecon_ad ( class(gwegweconnectiontype this)
private
Parameters
thisthis connection

Definition at line 385 of file GweGweConnection.f90.

386 
387  class(GweGweConnectionType) :: this !< this connection
388 
389  ! recalculate conduction ellipse
390  if (this%gweInterfaceModel%incnd > 0) call this%gweInterfaceModel%cnd%cnd_ad()
391 
392  if (this%owns_exchange) then
393  call this%gweExchange%exg_ad()
394  end if
395 

◆ gwegwecon_ar()

subroutine gwegweconnectionmodule::gwegwecon_ar ( class(gwegweconnectiontype this)
private
Parameters
thisthe connection

Definition at line 287 of file GweGweConnection.f90.

288  class(GweGweConnectionType) :: this !< the connection
289 
290  ! check if we can construct an interface model
291  ! NB: only makes sense after the models' allocate&read have been
292  ! called, which is why we do it here
293  call this%validateConnection()
294 
295  ! allocate and read base
296  call this%spatialcon_ar()
297 
298  ! ... and now the interface model
299  call this%gweInterfaceModel%model_ar()
300 
301  ! set a pointer in the interface model to the gwecommon data
302  if (this%gweModel%inest > 0) then
303  this%gweInterfaceModel%gwecommon%gwecpw => this%gweModel%gwecommon%gwecpw
304  this%gweInterfaceModel%gwecommon%gwerhow => this%gweModel%gwecommon%gwerhow
305  end if
306 
307  ! set the equation scaling factor in the interface model to that of
308  ! underlying GWE model
309  if (this%gweModel%incnd > 0) then
310  this%gweInterfaceModel%ieqnsclfac = this%gweModel%cnd%eqnsclfac
311  end if
312 
313  ! AR the movers and obs through the exchange
314  if (this%owns_exchange) then
315  !cdl implement this when MVT is ready
316  !cdl if (this%gweExchange%inmvt > 0) then
317  !cdl call this%gweExchange%mvt%mvt_ar()
318  !cdl end if
319  if (this%gweExchange%inobs > 0) then
320  call this%gweExchange%obs%obs_ar()
321  end if
322  end if
323 

◆ gwegwecon_bd()

subroutine gwegweconnectionmodule::gwegwecon_bd ( class(gwegweconnectiontype this,
integer(i4b), intent(inout)  icnvg,
integer(i4b), intent(in)  isuppress_output,
integer(i4b), intent(in)  isolnid 
)
Parameters
thisthe connection
[in,out]icnvgconvergence flag
[in]isuppress_outputsuppress output when =1
[in]isolnidsolution id

Definition at line 457 of file GweGweConnection.f90.

458  ! modules
459  use budgetmodule, only: rate_accumulator
460  ! dummy
461  class(GweGweConnectionType) :: this !< the connection
462  integer(I4B), intent(inout) :: icnvg !< convergence flag
463  integer(I4B), intent(in) :: isuppress_output !< suppress output when =1
464  integer(I4B), intent(in) :: isolnid !< solution id
465 
466  ! call exchange budget routine, also calls _bd
467  ! for movers.
468  if (this%owns_exchange) then
469  call this%gweExchange%exg_bd(icnvg, isuppress_output, isolnid)
470  end if
471 
This module contains the BudgetModule.
Definition: Budget.f90:20
subroutine, public rate_accumulator(flow, rin, rout)
@ brief Rate accumulator subroutine
Definition: Budget.f90:632
Here is the call graph for this function:

◆ gwegwecon_cq()

subroutine gwegweconnectionmodule::gwegwecon_cq ( class(gwegweconnectiontype this,
integer(i4b), intent(inout)  icnvg,
integer(i4b), intent(in)  isuppress_output,
integer(i4b), intent(in)  isolnid 
)
private
Parameters
thisthe connection
[in,out]icnvgconvergence flag
[in]isuppress_outputsuppress output when =1
[in]isolnidsolution id

Definition at line 419 of file GweGweConnection.f90.

420  ! dummy
421  class(GweGweConnectionType) :: this !< the connection
422  integer(I4B), intent(inout) :: icnvg !< convergence flag
423  integer(I4B), intent(in) :: isuppress_output !< suppress output when =1
424  integer(I4B), intent(in) :: isolnid !< solution id
425 
426  call this%gweInterfaceModel%model_cq(icnvg, isuppress_output)
427  call this%setFlowToExchange()
428 

◆ gwegwecon_da()

subroutine gwegweconnectionmodule::gwegwecon_da ( class(gwegweconnectiontype this)
Parameters
thisthe connection

Definition at line 566 of file GweGweConnection.f90.

567  ! dummy
568  class(GweGweConnectionType) :: this !< the connection
569  ! local
570  logical(LGP) :: isOpen
571 
572  ! scalars
573  call mem_deallocate(this%iIfaceAdvScheme)
574  call mem_deallocate(this%iIfaceXt3d)
575  call mem_deallocate(this%exgflowSign)
576 
577  ! arrays
578  call mem_deallocate(this%exgflowjaGwe)
579 
580  ! interface model
581  call this%gweInterfaceModel%model_da()
582  deallocate (this%gweInterfaceModel)
583 
584  ! dealloc base
585  call this%spatialcon_da()
586 
587  inquire (this%iout, opened=isopen)
588  if (isopen) then
589  close (this%iout)
590  end if
591 
592  ! we need to deallocate the exchange we own:
593  if (this%owns_exchange) then
594  call this%gweExchange%exg_da()
595  end if
596 

◆ gwegwecon_df()

subroutine gwegweconnectionmodule::gwegwecon_df ( class(gwegweconnectiontype this)
private
Parameters
thisthe connection

Definition at line 153 of file GweGweConnection.f90.

154  ! dummy
155  class(GweGweConnectionType) :: this !< the connection
156  ! local
157  character(len=LENCOMPONENTNAME) :: imName
158 
159  ! determine advection scheme (the GWE-GWE exchange
160  ! has been read at this point)
161  this%iIfaceAdvScheme = this%gweExchange%iAdvScheme
162 
163  ! determine xt3d setting on interface
164  this%iIfaceXt3d = this%gweExchange%ixt3d
165 
166  ! turn off when off in the owning model
167  if (this%gweModel%incnd > 0) then
168  this%iIfaceXt3d = this%gweModel%cnd%ixt3d
169  end if
170 
171  ! determine the required size of the interface model grid
172  call this%setGridExtent()
173 
174  ! now set up the GridConnection
175  call this%spatialcon_df()
176 
177  ! we have to 'catch up' and create the interface model
178  ! here, then the remainder of this routine will be define
179  if (this%prim_exchange%v_model1 == this%owner) then
180  write (imname, '(a,i0)') 'GWEIM1_', this%gweExchange%id
181  else
182  write (imname, '(a,i0)') 'GWEIM2_', this%gweExchange%id
183  end if
184  call this%gweInterfaceModel%gweifmod_cr(imname, &
185  this%iout, &
186  this%ig_builder)
187  call this%gweInterfaceModel%set_idsoln(this%gweModel%idsoln)
188  this%gweInterfaceModel%iAdvScheme = this%iIfaceAdvScheme
189  this%gweInterfaceModel%ixt3d = this%iIfaceXt3d
190  call this%gweInterfaceModel%model_df()
191 
192  call this%cfg_dist_vars()
193 
194  call this%allocate_arrays()
195  call this%gweInterfaceModel%allocate_fmi()
196 
197  ! connect X, RHS, IBOUND, and flowja
198  call this%spatialcon_setmodelptrs()
199 
200  ! connect pointers (used by BUY)
201  this%conc => this%gweInterfaceModel%x
202  this%icbound => this%gweInterfaceModel%ibound
203 
204  ! add connections from the interface model to solution matrix
205  call this%spatialcon_connect()
206 

◆ gwegwecon_fc()

subroutine gwegweconnectionmodule::gwegwecon_fc ( class(gwegweconnectiontype this,
integer(i4b), intent(in)  kiter,
class(matrixbasetype), pointer  matrix_sln,
real(dp), dimension(:), intent(inout)  rhs_sln,
integer(i4b), intent(in), optional  inwtflag 
)
private
Parameters
thisthe connection
[in]kiterthe iteration counter
matrix_slnthe system matrix
[in,out]rhs_slnglobal right-hand-side
[in]inwtflagnewton-raphson flag

Definition at line 398 of file GweGweConnection.f90.

399  ! dummy
400  class(GweGweConnectionType) :: this !< the connection
401  integer(I4B), intent(in) :: kiter !< the iteration counter
402  class(MatrixBaseType), pointer :: matrix_sln !< the system matrix
403  real(DP), dimension(:), intent(inout) :: rhs_sln !< global right-hand-side
404  integer(I4B), optional, intent(in) :: inwtflag !< newton-raphson flag
405 
406  call this%SpatialModelConnectionType%spatialcon_fc( &
407  kiter, matrix_sln, rhs_sln, inwtflag)
408 
409  ! _fc the movers through the exchange
410  if (this%owns_exchange) then
411  if (this%gweExchange%inmvt > 0) then
412  call this%gweExchange%mvt%mvt_fc(this%gweExchange%gwemodel1%x, &
413  this%gweExchange%gwemodel2%x)
414  end if
415  end if
416 

◆ gwegwecon_ot()

subroutine gwegweconnectionmodule::gwegwecon_ot ( class(gwegweconnectiontype this)
Parameters
thisthe connection

Definition at line 474 of file GweGweConnection.f90.

475  ! dummy
476  class(GweGweConnectionType) :: this !< the connection
477 
478  ! call exg_ot() here as it handles all output processing
479  ! based on gweExchange%simvals(:), which was correctly
480  ! filled from gwegwecon
481  if (this%owns_exchange) then
482  call this%gweExchange%exg_ot()
483  end if
484 

◆ gwegwecon_rp()

subroutine gwegweconnectionmodule::gwegwecon_rp ( class(gwegweconnectiontype this)
Parameters
thisthe connection

Definition at line 372 of file GweGweConnection.f90.

373  ! dummy
374  class(GweGweConnectionType) :: this !< the connection
375 
376  ! call exchange rp routines
377  if (this%owns_exchange) then
378  call this%gweExchange%exg_rp()
379  end if
380 

◆ gwegweconnection_ctor()

subroutine gwegweconnectionmodule::gwegweconnection_ctor ( class(gwegweconnectiontype this,
class(numericalmodeltype), pointer  model,
class(disconnexchangetype), pointer  gweEx 
)
Parameters
thisthe connection
modelthe model owning this connection, this must be a GweModelType
gweexthe GWE-GWE exchange the interface model is created for

Definition at line 83 of file GweGweConnection.f90.

84  ! modules
85  use inputoutputmodule, only: openfile
86  ! dummy
87  class(GweGweConnectionType) :: this !< the connection
88  class(NumericalModelType), pointer :: model !< the model owning this connection,
89  !! this must be a GweModelType
90  class(DisConnExchangeType), pointer :: gweEx !< the GWE-GWE exchange the interface model is created for
91  ! local
92  character(len=LINELENGTH) :: fname
93  character(len=LENCOMPONENTNAME) :: name
94  class(*), pointer :: objPtr
95  logical(LGP) :: write_ifmodel_listfile = .false.
96 
97  objptr => model
98  this%gweModel => castasgwemodel(objptr)
99  objptr => gweex
100  this%gweExchange => castasgweexchange(objptr)
101 
102  if (gweex%v_model1%is_local .and. gweex%v_model2%is_local) then
103  this%owns_exchange = associated(model, gweex%model1)
104  else
105  this%owns_exchange = .true.
106  end if
107 
108  if (gweex%v_model1 == model) then
109  write (name, '(a,i0)') 'GWECON1_', gweex%id
110  else
111  write (name, '(a,i0)') 'GWECON2_', gweex%id
112  end if
113 
114  ! .lst file for interface model
115  if (write_ifmodel_listfile) then
116  fname = trim(name)//'.im.lst'
117  call openfile(this%iout, 0, fname, 'LIST', filstat_opt='REPLACE')
118  write (this%iout, '(4a)') 'Creating GWE-GWE connection for model ', &
119  trim(this%gweModel%name), 'from exchange ', &
120  trim(gweex%name)
121  end if
122 
123  ! first call base constructor
124  call this%SpatialModelConnectionType%spatialConnection_ctor(model, &
125  gweex, &
126  name)
127 
128  call this%allocate_scalars()
129  this%typename = 'GWE-GWE'
130  this%iIfaceAdvScheme = 0
131  this%iIfaceXt3d = 0
132  this%exgflowSign = 1
133 
134  allocate (this%gweInterfaceModel)
135  this%interface_model => this%gweInterfaceModel
136 
subroutine, public openfile(iu, iout, fname, ftype, fmtarg_opt, accarg_opt, filstat_opt, mode_opt)
Open a file.
Definition: InputOutput.f90:30
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setflowtoexchange()

subroutine gwegweconnectionmodule::setflowtoexchange ( class(gwegweconnectiontype this)
private
Parameters
thisthis connection

Definition at line 433 of file GweGweConnection.f90.

434  ! modules
435  use indexmapmodule
436  ! dummy
437  class(GweGweConnectionType) :: this !< this connection
438  ! local
439  integer(I4B) :: i
440  class(GweExchangeType), pointer :: gweEx
441  type(IndexMapSgnType), pointer :: map
442 
443  if (this%owns_exchange) then
444  gweex => this%gweExchange
445  map => this%interface_map%exchange_maps(this%interface_map%prim_exg_idx)
446 
447  ! use (half of) the exchange map in reverse:
448  do i = 1, size(map%src_idx)
449  if (map%sign(i) < 0) cycle ! simvals is defined from exg%m1 => exg%m2
450  gweex%simvals(map%src_idx(i)) = &
451  this%gweInterfaceModel%flowja(map%tgt_idx(i))
452  end do
453  end if
454 

◆ setgridextent()

subroutine gwegweconnectionmodule::setgridextent ( class(gwegweconnectiontype this)
private
Parameters
thisthe connection

Definition at line 256 of file GweGweConnection.f90.

257  ! dummy
258  class(GweGweConnectionType) :: this !< the connection
259  ! local
260  logical(LGP) :: hasAdv, hasCnd
261 
262  hasadv = this%gweModel%inadv > 0
263  hascnd = this%gweModel%incnd > 0
264 
265  if (hasadv) then
266  if (this%iIfaceAdvScheme == 2) then
267  this%exg_stencil_depth = 2
268  if (this%gweModel%adv%iadvwt == 2) then
269  this%int_stencil_depth = 2
270  end if
271  end if
272  end if
273 
274  if (hascnd) then
275  if (this%iIfaceXt3d > 0) then
276  this%exg_stencil_depth = 2
277  if (this%gweModel%cnd%ixt3d > 0) then
278  this%int_stencil_depth = 2
279  end if
280  end if
281  end if
282 

◆ validateconnection()

subroutine gwegweconnectionmodule::validateconnection ( class(gwegweconnectiontype this)
private
Parameters
thisthis connection

Definition at line 328 of file GweGweConnection.f90.

329  use simvariablesmodule, only: errmsg
331  class(GweGweConnectionType) :: this !< this connection
332 
333  ! base validation, the spatial/geometry part
334  call this%SpatialModelConnectionType%validateConnection()
335 
336  ! we cannot validate this (yet) in parallel mode
337  if (.not. this%gweExchange%v_model1%is_local) return
338  if (.not. this%gweExchange%v_model2%is_local) return
339 
340  ! check specific cross-interface options/values that should be the same
341  call this%validateGweExchange()
342 
343  ! GWE related matters
344  if ((this%gweExchange%gwemodel1%inadv > 0 .and. &
345  this%gweExchange%gwemodel2%inadv == 0) .or. &
346  (this%gweExchange%gwemodel2%inadv > 0 .and. &
347  this%gweExchange%gwemodel1%inadv == 0)) then
348  write (errmsg, '(1x,a,a,a)') 'Cannot connect GWE models in exchange ', &
349  trim(this%gweExchange%name), ' because one model is configured with ADV &
350  &and the other one is not'
351  call store_error(errmsg)
352  end if
353 
354  if ((this%gweExchange%gwemodel1%incnd > 0 .and. &
355  this%gweExchange%gwemodel2%incnd == 0) .or. &
356  (this%gweExchange%gwemodel2%incnd > 0 .and. &
357  this%gweExchange%gwemodel1%incnd == 0)) then
358  write (errmsg, '(1x,a,a,a)') 'Cannot connect GWE models in exchange ', &
359  trim(this%gweExchange%name), ' because one model is configured with CND &
360  &and the other one is not'
361  call store_error(errmsg)
362  end if
363 
364  ! abort on errors
365  if (count_errors() > 0) then
366  write (errmsg, '(a)') 'Errors occurred while processing exchange(s)'
367  call ustop()
368  end if
369 
This module contains simulation methods.
Definition: Sim.f90:10
subroutine, public store_error(msg, terminate)
Store an error message.
Definition: Sim.f90:92
integer(i4b) function, public count_errors()
Return number of errors.
Definition: Sim.f90:59
This module contains simulation variables.
Definition: SimVariables.f90:9
character(len=maxcharlen) errmsg
error message string
Here is the call graph for this function:

◆ validategweexchange()

subroutine gwegweconnectionmodule::validategweexchange ( class(gwegweconnectiontype this)
private

Stops with error message on config mismatch

Parameters
thisthis connection

Definition at line 493 of file GweGweConnection.f90.

494  ! modules
495  use simvariablesmodule, only: errmsg
496  use simmodule, only: store_error
497  use gweestmodule, only: gweesttype
498 
499  ! dummy
500  class(GweGweConnectionType) :: this !< this connection
501 
502  ! local
503  class(GweExchangeType), pointer :: gweEx
504  class(*), pointer :: modelPtr
505  class(GweModelType), pointer :: gweModel1
506  class(GweModelType), pointer :: gweModel2
507  type(GweEstType), pointer :: est1, est2
508  logical(LGP) :: compatible
509 
510  gweex => this%gweExchange
511 
512  ! we cannot validate the remainder (yet) in parallel mode
513  if (.not. gweex%v_model1%is_local) return
514  if (.not. gweex%v_model2%is_local) return
515 
516  modelptr => this%gweExchange%model1
517  gwemodel1 => castasgwemodel(modelptr)
518  modelptr => this%gweExchange%model2
519  gwemodel2 => castasgwemodel(modelptr)
520 
521  ! check that EST package usage is the same on both side of the interface
522  if ((gwemodel1%inest > 0 .and. gwemodel2%inest == 0) .or. &
523  (gwemodel1%inest == 0 .and. gwemodel2%inest > 0)) then
524  write (errmsg, '(2a)') 'Energy Storage and Transfer package should '// &
525  'be enabled/disabled simultaneously in models connected with the '// &
526  'interface model for exchange ', &
527  trim(gweex%name)
528  call store_error(errmsg)
529  end if
530 
531  ! conduction options need to be the same in both model
532  if ((gwemodel1%cnd%ixt3d > 0 .and. gwemodel2%cnd%ixt3d == 0) .or. &
533  (gwemodel1%cnd%ixt3d == 0 .and. gwemodel2%cnd%ixt3d > 0)) then
534  write (errmsg, '(2a)') 'Use of XT3D to calculate conduction should '// &
535  'be the same in both models, either both use XT3D or neither for '// &
536  ' exchange '//trim(gweex%name)
537  call store_error(errmsg)
538  end if
539 
540  ! check compatibility of Energy Storage and Transfer (EST) package
541  compatible = .true.
542  est1 => gwemodel1%est
543  est2 => gwemodel2%est
544  if (est1%rhow /= est2%rhow) compatible = .false.
545  if (est1%cpw /= est2%cpw) compatible = .false.
546  ! if (est1%nrhospecies /= est2%nrhospecies) compatible = .false.
547  ! if (.not. all(buy1%drhodc == buy2%drhodc)) compatible = .false.
548  ! if (.not. all(buy1%crhoref == buy2%crhoref)) compatible = .false.
549  !if (.not. all(buy1%cauxspeciesname == buy2%cauxspeciesname)) then
550  ! compatible = .false.
551  !end if
552  if (.not. compatible) then
553  write (errmsg, '(6a)') 'Energy storage and transfer (EST) packages ', &
554  'in model '//trim(gweex%model1%name), ' and ', &
555  trim(gweex%model2%name), &
556  ' should be equivalent to construct an '// &
557  ' interface model for exchange ', &
558  trim(gweex%name)
559  call store_error(errmsg)
560  end if
561 
– @ brief Energy Storage and Transfer (EST) Module
Definition: gwe-est.f90:13
@ brief Energy storage and transfer
Definition: gwe-est.f90:38
Here is the call graph for this function: