Re: passing string from NCL to fortran

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Thu, 14 Feb 2008 10:01:58 -0700 (MST)

Prince,

For information on passing strings between NCL and Fortran, see:

http://www.ncl.ucar.edu/Document/Manuals/Ref_Manual/NclExtend.shtml#SpecialConsiderations

Note the following:

Passing strings from NCL to Fortran:
     If you want to pass an NCL variable of type string to a Fortran
     procedure, then the argument to the Fortran procedure must be
     declared as CHARACTER*(*).

If you are really talking about a single character, this should do it:

C NCLFORTSTART
       SUBROUTINE ONEC (STRIN)
       CHARACTER*(*) STRIN
C NCLEND
       PRINT *,'STRIN=',STRIN

       RETURN
       END

The two-line NCL script:

   external EX09 "./ex09.so"
   EX09::onec("L")

--Mary

On Thu, 14 Feb 2008, Prince K. XAVIER wrote:

> Hello all,
>
> How can I pass a NCL string variable to Fortran to be used as a character?
> NCL converts the string to a character ARRAY (of size n+1), but then I have
> to reassemble them in Fortran to have the word meaningful. I'm wondering if
> there is any straightforward way of doing it?
>
> regards
> Prince
>
>
>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk_at_ucar.edu
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
_______________________________________________
ncl-talk mailing list
ncl-talk_at_ucar.edu
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Thu Feb 14 2008 - 10:01:58 MST

This archive was generated by hypermail 2.2.0 : Fri Feb 15 2008 - 17:17:57 MST