[Dart-dev] DART/branches Revision: 12332
dart at ucar.edu
dart at ucar.edu
Tue Jan 16 11:15:24 MST 2018
thoar at ucar.edu
2018-01-16 11:15:23 -0700 (Tue, 16 Jan 2018)
81
May be working ... but not using the _FillValue or valid_[min,max] attributes.
Modified: DART/branches/cesm_clm/observations/obs_converters/NSIDC/SMAP_L2_to_obs.f90
===================================================================
--- DART/branches/cesm_clm/observations/obs_converters/NSIDC/SMAP_L2_to_obs.f90 2018-01-16 17:49:53 UTC (rev 12331)
+++ DART/branches/cesm_clm/observations/obs_converters/NSIDC/SMAP_L2_to_obs.f90 2018-01-16 18:15:23 UTC (rev 12332)
@@ -66,7 +66,6 @@
use obs_kind_mod, only : SOIL_MOISTURE
-use netcdf
use HDF5
use H5LT
@@ -107,24 +106,20 @@
logical :: first_obs
! The EASE grid
-real(r8), allocatable, dimension(:) :: longitude
-real(r8), allocatable, dimension(:) :: latitude
-real(r8), allocatable, dimension(:) :: observation
-real(r8), allocatable, dimension(:) :: soil_moisture_error_std
+real(r4), allocatable, dimension(:) :: longitude
+real(r4), allocatable, dimension(:) :: latitude
+real(r4), allocatable, dimension(:) :: observation
+real(r4), allocatable, dimension(:) :: soil_moisture_error_std
type(time_type), allocatable, dimension(:) :: obs_time
integer, allocatable, dimension(:) :: retrieval_flag
-integer :: dimids(NF90_MAX_DIMS)
-integer :: dimlens(NF90_MAX_DIMS)
-character(len=NF90_MAX_NAME) :: dimnames(NF90_MAX_DIMS)
-
-integer :: icount, ncid, VarID, io
+integer :: icount
integer :: counts = 20000
-character(len=NF90_MAX_NAME) :: varname
-integer :: xtype, ndims, nAtts
+character(len=256) :: varname ! HDF variable names can be long
+integer :: ndims
-real(r8) :: qc
+real(r8) :: qc, obs_val, err_std
real(r8) :: rlat, rlon, depth_cm, depth_m
type(obs_sequence_type) :: obs_seq
@@ -134,7 +129,7 @@
integer(HID_T) :: file_id, dset_id, dspace_id
integer :: hdferr
-integer(HSIZE_T), allocatable :: dims(:)
+integer(HSIZE_T), allocatable :: dimlens(:)
integer(HSIZE_T), allocatable :: maxdims(:)
real, allocatable :: data_hdf5(:)
@@ -159,9 +154,13 @@
num_input_files = Check_Input_Files(input_file_list, filename_seq_list)
+
+!-----------------------------------------------------------------------
+!-----------------------------------------------------------------------
+! Test block ...
+
filename = filename_seq_list(1)
-
if ( verbose ) then ! HDF5 exploration block - works.
call h5open_f(hdferr)
call h5fopen_f(filename, H5F_ACC_RDONLY_F, file_id, hdferr)
@@ -171,18 +170,15 @@
call h5dget_space_f(dset_id, dspace_id, hdferr)
call h5sget_simple_extent_ndims_f(dspace_id, ndims, hdferr)
- allocate(dims(ndims), maxdims(ndims))
- call h5sget_simple_extent_dims_f(dspace_id, dims, maxdims, hdferr)
- allocate(data_hdf5(dims(1)))
- call h5ltread_dataset_float_f(file_id, dset_name, data_hdf5, dims, hdferr)
+ allocate(dimlens(ndims), maxdims(ndims))
+ call h5sget_simple_extent_dims_f(dspace_id, dimlens, maxdims, hdferr)
+ allocate(data_hdf5(dimlens(1)))
+ call h5ltread_dataset_float_f(file_id, dset_name, data_hdf5, dimlens, hdferr)
write(*,*)data_hdf5(1:10)
- deallocate(data_hdf5, dims, maxdims)
+ deallocate(data_hdf5, dimlens, maxdims)
endif
-
-
file_id = h5_open(filename, H5F_ACC_RDONLY_F)
-
write(string1,*) trim(filename),' ',routine
call h5_get_dset_dspace(file_id, dset_name, dset_id, dspace_id, string1)
@@ -189,22 +185,23 @@
write(string1,*) trim(dset_name),' ',trim(filename),' ',routine
ndims = h5_get_rank(dspace_id, string1)
-allocate(dims(ndims), maxdims(ndims))
+allocate(dimlens(ndims), maxdims(ndims))
-call h5_get_dimensions(dspace_id, dims, context=string1)
More information about the Dart-dev
mailing list