A.8 Numbers Module Code Listing

The main documentation of the Numbers Module contains additional explanation of this code listing.

!
! Author: Michael L. Hall
!         P.O. Box 1663, MS-D413, LANL
!         Los Alamos, NM 87545
!         ph: 505-665-4312
!         email: Hall@LANL.gov
!
! Created on: 6/1/86
! CVS Info:   $Id: numbers.F90,v 1.4 2009/09/04 01:58:44 hall Exp $

module Caesar_Numbers_Module

  ! Start up with everything untyped and public.
  ! Note: this module contains no private information.

  implicit none
  public

  ! Define the variables used in the place of numbers.

  ! Numbers 0-9.

  type(real), parameter :: zero=0.d0,  one=1.d0,  two=2.d0, three=3.d0, &
                           four=4.d0,  five=5.d0, six=6.d0, seven=7.d0, &
                           eight=8.d0, nine=9.d0

  ! Numbers 10-19.

  type(real), parameter :: ten=10.d0,      eleven=11.d0,    twelve=12.d0,   &
                           thirteen=13.d0, fourteen=14.d0,  fifteen=15.d0,  &
                           sixteen=16.d0,  seventeen=17.d0, eighteen=18.d0, &
                           nineteen=19.d0

  ! Numbers 20-100, by tens.

  type(real), parameter :: twenty=20.d0, thirty=30.d0, forty=40.d0,   &
                           fifty=50.d0,  sixty=60.d0,  seventy=70.d0, &
                           eighty=80.d0, ninety=90.d0, hundred=100.d0

  ! Fractions.

  type(real), parameter :: half=one/two,     third=one/three,   &
                           fourth=one/four,  fifth=one/five,    &
                           sixth=one/six,    seventh=one/seven, &
                           eighth=one/eight, ninth=one/nine,    &
                           tenth=one/ten

  ! Forms of pi.

  type(real), parameter ::                                             &
    pi=3.141592653589793238462643383279d0, sqrtpi=1.7724538509055d0,   &
    invpi=one/pi,    pisqr=pi*pi,          fourthirdspi=four*pi/three, &
    twopi=two*pi,    threepi=three*pi,     fourpi=four*pi,             & 
    halfpi=pi/two,   thirdpi=pi/three,     fourthpi=pi/four,           &
    sqrtfourpi=two*sqrtpi

  ! Decimal multipliers.

  type(real), parameter :: deca=1.d1,    hecto=1.d2,  kilo=1.d3,    &
                           mega=1.d6,    giga=1.d9,   tera=1.d12,   &
                           peta=1.d15,   exa=1.d18,   zetta=1.d21,  &
                           yotta=1.d24,                             &
                           deci=1.d-1,   centi=1.d-2, milli=1.d-3,  &
                           micro=1.d-6,  nano=1.d-9,  pico=1.d-12,  &
                           femto=1.d-15, atto=1.d-18, zepto=1.d-21, &
                           yocto=1.d-24

end module Caesar_Numbers_Module



Subsections

Michael L. Hall