32 use netcdf,
only: nf90_float, nf90_double
41 character(len=*) :: vname
42 integer,
dimension(:),
intent(in) :: in_index
43 integer,
dimension(:),
allocatable,
intent(out) :: out_index
46 integer,
dimension(:),
allocatable :: dims
48 real,
dimension(:),
allocatable :: var1d
49 real,
dimension(:,:),
allocatable :: var2d
50 real(kind_real),
dimension(:),
allocatable :: var1d_dbl
51 real(kind_real),
dimension(:,:),
allocatable :: var2d_dbl
60 if (
allocated(dims))
deallocate(dims)
61 call nc_diag_read_get_var_dims(ncid, vname, ndim, dims)
62 vtype = nc_diag_read_get_var_type(ncid, vname)
65 allocate(var1d(dims(1)))
66 if (vtype == nf90_float)
then 67 call nc_diag_read_get_var(ncid, vname, var1d)
68 elseif (vtype == nf90_double)
then 69 allocate(var1d_dbl(dims(1)))
70 call nc_diag_read_get_var(ncid, vname, var1d_dbl)
71 var1d =
real(var1d_dbl)
75 allocate(var2d(dims(1), dims(2)))
76 if (vtype == nf90_float)
then 77 call nc_diag_read_get_var(ncid, vname, var2d)
78 elseif (vtype == nf90_double)
then 79 allocate(var2d_dbl(dims(1), dims(2)))
80 call nc_diag_read_get_var(ncid, vname, var2d_dbl)
81 var2d =
real(var2d_dbl)
85 allocate(var1d(dims(2)))
96 do i = 1,
size(in_index)
101 mlen =
size(in_index) - mcount
105 allocate(out_index(mlen))
108 do i = 1,
size(in_index)
111 out_index(imiss) = in_index(i)
Fortran module containing IODA utility programs.
real(kind=kind_real), public missing_value
default for NetCDF file converted from PrepBUFR, the actual missing value is 9.96921e+36 ...
integer, parameter, public kind_real
subroutine, public ioda_deselect_missing_values(ncid, vname, in_index, out_index)