json_file_variable_info Subroutine

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

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) :: found

the variable exists in the structure

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

variable type

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

number of children

Description

Returns information about a variable in a json_file.

Calls

proc~~json_file_variable_info~~CallsGraph proc~json_file_variable_info json_file_variable_info proc~json_info json_info proc~json_file_variable_info->proc~json_info proc~json_count json_count proc~json_info->proc~json_count
Help

Called By

proc~~json_file_variable_info~~CalledByGraph proc~json_file_variable_info json_file_variable_info proc~wrap_json_file_variable_info wrap_json_file_variable_info proc~wrap_json_file_variable_info->proc~json_file_variable_info
Help

Variables

TypeVisibility AttributesNameInitial
type(json_value), public, pointer:: p

Source Code

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

    implicit none

    class(json_file),intent(inout)      :: me
    character(kind=CK,len=*),intent(in) :: path       !! path to the variable
    logical(LK),intent(out)             :: found      !! the variable exists in the structure
    integer(IK),intent(out)             :: var_type   !! variable type
    integer(IK),intent(out)             :: n_children !! number of children

    type(json_value),pointer :: p

    !initialize:
    nullify(p)

    !get a pointer to the variable (if it is there):
    call me%get(path,p,found)

    if (found) then

        !get info:
        call json_info(p,var_type,n_children)

    else

        !set to dummy values:
        var_type = json_unknown
        n_children = 0

    end if

    !cleanup:
    nullify(p)

    end subroutine json_file_variable_info