[ncl-talk] Using NetCDF with WRAPIT

Ian Harris (ENV - Staff) I.Harris at uea.ac.uk
Sat Jul 18 18:20:07 MDT 2020


Hi Dennis,

I can! See attached screen shots from iStat Menus. Nothing running apart from Terminal, only process on that is ncl.

Cheers

Harry

[cid:C9292F5A-DB14-46CE-8A06-A419F7220414]
[cid:0EC04580-4DC4-46E5-A2B8-07033C3A2CCA]From: Dennis Shea <shea at ucar.edu<mailto:shea at ucar.edu>>
Date: Friday, 17 July 2020 at 18:49
To: Rick Brownrigg <brownrig at ucar.edu<mailto:brownrig at ucar.edu>>
Cc: Ian Harris <i.harris at uea.ac.uk<mailto:i.harris at uea.ac.uk>>, ncl-talk <ncl-talk at mailman.ucar.edu<mailto:ncl-talk at mailman.ucar.edu>>
Subject: Re: [ncl-talk] Using NetCDF with WRAPIT

re: " ... there seems to be a memory leak in addfile()."

Can you please provide an example?

THX

On Fri, Jul 17, 2020 at 11:42 AM Rick Brownrigg via ncl-talk <ncl-talk at mailman.ucar.edu<mailto:ncl-talk at mailman.ucar.edu>> wrote:
Hi Harry,

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).

I presume you are using gfortran?  It manual states: "The gfortran compiler currently does not make use of any environment variables to control its operation above and beyond those that affect the operation of gcc"

With that, you might try setting CPATH:

export CPATH=/usr/local/include

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.

Wish I had a better answer...
Rick


On Fri, Jul 17, 2020 at 10:32 AM Ian Harris (ENV - Staff) via ncl-talk <ncl-talk at mailman.ucar.edu<mailto:ncl-talk at mailman.ucar.edu>> wrote:
Hi Rick,

WRAPIT Version: 120209
A syntax error occurred while parsing: include
COMPILING /Users/ianharris/Programs/Fortran/forverify3.for
/Users/ianharris/Programs/Fortran/forverify3.for:443: Error: Can't open included file 'netcdf.inc'
LINKING
gcc: error: forverify3.o: No such file or directory
rm: forverify3.o: No such file or directory
END WRAPIT

This is the gfortran equivalent that works:

% gfortran -m64 -I/usr/local/include/ -L/usr/local/lib -lnetcdf /usr/local/lib/libnetcdff.a ~/Programs/Fortran/forverify3.for
also, new tree from macports:
% gfortran -m64 -I/opt/local/include/ -L/opt/local/lib -lnetcdf /opt/local/lib/libnetcdff.a ~/Programs/Fortran/forverify3.for

Now WRAPIT doesn't like Includes, and you have to put spaces after the -L and -l linkages, but:

% WRAPIT -m64 -L /opt/local/lib -l netcdf /opt/local/lib/libnetcdff.a ~/Programs/Fortran/forverify3.for

WRAPIT Version: 120209
A syntax error occurred while parsing: include
COMPILING /Users/ianharris/Programs/Fortran/forverify3.for
/Users/ianharris/Programs/Fortran/forverify3.for:442: Error: Can't open included file 'netcdf.inc'
LINKING
gcc: error: forverify3.o: No such file or directory
rm: forverify3.o: No such file or directory
END WRAPIT

Cheers

Harry
________________________________
From: Rick Brownrigg <brownrig at ucar.edu<mailto:brownrig at ucar.edu>>
Sent: 17 July 2020 17:15
To: Ian Harris (ENV - Staff) <I.Harris at uea.ac.uk<mailto:I.Harris at uea.ac.uk>>
Cc: Dennis Shea via ncl-talk <ncl-talk at mailman.ucar.edu<mailto:ncl-talk at mailman.ucar.edu>>
Subject: Re: [ncl-talk] Using NetCDF with WRAPIT


Warning: 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.

Hi,

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?

Rick

On Fri, Jul 17, 2020 at 10:03 AM Ian Harris (ENV - Staff) via ncl-talk <ncl-talk at mailman.ucar.edu<mailto:ncl-talk at mailman.ucar.edu>> wrote:
Hi,

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.

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?

Here are a couple examples that don't work:

WRAPIT  -L/usr/local/lib -l netcdf -L /usr/local /usr/local/lib/libnetcdff.a /usr/local/lib/libnetcdf.a   ~/Programs/Fortran/forverify3.for
WRAPIT -L /opt/local/lib -l netcdf -L /opt/local -l libnetcdff.a ~/Programs/Fortran/forverify3.for

..I just chose two from dozens.

Is it actually *possible* to have a NetCDF-aware Fortran subroutine under WRAPIT?

Cheers

Harry
_______________________________________________
ncl-talk mailing list
ncl-talk at mailman.ucar.edu<mailto:ncl-talk at mailman.ucar.edu>
List instructions, subscriber options, unsubscribe:
https://mailman.ucar.edu/mailman/listinfo/ncl-talk<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>
_______________________________________________
ncl-talk mailing list
ncl-talk at mailman.ucar.edu<mailto:ncl-talk at mailman.ucar.edu>
List instructions, subscriber options, unsubscribe:
https://mailman.ucar.edu/mailman/listinfo/ncl-talk<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>
_______________________________________________
ncl-talk mailing list
ncl-talk at mailman.ucar.edu<mailto:ncl-talk at mailman.ucar.edu>
List instructions, subscriber options, unsubscribe:
https://mailman.ucar.edu/mailman/listinfo/ncl-talk<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>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.ucar.edu/pipermail/ncl-talk/attachments/20200719/78a38acb/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Screen Shot 2020-07-13 at 13.39.55 1986 history.png
Type: image/png
Size: 138983 bytes
Desc: Screen Shot 2020-07-13 at 13.39.55 1986 history.png
URL: <https://mailman.ucar.edu/pipermail/ncl-talk/attachments/20200719/78a38acb/attachment-0002.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ncl_memory_hog.png
Type: image/png
Size: 130539 bytes
Desc: ncl_memory_hog.png
URL: <https://mailman.ucar.edu/pipermail/ncl-talk/attachments/20200719/78a38acb/attachment-0003.png>


More information about the ncl-talk mailing list