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 noresm2_3_deveop for noresm2_1_develop compatibility #130

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
72 commits
Select commit Hold shift + click to select a range
dafdd94
first commit of refactorization
Aug 11, 2023
878f79e
intermediate mods
Aug 12, 2023
2654ffd
more updates
Aug 13, 2023
821542a
back up refactor of pmxsub
Aug 14, 2023
1b7d057
changes that compiled and ran - bfb still tbd
mvertens Aug 15, 2023
1802903
refactored ndrop.F90
mvertens Aug 16, 2023
0a90147
removed routines that are not needed
mvertens Aug 16, 2023
8840891
more removal of #ifdef OSLO_AERO
mvertens Aug 16, 2023
00f5bb0
more removal of OSLO_AERO ifdefs
mvertens Aug 16, 2023
9c4123c
updated intlog module that contains initlogn as well as new module co…
mvertens Aug 16, 2023
ebc11ff
removed opttab_lw and put functionality in opttab.F90
mvertens Aug 17, 2023
67e5476
moved optinterpol to opttab
mvertens Aug 17, 2023
836f2f7
updates for creating new aerocom module
mvertens Aug 17, 2023
1d456b3
more cleanup
mvertens Aug 17, 2023
99e950c
fix for build problem
mvertens Aug 18, 2023
5c4c0b4
moved duplicate files to physics/cam_oslo and kept oslo aero files in…
mvertens Aug 18, 2023
8930894
incorporate aeronucl_mod subroutines into condtend.F90 module
mvertens Aug 18, 2023
1225bba
moved ndrop and aero_model from oslo_aero to cam_oslo since they are …
mvertens Aug 21, 2023
bb4d69a
refactored dust model
mvertens Aug 21, 2023
46f6525
removed modal_aero_data.F90 from physics/cam_oslo
mvertens Aug 21, 2023
f1d822b
moved hetfrz to this directory
mvertens Aug 28, 2023
669f3b4
more refactorization of hetfrz_classnuc_oslo.F90
mvertens Aug 28, 2023
de3fd9e
more updates for refactoring
mvertens Aug 29, 2023
7704c8e
more cleanup still bfb
mvertens Aug 29, 2023
539d02b
refactored aerosol deposition
mvertens Aug 30, 2023
01efbf1
more refactoring
mvertens Aug 30, 2023
b323d44
more refactoring
mvertens Aug 30, 2023
cdc579c
renamed oxi_diurnal_var.F90 oxi_diurnal_var.F90
mvertens Aug 30, 2023
8a1962a
renamed oxi_diurnal_var.F90 oxi_diurnal_var.F90
mvertens Aug 30, 2023
cda1d11
more cleanup
mvertens Aug 30, 2023
7cfdff7
rename ndrop.F90 to oslo_aero_ndrop and made it an oslo_aero specific…
mvertens Aug 31, 2023
ac2a141
introduced oslo_aero_dust_sediment.F90 as a refactored copy of dust_s…
mvertens Aug 31, 2023
cd4b998
rename condtend to oslo_aero_condtend
mvertens Aug 31, 2023
06261a3
moved condtend.F90 to oslo_aero_condtend and implemented private stat…
mvertens Aug 31, 2023
9e5b248
moved oslo_utils to oslo_aero_utils
mvertens Aug 31, 2023
bdd06d5
more extensive consolidation
mvertens Aug 31, 2023
dea7325
updates for ocean and seasalt
mvertens Sep 1, 2023
60d24be
put calcaersize into aero_model
mvertens Sep 1, 2023
e1eaeb1
more cleanup of aero_model
mvertens Sep 1, 2023
31c8bbb
renamed and refactored interpolation routines
mvertens Sep 2, 2023
c5dda2f
more cleanup
mvertens Sep 2, 2023
8ed245a
more refactoring
mvertens Sep 3, 2023
7762cb1
more refactoring
mvertens Sep 3, 2023
d00ab8e
moved refactored radation to physics/rrtmg
mvertens Sep 3, 2023
3493b80
refactored microp_aero
mvertens Sep 3, 2023
c2b783c
refactored microp_aero
mvertens Sep 3, 2023
8be7741
moved microp_aero to chemistry/oslo_aero and renamed it
mvertens Sep 3, 2023
260b263
more refactoring of cam_oslo routines
mvertens Sep 3, 2023
95f82d9
updates that are causing model to crash
mvertens Sep 3, 2023
a5c0f34
Merge branch 'feature_newaer5_crash' into feature/new_aero5
mvertens Sep 4, 2023
36ee848
renamed commondefinitions.F90 as oslo_aero_params.F90
mvertens Sep 4, 2023
f90b69c
moved aerosoldef to oslo_aero_share
mvertens Sep 4, 2023
c3698ad
updated vertical diffusion with #ifdefs
mvertens Sep 4, 2023
9553e23
moved vertical diffusion to physics/cam and removed cam_oslo directory
mvertens Sep 4, 2023
caefbe9
moved aero_model to oslo_aero_model in chemistry/oslo_aero
mvertens Sep 4, 2023
24ac1e9
more cleanup to compile without defining OSLO_AERO
mvertens Sep 4, 2023
890b114
pointing to chemistry/oslo_aero as an external
mvertens Sep 4, 2023
b3bb05b
pointing to chemistry/oslo_aero as an external
mvertens Sep 4, 2023
c7ba580
minor update to radiation.F90
mvertens Oct 17, 2023
5bcf671
updates for new changes to oslo-aero
mvertens Oct 25, 2023
014d4f0
updates to get new external oslo-aero working in the release branch
mvertens Oct 25, 2023
7b865c7
removed trailing whitespace
mvertens Oct 25, 2023
9d9bc54
removed svn externals that are now imbedded in the source code
mvertens Oct 25, 2023
437d3bd
nan bug fixes
mvertens Oct 31, 2023
42189f9
new oslo aero in release with aerocom
mvertens Nov 8, 2023
3f94fb4
updates to be consistent with 2_1 release updates
mvertens Nov 20, 2023
8d06816
removed cosp from externals
mvertens Nov 20, 2023
199858c
pointing to new oslo_aero external
mvertens Nov 20, 2023
3cf4116
updates that are consistent with noresm2_1 branch goldy/fix_ice_delim…
mvertens Jan 3, 2024
9cfc20e
updtes to have non oslo-aero code look identical to noresm2.1
mvertens Jan 28, 2024
f2f17af
udpates for noresm2_1_develop compatibility
mvertens Jan 28, 2024
abf2e27
more updates for noresm21 compatibility
mvertens Jan 30, 2024
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
53 changes: 23 additions & 30 deletions Externals.cfg
Original file line number Diff line number Diff line change
@@ -1,60 +1,53 @@
[externals_description]
schema_version = 1.0.0

[cice]
tag = cice5_cesm2_0_rel_01
tag = cice5_20181109-Nor_v1.0.3
protocol = git
repo_url = https://github.com/ESCOMP/CESM_CICE5
required = True
repo_url = https://github.com/NorESMHub/CESM_CICE5
local_path = components/cice
required = True

[cime]
tag = cime_cesm2_0_rel_06
tag = cime5.6.10_cesm2_1_rel_06-Nor_v1.0.6
protocol = git
repo_url = https://github.com/ESMCI/cime
required = True
repo_url = https://github.com/NorESMhub/cime
local_path = cime
required = True

[cism]
tag = release-cesm2.0.01
tag = wrapper_noresm2.0.6_v0
protocol = git
repo_url = https://github.com/ESCOMP/cism-wrapper
externals = Externals_CISM.cfg
required = True
repo_url = https://github.com/NorESMhub/cism-wrapper
local_path = components/cism
externals = Externals_CISM.cfg
required = False

[clm]
tag = release-clm5.0.01
tag = release-clm5.0.14-Nor_v1.0.4
protocol = git
repo_url = https://github.com/ESCOMP/ctsm
repo_url = https://github.com/NorESMhub/ctsm
local_path = components/clm
externals = Externals_CLM.cfg
required = True
local_path = components/clm

[mosart]
tag = release-cesm2.0.00
tag = release-cesm2.0.03-Nor_v1.0.0
protocol = git
repo_url = https://github.com/ESCOMP/mosart
repo_url = https://github.com/NorESMhub/mosart
local_path = components/mosart
required = True
local_path = components/mosart

[rtm]
tag = release-cesm2.0.00
tag = release-cesm2.0.02
protocol = git
repo_url = https://github.com/ESCOMP/rtm
required = True
local_path = components/rtm
required = False

[ww3]
tag = ww3_cesm2_0_rel_01
tag = ww3_cesm2_1_rel_01
protocol = svn
repo_url = https://svn-ccsm-models.cgd.ucar.edu/ww3/release_tags
required = True
repo_url = https://svn-ccsm-models.cgd.ucar.edu/ww3/release_tags
local_path = components/ww3
required = False

[cam]
local_path = .
protocol = externals_only
externals = Externals_CAM.cfg
required = True

[externals_description]
schema_version = 1.0.0
32 changes: 5 additions & 27 deletions Externals_CAM.cfg
Original file line number Diff line number Diff line change
@@ -1,31 +1,9 @@
[chem_proc]
local_path = chem_proc
protocol = svn
repo_url = https://svn-ccsm-models.cgd.ucar.edu/tools/proc_atm/chem_proc/release_tags/
tag = chem_proc5_0_03_rel
required = True

[carma]
local_path = src/physics/carma/base
protocol = svn
repo_url = https://svn-ccsm-models.cgd.ucar.edu/carma/release_tags/
tag = carma3_49_rel
required = True

[clubb]
local_path = src/physics/clubb
protocol = svn
repo_url = https://svn-ccsm-models.cgd.ucar.edu/clubb_core/release_tags/
tag = clubb_r8099_n02_rel
required = True

[cosp2]
local_path = src/physics/cosp2/src
protocol = svn
repo_url = https://github.com/CFMIP/COSPv2.0/tags/
tag = v2.0.3cesm/src
[oslo_aero]
local_path = src/chemistry/oslo_aero
protocol = git
repo_url = https://github.com/mvertens/OSLO_AERO.git
branch = noresm2_3_develop
required = True

[externals_description]
schema_version = 1.0.0

16 changes: 11 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,8 +307,11 @@ 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>
<entry id="aerocom" valid_values="0,1" value="0">
Turns on aerocom
</entry>

</config_definition>
83 changes: 56 additions & 27 deletions bld/configure
Original file line number Diff line number Diff line change
Expand Up @@ -110,21 +110,24 @@ OPTIONS
Options used to determine the CAM model configuration. These options will have an
effect whether running CAM as part of CCSM or running in a CAM standalone mode:

-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.
-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 @@ -288,6 +291,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 All @@ -299,6 +303,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 +617,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 +653,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,7 +1439,7 @@ if ($chem_pkg =~ '_mam3') {
}

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

# CARMA sectional microphysics
Expand Down Expand Up @@ -1920,7 +1943,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 @@ -1952,6 +1975,14 @@ if ($clubb_sgs == 1) {
$cfg_cppdefs .= " -DCLUBB_REAL_TYPE=dp";
}

# 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 @@ -2731,6 +2762,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 @@ -2747,23 +2779,20 @@ 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
# 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)
# offline unit driver (defaults to stub)
print $fh "$camsrcdir/cam/src/unit_drivers\n";
print $fh "$camsrcdir/cam/src/unit_drivers/${offline_drv}\n";

Expand All @@ -2788,15 +2817,15 @@ sub write_filepath
print $fh "$chem_src_dir\n";
}
if ($chem =~/_oslo/) {
print $fh "$camsrcdir/cam/src/chemistry/oslo_aero\n";
print $fh "$camsrcdir/cam/src/physics/cam_oslo\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
5 changes: 5 additions & 0 deletions cime_config/buildcpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ def buildcpp(case):
compiler = case.get_value("COMPILER") # for chem preprocessor
nthrds_atm = case.get_value("NTHRDS_ATM")
cam_config_opts = case.get_value("CAM_CONFIG_OPTS")
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 @@ -99,6 +100,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"]

camconf = os.path.join(caseroot, "Buildconf", "camconf")
if not os.path.isdir(camconf):
os.makedirs(camconf)
Expand Down
Loading