EMPIRE DA  v1.9.1
Data assimilation codes using EMPIRE communication
 All Classes Files Functions Variables Pages
timestep_data.f90
Go to the documentation of this file.
1 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
2 !!! Time-stamp: <2016-10-18 15:00:41 pbrowne>
3 !!!
4 !!! Module that stores information about timestepping
5 !!! Copyright (C) 2015 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 
31  implicit none
32  type, public :: timestep_data_type
33  integer :: total_timesteps
35  integer :: current_timestep
37  integer :: completed_timesteps
39  integer :: next_ob_timestep
40  logical :: is_analysis
43  logical :: do_analysis
47  integer, allocatable, dimension(:) :: obs_times
53  integer :: tau
54  end type timestep_data_type
55  type(timestep_data_type), save :: tsdata
57 
58  contains
61  use output_empire, only : emp_e
62  implicit none
63  integer, intent(in) :: n
64  integer :: st
65  allocate(tsdata%obs_times(n),stat=st)
66  if(st .ne. 0) then
67  write(emp_e,*) 'ERROR: allocation of obs_times in timestep data'
68  write(emp_e,*) 'ERROR: STOPPING.'
69  stop '-7'
70  end if
71  tsdata%obs_times = -1
73 
76  deallocate(tsdata%obs_times)
78 
81  subroutine timestep_data_set_obs_times(obs_num_in_time,timestep)
82  implicit none
83  integer, intent(in) :: obs_num_in_time
84  integer, intent(in) :: timestep
85 
86  tsdata%obs_times(obs_num_in_time) = timestep
87  end subroutine timestep_data_set_obs_times
88 
90  subroutine timestep_data_set_next_ob_time(ob_time)
91  implicit none
92  integer, intent(in) :: ob_time
93 
94  tsdata%next_ob_timestep = ob_time
95  end subroutine timestep_data_set_next_ob_time
96 
99  subroutine timestep_data_get_obs_times(obs_num_in_time,timestep)
100  implicit none
101  integer, intent(in) :: obs_num_in_time
102  integer, intent(out) :: timestep
103  timestep = tsdata%obs_times(obs_num_in_time)
104  end subroutine timestep_data_get_obs_times
105 
108  implicit none
109  tsdata%do_analysis = .true.
110  end subroutine timestep_data_set_do_analysis
111 
115  implicit none
116  tsdata%do_analysis = .false.
117  end subroutine timestep_data_set_do_no_analysis
118 
121  implicit none
122  tsdata%is_analysis = .true.
123  end subroutine timestep_data_set_is_analysis
124 
127  implicit none
128  tsdata%is_analysis = .false.
129  end subroutine timestep_data_set_no_analysis
130 
133  implicit none
134  integer, intent(in) :: t
135  tsdata%completed_timesteps = t
136  end subroutine timestep_data_set_completed
137 
140  implicit none
141  integer, intent(in) :: t
142  tsdata%current_timestep = t
143  end subroutine timestep_data_set_current
144 
148  implicit none
149  integer, intent(in) :: t
150  tsdata%total_timesteps = t
151  end subroutine timestep_data_set_total
152 
154  subroutine timestep_data_set_tau(pseudotimestep)
155  implicit none
156  integer, intent(in) :: pseudotimestep
157  tsdata%tau = pseudotimestep
158  end subroutine timestep_data_set_tau
159 
160 
161 End Module timestep_data
162 
163 
164 
subroutine timestep_data_allocate_obs_times(n)
subroutine to allocate space for obs_times array
Module that stores the information about the outputting from empire.
subroutine timestep_data_set_completed(t)
subroutine to define the number of completed timesteps
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
subroutine timestep_data_set_tau(pseudotimestep)
subroutine to define the current number of timesteps between observations
subroutine timestep_data_set_current(t)
subroutine to define the current timestep
subroutine timestep_data_set_do_no_analysis
subroutine to define if the current timestep should not perform an analysis
subroutine timestep_data_set_obs_times(obs_num_in_time, timestep)
subroutine to set the timestep corresponding to the observation number in time
subroutine timestep_data_set_do_analysis
subroutine to define if the current timestep should perform an analysis
subroutine timestep_data_set_next_ob_time(ob_time)
subroutine to set the next observation timestep
subroutine timestep_data_set_is_analysis
subroutine to define if the current ensemble is an analysis
subroutine timestep_data_deallocate_obs_times
subroutine to deallocate obs_times array
subroutine timestep_data_get_obs_times(obs_num_in_time, timestep)
subroutine to extract the timestep corresponding to the observation number in time ...
subroutine timestep_data_set_no_analysis
subroutine to define if the current ensemble is not an analysis