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

update noresm_develop to noresm2_3_develop changes for oslo_aero #128

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
4 changes: 2 additions & 2 deletions Externals_CAM.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,14 @@ required = True

[camnor_phys]
protocol = git
tag = camnor_noresm_v0.0.5
branch = noresm
repo_url = https://github.com/NorESMhub/CAM-Nor-physics
local_path = src/physics/camnor_phys
required = True

[oslo_aero]
protocol = git
tag = noresm_oslo_aero_v0
branch = noresm_develop
repo_url = https://github.com/NorESMhub/OSLO_AERO
local_path = src/chemistry/oslo_aero
required = True
Expand Down
3 changes: 3 additions & 0 deletions bld/config_files/definition.xml
Original file line number Diff line number Diff line change
Expand Up @@ -325,5 +325,8 @@ SPCAM horizontal grid spacing, m
<entry id="spcam_dt" value="1">
SPCAM time step, s
</entry>
<entry id="aerocom" valid_values="0,1" value="0">
Turns on aerocom
</entry>

</config_definition>
47 changes: 30 additions & 17 deletions bld/configure
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ OPTIONS
Options used to determine the CAM model configuration. These options will have an
effect whether running CAM from CESM scripts or running via CAM standalone scripts:
-aerocom Enable AEROCOM cpp-def for OSLO_AERO
-[no]age_of_air_trcs Switch on [off] age of air tracers. Default: on for waccm_phys, otherwise off.
-analytic_ic Enables the (namelist controlled) dycore testing infrastructure
-aquaplanet Switch on aqua-planet mode.
Expand Down Expand Up @@ -232,6 +233,7 @@ my %opts = (
cache => "config_cache.xml",
);
GetOptions(
"aerocom!" => \$opts{'aerocom'},
"age_of_air_trcs!" => \$opts{'age_of_air_trcs'},
"analytic_ic" => \$opts{'analytic_ic'},
"aquaplanet" => \$opts{'aquaplanet'},
Expand Down Expand Up @@ -1940,6 +1942,14 @@ if ($silhs == 1) {
# Simple Models
if ($simple_phys) { $cfg_cppdefs .= ' -DSIMPLE'; }

# Turn on aerocom
my $aerocom_opt = (defined $opts{'aerocom'}) ? 1 : 0;
$cfg_ref->set('aerocom', $aerocom_opt);
my $aerocom = $cfg_ref->get('aerocom');
if ($aerocom eq 1) {
$cfg_cppdefs .= ' -DAEROCOM';
}

# UNICON
if ($unicon) { $cfg_cppdefs .= ' -DUSE_UNICON'; }

Expand Down Expand Up @@ -2087,8 +2097,17 @@ sub write_filepath
my $CASEROOT = "$ENV{'CASEROOT'}";
print $fh "$CASEROOT/SourceMods/src.cam\n";

# CAM-Nor has precedence over everything except SourceMods
# Only active in NF or NB compsets
# CAM chemistry for oslo-aero must be at the top of Filepath since it
# needs to take precedence over everything. This is because several shadow files
# for oslo_aero routines are now in camnor_physics and contain stub interfaces
# needed for use statements. These replace the previous use of #ifdef OSLO_AERO queries.
if ($chem =~/_oslo/) {
print $fh "$camsrcdir/src/chemistry/oslo_aero/src\n";
print $fh "$camsrcdir/src/chemistry/oslo_aero/src_cam\n";
}

# CAM-Nor-physics has precedence over everything except SourceMods and oslo-aero
# Only active in NF or NB compsets
if ($camnor) {
if ($phys_pkg eq 'cam_dev') {
print $fh "$camsrcdir/src/physics/camnor_phys/physics\n";
Expand All @@ -2102,10 +2121,6 @@ sub write_filepath
}
}

if ($chem =~/_oslo/) {
print $fh "$camsrcdir/src/chemistry/oslo_aero/src_cam\n";
}

# offline unit driver (defaults to stub)
print $fh "$camsrcdir/src/unit_drivers\n";
print $fh "$camsrcdir/src/unit_drivers/${offline_drv}\n";
Expand Down Expand Up @@ -2142,14 +2157,12 @@ sub write_filepath
if ($chem_src_dir) {
print $fh "$chem_src_dir\n";
}
if ($chem =~/_oslo/) {
# print $fh "$camsrcdir/src/chemistry/oslo_aero/object\n"; BUG: this does not compile
print $fh "$camsrcdir/src/chemistry/oslo_aero/src\n";
print $fh "$camsrcdir/src/chemistry/oslo_aero/cam_intr\n";
} elsif ($chem =~ /_mam/) {
print $fh "$camsrcdir/src/chemistry/modal_aero\n";
} else {
print $fh "$camsrcdir/src/chemistry/bulk_aero\n";
if ($chem !~/_oslo/) {
if ($chem =~ /_mam/) {
print $fh "$camsrcdir/src/chemistry/modal_aero\n";
} else {
print $fh "$camsrcdir/src/chemistry/bulk_aero\n";
}
}
print $fh "$camsrcdir/src/chemistry/aerosol\n";

Expand All @@ -2161,9 +2174,9 @@ sub write_filepath
}
if ($waccm_phys) {
print $fh "$camsrcdir/src/physics/waccm\n";
print $fh "$camsrcdir/src/physics/ali_arms\n";
print $fh "$camsrcdir/src/physics/ali_arms/subs\n";
print $fh "$camsrcdir/src/physics/ali_arms/include\n";
print $fh "$camsrcdir/src/physics/ali_arms\n";
print $fh "$camsrcdir/src/physics/ali_arms/subs\n";
print $fh "$camsrcdir/src/physics/ali_arms/include\n";
}
print $fh "$camsrcdir/src/ionosphere\n";

Expand Down
3 changes: 1 addition & 2 deletions bld/namelist_files/use_cases/1850_cam_lt.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,11 @@
<prescribed_strataero_use_chemtrop> .true. </prescribed_strataero_use_chemtrop>
<prescribed_strataero_type> 'CYCLICAL' </prescribed_strataero_type>


<!-- Prescribed oxidants for aerosol chemistry : -->
<tracer_cnst_cycle_yr > 1850 </tracer_cnst_cycle_yr>
<tracer_cnst_datapath > 'atm/cam/tracer_cnst' </tracer_cnst_datapath>
<tracer_cnst_file > 'tracer_cnst_WACCM6_halons_3DmonthlyL70_1850climoCMIP6piControl001_y21-50avg_c180802.nc' </tracer_cnst_file>
<tracer_cnst_specifier> 'O3','OH','NO3','HO2','HALONS' </tracer_cnst_specifier>
<tracer_cnst_specifier> 'O3','OH','NO3','HO2' </tracer_cnst_specifier>
<tracer_cnst_type > 'CYCLICAL' </tracer_cnst_type>
<tracer_cnst_filelist > '' </tracer_cnst_filelist>

Expand Down
81 changes: 81 additions & 0 deletions bld/namelist_files/use_cases/1850_cam_lt_noresm.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
<?xml version="1.0"?>
<namelist_defaults>

<!-- Solar data from NRL -->
<solar_irrad_data_file>'atm/cam/solar/SolarForcingCMIP6piControl_c160921.nc'</solar_irrad_data_file>
<solar_data_ymd>18500101</solar_data_ymd>
<solar_data_type>FIXED</solar_data_type>

<!-- LBC Files : -->
<flbc_file>atm/waccm/lb/LBC_17500116-20150116_CMIP6_0p5degLat_c180905.nc</flbc_file>
<flbc_cycle_yr>1850</flbc_cycle_yr>
<flbc_type>'CYCLICAL'</flbc_type>
<flbc_list>'CO2','CH4','N2O','CFC11','CFC12','CFC11eq'</flbc_list>

<!-- Low top upper boundary conditions -->
<ubc_specifier>'Q:H2O->UBC_FILE'</ubc_specifier>
<ubc_file_path>atm/cam/chem/ubc/b.e21.BWHIST.f09_g17.CMIP6-historical-WACCM.ensAvg123.cam.h0zm.H2O.185001-201412_c230509cdf5.nc</ubc_file_path>
<ubc_file_input_type>CYCLICAL</ubc_file_input_type>
<ubc_file_cycle_yr>1850</ubc_file_cycle_yr>

<!-- ozone data -->
<prescribed_ozone_datapath>'atm/cam/ozone_strataero'</prescribed_ozone_datapath>
<prescribed_ozone_file>'ozone_strataero_cyclical_WACCM6_L70_CMIP6-piControl.001_y21-50avg_zm_5day_c180802.nc'</prescribed_ozone_file>
<prescribed_ozone_name>'O3'</prescribed_ozone_name>
<prescribed_ozone_type>'CYCLICAL'</prescribed_ozone_type>
<prescribed_ozone_cycle_yr>1850</prescribed_ozone_cycle_yr>

<!-- Prescribed oxidants for aerosol chemistry -->
<tracer_cnst_cycle_yr>1850</tracer_cnst_cycle_yr>
<tracer_cnst_datapath>'atm/cam/tracer_cnst'</tracer_cnst_datapath>
<tracer_cnst_file>'tracer_cnst_WACCM6_halons_3DmonthlyL70_1850climoCMIP6piControl001_y21-50avg_c180802.nc'</tracer_cnst_file>
<tracer_cnst_specifier>'O3','OH','NO3','HO2'</tracer_cnst_specifier>
<tracer_cnst_type>'CYCLICAL'</tracer_cnst_type>
<tracer_cnst_filelist>''</tracer_cnst_filelist>

<!-- External forcing for MAMOslo -->
<ext_frc_type>CYCLICAL</ext_frc_type>
<ext_frc_cycle_yr>1850</ext_frc_cycle_yr>
<ext_frc_specifier>
'H2O -> $INPUTDATA_ROOT/atm/cam/chem/emis/elev/H2O_emission_CH4_oxidationx2_elev_3DmonthlyL70_1850climoCMIP6piControl001_y21-50avg_c180802.nc',
'BC_AX -> $INPUTDATA_ROOT/atm/cam/chem/emis/cmip6_emissions_version20180512/emissions_cmip6_noresm2_BC_AX_airALL_vertical_1850_0.9x1.25_version20180512.nc',
'BC_AX -> $INPUTDATA_ROOT/atm/cam/chem/emis/cmip6_emissions_version20180512/emissions_cmip6_noresm2_BC_AX_anthroprofENEIND_vertical_1850_0.9x1.25_version20180512.nc',
'BC_N -> $INPUTDATA_ROOT/atm/cam/chem/emis/cmip6_emissions_version20180512/emissions_cmip6_noresm2_BC_N_airALL_vertical_1850_0.9x1.25_version20180512.nc',
'BC_N -> $INPUTDATA_ROOT/atm/cam/chem/emis/cmip6_emissions_version20180512/emissions_cmip6_noresm2_BC_N_anthroprofENEIND_vertical_1850_0.9x1.25_version20180512.nc',
'BC_NI -> $INPUTDATA_ROOT/atm/cam/chem/emis/cmip6_emissions_version20180512/emissions_cmip6_noresm2_BC_NI_bbAGRIBORFDEFOPEATSAVATEMF_vertical_1850_0.9x1.25_version20180512.nc',
'OM_NI -> $INPUTDATA_ROOT/atm/cam/chem/emis/cmip6_emissions_version20180512/emissions_cmip6_noresm2_OM_NI_airALL_vertical_1850_0.9x1.25_version20180512.nc',
'OM_NI -> $INPUTDATA_ROOT/atm/cam/chem/emis/cmip6_emissions_version20180512/emissions_cmip6_noresm2_OM_NI_anthroprofENEIND_vertical_1850_0.9x1.25_version20180512.nc',
'OM_NI -> $INPUTDATA_ROOT/atm/cam/chem/emis/cmip6_emissions_version20180512/emissions_cmip6_noresm2_OM_NI_bbAGRIBORFDEFOPEATSAVATEMF_vertical_1850_0.9x1.25_version20180512.nc',
'SO2 -> $INPUTDATA_ROOT/atm/cam/chem/emis/cmip6_emissions_version20180512/emissions_cmip6_noresm2_SO2_airALL_vertical_1850_0.9x1.25_version20180512.nc',
'SO2 -> $INPUTDATA_ROOT/atm/cam/chem/emis/cmip6_emissions_version20180512/emissions_cmip6_noresm2_SO2_anthroprofENEIND_vertical_1850_0.9x1.25_version20180512.nc',
'SO2 -> $INPUTDATA_ROOT/atm/cam/chem/emis/cmip6_emissions_version20180512/emissions_cmip6_noresm2_SO2_bbAGRIBORFDEFOPEATSAVATEMF_vertical_1850_0.9x1.25_version20180512.nc',
'SO2 -> $INPUTDATA_ROOT/atm/cam/chem/emis/cmip6_emissions_version20180512/emissions_cmip6_noresm2_SO2_volcCONTEXPL_vertical_1850_0.9x1.25_version20180512.nc',
'SO4_PR -> $INPUTDATA_ROOT/atm/cam/chem/emis/cmip6_emissions_version20180512/emissions_cmip6_noresm2_SO4_PR_airALL_vertical_1850_0.9x1.25_version20180512.nc',
'SO4_PR -> $INPUTDATA_ROOT/atm/cam/chem/emis/cmip6_emissions_version20180512/emissions_cmip6_noresm2_SO4_PR_anthroprofENEIND_vertical_1850_0.9x1.25_version20180512.nc',
'SO4_PR -> $INPUTDATA_ROOT/atm/cam/chem/emis/cmip6_emissions_version20180512/emissions_cmip6_noresm2_SO4_PR_bbAGRIBORFDEFOPEATSAVATEMF_vertical_1850_0.9x1.25_version20180512.nc',
'SO4_PR -> $INPUTDATA_ROOT/atm/cam/chem/emis/cmip6_emissions_version20180512/emissions_cmip6_noresm2_SO4_PR_volcCONTEXPL_vertical_1850_0.9x1.25_version20180512.nc'
</ext_frc_specifier>

<!-- surface emissions for MAMoslo-->
<srf_emis_type>CYCLICAL</srf_emis_type>
<srf_emis_cycle_yr>1850</srf_emis_cycle_yr>
<srf_emis_specifier>
'BC_AX -> $INPUTDATA_ROOT/atm/cam/chem/emis/cmip6_emissions_version20180512/emissions_cmip6_noresm2_BC_AX_anthrosurfAGRTRADOMSOLWSTSHP_surface_1850_0.9x1.25_version20180512.nc',
'BC_N -> $INPUTDATA_ROOT/atm/cam/chem/emis/cmip6_emissions_version20180512/emissions_cmip6_noresm2_BC_N_anthrosurfAGRTRADOMSOLWSTSHP_surface_1850_0.9x1.25_version20180512.nc',
'OM_NI -> $INPUTDATA_ROOT/atm/cam/chem/emis/cmip6_emissions_version20180512/emissions_cmip6_noresm2_OM_NI_anthrosurfAGRTRADOMSOLWSTSHP_surface_1850_0.9x1.25_version20180512.nc',
'SO2 -> $INPUTDATA_ROOT/atm/cam/chem/emis/cmip6_emissions_version20180512/emissions_cmip6_noresm2_SO2_anthrosurfAGRTRADOMSOLWSTSHP_surface_1850_0.9x1.25_version20180512.nc',
'SO4_PR -> $INPUTDATA_ROOT/atm/cam/chem/emis/cmip6_emissions_version20180512/emissions_cmip6_noresm2_SO4_PR_anthrosurfAGRTRADOMSOLWSTSHP_surface_1850_0.9x1.25_version20180512.nc'
</srf_emis_specifier>

<rad_climate>'A:Q:H2O','N:O2:O2','N:CO2:CO2','N:ozone:O3','N:N2O:N2O','N:CH4:CH4','N:CFC11:CFC11','N:CFC12:CFC12'</rad_climate>

<!--diagnostics-->
<do_circulation_diags>.true.</do_circulation_diags>

<!--phys_ctl_nl-->
<dme_energy_adjust>.true.</dme_energy_adjust>

<!--Options for megan -->
<megan_specifier>'isoprene = isoprene','monoterp = myrcene + sabinene + limonene+ carene_3 + ocimene_t_b + pinene_b + pinene_a'</megan_specifier>

</namelist_defaults>
5 changes: 5 additions & 0 deletions cime_config/buildcpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ def buildcpp(case):
nthrds_atm = case.get_value("NTHRDS_ATM")
cam_config_opts = case.get_value("CAM_CONFIG_OPTS")
comp_interface=case.get_value("COMP_INTERFACE")
cam_aerocom = case.get_value("CAM_AEROCOM")

# level information for CAM is part of the atm grid name - and must be stripped out
nlev = ''
Expand Down Expand Up @@ -123,6 +124,10 @@ def buildcpp(case):
if "-cosp" in config_opts:
config_opts += ["-cosp_libdir", os.path.join(exeroot, "atm", "obj", "cosp")]

print(f"cam_aerocom is {cam_aerocom}")
if cam_aerocom:
config_opts += [" -aerocom"]

if cam_dycore == 'mpas':
config_opts += ["-mpas_libdir", os.path.join(exeroot, "atm", "obj", "mpas")]

Expand Down
14 changes: 11 additions & 3 deletions cime_config/config_component.xml
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,14 @@
<desc>CAM dynamical core</desc>
</entry>

<entry id="CAM_AEROCOM">
<type>logical</type>
<default_value>FALSE</default_value>
<group>build_component_cam</group>
<file>env_build.xml</file>
<desc>If true, turn on aerocom diagnostics for oslo-aerosol package</desc>
</entry>

<entry id="CAM_CONFIG_OPTS">
<type>char</type>
<valid_values></valid_values>
Expand Down Expand Up @@ -226,6 +234,7 @@
<value compset="1850_CAM60%WCSC" >waccm_sc_1850_cam6</value>
<value compset="1850_CAM%DEV%LT" >1850_cam_lt</value>
<value compset="1850_CAM%DEV%MT" >1850_cam_mt</value>
<value compset="1850_CAM%DEV%LT%NORESM%CAMoslo">1850_cam_lt_noresm</value>

<value compset="2000_CAM40%TMOZ" >2000_cam4_trop_chem</value>
<value compset="2000_CAM40%WXIE" >waccmxie_ma_2000_cam4</value>
Expand All @@ -240,9 +249,9 @@
<value compset="2000_CAM60%WXIE" >waccmx_ma_2000_cam6</value>

<value compset="2000_CAM%DEV%NORESM%TROPMAM4">2000_cam6</value>
<value compset="2000_CAM%DEV%LT%NORESM%TROPMAM4">2000_cam6</value>

<value compset="2000_CAM%DEV%NORESM%CAMoslo">2000_cam6_noresm</value>

<value compset="2000_CAM%DEV%LT%NORESM%TROPMAM4">2000_cam6</value>
<value compset="2000_CAM%DEV%LT%NORESM%CAMoslo">2000_cam6_noresm</value>

<value compset="2000_CAM30_SLND_SICE_DOCN%AQP" >aquaplanet_cam3</value>
Expand Down Expand Up @@ -270,7 +279,6 @@
<value compset="HIST_CAM60" >hist_cam6</value>
<value compset="HIST_CAM%DEV%LT" >hist_cam_lt</value>
<value compset="HIST_CAM%DEV%MT" >hist_cam_mt</value>

<value compset="HIST_CAM%DEV%LT%NORESM%CAMoslo">hist_cam6_noresm</value>

<value compset="HIST_CAM60%WCTS" >waccm_tsmlt_hist_cam6</value>
Expand Down
51 changes: 12 additions & 39 deletions cime_config/config_compsets.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,18 +32,19 @@
- lname
- alias
- support (optional description of the support level for this compset)

Each compset node can also have the following attributes
- grid (optional regular expression match for grid to work with the compset)
</help>


<!-- NOTE: the NorESM physics does not work with cam60 - so must use camdev if noresm physics is used -->

<!-- ******************************** -->
<!-- CAM-Nor compsets -->
<!-- ******************************** -->

<compset>
<alias>NF2000dev</alias>
<lname>2000_CAM%DEV%LT%NORESM_CLM50%SP_CICE%PRES_DOCN%DOM_MOSART_SGLC_SWAV</lname>
</compset>
<!-- CAMDEV -->
<compset>
<alias>NF2000oslo</alias>
<lname>2000_CAM%DEV%LT%NORESM%CAMoslo_CLM50%SP_CICE%PRES_DOCN%DOM_MOSART_SGLC_SWAV</lname>
Expand All @@ -54,53 +55,25 @@
</compset>

<compset>
<alias>NF2000devL32</alias>
<lname>2000_CAM%DEV%NORESM_CLM50%SP_CICE%PRES_DOCN%DOM_MOSART_SGLC_SWAV</lname>
</compset>
<compset>
<alias>NF2000osloL32</alias>
<lname>2000_CAM%DEV%NORESM%CAMoslo_CLM50%SP_CICE%PRES_DOCN%DOM_MOSART_SGLC_SWAV</lname>
</compset>
<compset>
<alias>NF2000tropmam4l32</alias>
<lname>2000_CAM%DEV%NORESM%TROPMAM4_CLM50%SP_CICE%PRES_DOCN%DOM_MOSART_SGLC_SWAV</lname>
</compset>

<compset>
<alias>NF2000climo</alias>
<lname>2000_CAM60%NORESM_CLM50%SP_CICE%PRES_DOCN%DOM_MOSART_SGLC_SWAV</lname>
</compset>

<compset>
<alias>NF1850</alias>
<lname>1850_CAM60%NORESM_CLM51%FATES-SP_CICE%PRES_DOCN%DOM_MOSART_SGLC_SWAV</lname>
<alias>NF1850oslo</alias>
<lname>1850_CAM%DEV%LT%NORESM%CAMoslo_CLM51%SP_CICE%PRES_DOCN%DOM_MOSART_SGLC_SWAV</lname>
</compset>
<compset>
<alias>NF1850oslo</alias>
<lname>1850_CAM60%NORESM%CAMoslo_CLM51%FATES-SP_CICE%PRES_DOCN%DOM_MOSART_SGLC_SWAV</lname>
<alias>NF1850tropmam4</alias>
<lname>1850_CAM%DEV%LT%NORESM%TROPMAM4_CLM51%SP_CICE%PRES_DOCN%DOM_MOSART_SGLC_SWAV</lname>
</compset>

<compset>
<alias>NFLTHIST_v0d</alias>
<alias>NFLTHISTghgmam4_v0d</alias>
<lname>HIST_CAM%DEV%LT%NORESM%GHGMAM4_CLM51%SP_CICE%PRES_DOCN%DOM_MOSART_SGLC_SWAV</lname>
</compset>
<compset>
<alias>NFLTHISToslo_v0d</alias>
<lname>HIST_CAM%DEV%LT%NORESM%CAMoslo_CLM51%SP_CICE%PRES_DOCN%DOM_MOSART_SGLC_SWAV</lname>
</compset>

<compset>
<alias>NQPC6</alias>
<lname>2000_CAM60%NORESM_SLND_SICE_DOCN%AQP3_SROF_SGLC_SWAV</lname>
</compset>

<compset>
<alias>NQPC2000climo</alias>
<lname>2000_CAM60%NORESM%CCTS1_SLND_SICE_DOCN%AQP3_SROF_SGLC_SWAV</lname>
</compset>

<!-- ******************************** -->
<!-- CAM "science supported" compsets -->
<!-- CAM compsets -->
<!-- ******************************** -->

<compset>
Expand Down Expand Up @@ -458,7 +431,7 @@
</compset>

<!-- ****************************** -->
<!-- WACCM science supported compsets -->
<!-- WACCM compsets -->
<!-- ****************************** -->

<compset>
Expand Down
Loading