<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space; color: rgb(0, 0, 0); font-size: 14px; font-family: Calibri, sans-serif;">
<div>Hi Dennis,</div>
<div><br>
</div>
<div>I can! See attached screen shots from iStat Menus. Nothing running apart from Terminal, only process on that is ncl.</div>
<div><br>
</div>
<div>Cheers</div>
<div><br>
</div>
<div>Harry</div>
<div><br>
</div>
<div><img src="cid:C9292F5A-DB14-46CE-8A06-A419F7220414" type="image/png"></div>
<span id="OLK_SRC_BODY_SECTION">
<div style="font-family:Calibri; font-size:11pt; text-align:left; color:black; BORDER-BOTTOM: medium none; BORDER-LEFT: medium none; PADDING-BOTTOM: 0in; PADDING-LEFT: 0in; PADDING-RIGHT: 0in; BORDER-TOP: #b5c4df 1pt solid; BORDER-RIGHT: medium none; PADDING-TOP: 3pt">
<img src="cid:0EC04580-4DC4-46E5-A2B8-07033C3A2CCA" type="image/png" style="font-family: Calibri, sans-serif; font-size: 14px;"><span style="font-weight:bold">From:
</span>Dennis Shea <<a href="mailto:shea@ucar.edu">shea@ucar.edu</a>><br>
<span style="font-weight:bold">Date: </span>Friday, 17 July 2020 at 18:49<br>
<span style="font-weight:bold">To: </span>Rick Brownrigg <<a href="mailto:brownrig@ucar.edu">brownrig@ucar.edu</a>><br>
<span style="font-weight:bold">Cc: </span>Ian Harris <<a href="mailto:i.harris@uea.ac.uk">i.harris@uea.ac.uk</a>>, ncl-talk <<a href="mailto:ncl-talk@mailman.ucar.edu">ncl-talk@mailman.ucar.edu</a>><br>
<span style="font-weight:bold">Subject: </span>Re: [ncl-talk] Using NetCDF with WRAPIT<br>
</div>
<div><br>
</div>
<div>
<div>
<div dir="ltr">
<div>re: " ... there seems to be a memory leak in addfile()."</div>
<div><br>
</div>
<div>Can you please provide an example?</div>
<div><br>
</div>
<div>THX<br>
</div>
</div>
<br>
<div class="gmail_quote">
<div dir="ltr" class="gmail_attr">On Fri, Jul 17, 2020 at 11:42 AM Rick Brownrigg via ncl-talk <<a href="mailto:ncl-talk@mailman.ucar.edu">ncl-talk@mailman.ucar.edu</a>> wrote:<br>
</div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div dir="ltr">
<div>Hi Harry,</div>
<div><br>
</div>
<div><span style="font-family:arial,sans-serif">I don't know for certain. It really looks like the compiler is not finding the netcdf header, and needs the equivalent of a -I/usr/local/include option. As you point out, WRAPIT doesn't accept that (seems like
 an oversight to me).</span></div>
<div><span style="font-family:arial,sans-serif"><br>
</span></div>
<div><span style="font-family:arial,sans-serif">I presume you are using gfortran?  It manual states: "The
<code>gfortran</code> compiler currently does not make use of any environment variables to control its operation<span style="color:rgb(255,0,0)"> above and beyond
</span>those that affect the operation of <code>gcc"</code></span></div>
<div><span style="font-family:arial,sans-serif"><code><br>
</code></span></div>
<div><span style="font-family:arial,sans-serif"><code>With that, you might try setting CPATH:</code></span></div>
<div><span style="font-family:arial,sans-serif"><code><br>
</code></span></div>
<div><span style="font-family:arial,sans-serif"><code>export CPATH=/usr/local/include</code></span></div>
<div><span style="font-family:arial,sans-serif"><code><br>
</code></span></div>
<div><span style="font-family:arial,sans-serif"><code>Other than that, you might try running WRAPIT with the -d switch. This will show the build commands and not delete temporary outputs. From there you might be able to manually fix-up and run the appropriate
 build commands.</code></span></div>
<div><span style="font-family:arial,sans-serif"><code><br>
</code></span></div>
<div><span style="font-family:arial,sans-serif"><code>Wish I had a better answer...</code></span></div>
<div><span style="font-family:arial,sans-serif"><code>Rick<br>
</code></span></div>
<div><code><span style="font-family:arial,sans-serif"></span><br>
</code></div>
</div>
<br>
<div class="gmail_quote">
<div dir="ltr" class="gmail_attr">On Fri, Jul 17, 2020 at 10:32 AM Ian Harris (ENV - Staff) via ncl-talk <<a href="mailto:ncl-talk@mailman.ucar.edu" target="_blank">ncl-talk@mailman.ucar.edu</a>> wrote:<br>
</div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div dir="ltr">
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
Hi Rick,</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
<span>WRAPIT Version: 120209<br>
</span>
<div>A syntax error occurred while parsing: include<br>
</div>
<div>COMPILING /Users/ianharris/Programs/Fortran/forverify3.for<br>
</div>
<div>/Users/ianharris/Programs/Fortran/forverify3.for:443: Error: Can't open included file 'netcdf.inc'<br>
</div>
<div>LINKING<br>
</div>
<div>gcc: error: forverify3.o: No such file or directory<br>
</div>
<div>rm: forverify3.o: No such file or directory<br>
</div>
<div>END WRAPIT<br>
</div>
<span></span></div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
This is the gfortran equivalent that works:</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
% gfortran -m64 -I/usr/local/include/ -L/usr/local/lib -lnetcdf /usr/local/lib/libnetcdff.a ~/Programs/Fortran/forverify3.for</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
also, new tree from macports:</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
% gfortran -m64 -I/opt/local/include/ -L/opt/local/lib -lnetcdf /opt/local/lib/libnetcdff.a ~/Programs/Fortran/forverify3.for</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
Now WRAPIT doesn't like Includes, and you have to put spaces after the -L and -l linkages, but:</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
<span>% WRAPIT -m64 -L /opt/local/lib -l netcdf /opt/local/lib/libnetcdff.a ~/Programs/Fortran/forverify3.for<br>
</span>
<div> <br>
</div>
<div>WRAPIT Version: 120209<br>
</div>
<div>A syntax error occurred while parsing: include<br>
</div>
<div>COMPILING /Users/ianharris/Programs/Fortran/forverify3.for<br>
</div>
<div>/Users/ianharris/Programs/Fortran/forverify3.for:442: Error: Can't open included file 'netcdf.inc'<br>
</div>
<div>LINKING<br>
</div>
<div>gcc: error: forverify3.o: No such file or directory<br>
</div>
<div>rm: forverify3.o: No such file or directory<br>
</div>
<div>END WRAPIT<br>
</div>
<span></span></div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
Cheers</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
Harry<br>
</div>
<div id="gmail-m_-2819898048657338827gmail-m_4122559872299673996appendonsend"></div>
<hr style="display:inline-block;width:98%">
<div id="gmail-m_-2819898048657338827gmail-m_4122559872299673996divRplyFwdMsg" dir="ltr">
<font style="font-size:11pt" face="Calibri,sans-serif" color="#000000"><b>From:</b> Rick Brownrigg <<a href="mailto:brownrig@ucar.edu" target="_blank">brownrig@ucar.edu</a>><br>
<b>Sent:</b> 17 July 2020 17:15<br>
<b>To:</b> Ian Harris (ENV - Staff) <<a href="mailto:I.Harris@uea.ac.uk" target="_blank">I.Harris@uea.ac.uk</a>><br>
<b>Cc:</b> Dennis Shea via ncl-talk <<a href="mailto:ncl-talk@mailman.ucar.edu" target="_blank">ncl-talk@mailman.ucar.edu</a>><br>
<b>Subject:</b> Re: [ncl-talk] Using NetCDF with WRAPIT</font>
<div> </div>
</div>
<div>
<p style="border:4px solid rgb(255,0,0);padding:0.5em;text-align:center"><b>Warning:</b> This email is from outside the UEA system. Do not click on links or attachments unless you expect them from the sender and know the content is safe.
</p>
<div></div>
<div>
<div dir="ltr">
<div>Hi,</div>
<div><br>
</div>
<div>What do you mean by "cannot get WRAPIT to recognise the "include 'netcdf.inc'""?  Are you getting a compiler error, or an error from WRAPIT itself, or?  I see you have -L directives pointing to where the netcdf library resides; do you need a similar -I
 directive to point to where the header is?</div>
<div><br>
</div>
<div>Rick<br>
</div>
</div>
<br>
<div>
<div dir="ltr">On Fri, Jul 17, 2020 at 10:03 AM Ian Harris (ENV - Staff) via ncl-talk <<a href="mailto:ncl-talk@mailman.ucar.edu" target="_blank">ncl-talk@mailman.ucar.edu</a>> wrote:<br>
</div>
<blockquote style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div dir="ltr">
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
Hi,</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
I need to write NetCDF files with a Fortran subroutine, because there seems to be a memory leak in addfile(). I know that was supposed to be fixed years back, but I have memory usage graphs that indicate otherwise. And yes, I have comprehensive deletion strategies.<br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
I've tried a lot of things, including reinstalling ncl, (oh, yes..), NetCDF, etc, etc, but I cannot get WRAPIT to recognise the "include 'netcdf.inc'" line in the subroutine. Has anyone managed this? How did you link to the libraries?</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
Here are a couple examples that don't work:</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
WRAPIT  -L/usr/local/lib -l netcdf -L /usr/local /usr/local/lib/libnetcdff.a /usr/local/lib/libnetcdf.a   ~/Programs/Fortran/forverify3.for<br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
WRAPIT -L /opt/local/lib -l netcdf -L /opt/local -l libnetcdff.a ~/Programs/Fortran/forverify3.for</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
..I just chose two from dozens.</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
Is it actually *possible* to have a NetCDF-aware Fortran subroutine under WRAPIT?</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
Cheers</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
Harry<br>
</div>
</div>
_______________________________________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@mailman.ucar.edu" target="_blank">ncl-talk@mailman.ucar.edu</a><br>
List instructions, subscriber options, unsubscribe:<br>
<a href="https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fmailman.ucar.edu%2Fmailman%2Flistinfo%2Fncl-talk&data=02%7C01%7CI.Harris%40uea.ac.uk%7Cc55f055f97e64c95dcd108d82a79c5c8%7Cc65f8795ba3d43518a070865e5d8f090%7C0%7C0%7C637306049786418837&sdata=fG1V%2BPwKciRmx%2B%2FV548Eg9BamFts7udneYQVIR60cNw%3D&reserved=0" originalsrc="https://mailman.ucar.edu/mailman/listinfo/ncl-talk" shash="Wpv9JtixE88Lo08I0lUaWs/naNVleIDv4onHGUCjCresr3Aed0SqC7iNfsBA3QyJxVukug8B+/0HZNwXQTeP7vCCq5PbGV45L8P0A1o0uMxVmgUewNWlgpCi9tHBOBG1xwNKuXXuo2PQAm2PWrbmQTBBcPY2KXW3CI68RaKdLKE=" rel="noreferrer" target="_blank">https://mailman.ucar.edu/mailman/listinfo/ncl-talk</a></blockquote>
</div>
</div>
</div>
</div>
_______________________________________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@mailman.ucar.edu" target="_blank">ncl-talk@mailman.ucar.edu</a><br>
List instructions, subscriber options, unsubscribe:<br>
<a href="https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fmailman.ucar.edu%2Fmailman%2Flistinfo%2Fncl-talk&data=02%7C01%7CI.Harris%40uea.ac.uk%7Cc55f055f97e64c95dcd108d82a79c5c8%7Cc65f8795ba3d43518a070865e5d8f090%7C0%7C0%7C637306049786428834&sdata=7MhsDMZ2EdFrZRxKDNr9MaE6u33bD72rRIa%2BljqzoBo%3D&reserved=0" originalsrc="https://mailman.ucar.edu/mailman/listinfo/ncl-talk" shash="ZYNa0swOsf+Rd3tVlCcBPT1sxchoFdslWGMRa5ePsamX8ouDyx6H6sowLdopPKoePMPrOlb2K5FT+2FLat7B/R1aJvQ/zu/SGpFtJmhlaz7lswDG8/2NtYq8tm3IKVBzpZzC1GZmTakKtn06uCMwBygy7oLQEl3FbH18+pcRkA8=" rel="noreferrer" target="_blank">https://mailman.ucar.edu/mailman/listinfo/ncl-talk</a></blockquote>
</div>
_______________________________________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@mailman.ucar.edu" target="_blank">ncl-talk@mailman.ucar.edu</a><br>
List instructions, subscriber options, unsubscribe:<br>
<a href="https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fmailman.ucar.edu%2Fmailman%2Flistinfo%2Fncl-talk&data=02%7C01%7CI.Harris%40uea.ac.uk%7Cc55f055f97e64c95dcd108d82a79c5c8%7Cc65f8795ba3d43518a070865e5d8f090%7C0%7C0%7C637306049786428834&sdata=7MhsDMZ2EdFrZRxKDNr9MaE6u33bD72rRIa%2BljqzoBo%3D&reserved=0" originalsrc="https://mailman.ucar.edu/mailman/listinfo/ncl-talk" shash="ZYNa0swOsf+Rd3tVlCcBPT1sxchoFdslWGMRa5ePsamX8ouDyx6H6sowLdopPKoePMPrOlb2K5FT+2FLat7B/R1aJvQ/zu/SGpFtJmhlaz7lswDG8/2NtYq8tm3IKVBzpZzC1GZmTakKtn06uCMwBygy7oLQEl3FbH18+pcRkA8=" rel="noreferrer" target="_blank">https://mailman.ucar.edu/mailman/listinfo/ncl-talk</a></blockquote>
</div>
</div>
</div>
</span>
</body>
</html>