json_file_module Module

module~~json_file_module~~UsesGraph module~json_file_module json_file_module iso_fortran_env iso_fortran_env iso_fortran_env->module~json_file_module module~json_value_module json_value_module iso_fortran_env->module~json_value_module module~json_kinds json_kinds iso_fortran_env->module~json_kinds module~json_string_utilities json_string_utilities module~json_string_utilities->module~json_file_module module~json_string_utilities->module~json_value_module module~json_value_module->module~json_file_module module~json_kinds->module~json_file_module module~json_kinds->module~json_string_utilities module~json_kinds->module~json_value_module module~json_parameters json_parameters module~json_kinds->module~json_parameters module~json_parameters->module~json_file_module module~json_parameters->module~json_string_utilities module~json_parameters->module~json_value_module
Help

Higher-level json_file interface for the json_value type.

License

  • JSON-Fortran is released under a BSD-style license. See the LICENSE file for details.

Used By

module~~json_file_module~~UsedByGraph module~json_file_module json_file_module module~json_module json_module module~json_file_module->module~json_module module~jf_test_1_mod jf_test_1_mod module~json_module->module~jf_test_1_mod module~jf_test_15_mod jf_test_15_mod module~json_module->module~jf_test_15_mod module~jf_test_9_mod jf_test_9_mod module~json_module->module~jf_test_9_mod module~jf_test_17_mod jf_test_17_mod module~json_module->module~jf_test_17_mod module~jf_test_7_mod jf_test_7_mod module~json_module->module~jf_test_7_mod module~jf_test_13_mod jf_test_13_mod module~json_module->module~jf_test_13_mod module~jf_test_14_mod jf_test_14_mod module~json_module->module~jf_test_14_mod module~jf_test_4_mod jf_test_4_mod module~json_module->module~jf_test_4_mod module~jf_test_18_mod jf_test_18_mod module~json_module->module~jf_test_18_mod module~jf_test_3_mod jf_test_3_mod module~json_module->module~jf_test_3_mod module~jf_test_11_mod jf_test_11_mod module~json_module->module~jf_test_11_mod module~jf_test_16_mod jf_test_16_mod module~json_module->module~jf_test_16_mod module~jf_test_8_mod jf_test_8_mod module~json_module->module~jf_test_8_mod module~jf_test_19_mod jf_test_19_mod module~json_module->module~jf_test_19_mod module~jf_test_6_mod jf_test_6_mod module~json_module->module~jf_test_6_mod module~jf_test_10_mod jf_test_10_mod module~json_module->module~jf_test_10_mod module~jf_test_12_mod jf_test_12_mod module~json_module->module~jf_test_12_mod module~jf_test_5_mod jf_test_5_mod module~json_module->module~jf_test_5_mod module~jf_test_2_mod jf_test_2_mod module~json_module->module~jf_test_2_mod module~jf_test_20_mod jf_test_20_mod module~json_module->module~jf_test_20_mod program~jf_test_1 jf_test_1 module~jf_test_1_mod->program~jf_test_1 program~jf_test_15 jf_test_15 module~jf_test_15_mod->program~jf_test_15 program~jf_test_9 jf_test_9 module~jf_test_9_mod->program~jf_test_9 program~jf_test_17 jf_test_17 module~jf_test_17_mod->program~jf_test_17 program~jf_test_7 jf_test_7 module~jf_test_7_mod->program~jf_test_7 program~jf_test_13 jf_test_13 module~jf_test_13_mod->program~jf_test_13 program~jf_test_14 jf_test_14 module~jf_test_14_mod->program~jf_test_14 program~jf_test_4 jf_test_4 module~jf_test_4_mod->program~jf_test_4 program~jf_test_18 jf_test_18 module~jf_test_18_mod->program~jf_test_18 program~jf_test_3 jf_test_3 module~jf_test_3_mod->program~jf_test_3 program~jf_test_11 jf_test_11 module~jf_test_11_mod->program~jf_test_11 program~jf_test_16 jf_test_16 module~jf_test_16_mod->program~jf_test_16 program~jf_test_8 jf_test_8 module~jf_test_8_mod->program~jf_test_8 program~jf_test_19 jf_test_19 module~jf_test_19_mod->program~jf_test_19 program~jf_test_6 jf_test_6 module~jf_test_6_mod->program~jf_test_6 program~jf_test_10 jf_test_10 module~jf_test_10_mod->program~jf_test_10 program~jf_test_12 jf_test_12 module~jf_test_12_mod->program~jf_test_12 program~jf_test_5 jf_test_5 module~jf_test_5_mod->program~jf_test_5 program~jf_test_2 jf_test_2 module~jf_test_2_mod->program~jf_test_2 program~jf_test_20 jf_test_20 module~jf_test_20_mod->program~jf_test_20
Help


Interfaces

public interface json_file

Structure constructor to initialize a json_file object with an existing json_value object, and either the json_core settings or a json_core instance.

  • private function initialize_json_file(p, verbose, compact_reals, print_signs, real_format, spaces_per_tab, strict_type_checking, trailing_spaces_significant, case_sensitive_keys, no_whitespace, unescape_strings) result(file_object)

    Author
    Izaak Beekman
    Date
    07/23/2015

    Cast a json_value object as a json_file object. It also calls the initialize() method.

    Arguments

    Type IntentOptional AttributesName
    type(json_value), intent(in), optional pointer:: p

    json_value object to cast as a json_file object

    logical(kind=LK), intent(in), optional :: verbose

    mainly useful for debugging (default is false)

    logical(kind=LK), intent(in), optional :: compact_reals

    to compact the real number strings for output (default is true)

    logical(kind=LK), intent(in), optional :: print_signs

    always print numeric sign (default is false)

    character(kind=CDK,len=*), intent(in), optional :: real_format

    Real number format: 'E' [default], '*', 'G', 'EN', or 'ES'

    integer(kind=IK), intent(in), optional :: spaces_per_tab

    number of spaces per tab for indenting (default is 2)

    logical(kind=LK), intent(in), optional :: strict_type_checking

    if true, no integer, double, or logical type conversions are done for the get routines (default is false)

    logical(kind=LK), intent(in), optional :: trailing_spaces_significant

    for name and path comparisons, is trailing space to be considered significant. (default is false)

    logical(kind=LK), intent(in), optional :: case_sensitive_keys

    for name and path comparisons, are they case sensitive. (default is true)

    logical(kind=LK), intent(in), optional :: no_whitespace

    if true, printing the JSON structure is done without adding any non-significant spaces or linebreaks (default is false)

    logical(kind=LK), intent(in), optional :: unescape_strings

    If false, then the raw escaped string is returned from json_get_string and similar routines. If true [default], then the string is returned unescaped.

    Return Value type(json_file)

  • private function initialize_json_file_v2(json_value_object, json_core_object) result(file_object)

    Author
    Jacob Williams
    Date
    4/26/2016

    Cast a json_value pointer and a json_core object as a json_file object.

    Arguments

    Type IntentOptional AttributesName
    type(json_value), intent(in), pointer:: json_value_object
    type(json_core), intent(in) :: json_core_object

    Return Value type(json_file)


Derived Types

type, public :: json_file

The json_file is the main public class that is used to open a file and get data from it.

Components

TypeVisibility AttributesNameInitial
type(json_core), private :: core

The instance of the json_core factory used for this file.

type(json_value), private, pointer:: p=> null()

the JSON structure read from the file

Constructor

Structure constructor to initialize a json_file object with an existing json_value object, and either the json_core settings or a json_core instance.

private function initialize_json_file(p, verbose, compact_reals, print_signs, real_format, spaces_per_tab, strict_type_checking, trailing_spaces_significant, case_sensitive_keys, no_whitespace, unescape_strings)

Cast a json_value object as a json_file object. It also calls the initialize() method.

private function initialize_json_file_v2(json_value_object, json_core_object)

Cast a json_value pointer and a json_core object as a json_file object.

Type-Bound Procedures

procedure, public :: check_for_errors => json_file_check_for_errors
procedure, public :: clear_exceptions => json_file_clear_exceptions
procedure, public :: destroy => json_file_destroy
procedure, public :: failed => json_file_failed
generic, public :: get => json_file_get_object, json_file_get_integer, json_file_get_double, json_file_get_logical, json_file_get_string, json_file_get_integer_vec, json_file_get_double_vec, json_file_get_logical_vec, json_file_get_string_vec, json_file_get_root
procedure, public :: get_core => get_json_core_in_file
generic, public :: info => json_file_variable_info
generic, public :: initialize => initialize_json_core_in_file, set_json_core_in_file
procedure, public :: initialize_json_core_in_file
procedure, public :: json_file_get_double
procedure, public :: json_file_get_double_vec
procedure, public :: json_file_get_integer
procedure, public :: json_file_get_integer_vec
procedure, public :: json_file_get_logical
procedure, public :: json_file_get_logical_vec
procedure, public :: json_file_get_object
procedure, public :: json_file_get_root
procedure, public :: json_file_get_string
procedure, public :: json_file_get_string_vec
procedure, public :: json_file_load_from_string
procedure, public :: json_file_print_1
procedure, public :: json_file_print_2
procedure, public :: json_file_print_to_console
procedure, public :: json_file_update_integer
procedure, public :: json_file_update_logical
procedure, public :: json_file_update_real
procedure, public :: json_file_update_string
procedure, public :: json_file_variable_info
procedure, public :: json_file_variable_matrix_info
procedure, public :: load_file => json_file_load
generic, public :: load_from_string => json_file_load_from_string
generic, public :: matrix_info => json_file_variable_matrix_info
procedure, public :: move => json_file_move_pointer
procedure, public :: print_error_message => json_file_print_error_message
generic, public :: print_file => json_file_print_to_console, json_file_print_1, json_file_print_2
procedure, public :: print_to_string => json_file_print_to_string
procedure, public :: set_json_core_in_file
procedure, public :: traverse => json_file_traverse
generic, public :: update => json_file_update_integer, json_file_update_logical, json_file_update_real, json_file_update_string

Functions

private function initialize_json_file(p, verbose, compact_reals, print_signs, real_format, spaces_per_tab, strict_type_checking, trailing_spaces_significant, case_sensitive_keys, no_whitespace, unescape_strings) result(file_object)

Author
Izaak Beekman
Date
07/23/2015

Cast a json_value object as a json_file object. It also calls the initialize() method.

Arguments

Type IntentOptional AttributesName
type(json_value), intent(in), optional pointer:: p

json_value object to cast as a json_file object

logical(kind=LK), intent(in), optional :: verbose

mainly useful for debugging (default is false)

logical(kind=LK), intent(in), optional :: compact_reals

to compact the real number strings for output (default is true)

logical(kind=LK), intent(in), optional :: print_signs

always print numeric sign (default is false)

character(kind=CDK,len=*), intent(in), optional :: real_format

Real number format: 'E' [default], '*', 'G', 'EN', or 'ES'

integer(kind=IK), intent(in), optional :: spaces_per_tab

number of spaces per tab for indenting (default is 2)

logical(kind=LK), intent(in), optional :: strict_type_checking

if true, no integer, double, or logical type conversions are done for the get routines (default is false)

logical(kind=LK), intent(in), optional :: trailing_spaces_significant

for name and path comparisons, is trailing space to be considered significant. (default is false)

logical(kind=LK), intent(in), optional :: case_sensitive_keys

for name and path comparisons, are they case sensitive. (default is true)

logical(kind=LK), intent(in), optional :: no_whitespace

if true, printing the JSON structure is done without adding any non-significant spaces or linebreaks (default is false)

logical(kind=LK), intent(in), optional :: unescape_strings

If false, then the raw escaped string is returned from json_get_string and similar routines. If true [default], then the string is returned unescaped.

Return Value type(json_file)

private function initialize_json_file_v2(json_value_object, json_core_object) result(file_object)

Author
Jacob Williams
Date
4/26/2016

Cast a json_value pointer and a json_core object as a json_file object.

Arguments

Type IntentOptional AttributesName
type(json_value), intent(in), pointer:: json_value_object
type(json_core), intent(in) :: json_core_object

Return Value type(json_file)

private pure function json_file_failed(me) result(failed)

Check error status in the file.

Arguments

Type IntentOptional AttributesName
class(json_file), intent(in) :: me

Return Value logical(kind=LK)

will be true if there has been an error.


Subroutines

private subroutine get_json_core_in_file(me, core)

Get a copy of the json_core in this json_file.

Arguments

Type IntentOptional AttributesName
class(json_file), intent(in) :: me
type(json_core), intent(out) :: core

private subroutine initialize_json_core_in_file(me, verbose, compact_reals, print_signs, real_format, spaces_per_tab, strict_type_checking, trailing_spaces_significant, case_sensitive_keys, no_whitespace, unescape_strings)

Initialize the json_core for this json_file. This is just a wrapper for json_initialize.

Arguments

Type IntentOptional AttributesName
class(json_file), intent(inout) :: me
logical(kind=LK), intent(in), optional :: verbose

mainly useful for debugging (default is false)

logical(kind=LK), intent(in), optional :: compact_reals

to compact the real number strings for output (default is true)

logical(kind=LK), intent(in), optional :: print_signs

always print numeric sign (default is false)

character(kind=CDK,len=*), intent(in), optional :: real_format

Real number format: 'E' [default], '*', 'G', 'EN', or 'ES'

integer(kind=IK), intent(in), optional :: spaces_per_tab

number of spaces per tab for indenting (default is 2)

logical(kind=LK), intent(in), optional :: strict_type_checking

if true, no integer, double, or logical type conversions are done for the get routines (default is false)

logical(kind=LK), intent(in), optional :: trailing_spaces_significant

for name and path comparisons, is trailing space to be considered significant. (default is false)

logical(kind=LK), intent(in), optional :: case_sensitive_keys

for name and path comparisons, are they case sensitive. (default is true)

logical(kind=LK), intent(in), optional :: no_whitespace

if true, printing the JSON structure is done without adding any non-significant spaces or linebreaks (default is false)

logical(kind=LK), intent(in), optional :: unescape_strings

If false, then the raw escaped string is returned from json_get_string and similar routines. If true [default], then the string is returned unescaped.

private subroutine json_file_check_for_errors(me, status_ok, error_msg)

Retrieve error status and message from the class.

Arguments

Type IntentOptional AttributesName
class(json_file), intent(inout) :: me
logical(kind=LK), intent(out) :: status_ok

true if there were no errors

character(kind=CK,len=:), intent(out), allocatable:: error_msg

the error message (if there were errors)

private pure subroutine json_file_clear_exceptions(me)

Clear exceptions in the class.

Arguments

Type IntentOptional AttributesName
class(json_file), intent(inout) :: me

private subroutine json_file_destroy(me, destroy_core)

Author
Jacob Williams

Destroy the json_value data in a json_file. This must be done when the variable is no longer needed, or will be reused to open a different file. Otherwise a memory leak will occur.

Arguments

Type IntentOptional AttributesName
class(json_file), intent(inout) :: me
logical, intent(in), optional :: destroy_core

to also destroy the json_core. default is to leave it as is.

private subroutine json_file_get_double(me, path, val, found)

Author
Jacob Williams
Date
12/9/2013

Get a real(RK) variable value from a JSON file.

Arguments

Type IntentOptional AttributesName
class(json_file), intent(inout) :: me
character(kind=CK,len=*), intent(in) :: path
real(kind=RK), intent(out) :: val
logical(kind=LK), intent(out), optional :: found

private subroutine json_file_get_double_vec(me, path, vec, found)

Author
Jacob Williams
Date
1/19/2014

Get a real(RK) vector from a JSON file.

Arguments

Type IntentOptional AttributesName
class(json_file), intent(inout) :: me
character(kind=CK,len=*), intent(in) :: path
real(kind=RK), intent(out), dimension(:), allocatable:: vec
logical(kind=LK), intent(out), optional :: found

private subroutine json_file_get_integer(me, path, val, found)

Author
Jacob Williams
Date
12/9/2013

Get an integer value from a JSON file.

Arguments

Type IntentOptional AttributesName
class(json_file), intent(inout) :: me
character(kind=CK,len=*), intent(in) :: path

the path to the variable

integer(kind=IK), intent(out) :: val

value

logical(kind=LK), intent(out), optional :: found

if it was really found

private subroutine json_file_get_integer_vec(me, path, vec, found)

Author
Jacob Williams
Date
1/20/2014

Get an integer vector from a JSON file.

Arguments

Type IntentOptional AttributesName
class(json_file), intent(inout) :: me
character(kind=CK,len=*), intent(in) :: path

the path to the variable

integer(kind=IK), intent(out), dimension(:), allocatable:: vec

the value vector

logical(kind=LK), intent(out), optional :: found

if it was really found

private subroutine json_file_get_logical(me, path, val, found)

Author
Jacob Williams
Date
12/9/2013

Get a logical(LK) value from a JSON file.

Arguments

Type IntentOptional AttributesName
class(json_file), intent(inout) :: me
character(kind=CK,len=*), intent(in) :: path
logical(kind=LK), intent(out) :: val
logical(kind=LK), intent(out), optional :: found

private subroutine json_file_get_logical_vec(me, path, vec, found)

Author
Jacob Williams
Date
1/20/2014

Get a logical(LK) vector from a JSON file.

Arguments

Type IntentOptional AttributesName
class(json_file), intent(inout) :: me
character(kind=CK,len=*), intent(in) :: path
logical(kind=LK), intent(out), dimension(:), allocatable:: vec
logical(kind=LK), intent(out), optional :: found

private subroutine json_file_get_object(me, path, p, found)

Author
Jacob Williams
Date
2/3/2014

Get a json_value pointer to an object from a JSON file.

Arguments

Type IntentOptional AttributesName
class(json_file), intent(inout) :: me
character(kind=CK,len=*), intent(in) :: path

the path to the variable

type(json_value), intent(out), pointer:: p

pointer to the variable

logical(kind=LK), intent(out), optional :: found

if it was really found

private subroutine json_file_get_root(me, p)

Author
Izaak Beekman
Date
7/23/2015

Get a json_value pointer to the JSON file root.

Arguments

Type IntentOptional AttributesName
class(json_file), intent(inout) :: me
type(json_value), intent(out), pointer:: p

pointer to the variable

private subroutine json_file_get_string(me, path, val, found)

Author
Jacob Williams
Date
12/9/2013

Get a character string from a json file. The output val is an allocatable character string.

Arguments

Type IntentOptional AttributesName
class(json_file), intent(inout) :: me
character(kind=CK,len=*), intent(in) :: path
character(kind=CK,len=:), intent(out), allocatable:: val
logical(kind=LK), intent(out), optional :: found

private subroutine json_file_get_string_vec(me, path, vec, found)

Author
Jacob Williams
Date
1/19/2014

Get a string vector from a JSON file.

Arguments

Type IntentOptional AttributesName
class(json_file), intent(inout) :: me
character(kind=CK,len=*), intent(in) :: path
character(kind=CK,len=*), intent(out), dimension(:), allocatable:: vec
logical(kind=LK), intent(out), optional :: found

private subroutine json_file_load(me, filename, unit)

Author
Jacob Williams
Date
12/9/2013

Load the JSON data from a file.

Arguments

Type IntentOptional AttributesName
class(json_file), intent(inout) :: me
character(kind=CDK,len=*), intent(in) :: filename

the filename to open

integer(kind=IK), intent(in), optional :: unit

the unit number to use (if not present, a newunit is used)

private subroutine json_file_load_from_string(me, str)

Author
Jacob Williams
Date
1/13/2015

Load the JSON data from a string.

Arguments

Type IntentOptional AttributesName
class(json_file), intent(inout) :: me
character(kind=CK,len=*), intent(in) :: str

string to load JSON data from

private subroutine json_file_move_pointer(to, from)

Author
Jacob Williams
Date
12/5/2014

Move the json_value pointer from one json_file to another. The "from" pointer is then nullified, but not destroyed.

Arguments

Type IntentOptional AttributesName
class(json_file), intent(inout) :: to
class(json_file), intent(inout) :: from

private subroutine json_file_print_1(me, iunit)

Author
Jacob Williams
Date
12/9/2013

Prints the JSON file to the specified file unit number.

Arguments

Type IntentOptional AttributesName
class(json_file), intent(inout) :: me
integer(kind=IK), intent(in) :: iunit

file unit number (must not be -1)

private subroutine json_file_print_2(me, filename)

Author
Jacob Williams
Date
1/11/2015

Print the JSON structure to the specified filename. The file is opened, printed, and then closed.

Arguments

Type IntentOptional AttributesName
class(json_file), intent(inout) :: me
character(kind=CDK,len=*), intent(in) :: filename

filename to print to

private subroutine json_file_print_error_message(me, io_unit)

This is a wrapper for json_print_error_message.

Arguments

Type IntentOptional AttributesName
class(json_file), intent(inout) :: me
integer, intent(in), optional :: io_unit

private subroutine json_file_print_to_console(me)

Author
Jacob Williams
Date
1/11/2015

Print the JSON file to the console.

Arguments

Type IntentOptional AttributesName
class(json_file), intent(inout) :: me

private subroutine json_file_print_to_string(me, str)

Author
Jacob Williams
Date
1/11/2015

Print the JSON file to a string.

Arguments

Type IntentOptional AttributesName
class(json_file), intent(inout) :: me
character(kind=CK,len=:), intent(out), allocatable:: str

string to print JSON data to

private subroutine json_file_traverse(me, traverse_callback)

Author
Jacob Williams
Date
6/11/2016

Traverse the JSON structure in the file. This routine calls the user-specified json_traverse_callback_func for each element of the structure.

Arguments

Type IntentOptional AttributesName
class(json_file), intent(inout) :: me
procedure(json_traverse_callback_func) :: traverse_callback

private subroutine json_file_update_integer(me, name, val, found)

Author
Jacob Williams
Date
1/10/2015

Given the path string, if the variable is present in the file, and is a scalar, then update its value. If it is not present, then create it and set its value.

Arguments

Type IntentOptional AttributesName
class(json_file), intent(inout) :: me
character(kind=CK,len=*), intent(in) :: name
integer(kind=IK), intent(in) :: val
logical(kind=LK), intent(out) :: found

private subroutine json_file_update_logical(me, name, val, found)

Author
Jacob Williams
Date
1/10/2015

Given the path string, if the variable is present in the file, and is a scalar, then update its value. If it is not present, then create it and set its value.

Arguments

Type IntentOptional AttributesName
class(json_file), intent(inout) :: me
character(kind=CK,len=*), intent(in) :: name
logical(kind=LK), intent(in) :: val
logical(kind=LK), intent(out) :: found

private subroutine json_file_update_real(me, name, val, found)

Author
Jacob Williams
Date
1/10/2015

Given the path string, if the variable is present in the file, and is a scalar, then update its value. If it is not present, then create it and set its value.

Arguments

Type IntentOptional AttributesName
class(json_file), intent(inout) :: me
character(kind=CK,len=*), intent(in) :: name
real(kind=RK), intent(in) :: val
logical(kind=LK), intent(out) :: found

private subroutine json_file_update_string(me, name, val, found)

Author
Jacob Williams
Date
1/10/2015

Given the path string, if the variable is present in the file, and is a scalar, then update its value. If it is not present, then create it and set its value.

Arguments

Type IntentOptional AttributesName
class(json_file), intent(inout) :: me
character(kind=CK,len=*), intent(in) :: name
character(kind=CK,len=*), intent(in) :: val
logical(kind=LK), intent(out) :: found

private subroutine json_file_update_string_name_ascii(me, name, val, found)

Alternate version of json_file_update_string, where "name" is kind=CDK.

Arguments

Type IntentOptional AttributesName
class(json_file), intent(inout) :: me
character(kind=CDK,len=*), intent(in) :: name
character(kind=CK,len=*), intent(in) :: val
logical(kind=LK), intent(out) :: found

private subroutine json_file_update_string_val_ascii(me, name, val, found)

Alternate version of json_file_update_string, where "val" is kind=CDK.

Arguments

Type IntentOptional AttributesName
class(json_file), intent(inout) :: me
character(kind=CK,len=*), intent(in) :: name
character(kind=CDK,len=*), intent(in) :: val
logical(kind=LK), intent(out) :: found

private subroutine json_file_variable_info(me, path, found, var_type, n_children, name)

Author
Jacob Williams
Date
2/3/2014

Returns information about a variable in a json_file.

Arguments

Type IntentOptional AttributesName
class(json_file), intent(inout) :: me
character(kind=CK,len=*), intent(in) :: path

path to the variable

logical(kind=LK), intent(out), optional :: found

the variable exists in the structure

integer(kind=IK), intent(out), optional :: var_type

variable type

integer(kind=IK), intent(out), optional :: n_children

number of children

character(kind=CK,len=:), intent(out), optional allocatable:: name

variable name

private subroutine json_file_variable_matrix_info(me, path, is_matrix, found, var_type, n_sets, set_size, name)

Author
Jacob Williams
Date
6/26/2016

Returns matrix information about a variable in a json_file.

Arguments

Type IntentOptional AttributesName
class(json_file), intent(inout) :: me
character(kind=CK,len=*), intent(in) :: path

path to the variable

logical(kind=LK), intent(out) :: is_matrix

true if it is a valid matrix

logical(kind=LK), intent(out), optional :: found

true if it was found

integer(kind=IK), intent(out), optional :: var_type

variable type of data in the matrix (if all elements have the same type)

integer(kind=IK), intent(out), optional :: n_sets

number of data sets (i.e., matrix rows if using row-major order)

integer(kind=IK), intent(out), optional :: set_size

size of each data set (i.e., matrix cols if using row-major order)

character(kind=CK,len=:), intent(out), optional allocatable:: name

variable name

private subroutine set_json_core_in_file(me, core)

Set the json_core for this json_file.

Arguments

Type IntentOptional AttributesName
class(json_file), intent(inout) :: me
type(json_core), intent(in) :: core

private subroutine wrap_json_file_get_double(me, path, val, found)

Alternate version of json_file_get_double, where "path" is kind=CDK.

Arguments

Type IntentOptional AttributesName
class(json_file), intent(inout) :: me
character(kind=CDK,len=*), intent(in) :: path
real(kind=RK), intent(out) :: val
logical(kind=LK), intent(out), optional :: found

private subroutine wrap_json_file_get_double_vec(me, path, vec, found)

Alternate version of json_file_get_double_vec, where "path" is kind=CDK.

Arguments

Type IntentOptional AttributesName
class(json_file), intent(inout) :: me
character(kind=CDK,len=*), intent(in) :: path
real(kind=RK), intent(out), dimension(:), allocatable:: vec
logical(kind=LK), intent(out), optional :: found

private subroutine wrap_json_file_get_integer(me, path, val, found)

Alternate version of json_file_get_integer, where "path" is kind=CDK.

Arguments

Type IntentOptional AttributesName
class(json_file), intent(inout) :: me
character(kind=CDK,len=*), intent(in) :: path
integer(kind=IK), intent(out) :: val
logical(kind=LK), intent(out), optional :: found

private subroutine wrap_json_file_get_integer_vec(me, path, vec, found)

Alternate version of json_file_get_integer_vec, where "path" is kind=CDK.

Arguments

Type IntentOptional AttributesName
class(json_file), intent(inout) :: me
character(kind=CDK,len=*), intent(in) :: path
integer(kind=IK), intent(out), dimension(:), allocatable:: vec
logical(kind=LK), intent(out), optional :: found

private subroutine wrap_json_file_get_logical(me, path, val, found)

Alternate version of json_file_get_logical, where "path" is kind=CDK.

Arguments

Type IntentOptional AttributesName
class(json_file), intent(inout) :: me
character(kind=CDK,len=*), intent(in) :: path
logical(kind=LK), intent(out) :: val
logical(kind=LK), intent(out), optional :: found

private subroutine wrap_json_file_get_logical_vec(me, path, vec, found)

Alternate version of json_file_get_logical_vec, where "path" is kind=CDK.

Arguments

Type IntentOptional AttributesName
class(json_file), intent(inout) :: me
character(kind=CDK,len=*), intent(in) :: path
logical(kind=LK), intent(out), dimension(:), allocatable:: vec
logical(kind=LK), intent(out), optional :: found

private subroutine wrap_json_file_get_object(me, path, p, found)

Alternate version of json_file_get_object, where "path" is kind=CDK.

Arguments

Type IntentOptional AttributesName
class(json_file), intent(inout) :: me
character(kind=CDK,len=*), intent(in) :: path
type(json_value), intent(out), pointer:: p
logical(kind=LK), intent(out), optional :: found

private subroutine wrap_json_file_get_string(me, path, val, found)

Alternate version of json_file_get_string, where "path" is kind=CDK.

Arguments

Type IntentOptional AttributesName
class(json_file), intent(inout) :: me
character(kind=CDK,len=*), intent(in) :: path
character(kind=CK,len=:), intent(out), allocatable:: val
logical(kind=LK), intent(out), optional :: found

private subroutine wrap_json_file_get_string_vec(me, path, vec, found)

Alternate version of json_file_get_string_vec, where "path" is kind=CDK.

Arguments

Type IntentOptional AttributesName
class(json_file), intent(inout) :: me
character(kind=CDK,len=*), intent(in) :: path
character(kind=CK,len=*), intent(out), dimension(:), allocatable:: vec
logical(kind=LK), intent(out), optional :: found

private subroutine wrap_json_file_load_from_string(me, str)

Alternate version of json_file_load_from_string, where "str" is kind=CDK.

Arguments

Type IntentOptional AttributesName
class(json_file), intent(inout) :: me
character(kind=CDK,len=*), intent(in) :: str

private subroutine wrap_json_file_update_integer(me, name, val, found)

Alternate version of json_file_update_integer, where "name" is kind=CDK.

Arguments

Type IntentOptional AttributesName
class(json_file), intent(inout) :: me
character(kind=CDK,len=*), intent(in) :: name
integer(kind=IK), intent(in) :: val
logical(kind=LK), intent(out) :: found

private subroutine wrap_json_file_update_logical(me, name, val, found)

Alternate version of json_file_update_logical, where "name" is kind=CDK.

Arguments

Type IntentOptional AttributesName
class(json_file), intent(inout) :: me
character(kind=CDK,len=*), intent(in) :: name
logical(kind=LK), intent(in) :: val
logical(kind=LK), intent(out) :: found

private subroutine wrap_json_file_update_real(me, name, val, found)

Alternate version of json_file_update_real, where "name" is kind=CDK.

Arguments

Type IntentOptional AttributesName
class(json_file), intent(inout) :: me
character(kind=CDK,len=*), intent(in) :: name
real(kind=RK), intent(in) :: val
logical(kind=LK), intent(out) :: found

private subroutine wrap_json_file_update_string(me, name, val, found)

Alternate version of json_file_update_string, where "name" and "val" are kind=CDK.

Arguments

Type IntentOptional AttributesName
class(json_file), intent(inout) :: me
character(kind=CDK,len=*), intent(in) :: name
character(kind=CDK,len=*), intent(in) :: val
logical(kind=LK), intent(out) :: found

private subroutine wrap_json_file_variable_info(me, path, found, var_type, n_children, name)

Alternate version of json_file_variable_info, where "path" is kind=CDK.

Arguments

Type IntentOptional AttributesName
class(json_file), intent(inout) :: me
character(kind=CDK,len=*), intent(in) :: path
logical(kind=LK), intent(out), optional :: found
integer(kind=IK), intent(out), optional :: var_type
integer(kind=IK), intent(out), optional :: n_children
character(kind=CK,len=:), intent(out), optional allocatable:: name

variable name

private subroutine wrap_json_file_variable_matrix_info(me, path, is_matrix, found, var_type, n_sets, set_size, name)

Alternate version of json_file_variable_matrix_info, where "path" is kind=CDK.

Arguments

Type IntentOptional AttributesName
class(json_file), intent(inout) :: me
character(kind=CDK,len=*), intent(in) :: path

path to the variable

logical(kind=LK), intent(out) :: is_matrix

true if it is a valid matrix

logical(kind=LK), intent(out), optional :: found

true if it was found

integer(kind=IK), intent(out), optional :: var_type

variable type of data in the matrix (if all elements have the same type)

integer(kind=IK), intent(out), optional :: n_sets

number of data sets (i.e., matrix rows if using row-major order)

integer(kind=IK), intent(out), optional :: set_size

size of each data set (i.e., matrix cols if using row-major order)

character(kind=CK,len=:), intent(out), optional allocatable:: name

variable name