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.
ts_mean_S.pro in branches/dev_r2586_dynamic_mem/NEMOGCM/CONFIG/ORCA2_LIM/IDL_scripts – NEMO

source: branches/dev_r2586_dynamic_mem/NEMOGCM/CONFIG/ORCA2_LIM/IDL_scripts/ts_mean_S.pro @ 2713

Last change on this file since 2713 was 2713, checked in by rblod, 13 years ago

Phasing dynamic memory branch with version 2712 off the trunk

File size: 4.2 KB
Line 
1pro ts_mean_S, sEXP1, sEXP2, year1, year2, s_iodir_data, POSTSCRIPT = postscript, _extra = ex
2
3  compile_opt idl2, strictarrsubs
4 
5  @common
6 
7  @initorca2
8 
9  std_iodir_climato = '/Users/sflod/idl_PLOTS/CLIMATOLOGIES/'
10  std_iodir_interan = '/Users/sflod/idl_PLOTS/INTERAN/'
11
12
13  if KEYWORD_SET(POSTSCRIPT) then begin
14     openps, sEXP1+'_Salinity_mean.ps', portrait = 1
15  endif
16 
17  filename = std_iodir_climato+'data_1y_salinity_nomask.nc'
18  Lev = read_ncdf('vosaline', filename = filename, /nostruct )
19  Lev_xyz = moyenne(Lev, 'xyz',  mask2d = masknp)
20  Lev_z = moyenne(Lev, 'xy', mask2d = masknp ,/KEEPBOTTOM)
21
22  ts_Sal = 0.
23  ts_Sal_2 = 0.
24  ts_Sal_Lev = 0.
25  ts_Sal_Lev_2 = 0.
26  ts_Time = 0.
27  ts_z = fltarr(jpk)
28  ts_z_2 = fltarr(jpk)
29
30  masknp = read_ncdf('tmaskutil', file = 'mesh_mask_partial.nc', /nostruct)
31
32  for year=year1,year2 do begin
33     
34     date1 = year * 10000L + 101
35     date2 = year * 10000L + 1231
36     filename = getname(s_iodir_data,sEXP1,'1Y','grid_T',date1)
37     filename2 = getname(s_iodir_data,sEXP2,'1Y','grid_T',date1)
38
39     if filename eq '' then stop
40     Sal   = read_ncdf('so',date1 ,date2 , filename = filename, /nostruct)
41     Sal_2 = read_ncdf('so',date1 ,date2 , filename = filename2, /nostruct)
42     SSH   =  read_ncdf('zos',date1 ,date2 , filename = filename, /nostruct)
43     SSH_2 =  read_ncdf('zos',date1 ,date2 , filename = filename2, /nostruct)
44
45     ts_Sal = [ ts_Sal, moyenne(Sal, 'xyz', mask2d = masknp, ssh = SSH) ]
46     ts_Sal_2 = [ ts_Sal_2, moyenne(Sal_2, 'xyz', mask2d = masknp, ssh = SSH_2) ]
47     ts_Sal_Lev = [ ts_Sal_Lev, moyenne(Sal, 'xyz', mask2d = masknp, ssh = SSH) - Lev_xyz ]
48     ts_Sal_Lev_2 = [ ts_Sal_Lev_2, moyenne(Sal_2, 'xyz', mask2d = masknp, ssh = SSH_2) - Lev_xyz ]
49     ts_Time = [ ts_Time, Time] ; Time = date
50
51     ts_z = [ [ts_z], [moyenne(Sal, 'xy',/KEEPBOTTOM, mask2d = masknp, ssh = SSH)- Lev_z] ]
52     ts_z_2 = [ [ts_z_2], [moyenne(Sal_2, 'xy',/KEEPBOTTOM, mask2d = masknp, ssh = SSH_2)- Lev_z] ]
53
54  endfor
55 
56  ts_Sal = ts_Sal[1:*]             ; remove first record of 0
57  ts_Sal_2 = ts_Sal_2[1:*]         ; remove first record of 0
58  ts_Sal_Lev = ts_Sal_Lev[1:*]     ; remove first record of 0
59  ts_Sal_Lev_2 = ts_Sal_Lev_2[1:*] ; remove first record of 0
60 
61  ts_z = ts_z[*,1:*]            ; remove first record of 0
62  ts_z_2 = ts_z_2[*,1:*]            ; remove first record of 0
63 
64  Time = ts_Time[1:*]           ; remove first record of 0
65  jpt = n_elements(Time)
66
67
68  title = sEXP1+' Global Annual Mean Salinity --- year '+strtrim(year1,1)+' - '+strtrim(year2,1)
69  pltt, ts_Sal, 't', 34.54, 34.76, INTER = .2, year1 * 10000L + 101, year2 * 10000L + 1231, /REMPLI $
70       , small = [1,2,1], YTITLE='psu', TITLE = title, FORMAT = '(I3)', /PORTRAIT, _extra = ex
71
72  title = sEXP1+' Global Annual Mean Salinity - Levitus --- year '+strtrim(year1,1)+' - '+strtrim(year2,1)
73  pltt, ts_Sal_Lev, 't', -.05, .05, year1 * 10000L + 101, year2 * 10000L + 1231, /REMPLI $
74       , small = [1,2,2], YTITLE='psu',  TITLE = title, FORMAT = '(I3)', /NOERASE, _extra = ex
75
76;;;;;;;;;;;;;;;;; new page ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
77ERASE
78 
79  title = sEXP1+' ZT-plot Salinity Mean (0-1500m) - Levitus --- year '+strtrim(year1,1)+' - '+strtrim(year2,1)
80  pltt,ts_z ,'zt', -.5, .5, INTER = .025, year1 * 10000L + 101, year2 * 10000L + 1231 , /REMPLI $
81       , small = [1,2,1], YTITLE='psu', STYLE = 'so0so',  TITLE = title, boxzoom = 1500., /PORTRAIT, _extra = ex
82
83  title = sEXP1+' ZT-plot Salinity Mean (0-6000) - Levitus --- year '+strtrim(year1,1)+' - '+strtrim(year2,1)
84  pltt,ts_z,'zt', -.5, .5, INTER = .025, year1 * 10000L + 101, year2 * 10000L + 1231, /REMPLI $
85       , small = [1,2,2], YTITLE='psu', STYLE = 'so0so',  TITLE = title, boxzoom = 6000., zoom = 1500.,  /NOERASE, _extra = ex
86 
87
88if sEXP2 ne sEXP1 then begin
89
90ERASE
91
92   title = sEXP1+' - '+sEXP2+' Global Annual Mean Salinity --- year '+strtrim(year1,1)+' - '+strtrim(year2,1)
93   pltt, ts_Sal - ts_Sal_2, 't', -1., 1., INTER = .2, year1 * 10000L + 101, year2 * 10000L + 1231, /REMPLI $
94         , COLOR = 250, small = [1,2,1], YTITLE='psu', TITLE = title, FORMAT = '(I3)', /PORTRAIT, _extra = ex
95   
96endif
97
98 
99  if KEYWORD_SET(POSTSCRIPT) then begin
100     closeps
101  endif
102 
103 
104  return
105end
Note: See TracBrowser for help on using the repository browser.