Skip to content

Commit

Permalink
added docstring
Browse files Browse the repository at this point in the history
  • Loading branch information
jagoosw committed Jul 24, 2024
1 parent 116fa19 commit 9066a7a
Showing 1 changed file with 20 additions and 2 deletions.
22 changes: 20 additions & 2 deletions src/Light/prescribed.jl
Original file line number Diff line number Diff line change
@@ -1,8 +1,26 @@
using Oceananigans.Fields: compute!
using Oceananigans.Fields: compute!, AbstractField

function maybe_named_fields(field)

isa(field, AbstractField) || @warn "fields: $field is not an `AbstractField"

return ((:PAR, ), (field, ))
end

maybe_named_fields(field) = ((:PAR, ), (field, ))
maybe_named_fields(fields::NamedTuple) = (keys(fields), values(fields))

"""
PrescribedPhotosyntheticallyActiveRadiation(fields)
`PrescribedPhotosyntheticallyActiveRadiation` returns "prescribed" PAR
fields which are user specified, e.g. they may be `FunctionField`s or
`ConstantField`s.
`fields` may either be an `AbstractField` or a `NamedTuple` of names and
fields which will be returned in `biogeochemical_auxiliary_fields`, if only
one field is present the field will be named `PAR`.
"""

struct PrescribedPhotosyntheticallyActiveRadiation{F, FN}
fields :: F
field_names :: FN
Expand Down

0 comments on commit 9066a7a

Please sign in to comment.