field Module


Contents


Interfaces

interface

  • public pure function rhs_field(self)

    Arguments

    Type IntentOptional Attributes Name
    class(field_type), intent(in) :: self

    Return Value real, allocatable, (:,:,:)


Derived Types

type, public ::  field_type

Implement a 3D scalar field, for instance a temperature field.

Read more…

Components

Type Visibility Attributes Name Initial
real, public, allocatable :: data(:,:,:)
real, public :: dx

Discrete mesh spacing

Type-Bound Procedures

procedure , public :: nz Function
procedure , public :: ny Function
procedure , public :: nx Function
procedure , public :: dump Subroutine
procedure , public :: is_equal Function
procedure (rhs_field) , public :: rhs
generic, public :: operator(+) => field_add_field, field_add_real
generic, public :: operator(-) => field_sub_field
generic, public :: operator(*) => field_mul_real

Functions

public pure function nx(self)

Returns domain size in direction

Arguments

Type IntentOptional Attributes Name
class(field_type), intent(in) :: self

Return Value integer

public pure function ny(self)

Returns domain size in direction

Arguments

Type IntentOptional Attributes Name
class(field_type), intent(in) :: self

Return Value integer

public pure function nz(self)

Returns domain size in direction

Arguments

Type IntentOptional Attributes Name
class(field_type), intent(in) :: self

Return Value integer

public pure function is_equal(self, lhs, tol)

Compare two field_type instance based on their data value

Read more…

Arguments

Type IntentOptional Attributes Name
class(field_type), intent(in) :: self

Right hand side of comparison

class(field_type), intent(in) :: lhs

Left hand side of comparison

real, intent(in) :: tol

Absolute tolerance when comparing fields values

Return Value logical

public pure function field_add_field(self, afield)

Arguments

Type IntentOptional Attributes Name
class(field_type), intent(in) :: self
class(field_type), intent(in) :: afield

Return Value class(field_type), allocatable

public pure function field_add_real(self, a)

Arguments

Type IntentOptional Attributes Name
class(field_type), intent(in) :: self
real, intent(in) :: a(:,:,:)

Return Value class(field_type), allocatable

public pure function field_sub_field(self, afield)

Arguments

Type IntentOptional Attributes Name
class(field_type), intent(in) :: self
class(field_type), intent(in) :: afield

Return Value class(field_type), allocatable

public pure function field_mul_real(self, a)

Multiply a field_cpu_type instance by a real number.

Read more…

Arguments

Type IntentOptional Attributes Name
class(field_type), intent(in) :: self

Left hand side

real, intent(in) :: a

Scalar to multiply field instance with

Return Value class(field_type), allocatable


Subroutines

public subroutine dump(self, file_path, fmt)

Write field data to ASCII file

Arguments

Type IntentOptional Attributes Name
class(field_type), intent(in) :: self
character, intent(in) :: file_path

Relative path to file to output file

character, optional :: fmt

Format string