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

Initializing MPAS-A with Near-Real-Time ERA5 Data

wxEpsilon

New member
Hi everyone,

I am conducting experiments to evaluate the forecast skill of MPAS-A for several heavy precipitation events in 2025/07. I know that era5_to_int.py is a useful tool for converting ERA5 data archived at NCAR into intermediate files for MPAS. However, the most up-to-date ERA5 data in the NCAR RDA archive is only available through May 2025.

So I attempted to download the required variables directly from CDSAPI, but era5_to_int.py encountered errors when processing them.

I wonder if there is any script or workflow for downloading near-real-time ERA5 data and converting it into the same format as the RDA archive for use with MPAS?

Any helps would be greatly appreciated!
 
Please see the attached python script that can be used to download ERA5 data from CDSAPI. Note that this script is provided by a user and some modification may be needed. It downloads data in GRIB format, which can be processed by WPS UNGRIB program.

Please try and hope it works for you.
 

Attachments

  • get_era5_hres_globe.py.txt
    3.1 KB · Views: 5
Please see the attached python script that can be used to download ERA5 data from CDSAPI. Note that this script is provided by a user and some modification may be needed. It downloads data in GRIB format, which can be processed by WPS UNGRIB program.

Please try and hope it works for you.
Thank you very much for your kind help! I would greatly appreciate it if you could help me identify any possible mistakes I may have made. 😀

I have created initial conditions using ERA5 (generated by myself) and GFS (from the Derecho archive), and ran MPAS with varying resolutions (60–15 km mesh centered over East Asia; mesoscale suite). However, I noticed that the precipitation results from the two sets of initial conditions differ significantly.

1755061937377.png
Apparently, the one initialized with GFS is more close to observation. So I speculate my ERA5 initial condition might be wrong. This is what I did:

1. Download ERA5 using the following script
import cdsapi

c = cdsapi.Client()

# Model levels
c.retrieve('reanalysis-era5-complete', {
'date': '2025-08-02',
'levelist': '1000/975/950/925/900/875/850/825/800/775/750/700/650/600/550/500/450/400/350/300/250/225/200/175/150/125/100/70/50/30/20/10/7/5/3/2/1',
'levtype': 'pl',
'param': '129/130/131/132/133',
'stream': 'oper',
'time': '12',
'type': 'an',
'area': 'global',
'grid': '0.25/0.25',
'format': 'grib',
}, 'era5_20250802_3d_globe.grib')

# Surface levels
c.retrieve("reanalysis-era5-complete", {
"date": "2025-08-02",
"levtype": "sfc",
"param": "31/34/39/40/41/42/43/67/129/134/139/141/151/165/166/167/168/170/172/183/235/236",
"stream": "oper",
"time": "12",
"type": "an",
"area": "global",
"grid": "0.25/0.25",
"format": "grib",
}, "era5_20250802_2d_globe.grib")

2. in ./WPS directory:
ln -s ./ungrib/Variable_Tables/Vtable.ECMWF ./Vtable
and ran the ungrib.exe twice for 3d and 2d fields.

3. cat PLEV:2025-08-02_12 SFC:2025-08-02_12 >> ERA5:2025-08-02_12

4. Ran MPAS-A (basically following the tutorial)

Could you advise whether my procedure might be incorrect? (directory for ERA5 run is /glade/derecho/scratch/yujiayou/mpas_tutorial/2025080212/ERA5/60-15km_variable_MS)
 
Did you run the python script to download ERA5? Where are the ERA5 and intermediate files located?
Hi Ming, thank you so much for your patience and help!

Yes. The intermediate files are located in /glade/derecho/scratch/yujiayou/mpas_tutorial/met_data
ERA5 files are in /glade/derecho/scratch/yujiayou/ERA5/mpas/era5_20250802_2d_globe.grib and era5_20250802_3d_globe.grib.
Python script to download ERA5 are /glade/derecho/scratch/yujiayou/ERA5/mpas/era5_download.py
 
Hi

I looked at your ERA5 data and intermediate files. They all look fine.

Repeating your case, I found almost zero moisture flux along the boundaries, which explains why the precipitation in your simulation is extremely low.

Please copy the code I modified, which is located at /glade/derecho/scratch/chenming/MPAS-V8.2.3/src/core_init_atmosphere/mpas_init_atm_cases.F, then recompile MPAS and rerun init_atmosphere to produce LBC files.

Let me know whether this solution can fix your problem. Thanks.
 
Hi

I looked at your ERA5 data and intermediate files. They all look fine.

Repeating your case, I found almost zero moisture flux along the boundaries, which explains why the precipitation in your simulation is extremely low.

Please copy the code I modified, which is located at /glade/derecho/scratch/chenming/MPAS-V8.2.3/src/core_init_atmosphere/mpas_init_atm_cases.F, then recompile MPAS and rerun init_atmosphere to produce LBC files.

Let me know whether this solution can fix your problem. Thanks.
Hi Ming,

Thank you for your kind help and patience! Sorry for the late reply. I was away on a short trip.

I believe you were looking at the experiment under:
/glade/derecho/scratch/yujiayou/mpas_tutorial/2025080212/3km_rMPAS
In this directory, I ran a 3 km regional MPAS simulation using ERA5 (both initial and LBC files), but it produced almost no precipitation. I will try using the modified mode you suggested to see if that resolves the issue.

However, the experiment I originally mentioned in this thread is a global variable-resolution run located at:
/glade/derecho/scratch/yujiayou/mpas_tutorial/2025080212/ERA5/60-15km_variable_MS
There are no LBC files for this simulation, and the results also show no precipitation.
For reference, the initial file is EastAsia.init.nc, which I compiled from ERA5:2025-08-02_12.

Since I am still new to MPAS-A, I am not sure what I might have done wrong in setting up this experiment. Any guidance you could provide would be greatly appreciated!
 
Hi,

I looked at your input file, "ERA5:2025-08-02_12", which doesn't contain any moisture information in the upper air. This is apparently the reason why you don't have any precipitation in your simulation.

How did you create the datafile ERA5:2025-08-02_12? Can you get the latest version of era5_to_int.py, then re-produce this file?

Please let me know how it works for you.
 
Hi,

I looked at your input file, "ERA5:2025-08-02_12", which doesn't contain any moisture information in the upper air. This is apparently the reason why you don't have any precipitation in your simulation.

How did you create the datafile ERA5:2025-08-02_12? Can you get the latest version of era5_to_int.py, then re-produce this file?

Please let me know how it works for you.
Hi Ming,

Thanks a lot for these helps!

I finally managed to convert the ERA5 file I downloaded into the same format as the RDA archive, and it can now be read by era5_to_int.py. The issue is now resolved!
 
Top