Icon : Build CMAQ executables Error building ICON

desc3.F:(.text+0x35d): undefined reference to ncagtc_' desc3.F:(.text+0x39a): undefined reference toncagt_’
desc3.F:(.text+0x3ce): undefined reference to ncagt_' desc3.F:(.text+0x400): undefined reference toncagt_’
opnfil3.F:(.text+0x1d2): undefined reference to ncagt_' opnfil3.F:(.text+0x237): undefined reference toncagt_’
opnfil3.F:(.text+0x273): undefined reference to ncagt_' opnfil3.F:(.text+0x2ab): undefined reference toncagt_’
opnfil3.F:(.text+0x54d): undefined reference to ncvid_' opnfil3.F:(.text+0x5c2): undefined reference toncagtc_’
opnfil3.F:(.text+0x646): undefined reference to ncvinq_' opnfil3.F:(.text+0x69d): undefined reference toncagtc_’
opnfil3.F:(.text+0x6e7): undefined reference to ncvid_' opnfil3.F:(.text+0x7fd): undefined reference to
crdict3.f:(.text+0x178): undefined reference to ncvdef_' crdict3.f:(.text+0x1d4): undefined reference toncaptc_’
crdict3.f:(.text+0x226): undefined reference to ncaptc_' crdict3.f:(.text+0xdb0): undefined reference toncapt_’
crdict3.f:(.text+0xe1c): undefined reference to ncaptc_' crdict3.f:(.text+0xe71): undefined reference toncvdef_’
crdict3.f:(.text+0xee1): undefined reference to ncvdef_' crdict3.f:(.text+0xf3d): undefined reference toncvdef_’

make: *** [ICON_D502a_Linux3_x86_64gcc] Error 1
ERROR while running make command

Which I/O API version? Which netCDF version?

See https://www.cmascenter.org/ioapi/documentation/all_versions/html/AVAIL.html#ncf4:
Evidently, starting with netCDF-Fortran 4.4.2, UCAR in their wisdom decided to silently eliminate the CALL NC*() Fortran interfaces in terms of which the I/O API was originally implemented. [If you can find any documentation indicating this intent on the web, I would enjoy seeing it; I can’t find it.]

I/O API Version 3.2 was tediously re-coded to replace all 943 of these calls by the newer IERR=NF_*() Fortran interfaces that are still supported. Prior editions of the I/O API will have link errors with netCDF-Fortran 4.4.2 or later, because routines such as NCCLOS() are no longer in that library.

…which is exactly what you’re seeing,

Carlie J. Coats, Jr., Ph.D.                    cjcoats@email.unc.edu
Senior Software Engineer                   I/O API Author/Maintainer
Center for Environmental Modeling for Policy Development,
UNC Institute for the Environment                     www.ie.unc.edu
100 Europa Dr., Suite 490 Rm 4051 / Campus Box 1105     919.843.5951
Chapel Hill, NC 27599-1105                          Fax 919.966.9920

netcdf-4.1.3 IOAPI 3.1

So (thanks to the fact that netCDF4 is not backwards compatible with its predecessors, you need to be using I/O API 3.2:

Start from a “new” directory, and
git clone https://github.com/cjcoats/ioapi-3.2.git
or
wget https://www.cmascenter.org/ioapi/download/ioapi-3.2.tar.gz ; tar xvfz ioapi-3.2.tar.gz
[etc.: see https://www.cmascenter.org/ioapi/documentation/all_versions/html/AVAIL.html#build for build-instructions

Hello,

Below is what I got while building CCTM:

STATE3.EXT:174:27:

Error: Syntax error in COMMON statement at (1)
STATE3.EXT:191:27:

Error: Syntax error in COMMON statement at (1)
Makefile:414: recipe for target ‘pinterpb.o’ failed
make: *** [pinterpb.o] Error 1
ERROR while running make command

else if ( 0 ) then
endif
mv Makefile Makefile.gcc7.3.0
if ( -e Makefile.gcc7.3.0 && -e Makefile ) rm Makefile
ln -s Makefile.gcc7.3.0 Makefile
if ( 0 != 0 ) then
if ( -e /home/catalyst/Desktop/Build_WRF/CMAQ-5.2/CCTM/scripts/BLD_CCTM_v52_gcc7.3.0/CCTM_v52.cfg ) then
mv CCTM_v52.cfg.bld /home/catalyst/Desktop/Build_WRF/CMAQ-5.2/CCTM/scripts/BLD_CCTM_v52_gcc7.3.0/CCTM_v52.cfg
exit

I need your help please. Thanks

See the I/O API Troubleshooting document: https://www.cmascenter.org/ioapi/documentation/all_versions/html/AVAIL.html#cmaq

According to the ISO Fortran Standard, there are two “source formats” for Fortran source code – the older ( f77 ) “fixed” format with code in columns 7-72 and continuation markers in column 6, and the ( f90 ) “free” format, with source in columns 1-132 and ampersand ("&") for trailing continuation markers, as well as a specification for code which is acceptable to both forms.

Since it is used by various models that use “free” format, the I/O API carefully follows the Standard in this regard, and uses the ISO-approved “both-form” format for its Fortran INCLUDE files.

Some of the models—in particular, CMAQ and SMOKE however, do not—instead using a “fixed-132” format. The I/O API Makefile has a way of dealing with this; the commands

> cd <installation directory>/ioapi
> make fixed_src

will create a new directory ioapi/fixed_src and populate it with copies of the INCLUDE files that have been edited to work with the non-Standard “fixed-132” format. You will need to use these INCLUDE files with CMAQ and SMOKE.

Thanks for your guide.
However, the CCTM is yet to compile as I got this response:

collect2: error: ld returned 1 exit status
Makefile:408: recipe for target ‘CCTM_v52.exe’ failed
make: *** [CCTM_v52.exe] Error 1
ERROR while running make command

else if ( 0 ) then
endif
mv Makefile Makefile.gcc7.3.0
if ( -e Makefile.gcc7.3.0 && -e Makefile ) rm Makefile
ln -s Makefile.gcc7.3.0 Makefile
if ( 0 != 0 ) then
if ( -e /home/catalyst/Desktop/Build_WRF/CMAQ-5.2/CCTM/scripts/BLD_CCTM_v52_gcc7.3.0/CCTM_v52.cfg ) then
mv CCTM_v52.cfg.bld /home/catalyst/Desktop/Build_WRF/CMAQ-5.2/CCTM/scripts/BLD_CCTM_v52_gcc7.3.0/CCTM_v52.cfg
exit

Kindly help me out. Thanks.

Hi, I seem to be running into the same problem. Did you ever find a solution for this?

Thanks!

Please remove or comment out the following statement
ln -s Makefile.gcc7.3.0 Makefile

That should remove one error that you are running into.

Hi
I want to compile icon, but it gives me ERROR. Could you guide me, please?

./bldit_icon.csh intel |& tee build_icon.log
Compiler is set to intel
set ICON_SRC = /home/ensiyeh/WRF-CMAQ/CMAQ_REPO/PREP/icon/src
setenv REPOROOT /home/ensiyeh/WRF-CMAQ/CMAQ_REPO/PREP/icon/src
set Mechs = /home/ensiyeh/WRF-CMAQ/CMAQ_REPO/CCTM/src/MECHS
set VRSN = v52
set INPT = profile
set EXEC = ICON_v52_profile.exe
set CFG = ICON_v52_profile.cfg
set CompileBLDMAKE
set CopySrc
set ModCommon = common
set ModType = profile
set ModMech = prof_data/cb05_ae6_aq
set Mechanism = cb05e51_ae6_aq/
set Tracer = trac0
set FC = ifort
set FP = ifort
setenv BLDER /home/ensiyeh/WRF-CMAQ/CMAQ_REPO/UTIL/bldmake/bldmake_intel.exe
set xLib_Base = /home/ensiyeh/WRF-CMAQ/CMAQ_REPO/lib/x86_64/intel
set xLib_1 = ioapi/modules
set xLib_2 = ioapi/include_files
set xLib_4 = ioapi/lib
set FSTD = -O3 -fno-alias -mp1 -fp-model source -qopenmp
set DBG = -O0 -g -check bounds -check uninit -fpe0 -fno-alias -ftrapuv -traceback
set F_FLAGS = -fixed -132
set F90_FLAGS = -free
set CPP_FLAGS =
set LINK_FLAGS = -qopenmp
set LIB1 = -lioapi
set LIB2 = -lnetcdf -lnetcdff -lcurl
if ( ! -e /home/ensiyeh/WRF-CMAQ/CMAQ_REPO || ! -e /home/ensiyeh/WRF-CMAQ/CMAQ_REPO/lib/x86_64/intel ) then
echo Model repository base path: /home/ensiyeh/WRF-CMAQ/CMAQ_REPO
Model repository base path: /home/ensiyeh/WRF-CMAQ/CMAQ_REPO
echo library path: /home/ensiyeh/WRF-CMAQ/CMAQ_REPO/lib/x86_64/intel
library path: /home/ensiyeh/WRF-CMAQ/CMAQ_REPO/lib/x86_64/intel
if ( 0 ) then
set BLD_OS = uname -s
uname -s
if ( Linux != Linux ) then
set Bld = /home/ensiyeh/WRF-CMAQ/CMAQ_REPO/PREP/icon/scripts/BLD_ICON_v52_profile_intel
if ( ! -e /home/ensiyeh/WRF-CMAQ/CMAQ_REPO/PREP/icon/scripts/BLD_ICON_v52_profile_intel ) then
if ( ! -d /home/ensiyeh/WRF-CMAQ/CMAQ_REPO/PREP/icon/scripts/BLD_ICON_v52_profile_intel ) then
endif
cd /home/ensiyeh/WRF-CMAQ/CMAQ_REPO/PREP/icon/scripts/BLD_ICON_v52_profile_intel
if ( 1 ) then
/bin/cp -fp /home/ensiyeh/WRF-CMAQ/CMAQ_REPO/CCTM/src/MECHS/cb05e51_ae6_aq//AE_cb05e51_ae6_aq.nml /home/ensiyeh/WRF-CMAQ/CMAQ_REPO/CCTM/src/MECHS/cb05e51_ae6_aq//GC_cb05e51_ae6_aq.nml /home/ensiyeh/WRF-CMAQ/CMAQ_REPO/CCTM/src/MECHS/cb05e51_ae6_aq//NR_cb05e51_ae6_aq.nml /home/ensiyeh/WRF-CMAQ/CMAQ_REPO/PREP/icon/scripts/BLD_ICON_v52_profile_intel
/bin/cp -fp /home/ensiyeh/WRF-CMAQ/CMAQ_REPO/CCTM/src/MECHS/trac0/Species_Table_TR_0.nml /home/ensiyeh/WRF-CMAQ/CMAQ_REPO/PREP/icon/scripts/BLD_ICON_v52_profile_intel
else
set Cfile = ICON_v52_profile.cfg.bld
set quote = "
echo
echo model ICON_v52_profile.exe;
echo
echo repo /home/ensiyeh/WRF-CMAQ/CMAQ_REPO/PREP/icon/src;
echo
echo mechanism cb05e51_ae6_aq/;
echo
echo lib_base /home/ensiyeh/WRF-CMAQ/CMAQ_REPO/lib/x86_64/intel;
echo
echo lib_1 ioapi/modules;
echo
echo lib_2 ioapi/include_files;
echo
echo lib_4 ioapi/lib;
echo
set text = “”;
echo cpp_flags “”;
echo
echo f_compiler ifort;
echo
echo fstd “-O3 -fno-alias -mp1 -fp-model source -qopenmp”;
echo
echo dbg “-O0 -g -check bounds -check uninit -fpe0 -fno-alias -ftrapuv -traceback”;
echo
echo f_flags “-fixed -132”;
echo
echo f90_flags “-free”;
echo
echo link_flags “-qopenmp”;
echo
echo ioapi “-lioapi”;
echo
echo netcdf “-lnetcdf -lnetcdff -lcurl”;
echo
set text=// mechanism:
echo // mechanism: cb05e51_ae6_aq/
echo // project repository: /home/ensiyeh/WRF-CMAQ/CMAQ_REPO/PREP/icon/src
echo
set text = common
echo // required common
echo Module common;
echo
set text = profile, m3conc, tracer
echo // options are profile, m3conc, tracer
echo Module profile;
echo
set text = cb05, saprc99, saprc07t
echo // options are cb05, saprc99, saprc07t
echo Module prof_data/cb05_ae6_aq;
echo
if ( 0 ) then
unalias mv rm
if ( 1 || ! -f /home/ensiyeh/WRF-CMAQ/CMAQ_REPO/UTIL/bldmake/bldmake_intel.exe ) then
cd /home/ensiyeh/WRF-CMAQ/CMAQ_REPO/UTIL/bldmake/scripts
./bldit_bldmake.csh
endif
set Blder = /home/ensiyeh/WRF-CMAQ/CMAQ_REPO/UTIL/bldmake/bldmake_intel.exe -serial -verbose
cd /home/ensiyeh/WRF-CMAQ/CMAQ_REPO/PREP/icon/scripts/BLD_ICON_v52_profile_intel
if ( 0 ) then
if ( 1 ) then
/home/ensiyeh/WRF-CMAQ/CMAQ_REPO/UTIL/bldmake/bldmake_intel.exe -serial -verbose ICON_v52_profile.cfg.bld
REPOROOT set to:/home/ensiyeh/WRF-CMAQ/CMAQ_REPO/PREP/icon/src

Model set to ICON_v52_profile.exe
Repository set to /home/ensiyeh/WRF-CMAQ/CMAQ_REPO/PREP/icon/src
Mechanism set to cb05e51_ae6_aq/
LIB_BASE set to /home/ensiyeh/WRF-CMAQ/CMAQ_REPO/lib/x86_64/intel
LIB_1 set to ioapi/modules
LIB_2 set to ioapi/include_files
LIB_4 set to ioapi/lib
CPP_FLAGS set to
F_COMPILER set to ifort
FSTD set to -O3 -fno-alias -mp1 -fp-model source -qopenmp
DBG set to -O0 -g -check bounds -check uninit -fpe0 -fno-alias -ftrapuv -traceback
f_flags set to -fixed -132
f90_flags set to -free
LINK_FLAGS set to -qopenmp
IOAPI set to -lioapi
NETCDF set to -lnetcdf -lnetcdff -lcurl

Building file list for module common
file /home/ensiyeh/WRF-CMAQ/CMAQ_REPO/PREP/icon/src/common/CGRID_SPCS.F added to make list
file /home/ensiyeh/WRF-CMAQ/CMAQ_REPO/PREP/icon/src/common/findex.F added to make list
file /home/ensiyeh/WRF-CMAQ/CMAQ_REPO/PREP/icon/src/common/gc_spc_map.F added to make list
file /home/ensiyeh/WRF-CMAQ/CMAQ_REPO/PREP/icon/src/common/get_envlist.f added to make list
file /home/ensiyeh/WRF-CMAQ/CMAQ_REPO/PREP/icon/src/common/HGRD_DEFN.F added to make list
file /home/ensiyeh/WRF-CMAQ/CMAQ_REPO/PREP/icon/src/common/icon.F added to make list
file /home/ensiyeh/WRF-CMAQ/CMAQ_REPO/PREP/icon/src/common/IC_PARMS.F added to make list
file /home/ensiyeh/WRF-CMAQ/CMAQ_REPO/PREP/icon/src/common/lat_lon.F added to make list
file /home/ensiyeh/WRF-CMAQ/CMAQ_REPO/PREP/icon/src/common/lr_interp.F added to make list
file /home/ensiyeh/WRF-CMAQ/CMAQ_REPO/PREP/icon/src/common/lst_spc_map.F added to make list
file /home/ensiyeh/WRF-CMAQ/CMAQ_REPO/PREP/icon/src/common/ngc_spc_map.F added to make list
file /home/ensiyeh/WRF-CMAQ/CMAQ_REPO/PREP/icon/src/common/opn_ic_file.F added to make list
file /home/ensiyeh/WRF-CMAQ/CMAQ_REPO/PREP/icon/src/common/setup_logdev.F added to make list
file /home/ensiyeh/WRF-CMAQ/CMAQ_REPO/PREP/icon/src/common/subhdomain.F added to make list
file /home/ensiyeh/WRF-CMAQ/CMAQ_REPO/PREP/icon/src/common/UTILIO_DEFN.F added to make list
file /home/ensiyeh/WRF-CMAQ/CMAQ_REPO/PREP/icon/src/common/VGRD_DEFN.F added to make list

Building file list for module profile
file /home/ensiyeh/WRF-CMAQ/CMAQ_REPO/PREP/icon/src/profile/prof_driver.F added to make list
file /home/ensiyeh/WRF-CMAQ/CMAQ_REPO/PREP/icon/src/profile/prof_icout.F added to make list
file /home/ensiyeh/WRF-CMAQ/CMAQ_REPO/PREP/icon/src/profile/prof_vinterp.F added to make list

Building file list for module prof_data/cb05_ae6_aq
file /home/ensiyeh/WRF-CMAQ/CMAQ_REPO/PREP/icon/src/prof_data/cb05_ae6_aq/ic_profile_CB05.dat added to make list

Determining global module files
file CGRID_SPCS.F determined to be global
file HGRD_DEFN.F determined to be global
file IC_PARMS.F determined to be global
file UTILIO_DEFN.F determined to be global
file VGRD_DEFN.F determined to be global

Generating Makefile

Compilers defined
CPP Flags defined
Libraries defined
Includes defined
Objects defined
Make rules defined

file,nfields-1 CGRID_SPCS.F 2
modName,modFile 2 UTILIO_DEFN UTILIO_DEFN.F

file,nfields-1 gc_spc_map.F 3
modName,modFile 2 UTILIO_DEFN UTILIO_DEFN.F
modName,modFile 3 CGRID_SPCS CGRID_SPCS.F

file,nfields-1 HGRD_DEFN.F 2
modName,modFile 2 UTILIO_DEFN UTILIO_DEFN.F

file,nfields-1 icon.F 6
modName,modFile 2 HGRD_DEFN HGRD_DEFN.F
modName,modFile 3 VGRD_DEFN VGRD_DEFN.F
modName,modFile 4 UTILIO_DEFN UTILIO_DEFN.F
modName,modFile 5 CGRID_SPCS CGRID_SPCS.F
modName,modFile 6 IC_PARMS IC_PARMS.F

file,nfields-1 lat_lon.F 2
modName,modFile 2 UTILIO_DEFN UTILIO_DEFN.F

file,nfields-1 lr_interp.F 2
modName,modFile 2 UTILIO_DEFN UTILIO_DEFN.F

file,nfields-1 lst_spc_map.F 4
modName,modFile 2 UTILIO_DEFN UTILIO_DEFN.F
modName,modFile 3 CGRID_SPCS CGRID_SPCS.F
modName,modFile 4 IC_PARMS IC_PARMS.F

file,nfields-1 ngc_spc_map.F 4
modName,modFile 2 UTILIO_DEFN UTILIO_DEFN.F
modName,modFile 3 CGRID_SPCS CGRID_SPCS.F
modName,modFile 4 IC_PARMS IC_PARMS.F

file,nfields-1 opn_ic_file.F 6
modName,modFile 2 HGRD_DEFN HGRD_DEFN.F
modName,modFile 3 VGRD_DEFN VGRD_DEFN.F
modName,modFile 4 UTILIO_DEFN UTILIO_DEFN.F
modName,modFile 5 CGRID_SPCS CGRID_SPCS.F
modName,modFile 6 IC_PARMS IC_PARMS.F

file,nfields-1 setup_logdev.F 2
modName,modFile 2 UTILIO_DEFN UTILIO_DEFN.F

file,nfields-1 subhdomain.F 2
modName,modFile 2 UTILIO_DEFN UTILIO_DEFN.F

file,nfields-1 UTILIO_DEFN.F 3
modName 2 M3UTILIO -------------
modName 3 PARUTILIO -------------

file,nfields-1 VGRD_DEFN.F 2
modName,modFile 2 UTILIO_DEFN UTILIO_DEFN.F

file,nfields-1 prof_driver.F 4
modName,modFile 2 UTILIO_DEFN UTILIO_DEFN.F
modName,modFile 3 CGRID_SPCS CGRID_SPCS.F
modName,modFile 4 IC_PARMS IC_PARMS.F

file,nfields-1 prof_icout.F 5
modName,modFile 2 HGRD_DEFN HGRD_DEFN.F
modName,modFile 3 VGRD_DEFN VGRD_DEFN.F
modName,modFile 4 UTILIO_DEFN UTILIO_DEFN.F
modName,modFile 5 IC_PARMS IC_PARMS.F

file,nfields-1 prof_vinterp.F 5
modName,modFile 2 HGRD_DEFN HGRD_DEFN.F
modName,modFile 3 VGRD_DEFN VGRD_DEFN.F
modName,modFile 4 UTILIO_DEFN UTILIO_DEFN.F
modName,modFile 5 IC_PARMS IC_PARMS.F

USE/MODULE dependencies defined

Makefile generated
ifort -qopenmp UTILIO_DEFN.o HGRD_DEFN.o IC_PARMS.o CGRID_SPCS.o VGRD_DEFN.o findex.o gc_spc_map.o get_envlist.o icon.o lat_lon.o lr_interp.o lst_spc_map.o ngc_spc_map.o opn_ic_file.o setup_logdev.o subhdomain.o prof_driver.o prof_icout.o prof_vinterp.o -L/home/ensiyeh/WRF-CMAQ/CMAQ_REPO/lib/x86_64/intel/ioapi/lib -lioapi -L/home/ensiyeh/WRF-CMAQ/CMAQ_REPO/lib/x86_64/intel/netcdf/lib -lnetcdf -lnetcdff -lcurl -o ICON_v52_profile.exe
ld: cannot find -lcurl
Makefile:85: recipe for target ‘ICON_v52_profile.exe’ failed
make: *** [ICON_v52_profile.exe] Error 1
ERROR while running make command

else
endif
mv Makefile Makefile.intel
mv: ‘Makefile’ and ‘Makefile.intel’ are the same file
ln -s Makefile.intel Makefile
ln: failed to create symbolic link ‘Makefile’: File exists
if ( 1 != 0 ) then
echo *** failure in /home/ensiyeh/WRF-CMAQ/CMAQ_REPO/UTIL/bldmake/bldmake_intel.exe -serial -verbose ***
*** failure in /home/ensiyeh/WRF-CMAQ/CMAQ_REPO/UTIL/bldmake/bldmake_intel.exe -serial -verbose ***
exit 1

I installed netcdf-4.1.3, mpich-3.0.4, ioapi-3.2.
My OS is ubuntuv16.04 and the compiler is intelv15.

See Availability/Download of the BAMS/Models-3 I/O API

There are lots of options for netCDF – and these change the libraries you need.

It is recommended that you configure and install netCDF with

--disable-netcdf-4 --disable-dap
so that you don’t have this happening. And by the way, from Availability/Download of the BAMS/Models-3 I/O API,

You are best off if you can build the whole modeling system (libnetcdf.a, libpvm3.a, libioapi.a, and your model(s) CMAQ, SMOKE, etc. with a common compiler set and common set of compile-flags. In particular, Linux-distribution-vendor supplied libnetcdf.a rarely works with CMAS-supported compiler sets.

1 Like

Hi
Thank you. I used these options when I installed netcdf and I installed all of them with a common compiler and common flags, but for ioapi I use makeinclude and I don’t know about it.
I installed curl library, after that, it didn’t give me any error but it failures.

Compiler is set to intel
set ICON_SRC = /home/ensiyeh/WRF-CMAQ/CMAQ_REPO/PREP/icon/src
setenv REPOROOT /home/ensiyeh/WRF-CMAQ/CMAQ_REPO/PREP/icon/src
set Mechs = /home/ensiyeh/WRF-CMAQ/CMAQ_REPO/CCTM/src/MECHS
set VRSN = v52
set INPT = profile
set EXEC = ICON_v52_profile.exe
set CFG = ICON_v52_profile.cfg
set CompileBLDMAKE
set CopySrc
set ModCommon = common
set ModType = profile
set ModMech = prof_data/cb05_ae6_aq
set Mechanism = cb05e51_ae6_aq/
set Tracer = trac0
set FC = ifort
set FP = ifort
setenv BLDER /home/ensiyeh/WRF-CMAQ/CMAQ_REPO/UTIL/bldmake/bldmake_intel.exe
set xLib_Base = /home/ensiyeh/WRF-CMAQ/CMAQ_REPO/lib/x86_64/intel
set xLib_1 = ioapi/modules
set xLib_2 = ioapi/include_files
set xLib_4 = ioapi/lib
set FSTD = -O3 -fno-alias -mp1 -fp-model source -qopenmp
set DBG = -O0 -g -check bounds -check uninit -fpe0 -fno-alias -ftrapuv -traceback
set F_FLAGS = -fixed -132
set F90_FLAGS = -free
set CPP_FLAGS =
set LINK_FLAGS = -qopenmp
set LIB1 = -lioapi
set LIB2 = -lnetcdf -lnetcdff -lcurl
if ( ! -e /home/ensiyeh/WRF-CMAQ/CMAQ_REPO || ! -e /home/ensiyeh/WRF-CMAQ/CMAQ_REPO/lib/x86_64/intel ) then
echo Model repository base path: /home/ensiyeh/WRF-CMAQ/CMAQ_REPO
Model repository base path: /home/ensiyeh/WRF-CMAQ/CMAQ_REPO
echo library path: /home/ensiyeh/WRF-CMAQ/CMAQ_REPO/lib/x86_64/intel
library path: /home/ensiyeh/WRF-CMAQ/CMAQ_REPO/lib/x86_64/intel
if ( 0 ) then
set BLD_OS = uname -s
uname -s
if ( Linux != Linux ) then
set Bld = /home/ensiyeh/WRF-CMAQ/CMAQ_REPO/PREP/icon/scripts/BLD_ICON_v52_profile_intel
if ( ! -e /home/ensiyeh/WRF-CMAQ/CMAQ_REPO/PREP/icon/scripts/BLD_ICON_v52_profile_intel ) then
if ( ! -d /home/ensiyeh/WRF-CMAQ/CMAQ_REPO/PREP/icon/scripts/BLD_ICON_v52_profile_intel ) then
endif
cd /home/ensiyeh/WRF-CMAQ/CMAQ_REPO/PREP/icon/scripts/BLD_ICON_v52_profile_intel
if ( 1 ) then
/bin/cp -fp /home/ensiyeh/WRF-CMAQ/CMAQ_REPO/CCTM/src/MECHS/cb05e51_ae6_aq//AE_cb05e51_ae6_aq.nml /home/ensiyeh/WRF-CMAQ/CMAQ_REPO/CCTM/src/MECHS/cb05e51_ae6_aq//GC_cb05e51_ae6_aq.nml /home/ensiyeh/WRF-CMAQ/CMAQ_REPO/CCTM/src/MECHS/cb05e51_ae6_aq//NR_cb05e51_ae6_aq.nml /home/ensiyeh/WRF-CMAQ/CMAQ_REPO/PREP/icon/scripts/BLD_ICON_v52_profile_intel
/bin/cp -fp /home/ensiyeh/WRF-CMAQ/CMAQ_REPO/CCTM/src/MECHS/trac0/Species_Table_TR_0.nml /home/ensiyeh/WRF-CMAQ/CMAQ_REPO/PREP/icon/scripts/BLD_ICON_v52_profile_intel
else
set Cfile = ICON_v52_profile.cfg.bld
set quote = "
echo
echo model ICON_v52_profile.exe;
echo
echo repo /home/ensiyeh/WRF-CMAQ/CMAQ_REPO/PREP/icon/src;
echo
echo mechanism cb05e51_ae6_aq/;
echo
echo lib_base /home/ensiyeh/WRF-CMAQ/CMAQ_REPO/lib/x86_64/intel;
echo
echo lib_1 ioapi/modules;
echo
echo lib_2 ioapi/include_files;
echo
echo lib_4 ioapi/lib;
echo
set text = “”;
echo cpp_flags “”;
echo
echo f_compiler ifort;
echo
echo fstd “-O3 -fno-alias -mp1 -fp-model source -qopenmp”;
echo
echo dbg “-O0 -g -check bounds -check uninit -fpe0 -fno-alias -ftrapuv -traceback”;
echo
echo f_flags “-fixed -132”;
echo
echo f90_flags “-free”;
echo
echo link_flags “-qopenmp”;
echo
echo ioapi “-lioapi”;
echo
echo netcdf “-lnetcdf -lnetcdff -lcurl”;
echo
set text=// mechanism:
echo // mechanism: cb05e51_ae6_aq/
echo // project repository: /home/ensiyeh/WRF-CMAQ/CMAQ_REPO/PREP/icon/src
echo
set text = common
echo // required common
echo Module common;
echo
set text = profile, m3conc, tracer
echo // options are profile, m3conc, tracer
echo Module profile;
echo
set text = cb05, saprc99, saprc07t
echo // options are cb05, saprc99, saprc07t
echo Module prof_data/cb05_ae6_aq;
echo
if ( 0 ) then
unalias mv rm
if ( 1 || ! -f /home/ensiyeh/WRF-CMAQ/CMAQ_REPO/UTIL/bldmake/bldmake_intel.exe ) then
cd /home/ensiyeh/WRF-CMAQ/CMAQ_REPO/UTIL/bldmake/scripts
./bldit_bldmake.csh
endif
set Blder = /home/ensiyeh/WRF-CMAQ/CMAQ_REPO/UTIL/bldmake/bldmake_intel.exe -serial -verbose
cd /home/ensiyeh/WRF-CMAQ/CMAQ_REPO/PREP/icon/scripts/BLD_ICON_v52_profile_intel
if ( 0 ) then
if ( 1 ) then
/home/ensiyeh/WRF-CMAQ/CMAQ_REPO/UTIL/bldmake/bldmake_intel.exe -serial -verbose ICON_v52_profile.cfg.bld
REPOROOT set to:/home/ensiyeh/WRF-CMAQ/CMAQ_REPO/PREP/icon/src

Model set to ICON_v52_profile.exe
Repository set to /home/ensiyeh/WRF-CMAQ/CMAQ_REPO/PREP/icon/src
Mechanism set to cb05e51_ae6_aq/
LIB_BASE set to /home/ensiyeh/WRF-CMAQ/CMAQ_REPO/lib/x86_64/intel
LIB_1 set to ioapi/modules
LIB_2 set to ioapi/include_files
LIB_4 set to ioapi/lib
CPP_FLAGS set to
F_COMPILER set to ifort
FSTD set to -O3 -fno-alias -mp1 -fp-model source -qopenmp
DBG set to -O0 -g -check bounds -check uninit -fpe0 -fno-alias -ftrapuv -traceback
f_flags set to -fixed -132
f90_flags set to -free
LINK_FLAGS set to -qopenmp
IOAPI set to -lioapi
NETCDF set to -lnetcdf -lnetcdff -lcurl

Building file list for module common
file /home/ensiyeh/WRF-CMAQ/CMAQ_REPO/PREP/icon/src/common/CGRID_SPCS.F added to make list
file /home/ensiyeh/WRF-CMAQ/CMAQ_REPO/PREP/icon/src/common/findex.F added to make list
file /home/ensiyeh/WRF-CMAQ/CMAQ_REPO/PREP/icon/src/common/gc_spc_map.F added to make list
file /home/ensiyeh/WRF-CMAQ/CMAQ_REPO/PREP/icon/src/common/get_envlist.f added to make list
file /home/ensiyeh/WRF-CMAQ/CMAQ_REPO/PREP/icon/src/common/HGRD_DEFN.F added to make list
file /home/ensiyeh/WRF-CMAQ/CMAQ_REPO/PREP/icon/src/common/icon.F added to make list
file /home/ensiyeh/WRF-CMAQ/CMAQ_REPO/PREP/icon/src/common/IC_PARMS.F added to make list
file /home/ensiyeh/WRF-CMAQ/CMAQ_REPO/PREP/icon/src/common/lat_lon.F added to make list
file /home/ensiyeh/WRF-CMAQ/CMAQ_REPO/PREP/icon/src/common/lr_interp.F added to make list
file /home/ensiyeh/WRF-CMAQ/CMAQ_REPO/PREP/icon/src/common/lst_spc_map.F added to make list
file /home/ensiyeh/WRF-CMAQ/CMAQ_REPO/PREP/icon/src/common/ngc_spc_map.F added to make list
file /home/ensiyeh/WRF-CMAQ/CMAQ_REPO/PREP/icon/src/common/opn_ic_file.F added to make list
file /home/ensiyeh/WRF-CMAQ/CMAQ_REPO/PREP/icon/src/common/setup_logdev.F added to make list
file /home/ensiyeh/WRF-CMAQ/CMAQ_REPO/PREP/icon/src/common/subhdomain.F added to make list
file /home/ensiyeh/WRF-CMAQ/CMAQ_REPO/PREP/icon/src/common/UTILIO_DEFN.F added to make list
file /home/ensiyeh/WRF-CMAQ/CMAQ_REPO/PREP/icon/src/common/VGRD_DEFN.F added to make list

Building file list for module profile
file /home/ensiyeh/WRF-CMAQ/CMAQ_REPO/PREP/icon/src/profile/prof_driver.F added to make list
file /home/ensiyeh/WRF-CMAQ/CMAQ_REPO/PREP/icon/src/profile/prof_icout.F added to make list
file /home/ensiyeh/WRF-CMAQ/CMAQ_REPO/PREP/icon/src/profile/prof_vinterp.F added to make list

Building file list for module prof_data/cb05_ae6_aq
file /home/ensiyeh/WRF-CMAQ/CMAQ_REPO/PREP/icon/src/prof_data/cb05_ae6_aq/ic_profile_CB05.dat added to make list

Determining global module files
file CGRID_SPCS.F determined to be global
file HGRD_DEFN.F determined to be global
file IC_PARMS.F determined to be global
file UTILIO_DEFN.F determined to be global
file VGRD_DEFN.F determined to be global

Generating Makefile

Compilers defined
CPP Flags defined
Libraries defined
Includes defined
Objects defined
Make rules defined

file,nfields-1 CGRID_SPCS.F 2
modName,modFile 2 UTILIO_DEFN UTILIO_DEFN.F

file,nfields-1 gc_spc_map.F 3
modName,modFile 2 UTILIO_DEFN UTILIO_DEFN.F
modName,modFile 3 CGRID_SPCS CGRID_SPCS.F

file,nfields-1 HGRD_DEFN.F 2
modName,modFile 2 UTILIO_DEFN UTILIO_DEFN.F

file,nfields-1 icon.F 6
modName,modFile 2 HGRD_DEFN HGRD_DEFN.F
modName,modFile 3 VGRD_DEFN VGRD_DEFN.F
modName,modFile 4 UTILIO_DEFN UTILIO_DEFN.F
modName,modFile 5 CGRID_SPCS CGRID_SPCS.F
modName,modFile 6 IC_PARMS IC_PARMS.F

file,nfields-1 lat_lon.F 2
modName,modFile 2 UTILIO_DEFN UTILIO_DEFN.F

file,nfields-1 lr_interp.F 2
modName,modFile 2 UTILIO_DEFN UTILIO_DEFN.F

file,nfields-1 lst_spc_map.F 4
modName,modFile 2 UTILIO_DEFN UTILIO_DEFN.F
modName,modFile 3 CGRID_SPCS CGRID_SPCS.F
modName,modFile 4 IC_PARMS IC_PARMS.F

file,nfields-1 ngc_spc_map.F 4
modName,modFile 2 UTILIO_DEFN UTILIO_DEFN.F
modName,modFile 3 CGRID_SPCS CGRID_SPCS.F
modName,modFile 4 IC_PARMS IC_PARMS.F

file,nfields-1 opn_ic_file.F 6
modName,modFile 2 HGRD_DEFN HGRD_DEFN.F
modName,modFile 3 VGRD_DEFN VGRD_DEFN.F
modName,modFile 4 UTILIO_DEFN UTILIO_DEFN.F
modName,modFile 5 CGRID_SPCS CGRID_SPCS.F
modName,modFile 6 IC_PARMS IC_PARMS.F

file,nfields-1 setup_logdev.F 2
modName,modFile 2 UTILIO_DEFN UTILIO_DEFN.F

file,nfields-1 subhdomain.F 2
modName,modFile 2 UTILIO_DEFN UTILIO_DEFN.F

file,nfields-1 UTILIO_DEFN.F 3
modName 2 M3UTILIO -------------
modName 3 PARUTILIO -------------

file,nfields-1 VGRD_DEFN.F 2
modName,modFile 2 UTILIO_DEFN UTILIO_DEFN.F

file,nfields-1 prof_driver.F 4
modName,modFile 2 UTILIO_DEFN UTILIO_DEFN.F
modName,modFile 3 CGRID_SPCS CGRID_SPCS.F
modName,modFile 4 IC_PARMS IC_PARMS.F

file,nfields-1 prof_icout.F 5
modName,modFile 2 HGRD_DEFN HGRD_DEFN.F
modName,modFile 3 VGRD_DEFN VGRD_DEFN.F
modName,modFile 4 UTILIO_DEFN UTILIO_DEFN.F
modName,modFile 5 IC_PARMS IC_PARMS.F

file,nfields-1 prof_vinterp.F 5
modName,modFile 2 HGRD_DEFN HGRD_DEFN.F
modName,modFile 3 VGRD_DEFN VGRD_DEFN.F
modName,modFile 4 UTILIO_DEFN UTILIO_DEFN.F
modName,modFile 5 IC_PARMS IC_PARMS.F

USE/MODULE dependencies defined

Makefile generated
ifort -qopenmp UTILIO_DEFN.o HGRD_DEFN.o IC_PARMS.o CGRID_SPCS.o VGRD_DEFN.o findex.o gc_spc_map.o get_envlist.o icon.o lat_lon.o lr_interp.o lst_spc_map.o ngc_spc_map.o opn_ic_file.o setup_logdev.o subhdomain.o prof_driver.o prof_icout.o prof_vinterp.o -L/home/ensiyeh/WRF-CMAQ/CMAQ_REPO/lib/x86_64/intel/ioapi/lib -lioapi -L/home/ensiyeh/WRF-CMAQ/CMAQ_REPO/lib/x86_64/intel/netcdf/lib -lnetcdf -lnetcdff -lcurl -o ICON_v52_profile.exe
else
endif
mv Makefile Makefile.intel
mv: ‘Makefile’ and ‘Makefile.intel’ are the same file
ln -s Makefile.intel Makefile
ln: failed to create symbolic link ‘Makefile’: File exists
if ( 1 != 0 ) then
echo *** failure in /home/ensiyeh/WRF-CMAQ/CMAQ_REPO/UTIL/bldmake/bldmake_intel.exe -serial -verbose ***
*** failure in /home/ensiyeh/WRF-CMAQ/CMAQ_REPO/UTIL/bldmake/bldmake_intel.exe -serial -verbose ***
exit 1

I used these environment variables:

export CC=icc

export CXX=icpc

export CFLAGS=’-O3 -xHost -ip -no-prec-div -static-intel’

export CXXFLAGS='-O3 -xHost -ip -no-prec-div -static-intel' ``

export F77=ifort

export FC=ifort

export F90=ifort

export FFLAGS='-O3 -xHost -ip -no-prec-div -static-intel' ``

export CPP='icc -E' ``

export CXXCPP='icpc -E'

and the CMAQ use these:
setenv myFC ifort
setenv myCC icc
setenv myFSTD “-O3 -fno-alias -mp1 -fp-model source -qopenmp”
setenv myDBG “-O0 -g -check bounds -check uninit -fpe0 -fno-alias -ftrapuv -traceback”
setenv myLINK_FLAG “-qopenmp”
setenv myFFLAGS “-fixed -132”
setenv myFRFLAGS “-free”
setenv myCFLAGS “-O2”
setenv extra_lib “-lcurl”
#setenv extra_lib “”
setenv mpi_lib “” #> No Library specification needed for mpiifort
#> -lmpich for mvapich
#> -lmpi for openmpi

Can I change the CMAQ’s environment variables according to my environment variables?

Really, what matters is that you end up with a Makefile in the build-directory, and that you then run make on it. So you should be OK if you do that…

1 Like