From d4f3c8465864655173d76fa7f7178043d8e144a6 Mon Sep 17 00:00:00 2001 From: Haipeng Lin Date: Thu, 12 Mar 2026 13:07:33 -0400 Subject: [PATCH 1/6] Add VOLC_MMR, VOLC_RAD_GEOM registry entries for prescribed volcanic aerosol (CAM4/5) --- src/data/registry.xml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/data/registry.xml b/src/data/registry.xml index 83ba849e0..25573d5e4 100644 --- a/src/data/registry.xml +++ b/src/data/registry.xml @@ -1707,6 +1707,20 @@ dust4 pbuf_dust4 cnst_dust4 + + + horizontal_dimension vertical_layer_dimension + VOLC_MMR pbuf_VOLC_MMR + + + horizontal_dimension vertical_layer_dimension + VOLC_RAD_GEOM pbuf_VOLC_RAD_GEOM + + Date: Thu, 12 Mar 2026 17:33:17 -0400 Subject: [PATCH 2/6] Update snapshot file for volcaero --- .../outfrq_trcdata_bam_derecho/user_nl_cam | 23 +++++++++++++------ 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/cime_config/testdefs/testmods_dirs/cam/outfrq_trcdata_bam_derecho/user_nl_cam b/cime_config/testdefs/testmods_dirs/cam/outfrq_trcdata_bam_derecho/user_nl_cam index 63698ed56..fb829c6de 100644 --- a/cime_config/testdefs/testmods_dirs/cam/outfrq_trcdata_bam_derecho/user_nl_cam +++ b/cime_config/testdefs/testmods_dirs/cam/outfrq_trcdata_bam_derecho/user_nl_cam @@ -1,17 +1,22 @@ ! these snapshots were constructed to specifically test whether the data read into the ! physics buffer by tracer_data in CAM will match the data read by CAM-SIMA bit-for-bit. ! this was done by -! (1) taking a FHIST_C4 snapshot (which has prescribed_ozone and aero) -! in this case a ne3pg3_fhistc4_gw_drag_cam4_oro snapshot, +! (1) taking a FHIST_C4 snapshot (which has prescribed_ozone, aero, aerodep_flx, and volcaero) +! using a "user_set" location at the beginning of tphysbc, before check_energy_fix +! this is because the prescribed data modules run during timestep_init; +! the energy fixer will change model state, causing changes in the interpolation, +! so the "before" snapshot before the global energy fixer needs to be used. ! (2) using nco to zero out the prescribed ozone and aero fields from the snapshot data, -! to create the "before" snapshot. -! (3) the "after" snapshot is the original snapshot file (which has non-zero values for prescribed -! ozone and aerosols) +! to create the "before" snapshot: +! ncap2 -O -s 'pbuf_ozone=0.0*pbuf_ozone' h1i_v2.nc 0xozone.nc +! ncap2 -O -s 'pbuf_sulf=0.0*pbuf_sulf;pbuf_bcar1=0.0*pbuf_sulf;pbuf_bcar2=0.0*pbuf_sulf;pbuf_ocar1=0.0*pbuf_sulf;pbuf_ocar2=0.0*pbuf_sulf;pbuf_sslt1=0.0*pbuf_sulf;pbuf_sslt2=0.0*pbuf_sulf;pbuf_sslt3=0.0*pbuf_sulf;pbuf_sslt4=0.0*pbuf_sulf;pbuf_dust1=0.0*pbuf_sulf;pbuf_dust2=0.0*pbuf_sulf;pbuf_dust3=0.0*pbuf_sulf;pbuf_dust4=0.0*pbuf_sulf;pbuf_VOLC_RAD_GEOM=0.0*pbuf_VOLC_RAD_GEOM;pbuf_VOLC_MMR=0.0*pbuf_VOLC_MMR' 0xozone.nc 0xozone_aero_volcaero.nc +! (3) the "after" snapshot is the original "before" snapshot file +! (which has non-zero values for prescribed ozone and aerosol) ! the test will pass iff. the tracer_data utility in CAM-SIMA and the prescribed_ozone/aerosols schemes ! can populate the prescribed fields bit-for-bit compared to the original snapshot file. -ncdata = '/glade/campaign/cesm/community/amwg/sima_baselines/cam_sima_test_snapshots/cam_ne3pg3_fhistc4_tracer_data_0xprescribed-ozone-aero_from_cam4_oro_snapshot_derecho_gnu_after_c20251028.nc' -ncdata_check = '/glade/campaign/cesm/community/amwg/sima_baselines/cam_sima_test_snapshots/cam_ne3pg3_fhistc4_gw_drag_cam4_oro_snapshot_derecho_gnu_after_c20250826.nc' +ncdata = '/glade/campaign/cesm/community/amwg/sima_baselines/cam_sima_test_snapshots/cam_ne3pg3_fhistc4_tracer_data_0xprescribed-ozone-aero-volcaero_from_energy_fixer_derecho_gnu_before_c20260312.nc' +ncdata_check = '/glade/campaign/cesm/community/amwg/sima_baselines/cam_sima_test_snapshots/cam_ne3pg3_fhistc4_tracer_data_0xprescribed-ozone-aero-volcaero_from_energy_fixer_derecho_gnu_after_c20260312.nc' ! tolerances for testing ncdata_check_err = .true. @@ -46,8 +51,12 @@ prescribed_ozone_fixed_tod = 0 prescribed_ozone_fixed_ymd = 0 prescribed_ozone_cycle_yr = 0 +prescribed_volcaero_datapath = "/glade/campaign/cesm/cesmdata/inputdata/atm/cam/volc" +prescribed_volcaero_file = "CCSM4_volcanic_1850-2008_prototype1.nc" + hist_output_frequency;h1: 1*nsteps hist_max_frames;h1: 1 hist_add_inst_fields;h1:ozone hist_add_inst_fields;h1:sulf_D,bcar1_D,bcar2_D,ocar1_D,ocar2_D,sslt1_D,sslt2_D,sslt3_D,sslt4_D,dust1_D,dust2_D,dust3_D,dust4_D +hist_add_inst_fields;h1:VOLC_MMR,VOLC_RAD_GEOM,VOLC_MASS,VOLC_MASS_C hist_precision;h1: REAL64 From 60910c7dc49f42424374aba56571332ac38231ee Mon Sep 17 00:00:00 2001 From: Haipeng Lin Date: Fri, 13 Mar 2026 14:30:51 -0400 Subject: [PATCH 3/6] Closes #283 - fixes boltz, avogad units in meta. --- src/data/physconst.meta | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/data/physconst.meta b/src/data/physconst.meta index 72b6c8237..561b99215 100644 --- a/src/data/physconst.meta +++ b/src/data/physconst.meta @@ -7,14 +7,14 @@ [ avogad ] standard_name = avogadro_number long_name = Avogadro's Number - units = molecules mole-1 + units = molecules kmol-1 type = real | kind = kind_phys dimensions = () protected = True [ boltz ] standard_name = boltzmann_constant long_name = Boltzmann's Constant - units = J K-1 + units = J K-1 molecule-1 type = real | kind = kind_phys dimensions = () protected = True From 9e8c5a83496bf6c4300d405457bc645bfb308213 Mon Sep 17 00:00:00 2001 From: Haipeng Lin Date: Mon, 11 May 2026 06:34:38 -0400 Subject: [PATCH 4/6] Revert change to boltz units. @nusbaume wrote: I actually think the correct units for the Boltzmann Constant really is just J K-1, even though comments in CAM-SIMA and CESM_share says otherwise. This is because the constant holds for any "particle" that can behave like a gas, which is technically not just molecules. It's the same reason a number density is technically just a per-volume unit (e.g. cm-3), and not molecules per volume (e.g. molecules cm-3). Co-authored-by: Jesse Nusbaumer --- src/data/physconst.F90 | 2 +- src/data/physconst.meta | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/data/physconst.F90 b/src/data/physconst.F90 index c73989dca..e560b1c87 100644 --- a/src/data/physconst.F90 +++ b/src/data/physconst.F90 @@ -46,7 +46,7 @@ module physconst !! \htmlinclude physconst.html ! Constants based off share code or defined in physconst real(kind_phys), public, parameter :: avogad = real(shr_const_avogad, kind_phys) ! Avogadro's number (molecules kmole-1) - real(kind_phys), public, parameter :: boltz = real(shr_const_boltz, kind_phys) ! Boltzman's constant (J K-1 molecule-1) + real(kind_phys), public, parameter :: boltz = real(shr_const_boltz, kind_phys) ! Boltzmann's constant (J K-1) real(kind_phys), public, parameter :: cday = real(shr_const_cday, kind_phys) ! sec in calendar day (seconds) real(kind_phys), public, parameter :: cpliq = real(shr_const_cpfw, kind_phys) ! specific heat of fresh h2o (J K-1 kg-1) real(kind_phys), public, parameter :: cpice = real(shr_const_cpice, kind_phys) ! specific heat of ice (J K-1 kg-1) diff --git a/src/data/physconst.meta b/src/data/physconst.meta index 561b99215..3f1c00839 100644 --- a/src/data/physconst.meta +++ b/src/data/physconst.meta @@ -14,7 +14,7 @@ [ boltz ] standard_name = boltzmann_constant long_name = Boltzmann's Constant - units = J K-1 molecule-1 + units = J K-1 type = real | kind = kind_phys dimensions = () protected = True From c3921406d212a5c16301c18c4a54c41638a89e5e Mon Sep 17 00:00:00 2001 From: Haipeng Lin Date: Wed, 13 May 2026 16:05:07 -0400 Subject: [PATCH 5/6] Update to use for inputs of prescribed --- .../cam/outfrq_trcdata_bam_derecho/user_nl_cam | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cime_config/testdefs/testmods_dirs/cam/outfrq_trcdata_bam_derecho/user_nl_cam b/cime_config/testdefs/testmods_dirs/cam/outfrq_trcdata_bam_derecho/user_nl_cam index fb829c6de..5e6569446 100644 --- a/cime_config/testdefs/testmods_dirs/cam/outfrq_trcdata_bam_derecho/user_nl_cam +++ b/cime_config/testdefs/testmods_dirs/cam/outfrq_trcdata_bam_derecho/user_nl_cam @@ -25,7 +25,7 @@ min_difference = 2e-15 ! cam4 vertical levels (FHIST_C4 snapshots) pver = 26 -prescribed_aero_datapath = "/glade/campaign/cesm/cesmdata/inputdata/atm/cam/chem/trop_mozart_aero/aero" +prescribed_aero_datapath = "$DIN_LOC_ROOT/atm/cam/chem/trop_mozart_aero/aero" prescribed_aero_file = "aero_1.9x2.5_L26_1850-2005_c091112.nc" prescribed_aero_filelist = "aero_1.9x2.5_L26_list_c070514.txt" prescribed_aero_model = "bulk" @@ -35,14 +35,14 @@ prescribed_aero_cycle_yr = 0 prescribed_aero_fixed_tod = 0 prescribed_aero_fixed_ymd = 0 -aerodep_flx_datapath = '/glade/campaign/cesm/cesmdata/inputdata/atm/cam/chem/trop_mozart_aero/aero' +aerodep_flx_datapath = '$DIN_LOC_ROOT/atm/cam/chem/trop_mozart_aero/aero' aerodep_flx_file = 'aerosoldep_monthly_1849-2006_1.9x2.5_c090803.nc' aerodep_flx_specifier = 'BCDEPWET', 'BCPHODRY', 'BCPHIDRY', 'OCDEPWET', 'OCPHODRY', 'OCPHIDRY', 'DSTX01DD', 'DSTX02DD', 'DSTX03DD', 'DSTX04DD', 'DSTX01WD', 'DSTX02WD', 'DSTX03WD', 'DSTX04WD' aerodep_flx_type = 'INTERP_MISSING_MONTHS' aerodep_flx_cycle_yr = 0 -prescribed_ozone_datapath = "/glade/campaign/cesm/cesmdata/inputdata/atm/cam/ozone" +prescribed_ozone_datapath = "$DIN_LOC_ROOT/atm/cam/ozone" prescribed_ozone_file = "ozone_1.9x2.5_L26_1850-2005_c091112.nc" prescribed_ozone_filelist = "UNSET" prescribed_ozone_name = "O3" @@ -51,7 +51,7 @@ prescribed_ozone_fixed_tod = 0 prescribed_ozone_fixed_ymd = 0 prescribed_ozone_cycle_yr = 0 -prescribed_volcaero_datapath = "/glade/campaign/cesm/cesmdata/inputdata/atm/cam/volc" +prescribed_volcaero_datapath = "$DIN_LOC_ROOT/atm/cam/volc" prescribed_volcaero_file = "CCSM4_volcanic_1850-2008_prototype1.nc" hist_output_frequency;h1: 1*nsteps From ada1b7fb0ddc902e73e9098acc78963073aa74f9 Mon Sep 17 00:00:00 2001 From: Haipeng Lin Date: Thu, 14 May 2026 21:48:52 -0400 Subject: [PATCH 6/6] Fixup! Use curly braces DIN_LOC_ROOT to avoid double-quoting --- .../cam/outfrq_trcdata_bam_derecho/user_nl_cam | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cime_config/testdefs/testmods_dirs/cam/outfrq_trcdata_bam_derecho/user_nl_cam b/cime_config/testdefs/testmods_dirs/cam/outfrq_trcdata_bam_derecho/user_nl_cam index 5e6569446..c45aa9428 100644 --- a/cime_config/testdefs/testmods_dirs/cam/outfrq_trcdata_bam_derecho/user_nl_cam +++ b/cime_config/testdefs/testmods_dirs/cam/outfrq_trcdata_bam_derecho/user_nl_cam @@ -25,7 +25,7 @@ min_difference = 2e-15 ! cam4 vertical levels (FHIST_C4 snapshots) pver = 26 -prescribed_aero_datapath = "$DIN_LOC_ROOT/atm/cam/chem/trop_mozart_aero/aero" +prescribed_aero_datapath = "${DIN_LOC_ROOT}/atm/cam/chem/trop_mozart_aero/aero" prescribed_aero_file = "aero_1.9x2.5_L26_1850-2005_c091112.nc" prescribed_aero_filelist = "aero_1.9x2.5_L26_list_c070514.txt" prescribed_aero_model = "bulk" @@ -35,14 +35,14 @@ prescribed_aero_cycle_yr = 0 prescribed_aero_fixed_tod = 0 prescribed_aero_fixed_ymd = 0 -aerodep_flx_datapath = '$DIN_LOC_ROOT/atm/cam/chem/trop_mozart_aero/aero' +aerodep_flx_datapath = '${DIN_LOC_ROOT}/atm/cam/chem/trop_mozart_aero/aero' aerodep_flx_file = 'aerosoldep_monthly_1849-2006_1.9x2.5_c090803.nc' aerodep_flx_specifier = 'BCDEPWET', 'BCPHODRY', 'BCPHIDRY', 'OCDEPWET', 'OCPHODRY', 'OCPHIDRY', 'DSTX01DD', 'DSTX02DD', 'DSTX03DD', 'DSTX04DD', 'DSTX01WD', 'DSTX02WD', 'DSTX03WD', 'DSTX04WD' aerodep_flx_type = 'INTERP_MISSING_MONTHS' aerodep_flx_cycle_yr = 0 -prescribed_ozone_datapath = "$DIN_LOC_ROOT/atm/cam/ozone" +prescribed_ozone_datapath = "${DIN_LOC_ROOT}/atm/cam/ozone" prescribed_ozone_file = "ozone_1.9x2.5_L26_1850-2005_c091112.nc" prescribed_ozone_filelist = "UNSET" prescribed_ozone_name = "O3" @@ -51,7 +51,7 @@ prescribed_ozone_fixed_tod = 0 prescribed_ozone_fixed_ymd = 0 prescribed_ozone_cycle_yr = 0 -prescribed_volcaero_datapath = "$DIN_LOC_ROOT/atm/cam/volc" +prescribed_volcaero_datapath = "${DIN_LOC_ROOT}/atm/cam/volc" prescribed_volcaero_file = "CCSM4_volcanic_1850-2008_prototype1.nc" hist_output_frequency;h1: 1*nsteps