diagnostics_group_m Module

Base module for diagnostic groups



Contents


Derived Types

type, public ::  diagnostics_group_t

Base class containing diagnostics

Components

Type Visibility Attributes Name Initial
character(len=:), public, allocatable :: groupname

Name of diagnostics group

character(len=:), public, allocatable :: dirpath

Path to diagnostics directory

type(diagnostic_variable_t), public :: tau

Time

type(diagnostic_variable_t), public, dimension(:), allocatable :: diags

Container of non-generic diagnostic variables

integer, public :: n_diags

Number of non-generic diagnostic variables

logical, public :: file_exists

Internal flag to track snapshot file status

Finalizations Procedures

final :: destructor

Type-Bound Procedures

procedure , public :: init_diagnostics_group Subroutine
procedure , public :: allocate_diags Subroutine
procedure , public :: write_diagnostics Subroutine
procedure , public :: init_next_diagnostic Subroutine

Subroutines

public subroutine init_diagnostics_group(self, comm_handler, groupname)

Initialize diagnostic

Arguments

Type IntentOptional Attributes Name
class(diagnostics_group_t), intent(inout) :: self

Instance of class

type(comm_handler_t), intent(in) :: comm_handler

MPI communication handler

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

Directory suffix to write snapsfiles into

public subroutine allocate_diags(self, n_diags)

Initialize diagnostic

Arguments

Type IntentOptional Attributes Name
class(diagnostics_group_t), intent(inout) :: self

Instance of class

integer, intent(in) :: n_diags

Directory to write snapsfiles into

public subroutine init_next_diagnostic(self, ndim, dimname, varname, ind_out)

Initialize single diagnostic and provide pointer to its vals field

Arguments

Type IntentOptional Attributes Name
class(diagnostics_group_t), intent(inout) :: self

Instance of class

integer, intent(in) :: ndim

Number of elements in diagnostic

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

Name of dimension of diagnostic

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

Name of diagnostic

integer, intent(out) :: ind_out

Index of initiated diagnostic in diags array

public subroutine write_diagnostics(self, tau, isnaps, idiag, start_new_file)

Write all diagnostics

Arguments

Type IntentOptional Attributes Name
class(diagnostics_group_t), intent(inout) :: self

Instance of class

real(kind=GP), intent(in) :: tau

Time

integer, intent(in) :: isnaps

Snapshot file index

integer, intent(in) :: idiag

Diagnostic step index

logical, intent(in) :: start_new_file

If true, a new file will be created

public subroutine destructor(self)

Arguments

Type IntentOptional Attributes Name
type(diagnostics_group_t), intent(inout) :: self

Instance of the type