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

Using SRTM1 data

This post was from a previous version of the WRF&MPAS-A Support Forum. New replies have been disabled and if you have follow up questions related to this post, then please start a new thread from the forum home page.

cross

Member
I found a very easy way to use SRTM1 data as input for geogrid with qgis and convert_geotiff.
So you have to follow these steps:
1 - Install the SRTM-Downloader plugin (https://github.com/hdus/SRTM-Downloader)
2 - download the domain you need with the plugin. This step is slow, and you need a account Nasa Earth Data (https://urs.earthdata.nasa.gov/users/new)
3 - The downloaded data is in .hgt files, but you can merge all the tiles with the raster tool merge (https://docs.qgis.org/3.10/en/docs/user_manual/processing_algs/gdal/rastermiscellaneous.html?highlight=merge#merge). I use output data as 1 — Int16
4 - Now you have a geotiff image of the downloaded data, so you need to convert it to the geogrid format, for this you can use convert_geotiff (https://github.com/openwfm/convert_geotiff)
5 - Once you installed convert_geotiff you can run it like this:
./convert_geotiff -w 4 -t 2291 your_file.tif
6 - After all the files are created, you have to edit the index file.
You need to add:
units = "meters MSL"
description = "Topography height"
missing_value = 32768

Code:
projection = regular_ll
known_x = 1
known_y = 25201
known_lat = -28.999861
known_lon = -73.000137
dx = 0.0002777777777777778
dy = 0.0002777777777777778
type = continuous
signed = yes
units = "meters MSL"
description = "Topography height"
wordsize = 4
tile_x = 2291
tile_y = 2291
tile_z = 1
tile_bdr = 3
missing_value = 32768
scale_factor = 1.000000
row_order = bottom_top
endian = little

Other way to convert from geotiff to geogrid format is using GIS4WRF plugin, but I couldn't run in continuous type, it only run in categorized.

7 - After you made all the data files, place them in your geog folder.
8 - Edit GEOGRID.TBL adding this lines to HGT_M:
interp_option = SRTM_1s:average_gcell(4.0)+four_pt+average_4pt
rel_path = SRTM_1s:SRTM_1s/
 
Hi all,

I also plan to use SRTM_1s data. But since the data's resolution is very high and my region size is relatively large. I cannot put all the data I need into one folder under the WPS_GEOG directory. And I noticed in WRF user guide, it's suggested that one can address this problem by
simply split the data set into several smaller data sets which will be identified separately to geogrid.
So I try to split the original datasets into four subsets (SRTM_1s_0,SRTM_1s_1,SRTM_1s_2,SRTM_1s_3) and save them in separate directory in WPS_GEOG. Then I edited GEOGRID.TBL as below
Code:
        interp_option = SRTM_1s_0:average_gcell(4.0)+four_pt+average_4pt
        interp_option = SRTM_1s_1:average_gcell(4.0)+four_pt+average_4pt
        interp_option = SRTM_1s_2:average_gcell(4.0)+four_pt+average_4pt
        interp_option = SRTM_1s_3:average_gcell(4.0)+four_pt+average_4pt
        rel_path = SRTM_1s_0:SRTM_1s_0/
        rel_path = SRTM_1s_1:SRTM_1s_1/
        rel_path = SRTM_1s_2:SRTM_1s_2/
        rel_path = SRTM_1s_3:SRTM_1s_3/
Then I edited my namelist.wps as
Code:
geog_data_res     = 'SRTM_1s_0+SRTM_1s_1+SRTM_1s_2+SRTM_1s_3',
But after I run geogird.exe, I found that in geo_em file only topography data from SRTM_1s_0 subset was used. So I wonder how to let geogrid identify all the sub datasets.

Thanks,
Yue
 
Yue,
when you specify the option geog_data_res = 'SRTM_1s_0+SRTM_1s_1+SRTM_1s_2+SRTM_1s_3', it instructs the model to read variables from 'SRTM_1s_0' first. If the required variables are found in 'SRTM_1s_0, then it will skip reading other files.
You may put your data to different directory, please use 'ln -sf' to link these datafile to the same directory, then specify the default path to this directory, and run geogrid.exe again.
Please try and let me know whether this works for you.
 
Hi Ming Chen,

Thank you for your advice but I also have a question on the index file. In this case, is the target directory only allowed to contain one index file?

Yue
 
Yue,
You are right that only one index file that applies to all the data should be located in the directory where you read the data.
The data themselves should also follow the rules described in https://www2.mmm.ucar.edu/wrf/users/docs/user_guide_v4/v4.0/users_guide_chap3.html#_Writing_Static_Data
 
Hi,

I just followed the advice from Ming Chen and did nothing else special. Tell me if you run into any issue.

Yue
 
Top