<div dir="ltr"><div><div>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.<br><br></div>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.<br><br></div>HTH<br><div><br><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Jun 21, 2016 at 9:41 AM, Bill Ladwig <span dir="ltr"><<a href="mailto:ladwig@ucar.edu" target="_blank">ladwig@ucar.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi Zhuxiao,<div><br></div><div>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.</div><div><br></div><div>Regards,</div><div><br></div><div>Bill </div></div><div class="gmail_extra"><br><div class="gmail_quote"><div><div class="h5">On Mon, Jun 20, 2016 at 3:02 PM, zhuxiao li <span dir="ltr"><<a href="mailto:lizhuxiao70@gmail.com" target="_blank">lizhuxiao70@gmail.com</a>></span> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5"><div dir="ltr"><div class="gmail_quote"><div dir="ltr">Hi There,<div><br></div><div>I have got a problem to use external F90 code in NCL. </div><div>Actually, I just using the simple templet in <a href="http://www.ncl.ucar.edu/Document/Manuals/language_man.pdf" target="_blank">http://www.ncl.ucar.edu/Document/Manuals/language_man.pdf</a></div><div>page 36 of Section 7.3 f90 subroutines. </div><div><br></div><div>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:</div><div> </div><div>quad.f90, </div><div>quad90.stub, </div><div>ncl_F90_test_temple.ncl. </div><div><br></div><div>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:</div><div> </div>
<div><div>quad_module.f90, </div><div>mquad90.stub, </div><div>ncl_F90_test_temple_module.ncl</div><div>
<p><span>error_message_ncl_exe.txt</span></p></div><div>The NCL I am using is ncl-6.3.0, do you have some idea on what is the reason of this problem?</div><div><br></div><div>Thanks very much in advance!</div><span><font color="#888888"><span><font color="#888888"><div><br></div><div>Zhuxiao</div><div><br></div>
<div> </div></font></span></font></span></div><div><br></div></div>
</div><br></div>
<br></div></div>_______________________________________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@ucar.edu</a><br>
List instructions, subscriber options, unsubscribe:<br>
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" rel="noreferrer" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><br>
<br></blockquote></div><br></div>
<br>_______________________________________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@ucar.edu">ncl-talk@ucar.edu</a><br>
List instructions, subscriber options, unsubscribe:<br>
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" rel="noreferrer" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><br>
<br></blockquote></div><br></div>