Skip to content

Commit 9a76455

Browse files
committed
Merge branch 'wlin/atm/set_volc_stream_params' into next (PR #6562)
Add alternative data stream control for SO2 species in ext_frc Made changes to allow SO2 species in ext_frc_specifier to have a separate data stream control (e.g., type, cycle_yr) from that for the other species. This is probably the simplest way to allow only volcanic SO2 to vary with time while holding all other SO2 sectors to a fixed year in historical single forcing experiment design. [BFB] for existing tests.
2 parents ee905bb + c5eb35f commit 9a76455

File tree

5 files changed

+62
-9
lines changed

5 files changed

+62
-9
lines changed

components/eam/bld/namelist_files/namelist_definition.xml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5138,6 +5138,17 @@ Format: YYYY
51385138
Default: 0
51395139
</entry>
51405140

5141+
<entry id="ext_frc_volc_cycle_yr" type="integer" category="cam_chem"
5142+
group="chem_inparm" valid_values="" >
5143+
The cycle year of the volcanic SO2 forcing (3D emissions) data.
5144+
Use this in place of ext_frc_cycle_yr if non-default, to allow different
5145+
speciciations volcanic emission and aerosols/precursors, which may be
5146+
invoked for single forcing simulation design.
5147+
if <varname>ext_frc_volc_type</varname> is 'CYCLICAL'.
5148+
Format: YYYY
5149+
Default: -1
5150+
</entry>
5151+
51415152
<entry id="ext_frc_fixed_ymd" type="integer" category="cam_chem"
51425153
group="chem_inparm" valid_values="" >
51435154
Default: current model date
@@ -5189,6 +5200,13 @@ Can be set to 'CYCLICAL', 'SERIAL', 'INTERP_MISSING_MONTHS', or 'FIXED'.
51895200
Default: 'CYCLICAL'
51905201
</entry>
51915202

5203+
<entry id="ext_frc_volc_type" type="char*32" category="cam_chem"
5204+
group="chem_inparm" valid_values="NULL,CYCLICAL,SERIAL,INTERP_MISSING_MONTHS,FIXED" >
5205+
Type of time interpolation for fixed lower boundary data. See also ext_frc_volc_cycle_yr.
5206+
Can be set to 'NULL','CYCLICAL', 'SERIAL', 'INTERP_MISSING_MONTHS', or 'FIXED'.
5207+
Default: 'NULL'
5208+
</entry>
5209+
51925210
<entry id="flbc_cycle_yr" type="integer" category="cam_chem"
51935211
group="chem_surfvals_nl" valid_values="" >
51945212
The cycle year of the fixed lower boundary data

components/eam/src/chemistry/mozart/chemistry.F90

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,13 @@ module chemistry
106106
integer :: ext_frc_fixed_ymd = 0
107107
integer :: ext_frc_fixed_tod = 0
108108

109+
! alternative type and cycle year for volcanic and other SO2 for controlling single forcing experiments
110+
! if NULL, same treatment as for the other species.
111+
! Possible in the future to modify further and apply to volcanic sector of SO2 alone
112+
113+
character(len=24) :: ext_frc_volc_type = 'NULL' !'NULL'|'CYCLICAL'|'SERIAL'|'INTERP_MISSING_MONTHS'
114+
integer :: ext_frc_volc_cycle_yr = -1
115+
109116
real(r8) :: dms_emis_scale = 1._r8
110117

111118
! fixed stratosphere
@@ -515,7 +522,7 @@ subroutine chem_readnl(nlfile)
515522
srf_emis_type, srf_emis_cycle_yr, srf_emis_fixed_ymd, srf_emis_fixed_tod, srf_emis_specifier, &
516523
fstrat_file, fstrat_list, fstrat_efold_list, &
517524
ext_frc_specifier, ext_frc_type, ext_frc_cycle_yr, ext_frc_fixed_ymd, ext_frc_fixed_tod, &
518-
dms_emis_scale
525+
ext_frc_volc_type, ext_frc_volc_cycle_yr, dms_emis_scale
519526

520527
namelist /chem_inparm/ chem_rad_passive
521528

@@ -689,6 +696,8 @@ subroutine chem_readnl(nlfile)
689696
call mpibcast (ext_frc_cycle_yr, 1, mpiint, 0, mpicom)
690697
call mpibcast (ext_frc_fixed_ymd, 1, mpiint, 0, mpicom)
691698
call mpibcast (ext_frc_fixed_tod, 1, mpiint, 0, mpicom)
699+
call mpibcast (ext_frc_volc_type, len(ext_frc_volc_type), mpichar, 0, mpicom)
700+
call mpibcast (ext_frc_volc_cycle_yr, 1, mpiint, 0, mpicom)
692701

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

@@ -1033,6 +1042,8 @@ subroutine chem_init(phys_state, pbuf2d, species_class)
10331042
, ext_frc_cycle_yr &
10341043
, ext_frc_fixed_ymd &
10351044
, ext_frc_fixed_tod &
1045+
, ext_frc_volc_type &
1046+
, ext_frc_volc_cycle_yr &
10361047
, xactive_prates &
10371048
, exo_coldens_file &
10381049
, tuv_xsect_file &

components/eam/src/chemistry/mozart/mo_chemini.F90

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ subroutine chemini &
4343
, ext_frc_cycle_yr &
4444
, ext_frc_fixed_ymd &
4545
, ext_frc_fixed_tod &
46+
, ext_frc_volc_type &
47+
, ext_frc_volc_cycle_yr &
4648
, xactive_prates &
4749
, exo_coldens_file &
4850
, tuv_xsect_file &
@@ -133,6 +135,8 @@ subroutine chemini &
133135
integer, intent(in) :: ext_frc_cycle_yr
134136
integer, intent(in) :: ext_frc_fixed_ymd
135137
integer, intent(in) :: ext_frc_fixed_tod
138+
character(len=*), intent(in) :: ext_frc_volc_type
139+
integer, intent(in) :: ext_frc_volc_cycle_yr
136140
character(len=*), intent(in) :: srf_emis_type
137141
integer, intent(in) :: srf_emis_cycle_yr
138142
integer, intent(in) :: srf_emis_fixed_ymd
@@ -183,7 +187,8 @@ subroutine chemini &
183187
! ... initialize external forcings module
184188
!-----------------------------------------------------------------------
185189
call setext_inti()
186-
call extfrc_inti(ext_frc_specifier, ext_frc_type, ext_frc_cycle_yr, ext_frc_fixed_ymd, ext_frc_fixed_tod)
190+
call extfrc_inti(ext_frc_specifier, ext_frc_type, ext_frc_cycle_yr, ext_frc_fixed_ymd, ext_frc_fixed_tod, &
191+
ext_frc_volc_type, ext_frc_volc_cycle_yr)
187192
if (masterproc) write(iulog,*) 'chemini: after extfrc_inti on node ',iam
188193

189194
!-----------------------------------------------------------------------

components/eam/src/chemistry/mozart/mo_extfrc.F90

Lines changed: 25 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,8 @@ module mo_extfrc
4646

4747
contains
4848

49-
subroutine extfrc_inti( extfrc_specifier, extfrc_type, extfrc_cycle_yr, extfrc_fixed_ymd, extfrc_fixed_tod)
49+
subroutine extfrc_inti( extfrc_specifier, extfrc_type, extfrc_cycle_yr, extfrc_fixed_ymd, extfrc_fixed_tod, &
50+
extfrc_volc_type, extfrc_volc_cycle_yr)
5051

5152
!-----------------------------------------------------------------------
5253
! ... initialize the surface forcings
@@ -71,6 +72,8 @@ subroutine extfrc_inti( extfrc_specifier, extfrc_type, extfrc_cycle_yr, extfrc_f
7172
integer , intent(in) :: extfrc_cycle_yr
7273
integer , intent(in) :: extfrc_fixed_ymd
7374
integer , intent(in) :: extfrc_fixed_tod
75+
character(len=*), intent(in) :: extfrc_volc_type
76+
integer , intent(in) :: extfrc_volc_cycle_yr
7477

7578
!-----------------------------------------------------------------------
7679
! ... local variables
@@ -204,6 +207,14 @@ subroutine extfrc_inti( extfrc_specifier, extfrc_type, extfrc_cycle_yr, extfrc_f
204207
else if( extfrc_type == 'CYCLICAL' ) then
205208
write(iulog,*) ' cycle year = ',extfrc_cycle_yr
206209
end if
210+
if (extfrc_volc_type /= 'NULL' ) then
211+
write(iulog,*) ' '
212+
write(iulog,*) 'Volcanic SO2 type = ',extfrc_volc_type
213+
if (extfrc_volc_type == 'CYCLICAL' ) then
214+
write(iulog,*) ' '
215+
write(iulog,*) 'Volcanic SO2 cycle year = ',extfrc_volc_cycle_yr
216+
end if
217+
end if
207218
write(iulog,*) ' '
208219
write(iulog,*) 'there are ',extfrc_cnt,' species with external forcing files'
209220
do m = 1,extfrc_cnt
@@ -264,11 +275,19 @@ subroutine extfrc_inti( extfrc_specifier, extfrc_type, extfrc_cycle_yr, extfrc_f
264275

265276
allocate(forcings(m)%file%in_pbuf(size(forcings(m)%sectors)))
266277
forcings(m)%file%in_pbuf(:) = .false.
267-
call trcdata_init( forcings(m)%sectors, &
268-
forcings(m)%filename, filelist, datapath, &
269-
forcings(m)%fields, &
270-
forcings(m)%file, &
271-
rmv_file, extfrc_cycle_yr, extfrc_fixed_ymd, extfrc_fixed_tod, extfrc_type)
278+
if (trim(forcings(m)%species) == 'SO2' .and. extfrc_volc_type /= 'NULL') then
279+
call trcdata_init( forcings(m)%sectors, &
280+
forcings(m)%filename, filelist, datapath, &
281+
forcings(m)%fields, &
282+
forcings(m)%file, rmv_file, extfrc_volc_cycle_yr, &
283+
extfrc_fixed_ymd, extfrc_fixed_tod, extfrc_volc_type)
284+
else
285+
call trcdata_init( forcings(m)%sectors, &
286+
forcings(m)%filename, filelist, datapath, &
287+
forcings(m)%fields, &
288+
forcings(m)%file, &
289+
rmv_file, extfrc_cycle_yr, extfrc_fixed_ymd, extfrc_fixed_tod, extfrc_type)
290+
end if
272291

273292
enddo frcing_loop
274293

components/eam/src/chemistry/utils/tracer_data.F90

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -660,7 +660,7 @@ subroutine advance_trcdata( flds, file, state, pbuf2d )
660660
call t_startf('read_next_trcdata')
661661
call read_next_trcdata(state, flds, file )
662662
call t_stopf('read_next_trcdata')
663-
if(masterproc) write(iulog,*) 'READ_NEXT_TRCDATA ', flds%fldnam
663+
if(masterproc) write(iulog,*) 'READ_NEXT_TRCDATA ', flds%fldnam,data_time
664664
end if
665665

666666
endif

0 commit comments

Comments
 (0)