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

I get a problem in compiling CAM3 :(

Hi everyone:
when I compile CAM3 I get a message told that there is a error:
The error information is:
/export/home/songjie/cams/cam3/cam1/models/atm/cam/bld/mkSrcfiles > /export/home/songjie/cams/cam3/test3/bld/Srcfiles
/export/home/songjie/cams/cam3/cam1/models/atm/cam/bld/mkDepends Filepath Srcfiles > /export/home/songjie/cams/cam3/test3/bld/Depends
/export/home/songjie/rams/mpich/bin/mpif90 -c /export/home/songjie/cams/cam3/cam1/models/lnd/clm2/src/main/clm_varpar.F90
No Fortran 90 compiler specified when mpif90 was created,
or configuration file does not specify a compiler.

For a better help I post my runcam3.csh script:

#! /bin/tcsh -f

#-----------------------------------------------------------------------
## PC-linux
##------------

## nthreads is the number of Open-MP threads. On the PC we assume a
## pure shared-memory configuration which assigns 1 thread per processor.
#set nthreads = 2

## Do our best to get sufficient stack memory
limit stacksize unlimited

## SET NETCDF PATHNAME
setenv LIB_NETCDF /export/home/songjie/netcdf/lib
setenv INC_NETCDF /export/home/songjie/netcdf/include


## SET MPI PATHNAME
setenv INC_MPI /export/home/songjie/rams/mpich/include
setenv LIB_MPI /export/home/songjie/rams/mpich/lib


setenv USER_FC /export/home/songjie/rams/mpich/bin/mpif90
#setenv USER_CC /export/pgi/linux86/bin/pgcc
setenv USER_CC /usr/bin/cc
setenv ESMF_ROOT '/export/home/songjie/cams/cam3/cam1/models/utils/esmf'

## ROOT OF CAM DISTRIBUTION - probably needs to be customized.
## Contains the source code for the CAM distribution.
## (the root directory contains the subdirectory "models"
set camroot = /export/home/songjie/cams/cam3/cam1

## ROOT OF CAM DATA DISTRIBUTION - needs to be customized unless running at NCAR.
## Contains the initial and boundary data for the CAM distribution.
## (the root directory contains the subdirectories "atm" and "lnd")
setenv CSMDATA /export/home/songjie/cams/cam3/csmdata

## Default namelist settings:
## $case is the case identifier for this run. It will be placed in the namelist.
## $runtype is the run type: initial, restart, or branch.
## $nelapse is the number of timesteps to integrate, or number of days if negative.
set case = test3
set runtype = initial
set nelapse = -720

## $wrkdir is a working directory where the model will be built and run.
## $blddir is the directory where model will be compiled.
## $rundir is the directory where the model will be run.
## $cfgdir is the directory containing the CAM configuration scripts.
set wrkdir = /export/home/songjie/cams/cam3
set blddir = $wrkdir/$case/bld
set rundir = $wrkdir/$case
set cfgdir = $camroot/models/atm/cam/bld

## Ensure that run and build directories exist
mkdir -p $rundir || echo "cannot create $rundir" && exit 1
mkdir -p $blddir || echo "cannot create $blddir" && exit 1

## If an executable doesn't exist, build one.
if ( ! -x $blddir/cam ) then
cd $blddir || echo "cd $blddir failed" && exit 1
$cfgdir/configure -spmd || echo "configure failed" && exit 1
echo "building CAM in $blddir ..."
rm -f Depends
gmake -j2 >&! MAKE.out
# || echo "CAM build failed: see $blddir/MAKE.out" && exit 1
endif

## Create the namelist
cd $blddir || echo "cd $blddir failed" && exit 1
$cfgdir/build-namelist -s -case $case -runtype $runtype -o $rundir/namelist -infile $rundir/namelist_input
|| echo "build-namelist failed" && exit 1

## Run CAM
cd $rundir || echo "cd $rundir failed" && exit 1
echo "running CAM in $rundir"
#env OMP_NUM_TASKS=$nthreads MPSTKZ="128M"
ln -s $blddir/cam .
bsub -n 4 -i /export/home/songjie/cams/cam3/$case/namelist mpijob cam || echo "CAM run failed" && exit 1
exit

Can anyone help me ?
 
I have change the runcams.csh script:
setenv INC_MPI /export/mpi/mpich-pgi/include
setenv LIB_MPI /export/mpi/mpich-pgi/lib
setenv USER_FC /export/mpi/mpich-pgi/bin/mpif90

and I get a different error message as follow:'Can't find include file misc.h '


creating /export/home/songjie/cams/cam3/test3/bld/Filepath
creating /export/home/songjie/cams/cam3/test3/bld/params.h
creating /export/home/songjie/cams/cam3/test3/bld/misc.h
creating /export/home/songjie/cams/cam3/test3/bld/preproc.h
creating /export/home/songjie/cams/cam3/test3/bld/Makefile
creating /export/home/songjie/cams/cam3/test3/bld/config_cache.xml
configure done.
building CAM in /export/home/songjie/cams/cam3/test3/bld ...
Makefile:1030: /export/home/songjie/cams/cam3/test3/bld/Depends: No such file or directory
PGF90-F-0226-Can't find include file misc.h (/export/home/songjie/cams/cam3/cam1/models/lnd/clm2/src/main/clm_varpar.F9)
PGF90/any Linux/x86 3.2-4: compilation aborted
gmake: *** [clm_varpar.o] Error 1
 

eaton

CSEG and Liaisons
The CAM Makefile does not currently support using mpif90 as the Fortran compiler.
This is something we plan to fix. For now you need to specify pgf90 as the Fortran compiler. With your setting of LIB_MPI=/export/mpi/mpich-pgi/lib the arguments passed to the linker will be "-L/export/mpi/mpich-pgi/lib -lmpich". If your mpich installation requires any additional libraries or paths you can specify these using the -ldflags argument to configure.
One way to determine whether or not additional link information will be required is to run the command "mpif90 -link-info". If this option is valid on your system it will echo the link information that the mpif90 command uses.
 
Top