Downloading one year ERA5 data

General questions and postings pertaining to the use of HYSPLIT regardless of the platform. For platform specific questions, use the HYSPLIT Platform forums.
Post Reply
prerita
Posts: 5
Joined: June 27th, 2024, 6:19 am
Registered HYSPLIT User: No

Downloading one year ERA5 data

Post by prerita »

Hi

I intend to download all the months using the script here https://github.com/amcz/hysplit_metdata ... ra5_cds.py
But the given Python only downloads for one month and one date.
I changed the string for month and year, but it still takes the default option.

Additionally, cds client has a limit of 60,000 and I wish to download all the months without having to change script each time.

Can anyone advise please ?
alicec
Posts: 439
Joined: February 8th, 2016, 12:56 pm
Registered HYSPLIT User: Yes

Re: Downloading one year ERA5 data

Post by alicec »

you can create a script to call get_era5_cds.py in a loop to get all the dates you want.
An example bash script is below.

Code: Select all

#!/bin/sh
# Example bash script for retrieving ERA5 for a small area.
# Author: Alice Crawford   Organization: NOAA/OAR/ARL

# Example for downloading and converting ERA5 data on pressure levels
# for a relatively small area.

# python call
MDL="python"

#Location of get_era5_cds.py
PDL=$HOME/hysplit_metdata
year=2020

#small area to retrieve
# upper left lat/ upper left lon / lower right lat / lower right lon
# NORTH/WEST/SOUTH/EAST
area="65/150/40/180"

#directory to write files to.
outdir='./'

for month in '10'
do
     #for day  in   $(seq 23  22)
     for day  in   23
     do
              echo "RETRIEVING  month $month day $day"
              # retrieves pressure level files
              $MDL ${PDL}/get_era5_cds.py  --3d -s enda  -y $year -m $month  -d $day --dir $outdir  -g  --area $area
              # retrieves surface data files with all variables
              $MDL ${PDL}/get_era5_cds.py  --2da -s enda  -y $year -m $month  -d $day --dir $outdir  -g  --area $area
     done
done
prerita
Posts: 5
Joined: June 27th, 2024, 6:19 am
Registered HYSPLIT User: No

Re: Downloading one year ERA5 data

Post by prerita »

Hi Alice,

Many thanks for this. That is helpful.
I have another question about your script /get_era5_cds.py.

I changed the 'month' : monthstr, to 'month' : [ '01' ],
in all the server.retrieve instances

hoping that it will not take the default month but the month that I provided.

However, the get_era5_message.txt still says 'retrieving 3d data for 2009-12-01' (which is the default option) and it writes the output file name as ERA5_2009.Dec01.3dpl.grib but the actual dates in grib file are 2009-01-01.

Why does it write dec in the downloaded files ?
I am not sure why. Can you advise?

Best, Prerita
Post Reply

Return to “Users”