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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Fortran question (beginner)

Status
Not open for further replies.

irisastro

Programmer
Oct 28, 2015
3
0
0
RO
Hello!
I'm trying to use a subprogram from the Starlink Project - Lucy in the library KAPPA - that is already installed and compiled. The idea is to be able to call it from my fortran routine.

Something like this:
Code:
PROGRAM ex
   
INTEGER i
REAL in(10),psf(10),out(10)
   
DO i =1,10
  in(i) = rand()
  psf(i) = rand()
ENDDO

lucy in psf out

WRITE(*,*)out

END

Is that possible?
If so, how should I compile the file (using gfortran)?

Many thanks in advance!
 
Installed and compiled? as in a Fortran library? Because the literature that you provide shows that KAPPA can be run from the UNIX c-shell terminal or from ICL command language. There is nothing about Fortran.

Please post the full path to what you say you have access to regarding Lucy software.
 
Thanks for your response.
Yes, I know that in the literature there is nothing about fortran... That is why I'm asking if this is possible.
So, after downloading and unpacking the Starlink package you write in the terminal:

$ export STARLINK_DIR=$HOME/Astronomy/Software/star-2015A
$ source $STARLINK_DIR/etc/profile

After that you can run the subprograms by typing:
$ kappa
$ lucy

The compiled lucy file can be found here: $HOME/Astronomy/Software/star-2015A/bin/kappa/lucy
The source file lucy.f can be found here: Thanks again!
 
In the same description you can find:

* Usage:
* lucy in psf out [aim]

I also dont understand, that is why I'm asking..
It is impossible to compile that lucy.f file by your own, it needs a lot of subroutines and include files. But I have the compiled version.
So the question is, is it possible to "insert" a previously compiled file while the compilation of a new file, so I could call that previously compiled subroutine from the new compiled routine?
Its kind of confusing.. Sorry
Thanks!
 
Yes it's in description but the 1.line of code, which is procedure declaration shows only one arg status, which is declared as integer.
Code:
SUBROUTINE LUCY( STATUS ) 
...
...
*  Arguments: 
*     STATUS = INTEGER (Given and Returned) 
*        The global status. 
...
...
*  Status: 
      INTEGER STATUS             ! Global status 
...
Maybe the other arguments are possible only when it will be called from the environment (KAPPA ?).
It seems that it's not possible to call it as a standalone subroutine from other fortran program.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top