Initialization CMAQ on Rhea

Hi all,

I’m a beginner of Linux and CMAQ. I followed the steps on the user manual of CMAQ and tried to initialize CMAQ environment (Chapter 5.5).
I got the problem when typing

source config_cmaq.csh 

and it showed

“setenv: command not found”
“setenv: command not found”
“setenv: command not found”

I have tried to switch the shell by “#csh” but it failed.

I also have loaded module “intel/19.0.0”, “netcdf/4.6.2”, “hdf5/1.8.18” and have IOAPI 3.2 in the same directory.

You can determine what shell you are using with the following command

echo $0

If you are using bash, it would explain the command not found message.

You may need to ask your systems administrator to change your shell to use tcsh as your login shell.

You can try entering the following at the command line to see if it changes the shell to csh and then set your compiler environment and then source the config_cmaq.csh

tcsh
setenv compiler intel
source config_cmaq.csh

Thanks for reply.

Now it said,

ERROR: /gpfs/alpine/cli138/world-shared/ckuo6/CMAQ/CMAQ-master/lib/x86_64/intel/netcdf/lib/libnetcdf.a does not exist in your CMAQ_LIB directorysource config_cmaq.csh intel! Check your installation before proceeding with CMAQ build.

It seems I need to modify the lline 85-89

    setenv NETCDF_LIB_DIR   netcdf_lib_intel   #> netCDF C directory path
    setenv NETCDF_INCL_DIR  netcdf_inc_intel   #> netCDF C directory path
    setenv NETCDFF_LIB_DIR  netcdff_lib_intel  #> netCDF Fortran directory path
    setenv NETCDFF_INCL_DIR netcdff_inc_intel  #> netCDF Fortran directory path

And I know in the manual it said,

If you encounter errors about libraries not being found, check the settings of the config_cmaq.csh script variables IOAPI, NETCDF, or MPI to ensure that they correctly point to the locations of these libraries on your Linux system.

But how do I know where the “netCDF C directory path” is ? I have already loaded module “netcdf/4.6.2”.

From the I/O API Installation manual:
https://www.cmascenter.org/ioapi/documentation/all_versions/html/AVAIL.html#warn:

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.

and https://www.cmascenter.org/ioapi/documentation/all_versions/html/AVAIL.html#ncf4:

NetCDF Version 4.1 and later also split the Fortran interfaces into a separate library libnetcdff.a As a result, much compatiblity with the infrastructure (Makefiles, etc.) is broken: you must modify all Makefiles, replacing -lnetcdf with -lnetcdff -lnetcdf

For netCDF 4.x, the C and Fortran packages are separate download-and-install problems, and create distinct directories for doing so. The C download-package will be named something like netcdf-4.4.tar.gz; the Fortran package netcdf-fortran-4.4.4.tar.gz. When unpacked, configured, and built, they will each have subdirectories under which the include-file are found, and likewise for the library-files. That is what these make-variables are talking about.

Please also review the tutorials that are available to help you get started.

Thanks for suggestion! I will get the help if I need.