MODULE NFNUM_KINDS
!
!   NAME:       NFNUM_KINDS                                       
!   STATUS:     Ver. 1.0                                              
!   PURPOSE:    Named constants used to define variable.              
!   LIBRARY:    MATH                                                  
!   TYPE:       SINGLE, DOUBLE PRECISION                              
!   AUTHOR:     Shigeru Inagaki                                       
!               National Institute for Fusion Science                 
!               +81-572-58-2143                                       
!               inagaki@LHD.nifs.ac.jp                                
!                                                                     
!   DESCRIPTION:                                                      
!     Define KIND for each variable TYPE for portability.             
!     This module should be used every routine in libnf90.              
!                                                                     
!   SEE ALSO:                                                         
!   CALLED:                                                            
!   REVISION HISTORY:                                                 
!     31-DEC-2002 (CREATION)                                          
!   COMMENTS:                                                         
!                                                                     
!                                                                      
   INTEGER, PARAMETER :: i4b = SELECTED_INT_KIND(9)
   INTEGER, PARAMETER :: i2b = SELECTED_INT_KIND(4)
   INTEGER, PARAMETER :: i1b = SELECTED_INT_KIND(2)
   INTEGER, PARAMETER :: sp  = KIND(1.0)
   INTEGER, PARAMETER :: dp  = KIND(1.0D0)
   INTEGER, PARAMETER :: spc = KIND((1.0,1.0))
   INTEGER, PARAMETER :: dpc = KIND((1.0D0,1.0D0))
   INTEGER, PARAMETER :: lgt = KIND(.TRUE.)
!
END MODULE NFNUM_KINDS
!
!----------------------------------------------------------------------
!
MODULE NFNUM_USEFUL
!
!   NAME:       NFNUM_USEFUL                                     
!   STATUS:     Ver. 1.0                                              
!   PURPOSE:    Some useful mathematical constants in single and double
!                precision.
!   LIBRARY:    MATH                                         
!   TYPE:       SINGLE, DOUBLE PRECISION       
!   AUTHOR:     Shigeru Inagaki                                       
!               National Institute for Fusion Science                 
!               +81-572-58-2143                                       
!               inagaki@LHD.nifs.ac.jp                                
!                                                                     
!   DESCRIPTION:                                                      
!                                                                     
!   SEE ALSO: NFNUM_USEFUL_DP                                         
!   CALLED:                                                            
!   REVISION HISTORY:                                                 
!     31-DEC-2002 (CREATION)                                          
!     01-APR-2004 (REVISED)
!   COMMENTS:                                                         
!                                                                     
!                                                                     
   USE NFNUM_KINDS, ONLY : dp, sp
!
!  Single precision
!
   REAL(sp), PARAMETER :: zero_sp    = 0.0_sp
   REAL(sp), PARAMETER :: one_sp     = 1.0_sp
   REAL(sp), PARAMETER :: pi_sp      = 3.141592653589793238462643383279502884197_sp
   REAL(sp), PARAMETER :: pio2_sp    = 1.57079632679489661923132169163975144209858_sp
   REAL(sp), PARAMETER :: twopi_sp   = 6.283185307179586476925286766559005768394_sp
   REAL(sp), PARAMETER :: sqrt2_sp   = 1.41421356237309504880168872420969807856967_sp
   REAL(sp), PARAMETER :: euler_sp   = 0.5772156649015328606065120900824024310422_sp
   REAL(sp), PARAMETER :: rad2deg_sp = 180.0_sp/pi_sp
   REAL(sp), PARAMETER :: deg2rad_sp = pi_sp/180.0_sp
!
!  Double precision
!
   REAL(dp), PARAMETER :: zero_dp    = 0.0_dp
   REAL(dp), PARAMETER :: one_dp     = 1.0_dp
   REAL(dp), PARAMETER :: pi_dp      = 3.141592653589793238462643383279502884197_dp
   REAL(dp), PARAMETER :: pio2_dp    = 1.57079632679489661923132169163975144209858_dp
   REAL(dp), PARAMETER :: twopi_dp   = 6.283185307179586476925286766559005768394_dp
   REAL(dp), PARAMETER :: sqrt2_dp   = 1.41421356237309504880168872420969807856967_dp
   REAL(dp), PARAMETER :: euler_dp   = 0.5772156649015328606065120900824024310422_dp
   REAL(dp), PARAMETER :: rad2deg_dp = 180.0_dp/pi_dp
   REAL(dp), PARAMETER :: deg2rad_dp = pi_dp/180.0_dp
! 
END MODULE NFNUM_USEFUL
