Main Page   Class Hierarchy   Data Structures   File List   Data Fields   Globals  

test3d.f

Go to the documentation of this file.
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         program test3d
00020 c       
00021 c       A program to plot a 3-D picture, using the plt3d subroutine.
00022 c
00023 c       a - the 2D data arrary, x direction increases faster.
00024 c       m,n  -  dimensionss of x and y directions
00025 c       alt, azim - viewing altitute and azimuthal angles in
00026 c                       degrees
00027 c       xlen,ylen - length of unprojected axis in device units
00028 c       xoff,yoff - offset of plot origin in device units
00029 c       zoff - data value corresponding to height of zero unit.
00030 c       zfac - scale of z axis from data unit to unprojected
00031 c               vertical device unit
00032 c       ier - returns 0 for successful plot
00033 c
00034         integer*4 m,n,ier 
00035         parameter (m = 50, n = 75)
00036         real*4  a(m,n),alt,azim,xlen,xoff,ylen,yoff,zfac,zoff
00037 c
00038         amax=0.
00039         amin=1.e30
00040 c
00041         do 5 j=1,n
00042             y = float(j)/n
00043             do 1 i=1,m
00044                 x = float(i)/m
00045 c
00046                 a(i,j) = x*y*sin(12.56*y)
00047 c
00048                 amax = max(amax,a(i,j))
00049                 amin = min(amin,a(i,j))
00050 1           continue
00051 5       continue
00052 c
00053         call mcinit
00054 c
00055         xlen=6.
00056         ylen=6.
00057         xoff=5.
00058         yoff=5.
00059         zfac=7./(amax-amin)
00060         zoff=.5*(amin+amax)
00061 c
00062 2       write(*,'(''Altitute, azimuthal viewing angles: ''$)')
00063         read(*,*,err=99999,end=99999)alt,azim
00064         call clear
00065 c
00066         call plt3d(a,m,n,alt,azim,xlen,xoff,ylen,yoff,zfac,zoff,ier)
00067         if (ier.ne.0) write(6,*)'Return status = ',ier
00068 c
00069         call simbol(xplot3d(float(m+1),-1.,0.),
00070      &              yplot3d(float(m+1),-1.,0.),
00071      &             .225,'X',0.,1)
00072         call simbol(xplot3d(-1.,float(n+1),0.),
00073      &              yplot3d(-1.,float(n+1),0.),
00074      &             .225,'Y',0.,1)
00075 c
00076         go to 2
00077 c
00078 99999   call mcquit
00079         end

Generated at Sun Feb 24 09:57:19 2002 for STARLAB by doxygen1.2.6 written by Dimitri van Heesch, © 1997-2001