private subroutine json_value_add_double_vec(me, name, val)
Arguments
Type |
Intent | Optional |
Attributes | | Name | |
type(json_value), |
intent(inout), |
|
pointer | :: |
me | |
character(kind=CK,len=*), |
intent(in) |
|
| :: |
name | |
real(kind=RK), |
intent(in), |
|
dimension(:) | :: |
val | |
Description
Add a real vector to the structure.
Note
This routine is part of the public
API that can be
used to build a
JSON structure using
json_value pointers.
Variables
Type | Visibility |
Attributes | | Name | | Initial | |
type(json_value), |
public, |
pointer | :: |
var | | | |
integer(kind=IK), |
public |
| :: |
i | | | |
Source Code
subroutine json_value_add_double_vec(me, name, val)
implicit none
type(json_value),pointer :: me
character(kind=CK,len=*),intent(in) :: name
real(RK),dimension(:),intent(in) :: val
type(json_value),pointer :: var
integer(IK) :: i
!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_double_vec