I used the script below to download the input ERA5 data (single and pressure levels).
I used namelist.input and namelist.wps files as you can find in the attachments below (also domains image). Then I followed the steps in this link and completed the metgrid step, but I got the following error during the real.exe step.
My input data actually covers the entire global area, yet I still can't understand why I'm getting this error.
Can anyone help me with this?
import cdsapi
import sys
from datetime import datetime, timedelta
def retrieve_data(date, c):
year = date.strftime('%Y')
month = date.strftime('%m')
day = date.strftime('%d')
# Retrieve pressure levels data
c.retrieve(
'reanalysis-era5-pressure-levels',
{
'product_type': 'reanalysis',
'format': 'grib',
'variable': [
'geopotential', 'relative_humidity', 'specific_humidity', 'temperature',
'u_component_of_wind', 'v_component_of_wind', 'vertical_velocity'
],
'pressure_level': [
"50", "100", "150",
"200", "250", "300",
"350", "400", "450",
"500", "550", "600",
"650", "700", "750",
"800", "850", "900",
"925", "950", "975",
"1000"
],
'year': year,
'month': month,
'day': day,
'time': [
"00:00", "01:00", "02:00",
"03:00", "04:00", "05:00",
"06:00", "07:00", "08:00",
"09:00", "10:00", "11:00",
"12:00", "13:00", "14:00",
"15:00", "16:00", "17:00",
"18:00", "19:00", "20:00",
"21:00", "22:00", "23:00"
],
# 'area': [44, 26, 38, 32]
},
f'era5_pl_{year}{month}{day}.grib'
)
# Retrieve surface levels data
c.retrieve(
'reanalysis-era5-single-levels',
{
'product_type': 'reanalysis',
'variable': [
'10m_u_component_of_wind', '10m_v_component_of_wind', '2m_dewpoint_temperature',
'2m_temperature', 'geopotential', 'land_sea_mask', 'mean_sea_level_pressure', 'sea_ice_cover',
'sea_surface_temperature', 'snow_depth', 'soil_temperature_level_1', 'skin_temperature',
'soil_temperature_level_2', 'soil_temperature_level_3', 'soil_temperature_level_4', 'surface_pressure',
'volumetric_soil_water_layer_1', 'volumetric_soil_water_layer_2', 'volumetric_soil_water_layer_3', 'volumetric_soil_water_layer_4',
],
'year': year,
'month': month,
'day': day,
'time': [
"00:00", "01:00", "02:00",
"03:00", "04:00", "05:00",
"06:00", "07:00", "08:00",
"09:00", "10:00", "11:00",
"12:00", "13:00", "14:00",
"15:00", "16:00", "17:00",
"18:00", "19:00", "20:00",
"21:00", "22:00", "23:00"
],
'format': 'grib',
# 'area': [44, 26, 38, 32]
},
f'era5_sfc_{year}{month}{day}.grib'
)
def main():
if len(sys.argv) != 2:
print("Usage: script.py YYYYMMDD-YYYYMMDD")
sys.exit(1)
date_range = sys.argv[1]
start_date_str, end_date_str = date_range.split('-')
start_date = datetime.strptime(start_date_str, '%Y%m%d')
end_date = datetime.strptime(end_date_str, '%Y%m%d')
c = cdsapi.Client()
current_date = start_date
while current_date <= end_date:
retrieve_data(current_date, c)
current_date += timedelta(days=1)
if __name__ == "__main__":
main()
I used namelist.input and namelist.wps files as you can find in the attachments below (also domains image). Then I followed the steps in this link and completed the metgrid step, but I got the following error during the real.exe step.
My input data actually covers the entire global area, yet I still can't understand why I'm getting this error.
Can anyone help me with this?
*************************************
Nesting domain
ids,ide,jds,jde 1 805 1 424
ims,ime,jms,jme -4 213 -4 117
ips,ipe,jps,jpe 1 201 1 106
INTERMEDIATE domain
ids,ide,jds,jde 45 318 28 174
ims,ime,jms,jme 40 123 23 74
ips,ipe,jps,jpe 43 113 26 64
*************************************
d01 2024-05-11_00:00:00 alloc_space_field: domain 2 , 59265024 bytes allocated
d01 2024-05-11_00:00:00 alloc_space_field: domain 2 , 988285348 bytes allocated
d02 2024-05-07_00:00:00 Yes, this special data is acceptable to use: OUTPUT FROM METGRID V4.6.0
d02 2024-05-07_00:00:00 Input data is acceptable to use: met_em.d02.2024-05-07_00:00:00.nc
metgrid input_wrf.F first_date_input = 2024-05-07_00:00:00
metgrid input_wrf.F first_date_nml = 2024-05-07_00:00:00
d02 2024-05-07_00:00:00 Timing for input 2 s.
d02 2024-05-07_00:00:00 flag_soil_layers read from met_em file is 1
Using sfcprs3 to compute psfc
d02 2024-05-07_00:00:00 No average surface temperature for use with inland lakes
Assume Noah LSM input
d02 2024-05-07_00:00:00 forcing artificial silty clay loam at 1645 points, out of 21306
d02 2024-05-07_00:00:00 Timing for processing 1 s.
d02 2024-05-07_00:00:00 Timing for output 6 s.
d02 2024-05-07_00:00:00 Timing for loop # 1 = 9 s.
-------------- FATAL CALLED ---------------
FATAL CALLED FROM FILE: <stdin> LINE: 189
real_em.F: Could not find the parent domain
-------------------------------------------