[ncl-talk] Fwd: about using Fortran90 code in NCL

Dennis Shea shea at ucar.edu
Tue Jun 21 11:30:01 MDT 2016


Attached is a PPT slide from the NCL Workshops that illustrate calling f90
via WRAPIT.  It is a bit over-the-top with module usage but it gives an
idea of how to proceed.  To my knowledge, modules *must* be compiled before
they are used. Hence, the ordering on the WRAIT example.

Since NCL's WRAPIT is f77 aware (*not* f90 aware), any f90 subroutine
invoked from an NCL script must have an associated 'stub' file which uses
f77 syntax. It uses this to create the interface between NCL (written in C)
and the user fortran subroutines.

HTH



On Tue, Jun 21, 2016 at 9:41 AM, Bill Ladwig <ladwig at ucar.edu> wrote:

> Hi Zhuxiao,
>
> Can you also provide us with how you called WRAPIT?  It doesn't look like
> your mquad routine ever got linked in when you built your .so module.
>
> Regards,
>
> Bill
>
> On Mon, Jun 20, 2016 at 3:02 PM, zhuxiao li <lizhuxiao70 at gmail.com> wrote:
>
>> Hi There,
>>
>> I have got a problem to use   external F90 code in NCL.
>> Actually, I just using the simple templet in
>> http://www.ncl.ucar.edu/Document/Manuals/language_man.pdf
>> page 36 of Section 7.3 f90 subroutines.
>>
>> The problem is that when I use only the subroutine CQUAD to produce the
>> object file (.so) and then execute the ncl code, it works. Please see the
>> following attachment:
>>
>> quad.f90,
>> quad90.stub,
>> ncl_F90_test_temple.ncl.
>>
>> While when I include the subroutine in a module structure exactly like
>> the templet on P36 of the manual, it gave me some very tough error message,
>> please check the following attachments:
>>
>> quad_module.f90,
>> mquad90.stub,
>> ncl_F90_test_temple_module.ncl
>>
>> error_message_ncl_exe.txt
>> The NCL I am using is ncl-6.3.0, do you have some idea on what is the
>> reason of this problem?
>>
>> Thanks very much in advance!
>>
>> Zhuxiao
>>
>>
>>
>>
>>
>> _______________________________________________
>> ncl-talk mailing list
>> ncl-talk at ucar.edu
>> List instructions, subscriber options, unsubscribe:
>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>
>>
>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk at ucar.edu
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20160621/816f6249/attachment-0001.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: NCL_f90.pptx
Type: application/vnd.openxmlformats-officedocument.presentationml.presentation
Size: 98619 bytes
Desc: not available
Url : http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20160621/816f6249/attachment-0001.bin 


More information about the ncl-talk mailing list