source: branches/2013/dev_MERGE_2013/NEMOGCM/CONFIG/ORCA2_LIM/IDL_scripts/std_ts_ICE_Vol.pro @ 4504

Last change on this file since 4504 was 4504, checked in by flavoni, 7 years ago

fix small improvements in idl plots, see ticket #724

File size: 6.2 KB
Line 
1function read_arr2d, filename, varname, t1, t2
2;; function that read input file and return 2d array with monthly timecounter
3nyear = (t2-t1+1)/12
4arr2d = ncdf_lec(filename, VAR=varname)
5arr2d = arr2d[t1:t2]
6arr2d = reform(arr2d,12,nyear) ; put in 2D array
7arr2d = total(arr2d,2)/nyear ; total over 2th dimension (i.e.years)
8
9return, arr2d
10end
11
12;
13;
14pro std_ts_ICE_Vol, masknp, s_iodir_data,  POSTSCRIPT = postscript, _extra = ex
15
16  compile_opt idl2, strictarrsubs
17 
18@common
19@std_common
20
21; get exp1 info
22  vICE1     = getenv('VAR1_ICE')     &   prefix = getenv('V1ICE_PREF')  &   suffix = getenv('V1ICE_SUFF')
23  v1_Ithick = getenv('VAR1_Ithick')  &   prefix = getenv('V1It_PREF')   &   suffix = getenv('V1It_SUFF')
24; get exp2 info
25  vICE2     = getenv('VAR2_ICE')     &   prefix2 = getenv('V2ICE_PREF')   &   suffix2 = getenv('V2ICE_SUFF')
26  v2_Ithick = getenv('VAR2_Ithick')  &   prefix2 = getenv('V2It_PREF')    &   suffix2 = getenv('V2It_SUFF')
27
28  cdti3 = string(cnt, format = '(i3.3)')
29  print, cdti3 + ') ' + blabla
30  filename = cdti3 + '_ts_ICE_Vol_'+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 Area(=Surface) in NORTH Hemisphere
38  domdef, 0, jpi-1, 30, 90, /xindex
39  ICE_N = rseries_ncdf(vICE1, date1, date2, prefix, suffix, FIRSTONLY = 1 - allrec)
40  ICE_thick = rseries_ncdf(v1_Ithick, date1, date2, prefix, suffix, FIRSTONLY = 1 - allrec)
41  ; Volume = Area(=Surface) * Thickness
42  ICE_vol_N = (ICE_N.arr < 1.e10 ) * ( ICE_thick.arr < 1.e10)  ; limited mask value of 1.e20, because 1.e20 * 1.e20 = inf for idl
43  ICE_vol_N = grossemoyenne(ICE_vol_N, 'xy', /integration, mask2d = masknp)
44
45  ;
46  if jpt mod 12 ne 0 then stop
47  nyr=jpt/12.
48  ICE_vol_N = reform(ICE_vol_N, 12, nyr)
49  ICE_vol_N = total(ICE_vol_N,2)/nyr
50  ICE_vol_N = {arr:ICE_vol_N * 1.e-9, unit : '10^9 Km^3'}
51  ;
52  ;ICE Area(=Surface) in SOUTH Hemisphere
53  domdef, 0, jpi-1, -90, -30, /xindex
54  ICE_S = rseries_ncdf(vICE1, date1, date2, prefix, suffix, FIRSTONLY = 1 - allrec)
55  ICE_thick = rseries_ncdf(v1_Ithick, date1, date2, prefix, suffix, FIRSTONLY = 1 - allrec)
56  ; Volume = Area(=Surface) * Thickness
57  ICE_vol_S = (ICE_S.arr < 1.e10 ) * ( ICE_thick.arr < 1.e10)  ; limited mask value of 1.e20, because 1.e20 * 1.e20 = inf for idl
58  ICE_vol_S = grossemoyenne(ICE_vol_S, 'xy', /integration, mask2d = masknp)
59  if jpt mod 12 ne 0 then stop
60  nyr=jpt/12.
61  ICE_vol_S = reform(ICE_vol_S, 12, nyr)
62  ICE_vol_S = total(ICE_vol_S,2)/nyr
63  ICE_vol_S = {arr:ICE_vol_S * 1.e-9, unit : '10^9 Km^3'}
64  ;
65  title = 'Northern Hemisphere'+'!C'+prefix+' '+d1_d2+'!C'+'Global Annual Mean Ice Volume (BLACK) '
66  jpt=12
67  time=julday(1,15,1900)+30*lindgen(12)
68  pltt, ICE_vol_N, 't', MIN = 0., MAX = 40000., /REMPLI, /PORTRAIT, XGRIDSTYLE = 1, DATE_FORMAT = '%M' $
69        , small = [1, 2, 1], YTITLE = '10^9 Km^3 ', TITLE = title, _extra = ex
70;
71  title ='Southern Hemisphere' +'!C'+prefix+' '+d1_d2+' - '+'!C'+'Global Annual Mean Ice Volume (BLACK)'
72  pltt, ICE_vol_S, 't', MIN = 0., MAX = 11000., /REMPLI, /NOERASE, XGRIDSTYLE = 1 , DATE_FORMAT = '%M' $
73        , small = [1, 2, 2], YTITLE = '10^9 Km^3 ', TITLE = title, _extra = ex
74;
75  htmltxt = [ htmltxt, '<hr>'+blabla, '<br><img width="80%" src='+filename+'.png  />  ' ]
76  if KEYWORD_SET(postscript) then closeps
77
78  if prefix NE prefix2 then BEGIN
79
80    d1_d2_2 = '('+strtrim(date1_2, 1)+' - '+strtrim(date2_2, 1)+')'
81    tsave = time
82    domdef, 0, jpi-1, 30, 90, /xindex
83    ;ICE Area(=Surface) in NORTH Hemisphere
84    ICE_N2 = rseries_ncdf(vICE2, date1_2, date2_2, prefix2, suffix2, FIRSTONLY = 1 - allrec)
85    ICE_thick2 = rseries_ncdf(v2_Ithick, date1_2, date2_2, prefix2, suffix2, FIRSTONLY = 1 - allrec)
86    ; Volume = Area(=Surface) * Thickness
87    ICE_vol_N2 = (ICE_N2.arr < 1.e10 ) * ( ICE_thick2.arr < 1.e10) ; limited mask value of 1.e20, because 1.e20 * 1.e20 = inf for idl
88    ICE_vol_N2 = grossemoyenne(ICE_vol_N2, 'xy', /integration, mask2d = masknp)
89    if jpt mod 12 ne 0 then stop
90    nyr=jpt/12.
91    ICE_vol_N2 = reform(ICE_vol_N2, 12, nyr)
92    ICE_vol_N2 = total(ICE_vol_N2,2)/nyr
93    ICE_vol_N2 = {arr:ICE_vol_N2 * 1.e-9, unit : '10^3 Km^3'}
94
95    ;ICE Area(=Surface) in SOUTH Hemisphere
96    domdef, 0, jpi-1, -90, -30, /xindex
97    ICE_S2 = rseries_ncdf(vICE2, date1_2, date2_2, prefix2, suffix2, FIRSTONLY = 1 - allrec)
98    ICE_thick2 = rseries_ncdf(v2_Ithick, date1_2, date2_2, prefix2, suffix2, FIRSTONLY = 1 - allrec)
99    ; Volume = Area(=Surface) * Thickness
100    ICE_vol_S2 = (ICE_S2.arr < 1.e10 ) * ( ICE_thick.arr < 1.e10) ; limited mask value of 1.e20, because 1.e20 * 1.e20 = inf for idl
101    ICE_vol_S2 = grossemoyenne(ICE_vol_S2, 'xy', /integration, mask2d = masknp)
102    if jpt mod 12 ne 0 then stop
103    nyr=jpt/12.
104    ICE_vol_S2 = reform(ICE_vol_S2, 12, nyr)
105    ICE_vol_S2 = total(ICE_vol_S2,2)/nyr
106    ICE_vol_S2 = {arr:ICE_vol_S2 * 1.e-9, unit : '10^3 Km^3'}
107
108   ; time = tsave   &   IF n_elements(time) NE jpt THEN stop
109
110    if KEYWORD_SET(postscript) then openps, filename+'_2.ps', portrait = 1
111
112    title = 'Northern Hemisphere'+'!C'+prefix+' (BLACK) - '+prefix2+' (RED) '+d1_d2_2 +'!C'+'Global Annual Mean Ice Volume (BLACK) '
113    jpt=12
114    time=julday(1,15,1900)+30*lindgen(12)
115    pltt, ICE_vol_N, 't', MIN = 0., MAX = 40000., /REMPLI, /PORTRAIT, XGRIDSTYLE = 1, window = 2, DATE_FORMAT = '%M' $
116          , small = [1, 2, 1], YTITLE = '10^9 Km^3 ', TITLE = title, _extra = ex
117    pltt, ICE_vol_N2 , 't', /REMPLI, /PORTRAIT $ ; linee tratteggiate LINESTYLE=2  $
118        , /ov1d, COLOR = 250, small = [1, 2, 1], YTITLE = '10^9 Km^3 ', TITLE = title, _extra = ex
119    ;
120    title = 'Southern Hemisphere'+'!C'+prefix+' (BLACK) - '+prefix2+' (RED) '+d1_d2_2+'!C'+'Global Annual Mean Ice Volume'
121    pltt, ICE_vol_S, 't', MIN = 0., MAX = 11000., /REMPLI, /NOERASE, XGRIDSTYLE = 1, DATE_FORMAT = '%M' $
122          , small = [1, 2, 2], YTITLE = '10^9 Km^3 ', TITLE = title, _extra = ex   
123    pltt, ICE_vol_S2, 't',  /REMPLI, /NOERASE $
124          , /ov1d, COLOR = 250, small = [1, 2, 2], YTITLE = '10^9 Km^3 ', TITLE = title, _extra = ex   
125
126    htmltxt = [ htmltxt, '<hr>'+blabla, '<br><img width="80%" src='+filename+'_2.png  />  ' ]
127    if KEYWORD_SET(postscript) then closeps
128
129  endif
130
131  domdef
132 
133
134  return
135end
Note: See TracBrowser for help on using the repository browser.