!
!  get_next_ptr.f90
!
    subroutine get_next_ptr(cmem,ctype,ptr,ierr)
!
    use memory_pointers
    character (len=*) :: cmem
    character (len=*) :: ctype
    integer :: ierr
!
! Pointer    
    integer :: ptr
!
    if (cmem(1:7)=='physics') then
      if (ctype(1:4)== 'real') then 
        ptr = pphys_real+1
      elseif (ctype(1:3)== 'int') then 
        ptr = pphys_int+1
      elseif (ctype(1:4)== 'char') then 
        ptr = pphys_char+1
      endif                
    else
      if (ctype(1:4)== 'real') then
        ptr = p_real+1    
      elseif (ctype(1:3)== 'int') then
        ptr = p_int+1 
      elseif (ctype(1:4)== 'char') then
        ptr = p_char+1 
      elseif (ctype(1:4)== 'dble') then
        ptr = p_dbl+1
      endif                   
    endif
!
    end subroutine get_next_ptr