source: trunk/tools/nino_composite.pro @ 39

Last change on this file since 39 was 23, checked in by kolasinski, 17 years ago

Add nino_composite.pro in the tools directory

File size: 2.6 KB
Line 
1PRO nino_composite,  FILENAME =  filename
2
3dbase='/home/dynamite/mkolas/database/'
4model='ipsl'
5exp='HH20'
6freq='1m'
7datedeb = 186001
8datefin = 205912
9grid = 'grid_T'
10
11file_TS = exp+'_'+freq+'_'+strtrim(string(datedeb), 1)+'_'+strtrim(string(datefin), 1)+'_'+grid+'.nc'
12print,  'file_TS : ',  file_TS
13
14@initorca0
15
16iodir =  dbase
17print,  'iodir : ',  iodir
18
19;Def de la boite Nino3.4
20lonmin=190
21lonmax=240
22latmin=-5
23latmax=5
24domdef, lonmin,lonmax,latmin,latmax, 0, 10
25date1 = datedeb*100+1
26date2 = datefin*100+12
27
28sstaC = grossemoyenne(read_ncdf('sosstsst',iodir = iodir, date1, date2, filename=file_TS, /nostruct),'xy')
29sstaC_sc = reform(sstaC, 12, jpt/12.)
30sstaC_temp = total(sstaC_sc, 2)*12/jpt
31tab_sst_sc = fltarr(jpt)
32FOR i = 0, jpt/12.-1 DO tab_sst_sc(i*12:i*12+11) = sstaC_temp(*)
33
34;Moyenne glissante Trenberth 3 ou 5 mois ??
35sstaC = ts_smooth(sstaC-tab_sst_sc, 5)
36;
37resp=fltarr(jpt)
38
39;Critere Nino
40a=where(sstaC GT stddev(sstaC)*1.0)
41b=where(sstaC LT stddev(sstaC)*1.0)
42;
43
44Deb_Nino = a(where(a-shift(a,1) GT 1))
45Fin_Nino = a(where(a-shift(a,1) GT 1)-1)
46IF (Fin_Nino(0) LT Deb_Nino(0)) THEN Fin_Nino = Fin_Nino(1:n_elements(Fin_Nino)-1)
47IF(n_elements(Deb_Nino) GT n_elements(Fin_Nino)) THEN Deb_Nino = Deb_Nino(0:n_elements(Fin_Nino)-1)
48Length_Nino = Fin_Nino-Deb_Nino+1
49Deb_Nino = Deb_Nino(where(Length_Nino GT 5))
50Fin_Nino = Fin_Nino(where(Length_Nino GT 5))
51Length_Nino = Length_Nino(where(Length_Nino GT 5))
52
53;;Max_Nino = intarr(n_elements(Deb_Nino))
54;;FOR i = 0, n_elements(Deb_Nino)-1 DO BEGIN
55;;a = max(sstaC(Deb_Nino(i):Fin_Nino(i)),ind)
56;;Max_Nino(i) = ind+Deb_Nino(i)
57;;ENDFOR
58;;Deb_Nino_sel = Deb_Nino(where((Max_Nino mod 12) GE 8 OR (Max_Nino mod 12) LE 1))
59;;Fin_Nino_sel = Fin_Nino(where((Max_Nino mod 12) GE 8 OR (Max_Nino mod 12) LE 1))
60;;Max_Nino_sel = Max_Nino(where((Max_Nino mod 12) GE 8 OR (Max_Nino mod 12) LE 1))
61;;Length_Nino_sel = Length_Nino(where((Max_Nino mod 12) GE 8 OR (Max_Nino mod 12) LE 1))
62
63Year_Nino = Deb_Nino/12
64
65sstaC_Nino = fltarr(n_elements(Year_Nino), 24)
66
67FOR i=0,n_elements(Year_Nino)-1 DO BEGIN
68sstaC_Nino(i, *) = sstaC(Year_Nino(i)*12: (Year_Nino(i)+2)*12-1)
69ENDFOR
70
71jpt = 24
72time = julday(01, 15, 01)+findgen(jpt)*30
73plt1d,reform(sstaC_Nino(0,*)),'t', min = -stddev(sstaC)*3, max = stddev(sstaC)*3, petit = [2, 2, 1], /rempli,xtitle ='', ytitle = 'SSTA (C)', title = model+' '+exp+' '+strtrim(string(n_elements(Year_Nino_Weak)), 1)+' Weak Nino (PrecMAM<2.): Nino34 SSTA',subtitle = '', /port, win = 2
74FOR i=1,n_elements(Year_Nino)-1 DO BEGIN
75plt1d,reform(sstaC_Nino(i,*)),'t', min = -stddev(sstaC)*3, max = stddev(sstaC)*3, /ov1d, /noerase, petit = [2, 2, 1], /rempli,xtitle ='', ytitle = '', title = '',subtitle = '', /port
76ENDFOR
77
78END
Note: See TracBrowser for help on using the repository browser.