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(a, b, c, beta, hf_deg)
  
  implicit none
  
  real*8 a,b,c,beta
  integer hf_deg
  namelist /name/ a,b,c,beta,hf_deg

  read(1000,name,err=100)

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

end subroutine read


