Skip to content
jtruesdal edited this page Oct 16, 2024 · 5 revisions

Welcome to the CESM3-planets wiki!

This is the development repository for CESM3-Planets and contains the latest CESM3 framework updates along with the most current version of CAM-MARS. Please refer to the original CESM-Planets wiki for further information on the project

Completed and Future Tasking:

There is a new interface to the ExoRT radiation library that was originally part of an exoplanet version of CAM. ExoRT and ExoCAM are currently being maintained by Eric Wolf.

The new interface sits below the physics/exo-rt directory and follows CAM's radiation API. ExoRT can be chosen as CAM's radiation package via the configuration routine and could eventually be swapped in place of RRTMG or any other CAM supported radiation package. For now though we are only using ExoRT for a developing a Mars simulation and the interface is currently hardwired to expect 3 advected, radiatively active constituents H2O, CO2 and N2. There are a number of new placeholder compsets for using ExoRT with the different versions of CAM physics but none of them is being worked on until the radiation has been validated.

In order to validate ExoRT and provide a simple framework for working on Mars physics parameterizations, we added a simple model setup for Mars along with a corresponding compset FMARSEXORT. The simple model framework allows ExoRT to be run and tested alone. As mentioned above, CAM-Mars currently expects 3 advected constituents H2O, CO2, and N2 that will be read from the initial condition file. CAM's radiation interface is a little klunky and I had to jump through a few hoops to use these 3 consitituents in the simulation.

  1. modify configure to bump the number of advected components by 2 when mars is selected
  2. add the names to the gaslist array in the radconstants.F90 file.
  3. modify the radiation namelist reading routine to not return if we are using the exort radiation package
  4. add the gasses to the rad_climate namelist
  5. call cnst_add for the gasses in the mars_cam.F90 simple model interface file.
  6. add CO2 and N2 mixing ratios to the Initial condition file.

A simple model mars experiment can be built and run up to the point where ExoRT is executed but the state returned from the driver is bad and the model dies noting a bad temperature value.

Since there is no surface model yet I added a surface init routine to the simple mars interface that sets reasonable surface temperature and the direct/indirect albedo values for input into ExoRT. These should be removed when we are ready to add a land model to the configuration which will prognose these variables.

A sample script for running a simple model ExoRT case on a single processor in debug mode.

#!/bin/csh -fv                                                                                                                                                                  
set echo

#**********************************************************************                                                                                                         
# Run SCAM with a single IOP                                                                                                                                                    
#    This script will build and run one IOP                                                                                                                                     
#    If a user wishes to run more than one IOP, use create_scam6_iop_multi                                                                                                      
#                                                                                                                                                                               
# Usage:                                                                                                                                                                        
#   ./create_scam6_iop <IOP>    # where IOP name is from list below                                                                                                             
#      - or -                                                                                                                                                                   
#   ./create_scam6_iop          # IOP is specified in the script below                                                                                                          
#**********************************************************************                                                                                                         

#### BEWARE OF ###                                                                                                                                                              
# - Have to blow away case directory to rebuild.                                                                                                                                

#------------------                                                                                                                                                             
# User sets options in this section                                                                                                                                             
#------------------                                                                                                                                                             
### Case Name                                                                                                                                                                   
set CASETITLE=cesm_planets.002

### Full path of cesm source code and case (output) directories (see examples)                                                                                                  

set CESMDIR=/project/amp/jet/collections/test/CESM3-planets
set CAMDIR=${CESMDIR}/components/cam
set CASEDIR=/project/amp/$USER/cases

### Set location of user source mods (if any)                                                                                                                                   
setenv this_dir  `pwd`
setenv usrsrc  ${this_dir}/mods/$CASETITLE

### Standard Run Settings                                                                                                                                                       
set RES=ne16_ne16_mg17
set COMPSET=FMARSEXORT
set COMPILER=intel

#------------------                                                                                                                                                             
# User should not need to set any options in this section                                                                                                                       
#------------------                                                                                                                                                             
cd  $CASEDIR


##set MODSDIR = $CESMDIR/components/cam/cime_config/usermods_dirs                                                                                                               
#Create full casename                                                                                                                                                           
set CASENAME=${COMPSET}.${RES}.${CASETITLE}

#------------------                                                                                                                                                             
# create case                                                                                                                                                                   
#------------------                                                                                                                                                             

$CESMDIR/cime/scripts/create_newcase --compset $COMPSET  --res $RES --compiler $COMPILER --case $CASEDIR/$CASENAME --run-unsupported --pecount 1
cd  $CASEDIR/$CASENAME

### Set build and run directories to be under case directory.                                                                                                                   

set RUNDIR=${CASEDIR}/${CASENAME}/run
./xmlchange RUNDIR=$RUNDIR
./xmlchange EXEROOT=${CASEDIR}/${CASENAME}/bld
  
#------------------                                                                                                                                                             
# USER XMLCHANGE OPTIONS HERE                                                                                                                                                        
#------------------                                                                                                                                                             
                                                                                                                                                               
./xmlchange DEBUG='TRUE'
./xmlchange STOP_OPTION=nsteps
./xmlchange STOP_N=2 # Total timesteps for run f(dt)                                                                                                                            

#------------------                                                                                                                                                             
# Setup Case                                                                                                                                                                    
#------------------                                                                                                                                                             
./case.setup

#------------------                                                                                                                                                             
#  source mods: copy them into case directory                                                                                                                                   
#------------------                                                                                                                                                             
#/bin/cp  ${usrsrc}/* SourceMods/src.cam/                                                                                                                                       

#------------------                                                                                                                                                             
# Add all user specific cam namelist changes here                                                                                                                               
#                                                                                                                                                                               
# Users should add all user specific namelist changes below in the form of                                                                                                      
#    namelist_var = new_namelist_value                                                                                                                                          
# Namelist settings which appear in usermods_dir and here will use the values                                                                                                   
#    specified below                                                                                                                                                            
# Other namelist settings from usermods_dirs will be unchanged                                                                                                                  
# Output can also be specified here (e.g. fincl1)                                                                                                                               
#------------------                                                                                                                                                             
cat >> user_nl_cam << EOF                                                                                                                                                       
se_statefreq       = 144                                                                                                                                                        
nhtfrq = 0,0                                                                                                                                                                    
inithist          =  'MONTHLY'                                                                                                                                                  
interpolate_output = .true.,.true.,.true.                                                                                                                                       
interpolate_nlat   = 192,192,192                                                                                                                                                
interpolate_nlon   = 288,288,288                                                                                                                                                
empty_htapes       = .true.                                                                                                                                                     
ncdata = '/fs/cgd/csm/inputdata/atm/cam/inic/se/Mars_co2_n2_ne16_ne16_mg17_L49.cam.i.0001-04-01-00000.nc'                                                                       
se_nsplit = 8                                                                                                                                                                   
se_rsplit = 4                                                                                                                                                                   
se_hypervis_subcycle           = 8                                                                                                                                              
se_hypervis_subcycle_q         = 1                                                                                                                                              
mfilt = 144                                                                                                                                                                     
avgflag_pertape(1) = 'I'                                                                                                                                                        
fincl1 = 'PS','U','V','T','OMEGA'                                                                                                                                               
fincl2 = 'PS','U','V','T','OMEGA'                                                                                                                                               
gravit = 3.72                                                                                                                                                                   
sday   = 88642.0                                                                                                                                                                
mwdry  = 43.34                                                                                                                                                                  
cpair  = 735.0                                                                                                                                                                  
rearth = 3.38992e6                                                                                                                                                              
co2vmr =  0.97                                                                                                                                                                  
ch4vmr=   0.                                                                                                                                                                    
n2ovmr=   0.                                                                                                                                                                    
f11vmr=   0.                                                                                                                                                                    
f12vmr=   0.                                                                                                                                                                    
n2vmr=    0.03                                                                                                                                                                  
rad_climate         = 'A:CO2:CO2','A:Q:H2O','A:N2:N2'                                                                                                                           
water_species_in_air                = 'Q'                                                                                                                                       
EOF                                                                                                                                                                             

#------------------                                                                                                                                                             
# Build                                                                                                                                                                         
#------------------                                                                                                                                                             

./case.build

### make timing dir kludge  [REMOVE WHEN FIXED]                                                                                                                                 
mkdir -p $RUNDIR/timing/checkpoints

#------------------                                                                                                                                                             
# Choose type of job submission (batch or interactive)                                                                                                                          
#------------------                                                                                                                                                             

### Submit to Queue (If you have one)                                                                                                                                           
./case.submit                                                                                                                                                                  
Clone this wiki locally