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.
Changeset 2751 for trunk/NEMOGCM/CONFIG/ORCA2_LIM/IDL_scripts/std_plot_mht.pro – NEMO

Ignore:
Timestamp:
2011-04-26T10:45:52+02:00 (13 years ago)
Author:
smasson
Message:

large update of IDL_scripts for Is-ENES

File:
1 moved

Legend:

Unmodified
Added
Removed
  • trunk/NEMOGCM/CONFIG/ORCA2_LIM/IDL_scripts/std_plot_mht.pro

    r2733 r2751  
    1 pro fig_ht_fromQ,  Q1, Q2, sEXP1, sEXP2, start_end, POSTSCRIPT = postscript, MASK_FILENAME = mask_filename, _extra = ex 
    2    
     1PRO std_plot_domht, Q, masknp, mask_filename, ibce, htr, htr_atl 
     2 
    33  compile_opt idl2, strictarrsubs 
    44 
    5 @common 
     5@common   
    66 
    7   tmask_save = tmask   
    8                                 ; suppress 1/2 north ligne dans TMASK 
    9   tmask[jpi/2:jpi-1,jpj-1,0] = 0b ; 0 byte 
     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  
    1023 
    11   masknp = read_ncdf('tmaskutil', file = 'mesh_mask_partial.nc', /nostruct) 
     24return 
     25END 
    1226 
    13   Qave1 = moyenne(Q1,'xy', mask2d = masknp)  
    14   Qave2 = moyenne(Q2,'xy', mask2d = masknp) 
     27pro std_plot_mht, Q1, Q2, masknp, mask_filename, POSTSCRIPT = postscript,  _extra = ex 
    1528 
    16   Qnet1 = Q1 - Qave1 
    17   Qnet2 = Q2 - Qave2 
     29  compile_opt idl2, strictarrsubs 
    1830 
    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) 
     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 
    2539   
    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 
     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 
    5047   
    5148; update data informations 
     
    5451  vargrid = 'T'  
    5552 
    56   ibce1 = STRTRIM(Qave1, 1) 
    57   ibce2 = STRTRIM(Qave2, 1) 
     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, 2, 1], YTITLE = 'PW',  XGRIDSTYLE = 2, TICKLEN = 1, YGRIDSTYLE = 2, _extra = ex 
     57  plt1d, htr1_atl, 'y', COLOR = 50, /ov1d,  _extra = ex 
    5858 
    59   title = sEXP1+' MHT (Black) & Atlantic MHT (Blue) / year '+start_end 
    60   subtitle = sEXP1 + ' (Qnet='+ibce1+' W/m2) -  (Qnet='+ibce2+' W/m2)' 
     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 
    6162 
    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 
     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 
    6568 
    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    varunit = 'Tw' 
     70    title = 'MHT (TeraW) differences!C'+std_file1_T+' - '+std_file2_T 
     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  htmltxt = [ htmltxt, '<hr>'+blabla, '<br><img width="80%" src='+filename+'.png  />  ' ] 
     79  if KEYWORD_SET(postscript) then closeps 
    6980   
    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 
     81  gphit = gphi_save 
    8882   
    8983  return 
Note: See TracChangeset for help on using the changeset viewer.