Prev: Libraries on Linux
Next: Write to file from DLL
From: FX on 20 Apr 2007 12:39 > I downloaded DQAGI.f and saved it in the same folder as my 3omega.f > program. Where will my program look for the DQAGI program? You have to tell the compiler yourself. Example to compile in one step: gfortran DQAGI.f my_own_code.f -o my_program.exe You can also compile in two steps (makes for easier recompiling, especially with a large number of source files): gfortran DQAGI.f -c (this will create an object file called DQAGI.o) gfortran my_own_code.f DQAGI.o -o my_program.exe > I also noticed my program has this statement: > call dqagi(fr,bound,inf,epsabs,epsrel,result, > * abserr,neval,ier,limit,lenw,last,iwork,work) > > Whereas, in the DQAGI program it reads: > SUBROUTINE DQAGI(F,BOUND,INF,EPSABS,EPSREL,RESULT,ABSERR,NEVAL, > 1 IER,LIMIT,LENW,LAST,IWORK,WORK) > > It has an "f" instead of an "fr". Could this be the problem? No, argument names for subroutines are local to the declaration. You can call the subroutine with different variables used as argument, using different names, it doesn't matter. The only thing you need to check is that they have the same type (integer, real, complex, etc.) and kind (real*4, real*8, complex*8, ...). -- FX
From: Steven G. Kargl on 20 Apr 2007 12:42 In article <1177086196.362928.139790(a)o5g2000hsb.googlegroups.com>, ben_nielsen20(a)yahoo.com writes: > I downloaded DQAGI.f and saved it in the same folder as my 3omega.f > program. Where will my program look for the DQAGI program? > > I also noticed my program has this statement: > call dqagi(fr,bound,inf,epsabs,epsrel,result, > * abserr,neval,ier,limit,lenw,last,iwork,work) > > Whereas, in the DQAGI program it reads: > SUBROUTINE DQAGI(F,BOUND,INF,EPSABS,EPSREL,RESULT,ABSERR,NEVAL, > 1 IER,LIMIT,LENW,LAST,IWORK,WORK) > > It has an "f" instead of an "fr". Could this be the problem? > No. I suggest that you take the time to read one or more Fortran tutorials available on the web. It will save you a lot of time. In particular, it looks like you're dealing with old Fortran 77 code. I'd suggest a stop at Clive Page's webpage and download his slim volume. http://www.star.le.ac.uk/~cgp/fortran.html -- Steve http://troutmask.apl.washington.edu/~kargl/
From: ben_nielsen20 on 20 Apr 2007 12:59 On Apr 20, 9:39 am, "FX" <coud...(a)alussinan.org> wrote: > > I downloaded DQAGI.f and saved it in the same folder as my 3omega.f > > program. Where will my program look for the DQAGI program? > > You have to tell the compiler yourself. Example to compile in one step: > gfortran DQAGI.f my_own_code.f -o my_program.exe > > You can also compile in two steps (makes for easier recompiling, > especially with a large number of source files): > gfortran DQAGI.f -c (this will create an object file called DQAGI.o) > gfortran my_own_code.f DQAGI.o -o my_program.exe > Does the name I put in for "my_program" not matter? I saved the above code as "3omega.f". So would it look something like this? gfortran DQAGI.f 3omega.f -o 3omega.exe Do I also have to specify the "input.par" file in the command line?
From: Brooks Moses on 20 Apr 2007 13:04 ben_nielsen20(a)yahoo.com wrote: > Does the name I put in for "my_program" not matter? I saved the above > code as "3omega.f". > So would it look something like this? > gfortran DQAGI.f 3omega.f -o 3omega.exe Yes, that should work. Note that the name you give the .exe file is arbitrary. It's usually most convenient to also call it 3omega, as you've done, but you can put any name you want after the "-o". > Do I also have to specify the "input.par" file in the command line? No. It is specified in the following line of 3omega.f: open(1,'input.par') - Brooks -- The "bmoses-nospam" address is valid; no unmunging needed.
From: ben_nielsen20 on 20 Apr 2007 13:20
When I try to run DQAGI.f by itself the compiler comes up with: "No such file or directory" |