21 November 2015 10:07:27.807 PM SUBPAK_PRB FORTRAN90 version Test the SUBPAK library. ANGLE_SHIFT_TEST ANGLE_SHIFT shifts an angle by multiples of 2 Pi until it lies between BETA and BETA+2Pi. ALPHA BETA GAMMA BETA+2Pi -7.1 11.5 11.8 17.8 8.3 1.6 2.0 7.8 -2.1 -10.9 -8.4 -4.6 -6.1 -9.8 -6.1 -3.5 -11.5 3.4 7.4 9.7 -11.0 -1.3 1.6 5.0 -2.5 6.4 10.1 12.7 7.5 -12.5 -11.4 -6.2 10.0 -3.8 -2.6 2.5 -10.2 -12.2 -10.2 -5.9 TEST02 ANGLE_SHIFT_DEG shifts an angle by multiples of 360 degrees until it lies between BETA and BETA+360. ALPHA BETA GAMMA BETA+360 -405.5 657.1 674.5 1017.1 474.5 88.8 114.5 448.8 -122.0 -624.8 -482.0 -264.8 -349.1 -561.7 -349.1 -201.7 -656.9 192.9 423.1 552.9 -631.1 -72.7 88.9 287.3 -142.1 366.7 577.9 726.7 428.1 -717.4 -651.9 -357.4 572.4 -214.9 -147.6 145.1 -583.9 -700.4 -583.9 -340.4 TEST03 ANGLE_TO_RGB converts an angle into an RGB color. ANGLE R G B 78.6 0.602 1.000 0.000 344.3 1.000 0.000 0.209 298.6 0.965 0.000 1.000 202.2 0.000 0.539 1.000 149.5 0.000 1.000 0.407 23.8 1.000 0.322 0.000 92.7 0.373 1.000 0.000 39.6 1.000 0.570 0.000 15.8 1.000 0.210 0.000 228.2 0.000 0.155 1.000 TEST04 AXIS_LIMITS adjusts plot limits to "nicer" values. Input XMIN = 67.3000 Input XMAX = 114.700 Input NDIVS = 6 Output PXMIN = 60.0000 Output PXMAX = 120.000 Output PXDIV = 10.0000 Output NTICKS = 5 Input XMIN = -26.0000 Input XMAX = 26.0000 Input NDIVS = 10 Output PXMIN = -50.0000 Output PXMAX = 50.0000 Output PXDIV = 10.0000 Output NTICKS = 5 TEST05 AXIS_LIMITS computes "nice" limits for a graph that must include a given range. All tests use NDIVS = 5 XMIN XMAX PXMIN PXMAX PXDIV NTICKS 1.000 9.000 0.000 10.00 2.000 4 1.003 4.125 1.000 6.000 1.000 5 101.2 193.8 100.0 200.0 20.00 4 2000. 2000. 2000. 2000. 0.4000E-01 4 -7.000 12.00 -8.000 12.00 4.000 4 TEST06 BAR_CHECK checks digits for a barcode; BAR_CODE computes the barcode for a string of 11 digits; BAR_DIGIT_CODE_LEFT returns the left digit code. BAR_DIGIT_CODE_RIGHT returns the right digit code. The check digit is 5 The left and right digit codes: 0 0001101 1110010 1 0011001 1100110 2 0010011 1101100 3 0111101 1000010 4 0100011 1011100 5 0110001 1001110 6 0101111 1010000 7 0111011 1000100 8 0110111 1001000 9 0001011 1110100 Bar code: 000000000 101 0001101 0011001 0010011 0111101 0100011 0110001 01010 1010000 1000100 1001000 1110100 1110010 1001110 101 000000000 TEST07 BMI_ENGLISH computes the Body Mass Index given body measurements in English Units. Weight Height BMI (LB) (FT IN) 132.76 6.00 8.00 14.58 224.43 5.00 7.00 35.15 162.30 4.00 2.00 45.64 138.64 4.00 4.00 36.05 106.57 5.00 9.00 15.74 109.26 5.00 3.00 19.35 160.20 6.00 1.00 21.14 219.59 4.00 0.00 67.01 234.63 4.00 12.00 45.82 114.18 4.00 0.00 34.84 TEST08 For products of prime factors: FAC_DIV computes a quotient; FAC_MUL multiplies; FAC_LCM computes the LCM; FAC_GCD computes the GCD; I4_TO_FAC converts an integer; FAC_TO_I4 converts to an integer. FAC_TO_RAT converts to a ratio. Representation of I1 = 720 Prime Power 2 4 3 2 5 1 Representation of I2 = 42 Prime Power 2 1 3 1 7 1 LCM of I1, I2: Prime Power 2 4 3 2 5 1 7 1 GCD of I1, I2: Prime Power 2 1 3 1 Product of I1, I2: Prime Power 2 5 3 3 5 1 7 1 Quotient of I2 / I1: Prime Power 2 -3 3 -1 5 -1 7 1 Quotient as a rational: 7 / 120 TEST09 GAUSS_SUM evaluates a function which is the sum of Gaussian functions. Number of component Gaussians = 3 Center Amplitude Width X Y 1 2.00 3.00 10.00 1.00 2 5.00 8.00 5.00 2.00 3 7.00 5.00 -3.00 4.00 X Y Gauss_Sum(X,Y) 0.00 0.00 -0.293884E-01 0.00 1.00 -0.482632E-01 0.00 2.00 -0.125666E-01 0.00 3.00 0.739000E-01 0.00 4.00 -0.642545E-01 0.00 5.00 -0.135940 0.00 6.00 -0.128237 0.00 7.00 -0.101758 0.00 8.00 -0.702950E-01 0.00 9.00 -0.441007E-01 0.00 10.00 -0.258601E-01 1.00 0.00 -0.658246E-01 1.00 1.00 -0.489427E-01 1.00 2.00 1.17320 1.00 3.00 3.43272 1.00 4.00 1.05799 1.00 5.00 -0.239166 1.00 6.00 -0.262896 1.00 7.00 -0.174933 1.00 8.00 -0.885858E-01 1.00 9.00 -0.450015E-01 1.00 10.00 -0.325889E-01 2.00 0.00 -0.130577 2.00 1.00 -0.481762E-01 2.00 2.00 3.32056 2.00 3.00 9.51128 2.00 4.00 3.09771 2.00 5.00 -0.390133 2.00 6.00 -0.395630 2.00 7.00 -0.793104E-01 2.00 8.00 0.168697 2.00 9.00 0.179090 2.00 10.00 0.620602E-01 3.00 0.00 -0.230881 3.00 1.00 -0.338618 3.00 2.00 0.724746 3.00 3.00 2.82283 3.00 4.00 0.350270 3.00 5.00 -0.842388 3.00 6.00 -0.359642 3.00 7.00 0.573010 3.00 8.00 1.21056 3.00 9.00 1.02652 3.00 10.00 0.445341 4.00 0.00 -0.358276 4.00 1.00 -0.625461 4.00 2.00 -0.906097 4.00 3.00 -1.14057 4.00 4.00 -1.46708 4.00 5.00 -1.29557 4.00 6.00 -0.173238 4.00 7.00 1.70141 4.00 8.00 2.92005 4.00 9.00 2.40382 4.00 10.00 1.07423 5.00 0.00 -0.489736 5.00 1.00 -0.859468 5.00 2.00 -1.33017 5.00 3.00 -1.80871 5.00 4.00 -2.10281 5.00 5.00 -1.80938 5.00 6.00 -0.355450 5.00 7.00 2.07441 5.00 8.00 3.66876 5.00 9.00 3.03449 5.00 10.00 1.34966 6.00 0.00 -0.590735 6.00 1.00 -1.03675 6.00 2.00 -1.60530 6.00 3.00 -2.18733 6.00 4.00 -2.57617 6.00 5.00 -2.40781 6.00 6.00 -1.21497 6.00 7.00 0.837806 6.00 8.00 2.28822 6.00 9.00 1.99588 6.00 10.00 0.841789 7.00 0.00 -0.628834 7.00 1.00 -1.10363 7.00 2.00 -1.70912 7.00 3.00 -2.33285 7.00 4.00 -2.78455 7.00 5.00 -2.80613 7.00 6.00 -2.14156 7.00 7.00 -0.903878 7.00 8.00 0.130049 7.00 9.00 0.328886 7.00 10.00 0.478423E-01 8.00 0.00 -0.590735 8.00 1.00 -1.03677 8.00 2.00 -1.60572 8.00 3.00 -2.19383 8.00 4.00 -2.63784 8.00 5.00 -2.76269 8.00 6.00 -2.45362 8.00 7.00 -1.78442 8.00 8.00 -1.07879 8.00 9.00 -0.626347 8.00 10.00 -0.396864 9.00 0.00 -0.489737 9.00 1.00 -0.859514 9.00 2.00 -1.33123 9.00 3.00 -1.81942 9.00 4.00 -2.19317 9.00 5.00 -2.32675 9.00 6.00 -2.16116 9.00 7.00 -1.74827 9.00 8.00 -1.23966 9.00 9.00 -0.788193 9.00 10.00 -0.456047 10.00 0.00 -0.358299 10.00 1.00 -0.628834 10.00 2.00 -0.973956 10.00 3.00 -1.33122 10.00 4.00 -1.60561 10.00 5.00 -1.70833 10.00 6.00 -1.60223 10.00 7.00 -1.32372 10.00 8.00 -0.964305 10.00 9.00 -0.621317 10.00 10.00 -0.354748 TEST10 GET_SEED gets a seed for the random number generator. These values are computed from the time and date. Values computed nearby in time will be near to each other, and should be passed through a random number generator a few times before use. I R(I) R2(I) R3(I) 1402077509 378635232 728298163 1997921288 1402077509 378635232 728298163 1997921288 1402077509 378635232 728298163 1997921288 1402077509 378635232 728298163 1997921288 1402077509 378635232 728298163 1997921288 1402077509 378635232 728298163 1997921288 1402077509 378635232 728298163 1997921288 1402077509 378635232 728298163 1997921288 1402077509 378635232 728298163 1997921288 1402077509 378635232 728298163 1997921288 TEST11 GRID1 computes a 1D grid between two DIM_NUM dimensional points X1 and X2. Here, we will use 11 steps going from 1.000 0.000 20.00 -5.000 1.000 to 1.000 10.00 0.000 5.000 2.000 The grid matrix: Row 1 2 3 4 5 Col 1: 1.00000 0.00000 20.0000 -5.00000 1.00000 2: 1.00000 1.00000 18.0000 -4.00000 1.10000 3: 1.00000 2.00000 16.0000 -3.00000 1.20000 4: 1.00000 3.00000 14.0000 -2.00000 1.30000 5: 1.00000 4.00000 12.0000 -1.00000 1.40000 6: 1.00000 5.00000 10.0000 0.00000 1.50000 7: 1.00000 6.00000 8.00000 1.00000 1.60000 8: 1.00000 7.00000 6.00000 2.00000 1.70000 9: 1.00000 8.00000 4.00000 3.00000 1.80000 10: 1.00000 9.00000 2.00000 4.00000 1.90000 11: 1.00000 10.0000 0.00000 5.00000 2.00000 TEST12 GRID1N computes a 1D grid between two DIM_NUM dimensional points X1 and X2, one point at a time. Here, we will use 11 steps going from 1.000 0.000 20.00 -5.000 1.000 to 1.000 10.00 0.000 5.000 2.000 1 1.000 0.000 20.00 -5.000 1.000 2 1.000 1.000 18.00 -4.000 1.100 3 1.000 2.000 16.00 -3.000 1.200 4 1.000 3.000 14.00 -2.000 1.300 5 1.000 4.000 12.00 -1.000 1.400 6 1.000 5.000 10.00 0.000 1.500 7 1.000 6.000 8.000 1.000 1.600 8 1.000 7.000 6.000 2.000 1.700 9 1.000 8.000 4.000 3.000 1.800 10 1.000 9.000 2.000 4.000 1.900 11 1.000 10.00 0.000 5.000 2.000 TEST13 GRID2 computes a 1 D grid between two DIM_NUM dimensional points X1 and X2, computing X1 and X2 at user specified times. Here, we will use 20 steps, and on step 3 we will compute 1.000 0.000 20.00 -5.000 1.000 and on step 13 we will compute 1.000 10.00 0.000 5.000 2.000 The grid matrix: Col 1 2 3 4 5 Row 1: 1. 1. 1. 1. 1. 2: -2. -1. 0. 1. 2. 3: 24. 22. 20. 18. 16. 4: -7. -6. -5. -4. -3. 5: 0.800000 0.900000 1. 1.10000 1.20000 Col 6 7 8 9 10 Row 1: 1. 1. 1. 1. 1. 2: 3. 4. 5. 6. 7. 3: 14. 12. 10. 8. 6. 4: -2. -1. 0. 1. 2. 5: 1.30000 1.40000 1.50000 1.60000 1.70000 Col 11 12 13 14 15 Row 1: 1. 1. 1. 1. 1. 2: 8. 9. 10. 11. 12. 3: 4. 2. 0. -2. -4. 4: 3. 4. 5. 6. 7. 5: 1.80000 1.90000 2. 2.10000 2.20000 Col 16 17 18 19 20 Row 1: 1. 1. 1. 1. 1. 2: 13. 14. 15. 16. 17. 3: -6. -8. -10. -12. -14. 4: 8. 9. 10. 11. 12. 5: 2.30000 2.40000 2.50000 2.60000 2.70000 TEST14 GRID2N computes points from a 1D grid between two DIM_NUM dimensional points X1 and X2, one at a time, with X1 and X2 having user specified J coordinates. Here, on step 3 we would compute 1.000 0.000 20.00 -5.000 1.000 and on step 13 we would compute 1.000 10.00 0.000 5.000 2.000 1 1.000 -2.000 24.00 -7.000 0.8000 2 1.000 -1.000 22.00 -6.000 0.9000 3 1.000 0.000 20.00 -5.000 1.000 4 1.000 1.000 18.00 -4.000 1.100 5 1.000 2.000 16.00 -3.000 1.200 6 1.000 3.000 14.00 -2.000 1.300 7 1.000 4.000 12.00 -1.000 1.400 8 1.000 5.000 10.00 0.000 1.500 9 1.000 6.000 8.000 1.000 1.600 10 1.000 7.000 6.000 2.000 1.700 11 1.000 8.000 4.000 3.000 1.800 12 1.000 9.000 2.000 4.000 1.900 13 1.000 10.00 0.000 5.000 2.000 14 1.000 11.00 -2.000 6.000 2.100 15 1.000 12.00 -4.000 7.000 2.200 16 1.000 13.00 -6.000 8.000 2.300 17 1.000 14.00 -8.000 9.000 2.400 18 1.000 15.00 -10.00 10.00 2.500 19 1.000 16.00 -12.00 11.00 2.600 20 1.000 17.00 -14.00 12.00 2.700 TEST15 GRID3 computes a 2D grid in the plane containing the DIM_NUM-dimensional points X1, X2 and X3. Here, we will use 3 steps going from 1.000 0.000 20.00 -5.000 1.000 to 1.000 10.00 0.000 5.000 2.000 and 6 steps going to 1.000 5.000 0.000 0.000 3.000 1 1 1.000 0.000 20.00 -5.000 1.000 1 2 1.000 1.000 16.00 -4.000 1.400 1 3 1.000 2.000 12.00 -3.000 1.800 1 4 1.000 3.000 8.000 -2.000 2.200 1 5 1.000 4.000 4.000 -1.000 2.600 1 6 1.000 5.000 0.000 0.000 3.000 2 1 1.000 5.000 10.00 0.000 1.500 2 2 1.000 6.000 6.000 1.000 1.900 2 3 1.000 7.000 2.000 2.000 2.300 2 4 1.000 8.000 -2.000 3.000 2.700 2 5 1.000 9.000 -6.000 4.000 3.100 2 6 1.000 10.00 -10.00 5.000 3.500 3 1 1.000 10.00 0.000 5.000 2.000 3 2 1.000 11.00 -4.000 6.000 2.400 3 3 1.000 12.00 -8.000 7.000 2.800 3 4 1.000 13.00 -12.00 8.000 3.200 3 5 1.000 14.00 -16.00 9.000 3.600 3 6 1.000 15.00 -20.00 10.00 4.000 TEST16 GRID3N computes a point from a 2D grid in the plane containing the DIM_NUM-dimensional points X1, X2 and X3. We use 3 steps from 1.000 0.000 20.00 -5.000 1.000 to 1.000 10.00 0.000 5.000 2.000 and 6 steps going to 1.000 5.000 0.000 0.000 3.000 1 1 1.000 0.000 20.00 -5.000 1.000 1 2 1.000 1.000 16.00 -4.000 1.400 1 3 1.000 2.000 12.00 -3.000 1.800 1 4 1.000 3.000 8.000 -2.000 2.200 1 5 1.000 4.000 4.000 -1.000 2.600 1 6 1.000 5.000 0.000 0.000 3.000 2 1 1.000 5.000 10.00 0.000 1.500 2 2 1.000 6.000 6.000 1.000 1.900 2 3 1.000 7.000 2.000 2.000 2.300 2 4 1.000 8.000 -2.000 3.000 2.700 2 5 1.000 9.000 -6.000 4.000 3.100 2 6 1.000 10.00 -10.00 5.000 3.500 3 1 1.000 10.00 0.000 5.000 2.000 3 2 1.000 11.00 -4.000 6.000 2.400 3 3 1.000 12.00 -8.000 7.000 2.800 3 4 1.000 13.00 -12.00 8.000 3.200 3 5 1.000 14.00 -16.00 9.000 3.600 3 6 1.000 15.00 -20.00 10.00 4.000 TEST17 GRID4 computes a 2D planar grid containing the DIM_NUM-dimensional points X1, X2 and X3. We compute the points on the following steps: X1 on step 2 3 X2 on step 5 3 X3 on step 2 9 We use 6 steps in the J direction and 10 steps in the K direction. The points X1, X2 and X3 are: 1.000 0.000 20.00 -5.000 1.000 1.000 10.00 0.000 5.000 2.000 1.000 5.000 0.000 0.000 3.000 1 1 1.000 -5.000 33.33 -10.00 -0.1110E-15 1 2 1.000 -4.167 30.00 -9.167 0.3333 1 3 1.000 -3.333 26.67 -8.333 0.6667 1 4 1.000 -2.500 23.33 -7.500 1.000 1 5 1.000 -1.667 20.00 -6.667 1.333 1 6 1.000 -0.8333 16.67 -5.833 1.667 1 7 1.000 0.000 13.33 -5.000 2.000 1 8 1.000 0.8333 10.00 -4.167 2.333 1 9 1.000 1.667 6.667 -3.333 2.667 1 10 1.000 2.500 3.333 -2.500 3.000 2 1 1.000 -1.667 26.67 -6.667 0.3333 2 2 1.000 -0.8333 23.33 -5.833 0.6667 2 3 1.000 0.000 20.00 -5.000 1.000 2 4 1.000 0.8333 16.67 -4.167 1.333 2 5 1.000 1.667 13.33 -3.333 1.667 2 6 1.000 2.500 10.00 -2.500 2.000 2 7 1.000 3.333 6.667 -1.667 2.333 2 8 1.000 4.167 3.333 -0.8333 2.667 2 9 1.000 5.000 0.000 0.000 3.000 2 10 1.000 5.833 -3.333 0.8333 3.333 3 1 1.000 1.667 20.00 -3.333 0.6667 3 2 1.000 2.500 16.67 -2.500 1.000 3 3 1.000 3.333 13.33 -1.667 1.333 3 4 1.000 4.167 10.00 -0.8333 1.667 3 5 1.000 5.000 6.667 -0.6661E-15 2.000 3 6 1.000 5.833 3.333 0.8333 2.333 3 7 1.000 6.667 0.2220E-14 1.667 2.667 3 8 1.000 7.500 -3.333 2.500 3.000 3 9 1.000 8.333 -6.667 3.333 3.333 3 10 1.000 9.167 -10.00 4.167 3.667 4 1 1.000 5.000 13.33 -0.8882E-15 1.000 4 2 1.000 5.833 10.00 0.8333 1.333 4 3 1.000 6.667 6.667 1.667 1.667 4 4 1.000 7.500 3.333 2.500 2.000 4 5 1.000 8.333 0.1110E-14 3.333 2.333 4 6 1.000 9.167 -3.333 4.167 2.667 4 7 1.000 10.00 -6.667 5.000 3.000 4 8 1.000 10.83 -10.00 5.833 3.333 4 9 1.000 11.67 -13.33 6.667 3.667 4 10 1.000 12.50 -16.67 7.500 4.000 5 1 1.000 8.333 6.667 3.333 1.333 5 2 1.000 9.167 3.333 4.167 1.667 5 3 1.000 10.00 0.000 5.000 2.000 5 4 1.000 10.83 -3.333 5.833 2.333 5 5 1.000 11.67 -6.667 6.667 2.667 5 6 1.000 12.50 -10.00 7.500 3.000 5 7 1.000 13.33 -13.33 8.333 3.333 5 8 1.000 14.17 -16.67 9.167 3.667 5 9 1.000 15.00 -20.00 10.00 4.000 5 10 1.000 15.83 -23.33 10.83 4.333 6 1 1.000 11.67 0.1110E-14 6.667 1.667 6 2 1.000 12.50 -3.333 7.500 2.000 6 3 1.000 13.33 -6.667 8.333 2.333 6 4 1.000 14.17 -10.00 9.167 2.667 6 5 1.000 15.00 -13.33 10.00 3.000 6 6 1.000 15.83 -16.67 10.83 3.333 6 7 1.000 16.67 -20.00 11.67 3.667 6 8 1.000 17.50 -23.33 12.50 4.000 6 9 1.000 18.33 -26.67 13.33 4.333 6 10 1.000 19.17 -30.00 14.17 4.667 TEST18 GRID4N computes, one at a time, points on a 2D grid in the plane containing the DIM_NUM-dimensional points X1, X2 and X3. We wish to compute the points on the following steps: X1 on step 2 3 X2 on step 5 3 X3 on step 2 9 We use 6 steps in the J direction and 10 steps in the K direction. The points X1, X2 and X3 are: 1.000 0.000 20.00 -5.000 1.000 1.000 10.00 0.000 5.000 2.000 1.000 5.000 0.000 0.000 3.000 1 1 1.000 -5.000 33.33 -10.00 -0.1110E-15 1 2 1.000 -4.167 30.00 -9.167 0.3333 1 3 1.000 -3.333 26.67 -8.333 0.6667 1 4 1.000 -2.500 23.33 -7.500 1.000 1 5 1.000 -1.667 20.00 -6.667 1.333 1 6 1.000 -0.8333 16.67 -5.833 1.667 1 7 1.000 0.000 13.33 -5.000 2.000 1 8 1.000 0.8333 10.00 -4.167 2.333 1 9 1.000 1.667 6.667 -3.333 2.667 1 10 1.000 2.500 3.333 -2.500 3.000 2 1 1.000 -1.667 26.67 -6.667 0.3333 2 2 1.000 -0.8333 23.33 -5.833 0.6667 2 3 1.000 0.000 20.00 -5.000 1.000 2 4 1.000 0.8333 16.67 -4.167 1.333 2 5 1.000 1.667 13.33 -3.333 1.667 2 6 1.000 2.500 10.00 -2.500 2.000 2 7 1.000 3.333 6.667 -1.667 2.333 2 8 1.000 4.167 3.333 -0.8333 2.667 2 9 1.000 5.000 0.000 0.000 3.000 2 10 1.000 5.833 -3.333 0.8333 3.333 3 1 1.000 1.667 20.00 -3.333 0.6667 3 2 1.000 2.500 16.67 -2.500 1.000 3 3 1.000 3.333 13.33 -1.667 1.333 3 4 1.000 4.167 10.00 -0.8333 1.667 3 5 1.000 5.000 6.667 -0.6661E-15 2.000 3 6 1.000 5.833 3.333 0.8333 2.333 3 7 1.000 6.667 0.2220E-14 1.667 2.667 3 8 1.000 7.500 -3.333 2.500 3.000 3 9 1.000 8.333 -6.667 3.333 3.333 3 10 1.000 9.167 -10.00 4.167 3.667 4 1 1.000 5.000 13.33 -0.8882E-15 1.000 4 2 1.000 5.833 10.00 0.8333 1.333 4 3 1.000 6.667 6.667 1.667 1.667 4 4 1.000 7.500 3.333 2.500 2.000 4 5 1.000 8.333 0.1110E-14 3.333 2.333 4 6 1.000 9.167 -3.333 4.167 2.667 4 7 1.000 10.00 -6.667 5.000 3.000 4 8 1.000 10.83 -10.00 5.833 3.333 4 9 1.000 11.67 -13.33 6.667 3.667 4 10 1.000 12.50 -16.67 7.500 4.000 5 1 1.000 8.333 6.667 3.333 1.333 5 2 1.000 9.167 3.333 4.167 1.667 5 3 1.000 10.00 0.000 5.000 2.000 5 4 1.000 10.83 -3.333 5.833 2.333 5 5 1.000 11.67 -6.667 6.667 2.667 5 6 1.000 12.50 -10.00 7.500 3.000 5 7 1.000 13.33 -13.33 8.333 3.333 5 8 1.000 14.17 -16.67 9.167 3.667 5 9 1.000 15.00 -20.00 10.00 4.000 5 10 1.000 15.83 -23.33 10.83 4.333 6 1 1.000 11.67 0.1110E-14 6.667 1.667 6 2 1.000 12.50 -3.333 7.500 2.000 6 3 1.000 13.33 -6.667 8.333 2.333 6 4 1.000 14.17 -10.00 9.167 2.667 6 5 1.000 15.00 -13.33 10.00 3.000 6 6 1.000 15.83 -16.67 10.83 3.333 6 7 1.000 16.67 -20.00 11.67 3.667 6 8 1.000 17.50 -23.33 12.50 4.000 6 9 1.000 18.33 -26.67 13.33 4.333 6 10 1.000 19.17 -30.00 14.17 4.667 TEST19 INDEX1_COL column indexes a 1D array, INDEX1_ROW row indexes a 1D array, and there are several more versions of these functions. By COLS: Imin I Imax Xmin Index 1 3 5 INDEX1_COL 0 2 INDEXN_COL 0 2 1 3 5 1 2 4 INDEX2_COL 0 7 INDEXN_COL 0 7 1 3 5 1 2 4 1 1 3 INDEX3_COL 0 7 INDEXN_COL 0 7 1 3 5 1 2 4 1 1 3 1 2 2 INDEX4_COL 0 67 INDEXN_COL 0 67 By ROWS: Imin I Imax Xmin Index 1 3 5 INDEX1_ROW 0 2 INDEXN_ROW 0 2 1 3 5 1 2 4 INDEX2_ROW 0 9 INDEXN_ROW 0 9 1 3 5 1 2 4 1 1 3 INDEX3_ROW 0 27 INDEXN_ROW 0 27 1 3 5 1 2 4 1 1 3 1 2 2 INDEX4_ROW 0 55 INDEXN_ROW 0 55 TEST22 LCM_12N computes the least common multiple of the integers 1 through N. N LCM_12N ( N ) 1 1 2 2 3 6 4 12 5 60 6 60 7 420 8 420 9 1260 10 1260 11 13860 12 13860 TEST24 PERM_INVERSE inverts a permutation in place; The original permutation: 1 2 3 4 5 6 7 4 3 5 1 7 6 2 The inverted permutation: 1 2 3 4 5 6 7 4 7 2 1 3 6 5 TEST25 PRIME_GE returns the smallest prime number greater than or equal to N. N P 1 2 2 2 3 3 4 5 5 5 6 7 7 7 8 11 9 11 10 11 11 11 12 13 13 13 14 17 15 17 16 17 17 17 18 19 19 19 20 23 TEST26 RANDOM_INITIALIZE can make up a seed for the FORTRAN90 random number generator RANDOM_NUMBER, or use a single SEED value from the user. Calling RANDOM_INITIALIZE with a zero input value of SEED tells the routine to make up a seed. And, at least for calls a few milliseconds apart, the output SEED should be different. In any case, if RANDOM_NUMBER is restarted by calling RANDOM_INITIALIZE with a nonzero input SEED, then the random number sequence should repeat. Call RANDOM_INITIALIZE 10 times. Use a 0 SEED the first time, then GET_SEED after than. Also, get the first three real random values. SEED Random 1, 2, 3 0 0.26034158 0.47659586 0.80309027 1402794054 0.62896371 0.74502101 0.69375127 1402794054 0.62896371 0.74502101 0.69375127 1402794054 0.62896371 0.74502101 0.69375127 1402794054 0.62896371 0.74502101 0.69375127 1402794054 0.62896371 0.74502101 0.69375127 1402794054 0.62896371 0.74502101 0.69375127 1402794054 0.62896371 0.74502101 0.69375127 1402794054 0.62896371 0.74502101 0.69375127 1402794054 0.62896371 0.74502101 0.69375127 Now call RANDOM_INITIALIZE with SEED = 5, 95, 5, 95. We promise the random numbers will repeat the second time. SEED Random 1, 2, 3 5 0.05409150 0.97116532 0.18396109 95 0.88336182 0.69061877 0.33779099 5 0.05409150 0.97116532 0.18396109 95 0.88336182 0.69061877 0.33779099 TEST27 RANDOM_NUMBER is an intrinsic FORTRAN90 routine to computer uniform random numbers. Random number seed size = 12 Test #1: Call 5 times, 1 value each time. 1 0.629752 2 0.382754 3 0.141815E-01 4 0.336782 5 0.504867 Test #2: Restore the random number seed. Call 5 times, 1 value each time. The results should be identical. 1 0.404230 2 0.498164 3 0.538949 4 0.925567 5 0.290356 Test #3: Restore the random number seed. Call 1 time for 5 values. The results should be identical. 1 0.629752 2 0.382754 3 0.141815E-01 4 0.336782 5 0.504867 Test #4: Restore the random number seed. Call for 2, 1, and 2 values. The results should be identical. 1 0.629752 2 0.382754 1 0.141815E-01 1 0.336782 2 0.504867 Test #5: Number of samples was 1000 Minimum value was 0.842497E-04 Maximum value was 0.998756 Average value was 0.504972 Variance was 0.815006E-01 Expected average 0.500000 Expected variance 0.833333E-01 TEST28 RANDOM_SEED is a FORTRAN90 routine which sets or gets the random number set. RANDOM_NUMBER returns a uniformly distributed random value between 0 and 1. Current random seed vector: 1 6739631 2 8629680 3 16679907 4 9591469 5 3026991 6 2033451 7 2940254 8 8500263 9 96168832 10 -43932236 11 350388129 12 522930181 Number of values computed was N = 1000 Average value was 0.502606 Variance was 0.855020E-01 TEST29 RAT_FACTOR factors a rational value. Rational value is 1638/ 12 Prime representation: I, FACTOR(I), POWER(I) 1 2 -1 2 3 1 3 7 1 4 13 1 TEST30 ROOTS_TO_R8POLY computes the coefficients of a polynomial from its roots. R8POLY_PRINT prints a polynomial. Roots: 1: 1.0000000 2: 2.0000000 3: 3.0000000 4: 4.0000000 The polynomial p(x) = 1.00000 * x ^ 4 - 10.0000 * x ^ 3 + 35.0000 * x ^ 2 - 50.0000 * x + 24.0000 TEST31 SORT_HEAP_EXTERNAL sorts objects externally. Unsorted array: 1: 5 2: 20 3: 17 4: 12 5: 9 6: 2 7: 6 8: 3 9: 1 10: 13 11: 2 12: 9 13: 9 14: 16 15: 16 16: 1 17: 18 18: 8 19: 2 20: 1 Sorted array: 1: 1 2: 1 3: 1 4: 2 5: 2 6: 2 7: 3 8: 5 9: 6 10: 8 11: 9 12: 9 13: 9 14: 12 15: 13 16: 16 17: 16 18: 17 19: 18 20: 20 TEST32 For evenly spaced angles between 0 and 2*PI: TVEC_EVEN TVEC_EVEN2 TVEC_EVEN3 TVEC_EVEN 1: 0.0000000 2: 1.5707963 3: 3.1415927 4: 4.7123890 TVEC_EVEN2 1: 0.78539816 2: 2.3561945 3: 3.9269908 4: 5.4977871 TVEC_EVEN3 1: 0.0000000 2: 2.0943951 3: 4.1887902 4: 6.2831853 TEST33 For evenly spaced angles between THETA1 and THETA2: TVEC_EVEN_BRACKET TVEC_EVEN_BRACKET2. TVEC_EVEN_BRACKET3. NT = 4 THETA1 = 30.0000 THETA2 = 90.0000 TVEC_EVEN_BRACKET 1: 30.000000 2: 50.000000 3: 70.000000 4: 90.000000 NT = 5 THETA1 = 30.0000 THETA2 = 90.0000 TVEC_EVEN_BRACKET2 1: 40.000000 2: 50.000000 3: 60.000000 4: 70.000000 5: 80.000000 NT = 3 THETA1 = 30.0000 THETA2 = 90.0000 TVEC_EVEN_BRACKET3 1: 40.000000 2: 60.000000 3: 80.000000 TEST34 UPC_CHECK_DIGIT determines the check digit for a UPC. P-LLLLL-RRRRR-C 0-72890-00011-8 0-12345-67890-5 TEST35 VERSINE_PULSE adds a versine pulse to a constant signal. 0 0.0000 1.0000 1 0.1000 1.0000 2 0.2000 1.0000 3 0.3000 1.0000 4 0.4000 1.0000 5 0.5000 1.0000 6 0.6000 1.0000 7 0.7000 1.0000 8 0.8000 1.0000 9 0.9000 1.0000 10 1.0000 1.0000 11 1.1000 1.0000 12 1.2000 1.0000 13 1.3000 1.0000 14 1.4000 1.0000 15 1.5000 1.0000 16 1.6000 1.0000 17 1.7000 1.0000 18 1.8000 1.0000 19 1.9000 1.0000 20 2.0000 1.0000 21 2.1000 1.0734 22 2.2000 1.2865 23 2.3000 1.6183 24 2.4000 2.0365 25 2.5000 2.5000 26 2.6000 2.9635 27 2.7000 3.3817 28 2.8000 3.7135 29 2.9000 3.9266 30 3.0000 4.0000 31 3.1000 3.9266 32 3.2000 3.7135 33 3.3000 3.3817 34 3.4000 2.9635 35 3.5000 2.5000 36 3.6000 2.0365 37 3.7000 1.6183 38 3.8000 1.2865 39 3.9000 1.0734 40 4.0000 1.0000 41 4.1000 1.0000 42 4.2000 1.0000 43 4.3000 1.0000 44 4.4000 1.0000 45 4.5000 1.0000 46 4.6000 1.0000 47 4.7000 1.0000 48 4.8000 1.0000 49 4.9000 1.0000 50 5.0000 1.0000 51 5.1000 1.0000 52 5.2000 1.0000 53 5.3000 1.0000 54 5.4000 1.0000 55 5.5000 1.0000 56 5.6000 1.0000 57 5.7000 1.0000 58 5.8000 1.0000 59 5.9000 1.0000 60 6.0000 1.0000 61 6.1000 1.0000 62 6.2000 1.0000 63 6.3000 1.0000 64 6.4000 1.0000 65 6.5000 1.0000 66 6.6000 1.0000 67 6.7000 1.0000 68 6.8000 1.0000 69 6.9000 1.0000 70 7.0000 1.0000 71 7.1000 1.0000 72 7.2000 1.0000 73 7.3000 1.0000 74 7.4000 1.0000 75 7.5000 1.0000 76 7.6000 1.0000 77 7.7000 1.0000 78 7.8000 1.0000 79 7.9000 1.0000 80 8.0000 1.0000 81 8.1000 1.0000 82 8.2000 1.0000 83 8.3000 1.0000 84 8.4000 1.0000 85 8.5000 1.0000 86 8.6000 1.0000 87 8.7000 1.0000 88 8.8000 1.0000 89 8.9000 1.0000 90 9.0000 1.0000 91 9.1000 1.0000 92 9.2000 1.0000 93 9.3000 1.0000 94 9.4000 1.0000 95 9.5000 1.0000 96 9.6000 1.0000 97 9.7000 1.0000 98 9.8000 1.0000 99 9.9000 1.0000 100 10.0000 1.0000 SUBPAK_PRB Normal end of execution. 21 November 2015 10:07:27.811 PM