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

Altering Surface Fluxes via module_sf_sfclay.F

HragN

New member
I am currently interested in running an experiment that alters HFX and LH by a scalar via windspeed.

For example, I want to add a scalar value to the windspeed that calculates the surface flux values, and to do this, I dug into module_sf_sfclay.F file and found where QFX/LH and HFX are calculated. They both use a coefficient in the equation (FLQC and FLHC for QFX and HFX respectively) that is calculated earlier using UST (u*).

My question is, if I adjust the coefficients FLQC and FLHC, will this impact the HFX and QFX calculations, and thereby impacting the surface heat fluxes that then influence the atmosphere? Is there potentially a better way of conducting this experiment?

Thank you,

Hrag
 

Attachments

  • module_sf_sfclay.F
    49.5 KB · Views: 0
Hrag,
As long as you are using sf_sfclay_physics = 91, then making those modifications should affect the results of QFX and HFX. The file module_sf_sfclay.F corresponds specifically with option 91. If you're using a different option, you can determine which module corresponds with that option by looking in WRF/Registry/Registry.EM_COMMON. If you search for "sf_sfclay_physics," closer to the bottom is a list of all the different options, and to the left of each of those option numbers is the name of the scheme - which typically matches the file name.

Once you make modifications to the file, you'll need to recompile WRF to reflect the changes. You don't need to clean the code or reconfigure - just recompilie (which should be faster than a full compile). You can then run a short, small test to check whether you're seeing the changes you expect.
 
Hrag,
As long as you are using sf_sfclay_physics = 91, then making those modifications should affect the results of QFX and HFX. The file module_sf_sfclay.F corresponds specifically with option 91. If you're using a different option, you can determine which module corresponds with that option by looking in WRF/Registry/Registry.EM_COMMON. If you search for "sf_sfclay_physics," closer to the bottom is a list of all the different options, and to the left of each of those option numbers is the name of the scheme - which typically matches the file name.

Once you make modifications to the file, you'll need to recompile WRF to reflect the changes. You don't need to clean the code or reconfigure - just recompilie (which should be faster than a full compile). You can then run a short, small test to check whether you're seeing the changes you expect.
Hi Kwerner,

Thank you for your prompt response. Your tips have been very helpful. I actually realized that there is a revised version of the module_sf_sfclay.F in the phys directory earlier today. I made the edits I proposed to the revised file (module_sf_sfclayrev.F) file since my namelist.input option calls to the revised version (sf_sfclay_physics = 1), and now everything works! Thanks for catching that and providing me a way to easily check what options call on what module through the Registry!

I did want to ask for a clarification regarding your last tip about recompiling. After making edits, I resort to running a clean and reconfiguration, but your suggestion would save me a lot of time. If I understand you correctly, I could instead simply skip the "./clean -a" and "./configure" step and simply run the compile command i typically run (./compile -j 2 em_real > compile.out 2>&1 &) after i make edits to .F files, and those edits should be reflected in WRF?

Thank you,

Hrag
 
Hrag,
Yes, that is correct. For modifications to any of the *.F files, you only need to compile, and don't need to use ./clean -a, nor reconfigure. I'm glad you were able to solve the issue!
 
Top