Skip to content
Open
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
Original file line number Diff line number Diff line change
@@ -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
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just double-checking if it is okay that many of these aerosol fields are zero times pbuf_sulf? It totally might be, I am just trying to understand the reasoning behind it. Thanks!

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the question. Yes, it is intended! It is just to zero out these fields in the "before" snapshot, so that ncdata_check can verify that the zeros in the model state indeed were populated by the tracer_data schemes.

The reason I used <something>=0.0*pbuf_sulf is because nco with <something>=0.0 will set the 2-D array into a scalar, and thus losing the dimensions; so I just borrowed the pbuf_sulf*0.0 to get a 2-D array of zeros to put into that variable. Hope this explains it!

! (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.
Expand All @@ -20,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"
Expand All @@ -30,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"
Expand All @@ -46,8 +51,12 @@ 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_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
2 changes: 1 addition & 1 deletion src/data/physconst.F90
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion src/data/physconst.meta
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
[ 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
Expand Down
14 changes: 14 additions & 0 deletions src/data/registry.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1707,6 +1707,20 @@
<ic_file_input_names>dust4 pbuf_dust4 cnst_dust4</ic_file_input_names>
</variable>

<!-- Prescribed volcanic aerosol (CAM4, CAM5) -->
<variable local_name="VOLC_MMR"
standard_name="VOLC_MMR"
units="kg kg-1" type="real" constituent="true">
<dimensions>horizontal_dimension vertical_layer_dimension</dimensions>
<ic_file_input_names>VOLC_MMR pbuf_VOLC_MMR</ic_file_input_names>
</variable>
<variable local_name="VOLC_RAD_GEOM"
standard_name="VOLC_RAD_GEOM"
units="m" type="real" constituent="true">
<dimensions>horizontal_dimension vertical_layer_dimension</dimensions>
<ic_file_input_names>VOLC_RAD_GEOM pbuf_VOLC_RAD_GEOM</ic_file_input_names>
</variable>

<!-- Zhang McFarlane (ZM) Variables -->
<variable local_name="ql"
standard_name="in_cloud_water_vapor_mixing_ratio_wrt_moist_air_and_condensed_water_due_to_deep_convection"
Expand Down
Loading