
! written by plasma_cwrite.py
! input: plasma_state_spec.dat   version 2.055
! *** do not edit *** (use code generator instead)


  subroutine ccps_getset_t1_dummy
     return
  end subroutine ccps_getset_t1_dummy

subroutine psget_trace_flag(iobj, n1, data, ierr)
    !! trace element flag, 0 means, beam has no trace element;, 1
    !! means, trace element, matching injection energy fractions, 2
    !! means, trace element injected at 100% full energy, (1 will be
    !! set if the trace element is an isotope of', "of the beam's main
    !! injection specie; 2 if not)."]
    use plasma_state_mod, only : plasma_state_container, plasma_state, &
                                & load_ps_container, rspec
    implicit NONE
    integer, intent(in) :: iobj(*)  ! object handle
    integer, intent(in) :: n1 ! list of dimensions (if any)
    INTEGER, intent(out)  :: data(n1) ! to read to/write from
    integer, intent(out) :: ierr ! error code (0=OK)
    ! local
    type (plasma_state_container) :: ptr
    type (plasma_state), pointer  :: ss

    ierr = 0
    call ccps_argcheck('psget_trace_flag', iobj, ierr)
    if(ierr.ne.0) return
    ! proceed...
    call load_ps_container(iobj,ptr)
    ss => ptr % ps_ptr
    ! set
    data(1:n1) = ss % trace_flag
end subroutine psget_trace_flag


subroutine psset_trace_flag(iobj, n1, data, ierr)
    !! trace element flag, 0 means, beam has no trace element;, 1
    !! means, trace element, matching injection energy fractions, 2
    !! means, trace element injected at 100% full energy, (1 will be
    !! set if the trace element is an isotope of', "of the beam's main
    !! injection specie; 2 if not)."]
    use plasma_state_mod, only : plasma_state_container, plasma_state, &
                                & load_ps_container, rspec
    implicit NONE
    integer, intent(in) :: iobj(*)  ! object handle
    integer, intent(in) :: n1 ! list of dimensions (if any)
    INTEGER, intent(in)  :: data(n1) ! to read to/write from
    integer, intent(out) :: ierr ! error code (0=OK)
    ! local
    type (plasma_state_container) :: ptr
    type (plasma_state), pointer  :: ss

    ierr = 0
    call ccps_argcheck('psset_trace_flag', iobj, ierr)
    if(ierr.ne.0) return
    ! proceed...
    call load_ps_container(iobj,ptr)
    ss => ptr % ps_ptr
    ! set
    ss % trace_flag = data(1:n1)
end subroutine psset_trace_flag


subroutine psgetrnk_trace_flag(iobj, ndims, ierr)
    !! trace element flag, 0 means, beam has no trace element;, 1
    !! means, trace element, matching injection energy fractions, 2
    !! means, trace element injected at 100% full energy, (1 will be
    !! set if the trace element is an isotope of', "of the beam's main
    !! injection specie; 2 if not)."]
    use plasma_state_mod, only :  plasma_state_container, plasma_state, rspec
    implicit NONE
    integer, intent(in) :: iobj(*) ! object handle
    integer, intent(out) :: ndims  ! number of dimensions
    integer, intent(out) :: ierr   ! error code (0=OK)
    ! local
    type (plasma_state_container) :: ptr
    type (plasma_state), pointer  :: ss

    ierr = 0
    ndims = 1
end subroutine psgetrnk_trace_flag


subroutine psgetdim_trace_flag(iobj, ndims, dims, ierr)
    !! trace element flag, 0 means, beam has no trace element;, 1
    !! means, trace element, matching injection energy fractions, 2
    !! means, trace element injected at 100% full energy, (1 will be
    !! set if the trace element is an isotope of', "of the beam's main
    !! injection specie; 2 if not)."]
    use plasma_state_mod, only :  plasma_state_container, plasma_state, &
                                & load_ps_container, rspec
    implicit NONE
    integer, intent(in) :: iobj(*) ! object handle
    integer, intent(in) :: ndims   ! number of dimensions
    integer, intent(out) :: dims(ndims) ! sizes
    integer, intent(out) :: ierr ! error code (0=OK)
    ! local
    type (plasma_state_container) :: ptr
    type (plasma_state), pointer  :: ss

    ierr = 0
    if (ndims /= 1) ierr = 1
    call ccps_argcheck('psgetdim_trace_flag', iobj, ierr)
    if(ierr.ne.0) return
    ! proceed...
    call load_ps_container(iobj,ptr)
    ss => ptr % ps_ptr
    dims = 0
    if (allocated( ss % trace_flag ) ) then
        ! can only call 'shape' on allocated/associated arrays
        dims = shape(ss % trace_flag)
    endif
end subroutine psgetdim_trace_flag


subroutine psget_tor_mode_no(iobj, n1, data, ierr)
    !! (from input) Toroidal modes monitored, set at
    !! initialization, would not vary in time, likely just:
    !! 1,2,3,...,mmodes
    use plasma_state_mod, only : plasma_state_container, plasma_state, &
                                & load_ps_container, rspec
    implicit NONE
    integer, intent(in) :: iobj(*)  ! object handle
    integer, intent(in) :: n1 ! list of dimensions (if any)
    INTEGER, intent(out)  :: data(n1) ! to read to/write from
    integer, intent(out) :: ierr ! error code (0=OK)
    ! local
    type (plasma_state_container) :: ptr
    type (plasma_state), pointer  :: ss

    ierr = 0
    call ccps_argcheck('psget_tor_mode_no', iobj, ierr)
    if(ierr.ne.0) return
    ! proceed...
    call load_ps_container(iobj,ptr)
    ss => ptr % ps_ptr
    ! set
    data(1:n1) = ss % Tor_mode_No
end subroutine psget_tor_mode_no


subroutine psset_tor_mode_no(iobj, n1, data, ierr)
    !! (from input) Toroidal modes monitored, set at
    !! initialization, would not vary in time, likely just:
    !! 1,2,3,...,mmodes
    use plasma_state_mod, only : plasma_state_container, plasma_state, &
                                & load_ps_container, rspec
    implicit NONE
    integer, intent(in) :: iobj(*)  ! object handle
    integer, intent(in) :: n1 ! list of dimensions (if any)
    INTEGER, intent(in)  :: data(n1) ! to read to/write from
    integer, intent(out) :: ierr ! error code (0=OK)
    ! local
    type (plasma_state_container) :: ptr
    type (plasma_state), pointer  :: ss

    ierr = 0
    call ccps_argcheck('psset_tor_mode_no', iobj, ierr)
    if(ierr.ne.0) return
    ! proceed...
    call load_ps_container(iobj,ptr)
    ss => ptr % ps_ptr
    ! set
    ss % Tor_mode_No = data(1:n1)
end subroutine psset_tor_mode_no


subroutine psgetrnk_tor_mode_no(iobj, ndims, ierr)
    !! (from input) Toroidal modes monitored, set at
    !! initialization, would not vary in time, likely just:
    !! 1,2,3,...,mmodes
    use plasma_state_mod, only :  plasma_state_container, plasma_state, rspec
    implicit NONE
    integer, intent(in) :: iobj(*) ! object handle
    integer, intent(out) :: ndims  ! number of dimensions
    integer, intent(out) :: ierr   ! error code (0=OK)
    ! local
    type (plasma_state_container) :: ptr
    type (plasma_state), pointer  :: ss

    ierr = 0
    ndims = 1
end subroutine psgetrnk_tor_mode_no


subroutine psgetdim_tor_mode_no(iobj, ndims, dims, ierr)
    !! (from input) Toroidal modes monitored, set at
    !! initialization, would not vary in time, likely just:
    !! 1,2,3,...,mmodes
    use plasma_state_mod, only :  plasma_state_container, plasma_state, &
                                & load_ps_container, rspec
    implicit NONE
    integer, intent(in) :: iobj(*) ! object handle
    integer, intent(in) :: ndims   ! number of dimensions
    integer, intent(out) :: dims(ndims) ! sizes
    integer, intent(out) :: ierr ! error code (0=OK)
    ! local
    type (plasma_state_container) :: ptr
    type (plasma_state), pointer  :: ss

    ierr = 0
    if (ndims /= 1) ierr = 1
    call ccps_argcheck('psgetdim_tor_mode_no', iobj, ierr)
    if(ierr.ne.0) return
    ! proceed...
    call load_ps_container(iobj,ptr)
    ss => ptr % ps_ptr
    dims = 0
    if (allocated( ss % Tor_mode_No ) ) then
        ! can only call 'shape' on allocated/associated arrays
        dims = shape(ss % Tor_mode_No)
    endif
end subroutine psgetdim_tor_mode_no


subroutine psget_triang_miller_l(iobj, n1, data, ierr)
    !! Miller lower triangularity,
    !! Sin(aCos((R(Zmin)-Rmajor_mean)/rMinor_mean)-pi/2).
    use plasma_state_mod, only : plasma_state_container, plasma_state, &
                                & load_ps_container, rspec
    implicit NONE
    integer, intent(in) :: iobj(*)  ! object handle
    integer, intent(in) :: n1 ! list of dimensions (if any)
    REAL(KIND=rspec), intent(out)  :: data(n1) ! to read to/write from
    integer, intent(out) :: ierr ! error code (0=OK)
    ! local
    type (plasma_state_container) :: ptr
    type (plasma_state), pointer  :: ss

    ierr = 0
    call ccps_argcheck('psget_triang_miller_l', iobj, ierr)
    if(ierr.ne.0) return
    ! proceed...
    call load_ps_container(iobj,ptr)
    ss => ptr % ps_ptr
    ! set
    data(1:n1) = ss % triang_miller_L
end subroutine psget_triang_miller_l


subroutine psset_triang_miller_l(iobj, n1, data, ierr)
    !! Miller lower triangularity,
    !! Sin(aCos((R(Zmin)-Rmajor_mean)/rMinor_mean)-pi/2).
    use plasma_state_mod, only : plasma_state_container, plasma_state, &
                                & load_ps_container, rspec
    implicit NONE
    integer, intent(in) :: iobj(*)  ! object handle
    integer, intent(in) :: n1 ! list of dimensions (if any)
    REAL(KIND=rspec), intent(in)  :: data(n1) ! to read to/write from
    integer, intent(out) :: ierr ! error code (0=OK)
    ! local
    type (plasma_state_container) :: ptr
    type (plasma_state), pointer  :: ss

    ierr = 0
    call ccps_argcheck('psset_triang_miller_l', iobj, ierr)
    if(ierr.ne.0) return
    ! proceed...
    call load_ps_container(iobj,ptr)
    ss => ptr % ps_ptr
    ! set
    ss % triang_miller_L = data(1:n1)
end subroutine psset_triang_miller_l


subroutine psgetrnk_triang_miller_l(iobj, ndims, ierr)
    !! Miller lower triangularity,
    !! Sin(aCos((R(Zmin)-Rmajor_mean)/rMinor_mean)-pi/2).
    use plasma_state_mod, only :  plasma_state_container, plasma_state, rspec
    implicit NONE
    integer, intent(in) :: iobj(*) ! object handle
    integer, intent(out) :: ndims  ! number of dimensions
    integer, intent(out) :: ierr   ! error code (0=OK)
    ! local
    type (plasma_state_container) :: ptr
    type (plasma_state), pointer  :: ss

    ierr = 0
    ndims = 1
end subroutine psgetrnk_triang_miller_l


subroutine psgetdim_triang_miller_l(iobj, ndims, dims, ierr)
    !! Miller lower triangularity,
    !! Sin(aCos((R(Zmin)-Rmajor_mean)/rMinor_mean)-pi/2).
    use plasma_state_mod, only :  plasma_state_container, plasma_state, &
                                & load_ps_container, rspec
    implicit NONE
    integer, intent(in) :: iobj(*) ! object handle
    integer, intent(in) :: ndims   ! number of dimensions
    integer, intent(out) :: dims(ndims) ! sizes
    integer, intent(out) :: ierr ! error code (0=OK)
    ! local
    type (plasma_state_container) :: ptr
    type (plasma_state), pointer  :: ss

    ierr = 0
    if (ndims /= 1) ierr = 1
    call ccps_argcheck('psgetdim_triang_miller_l', iobj, ierr)
    if(ierr.ne.0) return
    ! proceed...
    call load_ps_container(iobj,ptr)
    ss => ptr % ps_ptr
    dims = 0
    if (allocated( ss % triang_miller_L ) ) then
        ! can only call 'shape' on allocated/associated arrays
        dims = shape(ss % triang_miller_L)
    endif
end subroutine psgetdim_triang_miller_l


subroutine psget_tqioniz(iobj, n1, n2, data, ierr)
    !! ionization torque per unit influx (sc0)
    use plasma_state_mod, only : plasma_state_container, plasma_state, &
                                & load_ps_container, rspec
    implicit NONE
    integer, intent(in) :: iobj(*)  ! object handle
    integer, intent(in) :: n1, n2 ! list of dimensions (if any)
    REAL(KIND=rspec), intent(out)  :: data(n1, n2) ! to read to/write from
    integer, intent(out) :: ierr ! error code (0=OK)
    ! local
    type (plasma_state_container) :: ptr
    type (plasma_state), pointer  :: ss

    ierr = 0
    call ccps_argcheck('psget_tqioniz', iobj, ierr)
    if(ierr.ne.0) return
    ! proceed...
    call load_ps_container(iobj,ptr)
    ss => ptr % ps_ptr
    ! set
    data(1:n1, 1: n2) = ss % tqioniz
end subroutine psget_tqioniz


subroutine psset_tqioniz(iobj, n1, n2, data, ierr)
    !! ionization torque per unit influx (sc0)
    use plasma_state_mod, only : plasma_state_container, plasma_state, &
                                & load_ps_container, rspec
    implicit NONE
    integer, intent(in) :: iobj(*)  ! object handle
    integer, intent(in) :: n1, n2 ! list of dimensions (if any)
    REAL(KIND=rspec), intent(in)  :: data(n1, n2) ! to read to/write from
    integer, intent(out) :: ierr ! error code (0=OK)
    ! local
    type (plasma_state_container) :: ptr
    type (plasma_state), pointer  :: ss

    ierr = 0
    call ccps_argcheck('psset_tqioniz', iobj, ierr)
    if(ierr.ne.0) return
    ! proceed...
    call load_ps_container(iobj,ptr)
    ss => ptr % ps_ptr
    ! set
    ss % tqioniz = data(1:n1, 1: n2)
end subroutine psset_tqioniz


subroutine psgetrnk_tqioniz(iobj, ndims, ierr)
    !! ionization torque per unit influx (sc0)
    use plasma_state_mod, only :  plasma_state_container, plasma_state, rspec
    implicit NONE
    integer, intent(in) :: iobj(*) ! object handle
    integer, intent(out) :: ndims  ! number of dimensions
    integer, intent(out) :: ierr   ! error code (0=OK)
    ! local
    type (plasma_state_container) :: ptr
    type (plasma_state), pointer  :: ss

    ierr = 0
    ndims = 2
end subroutine psgetrnk_tqioniz


subroutine psgetdim_tqioniz(iobj, ndims, dims, ierr)
    !! ionization torque per unit influx (sc0)
    use plasma_state_mod, only :  plasma_state_container, plasma_state, &
                                & load_ps_container, rspec
    implicit NONE
    integer, intent(in) :: iobj(*) ! object handle
    integer, intent(in) :: ndims   ! number of dimensions
    integer, intent(out) :: dims(ndims) ! sizes
    integer, intent(out) :: ierr ! error code (0=OK)
    ! local
    type (plasma_state_container) :: ptr
    type (plasma_state), pointer  :: ss

    ierr = 0
    if (ndims /= 2) ierr = 1
    call ccps_argcheck('psgetdim_tqioniz', iobj, ierr)
    if(ierr.ne.0) return
    ! proceed...
    call load_ps_container(iobj,ptr)
    ss => ptr % ps_ptr
    dims = 0
    if (allocated( ss % tqioniz ) ) then
        ! can only call 'shape' on allocated/associated arrays
        dims = shape(ss % tqioniz)
    endif
end subroutine psgetdim_tqioniz


subroutine psget_tmodel(iobj, n1, data, ierr)
    !! target temperature profile, from experiment or "profile
    !! consistency" model
    use plasma_state_mod, only : plasma_state_container, plasma_state, &
                                & load_ps_container, rspec
    implicit NONE
    integer, intent(in) :: iobj(*)  ! object handle
    integer, intent(in) :: n1 ! list of dimensions (if any)
    REAL(KIND=rspec), intent(out)  :: data(n1) ! to read to/write from
    integer, intent(out) :: ierr ! error code (0=OK)
    ! local
    type (plasma_state_container) :: ptr
    type (plasma_state), pointer  :: ss

    ierr = 0
    call ccps_argcheck('psget_tmodel', iobj, ierr)
    if(ierr.ne.0) return
    ! proceed...
    call load_ps_container(iobj,ptr)
    ss => ptr % ps_ptr
    ! set
    data(1:n1) = ss % tmodel
end subroutine psget_tmodel


subroutine psset_tmodel(iobj, n1, data, ierr)
    !! target temperature profile, from experiment or "profile
    !! consistency" model
    use plasma_state_mod, only : plasma_state_container, plasma_state, &
                                & load_ps_container, rspec
    implicit NONE
    integer, intent(in) :: iobj(*)  ! object handle
    integer, intent(in) :: n1 ! list of dimensions (if any)
    REAL(KIND=rspec), intent(in)  :: data(n1) ! to read to/write from
    integer, intent(out) :: ierr ! error code (0=OK)
    ! local
    type (plasma_state_container) :: ptr
    type (plasma_state), pointer  :: ss

    ierr = 0
    call ccps_argcheck('psset_tmodel', iobj, ierr)
    if(ierr.ne.0) return
    ! proceed...
    call load_ps_container(iobj,ptr)
    ss => ptr % ps_ptr
    ! set
    ss % tmodel = data(1:n1)
end subroutine psset_tmodel


subroutine psgetrnk_tmodel(iobj, ndims, ierr)
    !! target temperature profile, from experiment or "profile
    !! consistency" model
    use plasma_state_mod, only :  plasma_state_container, plasma_state, rspec
    implicit NONE
    integer, intent(in) :: iobj(*) ! object handle
    integer, intent(out) :: ndims  ! number of dimensions
    integer, intent(out) :: ierr   ! error code (0=OK)
    ! local
    type (plasma_state_container) :: ptr
    type (plasma_state), pointer  :: ss

    ierr = 0
    ndims = 1
end subroutine psgetrnk_tmodel


subroutine psgetdim_tmodel(iobj, ndims, dims, ierr)
    !! target temperature profile, from experiment or "profile
    !! consistency" model
    use plasma_state_mod, only :  plasma_state_container, plasma_state, &
                                & load_ps_container, rspec
    implicit NONE
    integer, intent(in) :: iobj(*) ! object handle
    integer, intent(in) :: ndims   ! number of dimensions
    integer, intent(out) :: dims(ndims) ! sizes
    integer, intent(out) :: ierr ! error code (0=OK)
    ! local
    type (plasma_state_container) :: ptr
    type (plasma_state), pointer  :: ss

    ierr = 0
    if (ndims /= 1) ierr = 1
    call ccps_argcheck('psgetdim_tmodel', iobj, ierr)
    if(ierr.ne.0) return
    ! proceed...
    call load_ps_container(iobj,ptr)
    ss => ptr % ps_ptr
    dims = 0
    if (allocated( ss % tmodel ) ) then
        ! can only call 'shape' on allocated/associated arrays
        dims = shape(ss % tmodel)
    endif
end subroutine psgetdim_tmodel

