Failed to install CCTM

Hi there,
I followed the WRF-CMAq installation document, and modified the config_cmaq.csh. Then run bldit_cctm.csh script. The following error occurred, anyone can help me, thanks.

if ( ! 1 ) then
if ( 0 != 0 ) then
if ( -e /home/lth/WRF-CMAQ/CMAQ_Project/CCTM/scripts/BLD_CCTM_v533_gcc/CCTM_v533.cfg ) then
mv CCTM_v533.cfg.bld /home/lth/WRF-CMAQ/CMAQ_Project/CCTM/scripts/BLD_CCTM_v533_gcc/CCTM_v533.cfg
if ( 1 ) then
Illegal variable name.

bldit_cctm_twoway.txt (119.5 KB)
bldit_cctm.csh (31.9 KB)
config_cmaq.csh (12.3 KB)

Hi @tianhao,

The failure maybe coming from the ‘git --version’ command? Do you have git installed on your system?

Hi Tianhao,

You might consider the manual way to build the coupled model.

 -- download WRF 4.4
 -- build CMAQ by executing bldit_cctm.csh with build_twoway turns on
 -- move the built CMAQ code, BLD* into WRF direction with the name cmaq
 -- setenv WRF_CMAQ 1
 -- setenv IOAPI /home/wdx/lib/x86_64/gcc-9.1/ioapi_3.2   (this is an example for gcc)
 -- setenv WRFIO_NCD_LARGE_FILE_SUPPORT 1
     (you can put these three setenv lines in your .bashrc or .cshrc and are activated every time you login in)
 -- configure
 -- compile em_real

Cheers,
David

1 Like

Hi fsidi,
Thank you for your reply, I have installed git on my system.

lth@lth-virtual-machine:~$ git --version
git version 2.25.1

Hi david,
Thank you for your reply. I think some wrong with my git. If I only turn on build_twoway , the same problem(‘Illegal variable name’) occurs. How should I modify the bldit_cctm.csh to only build the CMAQ portion without going through downloading WRF process.

1 Like

Hi Tianhao,

Sorry to hear the git is not working. In theory you should have a BLD* already created. Please check.

Cheers,
David

Hi David,
The BLD_CCTM_v533_gcc has created, but there was no CCTM_v533.exe in the directory. Only when I turn off the build_twoway, the CCTM_v533.exe can be created in the directory.

lth@lth-virtual-machine:~/WRF-CMAQ/CMAQ5.3.3/CCTM/scripts$ ls -c
bldit_cctm_twoway.log  run_cctm_Bench_2016_12SE1.WRFCMAQ.csh  isam_control.txt         run_cctm_2015_HEMI.csh   run_cctm_2010_4CALIF1.csh
BLD_CCTM_v533_gcc      run_cctm_Bench_2016_12SE1.csh          lonlat.csv               run_cctm_2014_12US1.csh  run_cctm_Bench_2011_12SE1.csh
bldit_cctm.csh         sensinput.dat                          run_cctm_2016_12US1.csh  run_cctm_2011_12US1.csh
lth@lth-virtual-machine:~/WRF-CMAQ/CMAQ5.3.3/CCTM/scripts/BLD_CCTM_v533_gcc$ ls -a
.                             GC_cb6r3_ae7_aq.nml    pa_getrxns.F             SEDIMENTATION.F
..                            getalpha.F             pa_getrxnsum.F           se_disp_info_ext.f
ABFLUX_MOD.F                  get_env_mod.f90        PA_GLOBAL.F              se_domain_info_ext.f
acmcld.f                      getfline.f             PAGRD_DEFN.F             se_gather_module.f
advbc_map.F                   getparb.f              pa_init.F                se_global_max_module.f
advstep.F                     getpar.f               PA_IPRDEF.F              se_global_min_module.f
AE_cb6r3_ae7_aq.nml           get_write_map.f        PA_IPRVARS.F             se_global_sum_module.f
AERO_BUDGET.F                 grdcheck.F             PA_IRR_CTL.F             se_init_module.F
AERO_DATA.F                   GRID_CONF.F            PA_IRR_module.F          se_internal_util_module.f
aero_depv.F                   gspro_biogenics.txt    pa_mkhdr.F               se_modules.f
aero_driver.F                 hadvppm.F              pa_molcloss.F            se_pe_info_ext.f
AERO_EMIS.F                   hcdiff3d.F             pa_molcprod.F            se_reconfig_grid_info_ext.f
AEROMET_DATA.F                hcontvel.F             pa_output.F              se_reconfig_grid_module.f
AERO_PHOTDATA.F               hdiff.F                PA_PARSE.F               se_slice_module.f
aero_sedv.F                   HGRD_DEFN.F            pa_read.F                se_subgrid_info_ext.f
AEROSOL_CHEMISTRY.F           HGSIM.F                pa_report.F              se_term_module.f
aero_subs.F                   hlconst.F              parsline.f               setup_logdev.F
alloc_data_mod.f              hppm.F                 parutilio.f              se_twoway_comm_module.f
aqchem.F                      hrdata_mod.F           pa_setup_ipr.F           se_util_module.f
AQ_DATA.F                     hrdriver.F             pa_setup_irr.F           SOA_DEFN.F
aq_map.F                      hrg1.F                 pa_update.F              SpecDef_cb6r3_ae7_aq.txt
ASX_DATA_MOD.F                hrg2.F                 PA_VARS.F                SpecDef_Dep_cb6r3_ae7_aq.txt
AVG_CONC.F                    hrg3.F                 pa_wrtpadefn.F           Species_Table_TR_0.nml
beis3.F                       hrg4.F                 PCGRID_DEFN.F            SSEMIS.F
BEIS_DEFN.F                   hrinit.F               PE_COMM.EXT              stack_group_data_module.F
BIDI_MOD.F                    hrno.F                 phot.F                   STD_CONC.F
BIOG_EMIS.F                   hrprodloss.F           PHOT_MET_DATA.F          STK_EMIS.F
biog_emis_param_module.F      hrrates.F              PHOT_MOD.F               STK_PRMS.F
CCTM_v533.cfg                 hrsolver.F             PHOTOLYSIS_ALBEDO.F      STM_MODULE.F
centralized_io_module.F       hveloc.F               PHOT_OPTICS.dat          STM_VARS.F
centralized_io_util_module.F  indexn.f               PIOGRID.EXT              subdmap.f
cgrid_depv.F                  init_degrade.F         pio_init.f               subhdomain.F
CGRID_SPCS.F                  initscen.F             piomaps_mod.f            subhfile.F
checkmem.f                    isocom.f               PIOVARS.EXT              tfabove.F
chkgrid.F                     isofwd.f               PISAM_DEFN.F             tfbelow.F
cksummer.F                    isorev.f               plmris.F                 tmpbeis.F
cldproc_acm.F                 isrpia.inc             plsprd.f                 tri.F
CLOUD_OPTICS.F                load_cgrid.F           pm3err.f                 twoway_aqprep.F90
cmaq_main.F                   log_header.F           pm3exit.f                twoway_aqprep_util.F90
coags.f                       LSM_MOD.F              pm3warn.f                twoway_cgrid_aerosol_spc_map_module.F90
complex_number_module.F90     lstepf.F               PMDIAG_DATA.F            twoway_data_module.F90
concld_prop_acm.F             LTNG_DEFN.F            PRECURSOR_DATA.F         twoway_feedback.F90
CONST.EXT                     lus_data_module.F      preplm.f                 twoway_header_data_module.F90
conv_cgrid.F                  LUS_DEFN.F             pshut3.F                 twoway_init_env_vars.F90
convcld_acm.F                 m3dry.F                PT3D_DEFN.F              twoway_met_param_module.F90
couplewrf.F                   Makefile.twoway        PTBILIN.F                twoway_rrtmg_aero_optics.F90
cropcal.F                     matrix1.F              PTMET.F                  twoway_sd_time_series.F90
crop_data_module.F            mech_cb6r3_ae7_aq.def  ptrwrite3.f              twoway_util_module.F90
CSQY_DATA_cb6r3_ae7_aq        MGEMIS.F               pwrgrdd.f                UDTYPES.F
CSQY_DATA.F                   mpcomm_init.F          pwrite3.f                UTILIO_DEFN.F
czangle.F                     NR_cb6r3_ae7_aq.nml    rdbcon.F                 vdiffacmx.F
deform.F                      o3totcol.f             rddepv.F                 VDIFF_DATA.F
degrade_data.F                OMI_1979_to_2019.dat   README.md                VDIFF_DIAG.F
degrade.F                     opaconc.F              rescld.F                 VDIFF_MAP.F
DEGRADE_SETUP_TOX.F           opapmdiag.F            rho_j.F                  vdiffproc.F
delta_zs.f                    opconc.F               RUNTIME_VARS.F           vertext_module.F
depv_data_module.F            opddep.F               RXNS_DATA_MODULE.F90     VGRD_DEFN.F
DEPV_DEFN.F                   opdepv_diag.F          RXNS_FUNC_MODULE.F90     vppm.F
DEPVVARS.F                    opemis.F               sa_array_init.F          wr_aconc.F
diffmsg.F                     openlayout.F           SA_DEFN.F                wr_avg_sa.F
distr_env.c                   opphot.F               sa_dim.F                 wr_cgrid.F
driver.F                      oppmdiag.F             SA_IRR_DEFN.F            wr_conc.F
DUST_EMIS.F                   oppt3d_diag.F          sa_matrix1.f             wrdaymsg.f
eddyx.F                       op_sa.F                sa_opwddep.F             wr_init.F
EMIS_DEFN.F                   opwdep.F               sa_tri.f                 write3_distr.f
EMISPRM.EXT                   pa_cb6r3_ae7_aq.ctl    SA_WRAP_AE.F             wr_sa_cgrid.F
EmissCtrl_cb6r3_ae7_aq.nml    pa_compmech.F          scavwdep.F               wr_sa.F
EMIS_VARS.F                   pa_datagen.F           sciproc.F                wrsubdmap.f
em_param_module.F             PA_DEFN.F              SEAS_STRAT_O3_MIN.F      WVEL_DEFN.F
FILES_CTM.EXT                 pa_errcheck.F          se_bndy_copy_info_ext.f  x_ppm.F
final_degrade.F               pa_getcoef.F           se_bndy_copy_module.f    y_ppm.F
find_degraded.F               pa_getcycle.F          se_comm_info_ext.f       zadvppmwrf.F
findex.f                      pa_getdesc.F           se_comm_module.f         zfdbc.f
fire_plmris.F                 pa_getfamily.F         se_data_copy_module.f
flcheck.F                     pa_getiprout.F         se_data_recv_module.f
gas_depv_map.F                pa_getirrout.F         se_data_send_module.f

Hi Tianhao,

 You don't need CCTM.exe since you are building a WRF-CMAQ coupled model where CMAQ is considered a set of subroutines in the WRF model. The very last step "compile em_real >& mylog" in the instructions I have provided will produce wrf.exe which is the WRF-CMAQ coupled model.

Cheers,
David

Thank you for your explanation. I will try again.

Hi @tianhao,

Yes seems like there is an issue with the git command and starting a new shell (maybe when you start the new shell your environment changes?). For future uses, you may want to investigate that but simply making a short script with only the git --version command. But for now as David has suggested, please manually try to build WRF-CMAQ

Please also note, that if you are trying to couple WRFv4.3-CMAQv5.3.3 to asses short-wave radiative aerosol feedback, that version contains a bug that impacts this feedback. This bug will be fixed in the next release of CMAQ and we recommend waiting, if you can. If you cannot, I’m sure we can assist you in patching this bug yourself.

Hi David,
I have installed WRF4.4, the directory contains the following files. Does this mean that I have successfully built the coupling model?

lth@lth-virtual-machine:~/WRF-CMAQ/CMAQ_Project/CCTM/scripts/WRFV4.4/main$ ls
convert_em.F                module_wrf_top.F    real_em.F    tc.exe
depend.common               module_wrf_top.f90  real_em.f90  wrf_ESMFMod.F
ideal_em.F                  module_wrf_top.mod  real_em.o    wrf.exe
ideal_nmm.F                 module_wrf_top.o    real.exe     wrf.F
libcmaqlib.a                ndown_em.F          real_nmm.F   wrf.f90
libwrflib.a                 ndown_em.f90        tc_em.F      wrf.o
Makefile                    ndown_em.o          tc_em.f90    wrf_SST_ESMF.F
module_initialize_real.mod  ndown.exe           tc_em.o

Hi fsidi,
Thank you for your suggestion. I’ll try to fix Git later. :rose:

1 Like

Hi Tianhao,

It looks like you have created an executable, wrf.exe, for the WRF-CMAQ coupled model. You can double check it by typing the following and see something return:

nm libcmaqlib.a | grep -i twoway_feedback

Cheers,
David

Hi Tianhao,

Please contact me directly wong.david-c@epa.gov for the path.

Cheers,
David

Hi David,
After I type the command, I get the following:

(base) lth@lth-virtual-machine:~/WRF-CMAQ/CMAQ_Project/CCTM/scripts/WRFV4.4/main$ nm libcmaqlib.a | grep -i twoway_feedback
twoway_feedback.o:

Hi Tianhao,

That confirmed your WRF-CMAQ module was built correctly.

Cheers,
David

Hi David,
Thank you for your help. :slightly_smiling_face: :slightly_smiling_face:
Cheers,
Tianhao

Hi Tianhao,

I have mentioned before that we have uncovered a bug in the WRf-CMAQ coupled model with CMAQ version 5.3 or later. Here is the way to fix the bug in twoway_feedback.F90:

– vi twoway_feedback.F90
– goto subroutine feedback_read
– add a new variable declaration

 integer, save :: loc_nlays

– add the following line right before “firstime = .false.”

 loc_nlays = nlays3d

– replace all occurance of NLAYS3D with loc_nlays after the
line "firstime = .false.

If you have any questions, please feel free to contact me (wong.david-c@epa.gov).

Cheers,
David

1 Like

Hi David,
Thank you for your patient reply. The file has been modified as you requested. I will contact you by email if I have any questions later.

Cheers,
Tianhao

Thanks Andshrew… I shall take the question to the sccm forum, see if I can get some traction there. To answer your query, We are a 3000 node, single site with just 2 DPs, a single MP, we don’t do anything complicated with it at all which is why it is so frustrating that the simple stuff is failing. Thanks for the input. I might look at running the upgrade, just in case there’s corruption in the install files as the upgrade might update them in \server\sms_Xxx\client… long shot…