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

Corrected bug in mixactivate for diagnostic CCN in sectional schemes #1359

Conversation

brigaudet
Copy link
Contributor

@brigaudet brigaudet commented Jan 8, 2021

TYPE: bug fix

KEYWORDS: chemistry, sectional, CCN, mixactivate

SOURCE: Calvin Howes (UCLA), Richard Easter (PNNL), internal

DESCRIPTION OF CHANGES:

Problem:
The sectional scheme diagnostic CCN1, CCN2, ... CCN6 output as computed in mixactivate did not allow for particle
growth in the computation of volume-mean diameters. This bug was initially found by Calvin Howes, with the current
fix proposed by Richard Easter 09/25/2020. The CCN output fields being diagnostic do not impact actual aerosol
activation, so cloud properties are not impacted by the bug.

Solution:

Subroutine mixactivate in module_mixactivate.F was modified to use actual time-dependent sizes rather than the default values in computing critical supersaturations and hence CCN.

LIST OF MODIFIED FILES:
M phys/module_mixactivate.F

TESTS CONDUCTED:

  1. The first set of attached figures shows CCN6 (CCN at > 1% SS) in the WRF restart files for the lowest model level in a simulation of the Amazon using chem_opt = 11 (RADM2SORG_AQ). The number of CCN is reduced in areas of cloud formation, suggesting wet removal. But this preferentially impacts the larger / activated Aitken mode particles, reducing the particle size from the default size. Thus with the bug fix the diagnosed CCN is reduced relative to the standard code, while the cloud condensate mixing ratio (QCLOUD) is unchanged (second set of slides).

CCN_bug_fix_test_4.2.2.pptx

  1. Jenkins testing is all pass.

RELEASE NOTE: Corrected bug in mixactivate for diagnostic CCN in sectional schemes. Impacts Morrison and Lin et al. microphysics schemes.

which did not allow for particle growth in the computation of
volume-mean diameters, found by Calvin Howes.  Fix proposed by
Richard Easter.   09/25/2020.
@brigaudet brigaudet requested a review from a team as a code owner January 8, 2021 00:34
do l=1,ncomp(n)
lmass=massptr_aer(l,m,n,ai_phase)
lmasscw=massptr_aer(l,m,n,cw_phase)
! scale = mwdry/mw_aer(l,n)
! scale = mwdry/mw_aer(l,n)
Copy link
Contributor

Choose a reason for hiding this comment

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

Just remove this commented out line completely.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Should be taken care of.

@davegill
Copy link
Contributor

davegill commented Jan 8, 2021

@jordanschnell
Jordan,
I do not know if this impacts WRF Chem. Please take a look in case.

@davegill davegill requested review from a team January 8, 2021 01:07
@davegill
Copy link
Contributor

davegill commented Jan 8, 2021

@brigaudet
There is a bit-for-bit failure with this physics combination (serial vs MPI):

&physics
fractional_seaice                   = 0,
mp_physics                          = 16,    16,    16,
ra_lw_physics                       = 14,    14,    14,
ra_sw_physics                       = 14,    14,    14,
radt                                = 6,     6,     6,
sf_sfclay_physics                   = 1,     1,     1,
sf_surface_physics                  = 4,     4,     4,
bl_pbl_physics                      = 11,    11,    11,
bldt                                = 0,     0,     0,
cu_physics                          = 14,    14,    0,
sf_urban_physics                    = 0,     0,     0,
shcu_physics                        = 4,     4,     4,
topo_shading                        = 0,     0,     0,
cudt                                = 5,     5,     5,
isfflx                              = 1,
ifsnow                              = 0,
icloud                              = 1,
surface_input_source                = 1,
num_soil_layers                     = 5,
num_land_cat                        = 28,
mp_zero_out                         = 0,
maxiens                             = 1,
maxens                              = 3,
maxens2                             = 3,
maxens3                             = 16,
ensdim                              = 144,
aer_opt                             = 2,
aer_type                            = 1,
aer_aod550_opt                      = 1,
aer_aod550_val                      = 0.12
aer_angexp_opt                      = 1,
aer_angexp_val                      = 1.3
aer_ssa_opt                         = 1,
aer_ssa_val                         = 0.85
aer_asy_opt                         = 1,
aer_asy_val                         = 0.90
/

There are three other combinations of physics that also use aer_opt=2, aer_aod550_opt=1, aer_angexp_opt=1, aer_ssa_opt=1, aer_asy_opt=1, and aer_type=1. Usually an MPI diff is related to a missing communcation or an incorrect assignment (maybe in an initialization).

@davegill
Copy link
Contributor

davegill commented Jan 8, 2021

@brigaudet
Hmmm, the bit-for-bit failed run was not a chemistry run. Does this only impact chemistry or it ALSO impacts chemistry?

@brigaudet
Copy link
Contributor Author

@brigaudet
Hmmm, the bit-for-bit failed run was not a chemistry run. Does this only impact chemistry or it ALSO impacts chemistry?

The intent was the fix would only impact chemistry (and only in a diagnostic way at that). But the relevant code is in the phys directory and some side effects with say the aer variables. Will need to take a closer look.

@davegill
Copy link
Contributor

davegill commented Jan 8, 2021

@brigaudet
WAIT! Usually when there is a single bit-for-bit difference in an obscure test with no obvious connection, I do a re-run (just to see if the failure is reported again).
The regression tests are just fine. No testing required.

Please find result of the WRF regression test cases in the attachment. This build is for Commit ID: 54f324c144aa6c2c192a3b9dba0e8da928790b3f, requested by: brigaudet for PR: https://github.com/wrf-model/WRF/pull/1359. For any query please send e-mail to David Gill.

    Test Type              | Expected  | Received |  Failed
    = = = = = = = = = = = = = = = = = = = = = = = =  = = = =
    Number of Tests        : 19           18
    Number of Builds       : 48           46
    Number of Simulations  : 166           164        0
    Number of Comparisons  : 105           104        0

    Failed Simulations are: 
    None
    Which comparisons are not bit-for-bit: 
    None

@davegill
Copy link
Contributor

davegill commented Jan 8, 2021

@brigaudet
Also, nice job on a first PR. This was certainly more complicated than most "bug fixes". The commit message was clean, and the figs were a nice touch.

Instead of me doing it, would you please edit the PR commit message on github and manually force a carriage return. This will avoid long lines when people look at the git logs on their desktop machines. I did the "Problem" section as an example. By convention, do NOT wrap the RELEASE NOTES part, as we cut and paste that directly into a bigger release message.

@davegill
Copy link
Contributor

davegill commented Jan 8, 2021

@brigaudet

Will need to take a closer look.

To re-iterate - no need to take a closer look.

@davegill
Copy link
Contributor

davegill commented Jan 8, 2021

@jordanschnell
Jordan,
We are trying to push a v422 out next week. Since this is a bug fix, it would be a possible candidate to include. No pressure at all, though.

@dudhia
Copy link
Collaborator

dudhia commented Jan 8, 2021

Add something about which options are affected in the PR message and release note.
I think only a few microphysics options use mixactivate.

Copy link
Contributor

@jordanschnell jordanschnell left a comment

Choose a reason for hiding this comment

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

Approved by Chem

@jordanschnell jordanschnell merged commit 9ef0fd7 into wrf-model:release-v4.2.2 Jan 12, 2021
vlakshmanan-scala pushed a commit to scala-computing/WRF that referenced this pull request Apr 4, 2024
…rf-model#1359)

TYPE: bug fix 

KEYWORDS: chemistry, sectional, CCN, mixactivate

SOURCE: Calvin Howes (UCLA), Richard Easter (PNNL), internal

DESCRIPTION OF CHANGES:

Problem:
The sectional scheme diagnostic CCN1, CCN2, ... CCN6 output as computed in mixactivate did not allow for particle 
growth in the computation of volume-mean diameters.  This bug was initially found by Calvin Howes, with the current 
fix proposed by Richard Easter 09/25/2020.  The CCN output fields being diagnostic do not impact actual aerosol 
activation, so cloud properties are not impacted by the bug.

Solution:

Subroutine mixactivate in module_mixactivate.F was modified to use actual time-dependent sizes rather than the default values in computing critical supersaturations and hence CCN.

LIST OF MODIFIED FILES:
M       phys/module_mixactivate.F 

TESTS CONDUCTED: 

1. The first set of attached figures shows CCN6 (CCN at > 1% SS) in the WRF restart files for the lowest model level in a simulation of the Amazon using chem_opt = 11 (RADM2SORG_AQ).  The number of CCN is reduced in areas of cloud formation, suggesting wet removal.  But this preferentially impacts the larger / activated Aitken mode particles, reducing the particle size from the default size.  Thus with the bug fix the diagnosed CCN is reduced relative to the standard code, while the cloud condensate mixing ratio (QCLOUD) is unchanged (second set of slides).

[CCN_bug_fix_test_4.2.2.pptx](https://github.com/wrf-model/WRF/files/5784455/CCN_bug_fix_test_4.2.2.pptx)

2. Jenkins testing is all pass.

RELEASE NOTE: Corrected bug in mixactivate for diagnostic CCN in sectional schemes. Impacts Morrison and Lin et al. microphysics schemes.
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.

4 participants