Prev: Libraries on Linux
Next: Write to file from DLL
From: glen herrmannsfeldt on 20 Apr 2007 15:19 ben_nielsen20(a)yahoo.com 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? > I also noticed my program has this statement: > call dqagi(fr,bound,inf,epsabs,epsrel,result, > * abserr,neval,ier,limit,lenw,last,iwork,work) For fixed form the C of CALL should be in column 7 or greater, and the * of the continuation in column 6. > 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? It would be very unusual for 13 out of 14 to have the same name. No, the names don't matter. The types must agree, though. -- glen
From: ben_nielsen20 on 20 Apr 2007 14:21 Can subroutines be run by themselves? This comes up with the same "No such file or directory" response in the compiler. gfortran DQAGI.f 3omega.f -o 3omega.exe
From: e p chandler on 20 Apr 2007 14:43 On Apr 20, 12:23 pm, ben_nielse...(a)yahoo.com 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? > > 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? > > Thanks, > > Ben As long as the types, kinds (and sizes) of the arguments match, what they are named does not matter. I briefly look at the source for this subroutine and it looks like fixed format Fortran with implicit typing. So unless otherwise specified, the types of F and FR would be default real. I'm also guessing that F or FR is the name of a function, but that does not matter here. The arguments named in the body of a subroutine are DUMMY arguments. They get replaced with the ACTUAL arguments as used in the calling program. So if you have a real variable foo and a SUBROUTINE FUBAR(BAR) ....... END and you CALL FUBAR(FOO) then FUBAR acts upon FOO, as it would with BAR. ------ Aside ----- I'm not sure how to gather all the subroutines needed for your program as DQAG requires a number of OTHER routines. But once you do, you can add their names to the command line. If you put them all in the same directory then you might be able to compile with gfortran *.f -o my_program.exe -- elliot
From: e p chandler on 20 Apr 2007 14:52 On Apr 20, 2:21 pm, ben_nielse...(a)yahoo.com wrote: > Can subroutines be run by themselves? > > This comes up with the same "No such file or directory" response in > the compiler. > gfortran DQAGI.f 3omega.f -o 3omega.exe It might help if you show us what appears when you issue the command dir *.f (If you are in a fullscreen session, switch to a command prompt (console) window with alt-enter. Then click the icon at upper left and select edit then mark. Click and drag the mouse to hilight part of the screen. Press ENTER to copy. Now open up some other application like NOTEPAD and EDIT then PASTE. You now have an instant text screen shot suitable for including in a newsgroup posting. This is a real easy way to show your files, commands typed and a limited amount of output from a program without having to type it into your newsreader or web application. --- elliot
From: Beliavsky on 20 Apr 2007 15:34
On Apr 20, 2:52 pm, e p chandler <e...(a)juno.com> wrote: > On Apr 20, 2:21 pm, ben_nielse...(a)yahoo.com wrote: > > > Can subroutines be run by themselves? > > > This comes up with the same "No such file or directory" response in > > the compiler. > > gfortran DQAGI.f 3omega.f -o 3omega.exe > > It might help if you show us what appears when you issue the command > > dir *.f > > (If you are in a fullscreen session, switch to a command prompt > (console) window with alt-enter. Then click the icon at upper left and > select edit then mark. Click and drag the mouse to hilight part of the > screen. Press ENTER to copy. Now open up some other application like > NOTEPAD and EDIT then PASTE. You now have an instant text screen shot > suitable for including in a newsgroup posting. The OP should just type dir *.f > temp.txt He can open temp.txt and paste its contents wherever. It works on Unix, too, and also for command line programs that he creates. Hope this does not sound abrupt. Happy Friday. > > This is a real easy way to show your files, commands typed and a > limited amount of output from a program without having to type it into > your newsreader or web application. > > --- elliot |