New URL for NEMO forge!   http://forge.nemo-ocean.eu

Since March 2022 along with NEMO 4.2 release, the code development moved to a self-hosted GitLab.
This present forge is now archived and remained online for history.
fig_ht_fromQ.pro in trunk/NEMOGCM/CONFIG/ORCA2_LIM/IDL_scripts – NEMO

source: trunk/NEMOGCM/CONFIG/ORCA2_LIM/IDL_scripts/fig_ht_fromQ.pro @ 2537

Last change on this file since 2537 was 2537, checked in by flavoni, 14 years ago

update IDL scripts, see ticket #724

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