MODFLOW 6 version 6.9.0.dev0
USGS Modular Hydrologic Model
Loading...
Searching...
No Matches
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.
subroutine allocate_scalars (this)
 Allocate scalar variables for this connection.
subroutine gwegwecon_df (this)
 define the GWE-GWE connection
subroutine cfg_dist_vars (this)
 Configure distributed variables for this interface model.
subroutine allocate_arrays (this)
 Allocate array variables for this connection.
subroutine setgridextent (this)
 Set required extent of the interface grid from.
subroutine gwegwecon_ar (this)
 allocate and read/set the connection's data structures
subroutine validateconnection (this)
 validate this connection prior to constructing
subroutine gwegwecon_rp (this)
subroutine gwegwecon_ad (this)
 Advance this connection.
subroutine gwegwecon_cf (this, kiter)
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.
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.
subroutine gwegwecon_da (this)
 Deallocate all resources.
class(gwegweconnectiontype) function, pointer, public castasgwegweconnection (obj)
 Cast to GweGweConnectionType.

Function/Subroutine Documentation

◆ allocate_arrays()

Parameters
thisthe connection

Definition at line 248 of file GweGweConnection.f90.

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

◆ allocate_scalars()

Parameters
thisthe connection

Definition at line 143 of file GweGweConnection.f90.

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

◆ 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 639 of file GweGweConnection.f90.

640 implicit none
641 ! dummy
642 class(*), pointer, intent(inout) :: obj !< object to be cast
643 ! return
644 class(GweGweConnectionType), pointer :: res !< the GweGweConnection
645
646 res => null()
647 if (.not. associated(obj)) return
648
649 select type (obj)
650 class is (gwegweconnectiontype)
651 res => obj
652 end select
653
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 213 of file GweGweConnection.f90.

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

◆ gwegwecon_ad()

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

Definition at line 389 of file GweGweConnection.f90.

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

◆ gwegwecon_ar()

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

Definition at line 291 of file GweGweConnection.f90.

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

◆ 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 )
private
Parameters
thisthe connection
[in,out]icnvgconvergence flag
[in]isuppress_outputsuppress output when =1
[in]isolnidsolution id

Definition at line 495 of file GweGweConnection.f90.

496 ! modules
498 ! dummy
499 class(GweGweConnectionType) :: this !< the connection
500 integer(I4B), intent(inout) :: icnvg !< convergence flag
501 integer(I4B), intent(in) :: isuppress_output !< suppress output when =1
502 integer(I4B), intent(in) :: isolnid !< solution id
503
504 ! call exchange budget routine, also calls _bd
505 ! for movers.
506 if (this%owns_exchange) then
507 call this%gweExchange%exg_bd(icnvg, isuppress_output, isolnid)
508 end if
509
This module contains the BudgetModule.
Definition Budget.f90:20
subroutine, public rate_accumulator(flow, rin, rout)
Rate accumulator subroutine.
Definition Budget.f90:634
Here is the call graph for this function:

◆ gwegwecon_cf()

subroutine gwegweconnectionmodule::gwegwecon_cf ( class(gwegweconnectiontype) this,
integer(i4b), intent(in) kiter )
private
Parameters
thisthis connection
[in]kiterthe iteration counter

Definition at line 402 of file GweGweConnection.f90.

403 class(GweGweConnectionType) :: this !< this connection
404 integer(I4B), intent(in) :: kiter !< the iteration counter
405 ! local
406 real(DP), dimension(:), pointer, contiguous :: x_m1, x_m2
407
408 call this%SpatialModelConnectionType%spatialcon_cf(kiter)
409
410 ! CF the movers in the exchange
411 if (this%owns_exchange) then
412 if (this%gweExchange%inmvt > 0) then
413 x_m1 => null()
414 x_m2 => null()
415 if (associated(this%gweExchange%gwemodel1)) then
416 x_m1 => this%gweExchange%gwemodel1%x
417 end if
418 if (associated(this%gweExchange%gwemodel2)) then
419 x_m2 => this%gweExchange%gwemodel2%x
420 end if
421 call this%gweExchange%mvt%xmvt_cf(x_m1, x_m2)
422 end if
423 end if
424

◆ 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 457 of file GweGweConnection.f90.

458 ! dummy
459 class(GweGweConnectionType) :: this !< the connection
460 integer(I4B), intent(inout) :: icnvg !< convergence flag
461 integer(I4B), intent(in) :: isuppress_output !< suppress output when =1
462 integer(I4B), intent(in) :: isolnid !< solution id
463
464 call this%gweInterfaceModel%model_cq(icnvg, isuppress_output)
465 call this%setFlowToExchange()
466

◆ gwegwecon_da()

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

Definition at line 604 of file GweGweConnection.f90.

605 ! dummy
606 class(GweGweConnectionType) :: this !< the connection
607 ! local
608 logical(LGP) :: isOpen
609
610 ! scalars
611 call mem_deallocate(this%iIfaceAdvScheme)
612 call mem_deallocate(this%iIfaceXt3d)
613 call mem_deallocate(this%exgflowSign)
614
615 ! arrays
616 call mem_deallocate(this%exgflowjaGwe)
617
618 ! interface model
619 call this%gweInterfaceModel%model_da()
620 deallocate (this%gweInterfaceModel)
621
622 ! dealloc base
623 call this%spatialcon_da()
624
625 inquire (this%iout, opened=isopen)
626 if (isopen) then
627 close (this%iout)
628 end if
629
630 ! we need to deallocate the exchange we own:
631 if (this%owns_exchange) then
632 call this%gweExchange%exg_da()
633 end if
634

◆ gwegwecon_df()

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

Definition at line 155 of file GweGweConnection.f90.

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

◆ 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 427 of file GweGweConnection.f90.

428 ! dummy
429 class(GweGweConnectionType) :: this !< the connection
430 integer(I4B), intent(in) :: kiter !< the iteration counter
431 class(MatrixBaseType), pointer :: matrix_sln !< the system matrix
432 real(DP), dimension(:), intent(inout) :: rhs_sln !< global right-hand-side
433 integer(I4B), optional, intent(in) :: inwtflag !< newton-raphson flag
434 ! local
435 real(DP), dimension(:), pointer, contiguous :: x_m1, x_m2
436
437 call this%SpatialModelConnectionType%spatialcon_fc( &
438 kiter, matrix_sln, rhs_sln, inwtflag)
439
440 ! _fc the movers through the exchange
441 if (this%owns_exchange) then
442 if (this%gweExchange%inmvt > 0) then
443 x_m1 => null()
444 x_m2 => null()
445 if (associated(this%gweExchange%gwemodel1)) then
446 x_m1 => this%gweExchange%gwemodel1%x
447 end if
448 if (associated(this%gweExchange%gwemodel2)) then
449 x_m2 => this%gweExchange%gwemodel2%x
450 end if
451 call this%gweExchange%mvt%mvt_fc(x_m1, x_m2)
452 end if
453 end if
454

◆ gwegwecon_ot()

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

Definition at line 512 of file GweGweConnection.f90.

513 ! dummy
514 class(GweGweConnectionType) :: this !< the connection
515
516 ! call exg_ot() here as it handles all output processing
517 ! based on gweExchange%simvals(:), which was correctly
518 ! filled from gwegwecon
519 if (this%owns_exchange) then
520 call this%gweExchange%exg_ot()
521 end if
522

◆ gwegwecon_rp()

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

Definition at line 376 of file GweGweConnection.f90.

377 ! dummy
378 class(GweGweConnectionType) :: this !< the connection
379
380 ! call exchange rp routines
381 if (this%owns_exchange) then
382 call this%gweExchange%exg_rp()
383 end if
384

◆ 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 85 of file GweGweConnection.f90.

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

472 ! modules
474 ! dummy
475 class(GweGweConnectionType) :: this !< this connection
476 ! local
477 integer(I4B) :: i
478 class(GweExchangeType), pointer :: gweEx
479 type(IndexMapSgnType), pointer :: map
480
481 if (this%owns_exchange) then
482 gweex => this%gweExchange
483 map => this%interface_map%exchange_maps(this%interface_map%prim_exg_idx)
484
485 ! use (half of) the exchange map in reverse:
486 do i = 1, size(map%src_idx)
487 if (map%sign(i) < 0) cycle ! simvals is defined from exg%m1 => exg%m2
488 gweex%simvals(map%src_idx(i)) = &
489 this%gweInterfaceModel%flowja(map%tgt_idx(i))
490 end do
491 end if
492

◆ setgridextent()

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

Definition at line 258 of file GweGweConnection.f90.

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

◆ validateconnection()

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

Definition at line 332 of file GweGweConnection.f90.

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

532 ! modules
533 use simvariablesmodule, only: errmsg
534 use simmodule, only: store_error
535 use gweestmodule, only: gweesttype
536
537 ! dummy
538 class(GweGweConnectionType) :: this !< this connection
539
540 ! local
541 class(GweExchangeType), pointer :: gweEx
542 class(*), pointer :: modelPtr
543 class(GweModelType), pointer :: gweModel1
544 class(GweModelType), pointer :: gweModel2
545 type(GweEstType), pointer :: est1, est2
546 logical(LGP) :: compatible
547
548 gweex => this%gweExchange
549
550 ! we cannot validate the remainder (yet) in parallel mode
551 if (.not. gweex%v_model1%is_local) return
552 if (.not. gweex%v_model2%is_local) return
553
554 modelptr => this%gweExchange%model1
555 gwemodel1 => castasgwemodel(modelptr)
556 modelptr => this%gweExchange%model2
557 gwemodel2 => castasgwemodel(modelptr)
558
559 ! check that EST package usage is the same on both side of the interface
560 if ((gwemodel1%inest > 0 .and. gwemodel2%inest == 0) .or. &
561 (gwemodel1%inest == 0 .and. gwemodel2%inest > 0)) then
562 write (errmsg, '(2a)') 'Energy Storage and Transfer package should '// &
563 'be enabled/disabled simultaneously in models connected with the '// &
564 'interface model for exchange ', &
565 trim(gweex%name)
566 call store_error(errmsg)
567 end if
568
569 ! conduction options need to be the same in both model
570 if ((gwemodel1%cnd%ixt3d > 0 .and. gwemodel2%cnd%ixt3d == 0) .or. &
571 (gwemodel1%cnd%ixt3d == 0 .and. gwemodel2%cnd%ixt3d > 0)) then
572 write (errmsg, '(2a)') 'Use of XT3D to calculate conduction should '// &
573 'be the same in both models, either both use XT3D or neither for '// &
574 ' exchange '//trim(gweex%name)
575 call store_error(errmsg)
576 end if
577
578 ! check compatibility of Energy Storage and Transfer (EST) package
579 compatible = .true.
580 est1 => gwemodel1%est
581 est2 => gwemodel2%est
582 if (est1%rhow /= est2%rhow) compatible = .false.
583 if (est1%cpw /= est2%cpw) compatible = .false.
584 ! if (est1%nrhospecies /= est2%nrhospecies) compatible = .false.
585 ! if (.not. all(buy1%drhodc == buy2%drhodc)) compatible = .false.
586 ! if (.not. all(buy1%crhoref == buy2%crhoref)) compatible = .false.
587 !if (.not. all(buy1%cauxspeciesname == buy2%cauxspeciesname)) then
588 ! compatible = .false.
589 !end if
590 if (.not. compatible) then
591 write (errmsg, '(6a)') 'Energy storage and transfer (EST) packages ', &
592 'in model '//trim(gweex%model1%name), ' and ', &
593 trim(gweex%model2%name), &
594 ' should be equivalent to construct an '// &
595 ' interface model for exchange ', &
596 trim(gweex%name)
597 call store_error(errmsg)
598 end if
599
Energy Storage and Transfer (EST) Module.
Definition gwe-est.f90:13
Energy storage and transfer.
Definition gwe-est.f90:48
Here is the call graph for this function: