sweq_simulate: Simulate from the modified SWEQ model

Description Usage Arguments Value Examples

View source: R/dynamics_sweq.R

Description

Simulate a time series of states and observations at a given frequency from the modified SWEQ model. The parameters and options follow the original implementation of the author in Python. Here the model is implemented in fortran90 for better performance.

Usage

1
2
3
4
5
6
sweq_simulate(duration, freq, ndim, umean = 0, unoise = FALSE, topo = 1,
  noiseswitch = 1, kh = 25000, ku = kh, kr = 200, noisefreq = 1,
  thres.rain = 0.005, sigr = 0.0025, sigu = 0.01, alpha = 1/4000,
  beta = 3, norain = TRUE, aircraft = 0, rgauss = FALSE,
  R.sigr = sigr, R.sigu = sigu, seed = sample.int(1000, 1), hc = 90.02,
  hr = 90.4, state0 = NA)

Arguments

duration

the total integration time

freq

the frequency at which the process is recorded and observed

ndim

dimension of the 1-dim domain

umean

Initial wind field

topo

1=nothing, 2=one mountain, 3=5mountains

kh, ku, kr

diffusion parameters

thres.rain

threshold over which rain is observed

sigr, sigu

standard deviation of r and u observations

alpha,

beta model parameters

R.sigr,

R.sigu are used to create the R matrix (not necessarily equal to sigr and sigu)

seed

random seed (pass as NA if set externally)

hc, hr

critical heights for clouds and rain formation

state0

possible initial state at time 0

unoise:

TRUE/FALSE wind perturbation

noiseswitch=1

for adding random plumes

noisefreq=1

probability of random plume at each integration cycle

norain:

should no-rain observations be created

Value

a list with everything needed for assimilation and plotting

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
ndim <- 300
freq <- 60
duration <- 12*freq
kh <- 25000; ku<- 25000; kr<- 200
alpha <- 1/4000; beta <- 3; hr <- 90.4; hc <- 90.02
train <- 0.005;
sigr <- 0.1
sigu <- 0.0025
R.sigu <- sigu
R.sigr <- 0.025
norain <- TRUE ## TRUE=assimilate norain observations
set.seed(1)
sweq_run <- sweq_simulate(duration, freq, ndim,
                          alpha=alpha, beta=beta,
                          noisefreq = 1, umean = 0,
                          hr=hr, hc=hc,
                          sigr=sigr, sigu=sigu,
                          R.sigr=R.sigr, R.sigu=R.sigu,
                          norain=norain,
                          thres.rain=train)
sweq_ggplot(sweq_run$state.ts[1,], obs=sweq_run$y.ts[[1]])

robertsy/assimilr documentation built on May 27, 2019, 10:33 a.m.