Hi,
Modulo regridding is done as a simple sum_of_data divided by the
count, as your clim_sumave/40 expressions are. The @AVE takes into
account the grid-cell sizes. It will be related to that but I have
not looked into it closely.
As to the blank plots in your repeat loop, I think that what's
happening is that there's a conflict in the use of the I index.
REPEAT/I=1:9 sets the context of the command to be I=1, and so the
expressions inside the loop are evaluated at I=1. The grid doesn't
have a Z axis, so you could use K as the repeat-loop index or the
syntax REPEAT/RANGE=1:9/NAME= which is intended to address
exactly this issue.
-Ansley
On 9/28/2018 9:36 AM, Xiaoyu Bai wrote:
Dear Ansley,
Thank you very much. After I changed T to L, @MOD and
"let pr_`i`_clim_sumave=pr_`i`[L=@SUM]/40" gave me the same
result. However, if I use "let pr_`i`_clim=pr_`i`[L=@AVE]"
comparing to @MOD, there are still some differences between
them. Any particular reason for that? Attach is one
difference figure.
By the way, when I use "repeat/i=1:9:1
(contour/fill/palette=blue_darkred
(pr_`i`_clim-pr_mod_[L=`i`])*60*60*24*30;
frame/file=0`i`_CNRM.png)", pyferret (v7.42) gives me blank
figures. If I plot them separately, like
"contour/fill/palette=blue_darkred
(pr_9_clim-pr_mod[L=9])*60*60*24*30", the figure attached
shows up. Any suggestions?
Thank you again and have a nice weekend.
Xiaoyu
Hello,
The stride syntax that you're using should be given with
the index L not the time-coordinate T, so all of the
January data is
pr[L=1:480:12]
A stride using T= is acting on the underlying time units
of the time axis, which is a monthly axis but with units
of days. So that means that [T=1:480:12] is asking for
data at every 12th day for the first 480 days. The clue
that I noticed was the time label at the top of your
second plot, where it's reporting that the plot used data
from the range 7-jan-1969 to 2-May 1970 .
With that change, I think the plots agree pretty well,
and of course @MOD is simplest to use.
The @MOD regridding will work with any time axis whether
it starts out as a monthly series or not, so if you
started with daily data, it gathers all of the January
data for each year, taking into account the calendar's
definition of months, and returns the climatological
average; and so on for each month. It'd also handle
partial grid cells, so if the source data somehow
timesteps which don't fall exactly within the
climatological grid-cell definitions, it takes the correct
portions of grid cells to contribute to each monthly
result.
Ansley
On
9/27/2018 10:37 AM, Xiaoyu Bai wrote:
Dear ferreters,
I have a monthly rainfall .nc file
which has Gregorian calendar. I wanted to
compute climatology for each month. I
tried with "MONTH_GREGORIAN@MOD", tried
with pick every month out then take the
average, "repeat/i=1:12:1 let
pr_`i`=pr[T=`i`:480:12]; repeat/i=1:12:1
let pr_`i`_clim=pr_`i`[T=@AVE]", tried
with sum them up then divide them by the
total years "repeat/i=1:12:1 let
pr_`i`_clim_sumave=pr_`i`[T=@SUM]/40". I
compared these results and found that none
of them were the same. Any suggestions on
which climatology should I use? By
the way, for the Gregorian calendar, if I
want to make the rain rates by month, is
there a better way than *60*60*24*(days of
the month)?
Attach are the December climatology
comparison figures I made.
My script was as follows:
set region/X=-30:70/Y=-40:40
let pr_mod=pr[gt=MONTH_GREGORIAN@MOD]
repeat/i=1:12:1 let
pr_`i`=pr[T=`i`:480:12]
repeat/i=1:12:1 let
pr_`i`_clim=pr_`i`[T=@AVE]
repeat/i=1:12:1 let
pr_`i`_clim_sumave=pr_`i`[T=@SUM]/40
repeat/i=1:9:1
(contour/fill/palette=blue_darkred
(pr_`i`_clim_sumave-pr_`i`_clim)*60*60*24*30;
frame/file=0`i`_CNRM.png)
repeat/i=10:12:1
(contour/fill/palette=blue_darkred
(pr_`i`_clim_sumave-pr_`i`_clim)*60*60*24*30;
frame/file=`i`_CNRM.png)
Thank you very much. 😸
--
--
|