[2709] | 1 | pro xxx_zonal_S, S1, S2, SLev, sEXP1, sEXP2, start_end, POSTSCRIPT = postscript, SUBBASIN = subbasin, MASK_FILENAME = mask_filename, _extra = ex |
---|
| 2 | |
---|
| 3 | compile_opt idl2, strictarrsubs |
---|
| 4 | |
---|
| 5 | @common |
---|
| 6 | |
---|
| 7 | if KEYWORD_SET(SUBBASIN) then subname = subbasin else subname = "Glo" |
---|
| 8 | |
---|
| 9 | |
---|
| 10 | if KEYWORD_SET(POSTSCRIPT) then begin |
---|
| 11 | openps, '017_Zonal_S_'+subname+'_'+sEXP1+'-'+sEXP2+'_y'+start_end+'.ps', portrait = 1 |
---|
| 12 | endif |
---|
| 13 | |
---|
| 14 | ; looking for longitudinal index corresponding to the highest latitude (closest to the North Pole) |
---|
| 15 | index=where(gphit eq max(gphit)) |
---|
| 16 | nx=index[0] mod jpi |
---|
| 17 | gphi_save=gphit |
---|
| 18 | gphit[0,*]=gphit[nx,*] |
---|
| 19 | |
---|
| 20 | if KEYWORD_SET(SUBBASIN) then begin |
---|
| 21 | ; save tmask |
---|
| 22 | tmasksv = tmask |
---|
| 23 | ; |
---|
| 24 | CASE 1 of |
---|
| 25 | subbasin eq 'Atl' : var = 'atlmsk_nomed' |
---|
| 26 | subbasin eq 'Ind' : var = 'indmsk_nored' |
---|
| 27 | subbasin eq 'Pac' : var = 'pacmsk' |
---|
| 28 | ENDCASE |
---|
| 29 | ; |
---|
| 30 | msk = read_ncdf( var, filename = mask_filename, _extra =ex) |
---|
| 31 | |
---|
| 32 | ; from 2D array to 3D array |
---|
| 33 | msk = msk.arr[*]#replicate(1., nzt) |
---|
| 34 | tmask[firstxt:lastxt,firstyt:lastyt,firstzt:lastzt] = tmask[firstxt:lastxt,firstyt:lastyt,firstzt:lastzt] * msk |
---|
| 35 | endif |
---|
| 36 | |
---|
| 37 | varunit = S1.unit |
---|
| 38 | ; |
---|
| 39 | title=sEXP1+' '+subname+' / S year '+start_end |
---|
| 40 | pltz, S1.arr, MININ = 32., MAXIN = 37., INTER = .2, typein = 'yz' $ |
---|
| 41 | , small = [1,2,1], COAST_THICK = 2, TITLE = title, boxzoom = 5500, ZOOM = 1000, /PORTRAIT, _extra=ex |
---|
| 42 | ; |
---|
| 43 | if sEXP1 ne sEXP2 then begin |
---|
| 44 | |
---|
| 45 | title = sEXP1+' - '+sEXP2+' '+subname+' / S year '+start_end |
---|
| 46 | pltz, S1.arr-S2.arr, MIN = -1., MAX = 1., INTER = .1, typein = 'yz' $ |
---|
| 47 | , small = [1,2,2], COAST_THICK = 2, TITLE = title, boxzoom = 5500, ZOOM = 1000, /NOERASE, _extra=ex |
---|
| 48 | |
---|
| 49 | endif else begin |
---|
| 50 | |
---|
| 51 | title=sEXP1+' - Levitus '+subname+'/ S year'+start_end |
---|
| 52 | pltz, S1.arr-SLev.arr, MININ = -1, MAXIN = 1., INTER = .1, typein = 'yz' $ |
---|
| 53 | , small = [1,2,2], COAST_THICK = 2, TITLE = title, boxzoom = 5500, ZOOM = 1000, /NOERASE, _extra = ex |
---|
| 54 | endelse |
---|
| 55 | ; |
---|
| 56 | title = 'Salinity differences in zonal average ' + subname +' with Levitus and '+sEXP1+'-'+sEXP2 |
---|
| 57 | text = [ title, '<img width="80%" src=/Users/sflod/TOOLS/my_IDL/PS/'+sEXP1+'_'+sEXP2+'/ps/017_Zonal_S_'+subname+'_'+sEXP1+'-'+sEXP2+'_y'+start_end+'.png /> ' ] |
---|
| 58 | putfile, '/tmp/prova.txt', text |
---|
| 59 | |
---|
| 60 | if KEYWORD_SET(POSTSCRIPT) then begin |
---|
| 61 | closeps |
---|
| 62 | endif |
---|
| 63 | |
---|
| 64 | |
---|
| 65 | if KEYWORD_SET(SUBBASIN) then tmask = tmasksv |
---|
| 66 | |
---|
| 67 | gphit=gphi_save |
---|
| 68 | |
---|
| 69 | return |
---|
| 70 | end |
---|