JSON_controller_procedures Submodule

Contains module procedures associated with the JSON controller class


Uses


Module Functions

pure module function getAlternativeJSONPath(this) result(filepath)

Get alternative default JSON filepath

Arguments

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

Return Value character(len=:), allocatable


Module Subroutines

module subroutine loadFile(this, mpiCont, filepath)

Loads json file on rank 0. The default filepath here is "./config.json".

Arguments

Type IntentOptional Attributes Name
class(JSONController), intent(inout) :: this
type(MPIController), intent(inout) :: mpiCont

MPIController object to be used by the JSONController for communication

character(len=*), intent(in), optional :: filepath

Non-default filepath

module subroutine closeFile(this, mpiCont, saveFile, filepath)

Closes currently open json file. If saveFile is true, saves the file being worked on before closing. The default filepath here is "./config.json".

Arguments

Type IntentOptional Attributes Name
class(JSONController), intent(inout) :: this
type(MPIController), intent(inout) :: mpiCont

MPIController object to be used by the JSONController for communication

logical, intent(in), optional :: saveFile

True if the file should be saved before closing

character(len=*), intent(in), optional :: filepath

Non-default filepath for saving

module subroutine loadScalarParams(this, vars)

Load named scalar parameters by calling individual load routines.

Arguments

Type IntentOptional Attributes Name
class(JSONController), intent(inout) :: this
type(NamedScalarContainer), intent(inout) :: vars

Values to load

module subroutine setAlternativeJSONPath(this, filepath)

Set alternative default JSON filepath

Arguments

Type IntentOptional Attributes Name
class(JSONController), intent(inout) :: this
character(len=*), intent(in) :: filepath

module subroutine loadArrayParams(this, vars)

Load named array parameters by calling individual load routines.

Arguments

Type IntentOptional Attributes Name
class(JSONController), intent(inout) :: this
type(NamedArrayContainer), intent(inout) :: vars

Values to load

module subroutine loadNamedReals(this, vars)

Load named reals from currently open json file on rank 0, then broadcast them to all processors. If a variable isn't found, the passed value is not modified.

Arguments

Type IntentOptional Attributes Name
class(JSONController), intent(inout) :: this
type(NamedReal), intent(inout), dimension(:) :: vars

Values to load

module subroutine loadNamedInts(this, vars)

Load named int from currently open json file on rank 0, then broadcast them to all processors. If a variable isn't found, the passed value is not modified.

Arguments

Type IntentOptional Attributes Name
class(JSONController), intent(inout) :: this
type(NamedInteger), intent(inout), dimension(:) :: vars

Values to load

module subroutine loadNamedLogicals(this, vars)

Load named logicals from currently open json file on rank 0, then broadcast them to all processors. If a variable isn't found, the passed value is not modified.

Arguments

Type IntentOptional Attributes Name
class(JSONController), intent(inout) :: this
type(NamedLogical), intent(inout), dimension(:) :: vars

Values to load

module subroutine loadNamedStrings(this, vars)

Load named strings from currently open json file on rank 0, then broadcast them to all processors. If a variable isn't found, the passed value is not modified.

Arguments

Type IntentOptional Attributes Name
class(JSONController), intent(inout) :: this
type(NamedString), intent(inout), dimension(:) :: vars

Values to load

module subroutine loadNamedRealArrays(this, vars)

Load named real arrays from currently open json file on rank 0, then broadcast them to all processors. If a variable isn't found, the passed value is not modified.

Arguments

Type IntentOptional Attributes Name
class(JSONController), intent(inout) :: this
type(NamedRealArray), intent(inout), dimension(:) :: vars

Values to load

module subroutine loadNamedIntArrays(this, vars)

Load named int arrays from currently open json file on rank 0, then broadcast them to all processors. If a variable isn't found, the passed value is not modified.

Arguments

Type IntentOptional Attributes Name
class(JSONController), intent(inout) :: this
type(NamedIntegerArray), intent(inout), dimension(:) :: vars

Values to load

module subroutine loadNamedLogicalArrays(this, vars)

Load named logical arrays from currently open json file on rank 0, then broadcast them to all processors. If a variable isn't found, the passed value is not modified.

Arguments

Type IntentOptional Attributes Name
class(JSONController), intent(inout) :: this
type(NamedLogicalArray), intent(inout), dimension(:) :: vars

Values to load

module subroutine loadNamedStringArrays(this, vars)

Load named string arrays from currently open json file on rank 0, then broadcast them to all processors. If a variable isn't found, the passed value is not modified.

Arguments

Type IntentOptional Attributes Name
class(JSONController), intent(inout) :: this
type(NamedStringArray), intent(inout), dimension(:) :: vars

Values to load

module subroutine outputScalarParamsToFile(this, vars)

Outputs named scalar parameters to json file from rank 0.

Arguments

Type IntentOptional Attributes Name
class(JSONController), intent(inout) :: this
type(NamedScalarContainer), intent(inout) :: vars

Values to output

module subroutine outputArrayParamsToFile(this, vars)

Outputs named array parameters to json file from rank 0.

Arguments

Type IntentOptional Attributes Name
class(JSONController), intent(inout) :: this
type(NamedArrayContainer), intent(inout) :: vars

Values to output

module subroutine outputNamedRealsToFile(this, vars)

Outputs named reals to json file from rank 0. First attempts to update the variable, and if it is not found it is added.

Arguments

Type IntentOptional Attributes Name
class(JSONController), intent(inout) :: this
type(NamedReal), intent(inout), dimension(:) :: vars

Values to output

module subroutine outputNamedIntsToFile(this, vars)

Outputs named ints to json file from rank 0. First attempts to update the variable, and if it is not found it is added.

Arguments

Type IntentOptional Attributes Name
class(JSONController), intent(inout) :: this
type(NamedInteger), intent(inout), dimension(:) :: vars

Values ot output

module subroutine outputNamedLogicalsToFile(this, vars)

Outputs named logicals to json file from rank 0. First attempts to update the variable, and if it is not found it is added.

Arguments

Type IntentOptional Attributes Name
class(JSONController), intent(inout) :: this
type(NamedLogical), intent(inout), dimension(:) :: vars

Values ot output

module subroutine outputNamedStringsToFile(this, vars)

Outputs named strings to json file from rank 0. First attempts to update the variable, and if it is not found it is added.

Arguments

Type IntentOptional Attributes Name
class(JSONController), intent(inout) :: this
type(NamedString), intent(inout), dimension(:) :: vars

Values ot output

module subroutine outputNamedRealArraysToFile(this, vars)

Outputs named real arrays to json file from rank 0.

Arguments

Type IntentOptional Attributes Name
class(JSONController), intent(inout) :: this
type(NamedRealArray), intent(inout), dimension(:) :: vars

Values ot output

module subroutine outputNamedIntArraysToFile(this, vars)

Outputs named int arrays to json file from rank 0.

Arguments

Type IntentOptional Attributes Name
class(JSONController), intent(inout) :: this
type(NamedIntegerArray), intent(inout), dimension(:) :: vars

Values ot output

module subroutine outputNamedLogicalArraysToFile(this, vars)

Outputs named logical arrays to json file from rank 0.

Arguments

Type IntentOptional Attributes Name
class(JSONController), intent(inout) :: this
type(NamedLogicalArray), intent(inout), dimension(:) :: vars

Values ot output

module subroutine outputNamedStringArraysToFile(this, vars)

Outputs named string arrays to json file from rank 0.

Arguments

Type IntentOptional Attributes Name
class(JSONController), intent(inout) :: this
type(NamedStringArray), intent(inout), dimension(:) :: vars