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

Problem with outputing some sfclay PBL variables

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.


New member
I think there might be some issues to output the following variables in the history files:

I am currently using WRF v.4.1.2 but I also noticed this problem in WRF v4.0.3. Other sfclay PBL variables such as FM, FH and BR were successfully added to the history files. The PBL scheme used for the test purposes is MYNN 2.5 (option 5) and the associated surface layer scheme (option 5).

To output sfclay PBL variables, I edited the Registry.EM_COMMON files and added h in the IO column; this work previously for me. Browsing module_sf_mynn.F, module_sf_sfclay.F and module_bl_mynn.F shows that PSIM, PSIH and GZ10Z0 are define as global variables (intent(inout)) similarly as M, FH and BR that were outputed correctly in the history files.

Could you please suggest, a way to successfully add PSIM, PSIH and GZ10Z0 to the history files?

Sincerely yours

If you look in the Registry.EM_COMMON file, you can see that the variables PSIM, PSIH, and GZ1OZ0 are listed as "i1" variables, while the others you mention are "state" variables. i1 variables are basically those that are only allocated temporarily during the solve and integration steps, and then deallocated to save memory. While these variables are needed for the integration, they are not something that most people need to see as output. And because they are listed this way, simply adding "h" in the I/O column will not force them to output. However, by promoting them to state variables, and with some code manipulation, you can force them to output. I am attaching the necessary modified files for V4.1.2 so that you can use them. You'll need to place the Registry.EM_COMMON file in the Registry/ directory, and then place the other 3 in the dyn_em/ directory. Because you are modifying the Registry, you'll need to issue a 'clean -a' and then reconfigure before recompiling the code. After that, when you run you should be able to see the 3 additional variables output (I also added an "h" to the FM, FH, and BR variables in the Registry file, so that they will continue to output if you'd like).


  • module_first_rk_step_part1.F
    107.4 KB · Views: 57
  • module_first_rk_step_part2.F
    52.4 KB · Views: 59
  • Registry.EM_COMMON
    385.9 KB · Views: 62
  • solve_em.F
    249.5 KB · Views: 60