consolidated wrf functions