-
Notifications
You must be signed in to change notification settings - Fork 23
How do you run Atmos?
If you want to run the 'Climate' portion of 'Atmos', do this:
Before you start compiling and running the code, make sure your input files make sense to the problem you are addressing. The input files that are needed for the climate code part of the 'Atmos' are: (1) input_clima.dat, where several parameters like the number of steps to run the model, the surface and the top pressure, surface temperature and surface albedo, solar constant and other switches are varied. (2) mixing_ratios.dat, where the species mixingratios are adjusted. Note that, You only need to change these files once before the start of the run. There are standard set of input files already included with the release. They are located in atmos/CLIMA/IO/TEMPLATES/ location. The the three templates that are available currently (1) Archean Earth + Haze (2) Archean Earth + Haze + Sulfur species (3) Modern Earth template that reproduces modern Earth.
For just testing the code, You can copy one of these template files (i.e, both input_clima.dat and mixing_ratios.dat, for each of the three types of the templates) to your input directory 'atmos/CLIMA/IO'. Then, after compiling and running and getting a feel for the code, you can change the 'input_clima.dat' and 'mixing_ratios.dat' according to your needs. Once the input file parameters are properly chosen, it is time to compile the code. There is a makefile in the top level directory (atmos) called 'ClimaMake'. It is always better to start with 'cleaning' the code with 'ClimaMake clean':
- make -f ClimaMake clean
To compile the Climate code portion, simply use the command: - make –f ClimaMake
After compiliation, time to run the code: - ./Clima.run
To understand the output, refer to: What Does The Converged Output Look Like?
If for any reason the code is not compiling or running properly for your planetary case, you can check the main Climate code to address the issue. The main Climate code is called ClimaMain.f, and is located in the main atmos folder.
If you want to run the 'Photochem' portion of the 'Atmos', do this:
Similar to running the Climate code, Photochem also needs to be compiled before doing runs but this has been conveniently accounted for in a mini script called 'RunModels.sh'. Photochem model allows the user to run a variety templates that incorporate input files for various atmospheric cases that are then used in order to run Photochem. Users can choose to run one of the following atmospheric cases: - Archean+haze (models Archean Earth) - High O2 (templates to perform studies on false positives) - ModernMars+CL (Models present day Mars) - ModernEarth (Models present day Earth) - ModernEarthS+CL (Models present day Earth with added sulfur and chlorine chemistry).
So, in order to use the RunModels.sh script, in the command line, use the command: - ./RunModels.sh When running RunModels.sh for the first time it may need to be compiled as well (separately from compiling photochem) Use this command if necessary, to compile RunModels.sh: - Chmod u+x RunModels.sh
Once RunModels.sh is compiled once, you should not need to compile it again. If the following RunModels.sh questions do not appear in the command window upon running the script, then it needs to be compiled.
First, you will be asked to type in the name of the template you wish to use. You may choose from the list of templates above. Next, you will be asked if you want to compile Photochem, (if you do, it will do a clean make) answer with y or n. The final Photochem question will be do you want to run Photochem, again, answer with y or n. Upon answering yes, Photochem will then run until it has reached a converged solution using the template that you specified. Different templates may take different amounts of time to converge but the default maximum for Photochem is 10,000 steps. This means that if the model does not come to a converged solution in 10,000 steps, the model will quit. To learn more details about the convergence of the model see the readme link “what does the converged output look like?”. To summarize, Use the following steps to Run Photochem with RunModels.sh: 1.) Choose the template you wish to run 2.) Run RunModels.sh 3.) Answer y or n to the question with regard to compiling photochem 4.) Answer y or n to the question with regard to running photochem 5.) Examine output files in the PHOTOCHEM directory Now, the way RunModels.sh works is this: it essentially copies the input files that are in the directory of the specified template, and copies them into the input files directory within PHOTOCHEM. This copy method is convenient when switching from one template case to another, but it is not so efficient when running the same template again and again. To maximize efficiency, you as the user, can follow these steps for iterative runs of the same template. To clarify, it is best to use RunModels.sh to copy the necessary input files for the first time, but thereafter, this method may be more suitable, and is very similar to the Climate method.
To compile Photochem without RunModels.sh, one can use the command: - make –f Photomake or - make –f Photomake clean These commands are for regular compiles and clean compiles respectively. To run Photochem use the command:
./Photo.run
This is the executable for the main Photochem source code which is entitled PhotoMain.f. This can also be found in the main atmos directory along with ClimaMain.f.
If you want to run the coupled Clima-Photochem model, do this:
The power of the coupled model is interactive chemistry. The climate responds to the photochemistry, and the photochemistry, in turn, responds to the atmosphere's temperature. The user initially needs to run ONE of the models uncoupled (ICOUPLE=0) to generate an initial atmospheric state. There may be some internal hardcoding, actually, that assumes PHOTO is being run first. But, if the user wants to run the Clima stand-alone, then set ICOUPLE = 0 in Clima code, and that should run Clima only. Here are the steps for "manual" coupling:
Run Photo uncoupled (set ICOUPLE = 0 in input_photochem). Photo will automatically generate coupling files in the /COUPLE folder for clima to use (or not). These files are: * fromPhoto2Clima.dat: contains altitude, pressure, O3, water, Ch4, CO2, c2h6 * hcaer.photoout.out: hydrocarbons in the atmosphere * mixing_ratios.dat: mixing ratio file for clima * time_frak_photo.out: time ago (billions of years), pressure at bottom of atmosphere, fractal particles (=1 if yes), type of star (see PHOTOCHEM/INPUTFILES/README.txt), monsize (see PHOTOCHEM/INPUTFILES/README.txt), number of atmospheric layers.
Turn on ICOUPLE (=1) in clima. Turning on coupling means Clima will ignore certain inputs in input_clima.dat because it now gets these from the photochemical model outputs, and it will ignore the mixing_ratios.dat in CLIMA/IO, instead reading this in from /COUPLE/mixing_ratios.dat. You do not need to change PG0 (surface pressure) in input_clima when coupling is on. Clima gets this from time_frak_photo.out. You also do not need to change SOLCON in input_clima. It will scaled this based on TIMEGA in time_frak_photo.
Run Clima. When it finishes, it will generate certain files for Photo: * fromClima2Photo.dat: file with altitude, temperature, water mixing ratio * hcaer.climaout.out: sanity check that clima is dealing with hydrocarbons properly. You can ignore this.
Set ICOUPLE = 1 in input_photochem and run photo...
Run clima... (./Clima.run)
Run photo... (./Photo.run)
Reun clima again... Run photo again... Run clima again... ...
When do you stop? Up to whatever convergence criteria you are happy with.