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

compiling CAM 3.0 with gfortran compiler

arindam@bu_edu

New Member
Hi,
I am a new user and I have been trying to compile CAM 3.0 with a gfortran compiler. The error mssgs that I get are:
Looking for a valid GNU make... using gmake

Testing for Fortran 90 compatible compiler... Testing NetCDF library... **** FAILED ****
Issued the command:
gmake test_nc 2>&1

The output was:
cat: Srcfiles: No such file or directory
Makefile:1008: /data/vesna3/cliveg/arindam/Climate_model_analysis/CAM_3.0/cam1/models/atm/cam/test/
Depends: No such file or directory
/data/vesna3/cliveg/arindam/Climate_model_analysis/CAM_3.0/cam1/models/atm/cam/bld/mkSrcfiles > /da
ta/vesna3/cliveg/arindam/Climate_model_analysis/CAM_3.0/cam1/models/atm/cam/test/Srcfiles
/data/vesna3/cliveg/arindam/Climate_model_analysis/CAM_3.0/cam1/models/atm/cam/bld/mkDepends Filepa
th Srcfiles > /data/vesna3/cliveg/arindam/Climate_model_analysis/CAM_3.0/cam1/models/atm/cam/test/D
epends
/usr/bin/gfortran -c -DHIDE_MPI test_nc.F90
test_nc.F90:3: error: netcdf.inc: No such file or directory
gmake: *** [test_nc.o] Error 1

Please help me with this issue. It seems that the default setting, including esmf, are for pgif90 compiler. Is there a way to use gfortran compiler instead?
Thanks,
Arindam.
 

rneale

Rich Neale
CAM Project Scientist
Staff member
Arindam,

Let's continue the conversation here so all the details get archived and are searchable.
Rich
 

arindam@bu_edu

New Member
Hi Rich,
Thanks for your reply. I would like to knw:
1) Is it possible to build and run CAM using a gfortran compiler? It seems that the makefiles and esmf are bulit around pgi, more specifically, pgf90 compiler.
2) I found CLM 2.0 source codes with the CAM 3.0 distribution. Does this mean that CLM2.0 is coupled with CAM3.0 or do I need to couple CAM 3 and CLM 3 separately. If so then how do I do it. Are there any materials available for this purpose.
I have posted on the bulletin board about both CAM 3 and CCSM 3 and haven't got any help so far. I would request you to provide me with some leads in these matters. I would grealy appreciate and acknowledge all help and guidance.
Arindam
 

rneale

Rich Neale
CAM Project Scientist
Staff member
Arindam,

CAM is set up to compile and build under a general user specified fortran
compiler, the options for which are distributed for all component models. If you want to run on a single processor it should be straight
forward. If you want to run on many processors it will be more difficult.

CLM will automatically be coupled with CAM and you don't need to do
anything separate to compile and build CLM.

Which code distribution do you have?
Did you download the cam3.1.p2 from the CAM download website?

If yes then you need to look at the directory
cam3.1.p2/models/atm/cam/bld

If you are running on pc architecture then look at run-pc.csh

In there you should your own compile options for your particular machine
The most important option to change is
setenv USER_FC lf95
which you should change to
setenv USER_FC gfortran

Also you need to make sure all the netcdf/mpi options and library
locations are set.

You also need to look in Makefile and add options for your particular
compiler.

ifeq ($(FC),gfortran)


Follow guidance from the ifort compiler for example to set options. This
is often a matter of trial and errors to get the options correct for the
model to run.
 
Top