00001 c hfwt_.F
00002 c*********************************************************************
00003 c* (c) Copyright 1994-2002 Brown Deer Technology, LLC.
00004 c* All rights reserved.
00005 c*********************************************************************
00006
00007 subroutine hfwt(Sizef,ns,size,sdata,wdata,iflag)
00008
00009 implicit none
00010
00011 c ****************************************
00012 c ***** COMMON BLOCKS AND PARAMETERS *****
00013 c ****************************************
00014
00015 #include "stormdef.h"
00016 real INVSQRT2
00017 parameter( INVSQRT2 = STORMDEF_MATHCONST_INVSQRT2 )
00018
00019 c *******************************
00020 c ***** VARIABLES EXCHANGED *****
00021 c *******************************
00022
00023 integer Sizef
00024 integer ns
00025 integer size
00026 real sdata(Sizef)
00027 real wdata(Sizef)
00028 integer iflag
00029
00030 c ***************************
00031 c ***** LOCAL VARIABLES *****
00032 c ***************************
00033
00034 integer i,j,size1,size2
00035 real xx(Sizef)
00036
00037 c ******************************
00038 c ***** EXTERNAL FUNCTIONS *****
00039 c ******************************
00040
00041 #ifdef STORM_FWT_FCHECKUSAGE
00042 if (size.lt.ns) then
00043 iflag=1
00044 return
00045 endif
00046 #endif
00047
00048 do i=1,size
00049 wdata(i)=sdata(i)
00050 enddo
00051
00052 if (size.eq.ns) then
00053 iflag=0
00054 return
00055 endif
00056
00057 size1=size
00058 10 continue
00059 size2=size1/2
00060 do i = 1, size2
00061 j = 2*i - 1
00062 xx(i) = ( wdata(j) + wdata(j+1) ) * INVSQRT2
00063 xx(size2+i) = ( wdata(j) - wdata(j+1) ) * INVSQRT2
00064 enddo
00065 do i=1,size1
00066 wdata(i)=xx(i)
00067 enddo
00068 size1=size2
00069 if (size1.gt.ns) then
00070 goto 10
00071 endif
00072
00073 #ifdef STORM_FWT_FCHECKUSAGE
00074 if (size1.lt.ns) then
00075 iflag=2
00076 return
00077 endif
00078 #endif
00079
00080 iflag=0
00081
00082 return
00083 end
00084