Calculation of Resolved Heat Flux

Questions specifically related to modifying the WRF source code
Post Reply
vanitas456
Posts: 3
Joined: Tue Mar 23, 2021 8:36 am

Calculation of Resolved Heat Flux

Post by vanitas456 » Thu May 20, 2021 4:29 am

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.

kwerner
Posts: 2328
Joined: Wed Feb 14, 2018 9:21 pm

Re: Calculation of Resolved Heat Flux

Post by kwerner » Mon May 24, 2021 5:45 pm

Hi,
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.
NCAR/MMM

Post Reply

Return to “WRF Code Modification”