Re: using wrapit and the fortran - ncl interface on solaris

From: Dennis Shea (shea AT XXXXXX)
Date: Tue Jun 03 2003 - 10:44:24 MDT


Hello,

There are two errors in your fortran 77 routine as far as
NCL is concerned:

(1) The "!", though a common f77 extension,
     is not ANSI conforming syntax for a f77 comment.
     Use "C"
     
(2) The acceptable NCL delimeters are:

    C NCLFORTSTART ( there are other variations)
      [the declarations which pertain to the
       arguments being passed]
    C NCLEND
      ^^^^^^
      
    You used NCLFORTEND ... ain't no such thing!
    
The following is correct and WRAPIT works fine.
    
C NCLFORTSTART
       subroutine test(x,y,z,a)
       real x,y,z,a
C NCLEND
       a=x+y+z
       return
       end

Good luck
D
========
>
>I am trying to incorporate a fortran (77) subroutine into ncl for
>the first time and I am having trouble. I'm trying something very
>simple for starters. I suspect I am not creating the .so file properly
>on our Solaris system. Does anyone have an idea what might be wrong?
>-Thanks,
> Jamie Scott
>
>->Here is what my fortran code looks like (test.f):
>
>! NCLFORTSTART
> subroutine test(x,y,z,a)
> real x,y,z,a
>! NCLFORTEND
> a=x+y+z
> return
> end
> >_______________
>
>->Here is what my ncl code looks like: (test.ncl)
>
>load "/home/jds/ncl/lib/gsn_code.ncl"
>load "/home/jds/ncl/lib/gsn_csm.ncl"
>load "/home/jds/ncl/lib/contributed.ncl"
>
>x=1
>y=2
>z=3
>a = new(1,float)
>
>external subs "/home/jds/ncl/test.so"
>begin
>subs::test(x,y,z,a)
>print(a)
>end
> >________________________
>
>->Wrapit says there is a syntax error while parsing, but still creates a .so
file:
>
>sr1{jds} 133: ./WRAPIT.csh -d test.f
>
>WRAPIT Version: 030422
>OPERATING SYSTEM: SunOS
>A syntax error occurred while parsing:
>COMPILING test.f
>SHARED OBJECT NAME (SharedObj): test.so
>LINKER SUFFIX (ld_suffux): WRAPIT.o test.o -o test.so
>
>LINKING
>ld: Software Generation Utilities - Solaris Link Editors: 5.8-1.273
>END WRAPIT
> >________________
>
>->Then ncl says it can't find Init() in the external file:
>
>
>sr1{jds} 132: ncl < test.ncl
> Copyright (C) 1995-2003 - All Rights Reserved
> University Corporation for Atmospheric Research
> NCAR Command Language Version 4.2.0.a028
> The use of this software is governed by a License Agreement.
> See http://ngwww.ucar.edu/ncl/ for more details.
>warning:Could not find Init() in external file /home/jds/ncl/test.so, file not
loaded
>fatal:syntax error: line 13 before or near :
>subs:
>----^
>
>
>fatal:syntax error: possibly an undefined procedure
>fatal:Syntax Error in block, block not executed
>
>
>
>
>
>--
>****************************************************************
>* Jamie Scott *
>* NOAA Climate Diagnostics Center *
>* R/CDC1 (303) 497-6257 *
>* 325 Broadway James.D.Scott AT noaa.gov *
>* Boulder, CO 80305-3328 http://www.cdc.noaa.gov/~jds *
>****************************************************************
>
>_______________________________________________
>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



This archive was generated by hypermail 2b29 : Tue Jun 03 2003 - 13:37:53 MDT