Installing and Running Poseidon

Overview

There are 4 components to the Poseidon modeling system:

  1. Equation of State Library
  2. GEMS communication Library
  3. Poseidon model Library
  4. Supervisor program

You should build these in the order listed. You can put things in various places, but you will need to edit the Makefiles so they point to the corresponding places. Each of the libraries can be built with 32-bit or 64-bit default reals, and GEMS and Poseidon can be built for shmem, mpi or 1cpu communicators.  These choices are set in the Makefiles. You need to be sure that you use the same ones in both GEMS and Poseidon. The Equation of State Library can be made with a linear, quadratic or full equation of state. We use the full equation, which is based on Dan Wright's fit to the EOS80 equation.  


I use a directory structure like

 

The xx refers to size of default reals (32 or 64)


The GEMS makefile starts with:

#
#*--------------------------------------------------------*
#*        makefile for gems libraries                     *
#*--------------------------------------------------------*
#
# Choices for communications primitives: [1cpu,mpi,shm]
#   1cpu     - Single cpu, no messages
#   mpi      - Generic MPI (Message Passing Interface)
#   shm      - Shmem with Max Suarez' special extensions
#
# Choices for TARGET_MACHINE [cpq,ibm,nag]
#   cpq      - Compaq TrueUnix (halem at GSFC)
#   ibm      - IBM SP (blackforest, bluesky at NCAR)
#   nag      - NAG f95 (tested on MacOSX 10.2.3, should work on linux)
#
REL:=`basename $$PWD`
PRECISIONS=32 64
COMMS= 1cpu mpi
SYS= nag

In the equation of state, you have to go to the sub-directory holding the version you want. In ./wright, the Makefile allows you to choose precisions and ranges.

PRECISIONS=32 64
RANGES=red ext
SYS=nag
VERS=wright

The red choice gives Wright's fit over a reduced range of T and S, while ext gives the extended range.

In the neptune Makefile, you can make for multiple precisions and for multiple ranges of the wright equation of state.  You get only one choice for system, equation of state version and communicator.  (There is a little problem here, in that if you choose linear equation of state, there is no red or ext range, but I think that choosing either one will work.)

PRECISIONS=32 64
RANGES=red ext
SYS= ibm
EQ_ST_VER= wright
COMM= mpi

Make Troubles:

You might have troubles with make.  Here are some points:

  1. Be sure you are using gmake. (The if() logic in the Makefiles needs gmake)
  2. The biggest problem I have is getting the files pre-processed correctly.  The codes have lots of cpp #include lines and makes use of the concatenation (##) operator defined in K&R C, but which seems to have disappeared from many cpp implementations.  I attacked this problem by creating the FPP macro.  This macro is not very satisfactory, but I have made it work on the Compaq, IBM and Mac.  You can see the various choices:

On the Compaq, cpp seems to work fine:

FPP= cpp $(DEFINES)  $<  

On IBM, I tell cc to just do pre-processing.  The cc compiler seems to obey the old standards, while the cpp that I get is gnu cpp.

FPP= cc -E -P -C $(DEFINES)  $<

On the Mac, I can use the f95 compiler, but it fails to concatenate the ## dierctives, so I use brute force and shove the output through sed:

FPP= f95 -fpp -F $(DEFINES) -o - $< | sed s/\ \#\#\ //g