In general, you'll want to add a call to the "InitHistory" subroutine within the module where the variable is defined and initialized. It looks like fabi_sun_z is initialized and defined in SurfaceAlbedoType.F90. So you would want to add something like this in the InitHistory subroutine:
this%fabi_sun_z_patch(begp:endp,:) = spval
if (nlevcan>1) then
call hist_addfld2d (fname='FABI_SUN_Z', units='0-1', type2d='nlevcan', &
avgflag='A', long_name='absorbed sunlit leaf diffuse PAR (per unit lai+sai) for canopy layer', &
ptr_patch=this%fabi_sun_z_patch)
else
ptr_1d => this%fabi_sun_z_patch(begp:endp,1)
call hist_addfld1d (fname='FABI_SUN_Z', units='0-1', &
avgflag='A', long_name='absorbed sunlit leaf diffuse PAR (per unit lai+sai) for canopy layer', &
ptr_patch=ptr_1d)
end if
That should handle cases where nlevcan=1 (the CLM default) and nlevcan>1.
You'll also need to add this in the "ARGUMENTS" section of InitHistory:
real(r8), pointer :: ptr_1d(:) ! pointer to 1d patch array
The history streams are not fixed, they can be configured to output whatever you need.
For instance, to get the standard monthly average history files for default variables and a second set of history files that have 1/2 hourly fabi_sun_z:
hist_nhtfrq = 0,1
hist_mfilt = 1,48
hist_fincl2 = 'FABI_SUN_Z'