Skip to content

Commit

Permalink
units of swflux (issue #10)
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander-Barth committed Oct 26, 2023
1 parent 5a050d7 commit bfece00
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Atmosphere/prepare_ecmwf.jl
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ function prepare_ecmwf(
ECMWFname = "",
accumulation = true,
output = "swflux",
scale = 100.0/Δt_seconds*(24*3600.0),
scale = 1.0/Δt_seconds,
),
(
Vname = "swrad",
Expand Down
5 changes: 5 additions & 0 deletions src/Atmosphere/prepare_gfs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -454,6 +454,11 @@ function prepare_gfs(

# check sign
field = -(field - evaporation_rate)

density_fresh_water = 998 # kg m⁻³

# kg m⁻² s⁻¹ / (kg m⁻³) = m s⁻¹
field = field / density_fresh_water
elseif Vname == "swrad"
field = swrad_down - field
else
Expand Down
2 changes: 1 addition & 1 deletion src/metadata.jl
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ metadata = Dict(
Tname = "swf_time",
ncattrib = (
long_name = "surface net freshwater flux (E-P)",
units = "centimeter day-1",
units = "m s-1",
positive_value = "net evaporation",
negative_value = "net precipitation",
),
Expand Down

0 comments on commit bfece00

Please sign in to comment.