;********************************************************************************** ; sources & targets ;********************************************************************************** ;********************************************************************************** load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl" load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl" load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl" load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/shea_util.ncl" ;------------------------------------------- begin wks = gsn_open_wks("ps","sources_targets") ; open a ps file ;gsn_define_colormap(wks,"wh-bl-gr-ye-re") ; choose a colormap res = True res@gsnDraw = False res@gsnFrame = False res@mpOceanFillColor = "Blue" res@mpLandFillColor = "Gray" res@mpInlandWaterFillColor = "Blue" res@mpLimitMode = "LatLon" res@mpMinLonF = -33 res@mpMaxLonF = 63 res@mpMinLatF = 18 res@mpMaxLatF = 63 map = gsn_csm_map(wks,res) ; draw global map ; number of source regions nsrc = 9 ndst = 18 col = 6 row = 3 halo = 0.01 ;--------------------------------------------------------------- ; region definitions (destination) ;--------------------------------------------------------------- ; define arrays xbox_dst = new((/ ndst, 5 /), "float", -999.9) ybox_dst = new((/ ndst, 5 /), "float", -999.9) ;--------------------------------------------------------------- ; region definitions (source) ;--------------------------------------------------------------- ; Turkey xbox_dst(0,:) = (/ 26.0, 43.0, 43.0, 26.0, 26.0 /) ybox_dst(0,:) = (/ 36.0, 36.0, 42.1, 42.1, 36.0 /) xbox_src = new((/ nsrc, 10 /), "float", -999.9) ybox_src = new((/ nsrc, 10 /), "float", -999.9) color = new((/ nsrc /), "string") color = "violetred" ; Sahara Desert xbox_src(0,0:6) = (/ -3.0, 30.0, 30.0, 10.0, 10.0, -3.0, -3.0 /) ybox_src(0,0:6) = (/ 25.0, 25.0, 32.5, 32.5, 36.0, 36.0, 25.0 /) ; Genova Sea xbox_src(1,0:4) = (/ 14.0, 18.0, 10.0, 6.0, 14.0 /) ybox_src(1,0:4) = (/ 35.9, 38.9, 44.9, 42.1, 35.9 /) ; Adriatic Sea xbox_src(2,0:4) = (/ 18.1, 21.0, 13.3, 10.1, 18.1 /) ybox_src(2,0:4) = (/ 39.0, 41.2, 47.0, 45.0, 39.0 /) ; Atlantic xbox_src(3,0:4) = (/-30.0, 2.0, 2.0, -30.0,-30.0 /) ybox_src(3,0:4) = (/ 37.0, 37.0, 60.0, 60.0, 37.0 /) ; Basra xbox_src(4,0:4) = (/ 35.8, 43.0, 43.0, 35.8, 35.8 /) ybox_src(4,0:4) = (/ 31.5, 31.5, 35.9, 35.9, 31.5 /) ; Eastern Black Sea xbox_src(5,0:4) = (/ 33.5, 43.0, 43.0, 33.5, 33.5 /) ybox_src(5,0:4) = (/ 42.2, 42.2, 46.5, 46.5, 42.2 /) ; Aegean Sea xbox_src(6,0:4) = (/ 22.8, 25.9, 25.9, 22.8, 22.8 /) ybox_src(6,0:4) = (/ 36.0, 36.0, 41.1, 41.1, 36.0 /) ; Cyprus xbox_src(7,0:4) = (/ 32.0, 35.0, 35.0, 32.0, 32.0 /) ybox_src(7,0:4) = (/ 34.0, 34.0, 35.9, 35.9, 34.0 /) ; Whole Region rxmax = max(xbox_src(:nsrc-2,:))+0.1 rxmin = min(xbox_src(:nsrc-2,:))-0.1 rymax = max(ybox_src(:nsrc-2,:))+0.1 rymin = min(ybox_src(:nsrc-2,:))-0.1 xbox_src(8,0:4) = (/ rxmin, rxmax, rxmax, rxmin, rxmin /) ybox_src(8,0:4) = (/ rymin, rymin, rymax, rymax, rymin /) polygons=new(nsrc,graphic) fill_colors = (/"red","navy","SkyBlue","cyan","orange","blue","SlateBlue","green","black"/) ; secilenleri dikkate almadan, hepsi icin sirayla... 8. source (hepsini toplami) icin yazmiyoruz... resPoly = True ;resPoly@gsFillScaleF = 1.0 resPoly@gsFillOpacityF = 0.5 do i=0,nsrc-1 resPoly@gsFillColor = fill_colors(i) polygons(i)=gsn_add_polygon(wks,map,xbox_src(i,:),ybox_src(i,:),resPoly) end do draw(map) system("convert -trim -density 200x200 sources_targets.ps sources_targets.png") end