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

Dennis Shea shea at ucar.edu
Tue Jun 21 14:39:19 MDT 2016


They 'prntq_l.f90' etc are just provided for illustration. Actually, they
are rather 'silly.' However, I needed something to illustrate how modules
should be loaded on the WRAPIT line.

They are 'dummy' modules for the example. I needed something that fit on
one slide.

D

On Tue, Jun 21, 2016 at 1:15 PM, zhuxiao li <lizhuxiao70 at gmail.com> wrote:

> Hi Dennis,
>
> Thanks for the slide. I just test it and the codes worked in this way, I
> wish I could get it earlier.😃 the NCL documents does need to be updated.
>
> While I still don't quite understand why the prntq_l.f90 and cquad_l.f90
> are needed by WRAPIT to produce the right object quad90.so?
> What if I had 'real' module includes the many subroutine? I can use that
> module directly or I need to make an interface instead of the original
> module, or I need to take the third option which is that I need to make an
> extra interface inside the original module?
>
> I will give you an example later.
>
> last, I would like to get the link for the whole PPT of this slide and
> thanks for your great help again!
>
> Zhuxiao
>
>
>
>
>
>
>
>
>
> On Tue, Jun 21, 2016 at 11:30 AM, Dennis Shea <shea at ucar.edu> wrote:
>
>> 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/d6545575/attachment.html 


More information about the ncl-talk mailing list