You need a radiative transfer model and global climate model to do it with greenhouse gases. you can derive the temperature without greenhouse gases as discussed below: 
The absorption is highly variable depending on wavelength and can be seen in this graphic:

Radiative transfer through the atmosphere is specific to pressure, temperature, and wavelength. So in order to calculate the contribution of greenhouse gases you need to know their concentration distribution both vertically and horizontally not to mention an accurate representation of the atmospheric conditions. It's not one general function... it's millions of functions that all get integrated together and vary dynamically in time and space. I suggest you look at the HITRAN database for the complexities in absorption potential of different greenhouse gases.
You may also be interested in climate sensitivity paramaters.
From wikipedia http://en.wikipedia.org/wiki/Climate_sensitivity :
"For coupled atmosphere-ocean global climate models (e.g. CMIP5) the climate sensitivity is an emergent property: it is not a model parameter, but rather a result of a combination of model physics and parameters. By contrast, simpler energy-balance models may have climate sensitivity as an explicit parameter.
(ΔTs) = λ (ΔRF)
The terms represented in the equation relate radiative forcing (RF) to linear changes in global surface temperature change (ΔTs) via the climate sensitivity λ."
This is convenient because if you know the change in concentration of a gas and the corresponding RF you can compute a change in surface temperature. Though, I believe the climate sensitivity parameters are particularly for certain time and concentration regimes.