Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/add daily bfg harvester surface energy balance #49

Open
wants to merge 7 commits into
base: develop
Choose a base branch
from

Conversation

sherrieF
Copy link
Collaborator

@sherrieF sherrieF commented Feb 7, 2024

This pull request is for the calculation of the surface_energy_balance(netR). The harvester that
calculates the netR is daily_bfg.py. The netR is a derived variable using
the required variables dswrf_ave,dlwrf_ave,ulwrf_ave,uswrf_ave,shtfl_ave,lhtfl_ave. These variables are:
dswrf_ave : averaged surface downward shortwave flux
dlwrf_ave : surface downward longwave flux
ulwrf_ave : surface upward longwave flux
uswrf_ave : averaged surface upward shortwave flux
shtfl_ave : surface sensible heat flux
lhtfl_ave : surface latent heat flux
The netR calculation is the weighted mean of these variables as follows:
netR = dswrf_ave + dlwrf_ave - ulwrf_ave - uswrf_ave - shtfl_ave - lhtfl_av.
The test script for the daily_bfg.py harvester is test_harvester_surface_energy_balance.py. In the
test_harvester_surface_energy_balance.py script the values returned from the harvester daily_bfg.py are
compared to values calculated in a separate python script. The values calculated in the separate python script
are hard coded in to the test script.
The files used in the test are the bfg control netcdf files with the names:bfg_1994mmdd${00,06,09}_fhr${00,06,09)_surf_energy_balance_control.nc.
pytest passed for the test of the harvester.

values returned by the harvester daily_bfg.py. The test
is for the derived variable netR. netR is derived from
the variables dswrf_ave,dlwrf_ave,ulwrf_ave,uswrf_ave,shtfl_ave,lhtfl_ave
which are located in the bfg control netcdf files. The values for
weighted mean,min,max and variance of each of the variables
are calculated in a separate python script and hard coded
in the file.
The netR is the name given to the surface energy balance.
The netR is derived from the following variables:
 dswrf_ave,dlwrf_ave,ulwrf_ave,uswrf_ave,shtfl_ave,lhtfl_ave
located in the bfg control Netcdf files in the test data directory.
The statistics weighted_mean,minimum,maximum and variance of each
of the required variables are calculated in the pyton script.
The weighted_mean of netR is also calculated.  The statistics
are calculated using the python class located in src/score_hv
stats_utils.py.
Copy link
Contributor

@amschne amschne left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a good start to the SEB harvester, which will be very helpful to diagnose surface fluxes in replay and upcoming reanalysis data sets.

It seems that this PR is dependent on #48 for stat_utils, which is not part of this PR. I suggest we work on that first before trying to test and develop this PR.

A couple issues, however, to address now:

  • the init.py files have been removed and I'm not sure why. I think at least one is needed so that score_hv can be imported as a module
  • there are extraneous files in test/data that should be removed from this PR

and variance of the required variables that are needed to calculate
the derived field surface energy balance.
to line 216.
Uncommented the field prateb_ave.
@sherrieF
Copy link
Collaborator Author

the _init.py file is gone. pytests passed

@jrknezha
Copy link
Collaborator

Per team discussion: this will be separated into a new PR using new bfg and stat utils framework

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants