MODFLOW 6 version 6.9.0.dev0
USGS Modular Hydrologic Model
Loading...
Searching...
No Matches
tspexchangemovermodule Module Reference

Data Types

type  tspexchangemovertype

Functions/Subroutines

subroutine, public xmvt_cr (mvt, name_exg, tsp_model1, tsp_model2, gwfmodelname1, gwfmodelname2, inunit, iout)
subroutine xmvt_rp (this)
 Read and prepare mover transport object.
subroutine xmvt_cf (this, cnew1, cnew2)
subroutine xmvt_fc (this, cnew1, cnew2)
subroutine xmvt_da (this)

Function/Subroutine Documentation

◆ xmvt_cf()

subroutine tspexchangemovermodule::xmvt_cf ( class(tspexchangemovertype) this,
real(dp), dimension(:), intent(in), target, contiguous cnew1,
real(dp), dimension(:), intent(in), target, contiguous cnew2 )
private

Definition at line 106 of file TspExchangeMover.f90.

107 class(TspExchangeMoverType) :: this
108 real(DP), intent(in), dimension(:), contiguous, target :: cnew1
109 real(DP), intent(in), dimension(:), contiguous, target :: cnew2
110 ! local
111 integer(I4B) :: i, n, idx
112 real(DP), dimension(:), pointer, contiguous :: prov_array
113 logical(LGP) :: prov_is_local
114
115 call this%mvt_fill_mvrterm(cnew1, cnew2)
116
117 ! add mvrterm data into synchronization array
118 idx = 1
119 do i = 1, size(this%mvrterm)
120
121 ! point to provider array
122 prov_is_local = .false.
123 if (this%mvrterm(i)%prov_is_m1) then
124 prov_is_local = this%model1%is_local
125 prov_array => this%quantity_m1
126 else
127 prov_is_local = this%model2%is_local
128 prov_array => this%quantity_m2
129 end if
130
131 if (prov_is_local) then
132 do n = 1, size(this%mvrterm(i)%qty)
133 prov_array(idx) = this%mvrterm(i)%qty(n)
134 idx = idx + 1
135 end do
136 end if
137 end do
138

◆ xmvt_cr()

subroutine, public tspexchangemovermodule::xmvt_cr ( type(tspexchangemovertype), pointer mvt,
character(len=*), intent(in) name_exg,
class(transportmodeltype), pointer tsp_model1,
class(transportmodeltype), pointer tsp_model2,
character(len=*), intent(in) gwfmodelname1,
character(len=*), intent(in) gwfmodelname2,
integer(i4b), intent(in) inunit,
integer(i4b), intent(in) iout )
Parameters
[in]name_exgname of the exchange
tsp_model1gwt model 1, can be null()
tsp_model2gwt model 2, can be null()

Definition at line 31 of file TspExchangeMover.f90.

33 type(TspExchangeMoverType), pointer :: mvt
34 character(len=*), intent(in) :: name_exg !< name of the exchange
35 class(TransportModelType), pointer :: tsp_model1 !< gwt model 1, can be null()
36 class(TransportModelType), pointer :: tsp_model2 !< gwt model 2, can be null()
37 character(len=*), intent(in) :: gwfmodelname1
38 character(len=*), intent(in) :: gwfmodelname2
39 integer(I4B), intent(in) :: inunit
40 integer(I4B), intent(in) :: iout
41 ! local
42 type(TspFmiType), pointer :: fmi1, fmi2
43 real(DP), pointer :: eqnsclfac !< governing equation scale factor
44 character(len=LENVARNAME) :: depvartype !< dependent variable type ('concentration' or 'temperature')
45
46 allocate (mvt)
47
48 fmi1 => null()
49 if (associated(tsp_model1)) then
50 fmi1 => tsp_model1%fmi
51 eqnsclfac => tsp_model1%eqnsclfac
52 depvartype = tsp_model1%depvartype
53 end if
54 fmi2 => null()
55 if (associated(tsp_model2)) then
56 fmi2 => tsp_model2%fmi
57 eqnsclfac => tsp_model2%eqnsclfac
58 depvartype = tsp_model2%depvartype
59 end if
60
61 mvt%model1 => get_virtual_model(gwfmodelname1)
62 mvt%model2 => get_virtual_model(gwfmodelname2)
63
64 call mvt%mvt_init(name_exg, inunit, iout, fmi1, &
65 eqnsclfac, depvartype, gwfmodelname1, &
66 gwfmodelname2, fmi2)
67
68 call mem_allocate(mvt%quantity_m1, 0, "QUANTITY_M1", mvt%memoryPath)
69 call mem_allocate(mvt%quantity_m2, 0, "QUANTITY_M2", mvt%memoryPath)
70 call mem_allocate(mvt%maxmvt, "MAXMVT", mvt%memoryPath)
71 mvt%maxmvt = 0
72
Here is the caller graph for this function:

◆ xmvt_da()

subroutine tspexchangemovermodule::xmvt_da ( class(tspexchangemovertype) this)
private

Definition at line 176 of file TspExchangeMover.f90.

177 class(TspExchangeMoverType) :: this
178
179 call this%TspMvtType%mvt_da()
180
181 call mem_deallocate(this%quantity_m1)
182 call mem_deallocate(this%quantity_m2)
183 call mem_deallocate(this%maxmvt)
184

◆ xmvt_fc()

subroutine tspexchangemovermodule::xmvt_fc ( class(tspexchangemovertype) this,
real(dp), dimension(:), intent(in), target, contiguous cnew1,
real(dp), dimension(:), intent(in), target, contiguous cnew2 )
private

Definition at line 141 of file TspExchangeMover.f90.

142 class(TspExchangeMoverType) :: this
143 real(DP), intent(in), dimension(:), contiguous, target :: cnew1
144 real(DP), intent(in), dimension(:), contiguous, target :: cnew2
145 ! local
146 integer(I4B) :: i, n, idx
147 real(DP), dimension(:), pointer, contiguous :: prov_array ! after synchronization when parallel
148 logical(LGP) :: prov_is_remote
149
150 ! get mvrterm data from synchronization array
151 idx = 1
152 do i = 1, size(this%mvrterm)
153
154 ! point to provider array
155 if (this%mvrterm(i)%prov_is_m1) then
156 prov_is_remote = .not. this%model1%is_local
157 prov_array => this%quantity_m1
158 else
159 prov_is_remote = .not. this%model2%is_local
160 prov_array => this%quantity_m2
161 end if
162
163 if (prov_is_remote) then
164 ! remote provider, so we copy it in here after sync'ing
165 do n = 1, size(this%mvrterm(i)%qty)
166 this%mvrterm(i)%qty(n) = prov_array(idx)
167 idx = idx + 1
168 end do
169 end if
170 end do
171
172 call this%mvt_update_qmfrommvr()
173

◆ xmvt_rp()

subroutine tspexchangemovermodule::xmvt_rp ( class(tspexchangemovertype) this)
private

Definition at line 77 of file TspExchangeMover.f90.

78 use tdismodule, only: kper, kstp
79 class(TspExchangeMoverType) :: this
80 ! local
81 integer(I4B) :: i, max_array_size
82
83 call this%TspMvtType%mvt_rp()
84
85 ! only on first timestep
86 if (kstp * kper == 1) then
87 max_array_size = 0
88 do i = 1, this%mvrbudobj%nbudterm
89 max_array_size = max_array_size + this%mvrbudobj%budterm(i)%maxlist
90 end do
91
92 if (max_array_size > 0) then
93 call mem_reallocate(this%quantity_m1, max_array_size, &
94 "QUANTITY_M1", this%memoryPath)
95 call mem_reallocate(this%quantity_m2, max_array_size, &
96 "QUANTITY_M2", this%memoryPath)
97 this%maxmvt = max_array_size
98 end if
99 end if
100
101 this%quantity_m1 = dnodata
102 this%quantity_m2 = dnodata
103
integer(i4b), pointer, public kstp
current time step number
Definition tdis.f90:27
integer(i4b), pointer, public kper
current stress period number
Definition tdis.f90:26