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_98.nc"
14 g = addfile (diri+fili,"r")
18 sta = chartostring(g->STATION)
26 ;**************************************************************
27 ; get only the lowest level at each station
28 ;**************************************************************
30 lat_tmp@_FillValue = 1.e+36
33 if (.not. ismissing(lat_tmp(n))) then
34 indexes = ind(lat(n) .eq. lat .and. lon(n) .eq. lon)
35 if (dimsizes(indexes) .gt. 1) then
36 lat_tmp(indexes(1:)) = lat_tmp@_FillValue
42 indexes = ind(.not. ismissing(lat_tmp))
43 ;print (dimsizes(indexes))
48 val_ob = val(indexes,:)
49 ;printVarSummary (val_ob)
50 ;print (lat_ob +"/"+lon_ob)
52 ;************************************************
54 ;************************************************
55 diri2 = "/fis/cgd/cseg/people/jeff/clamp_data/model/"
56 fili2 = "b30.061m_401_425_MONS_climo.nc"
58 g = addfile(diri2+fili2,"r")
67 ; get the co2 at the lowest level
70 ; change to unit of observed (u mol/mol)
71 ; Model_units [=] kgCO2 / kgDryAir
72 ; 28.966 = molecular weight of dry air
73 ; 44. = molecular weight of CO2
76 factor = (28.966/44.) * 1e6
81 ; y = where(y0 .lt. 287.,y@_FillValue,y)
83 ; print (min(y)+"/"+max(y))
85 ; interpolate into observed station
86 ; note: model is 0-360E, 90S-90N
88 i = ind(lon_ob .lt. 0.)
89 lon_ob(i) = lon_ob(i) + 360.
91 yo = linint2_points_Wrap(xi,yi,y,True,lon_ob,lat_ob,0)
94 val_model = yo(pts|:,time|:)
95 ; printVarSummary (val_model)
96 ; print (min(val_model)+"/"+max(val_model))
99 val_model = val_model - conform(val_model,dim_avg(val_model),0)
100 ; print (min(val_model)+"/"+max(val_model))
106 ; maximum score for the zone, 60N-90N
108 ; index of stations in this zone
109 ind_z = ind(lat_ob .ge. 60.)
111 ; print (lat_ob(ind_z)+"/"+lon_ob(ind_z))
112 ; print (val_ob(ind_z,:))
113 ; print (val_model(ind_z,:))
117 ; maximum score for the zone, 30N-60N
119 ; index of stations in this zone
120 ind_z = ind(lat_ob .ge. 30. .and. lat_ob .lt. 60.)
122 ; print (lat_ob(ind_z)+"/"+lon_ob(ind_z))
123 ; print (val_ob(ind_z,:))
124 ; print (val_model(ind_z,:))
128 ; maximum score for the zone, EQ-30N
130 ; index of stations in this zone
131 ind_z = ind(lat_ob .ge. 0. .and. lat_ob .lt. 30.)
133 ; print (lat_ob(ind_z)+"/"+lon_ob(ind_z))
134 ; print (val_ob(ind_z,:))
135 ; print (val_model(ind_z,:))
139 ; maximum score for the zone, 90S-EQ
141 ; index of stations in this zone
142 ind_z = ind(lat_ob .lt. 0. )
144 ; print (lat_ob(ind_z)+"/"+lon_ob(ind_z))
145 ; print (val_ob(ind_z,:))
146 ; print (val_model(ind_z,:))
149 u = ndtooned(val_ob(ind_z,:))
150 v = ndtooned(val_model(ind_z,:))
152 good = ind(.not.ismissing(u) .and. .not.ismissing(v))
164 un = onedtond(uu,(/npts,12/))
165 vn = onedtond(vv,(/npts,12/))
169 score = new((/npts/),float)
172 amp_ob = max(un(n,:)) - min(un(n,:))
173 amp_model = max(vn(n,:)) - min(vn(n,:))
174 score(n) = 1.-abs((amp_model/amp_ob)-1.)
183 M_total = (ccr*ccr + M)*0.5 * score_max