Installing the CM1 model
George Bryan’s cloud model is a very powerful, yet compact and relatively simple, numerical model for idealized studies of clouds, convection, and so forth. It has been used in many peer-reviewed publications in recent years. The experience of running it should give you a feel for some of the possibilities (as well as challenges) associated with using numerical models as a research tool.
To set up and run CM1, we can use NSF-NCAR’s derecho high-performance computing system. They have kindly provided a classroom allocation for use in our class, and you separately received instructions for logging in to your account. Do we need a supercomputer for the model runs we’ll do for this assignment? No – you could run them on a laptop. But it will make the model setup easier, and you might also get inspired to do some more intensive experiments for your final project.
First, download the model from the CM1 website. If logged in to derecho, you can use wget or curl to download the source code. General instructions for compiling the model are given on the CM1 webpage. On derecho, only one additional step should be needed. In the Makefile, uncomment the four lines dealing with netcdf near the top, and uncomment the lines under the “multiple processors, distributed memory (MPI), Intel compiler” option. Then type make to compile the model. You’ll get some messages about ifort being deprecated in late 2024, but you can ignore those.
There are some example submission scripts for derecho on the CM1 website. You will likely want to copy the contents of the “run” directory to the scratch drive, which has more space (for example, make a directory like /glade/derecho/scratch/<yourusername>/cm1r21.1/run).
Make any needed changes to the namelist. In particular, you may want to change the output format to netCDF for easier reading and plotting in python. Also modify the job submission script to include the proper project number and paths, and I would recommend reducing the values of wall-clock time and “select” to avoid waiting in the queue. (One hour, and one node, should be more than enough.) Then submit your job with qsub <nameofscript>, and the model should be off and running (pending any wait time in the queue.) You can check the status of your job in the queue with qstat -u <yourusername>.
It’s good practice to make subfolders with the output, namelist, etc., of each of your runs. So after a model run completes, move/copy those files to a folder with a name describing the run, so you don’t overwrite it when you set up the next one. (Or you can even set up separate folders before you start each run, and run the model from the subfolders.)
If you prefer, you can also compile and run the model on another machine in your research group, or even your own desktop or laptop computer (the runs we’ll be doing in class don’t require all that much computing power – I regularly run simulations like these on my laptop.) All you need is a fortran compiler and the netcdf libraries (if you want to write netcdf output). The netcdf libraries can cause some complications (which is why derecho serves as a good option), but for most Mac or Linux machines that you would use for research, they are likely already installed. If you haven’t done this before and want to, you might need to ask your group’s IT person for the details of your system, or I can try to help.