ParNCLDeveloperInfo/SimpleParNCLScripts: data_slice_04.ncl

File data_slice_04.ncl, 489 bytes (added by jayesh, 7 years ago)

Adding two data slices

Line 
1begin
2fili = systemfunc("ls eul26x48x96.t[0-2].nc")  ; 1 files     
3
4setfileoption("nc","SuppressClose",False)   ; user can tell NCL to alter default mode
5
6; Add the files
7f = addfiles(fili, "r")
8
9; Read the variable T
10t = f[:]->T
11
12; levels 10 to 20 with stride 2, lat 0 to 10 with stride 4, lon 2 and 5
13; 1st time step of T
14t_slice1 = t(1,10:20:2,0:10:4,(/ 2,5 /) )
15t_slice2 = t(1,10:20:2,0:10:4,(/ 2,5 /) )
16t_slice3 = t_slice1 + t_slice2
17
18; Print the val to output
19print(t_slice3)
20
21end