[Dart-dev] DART/branches Revision: 12110
dart at ucar.edu
dart at ucar.edu
Thu Nov 16 10:58:12 MST 2017
thoar at ucar.edu
2017-11-16 10:58:10 -0700 (Thu, 16 Nov 2017)
107
These convert an ASCII table to a DART obs sequence file.
Mingjie converted the HDF5 to the ASCII tables.
Added: DART/branches/cesm_clm/observations/obs_converters/EASE-Grid/HDF5_utilities_mod.f90
===================================================================
--- DART/branches/cesm_clm/observations/obs_converters/EASE-Grid/HDF5_utilities_mod.f90 (rev 0)
+++ DART/branches/cesm_clm/observations/obs_converters/EASE-Grid/HDF5_utilities_mod.f90 2017-11-16 17:58:10 UTC (rev 12110)
@@ -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