subroutine rfxqlo_vacuum_dflts(zvac)

  use rfxqlo_private
  type (rfxqlo_vacuum), intent(out) :: zvac

  !  set default values for rfxqlo_vacuum compound data type

  zvac%vacden = 0
  zvac%vactemp = 0

  zvac%nvvmoms = 0
  zvac%vvrmoms = 0
  zvac%vvzmoms = 0

  zvac%rmaj0 = 0
  zvac%btor0 = 0
  zvac%placur = 0
  zvac%tflux = 0

end subroutine rfxqlo_vacuum_dflts

subroutine rfxqlo_vacuum_set(zvac,ierr)

  use rfxqlo_private
  type (rfxqlo_vacuum), intent(in) :: zvac
  integer, intent(out) :: ierr

  !  set rfxqlo module vacuum parameters

  if(.not.init) then
     ierr=1
     write(lunmsg,*) ' ?rfxqlo_vacuum_set: rfxqlo module not initialized.'
  else
     ierr=0
     vacden = zvac%vacden
     vactemp = zvac%vactemp
     nvvmoms = zvac%nvvmoms
     if(allocated(vvrmoms)) deallocate(vvrmoms,vvzmoms)
     allocate(vvrmoms(0:nvvmoms),vvzmoms(0:nvvmoms))
     vvrmoms(0:nvvmoms) = zvac%vvrmoms(0:nvvmoms)
     vvzmoms(0:nvvmoms) = zvac%vvzmoms(0:nvvmoms)
     rmaj0=zvac%rmaj0
     btor0=zvac%btor0
     placur=zvac%placur
     tflux=zvac%tflux
  endif

end subroutine rfxqlo_vacuum_set

subroutine rfxqlo_vacuum_get(zvac,ierr)

  use rfxqlo_private
  type (rfxqlo_vacuum), intent(out) :: zvac
  integer, intent(out) :: ierr

  !  get rfxqlo module vacuum parameters

  if(.not.init) then
     ierr=1
     write(lunmsg,*) ' ?rfxqlo_vacuum_get: rfxqlo module not initialized.'
  else if(.not.allocated(vvrmoms)) then
     ierr=1
     write(lunmsg,*) ' ?rfxqlo_vacuum_get: rfxqlo vacuum data never set.'
  else
     ierr=0
     zvac%vacden = vacden
     zvac%vactemp = vactemp
     zvac%nvvmoms = nvvmoms
     zvac%vvrmoms(0:nvvmoms) = vvrmoms(0:nvvmoms)
     zvac%vvzmoms(0:nvvmoms) = vvzmoms(0:nvvmoms)
     zvac%rmaj0=rmaj0
     zvac%btor0=btor0
     zvac%placur=placur
     zvac%tflux=tflux
  endif

end subroutine rfxqlo_vacuum_get

