About CVMix / How to Download
The Community Vertical Mixing Project (CVMix) is a portable vertical mixing software package providing an extensible framework for the development of first-order closures. It can be downloaded via the links at the left or cloned directly from github:
$ git clone git@github.com:CVMix/CVMix-src.git
The scientific description of the project and data needed for some of the stand-alone test cases provided are available from the CVMix project page on github.
How to Build
CVMix offers two options for building:The primary goal of the model is to provide a selection of vertical mixing libraries for use in ocean general circulation models (OGCMs). This only requires building libcvmix.a, which can be done by running
make
in thesrc/shared/
directory. When you runmake
, you must pass the name of the compiler to use via the$(FC)
variable to theMakefile
; you can also pass compiler flags in the$(FCFLAGS)
variable. Further, you can specify four directories (default value of each is the current directory):SRC_DIR
-- directory containing the mixing modules (src/shared/
)OBJ_DIR
-- directory to store.o
and.mod
files when compiling.INC_DIR
-- directory to store.mod
files. When you compile your OGCM, you want to compile your model with the-I$(INC_DIR)
option. This directory can be the same as$(OBJ_DIR)
.LIB_DIR
-- directory to storelibcvmix.a
file. When you compile your OGCM, you want to link your model with the-L$(LIB_DIR) -lcvmix
flag.
For example, in CESM the POP ocean model build is launched from a c-shell script that reads in CESM environment variables; the CVMix library is built by running
gmake -f $CODEROOT/ocn/pop2/source/cvmix/Makefile \ SRC_DIR=$CODEROOT/ocn/pop2/source/cvmix \ FC=$FC FCFLAGS="$FFLAGS $FREEFLAGS" \ LIB_DIR=$LIBROOT
where
$CODEROOT/ocn/pop2/source/cvmix
is a copy of thesrc/shared/
directory of the CVMix repository.CVMix also provides a stand-alone mode to test the library on new machines and to aid in development. There is a simple I/O routine that can be compiled with or without netCDF support and some NCL scripts to produce plots for comparison. Developers wishing to add a mixing module to the library must also provide a stand-alone driver for regression testing.
The executable for the stand-alone driver is
bin/cvmix
, which can be built by runningmake
from thesrc/
directory. The first time you try to build the driver, you will be prompted to enter your compiler (there is no parallel code at this time, so a serial compiler is fine) and the location of netcdf (which is only used if you build thenetcdf
target). At this time, the following compilers are supported:gfortran
pgf90
ifort
xlf90
nagfor
pathf95
ftn
, provided the environment variablePE_ENV
is one of the following:GNU
,PGI
,INTEL
,PATHSCALE
, orCRAY
.
Given one of the above compilers, the compiler flags will be set as specified in
bld/CompileFlags.mak
. The supported compilers put object and module files inbld/obj
and build at theO2
optimization level. The GNU and Intel compilers will also exit on warnings.
How to Run the Stand-alone Driver
Authors and Contributors
This project is a collaboration driven mainly by the Geophysical Fluid Dynamics Laboratory, Los Alamos National Laboratory, and the National Center for Atmospheric Research. The main contributors are Stephen Griffies, Alistair Adcroft, and Robert Hallberg from GFDL; Todd Ringler and Douglas Jacobsen from LANL; Gokhan Danabasoglu, William Large, and Michael Levy from NCAR.