Modify the rain_threshold in CLM#

In the below exercise, we will change the rain threshold for stress deciduous vegetation, which includes C3 grasses. The rain threshold is the amount of rain required to initiate leaf onset. Reaching the rain threshold is one of several requirements for stress deciduous vegetation leaf onset. If you are interested, you can find more information about the stress deciduous phenology representation in the CLM Technical Note.

The current value of rain_threshold is 20mm as specified in the code:

rain_threshold = 20._r8 
Exercise: Add an additional output variable

Create a case called b1850_rain_threshold using the compset B1850 at f19_g17 resolution.

  • Change the rain_threshold from 20mm to 1mm.

  • Output daily values of ??? in the h1 history file.

  • Make a 1-month run.

Click here for hints

Tip to add T750

  • Use T500as a template for your changes.

  • Find the subroutine containing T750. For instance, in the CESMROOT, use the command:

    grep –r T500 *    

Tip to check your solution T750

  • When the run is completed, go to your archive directory:

  • check the fields T750 and T500 are in the file h1

  • create a file with the difference between T750-T500

  • For instance, you can use ncap2

    ncap2 -s ’T750_minus_T500=T750-T500' b1850_T750.cam.h1.0001-01-01-00000.nc  T750-T500.nc
  • Look at the difference with ncview.

Click here for the solution

Create a new case b1850_rain_threshold with the command:

cd /glade/p/cesm/tutorial/cesm2.1_tutorial2022/cime/scripts
./create_newcase --case ~/cases/b1850_rain_threshold --compset B1850 --res f19_g17 

Case setup:

cd ~/cases/b1850_rain_threshold
./case.setup

Locate the file where rain_threshold is defined and copy it into SourceMods/src.lnd:

cp /glade/p/cesm/tutorial/cesm2.1_tutorial2022/components/clm/src/biogeochem/CNPhenologyMod.F90 SourceMods/src.clm

Edit the file SourceMods/src.clm/CNPhenologyMod.F90 and add the lines:

      ! specify rain threshold for leaf onset                                   
      rain_threshold = 20._r8

to

      ! specify rain threshold for leaf onset                                   
      rain_threshold = 1._r8

Change the run length:

./xmlchange STOP_N=1,STOP_OPTION=nmonths

If needed, change job queue and account number For instance:

./xmlchange JOB_QUEUE=regular,PROJECT=UESM0011

Build and submit:

qcmd -- ./case.build
./case.submit

When the run is completed, check the fields T750 and T500 are in the file h1:

cd /glade/scratch/$USER/archive/b1850_rain_threshold/atm/hist/ 
ncdump -h bb1850_rain_threshold.cam.h1.0001-01-01-00000.nc

The file should contain:

float T500(time, lat, lon) ;
    T500:units = "K" ;
    T500:long_name = "Temperature at 500 mbar pressure surface" ;
    T500:cell_methods = "time: mean" ;
float T750(time, lat, lon) ;
    T750:units = "K" ;
    T750:long_name = "Temperature at 750 mbar pressure surface" ;
    T750:cell_methods = "time: mean" ;

If you don’t see these variables, check you correctly set the user_nl_cam.

Create a file with the difference between T750-T500:

cd /glade/scratch/$USER/archive/b1850_rain_threshold/atm/hist/ 
ncap2 -s ‘T750_minus_T500=T750-T500' b1850_T750.cam.h1.0001-01-01-00000.nc  T750-T500.nc 

Look at the difference between T750-T500 with ncview:

cd /glade/scratch/$USER/archive/b1850_rain_threshold/atm/hist/ 
ncview T750-T500.nc

The field T750-T500 looks like:

ncview T750-T500
Figure: Overview of the CESM directories and the SourceMods directories.