diff --git a/src/Model/GroundWaterTransport/gwt1.f90 b/src/Model/GroundWaterTransport/gwt1.f90 index 035b6c17d40..8f32e270e72 100644 --- a/src/Model/GroundWaterTransport/gwt1.f90 +++ b/src/Model/GroundWaterTransport/gwt1.f90 @@ -102,7 +102,6 @@ subroutine gwt_cr(filename, id, modelname) use ConstantsModule, only: LINELENGTH, LENPACKAGENAME use MemoryHelperModule, only: create_mem_path use MemoryManagerExtModule, only: mem_set_value - use SimVariablesModule, only: idm_context use GwtNamInputModule, only: GwtNamParamFoundType use BudgetModule, only: budget_cr ! -- dummy @@ -113,9 +112,6 @@ subroutine gwt_cr(filename, id, modelname) integer(I4B) :: indis type(GwtModelType), pointer :: this class(BaseModelType), pointer :: model - character(len=LENMEMPATH) :: input_mempath - character(len=LINELENGTH) :: lst_fname - type(GwtNamParamFoundType) :: found ! ! -- Allocate a new GWT Model (this) allocate (this) @@ -132,33 +128,8 @@ subroutine gwt_cr(filename, id, modelname) model => this call AddBaseModelToList(basemodellist, model) ! - ! -- Assign values - this%filename = filename - this%name = modelname - this%macronym = 'GWT' - this%id = id - ! - ! -- set input model namfile memory path - input_mempath = create_mem_path(modelname, 'NAM', idm_context) - ! - ! -- copy option params from input context - call mem_set_value(lst_fname, 'LIST', input_mempath, found%list) - call mem_set_value(this%iprpak, 'PRINT_INPUT', input_mempath, & - found%print_input) - call mem_set_value(this%iprflow, 'PRINT_FLOWS', input_mempath, & - found%print_flows) - call mem_set_value(this%ipakcb, 'SAVE_FLOWS', input_mempath, found%save_flows) - ! - ! -- activate save_flows if found - if (found%save_flows) then - this%ipakcb = -1 - end if - ! - ! -- Create utility objects - call budget_cr(this%budget, this%name) - ! ! -- Call parent class routine - call this%tsp_cr(filename, id, modelname, indis) + call this%tsp_cr(filename, id, modelname, 'GWT', indis) ! ! -- create model packages call this%create_packages(indis) @@ -190,7 +161,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_GWT, 'MASS', 'M') + call this%budget%budget_df(NIUNIT_GWT, this%depvarunit, & + this%depvarunitabbrev) ! ! -- Check for SSM package if (this%inssm == 0) then @@ -317,7 +289,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) + 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 @@ -512,6 +484,8 @@ subroutine gwt_cc(this, innertot, kiter, iend, icnvgmod, cpak, ipak, dpak) character(len=LENPAKLOC), intent(inout) :: cpak integer(I4B), intent(inout) :: ipak real(DP), intent(inout) :: dpak + ! -- local + ! -- formats ! ! -- If mover is on, then at least 2 outers required if (this%inmvt > 0) call this%mvt%mvt_cc(kiter, iend, icnvgmod, cpak, dpak) diff --git a/src/Model/TransportModel/tsp1.f90 b/src/Model/TransportModel/tsp1.f90 index 00c999e2c18..f1de33b333a 100644 --- a/src/Model/TransportModel/tsp1.f90 +++ b/src/Model/TransportModel/tsp1.f90 @@ -91,8 +91,11 @@ module TransportModelModule !! !! Create a new transport model that will be further refined into GWT or GWE !< - subroutine tsp_cr(this, filename, id, modelname, indis) + subroutine tsp_cr(this, filename, id, modelname, macronym, indis) ! -- modules + use MemoryHelperModule, only: create_mem_path + use MemoryManagerExtModule, only: mem_set_value + use SimVariablesModule, only: idm_context use GwfNamInputModule, only: GwfNamParamFoundType use BudgetModule, only: budget_cr ! -- dummy @@ -101,13 +104,37 @@ subroutine tsp_cr(this, filename, id, modelname, indis) integer(I4B), intent(in) :: id integer(I4B), intent(inout) :: indis character(len=*), intent(in) :: modelname + character(len=*), intent(in) :: macronym ! -- local + character(len=LENMEMPATH) :: input_mempath character(len=LINELENGTH) :: lst_fname type(GwfNamParamFoundType) :: found ! + ! -- Assign values + this%filename = filename + this%name = modelname + this%id = id + this%macronym = macronym + ! + ! -- set input model namfile memory path + input_mempath = create_mem_path(modelname, 'NAM', idm_context) + ! + ! -- copy option params from input context + call mem_set_value(lst_fname, 'LIST', input_mempath, found%list) + call mem_set_value(this%iprpak, 'PRINT_INPUT', input_mempath, & + found%print_input) + call mem_set_value(this%iprflow, 'PRINT_FLOWS', input_mempath, & + found%print_flows) + call mem_set_value(this%ipakcb, 'SAVE_FLOWS', input_mempath, found%save_flows) + ! ! -- create the list file call this%create_lstfile(lst_fname, filename, found%list) ! + ! -- activate save_flows if found + if (found%save_flows) then + this%ipakcb = -1 + end if + ! ! -- log set options if (this%iout > 0) then call this%log_namfile_options(found) diff --git a/src/Model/TransportModel/tsp1oc1.f90 b/src/Model/TransportModel/tsp1oc1.f90 index df6b2f35873..cdad8682249 100644 --- a/src/Model/TransportModel/tsp1oc1.f90 +++ b/src/Model/TransportModel/tsp1oc1.f90 @@ -53,12 +53,15 @@ end subroutine oc_cr !> @ brief Allocate and read TspOcType !! - !! Setup concentration and budget as output control variables. + !! Setup dependent variable (e.g., concentration or temperature) + !! and budget as output control variables. + !! !< - subroutine oc_ar(this, conc, dis, dnodata) + subroutine oc_ar(this, depvar, dis, dnodata, dvname) ! -- dummy class(TspOcType) :: this !< TspOcType object - real(DP), dimension(:), pointer, contiguous, intent(in) :: conc !< model concentration + real(DP), dimension(:), pointer, contiguous, intent(in) :: depvar !< model concentration + character(len=*), intent(in) :: dvname !< name of dependent variable solved by generalized transport model (concentration, temperature) class(DisBaseType), pointer, intent(in) :: dis !< model discretization package real(DP), intent(in) :: dnodata !< no data value ! -- local @@ -78,7 +81,7 @@ subroutine oc_ar(this, conc, dis, dnodata) 'COLUMNS 10 WIDTH 11 DIGITS 4 GENERAL ', & this%iout, dnodata) case (2) - call ocdobjptr%init_dbl('CONCENTRATION', conc, dis, 'PRINT LAST ', & + call ocdobjptr%init_dbl(trim(dvname), depvar, dis, 'PRINT LAST ', & 'COLUMNS 10 WIDTH 11 DIGITS 4 GENERAL ', & this%iout, dnodata) end select