Hi Sam,
It sounds as if you've defined the grid you want, and defined a
variable which is the original variable on your new grid
.
The thing to do next is to define expressions to do the
operation on the variables/grids. Here's a variable with the data
shifted so that the data that was at timestep 52 will be in timestep
53:
let varshift = newvar[L=@shf:-1]
This variable keeps what was in the original variable for 52
timesteps, and uses the shifted data in that last timestep.
let var_final = if L LE 52 then newvar else varshift
(By the way, this isn' really "appending" here, in the sense that we
append when writing out data to a file. Instead it's defining a
variable that has the desired grid and data once some or all of it
is loaded into memory.)
--Ansley
On 4/7/2015 11:40 AM, Sam Rabin wrote:
[Sorry if this double-posts; I think I used the
wrong email address before.]
All —
I have a 3-D variable whose time axis is irregular
(January 1 of each year: 1500, 1600, 1700:1980:10, 1990:2010:1).
I would like to simply copy the values for each grid cell in
2010 and set that as the value for some arbitrary future date
(e.g., 2011). Of course, nothing is ever so simple.
I’ve already managed to create a new grid (GMH1),
based on the old grid (GRS1), that has an extra (empty) time
step at 01-JAN-2011 00:00. What I’m having trouble with now is
saving the L=52 value as L=53. How would I do this?
Relevant info (?):
GRID GRS1
name axis # pts start
end
LON LONGITUDE 720mr 179.75W(-179.75)
179.75E
LAT LATITUDE 360 r 89.75S
89.75N
normal Z
TIME1 TIME 52 i 01-JAN-1500 00:00
01-JAN-2010 00:00
GRID GMH1
name axis # pts start
end
LON LONGITUDE 720mr 179.75W(-179.75)
179.75E
LAT LATITUDE 360 r 89.75S
89.75N
normal Z
TIME2 TIME 53 i 01-JAN-1500 00:00
01-JAN-2011 00:00
And here are the last four lines of LIST
NEWVAR[I=@SUM,J=@SUM), to show that the last (new) point is
indeed empty:
JAN-2008 /
50: 3580402.
JAN-2009 / 51: 3622055.
JAN-2010 / 52: 3663709.
JAN-2011 / 53: ....
Thanks in advance.
- - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - -
Sam Rabin
PhD student, Ecology & Evolutionary Biology
Princeton University