CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > General Forums > Main CFD Forum

Compile error in KIVA 3v with gfortran

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 20, 2009, 07:37
Default Compile error in KIVA 3v with gfortran
  #1
New Member
 
Robert C
Join Date: Jun 2009
Location: London, UK
Posts: 16
Rep Power: 17
ottbot is on a distinguished road
I'm trying to build kiva 3v on OS X using gfortran. I had the same code compiling with intel fortran compiler, using XCode so I didn't see compiler options ifort was using.

Anyway, with gfortran I get the follow error I can't seem to find much information on:
Code:
begin.F:51.18:

      call second(tstart)                                               
                 1
Error: 'time' argument of 'second' intrinsic at (1) must be of kind 4
This is repeated several times (for each call of second it seems like). Here's the full output from the compiler.

http://gist.github.com/189768

The second looks like this:
Code:
      subroutine second (tnow)
      real*4 d(2)
      rtnow=etime(d)
      tnow=d(1)+d(2)
      return
      end
Does this indicate a problem the variable in the subroutine, or the variable being passed to it externally? Is there an option I can use to relax this "must be kind 4" requirement?

I'm at a loss of how to proceed, any advice is appreciated!

Last edited by ottbot; October 1, 2009 at 07:31. Reason: fix subroutine second to actual kiva second.F
ottbot is offline   Reply With Quote

Old   October 1, 2009, 08:10
Default
  #2
New Member
 
Robert C
Join Date: Jun 2009
Location: London, UK
Posts: 16
Rep Power: 17
ottbot is on a distinguished road
I'm hoping someone could take another look at this - the following program will show what's happening.


Code:
      program sec 
          implicit double precision (a-h,o-z)          
        
          call second(tbegin)
      end program sec

      subroutine second (tnow)
          real*4 d(2)
          rtnow=etime(d)
          tnow=d(1)+d(2)
          return
      end
Compiling does this:
Code:
rob@cosmo test $ gfortran second.F 
second.F:4.22:

          call second(tbegin)                                           
                     1
Error: 'time' argument of 'second' intrinsic at (1) must be of kind 4
If I add "real tbegin" or "real*4 tbegin" in the main program, it works as expected..

However I'm looking for a way to modify just the subroutine to get it working - as second() is used all over the place in kiva. Any thoughts?

Thanks again!
ottbot is offline   Reply With Quote

Old   October 1, 2009, 23:08
Default Subroutine Second
  #3
New Member
 
Tonse
Join Date: Oct 2009
Posts: 1
Rep Power: 0
tonse2003 is on a distinguished road
I guess you have solved your problem by now, but here goes anyway:
The gfortran compiler thinks that Second() is an Intrinsic function, (and it probably is for gfortran.)
Solution: Rename the subroutine in second.f to be something else, say, Ksecond.
Also rename the Calls to Second to be Call Ksecond.
That fixes it.
tonse2003 is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
ATTN ALL: SOLUTON TO UDF COMPILE PROBLEM Rizwan Fluent UDF and Scheme Programming 40 March 18, 2018 07:05
Error compile file udf czfluent Fluent UDF and Scheme Programming 24 September 26, 2009 14:24
Can someone PLEASE document the development version installation bernd OpenFOAM Installation 76 November 14, 2008 22:51
Compile KIVA in MAC platform FooChern Main CFD Forum 0 August 9, 2005 16:56
PDF - conserved scalar approach in KIVA vega Main CFD Forum 0 July 5, 2005 03:49


All times are GMT -4. The time now is 17:57.