00001 REAL FUNCTION snorm()
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031 REAL aa,s,tt,u,ustar,w,y
00032 INTEGER i
00033
00034
00035 REAL a(32),d(31),h(31),t(31)
00036
00037
00038 REAL ranf
00039 EXTERNAL ranf
00040
00041
00042 INTRINSIC float,int
00043
00044
00045
00046 SAVE a,d,t,h
00047
00048
00049 DATA a/0.0,.3917609E-1,.7841241E-1,.1177699,.1573107,.1970991,
00050 + .2372021,.2776904,.3186394,.3601299,.4022501,.4450965,
00051 + .4887764,.5334097,.5791322,.6260990,.6744898,.7245144,
00052 + .7764218,.8305109,.8871466,.9467818,1.009990,1.077516,
00053 + 1.150349,1.229859,1.318011,1.417797,1.534121,1.675940,
00054 + 1.862732,2.153875/
00055 DATA d/5*0.0,.2636843,.2425085,.2255674,.2116342,.1999243,
00056 + .1899108,.1812252,.1736014,.1668419,.1607967,.1553497,
00057 + .1504094,.1459026,.1417700,.1379632,.1344418,.1311722,
00058 + .1281260,.1252791,.1226109,.1201036,.1177417,.1155119,
00059 + .1134023,.1114027,.1095039/
00060 DATA t/.7673828E-3,.2306870E-2,.3860618E-2,.5438454E-2,
00061 + .7050699E-2,.8708396E-2,.1042357E-1,.1220953E-1,.1408125E-1,
00062 + .1605579E-1,.1815290E-1,.2039573E-1,.2281177E-1,.2543407E-1,
00063 + .2830296E-1,.3146822E-1,.3499233E-1,.3895483E-1,.4345878E-1,
00064 + .4864035E-1,.5468334E-1,.6184222E-1,.7047983E-1,.8113195E-1,
00065 + .9462444E-1,.1123001,.1364980,.1716886,.2276241,.3304980,
00066 + .5847031/
00067 DATA h/.3920617E-1,.3932705E-1,.3950999E-1,.3975703E-1,
00068 + .4007093E-1,.4045533E-1,.4091481E-1,.4145507E-1,.4208311E-1,
00069 + .4280748E-1,.4363863E-1,.4458932E-1,.4567523E-1,.4691571E-1,
00070 + .4833487E-1,.4996298E-1,.5183859E-1,.5401138E-1,.5654656E-1,
00071 + .5953130E-1,.6308489E-1,.6737503E-1,.7264544E-1,.7926471E-1,
00072 + .8781922E-1,.9930398E-1,.1155599,.1404344,.1836142,.2790016,
00073 + .7010474/
00074
00075
00076
00077 10 u = ranf()
00078 s = 0.0
00079 IF (u.GT.0.5) s = 1.0
00080 u = u + u - s
00081 20 u = 32.0*u
00082 i = int(u)
00083 IF (i.EQ.32) i = 31
00084 IF (i.EQ.0) GO TO 100
00085
00086
00087
00088 30 ustar = u - float(i)
00089 aa = a(i)
00090 40 IF (ustar.LE.t(i)) GO TO 60
00091 w = (ustar-t(i))*h(i)
00092
00093
00094
00095 50 y = aa + w
00096 snorm = y
00097 IF (s.EQ.1.0) snorm = -y
00098 RETURN
00099
00100
00101
00102 60 u = ranf()
00103 w = u* (a(i+1)-aa)
00104 tt = (0.5*w+aa)*w
00105 GO TO 80
00106
00107 70 tt = u
00108 ustar = ranf()
00109 80 IF (ustar.GT.tt) GO TO 50
00110 90 u = ranf()
00111 IF (ustar.GE.u) GO TO 70
00112 ustar = ranf()
00113 GO TO 40
00114
00115
00116
00117 100 i = 6
00118 aa = a(32)
00119 GO TO 120
00120
00121 110 aa = aa + d(i)
00122 i = i + 1
00123 120 u = u + u
00124 IF (u.LT.1.0) GO TO 110
00125 130 u = u - 1.0
00126 140 w = u*d(i)
00127 tt = (0.5*w+aa)*w
00128 GO TO 160
00129
00130 150 tt = u
00131 160 ustar = ranf()
00132 IF (ustar.GT.tt) GO TO 50
00133 170 u = ranf()
00134 IF (ustar.GE.u) GO TO 150
00135 u = ranf()
00136 GO TO 140
00137
00138 END