pkGetSpecies
The subroutine pkGetSpecies
returns the value of a given property for one
species or the values of that property for a sequence of species.
pkGetSpecies( Property, Value, SpeciesN[, STAT] )
Name | Description | Data type and attributes |
---|---|---|
Property | Case sensitive name of property | CHARACTER(len=*), INTENT(IN) |
{Value | Value(:)} | Values(s) of property | {CHARACTER(20) | INTEGER | REAL(double)} , INTENT(OUT) |
SpeciesN | {Index of Species | starting index of Species} | INTEGER, INTENT(IN) |
STAT | Execution status indicator | INTEGER, OPTIONAL, INTENT(OUT) |
The Value
argument can be a scalar or an array. In the first
case the value of Property
of
Species(SpeciesN)
is the value returned. In the last case the values returned are the
Property
values from consecutive species from Species(SpeciesN)
to Species(SpeciesN+
SIZE(
Value
)-1)
.
When the properties are of a derived type, the result depends on the
intrinsic type of the dummy argument Value
and is the derived-type
component with the same type as Value
.
STAT
= 0: no errors; STAT
= n: error number.
Example E-9. pkGetSpecies
: Reading the names of all
species into an array.
CHARACTER(20), ALLOCATABLE :: SpcName(:) ... ALLOCATE( SpcName(NSpecies) ) ... CALL pkGetSpecies( 'name', SpcName, 1 )
Example E-10. pkGetSpecies
: Example showing how the
returned values depend on the data type of the Value
argument.
CHARACTER(20) :: SpcFileName INTEGER :: SpcFileIndex ... NAMELIST /TransportData/ Vd, D ... ! Reads transport properties in an external file DO i = NnC+1, NnC+NnTV CALL pkGetSpecies( 'data_file', SpcFileName, i ) CALL pkGetSpecies( 'data_file', SpcFileIndex, i ) OPEN( IOUnit, SpcFileName, ACTION='READ' ) DO j = 1, SpcFileIndex ! Reads file until finding the correct index READ( IOUnit, NML=TransportData, IOSTAT ) END DO CLOSE( IOUnit ) END DO
SpcFileName
will hold the name of the external file
listing the transport parameters for the inquired Species
.SpcFileIndex
indexes the transport
data for each Species
in the external file.