[Dart-dev] DART/branches Revision: 12327
dart at ucar.edu
dart at ucar.edu
Fri Jan 12 15:39:48 MST 2018
thoar at ucar.edu
2018-01-12 15:39:47 -0700 (Fri, 12 Jan 2018)
18
making progress.
Modified: DART/branches/cesm_clm/assimilation_code/modules/utilities/HDF5_utilities_mod.f90
===================================================================
--- DART/branches/cesm_clm/assimilation_code/modules/utilities/HDF5_utilities_mod.f90 2018-01-12 21:48:23 UTC (rev 12326)
+++ DART/branches/cesm_clm/assimilation_code/modules/utilities/HDF5_utilities_mod.f90 2018-01-12 22:39:47 UTC (rev 12327)
@@ -15,7 +15,8 @@
implicit none
private
-public :: h5_open, H5_CRTDAT, H5_RDWT, h5_get_rank, h5_get_dimensions
+public :: h5_open, H5_CRTDAT, H5_RDWT, h5_get_rank, h5_get_dimensions, &
+ h5_get_dset_dspace
! interface hf_get_var
! module procedure hf_get_int_1d
@@ -39,7 +40,8 @@
!-----------------------------------------------------------------------
!> initialize the Fortran interface to HDF5
-subroutine initialize_module()
+subroutine initialize_module(context)
+character(len=*), optional :: context
integer :: hdferr
@@ -48,15 +50,22 @@
call register_module(source, revision, revdate)
module_initialized = .true.
+if (present(context)) then
+ write(string1,*)'initializing Fortran interfaces: ',trim(context)
+else
+ write(string1,*)'initializing Fortran interfaces'
+endif
+
! initialize the Fortran interface
call h5open_f(hdferr)
-call h5_check(hdferr,'initialize_module','h5open_f','initializing Fortran interfaces')
+call h5_check(hdferr,'initialize_module','h5open_f',string1)
end subroutine initialize_module
!-----------------------------------------------------------------------
-!>
+!> open the fortran interface to hdf5 libs
+!> open the file
function h5_open(filename, flag, context) result(file_id)
@@ -65,9 +74,10 @@
character(len=*), optional, intent(in) :: context
integer(HID_T) :: file_id
-
integer :: hdferr
+if ( .not. module_initialized ) call initialize_module(context)
+
call h5fopen_f(filename, flag, file_id, hdferr)
call h5_check(hdferr,'h5_open','h5fopen_f', context, filename)
@@ -77,6 +87,31 @@
!-----------------------------------------------------------------------
!>
+subroutine h5_get_dset_dspace(file_id, dsetname, dsetid, dspaceid, context)
+
+integer(HID_T), intent(in) :: file_id !> hdf file ID
+character(len=*), intent(in) :: dsetname !> dataset name
+integer(HID_T), intent(out) :: dsetid !> dataset ID
+integer(HID_T), intent(out) :: dspaceid !> dataset dataspace ID
+character(len=*), optional, intent(in) :: context
+
+integer :: hdferr
+character(len=*), parameter :: routine = 'h5_get_dset_dspace'
+
+if ( .not. module_initialized ) call initialize_module(context)
+
+call h5dopen_f(file_id, dsetname, dsetid, hdferr)
+call h5_check(hdferr, routine, 'h5dopen_f', context, dsetname)
+
+call h5dget_space_f(dsetid, dspaceid, hdferr)
+call h5_check(hdferr, routine, 'h5dget_space_f', context, dsetname)
+
+end subroutine h5_get_dset_dspace
+
+
+!-----------------------------------------------------------------------
+!>
+
function h5_get_rank(dspace_id, error) result(rank)
integer(HID_T), intent(in) :: dspace_id
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-12 21:48:23 UTC (rev 12326)
+++ DART/branches/cesm_clm/observations/obs_converters/NSIDC/SMAP_L2_to_obs.f90 2018-01-12 22:39:47 UTC (rev 12327)
@@ -58,8 +58,12 @@
use obs_utilities_mod, only : add_obs_to_seq, create_3d_obs
More information about the Dart-dev
mailing list