------------------------------------------------------------------------ Planet Simulator for ATOC5060 ------------------------------------------------------------------------ PlaSim is a a global climate model that includes atmospheric dynamics a simple ocean, simple seaice, and a simple biosphere. This is a relatively low resolution model, yet is capably of accurately modeling many aspects of the general circulation. Notice that 'puma' is the atmosphereic component of this climate model. The model's home page can be found at: http://www.mi.uni-hamburg.de/Planet_Simulator.216.0.html The model and files distributed for ATO5060 differ somewhat from the default such that it is more convenient for out system. A copy of the documentation for the model can be found on the class web site. This is both a user's guide, giving a more detailed overview of setting up simulations than is given here, and a reference guide, which describes the model and outlines the sets of equations solved. Below is a brief tutorial to start the modeling - please work through this before starting your project simulations. Directories ----------- src source code, and a Makefile for compiling the model run directory containing files needed to run the model, including a script which automates much of the process bin binary tools (specifically pumaburn4) for processing output idl example idl code for modifying the input data, and viewing the output Compiling the model ------------------- In the src directory, you will see all the Fortran 90 source code. You will also find a file called Makefile. This is a special set of definitions which a utility called "make" will read, and from which it can determine how to compiler the model. At the unix prompt (%), type the following: % cd src % make You should see the Fortran compiler (f90) start working. When finished, examine the contents of the directory. You should see a new file called "puma.x" This is the model executable. You will also need to compile the postprocessing tool. From the root directory: % cd bin % make This should set the C compiler going, and result in the new executable called "pumaburn4". Running the model ----------------- The model needs input in two forms: 1) surface specifications (location of continents, topographic elevation, sea surface temperature, etc.). This is given in a file called "surface_parameters". 2) run-time parameters (length of simulation, output frequency, etc..). This is specified as a Fortran 90 namelist called puma_namelist. Notice that there are no initial conditions - the actual state is arbitrary, and we want to look at the statistical properties of the circulation. An example has been set up to perform a 30 day (one month) simulation. To run this test: % cd run % cp puma_example_namelist puma_namelist % ../src/puma.x The model will start running, and take a few minutes to complete. As it runs, you may wish to keep the output otherwise written to the screen. This can be done as: % ../src/puma.x >& pumarun.log Where the output is now written to the file pumarun.log, which you can examine with you favorite text editor or by using 'more'. When done, you will see the output in this run directory (called "puma_output"). This is in a rather inconvenient format, so it is useful to convert it to NetCDF, so that we might read it into IDL, for example. To do this, use the pumaburn4 utility. Again this tool will know what to do based on some namelists. There are two set up. The first to look at once per day temperature, u and v wind, and the second to generate monthly means of these plus more quantities. To do the conversion, in the ./run directory: % ../bin/pumaburn4 puma_output test.nc < burn_instant_namelist % ../bin/pumaburn4 puma_output test_mon_mean.nc < burn_monthly_namelist Thus you should now have two new netcdf files test.nc and test_mon_mean.nc. You can see the contents with ncdump, in the usual way. E.g.: % ncdump -h test_mon_mean.nc If this has all worked, you no longer need the file puma_output, which may be deleted to save disk space. % rm puma_output Viewing and analyzing output ---------------------------- In IDL you can read the data, as per usual. An example has been set up in the idl subdirectory. Try plotting the zonal mean wind from the test run using the script testplot.pro: IDL> .run testplot Running experiments ------------------- Before developing an experiment, you must first generate a control simulation against which the experiment results can be compared. In the case of BOTH you control simulation and your experiment you will need to "spinup" the circulation. This is needed as you want the model to have no memory of the initial state, and also so that the circulation can adjust to any additional forcing you add. It takes about 100 days for this spin up - so let's make it 180 days to be sure. The model has days, as expected, but all months are exactly 30 days in length. More over, while we can run the model with a seasonal cycle, we want here to do experiments for a "perpetual january" and a "perpetual July". That is, the solar radiation does not depend on time of year, or more particularly, we set the day to denote the position of the earth in its orbit around the sun. For January we use day number 15, and for July we set day number 196. One advantage of this is that the requirements on disk space and cpu time is greatly decreased, while maintaining the main aspects of the circulation in the results. To run the control experiment, there is a script in the run directory called "run_model.csh". This script will: 1) Run 180 day "spinup", ignoring the output 2) Run 180 day simulation, from which we keep the output 3) Convert the output to netcdf (both instantaneous and monthly means) This is done for both January and July. To run this type: % cd run % run_model.csh >& runlog & The output from the script will go to the new file called runlog. The & on the end puts the process in background. Meaning that you can log out, or do something else, and the model will continue to run. To check that it is running, type: % top You should see your username listed with the name of the command (in this case puma). You can also see what else is running, and how much of the computers resources are being used by all users. In particular, if your model is the only one running, you should be using about 100% of the CPU. If there are 4 other models running, you should be getting about 20%.... Do not start another model while your first is running, as it will screw up the output (if not fail completely). If you need to stop the model which is in background, you will need to use the "kill" command. Using top, get the PID number from the first column. Then: % kill PID (where PID is the number) Check top again, and you should find your model has stopped. If for some reason it didn't stop, try "kill -9 PID". Remember that this is only if you want to stop the model prematurely - it will ordinarily stop itself when the simulation in complete. Once this script has finished, it will send you an email. Back in the run directory you should now see a collection of netcdf files. cntrl_jul_mean.nc cntrl_jul.nc cntrl_jul_run.log cntrl_jan_mean.nc cntrl_jan.nc cntrl_jan_run.log The log files are the text output from the model, while the .nc files are the instantaneous and monthly means for the January and July simulations, ready to be analyzed. Setting up an experiment ------------------------ There are two ways to set up the model for an experiment. 1) Change the input (surface_parameter) 2) Change the model source code The former can be used to change the ocean temperature, surface elevation, and a few other. To help wit this, there is a script in the "idl" directory called "pparmod.pro". This reads in the default surface_parameter file and writes a new one. By default there is not change, but there are a few examples of how modifications might be made. Once a new file is generates ("surface_parameters_new"), copy this into the run directory overwriting the original. % cp surface_parameters_new ../run/surface_parameters Fields included in this definition are: sea surface temperature (x 12 months) orography land-sea mask glacier mask sea ice concentration (x 12 months) background albedo surface roughness forest cover specification soil water bucket size soil temperature climatological temperature (x 12 months) The other way to set up an experiment is to modify the source code directly. Changes can then be made to various parameters (CO2 concentration, ozone, radius of the planet, rotation rate, total mass of the atmosphere, etc). More advanced changes could include suppressing evaporation, adding additional 'fictitious' heating rates, or any number of more imaginative changes. A good starting place is to look at pumamod.F90, which controls basic aspects of the dynamics, also radmod.F90 controls the radiation calculations (thus CO2 and ozone concentrations, the solar constant, albedos). If you modify the Fortran source code you will need to recompile the model before running it. In all cases, be a little cautious - some changes will lead the model to become unstable and crash. If this happens you should reduce the size of the forcing that you impose. When running the experiments, you can use the same "run_model.csh" script, but remember to change the name of the experiment - if you forget, you will overwrite your previous results! Final comments -------------- The model and scrips are presently set up for running on atoc - although you can run the model on any (most?) machines that have a fortran 90 compiler. Notice that the experiments are designed to ensure that everyone in the class can perform the simulations - and importantly story the output. If you are interested in running longer simulations, be very mindful of filling up the disk (use df -h to see how full the home disk is). To free up the cpus on atoc you can always run the model on one of the "paoslab" machines instead. This infact will be the case if you are using the machines in the PAOS computer lab, but you can always ssh to each machine once you log into atoc: e.g., ssh paoslab2 Happy climate modeling! ------------------------------------------------------------------------ David Noone - Fri Mar 18 13:38:45 MST 2005