Building interpinic tool for interpolation of land initial conditions for the CESM1.1 model

From SNIC Documentation
Jump to: navigation, search

The interpinic tool is designed to horizontally interpolate land initial conditions for the CESM1.1 model. The code can be found in the /models/lnd/clm/tools/interpinic/ folder of the CESM1.1 distribution. 'Out-of-the-box' compiling of this code on triolith unfortunately does not work and so a work-around has been developed by Qiong Zhang from INK, Stockholms Universitet.

Step 1

Replace line 251 of the Makefile.common with:

LDFLAGS += -L$(LIB_NETCDF) -lnetcdf -lnetcdff -lnetcdf_c++4

Step 2

Proceed to compile the code:

export LIB_NETCDF=/software/apps/netcdf/4.2/i1214-hdf5-1.8.9/lib
export INC_NETCDF=/software/apps/netcdf/4.2/i1214-hdf5-1.8.9/include
USER_FC=ifort USER_CC=icc gmake interpinic

At which point you will get a compile error - but do not worry. Finish the compile with:

ifort -ftz -g -fp-model precise -convert big_endian -assume byterecl -traceback -FR -O2 -c -I/software/apps/netcdf/4.2/i1214-hdf5-1.8.9/include -DOPT -DLINUX -DFORTRANUNDERSCORE -I. -I. -I/software/apps/netcdf/4.2/i1214-hdf5-1.8.9/include -I/software/apps/netcdf/4.2/i1214-hdf5-1.8.9/lib fmain.F90
ifort -o interpinic fmain.o interpinic.o shr_kind_mod.o shr_sys_mod.o shr_const_mod.o shr_log_mod.o -L/software/apps/netcdf/4.2/i1214-hdf5-1.8.9/lib -lnetcdf -lnetcdff -m64

Hopefully this completes the build of initerpinic