[MITgcm-support] netcdf

Martin Losch Martin.Losch at awi.de
Thu Dec 19 07:51:30 EST 2013


Mohammad,

please have a look at the official netcdf web-site <http://www.unidata.ucar.edu/software/netcdf/>

Ofter there are example builds that you can start from, if you cannot find any instructions for your platform.

BTW: the MITgcm also works without netcdf output. The “mds”-output (pairs of *.data and *.meta files) is an ieee big endian unblocked format and can be easily read into matlab (rdmds in utils/matlab) or python (rdmds in utils/python/MITgcmutils). In general the format is not complicated so you should be able to convince many plotting and post processing tools to read the data

Martin

On Dec 10, 2013, at 4:57 AM, mohammad akbarinasab <akbarinasabmohamad at gmail.com> wrote:

> Dear MITGCM users
> I Install mitgcm on CentOS-6.5
> How I can install NETCDF on CentOS-6.5,
> Please show me website NETCDF files
> how I can find path netcdf at CentOS-6.5?
> Where do I put the file path in opt file
> (NETCDF )?
>  
> Meanwhile opt file
> #!/bin/bash
> 
> #
> 
> # $Header: /u/gcmpack/MITgcm/tools/build_options/linux_amd64_gfortran+mpi_generic,v 1.2 2010/12/25 18:25:56 jmc Exp $
> 
> # $Name: checkpoint63 $
> 
> #
> 
> # Tested with gcc-gfortran v4.1.x on FC5, FC6, FC8, using flags
> 
> # formally for gcc-gfortran 4.3*
> 
> # + with gcc-gfortran v4.3.x on FC9, FC10
> 
> # + with gcc-gfortran v4.4.x on FC11,FC12,FC13
> 
> #
> 
> # on baudelaire.csail.mit.edu (FC13), uses:
> 
> # export MPI_GCC_DIR=/srv/software/gcc/gcc-packages/gcc-4.4.5/mpich2/mpich2-1.3
> 
> # export MPI_INC_DIR=$MPI_GCC_DIR/include
> 
> # export PATH=$MPI_GCC_DIR/bin:$PATH
> 
> #
> 
> #-------
> 
> # run with OpenMP: needs to set environment var. OMP_NUM_THREADS
> 
> # and generally, needs to increase the thread stack-size:
> 
> # - sh,bash:
> 
> # > export OMP_NUM_THREADS=2
> 
> # > export GOMP_STACKSIZE=400m
> 
> # - csh,tcsh:
> 
> # > setenv OMP_NUM_THREADS 2
> 
> # > setenv GOMP_STACKSIZE 400m
> 
> #-------
> 
> FC=${FC:=mpif77}
> 
> F90C=${F90C:=mpif90}
> 
> CC=${CC:=mpicc}
> 
> DEFINES='-DWORDLENGTH=4 -DNML_TERMINATOR'
> 
> CPP='cpp -traditional -P'
> 
> EXTENDED_SRC_FLAG='-ffixed-line-length-132'
> 
> GET_FC_VERSION="--version"
> 
> OMPFLAG='-fopenmp'
> 
> NOOPTFLAGS='-O0'
> 
> MPI='true'
> 
> INCLUDEDIRS='/usr/local/include'
> 
> LIBDIRS='/usr/local/lib/'
> 
> if test "x$DEVEL" != x ; then
> 
> FFLAGS='-g -Wall -W -ffpe-trap=invalid,zero,overflow -fbounds-check'
> 
> else
> 
> FFLAGS=''
> 
> fi
> 
> # Requires gfortran from 2006 onwards for -fconvert=big-endian
> 
> FFLAGS="$FFLAGS -fconvert=big-endian -fimplicit-none"
> 
> # for big objects:
> 
> FFLAGS="$FFLAGS -fPIC"
> 
> if test "x$IEEE" = x ; then
> 
> # No need for IEEE-754
> 
> FOPTIM='-O3 -funroll-loops'
> 
> CFLAGS="$FOPTIM -fPIC"
> 
> else
> 
> # Try to follow IEEE-754
> 
> FFLAGS="$FFLAGS -Waliasing -Wampersand -Wsurprising -Wline-truncation"
> 
> FOPTIM='-O0'
> 
> CFLAGS="$FOPTIM -fPIC"
> 
> # to get plenty of warnings :
> 
> # FFLAGS="$FFLAGS -Wconversion -Wimplicit-interface -Wunused-labels"
> 
> # more checking (to use with testreport, put DEVEL option in IEEE section):
> 
> # FOPTIM="$FOPTIM -g -ffpe-trap=invalid,zero,overflow -fbounds-check"
> 
> fi
> 
> F90FLAGS=$FFLAGS
> 
> F90OPTIM=$FOPTIM
> 
> if [ "x$NETCDF_ROOT" != x ] ; then
> 
> INCLUDEDIR="${NETCDF_ROOT}/include"
> 
> INCLUDES="-I${NETCDF_ROOT}/include"
> 
> LIBDIR="${NETCDF_ROOT}/lib"
> 
> LIBS="-L${NETCDF_ROOT}/lib"
> 
> elif [ "x$NETCDF_HOME" != x ]; then
> 
> INCLUDEDIR="${NETCDF_HOME}/include"
> 
> INCLUDES="-I${NETCDF_HOME}/include"
> 
> LIBDIR="${NETCDF_HOME}/lib"
> 
> LIBS="-L${NETCDF_HOME}/lib"
> 
> elif [ "x$NETCDF_INC" != x -a "x$NETCDF_LIB" != x ]; then
> 
> NETCDF_INC=`echo $NETCDF_INC | sed 's/-I//g'`
> 
> NETCDF_LIB=`echo $NETCDF_LIB | sed 's/-L//g'`
> 
> INCLUDEDIR="${NETCDF_INC}"
> 
> INCLUDES="-I${NETCDF_INC}"
> 
> LIBDIR="${NETCDF_LIB}"
> 
> LIBS="-L${NETCDF_LIB}"
> 
> elif [ "x$NETCDF_INCDIR" != x -a "x$NETCDF_LIBDIR" != x ]; then
> 
> INCLUDEDIR="${NETCDF_INCDIR}"
> 
> INCLUDES="-I${NETCDF_INCDIR}"
> 
> LIBDIR="${NETCDF_LIBDIR}"
> 
> LIBS="-L${NETCDF_LIBDIR}"
> 
> elif test -d /usr/include/netcdf-3 ; then
> 
> INCLUDES='-I/usr/include/netcdf-3'
> 
> LIBS='-L/usr/lib/netcdf-3 -L/usr/lib64/netcdf-3'
> 
> elif test -d /usr/local/netcdf ; then
> 
> INCLUDES='-I/usr/local/netcdf'
> 
> elif test -d /usr/local/netcdf ; then
> 
> INCLUDES='-I/usr/local/netcdf/include'
> 
> LIBS='-L/usr/local/netcdf/lib'
> 
> elif test -d /usr/local/include/netcdf.inc ; then
> 
> INCLUDES='-I/usr/local/include'
> 
> LIBS='-L/usr/local/lib64'
> 
> fi
> 
> MPI_HEADER_FILES='mpif.h mpif-mpi-io.h'
> 
> MPI_HEADER_FILES_INC='/usr/local/include/mpif.h /usr/local/include/mpif-mpi-io.h'
> 
> _______________________________________________
> MITgcm-support mailing list
> MITgcm-support at mitgcm.org
> http://mitgcm.org/mailman/listinfo/mitgcm-support




More information about the MITgcm-support mailing list