Netcdf for pgf90

Hello,

I am trying to get netcdf working with PGI Workstations 6.2-5 (32-bit) on a Windows XP machine. I have tried using various pre-built binaries but have not had any luck. When I try to compile the error message that I get is: 0004- Unable to open MODULE file netcdf.mod. Since the module definition file is compiler dependent, it appears that I will have to build this. I guess I have several questions:

  1. Do I have to build an entire netcdf library or can I use a pre-built dll and build only the .mod file?

  2. Assuming that I only need to build the .mod file, how do I do this using PGI workstation? I found some instructions for Compaq Visual Fortran but these were not very helpful.

If there is anyone who has had experience working with netcdf and pgf90 who can help me out on this process it would be greatly appreciated.

Cheers,

Nathaniel

Hi Nathaniel,

  1. I do not think you need to build .mod files to use prebuilt DLL.
    Did you include netcdf.inc in your program or source files where you call netcdf routines?

For more information, look in README_DLL.txt.

  1. From information from,
    http://www.unidata.ucar.edu/software/netcdf/docs/faq.html#win

There is no support for F90 on windows yet. Let me know if the 1) does not work. If you really need to build, I will look around how to build it on windows.

Hongyon

Thanks for the help. In the source file that I am compiling the call is “use netcdf” I have some older code which I can compile which uses “include ntcdf.inc”. I checked with the author of the newer code and he said that I cannot simply change the call from “use netcdf” to “include netcdf.inc”. He also said that the “include netcdf.inc” is the older way to envoke F77 and that for F90, I will need to find the mod file.

Let me know what you think.

Cheers,

Nathaniel

Hi Nathaniel,

I assume you want to build on win32? There is a workaround to build it. I am passing the information to our application engineer who is familiar with it and let you know when I get more information.

Hongyon

Yes. Your assumption is correct. I am trying to build on win32. Any new from the application engineer? I would love to try to figure this out.

Thanks for all your help.

Nathaniel

Hi Nathaniel,

I have not heard back yet. Do you use SFU on window? If you do, you can build it there just like you do on Linux.

Hongyon

Nathaniel,

If you do not SUA or SFU,

Here is what I do: I configure everything on linux using PGI 32-bit compilers and then compile and keep log files.

Then I copy the whole directory to win32 machine. You can map to network drive if you do not want to copy.

I look at log file for command lines to compile typeSize.f90 and netcdf.f90. Go to f90 directory and remove *.o and *.mod and then run commands in f90 directory to create mod files.

This is to create .mod files only. Also you will need to make sure you use the correct version of compilers that they user to compile DLL. Modules may not be compatible with older release.

To create the whole libraries, you will need to invoke from command lines or create your own Makefile by looking at linux log files.

Hope this helps.
Hongyon