Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(json_value), | intent(inout), | pointer | :: | me | ||
character(kind=CK,len=*), | intent(in) | :: | name | name of the vector |
||
logical(kind=LK), | intent(in), | dimension(:) | :: | val | value |
Add a logical vector to the structure.
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
type(json_value), | public, | pointer | :: | var | |||
integer(kind=IK), | public | :: | i |
subroutine json_value_add_logical_vec(me, name, val)
implicit none
type(json_value),pointer :: me
character(kind=CK,len=*),intent(in) :: name !! name of the vector
logical(LK),dimension(:),intent(in) :: val !! value
type(json_value),pointer :: var
integer(IK) :: i !counter
!create the variable as an array:
call json_value_create(var)
call to_array(var,name)
!populate the array:
do i=1,size(val)
call json_add(var, '', val(i))
end do
!add it:
call json_add(me, var)
!cleanup:
nullify(var)
end subroutine json_value_add_logical_vec