Plotting Package Installation

From WikiROMS
Revision as of 23:12, 14 January 2008 by Robertson (talk | contribs) (New page: <div class="title">Installing the ROMS/TOMS Plotting Package</div>__NOTOC__ The ROMS/TOMS Plotting package is a collection of Fortran programs for visualizing ROMS model output. It can be ...)
(change visibility) (diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search
Installing the ROMS/TOMS Plotting Package

The ROMS/TOMS Plotting package is a collection of Fortran programs for visualizing ROMS model output. It can be used to create publication quality, vector graphics. Two shell scripts (ncgm2gif and ncgm2www) are provided to facilitate raster images and animations.


Table of Contents
1. Installation
2. Contour Plots
3. Cross-section Plots
4. Internal Plotting Parameters
5. Plotting Options
6. Plotting Fields
7. Raster Scripts


Required Software

Download

The ROMS/TOMS Plotting Package is distributed via an SVN repository. For more information about SVN and ROMS read the Subversion page. To 'checkout' the plotting package source code issue the subversion command:

   svn checkout https://www.myroms.org/svn/src/plot MyDir

If your user name on your local machine is not the same as your ROMS user name you may need to add the --username option.

   svn checkout --username joeroms https://www.myroms.org/svn/src/plot MyDir

Build

Be sure that your NCARG_ROOT environment variable is set to the directory where NCAR Graphics (or NCL) is installed. Once you have the source code downloaded, move into the src directory:

  cd Mydir/src

makefile

You should check the user-defined options section of the makefile and edit the macro variables as needed. Below you will find a short description of each macro variable in each section.

  PLT_DEBUG ?=

If set, this option will set the proper debugging compiler flag. This option is mostly used by developers and will add a 'G' to the resulting executable names (ccntG, cntG, csecG, and secG) so they will not replace the standard executables.

  PLT_LARGE ?=

If set, this option will activate 64-bit compilation. Use this flag if you downloaded or compiled NCAR Graphics in 64-bit mode.

  FORT ?= g77

This macro must be set to the name of your compiler. This macro tells make what compiler file to include. To see what options are available look in the Compilers directory. The files are named <OS>-<compiler>.mk so the Linux-g77.mk file is for compiling on Linux using the g77 Fortran compiler (make will automatically detect your operating system). If your OS/compiler combination is not there you can create your own. The <OS> portion of the filename is derived from the result of the uname -s command and the <compiler> portion will be whatever you set FORT to.

If you downloaded a binary distribution of NCL you will need to use the same compiler that was used to make that NCL build. For Example, if you installed the 64-bit binary for x86_64 chips for Linux compiled with gcc 3.x you would want to use the gcc 3.x g77 compiler. If you built NCL from source you should use the same compiler and flags to build the ROMS Plotting Package.

  NCAR_VERSION ?= NCARG441

You should only have to modify this option if you have a very old version of NCAR Graphics installed. For the Current 5.0.0 release of NCL leave this macro variable set to 'NCARG441'. This option changes the way calls to the NCARG libraries are made.

  PLT_BINDIR ?= $(HOME)/bin

Set this option to the path where you want the plotting executables (ccnt, cnt, csec, and sec) to be installed.

Machine Dependent Include File

Next you should check the paths and options of the machine dependent include file you chose with the FORT macro variable in the makefile. In particular you should check that LD points to the correct ncargf90 and that NETCDF_INCDIR and NETCDF_INCDIR are set correctly. It is important that your NetCDF libraries are compatible with your NCL install. The most common compatibility issue is the infamous second underscore problem. A simple google search will tell you more than you wish to know on this subject as will a search in the ROMS forum. The binary distributions of NCL 5.0.0 appear to have been built with the -fno-second-underscore compiler option set where applicable.

The last thing to check is FFLAGS. You may have to experiment with these to get the ROMS Plotting Package to compile. For example, if you installed the 64-bit binary for x86_64 chips for Linux compiled with gcc 3.x you would would want to add -fno-second_underscore to FFLAGS in the Linux-g77.mk file.

NOTE: If you are running ROMS it is likely that your NetCDF library is already built with single underscores at the end of symbol names.

Compiling

Make sure you are in the src directory and issue the make command. If the process is successful you will have ccnt, cnt, csec, and sec executables in your PLT_BINDIR directory. At this time cnt and sec do not work properly but it is unlikely that you would wish to use them as they are the grayscale versions of ccnt and csec respectively.

Next: Contour Plots