Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 5 additions & 15 deletions src/Utilities/Idm/InputDefinition.f90
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
!> @brief This module contains the InputDefinitionModule
!> @brief Input definition module.
!!
!! This module contains type definitions that represent
!! descriptions of input from modflow 6 definition files.
!! This module contains derived types that represent
!! input parameters as described in definition files.
!!
!<
module InputDefinitionModule
Expand All @@ -14,12 +14,7 @@ module InputDefinitionModule
public :: InputParamDefinitionType, &
InputBlockDefinitionType

!> @brief Input parameter definition type
!!
!! This type is used to store information for
!! each modflow input record
!!
!<
!> @brief Input parameter definition. Describes an input parameter.
type InputParamDefinitionType
character(len=LENCOMPONENTNAME) :: component_type = '' !< type of component, e.g. GWF
character(len=LENCOMPONENTNAME) :: subcomponent_type = '' !< type of subcomponent, e.g. CHD
Expand All @@ -36,12 +31,7 @@ module InputDefinitionModule
logical(LGP) :: timeseries = .false. !< does the parameter support timeseries
end type InputParamDefinitionType

!> @brief Input block definition type
!!
!! This type is used to store information for
!! how to read a modflow block
!!
!<
!> @brief Input block definition. Describes an input block.
type InputBlockDefinitionType
character(len=LINELENGTH) :: blockname = '' !< name of block, e.g. DIMENSIONS
logical(LGP) :: required = .false. !< is the block required
Expand Down
16 changes: 16 additions & 0 deletions utils/idmloader/filters.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
from typing import Any

from modflow_devtools.misc import try_get_enum_value


class Filters:
@staticmethod
def value(v: Any) -> str:
"""
Format a value to appear in the RHS of an assignment or argument-passing expression.
"""
v = try_get_enum_value(v)
v = f"'{v}'"
if isinstance(v, bool):
v = ".true." if v else ".false."
return v
Loading
Loading