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 @ 4495

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

commit FRAM strait export for idl plots, see ticket #724

File size: 8.6 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_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 ;
51  domdef, indx1, indx2, indy1, indy2, /xindex, /yindex,/memeindices
52  ICE = rseries_ncdf(vICE1, date1, date2, prefix, suffix, FIRSTONLY = 1 - allrec, /nostruct)
53  ICE_thick = rseries_ncdf(v1_Ithick, date1, date2, prefix, suffix, FIRSTONLY = 1 - allrec, /nostruct)
54 ; domdef for V-Point in j-1
55 ; REALLY NOT NECESSARY, BECAUSE FLUX CAN BE COMPUTED IN J POINT, is the same
56  domdef, indx1, indx2, indy1-1, indy2-1, /xindex, /yindex,/memeindices
57  VN = rseries_ncdf(v1_IV, date1, date2, prefix, suffix, FIRSTONLY = 1 - allrec,/nostuct) ;!! warning positive northward
58
59  ;; Area export
60  ICE_area_export = (-1) * ICE * VN.arr * ((e1v[firstxv:lastxv, firstyv:lastyv])[*]#replicate(1., jpt))
61  ICE_area_export = total(reform(ICE_area_export),1) ; in m2/s -> need to change the unit?
62
63  ;; Volume export
64  ICE_vol_export = (-1) * ICE * ICE_thick * VN.arr * ((e1v[firstxv:lastxv, firstyv:lastyv])[*]#replicate(1., jpt))
65  ICE_vol_export = total(reform(ICE_vol_export),1) ;! in m3/s -> need to change the unit?
66
67  ;   needed for seasonal cycle :
68  if jpt mod 12 ne 0 then stop
69  nyr=jpt/12.
70  ;; AREA
71  ICE_area_export = reform(ICE_area_export, 12, nyr)
72  ICE_area_export = total(ICE_area_export,2)/nyr
73  ; ICE_area_export = {arr:ICE_area_export * 1.e-12 * 86400 * 365 , unit : '10^6 Km^2/year'}  ; annual mean
74  ICE_area_export = {arr:ICE_area_export * 1.e-12 * 86400 * 30 , unit : '10^6 Km^2/month'}    ; monthly mean
75 
76  ;
77  ICE_vol_export = reform(ICE_vol_export, 12, nyr)
78  ICE_vol_export = total(ICE_vol_export,2)/nyr
79  ; ICE_vol_export = {arr:ICE_vol_export * 1.e-12 * 86400 * 365 , unit : '10^3 Km^3/year'}      ; annual mean
80  ICE_vol_export = {arr:ICE_vol_export * 1.e-12 * 86400 * 30 , unit : '10^3 Km^3/month'}      ; monthly mean
81
82  ;
83  ;title = 'Northern Hemisphere'+'!C'+prefix+' '+d1_d2+'!C'+'Global Annual Mean Ice Volume (Black SOLID simulation)'
84  title = 'Fram Strait Areal Export'+'!C'+prefix+' '+d1_d2
85  jpt=12
86  time=julday(1,15,1900)+30*lindgen(12)
87  ;; pltt, ICE_area_export, 't', 0., 15., 19000101, 19001231, /REMPLI, /PORTRAIT,MIN = 0., MAX = .5 $
88  pltt, ICE_area_export, 't', 0., 15., /REMPLI, /PORTRAIT,MIN = 0., MAX = .5 $
89  ;;      , small = [1, 2, 1], YTITLE = varunit, TITLE = title, _extra = ex
90        , small = [1, 2, 1],YTITLE = '10^6 Km^2/month',  TITLE = title, _extra = ex   
91  ;
92  ;title ='Southern Hemisphere' +'!C'+prefix+' '+d1_d2+' - '+'!C'+'Global Annual Mean Ice Volume (Black SOLID simulation)'
93  title = 'Fram Strait Volume Export'+'!C'+prefix+' '+d1_d2
94  ;; pltt, ICE_vol_export, 't', 0., 15.,19000101 ,19001231 , /REMPLI, /NOERASE , MIN = 0., MAX = .5 $
95  pltt, ICE_vol_export, 't', 0., 15., /REMPLI, /NOERASE , MIN = 0., MAX = .5 $
96  ;;       , small = [1, 2, 2], YTITLE = varunit, TITLE = title, _extra = ex
97       , small = [1, 2, 2], YTITLE = '10^3 Km^3/month', TITLE = title, _extra = ex
98  ;
99  htmltxt = [ htmltxt, '<hr>'+blabla, '<br><img width="80%" src='+filename+'.png  />  ' ]
100  if KEYWORD_SET(postscript) then closeps
101
102  if prefix NE prefix2 then BEGIN
103
104    d1_d2_2 = '('+strtrim(date1_2, 1)+' - '+strtrim(date2_2, 1)+')'
105    tsave = time
106    domdef, indx1, indx2, indy1, indy2, /xindex, /yindex,/memeindices
107    ICE_2= rseries_ncdf(vICE2, date1_2, date2_2, prefix2, suffix2, FIRSTONLY = 1 - allrec, /nostruct)
108    ICE_thick_2 = rseries_ncdf(v2_Ithick, date1_2, date2_2, prefix2, suffix2, FIRSTONLY = 1 - allrec, /nostruct)
109    ; domdef for V-Point in j-1
110    ; REALLY NOT NECESSARY, BECAUSE FLUX CAN BE COMPUTED IN J POINT, is the same
111    domdef, indx1, indx2, indy1-1, indy2-1, /xindex, /yindex,/memeindices
112    VN_2 = rseries_ncdf(v2_IV, date1_2, date2_2, prefix2, suffix2, FIRSTONLY = 1 - allrec,/nostuct) ;!! warning positive northward
113
114    ;; Area export
115    ICE_area_export_2 = (-1) * ICE_2 * VN_2.arr * ((e1v[firstxv:lastxv, firstyv:lastyv])[*]#replicate(1., jpt))
116    ICE_area_export_2 = total(reform(ICE_area_export_2),1) ; in m2/s -> need to change the unit?
117
118    ;; Volume export
119    ICE_vol_export_2 = (-1) * ICE_2 * ICE_thick_2 * VN_2.arr * ((e1v[firstxv:lastxv, firstyv:lastyv])[*]#replicate(1., jpt))
120    ICE_vol_export_2 = total(reform(ICE_vol_export_2),1) ;! in m3/s -> need to change the unit?
121
122    ;   needed for seasonal cycle :
123    if jpt mod 12 ne 0 then stop
124    nyr=jpt/12.
125    ;; AREA
126    ICE_area_export_2 = reform(ICE_area_export_2, 12, nyr)
127    ICE_area_export_2 = total(ICE_area_export_2,2)/nyr
128    ; ICE_area_export_2 = {arr:ICE_area_export_2 * 1.e-12 * 86400 * 365 , unit : '10^6 Km^2/year'}   ; annual mean
129    ICE_area_export_2 = {arr:ICE_area_export_2 * 1.e-12 * 86400 * 30 , unit : '10^6 Km^2/month'}     ; monthly mean
130    ;
131    ICE_vol_export_2 = reform(ICE_vol_export_2, 12, nyr)
132    ICE_vol_export_2 = total(ICE_vol_export_2,2)/nyr
133    ; ICE_vol_export_2 = {arr:ICE_vol_export_2 * 1.e-12 * 86400 * 365 , unit : '10^3 Km^3/year'}     ; annual mean
134    ICE_vol_export_2 = {arr:ICE_vol_export_2 * 1.e-12 * 86400 * 30 , unit : '10^3 Km^3/month'}       ; monthly mean
135    ;
136    ;
137    if KEYWORD_SET(postscript) then openps, filename+'_2.ps', portrait = 1
138
139    title = 'Fram Strait Areal Export'+'!C'+prefix+' (BLACK) - '+prefix2+' (RED) '+d1_d2_2
140    jpt=12
141    time=julday(1,15,1900)+30*lindgen(12)
142    ;; pltt, ICE_area_export.arr, 't', 0., 15., 19000101, 19001231, /REMPLI, /PORTRAIT, MIN = 0., MAX = .5, window = 2 $
143    pltt, ICE_area_export, 't', 0., 15., /REMPLI, /PORTRAIT, MIN = 0., MAX = .5, window = 2 $
144    ;;    , small = [1, 2, 1], YTITLE = varunit, TITLE = title, _extra = ex
145        , small = [1, 2, 1], YTITLE = '10^6 Km^2/month',  TITLE = title, _extra = ex   
146    ;; pltt, ICE_area_export_2.arr ,'t', 0., 15., 19000101, 19001231, /REMPLI, /PORTRAIT $
147    pltt, ICE_area_export_2 ,'t', 0., 15., /REMPLI, /PORTRAIT $
148    ;;    , /ov1d, COLOR = 250, small = [1, 2, 1], YTITLE = varunit,  TITLE = title, _extra = ex
149        , /ov1d, COLOR = 250, small = [1, 2, 1],YTITLE = '10^6 Km^2/month',  TITLE = title, _extra = ex
150    ;
151    title = 'Fram Strait Volume Export'+'!C'+prefix+' (BLACK) - '+prefix2+' (RED) '+d1_d2_2
152    ;; pltt, ICE_vol_export.arr, 't', 0., 15.,19000101 ,19001231 , /REMPLI, /NOERASE , MIN = 0., MAX = .5 $
153    pltt, ICE_vol_export, 't', 0., 15., /REMPLI, /NOERASE , MIN = 0., MAX = .5 $
154    ;;    , small = [1, 2, 2], YTITLE = varunit, TITLE = title, _extra = ex
155        , small = [1, 2, 2], YTITLE = '10^3 Km^3/month', TITLE = title, _extra = ex
156    ;; pltt, ICE_vol_export_2.arr, 't', 0., 15.,19000101 ,19001231 , /REMPLI, /NOERASE  $
157    pltt, ICE_vol_export_2, 't', 0., 15.,  /REMPLI, /NOERASE  $
158    ;;    , /ov1d, COLOR = 250, small = [1, 2, 2], YTITLE = varunit, TITLE = title, _extra = ex
159        , /ov1d, COLOR = 250, small = [1, 2, 2], YTITLE = '10^3 Km^3/month', TITLE = title, _extra = ex
160    ;
161
162    htmltxt = [ htmltxt, '<hr>'+blabla, '<br><img width="80%" src='+filename+'_2.png  />  ' ]
163    if KEYWORD_SET(postscript) then closeps
164
165  endif
166
167  domdef
168 
169
170  return
171end
Note: See TracBrowser for help on using the repository browser.