Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
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 |
Returns information about a variable in a json_file.
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
type(json_value), | public, | pointer | :: | p |
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