This is an old revision of the document!
Advanced configuration of NorESM2
Creating a new compset for use of CAM5-Oslo aerosols
In this example we use the CESM1.2 compset FAMIPC5 (AMIP run with CAM5) as basis. If starting from fresh, include the new CAM5-Oslo on a new directory;
~/noresm/models/atm/cam/src/physics/cam_oslo/
then add the new CAM5-Oslo capability by editing the following files:
~/noresm/models/atm/cam/bld/configure
Under “GetOptions(” add
"cam_oslo=s" => \$opts{'cam_oslo'},
At the end of the section starting with “The default physics package is cam5…”, add
#cam-oslo configuration
my $cam_oslo='none';
my $cam_oslo_nadv = 0;
# Check cam-oslo option
if (defined $opts{'cam_oslo'}){
$cam_oslo=$opts{'cam_oslo'};
}
if($cam_oslo != 'none' and $cam_oslo != 'aerlife'){
die "only valid cam_oslo configuration is currently 'aerlife' or 'none' \n ";
}
if($cam_oslo eq 'aerlife'){
$cam_oslo_nadv =23;
}
At the end of the section starting with “User source directories”, add
#if cam_oslo is defined its source goes before the usr_sources
if ($cam_oslo ne 'none'){
my @usr_src_dirs = split ',', $cfg_ref->get('usr_src');
unshift(@usr_src_dirs, "$cam_root/models/atm/cam/src/physics/cam_oslo");
my $usr_src_dirs_string = join(",",@usr_src_dirs);
$cfg_ref->set('usr_src',$usr_src_dirs_string);
}
At the end of the section starting with “Number of advected constituents”, add
#CAM5-Oslo
if ($cam_oslo_nadv > 0){
$nadv += $cam_oslo_nadv;
if($print >=2 ){ print "Advected constituents added by CAM-Oslo $cam_oslo : $cam_oslo_nadv$eol"; }
}
At the end of the section starting with “For the CPP tokens”, add
if ($cam_oslo eq 'aerlife'){
$usr_cppdefs .= ' -DAERLIFE -DDIRIND';
}
The two chosen cppdefs options make sure that all code under “#ifdef AERLIFE” and “#ifdef DIRIND” is compiled, so that both the CAM5-Oslo aerosol life cycle and its direct and indirect effects on climate are taken into account.
~/noresm/models/atm/cam/bld/config_files/definition.xml
Under “<config_definition>”, add
<entry id="cam_oslo" value=""> Options for building cam-oslo </entry>
~/noresm/scripts/ccsm_utils/Case.template/config_compsets.xml
Under “”, add
<COMPSET sname="F_AMIP_CAM5-OSLO" alias="FAMIPOSLO" >AMIP_CAM5%OSLO_CLM40%SP_CICE%PRES_DOCN%DOM_RTM_SGLC_SWAV</COMPSET>
Setting up a case with the new compset and building the model
It should now be possible to create a new case directory, which we here name FAMIPOSLOtst and configure with 1 degree horizontal atmospheric resolution;
./create_newcase -case ../cases/FAMIPOSLOtst -compset FAMIPOSLO -mach hexagon -res f09_f09
and finally set up and compile the model:
cd ../cases/FAMIPOSLOtst ./cesm_setup ./FAMIPOSLOtst.build