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
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.
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”.
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.
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.