00001 c artrsmrartrswt_.F
00002 c*********************************************************************
00003 c* (c) Copyright 2000-2002 Brown Deer Technology, LLC.
00004 c* All rights reserved.
00005 c*********************************************************************
00006
00007 subroutine artrsmrartrswt(
00008 & Asize,Msize
00009 & ,amax,mmax
00010 & ,mrastep,mracoef
00011 & ,mracoefrs
00012 & ,datavalue
00013 & )
00014
00015 implicit none
00016
00017 c ****************************************
00018 c ***** COMMON BLOCKS AND PARAMETERS *****
00019 c ****************************************
00020
00021 #include "stormdef.h"
00022 real INVSQRT2
00023 parameter( INVSQRT2 = STORMDEF_MATHCONST_INVSQRT2 )
00024
00025 c *******************************
00026 c ***** VARIABLES EXCHANGED *****
00027 c *******************************
00028
00029 integer Asize
00030 integer Msize
00031 integer amax
00032 integer mmax
00033 integer mrastep
00034 real mracoef(0:1,0:Msize-1,0:Asize-1)
00035 real mracoefrs(0:1,0:Msize-1,0:Asize-1)
00036 real datavalue(0:Asize-1)
00037
00038 c ****************************
00039 c ***** LOCAL VARIABLES ******
00040 c ****************************
00041
00042 integer mcycle
00043 integer mcyclers
00044 integer a
00045 integer m
00046 real tmpold,tmps,tmpw,tmp
00047
00048 c ******************************
00049 c ***** EXTERNAL FUNCTIONS *****
00050 c ******************************
00051
00052 mrastep=mrastep+1
00053
00054 mcycle=0
00055 do while (btest(mrastep,mcycle).and.(mcycle.lt.mmax))
00056 mcycle=mcycle+1
00057 enddo
00058
00059 mcyclers=mcycle+1
00060 if ((mrastep.lt.ishft(1,mcyclers)).or.(mcyclers.gt.mmax)) then
00061 mcyclers=0
00062 endif
00063
00064 do a=0,amax
00065
00066 tmp=datavalue(a)
00067
00068 m=1
00069 do while (m.le.mcycle)
00070 tmpold=mracoef(0,m-1,a)
00071 tmps=(tmpold+tmp)*INVSQRT2
00072 tmpw=(tmpold-tmp)*INVSQRT2
00073 mracoef(0,m-1,a)=tmp
00074 mracoef(1,m,a)=tmpw
00075 tmp=tmps
00076 m=m+1
00077 enddo
00078
00079 if (m.eq.mcyclers) then
00080 tmpold=mracoef(0,m-1,a)
00081 tmps=(tmpold+tmp)*INVSQRT2
00082 tmpw=(tmpold-tmp)*INVSQRT2
00083 mracoefrs(0,m,a)=tmps
00084 mracoefrs(1,m,a)=tmpw
00085 endif
00086
00087 mracoef(0,m-1,a)=tmp
00088
00089 enddo
00090
00091 return
00092 end
00093 c********************************************************