30 October 2007 2:54:37.551 PM XLF_INTRINSICS_PRB FORTRAN90 version Test the XLF intrinsic routines. TEST_ERF: ERF computes the error function. ERF_VALUES returns selected values. X FX FX2 (table) (ERF) 0.00000000 0.000000000000000 0.000000000000000 0.10000000 0.1124629160182849 0.1124629154801369 0.20000000 0.2227025892104785 0.2227025926113129 0.30000000 0.3286267594591274 0.3286267817020416 0.40000000 0.4283923550466685 0.4283923506736755 0.50000000 0.5204998778130465 0.5204998850822449 0.60000000 0.6038560908479259 0.6038560867309570 0.70000000 0.6778011938374185 0.6778011918067932 0.80000000 0.7421009647076605 0.7421009540557861 0.90000000 0.7969082124228321 0.7969081997871399 1.00000000 0.8427007929497149 0.8427007794380188 1.10000000 0.8802050695740817 0.8802050948143005 1.20000000 0.9103139782296354 0.9103139638900757 1.30000000 0.9340079449406524 0.9340079426765442 1.40000000 0.9522851197626488 0.9522851109504700 1.50000000 0.9661051464753106 0.9661051630973816 1.60000000 0.9763483833446440 0.9763484001159668 1.70000000 0.9837904585907746 0.9837904572486877 1.80000000 0.9890905016357306 0.9890905022621155 1.90000000 0.9927904292352575 0.9927904009819031 2.00000000 0.9953222650189527 0.9953222870826721 TEST_ERFC: ERFC computes the complementary error function. ERFC_VALUES returns selected values. X FX FX2 (table) (ERFC) 0.00000000 1.000000000000000 1.000000000000000 0.20000000 0.7772974107895215 0.7772974371910095 0.40000000 0.5716076449533315 0.5716076493263245 0.60000000 0.3961439091520741 0.3961438834667206 0.80000000 0.2578990352923395 0.2578990161418915 1.00000000 0.1572992070502851 0.1572992056608200 1.20000000 0.8968602177036462E-01 0.8968600630760193E-01 1.40000000 0.4771488023735119E-01 0.4771488532423973E-01 1.60000000 0.2365161665535599E-01 0.2365161478519440E-01 1.80000000 0.1090949836426929E-01 0.1090950053185225E-01 2.00000000 0.4677734981047266E-02 0.4677734803408384E-02 2.20000000 0.1862846297981891E-02 0.1862845849245787E-02 2.40000000 0.6885138966450786E-03 0.6885135662741959E-03 2.60000000 0.2360344165293492E-03 0.2360345388296992E-03 2.80000000 0.7501319466545903E-04 0.7501321670133621E-04 3.00000000 0.2209049699858544E-04 0.2209049671364482E-04 3.20000000 0.6025761151762095E-05 0.6025759375916095E-05 3.40000000 0.1521993362862285E-05 0.1521992317066179E-05 3.60000000 0.3558629930076853E-06 0.3558632499789383E-06 3.80000000 0.7700392745696413E-07 0.7700395343590571E-07 4.00000000 0.1541725790028002E-07 0.1541725858089649E-07 TEST_ETIME_ ETIME_ returns the user and system execution time. TARRAY(1) (User time) = 0.00000 TARRAY(2) (System time) = 0.00000 RESULT (0 = success) = ******** TEST_FDATEa_ FDATE_ returns the current date as a string. It can be called as a function or subroutine. CALL FDATE_ ( STRING ) returns: "Tue Oct 30 14:54:37 2007 ". TEST_GAMMA: GAMMA computes the gamma function. GAMMA_VALUES returns selected values. X FX FX2 (table) (GAMMA) -0.50000000 -3.544907701811032 -3.544907808303833 -0.01000000 -100.5871979644108 -100.5872039794922 0.01000000 99.43258511915060 99.43258666992188 0.10000000 9.513507698668732 9.513507843017578 0.20000000 4.590843711998803 4.590843677520752 0.40000000 2.218159543757688 2.218159437179565 0.50000000 1.772453850905516 1.772453904151917 0.60000000 1.489192248812817 1.489192247390747 0.80000000 1.164229713725303 1.164229750633240 1.00000000 1.000000000000000 1.000000000000000 1.10000000 0.9513507698668732 0.9513507485389709 1.20000000 0.9181687423997607 0.9181687235832214 1.30000000 0.8974706963062772 0.8974707126617432 1.40000000 0.8872638175030753 0.8872638344764709 1.50000000 0.8862269254527581 0.8862269520759583 1.60000000 0.8935153492876903 0.8935153484344482 1.70000000 0.9086387328532904 0.9086387157440186 1.80000000 0.9313837709802427 0.9313837289810181 1.90000000 0.9617658319073874 0.9617658257484436 2.00000000 1.000000000000000 1.000000000000000 3.00000000 2.000000000000000 2.000000000000000 4.00000000 6.000000000000000 6.000000000000000 10.00000000 362880.0000000000 362880.0000000000 20.00000000 0.1216451004088320E+18 0.1216451045941576E+18 30.00000000 0.8841761993739702E+31 0.8841761870393380E+31 TEST_HOSTNM HOSTNM_ returns the host name as a string. RESULT = HOSTNM_ ( STRING ) returns: STRING = "h80ad9360.dhcp.vt.edu". RESULT (0 = success) = 0 TEST_LGAMMA: LGAMMA computes the log of the gamma function. GAMMA_LOG_VALUES returns selected values. X FX FX2 (table) (LGAMMA) 0.20000000 1.524063822430784 1.524063825607300 0.40000000 0.7966778177017837 0.7966778278350830 0.60000000 0.3982338580692348 0.3982338309288025 0.80000000 0.1520596783998375 0.1520596742630005 1.00000000 0.000000000000000 0.000000000000000 1.10000000 -0.4987244125983972E-01 -0.4987245053052902E-01 1.20000000 -0.8537409000331583E-01 -0.8537410199642181E-01 1.30000000 -0.1081748095078604 -0.1081748008728027 1.40000000 -0.1196129141723712 -0.1196129098534584 1.50000000 -0.1207822376352452 -0.1207822412252426 1.60000000 -0.1125917656967557 -0.1125917658209801 1.70000000 -0.9580769740706586E-01 -0.9580768644809723E-01 1.80000000 -0.7108387291437215E-01 -0.7108388841152191E-01 1.90000000 -0.3898427592308333E-01 -0.3898428380489349E-01 2.00000000 0.000000000000000 0.000000000000000 3.00000000 0.6931471805599453 0.6931471824645996 4.00000000 1.791759469228055 1.791759490966797 10.00000000 12.80182748008147 12.80182743072510 20.00000000 39.33988418719949 39.33988571166992 30.00000000 71.25703896716801 71.25704193115234 TEST_RAND R = RAND() returns a real pseudorandom value. 1 0.225159 2 0.828552 3 0.645630 4 0.249695 5 0.221558 6 0.151794 7 0.573792 8 0.414490 9 0.903320E-01 10 0.757172 To control the sequence, first call SRAND with a REAL number as the seed. SEED = 1.23456789 call SRAND ( SEED ) do i = 1, 10 r = RAND ( ) end do 1 0.520966 2 0.411865 3 0.161591 4 0.138550 5 0.550568 6 0.575562 7 0.943512 8 0.397034E-01 9 0.700165 10 0.565460 Changing the seed changes the sequence: SEED = 9.87654321 call SRAND ( SEED ) do i = 1, 10 r = RAND ( ) end do 1 0.173309 2 0.392334 3 0.407684 4 0.837769 5 0.140411 6 0.743530 7 0.627106 8 0.426422 9 0.227509 10 0.920929 Restoring the old seed restores the old sequence: SEED = 1.23456789 call SRAND ( SEED ) do i = 1, 10 r = RAND ( ) end do 1 0.520966 2 0.411865 3 0.161591 4 0.138550 5 0.550568 6 0.575562 7 0.943512 8 0.397034E-01 9 0.700165 10 0.565460 TEST_SIZEOF SIZEOF returns the size, in bytes, of various objects. Type Byte Size character 1 complex 8 double complex 16 double precision 8 integer 4 logical 4 real 4 character ( len = 15 ) 15 TEST_SLEEP_ CALL SLEEP_ ( T ) causes the program to "sleep" for T seconds. Current TIME in seconds is = 1193770477 Now CALL SLEEP_ ( 10 ) Current TIME in seconds is = 1193770479 TEST_SYSTEM RESULT = SYSTEM ( STRING ) issues the command STRING to the operating system, waits for the command to complete and sets RESULT to the return value of the command. We issue the command CALL SYSTEM ( 'date', RESULT ) Tue Oct 30 14:54:39 EDT 2007 RESULT ( 0 = success ) = 0 TEST_TIME_ T = TIME_ ( ) returns the current GMT time, in seconds. The code fragment: T1 = TIME_ ( ) stuff happens T2 = TIME_ ( ) allows us to estimate T2-T1 seconds required for "stuff happens". Value of TIME_ ( ) = T1 = ************ seconds. Value of TIME_ ( ) = T2 = ************ seconds. Elapsed time T2 - T1 = 0.0000 seconds. TEST_TIMEF VALUE = TIMEF ( ) returns the elapsed time in milliseconds, since the previous call to TIMEF. Value returned by TIMEF = 0.00000 XLF_INTRINSICS_PRB Normal end of execution. 30 October 2007 2:54:41.569 PM