Skip to content
Prev 7074 / 15075 Next

gfortran bug?

On 25-04-2010, at 22:22, Andreas Noack Jensen wrote:

            
As far as I can tell, your fortran code is in fixed format which is not immediately obvious.
I have put the code in free format and  have reformatted the code with more indentation (1 space of indent is really not enough).
See below after my signature.
It  now compiles with no errors.

I don't see anything immediately wrong.
It would be nice to have a small test program in fortran to check the code.

Berend

     subroutine rmfilter(x, nl, coef, ndim, init)

     implicit none
     integer, intent(in) :: nl(2), ndim(3)
     double precision, intent(inout) :: x(nl(1),nl(2))
     double precision, intent(in) :: coef(ndim(1),ndim(2),ndim(3)),   init(ndim(3),ndim(nl(2)))
     double precision :: y(nl(1),nl(2))
     integer :: i, j

     y = 0.0d+0   
         
     do i = 1, nl(1), 1
         do j = 1, ndim(3), 1
             if ( i <= j ) then
                 call dgemm('N', 'T', 1, ndim(1), nl(2), 1.0d+0,    &
                        init(ndim(3)-j+1,:), 1, coef(:,:,j), ndim(1), 1.0d+0, y(i,:), 1)
             else
                 call dgemm('N', 'T', 1, ndim(1), nl(2), 1.0d+0,    &
                        y(i-j,:), 1, coef(:,:,j), ndim(1), 1.0d+0, y(i,:), 1)
             end if
         end do
         y(i,:) = y(i,:) + x(i,:)
     end do
     x = y
     return
     end subroutine rmfilter

BTW. in       do i = 1, nl(1), 1  and    do j = 1, ndim(3), 1
the steps 1 are not necessary: 1 is the default