AeroTrippy
Technical User
hey guys,
I have been racking my brain about this, so hopefully you can help me out a bit. This is my function for Simpson's 3/8 rule.
REAL FUNCTION Simpson38(v,h,n)
IMPLICIT NONE
REAL :: s1, s2, s3
REAL, INTENT(in) :: v,h
INTEGER, INTENT(in) :: n
INTEGER :: i,j,k
[highlight #FCE94F]REAL, DIMENSION :: (0:n)[/highlight]
s1=0
s2=0
s3=0
DO i=1,(n-2),3
s1=s1+v(i)
END DO
DO j=2,(n-1),3
s2=s2+v(j)
END DO
DO k=3,(n-3),3
s3=s3+v(k)
END DO
Simpson38= (3*h/8)*(v(0)+3*(s1)+3*(s2)+2*(s3)+v)
END FUNCTION
The highlighted part is what I am confused about. My TA told me to insert this line but it keeps giving me error#5082: Syntax error, found '(' when expecting one of: %FILL <IDENTIFIER>
The purpose of the program is to be able to read any data file and depending on the number of points it will either use this function or Simpson's 1/3. Any idea what goes in that line? Any help is greatly appreciated! If you need any more info, let me know!
Thanks!
I have been racking my brain about this, so hopefully you can help me out a bit. This is my function for Simpson's 3/8 rule.
REAL FUNCTION Simpson38(v,h,n)
IMPLICIT NONE
REAL :: s1, s2, s3
REAL, INTENT(in) :: v,h
INTEGER, INTENT(in) :: n
INTEGER :: i,j,k
[highlight #FCE94F]REAL, DIMENSION :: (0:n)[/highlight]
s1=0
s2=0
s3=0
DO i=1,(n-2),3
s1=s1+v(i)
END DO
DO j=2,(n-1),3
s2=s2+v(j)
END DO
DO k=3,(n-3),3
s3=s3+v(k)
END DO
Simpson38= (3*h/8)*(v(0)+3*(s1)+3*(s2)+2*(s3)+v)
END FUNCTION
The highlighted part is what I am confused about. My TA told me to insert this line but it keeps giving me error#5082: Syntax error, found '(' when expecting one of: %FILL <IDENTIFIER>
The purpose of the program is to be able to read any data file and depending on the number of points it will either use this function or Simpson's 1/3. Any idea what goes in that line? Any help is greatly appreciated! If you need any more info, let me know!
Thanks!