Modifications to scoring and graphics production for the final version of code for the C-LAMP paper in GCB.
1 ; ***********************************************
2 ; add another model to plot
3 ; add panel plot to 22.lines.ncl
4 ; add zone plot to 21.lines.ncl
5 ; ***********************************************
6 load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
7 load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
8 load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"
9 ;************************************************
11 ;************************************************
12 ; read in data: observed
13 ;************************************************
14 diri = "/fis/cgd/cseg/people/jeff/clamp_data/co2/"
15 fili = "co2_globalView_98.nc"
16 g = addfile (diri+fili,"r")
20 sta = chartostring(g->STATION)
28 ;**************************************************************
29 ; get only the lowest level at each station
30 ;**************************************************************
32 lat_tmp@_FillValue = 1.e+36
35 if (.not. ismissing(lat_tmp(n))) then
36 indexes = ind(lat(n) .eq. lat .and. lon(n) .eq. lon)
37 if (dimsizes(indexes) .gt. 1) then
38 lat_tmp(indexes(1:)) = lat_tmp@_FillValue
44 indexes = ind(.not. ismissing(lat_tmp))
45 ;print (dimsizes(indexes))
50 val_ob = val(indexes,:)
51 ;printVarSummary (val_ob)
52 ;print (lat_ob +"/"+lon_ob)
54 ;************************************************
56 ;************************************************
57 diri2 = "/fis/cgd/cseg/people/jeff/clamp_data/model/"
58 fili2 = "b30.061n_1995-2004_MONS_climo_atm.nc"
59 fili3 = "b30.061m_401_425_MONS_climo_atm.nc"
60 ;--------------------------------------------
61 g = addfile(diri2+fili2,"r")
71 ; printVarSummary (y1)
73 ; get the co2 at the lowest level
74 ; y1 = x1(:,nlev-1,:,:)
76 ;---------------------------------------------
77 ; g = addfile(diri2+fili3,"r")
81 ; y2 = x2(:,nlev-1,:,:)
83 ;---------------------------------------------
84 ; change to unit of observed (u mol/mol)
85 ; Model_units [=] kgCO2 / kgDryAir
86 ; 28.966 = molecular weight of dry air
87 ; 44. = molecular weight of CO2
90 factor = (28.966/44.) * 1e6
91 ;---------------------------------------------
94 y1@units = "u mol/mol"
95 ; y1 = where(y0 .lt. 287.,y1@_FillValue,y1)
96 ; printVarSummary (y1)
97 ; print (min(y1)+"/"+max(y1))
98 ;---------------------------------------------
100 ; y2@_FillValue = 1.e36
101 ; y2@units = "u mol/mol"
102 ;---------------------------------------------
103 ; interpolate into observed station
104 ; note: model is 0-360E, 90S-90N
105 ; ob is -180-180, 90S-90N
107 ; to be able to handle observation at (-89.98,-24.80)
111 i = ind(lon_ob .lt. 0.)
112 lon_ob(i) = lon_ob(i) + 360.
113 ;----------------------------------------------------------------
114 yo = linint2_points_Wrap(xi,yi,y1,True,lon_ob,lat_ob,0)
116 ; yo:[time | 12] x [lev | 26] x [pts | 98]
118 val_model1 = yo(pts|:,lev|:,time|:)
120 val_model1_0 = val_model1
121 ; printVarSummary (val_model1)
122 ; print (min(val_model1)+"/"+max(val_model1))
125 val_model1 = val_model1 - conform(val_model1,dim_avg(val_model1),(/0,1/))
126 ; print (min(val_model1)+"/"+max(val_model1))
128 ;-----------------------------------------------------------------
129 ; index of station Barrow, Alaska (71.32,-156.60)
130 ind_z = ind(lat_ob .eq. 71.32)
132 print (lat_ob(ind_z)+"/"+lon_ob(ind_z))
133 print ("observation at Barrow, Alaska (71.32,-156.60)")
134 print (val_ob(ind_z,:))
135 print ("model top atm at Barrow, Alaska (71.32,-156.60)")
136 print (val_model1_0(ind_z,0,:))
137 print ("model surface at Barrow, Alaska (71.32,-156.60)")
138 print (val_model1_0(ind_z,nlev-1,:))
139 print ("model top atm at Barrow, Alaska (71.32,-156.60)")
140 print (val_model1(ind_z,0,:))
141 print ("model surface at Barrow, Alaska (71.32,-156.60)")
142 print (val_model1(ind_z,nlev-1,:))