Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Compiling DVODE_F90 fails on gfortran, works on g95

Status
Not open for further replies.

NickFort

Technical User
Jun 10, 2010
113
Hi guys,

I'm trying to get DVODE_F90 working. It can be found here:


In that zip file are the module "dvode_f90_m.f90" (it's buried in the folder, you'll see) and an example for testing it called -- wait for it -- "example1.f90".

I put both files in the same folder, and then tried to compile, but it came up with an error:

Code:
$ gfortran dvode_f90_m.f90 example1.f90 -o test
example1.f90:88.71:

        CALL DVODE_F90(FEX,NEQ,Y,T,TOUT,ITASK,ISTATE,OPTIONS,J_FCN=JEX)
                                                                       1
Error: There is no specific subroutine for the generic 'dvode_f90' at (1)

g95 seems to compile it just fine.

Any idea how I can get this working in gfortran?

I know what you might be inclined to say: why don't I just stick with g95? The answer: because I've found gfortran to be dramatically faster than g95, at least for my work.

Also, I have used DVODE_F90 in the past (when I did a bit of F90 programming last year), and I remember being able to use it with gfortran and g95. I might have had an older version of gfortran or something, but it definitely worked!

Any ideas, or should I take this up with the gfortran developers as a bug?

Thanks,
NickFort

--------------------------------------
Background: Chemical engineer, familiar mostly with MATLAB, but now branching out into real programming.
 
I was using gfortran 4.6 (experimental) for the above. I tried 4.5.0 now, and I still get the same error.

Interestingly, I found the code I used last year, and it compiles without a problem. So, for some reason, the examples don't work, but my old code does. Unfortunately, it's far too long and complicated to post here.

--------------------------------------
Background: Chemical engineer, familiar mostly with MATLAB, but now branching out into real programming.
 
I am using gfortran 4.3. I got no error message, only several warnings.
 
Yep, works in gfortran 4.4.4, with a lot of warnings akin to:

Code:
dvode_f90_m.f90:18683.39:

                IF (J >= NIFAC) GOTO 50
                                       1
dvode_f90_m.f90:18693.18:

50          END DO
                  2
Warning: Deleted feature: GOTO at (1) jumps to END of construct at (2)

Is there a way to turn off (just) those warnings?

--------------------------------------
Background: Chemical engineer, familiar mostly with MATLAB, but now branching out into real programming.
 
Try something like
gfortran -std=legacy dvode_f90_m.f90 example1.f90 -o test
 
Ah, indeed! A very good idea. :) I'll stick with gfortran 4.4.4 for now, but I'll post something about this in the gcc newsgroup and see what they come up with. Thanks!

--------------------------------------
Background: Chemical engineer, familiar mostly with MATLAB, but now branching out into real programming.
 
Alternatively try
Code:
50 continue
   end do
 
Hey xwb,

That's a good idea, but there are dozens, if not hundreds, of warnings that pop up, and hunting all of those down is just not worth it when I can suppress them with a single command-line option.

But, that's very good to know, in case the command-line option ends up having some sort of unintended side-effect with the rest of the code.

Thanks,
NF

--------------------------------------
Background: Chemical engineer, familiar mostly with MATLAB, but now branching out into real programming.
 
Problem solved! (The first one where it wouldn't compile with the newer gfortran versions)

I contacted the gfortran developers, and as it turns out -- it doesn't compile with NAG either. The reason for this is that in the example1.f90 file, where the function FEX (argument to DVODE_F90) is defined, the intents of the arguments are not declated, unlike in the dummy procedure in dvode_f90_m.f90 where they are declared. This mismatch causes the error; the only problem is that the error isn't well-explained by gfortran -- NAG's message is a lot more useful.

A bug has been filed since last year, not for the error (because the error should occur), but for the fairly useless message that gfortran gives:
--------------------------------------
Background: Chemical engineer, familiar mostly with MATLAB, but now branching out into real programming.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top