Skip to content

Commit

Permalink
Merge pull request #795 from fvitt/ocean_emis
Browse files Browse the repository at this point in the history
cam6_3_108: Ocean emissions fix
  • Loading branch information
fvitt authored Apr 27, 2023
2 parents fc3cc80 + 0be2736 commit 5e11806
Show file tree
Hide file tree
Showing 13 changed files with 780 additions and 401 deletions.
2 changes: 1 addition & 1 deletion Externals.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ externals = Externals.cfg
required = True

[cmeps]
tag = cmeps0.14.18
tag = cmeps0.14.24
protocol = git
repo_url = https://github.com/ESCOMP/CMEPS.git
local_path = components/cmeps
Expand Down
31 changes: 20 additions & 11 deletions bld/build-namelist
Original file line number Diff line number Diff line change
Expand Up @@ -3475,14 +3475,16 @@ if ( length($nl->get_value('soil_erod_file'))>0 ) {
else {
if ($chem =~ /trop_strat/ or $chem =~ /waccm_ma/ or $chem =~ /waccm_tsmlt/ or $chem =~ /trop_mozart/) {
add_default($nl, 'dust_emis_fact', 'ver'=>'chem');
# set scaling of lightning NOx production
add_default($nl, 'lght_no_prd_factor' );
}
else {
add_default($nl, 'dust_emis_fact');
}
}
}
if (chem_has_species($cfg, 'NO')) {
# set scaling of lightning NOx production
add_default($nl, 'lght_no_prd_factor' );
}

# Seasalt emissions tuning factor
if ($chem =~ /_mam(\d)/) {
Expand Down Expand Up @@ -4111,6 +4113,21 @@ add_default($nl, 'cam_snapshot_before_num');
add_default($nl, 'cam_snapshot_after_num');
check_snapshot_settings();

if ($opts{'cmeps'}) {
# advertise the nature of ozone data passed to surface models
if ($rad_prog_ozone) {
add_default($nl, 'atm_ozone_frequency', 'val'=>'subdaily');
} else {
add_default($nl, 'atm_ozone_frequency', 'val'=>'multiday_average');
}
# for lightning flash freq to CTSM
if ($simple_phys or $aqua_mode) {
add_default($nl, 'atm_provides_lightning', 'val'=>'.false.');
} else {
add_default($nl, 'atm_provides_lightning', 'val'=>'.true.');
}
}

#-----------------------------------------------------------------------------------------------
# Write output files

Expand All @@ -4127,16 +4144,8 @@ my %nl_group = ();
foreach my $name (@nl_groups) { $nl_group{$name} = ''; }

# Dry deposition, MEGAN VOC emis and ozone namelists
@comp_groups = qw(drydep_inparm megan_emis_nl fire_emis_nl carma_inparm ndep_inparm ozone_coupling_nl);
@comp_groups = qw(drydep_inparm megan_emis_nl fire_emis_nl carma_inparm ndep_inparm ozone_coupling_nl lightning_coupling_nl);

# nature of ozone data passed to surface models -- only if cmeps (nuopc) coupling is used
if ($opts{'cmeps'}) {
if ($rad_prog_ozone) {
add_default($nl, 'atm_ozone_frequency', 'val'=>'subdaily');
} else {
add_default($nl, 'atm_ozone_frequency', 'val'=>'multiday_average');
}
}
$outfile = "$opts{'dir'}/drv_flds_in";
$nl->write($outfile, 'groups'=>\@comp_groups);
if ($print>=1) {
Expand Down
14 changes: 7 additions & 7 deletions bld/namelist_files/namelist_definition.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6197,14 +6197,8 @@ List of species that are constrained in the stratosphere.
Default: set by build-namelist.
</entry>

<entry id="lght_landmask_file" type="char*256" input_pathname="abs" category="cam_chem"
group="chem_inparm" valid_values="" >
Full pathname of dataset for land mask applied to the lighting NOx production
Default: set by build-namelist.
</entry>

<entry id="lght_no_prd_factor" type="real" category="cam_chem"
group="chem_inparm" valid_values="" >
group="lightning_nl" valid_values="" >
Multiplication factor applied to the lighting NOx production
Default: 1.0.
</entry>
Expand Down Expand Up @@ -7312,6 +7306,12 @@ coarser temporal resolution.
Default: set by build-namelist.
</entry>

<entry id="atm_provides_lightning" type="logical" category="lightning_coupling"
group="lightning_coupling_nl" valid_values="">
If TRUE atmosphere model will provide prognosed lightning flash frequency.
Default: FALSE
</entry>

<!-- WACCM_GHG Chemistry -->

<entry id="waccm_forcing_file" type="char*256" input_pathname="rel:waccm_forcing_datapath" category="waccm_sc"
Expand Down
230 changes: 228 additions & 2 deletions doc/ChangeLog

Large diffs are not rendered by default.

10 changes: 0 additions & 10 deletions src/chemistry/mozart/chemistry.F90
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,6 @@ module chemistry
character(len=shr_kind_cl) :: bndtvg = ' ' ! pathname for greenhouse gas loss rate
character(len=shr_kind_cl) :: h2orates = ' ' ! pathname for greenhouse gas (lyman-alpha H2O loss)

! lightning

real(r8) :: lght_no_prd_factor = 1._r8

! photolysis

character(len=shr_kind_cl) :: rsf_file = 'rsf_file'
Expand Down Expand Up @@ -377,7 +373,6 @@ subroutine chem_readnl(nlfile)
xs_coef_file, xs_short_file, &
exo_coldens_file, &
xs_long_file, rsf_file, photo_max_zen, &
lght_no_prd_factor, &
depvel_lnd_file, drydep_srf_file, &
srf_emis_type, srf_emis_cycle_yr, srf_emis_fixed_ymd, srf_emis_fixed_tod, srf_emis_specifier, &
fstrat_file, fstrat_list, &
Expand Down Expand Up @@ -454,10 +449,6 @@ subroutine chem_readnl(nlfile)
call mpibcast (bndtvg, len(bndtvg), mpichar, 0, mpicom)
call mpibcast (h2orates, len(h2orates), mpichar, 0, mpicom)

! lightning

call mpibcast (lght_no_prd_factor,1, mpir8, 0, mpicom)

! photolysis

call mpibcast (rsf_file, len(rsf_file), mpichar, 0, mpicom)
Expand Down Expand Up @@ -766,7 +757,6 @@ subroutine chem_init(phys_state, pbuf2d)
, ext_frc_fixed_ymd &
, ext_frc_fixed_tod &
, exo_coldens_file &
, lght_no_prd_factor &
, pbuf2d &
)

Expand Down
9 changes: 0 additions & 9 deletions src/chemistry/mozart/mo_chemini.F90
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ subroutine chemini &
, ext_frc_fixed_ymd &
, ext_frc_fixed_tod &
, exo_coldens_file &
, lght_no_prd_factor &
, pbuf2d &
)

Expand All @@ -48,7 +47,6 @@ subroutine chemini &
use mo_srf_emissions, only : srf_emissions_inti
use mo_sulf, only : sulf_inti
use mo_photo, only : photo_inti
use mo_lightning, only : lightning_inti
use mo_drydep, only : drydep_inti
use mo_imp_sol, only : imp_slv_inti
use mo_exp_sol, only : exp_sol_inti
Expand Down Expand Up @@ -94,7 +92,6 @@ subroutine chemini &
character(len=*), dimension(:), intent(in) :: srf_emis_specifier
character(len=*), dimension(:), intent(in) :: ext_frc_specifier
character(len=*), intent(in) :: exo_coldens_file
real(r8), intent(in) :: lght_no_prd_factor
character(len=*), intent(in) :: ext_frc_type
integer, intent(in) :: ext_frc_cycle_yr
integer, intent(in) :: ext_frc_fixed_ymd
Expand Down Expand Up @@ -161,12 +158,6 @@ subroutine chemini &
call sad_inti(pbuf2d)
if (masterproc) write(iulog,*) 'chemini: after sad_inti on node ',iam

!-----------------------------------------------------------------------
! ... initialize the lightning module
!-----------------------------------------------------------------------
call lightning_inti(lght_no_prd_factor)
if (masterproc) write(iulog,*) 'chemini: after lightning_inti on node ',iam

!-----------------------------------------------------------------------
! ... initialize the dry deposition module
!-----------------------------------------------------------------------
Expand Down
Loading

0 comments on commit 5e11806

Please sign in to comment.