Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
f3cc48c
first pass at refactoring the nudging code
Oct 26, 2025
601ecd3
fixed compiler issues
mvertens Oct 27, 2025
99b98fa
more refactor of code
Oct 27, 2025
e48da5b
migrated atm_stream_nuding.F90 code into nudging.F90 and added atm_sh…
mvertens Oct 29, 2025
d9b8012
fixes to nudging for running
mvertens Oct 30, 2025
46c9114
refactor of co2_cycle and co2_data_flux to use cdeps streams
Oct 30, 2025
1f3d7d9
first pass at the validation
mvertens Nov 4, 2025
8a8c1fb
addressed issues in the PR
mvertens Nov 25, 2025
3c642b5
more updates
mvertens Nov 25, 2025
2fc0734
added aircraft emissions to this PR and also addressed more issues ra…
mvertens Nov 26, 2025
089444c
fixed compilation problem
mvertens Nov 26, 2025
ebd61ba
updates for default namelists
mvertens Nov 27, 2025
42f8e97
removed co2_readFlux_ocn
mvertens Dec 1, 2025
d4323c9
updates for namelist in aircraft_emit.F90 and removal of ocean read C…
mvertens Dec 3, 2025
ad01c91
cleanup of co2_data_flux.F90
mvertens Dec 3, 2025
e482086
co2_readflux_aircraft namelist in co2_cycle.F90 is now recognoized in…
mvertens Dec 6, 2025
1422b77
made tintalgo a namelist variable
mvertens Dec 8, 2025
0dae7b0
addressed issues in PR
mvertens Dec 8, 2025
f1e5eb6
more changes for PR comments
mvertens Dec 8, 2025
3bf4799
added documentation requested in PR
mvertens Dec 8, 2025
233d2d2
addressed more issues raised in the PR review
mvertens Dec 9, 2025
6a76e9b
Update src/control/cam_esmf_mod.F90
mvertens Dec 9, 2025
c1f4535
addressed more comments in PR
mvertens Dec 10, 2025
3109891
yet more changes to address PR comments
mvertens Dec 10, 2025
0ba5ec1
Addressed final PR comments and requests
Dec 10, 2025
9789e28
Try fixing clubb submodule hash
Dec 10, 2025
ed1ca6a
Merge remote-tracking branch 'NorESM/noresm_develop' into feature/ref…
Dec 11, 2025
678168e
Fix compiler errors
Dec 11, 2025
e57a676
fixed problems in namelist generation
mvertens Dec 16, 2025
40106a6
Fix typos in build-namelist
Dec 19, 2025
38ddd6b
Fix use of sim_year and add to NorESM use-case files
Dec 20, 2025
1740a6a
Correct some namelist documentation
Dec 20, 2025
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
75 changes: 42 additions & 33 deletions bld/build-namelist
Original file line number Diff line number Diff line change
Expand Up @@ -696,24 +696,16 @@ if (defined $nl->get_value('sim_year')) {
$sim_year =~ s/['"]//g; #"'
}

# sim_year_start
# If sim_year is input as a range of years, then select the first year
# to use with some datasets
my $sim_year_start = $sim_year;
if ($sim_year =~ /(\d+)-(\d+)/) {
$sim_year_start = $1;
}

# Setup default ndep streams only if not simple_phys or aqua_mode and
# the chemistry cannot produce the nitrogen depostion fluxes
if (!($simple_phys or $aqua_mode)) {
my $chem_nitrodep = chem_has_species($cfg, 'NO') and chem_has_species($cfg, 'NH3');
if ((!$chem_nitrodep) or ($chem =~ /geoschem/)) {
add_default($nl, 'stream_ndep_mesh_filename');
add_default($nl, 'stream_ndep_data_filename', 'sim_year'=>$sim_year);
add_default($nl, 'stream_ndep_year_first', 'sim_year'=>$sim_year);
add_default($nl, 'stream_ndep_year_last', 'sim_year'=>$sim_year);
add_default($nl, 'stream_ndep_year_align', 'sim_year'=>$sim_year);
add_default($nl, 'stream_ndep_mesh_filename' , 'sim_year'=>$sim_year);
add_default($nl, 'stream_ndep_data_filename' , 'sim_year'=>$sim_year);
add_default($nl, 'stream_ndep_year_first' , 'sim_year'=>$sim_year);
add_default($nl, 'stream_ndep_year_last' , 'sim_year'=>$sim_year);
add_default($nl, 'stream_ndep_year_align' , 'sim_year'=>$sim_year);
}
}

Expand Down Expand Up @@ -809,42 +801,59 @@ if ($cfg->get('cosp')) {
# Carbon cycle constituents
my $co2_cycle = $cfg->get('co2_cycle');

if ($co2_cycle) {

# co2_flag turns on the co2_cycle code in CAM
add_default($nl, 'co2_flag', 'val'=>'.true.');
# co2_flag turns on the co2_cycle code in CAM
# defaults set in namelist_defaults_cam.xml
add_default($nl, 'co2_flag');

if ($co2_cycle) {

# Supply a fossil fuel dataset if the co2_cycle is active and it's a
# transient run ...
if ($sim_year =~ /(\d+)-(\d+)/) {
# Supply a fossil fuel and aircraft emission datasets if the
# co2_cycle is active and it is a transient run
if ($sim_year =~ /(\d+)-(\d+)/ || $sim_year =~ /(\d+)/) {

add_default($nl, 'co2_readflux_fuel', 'val'=>'.true.');

# Check whether user has explicitly turned off reading the fossil fuel dataset.
# (user specification has higher precedence than the true value set above)
if ($nl->get_value('co2_readflux_fuel') =~ /$TRUE/io) {
add_default($nl, 'co2flux_fuel_file', 'sim_year'=>$sim_year);
if ($sim_year =~ /(\d+)-(\d+)/) {
add_default($nl, 'co2flux_fuel_taxmode', 'val'=>'extend' );
} else {
add_default($nl, 'co2flux_fuel_taxmode', 'val'=>'cycle' );
}
add_default($nl, 'co2flux_fuel_tintalgo');
add_default($nl, 'co2flux_fuel_meshfile');
add_default($nl, 'co2flux_fuel_datafile');
add_default($nl, 'co2flux_fuel_year_first', 'sim_year'=>$sim_year);
add_default($nl, 'co2flux_fuel_year_last' , 'sim_year'=>$sim_year);
add_default($nl, 'co2flux_fuel_year_align', 'sim_year'=>$sim_year);
}

add_default($nl, 'co2_readflux_aircraft', 'val'=>'.true.');

# Check whether user has explicitly turned off reading the aircraft CO2 dataset.
# (user specification has higher precedence than the true value set above)
if ($nl->get_value('co2_readflux_aircraft') =~ /$TRUE/io) {

my $rel_filepath = get_default_value('ac_CO2_emis');
my $emisval = quote_string('ac_CO2 -> ' . $rel_filepath);
add_default($nl, 'aircraft_specifier', 'val'=>$emisval);

add_default($nl, 'aircraft_datapath');
add_default($nl, 'aircraft_type');
# This should be the same file as the one in the aircraft_specifier file.
# This is a workaround to get this filepath into the cam.input_data_list file
# to allow the CESM scripts to obtain all required data for a run.
add_default($nl, 'aircraft_co2_file');
if ($sim_year =~ /(\d+)-(\d+)/) {
add_default($nl, 'aircraft_co2_taxmode', 'val'=>'extend' );
} else {
add_default($nl, 'aircraft_co2_taxmode', 'val'=>'cycle' );
}
add_default($nl, 'aircraft_co2_tintalgo');
add_default($nl, 'aircraft_co2_meshfile');
add_default($nl, 'aircraft_co2_datafile');
add_default($nl, 'aircraft_co2_year_first', 'sim_year'=>$sim_year);
add_default($nl, 'aircraft_co2_year_last' , 'sim_year'=>$sim_year);
add_default($nl, 'aircraft_co2_year_align', 'sim_year'=>$sim_year);
}
}
} else {
# This case probably should not happen (co2_cycle on with no sim year)
add_default($nl, 'co2_readflux_fuel', 'val'=>'.false.');
add_default($nl, 'co2_readflux_aircraft', 'val'=>'.false.');
}
} else {
add_default($nl, 'co2_readflux_fuel', 'val'=>'.false.');
add_default($nl, 'co2_readflux_aircraft', 'val'=>'.false.');
}

# By default the prognostic co2_cycle CO2 will be radiative active, unless the
Expand Down
67 changes: 29 additions & 38 deletions bld/namelist_files/namelist_defaults_cam.xml
Original file line number Diff line number Diff line change
Expand Up @@ -262,12 +262,6 @@
<bnd_topo hgrid="4x5" >atm/cam/topo/USGS-gtopo30_4x5_remap_c050520.nc</bnd_topo>
<bnd_topo hgrid="10x15" >atm/cam/topo/fv_10x15_nc0540_Nsw042_Nrs008_Co060_Fi001_20171220.nc</bnd_topo>

<bnd_topo hgrid="C24" >atm/cam/topo/fv3_C24_nc3000_Co180_Fi001_MulG_PF_nullRR_Nsw127_c200625.nc</bnd_topo>
<bnd_topo hgrid="C48" >atm/cam/topo/fv3_C48_nc3000_Co120_Fi001_MulG_PF_nullRR_Nsw085_c200625.nc</bnd_topo>
<bnd_topo hgrid="C96" >atm/cam/topo/fv3_C96_nc3000_Co060_Fi001_MulG_PF_nullRR_Nsw042_c200625.nc</bnd_topo>
<bnd_topo hgrid="C192" >atm/cam/topo/fv3_C192_nc3000_Co030_Fi001_MulG_PF_Nsw021_c200625.nc</bnd_topo>
<bnd_topo hgrid="C384" >atm/cam/topo/fv3_C384_nc3000_Co015_Fi001_MulG_PF_nullRR_Nsw011_c200625.nc</bnd_topo>

<bnd_topo hgrid="ne5np4" >atm/cam/topo/se/ne5np4_nc3000_Co360_Fi001_MulG_PF_nullRR_Nsw064_20170515.nc</bnd_topo>
<bnd_topo hgrid="ne16np4" >atm/cam/topo/se/ne16np4_nc3000_Co120_Fi001_PF_nullRR_Nsw084_20171012.nc</bnd_topo>
<bnd_topo hgrid="ne30np4" >atm/cam/topo/se/ne30np4_nc3000_Co060_Fi001_PF_nullRR_Nsw042_20171020.nc</bnd_topo>
Expand Down Expand Up @@ -658,32 +652,34 @@
<flbc_file>atm/waccm/lb/LBC_1765-2100_1.9x2.5_CCMI_RCP60_za_RNOCStrend_c141002.nc</flbc_file>
<flbc_file chem="ghg_mam4">atm/waccm/lb/LBC_17500116-20150116_CMIP6_0p5degLat_c180905.nc</flbc_file>

<co2_flag>.false.</co2_flag>
<co2_flag co2_cycle="1">.true.</co2_flag>

<!-- Time-variant CO2 fossil fuel emissions -->
<co2flux_fuel_file hgrid="0.9x1.25" sim_year="1850-2015">atm/cam/ggas/emissions-cmip6_CO2_anthro_surface_175001-201512_fv_0.9x1.25_c20181011.nc</co2flux_fuel_file>
<co2flux_fuel_file hgrid="1.9x2.5" sim_year="1850-2015">atm/cam/ggas/emissions-cmip6_CO2_anthro_surface_175001-201512_fv_1.9x2.5_c20181011.nc</co2flux_fuel_file>
<co2flux_fuel_file hgrid="C384" sim_year="1850-2015">atm/cam/ggas/emissions-cmip6_CO2_anthro_surface_175001-201512_fv_0.9x1.25_c20181011.nc</co2flux_fuel_file>
<co2flux_fuel_file hgrid="C192" sim_year="1850-2015">atm/cam/ggas/emissions-cmip6_CO2_anthro_surface_175001-201512_fv_0.9x1.25_c20181011.nc</co2flux_fuel_file>
<co2flux_fuel_file hgrid="C96" sim_year="1850-2015">atm/cam/ggas/emissions-cmip6_CO2_anthro_surface_175001-201512_fv_0.9x1.25_c20181011.nc</co2flux_fuel_file>
<co2flux_fuel_file hgrid="C48" sim_year="1850-2015">atm/cam/ggas/emissions-cmip6_CO2_anthro_surface_175001-201512_fv_1.9x2.5_c20181011.nc</co2flux_fuel_file>
<co2flux_fuel_file hgrid="C24" sim_year="1850-2015">atm/cam/ggas/emissions-cmip6_CO2_anthro_surface_175001-201512_fv_1.9x2.5_c20181011.nc</co2flux_fuel_file>

<ac_CO2_emis hgrid="0.9x1.25">ac_CO2_filelist_175001-201512_fv_0.9x1.25_c20181011.txt</ac_CO2_emis>
<ac_CO2_emis hgrid="1.9x2.5" >ac_CO2_filelist_175001-201512_fv_1.9x2.5_c20181011.txt</ac_CO2_emis>
<ac_CO2_emis hgrid="C384">ac_CO2_filelist_175001-201512_fv_0.9x1.25_c20181011.txt</ac_CO2_emis>
<ac_CO2_emis hgrid="C192">ac_CO2_filelist_175001-201512_fv_0.9x1.25_c20181011.txt</ac_CO2_emis>
<ac_CO2_emis hgrid="C96">ac_CO2_filelist_175001-201512_fv_0.9x1.25_c20181011.txt</ac_CO2_emis>
<ac_CO2_emis hgrid="C48" >ac_CO2_filelist_175001-201512_fv_1.9x2.5_c20181011.txt</ac_CO2_emis>
<ac_CO2_emis hgrid="C24" >ac_CO2_filelist_175001-201512_fv_1.9x2.5_c20181011.txt</ac_CO2_emis>
<aircraft_datapath >atm/cam/ggas</aircraft_datapath>
<aircraft_type >SERIAL</aircraft_type>
<!-- These CO2 aircraft emission files are the same as in the aircraft_specifier file above (for cam.input_data_list) -->
<aircraft_co2_file hgrid="0.9x1.25">atm/cam/ggas/emissions-cmip6_CO2_anthro_ac_175001-201512_fv_0.9x1.25_c20181011.nc</aircraft_co2_file>
<aircraft_co2_file hgrid="1.9x2.5" >atm/cam/ggas/emissions-cmip6_CO2_anthro_ac_175001-201512_fv_1.9x2.5_c20181011.nc</aircraft_co2_file>
<aircraft_co2_file hgrid="C384">atm/cam/ggas/emissions-cmip6_CO2_anthro_ac_175001-201512_fv_0.9x1.25_c20181011.nc</aircraft_co2_file>
<aircraft_co2_file hgrid="C192">atm/cam/ggas/emissions-cmip6_CO2_anthro_ac_175001-201512_fv_0.9x1.25_c20181011.nc</aircraft_co2_file>
<aircraft_co2_file hgrid="C96">atm/cam/ggas/emissions-cmip6_CO2_anthro_ac_175001-201512_fv_0.9x1.25_c20181011.nc</aircraft_co2_file>
<aircraft_co2_file hgrid="C48" >atm/cam/ggas/emissions-cmip6_CO2_anthro_ac_175001-201512_fv_1.9x2.5_c20181011.nc</aircraft_co2_file>
<aircraft_co2_file hgrid="C24" >atm/cam/ggas/emissions-cmip6_CO2_anthro_ac_175001-201512_fv_1.9x2.5_c20181011.nc</aircraft_co2_file>
<co2flux_fuel_datafile>atm/cam/ggas/emissions-cmip6_CO2_anthro_surface_175001-201512_fv_0.9x1.25_c20181011.nc</co2flux_fuel_datafile>
<co2flux_fuel_meshfile>share/meshes/fv0.9x1.25_141008_polemod_ESMFmesh.nc</co2flux_fuel_meshfile>
<co2flux_fuel_year_first sim_year="2000">2000</co2flux_fuel_year_first>
<co2flux_fuel_year_end sim_year="2000">2000</co2flux_fuel_year_end>
<co2flux_fuel_year_align sim_year="2000">1</co2flux_fuel_year_align>
<co2flux_fuel_year_first sim_year="1850">1850</co2flux_fuel_year_first>
<co2flux_fuel_year_end sim_year="1850">1850</co2flux_fuel_year_end>
<co2flux_fuel_year_align sim_year="1850">1</co2flux_fuel_year_align>
<co2flux_fuel_year_first sim_year="1850-2015">1850</co2flux_fuel_year_first>
<co2flux_fuel_year_end sim_year="1850-2015">2015</co2flux_fuel_year_end>
<co2flux_fuel_year_align sim_year="1850-2015">1850</co2flux_fuel_year_align>

<!-- Time-variant CO2 aircraft emissions -->
<aircraft_co2_datafile>atm/cam/ggas/emissions-cmip6_CO2_anthro_ac_175001-201512_fv_0.9x1.25_c20181011.nc</aircraft_co2_datafile>
<aircraft_co2_meshfile>share/meshes/fv0.9x1.25_141008_polemod_ESMFmesh.nc</aircraft_co2_meshfile>
<aircraft_co2_year_first sim_year="2000">2000</aircraft_co2_year_first>
<aircraft_co2_year_end sim_year="2000">2000</aircraft_co2_year_end>
<aircraft_co2_year_align sim_year="2000">1</aircraft_co2_year_align>
<aircraft_co2_year_first sim_year="1850">1850</aircraft_co2_year_first>
<aircraft_co2_year_end sim_year="1850">1850</aircraft_co2_year_end>
<aircraft_co2_year_align sim_year="1850">1</aircraft_co2_year_align>
<aircraft_co2_year_first sim_year="1850-2015">1850</aircraft_co2_year_first>
<aircraft_co2_year_end sim_year="1850-2015">2015</aircraft_co2_year_end>
<aircraft_co2_year_align sim_year="1850-2015">1850</aircraft_co2_year_align>

<!-- Greenhouse gas production/loss rates -->
<bndtvg>atm/cam/ggas/noaamisc.r8.nc</bndtvg>
Expand Down Expand Up @@ -1981,12 +1977,6 @@
<drydep_srf_file hgrid="ne0np4.ARCTIC.ne30x4" >atm/cam/chem/trop_mam/atmsrf_ne30x4_ARCTIC_191011.nc</drydep_srf_file>
<drydep_srf_file hgrid="ne0np4.ARCTICGRIS.ne30x8">atm/cam/chem/trop_mam/atmsrf_ne30x8_ARCTICGRIS_191212.nc</drydep_srf_file>

<drydep_srf_file hgrid="C24">atm/cam/chem/trop_mam/atmsrf_C24_c200625.nc</drydep_srf_file>
<drydep_srf_file hgrid="C48">atm/cam/chem/trop_mam/atmsrf_C48_c200625.nc</drydep_srf_file>
<drydep_srf_file hgrid="C96">atm/cam/chem/trop_mam/atmsrf_C96_c200625.nc</drydep_srf_file>
<drydep_srf_file hgrid="C192">atm/cam/chem/trop_mam/atmsrf_C192_c200625.nc</drydep_srf_file>
<drydep_srf_file hgrid="C384">atm/cam/chem/trop_mam/atmsrf_C384_c200625.nc</drydep_srf_file>

<drydep_srf_file hgrid="mpasa120">atm/cam/chem/trop_mam/atmsrf_mpasa120_c090720.nc</drydep_srf_file>
<drydep_srf_file hgrid="mpasa480">atm/cam/chem/trop_mam/atmsrf_mpasa480_c090720.nc</drydep_srf_file>

Expand Down Expand Up @@ -2026,8 +2016,9 @@

<!-- nitrogen deposition to surface models -->
<stream_ndep_mesh_filename>share/meshes/fv0.9x1.25_141008_polemod_ESMFmesh.nc</stream_ndep_mesh_filename>
<stream_ndep_data_filename>lnd/clm2/ndepdata/fndep_clm_hist_b.e21.BWHIST.f09_g17.CMIP6-historical-WACCM.ensmean_1849-2015_monthly_0.9x1.25_c180926.nc</stream_ndep_data_filename>

<stream_ndep_data_filename >lnd/clm2/ndepdata/fndep_clm_hist_b.e21.BWHIST.f09_g17.CMIP6-historical-WACCM.ensmean_1849-2015_monthly_0.9x1.25_c180926.nc</stream_ndep_data_filename>
<stream_ndep_mesh_filename sim_year="1850">share/meshes/fv0.9x1.25_141008_polemod_ESMFmesh.nc</stream_ndep_mesh_filename>
<stream_ndep_data_filename sim_year="1850">lnd/clm2/ndepdata/fndep_clm_WACCM6_CMIP6piControl001_y21-50avg_1850monthly_0.95x1.25_c180802.nc</stream_ndep_data_filename>

<stream_ndep_year_first >2000</stream_ndep_year_first>
Expand Down
Loading