# Installing WRF-CMAQ two-way online - issue with installing netcdf-fortran

**URL:** <https://forum.cmascenter.org/t/installing-wrf-cmaq-two-way-online-issue-with-installing-netcdf-fortran/2547>\
**Category:** WRF-CMAQ\
**Created:** [July 30, 2021, 4:29pm UTC](https://forum.cmascenter.org/t/installing-wrf-cmaq-two-way-online-issue-with-installing-netcdf-fortran/2547 "2021-07-30T16:29:42Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![setraseti123](https://avatars.discourse-cdn.com/v4/letter/s/8797f3/32.png) [@setraseti123](https://forum.cmascenter.org/u/setraseti123)\
**Post date:** [July 30, 2021, 4:29pm UTC](https://forum.cmascenter.org/t/installing-wrf-cmaq-two-way-online-issue-with-installing-netcdf-fortran/2547/1 "2021-07-30T16:29:42Z")

</div>

Dear all,  
I am trying to install WRF-CMAQ two-way online using gfortran compiler on HPC.  
However once I installed netcdf-c-4.8.0 and try to install netcdf-fortran-4.5.3 I received this error :  
**netcdf-c version 4.7.4 or greater is required**  
Why should I get this error?

This the configuration for netcdf-c:

CPPFLAGS=“-I/backup/seti/setii/Build\_WRFCMAQ/LIBRARIES/curl/include”\

LDFLAGS=“-L/backup/seti/setii/Build\_WRFCMAQ/LIBRARIES/curl/lib”\

./configure --prefix=/backup/seti/setii/Build\_WRFCMAQ/LIBRARIES/netcdf --disable-netcdf-4

and this is for netcdf-fortran :

CPPFLAGS=“-I/backup/seti/setii/Build\_WRFCMAQ/LIBRARIES/netcdf/include”\

LDFLAGS=“-L/backup/seti/setii/Build\_WRFCMAQ/LIBRARIES/netcdf/lib”\

./configure --prefix=/backup/seti/setii/Build\_WRFCMAQ/LIBRARIES/netcdf

May I ask you please help me to sort this issue out?  
Many thanks in advance,  
Best wishes,

---

<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:** [July 30, 2021, 4:38pm UTC](https://forum.cmascenter.org/t/installing-wrf-cmaq-two-way-online-issue-with-installing-netcdf-fortran/2547/2 "2021-07-30T16:38:14Z")

</div>

This one probably needs to go to WRF support at NCAR.

---

<div class="post-metadata">

**Author:** ![setraseti123](https://avatars.discourse-cdn.com/v4/letter/s/8797f3/32.png) [@setraseti123](https://forum.cmascenter.org/u/setraseti123)\
**Post date:** [July 30, 2021, 6:44pm UTC](https://forum.cmascenter.org/t/installing-wrf-cmaq-two-way-online-issue-with-installing-netcdf-fortran/2547/3 "2021-07-30T18:44:46Z")

</div>

Dear cjcoats,  
Thanks for your advice, however if anyone faced the same issue and could resolve the problem please inform me.  
Many thanks,  
Best wishes,

---

<div class="post-metadata">

**Author:** ![ever.barreto](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.cmascenter.org/ever.barreto/32/778_2.png) [@ever.barreto](https://forum.cmascenter.org/u/ever.barreto)\
**Post date:** [July 30, 2021, 8:00pm UTC](https://forum.cmascenter.org/t/installing-wrf-cmaq-two-way-online-issue-with-installing-netcdf-fortran/2547/4 "2021-07-30T20:00:53Z")

</div>

@setraseti123 have you tried installing NetCDF-C 4.7.4 instead of 4.8.0?

---

<div class="post-metadata">

**Author:** ![setraseti123](https://avatars.discourse-cdn.com/v4/letter/s/8797f3/32.png) [@setraseti123](https://forum.cmascenter.org/u/setraseti123)\
**Post date:** [July 31, 2021, 6:21am UTC](https://forum.cmascenter.org/t/installing-wrf-cmaq-two-way-online-issue-with-installing-netcdf-fortran/2547/5 "2021-07-31T06:21:40Z")

</div>

Dear ever.barreto,  
No, I did not install NetCDF-C 4.7.4.

---

<div class="post-metadata">

**Author:** ![setraseti123](https://avatars.discourse-cdn.com/v4/letter/s/8797f3/32.png) [@setraseti123](https://forum.cmascenter.org/u/setraseti123)\
**Post date:** [August 1, 2021, 11:36am UTC](https://forum.cmascenter.org/t/installing-wrf-cmaq-two-way-online-issue-with-installing-netcdf-fortran/2547/6 "2021-08-01T11:36:25Z")

</div>

Dear all,  
I could solve the issue. I share my experience here whit those who may face the same issue.  
After installing netcdf-c version 4.7.4, before configuring netcdf-fortran, it is important to export **LD\_LIBRARY\_PATH=/backup/seti/setii/Build\_WRFCMAQ/LIBRARIES/netcdf/lib:$LD\_LIBRARY\_PATH**  
This way I could remove the error.  
Hope this help  
Best wishes,

---

<div class="post-metadata">

**Author:** ![vaishnavi\_198](https://avatars.discourse-cdn.com/v4/letter/v/b782af/32.png) [@vaishnavi\_198](https://forum.cmascenter.org/u/vaishnavi_198)\
**Post date:** [December 24, 2023, 3:00pm UTC](https://forum.cmascenter.org/t/installing-wrf-cmaq-two-way-online-issue-with-installing-netcdf-fortran/2547/7 "2023-12-24T15:00:46Z")

</div>

hey, i am absolutely new to installing WRF. i want to know why setting LD\_LIBRARY\_PATH solves the issue. How did you figure out that not setting it was the problem, because in almost none of the guides for installation have they mentioned this (or maybe i overlooked). Your response would be of great help to me.

---

<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:** [January 5, 2024, 6:00pm UTC](https://forum.cmascenter.org/t/installing-wrf-cmaq-two-way-online-issue-with-installing-netcdf-fortran/2547/8 "2024-01-05T18:00:13Z")

</div>

Please consult the install instructions provided by Unidata for netCDF-C and netCDF-Fortran, and also the install instructions for I/O API. We have recommended in the past that folks build without netCDF-4 support or remote client access. If you are trying to run CMAQ for \*.nc4 files, such as are available in the EQUATES data, you will need to build the libraries with netCDF-4 support.

[netCDF-C](https://docs.unidata.ucar.edu/nug/current/getting_and_building_netcdf.html#build_classic)

[netcdf-Fortran depends on netCDF-C](https://docs.unidata.ucar.edu/netcdf-c/current/building_netcdf_fortran.html)

[I/O API build instructions](https://www.cmascenter.org/ioapi/documentation/all_versions/html/AVAIL.html#build)

Please also see the [tutorials install libraries for gcc](https://github.com/USEPA/CMAQ/blob/main/DOCS/Users_Guide/Tutorials/CMAQ_UG_tutorial_build_library_gcc.md) for how to build the libraries.

[tutorials install libraries using intel compiler](https://github.com/USEPA/CMAQ/blob/main/DOCS/Users_Guide/Tutorials/CMAQ_UG_tutorial_build_library_intel.md)

I have some example scripts to install both netCDF-C and netCDF-Fortran for the  
[netCDF-classic](https://github.com/CMASCenter/pcluster-cmaq/blob/main/install/gcc_netcdf_alinux.csh) version

You can review and/or download the script and then modify the directory paths to see if you can get it working on your system.

Once these libraries are installed, I highly recommend following instructions to use environment modules if you have them available on your machine.

The advantage of using environment modules is that if you need to switch between netcdf-classsic and netcdf-hdf5 versions, this is easier to do.

See [custom modules from Princeton](https://researchcomputing.princeton.edu/support/knowledge-base/custom-modules)

[Example on how to use environment modules to manage libraries](https://pcluster-cmaq.readthedocs.io/en/latest/user_guide_pcluster/developers_guide/cmaq-vm/install.html#create-custom-environment-module-for-libraries)
