Hi Simon,
The problem is that you aren't mapping the variables between grids
explicitly. Ferret is making its best guess (hence the warning
about ambiguous grids) but not making the right choice. The
repeated changing of regions is also confusing, especially the
time index. The region is only evaluated when making the plot so
your first set/region does precisely nothing.
When defining variables from a combination of sources make sure
that the grids are compatible.
So rather than
let rf_100 = rainfall[d=1] * mask1
you should use (assuming the mask is time invariant)
let rf_100 = rainfall[d=1,gxy=mask1]*mask1[l=1] ! put on the
topography grid
or
let rf_100 = rainfall[d=1]*mask1[gxy=rainfall[d=1],l=1] ! put on
the rainfall grid.
If the grids are aligned but of different sizes then the @NRST
regridding is possibly the most appropriate transform.
I'd also omit the set region statements and plot
things explicitly. Setting regions when you have mixed grids often
leads to problems and it's
probably best not to get into the habit of automatically setting
regions unless you are sure that it's safe and that you cancel the
region as soon as it's not needed.
plot/x=74E:81E/y=8N:15N/l=1:365 rf_100[x=@ave,y=@ave]
Cheers,
Russ
On 17/10/15 22:10, simon EK wrote:
Dear Andre/ ferret users,
I downloaded .25x.25 grid topography dataset and tried
with one mask as adviced by you::
(the journal file and the errors & warnings are
listed below:
I could not much understand the errors.
kindly help.
Regards
Simon
!====================================================================
!topo-rf.jnl
!====================================================================
use spi-rf.nc
! Rainfall data on .25x.25 grid - variable
name 'rainfall'
set region/x=74E:81E/y=8N:15N/l=1:365 !
selected 365 days data from ~ 100 years data
use elev.0.25-deg.nc
! elevation on .25x.25 grid - variable name
'data'
set region/x=74E:81E/y=8N:15N/l=1
let mask1 = IF (data GE 0 AND data LT 100) THEN 1
else 1/0
let rf_100 = rainfall[D=1] * mask1
plot rf_100[x=@ave,y=@ave,l=1:365] ! plotting
365 days xy spacially averaged data
!====================================================================
Error
yes? go topo-rf.jnl
use spi-rf.nc !
Rainfall data on .25x.25 grid
set region/x=74E:81E/y=8N:15N/l=1:365 ! selected
365 days data from ~ 100 years data
use elev.0.25-deg.nc
! elevation on .25x.25 grid - variable name
'data' - got dataset from site.
***
NOTE: Axis coordinates are decreasing-ordered.
Reversing ordering for axis lat
set
region/x=74E:81E/y=8N:15N/l=1
let mask1 = IF (data GE 0 AND data LT 100) THEN 1
else 1/0
!let mask2 = IF (data GE 100 AND data LT 500) THEN 1
else 1/0
let rf_100 = rainfall[D=1] * mask1
!let rain_500 = rainfall * mask2
plot rf_100[x=@ave,y=@ave,l=1:365]
*** NOTE: Ambiguous
coordinates on X axis: RAINFALL[D=1] * MASK1
*** NOTE: Ambiguous coordinates on Y axis:
RAINFALL[D=1] * MASK1
*** NOTE: Ambiguous coordinates on T axis:
RAINFALL[D=1] * MASK1
**ERROR: inconsistent sizes of data regions: X
axis
MASK1 has 28 points (I=297:324)
_expression_ has 29 points (I=31:59)
plot
rf_100[x=@ave,y=@ave,l=1:365]
Command file, command
group, or REPEAT execution aborted
yes?
=================================================================
|