coordinate_mapper_t Derived Type

type, public :: coordinate_mapper_t


Components

Type Visibility Attributes Name Initial
real(kind=wp), public :: x_min

Data bounds

real(kind=wp), public :: x_max

Data bounds

real(kind=wp), public :: y_min

Data bounds

real(kind=wp), public :: y_max

Data bounds

integer, public :: grid_nx

Grid dimensions

integer, public :: grid_ny

Grid dimensions

integer, public :: mask_nx

Mask dimensions

integer, public :: mask_ny

Mask dimensions

real(kind=wp), public :: x_grid2mask

Grid to mask scaling

real(kind=wp), public :: y_grid2mask

Grid to mask scaling

real(kind=wp), public :: x_mask2grid

Mask to grid scaling

real(kind=wp), public :: y_mask2grid

Mask to grid scaling

real(kind=wp), public :: x_data2grid

Data to grid scaling

real(kind=wp), public :: y_data2grid

Data to grid scaling


Type-Bound Procedures

procedure, public :: initialize => mapper_initialize

  • private subroutine mapper_initialize(self, x_bounds, y_bounds, grid_shape, mask_shape)

    Initialize coordinate mapper for data ↔ grid ↔ mask conversions

    Arguments

    Type IntentOptional Attributes Name
    class(coordinate_mapper_t), intent(inout) :: self
    real(kind=wp), intent(in) :: x_bounds(2)
    real(kind=wp), intent(in) :: y_bounds(2)
    integer, intent(in) :: grid_shape(2)
    integer, intent(in) :: mask_shape(2)

procedure, public :: data2grid => mapper_data2grid

  • private subroutine mapper_data2grid(self, x_data, y_data, x_grid, y_grid)

    Convert from data coordinates to grid coordinates

    Arguments

    Type IntentOptional Attributes Name
    class(coordinate_mapper_t), intent(in) :: self
    real(kind=wp), intent(in) :: x_data
    real(kind=wp), intent(in) :: y_data
    real(kind=wp), intent(out) :: x_grid
    real(kind=wp), intent(out) :: y_grid

procedure, public :: grid2data => mapper_grid2data

  • private subroutine mapper_grid2data(self, x_grid, y_grid, x_data, y_data)

    Convert from grid coordinates to data coordinates

    Arguments

    Type IntentOptional Attributes Name
    class(coordinate_mapper_t), intent(in) :: self
    real(kind=wp), intent(in) :: x_grid
    real(kind=wp), intent(in) :: y_grid
    real(kind=wp), intent(out) :: x_data
    real(kind=wp), intent(out) :: y_data

procedure, public :: mask2grid => mapper_mask2grid

  • private subroutine mapper_mask2grid(self, x_mask, y_mask, x_grid, y_grid)

    Convert from mask coordinates to grid coordinates

    Arguments

    Type IntentOptional Attributes Name
    class(coordinate_mapper_t), intent(in) :: self
    integer, intent(in) :: x_mask
    integer, intent(in) :: y_mask
    real(kind=wp), intent(out) :: x_grid
    real(kind=wp), intent(out) :: y_grid

procedure, public :: grid2mask => mapper_grid2mask

  • private subroutine mapper_grid2mask(self, x_grid, y_grid, x_mask, y_mask)

    Convert from grid coordinates to mask coordinates (nearest)

    Arguments

    Type IntentOptional Attributes Name
    class(coordinate_mapper_t), intent(in) :: self
    real(kind=wp), intent(in) :: x_grid
    real(kind=wp), intent(in) :: y_grid
    integer, intent(out) :: x_mask
    integer, intent(out) :: y_mask