Scheduled Downtime
On Friday 21 April 2023 @ 5pm MT, this website will be down for maintenance and expected to return online the morning of 24 April 2023 at the latest

xkmv has zero values only

This post was from a previous version of the WRF&MPAS-A Support Forum. New replies have been disabled and if you have follow up questions related to this post, then please start a new thread from the forum home page.

jiaobf

New member
Hi, I am trying to retrieve the vertical and horizontal eddy viscosity from WRF v3.8.1. FAQs in WRF user page (Q16, http://www2.mmm.ucar.edu/wrf/users/FAQ_files/FAQ_wrf_physics.html) suggest that ‘the XKMV and XKHV arrays are used by other PBL options (not MYJ)’. Then, I modify the Registry.EM_COMMON adding “h” on the line of xkmv and xkmh. The corresponding fields are found in the output after recompiling. However, the values of xkmv are zero at any position and any time while the values of xkmh seem to be valid. Does any one have an explanation for that or another way to obtain eddy viscosity? Part of the namelist.input is listed below:
Code:
&physics
 mp_physics                          = 6,    6,     10
 ra_lw_physics                       = 3,     3,     1,
 ra_sw_physics                       = 3,     3,     1,
 radt                                = 30,   30,     3 ,
 sf_sfclay_physics                   = 7,     7,     7,
 sf_surface_physics                  = 7,     7,     7,
 bl_pbl_physics                      = 7,     7,     7,
 bldt                                = 0,     0,     0,
 cu_physics                          = 0,     0,     0,
 cudt                                = 0,     0,     0,
 isfflx                              = 1
 ifsnow                              = 0
 icloud                              = 1
 surface_input_source                = 1
 num_soil_layers                     = 2
 sf_urban_physics                    = 0,     0,     0,
 NUM_LAND_CAT =         20
 /

 &dynamics
 w_damping                           = 1,
 diff_opt                            = 1,
 km_opt                              = 4,
 diff_6th_opt                        = 0,      0,      0,
 diff_6th_factor                     = 0.25,   0.25,   0.25,
 base_temp                           = 290.
 damp_opt                            = 3,
 zdamp                               = 5000.,  5000.,  5000.,
 dampcoef                            = 0.2,   0.05,    0.05,
 khdif                               = 0,      0,      0,
 kvdif                               = 0,      0,      0,
 non_hydrostatic                     = .true., .true., .true.,
 moist_adv_opt                       = 2,      1,      1,     
 scalar_adv_opt                      = 1,      0,      0,     
 /


Thanks in advance.
 
If you look at the code dyn_em/module_diffusion_em.F and find the subroutine "smag2d_km", you will see that xkmv is set to zero.
However, I am not sure why this variable is set to zero permanently. I will talk to our expert and get back to you once I get an answer.

Ming Chen
 
Hi,

Thank you for your reply. I am tring to obtain the turbulent frictional force which may be approximated by the vertical divergence of the mean vertical flux of horizontal eddy momentum. once the vertical eddy viscosity is available (km), the Reynolds stress can be written as T=density*km*du/dz (partial differential) (refer to https://www.researchgate.net/post/Does_anyone_know_if_I_can_use_the_friction_velocity_outputed_from_the_WRF_model_as_an_approximation_for_the_surface_friction_force). If it is hard to get the value of xkmv, is there another way to evaluate the turbulent frictional force from wrfout?

Best
Jiao
 
For real data case, vertical mixing is done in PBL scheme. That is why the value of xlmv is always set to zero in the smag_2d option.
EXCH_M in PBL scheme is equivalent to xlmv. You can compute the turbulent frictional force based on this variable and horizontal winds.

Ming Chen
 
Hi,

Thanks for your advise.I add “h” on the line of EXCH_M in Registry.EM_COMMON and the it is still zero in the history files. I am not sure if it only works when using MYJ PBL. what can I do with ACM2(Pleim) PBL scheme?
 
Note that in the ACM PBL scheme, the variable you are looking for is EDDYZM. However, this is a local variable and you need to modify the related codes to make it able to output in wrfout. Please take a look at the presentation here about how to:

http://www2.mmm.ucar.edu/wrf/users/tutorial/201707/registry.pdf

Ming Chen
 
Thank you, it does work! However, there seems to be some problems with the magnitude and symbol. I modified the related scripts—‘module_bl_acm.F’, ’module_pbl_driver.F’, and ‘module_first_rk_step_part1.F’. A new line was added in Registry.EM_COMMON--‘state real EDDYZM ikj misc 1 - hr "EDDYZM" "eddy diffusivity for momentum KM in ACM2 PBL" "m2 s-1"’. The values of EDDYZM in the spiral rainbands of a TC before landfall were about -10^-4 (with the wrong symbol) while the typical value suggested by the books was 0.1 m^2 s^-1 at the height of 10+ meter and 5-10 (positive) m^2 s^-1 at the height of 1 km.
f1.png
Attached is the related modified scripts, the changes in *.F were marked with ‘!add by jiaobf’ in the same line. I add a 3d array EDDYZM in SUBROUTINE ACMPBL, it is passed to SUBROUTINE ACM2D with fixed J as a 2d array eddyz_m. The 2d EDDYZM (Different from the 3d array EDDYZM) calculated by SUBROUTINE EDDYX was stored in eddyz_m.

By the way, I found the variable RUBLTEN which represent the coupled x wind tendency due to pbl parameterization. I am not sure if RUBLTEN/(MU+MUB) can directly replace the eddy frictional term at the right hand of the general momentum equation (x-direction).

Thanks again for your careful replies.

Best
jiaobf
View attachment module_bl_acm.FView attachment module_pbl_driver.FView attachment module_first_rk_step_part1.F
 
The ACM PBL scheme is different to other PBL schemes in that its vertical mixing calculated from EDDYZM diffusivity only accounts for partial vertical mixing. This explains why the value of EDDYZM is very small. Please read the paper I give below for more detail.
Pleim, Jonathan E., 2007: A Combined Local and Nonlocal Closure Model for the Atmospheric Boundary Layer. Part I: Model Description and Testing. J. Appl. Meteor. Climatol., 46, 1383–1395. doi:10.1175/JAM2539.1

In addiiton, I believe that RUBLTEN/(MU+MUB) can be used to represent the eddy frictional term in the PBL scheme.

Ming Chen
 
Hi, jiaobf and Ming Chen. I have the same problem. I am also trying to retrieve the vertical and horizontal eddy viscosity (xkmv in YSU PBL scheme) from WRF v3.8.1. Follow FAQs I modify the Registry.EM_COMMON adding “h” on the line of xkmv and xkmh. The corresponding fields are found in the output after recompiling. However, the values of xkmv are zero at any position and any time while the values of xkmh seem to be valid. Does any one know another way to obtain eddy viscosity or use which variables available from output to calculate xkmv? Part of the namelist.input is listed below:

View attachment namelist.input

Look forward for replying.
 
The equivalent variable of xkmv in YSU PBL scheme is exch_h (for heat/moisture) and exch_m (for momentum).
Please modify Registry.EM_COMMON to add them to history output files.
 
Hi,

Thank you for your reply. Following your advise, I modify the Registry.EM_COMMON ( adding “h” on the line of exch_m and exch_h). However, the results have some problems, the output of exch_h seems right, while exch_m are constant zero at any position and any times. So is there any other modification should be done to obtain exch_m?

Best,
Zhou
 
I looked at the YSU PBL scheme. It turns out that only exch_h is output as a state variable, whereas exch_m is actually not given a value in YSU. This explains why it is zero everywhere. Please follow the example of exch_h to specify exch_m in YSU (it should be xzkm).
 
Hello professor, I donot find exch_h or exch_m in the Registry.EM_COMMON file. I want to output boundary turbulent exchange coefficient and turbulent flux in the wrfout file for different PBL schemes. Could you please tell me how to do with that. Thank you.
 
Please look at the following two lines in Registry.EM_COMMON:
state real EXCH_H ikj misc 1 Z r "EXCH_H" "SCALAR EXCHANGE COEFFICIENTS " "m2 s-1"
state real EXCH_M ikj misc 1 Z r "EXCH_M" "EXCHANGE COEFFICIENTS " "m2 s-1"

They are exchange coefficients for scalar and momentum variables in ALL the PBL schemes. To output these two variables, you need to change the above two lines as below:
state real EXCH_H ikj misc 1 Z rh "EXCH_H" "SCALAR EXCHANGE COEFFICIENTS " "m2 s-1"
state real EXCH_M ikj misc 1 Z rj "EXCH_M" "EXCHANGE COEFFICIENTS " "m2 s-1"
 
Hello professor, I want to output the variable "EXCH_M" in wrfout file for YSU, MYJ, and ACM2 PBL scheme, and I use wrf v4.0.
For MYJ scheme, I modify "r" to "rh" for "EXCH_M" in the Registry.EM_COMMON filem, and add the "EXCH_M" following "EXCH_H" in the module_bl_myjpbl.F and module_driver_pbl.F respectively. Then i configure and compile the wrf, but it failed after compiling. Could you please give me some help? Thank you.
 
Did you type ./clean -a before you recompile the code? If not, please do and save the log for me to take a look.
 
Top