Page 1 of 1

SRTM Data in WPS

PostPosted: Wed May 20, 2009 7:26 pm
by bviner
I have a question regarding the use of external terrain data in geogrid. I'm trying to read in SRTM data but I'm getting strange values of terrain, including values ranging from -17000 to 20000 and large changes between grid points. The SRTM data (in ascii format) reads properly, but it does not seem to be converting to the binary format properly or is not being read by geogrid properly.

I'm currently using the file srtm_38_03.asc in geogrid/src and converting it to binary by compiling and running asc2bin.f and write_geogrid.c located in geogrid/src to get the necessary 00001-06000.00001-06000 file. I've double checked to make sure the lat and lon in the index files and the namelist are specified properly and updated the GEOGRID.TBL file (as listed below). If anyone has any thoughts, I'd really appreciate any suggestions.

Index file:
type = continuous
signed = yes
projection = regular_ll
dx = 0.000833333
dy = 0.000833333
known_x = 1.0
known_y = 1.0
known_lat = 45
known_lon = 5
wordsize = 2
tile_x = 6000
tile_y = 6000
tile_z = 1
tile_bdr=0
units="meters MSL"
description="Topography height"


Namelist.wps
&geogrid
parent_id = 1,
parent_grid_ratio = 1,
i_parent_start = 1,
j_parent_start = 1,
e_we = 50,
e_sn = 50,
geog_data_res = '3s',
dx = 1000,
dy = 1000,
map_proj = 'lambert',
ref_lat = 47,
ref_lon = 7,
truelat1 = 47,
truelat2 = 47,
stand_lon = 7,
geog_data_path = '/ptmp/wrf/geog'
/


Geogrid.TBL (all variables have been updated, but here is an example)
name = HGT_M
priority = 1
dest_type = continuous
df_dx=SLPX
df_dy=SLPY
smooth_option = smth-desmth_special; smooth_passes=1
fill_missing=0.
interp_option = 3s:average_gcell(4.0)+four_pt+average_4pt
interp_option = 30s:average_gcell(4.0)+four_pt+average_4pt
interp_option = 2m:four_pt
interp_option = 5m:four_pt
interp_option = 10m:four_pt
interp_option = default:four_pt
rel_path= 3s:topo_3s/
rel_path= 30s:topo_30s/
rel_path= 2m:topo_2m/
rel_path= 5m:topo_5m/
rel_path= 10m:topo_10m/
rel_path= default:topo_2m/

Re: SRTM Data in WPS

PostPosted: Thu May 21, 2009 2:00 pm
by bviner
Just some further info-

I've narrowed down the problem some. The terrain values are being fed into the write_geogrid routine properly (I've printed out values in "iarray" to check), but are incorrect when read_geogrid gets them (in rarray). This implies the problem is somewhere between writing and reading the binary file. Would this be a compiler problem? Perhaps I'm missing a particular flag? Just in case, I'm compiling the write_geogrid.c using teh same command the compiler program uses to compile read_geogrid.c:
pgcc -D_UNDERSCORE -DBYTESWAP -DLINUX -DIO_NETCDF-DIO_BINARY -DIO_GRIB1 -DBIT32 -D_GEOGRID -O -c write_geogrid.c

and compiling asc2bin.f as:
pgf90 -c -o asc2bin.exe asc2bin.f write_geogrid.o

Re: SRTM Data in WPS

PostPosted: Wed Jul 29, 2009 6:21 am
by colopolo70
Hi guys

I am so newbie of GIS data.

I totally have no idea how to convert *.asc file to wps input file.

1. where is asc2bin.f file under WPS? I could not find it and how to compile write_geogrid.c with srtm file?

Could you please tell me how to convert STEP by STEP?

I am so frustrated to deal with data..

Have a good day.

JY

Re: SRTM Data in WPS

PostPosted: Wed Jul 03, 2019 2:52 pm
by drmarcoguevara
You can try to use the app convert_geotiff, I am trying to use it for a similar task.

just be careful to install the master, other way you wont be able to compile it.

https://github.com/openwfm/convert_geotiff
Regards.

colopolo70 wrote:Hi guys

I am so newbie of GIS data.

I totally have no idea how to convert *.asc file to wps input file.

1. where is asc2bin.f file under WPS? I could not find it and how to compile write_geogrid.c with srtm file?

Could you please tell me how to convert STEP by STEP?

I am so frustrated to deal with data..

Have a good day.

JY