Scheduled Downtime
On Friday 21 April 2023 @ 5pm MT, this website will be down for maintenance and expected to return online the morning of 24 April 2023 at the latest

wrfout files are not in netcdf4 format

Parvathy

New member
i was running the wrf model and using xarray and wrf-python to do the post analysis. the files were being opened but recently, in some simulations that i did, the files are not opening using xarray nor via wrf-python. It is showing HDF error. i am able to open the files by h5py so the files are not corrupt. i thought it is because the path to netcdf4 is not being taken in properly and so i entered the commands:

export LD_LIBRARY_PATH="/home/sigma/WRF/Libs/NETCDF/lib/"
export NETCDF="/home/sigma/WRF/Libs/NETCDF"
export DIR="/home/sigma/WRF/Libs"
export CC="gcc"
export CXX="g++"
export FC="gfortran"
export FCFLAGS="-64"
export JASPERLIB="$DIR/grib2/lib"
export JASPERINC="$DIR/grib2/include"
export LDFLAGS="-L$DIR/NETCDF/lib"
export CPPFLAGS="-I$DIR/NETCDF/include"

just to be safe. But still it is showing the same error. For verification, i ran the same namelist.input that i ran previously for which i got the output which i was able to open via xarray, and now the newly produced files i am not able to open like that. so what could be the issue now?

i will attach the screenshot of the same error and the namelists and rsl.out.0000 and rsl.error.0000 for the reference.
 

Attachments

  • Screenshot from 2024-07-26 11-05-14.png
    Screenshot from 2024-07-26 11-05-14.png
    252.7 KB · Views: 4
  • namelist.wps
    941 bytes · Views: 0
  • namelist.input
    4.1 KB · Views: 2
  • rsl.error.0000
    3.4 MB · Views: 0
  • rsl.out.0000
    3.4 MB · Views: 0
Are you able to open the wrfout* files using a netCDF utility like ncview or using an ncdump command? If so, then the files are in netCDF format, and the issue is likely with the post-processor.
 
Yes sir, ncdump is showing the dimensions variables and everything. Thank you.
Actually i have been using wrf-python as well as xarray until last week in the same system to do the analyses. as per your suggestion, ncdump is working for both old and new wrf runs but now the whole xarray and wrf-python are not able to open the old files as well. @kwerner, thanks for the information, i guess something must have happened with the python environment, because arwpost is working. i will make a new environment and see how it goes.
@William.Hatheway, in my laptop, i installed it using the pip command. In my workstation, wrf-python was installed along with wrf using wrf-mosit. Its not an issue of installation as they were working fine till last week. That was why i was thinking something happened with wrf outputs.
Actually, last week in my laptop as well as in my workstation i had installed some python libraries and so I guess something happened with wrf-python and xarray after that.
 
Yes sir, ncdump is showing the dimensions variables and everything. Thank you.
Actually i have been using wrf-python as well as xarray until last week in the same system to do the analyses. as per your suggestion, ncdump is working for both old and new wrf runs but now the whole xarray and wrf-python are not able to open the old files as well. @kwerner, thanks for the information, i guess something must have happened with the python environment, because arwpost is working. i will make a new environment and see how it goes.
@William.Hatheway, in my laptop, i installed it using the pip command. In my workstation, wrf-python was installed along with wrf using wrf-mosit. Its not an issue of installation as they were working fine till last week. That was why i was thinking something happened with wrf outputs.
Actually, last week in my laptop as well as in my workstation i had installed some python libraries and so I guess something happened with wrf-python and xarray after that.
@Parvathy

wrf-python using wrf-mosit is installed via conda. To activate it you type this into the terminal

conda activate wrf-python


The reason wrf-python doesn't work with pip installation is because when you install pip it gets the latest versions of the required packages and something changed with the newer packages that won't let wrf-python work properly for netcdf4. I think NCAR is working on a fix.

The conda package is frozen in time so that it will work with archived packages.
 
Top