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


  subroutine ccps_getset_a1_dummy
     return
  end subroutine ccps_getset_a1_dummy

subroutine psget_ap_halfwidth(iobj, n1, data, ierr)
    !! aperture half-width, for nbap_shape(j)="rectangle", this is
    !! the horizontal size, specification; for nbap_shape(j)="circle",
    !! ap_halfwidth(j) is, the 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_ap_halfwidth', iobj, ierr)
    if(ierr.ne.0) return
    ! proceed...
    call load_ps_container(iobj,ptr)
    ss => ptr % ps_ptr
    ! set
    data(1:n1) = ss % ap_halfwidth
end subroutine psget_ap_halfwidth


subroutine psset_ap_halfwidth(iobj, n1, data, ierr)
    !! aperture half-width, for nbap_shape(j)="rectangle", this is
    !! the horizontal size, specification; for nbap_shape(j)="circle",
    !! ap_halfwidth(j) is, the 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_ap_halfwidth', iobj, ierr)
    if(ierr.ne.0) return
    ! proceed...
    call load_ps_container(iobj,ptr)
    ss => ptr % ps_ptr
    ! set
    ss % ap_halfwidth = data(1:n1)
end subroutine psset_ap_halfwidth


subroutine psgetrnk_ap_halfwidth(iobj, ndims, ierr)
    !! aperture half-width, for nbap_shape(j)="rectangle", this is
    !! the horizontal size, specification; for nbap_shape(j)="circle",
    !! ap_halfwidth(j) is, the 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_ap_halfwidth


subroutine psgetdim_ap_halfwidth(iobj, ndims, dims, ierr)
    !! aperture half-width, for nbap_shape(j)="rectangle", this is
    !! the horizontal size, specification; for nbap_shape(j)="circle",
    !! ap_halfwidth(j) is, the 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_ap_halfwidth', iobj, ierr)
    if(ierr.ne.0) return
    ! proceed...
    call load_ps_container(iobj,ptr)
    ss => ptr % ps_ptr
    dims = 0
    if (allocated( ss % ap_halfwidth ) ) then
        ! can only call 'shape' on allocated/associated arrays
        dims = shape(ss % ap_halfwidth)
    endif
end subroutine psgetdim_ap_halfwidth


subroutine psget_atormaxlh(iobj, n1, n2, data, ierr)
    !! toroidal mode number right of lumps
    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_atormaxlh', 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 % atormaxlh
end subroutine psget_atormaxlh


subroutine psset_atormaxlh(iobj, n1, n2, data, ierr)
    !! toroidal mode number right of lumps
    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_atormaxlh', iobj, ierr)
    if(ierr.ne.0) return
    ! proceed...
    call load_ps_container(iobj,ptr)
    ss => ptr % ps_ptr
    ! set
    ss % atormaxlh = data(1:n1, 1: n2)
end subroutine psset_atormaxlh


subroutine psgetrnk_atormaxlh(iobj, ndims, ierr)
    !! toroidal mode number right of lumps
    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_atormaxlh


subroutine psgetdim_atormaxlh(iobj, ndims, dims, ierr)
    !! toroidal mode number right of lumps
    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_atormaxlh', iobj, ierr)
    if(ierr.ne.0) return
    ! proceed...
    call load_ps_container(iobj,ptr)
    ss => ptr % ps_ptr
    dims = 0
    if (allocated( ss % atormaxlh ) ) then
        ! can only call 'shape' on allocated/associated arrays
        dims = shape(ss % atormaxlh)
    endif
end subroutine psgetdim_atormaxlh


subroutine psget_all_index(iobj, n1, data, ierr)
    !! species index in original lists, ion species j in "all"
    !! corresponds to ion species:, all_index(j) in "s" if all_type(j)
    !! = ps_electron, ps_therm_ion, or, ps_impurity, all_index(j) in
    !! "snbi" if all_type(j) = ps_beam_ion, all_index(j) in "rfmin" if
    !! all_type(j) = ps_rf_minority, all_index(j) in "sfus" if
    !! all_type(j) = ps_fusion_ion
    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_all_index', iobj, ierr)
    if(ierr.ne.0) return
    ! proceed...
    call load_ps_container(iobj,ptr)
    ss => ptr % ps_ptr
    ! set
    data(1:n1) = ss % all_index
end subroutine psget_all_index


subroutine psset_all_index(iobj, n1, data, ierr)
    !! species index in original lists, ion species j in "all"
    !! corresponds to ion species:, all_index(j) in "s" if all_type(j)
    !! = ps_electron, ps_therm_ion, or, ps_impurity, all_index(j) in
    !! "snbi" if all_type(j) = ps_beam_ion, all_index(j) in "rfmin" if
    !! all_type(j) = ps_rf_minority, all_index(j) in "sfus" if
    !! all_type(j) = ps_fusion_ion
    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_all_index', iobj, ierr)
    if(ierr.ne.0) return
    ! proceed...
    call load_ps_container(iobj,ptr)
    ss => ptr % ps_ptr
    ! set
    ss % all_index = data(1:n1)
end subroutine psset_all_index


subroutine psgetrnk_all_index(iobj, ndims, ierr)
    !! species index in original lists, ion species j in "all"
    !! corresponds to ion species:, all_index(j) in "s" if all_type(j)
    !! = ps_electron, ps_therm_ion, or, ps_impurity, all_index(j) in
    !! "snbi" if all_type(j) = ps_beam_ion, all_index(j) in "rfmin" if
    !! all_type(j) = ps_rf_minority, all_index(j) in "sfus" if
    !! all_type(j) = ps_fusion_ion
    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_all_index


subroutine psgetdim_all_index(iobj, ndims, dims, ierr)
    !! species index in original lists, ion species j in "all"
    !! corresponds to ion species:, all_index(j) in "s" if all_type(j)
    !! = ps_electron, ps_therm_ion, or, ps_impurity, all_index(j) in
    !! "snbi" if all_type(j) = ps_beam_ion, all_index(j) in "rfmin" if
    !! all_type(j) = ps_rf_minority, all_index(j) in "sfus" if
    !! all_type(j) = ps_fusion_ion
    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_all_index', iobj, ierr)
    if(ierr.ne.0) return
    ! proceed...
    call load_ps_container(iobj,ptr)
    ss => ptr % ps_ptr
    dims = 0
    if (allocated( ss % all_index ) ) then
        ! can only call 'shape' on allocated/associated arrays
        dims = shape(ss % all_index)
    endif
end subroutine psgetdim_all_index


subroutine psget_area(iobj, n1, data, ierr)
    !! enclosed area
    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_area', iobj, ierr)
    if(ierr.ne.0) return
    ! proceed...
    call load_ps_container(iobj,ptr)
    ss => ptr % ps_ptr
    ! set
    data(1:n1) = ss % area
end subroutine psget_area


subroutine psset_area(iobj, n1, data, ierr)
    !! enclosed area
    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_area', iobj, ierr)
    if(ierr.ne.0) return
    ! proceed...
    call load_ps_container(iobj,ptr)
    ss => ptr % ps_ptr
    ! set
    ss % area = data(1:n1)
end subroutine psset_area


subroutine psgetrnk_area(iobj, ndims, ierr)
    !! enclosed area
    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_area


subroutine psgetdim_area(iobj, ndims, dims, ierr)
    !! enclosed area
    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_area', iobj, ierr)
    if(ierr.ne.0) return
    ! proceed...
    call load_ps_container(iobj,ptr)
    ss => ptr % ps_ptr
    dims = 0
    if (allocated( ss % area ) ) then
        ! can only call 'shape' on allocated/associated arrays
        dims = shape(ss % area)
    endif
end subroutine psgetdim_area


subroutine psget_anom_evar(iobj, n1, data, ierr)
    !! anomalous transport energy variation, =1 to use transport
    !! profiles as given; O(1) expected., if undefined, use transport
    !! profiles as given.
    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_anom_evar', iobj, ierr)
    if(ierr.ne.0) return
    ! proceed...
    call load_ps_container(iobj,ptr)
    ss => ptr % ps_ptr
    ! set
    data(1:n1) = ss % anom_evar
end subroutine psget_anom_evar


subroutine psset_anom_evar(iobj, n1, data, ierr)
    !! anomalous transport energy variation, =1 to use transport
    !! profiles as given; O(1) expected., if undefined, use transport
    !! profiles as given.
    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_anom_evar', iobj, ierr)
    if(ierr.ne.0) return
    ! proceed...
    call load_ps_container(iobj,ptr)
    ss => ptr % ps_ptr
    ! set
    ss % anom_evar = data(1:n1)
end subroutine psset_anom_evar


subroutine psgetrnk_anom_evar(iobj, ndims, ierr)
    !! anomalous transport energy variation, =1 to use transport
    !! profiles as given; O(1) expected., if undefined, use transport
    !! profiles as given.
    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_anom_evar


subroutine psgetdim_anom_evar(iobj, ndims, dims, ierr)
    !! anomalous transport energy variation, =1 to use transport
    !! profiles as given; O(1) expected., if undefined, use transport
    !! profiles as given.
    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_anom_evar', iobj, ierr)
    if(ierr.ne.0) return
    ! proceed...
    call load_ps_container(iobj,ptr)
    ss => ptr % ps_ptr
    dims = 0
    if (allocated( ss % anom_evar ) ) then
        ! can only call 'shape' on allocated/associated arrays
        dims = shape(ss % anom_evar)
    endif
end subroutine psgetdim_anom_evar

