CESM: Adding an Idealized Land Mass to an Aqua-Planet

While working on my current research on the African monsoon system, I often wonder about how the monsoon would change if I could reshape the african continent. But to answer this, it would be nice if you could simplify the problem and remove all the other continents. I’ve talked to other people who have similar question about how the Inter-Tropical Convergence Zone (ITCZ) is affected by the existence of land masses. Below are some notes for setting up a model simulation using the NCAR CESM with an idealized land mass for exploring these questions.

Land masses complicate weather and climate patterns in several ways:

  • Land has a much smaller heat capacity, so the daily temperature swings are much larger and more in sync with the incoming solar radiation compared to the ocean
  • Land usually comes with topographical features that block and redirect atmospheric flow, often lifting the air and triggering convective storms
  • land masses with ocean circulations, which restructures the ocean surface temperature patterns
  • patterns of soil moisture and vegetation can have a very large impact on surface evaporation and atmospheric flows, such as the African easterly jet (AEJ, Wu et al. 2009)

In my case, I had a wish list for some simple experiments:

  • A planet with mostly ocean
  • Perpetual equinox (i.e. no seasons)
  • Simple land geometry, no complicated coastlines
  • To mimic the conditions of West Africa, I needed a wet region to the South and a large, dry desert region to the North (like the Sahara desert).
  • I also did not want any east-west variation of the land surface conditions (zonal homogeneity)

To begin I started with the code for setting up an aqua-planet that I talked about in a previous post. The first step was to determine the area of the idealized continent and modify the ocean and land masks. This includes:

  • lnd and ocn domain files
  • cam atmospheric initialization file (cami)
  • topography data (I just set it all to zero)
  • clm input data

I wanted to have the land be somewhat realistic, so instead of using a completely idealized land surface I wanted to use the community land model (CLM) component of CESM, which calculates surface sensible and latent heat fluxes based on soil and vegetation types. However, the CLM requires A LOT of input variables that I don’t know the first thing about. So to make an idealized continent like Africa I just took a standard CLM input file and replaced the area approximately over North Africa with the zonal average values of West Africa (where the Sahara is the hottest). This became pretty tricky because there were several special variables that can’t be homogenized like this, so my script to do this is kind of a mess.

After a lot of trial and error (see below), I got it to running for a few years of perpetual equinox conditions the surface temperature and 975mb wind looks like this:

The idealized land mass on the right panel is the black rectangle. The other continent lines are just shown for scale.

So after all that effort it (kinda) works! I knew it would look dramatically different from the real Earth, but I was hoping the continent would look a bit more like Africa. It seems that the model hasn’t formed a large desert like the Sahara. The precipitation shows that there is something similar to a monsoon on the continent, but nothing like the real African monsoon. I think there are three main reasons why the climatology doesn’t resemble Africa:

  • My zonally homogeneous SST pattern keeps the ITCZ convection on the equator. The location of this heat source is important for the circulations over Africa (Thorncroft and Blackburn 1999). I think widening the SST pattern meridionally and moving it slightly northward will make a big difference.
  • I don’t have a West Pacific Warm pool or Asian monsoon, which may be important for the circulation and strong subsidence we see over the Mediterranean (Tyrlis et al. 2013).
  • Using a perpetual equinox doesn’t really make sense for what I’m doing. However, I haven’t figured out how to set the model to run perpetually in a different season. This was very easy in older versions of CESM, but in the current version (1.2.2) this requires modifying the source code. My first few attempts to do this have not been fruitful.

I’m pretty busy with other stuff now, but I hope to get back to idealized simulations like this in the future. I think they are a novel way to study monsoons as well as how land can influence weather and climate.

Errors Along the Way

I initially tried to use CLM4.5 instead of the older and less complex CLM4.0. However, I quickly ran into a problem with the following error.

mpif90 -o /home/whannah/Model/CESM/scratch/NUNA_ZM_00_1.9x2.5_044/bld/cesm.exe ccsm_comp_mod.o ccsm_driver.o mrg_mod.o seq_avdata_mod.o seq_diag_mct.o seq_domain_mct.o seq_flux_mct.o seq_frac_mct.o seq_hist_mod.o seq_map_esmf.o seq_map_mod.o seq_mctext_mod.o seq_rest_mod.o -L/home/whannah/Model/CESM/scratch/NUNA_ZM_00_1.9x2.5_044/bld/lib/ -latm -L/home/whannah/Model/CESM/scratch/NUNA_ZM_00_1.9x2.5_044/bld/lib/ -lice -L/home/whannah/Model/CESM/scratch/NUNA_ZM_00_1.9x2.5_044/bld/lib/ -llnd -L/home/whannah/Model/CESM/scratch/NUNA_ZM_00_1.9x2.5_044/bld/lib/ -locn -L/home/whannah/Model/CESM/scratch/NUNA_ZM_00_1.9x2.5_044/bld/lib/ -lrof -L/home/whannah/Model/CESM/scratch/NUNA_ZM_00_1.9x2.5_044/bld/lib/ -lglc -L/home/whannah/Model/CESM/scratch/NUNA_ZM_00_1.9x2.5_044/bld/lib/ -lwav -L/home/whannah/Model/CESM/scratch/NUNA_ZM_00_1.9x2.5_044/bld/gnu/openmpi/nodebug/nothreads/MCT/noesmf/a1l1r1i1o1g1w1/csm_share -lcsm_share -L/home/whannah/Model/CESM/scratch/NUNA_ZM_00_1.9x2.5_044/bld/gnu/openmpi/nodebug/nothreads/lib -lpio -lgptl -lmct -lmpeu -L/usr/local/netcdf/lib -lnetcdf -L/usr/local/netcdf/lib -lnetcdf -lnetcdff 
/home/whannah/Model/CESM/scratch/NUNA_ZM_00_1.9x2.5_044/bld/lib//liblnd.a(BandDiagonalMod.o): In function `__banddiagonalmod_MOD_banddiagonal':
BandDiagonalMod.F90:(.text+0x84a): undefined reference to `dgbsv_'
collect2: error: ld returned 1 exit status
gmake: *** [/home/whannah/Model/CESM/scratch/NUNA_ZM_00_1.9x2.5_044/bld/cesm.exe] Error 1

Steve Ghan noted a similar error on the CESM bulletin board here. The response mentions that this means the compiler needs to link to the LAPACK and BLAS libraries for linear algebra operations for CLM4.5. Instead of dealing with this, I realized that I don’t care which land model is used! So to make things easy I switched to CLM4.0.


After creating my idealized land input data, I got this error:

 ...
 check_var: variable xc is not on dataset
 surfrd_get_data lon_var = LONGXY lat_var =LATIXY
 surfrd_get_data: surfdata/fatmgrid lon/lat mismatch error 244.64285714285708 4.9737991503207013E-014
 ENDRUN:surfrd_get_data

The two numbers are the maximum lat and lon of the land component grid. Turns out I had forgotten to skip the lat and lon variables when I did my continent homogenization routine. In other words, I replaced the monotonically varying latitude and longitude arrays with the average lat and lon values over the continent (whoops!).


I wish the differences between all the different input files were easier to talk about. In this next case, the “initial condition” file is very different from the “input data” file for CLM. The “input data” tells the model about physical things, like how much sand is in each grid box, which we don’t expect to change over the course of the simulation. On the other hand, the “initial condition” file(s) give the initial state of things that we do expect to change, like the soil temperature and moisture. When creating an idealized land mass, we have to consider both of these files, which is why I got this error:

 check_dim ERROR: mismatch of input dimension 5663 with expected value 315 for variable gridcell
 ENDRUN: called without a message string
--------------------------------------------------------------------------
MPI_ABORT was invoked on rank 2 in communicator MPI COMMUNICATOR 9 CREATE FROM 0 
with errorcode 1.

This has to do with the fact that I needed to interpolate the “initial condition” files to match the new surface data input. This problem is discussed in this post on the CESM bulletin board, as well as in the CESM User Guide.

As an alternative, it seemed that I could just set CLM_FORCE_COLDSTART to “on” in the file env_run.xml. So I tried this out and it seems to have worked, circumventing the need to create a new initial condition file.


After getting the model to actually run, I got a bunch of these QNEG warnings, as well as a segmentation fault (i.e. the model crashed).

... 
 QNEG3 from vertical diffusion/ncl_a2:m= 20 lat/lchnk= 339 Min. mixing ratio violated at 13 points. Reset to 1.0E-36 Worst =-7.6E-10 at i,k= 3 30
 QNEG3 from vertical diffusion/num_a2:m= 21 lat/lchnk= 339 Min. mixing ratio violated at 7 points. Reset to 1.0E-36 Worst =-4.8E+09 at i,k= 3 30
 QNEG3 from vertical diffusion/ncl_a2:m= 20 lat/lchnk= 123 Min. mixing ratio violated at 15 points. Reset to 1.0E-36 Worst =-4.2E-10 at i,k= 12 30
 QNEG3 from vertical diffusion/num_a2:m= 21 lat/lchnk= 123 Min. mixing ratio violated at 6 points. Reset to 1.0E-36 Worst =-2.7E+09 at i,k= 12 30
 QNEG3 from vertical diffusion/ncl_a2:m= 20 lat/lchnk= 340 Min. mixing ratio violated at 9 points. Reset to 1.0E-36 Worst =-5.0E-10 at i,k= 3 30
 QNEG3 from vertical diffusion/num_a2:m= 21 lat/lchnk= 340 Min. mixing ratio violated at 7 points. Reset to 1.0E-36 Worst =-2.3E+09 at i,k= 3 30
 QNEG3 from vertical diffusion/ncl_a2:m= 20 lat/lchnk= 124 Min. mixing ratio violated at 15 points. Reset to 1.0E-36 Worst =-2.4E-10 at i,k= 1 30
 QNEG3 from vertical diffusion/num_a2:m= 21 lat/lchnk= 124 Min. mixing ratio violated at 6 points. Reset to 1.0E-36 Worst =-2.1E+09 at i,k= 1 30
...
Opened file NUNA_ZM_00_1.9x2.5_044.cam.h1.0000-01-01-00000.nc to write 524288
Program received signal SIGABRT: Process abort signal.
Backtrace for this error:
Program received signal SIGSEGV: Segmentation fault - invalid memory reference.

According to this post on the bulletin board, the seg fault is related to the model trying to write NaN’s to the output file. After a few days of looking into this it turned out that I accidentally converted my SST input values to Kelvin, when they needed to be in Celsius! The QNEG warnings were probably related to this as well. So I effectively tried to simulate an atmosphere with a boiling ocean… and not surprisingly, the model didn’t like that.

9 thoughts on “CESM: Adding an Idealized Land Mass to an Aqua-Planet

  1. Wenwen

    Hi Walter,
    Thanks very much for sharing this! I am pursuing the similar approach to tackle a different problem. I am having several questions about the details and hope you could give me a hint.
    (1) I wonder what variables need to be modified in the cam initialization file, I looked at the cami data but did not find relevant variables (such as PHIS, SGH, etc).
    (2) As I don’t need a somewhat realistic land as you did in your case, so I assume there is no need for me to modify and read in the clm input data, right?
    (3) My understanding is that I don’t need to modify the SST file to match the mask file (for example, set the SST values over the land mass area to _FillValue), but I am not 100% sure.
    (4) Did you also try to minimize the effect from aerosols (for example, set the aerosol emission globally uniform)?

    Wenwen

    Reply
    1. Walter Post author

      Wenwen,

      (1) I’m not sure which variables would need to be changed. This will probably take a lot of trial and error to figure out.
      (2) You definitely need to modify the CLM input data. The CLM “initial conditions” file can be ignored if you use the CLM_FORCE_COLDSTART option, but the “input data” definitely needs some attention.
      (3) You most likely do need to modify the SST mask and make sure it matches the boundaries of the land domain file. This is done with the land and ocean “fraction” variables, but I don’t remember what their exact names are.
      (4) I didn’t touch the aerosol options, but I think it would be best to homogenize this as well. I recently got another question related to this, and I need to look into this more.

      Reply
      1. Wenwen

        Hi Walter,
        Thank you for the quick response and suggestions!
        Could you elaborate more about how you dealt with the CAM initial file in your trial run shown above? For the aerosol (and ozone) part, I will keep you posted if I make any progress.
        Thanks!
        Wenwen

        Reply
  2. Rishav Goyal

    Hi Walter,

    Thanks for this amazing guide, it has been a great help

    I am trying to set up an idealized land mass in aquaplanet ( my aquaplanet configuration is the same as yours, from your earlier post). As my Land model was NULL, there is no CLM input file to edit as you mentioned. Is your component set different from the previous aquaplanet or am I missing something in my CLM input?

    Thanks

    Cheers

    Reply
    1. Walter Post author

      I guess I forgot to go over that part of the setup. For the version of CESM I was using at the time I was able to add this:
      -user_compset 2000_CAM5_CLM40_DICE%NULL_DOCN%DOM_SROF_SGLC_SWAV
      to the “create_newcase” command, but I don’t think that is a valid way to specify a custom compset now. I’m not sure of the best way to do this with the recent CESM code, but you definitely can’t use a “NULL” land model. You have to have an active land model if you want the the land to respond like a real land mass with vegetation and soil and such.

      Reply
  3. sun weihao

    Hi Walter,

    Thanks for this tutorial ,
    I have meet the same problem as you displayed, I changed land-sea distribution in the cesm model. But in the run time it shows that:
    ERROR: ERROR in surfrdMod.F90 at line 384
    ERROR: surfdata/fatmgrid lon/lat mismatch error 5.684341886080801E-014
    0.235602094240804

    can you tell me how to resolve this problem in more details?

    Thank you!

    Reply
    1. Walter Post author

      The main thing here is that you need to preserve the lat/lon coordinate data. The model needs the coordinates to know where each grid cell is located, so make sure the coordinate data in the file that you make matches the coordinate data for the other input files.

      Reply

Leave a Reply to Wenwen Cancel reply

Your email address will not be published. Required fields are marked *