6 use iso_c_binding,
only : c_long_long, c_double, c_int, c_bool
21 integer (c_long_long) :: n = 0
22 real (c_double) :: nodata_value = -9999.
43 integer (c_int),
intent(in) :: NX
44 integer (c_int),
intent(in) :: NY
45 real (c_double),
intent(in) :: X0
46 real (c_double),
intent(in) :: Y0
47 real (c_double),
intent(in) :: X1
48 real (c_double),
intent(in) :: Y1
49 real (c_double),
intent(in) :: nodata_value
51 this%nodata_value = nodata_value
116 if (
allocated(this%grd_delta%dpData) ) this%grd_delta%dpData = 0.0_c_double
117 if (
allocated(this%grd_delta_n%dpData) ) this%grd_delta_n%dpData = 0.0_c_double
118 if (
allocated(this%grd_delta_n2%dpData) ) this%grd_delta_n2%dpData = 0.0_c_double
119 if (
allocated(this%grd_term1%dpData) ) this%grd_term1%dpData = 0.0_c_double
120 if (
allocated(this%grd_M1%dpData) ) this%grd_M1%dpData = 0.0_c_double
121 if (
allocated(this%grd_M2%dpData) ) this%grd_M2%dpData = 0.0_c_double
122 if (
allocated(this%grd_sum%dpData) ) this%grd_sum%dpData = 0.0_c_double
123 this%n = 0_c_long_long
132 real (c_double),
intent(in) :: grd_data(:,:)
133 logical (c_bool),
intent(in) :: mask(:,:)
135 integer (c_long_long) :: n1
142 this%grd_sum%dpData = this%grd_sum%dpData + grd_data
143 this%grd_delta%dpData = grd_data - this%grd_M1%dpData
144 this%grd_delta_n%dpData = this%grd_delta%dpData / real(this%n, c_double)
145 this%grd_delta_n2%dpData = this%grd_delta_n%dpData * this%grd_delta_n%dpData
146 this%grd_term1%dpData = this%grd_delta%dpData * this%grd_delta_n%dpData &
148 this%grd_M1%dpData = this%grd_M1%dpData + this%grd_delta_n%dpData
149 this%grd_M2%dpData = this%grd_M2%dpData + this%grd_term1%dpData
153 this%grd_sum%dpData = -9999._c_double
154 this%grd_M1%dpData = -9999._c_double
155 this%grd_M2%dpData = -9999._c_double
166 real (c_double),
dimension(:,:),
intent(out) :: dpData
168 dpdata = this%grd_M1%dpData
177 real (c_double),
dimension(:,:),
intent(out) :: dpData
179 dpdata = this%grd_sum%dpData
188 real (c_double),
dimension(:,:),
intent(out) :: dpData
192 where ((this%grd_M1%dpData > -9999._c_double) .and. this%n > 1)
193 dpdata = this%grd_M1%dpData / (real(this%n, c_double) - 1.0_c_double)
195 dpdata = -9999._c_double
205 real (c_double),
dimension(:,:),
allocatable,
intent(out) :: dpData
210 dpdata = sqrt(this%grd_M1%dpData / (real(this%n, c_double) - 1.0_c_double))
212 dpdata = 0.0_c_double
This module contains physical constants and convenience functions aimed at performing unit conversion...
logical(c_bool), parameter, public true
logical(c_bool), parameter, public false
Provides support for input and output of gridded ASCII data, as well as for creation and destruction ...
integer(c_int), parameter, public grid_datatype_double
subroutine calc_sum_sub(this, dpdata)
subroutine calc_mean_sub(this, dpdata)
subroutine push_sub(this, grd_data, mask)
subroutine calc_std_deviation_sub(this, dpdata)
subroutine calc_variance_sub(this, dpdata)
subroutine clear_sub(this)
subroutine initialize_sub(this, nx, ny, x0, y0, x1, y1, nodata_value)