Module for serialising beat, log, node, observation, sensor, and target
derived types to CSV, JSON, JSONL, and Namelist.
The following serialisation formats are valid:
FORMAT_CSV
FORMAT_JSON
FORMAT_JSONL
FORMAT_NML
The example reads sensors from an observation database and writes them
in JSON format to a scratch file:
integer :: rc , unit
type ( db_type ) :: db
type ( db_stmt_type ) :: db_stmt
type ( sensor_type ) :: sensor
type ( serial_class ) :: serial
rc = dm_db_open ( db , '/var/dmpack/observ.sqlite' )
rc = dm_db_select_sensors ( db , db_stmt , sensor )
open ( action = 'readwrite' , form = 'formatted' , newunit = unit , status = 'scratch' )
call serial % create ( sensor , FORMAT_JSON , unit = unit , empty = ( rc /= E_NONE ))
do while ( rc == E_NONE )
call serial % next ( sensor )
rc = dm_db_select_sensors ( db , db_stmt , sensor )
end do
call serial % destroy ()
close ( unit )
call dm_db_finalize ( db_stmt )
call dm_db_close ( db )
module~~dm_serial~~UsesGraph
module~dm_serial
dm_serial
module~dm_ascii
dm_ascii
module~dm_serial->module~dm_ascii
module~dm_csv
dm_csv
module~dm_serial->module~dm_csv
module~dm_error
dm_error
module~dm_serial->module~dm_error
module~dm_format
dm_format
module~dm_serial->module~dm_format
module~dm_json
dm_json
module~dm_serial->module~dm_json
module~dm_kind
dm_kind
module~dm_serial->module~dm_kind
module~dm_nml
dm_nml
module~dm_serial->module~dm_nml
module~dm_type
dm_type
module~dm_serial->module~dm_type
module~dm_csv->module~dm_ascii
module~dm_csv->module~dm_error
module~dm_csv->module~dm_kind
module~dm_string
dm_string
module~dm_csv->module~dm_string
module~dm_util
dm_util
module~dm_csv->module~dm_util
module~dm_error->module~dm_ascii
module~dm_error->module~dm_kind
module~dm_json->module~dm_error
module~dm_json->module~dm_kind
module~dm_dp
dm_dp
module~dm_json->module~dm_dp
module~dm_json->module~dm_util
iso_fortran_env
iso_fortran_env
module~dm_kind->iso_fortran_env
module~dm_nml->module~dm_error
module~dm_nml->module~dm_kind
module~dm_nml->module~dm_util
module~dm_dp->module~dm_error
module~dm_dp->module~dm_kind
module~dm_time
dm_time
module~dm_dp->module~dm_time
module~dm_string->module~dm_error
module~dm_string->module~dm_kind
module~dm_util->module~dm_error
module~dm_util->module~dm_kind
module~dm_time->module~dm_error
module~dm_time->module~dm_kind
module~dm_time->module~dm_util
unix
unix
module~dm_time->unix
Nodes of different colours represent the following:
Graph Key
Module
Module
Submodule
Submodule
Subroutine
Subroutine
Function
Function
Program
Program
This Page's Entity
This Page's Entity
Solid arrows point from a submodule to the (sub)module which it is
descended from. Dashed arrows point from a module or program unit to
modules which it uses.
module~~dm_serial~~UsedByGraph
module~dm_serial
dm_serial
module~dmpack
dmpack
module~dmpack->module~dm_serial
Nodes of different colours represent the following:
Graph Key
Module
Module
Submodule
Submodule
Subroutine
Subroutine
Function
Function
Program
Program
This Page's Entity
This Page's Entity
Solid arrows point from a submodule to the (sub)module which it is
descended from. Dashed arrows point from a module or program unit to
modules which it uses.
Variables
Type
Visibility Attributes
Name
Initial
integer,
public,
parameter
::
SERIAL_UNIT_NONE
=
-99999
Default file unit.
Derived Types
Serialisation class.
Type-Bound Procedures
procedure, public ::
create => serial_create
procedure, public ::
destroy => serial_destroy
generic, public ::
next => next_beat, next_log, next_node, next_observ, next_sensor, next_target