fwrite wrap data
Javier G. Corripio
Javier.Corripio at UIBK.AC.AT
Mon Sep 28 15:03:50 EDT 2009
Dear all,
I would appreciate some advice with fwrite.
I am trying to write some data which is a subset of a larger grib. It seems that the data is wrapped
around in a peculiar way when using fwrite.
Here I show and example for clarity, the topography of the Alps from the GFS (hgtsfc). When using
the data written by fwrite it will display with the eastern end on the northwestern corner
The ctl files seems to be OK, so I wonder if I failed to specify any settings for fwrite.
These are the commands:
open gfs.ctl
set lon 0 20
set lat 40 50
d hgtsfc;************** first map correct
set gxout fwrite
set fwrite alpsset.dat
d hgtsfc
disaple fwrite
reinit
open alpsset.ctl
d topo;**************** second map wrapped around
ctl file for subset:
ga-> q ctlinfo
dset alpsset.dat
title
undef 9.999e+20
xdef 40 linear 0 0.5
ydef 20 linear 40 0.5
zdef 1 linear 1013 1
tdef 1 linear 00Z04SEP2009 60mn
vars 1
topo 0 1,1,0,0 surface height (m) []
endvars
original ctl file:
ga-> q ctlinfo 2
dset gfs
title gfs
undef 9.999e+20
xdef 720 linear 0 0.5
ydef 361 linear -90 0.5
zdef 26 levels 1000 975 950 925 900 850 800 750
700 650 600 550 500 450 400 350 300 250
200 150 100 70 50 30 20 10
tdef 51 linear 00Z28SEP2009 180mn
vars 52
.....
endvars
Image of what it should be and what I obtained:
http://tinyurl.com/y8f2xcq
or in a schematic way,
THIS:
*
****
********
************
*****************
****************************
*****************
************
********
****
*
BECOMES THIS:
***
**************
***
*
****
********
************
**************
**************
**************
************
********
****
*
Thanks a lot for any help.
Javier
More information about the gradsusr
mailing list