CustomModelBuilder Derived Type

type, public, extends(ModelBuilder) :: CustomModelBuilder

Builder for custom models with user defined terms and modelbound data


Components

Type Visibility Attributes Name Initial
logical, public :: userDefined = .false.

True only if user explicitly sets it to true

class(Model), private, allocatable :: modelBuffer

Model buffer filled during initialization


Type-Bound Procedures

procedure, public :: isDefined => isDefinedObject

  • interface

    private pure module function isDefinedObject(this) result(defined)

    Getter for userDefined

    Arguments

    Type IntentOptional Attributes Name
    class(Object), intent(in) :: this

    Return Value logical

procedure, public :: makeDefined => makeDefinedObject

  • interface

    private pure module subroutine makeDefinedObject(this)

    Set userDefined to .true.

    Arguments

    Type IntentOptional Attributes Name
    class(Object), intent(inout) :: this

procedure, public :: makeUndefined => makeUndefinedObject

  • interface

    private pure module subroutine makeUndefinedObject(this)

    Set userDefined to .false.

    Arguments

    Type IntentOptional Attributes Name
    class(Object), intent(inout) :: this

procedure, public :: loadParams

  • interface

    private module subroutine loadParams(this, jsonCont, mpiCont)

    Load parameters from "./config.json"

    Arguments

    Type IntentOptional Attributes Name
    class(ModelBuilder), intent(inout) :: this
    type(JSONController), intent(inout) :: jsonCont

    JSONController object responsible for reading the config file

    type(MPIController), intent(inout) :: mpiCont

    MPIController object to be used with JSON IO

procedure, public :: outputUsedParams

  • interface

    private module subroutine outputUsedParams(this, jsonCont, mpiCont)

    Output used parameters to "./used_config.json"

    Arguments

    Type IntentOptional Attributes Name
    class(ModelBuilder), intent(inout) :: this
    type(JSONController), intent(inout) :: jsonCont

    JSONController object responsible for writing the config file

    type(MPIController), intent(inout) :: mpiCont

    MPIController object to be used with JSON IO

procedure, public :: getScalarParams

  • interface

    private pure module function getScalarParams(this) result(params)

    Getter for ModelBuilder scalarParams

    Arguments

    Type IntentOptional Attributes Name
    class(ModelBuilder), intent(in) :: this

    Return Value type(NamedScalarContainer)

procedure, public :: getArrayParams

  • interface

    private pure module function getArrayParams(this) result(params)

    Getter for ModelBuilder arrayParams

    Arguments

    Type IntentOptional Attributes Name
    class(ModelBuilder), intent(in) :: this

    Return Value type(NamedArrayContainer)

procedure, public :: setScalarParams

  • interface

    private pure module subroutine setScalarParams(this, params)

    Setter for ModelBuilder scalarParams

    Arguments

    Type IntentOptional Attributes Name
    class(ModelBuilder), intent(inout) :: this
    type(NamedScalarContainer), intent(in) :: params

procedure, public :: setArrayParams

  • interface

    private pure module subroutine setArrayParams(this, params)

    Setter for ModelBuilder scalarParams

    Arguments

    Type IntentOptional Attributes Name
    class(ModelBuilder), intent(inout) :: this
    type(NamedArrayContainer), intent(in) :: params

procedure, public :: init => initCustomBuilder

  • interface

    private module subroutine initCustomBuilder(this, env, normObject, modelTag)

    Constructs the model for this builder and sets it into defined state

    Arguments

    Type IntentOptional Attributes Name
    class(CustomModelBuilder), intent(inout) :: this
    class(EnvironmentWrapper), intent(inout) :: env
    class(Normalization), intent(in) :: normObject

    Reference normalization object

    character(len=*), intent(in) :: modelTag

    Tag of this model

procedure, public :: addModelToModeller => addCustomModel

  • interface

    private module subroutine addCustomModel(this, modellerObj)

    Adds the model built by the builder and resets the builder to become undefined for further use

    Arguments

    Type IntentOptional Attributes Name
    class(CustomModelBuilder), intent(inout) :: this
    class(Modeller), intent(inout) :: modellerObj

procedure, private :: addTermToModel

  • interface

    private module subroutine addTermToModel(this, termJSONPrefix, termTag, env, normObject, mbData)

    Adds individual term to model buffer based on JSON file data

    Arguments

    Type IntentOptional Attributes Name
    class(CustomModelBuilder), intent(inout) :: this
    character(len=*), intent(in) :: termJSONPrefix
    character(len=*), intent(in) :: termTag
    class(EnvironmentWrapper), intent(inout) :: env
    class(Normalization), intent(in) :: normObject
    class(ModelboundData), intent(in), optional :: mbData

procedure, private :: applyTermGenerator

  • interface

    private module subroutine applyTermGenerator(this, env, normObject, modelTag, currentNumTerms, mbData)

    Checks for associated term generator in JSON file and applies to custom model

    Arguments

    Type IntentOptional Attributes Name
    class(CustomModelBuilder), intent(inout) :: this
    class(EnvironmentWrapper), intent(inout) :: env
    class(Normalization), intent(in) :: normObject

    Reference normalization object

    character(len=*), intent(in) :: modelTag

    Tag of this model

    integer(kind=ik), intent(in) :: currentNumTerms
    class(ModelboundData), intent(in), optional :: mbData