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 | ; get exp1 info |
---|
20 | vICE1 = getenv('VAR1_ICE') & prefix = getenv('V1ICE_PREF') & suffix = getenv('V1ICE_SUFF') |
---|
21 | ; get exp2 info |
---|
22 | vICE2 = getenv('VAR2_ICE') & prefix2 = getenv('V2ICE_PREF') & suffix2 = getenv('V2ICE_SUFF') |
---|
23 | ; get exp1 info |
---|
24 | vICE_vel_1 = getenv('VAR1_Ivel') & prefix = getenv('V1Iv_PREF') & suffix = getenv('V1Iv_SUFF') |
---|
25 | ; get exp2 info |
---|
26 | vICE_vel_2 = getenv('VAR2_Ivel') & prefix2 = getenv('V2Iv_PREF') & suffix2 = getenv('V2Iv_SUFF') |
---|
27 | |
---|
28 | cdti3 = string(cnt, format = '(i3.3)') |
---|
29 | print, cdti3 + ') ' + blabla |
---|
30 | filename = cdti3 + '_ts_ICE_Vel_'+prefix |
---|
31 | if prefix NE prefix2 then filename = filename + '_'+prefix2 |
---|
32 | if KEYWORD_SET(postscript) then openps, filename+'.ps', portrait = 1 |
---|
33 | ; |
---|
34 | d1_d2 = '('+strtrim(date1, 1)+' - '+strtrim(date2, 1)+')' |
---|
35 | ; |
---|
36 | iodir = std_iodir_data |
---|
37 | ; ICE Velocity in NORTH Hemisphere |
---|
38 | domdef, 0, jpi-1, 30, 90, /xindex |
---|
39 | Velo_N = rseries_ncdf(vICE_vel_1, date1, date2, prefix, suffix, FIRSTONLY = 1 - allrec, /nostruct) ;!! warning positive northward |
---|
40 | ICE_N_15 = rseries_ncdf(vICE1, date1, date2, prefix, suffix, FIRSTONLY = 1 - allrec, /nostruct) |
---|
41 | print, 'N15', max(ICE_N_15) |
---|
42 | |
---|
43 | |
---|
44 | ICE_N_15[where(ICE_N_15 lt 0.15)] = 0. |
---|
45 | |
---|
46 | ICE_velo_N = grossemoyenne( (Velo_N < 1.e10) * (ICE_N_15 < 1.e10), 'xy',/integration, mask2d = masknp) |
---|
47 | ICE_N_15 = grossemoyenne(ICE_N_15, 'xy',/integration, mask2d = masknp) |
---|
48 | |
---|
49 | ICE_velo_N = ICE_velo_N / ICE_N_15 |
---|
50 | |
---|
51 | if jpt mod 12 ne 0 then stop |
---|
52 | nyr=jpt/12. |
---|
53 | ICE_velo_N = reform(ICE_velo_N, 12, nyr) |
---|
54 | ICE_velo_N = total(ICE_velo_N,2)/nyr |
---|
55 | ICE_velo_N = {arr:ICE_velo_N , unit : 'm/s'} |
---|
56 | |
---|
57 | |
---|
58 | ;ICE Velocity in SOUTH Hemisphere |
---|
59 | domdef, 0, jpi-1, -90, -30, /xindex |
---|
60 | Velo_S = rseries_ncdf(vICE_vel_1, date1, date2, prefix, suffix, FIRSTONLY = 1 - allrec,/nostruct) ;!! warning positive northward |
---|
61 | |
---|
62 | |
---|
63 | |
---|
64 | title = 'Northern Hemisphere'+'!C'+prefix+' '+d1_d2+'!C'+'Ice Velocity (Black SOLID simulation)' |
---|
65 | jpt=12 |
---|
66 | time=julday(1,15,1900)+30*lindgen(12) |
---|
67 | |
---|
68 | |
---|
69 | pltt, ICE_velo_N, 't', /REMPLI, /PORTRAIT, XGRIDSTYLE = 1 $ |
---|
70 | , small = [1, 2, 1], YTITLE = varunit, TITLE = title, _extra = ex |
---|
71 | ; |
---|
72 | title ='Southern Hemisphere' +'!C'+prefix+' '+d1_d2+' - '+'!C'+'Ice Velocity (Black SOLID simulation)' |
---|
73 | pltt, Velo_S, 't', /REMPLI, /NOERASE, XGRIDSTYLE = 1 $ |
---|
74 | , small = [1, 2, 2], YTITLE = varunit, TITLE = title, _extra = ex |
---|
75 | ; |
---|
76 | |
---|
77 | htmltxt = [ htmltxt, '<hr>'+blabla, '<br><img width="80%" src='+filename+'.png /> ' ] |
---|
78 | if KEYWORD_SET(postscript) then closeps |
---|
79 | |
---|
80 | if prefix NE prefix2 then BEGIN |
---|
81 | |
---|
82 | d1_d2_2 = '('+strtrim(date1_2, 1)+' - '+strtrim(date2_2, 1)+')' |
---|
83 | tsave = time |
---|
84 | ; ICE Velocity in NORTH Hemisphere |
---|
85 | domdef, 0, jpi-1, 30, 90, /xindex |
---|
86 | Velo_N_2 = rseries_ncdf(vICE_vel_2, date1_2, date2_2, prefix2, suffix2, FIRSTONLY = 1 - allrec,/nostruct) |
---|
87 | |
---|
88 | ;;;;;; if grossempoyenne is not present dimension of array is not ok: 54 Array[180, 54, 120] |
---|
89 | ;;;;;; with the domain dimensions [jpi/nx, jpj/ny, jpk/nz, jpt] = [180/180, 149/50, 31/31, 12] |
---|
90 | |
---|
91 | ICE_velo_N_2 = grossemoyenne(Velo_N_2, 'xy', /integration, mask2d = masknp) |
---|
92 | print, 'max ice velo', max(ICE_velo_N_2) |
---|
93 | |
---|
94 | if jpt mod 12 ne 0 then stop |
---|
95 | nyr=jpt/12. |
---|
96 | ICE_velo_N_2 = reform(ICE_velo_N_2, 12, nyr) |
---|
97 | ICE_velo_N_2 = total(ICE_velo_N_2,2)/nyr |
---|
98 | ICE_velo_N_2 = {arr:ICE_velo_N_2 * 86400 * 365, unit : 'm/year'} |
---|
99 | print, 'max ice velo', max(ICE_velo_N_2.arr) |
---|
100 | |
---|
101 | |
---|
102 | ;ICE Velocity in SOUTH Hemisphere |
---|
103 | domdef, 0, jpi-1, -90, -30, /xindex |
---|
104 | Velo_S_2 = rseries_ncdf(vICE_vel_2, date1_2, date2_2, prefix2, suffix2, FIRSTONLY = 1 - allrec,/nostruct) |
---|
105 | |
---|
106 | if KEYWORD_SET(postscript) then openps, filename+'_2.ps', portrait = 1 |
---|
107 | |
---|
108 | jpt=12 |
---|
109 | time=julday(1,15,1900)+30*lindgen(12) |
---|
110 | |
---|
111 | title = 'Northern Hemisphere'+'!C'+prefix+' (BLACK) - '+prefix2+' (RED) '+d1_d2_2 +'!C'+'Ice Velocity (BLACK) ' |
---|
112 | pltt, ICE_velo_N , 't', /REMPLI, XGRIDSTYLE = 1, window = 2 $ |
---|
113 | , small = [1, 2, 1], YTITLE = varunit, TITLE = title, /noerase, _extra = ex |
---|
114 | pltt, ICE_velo_N_2, 't', /REMPLI $ |
---|
115 | , /ov1d, color = 250, small = [1, 2, 1], YTITLE = varunit, TITLE = title, /noerase, _extra = ex |
---|
116 | |
---|
117 | title = 'Southern Hemisphere'+'!C'+prefix+' (BLACK) - '+prefix2+' (RED) '+d1_d2_2 +'!C'+'Ice Velocity (BLACK) ' |
---|
118 | pltt, Velo_S , 't', /REMPLI, XGRIDSTYLE = 1 $ |
---|
119 | , small = [1, 2, 2], YTITLE = varunit, TITLE = title, /noerase, _extra = ex |
---|
120 | pltt, Velo_S_2, 't', /REMPLI $ |
---|
121 | , /ov1d, color = 250, small = [1, 2, 2], YTITLE = varunit, TITLE = title, /noerase, _extra = ex |
---|
122 | |
---|
123 | htmltxt = [ htmltxt, '<hr>'+blabla, '<br><img width="80%" src='+filename+'_2.png /> ' ] |
---|
124 | if KEYWORD_SET(postscript) then closeps |
---|
125 | |
---|
126 | endif |
---|
127 | |
---|
128 | domdef |
---|
129 | |
---|
130 | |
---|
131 | return |
---|
132 | end |
---|