source: trunk/CONFIG/ORCA2_LIM/IDL_scripts/ts_mean_EMP.pro @ 2150

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

commit idl tools for post-processing, for ORCA2_LIM configuration, see ticket #724

File size: 1.9 KB
Line 
1pro ts_mean_EMP, sEXP1, sEXP2, year1, year2, s_iodir_data, POSTSCRIPT = postscript, _extra = ex
2
3  compile_opt idl2, strictarrsubs
4 
5  @common
6
7 @initorca2
8 
9 if KEYWORD_SET(POSTSCRIPT) then begin
10    openps, sEXP1+'_EMP_mean.ps', portrait = 1
11 endif
12
13 ts_EMP = 0.
14 ts_EMP2 = 0.
15 ts_Time = 0.
16
17 for year=year1,year2 do begin
18
19 date1 = year * 10000L + 101
20 date2 = year * 10000L + 1231
21 filename = getname(s_iodir_data,sEXP1,'1Y','grid_T',date1)
22 filename2 = getname(s_iodir_data,sEXP2,'1Y','grid_T',date1)
23
24 if filename eq '' then stop
25 EMP = read_ncdf('wfo',date1 ,date2 , filename = filename, /nostruct)
26 EMP2 = read_ncdf('wfo',date1 ,date2 , filename = filename2, /nostruct)
27
28 ts_EMP = [ ts_EMP, moyenne(EMP, 'xy')]
29 ts_EMP2 = [ ts_EMP2, moyenne(EMP2, 'xy')]
30 ts_Time = [ ts_Time, Time] ; Time = date
31
32 endfor
33
34  surf_oce =  e1t * e2t  * tmask[*,*,0]
35  surf_oce = total(surf_oce)
36
37  ts_EMP = ts_EMP[1:*] ; remove first record of 0
38  ts_EMP = ts_EMP * 1.E-09 * surf_oce ; to have Sv
39
40  ts_EMP2 = ts_EMP2[1:*]                ; remove first record of 0
41  ts_EMP2 = ts_EMP2 * 1.E-09 * surf_oce ; to have Sv
42
43  varunit= 'Sv'
44  vol_oce = moyenne( replicate(1., jpi, jpj, jpk), /integration, 'xyz')
45
46  Time = ts_Time[1:*] ; remove first record of 0
47  jpt = n_elements(Time)
48
49  title = sEXP1+' Global Annual EMP Budget (Sv) --- year '+strtrim(year1,1)+' - '+strtrim(year2,1)
50  pltt,ts_EMP,'t', -.01, 0.00, year1 * 10000L + 101, year2 * 10000L + 1231, /REMPLI $
51       , small = [1,2,1], YTITLE = 'Sv', TITLE = title, /PORTRAIT, _extra = ex
52
53  if sEXP2 ne sEXP1 then begin
54     
55     title = sEXP1+' - '+sEXP2+' Global Annual EMP Budget (Sv) --- year '+strtrim(year1,1)+' - '+strtrim(year2,1)
56     pltt,ts_EMP - ts_EMP2,'t', -.002, .002, year1 * 10000L + 101, year2 * 10000L + 1231, /REMPLI, /NOERASE $
57          , COLOR = 250, small = [1,2,2], YTITLE = 'Sv', TITLE = title, /PORTRAIT, _extra = ex
58  endif
59
60  if KEYWORD_SET(POSTSCRIPT) then begin
61     closeps
62  endif
63
64
65  return
66end
Note: See TracBrowser for help on using the repository browser.