Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement CLUBB and MG2 #328

Merged
merged 4 commits into from
Oct 27, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 43 additions & 5 deletions models/atm/cam/bld/build-namelist
Original file line number Diff line number Diff line change
Expand Up @@ -2462,10 +2462,16 @@ add_default($nl, 'srf_flux_avg', 'eddy_scheme'=>$eddy_scheme);
# Microphysics scheme
add_default($nl, 'use_subcol_microp');
add_default($nl, 'microp_scheme');
add_default($nl, 'micro_do_icesupersat');
add_default($nl, 'macrop_scheme');
if ($cfg->get('microphys') =~ /^mg/) {
add_default($nl, 'micro_mg_version');
add_default($nl, 'micro_mg_sub_version');
add_default($nl, 'micro_mg_num_steps');
add_default($nl, 'nucleate_ice_subgrid');
add_default($nl, 'cld_macmic_num_steps');
add_default($nl, 'micro_mg_precip_frac_method');
add_default($nl, 'micro_mg_berg_eff_factor');
}
add_default($nl, 'micro_mg_dcs');

Expand Down Expand Up @@ -2512,11 +2518,34 @@ else {

# CLUBB_SGS
add_default($nl, 'do_clubb_sgs');
add_default($nl, 'clubb_history');
add_default($nl, 'clubb_rad_history');
my $clubb_sgs = $nl->get_value('do_clubb_sgs');
if ($clubb_sgs =~ /$TRUE/io) {
my $clubb_do_adv = $cfg->get('clubb_do_adv');
if($clubb_do_adv == '1') {
add_default($nl, 'clubb_do_adv', 'val'=>'.true.');
}
my $clubb_do_deep = $cfg->get('clubb_do_deep');
if($clubb_do_deep == '1') {
add_default($nl, 'clubb_do_deep', 'val'=>'.true.');
}
add_default($nl, 'clubb_history');
add_default($nl, 'clubb_rad_history');

# Check compatibility of clubb_do_deep (if set) with deep_scheme
my $clubb_do_deep = $nl->get_value('clubb_do_deep');
if (defined $clubb_do_deep) {
my $deep_scheme = $nl->get_value('deep_scheme');
if ($deep_scheme ne "'CLUBB_SGS'" && $clubb_do_deep == /$TRUE/io) {
die "$ProgName - ERROR: clubb_do_deep = .true. but incompatible deep_scheme=$deep_scheme and needs to be 'CLUBB_SGS'\n";
}
}

if ($nl->get_value('clubb_history') =~ "true" && $nl->get_value('atm_nthreads') != 1) {
die "$ProgName - ERROR: clubb_history = .true. with multiple threads is not supported. \n";
add_default($nl, 'clubb_expldiff');
add_default($nl, 'clubb_rainevap_turb');
add_default($nl, 'clubb_cloudtop_cooling');
add_default($nl, 'clubb_timestep');
add_default($nl, 'clubb_rnevap_effic');
add_default($nl, 'clubb_stabcorrect');
}

#in-cloud scav tuning for cloud-borne aerosol
Expand Down Expand Up @@ -2564,6 +2593,13 @@ add_default($nl, 'cldfrc_premit');
add_default($nl, 'cldfrc_premib');
add_default($nl, 'cldfrc_iceopt');
add_default($nl, 'cldfrc_icecrit');
add_default($nl, 'cldfrc2m_rhmini');
add_default($nl, 'cldfrc2m_rhmaxi');

my $cldfrc_rhminp = $nl->get_value('cldfrc_rhminp');
if ($cldfrc_rhminp and !($cfg->get('microphys') eq 'rk')) {
die "$ProgName - ERROR: cldfrc_rhminp is valid only for RK microphysics scheme\n";
}

# condensate to rain autoconversion coefficients
add_default($nl, 'zmconv_c0_lnd');
Expand Down Expand Up @@ -3000,7 +3036,8 @@ if ($cfg->get('dyn') =~ /se/) {
statefreq se_partmethod se_topology se_ftype
integration nu nu_div nu_p nu_q nu_top se_phys_tscale
interpolate_analysis interp_nlat interp_nlon vert_remap_q_alg
interp_type interp_gridtype se_limiter_option qsplit rsplit tstep_type);
interp_type interp_gridtype se_limiter_option qsplit rsplit tstep_type
hypervis_scaling mesh_file);

foreach my $var (@vars) {
add_default($nl, $var);
Expand All @@ -3015,6 +3052,7 @@ add_default($nl, 'history_aero_optics');
add_default($nl, 'history_budget');
add_default($nl, 'history_eddy');
add_default($nl, 'history_waccm');
add_default($nl, 'history_clubb');

# The history output for the AMWG variability diagnostics assumes that auxilliary history
# files h1, h2, and h3 contain daily, 6-hrly, and 3-hrly output respectively. If this output
Expand Down
13 changes: 11 additions & 2 deletions models/atm/cam/bld/config_files/definition.xml
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,24 @@ Option to turn on waccmx thermosphere/ionosphere extension: 0 => no, 1 => yes
<entry id="phys" valid_values="cam3,cam3_5_1,cam4,cam5,ideal,adiabatic" value="">
Physics package: cam3, cam4, cam5, ideal (Held-Suarez forcings), adiabatic.
</entry>
<entry id="microphys" valid_values="rk,mg1,mg1.5" value="">
Microphysics package: rk (Rasch and Kristjansson), mg1 (Morrison and Gettelman two moment scheme CAM5.1), mg1.5 (Morrison and Gettelman second version development).
<entry id="microphys" valid_values="rk,mg1,mg1.5,mg2" value="">
Microphysics package: rk (Rasch and Kristjansson), mg1 (Morrison and Gettelman two moment scheme CAM5.1), mg1.5 (Morrison and Gettelman second version development), mg2 ((Morrison and Gettelman second version).
</entry>
<entry id="macrophys" valid_values="rk,park,clubb_sgs,none" value="">
Macrophysics package: RK, Park, CLUBB_SGS.
</entry>
<entry id="clubb_sgs" valid_values="0,1" value="0">
Switch to turn on/off CLUBB_SGS package: 0 => no, 1 => yes
</entry>
<entry id="unicon" valid_values="0,1" value="0">
Switch to turn on UNICON package: 0 => off, 1 => on
</entry>
<entry id="clubb_do_deep" valid_values="0,1" value="0">
Switch to turn on/off CLUBB_SGS using clubb to calculate deep: 0 => no, 1 => yes
</entry>
<entry id="clubb_do_adv" valid_values="0,1" value="0">
Switch to turn on/off advecting CLUBB moments: 0 => no, 1 => yes
</entry>
<entry id="pbl" valid_values="uw,hb,hbr,clubb_sgs" value="">
PBL package: uw (University of Washington), hb (Holtslag and Boville), hbr
(Holtslag, Boville, and Rasch), clubb_sgs.
Expand Down
4 changes: 4 additions & 0 deletions models/atm/cam/bld/config_files/horiz_grid.xml
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,9 @@
<horiz_grid dyn="se" hgrid="ne60np4" ncol="194402" csne="60" csnp="4" />
<horiz_grid dyn="se" hgrid="ne120np4" ncol="777602" csne="120" csnp="4" />
<horiz_grid dyn="se" hgrid="ne240np4" ncol="3110402" csne="240" csnp="4" />
<horiz_grid dyn="se" hgrid="ne0np4_arm_x8v3_lowcon" ncol="92558" csne="0" csnp="4" />
<horiz_grid dyn="se" hgrid="ne0np4_conus_x4v1_lowcon" ncol="89147" csne="0" csnp="4" />
<horiz_grid dyn="se" hgrid="ne0np4_svalbard_x8v1_lowcon" ncol="71912" csne="0" csnp="4" />
<horiz_grid dyn="se" hgrid="ne0np4_sooberingoa_x4x8v1_lowcon" ncol="105707" csne="0" csnp="4" />

</config_horiz_grid>
39 changes: 37 additions & 2 deletions models/atm/cam/bld/configure
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,8 @@ OPTIONS
trop_mam3 | trop_mam7 | super_fast_llnl | super_fast_llnl_mam3 |
trop_strat_soa | trop_strat_mam3 | trop_strat_mam7 | none ]. Default: trop_mam3.
-clubb_sgs Turns on CLUBB_SGS
-clubb_opts <list> Comma separated list of CLUBB options to turn on/off. By default they are all off. Current
options are: clubb_do_adv(Advect CLUBB moments), clubb_do_deep(CLUBB does the deep convection)
-co2_cycle This option is meant to be used with the -ccsm_seq option. It modifies the
CAM configuration by increasing the number of advected constituents by 4.
-comp_intf Specify the component interfaces [mct | esmf] (default: mct).
Expand All @@ -136,7 +138,7 @@ OPTIONS
se grids.
-max_n_rad_cnst <n> Maximum number of constituents that are either radiatively
active, or in any single diagnostic list for the radiation.
-microphys <name> Specify the microphysics option [mg1 | mg1.5 | rk].
-microphys <name> Specify the microphysics option [mg1 | mg1.5 | mg2 | rk].
-nadv <n> Set total number of advected species to <n>.
-nadv_tt <n> Set number of advected test tracers <n>.
-nlev <n> Set number of levels to <n>.
Expand Down Expand Up @@ -856,6 +858,12 @@ if ($co2_cycle and $print>=2) { print "co2_cycle option: ON$eol"; }
# Micro-physics package
# The default for the current physics package is:
my $microphys_pkg = 'mg1';

#Set the default microphysics package for CLUBB to mg2
if (defined $opts{'clubb_sgs'}) {
$microphys_pkg = 'mg2';
}

# But if the physics package is adiabatic, ideal, cam3, cam4, change the default
if ($phys_pkg =~ m/^ideal$|^adiabatic$|^cam[34]$/) {
$microphys_pkg = 'rk';
Expand Down Expand Up @@ -916,6 +924,20 @@ if ($clubb_sgs and $microphys_pkg !~ m/^mg/) {
EOF
}

#-----------------------------------------------------------------------------------------------
# Break apart CLUBB options into separate fields

if (defined $opts{'clubb_opts'}) {
my @clubb_temp_opts = split /,/, $opts{'clubb_opts'};
foreach (@clubb_temp_opts) {
$cfg_ref->set("$_", '1');
}
}
my $clubb_do_deep = $cfg_ref->get('clubb_do_deep');
my $clubb_do_adv = $cfg_ref->get('clubb_do_adv');
if ($print>=2) { print "clubb_do_deep=',$clubb_do_deep,$eol"; }
if ($print>=2) { print "clubb_do_adv=',$clubb_do_adv,$eol"; }

#-----------------------------------------------------------------------------------------------
# Macro-physics package
# The default for the current physics package is:
Expand Down Expand Up @@ -1434,10 +1456,19 @@ else {
$nadv += 2;
if ($print>=2) { print "Advected constituents added by $microphys_pkg microphysics: 2$eol"; }
}
elsif ($microphys_pkg =~ /^mg/) {
elsif ($microphys_pkg =~ /^mg1/) {
$nadv += 4;
if ($print>=2) { print "Advected constituents added by $microphys_pkg microphysics: 4$eol"; }
}
elsif ($microphys_pkg =~/^mg2/) {
$nadv += 8;
if ($print>=2) { print "Advected constituents added by $microphys_pkg microphysics: 8$eol"; }
}

if ($clubb_do_adv) {
$nadv += 9;
if ($print>=2) { print "Advected constituents added by $microphys_pkg microphysics: 8$eol"; }
}

# co2_cycle
if ($co2_cycle) {
Expand Down Expand Up @@ -1960,6 +1991,10 @@ if ($clubb_sgs == 1) {
$cfg_cppdefs .= " -DCLUBB_REAL_TYPE=dp";
}

if ($clubb_do_deep == 1) {
$cfg_cppdefs .= ' -DCLUBBND_CAM';
}

#-----------------------------------------------------------------------------------------------
# External libraries ###########################################################################
#-----------------------------------------------------------------------------------------------
Expand Down
Loading