<div dir="ltr"><div class="gmail_default" style="font-family:verdana,sans-serif">Hi Sai, </div><div class="gmail_default" style="font-family:verdana,sans-serif"><br></div><div class="gmail_default" style="font-family:verdana,sans-serif">I've gone through and made edits as I've detailed below. I haven't tried to work out what the code is doing, so go through and double check the differences between my files and your originals, to both learn for the next time and to check I didn't make a silly mistake. </div><div class="gmail_default" style="font-family:verdana,sans-serif"><br></div><div class="gmail_default" style="font-family:verdana,sans-serif">The stub has to be formatted a little different to how you have it. There's extensive docs on each aspect here: <span style="font-family:arial,sans-serif"><a href="https://www.ncl.ucar.edu/Document/Tools/WRAPIT.shtml#SpecialConsiderations">https://www.ncl.ucar.edu/Document/Tools/WRAPIT.shtml#SpecialConsiderations</a></span></div><div class="gmail_default" style="font-family:verdana,sans-serif"><span style="font-family:arial,sans-serif"><br></span></div><div class="gmail_default" style="font-family:verdana,sans-serif"><span style="font-family:arial,sans-serif">Firstly you only need the variables that NCL will deal with in the stub, so you can cut out half the lines straight away. </span></div><div class="gmail_default" style="font-family:verdana,sans-serif"><span style="font-family:arial,sans-serif">You also want to drop the intents and go to a more simplistic F77 style of declaring variables. </span></div><div class="gmail_default">Lastly and most difficult to fix, you want to change the Array indexing of the input and output variables. </div><div class="gmail_default">See here: <a href="https://www.ncl.ucar.edu/Document/Tools/WRAPIT.shtml#ArrayIndexing">https://www.ncl.ucar.edu/Document/Tools/WRAPIT.shtml#ArrayIndexing</a><br></div><div class="gmail_default"><br></div><div class="gmail_default">I set up a quick driver subroutine at the bottom of the F90 file which calls the original now renamed subroutine. </div><div class="gmail_default">To get around the array indexing issue, I've added three variables to the list of arguments which you can see in the stub or in the short subroutine at the bottom. </div><div class="gmail_default">The alternate way would be to edit the original code so the loops are all 1 to dimension length, but there's a probably a reason to not do that. </div><div class="gmail_default"><br></div><div class="gmail_default">external hb01 "./HBFILTER.so"</div><div class="gmail_default"><br></div><div class="gmail_default">original call e.g.<br></div><div class="gmail_default"><div class="gmail_default"> hb01::hbfilter (input,output,nmax, start_z,end_z, ids,ide, jds,jde, ims,ime, jms,jme )</div></div><div class="gmail_default" style="font-family:verdana,sans-serif"><span style="font-family:arial,sans-serif"><br></span></div><div class="gmail_default" style="font-family:verdana,sans-serif"><span style="font-family:arial,sans-serif">new call e.g.</span></div><div class="gmail_default" style="font-family:verdana,sans-serif"><span style="font-family:arial,sans-serif"> hb01::hbfilter (input,output,nmax, start_z,end_z, (end_z-start_z), ids,ide, jds,jde, ims,ime,(ime-ims), jms,jme, (jme-jms) ) </span><span style="font-family:arial,sans-serif"><br></span></div><div class="gmail_default" style="font-family:verdana,sans-serif"><span style="font-family:arial,sans-serif"><br></span></div><div class="gmail_default" style="font-family:verdana,sans-serif"><span style="font-family:arial,sans-serif"><br></span></div><div class="gmail_default" style="font-family:verdana,sans-serif">Big disclaimer, I'm not a fortran expert but have wrapped many programs like this into NCL so have some experience. <span style="font-family:arial,sans-serif"><br></span></div><div class="gmail_default" style="font-family:verdana,sans-serif"><span style="font-family:arial,sans-serif"><br></span></div><div class="gmail_default"><br></div><div class="gmail_default" style="font-family:verdana,sans-serif"><span style="font-family:arial,sans-serif">Good luck, </span></div><div class="gmail_default" style="font-family:verdana,sans-serif"><span style="font-family:arial,sans-serif"><br></span></div><div class="gmail_default" style="font-family:verdana,sans-serif"><span style="font-family:arial,sans-serif">Alan</span></div><div class="gmail_default" style="font-family:verdana,sans-serif"><span style="font-family:arial,sans-serif"><br></span></div><div class="gmail_extra"><div class="gmail_quote">On Wed, Jan 17, 2018 at 6:16 PM, Prashanth Bhalachandran via ncl-talk <span dir="ltr"><<a href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@ucar.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div lang="EN-US"><div class="gmail-m_9004542188433944887WordSection1"><p class="MsoNormal">Hello NCL’ers, </p><p class="MsoNormal">I have a Fortran 90 subroutine (attached to this email) that I am trying to wrap and use in NCL here. However, I am getting the following error before it proceeds to create the .so file. I must confess that I am not very good with Fortran and I’m simply unable to spot where this error is stemming from. I am afraid it’s one of the F90 syntaxes that I am unaware of. Can one of you please guide me and tell me how to get this to compile without any errors? </p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">Thank you, </p><p class="MsoNormal">Sai </p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">Error message: </p><p class="MsoNormal">WRAPIT HBFILTER.stub HBFILTER.F90</p><p class="MsoNormal">WRAPIT Version: 120209</p><p class="MsoNormal">A syntax error occurred while parsing: ,</p><p class="MsoNormal">COMPILING HBFILTER.F90</p><p class="MsoNormal">LINKING</p><p class="MsoNormal">END WRAPIT</p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">Sent from <a href="https://go.microsoft.com/fwlink/?LinkId=550986" target="_blank">Mail</a> for Windows 10</p><p class="MsoNormal"><u></u> <u></u></p></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></div>