parse-sea-condition ( str -- str' )


Vocabulary
metar.private

Inputs
stran object


Outputs
str'an object


Definition


:: parse-sea-condition ( str -- str' )
str rest :> code code "//" head?
[ "//" code 3 tail ] [ code "/" split1 ] if
:> ( temperature condition ) temperature
parse-temperature-value [ "unavailable" ] unless*
condition "S" head?
[ condition rest sea-states at "sea state %s" sprintf ] [
condition rest dup [ 47 = ] all?
[ drop "wave height unavailable" ] [
string>number 10 /f
"significant wave height %.1f meters" sprintf
] if
] if "sea-surface temperature %s; %s" sprintf ;