1 -- 
    2 --      Patricia Fasel
    3 --      Los Alamos National Laboratory
    4 --      1990 August
    5 --
    6 module InitTable (ergs, xComp, xPair, xPhot) where
    7 
    8 import GamtebType
    9 import Consts
   10 import Array--1.3
   11 
   12 -- initialize the cross section tables
   13 -- these tables are constant, used with the energy and energy index
   14 -- in calculating probabilities
   15 
   16 ergs :: Array Indx Value
   17 ergs = array (1,numLev) (zipWith (,) [1..numLev] (map f2 erg))
   18         where erg = 
   19                 [0.001, 0.0015, 0.002, 0.003, 0.004, 0.005, 0.006, 0.008,
   20                 0.01, 0.015, 0.02, 0.03, 0.04, 0.05, 0.06, 0.08,
   21                 0.1, 0.15, 0.2, 0.3, 0.4, 0.5, 0.6, 0.8,
   22                 1.0, 1.5, 2.0, 3.0, 4.0, 5.0, 6.0, 8.0,
   23                 10.0, 15.0, 20.0]
   24         
   25 xComp :: Array Indx Value
   26 xComp = array (1,numLev) (zipWith (,) [1..numLev] (map f1 xc))
   27         where xc = 
   28                 [0.015, 0.0296, 0.0451, 0.0717, 0.0913, 0.105, 0.115, 0.128, 
   29                 0.137, 0.152, 0.160, 0.165, 0.165, 0.163, 0.160, 0.153, 
   30                 0.146, 0.133, 0.122, 0.106, 0.0953, 0.0867, 0.0802, 0.0707, 
   31                 0.0637, 0.0516, 0.0440, 0.0346, 0.0289, 0.025, 0.0221, 0.0181, 
   32                 0.0154, 0.0114, 0.00913]
   33         
   34 xPair :: Array Indx Value
   35 xPair = array (1,numLev) (zipWith (,) [1..numLev] (map f1 xp))
   36         where xp = 
   37                 [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 
   38                 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
   39                 0.0000792, 0.000316, 0.000923, 0.00153, 0.00208, 0.00256, 
   40                 0.00343, 0.00414, 0.00547, 0.00652]
   41         
   42 xPhot :: Array Indx Value
   43 xPhot = array (1,numLev) (zipWith (,) [1..numLev] (map f1 xpe))
   44         where xpe = 
   45                 [2010.0, 632.0, 280.0, 87.7, 37.3, 18.9, 10.4, 4.01, 
   46                 1.91, 0.489, 0.192, 0.0491, 0.0186, 0.00887, 0.00481, 
   47                 0.00179, 0.000862, 0.000234, 0.0000918,
   48                 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 
   49                 0.0, 0.0, 0.0, 0.0]
   50         
   51 f1 :: Value -> Value
   52 f1 x = if (x < small)
   53         then nothing
   54         else log (2.2*x)
   55 
   56 f2 :: Value -> Value
   57 f2 x = if (x < small)
   58         then nothing
   59         else log x