!c Description:
!c  惑星の名前から重力を計算する
!c
!c Current Code Owner: 
!c   sugiyama@gfd-dennou.org
!c
!c Histry: 
!c   Version    Date          Comment
!c   -------    ----------    --------
!c   1.0        2003-02-05    作成
!c
!c Copyright (C) SUGIYAMA Ko-ichiro, 2003, All rights reserved

module interface_def_gravity

  interface
     subroutine gravity(planet, grav)    
       character(*), intent(in) :: planet
       real(8), intent(out)     :: grav
     end subroutine gravity
  end interface

end module interface_def_gravity



subroutine def_gravity(planet, grav)    
  use prm_phys, only: grav_jupiter, &
       & grav_saturn, grav_uranus, grav_neptune, grav_earth, grav_titan

  implicit none
  character(*), intent(in) :: planet
  real(8), intent(out)     :: grav


  if (planet == "jupiter") then
     grav = grav_jupiter
  elseif (planet == "earth") then
     grav = grav_earth
  elseif (planet == "saturn") then
     grav = grav_saturn 
  elseif (planet == "uranus") then
     grav = grav_uranus
  elseif (planet == "neptune") then
     grav = grav_neptune
  elseif (planet == "titan") then
     grav = grav_titan
  else
     write(*,*) "unknown Planet Name: ", planet
     stop
  end if
end subroutine def_gravity
