SRTM 3s - cannot locileze domain, please help

All issues/questions about EMS v3.4 package, please ask here.
Post Reply
emsiwx
Posts: 75
Joined: Sun Aug 12, 2012 11:07 am

SRTM 3s - cannot locileze domain, please help

Post by emsiwx » Sun Oct 04, 2015 10:19 pm

Dear all,

I have finally done a step forward in my hi-res topo nightmare.

I have managed to extract my desired area from SRTM_NE_250m.tiff using QGIS.

Then I used gdal_translate -of "AAIGrid" myfile.tiff myfile.asc

Then I compiled read_geogrid.c and write_geogrid.c and Fortran code:

Code: Select all

program geogrid
      implicit none

      integer :: j
      integer :: isigned, endian, wordsize
      integer :: nx, ny, nz
      real :: scalefactor
      real*8 :: xllcorner, yllcorner, cellsize, missvalue
      character :: head12
      real, allocatable :: rarray(:,:), iarray(:,:)
      character(len=255) :: pathToFile
      LOGICAL :: file_exists

      isigned = 1
      endian = 0
      wordsize = 4
      scalefactor = 1.0
      nz = 1

      CALL getarg(1, pathToFile)

      INQUIRE(FILE=pathToFile, EXIST=file_exists)
	
      if (file_exists .eqv. .FALSE.) then
        write(0,*) "ERROR: no valid path to  *.asc SRTM file"
        CALL exit(-1)
      end if 
	  
      open (10, file = pathToFile)

      read(10,*) head12, nx
      read(10,*) head12, ny
      read(10,*) head12, xllcorner
      read(10,*) head12, yllcorner
      read(10,*) head12, cellsize
      read(10,*) head12, missvalue

      allocate(rarray(nx,1))
      allocate(iarray(nx,ny))

      do j = 1,ny
      read(10,*) iarray(:,j)
      end do

      ! reverse the data so that it begins at the lower-left corner
      do j = 1,ny/2
        rarray(:,1) = iarray(:,ny-(j-1))
        iarray(:,ny-(j-1)) = iarray(:,j)
        iarray(:,j) = rarray(:,1)
      end do
      deallocate(rarray)
		
      call write_geogrid(iarray, nx, ny, nz, isigned, endian, scalefactor, wordsize)

end program geogrid
After I run ConvSRTM myfile.asc I get file : 00001-05905.00001-03113

I created topo_3 put the file there
I created index file like this:

Code: Select all

type = continuous
signed = yes
projection = regular_ll
dx = 0.00208333
dy = 0.00208333
known_x = 1.0
known_y = 1.0
known_lat = 52.4542
known_lon = 11.1625
wordsize = 2
row_order=top_bottom
endian = little
tile_x = 5905
tile_y =  3113
tile_z = 1
missing_value = 0
units = "meters MSL"
description = "Topography Height"
Edited the table and namelist.wps

When I run geogrid.exe I get following error:

Image

And domain_geogrid.log looks like this:

Code: Select all

Parsed 24 entries in GEOGRID.TBL
Processing domain 1 of 3
  Processing XLAT and XLONG
  Processing MAPFAC
  Processing F and E
  Processing ROTANG
  Processing LANDUSEF
  Calculating landmask from LANDUSEF ( WATER =  16 )
  Processing HGT_M
  Processing HGT_U
  Processing HGT_V
  Processing SOILTEMP
  Processing SOILCTOP
  Processing SCT_DOM
  Processing SOILCBOT
  Processing SCB_DOM
  Processing ALBEDO12M
  Processing GREENFRAC
  Processing SNOALB
  Processing SLOPECAT
  Processing SLOPECAT
  Processing CON
  Processing VAR
  Processing OA1
  Processing OA2
  Processing OA3
  Processing OA4
  Processing OL1
  Processing OL2
  Processing OL3
  Processing OL4
  Processing VAR_SSO
  Processing CLAYFRAC
  Processing SANDFRAC
Processing domain 2 of 3
  Processing XLAT and XLONG
  Processing MAPFAC
  Processing F and E
  Processing ROTANG
  Processing LANDUSEF
  Calculating landmask from LANDUSEF ( WATER =  16 )
  Processing HGT_M
  Processing HGT_U
  Processing HGT_V
  Processing SOILTEMP
  Processing SOILCTOP
  Processing SCT_DOM
  Processing SOILCBOT
  Processing SCB_DOM
  Processing ALBEDO12M
  Processing GREENFRAC
  Processing SNOALB
  Processing SLOPECAT
  Processing SLOPECAT
  Processing CON
  Processing VAR
  Processing OA1
  Processing OA2
  Processing OA3
  Processing OA4
  Processing OL1
  Processing OL2
  Processing OL3
  Processing OL4
  Processing VAR_SSO
PGFIO-F-231/formatted read/internal file/error on data conversion.
 In source file source_data_module.f90, at line number 972
[0]0:Return code = 0, signaled with Interrupt
[0]1:Return code = 127
[0]2:Return code = 0, signaled with Interrupt
[0]3:Return code = 0, signaled with Interrupt
I know this has been discussed before, and I went through all topics, but did not found anything like my problem.

I will be very thankfull for any ideas.

Thank you.

Marian

smartie
Posts: 94
Joined: Sat May 21, 2011 7:34 am

Re: SRTM 3s - cannot locileze domain, please help

Post by smartie » Tue Oct 06, 2015 7:35 am

Hello Marian,
can you find out what geogrid is doing at

Code: Select all

PGFIO-F-231/formatted read/internal file/error on data conversion.
 In source file source_data_module.f90, at line number 972
?
I don't have the source code for 3.4.1 if you are using that. In the latest version 3.7.1 it is processing a landuse variable.

Also your index file doesn't look right to me
known_y should be the = to tile_y, in yr case 3113
missing value for ASTER is 32768, don't know about SRTM
wordsize can vary depending on your machine

emsiwx
Posts: 75
Joined: Sun Aug 12, 2012 11:07 am

Re: SRTM 3s - cannot locileze domain, please help

Post by emsiwx » Tue Oct 06, 2015 7:53 am

Hello David,

a big thank you for your time and willingness to help me.

I have tried to change my known_y, to tile_y, no joy :(

My PC is Intel i5, running WMVare workstation (as viryual PC) with Ubuntu 10.04, EMS 3.4.1.15.16 installed. (this is for my testing purp.)

where can I find source_data_module.f90 to see what is on line 972?

I am also trying with ASTER, getting tthe same problem.

I highly appreciate your help.

Marian

smartie
Posts: 94
Joined: Sat May 21, 2011 7:34 am

Re: SRTM 3s - cannot locileze domain, please help

Post by smartie » Tue Oct 06, 2015 8:09 am

OK found the source code for 3.4.1. At lines 970-972-

Code: Select all

                  else if (index('wordsize',trim(buffer(1:i-1))) /= 0) then
                     is_wordsize(idx) = .true.
                     read(buffer(i+1:eos-1),'(i10)') source_wordsize(idx)
it is processing the index file reading the word size entry. Try a different value on yr machine eg 4

emsiwx
Posts: 75
Joined: Sun Aug 12, 2012 11:07 am

Re: SRTM 3s - cannot locileze domain, please help

Post by emsiwx » Tue Oct 06, 2015 8:23 am

I have tried 1,2,4 still with problem.

I just erased the lind with word size from idx file (source code looks like it would use propre value):

after I ended on line 997 (after running geogrid):

WARNING: Invalid value for keyword 'endian' specified in index file. BIG_ENDIAN will be used.
PGFIO-F-231/formatted read/internal file/error on data conversion.
In source file source_data_module.f90, at line number 997
emsuser@ubuntu->

emsiwx
Posts: 75
Joined: Sun Aug 12, 2012 11:07 am

Re: SRTM 3s - cannot locileze domain, please help

Post by emsiwx » Tue Oct 06, 2015 8:37 am

Ok what I did (just as another go), I took index file from topo_30s copied to topo_3s, edited/changed as follows:

Code: Select all

type = continuous
signed = yes
projection = regular_ll
dx = 0.00208333
dy = 0.00208333
known_x = 1.0
known_y = 1.0
known_lat = 45.968
known_lon = 11.1624
wordsize = 2
tile_x = 5905
tile_y = 3113
tile_z = 1
units="meters MSL"
description="Topography height"
Now, I got:

Processing SANDFRAC
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
! Successful completion of geogrid. !
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

How can I check my d03.nc file is ok?

smartie
Posts: 94
Joined: Sat May 21, 2011 7:34 am

Re: SRTM 3s - cannot locileze domain, please help

Post by smartie » Tue Oct 06, 2015 8:51 am

OK-good. Maybe the index file was corrupted or mis-formatted. Is there a new line problem \n, I presume you're using a proper Linux editor on the virtual machine?
You can view the .nc file with the built in version of Panoply in the EMS dom wiz- look at HGT_M first or IDV or any netCDF software.
BTW I still think known_y should equal 3113 in yr case. If not HGT_M terrain will look misplaced or missing all together.

emsiwx
Posts: 75
Joined: Sun Aug 12, 2012 11:07 am

Re: SRTM 3s - cannot locileze domain, please help

Post by emsiwx » Tue Oct 06, 2015 9:00 am

well, my index file was initially created in Notepad under WIN7, copied end edited in Virtual machine (could be the problem?)

I tried ncview, looks good to me:

Image

smartie
Posts: 94
Joined: Sat May 21, 2011 7:34 am

Re: SRTM 3s - cannot locileze domain, please help

Post by smartie » Tue Oct 06, 2015 9:08 am

That's your problem i'd use a proper Linux editor like Gedit or some such or else you'll end with all sorts of problems editing Linux files.

The terrain looks good , I see you've got high terrain with likely steep slopes you may need to experiment with the smoothing in Geogrid.TBL eg have two or even more passes of smooth-desmooth or 4-5 passes of 1-2-1 smooth and/or fiddle with some Dynamics/Physics settings if you have problems with CFL violations. Post again if so...
Oh and try and keep the boundaries inc the relaxation zone away from steep gradients.
Last edited by smartie on Tue Oct 06, 2015 9:12 am, edited 1 time in total.

emsiwx
Posts: 75
Joined: Sun Aug 12, 2012 11:07 am

Re: SRTM 3s - cannot locileze domain, please help

Post by emsiwx » Tue Oct 06, 2015 9:11 am

yeah my bad.... Thank very much, you are a legend...... I will try to localize ASTER 1s , as well....and try a test run.... If I face any problems, I wil post.

Thax again, and have a nice day ;)

Marian

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest