[Dart-dev] DART/branches Revision: 12247

dart at ucar.edu dart at ucar.edu
Wed Dec 27 14:50:39 MST 2017


thoar at ucar.edu
2017-12-27 14:50:35 -0700 (Wed, 27 Dec 2017)
170
Better name for the converter, which is still not finished.
A prototype HDF5_utilities_mod.f90 is provided. There are some
examples from the HDF5 website in the module.




Copied: DART/branches/cesm_clm/assimilation_code/modules/utilities/HDF5_utilities_mod.f90 (from rev 12246, DART/branches/cesm_clm/observations/obs_converters/NSIDC/HDF5_utilities_mod.f90)
===================================================================
--- DART/branches/cesm_clm/assimilation_code/modules/utilities/HDF5_utilities_mod.f90	                        (rev 0)
+++ DART/branches/cesm_clm/assimilation_code/modules/utilities/HDF5_utilities_mod.f90	2017-12-27 21:50:35 UTC (rev 12247)
@@ -0,0 +1,211 @@
+! DART software - Copyright UCAR. This open source software is provided
+! by UCAR, "as is", without charge, subject to all terms of use at
+! http://www.image.ucar.edu/DAReS/DART/DART_download
+!
+! $Id$
+
+module HDF5_utilities_mod
+
+use        types_mod, only : i2, i4, r4, r8, MISSING_R8, MISSING_I
+use    utilities_mod, only : nc_check, E_MSG, E_ERR, error_handler
+use time_manager_mod, only : time_type, operator(>=), set_time, get_time
+
+use HDF5
+
+implicit none
+private
+
+public :: H5_CRTDAT, H5_RDWT, h5_get_rank, h5_get_dimensions
+
+
+! interface hf_get_var
+!    module procedure hf_get_int_1d
+!    module procedure hf_get_real_1d
+! end interface
+
+! version controlled file description for error handling, do not edit
+character(len=*), parameter :: source   = &
+   "$URL$"
+character(len=*), parameter :: revision = "$Revision$"
+character(len=*), parameter :: revdate  = "$Date$"
+
+character(len=512) :: string1, string2, string3
+
+
+contains
+
+
+function h5_get_rank(dspace_id, error) result(rank)
+
+integer(HID_T), intent(in)  :: dspace_id
+integer,        intent(out) :: error
+integer :: rank
+
+call h5sget_simple_extent_ndims_f(dspace_id, rank, error)
+
+write(*,*)'TJH rank is ',rank
+
+end function h5_get_rank
+
+
+
+subroutine h5_get_dimensions(dspace_id, dims, error)
+
+integer(HID_T),   intent(in)  :: dspace_id
+integer(HSIZE_T), intent(out) :: dims(:)
+integer,          intent(out) :: error
+
+integer(HSIZE_T) :: maxdims(size(dims))
+
+! get the dimensions of the dataspace
+call h5sget_simple_extent_dims_f(dspace_id, dims, maxdims, error)
+
+write(*,*)'TJH    dims is ',dims
+write(*,*)'TJH maxdims is ',maxdims
+
+end subroutine h5_get_dimensions
+
+
+
+subroutine H5_CRTDAT()
+
+! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+!   Copyright by The HDF Group.                                               *
+!   Copyright by the Board of Trustees of the University of Illinois.         *
+!   All rights reserved.                                                      *
+!                                                                             *
+!   This routine is part of HDF5.  The full HDF5 copyright notice, including     *
+!   terms governing use, modification, and redistribution, is contained in    *
+!   the COPYING file, which can be found at the root of the source code       *
+!   distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases.  *
+!   If you do not have access to either file, you may request a copy from     *
+!   help at hdfgroup.org.                                                        *
+! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+!
+! The following example shows how to create an empty dataset.
+! It creates a file called 'dsetf.h5', defines the
+! dataset dataspace, creates a dataset which is a 4x6 integer array,
+! and then closes the dataspace, the dataset, and the file.
+!
+! This example is used in the HDF5 Tutorial.
+
+character(len=8), parameter :: filename = "dsetf.h5" ! File name
+character(len=4), parameter :: dsetname = "dset"     ! Dataset name
+
+integer(HID_T) :: file_id       ! File identifier
+integer(HID_T) :: dset_id       ! Dataset identifier


More information about the Dart-dev mailing list