Skip to main content

Data Types

FPL defines structured types that hold NetCDF grid data, coordinates, metadata, and attributes in a single variable.

Naming Convention

Type names follow the pattern:

nc{D}d_{type}_{coord}[_t{ttype}][_l{ltype}]
SegmentValuesMeaning
D2, 3, 4Number of dimensions
typebyte, short, int, float, doubleData precision
coordllf, lldCoordinate precision (float / double)
ttypeti, tf, tdTime dimension type (int / float / double) — 3D/4D only
ltypeli, lfLevel dimension type (int / float) — 4D only

Examples

Type NameDescription
nc2d_float_llf2D float grid, float coordinates
nc3d_int_lld_ti3D integer grid, double coordinates, integer time
nc4d_double_llf_tf_lf4D double grid, float coords, float time, float levels

2D Type Fields

type :: nc2d_{type}_{coord}
sequence
character(len=100) :: varname ! Variable name
character(len=100) :: lonname ! Longitude dimension name
character(len=100) :: latname ! Latitude dimension name
character(len=100) :: long_name ! Descriptive name
character(len=100) :: varunits ! Variable units
character(len=100) :: lonunits ! Longitude units
character(len=100) :: latunits ! Latitude units

integer :: nlons, nlats ! Grid dimensions
integer :: ndims, vartype ! Number of dims, NetCDF type code
{type} :: FillValue ! Missing data marker

real({coord}), allocatable :: longitudes(:) ! Longitude array
real({coord}), allocatable :: latitudes(:) ! Latitude array
{type}, allocatable :: ncdata(:,:) ! Data array (lon × lat)
end type

3D Type Fields

Adds to 2D fields:

FieldTypeDescription
timenamecharacter(100)Time dimension name
timeunitscharacter(100)Time units
ntimesintegerNumber of time steps
times(:)integer/realTime coordinate array
ncdata(:,:,:){type}Data array (lon × lat × time)

4D Type Fields

Adds to 3D fields:

FieldTypeDescription
levelnamecharacter(100)Level dimension name
levelunitscharacter(100)Level units
nlevelsintegerNumber of levels
levels(:)integer/realLevel coordinate array
ncdata(:,:,:,:){type}Data array (lon × lat × time × level)

Internal Metadata Fields

All types also contain these internal fields used by the I/O routines:

FieldTypeDescription
dimname(:)character(100)Dimension names (allocatable)
dimunits(:)character(100)Dimension units (allocatable)
dimid(:)integerNetCDF dimension IDs
dimsize(:)integerDimension sizes
varids(:)integerNetCDF variable IDs
dims(D)integerArray of dimension sizes

Total Types

FPL provides 5 data types × 2 coordinate precisions = 10 variants per dimension class:

ClassVariantsTotal
2D5 types × 2 coords10
3D5 types × 2 coords × 3 time types30
4D5 types × 2 coords × 3 time types × 2 level types60
Grand Total100 types