Re: call NCL from within a Fortran program

From: Dennis Shea <shea_at_nyahnyahspammersnyahnyah>
Date: Tue, 17 Jul 2007 14:28:33 -0600

I do not know if anybody answered.

AFAIK ... There is no way to call NCL directly from a fortran program.

Of course, you could create a file [ascii, binary, netCDF, ...] in the
fortran.
Then invoke NCL to read the file. You could use NCL's command
line arguments to pass the file name . This requires that the fortran
have a "system" subroutine ...

fortran code ...
                   character filnam*50 , nclcmd*100
                  
                   filnam = trim( "foo.bin" )
                   open (10, file=filnam, access="sequential",
form="unformatted")

                   nclcmd = trim( ' "ncl fname=" // filnam //"
demo.ncl" ' )
                   call system( nclcmd )
                  
NCL script [demo.ncl]

if (.not.isvar("fname")) then
    print("NCL: required argument fname is not present")
    exit
end if
load ..
load ..

   x = fbinrecread(fname ......)

=========================================================
Good luck
D

Mateus da Silva Teixeira wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Dear NCL users,
>
> I was navigating NCL's web site and I found a page that says the
> following (http://www.ncl.ucar.edu/Document/HLUs/API/):
>
> HLU API functions
>
> NHLPERROR
> The Fortran name of this function is NhlFPError.
>
> My doubt: Is it possible to call NCL from within a Fortran program?
> After saw this page I think yes, but in the NCL Reference Manual, only C
> APIs are mentioned.
>
> Thanks,
>
> Mateus
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.5 (GNU/Linux)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
>
> iD8DBQFGl+AetBm/Y0ahARYRApaMAJ9Obo9L5YBfoCpJhj6EOGDv4hFpHACfX/7Z
> tf/omsTobz8GdBoUk1CI4Rc=
> =gwwa
> -----END PGP SIGNATURE-----
> _______________________________________________
>

_______________________________________________
ncl-talk mailing list
ncl-talk_at_ucar.edu
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Tue Jul 17 2007 - 14:28:33 MDT

This archive was generated by hypermail 2.2.0 : Wed Jul 18 2007 - 17:38:11 MDT