Welcome, Guest
Username: Password: Remember me

Here we can describe more what should be posted here

TOPIC: netcdf

netcdf 8 months 2 days ago #2544

Dear colleagues, as new comer I have produced an Harmonie forecast. The output is in grib but I would like to use python+netcdf. After setting the flag nc instead of grib1 in ecf/config_exp.h no nc files are produced unfortunately. I have run gl -nc on the command line and that produces many level data files for each parameter. In the documentation on gl I could not find a clue of how to resolve this.

So if anybody has a simple script to convert, say temperature only, to Netcdf that would be very helpful.
Last Edit: 8 months 2 days ago by Mirjam Tijhuis.

netcdf 8 months 2 days ago #2545

  • Ulf Andrae
  • Ulf Andrae's Avatar
  • Administrator
  • Posts: 308
  • Thank you received: 35

The nc output is not taken care of in NWP mode, only in climate mode. I hope some or our climate colleagues can guide you in the usage.


netcdf 8 months 2 days ago #2546

  • Bert van Ulft
  • Bert van Ulft's Avatar
  • Expert Boarder
  • Posts: 109
  • Thank you received: 22
Hi Mirjam,

it is possible to produce netcdf output by setting ARCHIVE_FORMAT=nc in config_exp.h, but as Ulf pointed out it may not work out of the box. We use this for the WINS50 reanalysis project for example. Could you point me to your experiment on ECMWF? I could try to figure out why it doesn't work for you.
You cannot use gl to convert a GRIB file to netcdf at the moment. To convert a FA file to netcdf afterwards, for just t2m you need to create a file with namelist like:
In this the FA name of the field you wish to convert is set. ref_date is needed because netcdf works with a time since a reference and the default in the code might not be appropriate.
To convert:
gl -nc $FA_file -n $namelist
in which FA_file is the path of the FA file you want to convert and $namelist is the path of the file with the namelist above. This will produce a netcdf file named e.g. tas_2020103100.nc.
There are many more options to control the conversion, have a look at:
* gl general: hirlam.org/trac/wiki/HarmonieSystemDocumentation/PostPP/gl
* nc/climate specifics: hirlam.org/trac/wiki/HarmonieClimate/HCLIM43/HCLIM_output
Alternative could be to read GRIB files in python. cfgrib (pypi.org/project/cfgrib) should have a netcdf-like feel, but I don't have experience with this.


Last Edit: 8 months 2 days ago by Bert van Ulft.
Time to create page: 0.076 seconds