Converter Derived Type

type, public, extends(CptrWrapper) :: Converter


Inherits

type~~converter~~InheritsGraph type~converter Converter type~cptrwrapper CptrWrapper type~converter->type~cptrwrapper c_ptr c_ptr type~cptrwrapper->c_ptr cptr_

Inherited by

type~~converter~~InheritedByGraph type~converter Converter type~convertunitsaction ConvertUnitsAction type~convertunitsaction->type~converter converter

Constructor

public interface Converter

  • private function construct_converter(from_unit, to_unit) result(conv)

    Arguments

    Type IntentOptional Attributes Name
    type(UDUnit), intent(in) :: from_unit
    type(UDUnit), intent(in) :: to_unit

    Return Value type(Converter)


Type-Bound Procedures

generic, public :: convert => convert_float_0d

  • private function convert_float_0d(this, from) result(to)

    Arguments

    Type IntentOptional Attributes Name
    class(Converter), intent(in) :: this
    real(kind=c_float), intent(in) :: from

    Return Value real(kind=c_float)

generic, public :: convert => convert_float_1d

  • private function convert_float_1d(this, from) result(to)

    Arguments

    Type IntentOptional Attributes Name
    class(Converter), intent(in) :: this
    real(kind=c_float), intent(in) :: from(:)

    Return Value real(kind=c_float), (size(from))

generic, public :: convert => convert_float_2d

  • private function convert_float_2d(this, from) result(to)

    Arguments

    Type IntentOptional Attributes Name
    class(Converter), intent(in) :: this
    real(kind=c_float), intent(in) :: from(:,:)

    Return Value real(kind=c_float), (size(from,1),size(from,2))

generic, public :: convert => convert_float_3d

  • private function convert_float_3d(this, from) result(to)

    Arguments

    Type IntentOptional Attributes Name
    class(Converter), intent(in) :: this
    real(kind=c_float), intent(in) :: from(:,:,:)

    Return Value real(kind=c_float), (size(from,1),size(from,2),size(from,3))

generic, public :: convert => convert_float_4d

  • private function convert_float_4d(this, from) result(to)

    Arguments

    Type IntentOptional Attributes Name
    class(Converter), intent(in) :: this
    real(kind=c_float), intent(in) :: from(:,:,:,:)

    Return Value real(kind=c_float), (size(from,1),size(from,2),size(from,3),size(from,4))

generic, public :: convert => convert_float_5d

  • private function convert_float_5d(this, from) result(to)

    Arguments

    Type IntentOptional Attributes Name
    class(Converter), intent(in) :: this
    real(kind=c_float), intent(in) :: from(:,:,:,:,:)

    Return Value real(kind=c_float), (size(from,1),size(from,2),size(from,3),size(from,4),size(from,5))

generic, public :: convert => convert_double_0d

  • private function convert_double_0d(this, from) result(to)

    Arguments

    Type IntentOptional Attributes Name
    class(Converter), intent(in) :: this
    real(kind=c_double), intent(in) :: from

    Return Value real(kind=c_double)

generic, public :: convert => convert_double_1d

  • private function convert_double_1d(this, from) result(to)

    Arguments

    Type IntentOptional Attributes Name
    class(Converter), intent(in) :: this
    real(kind=c_double), intent(in) :: from(:)

    Return Value real(kind=c_double), (size(from))

generic, public :: convert => convert_double_2d

  • private function convert_double_2d(this, from) result(to)

    Arguments

    Type IntentOptional Attributes Name
    class(Converter), intent(in) :: this
    real(kind=c_double), intent(in) :: from(:,:)

    Return Value real(kind=c_double), (size(from,1),size(from,2))

generic, public :: convert => convert_double_3d

  • private function convert_double_3d(this, from) result(to)

    Arguments

    Type IntentOptional Attributes Name
    class(Converter), intent(in) :: this
    real(kind=c_double), intent(in) :: from(:,:,:)

    Return Value real(kind=c_double), (size(from,1),size(from,2),size(from,3))

generic, public :: convert => convert_double_4d

  • private function convert_double_4d(this, from) result(to)

    Arguments

    Type IntentOptional Attributes Name
    class(Converter), intent(in) :: this
    real(kind=c_double), intent(in) :: from(:,:,:,:)

    Return Value real(kind=c_double), (size(from,1),size(from,2),size(from,3),size(from,4))

generic, public :: convert => convert_double_5d

  • private function convert_double_5d(this, from) result(to)

    Arguments

    Type IntentOptional Attributes Name
    class(Converter), intent(in) :: this
    real(kind=c_double), intent(in) :: from(:,:,:,:,:)

    Return Value real(kind=c_double), (size(from,1),size(from,2),size(from,3),size(from,4),size(from,5))

procedure, public :: free

  • private subroutine free(this)

    Arguments

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

procedure, public :: free_memory => free_cv_converter

  • private subroutine free_cv_converter(this)

    Arguments

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

procedure, public :: get_cptr

  • private function get_cptr(this)

    Arguments

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

    Return Value type(c_ptr)

procedure, public :: is_free

  • private function is_free(this)

    Arguments

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

    Return Value logical

procedure, public :: set_cptr

  • private subroutine set_cptr(this, cptr)

    Arguments

    Type IntentOptional Attributes Name
    class(CptrWrapper), intent(inout) :: this
    type(c_ptr), intent(in) :: cptr

Source Code

   type, extends(CptrWrapper) :: Converter
      private
   contains
      procedure :: free_memory => free_cv_converter
      procedure, private :: convert_float_0d
      procedure, private :: convert_float_1d
      procedure, private :: convert_float_2d
      procedure, private :: convert_float_3d
      procedure, private :: convert_float_4d
      procedure, private :: convert_float_5d
      procedure, private :: convert_double_0d
      procedure, private :: convert_double_1d
      procedure, private :: convert_double_2d
      procedure, private :: convert_double_3d
      procedure, private :: convert_double_4d
      procedure, private :: convert_double_5d

      generic :: convert => convert_float_0d
      generic :: convert => convert_float_1d
      generic :: convert => convert_float_2d
      generic :: convert => convert_float_3d
      generic :: convert => convert_float_4d
      generic :: convert => convert_float_5d
      generic :: convert => convert_double_0d
      generic :: convert => convert_double_1d
      generic :: convert => convert_double_2d
      generic :: convert => convert_double_3d
      generic :: convert => convert_double_4d
      generic :: convert => convert_double_5d
   end type Converter