Sorry for the stupid question, but I have been unable to answer it even after wasting time googleing for a while... I know there are several climate-changes scenarios, and I know the several climatic databases offering surfaces (rasters) with those scenarios. However, I want to try some calculations on my own, for which I am looking for the mathematics behind these models (the different scenarios) or some code (preferably in R). Any suggestion?
Full scale climate models
The atmospheric climate simulations that are presented in the IPCC reports are performed by quite large and complex models. Running these models needs a "supercomputer" (high performance cluster). Additionally, certain "forcing data" and "boundary conditions" are needed.
Boundary conditions are the top of the atmosphere and the Earth's surface/oceans. Partly, atmospheric climate model simulations are directly coupled to ocean model simulations. This makes the models even larger and harder to setup/run. "Forcing data" means thinks like CO2 emissions, emissions of particulate matter, solar radiation ... .
Having said that: it is quite unrealistic to setup und run a "real" climate model just for fun.
Further reading on recent climate modeling activities
Simulation results of the couple model intercomparison project (CMIP) form the basis for the IPCC reports. The CMIP Phase 6 (CMIP6) simulations form the basis of the most recent IPCC reports. There is an overview paper of CMIP6 which might indicate how large the overhead for running "real" climate models in a comparable way is (Eyring et al., 2016).
One of the models that were used for the CMIP5 and CMIP6 simuations was the MPI-ESM model. An overview of this model is given in Giorgette et al. (2013). Detailed descriptions are available in this special issue.
There are several more models used in CMIP5 and CMIP6. The MPI-ESM is just an example.
Climate models made for training
There are some simple climate models that are made for students and which are based on a few governing equations. Seems models show the general features of climate models but can be run on a normal end-user computer. One of these models is the "Monash simple climate model". An instance of that model which can be run via a web-GUI is available here. There is a documentation available in which you will find links to a publication describing the model and to a repository to download the source code.
There is another climate model made for training which is called Planet Simulator. Download details and documentation are offered on that web page.