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

avg_tsfc.exe - no daily mean temperature

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.


Recently I am trying to use WRF to simulate some variables in a region for a long time, and lakes would definitely have impacts on my results. To make the temperature of lakes in the model more realistic, a choice is to run the avg_tsfc.exe to create the TAVGSFC file, which should contain "a daily-average of the surface air temperature field, which will be substituted for the SST field only over lakes" according to the ARW User’s Guide.

I ran the avg_tsfc.exe and TAVGSFC file is obtained. However, I carefully checked the met_em files, and I found that TAVGSFC in every met_em files did not actually contain daily mean temperature. It seemed to be a mean over the whole period. (TAVGSFC in every met_em files are same)

As the picture shows, the two TAVGSFC have same max and min value and same pattern, which is impossible if TAVGSFC is daily mean instead of a mean over the whole period...And I've checked other met_em files, they are all the same as this.

How to solve this problem?

Or I should run avg_tsfc.exe and metgrid.exe every day or every week to update TAVGSFC?



  • 微信图片_20220511200103.png
    1.2 MB · Views: 116
  • 微信图片_20220511200108.png
    1.2 MB · Views: 116
Can someone help me with this question? I asked some WRF users around and they were not sure about the answer to this question...
I think the description in the User's Guide (which I admit I may have written...) is probably not accurate. The avg_tsfc.exe program computes the average 2-m air temperature over the largest number of 24-h periods from the start_date to the end_date in your namelist.wps file, and writes the resulting field to the TAVGSFC intermediate file.

For example, if your start_date and end_date were '2010-10-23_00:00:00' and '2010-10-25_00:00:00', the TAVGSFC file would contain the average over the full 48-h period. However, if your start_date and end_date were '2010-10-23_00:00:00' and '2010-10-25_12:00:00', the avg_tsfc.exe program should ignore the last 12 hours of intermediate files (after 2010-10-25 0000 UTC), since only full 24-h periods are used in the average to avoid biases (e.g., a night-time or a day-time bias).

If you are interested in a moving average or something similar, you could either try modifying the avg_tsfc.F source code yourself, or you could write a script that repeatedly modifies the start_date and end_date in your namelist.wps file and calls the avg_tsfc.exe program in a loop, moving the TAVGSFC intermediate file to names like 'TAVGSFC:YYYY-MM-DD_HH'. Then, you would need to specify the intermediate file prefix 'TAVGSFC' in the fg_name variable in your namelist.wps file rather than using the constants_name variable.
Hi mgduda

Thanks for your reply!

It seems that I need to modify the original code or run WPS several times to make sure that TAVGSFC can updated by time.