Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(json_value), | intent(in), | pointer | :: | me | ||
character(kind=CDK,len=*), | intent(in) | :: | filename | the filename to print to (should not already be open) |
Print the json_value structure to a file.
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
integer(kind=IK), | public | :: | iunit | ||||
integer(kind=IK), | public | :: | istat |
subroutine json_print_2(me,filename)
implicit none
type(json_value),pointer,intent(in) :: me
character(kind=CDK,len=*),intent(in) :: filename !! the filename to print to (should not already be open)
integer(IK) :: iunit,istat
open(newunit=iunit,file=filename,status='REPLACE',iostat=istat FILE_ENCODING )
if (istat==0) then
call json_print(me,iunit)
close(iunit,iostat=istat)
else
call throw_exception('Error in json_print: could not open file: '//&
trim(filename))
end if
end subroutine json_print_2