Building and using NetCDF with PGI Visual Fortran


I am trying to set up NetCDF to be used with my PVF installation in visual studio 2010 and am running into some issues compiling the libraries. mainly that the libraries use a configure/make system for linux, or an old msvs solution file, that only includes .vfproj files (intel visual fortran) for the fortran libraries.

I am wondering if anyone has got NetCDF and PGI Visual Fortran to play together, and if they can provide some insight as to how they achieved this.


Hi imitchell,

Sorry, but we don’t have PVF project for NetCDF. I wrote an article a few years back on porting WRF to Windows (See: which included a section on building NetCDF from the command line. Though, NetCDF has changed a lot since then, so I doubt if this process would apply to the latest version. Windows porting, including Visual Studio support, really needs to come from Unidata since they maintain the code.

For previous releases, Unidata did provide Windows binaries but don’t have one for the most current release. According to this March 30, 2012 post: “Currently we do not have precompiled binaries for Windows, but we have recently hired a developer to improve netCDF Windows support.”.

You might be able to find some older binaries around (I see a link to 4.0 Win32 binaries on their FAQ page) or contact Unidata and see what their latest status is.

Best Regards,

Thanks for the reply!

I dont really mind how old the netcdf version is as long as it runs with PVF.

Sadly neither of those enable netCDF use with PVF on my system. The old 4.0.1 from the unidata link lacks the netcdf.mod module files. So i get error code 19 when i try to compile my code, as it cannot find them, because they do not exist.

The paratools version gets a little closer. It has the module, but when PVF tries to use it: “error F0004 : Corrupt or Old Module file (Dir)…\netcdf-4.1.3\include\netcdf.mod” I get similar errors regularly when trying to use other netcdf prebuilds on other environments. however, in linux it has thusfar been trivial to just compile netcdf in that environment with the compilers i intend to use it with etc. and that solves the problem.

I will try unidata.
Thanks again,