In the following we will descibe the Simple Climate Model class and its public functions and methods. To run the simple climate model two input files are required:
(1) Parameter file (SimpleClimateModelParameterFile.txt) that sets parameters for the Simple Climate model run such as the start and end year of the simulation as well as the path and file names for the input and output files.
(2) The emission file (EmissionsForSCM.dat) containing the atmospheric emissions of carbon dioxid (CO_{2}), methane (CH_{4}), nitrous oxide (N_{2}O) and sulfate (SO_{x}).
At the beginning of the Simple Climate Model class we define a set the global variables as constants. These variables will be used throughout the simple climate model run and therefore need to be global:
Carbon dioxide (CO_{2}), methane (CH_{4}), and nitrous oxide (N_{2}O) concentrations at their preindustrial level (e.g. 1750 values).
baseCO2 = 278.305
baseCH4 = 700.0
baseN2O = 270.0
CO2 emissions are reported in Peta grams of carbon (PgC) where 1 PgC = 10^15 g carbon and therefore we need the PgCperppm constant which is the conversion factor for PgC to ppm of CO2.
PgCperppm = 2.123
Estimates of direct (aerDirectFac) and indirect (aerIndirectFac) aerosol radiative forcing factors in units of (W/m^2)/TgS are:
aerDirectFac = 0.002265226
aerIndirectFac = 0.013558119
We construct a class called EmissionRec which holds the atmospheric emissions of CO_{2}, CH_{4}, N_{2}O and SO_{x}. The emissions need to be provided as an input to the Simple Climate Model class, where the filename and path will be set in the SimpleClimateModelParameterFile.txt. The emissions will be read from file when the Simple Climate Model class is constructed by typing:
>>> SCM = pySCM.SimpleClimateModel('PathAndFileNameOfParameterFile')
The Simple Climate Model class comprises only two public functions, i.e. runModel and saveOutput. The class uses the EmissionRec to store all GHG emissions that are going to be used during the model run.
This is the Simple Climate Model class which can be created by typing:
>>> SCM = pySCM.SimpleClimateModel('PathAndFileNameOfParameterFile')
During the call of the constructor, all parameters detailed in the SimpleClimateModelParameterFile.txt will be read from file as well as the atmospheric emissions of GHGs (detailed above).
Note
The file containing the emissions should be in a certain format. Please refer to the example file (EmissionsForSCM.dat) for details.
This function runs the simple climate model. A number of private functions will be called but also a number of ‘independent’ functions (detailed below). The model takes the atmosheric GHG emissions as input, converts them into concentrations and calculates the radiative forcing from the change in GHG concentrations over the years. Finally, the temperature change is derived from the change in radiative forcing which is required to calculate the change in sea level. For more information on the theory behind those calculations, please refer to ‘Theory’ page.
To run the simple climate model, type:
>>> SCM.runModel()
By default, the calculated temperature change and sea level change will be written to a textfile where the location and name of the textfile need to be specified in the parameter file. If the user wants to, a figure showing the temperature change and sea level change, respectively, will be saved to file and again the path and filename have to be specified in the parameter file.
Param:  RadForcingFlag (bool) which is set to ‘False’ by default. If it is set to ‘True’ the function returns the calculated radiative forcing. 

Returns:  This function returns the radiative forcing (numpy.array) if the flag was set to true. Otherwise, nothing will be returned. 
This function is optional and allows the user to save the calculated GHG concentrations and also a figure showing the evolution of GHG concentrations. You can call this function by typing:
>>> SCM.saveOutput()
If this function gets called, the user has to make sure that the path and filenames are given in the parameter file.
These are public functions that will be called within the Simple Climate Model but can also be called outside the class. By providing the right input, these functions can be used independently of the Simple Climate Model class, e.g.
>>> pySCM.CO2EmissionsToConcs(Emissions, numYr, OceanMLDepth)
where emissions are the CO_{2} emissions, numYr are the number of years the response function will be calculated for and OceanMLDepth is the ocean layer depth. More information are given in the code or in the ‘Theory’ part of this documentation.
This function converts atmospheric CO_{2} emissions to concentrations as described in Joos et al. 1996.
Parameters: 


Returns:  numpy array – containing the atmospheric CO_{2} concentrations for each year [ppm] 
This function converts methane (CH_{4}) emissions into concentrations.
Parameters:  emissions – CH_{4} emissions [TgCH4/year] 

Returns:  numpy.array – containing the CH_{4} concentrations for each year [ppb] 
This function converts nitrous oxide (N_{2}O) emissions into concentrations.
Parameters:  emissions – N_{2}O emissions [TgN2O/year] 

Returns:  numpy.array – containing the N_{2}O concentrations for each year [ppb] 
This function calculates the total radiative forcing (formula given in IPCC TAR Chapter 6). The total change in radiative forcing is the sum of the changes in radiative forcing resulting from changes in CO_{2}, CH_{4}, and N_{2}O concentrations and sulfate emissions.
Parameters: 


Returns:  numpy.array – containing the change in radiative forcing per year. 
This function calculates the temperature response function that is used to calculate the change in global mean surface temperature as a result of changes in radiative forcing.
Parameters:  numYrs – number of years the response function will be evaluates for. 

Returns:  numpy.array – containing climate response function 
This function calculates the sea level response function that is used to calculate the change in sea level as a result of changes in in global mean surface temperature. This equation only accounts for changes in sea level resulting from thermal expansion of the ocean, it does not include the effects of melting glaciers and melting grounded ice sheets.
Parameters:  numYrs – number of years the response function will be evaluates for. 

Returns:  numpy.array – containing climate response function 
This function calculates the ocean mixed layer response function (HILDA model) as described in Joos et al., 1996. This function returns the amount of carbon remaining in the surface layer of the ocean after an input (pulse) from the atmosphere scaled to units of micromol/kg.
Parameters: 


Returns:  numpy.array – contains the remaining carbon per year. 
This function calculates the decay response function for the biosphere.
Parameters:  numYears – number of years to calculate the response function for. 

Returns:  numpy.array – contains the biosphereatmospheric flux after initial carbon input per year 
This function calculates the change in sea water CO_{2} from equilibrium corresponding to change in ocean mixed layer carbon from equilibrium.
Parameters:  SurfaceOceanDIC – Surface ocean dissolved inorganic carbon (DIC) [micromol/kg] 

Returns:  the change in sea water CO_{2} [ppm] 
This function calculates the temperature change due to changes in radiative forcing.
Parameters: 


Returns:  numpy.array –containing the temperature change for every year. 
This function calculated the changes in sea level due to changes in global mean surface temperatures.
Parameters: 


Returns:  numpy.array – containing the sea level change for every year. 