Of Computer Climate Models, Fudge, and Parameters – ModelE

So I was listening to the Republican Debate, and to keep from falling completely asleep (they were being ‘polite’, having been scolded one presumes…) I was using the tablet to wander around the source code of one of the Climate Models. ModelE. This is one of THE few where the source code is available without registering or proving you are a bonafide climate modeler (i.e. on The Team already). Also, they have a rather very nice “FORTRAN to HTML” tool that lets you browse it without all the pain and suffering of downloading a tar file or doing a ‘git’ on it. Yes, it’s only for an older version than the present development model, but that’s fine. Overall: Nice.



The current incarnation of the GISS series of coupled atmosphere-ocean models is now available. Called ModelE, it provides the ability to simulate many different configurations of Earth System Models – including interactive atmospheric chemistry, aerosols, carbon cycle and other tracers, as well as the standard atmosphere, ocean, sea ice and land surface components.

The model version being used for the CMIP5 simulations will soon be available in a complete package, though there are nightly snapshots of the current code repository available (including the frozen ‘AR5_branch’), but users should be aware that these snapshots are presented ‘as is’ and are not necessarily suitable for publication-quality experiments.

Please let us know if you intend to use this code by subscribing to our mailing list. We will then keep you (very occasionally) informed about code patches and possible improvements to the configuration.

Further down it notes that the AR4 version is available online in their nice browser:

F90 Code Viewer
The source code corresponding to the basic configuration of ModelE (AR5 version) will be available to be seen in it’s entirety using the f90t0html software package (not yet done). This will allow you to jump around the code in a very intuitive graphical interface. The AR4 version is still available. Feel free to notify us of any errors you might find!

Source Code Repository
View source code in the repository (access limited approved users on the nasa.gov domain) for latest updates. This link allows you to view all the source files currently in the central Git repository together with their older versions. You can also make comparisons between different versions of the same file.

But only those who are not of the unwashed masses can see the current stuff. Likely a good idea. Here’s the link to the AR4 version viewer ( I didn’t find a download link for the whole magilla, but didn’t look much. The CMIP3 version is available as a tar ball download and is likely the same one).


CMIP3 Model Configuration and Description
GISS submitted a number of different configurations to the CMIP3 model data repository at PCMDI. Information about the configurations and about updates and known issues are provided on the ModelE AR4 simulations page.

The frozen version of the ModelE code used for CMIP3 simulations and the controls for model description papers is denoted as ModelE1 (internal version number 3.0, dated Feb. 1, 2004). This code can be freely downloaded (as a 1.2 MB gzip-ed tar file) from modelE1.tar.gz.

Boundary and initial conditions for the AR4 version can be downloaded from fixed.tar.gz (191 MB). This is a large amount of data due to things like transient 3-D aerosol concentrations etc. A wider selection of input data (encompassing many different configurations, but mainly for a more up-to-date codebase are available here. There are more variants of this data available internally, so if you do not find the configuration you’d like, let us know and we may be able to help you.

If you require any further details on these configurations, please read the submitted papers, or contact us as described below.

Now the first thing that caught my eye was that 191 MB file. Really? I did the download and the tablet reported closer to 42 MB. YMMV. (Did my download choke on the tablet? Is it compressed so different? Whatever… yes, a “dig here later, maybe”…) But think for just a moment. There are essentially a few dozen MB of “initialization” parameters / data state being set. One wonders just what all is done to assure that is “right”. And how much it can “tune” the model for desired output. But pressing on…

So I wandered around in the code base a while.

Overall impression? It is one hell of a lot better written and structured than GIStemp.

The folks writing this “have clue” about how to do clean code with good practices and clean style.

Now I’ve not read a lot of it. First off, it is HUGE. (Though not really as large as I’d thought it might be… there are many modules, but each looks fairly short in the sample I looked over. That, too, is good coding practice.) It is one program with a file size (compressed) of 1.2 MB (that would be about 1000 pages of modest code density per my wild ass guess) but:

549 total:

So given that my sample size has been a page or three per subroutine, maybe my SWAG is near valid… Still, looking at 550 programs (+1 for the MAIN program) can take a while.

So I did some random hopping around. Other than the astounding number of places you load data and / or set values (i.e. an elephant with 10,000 places to make it wiggle a trunk…) it looks reasonably well thought out and written.

Here’s a listing of just the subroutines that start with “SET” in their name. I’m assuming they set some kind of value:

SETQVA  1,16
SETREL  2,59
SET_CON  16,5
SET_SNOW  1,10

I did run into one funny spot, down at the bottom of the opening comments, I’ve bolded it:

C     ------------------------------------------------------------------
C     MADVEL  Model Add-on Data of Extended Climatology Enable Parameter
C             Each MADVEL digit is ON/OFF switch for corresponding input
C             e.g. MADVEL=123456   (zero digit skips process)
C     MADO3M  =  1           Makiko's 1951-1997 Ozone climatology RFILEA
C     MADAER  =  2  Updates  Aerosol 50y tropospheric climatology RFILE5
C     MADDST  =  3  Updates  Dust-windblown mineral climatology   RFILE6
C     MADVOL  =  4  Updates  Volcanic 1950-00 aerosol climatology RFILE7
C     MADEPS  =  5           Epsilon cloud heterogeneity data     RFILE8
C     MADLUV  =  6           Lean's SolarUV 1882-1998 variability RFILE9
C                 Related Model Add-on Data Parameters set in RADPAR
C     MADGHG   =  1  Default Enables UPDGHG update. (MADGHG=0),no update
C     MADSUR   =  1          V72X46N.1.cor Vegetation type data   RFILEC
C                            Z72X46N Ocean fraction, topography   RFILED
C     ------------------------------------------------------------------
C      -----------------------------------------------------------------
C      Get Surface, Atmosphere, Sun Angle, Radiative Forcing, etc. Input
C      to compute Solar/Thermal Radiation for given (JLAT,ILON) Grid-box
C      The Radiation Model utilizes Data with 72x46 (lon,lat) resolution
C                 for GCM resolution other than 72x46, set JLAT and ILON
C                 to appropriately Sample  (rather than interpolate) the
C                 72x46 aerosol, ozone, cloud heterogeneity data sets
C      The Radiation Model can accommodate arbitrary vertical resolution
C      -----------------------------------------------------------------
!!!                   CALL GETO3D(ILON,JLAT)
      O3_OUT(:)=U0GAS(:,3) ! to save 3D ozone field in SUBR. RADIA
      if(use_tracer_ozone .eq. 1) U0GAS(1:NL-3,3)=O3_IN(1:NL-3)
      ! The -3 in the line above is just a fudge for the 23-layer model.
      ! Gavin said he'd think about how to do this properly.
                      CALL GETGAS

Yup. “just a fudge”… going to think about “how to do this properly” later ;-)

Now that kind of thing is VERY common in just about every program in the world when it is under development, and R&D codes are always under development. You do some kind of “hack” (the proper meaning – to knock together some code that works but isn’t as elegant as you would like; not the common bent meaning of ‘system security crack’ which isn’t quite proper jargon for “hack”… but widely used… but I digress…) and document your “hack that works but needs some polish” with a comment like that.

I fully expect that this is not a smoking gun of any kind, and has minimal impact other than letting the “23 layer model” run right. But I also think it is VERY important when folks are playing “bet the world economy” on the output of computer games that maybe, just maybe, they ought to know that this is how they ALL are made. Guesses, hacks, parameters galore, loose ends, fudge and humble pie. You have a spec, you write code to meet it, but you don’t bet your paycheck on it until the full QA cycle is done. The problem with Climate Models is that there is no real world QA.

Well, there’s a sort of a QA in that they are matched to reality to see what they say; but the models have dismally failed to predict what actually has happened, so effectively failed the only QA available.

So “Moving On”…

At any rate, I’ve got the tarball and “someday” I’ll unpack it and use some text searching tools to look for other such comments about Fudge, or other terms of interest. Please don’t toss rocks over this. It’s just one programmer talking to another and saying “don’t waste brain time trying to figure out where this -3 came from, it’s a plug number that works for now”. I’d much rather have that comment in there to give me clue than have it removed and things just become opaque. Given the overall impression of the code quality, I doubt there is anything of import to it other than it is “Yet Another Parameter” on the elephant trunk. But it is kinda cute ;-)

I expect there is FAR more of interest to be found in both all the parameter / initial state setting code / data and in the CO2 “forcing” code (IFF I can figure out where it is in the model…). I did find where the sulphates are set:

C     Anthropogenic Sulfate inter-decadal TAU interpolation is based
C     on a linear TAU trend (between decadal global TAU-maps) with a
C     superimposed intradecadal time dependence scaled in proportion
C     to the Anthropogenic Sulfate global emission rate.
C        INPUT:  XJYEAR  (Fractional Julian year)
C                                                 by 25     by 10
C       OUTPUT:  IDEC    (Map Index: I= -3,4-7  (0) -1925,1950-1980)
C                JDEC    (Map Index: J=1-4,5-8  1875-1950,1960-1990)
C              SUWTID    (Multiplicative Weight for SU TAU-Map IDEC)
C              SUWTJD    (Multiplicative Weight for SU TAU-Map JDEC)

Id do note in passing at least one thing that almost certainly “needs work”. In several places where the sun is involved, while they allow for orbital changes and solar angles, some values are set constant:

      subroutine solar_ice_frac(snow,msi2,wetsnow,fsri,lmax) 2
!@sum solar_ice_frac calculates the fraction of solar radiation
!@+   transmitted through the ice, taking albedo into account, but
!@+   assuming constant proportions of visible and near-ir.
!@+   Based on Ebert et al, 1995.
!@auth Gavin Schmidt

Yet we know from the latest “sun went quiet” observations that low frequencies (red and IR) increased while high frequencies (blue and UV) decreased. So there’s one very clear “issue” that needs a whole ‘nother set of processes. But at least the model looks like it uses the different spectra appropriately, just needs the variation added in. It looks like there is a very limited ability to modulate the UV level, but nothing that resembles an actual dramatic “shift at a point in time” as we’ve just had.

C     SETSOL Parameters:
C            KSOLAR    Selects Solar Spectrum, (Lean vs Thekaekara Flux)
C            JYEARS    JYEAR Proxy:  Sets: Solar Constant Reference Year
C            JJDAYS    JDAY  Proxy:  Sets Reference Year Month JDAY/30.5
C                      (Nominal Reference: JYEARS= 1950 JJDAYS= January)
C            KSOLAR   SOLSPEC     UVWAVLs       UVFACTs         KUVFAC
C              -1     THEK      Can be set    Can be set   (if KUVFAC=1)
C               0     LEAN      Can be set    Can be set   (if KUVFAC=1)
C               1     LEAN      Can be set    Can be set   (if KUVFAC=1)
C                               (Option to Modify Solar UV Fluxes)
C            UVWAVL    Specified Edges of UV Flux Variation SubIntervals
C            UVFACT    Factors to Change the Amplitude of UV Variability
C            KUVFAC    ON/OFF switch for activating UV Flux Modification
C            KSNORM    Re-Normalize S0 (VIS) (after UV Amplitude Change)
C                         (Nominal UVWAVLs are: 0.295,0.310,0.366)
C                                         Option to Modify Solar UV Flux
C                                         ------------------------------
      DO 160 I=1,NWSUV
      IF(WSOLAR(I).GT.UVWAVL(1)) GO TO 140
      GO TO 160
      IF(WSOLAR(I).GT.UVWAVL(2)) GO TO 150
      GO TO 160
      IF(WSOLAR(I).GT.UVWAVL(3)) GO TO 170
     +      +F3FLUX*(1.D0-UVFACT(3))
C                  -----------------------------------------------------
C                  When KUVFAC=1 option multiplicative factors UVFACT(I)
C                  are used to change the UV spectral flux distribution,
C                  KSNORM=1 provides the option to keep S00WM2 constant.
C                  -----------------------------------------------------

But maybe one could “do a run” with one setting up to a point in time, then checkpoint, and restart with a different UV level for the next 20 years and get something useful? I’ll have to read a lot more of the code before I can make a decent guess on that one. At present, it looks like just swap on plug number for a different one if you want to run a single, but different, UV spectrum. No solar modulation over time allowed.

I also found where they have methane drive higher water vapor levels (at least I think that’s what it does on a first glance):

      subroutine getqma (iu,dglat,plb,dh2o,lm,jm) 1
!@sum  reads H2O production rates induced by CH4 (Tim Hall)
!@auth R. Ruedy
!@ver  1.0

Most likely an example of self fulfilling prophecy. You “know” CH4 will increase water vapor so you program it in, but don’t handle clouds well so don’t find that it precipitates back out again… (My Guess on too little actual reading of the code).

In Conclusion

So color me a mix of impressed (with the general code quality) and unimpressed (with the massive parameterization and the ‘model what we expect so we get what we expected’ structure. Holding constant naturally variable things (cloud nature, sun, …) and building in expected dependencies (water vapor on CH4) that may not happen. Or, more properly given the lack of a troposphere hot spot, didn’t happen at all.

While it would be fun to add in a “solar variation” module and a “lunar tidal ocean mixing” module and a “lunar tidal SST variation” module and damp down the settings on the effect of CH4 and CO2, perhaps even having rain quantity vary upward with water vapor… and increasing clouds with CO2 / WV; it would likely take more time than is available to do it.

At any rate, for anyone wanting to “wander around the code”, it’s an easy interface to use. Select a subroutine in the lower left side and read the code on the right. Feel free to post comments on anything interesting to run into.

Subscribe to feed


About E.M.Smith

A technical managerial sort interested in things from Stonehenge to computer science. My present "hot buttons' are the mythology of Climate Change and ancient metrology; but things change...
This entry was posted in AGW Science and Background and tagged , , , . Bookmark the permalink.

13 Responses to Of Computer Climate Models, Fudge, and Parameters – ModelE

  1. peterazlac says:

    Earl Happ has a series on the importance of ozone variability in the stratosphere in relation to climate change.
    I find his arguments compelling in that they offer a good explanation as to how variation in other aspects of an otherwise near constant TSI, together with changes in the solar wind and geomagnetism, result in a “top down” control of surface temperatures. His study also removes the artificial boundary between troposphere and stratosphere etc. He does not except the “bottom up” claims on which most GCMs are based nor the impact of the Saros cycle or orbital change but rather that without the “top down” solar effects these would be diminished.

    I am not literate in computer code – or is that numerate? – but I wonder to what extent the Model E code incorporates or is capable of incorporating his ideas and what you think of them.

  2. Anything to do with methane is not only a guess but a lie. Methane is has no effect on climate. Its IR absorption is a small fraction of CO2 and the amount present in the atmosphere is only about 1/2 % of CO2. No amount of fiddling can make it significant.. see https://cementafriend.wordpress.com/2011/10/
    Gavin Schmidt has no idea about heat and mass transfer. On another blog he admitted he did not know about the Schmidt number. which is analogous to the Prandtl number. I suggest that he is technically incompetent and that is a big reason why that climate model (E) does not work.
    Probably it is not worthwhile for you to find more holes in this model, it is a dud, but thanks for your efforts

  3. spetzer86 says:

    If methane doesn’t matter I guess it’s a good thing Obama has the USA and Canada making a deal on reducing it. EPA is already gearing up to implement.

  4. E.M.Smith says:


    It will only be barely started when it gets crushed by The Donald or Ted. (Or, horrors!, gets the old double down and double dip from Hillary…)


    I’d not call it “efforts” just yet. More like idle musing… I literally was just clicking around in it during commercials and when the Talking Heads were not saying enough to keep my interest. (I’ll get around to “efforts” later when I unpack it and try porting it to Linux on some box or other).

    For anyone wanting to know the numbers, they have to do with fluid flow:

    The Prandtl number (Pr) or Prandtl group is a dimensionless number, named after the German physicist Ludwig Prandtl, defined as the ratio of momentum diffusivity to thermal diffusivity.[1] That is, the Prandtl number is given as:
    \mathrm{Pr} = \frac{\nu}{\alpha} = \frac{\mbox{viscous diffusion rate}}{\mbox{thermal diffusion rate}} = \frac{\mu / \rho}{k / c_p \rho} = \frac{c_p \mu}{k}

    Note that whereas the Reynolds number and Grashof number are subscripted with a length scale variable, the Prandtl number contains no such length scale in its definition and is dependent only on the fluid and the fluid state. As such, the Prandtl number is often found in property tables alongside other properties such as viscosity and thermal conductivity.

    Schmidt number

    (Sc) is a dimensionless number defined as the ratio of momentum diffusivity (viscosity) and mass diffusivity, and is used to characterize fluid flows in which there are simultaneous momentum and mass diffusion convection processes. It was named after the German engineer Ernst Heinrich Wilhelm Schmidt (1892-1975).

    Schmidt number is the ratio of the shear component for diffusivity viscosity/density to the diffusivity for mass transfer D. It physically relates the relative thickness of the hydrodynamic layer and mass-transfer boundary layer.

    Yeah, a bit strange that someone named Schmidt would not know about it ;-)

    (FWIW: I knew about it but could not have rattled it off if asked. Then again, I don’t do anything at all with fluid and heat flow and haven’t since college 45 years or so ago… Reynolds I remembered as I was interested in airfoil design at one point and it matters in model scale…)


    That’s 550 modules to dig through. If anyone could just click on one or two and put up a comment on any of them with things like mass flow (convection) and gas IR (i.e. CO2 stuff) that would help focus in on “issues”. Otherwise I’m just going to be slogging through it for a year or two… a bit at a time. (Which is probably OK anyway. The Political Machine is not going to be derailed by me, and we are entering the win / lose final quarter. Implementation is being pushed NOW and it’s moved out of the realm of ‘the science’ or ‘the tech’ and into the People With Pitchforks needed phase. Anyone who votes for a Democrat in this race is not one of the PWP… Maybe we need a new T-shirt: PWP for The Donald and / or PWP for Ted?)

  5. Power Grab says:

    PWP – ?

    Maybe I haven’t been paying attention lately, but I don’t remember this one.

    If one is a member of People With Pitchforks, is that likely to evoke the image of one who brings the tar and feathers?

    That is what comes to my mind.

  6. Another Ian says:

    Thats the PTAF – allies of PWP

  7. Another Ian says:


    Re the “Standard Model” for particle physics

    “Most particle physicists feel, as Leon Lederman remarked in a 1985 television documentary, that the Standard Model lacks elegance and simplicity. “It is too complicated. It has too many arbitary parameters” Lederman said. “We don’t really see the creator twiddling twenty knobs to set twenty parameters to create the universe as we know it”.

    Bill Bryson “A Short History of Nearly Everything”

    Thoughts for global circulation models too?

  8. E.M.Smith says:

    At Power Grab: I’d used the phrase just before it, but didn’t match the definition tighly:

    People With Pitchforks. PWP.

    It is like new with / from me. Maybe it will catch on ;-)

    @Another Ian:

    I’d agree. Get convection and water right and I think you have over 90% of it all…

  9. p.g.sharrow says:

    GOD works in applied science with the K.I.S.S. method of engineering.
    Scientists use, confuse and dazzle with BS and phd as their method of creation.
    Small wonder that the real world of GOD works and the imagined world of Science does not.
    GOD= that which is or the soul of the universe
    K.I.S.S= keep it simple, stupid
    BS= Bad Science, different then bs=bull scat
    phd=piled higher and deeper
    GIGO=garbage in, garbage out
    Climate Science experts felt that if they plug enough phd BS into their computers, the answers would be reveled to any question. Small wonder GIGO. ;-)…pg

  10. cdquarles says:

    Hmm. I need to check my archives again. I think that I downloaded ModelE a few years ago to see what it looked like. I cut my keypunching teeth on FORTRAN IV (66). My last job for my Professor was keying in his X-ray crystallography code and data. [Good practice back then was putting a rubber band on the deck ;P] Fun times messing with the work-study folk tending the UNIVAC.

  11. Power Grab says:

    Ah yes…FORTRAN IV…good times…good times.

  12. David A says:

    “Yet we know from the latest “sun went quiet” observations that low frequencies (red and IR) increased while high frequencies (blue and UV) decreased”
    Well I will dust off my personal physics law in thought about this.

    (1) “Only two things can change the energy content of a system in a radiative balance; either a change in input, or a change in residence time of some aspect of the energy within the system.”
    ..and its corollary…

    (2) “Residence time depends on both the materials energy input encounters, and the WL of the input under consideration.”

    Note: For purposes of CAGW discussion we are defining the earth’s atmosphere as our system existing between two inputs, the earth itself, including the oceans, (bottom up) and solar insolation (top down)

    In thinking about this it becomes clear that CO2 is considered warming due to increasing the residence time of some energy in the system. (It also decreases the residence time of some energy, so I am not certain we know how all the pluses and minuses for CO2 alone add up) In general however I think it may be apparent that, once we get past albedo affect on visible, longer frequencies have a shorter residence time compared to a longer residence time for shorter frequencies.

    I got Leif S on WUWT to admit we do not know the residence time of disparate solar energy entering earth’s system but we do know it varies from micro seconds to centuries! Some enters and leaves at the sped of light, some penetrates hundreds of meters into the ocean.

    Over four or five large solar cycles if there is an increase in the SW penetrating deep into the oceans, then over four or five solar cycles that increase may accumulates every day for forty or fifty years!! (Curiously of course this longest residence time input increase, is potentially balanced out by an increase in albedo, the shortest residence time input factor.) The point is we do not know! To therefore assume no change in what is fundamental to long term change, is tantamount to a blind man refusing to admit he is blind.

    This increase (from successive strong solar cycles) may manifest eventually as subtle long term changes in ENSO cycles, but eventually it gets to the atmosphere. (Possibly the last two strong El Niño’s) The only input with a longer residence time is volcanic and general conduction from the crust underneath the oceans. I have never received an answer as to how much energy currently in the oceans is from volcanic sources. Also we know little of how much these forcing’s change over time.

    Therefore whether one is talking Earl Harps (or our hosts and/or Steven Wilder’s thoughts in this line) top down changes, or bottom up changes from earth’s core and ocean penetrating solar insolation, the earth’s atmosphere is a short tail being wagged by dogs below and above with thousands of times more energy. It is scientific illiteracy to assume constant input and to assume we know far more then we do about residence time of disparate input flux. It is dangerous for a blind man on a raised stage to strut around acting as though he can see.

  13. Pingback: Of Computer Climate Models, Fudge, and Parameters – ModelE | Climate Collections

Comments are closed.