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

How to use ERA5 grib data to generate initial conditions files using chgres_cube? #1001

Open
bnepal22 opened this issue Dec 3, 2024 · 4 comments

Comments

@bnepal22
Copy link

bnepal22 commented Dec 3, 2024

I was attempting to get the initial condition tile files from ERA5 reanalysis data in grib format. I downloaded following pressure level and surface level data individually as a single grib file:

pressure_level_variables: 'divergence', 'fraction_of_cloud_cover', 'geopotential', 'ozone_mass_mixing_ratio', 'potential_vorticity', 'relative_humidity', 'specific_cloud_ice_water_content', 'specific_cloud_liquid_water_content', 'specific_humidity', 'specific_rain_water_content', 'specific_snow_water_content', 'temperature', 'u_component_of_wind', 'v_component_of_wind', 'vertical_velocity', 'vorticity'

surface or single level variables: '10m_u_component_of_wind', '10m_v_component_of_wind', '2m_dewpoint_temperature', '2m_temperature', 'land_sea_mask', 'mean_sea_level_pressure', 'sea_ice_cover', 'sea_surface_temperature', 'skin_temperature', 'snow_density', 'snow_depth', 'soil_temperature_level_1', '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'

Then each downloaded data was converted to grib2 using eccodes and finally merged into single grib2 file to be used in chgres_cube script. However When I run the code I get the following errors:

#============= This error messsage appears just after reading grib2 data

/UFS/GFS.initial/20230530/ecmwf_20230530_t00z_sfc_plev_combined.grib2
**** ERROR: local table = 0 is not allowed, set to 1 ***
**** ERROR: local table = 0 is not allowed, set to 1 ***
**** ERROR: local table = 0 is not allowed, set to 1 ***
**** ERROR: local table = 0 is not allowed, set to 1 ***
**** ERROR: local table = 0 is not allowed, set to 1 ***
**** ERROR: local table = 0 is not allowed, set to 1 ***

#============= This message appears at last

  • CALL FieldScatter FOR INPUT DZDT.
  • READ TERRAIN.
  • FATAL ERROR: READING TERRAIN HEIGHT RECORD.
  • IOSTAT IS: 0
    application called MPI_Abort(MPI_COMM_WORLD, 999) - process 0

I have used the same GFSphys_var_map.txt without any modification.
It works perfectly for gfs data.

How to resolve this issue?

@GeorgeGayno-NOAA
Copy link
Collaborator

It is looking for terrain height and not finding it:
https://github.com/ufs-community/UFS_UTILS/blob/develop/sorc/chgres_cube.fd/atm_input_data.F90#L2794

@bnepal22
Copy link
Author

bnepal22 commented Dec 4, 2024

It is looking for terrain height and not finding it: https://github.com/ufs-community/UFS_UTILS/blob/develop/sorc/chgres_cube.fd/atm_input_data.F90#L2794

Thank you for your quick response.
As per the atm_input_data.F90, the terrain height is pointing towards geopotential height at surface level ( if I am correct)
So I downloaded the geopotential at the surface from ERA5 data ( it is in m2/s2 so I converted it to m by dividing it by 9.8) and again combined it to the main grib2 file and rerun the chgres_cube. It again shows the same error: "FATAL ERROR: READING TERRAIN HEIGHT RECORD."

@GeorgeGayno-NOAA
Copy link
Collaborator

It is looking for terrain height and not finding it: https://github.com/ufs-community/UFS_UTILS/blob/develop/sorc/chgres_cube.fd/atm_input_data.F90#L2794

Thank you for your quick response. As per the atm_input_data.F90, the terrain height is pointing towards geopotential height at surface level ( if I am correct) So I downloaded the geopotential at the surface from ERA5 data ( it is in m2/s2 so I converted it to m by dividing it by 9.8) and again combined it to the main grib2 file and rerun the chgres_cube. It again shows the same error: "FATAL ERROR: READING TERRAIN HEIGHT RECORD."

Perhaps the ERA5 GRIB2 product definition for terrain (param category etc.) is not what chgres expects. See https://github.com/ufs-community/UFS_UTILS/blob/develop/sorc/chgres_cube.fd/atm_input_data.F90#L2802

@bnepal22
Copy link
Author

bnepal22 commented Dec 5, 2024

It is looking for terrain height and not finding it: https://github.com/ufs-community/UFS_UTILS/blob/develop/sorc/chgres_cube.fd/atm_input_data.F90#L2794

Thank you for your quick response. As per the atm_input_data.F90, the terrain height is pointing towards geopotential height at surface level ( if I am correct) So I downloaded the geopotential at the surface from ERA5 data ( it is in m2/s2 so I converted it to m by dividing it by 9.8) and again combined it to the main grib2 file and rerun the chgres_cube. It again shows the same error: "FATAL ERROR: READING TERRAIN HEIGHT RECORD."

Perhaps the ERA5 GRIB2 product definition for terrain (param category etc.) is not what chgres expects. See https://github.com/ufs-community/UFS_UTILS/blob/develop/sorc/chgres_cube.fd/atm_input_data.F90#L2802

Finally, I found the solution to TERRAIN ERROR, which was mainly due to the parameter Number issue with the ECMWF grib2 file which was 4 and when I changed it to 5 then the error was resolved however another similar error about

  • CALL FieldCreate FOR INPUT GRID T2M.
  • FILE HAS 0 SOIL LEVELS
  • FATAL ERROR: COUNTING SOIL LEVELS.
    which is yet again associated with the different grib parameters and I am attempting to copy it to gfs grib2 format.

I also tried by converting grib2 to netcdf and modifying chgres_cube.sh script.
changed grib2 to gaussian_netcdf in :

INPUT_TYPE=${INPUT_TYPE:-"gaussian_netcdf"}

and
ATM_FILES_INPUT=/UFS/GFS.initial/20230530/ecmwf_20230530_t00z_sfc_plev_combined.nc
ATM_CORE_FILES_INPUT=${ATM_CORE_FILES_INPUT:-NULL}
ATM_TRACER_FILES_INPUT=${ATM_TRACER_FILES_INPUT:-NULL}
SFC_FILES_INPUT=${sfc_path}'/facsf.1.0.nc,'${sfc_path}'/facsf.1.0.nc,'${sfc_path}'/maximum_snow_albedo.0.05.nc,slope_type.1.0.nc,'${sfc_path}'/snowfree_albedo.4comp.0.05.nc,'${sfc_path}'/soil_type.statsgo.0.03.nc,'${sfc_path}'/substrate_temperature.1.0.nc,'${sfc_path}'/vegetation_greenness.0.144.nc,'${sfc_path}'/vegetation_type.modis.igbp.0.03.nc'
NST_FILES_INPUT=${NST_FILES_INPUT:-NULL}
GRIB2_FILE_INPUT=${GRIB2_FILE_INPUT:-NULL}
#GRIB2_FILE_INPUT=$4
TRACERS_INPUT=${TRACERS_INPUT:-'"spfh","clwmr","o3mr","icmr","rwmr","snmr","grle"'}
GEOGRID_FILE_INPUT=${GEOGRID_FILE_INPUT:-NULL}
But it throws OPEN ERROR.
Are there any other paramter I have to modify to use netcdf data?

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