Scheduled Downtime
On Tuesday 24 October 2023 @ 5pm MT the forums will be in read only mode in preparation for the downtime. On Wednesday 25 October 2023 @ 5am MT, this website will be down for maintenance and expected to return online later in the morning.
Normal Operations
The forums are back online with normal operations. If you notice any issues or errors related to the forums, please reach out to help@ucar.edu

CESM 1_2_0 porting issue in building csm_share with mpif90

Dear All,

I'm porting CESM_1_2_0 to a server.
There’s an error occurred during building the model:

-------------------------------------------------------------------------
CESM BUILDEXE SCRIPT STARTING
COMPILER is intel
- Build Libraries: mct gptl pio csm_share
Tue Aug 20 15:46:53 EDT 2013 /scratch/wang/run0/bld//mct/mct.bldlog.130820-154648
Tue Aug 20 15:47:41 EDT 2013 /scratch/wang/run0/bld//gptl/gptl.bldlog.130820-154648
Tue Aug 20 15:47:44 EDT 2013 /scratch/wang/run0/bld//pio/pio.bldlog.130820-154648
Tue Aug 20 15:48:40 EDT 2013 /scratch/wang/run0/bld//csm_share/csm_share.bldlog.130820-154648
ERROR: buildlib.csm_share failed, see /scratch/wang/run0/bld//csm_share/csm_share.bldlog.130820-154648
ERROR: cat /scratch/wang/run0/bld//csm_share/csm_share.bldlog.130820-154648
-------------------------------------------------------------------------

I checked csm_share.bldlog.130820-154648 and found the errors below:

-------------------------------------------------------------------------

mpif90 -c -I. -I/scratch/wang/run0/bld//pio -I/opt/netcdf/4.2/intel/11.1.064/include -I/opt/openmpi/1.4/intel/11.1.064//include -I/scratch/wang/run0/bld//mct/mct -I/scratch/wang/run0/bld//mct/mpeu -I/scratch/wang/run0/bld//pio -I/scratch/wang/run0/bld//gptl -I/homes/wang/cesm1_2_0/models/utils/pio -I/scratch/wang/run0/bld//lib/include -I. -I/homes/wang/cesm1_2_0/scripts/run0/SourceMods/src.share -I/homes/wang/cesm1_2_0/models/drv/shr_mct -I/homes/wang/cesm1_2_0/models/drv/shr -I/homes/wang/cesm1_2_0/models/dead_share -I/homes/wang/cesm1_2_0/models/csm_share/shr -I/homes/wang/cesm1_2_0/models/utils/esmf_wrf_timemgr -I/scratch/wang/run0/bld//lib/include -O2 -fp-model source -convert big_endian -assume byterecl -ftz -traceback -DNUM_COMP_INST_ATM=1 -DNUM_COMP_INST_LND=1 -DNUM_COMP_INST_OCN=1 -DNUM_COMP_INST_ICE=1 -DNUM_COMP_INST_GLC=1 -DNUM_COMP_INST_WAV=1 -DNUM_COMP_INST_ROF=1 -DLINUX -DMCT_INTERFACE -DHAVE_MPI -DFORTRANUNDERSCORE -DNO_R16 -DLINUX -DCPRINTEL -DHAVE_SLASHPROC -free /homes/wang/cesm1_2_0/models/csm_share/shr/shr_spfn_mod.F90
/homes/wang/cesm1_2_0/models/csm_share/shr/shr_spfn_mod.F90(304): error #6407: This symbolic name is not an intrinsic function name or an intrinsic subroutine name. [ERFC_SCALED]
intrinsic erfc_scaled
------------^
/homes/wang/cesm1_2_0/models/csm_share/shr/shr_spfn_mod.F90(319): error #6407: This symbolic name is not an intrinsic function name or an intrinsic subroutine name. [ERFC_SCALED]
intrinsic erfc_scaled
------------^
/homes/wang/cesm1_2_0/models/csm_share/shr/shr_spfn_mod.F90(334): error #6407: This symbolic name is not an intrinsic function name or an intrinsic subroutine name. [GAMMA]
intrinsic gamma
------------^
/homes/wang/cesm1_2_0/models/csm_share/shr/shr_spfn_mod.F90(335): error #7137: Any procedure referenced in a PURE procedure, including one referenced via a defined operation or assignmnent, must be explicitly declared PURE. [GAMMA]
res = gamma(x)
--------^
compilation aborted for /homes/wang/cesm1_2_0/models/csm_share/shr/shr_spfn_mod.F90 (code 1)
gmake: *** [shr_spfn_mod.o] Error 1
gmake complib -j 1 MODEL=csm_share COMPLIB=libcsm_share.a USER_CPPDEFS=" -DNUM_COMP_INST_ATM=1 -DNUM_COMP_INST_LND=1 -DNUM_COMP_INST_OCN=1 -DNUM_COMP_INST_ICE=1 -DNUM_COMP_INST_GLC=1 -DNUM_COMP_INST_WAV=1 -DNUM_COMP_INST_ROF=1" -f /homes/wang/cesm1_2_0/scripts/run0/Tools/Makefile returned non-zero exit status 2
-------------------------------------------------------------------------

Below is the Macros file:

-------------------------------------------------------------------------
CFLAGS:= -O2 -fp-model precise

CONFIG_ARGS:=

CXX_LDFLAGS:= -cxxlib

CXX_LINKER:=FORTRAN

ESMF_LIBDIR:=

FC_AUTO_R8:= -r8

FFLAGS:= -O2 -fp-model source -convert big_endian -assume byterecl -ftz -traceback

FFLAGS_NOOPT:= -O0

FIXEDFLAGS:= -fixed -132

FREEFLAGS:= -free

MPICC:= mpicc

MPICXX:= mpicxx

MPIFC:= mpif90

MPI_LIB_NAME:= openmpi

MPI_PATH:= /opt/openmpi/1.4/intel/11.1.064/

NETCDF_PATH:= /opt/netcdf/4.2/intel/11.1.064

PNETCDF_PATH:=

SCC:= icc

SCXX:= icpc

SFC:= ifort

SUPPORTS_CXX:=TRUE

ifeq ($(DEBUG), TRUE)
FFLAGS += -g -CU -check pointers -fpe0
endif

ifeq ($(compile_threaded), true)
LDFLAGS += -openmp
CFLAGS += -openmp
FFLAGS += -openmp
Endif
-------------------------------------------------------------------------

The env_mach_specific file:

-------------------------------------------------------------------------

#! /bin/csh -f

source /opt/Modules/3.2.5/init/csh

#module purge
module load intel/11.1.064
module load openmpi/1.4/intel/11.1.064
module load hdf5/1.8.7/intel/11.1.064
module load netcdf/4.1.3/intel/11.1.064
module load grads/2.0
module load mkl/10.0.1.014

setenv NCARG_ROOT /homes/colfescu/ncl6
setenv PATH /homes/colfescu/ncl6/bin:$PATH
setenv PATH ${PATH}:.
-------------------------------------------------------------------------

It looks like I should use ifort to compile .f90 instead of using mpif90,
but I'm not sure, nor know how to change it.

Will you please help?

Thank you,
Zaiyu
 

jedwards

CSEG and Liaisons
Staff member
Your intel compiler level is pretty old.  These features are supported in newer versions of the compiler.  
 
Top