Re: WRAPIT script for Fortran 90 code

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Mon, 27 Jul 2009 13:46:54 -0600 (MDT)

You are running a version of NCL that is almost 2 years old.

I'm not even sure if the binary you have was built with shared
object capability.

Can you try the 5.1.1 "ncl" executable? I'm not sure if it will work,
but it's worth a shot.

Here's how to get the file:

      ftp ftp.ucar.edu
      <log in as "anonymous">
      <Use email address as password>
      cd /pub/scd/haley
      get ncl_ia64.5.1.1
      quit

Once you have the file, make sure it is executable, and move it to
$NCARG_ROOT/bin:

     chmod gou+x ncl_ia64.5.1.1
     mv ncl_ia64.5.1.1 $NCARG_ROOT/bin/.

Now you can use this new NCL executable instead of the one already
installed on your system:

     ncl_ia64.5.1.1 your_script.ncl

If this works, then I suggest downloading V5.1.1 from the
ESG. The instructions are at:

    http://www.ncl.ucar.edu/Download/

You basically get the file, and then "gunzip" and "tar -xvf" wherever
you want it to reside.

--Mary

On Mon, 27 Jul 2009, Changlin Chen wrote:

> Hi haley:
> Thanks!
> The following is the information.
>
> uname -a : Linux a330 2.6.5-7.283-sn2 #1 SMP Wed Nov 29 16:55:53 UTC 2006 ia64 ia64 ia64 GNU/Linux
> ncl -V : 4.3.1
>
> Three files "cquad90.stub" , "cquad.f90" and "test.ncl' are attatched.
> I then run
> $WRAPIT -in -d cquad90.stub cquad.f90
> The full out put are:
> ******************************************
> WRAPIT Version: 051007
> /opt/intel/fc/10.0.026/bin/ifort
> OPERATING SYSTEM: Linux
> FORTRAN COMPILER (f90c): ifort
> FORTRAN COMPILER OPTIONS (fopts): -c -CB -V
> cc -c -I/usr/local/ncl4.3.1//include WRAPIT.c
> COMPILING cquad.f90
> ifort -c -CB -V cquad.f90
> Intel(R) Fortran IA-64 Compiler for applications running on IA-64, Version 10.0 Build 20070809 Package ID: l_fc_c_10.0.026
> Copyright (C) 1985-2007 Intel Corporation. All rights reserved.
> FOR NON-COMMERCIAL USE ONLY
>
> Intel Fortran 10.0-1040
> SHARED OBJECT NAME (SharedObj): cquad90.so
> LINKER SUFFIX (ld_suffix): WRAPIT.o cquad.o -o cquad90.so
>
> LINKING
> ifort -shared WRAPIT.o cquad.o -o cquad90.so
> END WRAPIT
> *****************************************
> "cquad90.so" is appeared.
> $ncl test.ncl
> is then run. the error are:
> --------------------------------------------------
> Copyright (C) 1995-2007 - All Rights Reserved
> University Corporation for Atmospheric Research
> NCAR Command Language Version 4.3.1
> The use of this software is governed by a License Agreement.
> See http://www.ncl.ucar.edu/ for more details.
> warning:An error occurred loading the external file ./cquad90.so, file not loaded
> ./cquad90.so: undefined symbol: NclGetArgValue
> warning:error at line 4 in file test.ncl
>
> fatal:syntax error: line 13 in file test.ncl before or near :
> EX01:
> -------^
>
> fatal:error in statement
> fatal:syntax error: line 22 in file test.ncl before or near :
> arclen = EX01:
> ----------------^
>
> fatal:Syntax Error in block, block not executed
> fatal:error at line 25 in file test.ncl
> ------------------------------------------------------
>
> Thanks Mary Haley!
>
>
>
>
>
>> From: Mary Haley <haley_at_ucar.edu>
>> Reply-To:
>> To: Changlin Chen <clchen_at_ouc.edu.cn>
>> Subject: Re: WRAPIT script for Fortran 90 code
>> Date:Sun, 26 Jul 2009 21:42:10 -0600 (MDT)
>>
>>
>> This error looks like there was a problem creating the *.so file.
>>
>> - What kind of system is this on? (uname -a)
>>
>> - What version of NCL do you have? (ncl -V)
>>
>> - Exactly how are you running WRAPIT?
>>
>> - Can you run WRAPIT with the "-d" option and send me the full
>> output?
>>
>> - Would you try this with an F77 example and let me know
>> what happens?
>>
>> http://www.ncl.ucar.edu/Document/Tools/WRAPIT.shtml#Example_1
>>
>> Thanks,
>>
>> --Mary
>>
>>
>> On Sun, 26 Jul 2009, Changlin Chen wrote:
>>
>>> Hi:
>>> I using the WRAPIT script for Fortran 90 code.
>>> I follow the manuals in http://www.ncl.ucar.edu/Document/Manuals/Ref_Manual/NclExtend.shtml.
>>>
>>> Create file "cquad.f90":
>>> ************************************
>>> subroutine cquad(a,b,c,nq,x,quad)
>>> implicit none
>>> integer, intent(in) ::nq
>>> real, intent(in) ::a,b,c,x(nq)
>>> real, intent(out) ::quad(nq)
>>> integer ::i
>>> quad = a*x**2+b*x+c
>>> return
>>> end subroutine cquad:
>>> ***************************************
>>> Create a separate file, called "cquad90.stub" :
>>> **********************************
>>> C NCLFORTSTART
>>> subroutine cquad(a,b,c,nq,x,quad)
>>> real a,b,c
>>> integer nq
>>> dimension x(nq),quad(nq)
>>> C NCLEND
>>> ******************************************
>>> And then run the ncl file test.ncl:
>>> ******************************************
>>> external EX01 "./cquad90.so"
>>> begin
>>> ;
>>> ; Calculate three values of a quadratic equation
>>> ;
>>> nump = 3
>>> x = (/ -1., 0.0, 1.0 /)
>>> qval = new(nump,float)
>>> EX01::cquad(-1., 2., 3., nump, x, qval) ; Call the NCL version of
>>> ; your Fortran subroutine.
>>> print("Polynomial value = " + qval) ; Should be (/0,3,4/)
>>> ;
>>> ; Calculate an arc length.
>>> ;
>>> xc = (/ 0., 1., 2. /)
>>> yc = (/ 0., 1., 0. /)
>>> arclen = EX01::arcln(nump,xc,yc) ; Call the NCL version of
>>> ; your Fortran function.
>>> print("Arc length = " + arclen) ; should be 2.82843
>>> end
>>> ******************************************
>>>
>>> An error occur:
>>> warning:An error occurred loading the external file ./cquad90.so, file not loaded
>>> ./cquad90.so: undefined symbol: NclGetArgValue
>>> warning:error at line 4 in file test.ncl
>>>
>>> So what's the problem? Thanks!
>>>
>>>
>>> Clchen
>>
_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Mon Jul 27 2009 - 13:46:54 MDT

This archive was generated by hypermail 2.2.0 : Wed Jul 29 2009 - 09:07:41 MDT