The "external" command: prescribed syntax ?

From: Karsten Peters <karsten.peters_at_nyahnyahspammersnyahnyah>
Date: Mon Jan 24 2011 - 04:12:42 MST

  Dear all,

     I am calling self-written procedures and external Fortran code in
my ncl-code. I have different Fortran codes for different purposes and I
want the procedure to include just the Fotran code that I need. For this
I had some ideas:

This is just some dummy code to illustrate my approach:

Flag in the main program:

super_safe = False

top of the procedure:

procedure bla (..,...,..,etc.)

if (super_safe) then
     external BLA "f_BLA1.so"
else
     external BLA "f_BLA2.so"
end if

Unfortunately, this gives a syntax error. Anyone have an idea why this
is ? Is the external command not allowed to be written in an if-loop ?

Then I had another idea:

Definition of filenames in the main program:

if (super_safe) then
     extname = "f_BLA1.so"
else
     extname = "f_BLA2.so"
end if

top of the procedure:

procedure bla (..,...,extname:string,etc.)

external BLA extname

Unfortunately, this also gives a syntax error.

Now the essence of this mail: Is there any possibility for using the
external command in a generic way like I described ?

I am happy for any input !

Cheers,
     Karsten Peters

-- 
Karsten Peters
Cloud-Climate-Feedbacks Group
Max Planck Institute for Meteorology
Bundesstrasse 53
D-20146 Hamburg
------------------------------------------------------------------
Tel.:	++49 (0)40 41173 147
Fax.: 	++49 (0)40 41173 298
Email: 	karsten.peters@zmaw.de
URL:	http://www.mpimet.mpg.de/~peters.karsten
_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Mon Jan 24 04:12:55 2011

This archive was generated by hypermail 2.1.8 : Tue Jan 25 2011 - 14:22:15 MST