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

How to modify HFX in a specific region

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
Dear all,
I am running a real case with WRF4.2 in a two-way nested domain.
I want to modify surface sensible heat flux in a specific small region in my simulation domain. I think I should modify HFX in module_sf_noahdrv.F since I'm using sf_surface_physics = 2.
My question now is that I don't know how to make the modification only work for the region I am interested in. Is there any way by which I could access the lat/lon of the grid in the code? How can I know the location of the grid so that I could only modify the HFX in the region I'm interested in?
Thank you for helping!

Best regards,
Hi Xuelin,
If you use the ncview program, you can figure out the lat/lon by looking at the 2d variables XLAT and XLONG. You can match that up with the i,j coordinates.
Hi kwerner,
Thank you for your reply!
But I still confused. I think that WRF will divide the whole domain into several tiles when running, then is the i/j that I matched with XLAT/XLONG works when it comes to the tiles? For example, the location I want to modify on is i=5,j=5 in XLAT/XLONG. WRF divides the domain into tiles, and i=5,j=5 in each tile may be changed and consequently, variable on many locations may be changed.
Hope that I described my question clearly. Looking forward to your reply!
Best regards,
I apologize for the confusion. I thought you were referring to the i,j coordinate for the full domain, and in that case, the lat/lon should always match up to the i,j coordinates. However, if you're referring to the i,j for each tile, then unfortunately there is no tool to do this, and the division of the way the domain is split up depends on the number of processors you use. Therefore you will need to figure out a way to write a script that can do this for your settings.