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

Add alternative data stream control for SO2 species in ext_frc #6562

Merged
merged 3 commits into from
Sep 5, 2024
Merged
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
18 changes: 18 additions & 0 deletions components/eam/bld/namelist_files/namelist_definition.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5138,6 +5138,17 @@ Format: YYYY
Default: 0
</entry>

<entry id="ext_frc_volc_cycle_yr" type="integer" category="cam_chem"
group="chem_inparm" valid_values="" >
The cycle year of the volcanic SO2 forcing (3D emissions) data.
Use this in place of ext_frc_cycle_yr if non-default, to allow different
speciciations volcanic emission and aerosols/precursors, which may be
invoked for single forcing simulation design.
if <varname>ext_frc_volc_type</varname> is 'CYCLICAL'.
Format: YYYY
Default: -1
</entry>

<entry id="ext_frc_fixed_ymd" type="integer" category="cam_chem"
group="chem_inparm" valid_values="" >
Default: current model date
Expand Down Expand Up @@ -5189,6 +5200,13 @@ Can be set to 'CYCLICAL', 'SERIAL', 'INTERP_MISSING_MONTHS', or 'FIXED'.
Default: 'CYCLICAL'
</entry>

<entry id="ext_frc_volc_type" type="char*32" category="cam_chem"
group="chem_inparm" valid_values="NULL,CYCLICAL,SERIAL,INTERP_MISSING_MONTHS,FIXED" >
Type of time interpolation for fixed lower boundary data. See also ext_frc_volc_cycle_yr.
Can be set to 'NULL','CYCLICAL', 'SERIAL', 'INTERP_MISSING_MONTHS', or 'FIXED'.
Default: 'NULL'
</entry>

<entry id="flbc_cycle_yr" type="integer" category="cam_chem"
group="chem_surfvals_nl" valid_values="" >
The cycle year of the fixed lower boundary data
Expand Down
13 changes: 12 additions & 1 deletion components/eam/src/chemistry/mozart/chemistry.F90
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,13 @@ module chemistry
integer :: ext_frc_fixed_ymd = 0
integer :: ext_frc_fixed_tod = 0

! alternative type and cycle year for volcanic and other SO2 for controlling single forcing experiments
! if NULL, same treatment as for the other species.
! Possible in the future to modify further and apply to volcanic sector of SO2 alone

character(len=24) :: ext_frc_volc_type = 'NULL' !'NULL'|'CYCLICAL'|'SERIAL'|'INTERP_MISSING_MONTHS'
integer :: ext_frc_volc_cycle_yr = -1

real(r8) :: dms_emis_scale = 1._r8

! fixed stratosphere
Expand Down Expand Up @@ -515,7 +522,7 @@ subroutine chem_readnl(nlfile)
srf_emis_type, srf_emis_cycle_yr, srf_emis_fixed_ymd, srf_emis_fixed_tod, srf_emis_specifier, &
fstrat_file, fstrat_list, fstrat_efold_list, &
ext_frc_specifier, ext_frc_type, ext_frc_cycle_yr, ext_frc_fixed_ymd, ext_frc_fixed_tod, &
dms_emis_scale
ext_frc_volc_type, ext_frc_volc_cycle_yr, dms_emis_scale

namelist /chem_inparm/ chem_rad_passive

Expand Down Expand Up @@ -689,6 +696,8 @@ subroutine chem_readnl(nlfile)
call mpibcast (ext_frc_cycle_yr, 1, mpiint, 0, mpicom)
call mpibcast (ext_frc_fixed_ymd, 1, mpiint, 0, mpicom)
call mpibcast (ext_frc_fixed_tod, 1, mpiint, 0, mpicom)
call mpibcast (ext_frc_volc_type, len(ext_frc_volc_type), mpichar, 0, mpicom)
call mpibcast (ext_frc_volc_cycle_yr, 1, mpiint, 0, mpicom)

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

Expand Down Expand Up @@ -1033,6 +1042,8 @@ subroutine chem_init(phys_state, pbuf2d, species_class)
, ext_frc_cycle_yr &
, ext_frc_fixed_ymd &
, ext_frc_fixed_tod &
, ext_frc_volc_type &
, ext_frc_volc_cycle_yr &
, xactive_prates &
, exo_coldens_file &
, tuv_xsect_file &
Expand Down
7 changes: 6 additions & 1 deletion components/eam/src/chemistry/mozart/mo_chemini.F90
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ subroutine chemini &
, ext_frc_cycle_yr &
, ext_frc_fixed_ymd &
, ext_frc_fixed_tod &
, ext_frc_volc_type &
, ext_frc_volc_cycle_yr &
, xactive_prates &
, exo_coldens_file &
, tuv_xsect_file &
Expand Down Expand Up @@ -133,6 +135,8 @@ subroutine chemini &
integer, intent(in) :: ext_frc_cycle_yr
integer, intent(in) :: ext_frc_fixed_ymd
integer, intent(in) :: ext_frc_fixed_tod
character(len=*), intent(in) :: ext_frc_volc_type
integer, intent(in) :: ext_frc_volc_cycle_yr
character(len=*), intent(in) :: srf_emis_type
integer, intent(in) :: srf_emis_cycle_yr
integer, intent(in) :: srf_emis_fixed_ymd
Expand Down Expand Up @@ -183,7 +187,8 @@ subroutine chemini &
! ... initialize external forcings module
!-----------------------------------------------------------------------
call setext_inti()
call extfrc_inti(ext_frc_specifier, ext_frc_type, ext_frc_cycle_yr, ext_frc_fixed_ymd, ext_frc_fixed_tod)
call extfrc_inti(ext_frc_specifier, ext_frc_type, ext_frc_cycle_yr, ext_frc_fixed_ymd, ext_frc_fixed_tod, &
ext_frc_volc_type, ext_frc_volc_cycle_yr)
if (masterproc) write(iulog,*) 'chemini: after extfrc_inti on node ',iam

!-----------------------------------------------------------------------
Expand Down
31 changes: 25 additions & 6 deletions components/eam/src/chemistry/mozart/mo_extfrc.F90
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ module mo_extfrc

contains

subroutine extfrc_inti( extfrc_specifier, extfrc_type, extfrc_cycle_yr, extfrc_fixed_ymd, extfrc_fixed_tod)
subroutine extfrc_inti( extfrc_specifier, extfrc_type, extfrc_cycle_yr, extfrc_fixed_ymd, extfrc_fixed_tod, &
extfrc_volc_type, extfrc_volc_cycle_yr)

!-----------------------------------------------------------------------
! ... initialize the surface forcings
Expand All @@ -71,6 +72,8 @@ subroutine extfrc_inti( extfrc_specifier, extfrc_type, extfrc_cycle_yr, extfrc_f
integer , intent(in) :: extfrc_cycle_yr
integer , intent(in) :: extfrc_fixed_ymd
integer , intent(in) :: extfrc_fixed_tod
character(len=*), intent(in) :: extfrc_volc_type
integer , intent(in) :: extfrc_volc_cycle_yr

!-----------------------------------------------------------------------
! ... local variables
Expand Down Expand Up @@ -204,6 +207,14 @@ subroutine extfrc_inti( extfrc_specifier, extfrc_type, extfrc_cycle_yr, extfrc_f
else if( extfrc_type == 'CYCLICAL' ) then
write(iulog,*) ' cycle year = ',extfrc_cycle_yr
end if
if (extfrc_volc_type /= 'NULL' ) then
write(iulog,*) ' '
write(iulog,*) 'Volcanic SO2 type = ',extfrc_volc_type
if (extfrc_volc_type == 'CYCLICAL' ) then
write(iulog,*) ' '
write(iulog,*) 'Volcanic SO2 cycle year = ',extfrc_volc_cycle_yr
end if
end if
write(iulog,*) ' '
write(iulog,*) 'there are ',extfrc_cnt,' species with external forcing files'
do m = 1,extfrc_cnt
Expand Down Expand Up @@ -264,11 +275,19 @@ subroutine extfrc_inti( extfrc_specifier, extfrc_type, extfrc_cycle_yr, extfrc_f

allocate(forcings(m)%file%in_pbuf(size(forcings(m)%sectors)))
forcings(m)%file%in_pbuf(:) = .false.
call trcdata_init( forcings(m)%sectors, &
forcings(m)%filename, filelist, datapath, &
forcings(m)%fields, &
forcings(m)%file, &
rmv_file, extfrc_cycle_yr, extfrc_fixed_ymd, extfrc_fixed_tod, extfrc_type)
if (trim(forcings(m)%species) == 'SO2' .and. extfrc_volc_type /= 'NULL') then
call trcdata_init( forcings(m)%sectors, &
forcings(m)%filename, filelist, datapath, &
forcings(m)%fields, &
forcings(m)%file, rmv_file, extfrc_volc_cycle_yr, &
extfrc_fixed_ymd, extfrc_fixed_tod, extfrc_volc_type)
else
call trcdata_init( forcings(m)%sectors, &
forcings(m)%filename, filelist, datapath, &
forcings(m)%fields, &
forcings(m)%file, &
rmv_file, extfrc_cycle_yr, extfrc_fixed_ymd, extfrc_fixed_tod, extfrc_type)
end if

enddo frcing_loop

Expand Down
2 changes: 1 addition & 1 deletion components/eam/src/chemistry/utils/tracer_data.F90
Original file line number Diff line number Diff line change
Expand Up @@ -660,7 +660,7 @@ subroutine advance_trcdata( flds, file, state, pbuf2d )
call t_startf('read_next_trcdata')
call read_next_trcdata(state, flds, file )
call t_stopf('read_next_trcdata')
if(masterproc) write(iulog,*) 'READ_NEXT_TRCDATA ', flds%fldnam
if(masterproc) write(iulog,*) 'READ_NEXT_TRCDATA ', flds%fldnam,data_time
end if

endif
Expand Down