<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class="">Hi Dennis,</div><div class=""><br class=""></div><div class="">After successfully creating the *.so file with WRAPIT and having it load properly in NCL with the command ‘ external GWDO “./module_bl_gwdo_gsd.so” ‘, when I try to call the subroutine “gwdo_gsd_F77” from NCL using the command ‘ GWDO::gwdo_gsd_F77(76 arguments) ‘, I get the following error message:</div><div class=""><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Monaco; background-color: rgb(255, 255, 255);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">fatal:syntax error: procedure gwdo_gsd_F77 is not defined in package GWDO</span></div></div><div class=""><br class=""></div><div class="">Is there a way to query “GWDO” to see what subroutines it supposedly contains?</div><div class=""><br class=""></div><div class="">Thanks.</div><div class=""><br class=""></div><div class="">— Mike</div><div class=""><br class=""></div><div class=""><br class=""></div><br class=""><div><blockquote type="cite" class=""><div class="">On May 17, 2018, at 5:04 PM, Dennis Shea <<a href="mailto:shea@ucar.edu" class="">shea@ucar.edu</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class=""><div class=""><div class=""><div class=""><div class="">Hi Mike/Barry,<br class=""><br class=""></div>I asked one of the core NCL developers [Rick Brownrigg; cc'd] to help with what I could not see [literally]. He responded with two messages:<br class="">---<br class="">[1]<br class="">All I know at this point is that it occurs with this line:<br class=""><br class="">$NCARG_ROOT/bin/wrapit77 < WRAPIT.stub >! WRAPIT.c<br class=""><br class="">wrapit77
is a C program with a full lex/yacc grammar, and the error message
originates out of the grammar parsing code. Beyond that, I haven't been
able to determine why, just yet. Looking at the contents of WRAPIT.stuib, there's nothing that stands out.<br class=""><br class="">[2] <br class="">OK, it appears the issue is that the original fortran code contains
carriage-return/newline delimiters, and wrapit77's grammar does not
expect that. Things appear to work if I strip those out:<br class=""><br class="">cat test.NCL.f | sed 's/\r$//' | cat >testNCL_noCR.f<br class="">---<br class=""></div><div class="">NOTE: the above does not seem to work with the MacOS.<br class=""><br class=""></div><div class="">It had to rune on a 'real linux box'<br class=""></div><div class=""><br class=""></div>So .... NCL itself handles carriage returns and new line characters **BUT** the "full lex/yacc grammar ..." WRAPIT does not. <br class=""><br class="">%> WRAPIT module_bl_gwdo_gsd.f90 testNCL_noCR.f<br class=""> <br class="">WRAPIT Version: 120209<br class="">COMPILING module_bl_gwdo_gsd.f90<br class="">COMPILING testNCL_noCR.f<br class="">LINKING<br class="">END WRAPIT<br class=""><br class="">===<br class=""></div>I am the messenger. Rick did the real work.<br class=""><br class=""></div>D<br class=""></div><div class="gmail_extra"><br class=""><div class="gmail_quote">On Wed, May 16, 2018 at 10:28 PM, Dennis Shea <span dir="ltr" class=""><<a href="mailto:shea@ucar.edu" target="_blank" class="">shea@ucar.edu</a>></span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr" class=""><div class=""><div class=""><div class=""><div class=""><div class=""><div class=""><div class=""><div class="">[A]<br class=""><br class=""></div><div class="">(0:1,0:1,0:1) is legal f77 & f90<br class=""><br class=""></div>WRAPIT is not a full fortran language parser. It is not very sophisticated. It does not understand this syntax.<br class=""><br class=""></div>[B]<br class=""><br class=""></div>Again, we must do the "end-around". <br class=""><br class=""></div>I added 'imsime', 'jmsjme', 'kmskme'<br class=""><br class=""></div><div class="">to the argument list and the declarations.<br class=""></div><div class=""><br class=""></div>Where the quantities are:<br class=""><br class=""></div> imsime = ime-ims+1<br class=""></div> jmsjme = jme-jms+1<br class=""></div> kmskme = kme-kms+1<br class=""><div class=""><div class=""><br class="">--------<br class=""><br class=""></div><div class="">%> gfortran -c module_bl_gwdo_gsd.f90 test.NCL.f<br class=""><br class=""></div><div class="">works fine.<br class=""><br class=""></div><div class="">Unfortunately, <br class=""></div><div class=""><br class="">%> WRAPIT module_bl_gwdo_gsd.f90 test.NCL.f<br class=""><br class="">WRAPIT Version: 120209<span class=""><br class="">A syntax error occurred while parsing: <br class=""></span>COMPILING module_bl_gwdo_gsd.f90<br class="">COMPILING test.NCL.f<br class="">LINKING<br class="">END WRAPIT<br class=""><br class=""></div><div class="">I'll look again tomorrow but it is late!<span class="HOEnZb"><font color="#888888" class=""><br class=""><br class=""></font></span></div><span class="HOEnZb"><font color="#888888" class=""><div class="">D<br class=""></div><div class=""><div class=""><div class=""><div class=""><div class=""><br class=""></div></div></div></div></div></font></span></div></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br class=""><div class="gmail_quote">On Wed, May 16, 2018 at 6:15 AM, Dennis Shea <span dir="ltr" class=""><<a href="mailto:shea@ucar.edu" target="_blank" class="">shea@ucar.edu</a>></span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr" class=""><div class=""><div class="">Hi, Michael, Barry, <br class=""><br class=""></div>I hope to look at this later today.<span class="m_6488725240813113978HOEnZb"><font color="#888888" class=""><br class=""><br class=""></font></span></div><span class="m_6488725240813113978HOEnZb"><font color="#888888" class="">D<br class=""></font></span></div><div class="m_6488725240813113978HOEnZb"><div class="m_6488725240813113978h5"><div class="gmail_extra"><br class=""><div class="gmail_quote">On Tue, May 15, 2018 at 11:14 AM, Michael Toy <span dir="ltr" class=""><<a href="mailto:toy@ucar.edu" target="_blank" class="">toy@ucar.edu</a>></span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word" class="">Hi Dennis and Barry,<div class=""><br class=""></div><div class="">I think narrowed my issue with WRAPIT and the "<span style="background-color:rgb(255,255,255)" class=""><font face="Monaco" class=""><span style="font-size:11px" class="">A syntax error occurred while parsing: :” </span></font></span>error message I’m getting to declaring arrays in F77 in which the indices are not the standard 1..N arrangement. For the simple stub below, I get the error message:</div><div class=""><br class=""></div><div class="">C NCLFORTSTART</div><div class=""> subroutine print_array(x)</div><div class=""> implicit none</div><div class=""> real x( 0:1, 0:1, 0:1 )</div><div class="">C NCLEND</div><div class=""><br class=""></div><div class="">However, if I change the declaration line to:</div><div class=""> real x ( 2, 2, 2 )</div><div class=""><br class=""></div><div class="">It compiles fine.</div><div class=""><br class=""></div><div class="">I’ve looked up some documentation on Fortran77, and it looks the (0:1,0:1,0:1) declaration should work. Is this not legal F77 syntax?</div><div class=""><br class=""></div><div class="">Thanks.</div><div class=""><br class=""></div><div class="">— Mike</div><div class=""><br class=""></div></div></blockquote></div><br class=""></div>
</div></div></blockquote></div><br class=""></div>
</div></div></blockquote></div><br class=""></div>
<span id="cid:88E472A9-3873-4AA9-85A7-592A491666D0@fsl.noaa.gov"><testNCL_noCR.f></span><span id="cid:C7D27686-1E9E-4114-ADF7-2B846593316B@fsl.noaa.gov"><module_bl_gwdo_gsd.f90></span></div></blockquote></div><br class=""></body></html>