leapParser Module

Simple parser to read inputs from ASCII files


Uses

  • module~~leapparser~~UsesGraph module~leapparser leapParser module~leapcli leapCli module~leapparser->module~leapcli module~leapkinds leapKinds module~leapparser->module~leapkinds module~leapcli->module~leapkinds iso_fortran_env iso_fortran_env module~leapkinds->iso_fortran_env

Used by

  • module~~leapparser~~UsedByGraph module~leapparser leapParser module~cdifs cdifs module~cdifs->module~leapparser module~leapeulerian leapEulerian module~cdifs->module~leapeulerian module~leapparallel leapParallel module~cdifs->module~leapparallel module~leapsolver leapSolver module~cdifs->module~leapsolver module~leaptimer leapTimer module~cdifs->module~leaptimer module~particles_resolved particles_resolved module~cdifs->module~particles_resolved module~cdifs_cases cdifs_cases module~cdifs->module~cdifs_cases module~immersed_boundaries immersed_boundaries module~cdifs->module~immersed_boundaries module~leapbc leapBC module~cdifs->module~leapbc module~leapblock leapBlock module~cdifs->module~leapblock module~leapdiffop leapDiffOp module~cdifs->module~leapdiffop module~leaphypre leapHypre module~cdifs->module~leaphypre module~leapmonitor leapMonitor module~cdifs->module~leapmonitor module~grans grans module~grans->module~leapparser module~grans->module~leapeulerian module~grans->module~leapparallel module~grans->module~leapsolver module~grans->module~leaptimer module~grans->module~particles_resolved module~grans_cases grans_cases module~grans->module~grans_cases module~grans->module~immersed_boundaries module~grans->module~leapblock module~grans->module~leaphypre module~grans->module~leapmonitor module~particles_point particles_point module~grans->module~particles_point module~immersed_boundaries_markers immersed_boundaries_markers module~immersed_boundaries_markers->module~leapparser module~immersed_boundaries_markers->module~leapeulerian module~leaplagrangian leapLagrangian module~immersed_boundaries_markers->module~leaplagrangian module~immersed_boundaries_markers->module~leapparallel module~immersed_boundaries_markers->module~leaptimer module~immersed_boundaries_markers->module~leapblock module~immersed_boundaries_markers->module~leapdiffop module~immersed_boundaries_markers->module~leaphypre module~immersed_boundaries_markers->module~leapmonitor module~leapio leapIO module~immersed_boundaries_markers->module~leapio module~leapcases leapCases module~leapcases->module~leapparser module~leapcases->module~leapparallel module~leapcases->module~leapblock module~leapeulerian->module~leapparser module~leapeulerian->module~leapparallel module~leapeulerian->module~leapblock module~leapio_mpi leapIO_mpi module~leapeulerian->module~leapio_mpi module~leapeulerian->module~leapio module~leaplagrangian->module~leapparser module~leaplagrangian->module~leapparallel module~leaplagrangian->module~leapblock module~leaplagrangian->module~leapio module~leapparallel->module~leapparser module~leapsolver->module~leapparser module~leapsolver->module~leapparallel module~leapsolver->module~leaptimer module~leaptimer->module~leapparser module~particles_resolved->module~leapparser module~particles_resolved->module~leapeulerian module~particles_resolved->module~leaplagrangian module~particles_resolved->module~leapparallel module~particles_resolved->module~leaptimer module~particles_resolved->module~immersed_boundaries module~particles_resolved->module~leapblock module~particles_resolved->module~leapdiffop module~particles_resolved->module~leapmonitor module~particles_resolved->module~leapio program~main main program~main->module~leapparser program~main->module~cdifs program~main->module~grans program~main->module~leapparallel program~main->module~leapsolver program~main->module~leaptimer module~cdifs_advancesolution_smod cdifs_AdvanceSolution_smod module~cdifs_advancesolution_smod->module~cdifs module~cdifs_cases->module~leapcases module~cdifs_cases->module~leapeulerian module~cdifs_monitor_smod cdifs_Monitor_smod module~cdifs_monitor_smod->module~cdifs module~cdifs_preparesolver_smod cdifs_PrepareSolver_smod module~cdifs_preparesolver_smod->module~cdifs module~cdifs_writeoutputdata_smod cdifs_WriteOutputData_smod module~cdifs_writeoutputdata_smod->module~cdifs module~cdifs_writerestartdata_smod cdifs_WriteRestartData_smod module~cdifs_writerestartdata_smod->module~cdifs module~grans_advancesolution_smod grans_AdvanceSolution_smod module~grans_advancesolution_smod->module~grans module~grans_cases->module~leapcases module~grans_cases->module~leapeulerian module~grans_cases->module~particles_resolved module~grans_cases->module~immersed_boundaries module~grans_cases->module~particles_point module~grans_module_smod grans_module_smod module~grans_module_smod->module~grans module~grans_preparesolver_smod grans_PrepareSolver_smod module~grans_preparesolver_smod->module~grans module~grans_writeoutputdata_smod grans_WriteOutputData_smod module~grans_writeoutputdata_smod->module~grans module~grans_writerestartdata_smod grans_WriteRestartData_smod module~grans_writerestartdata_smod->module~grans module~immersed_boundaries->module~immersed_boundaries_markers module~immersed_boundaries_solids immersed_boundaries_solids module~immersed_boundaries->module~immersed_boundaries_solids module~immersed_boundaries_solids->module~immersed_boundaries_markers module~immersed_boundaries_solids->module~leapeulerian module~immersed_boundaries_solids->module~leaplagrangian module~immersed_boundaries_solids->module~leapparallel module~immersed_boundaries_solids->module~leapblock module~immersed_boundaries_solids->module~leapio module~leapbc->module~leapeulerian module~leapbc->module~leapparallel module~leapbc->module~leapblock module~leapblock->module~leapparallel module~leapdiffop->module~leapeulerian module~leapdiffop->module~leapparallel module~leapdiffop->module~leapbc module~leapdiffop->module~leapblock module~leaphypre->module~leapeulerian module~leaphypre->module~leapparallel module~leaphypre->module~leapblock module~leapio_h5hut leapIO_h5hut module~leapio_h5hut->module~leapparallel module~leapio_hdf5 leapIO_hdf5 module~leapio_hdf5->module~leapparallel module~leapio_mpi->module~leapparallel module~leapio_mpi->module~leapblock module~leapio_silo leapIO_silo module~leapio_silo->module~leapparallel module~leapio_silo->module~leapblock module~leapmonitor->module~leapparallel module~particles_point->module~leapeulerian module~particles_point->module~leaplagrangian module~particles_point->module~leapparallel module~particles_point->module~leapblock module~particles_point->module~leapio proc~add_markers add_markers proc~add_markers->module~particles_resolved proc~add_markers->module~immersed_boundaries proc~add_markers~2 add_markers proc~add_markers~2->module~particles_resolved proc~add_markers~2->module~immersed_boundaries proc~bc_set_buildmask bc_set%bc_set_BuildMask proc~bc_set_buildmask->module~leapeulerian proc~cdifs_rebound_respart cdifs_rebound_ResPart proc~cdifs_rebound_respart->module~particles_resolved proc~cdifs_settling_sphere_respart cdifs_settling_sphere_ResPart proc~cdifs_settling_sphere_respart->module~particles_resolved module~cavity_smod cavity_smod module~cavity_smod->module~cdifs_cases module~channel_flow_smod channel_flow_smod module~channel_flow_smod->module~cdifs_cases module~cylinder_smod cylinder_smod module~cylinder_smod->module~cdifs_cases module~headon_collision_smod headon_collision_smod module~headon_collision_smod->module~grans_cases module~homogeneous_cooling_smod homogeneous_cooling_smod module~homogeneous_cooling_smod->module~grans_cases module~lamb_oseen_smod lamb_oseen_smod module~lamb_oseen_smod->module~cdifs_cases module~leapio->module~leapio_h5hut module~leapio->module~leapio_hdf5 module~leapio->module~leapio_mpi module~leapio->module~leapio_silo module~nga_smod nga_smod module~nga_smod->module~particles_point module~rebound_smod rebound_smod module~rebound_smod->module~cdifs_cases module~rotating_drum_smod rotating_drum_smod module~rotating_drum_smod->module~grans_cases module~settling_sphere_smod settling_sphere_smod module~settling_sphere_smod->module~cdifs_cases module~taylor_green_smod taylor_green_smod module~taylor_green_smod->module~cdifs_cases module~vortex_dipole_smod vortex_dipole_smod module~vortex_dipole_smod->module~cdifs_cases module~vortex_impingement_smod vortex_impingement_smod module~vortex_impingement_smod->module~cdifs_cases proc~block_obj_read block_obj%block_obj_Read proc~block_obj_read->module~leapio_hdf5 proc~block_obj_write block_obj%block_obj_Write proc~block_obj_write->module~leapio_hdf5 proc~cdifs_channel_flow_bcs cdifs_channel_flow_bcs proc~cdifs_channel_flow_bcs->module~leapbc proc~cdifs_channel_flow_block cdifs_channel_flow_block proc~cdifs_channel_flow_block->module~leapblock proc~cdifs_cylinder_bcs cdifs_cylinder_bcs proc~cdifs_cylinder_bcs->module~leapbc proc~cdifs_cylinder_ib cdifs_cylinder_IB proc~cdifs_cylinder_ib->module~immersed_boundaries proc~cdifs_lamb_oseen_bcs cdifs_lamb_oseen_bcs proc~cdifs_lamb_oseen_bcs->module~leapbc proc~cdifs_lid_driven_cavity_bcs cdifs_lid_driven_cavity_bcs proc~cdifs_lid_driven_cavity_bcs->module~leapbc proc~cdifs_lid_driven_cavity_block cdifs_lid_driven_cavity_block proc~cdifs_lid_driven_cavity_block->module~leapblock proc~cdifs_obj_preparesolveroperators cdifs_obj_PrepareSolverOperators proc~cdifs_obj_preparesolveroperators->module~leapbc proc~cdifs_obj_preparesolveroperatorsdiv cdifs_obj_PrepareSolverOperatorsDIV proc~cdifs_obj_preparesolveroperatorsdiv->module~leapbc proc~cdifs_obj_preparesolveroperatorspgrad cdifs_obj_PrepareSolverOperatorsPGRAD proc~cdifs_obj_preparesolveroperatorspgrad->module~leapbc proc~cdifs_obj_preparesolveroperatorsvlap cdifs_obj_PrepareSolverOperatorsVLAP proc~cdifs_obj_preparesolveroperatorsvlap->module~leapbc proc~cdifs_rebound_bcs cdifs_rebound_bcs proc~cdifs_rebound_bcs->module~leapbc proc~cdifs_rebound_ib cdifs_rebound_IB proc~cdifs_rebound_ib->module~immersed_boundaries proc~cdifs_settling_sphere_bcs cdifs_settling_sphere_bcs proc~cdifs_settling_sphere_bcs->module~leapbc proc~cdifs_settling_sphere_ib cdifs_settling_sphere_IB proc~cdifs_settling_sphere_ib->module~immersed_boundaries proc~cdifs_taylor_green_bcs cdifs_taylor_green_bcs proc~cdifs_taylor_green_bcs->module~leapbc proc~cdifs_vortex_dipole_bcs cdifs_vortex_dipole_bcs proc~cdifs_vortex_dipole_bcs->module~leapbc proc~cdifs_vortex_impingement_bcs cdifs_vortex_impingement_bcs proc~cdifs_vortex_impingement_bcs->module~leapbc proc~cdifs_vortex_impingement_block cdifs_vortex_impingement_block proc~cdifs_vortex_impingement_block->module~leapblock proc~grans_obj_preparesolver_operators grans_obj_PrepareSolver_operators proc~grans_obj_preparesolver_operators->module~leapdiffop proc~marker_set_computesolidvolfrac marker_set%marker_set_ComputeSolidVolFrac proc~marker_set_computesolidvolfrac->module~leapdiffop proc~op_obj_applylaplaciandc op_obj%op_obj_ApplyLaplacianDC proc~op_obj_applylaplaciandc->module~leapbc proc~bc_set_read bc_set%bc_set_Read proc~bc_set_read->module~leapio proc~bc_set_write bc_set%bc_set_Write proc~bc_set_write->module~leapio

Variables

Type Visibility Attributes Name Initial
character(len=3), private, parameter :: COMMENT_SYMBOLS = '!#%'

Allowed comment symbols

integer, private, parameter :: MAX_LABEL_SIZE = 128

Maximum number of characters in a label

integer, private, parameter :: MAX_LINE_SIZE = 4096

Maximum number of characters in a line

character(len=1), private, parameter :: SEPARATOR = ':'

Character used to seperate label form value

integer, private, parameter :: TAB_ICHAR = 9

ichar of a tab character


Derived Types

type, public ::  parser_obj

Type represents a parser that can be used to get information from an input file

Components

Type Visibility Attributes Name Initial
type(entry_obj), public, allocatable :: entries(:)

Entries in an input file

Type-Bound Procedures

procedure, public :: Finalize => parser_obj_final
generic, public :: Get => parser_obj_read0D, parser_obj_read1D
procedure, public :: Initialize => parser_obj_init
procedure, public :: IsDefined => parser_obj_IsDefined
procedure, public :: ParseFile => parser_obj_ParseFile
procedure, public :: Print => parser_obj_print
procedure, private :: AddEntry => parser_obj_AddEntry
generic, private :: AssignDefault => parser_obj_AssignDefault0D, parser_obj_AssignDefault1D
procedure, private :: FetchLabelID => parser_obj_FetchLabelID
procedure, private :: ParseLine => parser_obj_ParseLine
procedure, private, nopass :: parser_obj_AssignDefault0D
procedure, private, nopass :: parser_obj_AssignDefault1D
procedure, private, nopass :: parser_obj_ReformatLine
procedure, private :: parser_obj_read0D
procedure, private :: parser_obj_read1D

type, private ::  entry_obj

Object representing an entry in the input file

Components

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

Column label

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

Value


Functions

private function parser_obj_FetchLabelID(this, label) result(id)

Return ID of label in the array of entries Returns 0 if label not found.

Arguments

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

Parser object

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

label to look for

Return Value integer

private function parser_obj_IsDefined(this, label) result(found)

Check whether the field is defined

Arguments

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

Parser object

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

label to look for

Return Value logical


Subroutines

private subroutine parser_obj_AddEntry(this, entry)

Resize entries array to add a new entry

Arguments

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

Parser object

type(entry_obj), intent(in) :: entry

New entrysize

private subroutine parser_obj_AssignDefault0D(value, default)

Assing default to value: 0D version

Arguments

Type IntentOptional Attributes Name
class(*), intent(out) :: value

Value to return

class(*), intent(in) :: default

Default value to return in case label is not found

private subroutine parser_obj_AssignDefault1D(value, default)

Assing default to value: 1D version

Arguments

Type IntentOptional Attributes Name
class(*), intent(out) :: value(:)

Value to return

class(*), intent(in) :: default(:)

Default value to return in case label is not found

private subroutine parser_obj_ParseFile(this, optInput)

Read & parse the input file

Arguments

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

Parser object

character(len=*), intent(in), optional :: optInput

Optional input file name

private subroutine parser_obj_ParseLine(this, line)

Parse a line

Arguments

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

Parser object

character(len=MAX_LINE_SIZE), intent(inout) :: line

A line from the input file

private subroutine parser_obj_ReformatLine(line)

Parse a line

Arguments

Type IntentOptional Attributes Name
character(len=MAX_LINE_SIZE), intent(inout) :: line

A line from the input file

private subroutine parser_obj_final(this)

Finalization routine

Arguments

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

Parser object

private subroutine parser_obj_init(this)

Initialization the praser

Arguments

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

Parser object

private subroutine parser_obj_print(this)

Prints all variables found in the parsed file

Arguments

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

Parser object

private subroutine parser_obj_read0D(this, label, value, default)

Read value: 0D version

Arguments

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

Parser object

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

Label

class(*), intent(out) :: value

Value to return

class(*), intent(in), optional :: default

Default value to return in case label is not found

private subroutine parser_obj_read1D(this, label, value, default)

Read value: 1D version

Arguments

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

Parser object

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

Label

class(*), intent(out) :: value(:)

Value to return

class(*), intent(in), optional :: default(:)

Default value to return in case label is not found