1 | function read_arr2d, filename, varname, t1, t2 |
---|
2 | ;; function that read input file and return 2d array with monthly timecounter |
---|
3 | nyear = (t2-t1+1)/12 |
---|
4 | arr2d = ncdf_lec(filename, VAR=varname) |
---|
5 | arr2d = arr2d[t1:t2] |
---|
6 | arr2d = reform(arr2d,12,nyear) ; put in 2D array |
---|
7 | arr2d = total(arr2d,2)/nyear ; total over 2th dimension (i.e.years) |
---|
8 | |
---|
9 | return, arr2d |
---|
10 | end |
---|
11 | |
---|
12 | ;; here start procedure that use function read_arr2d |
---|
13 | pro std_ts_ICE_Vel, masknp, s_iodir_data, POSTSCRIPT = postscript, _extra = ex |
---|
14 | |
---|
15 | compile_opt idl2, strictarrsubs |
---|
16 | |
---|
17 | @common |
---|
18 | @std_common |
---|
19 | |
---|
20 | ; get exp1 info |
---|
21 | vICE_vel_1 = getenv('VAR1_Ivel') & prefix = getenv('V1Iv_PREF') & suffix = getenv('V1Iv_SUFF') |
---|
22 | ; get exp2 info |
---|
23 | vICE_vel_2 = getenv('VAR2_Ivel') & prefix2 = getenv('V2Iv_PREF') & suffix2 = getenv('V2Iv_SUFF') |
---|
24 | |
---|
25 | cdti3 = string(cnt, format = '(i3.3)') |
---|
26 | print, cdti3 + ') ' + blabla |
---|
27 | filename = cdti3 + '_ts_ICE_Vel_'+prefix |
---|
28 | if prefix NE prefix2 then filename = filename + '_'+prefix2 |
---|
29 | if KEYWORD_SET(postscript) then openps, filename+'.ps', portrait = 1 |
---|
30 | ; |
---|
31 | d1_d2 = '('+strtrim(date1, 1)+' - '+strtrim(date2, 1)+')' |
---|
32 | ; |
---|
33 | iodir = std_iodir_data |
---|
34 | ; ICE Velocity in NORTH Hemisphere |
---|
35 | domdef, 0, jpi-1, 30, 90, /xindex |
---|
36 | Velo_N = rseries_ncdf(vICE_vel_1, date1, date2, prefix, suffix, FIRSTONLY = 1 - allrec,/nostruct) ;!! warning positive northward |
---|
37 | |
---|
38 | ;;;;;; if grossempoyenne is not present dimension of array is not ok: 54 Array[180, 54, 120] |
---|
39 | ;;;;;; with the domain dimensions [jpi/nx, jpj/ny, jpk/nz, jpt] = [180/180, 149/50, 31/31, 12] |
---|
40 | |
---|
41 | ICE_velo_N = grossemoyenne(Velo_N, 'xy', /integration, mask2d = masknp) |
---|
42 | help, ICE_velo_N |
---|
43 | print, 'max ice velo', max(ICE_velo_N) |
---|
44 | |
---|
45 | if jpt mod 12 ne 0 then stop |
---|
46 | nyr=jpt/12. |
---|
47 | ICE_velo_N = reform(ICE_velo_N, 12, nyr) |
---|
48 | ICE_velo_N = total(ICE_velo_N,2)/nyr |
---|
49 | ICE_velo_N = {arr:ICE_velo_N * 1.e-19 * 86400 * 365, unit : 'm/year'} |
---|
50 | help, ICE_velo_N |
---|
51 | print, 'max ice velo', max(ICE_velo_N.arr) |
---|
52 | |
---|
53 | ;ICE Velocity in SOUTH Hemisphere |
---|
54 | domdef, 0, jpi-1, -90, -30, /xindex |
---|
55 | Velo_S = rseries_ncdf(vICE_vel_1, date1, date2, prefix, suffix, FIRSTONLY = 1 - allrec,/nostruct) ;!! warning positive northward |
---|
56 | |
---|
57 | |
---|
58 | title = 'Northern Hemisphere'+'!C'+prefix+' '+d1_d2+'!C'+'Ice Velocity (Black SOLID simulation)' |
---|
59 | jpt=12 |
---|
60 | time=julday(1,15,1900)+30*lindgen(12) |
---|
61 | pltt, ICE_velo_N, 't', /REMPLI, /PORTRAIT, MIN = 0., MAX = 60000000. , XGRIDSTYLE = 1 $ |
---|
62 | , small = [1, 2, 1], YTITLE = varunit, TITLE = title, _extra = ex |
---|
63 | ; |
---|
64 | title ='Southern Hemisphere' +'!C'+prefix+' '+d1_d2+' - '+'!C'+'Ice Velocity (Black SOLID simulation)' |
---|
65 | pltt, Velo_S, 't', /REMPLI, MIN = 0., MAX = 60000000., /NOERASE, XGRIDSTYLE = 1 $ |
---|
66 | , small = [1, 2, 2], YTITLE = varunit, TITLE = title, _extra = ex |
---|
67 | ; |
---|
68 | |
---|
69 | htmltxt = [ htmltxt, '<hr>'+blabla, '<br><img width="80%" src='+filename+'.png /> ' ] |
---|
70 | if KEYWORD_SET(postscript) then closeps |
---|
71 | |
---|
72 | if prefix NE prefix2 then BEGIN |
---|
73 | |
---|
74 | d1_d2_2 = '('+strtrim(date1_2, 1)+' - '+strtrim(date2_2, 1)+')' |
---|
75 | tsave = time |
---|
76 | ; ICE Velocity in NORTH Hemisphere |
---|
77 | domdef, 0, jpi-1, 30, 90, /xindex |
---|
78 | Velo_N_2 = rseries_ncdf(vICE_vel_2, date1_2, date2_2, prefix2, suffix2, FIRSTONLY = 1 - allrec,/nostruct) |
---|
79 | help, Velo_N_2 |
---|
80 | |
---|
81 | ;;;;;; if grossempoyenne is not present dimension of array is not ok: 54 Array[180, 54, 120] |
---|
82 | ;;;;;; with the domain dimensions [jpi/nx, jpj/ny, jpk/nz, jpt] = [180/180, 149/50, 31/31, 12] |
---|
83 | |
---|
84 | ICE_velo_N_2 = grossemoyenne(Velo_N_2, 'xy', /integration, mask2d = masknp) |
---|
85 | help, ICE_velo_N_2 |
---|
86 | print, 'max ice velo', max(ICE_velo_N_2) |
---|
87 | |
---|
88 | if jpt mod 12 ne 0 then stop |
---|
89 | nyr=jpt/12. |
---|
90 | ICE_velo_N_2 = reform(ICE_velo_N_2, 12, nyr) |
---|
91 | ICE_velo_N_2 = total(ICE_velo_N_2,2)/nyr |
---|
92 | ICE_velo_N_2 = {arr:ICE_velo_N_2 * 86400 * 365, unit : 'm/year'} |
---|
93 | help, ICE_velo_N_2 |
---|
94 | print, 'max ice velo', max(ICE_velo_N_2.arr) |
---|
95 | |
---|
96 | |
---|
97 | ;ICE Velocity in SOUTH Hemisphere |
---|
98 | domdef, 0, jpi-1, -90, -30, /xindex |
---|
99 | Velo_S_2 = rseries_ncdf(vICE_vel_2, date1_2, date2_2, prefix2, suffix2, FIRSTONLY = 1 - allrec,/nostruct) |
---|
100 | ;SF help, Velo_S_2 |
---|
101 | |
---|
102 | if KEYWORD_SET(postscript) then openps, filename+'_2.ps', portrait = 1 |
---|
103 | |
---|
104 | title = 'Northern Hemisphere'+'!C'+prefix+' (BLACK) - '+prefix2+' (RED) '+d1_d2_2 +'!C'+'Ice Velocity (BLACK) ' |
---|
105 | pltt, ICE_velo_N , 't', MIN = 0., MAX = 60000000. , date1, date2, /REMPLI, XGRIDSTYLE = 1, window = 2 $ |
---|
106 | , small = [1, 2, 1], YTITLE = varunit, TITLE = title, /noerase, _extra = ex |
---|
107 | pltt, ICE_velo_N_2, 't', date1, date2, /REMPLI $ |
---|
108 | , /ov1d, color = 250, small = [1, 2, 1], YTITLE = varunit, TITLE = title, /noerase, _extra = ex |
---|
109 | |
---|
110 | title = 'Southern Hemisphere'+'!C'+prefix+' (BLACK) - '+prefix2+' (RED) '+d1_d2_2 +'!C'+'Ice Velocity (BLACK) ' |
---|
111 | pltt, Velo_S , 't', MIN = -.04, MAX = .04, date1, date2, /REMPLI, XGRIDSTYLE = 1 $ |
---|
112 | , small = [1, 2, 2], YTITLE = varunit, TITLE = title, /noerase, _extra = ex |
---|
113 | pltt, Velo_S_2, 't', date1, date2, /REMPLI $ |
---|
114 | , /ov1d, color = 250, small = [1, 2, 2], YTITLE = varunit, TITLE = title, /noerase, _extra = ex |
---|
115 | |
---|
116 | htmltxt = [ htmltxt, '<hr>'+blabla, '<br><img width="80%" src='+filename+'_2.png /> ' ] |
---|
117 | if KEYWORD_SET(postscript) then closeps |
---|
118 | |
---|
119 | endif |
---|
120 | |
---|
121 | domdef |
---|
122 | |
---|
123 | |
---|
124 | return |
---|
125 | end |
---|