diff --git a/make/makefile b/make/makefile index 949b794b820..0f4aec322db 100644 --- a/make/makefile +++ b/make/makefile @@ -119,7 +119,6 @@ $(OBJDIR)/Observe.o \ $(OBJDIR)/TimeArraySeriesLink.o \ $(OBJDIR)/ObsUtility.o \ $(OBJDIR)/ObsContainer.o \ -$(OBJDIR)/TspLabels.o \ $(OBJDIR)/BudgetFileReader.o \ $(OBJDIR)/TimeArraySeriesManager.o \ $(OBJDIR)/PackageMover.o \ diff --git a/msvs/mf6core.vfproj b/msvs/mf6core.vfproj index df1037280e9..3516984ac35 100644 --- a/msvs/mf6core.vfproj +++ b/msvs/mf6core.vfproj @@ -191,7 +191,6 @@ - diff --git a/src/Model/Connection/GwtInterfaceModel.f90 b/src/Model/Connection/GwtInterfaceModel.f90 index 87967ee6e02..82f9babe40b 100644 --- a/src/Model/Connection/GwtInterfaceModel.f90 +++ b/src/Model/Connection/GwtInterfaceModel.f90 @@ -84,8 +84,8 @@ subroutine gwtifmod_cr(this, name, iout, gridConn) ! create dis and packages call disu_cr(this%dis, this%name, '', -1, this%iout) - call fmi_cr(this%fmi, this%name, 0, this%iout, this%tsplab, & - this%ieqnsclfac) + call fmi_cr(this%fmi, this%name, 0, this%iout, this%ieqnsclfac, & + this%depvartype) call adv_cr(this%adv, this%name, adv_unit, this%iout, this%fmi, & this%ieqnsclfac) call dsp_cr(this%dsp, this%name, '', -dsp_unit, this%iout, this%fmi) diff --git a/src/Model/GroundWaterTransport/gwt1.f90 b/src/Model/GroundWaterTransport/gwt1.f90 index eb68a46a072..65aa9b1c063 100644 --- a/src/Model/GroundWaterTransport/gwt1.f90 +++ b/src/Model/GroundWaterTransport/gwt1.f90 @@ -8,7 +8,8 @@ module GwtModule use KindModule, only: DP, I4B - use ConstantsModule, only: LENFTYPE, LENMEMPATH, DZERO, LENPAKLOC, DONE + use ConstantsModule, only: LENFTYPE, LENMEMPATH, DZERO, LENPAKLOC, DONE, & + LENVARNAME use VersionModule, only: write_listfile_header use NumericalModelModule, only: NumericalModelType use BaseModelModule, only: BaseModelType @@ -26,6 +27,9 @@ module GwtModule public :: GwtModelType public :: CastAsGwtModel public :: niunit + character(len=LENVARNAME), parameter :: dvt = 'CONCENTRATION ' !< dependent variable type, varies based on model type + character(len=LENVARNAME), parameter :: dvu = 'MASS ' !< dependent variable unit of measure, either "mass" or "energy" + character(len=LENVARNAME), parameter :: dvua = 'M ' !< abbreviation of the dependent variable unit of measure, either "M" or "J" type, extends(TransportModelType) :: GwtModelType @@ -72,7 +76,6 @@ subroutine gwt_cr(filename, id, modelname) use MemoryManagerExtModule, only: mem_set_value use GwfNamInputModule, only: GwfNamParamFoundType use BudgetModule, only: budget_cr - use TspLabelsModule, only: tsplabels_cr use GwtMstModule, only: mst_cr use GwtDspModule, only: dsp_cr ! -- dummy @@ -94,6 +97,10 @@ subroutine gwt_cr(filename, id, modelname) this%memoryPath = create_mem_path(modelname) ! call this%allocate_gwt_scalars(modelname) + ! + ! -- set labels for transport model - needed by create_packages() below + call this%set_tsp_labels(this%macronym, dvt, dvu, dvua) + ! model => this call AddBaseModelToList(basemodellist, model) ! @@ -116,16 +123,12 @@ end subroutine gwt_cr subroutine gwt_df(this) ! -- modules use ModelPackageInputsModule, only: NIUNIT_GWT - use TspLabelsModule, only: setTspLabels ! -- dummy class(GwtModelType) :: this ! -- local integer(I4B) :: ip class(BndType), pointer :: packobj ! ------------------------------------------------------------------------------ - ! - ! -- Set labels to be used with transport model - call this%tsplab%setTspLabels(this%macronym, 'CONCENTRATION', 'MASS', 'M') ! ! -- Define packages and utility objects call this%dis%dis_df() @@ -135,8 +138,8 @@ subroutine gwt_df(this) if (this%indsp > 0) call this%dsp%dsp_df(this%dis) if (this%inssm > 0) call this%ssm%ssm_df() call this%oc%oc_df() - call this%budget%budget_df(niunit, this%tsplab%depvarunit, & - this%tsplab%depvarunitabbrev) + call this%budget%budget_df(niunit, this%depvarunit, & + this%depvarunitabbrev) ! ! -- Assign or point model members to dis members this%neq = this%dis%nodes @@ -257,7 +260,7 @@ subroutine gwt_ar(this) !call this%dis%dis_ar(this%npf%icelltype) ! ! -- set up output control - call this%oc%oc_ar(this%x, this%dis, DHNOFLO, this%tsplab%depvartype) + call this%oc%oc_ar(this%x, this%dis, DHNOFLO, this%depvartype) call this%budget%set_ibudcsv(this%oc%ibudcsv) ! ! -- Package input files now open, so allocate and read @@ -616,7 +619,6 @@ subroutine gwt_da(this) call this%budget%budget_da() call this%oc%oc_da() call this%obs%obs_da() - call this%tsplab%tsplabels_da() ! ! -- Internal package objects deallocate (this%dis) @@ -630,7 +632,6 @@ subroutine gwt_da(this) deallocate (this%budget) deallocate (this%oc) deallocate (this%obs) - deallocate (this%tsplab) ! ! -- Boundary packages do ip = 1, this%bndlist%Count() @@ -639,7 +640,7 @@ subroutine gwt_da(this) deallocate (packobj) end do ! - ! -- Scalars + ! -- Parent class members call this%TransportModelType%tsp_da() ! ! -- NumericalModelType @@ -770,22 +771,22 @@ subroutine package_create(this, filtyp, ipakid, ipaknum, pakname, inunit, & select case (filtyp) case ('CNC6') call cnc_create(packobj, ipakid, ipaknum, inunit, iout, this%name, & - pakname, this%tsplab, this%eqnsclfac) + pakname, this%eqnsclfac, dvt) case ('SRC6') call src_create(packobj, ipakid, ipaknum, inunit, iout, this%name, & - pakname, this%tsplab) + pakname, dvt) case ('LKT6') call lkt_create(packobj, ipakid, ipaknum, inunit, iout, this%name, & - pakname, this%fmi, this%tsplab, this%eqnsclfac) + pakname, this%fmi, this%eqnsclfac, dvt, dvu, dvua) case ('SFT6') call sft_create(packobj, ipakid, ipaknum, inunit, iout, this%name, & - pakname, this%fmi, this%tsplab, this%eqnsclfac) + pakname, this%fmi, this%eqnsclfac, dvt, dvu, dvua) case ('MWT6') call mwt_create(packobj, ipakid, ipaknum, inunit, iout, this%name, & - pakname, this%fmi, this%tsplab, this%eqnsclfac) + pakname, this%fmi, this%eqnsclfac, dvt, dvu, dvua) case ('UZT6') call uzt_create(packobj, ipakid, ipaknum, inunit, iout, this%name, & - pakname, this%fmi, this%tsplab, this%eqnsclfac) + pakname, this%fmi, this%eqnsclfac, dvt, dvu, dvua) case ('IST6') call ist_create(packobj, ipakid, ipaknum, inunit, iout, this%name, & pakname, this%fmi, this%mst) diff --git a/src/Model/GroundWaterTransport/gwt1lkt1.f90 b/src/Model/GroundWaterTransport/gwt1lkt1.f90 index e9559070def..d1392af7b7c 100644 --- a/src/Model/GroundWaterTransport/gwt1lkt1.f90 +++ b/src/Model/GroundWaterTransport/gwt1lkt1.f90 @@ -34,7 +34,7 @@ module GwtLktModule use KindModule, only: DP, I4B - use ConstantsModule, only: DZERO, DONE, LINELENGTH + use ConstantsModule, only: DZERO, DONE, LINELENGTH, LENVARNAME use SimModule, only: store_error use BndModule, only: BndType, GetBndFromList use TspFmiModule, only: TspFmiType @@ -42,7 +42,6 @@ module GwtLktModule use ObserveModule, only: ObserveType use TspAptModule, only: TspAptType, apt_process_obsID, & apt_process_obsID12 - use TspLabelsModule, only: TspLabelsType use MatrixBaseModule implicit none @@ -96,7 +95,8 @@ module GwtLktModule !> @brief Create a new lkt package !< subroutine lkt_create(packobj, id, ibcnum, inunit, iout, namemodel, pakname, & - fmi, tsplab, eqnsclfac) + fmi, eqnsclfac, depvartype, depvarunit, & + depvarunitabbrev) ! -- dummy class(BndType), pointer :: packobj integer(I4B), intent(in) :: id @@ -106,8 +106,10 @@ subroutine lkt_create(packobj, id, ibcnum, inunit, iout, namemodel, pakname, & character(len=*), intent(in) :: namemodel character(len=*), intent(in) :: pakname type(TspFmiType), pointer :: fmi - type(TspLabelsType), pointer :: tsplab real(DP), intent(in), pointer :: eqnsclfac !< governing equation scale factor + character(len=LENVARNAME), intent(in) :: depvartype + character(len=LENVARNAME), intent(in) :: depvarunit + character(len=LENVARNAME), intent(in) :: depvarunitabbrev ! -- local type(GwtLktType), pointer :: lktobj ! ------------------------------------------------------------------------------ @@ -132,15 +134,16 @@ subroutine lkt_create(packobj, id, ibcnum, inunit, iout, namemodel, pakname, & packobj%ibcnum = ibcnum packobj%ncolbnd = 1 packobj%iscloc = 1 - + ! ! -- Store pointer to flow model interface. When the GwfGwt exchange is ! created, it sets fmi%bndlist so that the GWT model has access to all ! the flow packages lktobj%fmi => fmi ! - ! -- Store pointer to the labels module for dynamic setting of - ! concentration vs temperature - lktobj%tsplab => tsplab + ! -- Store labels for dynamic setting of concentration vs temperature + lktobj%depvartype = depvartype + lktobj%depvarunit = depvarunit + lktobj%depvarunitabbrev = depvarunitabbrev ! ! -- Store pointer to governing equation scale factor lktobj%eqnsclfac => eqnsclfac diff --git a/src/Model/GroundWaterTransport/gwt1mwt1.f90 b/src/Model/GroundWaterTransport/gwt1mwt1.f90 index c3abcd269c1..2c895009d45 100644 --- a/src/Model/GroundWaterTransport/gwt1mwt1.f90 +++ b/src/Model/GroundWaterTransport/gwt1mwt1.f90 @@ -35,7 +35,7 @@ module GwtMwtModule use KindModule, only: DP, I4B - use ConstantsModule, only: DZERO, LINELENGTH + use ConstantsModule, only: DZERO, LINELENGTH, LENVARNAME use SimModule, only: store_error use BndModule, only: BndType, GetBndFromList use TspFmiModule, only: TspFmiType @@ -43,7 +43,6 @@ module GwtMwtModule use ObserveModule, only: ObserveType use TspAptModule, only: TspAptType, apt_process_obsID, & apt_process_obsID12 - use TspLabelsModule, only: TspLabelsType use MatrixBaseModule implicit none @@ -89,7 +88,8 @@ module GwtMwtModule !> Create new MWT package !< subroutine mwt_create(packobj, id, ibcnum, inunit, iout, namemodel, pakname, & - fmi, tsplab, eqnsclfac) + fmi, eqnsclfac, depvartype, depvarunit, & + depvarunitabbrev) ! -- dummy class(BndType), pointer :: packobj integer(I4B), intent(in) :: id @@ -99,8 +99,10 @@ subroutine mwt_create(packobj, id, ibcnum, inunit, iout, namemodel, pakname, & character(len=*), intent(in) :: namemodel character(len=*), intent(in) :: pakname type(TspFmiType), pointer :: fmi - type(TspLabelsType), pointer :: tsplab real(DP), intent(in), pointer :: eqnsclfac !< governing equation scale factor + character(len=LENVARNAME), intent(in) :: depvartype + character(len=LENVARNAME), intent(in) :: depvarunit + character(len=LENVARNAME), intent(in) :: depvarunitabbrev ! -- local type(GwtMwtType), pointer :: mwtobj ! ------------------------------------------------------------------------------ @@ -131,9 +133,10 @@ subroutine mwt_create(packobj, id, ibcnum, inunit, iout, namemodel, pakname, & ! the flow packages mwtobj%fmi => fmi ! - ! -- Store pointer to the labels module for dynamic setting of - ! concentration vs temperature - mwtobj%tsplab => tsplab + ! -- Store labels for dynamic setting of concentration vs temperature + mwtobj%depvartype = depvartype + mwtobj%depvarunit = depvarunit + mwtobj%depvarunitabbrev = depvarunitabbrev ! ! -- Store pointer to governing equation scale factor mwtobj%eqnsclfac => eqnsclfac diff --git a/src/Model/GroundWaterTransport/gwt1sft1.f90 b/src/Model/GroundWaterTransport/gwt1sft1.f90 index 1a1262e7c40..03d89c4692a 100644 --- a/src/Model/GroundWaterTransport/gwt1sft1.f90 +++ b/src/Model/GroundWaterTransport/gwt1sft1.f90 @@ -33,7 +33,7 @@ module GwtSftModule use KindModule, only: DP, I4B - use ConstantsModule, only: DZERO, DONE, LINELENGTH + use ConstantsModule, only: DZERO, DONE, LINELENGTH, LENVARNAME use SimModule, only: store_error use BndModule, only: BndType, GetBndFromList use TspFmiModule, only: TspFmiType @@ -41,7 +41,6 @@ module GwtSftModule use ObserveModule, only: ObserveType use TspAptModule, only: TspAptType, apt_process_obsID, & apt_process_obsID12 - use TspLabelsModule, only: TspLabelsType use MatrixBaseModule implicit none @@ -93,7 +92,8 @@ module GwtSftModule !> @brief Create a new sft package !< subroutine sft_create(packobj, id, ibcnum, inunit, iout, namemodel, pakname, & - fmi, tsplab, eqnsclfac) + fmi, eqnsclfac, depvartype, depvarunit, & + depvarunitabbrev) ! -- dummy class(BndType), pointer :: packobj integer(I4B), intent(in) :: id @@ -103,8 +103,10 @@ subroutine sft_create(packobj, id, ibcnum, inunit, iout, namemodel, pakname, & character(len=*), intent(in) :: namemodel character(len=*), intent(in) :: pakname type(TspFmiType), pointer :: fmi - type(TspLabelsType), pointer :: tsplab real(DP), intent(in), pointer :: eqnsclfac !< governing equation scale factor + character(len=LENVARNAME), intent(in) :: depvartype + character(len=LENVARNAME), intent(in) :: depvarunit + character(len=LENVARNAME), intent(in) :: depvarunitabbrev ! -- local type(GwtSftType), pointer :: sftobj ! ------------------------------------------------------------------------------ @@ -138,9 +140,10 @@ subroutine sft_create(packobj, id, ibcnum, inunit, iout, namemodel, pakname, & ! -- Store pointer to governing equation scale factor sftobj%eqnsclfac => eqnsclfac ! - ! -- Store pointer to the labels module for dynamic setting of - ! concentration vs temperature - sftobj%tsplab => tsplab + ! -- Store labels for dynamic setting of concentration vs temperature + sftobj%depvartype = depvartype + sftobj%depvarunit = depvarunit + sftobj%depvarunitabbrev = depvarunitabbrev ! ! -- Return return diff --git a/src/Model/GroundWaterTransport/gwt1src1.f90 b/src/Model/GroundWaterTransport/gwt1src1.f90 index b7a100f087a..505eebf49d5 100644 --- a/src/Model/GroundWaterTransport/gwt1src1.f90 +++ b/src/Model/GroundWaterTransport/gwt1src1.f90 @@ -1,9 +1,8 @@ module GwtSrcModule ! use KindModule, only: DP, I4B - use ConstantsModule, only: DZERO, DEM1, DONE, LENFTYPE + use ConstantsModule, only: DZERO, DEM1, DONE, LENFTYPE, LENVARNAME use BndModule, only: BndType - use TspLabelsModule, only: TspLabelsType use ObsModule, only: DefaultObsIdProcessor use TimeSeriesLinkModule, only: TimeSeriesLinkType, & GetTimeSeriesLinkFromList @@ -19,7 +18,11 @@ module GwtSrcModule character(len=16) :: text = ' SRC' ! type, extends(BndType) :: GwtSrcType + + character(len=LENVARNAME) :: depvartype = '' !< stores string of dependent variable type, depending on model type + contains + procedure :: allocate_scalars => src_allocate_scalars procedure :: bnd_cf => src_cf procedure :: bnd_fc => src_fc @@ -30,6 +33,7 @@ module GwtSrcModule procedure, public :: bnd_df_obs => src_df_obs ! -- methods for time series procedure, public :: bnd_rp_ts => src_rp_ts + end type GwtSrcType contains @@ -39,7 +43,7 @@ module GwtSrcModule !! This subroutine points bndobj to the newly created package !< subroutine src_create(packobj, id, ibcnum, inunit, iout, namemodel, pakname, & - tsplab) + depvartype) ! -- dummy class(BndType), pointer :: packobj integer(I4B), intent(in) :: id @@ -48,7 +52,7 @@ subroutine src_create(packobj, id, ibcnum, inunit, iout, namemodel, pakname, & integer(I4B), intent(in) :: iout character(len=*), intent(in) :: namemodel character(len=*), intent(in) :: pakname - type(TspLabelsType), pointer :: tsplab + character(len=LENVARNAME), intent(in) :: depvartype ! -- local type(GwtSrcType), pointer :: srcobj ! ------------------------------------------------------------------------------ @@ -74,9 +78,8 @@ subroutine src_create(packobj, id, ibcnum, inunit, iout, namemodel, pakname, & packobj%ncolbnd = 1 packobj%iscloc = 1 ! - ! -- Store pointer to labels associated with the current model so that the - ! package has access to the assigned labels - packobj%tsplab => tsplab + ! -- Store the appropriate label based on the dependent variable + srcobj%depvartype = depvartype ! ! -- Return return diff --git a/src/Model/GroundWaterTransport/gwt1uzt1.f90 b/src/Model/GroundWaterTransport/gwt1uzt1.f90 index 37c369ff1fa..fa359d2aa46 100644 --- a/src/Model/GroundWaterTransport/gwt1uzt1.f90 +++ b/src/Model/GroundWaterTransport/gwt1uzt1.f90 @@ -27,7 +27,7 @@ module GwtUztModule use KindModule, only: DP, I4B - use ConstantsModule, only: DZERO, DONE, LINELENGTH + use ConstantsModule, only: DZERO, DONE, LINELENGTH, LENVARNAME use SimModule, only: store_error use BndModule, only: BndType, GetBndFromList use TspFmiModule, only: TspFmiType @@ -35,7 +35,6 @@ module GwtUztModule use ObserveModule, only: ObserveType use TspAptModule, only: TspAptType, apt_process_obsID, & apt_process_obsID12 - use TspLabelsModule, only: TspLabelsType use MatrixBaseModule implicit none @@ -81,7 +80,8 @@ module GwtUztModule !> @brief Create a new UZT package !< subroutine uzt_create(packobj, id, ibcnum, inunit, iout, namemodel, pakname, & - fmi, tsplab, eqnsclfac) + fmi, eqnsclfac, depvartype, depvarunit, & + depvarunitabbrev) ! -- dummy class(BndType), pointer :: packobj integer(I4B), intent(in) :: id @@ -91,8 +91,10 @@ subroutine uzt_create(packobj, id, ibcnum, inunit, iout, namemodel, pakname, & character(len=*), intent(in) :: namemodel character(len=*), intent(in) :: pakname type(TspFmiType), pointer :: fmi - type(TspLabelsType), pointer :: tsplab !< class bearing appropriate labels depending on the transport model type real(DP), intent(in), pointer :: eqnsclfac !< governing equation scale factor + character(len=LENVARNAME), intent(in) :: depvartype + character(len=LENVARNAME), intent(in) :: depvarunit + character(len=LENVARNAME), intent(in) :: depvarunitabbrev ! -- local type(GwtUztType), pointer :: uztobj ! ------------------------------------------------------------------------------ @@ -123,9 +125,10 @@ subroutine uzt_create(packobj, id, ibcnum, inunit, iout, namemodel, pakname, & ! the flow packages uztobj%fmi => fmi ! - ! -- Store pointer to the labels module for dynamic setting of - ! concentration vs temperature - uztobj%tsplab => tsplab + ! -- Store labels for dynamic setting of concentration vs temperature + uztobj%depvartype = depvartype + uztobj%depvarunit = depvarunit + uztobj%depvarunitabbrev = depvarunitabbrev ! ! -- Store pointer to governing equation scale factor uztobj%eqnsclfac => eqnsclfac diff --git a/src/Model/ModelUtilities/GweInputData.f90 b/src/Model/ModelUtilities/GweInputData.f90 index 32e388321d7..15cbbb7900c 100644 --- a/src/Model/ModelUtilities/GweInputData.f90 +++ b/src/Model/ModelUtilities/GweInputData.f90 @@ -85,7 +85,7 @@ end subroutine gweshared_dat_df subroutine allocate_shared_vars(this, nodes) ! -- modules ! -- dummy - class(GweInputDataType) :: this !< TspLabelsType object + class(GweInputDataType) :: this !< GweCommon object integer(I4B), intent(in) :: nodes ! -- local integer(I4B) :: i diff --git a/src/Model/ModelUtilities/TspLabels.f90 b/src/Model/ModelUtilities/TspLabels.f90 deleted file mode 100644 index 11e699a92d2..00000000000 --- a/src/Model/ModelUtilities/TspLabels.f90 +++ /dev/null @@ -1,169 +0,0 @@ -!> @brief This module contains the TspLabels Module -!! -!! A generic module containing the labels used by -!! the generalized TransportModel module that assigns -!! labeling based on which type of transport model an -!! instance of this module is associated with (GWT or -!! GWE) -!! -!! Labels that need to be transport model type specific: -!! -!! GWT | GWE | src files w/label -!! -----------------|-------------------|-------------- -!! "Concentration" |"Temperature" | gwt1.f90/gwe1.f90 -!! | | gwt1apt1.f90 -!! | | gwt1cnc1.f90 -!! | | gwt1ist1.f90 -!! | | gwt1lkt1.f90 -!! | | gwt1mst1.f90 -!! | | gwt1obs1.f90 -!! | | gwt1oc1.f90 -!! | | gwt1sft1.f90 (?) -!! | | gwt1ssm1.f90 -!! | | gwt1fmi1.f90 -!! | | tsp1ic1.f90 -!! | | GwtSpc.f90 -!! "Cumulative Mass"|"Cumulative Energy"| Budget.f90 (_ot routine) -!! "MASS", "M" |"ENERGY", "E" | gwt1.f90 (gwt_df routine & _ot routine) -!! "M/T" |"Watts" (?) | -!! "M" |"Joules" or "E" | -!< -module TspLabelsModule - - use KindModule, only: DP, LGP, I4B - use ConstantsModule, only: LENVARNAME - - implicit none - private - public :: TspLabelsType - public :: tsplabels_cr - public :: setTspLabels - - !> @brief Define labels for use with generalized transport model - !! - !! Subroutine to store which type of units are in use since a - !! generalized transport model is the base clase for either a - !! solute transport (GWT) or heat transport (GWE) - !! - !< - type TspLabelsType - - character(len=LENVARNAME), pointer :: modname => null() !< name of the model that module is associated with - character(len=LENVARNAME), pointer :: tsptype => null() !< "solute" or "heat" - character(len=LENVARNAME), pointer :: depvartype => null() !< "concentration" or "temperature" - character(len=LENVARNAME), pointer :: depvarunit => null() !< "mass" or "energy" - character(len=LENVARNAME), pointer :: depvarunitabbrev => null() !< "M" or "J" - - contains - !-- public - procedure, public :: setTspLabels - procedure, public :: tsplabels_da - ! -- private - procedure :: allocate_label_names - - end type TspLabelsType - -contains - - !> @brief Create a new transport labels object - !! - !! Create a new labels object - !! - !< - subroutine tsplabels_cr(this, name_model) - ! -- modules - ! -- dummy variables - type(TspLabelsType), pointer :: this !< TspLabelsType object - character(len=*), intent(in) :: name_model !< name of the model - ! ------------------------------------------------------------------- - ! - ! -- Create the object - allocate (this) - ! -- local variables - ! - ! -- Allocate variable names - call this%allocate_label_names(name_model) - ! - ! -- Return - return - end subroutine tsplabels_cr - - !> @brief Define the labels corresponding to the flavor of - !! transport model - !! - !! Set variable names according to type of transport model - !! - !< - subroutine setTspLabels(this, tsptype, depvartype, depvarunit, depvarunitabbrev) - class(TspLabelsType) :: this - character(len=*), intent(in) :: tsptype !< type of model, default is GWT (alternative is GWE) - character(len=*), intent(in) :: depvartype !< dependent variable type, default is "CONCENTRATION" - character(len=*), intent(in) :: depvarunit !< units of dependent variable for writing to list file - character(len=*), intent(in) :: depvarunitabbrev !< abbreviation of associated units - ! - ! -- Set the model type - this%tsptype = tsptype - ! - ! -- Set the type of dependent variable being solved for - this%depvartype = depvartype - ! - ! -- Set the units associated with the dependent variable - this%depvarunit = depvarunit - ! - ! -- Set the units abbreviation - this%depvarunitabbrev = depvarunitabbrev - ! - ! -- Return - return - end subroutine setTspLabels - - !> @brief Define the information this object holds - !! - !! Allocate strings for storing label names - !! Intended to be analogous to allocate_scalars() - !! - !< - subroutine allocate_label_names(this, name_model) - ! -- modules - ! -- dummy - class(TspLabelsType) :: this !< TspLabelsType object - character(len=*), intent(in) :: name_model !< name of the model - ! - allocate (this%modname) - allocate (this%tsptype) - allocate (this%depvartype) - allocate (this%depvarunit) - allocate (this%depvarunitabbrev) - ! - ! -- Initialize values - this%tsptype = '' - this%depvartype = '' - this%depvarunit = '' - this%depvarunitabbrev = '' - ! - ! -- Initialize model name that labels module is associated with - this%modname = name_model - ! - return - end subroutine allocate_label_names - - !> @ brief Deallocate memory - !! - !! Deallocate memory - !! - !< - subroutine tsplabels_da(this) - class(TspLabelsType) :: this !< TspLabelsType object - ! - ! -- Strings - deallocate (this%modname) - deallocate (this%tsptype) - deallocate (this%depvartype) - deallocate (this%depvarunit) - deallocate (this%depvarunitabbrev) - ! - ! -- Return - return - end subroutine tsplabels_da - -end module TspLabelsModule diff --git a/src/Model/NumericalPackage.f90 b/src/Model/NumericalPackage.f90 index 9afe726d1a3..114256a4778 100644 --- a/src/Model/NumericalPackage.f90 +++ b/src/Model/NumericalPackage.f90 @@ -15,7 +15,6 @@ module NumericalPackageModule use BlockParserModule, only: BlockParserType use BaseDisModule, only: DisBaseType use MemoryHelperModule, only: create_mem_path - use TspLabelsModule, only: TspLabelsType implicit none private @@ -49,9 +48,6 @@ module NumericalPackageModule ! -- derived types type(BlockParserType) :: parser !< parser object for reading blocks of information class(DisBaseType), pointer :: dis => null() !< model discretization object - ! - ! -- labels - type(TspLabelsType), pointer :: tsplab => null() contains procedure :: set_names diff --git a/src/Model/TransportModel/tsp1.f90 b/src/Model/TransportModel/tsp1.f90 index 0d019921cee..7db6fba2dca 100644 --- a/src/Model/TransportModel/tsp1.f90 +++ b/src/Model/TransportModel/tsp1.f90 @@ -6,16 +6,41 @@ ! * Consider implementation of steady-state transport (affects MST, IST) ! * Check and handle pore space discrepancy between flow and transport (porosity vs specific yield) ! * UZT may not have the required porosity term +! +! This classes uses strings for storing labels used by different parts of the +! code. Labels are based on which type of transport model inherits +! from this module (GWT or GWE) +! +! Labels that are transport model specific and used in different packages: +! +! GWT | GWE | src files w/label +! -----------------|-------------------|-------------- +! "Concentration" |"Temperature" | gwt1.f90/gwe1.f90 +! | | gwt1apt1.f90 +! | | gwt1cnc1.f90 +! | | gwt1ist1.f90 +! | | gwt1lkt1.f90 +! | | gwt1mst1.f90 +! | | gwt1obs1.f90 +! | | gwt1oc1.f90 +! | | gwt1sft1.f90 (?) +! | | gwt1ssm1.f90 +! | | gwt1fmi1.f90 +! | | tsp1ic1.f90 +! | | GwtSpc.f90 +! "Cumulative Mass"|"Cumulative Energy"| Budget.f90 (_ot routine) +! "MASS", "M" |"ENERGY", "E" | gwt1.f90 (gwt_df routine & _ot routine) +! "M/T" |"Watts" (?) | +! "M" |"Joules" or "E" | module TransportModelModule use KindModule, only: DP, I4B use InputOutputModule, only: ParseLine use VersionModule, only: write_listfile_header - use ConstantsModule, only: LENFTYPE, DZERO, LENPAKLOC, LENMEMPATH + use ConstantsModule, only: LENFTYPE, DZERO, LENPAKLOC, LENMEMPATH, LENVARNAME use SimVariablesModule, only: errmsg use NumericalModelModule, only: NumericalModelType use NumericalPackageModule, only: NumericalPackageType - use TspLabelsModule, only: TspLabelsType use BndModule, only: BndType, GetBndFromList use TspIcModule, only: TspIcType use TspFmiModule, only: TspFmiType @@ -45,7 +70,6 @@ module TransportModelModule type(TspObsType), pointer :: obs => null() !< observation package type(TspOcType), pointer :: oc => null() !< output control package type(TspSsmType), pointer :: ssm => null() !< source sink mixing package - type(TspLabelsType), pointer :: tsplab => null() !< object defining the appropriate labels type(BudgetType), pointer :: budget => null() !< budget object integer(I4B), pointer :: inic => null() !< unit number IC integer(I4B), pointer :: infmi => null() !< unit number FMI @@ -55,11 +79,17 @@ module TransportModelModule integer(I4B), pointer :: inoc => null() !< unit number OC integer(I4B), pointer :: inobs => null() !< unit number OBS real(DP), pointer :: eqnsclfac => null() !< constant factor by which all terms in the model's governing equation are scaled (divided) for formulation and solution + ! Labels that will be defined + character(len=LENVARNAME) :: tsptype = '' !< "solute" or "heat" + character(len=LENVARNAME) :: depvartype = '' !< "concentration" or "temperature" + character(len=LENVARNAME) :: depvarunit = '' !< "mass" or "energy" + character(len=LENVARNAME) :: depvarunitabbrev = '' !< "M" or "J" contains ! -- public - procedure :: allocate_tsp_scalars + procedure, public :: allocate_tsp_scalars + procedure, public :: set_tsp_labels procedure, public :: ftype_check procedure, public :: tsp_cr procedure, public :: tsp_df @@ -74,6 +104,7 @@ module TransportModelModule procedure, public :: tsp_cq procedure, public :: tsp_bd procedure, public :: tsp_ot + ! -- private procedure, private :: tsp_ot_obs procedure, private :: tsp_ot_flow procedure, private :: tsp_ot_flowja @@ -110,7 +141,6 @@ subroutine tsp_cr(this, filename, id, modelname, macronym, indis, gwecommon) use MemoryManagerExtModule, only: mem_set_value use SimVariablesModule, only: idm_context use GwfNamInputModule, only: GwfNamParamFoundType - use TspLabelsModule, only: tsplabels_cr use GwfDisModule, only: dis_cr use GwfDisvModule, only: disv_cr use GwfDisuModule, only: disu_cr @@ -163,16 +193,13 @@ subroutine tsp_cr(this, filename, id, modelname, macronym, indis, gwecommon) this%ipakcb = -1 end if ! - ! -- Instantiate generalized labels - call tsplabels_cr(this%tsplab, this%name) - ! ! -- log set options if (this%iout > 0) then call this%log_namfile_options(found) end if ! ! -- Create utility objects - call budget_cr(this%budget, this%name, this%tsplab) + call budget_cr(this%budget, this%name) ! ! -- create model packages if (present(gwecommon)) then @@ -383,8 +410,8 @@ subroutine tsp_ot(this, inmst) idvprint = 0 icbcfl = 0 ibudfl = 0 - if (this%oc%oc_save(trim(this%tsplab%depvartype))) idvsave = 1 - if (this%oc%oc_print(trim(this%tsplab%depvartype))) idvprint = 1 + if (this%oc%oc_save(trim(this%depvartype))) idvsave = 1 + if (this%oc%oc_print(trim(this%depvartype))) idvprint = 1 if (this%oc%oc_save('BUDGET')) icbcfl = 1 if (this%oc%oc_print('BUDGET')) ibudfl = 1 icbcun = this%oc%oc_save_unit('BUDGET') @@ -392,7 +419,7 @@ subroutine tsp_ot(this, inmst) ! -- Override ibudfl and idvprint flags for nonconvergence ! and end of period ibudfl = this%oc%set_print_flag('BUDGET', this%icnvg, endofperiod) - idvprint = this%oc%set_print_flag(trim(this%tsplab%depvartype), & + idvprint = this%oc%set_print_flag(trim(this%depvartype), & this%icnvg, endofperiod) ! ! Calculate and save observations @@ -635,6 +662,35 @@ subroutine allocate_tsp_scalars(this, modelname) return end subroutine allocate_tsp_scalars + !> @brief Define the labels corresponding to the flavor of + !! transport model + !! + !! Set variable names according to type of transport model + !< + subroutine set_tsp_labels(this, tsptype, depvartype, depvarunit, & + depvarunitabbrev) + class(TransportModelType) :: this + character(len=*), intent(in), pointer :: tsptype !< type of model, default is GWT (alternative is GWE) + character(len=*), intent(in) :: depvartype !< dependent variable type, default is "CONCENTRATION" + character(len=*), intent(in) :: depvarunit !< units of dependent variable for writing to list file + character(len=*), intent(in) :: depvarunitabbrev !< abbreviation of associated units + ! + ! -- Set the model type + this%tsptype = tsptype + ! + ! -- Set the type of dependent variable being solved for + this%depvartype = depvartype + ! + ! -- Set the units associated with the dependent variable + this%depvarunit = depvarunit + ! + ! -- Set the units abbreviation + this%depvarunitabbrev = depvarunitabbrev + ! + ! -- Return + return + end subroutine set_tsp_labels + !> @brief Deallocate memory !! !! Deallocate memmory at conclusion of model run @@ -882,13 +938,14 @@ subroutine create_packages(this, indis, gwecommon) end do ! ! -- Create packages that are tied directly to model - call ic_cr(this%ic, this%name, this%inic, this%iout, this%dis, this%tsplab) - call fmi_cr(this%fmi, this%name, this%infmi, this%iout, this%tsplab, & - this%eqnsclfac) + call ic_cr(this%ic, this%name, this%inic, this%iout, this%dis, & + this%depvartype) + call fmi_cr(this%fmi, this%name, this%infmi, this%iout, this%eqnsclfac, & + this%depvartype) call adv_cr(this%adv, this%name, this%inadv, this%iout, this%fmi, & this%eqnsclfac) call ssm_cr(this%ssm, this%name, this%inssm, this%iout, this%fmi, & - this%tsplab, this%eqnsclfac, gwecommon) + this%eqnsclfac, this%depvartype, gwecommon) call mvt_cr(this%mvt, this%name, this%inmvt, this%iout, this%fmi, & this%eqnsclfac) call oc_cr(this%oc, this%name, this%inoc, this%iout) diff --git a/src/Model/TransportModel/tsp1apt1.f90 b/src/Model/TransportModel/tsp1apt1.f90 index 5a6d203db14..07dec873f1b 100644 --- a/src/Model/TransportModel/tsp1apt1.f90 +++ b/src/Model/TransportModel/tsp1apt1.f90 @@ -40,7 +40,7 @@ module TspAptModule LENBOUNDNAME, LENPACKAGENAME, NAMEDBOUNDFLAG, & DNODATA, TABLEFT, TABCENTER, TABRIGHT, & TABSTRING, TABUCSTRING, TABINTEGER, TABREAL, & - LENAUXNAME + LENAUXNAME, LENVARNAME use SimModule, only: store_error, store_error_unit, count_errors use SimVariablesModule, only: errmsg use BndModule, only: BndType @@ -61,6 +61,7 @@ module TspAptModule character(len=LENFTYPE) :: ftype = 'APT' character(len=16) :: text = ' APT' + character(len=LENVARNAME) :: tsptype = 'GWT' !< to be removed once TSP refactor is further sorted out type, extends(BndType) :: TspAptType @@ -111,6 +112,9 @@ module TspAptModule real(DP), dimension(:, :), pointer, contiguous :: concbudssm => null() !< user specified concentrations (or temperatures) for flow terms real(DP), dimension(:), pointer, contiguous :: qmfrommvr => null() !< a mass or energy flow coming from the mover that needs to be added real(DP), pointer :: eqnsclfac => null() !< governing equation scale factor; =1. for solute; =rhow*cpw for energy + character(len=LENVARNAME) :: depvartype = '' !< stores string identifying dependent variable type, depending on model type + character(len=LENVARNAME) :: depvarunit = '' !< "mass" or "energy" + character(len=LENVARNAME) :: depvarunitabbrev = '' !< "M" or "J" ! ! -- pointer to flow package boundary type(BndType), pointer :: flowpackagebnd => null() @@ -551,7 +555,7 @@ subroutine apt_set_stressperiod(this, itemno) bndElem => this%concfeat(itemno) call read_value_or_time_series_adv(text, itemno, jj, bndElem, & this%packName, 'BND', this%tsManager, & - this%iprpak, this%tsplab%depvartype) + this%iprpak, this%depvartype) case ('AUXILIARY') ierr = this%apt_check_valid(itemno) if (ierr /= 0) then @@ -1064,7 +1068,7 @@ subroutine apt_ot_dv(this, idvsave, idvprint) end if this%dbuff(n) = c end do - write (text, '(a)') padl(this%tsplab%depvartype, 16) + write (text, '(a)') padl(this%depvartype, 16) call ulasav(this%dbuff, text, kstp, kper, pertim, totim, & this%ncv, 1, 1, ibinun) end if @@ -1426,7 +1430,7 @@ subroutine apt_options(this, option, found) case ('PRINT_CONCENTRATION', 'PRINT_TEMPERATURE') this%iprconc = 1 write (this%iout, '(4x,a,1x,a,1x,a)') trim(adjustl(this%text))// & - trim(adjustl(this%tsplab%depvartype))//'S WILL BE PRINTED TO LISTING & + trim(adjustl(this%depvartype))//'S WILL BE PRINTED TO LISTING & &FILE.' case ('CONCENTRATION', 'TEMPERATURE') call this%parser%GetStringCaps(keyword) @@ -1436,11 +1440,11 @@ subroutine apt_options(this, option, found) call openfile(this%iconcout, this%iout, fname, 'DATA(BINARY)', & form, access, 'REPLACE') write (this%iout, fmtaptbin) & - trim(adjustl(this%text)), trim(adjustl(this%tsplab%depvartype)), & + trim(adjustl(this%text)), trim(adjustl(this%depvartype)), & trim(fname), this%iconcout else write (errmsg, "('Optional', 1x, a, 1X, 'keyword must & - &be followed by FILEOUT')") this%tsplab%depvartype + &be followed by FILEOUT')") this%depvartype call store_error(errmsg) end if case ('BUDGET') @@ -1647,7 +1651,7 @@ subroutine apt_read_cvs(this) this%strt(n) = this%parser%GetDouble() ! ! -- if GWE model, read additional thermal conductivity terms - if (this%tsplab%tsptype == 'GWE') then + if (tsptype == 'GWE') then ! skip for UZE if (trim(adjustl(this%text)) /= 'UZE') then this%ktf(n) = this%parser%GetDouble() @@ -2077,7 +2081,7 @@ subroutine apt_setup_budobj(this) ! -- set up budobj call budgetobject_cr(this%budobj, this%packName) ! - bddim_opt = this%tsplab%depvarunitabbrev + bddim_opt = this%depvarunitabbrev call this%budobj%budgetobject_df(this%ncv, nbudterm, 0, 0, & bddim_opt=bddim_opt, ibudcsv=this%ibudcsv) idx = 0 @@ -2137,7 +2141,7 @@ subroutine apt_setup_budobj(this) idx = idx + 1 maxlist = this%flowbudptr%budterm(this%idxbudsto)%maxlist naux = 1 - write (textt, '(a)') padl(this%tsplab%depvarunit, 16) + write (textt, '(a)') padl(this%depvarunit, 16) auxtxt(1) = textt ! ' MASS' or ' ENERGY' call this%budobj%budterm(idx)%initialize(text, & this%name_model, & @@ -2855,7 +2859,7 @@ subroutine apt_rp_obs(this) ! by a boundname that is assigned to more than one element if (obsrv%indxbnds_count > 1) then write (errmsg, '(a, a, a, a)') & - trim(adjustl(this%tsplab%depvartype))// & + trim(adjustl(this%depvartype))// & ' for observation', trim(adjustl(obsrv%Name)), & ' must be assigned to a feature with a unique boundname.' call store_error(errmsg) @@ -3151,7 +3155,7 @@ subroutine apt_setup_tableobj(this) ! -- set up table title title = trim(adjustl(this%text))//' PACKAGE ('// & trim(adjustl(this%packName))// & - ') '//trim(adjustl(this%tsplab%depvartype))// & + ') '//trim(adjustl(this%depvartype))// & &' FOR EACH CONTROL VOLUME' ! ! -- set up dv tableobj @@ -3171,7 +3175,7 @@ subroutine apt_setup_tableobj(this) ! ! -- feature conc !text_temp = 'CONC' - text_temp = this%tsplab%depvartype(1:4) + text_temp = this%depvartype(1:4) call this%dvtab%initialize_column(text_temp, 12, alignment=TABCENTER) end if ! diff --git a/src/Model/TransportModel/tsp1cnc1.f90 b/src/Model/TransportModel/tsp1cnc1.f90 index 8157b4827ec..bc77fc921a0 100644 --- a/src/Model/TransportModel/tsp1cnc1.f90 +++ b/src/Model/TransportModel/tsp1cnc1.f90 @@ -5,7 +5,6 @@ module TspCncModule LENPACKAGENAME, LENVARNAME use ObsModule, only: DefaultObsIdProcessor use BndModule, only: BndType - use TspLabelsModule, only: TspLabelsType use ObserveModule, only: ObserveType use TimeSeriesLinkModule, only: TimeSeriesLinkType, & GetTimeSeriesLinkFromList @@ -27,6 +26,7 @@ module TspCncModule real(DP), dimension(:), pointer, contiguous :: ratecncin => null() !simulated flows into constant conc (excluding other concs) real(DP), dimension(:), pointer, contiguous :: ratecncout => null() !simulated flows out of constant conc (excluding to other concs) real(DP), pointer :: eqnsclfac => null() !< governing equation scale factor; =1. for solute; =rhow*cpw for energy + character(len=LENVARNAME) :: depvartype = '' !< stores string of dependent variable type, depending on model type contains @@ -44,6 +44,7 @@ module TspCncModule procedure, public :: bnd_df_obs => cnc_df_obs ! -- method for time series procedure, public :: bnd_rp_ts => cnc_rp_ts + end type TspCncType contains @@ -53,7 +54,7 @@ module TspCncModule !! Routine points packobj to the newly created package !< subroutine cnc_create(packobj, id, ibcnum, inunit, iout, namemodel, pakname, & - tsplab, eqnsclfac, gwecommon) + eqnsclfac, depvartype, gwecommon) ! -- dummy class(BndType), pointer :: packobj integer(I4B), intent(in) :: id @@ -62,8 +63,8 @@ subroutine cnc_create(packobj, id, ibcnum, inunit, iout, namemodel, pakname, & integer(I4B), intent(in) :: iout character(len=*), intent(in) :: namemodel character(len=*), intent(in) :: pakname - type(TspLabelsType), pointer :: tsplab real(DP), intent(in), pointer :: eqnsclfac !< governing equation scale factor + character(len=LENVARNAME), intent(in) :: depvartype type(GweInputDataType), intent(in), target, optional :: gwecommon !< shared data container for use by multiple GWE packages ! -- local type(TspCncType), pointer :: cncobj @@ -91,8 +92,8 @@ subroutine cnc_create(packobj, id, ibcnum, inunit, iout, namemodel, pakname, & packobj%ncolbnd = 1 packobj%iscloc = 1 ! - ! -- Give package access to the assigned labels based on dependent variable - packobj%tsplab => tsplab + ! -- Store the appropriate label based on the dependent variable + cncobj%depvartype = depvartype ! ! -- Give access to governing equation scale factor cncobj%eqnsclfac => eqnsclfac @@ -164,7 +165,7 @@ subroutine cnc_rp(this) ibd = this%ibound(node) if (ibd < 0) then call this%dis%noder_to_string(node, nodestr) - dvtype = trim(this%tsplab%depvartype) + dvtype = trim(this%depvartype) call lowcase(dvtype) call store_error('Cell is already a constant ' & //dvtype//': '//trim(adjustl(nodestr))) @@ -423,7 +424,7 @@ subroutine define_listlabel(this) write (this%listlabel, '(a, a7)') trim(this%listlabel), 'NODE' end if write (this%listlabel, '(a, a16)') trim(this%listlabel), & - trim(this%tsplab%depvartype) + trim(this%depvartype) if (this%inamedbound == 1) then write (this%listlabel, '(a, a16)') trim(this%listlabel), 'BOUNDARY NAME' end if @@ -489,7 +490,7 @@ subroutine cnc_rp_ts(this) if (associated(tslink)) then select case (tslink%JCol) case (1) - tslink%Text = trim(this%tsplab%depvartype) + tslink%Text = trim(this%depvartype) end select end if end do diff --git a/src/Model/TransportModel/tsp1fmi1.f90 b/src/Model/TransportModel/tsp1fmi1.f90 index 33671870097..3576c4167f5 100644 --- a/src/Model/TransportModel/tsp1fmi1.f90 +++ b/src/Model/TransportModel/tsp1fmi1.f90 @@ -2,7 +2,7 @@ module TspFmiModule use KindModule, only: DP, I4B use ConstantsModule, only: DONE, DZERO, DHALF, LINELENGTH, LENBUDTXT, & - LENPACKAGENAME + LENPACKAGENAME, LENVARNAME use SimModule, only: store_error, store_error_unit use SimVariablesModule, only: errmsg use NumericalPackageModule, only: NumericalPackageType @@ -12,7 +12,6 @@ module TspFmiModule use HeadFileReaderModule, only: HeadFileReaderType use PackageBudgetModule, only: PackageBudgetType use BudgetObjectModule, only: BudgetObjectType, budgetobject_cr_bfr - use TspLabelsModule, only: TspLabelsType use MatrixBaseModule implicit none @@ -66,6 +65,8 @@ module TspFmiModule dimension(:), pointer, contiguous :: datp => null() character(len=16), dimension(:), allocatable :: flowpacknamearray !< array of boundary package names (e.g. LAK-1, SFR-3, etc.) type(BudObjPtrArray), dimension(:), allocatable :: aptbudobj !< flow budget objects for the advanced packages + character(len=LENVARNAME) :: depvartype = '' + contains procedure :: fmi_df @@ -102,14 +103,14 @@ module TspFmiModule !> @breif Create a new FMI object !< - subroutine fmi_cr(fmiobj, name_model, inunit, iout, tsplab, eqnsclfac) + subroutine fmi_cr(fmiobj, name_model, inunit, iout, eqnsclfac, depvartype) ! -- dummy type(TspFmiType), pointer :: fmiobj character(len=*), intent(in) :: name_model integer(I4B), intent(in) :: inunit integer(I4B), intent(in) :: iout - type(TspLabelsType), pointer, intent(in) :: tsplab real(DP), intent(in), pointer :: eqnsclfac !< governing equation scale factor + character(len=LENVARNAME), intent(in) :: depvartype ! ------------------------------------------------------------------------------ ! ! -- Create the object @@ -133,7 +134,7 @@ subroutine fmi_cr(fmiobj, name_model, inunit, iout, tsplab, eqnsclfac) call fmiobj%parser%Initialize(fmiobj%inunit, fmiobj%iout) ! ! -- Give package access to the assigned labels based on dependent variable - fmiobj%tsplab => tsplab + fmiobj%depvartype = depvartype ! ! -- Store pointer to governing equation scale factor fmiobj%eqnsclfac => eqnsclfac @@ -674,7 +675,7 @@ subroutine set_active_status(this, cnew) call this%dis%noder_to_string(n, nodestr) write (this%iout, '(/1x,a,1x,a,a,1x,a,1x,a,1x,G13.5)') & 'WARNING: DRY CELL ENCOUNTERED AT', trim(nodestr), '; RESET AS & - &INACTIVE WITH DRY', trim(adjustl(this%tsplab%depvartype)), & + &INACTIVE WITH DRY', trim(adjustl(this%depvartype)), & '=', DHDRY end if end if @@ -712,7 +713,7 @@ subroutine set_active_status(this, cnew) call this%dis%noder_to_string(n, nodestr) write (this%iout, '(/1x,a,1x,a,1x,a,1x,a,1x,a,1x,G13.5)') & 'DRY CELL REACTIVATED AT', trim(nodestr), 'WITH STARTING', & - trim(adjustl(this%tsplab%depvartype)), '=', crewet + trim(adjustl(this%depvartype)), '=', crewet end if end if end do diff --git a/src/Model/TransportModel/tsp1ic1.f90 b/src/Model/TransportModel/tsp1ic1.f90 index 514a6024c2c..90b805d937d 100644 --- a/src/Model/TransportModel/tsp1ic1.f90 +++ b/src/Model/TransportModel/tsp1ic1.f90 @@ -1,10 +1,10 @@ module TspIcModule use KindModule, only: DP, I4B + use ConstantsModule, only: LENVARNAME use GwfIcModule, only: GwfIcType use BlockParserModule, only: BlockParserType use BaseDisModule, only: DisBaseType - use TspLabelsModule, only: TspLabelsType implicit none private @@ -13,22 +13,27 @@ module TspIcModule ! -- Most of the TspIcType functionality comes from GwfIcType type, extends(GwfIcType) :: TspIcType + ! -- strings + character(len=LENVARNAME) :: depvartype = '' + contains + procedure :: read_data + end type TspIcType contains !> @brief Create a new initial conditions object !< - subroutine ic_cr(ic, name_model, inunit, iout, dis, tsplab) + subroutine ic_cr(ic, name_model, inunit, iout, dis, depvartype) ! -- dummy type(TspIcType), pointer :: ic - type(TspLabelsType), pointer, intent(in) :: tsplab character(len=*), intent(in) :: name_model integer(I4B), intent(in) :: inunit integer(I4B), intent(in) :: iout class(DisBaseType), pointer, intent(in) :: dis + character(len=LENVARNAME), intent(in) :: depvartype ! ------------------------------------------------------------------------------ ! ! -- Create the object @@ -47,7 +52,7 @@ subroutine ic_cr(ic, name_model, inunit, iout, dis, tsplab) ic%dis => dis ! ! -- Give package access to the assigned labelsd based on dependent variable - ic%tsplab => tsplab + ic%depvartype = depvartype ! ! -- Initialize block parser call ic%parser%Initialize(ic%inunit, ic%iout) @@ -76,7 +81,7 @@ subroutine read_data(this) ! ------------------------------------------------------------------------------ ! ! -- Setup the label - write (aname(1), '(a,1x,a)') 'INITIAL', trim(adjustl(this%tsplab%depvartype)) + write (aname(1), '(a,1x,a)') 'INITIAL', trim(adjustl(this%depvartype)) ! ! -- get griddata block call this%parser%GetBlock('GRIDDATA', isfound, ierr) diff --git a/src/Model/TransportModel/tsp1mvt1.f90 b/src/Model/TransportModel/tsp1mvt1.f90 index ba73d59bea3..2a54b771e18 100644 --- a/src/Model/TransportModel/tsp1mvt1.f90 +++ b/src/Model/TransportModel/tsp1mvt1.f90 @@ -249,7 +249,8 @@ subroutine mvt_fc(this, cnew1, cnew2) ! -- Set pointers to the fmi packages for the provider and the receiver call this%set_fmi_pr_rc(i, fmi_pr, fmi_rc) ! - ! -- Set a pointer to the GWT model concentration associated with the provider + ! -- Set a pointer to the transport model's dependent variable + ! (concentration or temperature) associated with the provider cnew => cnew1 if (associated(fmi_pr, this%fmi2)) then cnew => cnew2 @@ -261,7 +262,8 @@ subroutine mvt_fc(this, cnew1, cnew2) ! -- Get the package index for the receiver call fmi_rc%get_package_index(this%mvrbudobj%budterm(i)%text2id2, irc) ! - ! -- If provider is an advanced package, then set a pointer to its simulated concentration + ! -- If provider is an advanced package, then set a pointer to its + ! simulated dependent variable (concentration or temperature) if (fmi_pr%iatp(ipr) /= 0) then concpak => fmi_pr%datp(ipr)%concpack end if @@ -276,26 +278,27 @@ subroutine mvt_fc(this, cnew1, cnew2) ! -- Obtain mover flow rate from the mover flow budget object q = this%mvrbudobj%budterm(i)%flow(n) ! - ! -- Assign concentration of the provider + ! -- Assign the concentration (or temperature) of the provider cp = DZERO if (fmi_pr%iatp(ipr) /= 0) then ! ! -- Provider package is being represented by an APT (SFT, LKT, MWT, UZT) - ! so set the concentration to the simulated concentation of APT + ! so set the concentration (or temperature) to the simulated + ! concentation (or temperature) of APT cp = concpak(id1) else ! ! -- Provider is a regular stress package (WEL, DRN, RIV, etc.) or the ! provider is an advanced stress package but is not represented with - ! SFT, LKT, MWT, or UZT, so use the GWT cell concentration + ! SFT, LKT, MWT, or UZT, so use the cell concentration (GWT) or + ! temperature (GWE) igwtnode = fmi_pr%gwfpackages(ipr)%nodelist(id1) cp = cnew(igwtnode) - end if ! - ! -- add the mover rate times the provider concentration into the receiver - ! make sure these are accumulated since multiple providers can move - ! water into the same receiver + ! -- add the mover rate times the provider concentration (or + ! temperature) into the receiver make sure these are accumulated + ! since multiple providers can move water into the same receiver if (fmi_rc%iatp(irc) /= 0) then fmi_rc%datp(irc)%qmfrommvr(id2) = fmi_rc%datp(irc)%qmfrommvr(id2) - & q * cp * this%eqnsclfac diff --git a/src/Model/TransportModel/tsp1ssm1.f90 b/src/Model/TransportModel/tsp1ssm1.f90 index 20c96c837d9..634419ded6e 100644 --- a/src/Model/TransportModel/tsp1ssm1.f90 +++ b/src/Model/TransportModel/tsp1ssm1.f90 @@ -10,13 +10,12 @@ module TspSsmModule use KindModule, only: DP, I4B, LGP use ConstantsModule, only: DONE, DZERO, LENAUXNAME, LENFTYPE, & LENPACKAGENAME, LINELENGTH, & - TABLEFT, TABCENTER, LENBUDROWLABEL + TABLEFT, TABCENTER, LENBUDROWLABEL, LENVARNAME use SimModule, only: store_error, count_errors, store_error_unit use SimVariablesModule, only: errmsg use NumericalPackageModule, only: NumericalPackageType use BaseDisModule, only: DisBaseType use TspFmiModule, only: TspFmiType - use TspLabelsModule, only: TspLabelsType use GweInputDataModule, only: GweInputDataType use TableModule, only: TableType, table_cr use GwtSpcModule, only: GwtSpcType @@ -50,6 +49,7 @@ module TspSsmModule type(TableType), pointer :: outputtab => null() !< output table object type(GwtSpcType), dimension(:), pointer :: ssmivec => null() !< array of stress package concentration objects real(DP), pointer :: eqnsclfac => null() !< governing equation scale factor; =1. for solute; =rhow*cpw for energy + character(len=LENVARNAME) :: depvartype = '' contains @@ -83,16 +83,16 @@ module TspSsmModule !! Create a new SSM package by defining names, allocating scalars !! and initializing the parser. !< - subroutine ssm_cr(ssmobj, name_model, inunit, iout, fmi, tsplab, eqnsclfac, & - gwecommon) + subroutine ssm_cr(ssmobj, name_model, inunit, iout, fmi, eqnsclfac, & + depvartype, gwecommon) ! -- dummy type(TspSsmType), pointer :: ssmobj !< TspSsmType object character(len=*), intent(in) :: name_model !< name of the model integer(I4B), intent(in) :: inunit !< fortran unit for input integer(I4B), intent(in) :: iout !< fortran unit for output type(TspFmiType), intent(in), target :: fmi !< Transport FMI package - type(TspLabelsType), intent(in), pointer :: tsplab !< TspLabelsType object real(DP), intent(in), pointer :: eqnsclfac !< governing equation scale factor + character(len=LENVARNAME), intent(in) :: depvartype type(GweInputDataType), intent(in), target, optional :: gwecommon !< shared data container for use by multiple GWE packages ! ! -- Create the object @@ -115,7 +115,7 @@ subroutine ssm_cr(ssmobj, name_model, inunit, iout, fmi, tsplab, eqnsclfac, & ! ! -- Store pointer to labels associated with the current model so that the ! package has access to the corresponding dependent variable type - ssmobj%tsplab => tsplab + ssmobj%depvartype = depvartype ! ! -- Give package access to the shared heat transport variables assigned in MST if (present(gwecommon)) then @@ -1152,7 +1152,7 @@ subroutine set_ssmivec(this, ip, packname) trim(packname)) write (this%iout, '(4x, a, a, a, a, a)') 'USING SPC INPUT FILE ', & - trim(filename), ' TO SET ', trim(this%tsplab%depvartype), & + trim(filename), ' TO SET ', trim(this%depvartype), & 'S FOR PACKAGE ', trim(packname) ! ! -- Return diff --git a/src/Utilities/Budget.f90 b/src/Utilities/Budget.f90 index a27e7f8ccdc..d7b63a4b4a6 100644 --- a/src/Utilities/Budget.f90 +++ b/src/Utilities/Budget.f90 @@ -23,7 +23,6 @@ module BudgetModule use SimModule, only: store_error, count_errors use ConstantsModule, only: LINELENGTH, LENBUDTXT, LENBUDROWLABEL, DZERO, & DTWO, DHUNDRED - use TspLabelsModule, only: TspLabelsType implicit none @@ -57,11 +56,9 @@ module BudgetModule ! -- csv output integer(I4B), pointer :: ibudcsv => null() integer(I4B), pointer :: icsvheader => null() - ! - ! -- labels - type(TspLabelsType), pointer :: tsplab => null() contains + procedure :: budget_df procedure :: budget_ot procedure :: budget_da @@ -76,6 +73,7 @@ module BudgetModule procedure, private :: allocate_arrays procedure, private :: resize procedure, private :: write_csv_header + end type BudgetType contains @@ -85,12 +83,11 @@ module BudgetModule !! Create a new budget object. !! !< - subroutine budget_cr(this, name_model, tsplab) + subroutine budget_cr(this, name_model) ! -- modules ! -- dummy type(BudgetType), pointer :: this !< BudgetType object character(len=*), intent(in) :: name_model !< name of the model - type(TspLabelsType), pointer, intent(in), optional :: tsplab !< TspLabelsType object ! ------------------------------------------------------------------------------ ! ! -- Create the object @@ -99,11 +96,6 @@ subroutine budget_cr(this, name_model, tsplab) ! -- Allocate scalars call this%allocate_scalars(name_model) ! - ! -- Store pointer to labels associated with the current model in order - ! assign the correct transport-related labels - only necessary for - ! transport model type (i.e., GWT or GWE) - if (present(tsplab)) this%tsplab => tsplab - ! ! -- Return return end subroutine budget_cr diff --git a/utils/zonebudget/make/makefile b/utils/zonebudget/make/makefile index ae253919bf8..1918bd8fee2 100644 --- a/utils/zonebudget/make/makefile +++ b/utils/zonebudget/make/makefile @@ -5,13 +5,11 @@ include ./makedefaults # Define the source file directories SOURCEDIR1=../src -SOURCEDIR2=../../../src/Model/ModelUtilities -SOURCEDIR3=../../../src/Utilities +SOURCEDIR2=../../../src/Utilities VPATH = \ ${SOURCEDIR1} \ -${SOURCEDIR2} \ -${SOURCEDIR3} +${SOURCEDIR2} .SUFFIXES: .f90 .F90 .o @@ -32,7 +30,6 @@ $(OBJDIR)/LongLineReader.o \ $(OBJDIR)/sort.o \ $(OBJDIR)/BlockParser.o \ $(OBJDIR)/ArrayReaders.o \ -$(OBJDIR)/TspLabels.o \ $(OBJDIR)/zone.o \ $(OBJDIR)/Budget.o \ $(OBJDIR)/zoneoutput.o \ diff --git a/utils/zonebudget/pymake/extrafiles.txt b/utils/zonebudget/pymake/extrafiles.txt index e07338ae243..0848ab0c086 100644 --- a/utils/zonebudget/pymake/extrafiles.txt +++ b/utils/zonebudget/pymake/extrafiles.txt @@ -1,4 +1,3 @@ -../../../src/Model/ModelUtilities/TspLabels.f90 ../../../src/Utilities/ArrayHandlers.f90 ../../../src/Utilities/ArrayReaders.f90 ../../../src/Utilities/BlockParser.f90