<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252">
</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>Okay, I’ve moved things on.</div>
<div><br>
</div>
<div>1. I located and edited the WRAPIT script. This has a ’set compiler options’ section, and within that a 'Darwin' subsection. Here I was able to add the minimum includes and libraries for NetCDF to be incorporated. Easy. This meant I didn’t need to spend
 two days upgrading everything, which is a shame, because of point 2.</div>
<div><br>
</div>
<div>2. Because I upgraded the Mac to 10.14 ('Mojave'), a security feature called FDA (Full Disk Access) prevents me from running WRAPIT! It’s very restrictive if you want to do things outside of the approved areas (ie, buying Apple Music, joining Apple TV,
 etc). You can add apps to FDA in the system Prefs, but not scripts. I tried writing a dummy Fortran proglet to run the script, but I don’t get any outputs, so that’s not working.</div>
<div><br>
</div>
<div>It doesn’t get easier!</div>
<div><br>
</div>
<div>Harry</div>
<div><br>
</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">
<span style="font-weight:bold">From: </span>ncl-talk <<a href="mailto:ncl-talk-bounces@mailman.ucar.edu">ncl-talk-bounces@mailman.ucar.edu</a>> on behalf of "Ian Harris (ENV - Staff) via ncl-talk" <<a href="mailto:ncl-talk@mailman.ucar.edu">ncl-talk@mailman.ucar.edu</a>><br>
<span style="font-weight:bold">Reply-To: </span>Ian Harris <<a href="mailto:i.harris@uea.ac.uk">i.harris@uea.ac.uk</a>><br>
<span style="font-weight:bold">Date: </span>Friday, 17 July 2020 at 23:57<br>
<span style="font-weight:bold">To: </span>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 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 Rick,</div>
<div><br>
</div>
<div>Nice suggestion, sadly no difference.</div>
<div><br>
</div>
<div>One of the reasons I went for a manual ncl install (“You have chosen Slow and Painful”) was in case I could mod WRAPIT to recognise Includes (or even just hard code NetCDF into it). I haven’t attempted that
<span style="font-weight: bold;">yet</span>..</div>
<div><br>
</div>
<div>Cheers</div>
<div><br>
</div>
<div>Harry</div>
<div><br>
</div>
<div><br>
</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">
<span style="font-weight:bold">From: </span>Rick Brownrigg <<a href="mailto:brownrig@ucar.edu">brownrig@ucar.edu</a>><br>
<span style="font-weight:bold">Date: </span>Friday, 17 July 2020 at 18:41<br>
<span style="font-weight:bold">To: </span>Ian Harris <<a href="mailto:i.harris@uea.ac.uk">i.harris@uea.ac.uk</a>><br>
<span style="font-weight:bold">Cc: </span>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>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">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_4122559872299673996appendonsend"></div>
<hr style="display:inline-block;width:98%">
<div id="gmail-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%7C211102872dc14150611308d82aa4d6c0%7Cc65f8795ba3d43518a070865e5d8f090%7C0%7C0%7C637306234773303227&sdata=fbUmdThTM7lcAJkKSPQFChudUlfhnPf3Q1yUNKLv3y8%3D&reserved=0" originalsrc="https://mailman.ucar.edu/mailman/listinfo/ncl-talk" shash="rDRsOnmXm4pLvhXFdFXQZFiSvv3liP64NZjnF1VGLMWBeOAXSjGIaDjxbE5GZJ/iPQlIeLaO8AOYdCxMj+kGS/2eTNykSDK4LNvSIkL3rGKupQI+SbrrpaKD7HNIb9jAOVaEKI/oGwviyM1klwwx6G2OR1kWtjzGcWEww9h/rl4=" 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%7C211102872dc14150611308d82aa4d6c0%7Cc65f8795ba3d43518a070865e5d8f090%7C0%7C0%7C637306234773313217&sdata=kx1POU0lvUBmTW5NNtQ7IQCzhTWbS%2Btn5s58MXhT6po%3D&reserved=0" originalsrc="https://mailman.ucar.edu/mailman/listinfo/ncl-talk" shash="v3mWDhB1Y0z4KAZRBeZVs0h9DXFuAKa7+pzPMhApdnRZHeld+3Qkntm+AZI9qlgTi5yq1V1CXx87vXewW/x94Z2yz88cYU+vzBxP8oz4BmF8QGmdFMhkUSEpHgMXiqHxM5qKLNDfdbU+uNW03e4AeuSCLddBxvS2OnwHkp1jtuQ=" rel="noreferrer" target="_blank">https://mailman.ucar.edu/mailman/listinfo/ncl-talk</a></blockquote>
</div>
</div>
</div>
</span></div>
</div>
</span>
</body>
</html>