#Metview Macro

#  **************************** LICENSE START ***********************************
# 
#  Copyright 2021 ECMWF. This software is distributed under the terms
#  of the Apache License version 2.0. In applying this license, ECMWF does not
#  waive the privileges and immunities granted to it by virtue of its status as
#  an Intergovernmental Organization or submit itself to any jurisdiction.
# 
#  ***************************** LICENSE END ************************************
# 
#=============================================================================
# Function      : absolute_vorticity
#
# Syntax        : fieldset absolute_vorticity(vo)
#                                          
# Category      : DYNAMICS
#
# OneLineDesc   : Computes the absolute vorticity from relative vorticity
#
# Description   : Computes the absolute vorticity from relative vorticity
#
# Parameters    : vo - relative vorticity (1/s)	 		
#           
# Return Value  : the absolute vorticity (1/s)
#
# Dependencies  : none
#
#===============================================================================

function absolute_vorticity(vo)
    
    omega = 7.292115E-5 # angular velocity of Earth
    absv = 2.0 * omega * sinlat(vo) + vo
    absv = grib_set_long(
           absv, ["paramId", 3041, "generatingProcessIdentifier", 146]
    )
            
    return absv
    
end absolute_vorticity