subroutine rfxqlo_profile_dflts(zprof)
  !  get default settings for instance of rfxqlo_profile compound data type
  use rfxqlo_types
  implicit NONE
  type (rfxqlo_profile), intent(out) :: zprof

  zprof%xplasma_file=" "

  zprof%xnam_g="G"
  zprof%xnam_q=" "
  zprof%xnam_te=" "
  zprof%xnam_ne=" "

  zprof%id_g=0
  zprof%id_q=0
  zprof%id_te=0
  zprof%id_ne=0

  zprof%xnam_tiav=" "   ! avg Ti
  zprof%xnam_vloop=" "  ! loop voltage
  zprof%xnam_epot=" "   ! radial electrostatic potential
  zprof%xnam_omega=" "  ! toroidal angular velocity

  zprof%id_tiav=0
  zprof%id_vloop=0
  zprof%id_epot=0
  zprof%id_omega=0

end subroutine rfxqlo_profile_dflts

subroutine rfxqlo_profile_set(zprof,ierr)
  !  define profile settings for rfxqlo module
  use rfxqlo_private
  implicit NONE
  type (rfxqlo_profile), intent(in) :: zprof
  integer, intent(out) :: ierr     ! 0: OK; 1: error

  ierr=0
  have_profile = .TRUE.
  rfx_prof = zprof

end subroutine rfxqlo_profile_set

subroutine rfxqlo_profile_get(zprof,ierr)
  !  fetch profile settings from rfxqlo module
  use rfxqlo_private
  implicit NONE
  type (rfxqlo_profile), intent(out) :: zprof
  integer, intent(out) :: ierr     ! 0: OK; 1: error

  ierr=0
  if(.not.have_profile) then
     ierr=1
     write(lunmsg,*) &
          ' ?rfxqlo_profile: profile settings have not been provided', &
          ' to rfxqlo module.'
  else
     zprof = rfx_prof
  endif

end subroutine rfxqlo_profile_get
