I have given OpenAcc access to the subroutine called "lang_force", and within that subroutine I call the Fortran90 intrinsic RANDOM_NUMBER().
subroutine lang_force(damp, temp, noise)
!$acc routine(lang_force)
implicit none
double precision, intent(in) :: damp, temp
double precision, dimension(1:3), intent(out) :: noise
double precision :: kb, a1, theta, phi, mag1, pi,r,s
integer :: i,j,k
double precision :: x,y,z
kb = 1.3806E-23
!kb = 1.0
pi=4.D0*DATAN(1.D0)
call random_number(a1)
call random_number(r)
call random_number(s)
mag1 = sqrt(-2.0*log(a1))
theta = r*pi
phi = 2.0*s*pi
x = mag1*cos(phi)*sin(theta)
y = mag1*sin(theta)*sin(phi)
z = mag1*cos(theta)
noise(1) = sqrt(2.0*kb*temp*damp)*x
noise(2) = sqrt(2.0*kb*temp*damp)*y
noise(3) = sqrt(2.0*kb*temp*damp)*z
end subroutine lang_force
When compiled with the latest version of pdf90, it tells me that it needs access to RANDOM_NUMBER(). How do I declare a routine directive to such a fortran90 intrinsic subroutine?