[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: use of functions in newly developed TYPE



Dirk,
  I think that all you need to do is add the line:

integer::kronecker

to the declarations section of your calculate_F subroutine. That will tell the subroutine that the result of the kronecker function is to be an integer.

Kind regards,
  David



At 01:57 PM 9/30/2003 +0200, you wrote:
Dear all,

Creating a new TYPE, I encountered a strange problem regarding the use of all functions I defined, the subroutines perform well.

I define a function kronecker and use it in a subroutine calculate_F(see below), the compiler gives an error message (see below) which suggests that the function is not found.This error message occurs each time I try to use one the functions. When I implement the same function kronecker in another TYPE (f.i. 60) and use it in a subroutine there, it works fine. When using these routines in a program to test them, there were no problems encountered.
Does someone have an idea what could cause this problem?

Thanks
Dirk
      function kronecker(x,y)
          implicit none
          integer::x,y,kronecker
          kron: if (x.eq.y) then
              kronecker=1
          else
              kronecker=0
          end if kron
      end function kronecker

     subroutine calculate_F(N,VF,F,rho,eps)
          implicit none
          integer::N,i,j
          real(kind=8),intent(out)::F(:,:),rho(:),eps(:)
          real(kind=8),intent(in)::VF(:,:)
          eps=0.84d0
          rho=1.0d0-eps 
          F=0.0d0
          do i=1,2*N+2
              do j=1,2*N+2
                  F(I,J)=(kronecker(i,j)-rho(i)*VF(i,j))/eps(i)
              end do
          end do
      end subroutine calculate_F

Error message:

C:\Trnsys15\Types\type901.f90(422) : Error: This name does not have a type, and must have an explicit type.   [KRONECKER]
    F(I,J)=(kronecker(i,j)-rho(i)*VF(i,j))/eps(i)

--
Dr.ir. D. Saelens, postdoc fellow IWT Flanders
Laboratory for Building Physics, K.U.Leuven
Kasteelpark Arenberg 51, 3001 Leuven, Belgium


T: +32 16 321345
F: +32 16 321980

www.kuleuven.ac.be/bwf

****************************************************************************************
Thermal Energy System Specialists (TESS)
David BRADLEY                           2916 Marketplace Drive - Suite 104
Project Engineer                           Madison, WI 53719
Phone: (608) 274-2577 USA
Fax: (608) 278-1475
E-mail: bradley@tess-inc.com
Web Pages:  http://www.tess-inc.com    and      http://www.trnsys.com

"Providing software solutions for today's energy engineering projects"
****************************************************************************************