subroutine dump_radfunc(xf,rf,parent_grid)
use xmlf90_wxml
type(xmlf_t), intent(inout) :: xf
type(radfunc_t), intent(in) :: rf
type(Grid_t) :: parent_grid ! Only one level for now
if (.not. initialized(rf%grid)) return
call xml_NewElement(xf,"radfunc")
if (same(rf%grid,parent_grid)) then
! do nothing
else
call dump_grid(xf,rf%grid)
endif
call xml_NewElement(xf,"data")
! Cover the case in which the data uses only an
! initial section of the grid
if (size(rf%data) < sizeGrid(rf%grid)) then
call my_add_attribute(xf,"npts",str(size(rf%data)))
endif
call xml_AddArray(xf,rf%data(:))
call xml_EndElement(xf,"data")
call xml_EndElement(xf,"radfunc")
end subroutine dump_radfunc