Skip to content

Commit b43e0d0

Browse files
authored
fix(mf6bmiUtil): use base model in get_grid_type_model (#2845)
#2705 switched PRT to ExplicitModelType, but did not accommodate this in the BMI implementation. Up to now get_grid_type_model only worked with NumericalModelType. Use BaseModelType instead.
1 parent ad807ec commit b43e0d0

2 files changed

Lines changed: 12 additions & 6 deletions

File tree

doc/ReleaseNotes/develop.toml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,4 +82,9 @@ description = "Previously, GWF model output files could only be referenced by a
8282
[[items]]
8383
section = "fixes"
8484
subsection = "model"
85-
description = "PRT was described as configuring a single release at the beginning of the simulation by default, but a release was in fact scheduled for the first time step of every stress period. Fix the default release behavior so a single release occurs at the beginning of the simulation."
85+
description = "PRT was described as configuring a single release at the beginning of the simulation by default, but a release was in fact scheduled for the first time step of every stress period. Fix the default release behavior so a single release occurs at the beginning of the simulation."
86+
87+
[[items]]
88+
section = "fixes"
89+
subsection = "basic"
90+
description = "The BMI interface's get\\_grid\\_model\\_type function worked only for numerical model types such as GWF, GWT, and GWE, but would crash for PRT models. Fix the function's implementation to work with all model types."

srcbmi/mf6bmiUtil.f90

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -238,18 +238,19 @@ end function getSolution
238238
subroutine get_grid_type_model(model_name, grid_type_f)
239239
! -- modules
240240
use ListsModule, only: basemodellist
241-
use NumericalModelModule, only: NumericalModelType, GetNumericalModelFromList
241+
use BaseModelModule, only: BaseModelType, GetBaseModelFromList
242242
! -- dummy variables
243243
character(len=LENMODELNAME) :: model_name
244244
character(len=LENGRIDTYPE) :: grid_type_f
245245
! -- local variables
246246
integer(I4B) :: i
247-
class(NumericalModelType), pointer :: numericalModel
247+
class(BaseModelType), pointer :: baseModel
248248

249249
do i = 1, basemodellist%Count()
250-
numericalModel => GetNumericalModelFromList(basemodellist, i)
251-
if (numericalModel%name == model_name) then
252-
call numericalModel%dis%get_dis_type(grid_type_f)
250+
baseModel => GetBaseModelFromList(basemodellist, i)
251+
if (baseModel%name == model_name) then
252+
call baseModel%dis%get_dis_type(grid_type_f)
253+
return
253254
end if
254255
end do
255256
end subroutine get_grid_type_model

0 commit comments

Comments
 (0)