source: trunk/NEMOGCM/CONFIG/ORCA2_LIM/IDL_scripts/ts_mean_EMP.pro @ 2709

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

update idl scripts, see ticket 724

File size: 2.0 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 masknp = read_ncdf('tmaskutil', file = 'mesh_mask_partial.nc', /nostruct)
18
19 for year=year1,year2 do begin
20
21 date1 = year * 10000L + 101
22 date2 = year * 10000L + 1231
23 filename = getname(s_iodir_data,sEXP1,'1Y','grid_T',date1)
24 filename2 = getname(s_iodir_data,sEXP2,'1Y','grid_T',date1)
25
26 if filename eq '' then stop
27 EMP = read_ncdf('wfo',date1 ,date2 , filename = filename, /nostruct)
28 EMP2 = read_ncdf('wfo',date1 ,date2 , filename = filename2, /nostruct)
29
30 ts_EMP = [ ts_EMP, moyenne(EMP, 'xy', mask2d = masknp)]
31 ts_EMP2 = [ ts_EMP2, moyenne(EMP2, 'xy', mask2d = masknp)]
32 ts_Time = [ ts_Time, Time] ; Time = date
33
34 endfor
35
36  surf_oce =  e1t * e2t  * tmask[*,*,0]
37  surf_oce = total(surf_oce)
38
39  ts_EMP = ts_EMP[1:*] ; remove first record of 0
40  ts_EMP = ts_EMP * 1.E-09 * surf_oce ; to have Sv
41
42  ts_EMP2 = ts_EMP2[1:*]                ; remove first record of 0
43  ts_EMP2 = ts_EMP2 * 1.E-09 * surf_oce ; to have Sv
44
45  varunit= 'Sv'
46  vol_oce = moyenne( replicate(1., jpi, jpj, jpk), /integration, 'xyz')
47
48  Time = ts_Time[1:*] ; remove first record of 0
49  jpt = n_elements(Time)
50
51  title = sEXP1+' Global Annual EMP Budget (Sv) --- year '+strtrim(year1,1)+' - '+strtrim(year2,1)
52  pltt,ts_EMP,'t', -.01, 0.00, year1 * 10000L + 101, year2 * 10000L + 1231, /REMPLI $
53       , small = [1,2,1], YTITLE = 'Sv', TITLE = title, /PORTRAIT, _extra = ex
54
55  if sEXP2 ne sEXP1 then begin
56     
57     title = sEXP1+' - '+sEXP2+' Global Annual EMP Budget (Sv) --- year '+strtrim(year1,1)+' - '+strtrim(year2,1)
58     pltt,ts_EMP - ts_EMP2,'t', -.002, .002, year1 * 10000L + 101, year2 * 10000L + 1231, /REMPLI, /NOERASE $
59          , COLOR = 250, small = [1,2,2], YTITLE = 'Sv', TITLE = title, /PORTRAIT, _extra = ex
60  endif
61
62  if KEYWORD_SET(POSTSCRIPT) then begin
63     closeps
64  endif
65
66
67  return
68end
Note: See TracBrowser for help on using the repository browser.