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

Calculation of Resolved Heat Flux

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
Hi everyone!

I'm looking for a way to calculate the resolved heat flux. It seems like i have to modify some files in phys, Registry, and some other directory. Could anybody tell me which files did i have to modify and how do i modify them? Right now i'm using WRF 4.2.

Thank you for your attention.
The files you need to modify will depend on what physics options you're using and to which scheme you wish to add the calculation. If you know the physics scheme, you'll want to find the file specific to that scheme and make modifications in the correct subroutine. You'll then want to check to see what subroutines (in the model - not just in that file) call that subroutine, and you'll need to make modifications up the chain until you get to the top level. So you'll want to modify the code in the following files:

- the specific file for the physics routine
- the physics driver for that scheme (e.g., if you're modifying a radiation file, you will also modify the radiation driver)
- dyn_em/module_first_rk_step_part1.F (which calls all drivers except microphysics - that one is called directly by dyn_em/solve_em.F)
- dyn_em/solve_em.F (which calls module_first_rk_step_part1.F)
- phys/module_physics_init.F (I think - if it includes calls to any of the above files/subroutines)
- dyn_em/start_em.F
- Registry.EM_COMMON

For a very basic example of adding code, you can see how to add a diagnostic variable in this exercise, but this does not include any physics files. It could potentially be a useful reference, though.