source: trunk/NEMOGCM/CONFIG/ORCA2_LIM/IDL_scripts/fig_ht_fromQ.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: 3.1 KB
Line 
1pro fig_ht_fromQ,  Q1, Q2, sEXP1, sEXP2, start_end, POSTSCRIPT = postscript, MASK_FILENAME = mask_filename, _extra = ex
2 
3  compile_opt idl2, strictarrsubs
4
5@common
6
7  tmask_save = tmask 
8                                ; suppress 1/2 north ligne dans TMASK
9  tmask[jpi/2:jpi-1,jpj-1,0] = 0b ; 0 byte
10
11  masknp = read_ncdf('tmaskutil', file = 'mesh_mask_partial.nc', /nostruct)
12
13  Qave1 = moyenne(Q1,'xy', mask2d = masknp)
14  Qave2 = moyenne(Q2,'xy', mask2d = masknp)
15
16  Qnet1 = Q1 - Qave1
17  Qnet2 = Q2 - Qave2
18
19  index=where(gphit eq max(gphit))
20  nx=index[0] mod jpi
21  gphi_save=gphit
22  gphit[0,*]=gphit[nx,*]
23                                ;
24  msk = read_ncdf( 'atlmsk_nomed', filename = mask_filename, _extra = ex)
25 
26                                ; from 2D array to 3D array
27  msk = msk.arr[*]#replicate(1., nzt)
28 
29                                ; x average (zonal mean)
30                                ; *1.E-15 to have PetaWatt
31  Q1x = moyenne(Qnet1*e2t,'x', mask2d = masknp,/integration)*1.E-15
32  Q2x = moyenne(Qnet2*e2t,'x', mask2d = masknp,/integration)*1.E-15
33  Q1x_atl = moyenne(Qnet1*e2t*msk,'x', mask2d = masknp,/integration)*1.E-15
34  Q2x_atl = moyenne(Qnet2*e2t*msk,'x', mask2d = masknp,/integration)*1.E-15
35                                ; northward heat flux transport from antartic 
36  htr1 = total(Q1x, /cumulative)
37  htr2 = total(Q2x, /cumulative)
38  htr1_atl = total(reverse(Q1x_atl), /cumulative)
39  htr1_atl = -reverse(htr1_atl)
40  htr2_atl = total(reverse(Q2x_atl), /cumulative)
41  htr2_atl = -reverse(htr2_atl)
42
43  bad_gphit = where(gphit[0,*] lt -30.)
44  htr1_atl[bad_gphit] = !Values.F_NaN   ; we take from values north till 30° South
45  htr2_atl[bad_gphit] = !Values.F_NaN   ; we take from values north till 30° South
46
47  if KEYWORD_SET(POSTSCRIPT) then begin
48     openps, '004_MHT_'+sEXP1+'-'+sEXP2+'_y'+start_end+ '.ps', /landscape
49  endif
50 
51; update data informations
52  varname = 'MHT'
53  varunit = 'Pw'
54  vargrid = 'T'
55
56  ibce1 = STRTRIM(Qave1, 1)
57  ibce2 = STRTRIM(Qave2, 1)
58
59  title = sEXP1+' MHT (Black) & Atlantic MHT (Blue) / year '+start_end
60  subtitle = sEXP1 + ' (Qnet='+ibce1+' W/m2) -  (Qnet='+ibce2+' W/m2)'
61
62  plt1d, htr1,'y',min = -2., max = 2.5, TITLE=title, SUBTITLE = subtitle $
63        , SMALL = [2,2,1], YTITLE = 'PW',  XGRIDSTYLE = 2, TICKLEN = 1, YGRIDSTYLE = 2 , _extra = ex
64  plt1d, htr1_atl,'y', COLOR = 50, /ov1d,  _extra = ex
65
66 if sEXP1 ne sEXP2 then begin
67  plt1d, htr2,'y', /ov1d, LINESTYLE = 2, _extra = ex
68  plt1d, htr2_atl,'y', /ov1d, LINESTYLE = 2, _extra = ex
69 
70  title = sEXP1+' - '+sEXP2+' MHT (TeraW) differences / year '+start_end
71  plt1d, (htr1-htr2)*1.e3,'y',min = -250., max = 250., TITLE = title $
72         , SMALL = [2,2,3], TICKLEN = 1, XGRIDSTYLE = 2 $
73         , YTITLE = 'TW', YGRIDSTYLE = 2, /NOERASE, _extra = ex
74  plt1d, (htr1_atl - htr2_atl)*1.e3,'y', COLOR = 50, /ov1d,  _extra = ex
75 
76 endif
77
78  title = 'Qnet'
79  text = [   title, '<img width="80%" src=/Users/sflod/TOOLS/my_IDL/PS/'+sEXP1+'_'+sEXP2+'/ps/004_MHT_'+sEXP1+'-'+sEXP2+'_y'+start_end+ '.png  />  ' ]
80  putfile, '/tmp/prova.txt', text
81
82  if KEYWORD_SET(POSTSCRIPT) then begin
83     closeps
84  endif
85 
86  tmask=tmask_save
87  gphit=gphi_save
88 
89  return
90end
Note: See TracBrowser for help on using the repository browser.