No, you don't have to go into the code for that. You can request subgrid history files by adding them to the user_nl_clm file.
Two of the key namelist variables are hist_dov2xy and hist_type1d_pertape. You can find information on these (and other hist_* variables) here:
www.cesm.ucar.edu
As an example, if you want monthly-average column-level TOTSOMC on an auxiliary history file and also maintain your monthly average history file, you would add something like this:
hist_nhtfrq = 0,0
hist_mfilt = 1,1
hist_dov2xy = .true.,.false.
hist_type1d_pertape = ' ','COLS'
hist_fincl2 = 'TOTSOMC'
A setting of hist_dov2xy to false will produce subgrid output for that history stream. Here, the TOTSOMC information will be on a "h1" history file and will include a column dimension.
There is additional information on the h1 file to help you identify which column belongs to which grid cell and what type of column it is, e.g.,
double cols1d_lon(column) ;
cols1d_lon:long_name = "column longitude" ;
cols1d_lon:units = "degrees_east" ;
double cols1d_lat(column) ;
cols1d_lat:long_name = "column latitude" ;
cols1d_lat:units = "degrees_north" ;
int cols1d_ixy(column) ;
cols1d_ixy:long_name = "2d longitude index of corresponding column" ;
int cols1d_jxy(column) ;
cols1d_jxy:long_name = "2d latitude index of corresponding column" ;
int cols1d_gi(column) ;
cols1d_gi:long_name = "1d grid index of corresponding column" ;
int cols1d_li(column) ;
cols1d_li:long_name = "1d landunit index of corresponding column" ;
double cols1d_wtgcell(column) ;
cols1d_wtgcell:long_name = "column weight relative to corresponding gridcell" ;
double cols1d_wtlunit(column) ;
cols1d_wtlunit:long_name = "column weight relative to corresponding landunit" ;
int cols1d_itype_col(column) ;
cols1d_itype_col:long_name = "column type (see global attributes)" ;
int cols1d_itype_lunit(column) ;
cols1d_itype_lunit:long_name = "column landunit type (vegetated,urban,lake,wetland,glacier or glacier_mec)" ;
Further information on customizing the CLM namelist can be found here: