makefile of the latest ROMS

General scientific issues regarding ROMS

Moderators: arango, robertson

Post Reply
Message
Author
azhang
Posts: 21
Joined: Fri May 11, 2007 12:49 pm
Location: CSDL/NOS/NOAA

makefile of the latest ROMS

#1 Unread post by azhang »

Hi, everyone,

I recently downloaded the latest version of ROMS 3.0, I found that there are two netcdf related files (netcdf.mod and typesize.mod) required. these two files weren't required by the version back to June 1, 2007. I wonder where to get these two files, and what's the purpose? For my opinion, I do not think it is a good idea to require more system files in the makefile since regular users of the supercomputer cannot easily add or install such files. It would be better to keep makefile to be more compatable to operating systems.
Can I compile ROMS without netcdf.mod and typesize.mod?
Thanks a lot

User avatar
cvl
Posts: 18
Joined: Tue Jun 03, 2003 7:39 pm

Installing NetCDF in userspace

#2 Unread post by cvl »

Most recent and complete builds of NetCDF should include a netcdf.mod. Wherever you used to look for netcdf.h, check for netcdf.mod. Or, look for libnetcdf.a, then cd ../include and look there. I'm unfamiliar with typesize.mod, but none of my builds have yet required it; it looks like it may be a UNICOS specific module; hopefully a UNICOS NetCDF build will generate it?

If there is no netcdf.mod there, you can typically build netcdf in your home directory without administrative privileges. Download the latest (I'd recommend the 3.6 series right now, I haven't had the guts to try 4+) netcdf source from:

http://www.unidata.ucar.edu/downloads/netcdf (user registration may be required)

Depending on your system, you may need to read the hints here:

http://www.unidata.ucar.edu/software/ne ... f-install/

Relevant environment variables you might need to set are:
  • CC - your C compiler (probably gcc)
    FC - your fortran compiler (probably f90, ifc, pgf90, g95, or similar)
    F90 - likely the same as FC, this may be redundant now
    FFLAGS - compiler specific fortran flags
    CFLAGS - compiler specific C flags
If you run into problems pay special attention to the "Platform Specific Notes". However, the one critical step in this is to make sure the build points to a directory for which you have write access:

Code: Select all

./configure --prefix=/home/azhang/netcdf
then

Code: Select all

make
make install
Where /home/azhang is your home directory, and ~/netcdf is the directory into which you want the lib/ and include/ directories installed.

Then you just alter your platform-specific ROMS makefiles to point the NETCDF_* variables to /home/azhang/netcdf/[lib,include].

Good Luck :twisted: ,
CVL

azhang
Posts: 21
Joined: Fri May 11, 2007 12:49 pm
Location: CSDL/NOS/NOAA

#3 Unread post by azhang »

Thanks a lot. I found netcdf.mod file in the system, and I copied the typesize.mod of my linux system to the NCEP's IBM system, so compiling is fine now.
Thanks again.

User avatar
cvl
Posts: 18
Joined: Tue Jun 03, 2003 7:39 pm

#4 Unread post by cvl »

Should anyone follow this, I was wrong about this:
it looks like it may be a UNICOS specific module; hopefully a UNICOS NetCDF build will generate it?
I did a lazy find and forget to look for typesizes.mod. typesizes.mod looks to be standard. Oh well, the NetCDF build info is still loosely correct for those interested.

User avatar
kate
Posts: 4091
Joined: Wed Jul 02, 2003 5:29 pm
Location: CFOS/UAF, USA

#5 Unread post by kate »

azhang wrote:I found netcdf.mod file in the system, and I copied the typesize.mod of my linux system to the NCEP's IBM system, so compiling is fine now.
Thanks again.
This is a dangerous practice and not likely to work if you truly need the typesize.mod file. The .mod files are specific to both your machine and your compiler, perhaps even your compiler version or options. Don't expect to be able to take it from one system to another.

Post Reply