program testnl
  implicit none
  
  real*8 arga,argb,argc,beta
  integer hf_deg
  
  call read(arga, argb, argc, beta, hf_deg)
  
  print *, arga, argb, argc, beta, hf_deg
  
  stop
end program testnl

subroutine read(arga, argb, argc, argbeta, arghf_deg)
  
  implicit NONE
  
  real*8 arga,a
  real*8 argb,b
  real*8 argc,c
  real*8 argbeta,beta
  integer arghf_deg,hf_deg
  namelist /name/ a,b,c,beta,hf_deg

  read(5,name,err=100)
  
  arga=a
  argb=b
  argc=c
  argbeta=beta
  arghf_deg=hf_deg

  return
  
100 write(0,'(A)')'error occurs @ reading namelist name'
  write(0,'(A)') 'stop.'

end subroutine read


