Skip to content

Commit

Permalink
add sampled_on_subcycle argument for missing subcycle fields
Browse files Browse the repository at this point in the history
  • Loading branch information
peverwhee committed Oct 29, 2024
1 parent b8cd5a6 commit 2f59d18
Show file tree
Hide file tree
Showing 7 changed files with 136 additions and 131 deletions.
12 changes: 6 additions & 6 deletions src/physics/cam/check_energy.F90
Original file line number Diff line number Diff line change
Expand Up @@ -201,12 +201,12 @@ subroutine check_energy_init()
history_waccm_out = history_waccm )

! register history variables
call addfld('TEINP', horiz_only, 'A', 'J/m2', 'Total energy of physics input', sampled_on_subcycle=.true.)
call addfld('TEOUT', horiz_only, 'A', 'J/m2', 'Total energy of physics output', sampled_on_subcycle=.true.)
call addfld('TEFIX', horiz_only, 'A', 'J/m2', 'Total energy after fixer', sampled_on_subcycle=.true.)
call addfld('EFIX', horiz_only, 'A', 'W/m2', 'Effective sensible heat flux due to energy fixer', sampled_on_subcycle=.true.)
call addfld('DTCORE', (/ 'lev' /), 'A', 'K/s' , 'T tendency due to dynamical core', sampled_on_subcycle=.true.)
call addfld('DQCORE', (/ 'lev' /), 'A', 'kg/kg/s' , 'Water vapor tendency due to dynamical core', sampled_on_subcycle=.true.)
call addfld('TEINP', horiz_only, 'A', 'J/m2', 'Total energy of physics input')
call addfld('TEOUT', horiz_only, 'A', 'J/m2', 'Total energy of physics output')
call addfld('TEFIX', horiz_only, 'A', 'J/m2', 'Total energy after fixer')
call addfld('EFIX', horiz_only, 'A', 'W/m2', 'Effective sensible heat flux due to energy fixer')
call addfld('DTCORE', (/ 'lev' /), 'A', 'K/s' , 'T tendency due to dynamical core')
call addfld('DQCORE', (/ 'lev' /), 'A', 'kg/kg/s' , 'Water vapor tendency due to dynamical core')

if ( history_budget ) then
call add_default ('DTCORE', history_budget_histfile_num, ' ')
Expand Down
15 changes: 10 additions & 5 deletions src/physics/cam/clubb_intr.F90
Original file line number Diff line number Diff line change
Expand Up @@ -5115,7 +5115,8 @@ subroutine stats_init_clubb( l_stats_in, stats_tsamp_in, stats_tout_in, &

call addfld( trim(sub), (/ 'ilev' /), 'A', &
trim(stats_zt(1)%file%grid_avg_var(i)%units), &
trim(stats_zt(1)%file%grid_avg_var(i)%description) )
trim(stats_zt(1)%file%grid_avg_var(i)%description), &
sampled_on_subcycle=.true. )
enddo

do i = 1, stats_zm(1)%num_output_fields
Expand All @@ -5126,7 +5127,8 @@ subroutine stats_init_clubb( l_stats_in, stats_tsamp_in, stats_tout_in, &

call addfld( trim(sub), (/ 'ilev' /), 'A', &
trim(stats_zm(1)%file%grid_avg_var(i)%units), &
trim(stats_zm(1)%file%grid_avg_var(i)%description) )
trim(stats_zm(1)%file%grid_avg_var(i)%description), &
sampled_on_subcycle=.true. )
enddo

if (stats_metadata%l_output_rad_files) then
Expand All @@ -5137,7 +5139,8 @@ subroutine stats_init_clubb( l_stats_in, stats_tsamp_in, stats_tout_in, &
if (len(temp1) > max_fieldname_len) sub = temp1(1:max_fieldname_len)
call addfld( trim(sub), (/ 'ilev' /), 'A', &
trim(stats_rad_zt(1)%file%grid_avg_var(i)%units), &
trim(stats_rad_zt(1)%file%grid_avg_var(i)%description) )
trim(stats_rad_zt(1)%file%grid_avg_var(i)%description), &
sampled_on_subcycle=.true. )
enddo

do i = 1, stats_rad_zm(1)%num_output_fields
Expand All @@ -5146,7 +5149,8 @@ subroutine stats_init_clubb( l_stats_in, stats_tsamp_in, stats_tout_in, &
if (len(temp1) > max_fieldname_len) sub = temp1(1:max_fieldname_len)
call addfld( trim(sub), (/ 'ilev' /), 'A', &
trim(stats_rad_zm(1)%file%grid_avg_var(i)%units), &
trim(stats_rad_zm(1)%file%grid_avg_var(i)%description) )
trim(stats_rad_zm(1)%file%grid_avg_var(i)%description), &
sampled_on_subcycle=.true. )
enddo
endif

Expand All @@ -5156,7 +5160,8 @@ subroutine stats_init_clubb( l_stats_in, stats_tsamp_in, stats_tout_in, &
if (len(temp1) > max_fieldname_len) sub = temp1(1:max_fieldname_len)
call addfld( trim(sub), horiz_only, 'A', &
trim(stats_sfc(1)%file%grid_avg_var(i)%units), &
trim(stats_sfc(1)%file%grid_avg_var(i)%description) )
trim(stats_sfc(1)%file%grid_avg_var(i)%description), &
sampled_on_subcycle=.true. )
enddo


Expand Down
68 changes: 34 additions & 34 deletions src/physics/cam/hetfrz_classnuc_cam.F90
Original file line number Diff line number Diff line change
Expand Up @@ -228,23 +228,23 @@ subroutine hetfrz_classnuc_cam_init(mincld_in, aero_props)
wactfac_hnames(cnt) = trim(tmpstr)//'_wactfac'

call addfld(tot_dens_hnames(cnt),(/ 'lev' /), 'A', '#/cm3', &
'total '//trim(tmpstr)//' number density' )
'total '//trim(tmpstr)//' number density', sampled_on_subcycle=.true.)
call addfld(cld_dens_hnames(cnt),(/ 'lev' /), 'A', '#/cm3', &
'cloud borne '//trim(tmpstr)//' number density' )
'cloud borne '//trim(tmpstr)//' number density', sampled_on_subcycle=.true.)
call addfld(cldfn_dens_hnames(cnt),(/ 'lev' /), 'A', '#/cm3', &
'cloud borne '//trim(tmpstr)//' number density derived from fn' )
'cloud borne '//trim(tmpstr)//' number density derived from fn', sampled_on_subcycle=.true.)
call addfld(amb_dens_hnames(cnt),(/ 'lev' /), 'A', '#/cm3', &
'ambient '//trim(tmpstr)//' number density' )
'ambient '//trim(tmpstr)//' number density', sampled_on_subcycle=.true.)
call addfld(coated_dens_hnames(cnt),(/ 'lev' /), 'A', '#/cm3', &
'coated '//trim(tmpstr)//' number density' )
'coated '//trim(tmpstr)//' number density', sampled_on_subcycle=.true.)
call addfld(uncoated_dens_hnames(cnt),(/ 'lev' /), 'A', '#/cm3', &
'uncoated '//trim(tmpstr)//' number density' )
'uncoated '//trim(tmpstr)//' number density', sampled_on_subcycle=.true.)
call addfld(coated_frac_hnames(cnt),(/ 'lev' /), 'A', '#/cm3', &
'coated '//trim(tmpstr)//' fraction' )
'coated '//trim(tmpstr)//' fraction', sampled_on_subcycle=.true.)
call addfld(radius_hnames(cnt),(/ 'lev' /), 'A', 'm', &
'ambient '//trim(tmpstr)//' radius' )
'ambient '//trim(tmpstr)//' radius', sampled_on_subcycle=.true.)
call addfld(wactfac_hnames(cnt),(/ 'lev' /), 'A', ' ', &
trim(tmpstr)//' water activity mass factor' )
trim(tmpstr)//' water activity mass factor', sampled_on_subcycle=.true.)

end if
end do
Expand All @@ -261,49 +261,49 @@ subroutine hetfrz_classnuc_cam_init(mincld_in, aero_props)
! pbuf fields used by hetfrz_classnuc
ast_idx = pbuf_get_index('AST')

call addfld('FRZIMM', (/ 'lev' /), 'A', ' ', 'immersion freezing')
call addfld('FRZCNT', (/ 'lev' /), 'A', ' ', 'contact freezing')
call addfld('FRZDEP', (/ 'lev' /), 'A', ' ', 'deposition freezing')
call addfld('FREQIMM', (/ 'lev' /), 'A', 'fraction', 'Fractional occurance of immersion freezing')
call addfld('FREQCNT', (/ 'lev' /), 'A', 'fraction', 'Fractional occurance of contact freezing')
call addfld('FREQDEP', (/ 'lev' /), 'A', 'fraction', 'Fractional occurance of deposition freezing')
call addfld('FREQMIX', (/ 'lev' /), 'A', 'fraction', 'Fractional occurance of mixed-phase clouds' )
call addfld('FRZIMM', (/ 'lev' /), 'A', ' ', 'immersion freezing', sampled_on_subcycle=.true.)
call addfld('FRZCNT', (/ 'lev' /), 'A', ' ', 'contact freezing', sampled_on_subcycle=.true.)
call addfld('FRZDEP', (/ 'lev' /), 'A', ' ', 'deposition freezing', sampled_on_subcycle=.true.)
call addfld('FREQIMM', (/ 'lev' /), 'A', 'fraction', 'Fractional occurance of immersion freezing', sampled_on_subcycle=.true.)
call addfld('FREQCNT', (/ 'lev' /), 'A', 'fraction', 'Fractional occurance of contact freezing', sampled_on_subcycle=.true.)
call addfld('FREQDEP', (/ 'lev' /), 'A', 'fraction', 'Fractional occurance of deposition freezing', sampled_on_subcycle=.true.)
call addfld('FREQMIX', (/ 'lev' /), 'A', 'fraction', 'Fractional occurance of mixed-phase clouds' , sampled_on_subcycle=.true.)

call addfld('DSTFREZIMM', (/ 'lev' /), 'A', 'm-3s-1', 'dust immersion freezing rate')
call addfld('DSTFREZCNT', (/ 'lev' /), 'A', 'm-3s-1', 'dust contact freezing rate')
call addfld('DSTFREZDEP', (/ 'lev' /), 'A', 'm-3s-1', 'dust deposition freezing rate')
call addfld('DSTFREZIMM', (/ 'lev' /), 'A', 'm-3s-1', 'dust immersion freezing rate', sampled_on_subcycle=.true.)
call addfld('DSTFREZCNT', (/ 'lev' /), 'A', 'm-3s-1', 'dust contact freezing rate', sampled_on_subcycle=.true.)
call addfld('DSTFREZDEP', (/ 'lev' /), 'A', 'm-3s-1', 'dust deposition freezing rate', sampled_on_subcycle=.true.)

call addfld('BCFREZIMM', (/ 'lev' /), 'A', 'm-3s-1', 'bc immersion freezing rate')
call addfld('BCFREZCNT', (/ 'lev' /), 'A', 'm-3s-1', 'bc contact freezing rate')
call addfld('BCFREZDEP', (/ 'lev' /), 'A', 'm-3s-1', 'bc deposition freezing rate')
call addfld('BCFREZIMM', (/ 'lev' /), 'A', 'm-3s-1', 'bc immersion freezing rate', sampled_on_subcycle=.true.)
call addfld('BCFREZCNT', (/ 'lev' /), 'A', 'm-3s-1', 'bc contact freezing rate', sampled_on_subcycle=.true.)
call addfld('BCFREZDEP', (/ 'lev' /), 'A', 'm-3s-1', 'bc deposition freezing rate', sampled_on_subcycle=.true.)

call addfld('NIMIX_IMM', (/ 'lev' /), 'A', '#/m3', &
'Activated Ice Number Concentration due to het immersion freezing in Mixed Clouds')
'Activated Ice Number Concentration due to het immersion freezing in Mixed Clouds', sampled_on_subcycle=.true.)
call addfld('NIMIX_CNT', (/ 'lev' /), 'A', '#/m3', &
'Activated Ice Number Concentration due to het contact freezing in Mixed Clouds')
'Activated Ice Number Concentration due to het contact freezing in Mixed Clouds', sampled_on_subcycle=.true.)
call addfld('NIMIX_DEP', (/ 'lev' /), 'A', '#/m3', &
'Activated Ice Number Concentration due to het deposition freezing in Mixed Clouds')
'Activated Ice Number Concentration due to het deposition freezing in Mixed Clouds', sampled_on_subcycle=.true.)

call addfld('DSTNIDEP', (/ 'lev' /), 'A', '#/m3', &
'Activated Ice Number Concentration due to dst dep freezing in Mixed Clouds')
'Activated Ice Number Concentration due to dst dep freezing in Mixed Clouds', sampled_on_subcycle=.true.)
call addfld('DSTNICNT', (/ 'lev' /), 'A', '#/m3', &
'Activated Ice Number Concentration due to dst cnt freezing in Mixed Clouds')
'Activated Ice Number Concentration due to dst cnt freezing in Mixed Clouds', sampled_on_subcycle=.true.)
call addfld('DSTNIIMM', (/ 'lev' /), 'A', '#/m3', &
'Activated Ice Number Concentration due to dst imm freezing in Mixed Clouds')
'Activated Ice Number Concentration due to dst imm freezing in Mixed Clouds', sampled_on_subcycle=.true.)

call addfld('BCNIDEP', (/ 'lev' /), 'A', '#/m3', &
'Activated Ice Number Concentration due to bc dep freezing in Mixed Clouds')
'Activated Ice Number Concentration due to bc dep freezing in Mixed Clouds', sampled_on_subcycle=.true.)
call addfld('BCNICNT', (/ 'lev' /), 'A', '#/m3', &
'Activated Ice Number Concentration due to bc cnt freezing in Mixed Clouds')
'Activated Ice Number Concentration due to bc cnt freezing in Mixed Clouds', sampled_on_subcycle=.true.)
call addfld('BCNIIMM', (/ 'lev' /), 'A', '#/m3', &
'Activated Ice Number Concentration due to bc imm freezing in Mixed Clouds')
'Activated Ice Number Concentration due to bc imm freezing in Mixed Clouds', sampled_on_subcycle=.true.)

call addfld('NUMICE10s', (/ 'lev' /), 'A', '#/m3', &
'Ice Number Concentration due to het freezing in Mixed Clouds during 10-s period')
'Ice Number Concentration due to het freezing in Mixed Clouds during 10-s period', sampled_on_subcycle=.true.)
call addfld('NUMIMM10sDST', (/ 'lev' /), 'A', '#/m3', &
'Ice Number Concentration due to imm freezing by dst in Mixed Clouds during 10-s period')
'Ice Number Concentration due to imm freezing by dst in Mixed Clouds during 10-s period', sampled_on_subcycle=.true.)
call addfld('NUMIMM10sBC', (/ 'lev' /), 'A', '#/m3', &
'Ice Number Concentration due to imm freezing by bc in Mixed Clouds during 10-s period')
'Ice Number Concentration due to imm freezing by bc in Mixed Clouds during 10-s period', sampled_on_subcycle=.true.)

if (hist_hetfrz_classnuc) then

Expand Down
26 changes: 13 additions & 13 deletions src/physics/cam/ndrop.F90
Original file line number Diff line number Diff line change
Expand Up @@ -135,10 +135,10 @@ subroutine ndrop_init(aero_props)

! Add tendency fields to the history only when prognostic MAM is enabled.
long_name = trim(tmpname) // ' dropmixnuc mixnuc column tendency'
call addfld(fieldname(mm), horiz_only, 'A', unit, long_name)
call addfld(fieldname(mm), horiz_only, 'A', unit, long_name, sampled_on_subcycle=.true.)

long_name = trim(tmpname_cw) // ' dropmixnuc mixnuc column tendency'
call addfld(fieldname_cw(mm), horiz_only, 'A', unit, long_name)
call addfld(fieldname_cw(mm), horiz_only, 'A', unit, long_name, sampled_on_subcycle=.true.)

if (history_aerosol) then
call add_default(fieldname(mm), 1, ' ')
Expand All @@ -148,19 +148,19 @@ subroutine ndrop_init(aero_props)
end do
end do

call addfld('CCN1',(/ 'lev' /), 'A','#/cm3','CCN concentration at S=0.02%')
call addfld('CCN2',(/ 'lev' /), 'A','#/cm3','CCN concentration at S=0.05%')
call addfld('CCN3',(/ 'lev' /), 'A','#/cm3','CCN concentration at S=0.1%')
call addfld('CCN4',(/ 'lev' /), 'A','#/cm3','CCN concentration at S=0.2%')
call addfld('CCN5',(/ 'lev' /), 'A','#/cm3','CCN concentration at S=0.5%')
call addfld('CCN6',(/ 'lev' /), 'A','#/cm3','CCN concentration at S=1.0%')
call addfld('CCN1',(/ 'lev' /), 'A','#/cm3','CCN concentration at S=0.02%', sampled_on_subcycle=.true.)
call addfld('CCN2',(/ 'lev' /), 'A','#/cm3','CCN concentration at S=0.05%', sampled_on_subcycle=.true.)
call addfld('CCN3',(/ 'lev' /), 'A','#/cm3','CCN concentration at S=0.1%', sampled_on_subcycle=.true.)
call addfld('CCN4',(/ 'lev' /), 'A','#/cm3','CCN concentration at S=0.2%', sampled_on_subcycle=.true.)
call addfld('CCN5',(/ 'lev' /), 'A','#/cm3','CCN concentration at S=0.5%', sampled_on_subcycle=.true.)
call addfld('CCN6',(/ 'lev' /), 'A','#/cm3','CCN concentration at S=1.0%', sampled_on_subcycle=.true.)


call addfld('WTKE', (/ 'lev' /), 'A', 'm/s', 'Standard deviation of updraft velocity')
call addfld('NDROPMIX', (/ 'lev' /), 'A', '#/kg/s', 'Droplet number mixing')
call addfld('NDROPSRC', (/ 'lev' /), 'A', '#/kg/s', 'Droplet number source')
call addfld('NDROPSNK', (/ 'lev' /), 'A', '#/kg/s', 'Droplet number loss by microphysics')
call addfld('NDROPCOL', horiz_only, 'A', '#/m2', 'Column droplet number')
call addfld('WTKE', (/ 'lev' /), 'A', 'm/s', 'Standard deviation of updraft velocity', sampled_on_subcycle=.true.)
call addfld('NDROPMIX', (/ 'lev' /), 'A', '#/kg/s', 'Droplet number mixing', sampled_on_subcycle=.true.)
call addfld('NDROPSRC', (/ 'lev' /), 'A', '#/kg/s', 'Droplet number source', sampled_on_subcycle=.true.)
call addfld('NDROPSNK', (/ 'lev' /), 'A', '#/kg/s', 'Droplet number loss by microphysics', sampled_on_subcycle=.true.)
call addfld('NDROPCOL', horiz_only, 'A', '#/m2', 'Column droplet number', sampled_on_subcycle=.true.)

! set the add_default fields
if (history_amwg) then
Expand Down
14 changes: 7 additions & 7 deletions src/physics/cam/ndrop_bam.F90
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ subroutine ndrop_bam_init
if (trim(aername(iaer)) == 'SULFATE') idxsul = iaer

! aerosol number concentration
call addfld(trim(aername(iaer))//'_m3', (/ 'lev' /), 'A', 'm-3', 'aerosol number concentration')
call addfld(trim(aername(iaer))//'_m3', (/ 'lev' /), 'A', 'm-3', 'aerosol number concentration', sampled_on_subcycle=.true.)

end do

Expand All @@ -129,12 +129,12 @@ subroutine ndrop_bam_init
end if
end if

call addfld ('CCN1',(/ 'lev' /), 'A','#/cm3','CCN concentration at S=0.02%')
call addfld ('CCN2',(/ 'lev' /), 'A','#/cm3','CCN concentration at S=0.05%')
call addfld ('CCN3',(/ 'lev' /), 'A','#/cm3','CCN concentration at S=0.1%')
call addfld ('CCN4',(/ 'lev' /), 'A','#/cm3','CCN concentration at S=0.2%')
call addfld ('CCN5',(/ 'lev' /), 'A','#/cm3','CCN concentration at S=0.5%')
call addfld ('CCN6',(/ 'lev' /), 'A','#/cm3','CCN concentration at S=1.0%')
call addfld ('CCN1',(/ 'lev' /), 'A','#/cm3','CCN concentration at S=0.02%', sampled_on_subcycle=.true.)
call addfld ('CCN2',(/ 'lev' /), 'A','#/cm3','CCN concentration at S=0.05%', sampled_on_subcycle=.true.)
call addfld ('CCN3',(/ 'lev' /), 'A','#/cm3','CCN concentration at S=0.1%', sampled_on_subcycle=.true.)
call addfld ('CCN4',(/ 'lev' /), 'A','#/cm3','CCN concentration at S=0.2%', sampled_on_subcycle=.true.)
call addfld ('CCN5',(/ 'lev' /), 'A','#/cm3','CCN concentration at S=0.5%', sampled_on_subcycle=.true.)
call addfld ('CCN6',(/ 'lev' /), 'A','#/cm3','CCN concentration at S=1.0%', sampled_on_subcycle=.true.)

if (history_amwg) then
call add_default('CCN3', 1, ' ')
Expand Down
Loading

0 comments on commit 2f59d18

Please sign in to comment.