GREB: Globally Resolved Energy Balance
Eli points to the Monash Simple Climate Model which is “based” on the Globally Resolved Energy Balance (GREB) published by Dommenget and Floeter (2011) in Climate Dyanmics. I’m not sure if there are any difference between the models beyond the name. It appears that the Monash Simple Climate Model is an attempt to build a climate education site using comparisons between canned scenarios to teach the basic components in climate dynamics. I found the website a bit clunky. However, by following the links, you can find code.
There are two links on their code page. One is a bare 771 line FORTRAN program: greb.model.f90. The second is a link to a tar.zip file including an updated version of that program with multiprocessor directives: greb.web-public.tar.zip
The plain FORTRAN program requires a ‘namelist’ FORTRAN module to setup some basic scenario info including the length of the run. Other scenario data is hard coded into modules in the main file. Still other data is hard coded into subroutines. There is a logic flag (log_exp) used to key different scenarios.
The tar.zip code compiled easily under the Intel Linux FORTRAN compiler (ifort). It did not compile under gfortran out of the box. The read.me.txt file warns that you may need to reset the ireal variable from ‘4’ to ‘1’ or some other value. I did not have to reset this on my Ubuntu x86_64 setup running on an i7 laptop. So it wasn’t very long before I was running the program. But the output is unformatted binary data files.
To read the output, I used the ‘output’ subroutine to provide me the information needed to write a small utilty to read the ‘scenario’ data output file, create a global annual temperature index, and to write it back out as text. There are five values saved in the ‘scenario’ data file:
The input files are as listed below, information from the header of greb.model.f90
topography | z_topo(xdim,ydim) | topography (0.5 are glacier points )
tsurf | Tclim(xdim,ydim,nstep_yr) | mean Tsurf [K]
zonal.winds | uclim(xdim,ydim,nstep_yr) | mean zonal wind speed [m/s]
meridional.winds | vclim(xdim,ydim,nstep_yr) | mean meridional wind speed [m/s]
water.vapor | qclim(xdim,ydim,nstep_yr) | mean atmospheric humidity [kg/kg]
ocean.mld | mldclim(xdim,ydim,nstep_yr) | mean ocean mixed layer depth [m]
ocean.temp | Toclim(xdim,ydim,nstep_yr) | mean deep ocean temperature [K]
soil.wetness | swetclim(xdim,ydim,nstep_yr) | soil wetnees, fraction of total [0-1]
solar.radiation | sw_solar(ydim,nstep_yr) | 24hrs mean solar radiation [W/m^2]
To explore the input data, I leveraged the output utility to read in the unformatted data of the input files. The size of the data can be deduced from the dimensions of the model (96×48: 3.75deg grid) and the binary size of the input file. Or, as I realized later, you can read it straight from the header info in greb.model.f90 which lists the dimensions, the variable description, and the units used in the input files as shown above. With the input data files read into the input utility, I write it back out as NetCDF files. This allows me to open the netcdf formatted input files and read the data using the ‘ncdf’ package in ‘R.’ Most of the input files are simply gridded data spread over 730 time steps; each time step is a half a day. For time invariant data, topography and glacier masks, there is no time dimension. For the solar radiation, the data exludes the longitudinal dimension and includes only latitude and time.
Having standard netcdf files to look at, it was easy business to examine the input data in a variety of formats. Many of these charts are also presented in Figure 1 of Dommenget and Floeter (2011).
Here is a snapshot of the gridded data for Julian day 1 on the left and the latitudinal mean time series on the right (with the obvious exceptions in the first and last row):