Skip to content

Commit

Permalink
updates to be consistent with 2_1 release updates
Browse files Browse the repository at this point in the history
  • Loading branch information
mvertens committed Nov 20, 2023
1 parent 42189f9 commit 3f94fb4
Show file tree
Hide file tree
Showing 7 changed files with 954 additions and 3,270 deletions.
3 changes: 1 addition & 2 deletions Externals_CAM.cfg
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[oslo_aero]
local_path = src/chemistry/oslo_aero
protocol = git
repo_url = https://github.com/NorESMhub/OSLO_AERO.git
repo_url = https://github.com/mvertens/OSLO_AERO.git
branch = feature/oslo_aero_integrate_release
required = True

Expand All @@ -14,4 +14,3 @@ required = True

[externals_description]
schema_version = 1.0.0

13 changes: 8 additions & 5 deletions bld/config_files/definition.xml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ Ionosphere model used in WACCMX.
<entry id="phys" valid_values="cam3,cam4,cam5,cam6,held_suarez,adiabatic,kessler,tj2016,spcam_sam1mom,spcam_m2005" value="">
Physics package: cam3, cam4, cam5, cam6, held_suarez, adiabatic, kessler, tj2016, spcam_sam1mom, spcam_m2005.
</entry>
<entry id="camnor" valid_values="0,1" value="0">
Option to turn on NorESM modifications to baseline CESM/CAM physics and dynamics
</entry>
<entry id="microphys" valid_values="rk,mg1,mg2,spcam_m2005,spcam_sam1mom,none" value="">
Microphysics package: rk (Rasch and Kristjansson), mg1 and mg2 (Morrison and Gettelman),
SPCAM_m2005, SPCAM_sam1mom.
Expand All @@ -77,15 +80,15 @@ PBL package: uw (University of Washington), hb (Holtslag and Boville), hbr
(Holtslag, Boville, and Rasch), clubb_sgs, spcam_sam1om, spcam_m2005, none.
</entry>
<entry id="rad" valid_values="rrtmg,camrt,none" value="">
Radiative transfer calculation:
Radiative transfer calculation:
camrt (CAM3 and CAM4 RT package), rrtmg (RRTMG package from AER).
</entry>
<entry id="carma" valid_values="none,bc_strat,cirrus,cirrus_dust,dust,meteor_impact,meteor_smoke,mixed_sulfate,pmc,pmc_sulfate,sea_salt,sulfate,tholin,test_detrain,test_growth,test_passive,test_radiative,test_swelling,test_tracers,test_tracers2" value="none">
CARMA sectional microphysics:
CARMA sectional microphysics:
none (disabled), bc_strat (Stratospheric Black Carbon), cirrus (Cirrus Clouds),
cirrus_dust (Cirrus Clouds with dust), dust (Dust), meteor_impact (Meteor Impact),
cirrus_dust (Cirrus Clouds with dust), dust (Dust), meteor_impact (Meteor Impact),
meteor_smoke (Meteor Smoke), mixed_sulfate (Meteor Smoke and Sulfate), pmc (Polar Mesospheric Clouds), pmc_sulfate (PMC and Sulfate), sea_salt (Sea Salt),
sulfate (Sulfate Aerosols), tholin (early earth haze), test_detrain (Detrainment), test_growth (Particle Growth), test_passive (Passive Dust),
sulfate (Sulfate Aerosols), tholin (early earth haze), test_detrain (Detrainment), test_growth (Particle Growth), test_passive (Passive Dust),
test_radiative (Radiatively Active Dust), test_swelling (Sea Salt), test_tracers (Asian Monsoon), test_tracers2 (Guam).
</entry>
<entry id="chem" valid_values="trop_mam3,trop_mam4,trop_mam7,trop_mozart,trop_strat_mam4_vbs,trop_strat_mam4_vbsext,waccm_ma,waccm_mad,waccm_mad_mam4,waccm_ma_mam4,waccm_ma_sulfur,waccm_sc,waccm_sc_mam4,waccm_tsmlt_mam4,terminator,trop_mam_oslo,none" value="">
Expand Down Expand Up @@ -304,7 +307,7 @@ SPCAM number of grid points in z
<entry id="spcam_dx" value="1">
SPCAM horizontal grid spacing, m
</entry>
<entry id="spcam_dt" value="1">
<entry id="spcam_dt" value="1">
SPCAM time step, s
</entry>

Expand Down
74 changes: 45 additions & 29 deletions bld/configure
Original file line number Diff line number Diff line change
Expand Up @@ -114,17 +114,19 @@ OPTIONS
-analytic_ic Enables the (namelist controlled) dycore testing infrastructure
-aquaplanet Switch on aqua-planet mode.
-build_chem_proc Switch forces the build of the chemistry preprocessor (primarily for testing).
-camnor Build CAM with CAM-Nor modifications
-carma <name> Build CAM with specified CARMA microphysics model
[ none | bc_strat | cirrus | cirrus_dust | dust | meteor_impact |
meteor_smoke | mixed_sulfate | pmc | pmc_sulfate | sea_salt | sulfate | tholin |
test_detrain | test_growth | test_passive | test_radiative | test_swelling |
test_tracers, test_tracers2].
Default: none.
-chem <name> Build CAM with specified prognostic chemistry package
[ trop_mam3 | trop_mam4 | trop_mam7 | trop_mozart | trop_strat_mam4_vbs | trop_strat_mam4_vbsext |
waccm_ma | waccm_mad | waccm_mad_mam4 | waccm_ma_mam4 |
waccm_ma_sulfur | waccm_sc | waccm_sc_mam4 | waccm_tsmlt_mam4 |
[ trop_mam3 | trop_mam4 | trop_mam7 | trop_mozart | trop_strat_mam4_vbs | trop_strat_mam4_vbsext |
waccm_ma | waccm_mad | waccm_mad_mam4 | waccm_ma_mam4 |
waccm_ma_sulfur | waccm_sc | waccm_sc_mam4 | waccm_tsmlt_mam4 |
terminator | trop_mam_oslo | none ].
Default: trop_mam_oslo when -camnor is specified
Default: trop_mam4 for cam6 and trop_mam3 for cam5.
-[no]clubb_sgs Switch on [off] CLUBB_SGS. Default: on for cam6, otherwise off.
-clubb_opts <list> Comma separated list of CLUBB options to turn on/off. By default they are all off.
Expand Down Expand Up @@ -299,6 +301,7 @@ GetOptions(
"cam_exe=s" => \$opts{'cam_exe'},
"cam_exedir=s" => \$opts{'cam_exedir'},
"camiop" => \$opts{'camiop'},
"camnor!" => \$opts{'camnor'},
"cc=s" => \$opts{'cc'},
"ccsm_seq" => \$opts{'ccsm_seq'},
"cflags=s" => \$opts{'cflags'},
Expand Down Expand Up @@ -612,11 +615,26 @@ if (defined $opts{'phys'}) {
$phys_pkg = lc($opts{'phys'});
}

# Special configuration for CAM-Nor options
# Currently, each CAM-Nor selection only works with the CAM6
# ESCOMP/CAM physics suites
my $camnor = 0;
# user or compset override is only way to turn on this feature
if (defined $opts{'camnor'}) {
$camnor = $opts{'camnor'};
}

# Add to the config object.
$cfg_ref->set('phys', $phys_pkg);
$cfg_ref->set('camnor', $camnor);

if ($print>=2) { print "Physics package: $phys_pkg$eol"; }

if ($print>=2) {
if ($camnor) {
print "Physics package: $phys_pkg with CAM-Nor modifications$eol";
} else {
print "Physics package: $phys_pkg$eol";
}
}

# Set flag to indicate a simple physics option
my $simple_phys = 0;
Expand All @@ -633,6 +651,9 @@ my $chem_pkg = 'trop_mam4';
if ($simple_phys or $phys_pkg =~ m/^cam[34]$/ or $phys_pkg eq 'spcam_sam1mom') {
$chem_pkg = 'none';
}
elsif ($camnor) {
$chem_pkg = 'trop_mam_oslo';
}
elsif ($phys_pkg eq 'cam5' or $phys_pkg eq 'spcam_m2005') {
$chem_pkg = 'trop_mam3';
}
Expand Down Expand Up @@ -1416,8 +1437,8 @@ if ($chem_pkg =~ '_mam3') {
}

if ($chem_pkg =~ '_oslo') {
$chem_cppdefs = ' -DOSLO_AERO -DAEROCOM'
#$chem_cppdefs = ' -DOSLO_AERO'
#$chem_cppdefs = ' -DOSLO_AERO -DAEROCOM'
$chem_cppdefs = ' -DOSLO_AERO'
}

# CARMA sectional microphysics
Expand Down Expand Up @@ -1921,7 +1942,7 @@ if ($cfg_ref->get('analytic_ic')) {

#WACCM-X extended thermosphere/ionosphere model
if ($waccmx) {
$cfg_cppdefs .= ' -DWACCMX_PHYS';
$cfg_cppdefs .= ' -DWACCMX_PHYS';
if (($dyn_pkg ne 'fv') and ($ionos ne 'none')) {
die "ERROR: Ionosphere is only available for FV dycore \n";
}
Expand Down Expand Up @@ -2732,6 +2753,7 @@ sub write_filepath
my $ocn = $cfg_ref->get('ocn');
my $offline_drv = $cfg_ref->get('offline_drv');
my $inic_val = $cfg_ref->get('analytic_ic');
my $camnor = $cfg_ref->get('camnor');

# Root directory
my $camsrcdir = "$cam_root/components";
Expand All @@ -2748,24 +2770,17 @@ sub write_filepath
}
}

# CESM has a standard source mods location.
# Standard source mods location.
if ($ccsm_seq) {
my $CASEROOT = "$ENV{'CASEROOT'}";
print $fh "$CASEROOT/SourceMods/src.cam\n";
}

# NorESM-specific:
# Any files in "NorESM"-folder go before the original CAM-files
# These files MUST give back standard CAM5.3 if a standard CAM5.3 compset is chosen
# Un-commenting this line will give back standard CAM 5.3 (unmodified).
# This is used for testing.
#++djlo (should be switched off when pure NCAR version is desired)
print $fh "$camsrcdir/cam/src/NorESM\n";
print $fh "$camsrcdir/cam/src/NorESM/$dyn\n";
#--djlo

if ($chem =~/_oslo/) {
print $fh "$camsrcdir/cam/src/chemistry/oslo_aero/src_cam\n";
# CAM-Nor has precedence over everything except SourceMods
# Only active in NF or NB compsets
if ($camnor) {
print $fh "$camsrcdir/cam/src/NorESM\n";
print $fh "$camsrcdir/cam/src/NorESM/$dyn\n";
}

# offline unit driver (defaults to stub)
Expand Down Expand Up @@ -2793,14 +2808,15 @@ sub write_filepath
print $fh "$chem_src_dir\n";
}
if ($chem =~/_oslo/) {
print $fh "$camsrcdir/cam/src/chemistry/oslo_aero/src\n";
}
else{
if ($chem =~ /_mam/) {
print $fh "$camsrcdir/cam/src/chemistry/modal_aero\n";
} else {
print $fh "$camsrcdir/cam/src/chemistry/bulk_aero\n";
}
# print $fh "$camsrcdir/src/chemistry/oslo_aero/object\n"; BUG: this does not compile
print $fh "$camsrcdir/cam/src/chemistry/oslo_aero/src\n";
print $fh "$camsrcdir/cam/src/chemistry/oslo_aero/src_cam\n";
} else {
if ($chem =~ /_mam/) {
print $fh "$camsrcdir/cam/src/chemistry/modal_aero\n";
} else {
print $fh "$camsrcdir/cam/src/chemistry/bulk_aero\n";
}
}
print $fh "$camsrcdir/cam/src/chemistry/aerosol\n";

Expand Down
Loading

0 comments on commit 3f94fb4

Please sign in to comment.