MeteoUtilities Module

History

current version 1.0 - 19th October 2017

version date comment
1.0 19/Oct/2017 Original code

License

license: GNU GPL http://www.gnu.org/licenses/

Module Description

Module containing subroutines used by Meteo module



Subroutines

public subroutine Interpolate(network, method, near, idw_power, anisotropy, varmodel, lags, maxlag, grid, devst)

interpolate site data to space

Arguments

Type IntentOptional Attributes Name
type(ObservationalNetwork), intent(in) :: network
integer(kind=short), intent(in) :: method
integer(kind=short), intent(in) :: near
real(kind=float), intent(in) :: idw_power
integer(kind=short), intent(in) :: anisotropy
integer(kind=short), intent(in) :: varmodel
integer(kind=short), intent(in) :: lags
real(kind=float), intent(in) :: maxlag
type(grid_real), intent(inout) :: grid
type(grid_real), intent(inout) :: devst

public subroutine Offset(grid, off)

apply offset to a grid_real

Arguments

Type IntentOptional Attributes Name
type(grid_real), intent(inout) :: grid
real(kind=float), intent(in) :: off

public subroutine ReadField(filename, time, dtAggr, dtGrid, aggrType, field, varName, stdName, cellsize, dem, demHiRes, lapse)

read a time varying field from a netcdf file

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: filename

name of netcdf file

type(DateTime), intent(in) :: time

time of the variable to read

integer, intent(in) :: dtAggr

aggregation time interval

integer, intent(in) :: dtGrid

time interval of grid in netcdf file

character(len=*), intent(in) :: aggrType

aggregation type. 'M' = mean, 'C' = cumulated, 'X' = maximum, 'N' = minimum

type(grid_real), intent(inout) :: field
character(len=*), intent(in), optional :: varName

name of the variable to read

character(len=*), intent(in), optional :: stdName

name of the variable to read

real, intent(in), optional :: cellsize
type(grid_real), intent(in), optional :: dem
type(grid_real), intent(in), optional :: demHiRes
type(grid_real), intent(in), optional :: lapse

public subroutine Scale(grid, sc)

apply scale factor to a grid_real

Arguments

Type IntentOptional Attributes Name
type(grid_real), intent(inout) :: grid
real(kind=float), intent(in) :: sc

public subroutine ShiftBackWithLapse(grid, dem, lapse, refelev, dt)

Shift back interpolated field to terrain surface

Arguments

Type IntentOptional Attributes Name
type(grid_real), intent(inout) :: grid
type(grid_real), intent(in) :: dem
type(grid_real), intent(in) :: lapse
real(kind=float), intent(in) :: refelev

ereference elevation

integer(kind=short), intent(in), optional :: dt

public subroutine ShiftMeteoWithLapse(input, lapse, refelev, output, dt)

shift meteo observations to reference elevation applying lapse rate

Arguments

Type IntentOptional Attributes Name
type(ObservationalNetwork), intent(in) :: input

actual station network

type(grid_real), intent(in) :: lapse

lapse rate grid

real(kind=float), intent(in) :: refelev

reference elevation

type(ObservationalNetwork), intent(inout) :: output

station network at reference elevation

integer, intent(in), optional :: dt

used when lapse rate is a flux