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


  subroutine ccps_getset_s5_dummy
     return
  end subroutine ccps_getset_s5_dummy

subroutine psget_sgas_name(iobj, n1, data, ierr)
    !! atomic neutral species in plasma core
    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)
    CHARACTER*(*), 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_sgas_name', iobj, ierr)
    if(ierr.ne.0) return
    ! proceed...
    call load_ps_container(iobj,ptr)
    ss => ptr % ps_ptr
    ! set
    data(1:n1) = ss % SGAS_name
end subroutine psget_sgas_name


subroutine psset_sgas_name(iobj, n1, data, ierr)
    !! atomic neutral species in plasma core
    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)
    CHARACTER*(*), 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_sgas_name', iobj, ierr)
    if(ierr.ne.0) return
    ! proceed...
    call load_ps_container(iobj,ptr)
    ss => ptr % ps_ptr
    ! set
    ss % SGAS_name = data(1:n1)
end subroutine psset_sgas_name


subroutine psgetsz_sgas_name(iobj, size, ierr)
    !! atomic neutral species in plasma core
    use plasma_state_mod, only :  plasma_state_container, plasma_state, &
                                & load_ps_container, rspec
    implicit NONE
    integer, intent(in) :: iobj(*) ! object handle
    integer, intent(out) :: size    ! size of character string
    integer, intent(out) :: ierr ! error code (0=OK)
    ! local
    type (plasma_state_container) :: ptr
    type (plasma_state), pointer  :: ss

    ierr = 0
    call ccps_argcheck('psgetsz_sgas_name', iobj, ierr)
    if(ierr.ne.0) return
    ! proceed...
    call load_ps_container(iobj,ptr)
    ss => ptr % ps_ptr
    ! note that the following will return the character length size regardless of
    ! the number of array elements (if SGAS_name is an array)
    size = len(ss % SGAS_name)
end subroutine psgetsz_sgas_name


subroutine psgetrnk_sgas_name(iobj, ndims, ierr)
    !! atomic neutral species in plasma core
    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_sgas_name


subroutine psgetdim_sgas_name(iobj, ndims, dims, ierr)
    !! atomic neutral species in plasma core
    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_sgas_name', iobj, ierr)
    if(ierr.ne.0) return
    ! proceed...
    call load_ps_container(iobj,ptr)
    ss => ptr % ps_ptr
    dims = 0
    if (allocated( ss % SGAS_name ) ) then
        ! can only call 'shape' on allocated/associated arrays
        dims = shape(ss % SGAS_name)
    endif
end subroutine psgetdim_sgas_name


subroutine psget_sprof0(iobj, n1, n2, n3, data, ierr)
    !! gas species source/sinks per unit species influx, due to
    !! charge exchange, single species neutral, source (sc0(i)) leads
    !! to multi species ion sce., remark (Jan. 2009):, charge exchange
    !! can affect impurity charge, states -- may need to add profiles
    !! to track, this interaction, in the future...
    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, n3 ! list of dimensions (if any)
    REAL(KIND=rspec), intent(out)  :: data(n1, n2, n3) ! 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_sprof0', iobj, ierr)
    if(ierr.ne.0) return
    ! proceed...
    call load_ps_container(iobj,ptr)
    ss => ptr % ps_ptr
    ! set
    data(1:n1, 1: n2, 1: n3) = ss % sprof0
end subroutine psget_sprof0


subroutine psset_sprof0(iobj, n1, n2, n3, data, ierr)
    !! gas species source/sinks per unit species influx, due to
    !! charge exchange, single species neutral, source (sc0(i)) leads
    !! to multi species ion sce., remark (Jan. 2009):, charge exchange
    !! can affect impurity charge, states -- may need to add profiles
    !! to track, this interaction, in the future...
    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, n3 ! list of dimensions (if any)
    REAL(KIND=rspec), intent(in)  :: data(n1, n2, n3) ! 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_sprof0', iobj, ierr)
    if(ierr.ne.0) return
    ! proceed...
    call load_ps_container(iobj,ptr)
    ss => ptr % ps_ptr
    ! set
    ss % sprof0 = data(1:n1, 1: n2, 1: n3)
end subroutine psset_sprof0


subroutine psgetrnk_sprof0(iobj, ndims, ierr)
    !! gas species source/sinks per unit species influx, due to
    !! charge exchange, single species neutral, source (sc0(i)) leads
    !! to multi species ion sce., remark (Jan. 2009):, charge exchange
    !! can affect impurity charge, states -- may need to add profiles
    !! to track, this interaction, in the future...
    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 = 3
end subroutine psgetrnk_sprof0


subroutine psgetdim_sprof0(iobj, ndims, dims, ierr)
    !! gas species source/sinks per unit species influx, due to
    !! charge exchange, single species neutral, source (sc0(i)) leads
    !! to multi species ion sce., remark (Jan. 2009):, charge exchange
    !! can affect impurity charge, states -- may need to add profiles
    !! to track, this interaction, in the future...
    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 /= 3) ierr = 1
    call ccps_argcheck('psgetdim_sprof0', iobj, ierr)
    if(ierr.ne.0) return
    ! proceed...
    call load_ps_container(iobj,ptr)
    ss => ptr % ps_ptr
    dims = 0
    if (allocated( ss % sprof0 ) ) then
        ! can only call 'shape' on allocated/associated arrays
        dims = shape(ss % sprof0)
    endif
end subroutine psgetdim_sprof0

