Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to read in variables - ERA5 #13

Closed
hs2112 opened this issue Feb 13, 2023 · 5 comments
Closed

Unable to read in variables - ERA5 #13

hs2112 opened this issue Feb 13, 2023 · 5 comments

Comments

@hs2112
Copy link

hs2112 commented Feb 13, 2023

  • I downloaded surface variables corresponding to this selection - https://apps.ecmwf.int/data-catalogues/era5/?class=ea&stream=oper&expver=1&type=an&year=2005&month=jun&levtype=sfc - at a resolution of 0.3x0.3
  • ML level data was also downloaded at the same resolution and the two were emerged in python (as the two files had different GRIB editions and CDO was apparently not able to handle that)
  • Renamed u10 as u10m and modified attribute GRIB_cfVarNam to store the same, (as a try to address the 'invalid name' issue that followed); similarly for v10m and t2m
  • LINUX output/ error as follows:
  Read meteo data: data_in/ea_2005_06_20_00.nc
  Read meteo grid information...
  Time: 172540800.00 (2005-06-20, 00:00 UTC)
  Number of longitudes: 434
  Number of latitudes: 217

Error (libtrac.c, read_met_grid, l3578): NetCDF: Invalid dimension ID or name

Could you please help me debug? Thank you.

@hs2112
Copy link
Author

hs2112 commented Feb 13, 2023

Link to file: https://drive.google.com/file/d/1zjbK0nne6AVXtuRvx3qbhwuzbNKeg2er/view?usp=sharing
Hope you can take a look.

@hs2112 hs2112 changed the title Unable to read in 2D variables like t2m, u10m, v10m - ERA5 Unable to read in variables - ERA5 Feb 13, 2023
@hs2112
Copy link
Author

hs2112 commented Feb 13, 2023

Could it be because 'hy' variables and dimensions are missing in ea_2005_06_20_00.nc? They got removed when I converted to pressure levels, somehow. Also, they were named differently in my merged file and the ml level column called 'hybrid' did not have its first level mapped to the surface vars -
image

@lars2015
Copy link
Contributor

Hello hs2112,

thanks for sending the bug report!

I checked the netCDF meteo file you shared and fixed some issues with the MPTRAC code:

  • The old code required the vertical dimension of the netCDF files to be called "lev". The dimension name "plev" only worked under certain circumstances. I revised the code so that it works with both, "lev" and "plev" as the name of the vertical dimension.

  • In the old code, we assumed the netCDF variable for surface pressure is named "ps" or "PS". Alternatively, if log surface pressure is given, "lnps" or "LNPS" can be provided. I extended the code so that it can also handle the variable names "sp" or "SP" for surface pressure (as in your file).

  • Previously, we only worked with global meteo data, whereas your test file provides regional data for a lon-lat box. I modified the MPTRAC code a bit so that it can deal with local meteo input data. In the case of local input data, trajectories will be terminated when they leave the given lon-lat box. I tested the feature to some extent, and it seems to work fine, but I recommend carefully checking the model results for your application.

You would have to update to the most recent code version on the master branch, please.

Best regards
Lars

@hs2112
Copy link
Author

hs2112 commented Feb 20, 2023

Hi @lars2015,

Just moving my comments to the relevant issue.

thanks for the changes. Looks like it's able to read in the 2D variables for the parcel origin file now (issue #13) but it is still not writing the _atm and _grid files for the following timesteps.

My data files are 3 hours apart in time so we are concerned with a 3-hour timestep with files formatted as follows -
image

Log file -
logfile.log

Run script (run.sh saved as run.txt) -
run.txt

@lars2015
Copy link
Contributor

Hi @hs2112,

I've added the reply to issue #12.

Best regards
Lars

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants