get_fio_profile_p Subroutine

public subroutine get_fio_profile_p(params, P, Y_R, Y_PHI, Y_Z, n_e, T_e, flag, hint)

Arguments

Type IntentOptional AttributesName
type(KORC_PARAMS), intent(in) :: params
type(PROFILES), intent(in) :: P
real(kind=rp), intent(in), DIMENSION(params%pchunk):: Y_R
real(kind=rp), intent(in), DIMENSION(params%pchunk):: Y_PHI
real(kind=rp), intent(in), DIMENSION(params%pchunk):: Y_Z
real(kind=rp), intent(inout), DIMENSION(params%pchunk):: n_e
real(kind=rp), intent(inout), DIMENSION(params%pchunk):: T_e
integer(kind=is), intent(inout), DIMENSION(params%pchunk):: flag
type(C_PTR), intent(inout), DIMENSION(params%pchunk):: hint

Calls

proc~~get_fio_profile_p~~CallsGraph proc~get_fio_profile_p get_fio_profile_p interface~fio_eval_field fio_eval_field proc~get_fio_profile_p->interface~fio_eval_field

Called by

proc~~get_fio_profile_p~~CalledByGraph proc~get_fio_profile_p get_fio_profile_p proc~include_coulombcollisions_gcfio_p include_CoulombCollisions_GCfio_p proc~include_coulombcollisions_gcfio_p->proc~get_fio_profile_p proc~include_coulombcollisions_fofio_p include_CoulombCollisions_FOfio_p proc~include_coulombcollisions_fofio_p->proc~get_fio_profile_p proc~gceom1_fio_p GCEoM1_fio_p proc~gceom1_fio_p->proc~get_fio_profile_p proc~advance_gcinterp_fio_vars advance_GCinterp_fio_vars proc~advance_gcinterp_fio_vars->proc~include_coulombcollisions_gcfio_p proc~advance_gcinterp_fio_vars->proc~gceom1_fio_p proc~advance_fofio_vars advance_FOfio_vars proc~advance_fofio_vars->proc~include_coulombcollisions_fofio_p proc~adv_fofio_top adv_FOfio_top proc~adv_fofio_top->proc~advance_fofio_vars program~main main program~main->proc~adv_fofio_top

Contents

Source Code


Source Code

  subroutine get_fio_profile_p(params,P,Y_R,Y_PHI,Y_Z, &
       n_e,T_e,flag,hint)
    TYPE(PROFILES), INTENT(IN)       :: P
    TYPE(KORC_PARAMS), INTENT(IN)  :: params
    REAL(rp), DIMENSION(params%pchunk), INTENT(IN)  :: Y_R,Y_PHI,Y_Z
    REAL(rp), DIMENSION(params%pchunk), INTENT(INOUT)  :: n_e,T_e
    INTEGER(is), DIMENSION(params%pchunk), INTENT(INOUT)  :: flag
    TYPE(C_PTR), DIMENSION(params%pchunk), INTENT(INOUT)  :: hint
    INTEGER (C_INT)                :: status
    INTEGER                        :: pp,pchunk
    REAL(rp), DIMENSION(3)         :: x
    REAL(rp)        :: netmp=-1._rp,Tetmp=-1._rp

    pchunk=params%pchunk
    
    do pp = 1,pchunk
       if (flag(pp) .EQ. 1_is) then
          x(1) = Y_R(pp)*params%cpp%length
          x(2) = Y_PHI(pp)
          x(3) = Y_Z(pp)*params%cpp%length

          !write(6,*) P%FIO_ne,x
          
          status = fio_eval_field(P%FIO_ne, x(1), &
               netmp,hint(pp))
          
          if (status .eq. FIO_SUCCESS) then

             if(netmp.le.0) netmp=1._rp
             
             n_e(pp) = netmp/params%cpp%density
          else if (status .eq. FIO_NO_DATA) then
             flag(pp) = 0_is
          else if (status .ne. FIO_SUCCESS) then
             flag(pp) = 0_is
             CYCLE
          end if
          
          status = fio_eval_field(P%FIO_te, x(1), &
               Tetmp,hint(pp))

          if (status .eq. FIO_SUCCESS) then

             if(Tetmp.le.0) Tetmp=0.1_rp
             
             T_e(pp) = Tetmp/(params%cpp%temperature/C_E)
          end if
          
!          write(6,*) E_R,E_PHI,E_Z
          
       end if
    end do

  end subroutine get_fio_profile_p