<div dir="ltr"><div class="gmail_default" style="font-size:small">​Barry,</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">Please see the WRAPIT documentation at:</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small"><a href="http://www.ncl.ucar.edu/Document/Tools/WRAPIT.shtml">http://www.ncl.ucar.edu/Document/Tools/WRAPIT.shtml</a></div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">There are several examples there to help you get started.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">The issue is that the line:</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">C NCLFORTSTART</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">needs to be *before* the SUBROUTINE line.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">Also, I suggest putting the &quot;C NCLEND&quot; line before all your local variables:</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default">C NCLFORTSTART                                                                                                                                                                            </div><div class="gmail_default">      SUBROUTINE sort(n,arr,arr_i,arr_j)</div><div class="gmail_default">      INTEGER n</div><div class="gmail_default">      REAL arr(n)</div><div class="gmail_default">      INTEGER arr_i(n),arr_j(n)</div><div class="gmail_default">C NCLEND                                                                                                                                                                                  </div><div class="gmail_default">      INTEGER M,NSTACK</div><div class="gmail_default">      PARAMETER (M=7,NSTACK=50)</div><div class="gmail_default">      INTEGER i,ir,j,jstack,k,l,istack(NSTACK)</div><div class="gmail_default" style="font-size:small">      REAL a,temp,b,c,a_i,a_j,temp_i,temp_j</div><div class="gmail_default" style="font-size:small"><br>Finally, I caution against calling your subroutine &quot;sort&quot;. This is a common name for a function / procedure in many languages, and could cause a conflict.  I suggest renaming it to something unique, like &quot;mysort&quot;.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">--Mary</div><div class="gmail_default" style="font-size:small">​</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Oct 24, 2016 at 12:44 PM, Barry Lynn <span dir="ltr">&lt;<a href="mailto:barry.h.lynn@gmail.com" target="_blank">barry.h.lynn@gmail.com</a>&gt;</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:<div><br></div><div>I believe that I have followed the instructions in trying use wrapit and in adding the external statement to sort.so</div><div><br></div><div><div>Copyright (C) 1995-2014 - All Rights Reserved</div><div> University Corporation for Atmospheric Research</div><div> NCAR Command Language Version 6.2.1</div><div> The use of this software is governed by a License Agreement.</div><div> See <a href="http://www.ncl.ucar.edu/" target="_blank">http://www.ncl.ucar.edu/</a> for more details.</div><div><b>warning:Could not find Init() in external file ./sort.so, file not loaded</b></div><div>warning:error at line 8 in file ./wrf_loop_radar_1.3km.ncl</div><div><br></div><div><br></div><div>Here is the top of the sort program</div><div><br></div><div><div>      SUBROUTINE sort(n,arr,arr_i,arr_j)</div><div>C NCLFORTSTART</div><div>      INTEGER n</div><div>      REAL arr(n)</div><div>      INTEGER arr_i(n),arr_j(n)</div><div>      INTEGER M,NSTACK</div><div>      PARAMETER (M=7,NSTACK=50)</div><div>      INTEGER i,ir,j,jstack,k,l,istack(<wbr>NSTACK)</div><div>      REAL a,temp,b,c,a_i,a_j,temp_i,<wbr>temp_j</div></div><div>C NCLEND<br></div><div><br></div><div>Here is what I get when I run WRAPIT sort.f</div><div><br></div><div><div>[wrf@mn03 NCL-TEMP3]$ WRAPIT sort.f</div><div> </div><div>WRAPIT Version: 120209</div><div>A<b> syntax error occurred while parsing: n  (Not sure what this error message is).</b></div><div>COMPILING sort.f</div><div>LINKING</div><div>END WRAPIT</div><div> </div><div>[wrf@mn03 NCL-TEMP3]$ ls -ltr *.so</div><div>-rwxr-xr-x. 1 wrf games 6507 Oct 24 20:34 sort.so</div><div>[wrf@mn03 NCL-TEMP3]$ </div></div><div><br></div><div>Here is the top of my ncl program.</div><div><br></div><div><div>;load &quot;$NCARG_ROOT/lib/ncarg/<wbr>nclscripts/csm/gsn_code.ncl&quot;</div><div>;load &quot;$NCARG_ROOT/lib/ncarg/<wbr>nclscripts/wrf/WRFUserARW.ncl&quot;</div><div>;load &quot;WRFOptions.ncl&quot;     ; set basic plot options here</div><div>;load &quot;gsn_code.ncl&quot;</div><div>;load &quot;WRFPlot.ncl&quot;</div><div>;load &quot;WRFUserARW.ncl&quot;</div><div>;load &quot;SkewTFunc.ncl&quot;</div><div><b>external SORT &quot;./sort.so&quot;</b></div><div> begin</div></div><div><br></div><div><br></div><div>Thank you.</div><div><br></div>-- <br><div class="m_-9013062996479838686gmail_signature"><div dir="ltr">Barry H. Lynn, Ph.D<div><div>Senior Lecturer,</div><div><div><span style="color:rgb(136,136,136)">The Institute of the Earth Science, </span><br style="color:rgb(136,136,136)"><span style="color:rgb(136,136,136)">The Hebrew University of Jerusalem, </span><br style="color:rgb(136,136,136)"><span style="color:rgb(136,136,136)">Givat Ram, Jerusalem 91904, Israel </span><br style="color:rgb(136,136,136)"></div><span style="color:rgb(136,136,136)">Tel: 972 547 231 170</span><br style="color:rgb(136,136,136)"><span style="color:rgb(136,136,136)">Fax: (972)-25662581</span></div></div><div><span style="color:rgb(136,136,136)"><br></span></div><div>C.E.O, Weather It Is, LTD<br>Weather and Climate Focus<br><a href="http://weather-it-is.com" target="_blank">http://weather-it-is.com</a><br>Jerusalem, Israel<br>Local: 02 930 9525<br>Cell: 054 7 231 170<br>Int-IS: x972 2 930 9525<br>US <a href="tel:914%20432%203108" value="+19144323108" target="_blank">914 432 3108</a><br></div></div></div>
</div></div>
<br>______________________________<wbr>_________________<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/<wbr>mailman/listinfo/ncl-talk</a><br>
<br></blockquote></div><br></div>