GRIDMAN
grid managment library
Functions/Subroutines
template.f File Reference

Converters of GRIDMAN_GRID object to and from simple template (DG template) More...

Go to the source code of this file.

Functions/Subroutines

subroutine gridman_template2grid (GRID, M, N, L, X, Y, IERR)
 Convert data read from a file in simple template format (DG template) into GRIDMAN_GRID object. More...
 
subroutine gridman_grid2template (GRID, M, N, L, X, Y, IERR)
 Convert GRIDMAN_GRID object into arrays which can be stored in simple template format (DG template) More...
 
subroutine gridman_template_read_grid (GRID, FNAME, IERR)
 Read from a simple template file (DG template) into GRIDMAN_GRID object. More...
 
subroutine gridman_template_write_grid (GRID, FNAME, IERR)
 Write GRIDMAN_GRID object in a simple template format (DG template) More...
 

Detailed Description

Converters of GRIDMAN_GRID object to and from simple template (DG template)

Definition in file template.f.

Function/Subroutine Documentation

subroutine gridman_template2grid ( type(gridman_grid)  GRID,
integer(gridman_sp), intent(in)  M,
integer(gridman_sp), dimension(m), intent(in)  N,
integer(gridman_sp), intent(in)  L,
real(gridman_dp), dimension(l), intent(in)  X,
real(gridman_dp), dimension(l), intent(in)  Y,
integer, intent(out)  IERR 
)

Convert data read from a file in simple template format (DG template) into GRIDMAN_GRID object.

WARNING: object GRID will be overwritten if already exists

The code tries to figure out if the polygone is closed or not. For closed polygones last point of the chain is moved to the first point. WARNING: single points are not taken into the grid object

Edge index EDGEINDEX(1) contains index of polygons for each edge

Parameters
gridResulting grid object
[in]mNumber of polygons
[in]nNumber of vertices in each polygon
[in]lTotal number of points, must be L=SUM(N)
[in]xX coordinates of the vertices
[in]yY coordinates of the vertices
[out]ierrError code

Definition at line 35 of file template.f.

References gridman::gridman_dp, gridman_grid2d_check(), gridman_grid_allocate(), gridman_grid_deallocate(), gridman_index_allocate(), and gridman::gridman_sp.

Referenced by gridman_template_read_grid().

Here is the call graph for this function:

Here is the caller graph for this function:

subroutine gridman_grid2template ( type(gridman_grid)  GRID,
integer(gridman_sp), intent(out)  M,
integer(gridman_sp), dimension(:), allocatable  N,
integer(gridman_sp), intent(out)  L,
real(gridman_dp), dimension(:), allocatable  X,
real(gridman_dp), dimension(:), allocatable  Y,
integer, intent(out)  IERR 
)

Convert GRIDMAN_GRID object into arrays which can be stored in simple template format (DG template)

WARNING: arrays N, X, Y must NOT be allcoated - they are allocated inside the subroutine. Arrays which already exist will be re-allocated

Each edge is stored as a separate polygon. This subroutine does not try to build chains of points

Parameters
gridGrid object to be converted
[out]mNumber of polygons
nNumber of vertices in each polygon, N(M)
[out]lTotal number of points, L=SUM(N)
xX coordinates of the vertices, X(L)
yY coordinates of the vertices, Y(L)
[out]ierrError code

Definition at line 239 of file template.f.

References gridman::gridman_dp, gridman_grid2d_check(), and gridman::gridman_sp.

Referenced by gridman_template_write_grid().

Here is the call graph for this function:

Here is the caller graph for this function:

subroutine gridman_template_read_grid ( type(gridman_grid)  GRID,
character(*), intent(in)  FNAME,
integer, intent(out)  IERR 
)

Read from a simple template file (DG template) into GRIDMAN_GRID object.

WARNING: the GRID object will be overwritten if elready exists

This subroutine is a shell for GRIDMAN_TEMPLATE_READ_ARRAY

GRIDMAN_TEMPLATE_READ_ARRAY AND GRIDMAN_TEMPLATE_READ_GRID are combined in the interface GRIDMAN_TEMPLATE_READ

Parameters
gridResulting grid object
[in]fnameString containing the name of input file
[out]ierrError code

Definition at line 335 of file template.f.

References gridman::gridman_dp, gridman::gridman_sp, gridman_template2grid(), and gridman_template_read_array().

Here is the call graph for this function:

subroutine gridman_template_write_grid ( type(gridman_grid)  GRID,
character(*), intent(in)  FNAME,
integer, intent(out)  IERR 
)

Write GRIDMAN_GRID object in a simple template format (DG template)

This subroutine is a shell for GRIDMAN_TEMPLATE_WRITE_ARRAY, it uses GRIDMAN_GRID2TEMPLATE to convert grid into template

GRIDMAN_TEMPLATE_WRITE_ARRAY and GRIDMAN_TEMPLATE_WRITE_GRID are combined in the interface GRIDMAN_TEMPLATE_WRITE

Parameters
gridGrid object to be written
[in]fnameString containing the name of input file
[out]ierrError code

Definition at line 389 of file template.f.

References gridman::gridman_dp, gridman_grid2template(), gridman::gridman_sp, and gridman_template_write_array().

Here is the call graph for this function: