00001 00002 c 00003 c Copyright (c) 1986,1987,1988,1989,1990,1991,1992,1993, 00004 c by Steve McMillan, Drexel University, Philadelphia, PA. 00005 c 00006 c All rights reserved. 00007 c 00008 c Redistribution and use in source and binary forms are permitted 00009 c provided that the above copyright notice and this paragraph are 00010 c duplicated in all such forms and that any documentation, 00011 c advertising materials, and other materials related to such 00012 c distribution and use acknowledge that the software was developed 00013 c by the author named above. 00014 c 00015 c THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR 00016 c IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED 00017 c WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. 00018 c 00019 c 00020 c A program plots a 3-dim picture 00021 c It calls the plt3d subroutine 00022 c a - the 2D data array, x direction increases faster. 00023 c m,n - dims of x and y directions 00024 c x and ywork - real working vector of length lwork > 00025 c 2*min(m,n) 00026 c alt, azim - viewing altitute and azimuthal angles in 00027 c degrees 00028 c xlen,ylen - length of unprojected axis in device units 00029 c xoff,yoff - offset of plot origin in device units 00030 c zoff - data value corresponding to height of zero unit. 00031 c zfac - scale of z axis from data unit to unprojected 00032 c vertical device unit 00033 c ier - returns 0 for successful plot 00034 c 00035 integer*4 m,n,lwork,ier 00036 c 00037 real*4 a(500000),b(50000),xwork(1000),ywork(1000) 00038 c 00039 read(1,*)m,n,etam,(a(k),k=1,(m+1)*(n+1)),(b(k),k=1,(m+1)*(n+1)) 00040 m = m + 1 00041 n = n + 1 00042 c 00043 amax=0. 00044 amin=1.e6 00045 bmax=0. 00046 bmin=1.e6 00047 c 00048 do 20 k=1,m*n 00049 aa = max(-2., min(2., a(k))) 00050 amax = max(amax, aa) 00051 amin = min(amin, aa) 00052 a(k) = aa 00053 c 00054 bb = max(-2., min(2., b(k))) 00055 bmax = max(bmax, bb) 00056 bmin = min(bmin, bb) 00057 b(k) = bb 00058 10 continue 00059 20 continue 00060 c 00061 c Rescale the data... 00062 c 00063 abar = .5*(amin+amax) 00064 afac = 1./(amax-amin) 00065 bbar = .5*(bmin+bmax) 00066 bfac = 1./(bmax-bmin) 00067 c 00068 do 110 k=1,m*n 00069 a(k) = (a(k)-abar)*afac 00070 b(k) = (b(k)-bbar)*bfac 00071 110 continue 00072 c 00073 call mcinit 00074 c 00075 lwork=2*m 00076 xlen=6. 00077 ylen=6. 00078 xoff=5. 00079 yoff=5. 00080 c 00081 zoff = 0. 00082 zfac = 6. 00083 c 00084 200 write(*,201) 00085 201 format('Choice (1 or 2), Altitute, azimuthal viewing angles: '$) 00086 read(*,*,iostat=io)i,alt,azim 00087 c 00088 if (io.eq.0) then 00089 call clear 00090 if (i.eq.1) then 00091 call plt3d(a,m,n,xwork,ywork,lwork,alt,azim, 00092 & xlen,xoff,ylen,yoff,zfac,zoff,ier) 00093 else 00094 call plt3d(b,m,n,xwork,ywork,lwork,alt,azim, 00095 & xlen,xoff,ylen,yoff,zfac,zoff,ier) 00096 end if 00097 go to 200 00098 end if 00099 c 00100 99999 call mcquit 00101 end