EMPIRE DA  v1.9.1
Data assimilation codes using EMPIRE communication
 All Classes Files Functions Variables Pages
model_specific.f90
Go to the documentation of this file.
1 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
2 !!! Time-stamp: <2016-04-13 15:10:55 pbrowne>
3 !!!
4 !!! This file must be adapted to the specific model in use.
5 !!! Copyright (C) 2014 Philip A. Browne
6 !!!
7 !!! This program is free software: you can redistribute it and/or modify
8 !!! it under the terms of the GNU General Public License as published by
9 !!! the Free Software Foundation, either version 3 of the License, or
10 !!! (at your option) any later version.
11 !!!
12 !!! This program is distributed in the hope that it will be useful,
13 !!! but WITHOUT ANY WARRANTY; without even the implied warranty of
14 !!! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 !!! GNU General Public License for more details.
16 !!!
17 !!! You should have received a copy of the GNU General Public License
18 !!! along with this program. If not, see <http://www.gnu.org/licenses/>.
19 !!!
20 !!! Email: p.browne @ reading.ac.uk
21 !!! Mail: School of Mathematical and Physical Sciences,
22 !!! University of Reading,
23 !!! Reading, UK
24 !!! RG6 6BB
25 !!!
26 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
27 
38 subroutine configure_model
39  use pf_control
40  use timestep_data
41  use sizes
42  implicit none
43  !this is for lorenz 96
44  state_dim = 40
45  obs_dim = 20
46  call timestep_data_set_total(pf%time_bwn_obs*pf%time_obs)
47  print*,'#################################'
48  print*,'######### SANITY CHECK ##########'
49  print*,'#################################'
50  print*,'## STATE DIMENSION = ',state_dim
51  print*,'## OBS DIMENSION = ',obs_dim
52  print*,'## TOTAL TIMESTEPS = ',tsdata%total_timesteps
53  print*,'#################################'
54 end subroutine configure_model
55 
59 end subroutine reconfigure_model
60 
61 
62 
63 
68 subroutine solve_r(obsDim,nrhs,y,v,t)
69  implicit none
70  integer, parameter :: rk=kind(1.0d+0)
71  integer, intent(in) :: obsDim
72  integer, intent(in) :: nrhs
73  real(kind=rk), dimension(obsdim,nrhs), intent(in) :: y
75  real(kind=rk), dimension(obsdim,nrhs), intent(out) :: v
77  integer, intent(in) :: t
78 
79  !v = y/(0.3d0**2)
80  stop 'Solve_r not yet implemented'
81 
82 end subroutine solve_r
83 
84 
89 subroutine solve_rhalf(obsdim,nrhs,y,v,t)
90  implicit none
91  integer, parameter :: rk=kind(1.0d+0)
92  integer, intent(in) :: obsDim
93  integer, intent(in) :: nrhs
94  real(kind=rk), dimension(obsdim,nrhs), intent(in) :: y
96  real(kind=rk), dimension(obsdim,nrhs), intent(out) :: v
98  integer, intent(in) :: t
99 
100  !v = y/(0.3d0**2)
101  stop 'Solve_r_half not yet implemented'
102 
103 end subroutine solve_rhalf
104 
105 
106 
111 subroutine solve_hqht_plus_r(obsdim,y,v,t)
112  implicit none
113  integer, parameter :: rk=kind(1.0d+0)
114  integer, intent(in) :: obsdim
115  real(kind=rk), dimension(obsdim), intent(in) :: y
116  real(kind=rk), dimension(obsdim), intent(out) :: v
118  integer, intent(in) :: t
119 
120 
121  !v = y/(5.3d3**2+0.3d0**2)
122  stop 'solve_hqht_plus_r not yet implemented'
123 
124 
125 end subroutine solve_hqht_plus_r
126 
131 subroutine q(nrhs,x,Qx)
132 
133  use sizes
134  implicit none
135  integer, parameter :: rk=kind(1.0d+0)
136  integer, intent(in) :: nrhs
137  real(kind=rk), dimension(state_dim,nrhs), intent(in) :: x
139  real(kind=rk), dimension(state_dim,nrhs), intent(out) :: Qx
141  real(kind=rk), dimension(state_dim,nrhs) :: temp
142 
143  call qhalf(nrhs,x,temp)
144 
145  call qhalf(nrhs,temp,qx)
146 
147 
148 end subroutine q
149 
150 
151 
156 subroutine qhalf(nrhs,x,Qx)
157  use sizes
158  use qdata
159  implicit none
160  integer, parameter :: rk=kind(1.0d+0)
161  integer, intent(in) :: nrhs
162  real(kind=rk), dimension(state_dim,nrhs), intent(in) :: x
164  real(kind=rk), dimension(state_dim,nrhs), intent(out) :: qx
166 
167  !qx = 5.3d3*x
168  stop 'Qhalf not yet implemented'
169 
170 end subroutine qhalf
171 
176 subroutine r(obsDim,nrhs,y,Ry,t)
177  use rdata
178  implicit none
179  integer, parameter :: rk=kind(1.0d+0)
180  integer, intent(in) :: obsDim
181  integer, intent(in) :: nrhs
182  real(kind=rk), dimension(obsDim,nrhs), intent(in) :: y
184  real(kind=rk), dimension(obsDim,nrhs), intent(out) :: Ry
186  integer, intent(in) :: t
187 
188 
189  stop 'R not yet implemented'
190  !Ry = 0.3d0**2*y
191 
192 end subroutine r
193 
198 subroutine rhalf(obsDim,nrhs,y,Ry,t)
199  use rdata
200  implicit none
201  integer, parameter :: rk=kind(1.0d+0)
202  integer, intent(in) :: obsDim
203  integer, intent(in) :: nrhs
204  real(kind=rk), dimension(obsDim,nrhs), intent(in) :: y
206  real(kind=rk), dimension(obsDim,nrhs), intent(out) :: Ry
208  integer, intent(in) :: t
209 
210 
211  stop 'Rhalf not yet implemented'
212  !Ry = 0.3d0*y
213 
214 end subroutine rhalf
215 
216 
221 subroutine h(obsDim,nrhs,x,hx,t)
222  use sizes
223  implicit none
224  integer, parameter :: rk=kind(1.0d+0)
225  integer, intent(in) :: obsDim
226  integer, intent(in) :: nrhs
227  real(kind=rk), dimension(state_dim,nrhs), intent(in) :: x
229  real(kind=rk), dimension(obsDim,nrhs), intent(out) :: hx
231  integer, intent(in) :: t
232 
233 
234  stop 'H not yet implemented'
235  !hx(:,:) = x(539617:566986,:)
236 
237 end subroutine h
238 
243 subroutine ht(obsDim,nrhs,y,x,t)
244  use sizes
245  implicit none
246  integer, parameter :: rk=kind(1.0d+0)
247  integer, intent(in) :: obsDim
248  integer, intent(in) :: nrhs
249  real(kind=rk), dimension(obsDim,nrhs), intent(in) :: y
251  real(kind=rk), dimension(state_dim,nrhs), intent(out) :: x
253  integer, intent(in) :: t
254 
255  stop 'HT not yet implemented'
256  !x = 0.0_rk
257  !x(539617:566986,:) = y(:,:)
258 
259 end subroutine ht
260 
265 subroutine dist_st_ob(xp,yp,dis,t)
266  use sizes
267  implicit none
268  integer, intent(in) :: xp
269  integer, intent(in) :: yp
270  real(kind=kind(1.0d0)), intent(out) :: dis
272  integer, intent(in) :: t
273  stop 'dist not yet implemented'
274 end subroutine dist_st_ob
275 
276 
281 subroutine bhalf(nrhs,x,bx)
282  use sizes
283  use qdata
284  implicit none
285  integer, parameter :: rk=kind(1.0d+0)
286  integer, intent(in) :: nrhs
287  real(kind=rk), dimension(state_dim,nrhs), intent(in) :: x
289  real(kind=rk), dimension(state_dim,nrhs), intent(out) :: bx
291 
292  !qx = 5.3d3*x
293  stop 'Bhalf not yet implemented'
294 
295 end subroutine bhalf
296 
301 subroutine solve_b(nrhs,x,v)
302  use sizes
303  implicit none
304  integer, parameter :: rk=kind(1.0d+0)
305  integer, intent(in) :: nrhs
306  real(kind=rk), dimension(state_dim,nrhs), intent(in) :: x
307  real(kind=rk), dimension(state_dim,nrhs), intent(out) :: v
309 
310  !v = y/(0.3d0**2)
311  stop 'solve_b not yet implemented'
312 
313 end subroutine solve_b
314 
319 subroutine get_observation_data(y,t)
320 
321  use sizes
322  implicit none
323  integer, parameter :: rk = kind(1.0d0)
324  integer, intent(in) :: t
325  real(kind=rk), dimension(obs_dim), intent(out) :: y
326 
327 
328  !This is set up to call the routine written which will
329  !work to do twin experiments. If you want to use your own
330  !observations you should implement your own method of reading
331  !in the observations
333 end subroutine get_observation_data
334 
335 
subroutine bhalf(nrhs, x, bx)
subroutine to take a full state vector x and return in state space.
subroutine default_get_observation_data(y, t)
Subroutine to read observation from a file Uses pftimestep to determine which observation to read...
Definition: data_io.f90:33
subroutine solve_r(obsDim, nrhs, y, v, t)
subroutine to take an observation vector y and return v in observation space.
subroutine configure_model
subroutine called initially to set up details and data for model specific functions ...
subroutine reconfigure_model
subroutine to reset variables that may change when the observation network changes ...
Module to hold user supplied data for observation error covariance matrix.
Definition: Rdata.f90:31
Module that stores the information about the timestepping process.
subroutine timestep_data_set_total(t)
subroutine to define the total number of timesteps that the model will run for
Module that stores the dimension of observation and state spaces.
Definition: sizes.f90:29
subroutine h(obsDim, nrhs, x, hx, t)
subroutine to take a full state vector x and return H(x) in observation space.
subroutine solve_b(nrhs, x, v)
subroutine to take a state vector x and return v in state space.
Module as a place to store user specified data for .
Definition: Qdata.f90:31
subroutine solve_rhalf(obsdim, nrhs, y, v, t)
subroutine to take an observation vector y and return v in observation space.
subroutine ht(obsDim, nrhs, y, x, t)
subroutine to take an observation vector y and return x in full state space.
subroutine rhalf(obsDim, nrhs, y, Ry, t)
subroutine to take an observation vector x and return Rx in observation space.
module pf_control holds all the information to control the the main program
Definition: pf_control.f90:29
subroutine solve_hqht_plus_r(obsdim, y, v, t)
subroutine to take an observation vector y and return v in observation space.
subroutine get_observation_data(y, t)
Subroutine to read observation from a file .
subroutine qhalf(nrhs, x, Qx)
subroutine to take a full state vector x and return in state space.
subroutine q(nrhs, x, Qx)
subroutine to take a full state vector x and return Qx in state space.
subroutine dist_st_ob(xp, yp, dis, t)
subroutine to compute the distance between the variable in the state vector and the variable in the o...
subroutine r(obsDim, nrhs, y, Ry, t)
subroutine to take an observation vector x and return Rx in observation space.