source: trunk/CONFIG/ORCA2_LIM/IDL_scripts/ts_mean_T.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: 4.0 KB
Line 
1pro ts_mean_T, 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  std_iodir_climato = '/Users/sflod/idl_PLOTS/CLIMATOLOGIES/'
10;  std_iodir_interan = '/Users/sflod/idl_PLOTS/INTERAN/'
11  std_iodir_data = '/Users/sflod/idl_PLOTS/INTERAN/mercure/'
12
13
14  if KEYWORD_SET(POSTSCRIPT) then begin
15     openps, sEXP1+'_Temperature_mean.ps', portrait = 1
16  endif
17 
18  filename = std_iodir_climato+'data_1y_potential_temperature_nomask.nc'
19  Lev = read_ncdf('votemper', filename = filename, /nostruct )
20  Lev_xyz = moyenne(Lev, 'xyz')
21  Lev_z = moyenne(Lev, 'xy',/KEEPBOTTOM)
22
23  ts_Temp = 0.
24  ts_Temp_2 = 0.
25  ts_Temp_Lev = 0.
26  ts_Temp_Lev_2 = 0.
27  ts_Time = 0.
28  ts_z = fltarr(jpk)
29  ts_z_2 = fltarr(jpk)
30 
31  for year=year1,year2 do begin
32     
33     date1 = year * 10000L + 101L
34     date2 = year * 10000L + 1231L
35 
36print,s_iodir_data
37
38     filename = getname(s_iodir_data,sEXP1,'1Y','grid_T',date1)
39     filename2 = getname(s_iodir_data,sEXP2,'1Y','grid_T',date1)
40
41     if filename eq '' then stop
42     Temp   = read_ncdf('thetao',date1 ,date2 , filename = filename, /nostruct)
43     Temp_2 = read_ncdf('thetao',date1 ,date2 , filename = filename2, /nostruct)
44     SSH    =  read_ncdf('zos',date1 ,date2 , filename = filename, /nostruct)
45     SSH_2  =  read_ncdf('zos',date1 ,date2 , filename = filename2, /nostruct)
46
47     ts_Temp = [ ts_Temp, moyenne(Temp, 'xyz',ssh = SSH) ]
48     ts_Temp_2 = [ ts_Temp_2, moyenne(Temp_2, 'xyz',ssh = SSH_2) ]
49     ts_Temp_Lev = [ ts_Temp_Lev, moyenne(Temp, 'xyz',ssh = SSH) - Lev_xyz ]
50     ts_Temp_Lev_2 = [ ts_Temp_Lev_2, moyenne(Temp_2, 'xyz',ssh = SSH_2) - Lev_xyz ]
51     ts_Time = [ ts_Time, Time] ; Time = date
52
53     ts_z = [ [ts_z], [moyenne(Temp, 'xy',/KEEPBOTTOM, ssh = SSH)- Lev_z] ]
54     ts_z_2 = [ [ts_z_2], [moyenne(Temp_2, 'xy',/KEEPBOTTOM, ssh = SSH_2)- Lev_z] ]
55
56  endfor
57
58  ts_Temp = ts_Temp[1:*]        ; remove first record of 0
59  ts_Temp_2 = ts_Temp_2[1:*]        ; remove first record of 0
60  ts_Temp_Lev = ts_Temp_Lev[1:*] ; remove first record of 0
61  ts_Temp_Lev_2 = ts_Temp_Lev_2[1:*] ; remove first record of 0
62  ts_z = ts_z[*,1:*]             ; remove first record of 0
63  ts_z_2 = ts_z_2[*,1:*]             ; remove first record of 0
64 
65  Time = ts_Time[1:*]           ; remove first record of 0
66  jpt = n_elements(Time)
67 
68  title = sEXP1+' Global Annual Mean Temperature --- year '+strtrim(year1,1)+' - '+strtrim(year2,1)
69  pltt, ts_Temp, 't', 1., 4.5, INTER = .5, year1 * 10000L + 101, year2 * 10000L + 1231 , /REMPLI $
70       , small = [1,2,1], YTITLE='Deg C', TITLE = title, FORMAT = '(I3)', /PORTRAIT, _extra = ex
71
72  title = sEXP1+' Global Annual Mean Temperature - Levitus --- year '+strtrim(year1,1)+' - '+strtrim(year2,1)
73  pltt,ts_Temp_Lev, 't', -1., 1., INTER = .25,  year1 * 10000L + 101, year2 * 10000L + 1231 , /REMPLI $
74       , small = [1,2,2], YTITLE='Deg C', TITLE = title, FORMAT = '(I3)', /NOERASE, _extra = ex
75
76  ;;;;;;;;;;;;;;;;; new page  ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
77
78ERASE
79
80  title = sEXP1+' ZT-plot Temperature Mean (0-1500m) - Levitus --- year '+strtrim(year1,1)+' - '+strtrim(year2,1)
81  pltt,ts_z ,'zt', -2., 2., year1 * 10000L + 101, year2 * 10000L + 1231 , /REMPLI $
82       , small = [1,2,1], YTITLE='Deg C', TITLE = title, boxzoom = 1500., /NOERASE, _extra = ex
83 
84  title = sEXP1+' ZT-plot Temperature Mean (0-6000m) - Levitus --- year '+strtrim(year1,1)+' - '+strtrim(year2,1)
85  pltt,ts_z ,'zt', -2., 2., year1 * 10000L + 101, year2 * 10000L + 1231 , /REMPLI $
86       , small = [1,2,2], YTITLE='Deg C', TITLE = title, boxzoom = 6000., /NOERASE, _extra = ex
87 
88if sEXP2 ne sEXP1 then begin
89 
90ERASE
91 
92   title = sEXP1+' - '+sEXP2+' Global Annual Mean Temperature --- year '+strtrim(year1,1)+' - '+strtrim(year2,1)
93   pltt, ts_Temp - ts_Temp_2, 't', -1., 1., year1 * 10000L + 101, year2 * 10000L + 1231 , /REMPLI $
94         , COLOR = 250, small = [1,2,1], YTITLE='Deg C', TITLE = title, FORMAT = '(I3)', /PORTRAIT, _extra = ex
95   
96endif
97
98 
99  if KEYWORD_SET(POSTSCRIPT) then begin
100     closeps
101  endif
102 
103 
104  return
105end
Note: See TracBrowser for help on using the repository browser.