New URL for NEMO forge!   http://forge.nemo-ocean.eu

Since March 2022 along with NEMO 4.2 release, the code development moved to a self-hosted GitLab.
This present forge is now archived and remained online for history.
std_ts_ICE_FRAM.pro in branches/2013/dev_MERGE_2013/NEMOGCM/CONFIG/ORCA2_LIM/IDL_scripts – NEMO

source: branches/2013/dev_MERGE_2013/NEMOGCM/CONFIG/ORCA2_LIM/IDL_scripts/std_ts_ICE_FRAM.pro @ 4497

Last change on this file since 4497 was 4497, checked in by flavoni, 10 years ago

update idl scripts, see ticket #724

File size: 11.6 KB
RevLine 
[4394]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_FRAM, 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  v1_IV     = getenv('VAR1_IvelV')   &   prefix = getenv('V1IvV_PREF')  &   suffix = getenv('V1IvV_SUFF')
25; get exp2 info
26  vICE2     = getenv('VAR2_ICE')     &   prefix2 = getenv('V2ICE_PREF')   &   suffix2 = getenv('V2ICE_SUFF')
27  v2_Ithick = getenv('VAR2_Ithick')  &   prefix2 = getenv('V2It_PREF')    &   suffix2 = getenv('V2It_SUFF')
28  v2_IV     = getenv('VAR2_IvelV')   &   prefix = getenv('V2IvV_PREF')    &   suffix = getenv('V2IvV_SUFF')
29
30  cdti3 = string(cnt, format = '(i3.3)')
31  print, cdti3 + ') ' + blabla
32  filename = cdti3 + '_ts_ICE_FRAM_'+prefix
33  if prefix NE prefix2 then filename = filename + '_'+prefix2
34  if KEYWORD_SET(postscript) then openps, filename+'.ps', portrait = 1
35;
36  d1_d2 = '('+strtrim(date1, 1)+' - '+strtrim(date2, 1)+')'
37;
38  iodir = std_iodir_data
39  ; ICE Area(=Surface) in FRAM Strait
40  ;; FRAM Strait points, computed with ncview meshmask for ORCA2 grid (133-1434-135-136, 137)
41  indx0 = 133
42  indx0_last = 136
43  indy0 = 137
44  indy0_last = 137
45  ;; ORI domdef, 133, 137, 136, 136, /xindex, /yindex,/memeindices
46  indx1= (indx0 - ixminmesh + key_shift)mod(jpi)
47  indx2= (indx0_last - ixminmesh + key_shift)mod(jpi)
48  indy1= indy0 - iyminmesh
49  indy2= indy1
50 ;
[4497]51 ;OBSERVATIONS : mean seasonal cycle/month
52  vol_obs = [0.261625, 0.230750, 0.325375, 0.252000, 0.172500, 0.0805000, 0.0805000, 0.0805000, 0.0805000, 0.176500, 0.148500, 0.235000]
53  area_obs = [0.103292, 0.0997500, 0.107625, 0.0944167, 0.0612083, 0.0262500, 0.0262500, 0.0262500, 0.0262500, 0.0843750, 0.0914583, 0.104083]
54 ;
[4394]55  domdef, indx1, indx2, indy1, indy2, /xindex, /yindex,/memeindices
56  ICE = rseries_ncdf(vICE1, date1, date2, prefix, suffix, FIRSTONLY = 1 - allrec, /nostruct)
57  ICE_thick = rseries_ncdf(v1_Ithick, date1, date2, prefix, suffix, FIRSTONLY = 1 - allrec, /nostruct)
58 ; domdef for V-Point in j-1
59 ; REALLY NOT NECESSARY, BECAUSE FLUX CAN BE COMPUTED IN J POINT, is the same
60  domdef, indx1, indx2, indy1-1, indy2-1, /xindex, /yindex,/memeindices
61  VN = rseries_ncdf(v1_IV, date1, date2, prefix, suffix, FIRSTONLY = 1 - allrec,/nostuct) ;!! warning positive northward
62
63  ;; Area export
64  ICE_area_export = (-1) * ICE * VN.arr * ((e1v[firstxv:lastxv, firstyv:lastyv])[*]#replicate(1., jpt))
65  ICE_area_export = total(reform(ICE_area_export),1) ; in m2/s -> need to change the unit?
66
67  ;; Volume export
68  ICE_vol_export = (-1) * ICE * ICE_thick * VN.arr * ((e1v[firstxv:lastxv, firstyv:lastyv])[*]#replicate(1., jpt))
69  ICE_vol_export = total(reform(ICE_vol_export),1) ;! in m3/s -> need to change the unit?
70
71  ;   needed for seasonal cycle :
72  if jpt mod 12 ne 0 then stop
73  nyr=jpt/12.
74  ;; AREA
75  ICE_area_export = reform(ICE_area_export, 12, nyr)
76  ICE_area_export = total(ICE_area_export,2)/nyr
[4495]77  ; ICE_area_export = {arr:ICE_area_export * 1.e-12 * 86400 * 365 , unit : '10^6 Km^2/year'}  ; annual mean
78  ICE_area_export = {arr:ICE_area_export * 1.e-12 * 86400 * 30 , unit : '10^6 Km^2/month'}    ; monthly mean
79 
[4394]80  ;
81  ICE_vol_export = reform(ICE_vol_export, 12, nyr)
82  ICE_vol_export = total(ICE_vol_export,2)/nyr
[4495]83  ; ICE_vol_export = {arr:ICE_vol_export * 1.e-12 * 86400 * 365 , unit : '10^3 Km^3/year'}      ; annual mean
84  ICE_vol_export = {arr:ICE_vol_export * 1.e-12 * 86400 * 30 , unit : '10^3 Km^3/month'}      ; monthly mean
[4394]85
86  ;
87  ;title = 'Northern Hemisphere'+'!C'+prefix+' '+d1_d2+'!C'+'Global Annual Mean Ice Volume (Black SOLID simulation)'
88  title = 'Fram Strait Areal Export'+'!C'+prefix+' '+d1_d2
89  jpt=12
90  time=julday(1,15,1900)+30*lindgen(12)
[4497]91  pltt, ICE_area_export, 't', /REMPLI, /PORTRAIT, MIN = 0., MAX = .5 , XGRIDSTYLE = 1 $
92        , small = [1, 2, 1],YTITLE = '10^6 Km^2/month',  TITLE = title, DATE_FORMAT = '%M', _extra = ex   
93  pltt, area_obs, 't', /REMPLI, /NOERASE, psym = 4, THICK = 4  $    ; light blue
94         , /ov1d, COLOR = 100, small = [1, 2, 2], YTITLE = '10^6 Km^2/month', TITLE = title, DATE_FORMAT = '%M', _extra = ex
[4394]95  ;
[4497]96  tot_area_expo = total(ICE_area_export.arr)
97  ;
98  xyouts, julday(6,15,1900), 0.48, 'Tot. Annual Export OBS = 0.851 million Km2', ALIGN = 0, CHARTHICK = 2, CHARSIZE=1, COLOR=2
99  xyouts, julday(6,15,1900), 0.46, 'Tot. Annual Export Model = '+strtrim(tot_area_expo, 1)+' million Km2', ALIGN = 0, CHARTHICK = 2, CHARSIZE=1, COLOR=2
100  xyouts, julday(7,15,1900), 0.42, 'Data from Kwok et al.(2004), 1979-2002 ', ALIGN = 0, CHARTHICK = 2, CHARSIZE=0.8, COLOR=2
[4394]101  ;title ='Southern Hemisphere' +'!C'+prefix+' '+d1_d2+' - '+'!C'+'Global Annual Mean Ice Volume (Black SOLID simulation)'
102  title = 'Fram Strait Volume Export'+'!C'+prefix+' '+d1_d2
[4497]103  pltt, ICE_vol_export, 't',  /REMPLI, MIN = 0., MAX = .5 , /NOERASE, XGRIDSTYLE = 1 $
104       , small = [1, 2, 2], YTITLE = '10^3 Km^3/month', TITLE = title, DATE_FORMAT = '%M', _extra = ex
105  pltt, vol_obs, 't', /REMPLI, /NOERASE, psym = 4, THICK = 4  $    ; light blue
106         , /ov1d, COLOR = 100, small = [1, 2, 2], YTITLE = '10^6 Km^2/month',DATE_FORMAT = '%M', TITLE = title, _extra = ex
[4394]107  ;
[4497]108  tot_vol_expo = total(ICE_vol_export.arr)
109  tot_vol_expo_Sv = tot_vol_expo * 1.e06 * 1/86400 * 1/365 ; annual mean in Sverdrup
110  xyouts, julday(6,15,1900), 0.48, 'Tot. Annual Export OBS = 2124 Km3/year', ALIGN = 0, CHARTHICK = 2, CHARSIZE=1, COLOR=2
111  xyouts, julday(6,15,1900), 0.46, 'Tot. Annual Export Model = '+strtrim(tot_vol_expo, 1)+' Km3/year', ALIGN = 0, CHARTHICK = 2, CHARSIZE=1, COLOR=2
112  xyouts, julday(9,15,1900), 0.44, 'in Sv = '+strtrim(tot_vol_expo_Sv, 1)+' Sv', ALIGN = 0, CHARTHICK = 2, CHARSIZE=1, COLOR=2
113  xyouts, julday(7,15,1900), 0.38, 'Data from Kwok et al.(2004), 1992-1998 ', ALIGN = 0, CHARTHICK = 2, CHARSIZE=0.8, COLOR=2
114
[4394]115  htmltxt = [ htmltxt, '<hr>'+blabla, '<br><img width="80%" src='+filename+'.png  />  ' ]
116  if KEYWORD_SET(postscript) then closeps
117
118  if prefix NE prefix2 then BEGIN
119
120    d1_d2_2 = '('+strtrim(date1_2, 1)+' - '+strtrim(date2_2, 1)+')'
121    tsave = time
122    domdef, indx1, indx2, indy1, indy2, /xindex, /yindex,/memeindices
123    ICE_2= rseries_ncdf(vICE2, date1_2, date2_2, prefix2, suffix2, FIRSTONLY = 1 - allrec, /nostruct)
124    ICE_thick_2 = rseries_ncdf(v2_Ithick, date1_2, date2_2, prefix2, suffix2, FIRSTONLY = 1 - allrec, /nostruct)
125    ; domdef for V-Point in j-1
126    ; REALLY NOT NECESSARY, BECAUSE FLUX CAN BE COMPUTED IN J POINT, is the same
127    domdef, indx1, indx2, indy1-1, indy2-1, /xindex, /yindex,/memeindices
128    VN_2 = rseries_ncdf(v2_IV, date1_2, date2_2, prefix2, suffix2, FIRSTONLY = 1 - allrec,/nostuct) ;!! warning positive northward
129
130    ;; Area export
131    ICE_area_export_2 = (-1) * ICE_2 * VN_2.arr * ((e1v[firstxv:lastxv, firstyv:lastyv])[*]#replicate(1., jpt))
132    ICE_area_export_2 = total(reform(ICE_area_export_2),1) ; in m2/s -> need to change the unit?
133
134    ;; Volume export
135    ICE_vol_export_2 = (-1) * ICE_2 * ICE_thick_2 * VN_2.arr * ((e1v[firstxv:lastxv, firstyv:lastyv])[*]#replicate(1., jpt))
136    ICE_vol_export_2 = total(reform(ICE_vol_export_2),1) ;! in m3/s -> need to change the unit?
137
138    ;   needed for seasonal cycle :
139    if jpt mod 12 ne 0 then stop
140    nyr=jpt/12.
141    ;; AREA
142    ICE_area_export_2 = reform(ICE_area_export_2, 12, nyr)
143    ICE_area_export_2 = total(ICE_area_export_2,2)/nyr
[4495]144    ; ICE_area_export_2 = {arr:ICE_area_export_2 * 1.e-12 * 86400 * 365 , unit : '10^6 Km^2/year'}   ; annual mean
145    ICE_area_export_2 = {arr:ICE_area_export_2 * 1.e-12 * 86400 * 30 , unit : '10^6 Km^2/month'}     ; monthly mean
[4394]146    ;
147    ICE_vol_export_2 = reform(ICE_vol_export_2, 12, nyr)
148    ICE_vol_export_2 = total(ICE_vol_export_2,2)/nyr
[4495]149    ; ICE_vol_export_2 = {arr:ICE_vol_export_2 * 1.e-12 * 86400 * 365 , unit : '10^3 Km^3/year'}     ; annual mean
150    ICE_vol_export_2 = {arr:ICE_vol_export_2 * 1.e-12 * 86400 * 30 , unit : '10^3 Km^3/month'}       ; monthly mean
[4394]151    ;
152    ;
153    if KEYWORD_SET(postscript) then openps, filename+'_2.ps', portrait = 1
154
[4395]155    title = 'Fram Strait Areal Export'+'!C'+prefix+' (BLACK) - '+prefix2+' (RED) '+d1_d2_2
[4394]156    jpt=12
157    time=julday(1,15,1900)+30*lindgen(12)
[4497]158    pltt, ICE_area_export, 't', /REMPLI, /PORTRAIT, MIN = 0., MAX = .5, XGRIDSTYLE = 1, window = 2 $
159        , small = [1, 2, 1], YTITLE = '10^6 Km^2/month',  TITLE = title, DATE_FORMAT = '%M', _extra = ex   
160    pltt, ICE_area_export_2 ,'t', /REMPLI, /PORTRAIT, /NOERASE $
161        , /ov1d, COLOR = 250, small = [1, 2, 1],YTITLE = '10^6 Km^2/month',  TITLE = title, DATE_FORMAT = '%M', _extra = ex
162    pltt, area_obs, 't', /REMPLI, /NOERASE, psym = 4, THICK = 4  $    ; light blue
163         , /ov1d, COLOR = 100, small = [1, 2, 2], YTITLE = '10^6 Km^2/month', TITLE = title, DATE_FORMAT = '%M', _extra = ex
[4394]164    ;
[4497]165    tot_area_expo = total(ICE_area_export.arr)
166    tot_area_expo_2 = total(ICE_area_export_2.arr)
167    ;
168    xyouts, julday(6,15,1900), 0.48, 'Tot. Annual Export OBS = 0.851 million Km2', ALIGN = 0, CHARTHICK = 2, CHARSIZE=1, COLOR=2
169    xyouts, julday(6,15,1900), 0.46, 'Tot. Annual Export Model 1= '+strtrim(tot_area_expo, 1)+' million Km2', ALIGN = 0, CHARTHICK = 2, CHARSIZE=1, COLOR=2
170    xyouts, julday(6,15,1900), 0.44, 'Tot. Annual Export Model 2= '+strtrim(tot_area_expo_2, 1)+' million Km2', ALIGN = 0, CHARTHICK = 2, CHARSIZE=1, COLOR=2
171    xyouts, julday(7,15,1900), 0.42, 'Data from Kwok et al.(2004), 1979-2002 ', ALIGN = 0, CHARTHICK = 2, CHARSIZE=0.8, COLOR=2
[4395]172    title = 'Fram Strait Volume Export'+'!C'+prefix+' (BLACK) - '+prefix2+' (RED) '+d1_d2_2
[4497]173    pltt, ICE_vol_export, 't', /REMPLI,  MIN = 0., MAX = .5, /NOERASE, XGRIDSTYLE = 1 $
174        , small = [1, 2, 2], YTITLE = '10^3 Km^3/month', TITLE = title, DATE_FORMAT = '%M', _extra = ex
175    pltt, ICE_vol_export_2, 't', /REMPLI, /NOERASE  $
176        , /ov1d, COLOR = 250, small = [1, 2, 2], YTITLE = '10^3 Km^3/month', TITLE = title, DATE_FORMAT = '%M',  _extra = ex
177    pltt, vol_obs, 't', /REMPLI, /NOERASE, psym = 4, THICK = 4  $    ; light blue
178         , /ov1d, COLOR = 100, small = [1, 2, 2], YTITLE = '10^6 Km^2/month', TITLE = title, DATE_FORMAT = '%M', _extra = ex
[4394]179    ;
[4497]180    tot_vol_expo = total(ICE_vol_export.arr)
181    tot_vol_expo_2 = total(ICE_vol_export_2.arr)
182    tot_vol_expo_Sv = tot_vol_expo * 1.e06 * 1/86400 * 1/365 ; annual mean in Sverdrup
183    tot_vol_expo_2_Sv = tot_vol_expo_2 * 1.e06 * 1/86400 * 1/365 ; annual mean in Sverdrup
184    xyouts, julday(6,15,1900), 0.48, 'Tot. Annual Export OBS = 2124 Km3/year', ALIGN = 0, CHARTHICK = 2, CHARSIZE=1, COLOR=2
185    xyouts, julday(6,15,1900), 0.46, 'Tot. Annual Export Model 1 = '+strtrim(tot_vol_expo, 1)+' Km3/year', ALIGN = 0, CHARTHICK = 2, CHARSIZE=1, COLOR=2
186    xyouts, julday(9,15,1900), 0.44, 'in Sv = '+strtrim(tot_vol_expo_Sv, 1)+' Sv', ALIGN = 0, CHARTHICK = 2, CHARSIZE=1, COLOR=2
187    xyouts, julday(6,15,1900), 0.42, 'Tot. Annual Export Model 2 = '+strtrim(tot_vol_expo_2, 1)+' Km3/year', ALIGN = 0, CHARTHICK = 2, CHARSIZE=1, COLOR=2
188    xyouts, julday(9,15,1900), 0.40, 'in Sv = '+strtrim(tot_vol_expo_2_Sv, 1)+' Sv', ALIGN = 0, CHARTHICK = 2, CHARSIZE=1, COLOR=2
189    xyouts, julday(7,15,1900), 0.38, 'Data from Kwok et al.(2004), 1992-1998 ', ALIGN = 0, CHARTHICK = 2, CHARSIZE=0.8, COLOR=2
[4394]190
191    htmltxt = [ htmltxt, '<hr>'+blabla, '<br><img width="80%" src='+filename+'_2.png  />  ' ]
192    if KEYWORD_SET(postscript) then closeps
193
194  endif
195
196  domdef
197 
198
199  return
200end
Note: See TracBrowser for help on using the repository browser.