Re: Using fortran subroutine in NCL

From: Lei Meng <dream916_at_nyahnyahspammersnyahnyah>
Date: Sat Dec 26 2009 - 17:27:05 MST

Hi Dennis,
   I was able to compile the attached foo.f file. When using ncl to execute
it, libgfortran.so.3 can not open shared object file. :
 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 warning:An error occurred loading the external file ./foo.so, file not
loaded
libgfortran.so.3: cannot open shared object file: No such file or directory
warning:error at line 1 in file ex1.ncl

fatal:syntax error: line 10 in file ex1.ncl before or near :
   FOO:
------^

fatal:error in statement
fatal:Syntax Error in block, block not executed
fatal:error at line 14 in file ex1.ncl
++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Do you have any suggestions on what I should diagnose?
Thanks,
Lei

On Sat, Dec 26, 2009 at 5:15 PM, Lei Meng <dream916@gmail.com> wrote:

> Hi Dennis,
> Which editor did you use to create the two files? I used UltraEdit to
> delete the lines after the last character and it did not work. However, when
> I manually typed the codes via vi and saved them, it worked. It seems that
> the error might be associated with the editor I used. Thanks,
> Lei
>
>
> On Sat, Dec 26, 2009 at 3:01 PM, Dennis Shea <shea@ucar.edu> wrote:
>
>> I just copied the codes. I used the gfortran, intel and portland_group
>> fompilers. Every thing worked fine. For example:
>>
>>
>> %> WRAPIT -gf -fPIC quad90.stub quad.f90
>>
>> WRAPIT Version: 091416
>>
>> COMPILING quad.f90
>> LINKING
>> END WRAPIT
>>
>> ====
>>
>> Sometime there are unseen characters [eg: ^M] so I suggest
>> manually deleteing everything after the last character.
>>
>> Good luck
>>
>>
>> Lei Meng wrote:
>>
>>> Hi,
>>> I am testing a fortran subroutine in NCL using the following two files
>>> (see below). I used "WRAPIT quad90.stub quad.f90" to compile it. An error
>>> messange"
>>> - - - - - - - - -
>>> WRAPIT Version: 091416
>>> A syntax error occurred while parsing:
>>> COMPILING quad.f90
>>> LINKING
>>> END WRAPIT
>>> - - - - - - -- - - -
>>> It did not provide any hints on what is the syntax error. Is there
>>> anything wrong with my WRAPIT version? Thanks,
>>>
>>> ----------------quad90.stub---------------
>>> C NCLFORTSTART
>>> subroutine cquad(a,b,c,nq,x,quad)
>>> real a,b,c
>>> integer nq
>>> dimension x(nq),quad(nq)
>>> C NCLEND
>>> --------------------------------------
>>> ---------------------quad.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
>>> ------------------------------------------
>>> Thanks,
>>> Lei
>>>
>>>
>>> ------------------------------------------------------------------------
>>>
>>> _______________________________________________
>>> ncl-talk mailing list
>>> List instructions, subscriber options, unsubscribe:
>>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>>
>>
>

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk

Received on Sat Dec 26 17:27:12 2009

This archive was generated by hypermail 2.1.8 : Tue Dec 29 2009 - 10:29:16 MST