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

Issue with Custom Chinese Irrigation Area Fraction (BIL) Not Being Applied in geogrid.exe

shuangshuang zi

New member
I am trying to use a custom Irrigation Area Fraction dataset (0-1) from China by converting a netcdf file into a binary (BIL) file. However, after running geogrid.exe, the generated geo_em.d01.nc and geo_em.d02.nc file does not reflect my custom dataset, and the values and projections are both incorrect.

293016011410583f2958aff29c40f9c0.png

The spatial map of irrigation area proportion data should look like this:
5b025eca30b9f720383e8b5822c3dcb1.png

Steps I Followed

1.Saved it as a BIL file based on the python
input_netcdf_file = 'pro_area/pro_data/final_irrigation_fraction_out010.nc'
variable_name = 'Irrfrac'
final_fraction = xr.open_dataset(input_netcdf_file)[variable_name]
data_for_wps = final_fraction.fillna(-999.0)
data_for_wps = data_for_wps.astype(np.float32)
if data_for_wps.lat.values[0] > data_for_wps.lat.values[-1]:
data_for_wps = data_for_wps.reindex(lat=list(reversed(data_for_wps.lat.values)))
print("finidhed")
else:
print("finished")
numpy_array = data_for_wps.values
ny, nx = numpy_array.shape
output_filename = f"00001-{nx:05d}.00001-{ny:05d}"
print(output_filename)
big_endian_data = numpy_array.astype('>f4')
with open(output_filename, 'wb') as f:
f.write(big_endian_data.tobytes(order='C'))
2. Retrieve grid information through cdo
87a4648069fffd70cdff7cbf5a429348.png
3. Set the index to interpret the data
0b97faa495ffd20dcf05986d26bf8975.png
4. Configured GEOGRID.TBL to reference my dataset

name = IRRFRAC
priority = 1
dest_type = continuous
interp_option = default:average_gcell(4.0)
rel_path = default:irrfraction/

Questions:

1) Is my data conversion workflow (from NetCDF to BIL) correct?
2) Is there an error in my index file configuration?
3) How can I ensure the projection of custom data matches the projection set in the WRF domain?
4) My irrigation area proportion data (nc) is in WGS84—could this affect the results?
5) Why are both the values and coordinate system of my newly generated irrigation area proportion data incorrect?
 

Attachments

  • namelist.wps
    743 bytes · Views: 0
Top