First of all, as I know, all of CCSM3 building scripts are running in c-shell or tc-sell. I don't know if you can do the environemnat setting in bashrc, though.
At least, you might need to create a ".cshrc" file, put all CCSM3 environment variables in, and run it before running any CCSM3 scripts.
I don't even know how to actually do it. If you don't wanna be bothered, you can ask your administrator for changing your shell to c- or tc-shell.
The ".cshec" file will be read eveytime when you are login to the system.
If the problem is not on the shell, it should be (or must be) on your netCDF setting. Let's get back to look at your NetCDF library setting.
I don't know what version you are using, though.
%cd /opt/ksc/gnu/lib
%ls libnetcdf*
What do you see?
Can you see both libnetcdf.a and libnetcdff.a? If so, you have to add "-lnetcdff" in your SLIBS.
Your SLIBS will be:
SLIBS := -L/opt/ksc/gnu/lib -lnetcdf
-lnetcdff -L/usr/lib -llapack -lblas -L/opt/mpich/1.2.5..10/gm-2.0.12-2.4.20-28.7smp-i686/smp/pgi/ssh/lib -lmpich
Please return "-Mfree, r8, -i4, -Kieee, -Mrecursive, -Mdalign, -Mextend" to where they should be origionally. It's not a good idea to change anything before you got the previous problem done.
So, here is you should do:
1) Turn your shell to C/TC-shell, and convert the environemnt variable setting to C/TC before building the model.
2) Check your NetCDF library.
3) If the problem still there (cash at cpl component), I would like to see your mct.buildlib.xxxx. Maybe it's also a good time to upgrade you mct library.
Here is the header of my cpl.buildexe.xxxxx.
Hopefully, that helps.
Building dependency for timeCheck.d
Building dependency for tStamp_mod.d
Building dependency for shr_vmath_mod.d
Building dependency for shr_vmath_fwrap.d
Building dependency for shr_timer_mod.d
Building dependency for shr_sys_mod.d
Building dependency for shr_orb_mod.d
Building dependency for shr_msg_mod.d
Building dependency for shr_mpi_mod.d
Building dependency for shr_kind_mod.d
Building dependency for shr_file_mod.d
Building dependency for shr_date_mod.d
Building dependency for shr_const_mod.d
Building dependency for shr_cal_mod.d
Building dependency for shr_alarm_mod.d
Building dependency for restart_mod.d
Building dependency for merge_mod.d
Building dependency for main.d
Building dependency for history_mod.d
Building dependency for frac_mod.d
Building dependency for flux_mod.d
Building dependency for diag_mod.d
Building dependency for data_mod.d
Building dependency for cpl_mct_mod.d
Building dependency for cpl_map_mod.d
Building dependency for cpl_kind_mod.d
Building dependency for cpl_iocdf_mod.d
Building dependency for cpl_iobin_mod.d
Building dependency for cpl_interface_mod.d
Building dependency for cpl_infobuf_mod.d
Building dependency for cpl_fields_mod.d
Building dependency for cpl_domain_mod.d
Building dependency for cpl_control_mod.d
Building dependency for cpl_contract_mod.d
Building dependency for cpl_const_mod.d
Building dependency for cpl_comm_mod.d
Building dependency for cpl_bundle_mod.d
Building dependency for bitCheck_mod.d
Building dependency for areafact_mod.d
mpif90 -I. -I/usr/local/netcdf-3.6.2/include -I/usr/include -I/home/odden/lib/include -I/usr/local/mpi/mvapich-0.9.8-pgi/include -I/usr/local/pgi/linux86-64/7.0-4/include -I. -I/home/odden/tst/TER
.01a.T31_gx3v5.B.glenn.203501/SourceMods/src.cpl -I/d/odden/ccsm3_0/models/cpl/cpl6 -I/d/odden/ccsm3_0/models/csm_share -I/d/odden/ccsm3_0/models/csm_share/shr -I/d/odden/ccsm3_0/models/csm_sha
re/cpl -c -r8 -i4 -Kieee -Mdalign -Mextend -Mfree -DLINUX -DPGF90 -DNO_SHR_VMATH -DLINUX /d/odden/ccsm3_0/models/csm_share/shr/shr_kind_mod.F90
mpif90 -I. -I/usr/local/netcdf-3.6.2/include -I/usr/include -I/home/odden/lib/include -I/usr/local/mpi/mvapich-0.9.8-pgi/include -I/usr/local/pgi/linux86-64/7.0-4/include -I. -I/home/odden/tst/TER
.01a.T31_gx3v5.B.glenn.203501/SourceMods/src.cpl -I/d/odden/ccsm3_0/models/cpl/cpl6 -I/d/odden/ccsm3_0/models/csm_share -I/d/odden/ccsm3_0/models/csm_share/shr -I/d/odden/ccsm3_0/models/csm_sha
re/cpl -c -r8 -i4 -Kieee -Mdalign -Mextend -Mfree -DLINUX -DPGF90 -DNO_SHR_VMATH -DLINUX /d/odden/ccsm3_0/models/csm_share/shr/shr_mpi_mod.F90
yogeshkumkar said:
Thank you for your reply.
I have set INC_NETCDF and LIB_NETCDF in our shell before using it in macros.linux
for exmpl: our ~/.bashrc looks like
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/ksc/gnu/lib
export PATH=$PATH:/opt/ksc/gnu/bin:/opt/ksc/gnu/sbin
export PATH
LIBDWD_FORCE_CONTROLWORDS=1
export LIBDWD_FORCE_CONTROLWORDS
# PGI & MPICH
PGI=/opt/pgi/linux86/5.2
export PGI
PATH=$PGI/bin:$PGI/lib:$PGI/man:$PATH
export PATH
MPI=/opt/mpich/1.2.5..10/gm-2.0.12-2.4.20-28.7smp-i686/smp/pgi/ssh
#MPI=/opt/mpich/1.2.5.2/ip/smp/pgi/ssh
export MPI
INC_MPI=$MPI/include
LIB_MPI=$MPI/lib
export INC_MPI LIB_MPI
PATH=$MPI/bin:$MPI/lib:$MPI/include:$MPI/man:$PATH
export PATH
# NetCDF
NETCDF=/opt/ksc/gnu
INC_NETCDF=$NETCDF/include
LIB_NETCDF=$NETCDF/lib
export NETCDF INC_NETCDF LIB_NETCDF
PATH=$NETCDF/bin:$NETCDF/include:$NETCDF/lib:$NETCDF/man:$PATH
export PATH
Moreover, I have changed Macros.Linux also because, the errors were coming related to Mfree, r8, -i4, -Kieee, -Mrecursive, -Mdalign, -Mextend. So I removed them. Now Macros.Linux is like:
ifeq ($(MACH),jazz)
INCLDIR := -I. -I/opt/ksc/gnu/include -I/usr/include -I${INCROOT} -I/opt/mpich/1.2.5..10/gm-2.0.12-2.4.20-28.7smp-i686/smp/pgi/ssh/include
SLIBS := -L/opt/ksc/gnu/lib -lnetcdf -L/usr/lib -llapack -lblas -L/opt/mpich/1.2.5..10/gm-2.0.12-2.4.20-28.7smp-i686/smp/pgi/ssh/lib -lmpich
else
INCLDIR := -I. -I$(INC_NETCDF) -I$(INCROOT) -I$(INC_MPI)
SLIBS := -L$(LIB_NETCDF) -lnetcdf -llapack -lblas
endif
ULIBS := -L$(LIBROOT) -lesmf -lmct -lmpeu -lmph
CPP := NONE
CPPFLAGS := -DLINUX -DPGF90 -DNO_SHR_VMATH
CPPDEFS := -DLINUX
CC := mpicc
#CC := /opt/mpich/1.2.5..10/gm-2.0.12-2.4.20-28.7smp-i686/smp/pgi/ssh/bin/mpicc
CFLAGS := -c
ifeq ($(CC),pgcc)
CFLAGS += -fast
else
CFLAGS += -DUSE_GCC
endif
FIXEDFLAGS := NONE
#FREEFLAGS := -Mfree
FREEFLAGS :=
FC := mpif90
#FC := /opt/mpich/1.2.5..10/gm-2.0.12-2.4.20-28.7smp-i686/smp/pgi/ssh/bin/mpif90
#FFLAGS := -c -r8 -i4 -Kieee -Mrecursive -Mdalign -Mextend
FFLAGS := -c -i4
# -g -Ktrap=fp -Mbounds
MOD_SUFFIX := mod
LD := $(FC)
#LDFLAGS := -L/usr/local/gm/lib -lgm -lpthread
#LDFLAGS := -L/usr/local/gm/lib -lgm
ifeq ($(CC),gcc)
LDFLAGS += -g77libs="-L/opt/pgi/linux86/5.2/lib -lpgf90 -lpgf90rtl -lpgftnrtl -lpgc"
endif
AR := ar
but still new error comes. it shows
Mon May 26 23:04:22 KST 2008 /ytmp/e027chs/yogesh/ccsm3_0.dead/zbdead/cpl/cpl.buildexe.080526-230410
mpif90 -I. -I/opt/ksc/gnu/include -I/usr/include -I/ytmp/e027chs/yogesh/ccsm3_0.dead/zbdead/lib/include -I/opt/mpich/1.2.5..10/gm-2.0.12-2.4.20-28.7smp-i686/smp/pgi/ssh/include -I. -I/ytmp/e027chs/yogesh/ccsm3_0.dead/zbdead/SourceMods/src.cpl -I/ytmp/e027chs/yogesh/ccsm3_0.dead/ccsm3.0/models/cpl/cpl6 -I/ytmp/e027chs/yogesh/ccsm3_0.dead/ccsm3.0/models/csm_share -I/ytmp/e027chs/yogesh/ccsm3_0.dead/ccsm3.0/models/csm_share/shr -I/ytmp/e027chs/yogesh/ccsm3_0.dead/ccsm3.0/models/csm_share/cpl -c -i4 -DLINUX -DPGF90 -DNO_SHR_VMATH -DLINUX /ytmp/e027chs/yogesh/ccsm3_0.dead/ccsm3.0/models/csm_share/shr/shr_mpi_mod.F90
/ytmp/e027chs/yogesh/ccsm3_0.dead/ccsm3.0/models/csm_share/shr/shr_mpi_mod.F90:70: #include expects "fname" or
Preprocessing failed.
gmake: *** [shr_mpi_mod.o] Error 1
Is it related to 32/64 bit machine or bash shell? Please give suggestions.
Sincerely,
Yogesh.