Modifications to scoring and graphics production for the final version of code for the C-LAMP paper in GCB.
1 ; ***********************************************
3 ; ***********************************************
4 load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
5 load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
6 load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"
7 ;************************************************
9 ;************************************************
10 ; read in data: observed
11 ;************************************************
12 diri = "/fis/cgd/cseg/people/jeff/clamp_data/co2/"
13 fili = "co2_globalView_222.nc"
14 g = addfile (diri+fili,"r")
23 ;**************************************************************
24 ; get only the lowest level at each station
25 ;**************************************************************
27 lat_tmp@_FillValue = 1.e+36
30 if (.not. ismissing(lat_tmp(n))) then
31 indexes = ind(lat(n) .eq. lat .and. lon(n) .eq. lon)
32 if (dimsizes(indexes) .gt. 1) then
33 lat_tmp(indexes(1:)) = lat_tmp@_FillValue
39 indexes = ind(.not. ismissing(lat_tmp))
44 val_ob = val(indexes,:)
45 ;printVarSummary (val_ob)
46 ;print (lat_ob +"/"+lon_ob)
48 ;************************************************
50 ;************************************************
51 diri2 = "/fis/cgd/cseg/people/jeff/clamp_data/model/"
52 fili2 = "b30.061m_401_425_MONS_climo.nc"
54 g = addfile(diri2+fili2,"r")
63 ; get the co2 at the lowest level
66 ; change to unit of observed (u mol/mol)
67 ; Model_units [=] kgCO2 / kgDryAir
68 ; 28.966 = molecular weight of dry air
69 ; 44. = molecular weight of CO2
72 factor = (28.966/44.) * 1e6
77 ; y = where(y0 .lt. 287.,y@_FillValue,y)
79 ; print (min(y)+"/"+max(y))
81 ; interpolate into observed station
82 ; note: model is 0-360E, 90S-90N
84 i = ind(lon_ob .lt. 0.)
85 lon_ob(i) = lon_ob(i) + 360.
87 yo = linint2_points_Wrap(xi,yi,y,True,lon_ob,lat_ob,0)
90 val_model = yo(pts|:,time|:)
91 ; printVarSummary (val_model)
92 ; print (min(val_model)+"/"+max(val_model))
95 val_model = val_model - conform(val_model,dim_avg(val_model),0)
96 ; print (min(val_model)+"/"+max(val_model))
102 ; maximum score for the zone, 60N-90N
104 ; index of stations in this zone
105 ind_z = ind(lat_ob .ge. 60.)
107 ; print (lat_ob(ind_z)+"/"+lon_ob(ind_z))
108 ; print (val_ob(ind_z,:))
109 ; print (val_model(ind_z,:))
113 ; maximum score for the zone, 30N-60N
115 ; index of stations in this zone
116 ind_z = ind(lat_ob .ge. 30. .and. lat_ob .lt. 60.)
118 ; print (lat_ob(ind_z)+"/"+lon_ob(ind_z))
119 ; print (val_ob(ind_z,:))
120 ; print (val_model(ind_z,:))
124 ; maximum score for the zone, EQ-30N
126 ; index of stations in this zone
127 ind_z = ind(lat_ob .ge. 0. .and. lat_ob .lt. 30.)
129 ; print (lat_ob(ind_z)+"/"+lon_ob(ind_z))
130 ; print (val_ob(ind_z,:))
131 ; print (val_model(ind_z,:))
135 ; maximum score for the zone, 90S-EQ
137 ; index of stations in this zone
138 ind_z = ind(lat_ob .lt. 0. )
140 ; print (lat_ob(ind_z)+"/"+lon_ob(ind_z))
141 ; print (val_ob(ind_z,:))
142 ; print (val_model(ind_z,:))
145 u = ndtooned(val_ob(ind_z,:))
146 v = ndtooned(val_model(ind_z,:))
148 good = ind(.not.ismissing(u) .and. .not.ismissing(v))
153 npts = dimsizes(uu)/12
159 un = onedtond(uu,(/npts,12/))
160 vn = onedtond(vv,(/npts,12/))
164 score = new((/npts/),float)
167 amp_ob = max(un(n,:)) - min(un(n,:))
168 amp_model = max(vn(n,:)) - min(vn(n,:))
169 score(n) = 1.-abs((amp_model/amp_ob)-1.)
178 M_total = (ccr*ccr + M)*0.5 * score_max