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

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,

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

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,

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

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

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,

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.

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

netcdf-Fortran depends on netCDF-C

I/O API build instructions

Please also see the tutorials install libraries for gcc for how to build the libraries.

tutorials install libraries using intel compiler

I have some example scripts to install both netCDF-C and netCDF-Fortran for the
netCDF-classic 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

Example on how to use environment modules to manage libraries

1 Like