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

Data Types

type  gwtsfttype

Functions/Subroutines

subroutine, public sft_create (packobj, id, ibcnum, inunit, iout, namemodel, pakname, mempath, fmi, eqnsclfac, dvt, dvu, dvua)
 Create a new sft package.
subroutine find_sft_package (this)
 Find corresponding sft package.
real(dp) function sft_setting_value (this, itemno, key)
 Value for a package-specific PERIOD setting.
subroutine sft_fc_expanded (this, rhs, ia, idxglo, matrix_sln)
 Add matrix terms related to SFT.
subroutine sft_solve (this)
 Add terms specific to sft to the explicit sft solve.
integer(i4b) function sft_get_nbudterms (this)
 Function to return the number of budget terms just for this package.
subroutine sft_setup_budobj (this, idx)
 Set up the budget object that stores all the sft flows.
subroutine sft_fill_budobj (this, idx, x, flowja, ccratin, ccratout)
 Copy flow terms into thisbudobj.
subroutine allocate_scalars (this)
 Allocate scalars specific to the streamflow energy transport (SFE) package.
subroutine sft_allocate_arrays (this)
 Allocate arrays specific to the streamflow energy transport (SFE) package.
subroutine sft_checkin_deprecated_names (this)
 Alias deprecated SFT variable names to their current storage.
subroutine sft_ad (this)
 Advance sft package routine.
subroutine sft_da (this)
 Deallocate memory.
subroutine sft_rain_term (this, ientry, n1, n2, rrate, rhsval, hcofval)
 Rain term.
subroutine sft_evap_term (this, ientry, n1, n2, rrate, rhsval, hcofval)
 Evaporative term.
subroutine sft_roff_term (this, ientry, n1, n2, rrate, rhsval, hcofval)
 Runoff term.
subroutine sft_iflw_term (this, ientry, n1, n2, rrate, rhsval, hcofval)
 Inflow Term.
subroutine sft_outf_term (this, ientry, n1, n2, rrate, rhsval, hcofval)
 Outflow term.
subroutine sft_df_obs (this)
 Observations.
subroutine sft_rp_obs (this, obsrv, found)
 Process package specific obs.
subroutine sft_bd_obs (this, obstypeid, jj, v, found)
 Calculate observation value and pass it back to APT.
subroutine sft_get_volumes (this, icv, vnew, vold, delt)
 Return the sfr new volume and old volume.

Variables

character(len= *), parameter ftype = 'SFT'
character(len= *), parameter flowtype = 'SFR'
character(len=16) text = ' SFT'

Function/Subroutine Documentation

◆ allocate_scalars()

subroutine gwtsftmodule::allocate_scalars ( class(gwtsfttype) this)

Definition at line 591 of file gwt-sft.f90.

592 ! -- modules
594 ! -- dummy
595 class(GwtSftType) :: this
596 ! -- local
597 !
598 ! -- allocate scalars in TspAptType
599 call this%TspAptType%allocate_scalars()
600 !
601 ! -- Allocate
602 call mem_allocate(this%idxbudrain, 'IDXBUDRAIN', this%memoryPath)
603 call mem_allocate(this%idxbudevap, 'IDXBUDEVAP', this%memoryPath)
604 call mem_allocate(this%idxbudroff, 'IDXBUDROFF', this%memoryPath)
605 call mem_allocate(this%idxbudiflw, 'IDXBUDIFLW', this%memoryPath)
606 call mem_allocate(this%idxbudoutf, 'IDXBUDOUTF', this%memoryPath)
607 !
608 ! -- Initialize
609 this%idxbudrain = 0
610 this%idxbudevap = 0
611 this%idxbudroff = 0
612 this%idxbudiflw = 0
613 this%idxbudoutf = 0

◆ find_sft_package()

subroutine gwtsftmodule::find_sft_package ( class(gwtsfttype) this)

Definition at line 159 of file gwt-sft.f90.

160 ! -- modules
162 ! -- dummy
163 class(GwtSftType) :: this
164 ! -- local
165 character(len=LINELENGTH) :: errmsg
166 class(BndType), pointer :: packobj
167 integer(I4B) :: ip, icount
168 integer(I4B) :: nbudterm
169 logical :: found
170 !
171 ! -- Initialize found to false, and error later if flow package cannot
172 ! be found
173 found = .false.
174 !
175 ! -- If user is specifying flows in a binary budget file, then set up
176 ! the budget file reader, otherwise set a pointer to the flow package
177 ! budobj
178 if (this%fmi%flows_from_file) then
179 call this%fmi%set_aptbudobj_pointer(this%flowpackagename, this%flowbudptr)
180 if (associated(this%flowbudptr)) found = .true.
181 !
182 else
183 if (associated(this%fmi%gwfbndlist)) then
184 ! -- Look through gwfbndlist for a flow package with the same name as
185 ! this transport package name
186 do ip = 1, this%fmi%gwfbndlist%Count()
187 packobj => getbndfromlist(this%fmi%gwfbndlist, ip)
188 if (packobj%packName == this%flowpackagename) then
189 found = .true.
190 !
191 ! -- store BndType pointer to packobj, and then
192 ! use the select type to point to the budobj in flow package
193 this%flowpackagebnd => packobj
194 select type (packobj)
195 type is (sfrtype)
196 this%flowbudptr => packobj%budobj
197 end select
198 end if
199 if (found) exit
200 end do
201 end if
202 end if
203 !
204 ! -- error if flow package not found
205 if (.not. found) then
206 write (errmsg, '(a)') 'Could not find flow package with name '&
207 &//trim(adjustl(this%flowpackagename))//'.'
208 call store_error(errmsg)
209 call store_error_filename(this%input_fname)
210 end if
211 !
212 ! -- allocate space for idxbudssm, which indicates whether this is a
213 ! special budget term or one that is a general source and sink
214 nbudterm = this%flowbudptr%nbudterm
215 call mem_allocate(this%idxbudssm, nbudterm, 'IDXBUDSSM', this%memoryPath)
216 !
217 ! -- Process budget terms and identify special budget terms
218 write (this%iout, '(/, a, a)') &
219 'PROCESSING '//ftype//' INFORMATION FOR ', this%packName
220 write (this%iout, '(a)') ' IDENTIFYING FLOW TERMS IN '//flowtype//' PACKAGE'
221 write (this%iout, '(a, i0)') &
222 ' NUMBER OF '//flowtype//' = ', this%flowbudptr%ncv
223 icount = 1
224 do ip = 1, this%flowbudptr%nbudterm
225 select case (trim(adjustl(this%flowbudptr%budterm(ip)%flowtype)))
226 case ('FLOW-JA-FACE')
227 this%idxbudfjf = ip
228 this%idxbudssm(ip) = 0
229 case ('GWF')
230 this%idxbudgwf = ip
231 this%idxbudssm(ip) = 0
232 case ('STORAGE')
233 this%idxbudsto = ip
234 this%idxbudssm(ip) = 0
235 case ('RAINFALL')
236 this%idxbudrain = ip
237 this%idxbudssm(ip) = 0
238 case ('EVAPORATION')
239 this%idxbudevap = ip
240 this%idxbudssm(ip) = 0
241 case ('RUNOFF')
242 this%idxbudroff = ip
243 this%idxbudssm(ip) = 0
244 case ('EXT-INFLOW')
245 this%idxbudiflw = ip
246 this%idxbudssm(ip) = 0
247 case ('EXT-OUTFLOW')
248 this%idxbudoutf = ip
249 this%idxbudssm(ip) = 0
250 case ('TO-MVR')
251 this%idxbudtmvr = ip
252 this%idxbudssm(ip) = 0
253 case ('FROM-MVR')
254 this%idxbudfmvr = ip
255 this%idxbudssm(ip) = 0
256 case ('AUXILIARY')
257 this%idxbudaux = ip
258 this%idxbudssm(ip) = 0
259 case default
260 !
261 ! -- set idxbudssm equal to a column index for where the concentrations
262 ! are stored in the concbud(nbudssm, ncv) array
263 this%idxbudssm(ip) = icount
264 icount = icount + 1
265 end select
266 write (this%iout, '(a, i0, " = ", a,/, a, i0)') &
267 ' TERM ', ip, trim(adjustl(this%flowbudptr%budterm(ip)%flowtype)), &
268 ' MAX NO. OF ENTRIES = ', this%flowbudptr%budterm(ip)%maxlist
269 end do
270 write (this%iout, '(a, //)') 'DONE PROCESSING '//ftype//' INFORMATION'
Here is the call graph for this function:

◆ sft_ad()

subroutine gwtsftmodule::sft_ad ( class(gwtsfttype) this)

Definition at line 672 of file gwt-sft.f90.

673 ! modules
675 ! dummy
676 class(GwtSftType) :: this
677 ! local
678 integer(I4B) :: n
679
680 ! call base bnd_ad and run the per-timestep resync directly
681 ! (see apt_ad_resync)
682 call this%BndExtType%bnd_ad()
683 call this%apt_ad_resync()
684
685 ! update vold, unless this time step is repeated, when vnew is the
686 ! volume the failed attempt ended with
687 if (ifailedstepretry == 0) then
688 do n = 1, this%ncv
689 this%vold(n) = this%vnew(n)
690 end do
691 end if
692
This module contains simulation variables.
integer(i4b) ifailedstepretry
current retry for this time step

◆ sft_allocate_arrays()

subroutine gwtsftmodule::sft_allocate_arrays ( class(gwtsfttype), intent(inout) this)

Definition at line 619 of file gwt-sft.f90.

620 ! -- modules
622 ! -- dummy
623 class(GwtSftType), intent(inout) :: this
624 ! -- local
625 integer(I4B) :: n
626 !
627 ! -- alias into the input context's permanent, feature-indexed arrays
628 ! (allocated and DZERO-initialized by the input context)
629 call mem_setptr(this%concrain, 'RAINFALL', this%input_mempath)
630 call mem_setptr(this%concevap, 'EVAPORATION', this%input_mempath)
631 call mem_setptr(this%concroff, 'RUNOFF', this%input_mempath)
632 call mem_setptr(this%conciflw, 'INFLOW', this%input_mempath)
633
634 call mem_allocate(this%vnew, this%ncv, 'VNEW', this%memoryPath)
635 call mem_allocate(this%vold, this%ncv, 'VOLD', this%memoryPath)
636
637 !
638 ! -- call standard TspAptType allocate arrays
639 call this%TspAptType%apt_allocate_arrays()
640 !
641 ! -- Initialize
642 do n = 1, this%ncv
643 this%vnew(n) = dzero
644 this%vold(n) = dzero
645 end do

◆ sft_bd_obs()

subroutine gwtsftmodule::sft_bd_obs ( class(gwtsfttype), intent(inout) this,
character(len=*), intent(in) obstypeid,
integer(i4b), intent(in) jj,
real(dp), intent(inout) v,
logical, intent(inout) found )

Definition at line 970 of file gwt-sft.f90.

971 ! -- dummy
972 class(GwtSftType), intent(inout) :: this
973 character(len=*), intent(in) :: obstypeid
974 real(DP), intent(inout) :: v
975 integer(I4B), intent(in) :: jj
976 logical, intent(inout) :: found
977 ! -- local
978 integer(I4B) :: n1, n2
979 !
980 found = .true.
981 select case (obstypeid)
982 case ('RAINFALL')
983 if (this%iboundpak(jj) /= 0) then
984 call this%sft_rain_term(jj, n1, n2, v)
985 end if
986 case ('EVAPORATION')
987 if (this%iboundpak(jj) /= 0) then
988 call this%sft_evap_term(jj, n1, n2, v)
989 end if
990 case ('RUNOFF')
991 if (this%iboundpak(jj) /= 0) then
992 call this%sft_roff_term(jj, n1, n2, v)
993 end if
994 case ('EXT-INFLOW')
995 if (this%iboundpak(jj) /= 0) then
996 call this%sft_iflw_term(jj, n1, n2, v)
997 end if
998 case ('EXT-OUTFLOW')
999 if (this%iboundpak(jj) /= 0) then
1000 call this%sft_outf_term(jj, n1, n2, v)
1001 end if
1002 case default
1003 found = .false.
1004 end select

◆ sft_checkin_deprecated_names()

subroutine gwtsftmodule::sft_checkin_deprecated_names ( class(gwtsfttype), intent(inout) this)

Definition at line 650 of file gwt-sft.f90.

651 ! -- modules
653 ! -- dummy
654 class(GwtSftType), intent(inout) :: this
655 ! -- code
656 !
657 ! -- names common to all advanced transport packages
658 call this%TspAptType%apt_checkin_deprecated_names()
659 !
660 call mem_alias_deprecated(this%concrain, 'CONCRAIN', this%memoryPath, &
661 'RAINFALL', this%input_mempath, '6.8.2')
662 call mem_alias_deprecated(this%concevap, 'CONCEVAP', this%memoryPath, &
663 'EVAPORATION', this%input_mempath, '6.8.2')
664 call mem_alias_deprecated(this%concroff, 'CONCROFF', this%memoryPath, &
665 'RUNOFF', this%input_mempath, '6.8.2')
666 call mem_alias_deprecated(this%conciflw, 'CONCIFLW', this%memoryPath, &
667 'INFLOW', this%input_mempath, '6.8.2')
Previous variable names checked in as deprecated aliases.

◆ sft_create()

subroutine, public gwtsftmodule::sft_create ( class(bndtype), pointer packobj,
integer(i4b), intent(in) id,
integer(i4b), intent(in) ibcnum,
integer(i4b), intent(in) inunit,
integer(i4b), intent(in) iout,
character(len=*), intent(in) namemodel,
character(len=*), intent(in) pakname,
character(len=*), intent(in) mempath,
type(tspfmitype), pointer fmi,
real(dp), intent(in), pointer eqnsclfac,
character(len=*), intent(in) dvt,
character(len=*), intent(in) dvu,
character(len=*), intent(in) dvua )
Parameters
[in]mempathinput memory path
[in]eqnsclfacgoverning equation scale factor
[in]dvtFor GWT, set to "CONCENTRATION" in TspAptType
[in]dvuFor GWT, set to "mass" in TspAptType
[in]dvuaFor GWT, set to "M" in TspAptType

Definition at line 102 of file gwt-sft.f90.

104 ! -- dummy
105 class(BndType), pointer :: packobj
106 integer(I4B), intent(in) :: id
107 integer(I4B), intent(in) :: ibcnum
108 integer(I4B), intent(in) :: inunit
109 integer(I4B), intent(in) :: iout
110 character(len=*), intent(in) :: namemodel
111 character(len=*), intent(in) :: pakname
112 character(len=*), intent(in) :: mempath !< input memory path
113 type(TspFmiType), pointer :: fmi
114 real(DP), intent(in), pointer :: eqnsclfac !< governing equation scale factor
115 character(len=*), intent(in) :: dvt !< For GWT, set to "CONCENTRATION" in TspAptType
116 character(len=*), intent(in) :: dvu !< For GWT, set to "mass" in TspAptType
117 character(len=*), intent(in) :: dvua !< For GWT, set to "M" in TspAptType
118 ! -- local
119 type(GwtSftType), pointer :: sftobj
120 !
121 ! -- allocate the object and assign values to object variables
122 allocate (sftobj)
123 packobj => sftobj
124 !
125 ! -- create name and memory path
126 call packobj%set_names(ibcnum, namemodel, pakname, ftype, mempath)
127 packobj%text = text
128 !
129 ! -- allocate scalars
130 call sftobj%allocate_scalars()
131 !
132 ! -- initialize package
133 call packobj%pack_initialize()
134 !
135 packobj%inunit = inunit
136 packobj%iout = iout
137 packobj%id = id
138 packobj%ibcnum = ibcnum
139 packobj%ncolbnd = 1
140 packobj%iscloc = 1
141 packobj%isadvpak = 1
142 !
143 ! -- Store pointer to flow model interface. When the GwfGwt exchange is
144 ! created, it sets fmi%bndlist so that the GWT model has access to all
145 ! the flow packages
146 sftobj%fmi => fmi
147 !
148 ! -- Store pointer to governing equation scale factor
149 sftobj%eqnsclfac => eqnsclfac
150 !
151 ! -- Set labels that will be used in generalized APT class
152 sftobj%depvartype = dvt
153 sftobj%depvarunit = dvu
154 sftobj%depvarunitabbrev = dvua
Here is the caller graph for this function:

◆ sft_da()

subroutine gwtsftmodule::sft_da ( class(gwtsfttype) this)

Definition at line 697 of file gwt-sft.f90.

698 ! -- modules
700 ! -- dummy
701 class(GwtSftType) :: this
702 ! -- local
703 !
704 ! -- deallocate scalars
705 call mem_deallocate(this%idxbudrain)
706 call mem_deallocate(this%idxbudevap)
707 call mem_deallocate(this%idxbudroff)
708 call mem_deallocate(this%idxbudiflw)
709 call mem_deallocate(this%idxbudoutf)
710 !
711 ! -- input-context-owned aliases, not package-allocated
712 nullify (this%concrain)
713 nullify (this%concevap)
714 nullify (this%concroff)
715 nullify (this%conciflw)
716
717 call mem_deallocate(this%vnew)
718 call mem_deallocate(this%vold)
719 !
720 ! -- deallocate scalars in TspAptType
721 call this%TspAptType%bnd_da()

◆ sft_df_obs()

subroutine gwtsftmodule::sft_df_obs ( class(gwtsfttype) this)

Store the observation type supported by the APT package and override BndTypebnd_df_obs

Definition at line 870 of file gwt-sft.f90.

871 ! -- modules
872 ! -- dummy
873 class(GwtSftType) :: this
874 ! -- local
875 integer(I4B) :: indx
876 !
877 ! -- Store obs type and assign procedure pointer
878 ! for concentration observation type.
879 call this%obs%StoreObsType('concentration', .false., indx)
880 this%obs%obsData(indx)%ProcessIdPtr => apt_process_obsid
881 !
882 ! -- Store obs type and assign procedure pointer
883 ! for flow between reaches.
884 call this%obs%StoreObsType('flow-ja-face', .true., indx)
885 this%obs%obsData(indx)%ProcessIdPtr => apt_process_obsid12
886 !
887 ! -- Store obs type and assign procedure pointer
888 ! for from-mvr observation type.
889 call this%obs%StoreObsType('from-mvr', .true., indx)
890 this%obs%obsData(indx)%ProcessIdPtr => apt_process_obsid
891 !
892 ! -- Store obs type and assign procedure pointer
893 ! for to-mvr observation type.
894 call this%obs%StoreObsType('to-mvr', .true., indx)
895 this%obs%obsData(indx)%ProcessIdPtr => apt_process_obsid
896 !
897 ! -- Store obs type and assign procedure pointer
898 ! for storage observation type.
899 call this%obs%StoreObsType('storage', .true., indx)
900 this%obs%obsData(indx)%ProcessIdPtr => apt_process_obsid
901 !
902 ! -- Store obs type and assign procedure pointer
903 ! for constant observation type.
904 call this%obs%StoreObsType('constant', .true., indx)
905 this%obs%obsData(indx)%ProcessIdPtr => apt_process_obsid
906 !
907 ! -- Store obs type and assign procedure pointer
908 ! for observation type: sft
909 call this%obs%StoreObsType('sft', .true., indx)
910 this%obs%obsData(indx)%ProcessIdPtr => apt_process_obsid
911 !
912 ! -- Store obs type and assign procedure pointer
913 ! for rainfall observation type.
914 call this%obs%StoreObsType('rainfall', .true., indx)
915 this%obs%obsData(indx)%ProcessIdPtr => apt_process_obsid
916 !
917 ! -- Store obs type and assign procedure pointer
918 ! for evaporation observation type.
919 call this%obs%StoreObsType('evaporation', .true., indx)
920 this%obs%obsData(indx)%ProcessIdPtr => apt_process_obsid
921 !
922 ! -- Store obs type and assign procedure pointer
923 ! for runoff observation type.
924 call this%obs%StoreObsType('runoff', .true., indx)
925 this%obs%obsData(indx)%ProcessIdPtr => apt_process_obsid
926 !
927 ! -- Store obs type and assign procedure pointer
928 ! for inflow observation type.
929 call this%obs%StoreObsType('ext-inflow', .true., indx)
930 this%obs%obsData(indx)%ProcessIdPtr => apt_process_obsid
931 !
932 ! -- Store obs type and assign procedure pointer
933 ! for ext-outflow observation type.
934 call this%obs%StoreObsType('ext-outflow', .true., indx)
935 this%obs%obsData(indx)%ProcessIdPtr => apt_process_obsid
Here is the call graph for this function:

◆ sft_evap_term()

subroutine gwtsftmodule::sft_evap_term ( class(gwtsfttype) this,
integer(i4b), intent(in) ientry,
integer(i4b), intent(inout) n1,
integer(i4b), intent(inout) n2,
real(dp), intent(inout), optional rrate,
real(dp), intent(inout), optional rhsval,
real(dp), intent(inout), optional hcofval )

Definition at line 751 of file gwt-sft.f90.

753 ! -- dummy
754 class(GwtSftType) :: this
755 integer(I4B), intent(in) :: ientry
756 integer(I4B), intent(inout) :: n1
757 integer(I4B), intent(inout) :: n2
758 real(DP), intent(inout), optional :: rrate
759 real(DP), intent(inout), optional :: rhsval
760 real(DP), intent(inout), optional :: hcofval
761 ! -- local
762 real(DP) :: qbnd
763 real(DP) :: ctmp
764 real(DP) :: omega
765 !
766 n1 = this%flowbudptr%budterm(this%idxbudevap)%id1(ientry)
767 n2 = this%flowbudptr%budterm(this%idxbudevap)%id2(ientry)
768 ! -- note that qbnd is negative for evap
769 qbnd = this%flowbudptr%budterm(this%idxbudevap)%flow(ientry)
770 ctmp = this%concevap(n1)
771 if (this%xnewpak(n1) < ctmp) then
772 omega = done
773 else
774 omega = dzero
775 end if
776 if (present(rrate)) &
777 rrate = omega * qbnd * this%xnewpak(n1) + &
778 (done - omega) * qbnd * ctmp
779 if (present(rhsval)) rhsval = -(done - omega) * qbnd * ctmp
780 if (present(hcofval)) hcofval = omega * qbnd

◆ sft_fc_expanded()

subroutine gwtsftmodule::sft_fc_expanded ( class(gwtsfttype) this,
real(dp), dimension(:), intent(inout) rhs,
integer(i4b), dimension(:), intent(in) ia,
integer(i4b), dimension(:), intent(in) idxglo,
class(matrixbasetype), pointer matrix_sln )

This will be called from TspAptTypeapt_fc_expanded() in order to add matrix terms specifically for SFT

Definition at line 303 of file gwt-sft.f90.

304 ! -- modules
305 ! -- dummy
306 class(GwtSftType) :: this
307 real(DP), dimension(:), intent(inout) :: rhs
308 integer(I4B), dimension(:), intent(in) :: ia
309 integer(I4B), dimension(:), intent(in) :: idxglo
310 class(MatrixBaseType), pointer :: matrix_sln
311 ! -- local
312 integer(I4B) :: j, n1, n2
313 integer(I4B) :: iloc
314 integer(I4B) :: iposd
315 real(DP) :: rrate
316 real(DP) :: rhsval
317 real(DP) :: hcofval
318 !
319 ! -- add rainfall contribution
320 if (this%idxbudrain /= 0) then
321 do j = 1, this%flowbudptr%budterm(this%idxbudrain)%nlist
322 call this%sft_rain_term(j, n1, n2, rrate, rhsval, hcofval)
323 iloc = this%idxlocnode(n1)
324 iposd = this%idxpakdiag(n1)
325 call matrix_sln%add_value_pos(iposd, hcofval)
326 rhs(iloc) = rhs(iloc) + rhsval
327 end do
328 end if
329 !
330 ! -- add evaporation contribution
331 if (this%idxbudevap /= 0) then
332 do j = 1, this%flowbudptr%budterm(this%idxbudevap)%nlist
333 call this%sft_evap_term(j, n1, n2, rrate, rhsval, hcofval)
334 iloc = this%idxlocnode(n1)
335 iposd = this%idxpakdiag(n1)
336 call matrix_sln%add_value_pos(iposd, hcofval)
337 rhs(iloc) = rhs(iloc) + rhsval
338 end do
339 end if
340 !
341 ! -- add runoff contribution
342 if (this%idxbudroff /= 0) then
343 do j = 1, this%flowbudptr%budterm(this%idxbudroff)%nlist
344 call this%sft_roff_term(j, n1, n2, rrate, rhsval, hcofval)
345 iloc = this%idxlocnode(n1)
346 iposd = this%idxpakdiag(n1)
347 call matrix_sln%add_value_pos(iposd, hcofval)
348 rhs(iloc) = rhs(iloc) + rhsval
349 end do
350 end if
351 !
352 ! -- add inflow contribution
353 if (this%idxbudiflw /= 0) then
354 do j = 1, this%flowbudptr%budterm(this%idxbudiflw)%nlist
355 call this%sft_iflw_term(j, n1, n2, rrate, rhsval, hcofval)
356 iloc = this%idxlocnode(n1)
357 iposd = this%idxpakdiag(n1)
358 call matrix_sln%add_value_pos(iposd, hcofval)
359 rhs(iloc) = rhs(iloc) + rhsval
360 end do
361 end if
362 !
363 ! -- add outflow contribution
364 if (this%idxbudoutf /= 0) then
365 do j = 1, this%flowbudptr%budterm(this%idxbudoutf)%nlist
366 call this%sft_outf_term(j, n1, n2, rrate, rhsval, hcofval)
367 iloc = this%idxlocnode(n1)
368 iposd = this%idxpakdiag(n1)
369 call matrix_sln%add_value_pos(iposd, hcofval)
370 rhs(iloc) = rhs(iloc) + rhsval
371 end do
372 end if

◆ sft_fill_budobj()

subroutine gwtsftmodule::sft_fill_budobj ( class(gwtsfttype) this,
integer(i4b), intent(inout) idx,
real(dp), dimension(:), intent(in) x,
real(dp), dimension(:), intent(inout), contiguous flowja,
real(dp), intent(inout) ccratin,
real(dp), intent(inout) ccratout )

Definition at line 522 of file gwt-sft.f90.

523 ! -- modules
524 ! -- dummy
525 class(GwtSftType) :: this
526 integer(I4B), intent(inout) :: idx
527 real(DP), dimension(:), intent(in) :: x
528 real(DP), dimension(:), contiguous, intent(inout) :: flowja
529 real(DP), intent(inout) :: ccratin
530 real(DP), intent(inout) :: ccratout
531 ! -- local
532 integer(I4B) :: j, n1, n2
533 integer(I4B) :: nlist
534 real(DP) :: q
535 ! -- formats
536 !
537 ! -- RAIN
538 idx = idx + 1
539 nlist = this%flowbudptr%budterm(this%idxbudrain)%nlist
540 call this%budobj%budterm(idx)%reset(nlist)
541 do j = 1, nlist
542 call this%sft_rain_term(j, n1, n2, q)
543 call this%budobj%budterm(idx)%update_term(n1, n2, q)
544 call this%apt_accumulate_ccterm(n1, q, ccratin, ccratout)
545 end do
546 !
547 ! -- EVAPORATION
548 idx = idx + 1
549 nlist = this%flowbudptr%budterm(this%idxbudevap)%nlist
550 call this%budobj%budterm(idx)%reset(nlist)
551 do j = 1, nlist
552 call this%sft_evap_term(j, n1, n2, q)
553 call this%budobj%budterm(idx)%update_term(n1, n2, q)
554 call this%apt_accumulate_ccterm(n1, q, ccratin, ccratout)
555 end do
556 !
557 ! -- RUNOFF
558 idx = idx + 1
559 nlist = this%flowbudptr%budterm(this%idxbudroff)%nlist
560 call this%budobj%budterm(idx)%reset(nlist)
561 do j = 1, nlist
562 call this%sft_roff_term(j, n1, n2, q)
563 call this%budobj%budterm(idx)%update_term(n1, n2, q)
564 call this%apt_accumulate_ccterm(n1, q, ccratin, ccratout)
565 end do
566 !
567 ! -- EXT-INFLOW
568 idx = idx + 1
569 nlist = this%flowbudptr%budterm(this%idxbudiflw)%nlist
570 call this%budobj%budterm(idx)%reset(nlist)
571 do j = 1, nlist
572 call this%sft_iflw_term(j, n1, n2, q)
573 call this%budobj%budterm(idx)%update_term(n1, n2, q)
574 call this%apt_accumulate_ccterm(n1, q, ccratin, ccratout)
575 end do
576 !
577 ! -- EXT-OUTFLOW
578 idx = idx + 1
579 nlist = this%flowbudptr%budterm(this%idxbudoutf)%nlist
580 call this%budobj%budterm(idx)%reset(nlist)
581 do j = 1, nlist
582 call this%sft_outf_term(j, n1, n2, q)
583 call this%budobj%budterm(idx)%update_term(n1, n2, q)
584 call this%apt_accumulate_ccterm(n1, q, ccratin, ccratout)
585 end do

◆ sft_get_nbudterms()

integer(i4b) function gwtsftmodule::sft_get_nbudterms ( class(gwtsfttype) this)

This overrides a function in the parent class.

Definition at line 430 of file gwt-sft.f90.

431 ! -- modules
432 ! -- dummy
433 class(GwtSftType) :: this
434 ! -- return
435 integer(I4B) :: nbudterms
436 ! -- local
437 !
438 ! -- Number of budget terms is 5
439 nbudterms = 5

◆ sft_get_volumes()

subroutine gwtsftmodule::sft_get_volumes ( class(gwtsfttype) this,
integer(i4b), intent(in) icv,
real(dp), intent(inout) vnew,
real(dp), intent(inout) vold,
real(dp), intent(in) delt )

Definition at line 1009 of file gwt-sft.f90.

1010 ! modules
1011 ! dummy
1012 class(GwtSftType) :: this
1013 integer(I4B), intent(in) :: icv
1014 real(DP), intent(inout) :: vnew, vold
1015 real(DP), intent(in) :: delt
1016 ! local
1017 real(DP) :: qss
1018 !
1019 ! -- get volumes
1020 vold = dzero
1021 vnew = vold
1022 if (this%idxbudsto /= 0) then
1023 qss = this%flowbudptr%budterm(this%idxbudsto)%flow(icv)
1024 vnew = this%flowbudptr%budterm(this%idxbudsto)%auxvar(1, icv)
1025 this%vnew(icv) = vnew
1026 if (qss /= dzero) then
1027 vold = vnew + qss * delt
1028 else
1029 if (vnew == dzero) then
1030 vold = dzero
1031 else
1032 vold = this%vold(icv)
1033 end if
1034 end if
1035 end if

◆ sft_iflw_term()

subroutine gwtsftmodule::sft_iflw_term ( class(gwtsfttype) this,
integer(i4b), intent(in) ientry,
integer(i4b), intent(inout) n1,
integer(i4b), intent(inout) n2,
real(dp), intent(inout), optional rrate,
real(dp), intent(inout), optional rhsval,
real(dp), intent(inout), optional hcofval )

Accounts for mass added via streamflow entering into a stream channel; for example, energy entering the model domain via a specified flow in a stream channel.

Definition at line 814 of file gwt-sft.f90.

816 ! -- dummy
817 class(GwtSftType) :: this
818 integer(I4B), intent(in) :: ientry
819 integer(I4B), intent(inout) :: n1
820 integer(I4B), intent(inout) :: n2
821 real(DP), intent(inout), optional :: rrate
822 real(DP), intent(inout), optional :: rhsval
823 real(DP), intent(inout), optional :: hcofval
824 ! -- local
825 real(DP) :: qbnd
826 real(DP) :: ctmp
827 !
828 n1 = this%flowbudptr%budterm(this%idxbudiflw)%id1(ientry)
829 n2 = this%flowbudptr%budterm(this%idxbudiflw)%id2(ientry)
830 qbnd = this%flowbudptr%budterm(this%idxbudiflw)%flow(ientry)
831 ctmp = this%conciflw(n1)
832 if (present(rrate)) rrate = ctmp * qbnd
833 if (present(rhsval)) rhsval = -rrate
834 if (present(hcofval)) hcofval = dzero

◆ sft_outf_term()

subroutine gwtsftmodule::sft_outf_term ( class(gwtsfttype) this,
integer(i4b), intent(in) ientry,
integer(i4b), intent(inout) n1,
integer(i4b), intent(inout) n2,
real(dp), intent(inout), optional rrate,
real(dp), intent(inout), optional rhsval,
real(dp), intent(inout), optional hcofval )

Accounts for the mass leaving a stream channel; for example, mass exiting the model domain via a flow in a stream channel flowing out of the active domain.

Definition at line 842 of file gwt-sft.f90.

844 ! -- dummy
845 class(GwtSftType) :: this
846 integer(I4B), intent(in) :: ientry
847 integer(I4B), intent(inout) :: n1
848 integer(I4B), intent(inout) :: n2
849 real(DP), intent(inout), optional :: rrate
850 real(DP), intent(inout), optional :: rhsval
851 real(DP), intent(inout), optional :: hcofval
852 ! -- local
853 real(DP) :: qbnd
854 real(DP) :: ctmp
855 !
856 n1 = this%flowbudptr%budterm(this%idxbudoutf)%id1(ientry)
857 n2 = this%flowbudptr%budterm(this%idxbudoutf)%id2(ientry)
858 qbnd = this%flowbudptr%budterm(this%idxbudoutf)%flow(ientry)
859 ctmp = this%xnewpak(n1)
860 if (present(rrate)) rrate = ctmp * qbnd
861 if (present(rhsval)) rhsval = dzero
862 if (present(hcofval)) hcofval = qbnd

◆ sft_rain_term()

subroutine gwtsftmodule::sft_rain_term ( class(gwtsfttype) this,
integer(i4b), intent(in) ientry,
integer(i4b), intent(inout) n1,
integer(i4b), intent(inout) n2,
real(dp), intent(inout), optional rrate,
real(dp), intent(inout), optional rhsval,
real(dp), intent(inout), optional hcofval )

Definition at line 726 of file gwt-sft.f90.

728 ! -- dummy
729 class(GwtSftType) :: this
730 integer(I4B), intent(in) :: ientry
731 integer(I4B), intent(inout) :: n1
732 integer(I4B), intent(inout) :: n2
733 real(DP), intent(inout), optional :: rrate
734 real(DP), intent(inout), optional :: rhsval
735 real(DP), intent(inout), optional :: hcofval
736 ! -- local
737 real(DP) :: qbnd
738 real(DP) :: ctmp
739 !
740 n1 = this%flowbudptr%budterm(this%idxbudrain)%id1(ientry)
741 n2 = this%flowbudptr%budterm(this%idxbudrain)%id2(ientry)
742 qbnd = this%flowbudptr%budterm(this%idxbudrain)%flow(ientry)
743 ctmp = this%concrain(n1)
744 if (present(rrate)) rrate = ctmp * qbnd
745 if (present(rhsval)) rhsval = -rrate
746 if (present(hcofval)) hcofval = dzero

◆ sft_roff_term()

subroutine gwtsftmodule::sft_roff_term ( class(gwtsfttype) this,
integer(i4b), intent(in) ientry,
integer(i4b), intent(inout) n1,
integer(i4b), intent(inout) n2,
real(dp), intent(inout), optional rrate,
real(dp), intent(inout), optional rhsval,
real(dp), intent(inout), optional hcofval )

Definition at line 785 of file gwt-sft.f90.

787 ! -- dummy
788 class(GwtSftType) :: this
789 integer(I4B), intent(in) :: ientry
790 integer(I4B), intent(inout) :: n1
791 integer(I4B), intent(inout) :: n2
792 real(DP), intent(inout), optional :: rrate
793 real(DP), intent(inout), optional :: rhsval
794 real(DP), intent(inout), optional :: hcofval
795 ! -- local
796 real(DP) :: qbnd
797 real(DP) :: ctmp
798 !
799 n1 = this%flowbudptr%budterm(this%idxbudroff)%id1(ientry)
800 n2 = this%flowbudptr%budterm(this%idxbudroff)%id2(ientry)
801 qbnd = this%flowbudptr%budterm(this%idxbudroff)%flow(ientry)
802 ctmp = this%concroff(n1)
803 if (present(rrate)) rrate = ctmp * qbnd
804 if (present(rhsval)) rhsval = -rrate
805 if (present(hcofval)) hcofval = dzero

◆ sft_rp_obs()

subroutine gwtsftmodule::sft_rp_obs ( class(gwtsfttype), intent(inout) this,
type(observetype), intent(inout) obsrv,
logical, intent(inout) found )

Method to process specific observations for this package.

Parameters
[in,out]thispackage class
[in,out]obsrvobservation object
[in,out]foundindicate whether observation was found

Definition at line 942 of file gwt-sft.f90.

943 ! -- dummy
944 class(GwtSftType), intent(inout) :: this !< package class
945 type(ObserveType), intent(inout) :: obsrv !< observation object
946 logical, intent(inout) :: found !< indicate whether observation was found
947 ! -- local
948 !
949 found = .true.
950 select case (obsrv%ObsTypeId)
951 case ('RAINFALL')
952 call this%rp_obs_byfeature(obsrv)
953 case ('EVAPORATION')
954 call this%rp_obs_byfeature(obsrv)
955 case ('RUNOFF')
956 call this%rp_obs_byfeature(obsrv)
957 case ('EXT-INFLOW')
958 call this%rp_obs_byfeature(obsrv)
959 case ('EXT-OUTFLOW')
960 call this%rp_obs_byfeature(obsrv)
961 case ('TO-MVR')
962 call this%rp_obs_byfeature(obsrv)
963 case default
964 found = .false.
965 end select

◆ sft_setting_value()

real(dp) function gwtsftmodule::sft_setting_value ( class(gwtsfttype), intent(inout) this,
integer(i4b), intent(in) itemno,
character(len=*), intent(in) key )

Already resolved by the input context; this only supplies it for the shared apt_rp table echo.

Definition at line 278 of file gwt-sft.f90.

279 ! -- dummy
280 class(GwtSftType), intent(inout) :: this
281 integer(I4B), intent(in) :: itemno
282 character(len=*), intent(in) :: key
283 real(DP) :: val
284 !
285 val = dzero
286 select case (trim(key))
287 case ('RAINFALL')
288 val = this%concrain(itemno)
289 case ('EVAPORATION')
290 val = this%concevap(itemno)
291 case ('RUNOFF')
292 val = this%concroff(itemno)
293 case ('INFLOW')
294 val = this%conciflw(itemno)
295 end select

◆ sft_setup_budobj()

subroutine gwtsftmodule::sft_setup_budobj ( class(gwtsfttype) this,
integer(i4b), intent(inout) idx )

Definition at line 444 of file gwt-sft.f90.

445 ! -- modules
446 use constantsmodule, only: lenbudtxt
447 ! -- dummy
448 class(GwtSftType) :: this
449 integer(I4B), intent(inout) :: idx
450 ! -- local
451 integer(I4B) :: maxlist, naux
452 character(len=LENBUDTXT) :: text
453 !
454 ! --
455 text = ' RAINFALL'
456 idx = idx + 1
457 maxlist = this%flowbudptr%budterm(this%idxbudrain)%maxlist
458 naux = 0
459 call this%budobj%budterm(idx)%initialize(text, &
460 this%name_model, &
461 this%packName, &
462 this%name_model, &
463 this%packName, &
464 maxlist, .false., .false., &
465 naux)
466 !
467 ! --
468 text = ' EVAPORATION'
469 idx = idx + 1
470 maxlist = this%flowbudptr%budterm(this%idxbudevap)%maxlist
471 naux = 0
472 call this%budobj%budterm(idx)%initialize(text, &
473 this%name_model, &
474 this%packName, &
475 this%name_model, &
476 this%packName, &
477 maxlist, .false., .false., &
478 naux)
479 !
480 ! --
481 text = ' RUNOFF'
482 idx = idx + 1
483 maxlist = this%flowbudptr%budterm(this%idxbudroff)%maxlist
484 naux = 0
485 call this%budobj%budterm(idx)%initialize(text, &
486 this%name_model, &
487 this%packName, &
488 this%name_model, &
489 this%packName, &
490 maxlist, .false., .false., &
491 naux)
492 !
493 ! --
494 text = ' EXT-INFLOW'
495 idx = idx + 1
496 maxlist = this%flowbudptr%budterm(this%idxbudiflw)%maxlist
497 naux = 0
498 call this%budobj%budterm(idx)%initialize(text, &
499 this%name_model, &
500 this%packName, &
501 this%name_model, &
502 this%packName, &
503 maxlist, .false., .false., &
504 naux)
505 !
506 ! --
507 text = ' EXT-OUTFLOW'
508 idx = idx + 1
509 maxlist = this%flowbudptr%budterm(this%idxbudoutf)%maxlist
510 naux = 0
511 call this%budobj%budterm(idx)%initialize(text, &
512 this%name_model, &
513 this%packName, &
514 this%name_model, &
515 this%packName, &
516 maxlist, .false., .false., &
517 naux)
This module contains simulation constants.
Definition Constants.f90:9
integer(i4b), parameter lenbudtxt
maximum length of a budget component names
Definition Constants.f90:37

◆ sft_solve()

subroutine gwtsftmodule::sft_solve ( class(gwtsfttype) this)

Definition at line 377 of file gwt-sft.f90.

378 ! -- dummy
379 class(GwtSftType) :: this
380 ! -- local
381 integer(I4B) :: j
382 integer(I4B) :: n1, n2
383 real(DP) :: rrate
384 !
385 ! -- add rainfall contribution
386 if (this%idxbudrain /= 0) then
387 do j = 1, this%flowbudptr%budterm(this%idxbudrain)%nlist
388 call this%sft_rain_term(j, n1, n2, rrate)
389 this%dbuff(n1) = this%dbuff(n1) + rrate
390 end do
391 end if
392 !
393 ! -- add evaporation contribution
394 if (this%idxbudevap /= 0) then
395 do j = 1, this%flowbudptr%budterm(this%idxbudevap)%nlist
396 call this%sft_evap_term(j, n1, n2, rrate)
397 this%dbuff(n1) = this%dbuff(n1) + rrate
398 end do
399 end if
400 !
401 ! -- add runoff contribution
402 if (this%idxbudroff /= 0) then
403 do j = 1, this%flowbudptr%budterm(this%idxbudroff)%nlist
404 call this%sft_roff_term(j, n1, n2, rrate)
405 this%dbuff(n1) = this%dbuff(n1) + rrate
406 end do
407 end if
408 !
409 ! -- add inflow contribution
410 if (this%idxbudiflw /= 0) then
411 do j = 1, this%flowbudptr%budterm(this%idxbudiflw)%nlist
412 call this%sft_iflw_term(j, n1, n2, rrate)
413 this%dbuff(n1) = this%dbuff(n1) + rrate
414 end do
415 end if
416 !
417 ! -- add outflow contribution
418 if (this%idxbudoutf /= 0) then
419 do j = 1, this%flowbudptr%budterm(this%idxbudoutf)%nlist
420 call this%sft_outf_term(j, n1, n2, rrate)
421 this%dbuff(n1) = this%dbuff(n1) + rrate
422 end do
423 end if

Variable Documentation

◆ flowtype

character(len=*), parameter gwtsftmodule::flowtype = 'SFR'

Definition at line 53 of file gwt-sft.f90.

◆ ftype

character(len=*), parameter gwtsftmodule::ftype = 'SFT'

Definition at line 52 of file gwt-sft.f90.

◆ text

character(len=16) gwtsftmodule::text = ' SFT'

Definition at line 54 of file gwt-sft.f90.