-
Notifications
You must be signed in to change notification settings - Fork 12
/
stats_type.F90
62 lines (42 loc) · 1.93 KB
/
stats_type.F90
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
!-----------------------------------------------------------------------
! $Id$
!===============================================================================
module stats_type
! Description:
! Contains derived data type 'stats'.
! Used for storing output statistics to disk.
!-----------------------------------------------------------------------
use stat_file_module, only: &
stat_file ! Type
use clubb_precision, only: &
stat_rknd, & ! Variable(s)
stat_nknd, &
core_rknd
implicit none
private ! Set Default Scope
public :: stats
! Derived data types to store GrADS/netCDF statistics
type stats
! Number of fields to sample
integer :: num_output_fields ! Number of variables being output to disk (e.g.
! cloud_frac, rain rate, etc.)
integer :: &
ii, & ! Horizontal extent of the variables (Usually 1 for the single-column model)
jj, & ! Horizontal extent of the variables (Usually 1 for the single-column model)
kk ! Vertical extent of the variables (Usually gr%nz from grid_class)
! Vertical levels
real( kind = core_rknd ), allocatable, dimension(:) :: z ! altitude [m]
! Array to store sampled fields
real(kind=stat_rknd), allocatable, dimension(:,:,:,:) :: accum_field_values
! The variable accum_field_values contains the cumulative sums
! of accum_num_samples sample values of each
! of the num_output_fields (e.g. the sum of the sampled rain rate values)
integer(kind=stat_nknd), allocatable, dimension(:,:,:,:) :: accum_num_samples
! accum_num_samples is the number of samples for each of the num_output_fields fields
! and each of the kk vertical levels
! Tracks if a field is in the process of an update
logical, allocatable, dimension(:,:,:,:) :: l_in_update
! Data for GrADS / netCDF output
type (stat_file) :: file
end type stats
end module stats_type