wrf-model / WRF

The official repository for the Weather Research and Forecasting (WRF) model
Other
1.18k stars 658 forks source link

mp_zero_out is applied to non-moist arrays, but should it be? #2007

Closed MicroTed closed 4 months ago

MicroTed commented 5 months ago

README.namelist describes mp_zero_out as applying only to the 'moist' variables:

 mp_zero_out                    = 0,      ! no action taken, no adjustment to any moist field
                                = 1,      ! except for Qv, all other moist arrays are set to zero
                                                 if they fall below a critical value
                                = 2,      ! Qv is .GE. 0, all other moist arrays are set to zero
                                                 if they fall below a critical value

But in solve_em.F, all the 3D arrays (moist, scalar, chem, tracer) have mp_zero_applied with calls to microphysics_zero_outa and microphysics_zero_outb.

So the question is should this be applied to non-moist arrays? Or should the other arrays have separate flags and thresholds? (Or simply update the readme to say what it is actually doing.)

weiwangncar commented 4 months ago

@dudhia Any thoughts?

dudhia commented 4 months ago

Note that by default this is off, but point taken. Not sure of any reason it should be applied to other 4d arrays, especially as it gives different treatment for p_qv. @MicroTed Do you have a reason you need to apply this switch for microphysics?

MicroTed commented 4 months ago

@dudhia I would not normally use it, but mp_zero_out is being used in the Warn-on-Forecast ensemble system to suppress noisy values along boundaries. We started doing some tests with 3-moment physics, though, and the reflectivity moments were getting zeroed out by the flag because they are O(-16 to -10). I am testing separate flags for each array (e.g., scalar_zero_out, scalar_zero_out_thresh, etc.) so that they can be controlled individually, which seems to be a reasonable solution. (This is working with 3.9, but 4.5 is the same.)

It seems that the original intent (based on the subroutines) was to apply only to the moist array. But perhaps somewhere along the line it was applied to all the arrays.

dudhia commented 4 months ago

Yes, I agree and if there is no reason to use it for other arrays, we could just confine it to moist and not need other switches.

MicroTed commented 4 months ago

A google search on 'wrf mp_zero_out' found a few instances of using mp_zero_out, including a 2013 paper that noted its effect on scalars, as well.

Also, the "WRF-Chem Version 4.4 User’s Guide" at https://ruc.noaa.gov/wrf/wrf-chem/Users_guide.pdf has this:

"NOTE: It has recently come to our attention that the mp_zero_out setting does not only apply to hydrometeor mixing ratios, but also the quanties of these arrays: moist, chem, scalar, and tracer. So, it is HIGHLY advised to set the mp_zero_out_thresh settting to a value much lower than the default 1.E-8. This setting will be fixed for future versions and noted in the user guide, but users should be aware that this setting will have impacted any simulations prior to version 4.4 and after version 3.1.1."

It seems like the intended usage has been for mixing ratios, so disabling the other arrays would seem to be sufficient.

Searches of the WRF forum and github issues found nothing.

dudhia commented 4 months ago

Thanks. So, it gave problems for WRF-Chem too. Limiting it to moist should be added as a PR.

MicroTed commented 4 months ago

If you're thinking of just removing the extra calls to microphysics_zero_outa and microphysics_zero_outb in solve_em.F, that would be pretty easy and give the expected behavior. Would here or a PR be the place to solicit input from the WRF-CHEM folks?

dudhia commented 4 months ago

Our PR's can request reviews from WRF-Chem. Not sure if they rely on this option, but since that question came up, we should.

MicroTed commented 4 months ago

In the off chance that somebody actually wants to be able zero-out scalar/chem/tracer values (e.g., for retesting previous simulations and reproduce old behavior), I'll just add the extra flags and thresholds for each array. I know it adds more to the namelist, but what's 6 more items in the grand scheme of things. I'll have a PR ready soon.

MicroTed commented 4 months ago

Resolved by https://github.com/wrf-model/WRF/pull/2010