subroutine frantic_input_restore(filename,izones,ierr)

  !  restore the state of a frantic calcution -- i.e. just before
  !  re-executing the calculation in `frantic_test.f90'.

  use ezcdf
  implicit none

  character(len=*), intent(in) :: filename ! NetCDF filename
  integer, intent(out) :: izones           ! number of user zones
  integer, intent(out) :: ierr             ! completion code, 0=OK

  !-----------------------------------------------

  integer ncid

  !-----------------------------------------------
  !  open the file and read...

  call frantic_module_read(filename,ierr)
  if(ierr.ne.0) then
    ierr=4
    return
  end if

  call frantic_get_nx_user(izones)

  return
end subroutine frantic_input_restore
