Skip to content

Thompson AA enhancements: BC aerosol, biomass burning emissions, and …#1616

Merged
davegill merged 3 commits intowrf-model:developfrom
twjuliano:develop_wrf_solar_bc_on_top
Jan 20, 2022
Merged

Thompson AA enhancements: BC aerosol, biomass burning emissions, and …#1616
davegill merged 3 commits intowrf-model:developfrom
twjuliano:develop_wrf_solar_bc_on_top

Conversation

@twjuliano
Copy link
Contributor

@twjuliano twjuliano commented Dec 22, 2021

TYPE: enhancement

KEYWORDS: real, Thompson aerosol-aware, microphysics

SOURCE: Timothy W. Juliano and Pedro A. Jimenez (NCAR/RAL)

DESCRIPTION OF CHANGES:
Problem:
Several enhancements have been made to the Thompson Aerosol-Aware microphysics scheme
(mp_physics=28) related to the addition of:

  1. black carbon (BC) aerosol category from either climatology (e.g., GOCART) or first guess aerosol source (e.g., GEOS-5);
  2. biomass burning aerosol (organic carbon (OC) and BC) emissions from a first guess aerosol source (e.g., GEOS-5);
  3. time-varying surface emissions from a first guess aerosol source (e.g., GEOS-5)

Solution:

  1. Addition of a new category (3D scalar variable, QNBCA), that represents BC aerosol for the Thompson Aerosol Aware (AA) microphysics scheme. This variable is handled in a similar fashion as QNWFA and QNIFA (water-friendly and ice-friendly aerosols, respectively), including the surface emissions. In terms of the microphysical activity of QNBCA, at present we consider only its removal due to wet scavenging by rain, snow, and graupel. We recognize that this is a limitation of the current implementation; however, more detailed investigation into the water/ice nucleating abilities of BC are needed and left for future work. As a result of this limitation, activation of BC aerosol is made through the &domains namelist option, wif_input_opt: =1 retains the current meaning (water- and ice-friendly aerosols only) and =2 adds the BC aerosol on top of the water- and ice-friendly aerosols. This allows a user to active the Thompson AA scheme as in its original implementation if desired.

To account for the radiative contribution of BC aerosols (which are strongly absorbing compared to the QNWFA and QNIFA aerosols that are strongly scattering) to diagnosed AOD at 550nm, we extend the look-up table in subroutine gt_aod. The new look-up table values are computed using Mie code provided by Trude Eidhammer (NCAR/RAL). For BC, we use the following parameter values:

  • Modal radius = 11.8 nm following Chin et al. (2002) to maintain consistency with the original implementation of the Thompson AA scheme
  • Geometric standard deviation = 2.0 following Chin et al. (2002) to maintain consistency with the original implementation of the Thompson AA scheme
  • Real and imaginary indices of refraction = 1.85 and 0.71, respectively, following Bond et al. (2006)
  • Hygroscopicity = 0.2 following Engelhart et al. (2012)

Citations:
Chin, M., Ginoux, P., Kinne, S., Torres, O., Holben, B. N., Duncan, B. N., Martin, R. V., Logan, J. A., Higurashi, A., & Nakajima, T. (2002). Tropospheric Aerosol Optical Thickness from the GOCART Model and Comparisons with Satellite and Sun Photometer Measurements, Journal of the Atmospheric Sciences, 59(3), 461-483. Retrieved Dec 22, 2021, from https://journals.ametsoc.org/view/journals/atsc/59/3/1520-0469_2002_059_0461_taotft_2.0.co_2.xml

Bond, T. C., G. Habib, and R. W. Bergstrom (2006), Limitations in the enhancement of visible light absorption due to mixing state, J. Geophys. Res., 111, D20211, doi:10.1029/2006JD007315.

Engelhart, G. J., Hennigan, C. J., Miracolo, M. A., Robinson, A. L., and Pandis, S. N.: Cloud condensation nuclei activity of fresh primary and aged biomass burning aerosol, Atmos. Chem. Phys., 12, 7285–7293, https://doi.org/10.5194/acp-12-7285-2012, 2012.

  1. Addition of OC and BC biomass burning aerosol emissions. These two aerosols are important during periods of active wildfires. Therefore, only when using a first guess aerosol source that has information about biomass burning emissions (e.g., GEOS-5), a user may include these effects through a new &physics namelist option: wif_fire_emit (logical). We note that if wif_fire_emit=.true. and wif_input_opt=1 (i.e., water- and ice-friendly aerosols only), then only OC biomass burning aerosols are emitted, as OC is included in the water-friendly category. However, if wif_fire_emit=.true. and wif_input_opt=2 (i.e., water- and ice-friendly plus BC aerosols), then both OC and BC biomass burning aerosols are emitted. This logic is handled using a surrogate integer variable (aer_fire_emit_opt) that is invisible to the user and thus defined on the Registry as a derived variable. Using the integer variable allows us to properly handle the new emission variables using packages while maintaining simplicity for the user to set a single, logical namelist option. To complement this enhancement, by default we distribute the OC/BC fire aerosols evenly throughout the PBL column (&physics namelist option: wif_fire_inj=1) as a simple plume rise parameterization. This is controllable through the namelist, and we set a warning message in check_a_mundo if the user is not running a PBL scheme with wif_fire_inj=1, as resolved vertical motions may be sufficient such that the parameterization should be turned off.

  2. Modifications have been made to the METGRID.TBL file to handle the processing of the new QNBCA aerosol, as well as the surface emissions of anthropogenic QNBCA (QNBCA2D – similar to QNWFA2D and QNIFA2D) and surface emissions of OC and BC biomass burning aerosols (QNOCBB2D and QNBCBB2D, respectively).

The modifications to METGRID.TBL may be found in the WPS#201 (wrf-model/WPS#201):

We add entries to METGRID.TBL to handle the black carbon aerosol category in addition to biomass burning emissions. Specifically, we:

  • add monthly climatology entries for black carbon aerosol (B_WIF_*) which generate FLAG_QNBCA_CL for processing in real
  • add first guess entry for black carbon aerosol (QNBCA) which generates FLAG_QNBCA for processing in real
  • add first guess entry for anthropogenic emission of black carbon aerosol (QNBCA2D) which generates FLAG_QNBCA2D
  • add first guess entries for biomass burning emissions of organic carbon (QNOCBB2D) and black carbon (QNBCBB2D) which generate FLAG_QNOCBB2D and FLAG_QNBCBB2D, respectively

Note that the new .dat file for monthly GOCART climatology is hosted on Google Drive: https://drive.google.com/file/d/1BYflyu65kP5giRYbTzKo6y4iSnTfb1Fw/view?usp=sharing

  1. The ability to have time-varying aerosol emissions has been added. This capability is handled through &physics namelist option qna_update=1, similar to sst_update=1. The I/O for qna_update is done through auxinput17 and the file generated during real is called wrfqnainp_d0* (individual files for each domain, again similar to wrflowinp for sst_update=1).

LIST OF MODIFIED FILES:
M Registry/Registry.EM_COMMON
M Registry/registry.new3d_wif
M dyn_em/module_em.F
M dyn_em/module_first_rk_step_part1.F
M dyn_em/module_initialize_real.F
M dyn_em/solve_em.F
M dyn_em/start_em.F
M main/real_em.F
M phys/module_bl_mynn.F
M phys/module_microphysics_driver.F
M phys/module_mp_thompson.F
M phys/module_pbl_driver.F
M phys/module_physics_init.F
M phys/module_radiation_driver.F
M share/input_wrf.F
M share/mediation_integrate.F
M share/module_check_a_mundo.F
M share/module_optional_input.F

TESTS CONDUCTED:

  1. We have conducted numerous simulations with the new code for a 21-day period in 2016 and a 9-day period in 2020 during active wildfire events. AOD/irradiance quantities from the model output have been compared to observations. For the 2020 wildfire event, our findings are summarized in a manuscript that is currently under review (Juliano, T. W., P. A. Jiménez, B. Kosović, T. Eidhammer, G. Thompson, J. Fast, L. Berg, A. Motley, and A. Polidori, 2021: Smoke from 2020 United States wildfires responsible for substantial solar energy forecast errors, in review at Environmental Research Letters).

  2. Jenkins tests are all passing.

RELEASE NOTE: A black carbon aerosol category has been added to the Thompson Aerosol-Aware microphysics scheme. Moreover, code enhancements are introduced to allow for time-varying surface aerosol emissions, in addition to consideration of biomass burning organic and black carbon aerosols when using a first guess aerosol source (e.g., GEOS-5).

@davegill
Copy link
Contributor

davegill commented Dec 23, 2021

@twjuliano
Tim,
You have all of these if (wif_input_opt .eq. 2) then statements, but the variable wif_input_opt is declared, and is not an input argument to the MP=8 Thompson scheme. Every MP=8 Thompson test is failing with a segfault.

There are two solutions:

  1. Pass in a DO_NOT_USE_THIS value in for wif_input_opt for MP=8 (maybe wif_input_opt=-1.
  2. Surround each of the tests with an IF ( PRESENT()) test:
          if (wif_input_opt .eq. 2) then
             Ef_sa = Eff_aero(xDs,0.0236E-6,visco(k),rho(k),temp(k),'s')
             pnb_scb(k) = rhof(k)*t1_qs_qc*Ef_sa*nbca(k)*smoe(k)
             pnb_scb(k) = MIN(DBLE(nbca(k)*odts), pnb_scb(k))
          endif
          if(present(wif_input_opt))then
             if (wif_input_opt .eq. 2) then
                Ef_sa = Eff_aero(xDs,0.0236E-6,visco(k),rho(k),temp(k),'s')
                pnb_scb(k) = rhof(k)*t1_qs_qc*Ef_sa*nbca(k)*smoe(k)
                pnb_scb(k) = MIN(DBLE(nbca(k)*odts), pnb_scb(k))
             endif
          endif

@twjuliano
Copy link
Contributor Author

@twjuliano Tim, You have all of these if (wif_input_opt .eq. 2) then statements, but the variable wif_input_opt is declared, and is not an input argument to the MP=8 Thompson scheme. Every MP=8 Thompson test is failing with a segfault.

There are two solutions:

  1. Pass in a DO_NOT_USE_THIS value in for wif_input_opt for MP=8 (maybe wif_input_opt=-1.
  2. Surround each of the tests with an IF ( PRESENT()) test:
          if (wif_input_opt .eq. 2) then
             Ef_sa = Eff_aero(xDs,0.0236E-6,visco(k),rho(k),temp(k),'s')
             pnb_scb(k) = rhof(k)*t1_qs_qc*Ef_sa*nbca(k)*smoe(k)
             pnb_scb(k) = MIN(DBLE(nbca(k)*odts), pnb_scb(k))
          endif
          if(present(wif_input_opt))then
             if (wif_input_opt .eq. 2) then
                Ef_sa = Eff_aero(xDs,0.0236E-6,visco(k),rho(k),temp(k),'s')
                pnb_scb(k) = rhof(k)*t1_qs_qc*Ef_sa*nbca(k)*smoe(k)
                pnb_scb(k) = MIN(DBLE(nbca(k)*odts), pnb_scb(k))
             endif
          endif

@davegill Good catch. Thanks for the suggestions -- I went with the present calls because they seem cleaner. Ran a quick test with mp=8 before and after the fix and it seems good now.

Comment on lines +489 to +493
state real qnwfa2d ij misc 1 - i014{17}rhdu "QNWFA2D" "Surface aerosol number conc emission" "kg-1 s-1"
state real qnifa2d ij misc 1 - i014{17}rhdu "QNIFA2D" "Surface dust number conc emission" "kg-1 s-1"
state real qnbca2d ij misc 1 - i014{17}rhdu "QNBCA2D" "Surface black carbon number conc emission" "kg-1 s-1"
state real qnocbb2d ij misc 1 - i014{17}rhdu "QNOCBB2D" "Surface organic carbon biomass burning number conc emission" "kg-1 s-1"
state real qnbcbb2d ij misc 1 - i014{17}rhdu "QNBCBB2D" "Surface black carbon biomass burning number conc emission" "kg-1 s-1"
Copy link
Contributor

Choose a reason for hiding this comment

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

@twjuliano
Since these are i4 and i1, that means that we need these variables in WPS. Have mods to the WPS tables been provided, and where is this global static data?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@davegill Yes, I have added the mods for METGRID.TBL to the previous WPS PR (wrf-model/WPS#190). The update global static file (GOCART climatology) is available in the Google Drive link posted in this PR as well as the WPS PR (https://drive.google.com/file/d/1BYflyu65kP5giRYbTzKo6y4iSnTfb1Fw/view?usp=sharing).

Copy link
Collaborator

Choose a reason for hiding this comment

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

@twjuliano If you place these fields in stream 17, perhaps you should remove '4' from the group.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@weiwangncar OK, I can do that. I maintained what was there previously just in case...

Copy link
Collaborator

@weiwangncar weiwangncar Dec 28, 2021

Choose a reason for hiding this comment

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

@twjuliano When you remove stream 4 from these lines, perhaps you could also line up the columns? This is just for easy viewing and tidiness of the code. That is if they are not lined up already.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@weiwangncar Sure thing, will do.

Comment on lines +2600 to +2602
rconfig logical wif_fire_emit namelist,physics 1 .false. irh "wif_fire_emit" "Activate biomass burning emissionsu in Thompson-MP-Aero" " "
rconfig integer aer_fire_emit_opt derived 1 0 irh "aer_fire_emit_opt" "surrogate to handle aerosol fire emissions in Thompson-MP-Aero: 0=no fire emissions, 1=OC only, 2=OC+BC"
rconfig integer wif_fire_inj namelist,physics max_domains 1 irh "wif_fire_inj" "Vertically distribute biomass burning emissions in Thompson-MP-Aero" " "
Copy link
Contributor

Choose a reason for hiding this comment

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

@twjuliano
Why do some of these have a single entry, and others are per domain?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@davegill I think wif_fire_emit (and therefore aer_fire_emit_opt) should be max_domains now that I'm thinking about it more. I'll change that, thanks.


state real qnwfa_gc i{wif}j dyn_em 1 Z i1 "QNWFA" "water-friendly aerosol num concentration" "# kg-1"
state real qnifa_gc i{wif}j dyn_em 1 Z i1 "QNIFA" "water-friendly aerosol num concentration" "# kg-1"
state real qnbca_gc i{wif}j dyn_em 1 Z i1 "QNBCA" "black carbon aerosol num concentration" "# kg-1"
Copy link
Contributor

Choose a reason for hiding this comment

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

@twjuliano
Tim,
Where do the fields for organic carbon biomass burning and black carbon biomass burning come from? This is only black carbon.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@davegill The organic carbon and black carbon biomass burning emissions are 2D fields that are added to the 3D QNWFA and QNBCA scalars, respectively, in mp_thompson.

Comment on lines +1373 to +1379
IF ( model_config_rec%io_form_auxinput17 .EQ. 0 ) THEN
wrf_err_message = '--- ERROR: If qna_update /= 0, io_form_auxinput17 must be /= 0'
CALL wrf_message ( wrf_err_message )
wrf_err_message = '--- Set io_form_auxinput17 in the time_control namelist (probably to 2).'
CALL wrf_debug ( 0, TRIM( wrf_err_message ) )
count_fatal_error = count_fatal_error + 1
END IF
Copy link
Contributor

Choose a reason for hiding this comment

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

@twjuliano
Tim,
Go ahead and mention that the interval needs to be non-zero, too.

Comment on lines +2331 to +2332
IF ( (model_config_rec%use_aero_icbc .OR. model_config_rec%use_rap_aero_icbc) &
.AND. model_config_rec%scalar_pblmix(i) .NE. 1 ) THEN
Copy link
Contributor

Choose a reason for hiding this comment

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

@twjuliano
Tim,
It seemed like you were changing use_aero_icbc to something else, maybe aer_init_opt?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@davegill Yes, I am using aer_init_opt as a replacement for use_aero_icbc and use_rap_aero_icbc. I did not use it here because my addition in check_a_mundo happens after this call. I can move my call before this one and swap out for aer_init_opt if you would prefer that.

@davegill
Copy link
Contributor

@twjuliano @weiwangncar @joeolson42
Lots of mods in MYNN BL scheme.

@twjuliano
Copy link
Contributor Author

@twjuliano @weiwangncar @joeolson42 Lots of mods in MYNN BL scheme.

@davegill Yes, I followed the code that @joeolson42 added for QNWFA and QNIFA, but it would be good for my modifications to be double checked.

@weiwangncar
Copy link
Collaborator

@twjuliano The other two important code checks we would like to see are if this code, with the new option on, can produce bit-for-bit results when running with 1 proc versus multiple processors, and if the results from a restart run will be identical to a continuous run. Thanks.

@weiwangncar
Copy link
Collaborator

@twjuliano Will the new .dat file replace the current .dat file in order to use Thompson AA scheme?

@twjuliano
Copy link
Contributor Author

@twjuliano The other two important code checks we would like to see are if this code, with the new option on, can produce bit-for-bit results when running with 1 proc versus multiple processors, and if the results from a restart run will be identical to a continuous run. Thanks.

@weiwangncar OK, I can run these simulations once Cheyenne is back up next week.

@twjuliano
Copy link
Contributor Author

@twjuliano Will the new .dat file replace the current .dat file in order to use Thompson AA scheme?

@weiwangncar Yes, the new .dat file will replace the current .dat file if the user wants to run with black carbon. The only difference between the old and new files is the addition of the black carbon variables. The metgrid (and real) processing should work just fine with the old .dat file if the user wants to run with only water- and ice-friendly.

@weiwangncar
Copy link
Collaborator

@twjuliano Can a user use the new .dat file but not using black carbon? It may be more efficient to keep one data file for support reason.

@twjuliano
Copy link
Contributor Author

@twjuliano Can a user use the new .dat file but not using black carbon? It may be more efficient to keep one data file for support reason.

@weiwangncar Yes, absolutely, a user can use the new .dat file but not process BC. I agree that it makes more sense to use one data file.


CALL wrf_debug (00 , 'mediation_integrate: med_read_qna_emissions: exit' )

END SUBROUTINE med_read_qna_emissions
Copy link
Collaborator

Choose a reason for hiding this comment

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

@davegill I don't understand why this subroutine is needed. Is there an equivalent for wrflowinp?

Copy link
Contributor

Choose a reason for hiding this comment

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

@twjuliano
Tim,
WRF is able to use the share/input_wrf.F file to bring in data. Is there a special need for this routine?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@weiwangncar @davegill This subroutine is used to read the wrfqnainp file. At the time, it seemed like the best way to bring in the data. If you prefer me to use share/input_wrf.F, then I can do that perhaps with some guidance. Thanks.

Copy link
Collaborator

Choose a reason for hiding this comment

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

@davegill Can you provide a rough outline for Tim to follow using input_wrf.F?

@davegill
Copy link
Contributor

davegill commented Jan 3, 2022

@twjuliano @weiwangncar @gthompsnWRF @joeolson42
Folks,
There are modifications to the MYNN PBL and the Thompson MP schemes. As code owners, we need you to weigh in on these mods.

Copy link
Contributor

@gthompsnWRF gthompsnWRF left a comment

Choose a reason for hiding this comment

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

For the most part I am OK with this except I really wish there was a better separation of fire-related BC/OC emissions from what is more purely a microphysics code. The idea of "emissions" (and more specific to fire) within a MP scheme does not sit well with me. There could be a better way using a module_fire_emit_oc_bc.F (or something) and then these 3 new namelist-related items and code for emissions all go there (small, simple file) and keep it more distinct from module_mp_thompson.F.

I basically did something nearly identical myself a couple years ago for fake volcanic emissions - which I them made simple changes to become a pseudo fire emissions method to increase aerosols. It was a much clearer separation of concerns and kept MP feeling like MP and with an entirely new module, one just needs to call it either from solve or rk_step_whatever.

This would not be a very difficult change to make to this PR to reduce overall code changes to mp_thompson which is getting so many changes from so many simultaneous places (myself included via CCPP).

A single WPS-formatted aerosol climo file is preferred even if the BC aerosols are ignored as in the current scheme. I also rewrote the code that created that .dat file (WPS intermediate format) and made a netCDF4 version of it. That provided some added compression. Could it be possible to switch input files to newer netcdf version some day? It has the advantage that others know how to work with nc4 files and has global attributes and other info that make it more self-descriptive.

@weiwangncar
Copy link
Collaborator

@twjuliano Are you willing to consider Greg's suggestion?

@twjuliano
Copy link
Contributor Author

@twjuliano Are you willing to consider Greg's suggestion?

@weiwangncar @gthompsnWRF Yes, I think that Greg's suggestion is a good one. It will keep things cleaner. One question is how long do I have to make these changes? Funding for this project is over so I will need to make some extra time. Thanks.

@davegill
Copy link
Contributor

davegill commented Jan 5, 2022

@twjuliano @weiwangncar @dudhia
Jimy is somewhere betwixt the UK and his home, and I'd like him to weigh in on this, too.

I see two possibilities:

  1. We put the code in AS-IS (after Joe Olson responds), and Tim pinky swears to fix the code during the next month to accommodate Greg's requests. The users only see the cleaned up version in April.
  2. We wait to get this PR merged in a final state, hopefully sometime before Feb. This is likely not the only PR that needs extra time (ahem, just saying).

Copy link
Contributor

@joeolson42 joeolson42 left a comment

Choose a reason for hiding this comment

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

Outside of the handling of the tendencies in subroutine mynn_tendencies, I think the rest of the mods are OK.

Dqnwfa(k)=0.
Dqnifa(k)=0.
Dqnbca(k)=0.
ENDDO
Copy link
Contributor

Choose a reason for hiding this comment

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

Do you want black carbon mixing to be done independently of the Thompson aerosols? Right now, the code looks like it can only produce a tendency for bca (lines 3680-3685) when you also produce tendencies for the aerosols.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You're right-- BC will be done only when the other Thompson aerosols are computed. This is how we want it. The option will be either QNWFA+QNIFA only or QNWFA+QNIFA+QNBCA. Thanks Joe.

@dudhia
Copy link
Collaborator

dudhia commented Jan 13, 2022 via email

@davegill
Copy link
Contributor

davegill commented Jan 18, 2022

@dudhia @weiwangncar @gthompsnWRF @joeolson42 @twjuliano
Folks,
I am trying to read between the lines and interpret cryptic runes.
I propose that we merge the code into the develop branch.
Over the next 6 weeks, Tim puts in the tweaks that Greg and Joe have each requested.

@davegill davegill closed this Jan 18, 2022
@davegill davegill reopened this Jan 18, 2022
@twjuliano
Copy link
Contributor Author

@dudhia @weiwangncar @gthompsnWRF @joeolson42 @twjuliano Folks, I am trying to read between the lines and interpret cryptic runes. I propose that we merge the code into the develop branch. Over the next 6 weeks, Tim puts in the tweaks that Greg and Joe have each requested.

@davegill Apologies for the radio silence on my end. That sounds like a good plan to me. I will have more time in early Feb to make these changes if that timeline is OK. Thanks.

@davegill
Copy link
Contributor

@weiwangncar @dudhia
Does it seem acceptable to bring in this change AS-IS, and then update the code (prior to v4.4 release) to accept the codeowner suggestions from Greg and Joe?

@weiwangncar
Copy link
Collaborator

@davegill I think it is a reasonable solution at this point.

@davegill
Copy link
Contributor

@gthompsnWRF @joeolson42 @twjuliano @dudhia @weiwangncar
Folks,
We would like to push the biomass burning / black carbon mods in the develop branch. These mods impact both the Greg's MP scheme and Joe's PBL scheme. You have both provided feedback to the contributor. Would everyone be OK to accept the mods AS-IS, and then Tim would put in the "not user facing" mods into the code during the next few weeks. The proposed modifications will not change the results, so we will be able to get bit-wise identical results (now vs then). If this is acceptable, we will push the mods in soon.

@weiwangncar
Copy link
Collaborator

@davegill Do we want to clean up how the data is input to the model in this PR? That is removing un-necessary code from share/mediation_integrate.F.

@davegill
Copy link
Contributor

@weiwangncar
All of the Chem data comes through their own files. Even though this is a dataset that would be manufactured in metgrid, I am OK with a special reader program. Especially if the metadata is not specific.

@gthompsnWRF
Copy link
Contributor

@gthompsnWRF @joeolson42 @twjuliano @dudhia @weiwangncar Folks, We would like to push the biomass burning / black carbon mods in the develop branch. These mods impact both the Greg's MP scheme and Joe's PBL scheme. You have both provided feedback to the contributor. Would everyone be OK to accept the mods AS-IS, and then Tim would put in the "not user facing" mods into the code during the next few weeks. The proposed modifications will not change the results, so we will be able to get bit-wise identical results (now vs then). If this is acceptable, we will push the mods in soon.

Yes, I am fine with this plan. Thanks everyone!

Copy link
Collaborator

@weiwangncar weiwangncar left a comment

Choose a reason for hiding this comment

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

We agreed that some tweaks will be made before the official release.

@davegill davegill merged commit 8b5bfe5 into wrf-model:develop Jan 20, 2022
davegill pushed a commit that referenced this pull request Jan 23, 2022
TYPE: bug fix

KEYWORDS: WRFDA, 4DVAR, compile

SOURCE: Jamie Bresch (NCAR)

DESCRIPTION OF CHANGES:
Following commit 8b5bfe5, PR #1616, a new subroutine name (med_read_qna_emissions) needs to be 
added in da_name_space.pl to avoid name conflict for 4DVAR build with the error message:
```
duplicate symbol '_med_read_qna_emissions_' in:
    /Users/hclin/code/WRFPLUS/develop/main/libwrflib.a(mediation_integrate.o)
    ./libwrfvar.a(mediation_integrate.o)
ld: 1 duplicate symbol for architecture x86_64
collect2: error: ld returned 1 exit status
```

LIST OF MODIFIED FILES:
M var/build/da_name_space.pl

TESTS CONDUCTED:
1. 4DVAR builds after the fix.
2. Jenkins tests now pass again.
davegill added a commit that referenced this pull request Jan 24, 2022
TYPE: bug fix

KEYWORDS: netcdfpar, Error

SOURCE: internal

DESCRIPTION OF CHANGES:
IMPORTANT: Without these mods, every commit since the parallel netcdf4 IO mods will fail the DA
build test in the regression test. For example, at least these commits:
```
fed10f4 Adding the WRF-Solar EPS model (#1547)
0bda5e0 Fix 4dvar build failure after commit 8b5bfe5 (#1652)
8b5bfe5 Thompson AA enhancements: BC aerosol, biomass burning emissions, and … (#1616)
9dc68ca After testing with UFS/GFS/FV-3, some tuning knob changes to Thompson-MP and icloud3 (cloud fraction) scheme (#1626)
96fd889 Update HONO, TERP, and CO2 emissions (#1644)
64fb190 SFCLAY=1, add shallow water roughness calculation (#1543)
609c2fc New module firebrand_spotting for WRF-Fire (#1540)
75bfe6d MYNN PBL clouds in photolysis option 4 (TUV) (#1622)
f8c4b13 Fix runtime error when using sf_surface_mosaic = 1 with use_wudapt_lcz = 0 (#1638)
b511c70 Run-time option for climate GHG for radiation (#1625)
8194c66 Bug fix for configuration option INTEL:HSW/BDW (#1645)
16c9287  bug fixes for radar_rf_opt=2 (#1642)
a82ce24 Sync with NoahMP Github version with all NoahMP updates since v4.3 (#1641)
7b642cc Bug fix for TAMDAR T VarBC (#1632)
92fd706 fix WRFDA build for Parallel netcdf-4 IO (#1634)
```
Problem:
With PR #1552 "Parallel netcdf-4 IO option" (SHA1 3cd4713), when then code was built without
the new parallel NetCDF4 compression, the build log had an `Error`. 
```
> grep Error compile.log
Fatal Error: Cannot open module file ‘wrf_data_ncpar.mod’ for reading at (1): No such file or directory
make[2]: [diffwrf] Error 1 (ignored)
make[2]: [diffwrf] Error 1 (ignored)
wrf_io.f:117: Error: Can't open included file 'mpif.h'
make[2]: [wrf_io.o] Error 1 (ignored)
Fatal Error: Cannot open module file ‘wrf_data_ncpar.mod’ for reading at (1): No such file or directory
make[2]: [field_routines.o] Error 1 (ignored)
make[2]: [libwrfio_nfpar.a] Error 127 (ignored)
make[2]: [libwrfio_nfpar.a] Error 1 (ignored)
```
The problem was related to constructing the object files in the io_netcdfpar directory. When the 
option is not selected at compile time, then we do not care about errors in the directory that will 
never be used.

Solution:
If the NETCDFPAR option is not selected at compile time, then SKIP going into the io_netcdfpar
directory all together.

LIST OF MODIFIED FILES:
m Makefile
m arch/Config.pl
m arch/configure.defaults
m configure

TESTS CONDUCTED:
1. Without the NETCDFPAR parameter set, the build for the io_netcdfpar directory is bypassed:
```
          cd ../io_netcdfpar ; \
          echo SKIPPING make -i -r NETCDFPARPATH="/glade/u/apps/ch/opt/netcdf/4.7.3/gnu/9.1.0" \

          cd ../io_netcdfpar ; \
          echo SKIPPING make -i -r NETCDFPARPATH="/glade/u/apps/ch/opt/netcdf/4.7.3/gnu/9.1.0" \
```

2. When the NETCDFPAR env variable is set, the build includes the io_netcdfpar directory:
          cd ../io_netcdfpar ; \
           make -i -r NETCDFPARPATH="/glade/u/apps/ch/opt/netcdf/4.8.0/gnu/9.1.0" \

          cd ../io_netcdfpar ; \
           make -i -r NETCDFPARPATH="/glade/u/apps/ch/opt/netcdf/4.8.0/gnu/9.1.0" \
```

3. Jenkins tests are all PASS.
weiwangncar pushed a commit that referenced this pull request Apr 22, 2022
…odule (#1715)

TYPE: enhancement

KEYWORDS: real, Thompson aerosol-aware, microphysics

SOURCE: Timothy W. Juliano (NCAR/RAL)

DESCRIPTION OF CHANGES:
This is an update to a previous PR #1616 that added biomass burning aerosol emissions for the Thompson AA scheme. In general, this PR cleans up the implementation of the biomass burning aerosol emissions.

In the current PR, two things occurred:

1. As requested by Greg Thompson, the emissions of smoke aerosols are now self-contained in a module separate from the Thompson AA scheme. The module is called immediately after mp_gt_driver, inside of the microphysics driver.
2. As requested, the 2D aerosol emissions are removed from io stream 4.
3. A check is added to stop users if use_aero_icbc or use_rap_aero_icbc is set, but not qna_update.

LIST OF MODIFIED FILES:
M Registry/Registry.EM_COMMON
M phys/module_microphysics_driver.F
M phys/module_mp_thompson.F
M phys/Makefile
N phys/module_fire_emis.F
M share/module_check_a_mundo.F
M test/em_real/examples.namelist

TESTS CONDUCTED:

1. Conducted two simulations: one before and one after the code changes. Results are bit-for-bit equivalent.
2. Jenkins tests are all passing.
vlakshmanan-scala pushed a commit to scala-computing/WRF that referenced this pull request Apr 4, 2024
wrf-model#1616)

TYPE: enhancement

KEYWORDS: real, Thompson aerosol-aware, microphysics

SOURCE: Timothy W. Juliano and Pedro A. Jimenez (NCAR/RAL)

DESCRIPTION OF CHANGES:
Problem:
Several enhancements have been made to the Thompson Aerosol-Aware microphysics scheme 
(mp_physics=28) related to the addition of:
1. black carbon (BC) aerosol category from either climatology (e.g., GOCART) or first guess aerosol source 
(e.g., GEOS-5);
2. biomass burning aerosol (organic carbon (OC) and BC) emissions from a first guess aerosol source 
(e.g., GEOS-5);
3. time-varying surface emissions from a first guess aerosol source (e.g., GEOS-5)

Solution:
1. Addition of a new category (3D scalar variable, QNBCA), that represents BC aerosol for the Thompson 
Aerosol Aware (AA) microphysics scheme. This variable is handled in a similar fashion as QNWFA and 
QNIFA (water-friendly and ice-friendly aerosols, respectively), including the surface emissions. In terms 
of the microphysical activity of QNBCA, at present we consider only its removal due to wet scavenging by 
rain, snow, and graupel. We recognize that this is a limitation of the current implementation; however, 
more detailed investigation into the water/ice nucleating abilities of BC are needed and left for future work. 
As a result of this limitation, activation of BC aerosol is made through the &domains namelist option, 
wif_input_opt: =1 retains the current meaning (water- and ice-friendly aerosols only) and =2 adds the BC 
aerosol on top of the water- and ice-friendly aerosols. This allows a user to active the Thompson AA scheme 
as in its original implementation if desired.

To account for the radiative contribution of BC aerosols (which are strongly absorbing compared to the 
QNWFA and QNIFA aerosols that are strongly scattering) to diagnosed AOD at 550nm, we extend the 
look-up table in subroutine gt_aod. The new look-up table values are computed using Mie code provided 
by Trude Eidhammer (NCAR/RAL). For BC, we use the following parameter values:
   * Modal radius = 11.8 nm following Chin et al. (2002) to maintain consistency with the original implementation 
      of the Thompson AA scheme
   * Geometric standard deviation = 2.0 following Chin et al. (2002) to maintain consistency with the original 
      implementation of the Thompson AA scheme
   * Real and imaginary indices of refraction = 1.85 and 0.71, respectively, following Bond et al. (2006)
   * Hygroscopicity = 0.2 following Engelhart et al. (2012)

Citations:
Chin, M., Ginoux, P., Kinne, S., Torres, O., Holben, B. N., Duncan, B. N., Martin, R. V., Logan, J. A., Higurashi, A., & Nakajima, T. (2002). Tropospheric Aerosol Optical Thickness from the GOCART Model and Comparisons with Satellite and Sun Photometer Measurements, Journal of the Atmospheric Sciences, 59(3), 461-483. Retrieved Dec 22, 2021, from https://journals.ametsoc.org/view/journals/atsc/59/3/1520-0469_2002_059_0461_taotft_2.0.co_2.xml

Bond, T. C., G. Habib, and R. W. Bergstrom (2006), Limitations in the enhancement of visible light absorption due to mixing state, J. Geophys. Res., 111, D20211, doi:10.1029/2006JD007315.

Engelhart, G. J., Hennigan, C. J., Miracolo, M. A., Robinson, A. L., and Pandis, S. N.: Cloud condensation nuclei activity of fresh primary and aged biomass burning aerosol, Atmos. Chem. Phys., 12, 7285–7293, https://doi.org/10.5194/acp-12-7285-2012, 2012.

2. Addition of OC and BC biomass burning aerosol emissions. These two aerosols are important during periods 
of active wildfires. Therefore, only when using a first guess aerosol source that has information about biomass 
burning emissions (e.g., GEOS-5), a user may include these effects through a new &physics namelist option: 
wif_fire_emit (logical). We note that if wif_fire_emit=.true. and wif_input_opt=1 (i.e., water- and ice-friendly 
aerosols only), then only OC biomass burning aerosols are emitted, as OC is included in the water-friendly 
category. However, if wif_fire_emit=.true. and wif_input_opt=2 (i.e., water- and ice-friendly plus BC aerosols), 
then both OC and BC biomass burning aerosols are emitted. This logic is handled using a surrogate integer 
variable (aer_fire_emit_opt) that is invisible to the user and thus defined on the Registry as a derived variable. 
Using the integer variable allows us to properly handle the new emission variables using packages while 
maintaining simplicity for the user to set a single, logical namelist option. To complement this enhancement, by 
default we distribute the OC/BC fire aerosols evenly throughout the PBL column (&physics namelist option: 
wif_fire_inj=1) as a simple plume rise parameterization. This is controllable through the namelist, and we set a 
warning message in check_a_mundo if the user is not running a PBL scheme with wif_fire_inj=1, as resolved 
vertical motions may be sufficient such that the parameterization should be turned off.

3. Modifications have been made to the METGRID.TBL file to handle the processing of the new QNBCA aerosol, 
as well as the surface emissions of anthropogenic QNBCA (QNBCA2D – similar to QNWFA2D and QNIFA2D) and 
surface emissions of OC and BC biomass burning aerosols (QNOCBB2D and QNBCBB2D, respectively).

The modifications to METGRID.TBL may be found in the WPS#190 (wrf-model/WPS#190):
   
We add entries to METGRID.TBL to handle the black carbon aerosol category in addition to biomass burning emissions. Specifically, we:
   * add monthly climatology entries for black carbon aerosol (B_WIF_*) which generate FLAG_QNBCA_CL 
      for processing in real
   * add first guess entry for black carbon aerosol (QNBCA) which generates FLAG_QNBCA for processing in real
   * add first guess entry for anthropogenic emission of black carbon aerosol (QNBCA2D) which generates 
      FLAG_QNBCA2D
   * add first guess entries for biomass burning emissions of organic carbon (QNOCBB2D) and black carbon 
     (QNBCBB2D) which generate FLAG_QNOCBB2D and FLAG_QNBCBB2D, respectively

Note that the new .dat file for monthly GOCART climatology is hosted on Google Drive:  https://drive.google.com/file/d/1BYflyu65kP5giRYbTzKo6y4iSnTfb1Fw/view?usp=sharing

4. The ability to have time-varying aerosol emissions has been added. This capability is handled through 
&physics namelist option qna_update=1, similar to sst_update=1. The I/O for qna_update is done through 
auxinput17 and the file generated during real is called wrfqnainp_d0* (individual files for each domain, 
again similar to wrflowinp for sst_update=1).

LIST OF MODIFIED FILES:
M Registry/Registry.EM_COMMON
M Registry/registry.new3d_wif
M dyn_em/module_em.F
M dyn_em/module_first_rk_step_part1.F
M dyn_em/module_initialize_real.F
M dyn_em/solve_em.F
M dyn_em/start_em.F
M main/real_em.F
M phys/module_bl_mynn.F
M phys/module_microphysics_driver.F
M phys/module_mp_thompson.F
M phys/module_pbl_driver.F
M phys/module_physics_init.F
M phys/module_radiation_driver.F
M share/input_wrf.F
M share/mediation_integrate.F
M share/module_check_a_mundo.F
M share/module_optional_input.F

TESTS CONDUCTED:
1. We have conducted numerous simulations with the new code for a 21-day period in 2016 and a 9-day period 
in 2020 during active wildfire events. AOD/irradiance quantities from the model output have been compared 
to observations. For the 2020 wildfire event, our findings are summarized in a manuscript that is currently 
under review (Juliano, T. W., P. A. Jiménez, B. Kosović, T. Eidhammer, G. Thompson, J. Fast, L. Berg, A. Motley, 
and A. Polidori, 2021: Smoke from 2020 United States wildfires responsible for substantial solar energy 
forecast errors, in review at Environmental Research Letters).

2.	Jenkins tests are all passing.

RELEASE NOTE: A black carbon aerosol category has been added to the Thompson Aerosol-Aware microphysics scheme. Moreover, code enhancements are introduced to allow for time-varying surface aerosol emissions, in addition to consideration of biomass burning organic and black carbon aerosols when using a first guess aerosol source (e.g., GEOS-5).
vlakshmanan-scala pushed a commit to scala-computing/WRF that referenced this pull request Apr 4, 2024
TYPE: bug fix

KEYWORDS: WRFDA, 4DVAR, compile

SOURCE: Jamie Bresch (NCAR)

DESCRIPTION OF CHANGES:
Following commit 8b5bfe5, PR wrf-model#1616, a new subroutine name (med_read_qna_emissions) needs to be 
added in da_name_space.pl to avoid name conflict for 4DVAR build with the error message:
```
duplicate symbol '_med_read_qna_emissions_' in:
    /Users/hclin/code/WRFPLUS/develop/main/libwrflib.a(mediation_integrate.o)
    ./libwrfvar.a(mediation_integrate.o)
ld: 1 duplicate symbol for architecture x86_64
collect2: error: ld returned 1 exit status
```

LIST OF MODIFIED FILES:
M var/build/da_name_space.pl

TESTS CONDUCTED:
1. 4DVAR builds after the fix.
2. Jenkins tests now pass again.
vlakshmanan-scala pushed a commit to scala-computing/WRF that referenced this pull request Apr 4, 2024
TYPE: bug fix

KEYWORDS: netcdfpar, Error

SOURCE: internal

DESCRIPTION OF CHANGES:
IMPORTANT: Without these mods, every commit since the parallel netcdf4 IO mods will fail the DA
build test in the regression test. For example, at least these commits:
```
fed10f4 Adding the WRF-Solar EPS model (wrf-model#1547)
0bda5e0 Fix 4dvar build failure after commit 8b5bfe5 (wrf-model#1652)
8b5bfe5 Thompson AA enhancements: BC aerosol, biomass burning emissions, and … (wrf-model#1616)
9dc68ca After testing with UFS/GFS/FV-3, some tuning knob changes to Thompson-MP and icloud3 (cloud fraction) scheme (wrf-model#1626)
96fd889 Update HONO, TERP, and CO2 emissions (wrf-model#1644)
64fb190 SFCLAY=1, add shallow water roughness calculation (wrf-model#1543)
609c2fc New module firebrand_spotting for WRF-Fire (wrf-model#1540)
75bfe6d MYNN PBL clouds in photolysis option 4 (TUV) (wrf-model#1622)
f8c4b13 Fix runtime error when using sf_surface_mosaic = 1 with use_wudapt_lcz = 0 (wrf-model#1638)
b511c70 Run-time option for climate GHG for radiation (wrf-model#1625)
8194c66 Bug fix for configuration option INTEL:HSW/BDW (wrf-model#1645)
16c9287  bug fixes for radar_rf_opt=2 (wrf-model#1642)
a82ce24 Sync with NoahMP Github version with all NoahMP updates since v4.3 (wrf-model#1641)
7b642cc Bug fix for TAMDAR T VarBC (wrf-model#1632)
92fd706 fix WRFDA build for Parallel netcdf-4 IO (wrf-model#1634)
```
Problem:
With PR wrf-model#1552 "Parallel netcdf-4 IO option" (SHA1 3cd4713), when then code was built without
the new parallel NetCDF4 compression, the build log had an `Error`. 
```
> grep Error compile.log
Fatal Error: Cannot open module file ‘wrf_data_ncpar.mod’ for reading at (1): No such file or directory
make[2]: [diffwrf] Error 1 (ignored)
make[2]: [diffwrf] Error 1 (ignored)
wrf_io.f:117: Error: Can't open included file 'mpif.h'
make[2]: [wrf_io.o] Error 1 (ignored)
Fatal Error: Cannot open module file ‘wrf_data_ncpar.mod’ for reading at (1): No such file or directory
make[2]: [field_routines.o] Error 1 (ignored)
make[2]: [libwrfio_nfpar.a] Error 127 (ignored)
make[2]: [libwrfio_nfpar.a] Error 1 (ignored)
```
The problem was related to constructing the object files in the io_netcdfpar directory. When the 
option is not selected at compile time, then we do not care about errors in the directory that will 
never be used.

Solution:
If the NETCDFPAR option is not selected at compile time, then SKIP going into the io_netcdfpar
directory all together.

LIST OF MODIFIED FILES:
m Makefile
m arch/Config.pl
m arch/configure.defaults
m configure

TESTS CONDUCTED:
1. Without the NETCDFPAR parameter set, the build for the io_netcdfpar directory is bypassed:
```
          cd ../io_netcdfpar ; \
          echo SKIPPING make -i -r NETCDFPARPATH="/glade/u/apps/ch/opt/netcdf/4.7.3/gnu/9.1.0" \

          cd ../io_netcdfpar ; \
          echo SKIPPING make -i -r NETCDFPARPATH="/glade/u/apps/ch/opt/netcdf/4.7.3/gnu/9.1.0" \
```

2. When the NETCDFPAR env variable is set, the build includes the io_netcdfpar directory:
          cd ../io_netcdfpar ; \
           make -i -r NETCDFPARPATH="/glade/u/apps/ch/opt/netcdf/4.8.0/gnu/9.1.0" \

          cd ../io_netcdfpar ; \
           make -i -r NETCDFPARPATH="/glade/u/apps/ch/opt/netcdf/4.8.0/gnu/9.1.0" \
```

3. Jenkins tests are all PASS.
vlakshmanan-scala pushed a commit to scala-computing/WRF that referenced this pull request Apr 4, 2024
…odule (wrf-model#1715)

TYPE: enhancement

KEYWORDS: real, Thompson aerosol-aware, microphysics

SOURCE: Timothy W. Juliano (NCAR/RAL)

DESCRIPTION OF CHANGES:
This is an update to a previous PR wrf-model#1616 that added biomass burning aerosol emissions for the Thompson AA scheme. In general, this PR cleans up the implementation of the biomass burning aerosol emissions.

In the current PR, two things occurred:

1. As requested by Greg Thompson, the emissions of smoke aerosols are now self-contained in a module separate from the Thompson AA scheme. The module is called immediately after mp_gt_driver, inside of the microphysics driver.
2. As requested, the 2D aerosol emissions are removed from io stream 4.
3. A check is added to stop users if use_aero_icbc or use_rap_aero_icbc is set, but not qna_update.

LIST OF MODIFIED FILES:
M Registry/Registry.EM_COMMON
M phys/module_microphysics_driver.F
M phys/module_mp_thompson.F
M phys/Makefile
N phys/module_fire_emis.F
M share/module_check_a_mundo.F
M test/em_real/examples.namelist

TESTS CONDUCTED:

1. Conducted two simulations: one before and one after the code changes. Results are bit-for-bit equivalent.
2. Jenkins tests are all passing.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants