Modifications to scoring and graphics production for the final version of code for the C-LAMP paper in GCB.
1 ;---------------------------------------------------------------
2 ; convert from 1x1 to T31/T42
4 ; use model T31/T42 lat and lon
5 ; output model area, too.
7 ;-------------------------------------------------------------
8 load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
9 load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
10 load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"
12 load "/fis/cgd/cseg/people/jeff/ncl/remap_areaave.ncl"
14 ;************************************************
16 ;************************************************
17 diro = "/fis/cgd/cseg/people/jeff/fire_data/ob/GFEDv2_C/"
18 filo = "Fire_C_1997-2006_monthly_1.9.nc"
19 c = addfile(diro+filo,"c")
20 filedimdef(c,"year",-1,True)
22 ;******************************************************
23 ; input grid: 1deg x 1deg, N->S, 180W-180E
24 ;******************************************************
25 diri = "/fis/cgd/cseg/people/jeff/fire_data/ob/GFEDv2_C/"
26 fili = "Fire_C_1997-2006_monthly_1x1.nc"
27 g = addfile (diri+fili,"r")
38 ;===================================================
39 ; change from 180W-180E, 90N-90S to 0-360E, 90S-90N
40 ;===================================================
43 bi = (/ bi(:,:,::-1,:) /)
56 bi(:,:,:,p)= b2(:,:,:,i)
65 ;==================================================
67 ;==================================================
69 xi_edge = fspan(0.0, 360.0, nlonx+1)
70 xi_edge@units = "degrees_east"
71 yi_edge = fspan(-90.0, 90.0, nlatx+1)
72 yi_edge@units = "degrees_north"
74 ;==================================================
76 ;==================================================
78 deg2rad = 4.0*atan(1.0)/180.0
80 dx = earth_rad * deg2rad * (xi_edge(1)-xi_edge(0))
81 dsin = sin(deg2rad*yi_edge(1:180)) - sin(deg2rad*yi_edge(0:179))
82 area_in = new((/ nlatx, nlonx /), float)
83 area_in = conform(area_in, earth_rad*dx*dsin,0)
86 ;**************************************************************
87 ; output grid: (0-360), (90S-90N)
88 ;**************************************************************
89 ; interpolate into model T31/T42, using model lat and lon
91 diri = "/fis/cgd/cseg/people/jeff/surface_data/"
93 b = addfile(diri+fili,"r")
100 xo_edge = fspan(0.0, 360.0, nlon+1) - 0.5*360.0/nlon
101 xo_edge@units = "degrees_east"
103 yo_edge = new(nlat+1, float)
104 gau_info = gaus(nlat/2)
106 yo_edge(1:nlat-1) = doubletofloat(0.5*(gau_info(0:nlat-2,0)+gau_info(1:nlat-1,0)))
108 yo_edge@units = "degrees_north"
110 ; yo = 0.5*(yo_edge(0:nlat-1) + yo_edge(1:nlat))
111 ; yo@units = yo_edge@units
112 ; xo = 0.5*(xo_edge(0:nlon-1) + xo_edge(1:nlon))
113 ; xo@units = xo_edge@units
115 ;===================================================
117 ;===================================================
119 w = new((/nyear,nmonth,nlat,nlon/),float)
123 w(m,n,:,:) = remap_areaave(xi_edge, yi_edge, bi(m,n,:,:), xo_edge, yo_edge)
134 w@long_name = bi@long_name
135 w@_FillValue = bi@_FillValue