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


  subroutine ccps_getset_a9_dummy
     return
  end subroutine ccps_getset_a9_dummy

subroutine psget_ang_vref_coil(iobj, n1, data, ierr)
    !! angle w.r.t. vertical of coil sides, zero means, walls are
    !! alligned vertically, +10 (degrees) means, tilted up and to left
    !! 10 degrees from vertical, -10 (degrees) means, tilted up and to
    !! right, 10 degrees from vertical
    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_ang_vref_coil', iobj, ierr)
    if(ierr.ne.0) return
    ! proceed...
    call load_ps_container(iobj,ptr)
    ss => ptr % ps_ptr
    ! set
    data(1:n1) = ss % Ang_Vref_coil
end subroutine psget_ang_vref_coil


subroutine psset_ang_vref_coil(iobj, n1, data, ierr)
    !! angle w.r.t. vertical of coil sides, zero means, walls are
    !! alligned vertically, +10 (degrees) means, tilted up and to left
    !! 10 degrees from vertical, -10 (degrees) means, tilted up and to
    !! right, 10 degrees from vertical
    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_ang_vref_coil', iobj, ierr)
    if(ierr.ne.0) return
    ! proceed...
    call load_ps_container(iobj,ptr)
    ss => ptr % ps_ptr
    ! set
    ss % Ang_Vref_coil = data(1:n1)
end subroutine psset_ang_vref_coil


subroutine psgetrnk_ang_vref_coil(iobj, ndims, ierr)
    !! angle w.r.t. vertical of coil sides, zero means, walls are
    !! alligned vertically, +10 (degrees) means, tilted up and to left
    !! 10 degrees from vertical, -10 (degrees) means, tilted up and to
    !! right, 10 degrees from vertical
    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_ang_vref_coil


subroutine psgetdim_ang_vref_coil(iobj, ndims, dims, ierr)
    !! angle w.r.t. vertical of coil sides, zero means, walls are
    !! alligned vertically, +10 (degrees) means, tilted up and to left
    !! 10 degrees from vertical, -10 (degrees) means, tilted up and to
    !! right, 10 degrees from vertical
    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_ang_vref_coil', iobj, ierr)
    if(ierr.ne.0) return
    ! proceed...
    call load_ps_container(iobj,ptr)
    ss => ptr % ps_ptr
    dims = 0
    if (allocated( ss % Ang_Vref_coil ) ) then
        ! can only call 'shape' on allocated/associated arrays
        dims = shape(ss % Ang_Vref_coil)
    endif
end subroutine psgetdim_ang_vref_coil


subroutine psget_ap2_horiz_offset(iobj, n1, data, ierr)
    !! horizontal offset, 2nd aperture, opening relative to beam
    !! centerline; positive value means shift of, aperture away from
    !! machine axis i.e. to make a beam with a larger, tangency radius
    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_ap2_horiz_offset', iobj, ierr)
    if(ierr.ne.0) return
    ! proceed...
    call load_ps_container(iobj,ptr)
    ss => ptr % ps_ptr
    ! set
    data(1:n1) = ss % ap2_horiz_offset
end subroutine psget_ap2_horiz_offset


subroutine psset_ap2_horiz_offset(iobj, n1, data, ierr)
    !! horizontal offset, 2nd aperture, opening relative to beam
    !! centerline; positive value means shift of, aperture away from
    !! machine axis i.e. to make a beam with a larger, tangency radius
    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_ap2_horiz_offset', iobj, ierr)
    if(ierr.ne.0) return
    ! proceed...
    call load_ps_container(iobj,ptr)
    ss => ptr % ps_ptr
    ! set
    ss % ap2_horiz_offset = data(1:n1)
end subroutine psset_ap2_horiz_offset


subroutine psgetrnk_ap2_horiz_offset(iobj, ndims, ierr)
    !! horizontal offset, 2nd aperture, opening relative to beam
    !! centerline; positive value means shift of, aperture away from
    !! machine axis i.e. to make a beam with a larger, tangency radius
    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_ap2_horiz_offset


subroutine psgetdim_ap2_horiz_offset(iobj, ndims, dims, ierr)
    !! horizontal offset, 2nd aperture, opening relative to beam
    !! centerline; positive value means shift of, aperture away from
    !! machine axis i.e. to make a beam with a larger, tangency radius
    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_ap2_horiz_offset', iobj, ierr)
    if(ierr.ne.0) return
    ! proceed...
    call load_ps_container(iobj,ptr)
    ss => ptr % ps_ptr
    dims = 0
    if (allocated( ss % ap2_horiz_offset ) ) then
        ! can only call 'shape' on allocated/associated arrays
        dims = shape(ss % ap2_horiz_offset)
    endif
end subroutine psgetdim_ap2_horiz_offset


subroutine psget_amaxlh(iobj, n1, n2, data, ierr)
    !! width of the spectrum peak
    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_amaxlh', 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 % amaxlh
end subroutine psget_amaxlh


subroutine psset_amaxlh(iobj, n1, n2, data, ierr)
    !! width of the spectrum peak
    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_amaxlh', iobj, ierr)
    if(ierr.ne.0) return
    ! proceed...
    call load_ps_container(iobj,ptr)
    ss => ptr % ps_ptr
    ! set
    ss % amaxlh = data(1:n1, 1: n2)
end subroutine psset_amaxlh


subroutine psgetrnk_amaxlh(iobj, ndims, ierr)
    !! width of the spectrum peak
    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_amaxlh


subroutine psgetdim_amaxlh(iobj, ndims, dims, ierr)
    !! width of the spectrum peak
    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_amaxlh', iobj, ierr)
    if(ierr.ne.0) return
    ! proceed...
    call load_ps_container(iobj,ptr)
    ss => ptr % ps_ptr
    dims = 0
    if (allocated( ss % amaxlh ) ) then
        ! can only call 'shape' on allocated/associated arrays
        dims = shape(ss % amaxlh)
    endif
end subroutine psgetdim_amaxlh

