|
1 ;************************************************* |
|
2 ; ce_1.ncl |
|
3 ;************************************************ |
|
4 load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl" |
|
5 load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl" |
|
6 ;************************************************ |
|
7 begin |
|
8 ;************************************************ |
|
9 ; read data |
|
10 ;************************************************ |
|
11 grid = "1x1" |
|
12 ; grid = "T31" |
|
13 ; grid = "T42" |
|
14 ; grid = "1.9" |
|
15 |
|
16 diri = "/fis/cgd/cseg/people/jeff/clamp_data/observed/biomass/" |
|
17 fili = "amazon_mask_"+ grid + ".nc" |
|
18 f = addfile (diri+fili,"r") |
|
19 |
|
20 y = f->mask_amazon |
|
21 |
|
22 printVarSummary(y) |
|
23 |
|
24 wks = gsn_open_wks ("ps","test") ; open workstation |
|
25 gsn_define_colormap(wks,"gui_default") ; choose colormap |
|
26 |
|
27 ;----------------------------------------- |
|
28 ; plot area sum |
|
29 |
|
30 gRes = True |
|
31 gRes@txFontHeightF = 0.02 |
|
32 ; gRes@txAngleF = 90 |
|
33 |
|
34 Sum_area = 7.41 |
|
35 |
|
36 area_sum_text = "(mask area = "+sprintf("%.2f", Sum_area)+"(x1.e12 m2))" |
|
37 |
|
38 gsn_text_ndc(wks,area_sum_text,0.50,0.80,gRes) |
|
39 ;----------------------------------------- |
|
40 |
|
41 ;************************************************ |
|
42 ; create default plot |
|
43 ;************************************************ |
|
44 |
|
45 res = True ; Use plot options |
|
46 res@cnFillOn = True ; Turn on color fill |
|
47 res@gsnSpreadColors = True ; use full colormap |
|
48 ; res@cnFillMode = "RasterFill" ; Turn on raster color |
|
49 ; res@lbLabelAutoStride = True |
|
50 res@cnLinesOn = False ; Turn off contourn lines |
|
51 res@mpFillOn = False ; Turn off map fill |
|
52 res@gsnAddCyclic = False |
|
53 res@tiMainString = "Amazon Mask: grid = "+ grid |
|
54 |
|
55 res@mpMinLatF = -21.1 ; range to zoom in on |
|
56 res@mpMaxLatF = 13.8 |
|
57 res@mpMinLonF = 277.28 |
|
58 res@mpMaxLonF = 326.43 |
|
59 |
|
60 res@gsnSpreadColors = True ; use full colormap |
|
61 res@cnLevelSelectionMode = "ManualLevels" ; Manual contour invtervals |
|
62 ; res@cnMinLevelValF = 1. ; Min level |
|
63 ; res@cnMaxLevelValF = 11. ; Max level |
|
64 ; res@cnLevelSpacingF = 1. ; interval |
|
65 res@cnMinLevelValF = 0. ; Min level |
|
66 res@cnMaxLevelValF = 1. ; Max level |
|
67 res@cnLevelSpacingF = 0.1 ; interval |
|
68 |
|
69 ; pres = True ; panel plot mods desired |
|
70 ; pres@gsnMaximize = True ; fill the page |
|
71 |
|
72 plot = gsn_csm_contour_map_ce(wks,y,res) ; for observed |
|
73 ; gsn_panel(wks,plot,(/1,1/),pres) ; create panel plot |
|
74 ; system("convert xy.ps xy.png") |
|
75 end |