Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Fortran question (beginner)

Fortran question (beginner)

Fortran question (beginner)

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 --> fortran

REAL in(10),psf(10),out(10)
DO i =1,10
  in(i) = rand()
  psf(i) = rand()

lucy in psf out



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

Many thanks in advance!

RE: Fortran question (beginner)

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.

RE: Fortran question (beginner)

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: https://github.com/Starlink/starlink/blob/master/a...
Thanks again!

RE: Fortran question (beginner)

But according the the description in the source
it should be called only with one argument
so I don't understand, how it should work with 3 arguments

RE: Fortran question (beginner)

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

RE: Fortran question (beginner)

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.


*  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.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close