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.
std_plot_mht.pro in NEMO/trunk/cfgs/ORCA2_ICE_PISCES/IDL_scripts – NEMO

source: NEMO/trunk/cfgs/ORCA2_ICE_PISCES/IDL_scripts/std_plot_mht.pro @ 10161

Last change on this file since 10161 was 7732, checked in by flavoni, 7 years ago

commit idl scripts deleted

File size: 3.3 KB
Line 
1PRO std_plot_domht, Q, masknp, mask_filename, ibce, htr, htr_atl
2
3  compile_opt idl2, strictarrsubs
4
5@common 
6
7  Qave = moyenne(Q, 'xy', mask2d = masknp) ; mean value
8  Qnet = Q - Qave
9  ibce = STRTRIM(Qave, 1)
10;
11  msk = read_ncdf('atlmsk_nomed', filename = mask_filename, /nostruct)
12  msk = msk[*]#replicate(1., nzt) ; from 2D array to 3D array
13                               
14; *1.E-15 to have PetaWatt
15  Qx     = moyenne(Qnet*e2t    , 'x', mask2d = masknp, /integration)*1.E-15
16  Qx_atl = moyenne(Qnet*e2t*msk, 'x', mask2d = masknp, /integration)*1.E-15
17; northward heat flux transport from antartic 
18  htr     = total(Qx, /cumulative)
19  htr_atl = total(reverse(Qx_atl), /cumulative) ; ! from north to south
20  htr_atl = -reverse(htr_atl)
21; we take from values north till 30° South
22  htr_atl[where(gphit[0, *] lt -30.)] = !Values.F_NaN
23
24return
25END
26
27pro std_plot_mht, Q1, Q2, masknp, mask_filename, POSTSCRIPT = postscript,  _extra = ex
28
29  compile_opt idl2, strictarrsubs
30
31@common 
32@std_common
33
34  cdti3 = string(cnt, format = '(i3.3)')
35  print, cdti3 + ') ' + blabla
36  filename = cdti3 + '_MHT_'+std_file1_T
37  if std_file1_T NE std_file2_T then filename = filename + '_'+std_file2_T
38  if KEYWORD_SET(postscript) then openps, filename+'.ps', portrait = 1
39 
40; find the x index with the highest latitude (for the plot)
41  index = where(gphit eq max(gphit))
42  nx = index[0] mod jpi
43  gphi_save = gphit
44  gphit[0, *] = gphit[nx, *]
45; compute meridional heat transport
46  std_plot_domht, Q1, masknp, mask_filename, ibce1, htr1, htr1_atl
47 
48; update data informations
49  varname = 'MHT'
50  varunit = 'Pw'
51  vargrid = 'T'
52
53  title = 'MHT (Black) & Atlantic MHT (Blue)!C'+std_file1_T
54  subtitle = '(Qnet='+ibce1+' W/m2)'
55  plt1d, htr1, 'y', min = -2., max = 2.5, TITLE = title, SUBTITLE = subtitle, /portrait $
56         , SMALL = [2-(std_file1_T EQ std_file2_T), 2, 1], YTITLE = 'PW',  XGRIDSTYLE = 2, TICKLEN = 1, YGRIDSTYLE = 2, _extra = ex
57  plt1d, htr1_atl, 'y', COLOR = 50, /ov1d,  _extra = ex
58
59  if std_file1_T NE std_file2_T then begin
60; compute meridional heat transport
61    std_plot_domht, Q2, masknp, mask_filename, ibce2, htr2, htr2_atl
62
63    title = 'MHT (Black) & Atlantic MHT (Blue)!C'+std_file2_T
64    subtitle = '(Qnet='+ibce2+' W/m2)'
65    plt1d, htr2, 'y', min = -2., max = 2.5, TITLE = title, SUBTITLE = subtitle, /noerase $
66           , SMALL = [2, 2, 2], YTITLE = 'PW',  XGRIDSTYLE = 2, TICKLEN = 1, YGRIDSTYLE = 2, _extra = ex
67    plt1d, htr2_atl, 'y', COLOR = 50, /ov1d,  _extra = ex
68
69    title = 'MHT (Black) & Atlantic MHT (Blue) '+std_file1_T+' !C (Red) '+std_file2_T
70    plt1d, htr1, 'y', min = -2., max = 2., TITLE = title $
71           , SMALL = [2, 2, 3], TICKLEN = 1, XGRIDSTYLE = 2 $
72           , YTITLE = 'PW', YGRIDSTYLE = 2, /NOERASE, _extra = ex
73    plt1d, htr2, 'y', COLOR = 250, /ov1d,  _extra = ex
74    plt1d, htr1_atl, 'y', COLOR = 50, /ov1d,  _extra = ex
75    plt1d, htr2_atl, 'y', COLOR = 250, /ov1d,  _extra = ex
76    ;plt1d, (htr1-htr2)*1.e3, 'y', min = -250., max = 250., TITLE = title $
77    ;       , SMALL = [2, 2, 3], TICKLEN = 1, XGRIDSTYLE = 2 $
78    ;       , YTITLE = 'TW', YGRIDSTYLE = 2, /NOERASE, _extra = ex
79    ;plt1d, (htr1_atl - htr2_atl)*1.e3, 'y', COLOR = 50, /ov1d,  _extra = ex
80   
81  endif
82
83  htmltxt = [ htmltxt, '<hr>'+blabla, '<br><img width="80%" src='+filename+'.png  />  ' ]
84  if KEYWORD_SET(postscript) then closeps
85 
86  gphit = gphi_save
87 
88  return
89end
Note: See TracBrowser for help on using the repository browser.