# Initialization CMAQ on Rhea

**URL:** <https://forum.cmascenter.org/t/initialization-cmaq-on-rhea/1081>\
**Category:** Compiling\
**Tags:** admin\
**Created:** [October 29, 2019, 4:53am UTC](https://forum.cmascenter.org/t/initialization-cmaq-on-rhea/1081 "2019-10-29T04:53:46Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![ckuo6](https://avatars.discourse-cdn.com/v4/letter/c/b9bd4f/32.png) [@ckuo6](https://forum.cmascenter.org/u/ckuo6)\
**Post date:** [October 29, 2019, 4:53am UTC](https://forum.cmascenter.org/t/initialization-cmaq-on-rhea/1081/1 "2019-10-29T04:53:46Z")

</div>

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

```auto
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.

---

<div class="post-metadata">

**Author:** ![lizadams](https://avatars.discourse-cdn.com/v4/letter/l/49beb7/32.png) [@lizadams](https://forum.cmascenter.org/u/lizadams)\
**Post date:** [October 29, 2019, 1:55pm UTC](https://forum.cmascenter.org/t/initialization-cmaq-on-rhea/1081/2 "2019-10-29T13:55:35Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![ckuo6](https://avatars.discourse-cdn.com/v4/letter/c/b9bd4f/32.png) [@ckuo6](https://forum.cmascenter.org/u/ckuo6)\
**Post date:** [October 30, 2019, 2:54am UTC](https://forum.cmascenter.org/t/initialization-cmaq-on-rhea/1081/3 "2019-10-30T02:54:28Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![cjcoats](https://avatars.discourse-cdn.com/v4/letter/c/ac8455/32.png) [@cjcoats](https://forum.cmascenter.org/u/cjcoats)\
**Post date:** [October 30, 2019, 7:01pm UTC](https://forum.cmascenter.org/t/initialization-cmaq-on-rhea/1081/4 "2019-10-30T19:01:24Z")

</div>

From the I/O API Installation manual:  
[https://www.cmascenter.org/ioapi/documentation/all\_versions/html/AVAIL.html#warn](https://www.cmascenter.org/ioapi/documentation/all_versions/html/AVAIL.html#warn):

> You are best off if you can build the whole modeling system (l_ibnetcdf.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](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.

---

<div class="post-metadata">

**Author:** ![lizadams](https://avatars.discourse-cdn.com/v4/letter/l/49beb7/32.png) [@lizadams](https://forum.cmascenter.org/u/lizadams)\
**Post date:** [November 7, 2019, 6:07pm UTC](https://forum.cmascenter.org/t/initialization-cmaq-on-rhea/1081/5 "2019-11-07T18:07:58Z")

</div>

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

> <https://github.com/USEPA/CMAQ/blob/master/DOCS/Users_Guide/Tutorials/README.md>

---

<div class="post-metadata">

**Author:** ![ckuo6](https://avatars.discourse-cdn.com/v4/letter/c/b9bd4f/32.png) [@ckuo6](https://forum.cmascenter.org/u/ckuo6)\
**Post date:** [November 7, 2019, 9:53pm UTC](https://forum.cmascenter.org/t/initialization-cmaq-on-rhea/1081/6 "2019-11-07T21:53:02Z")

</div>

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