SUBROUTINE load_data_from_hdf5(params)
TYPE(KORC_PARAMS), INTENT(IN) :: params
CHARACTER(MAX_STRING_LENGTH) :: filename
CHARACTER(MAX_STRING_LENGTH) :: gname
CHARACTER(MAX_STRING_LENGTH) :: subgname
CHARACTER(MAX_STRING_LENGTH) :: dset
INTEGER(HID_T) :: h5file_id
INTEGER(HID_T) :: group_id
INTEGER(HID_T) :: subgroup_id
REAL(rp) :: rdatum
INTEGER :: h5error
LOGICAL :: lookhere
filename = TRIM(h_params%filename)
call h5fopen_f(filename, H5F_ACC_RDONLY_F, h5file_id, h5error)
if (h5error .EQ. -1) then
write(output_unit_write,'("KORC ERROR: Something went wrong in: load_data_from_hdf5 (korc_experimental) --> h5fopen_f")')
call korc_abort(20)
end if
gname='N'
call h5lexists_f(h5file_id,TRIM(gname),lookhere,h5error)
if (lookhere) then
dset = "/N"
call load_from_hdf5(h5file_id,dset,rdatum)
h_params%N = INT(rdatum)
ALLOCATE(h_params%fRE_E(h_params%N))
ALLOCATE(h_params%fRE_pitch(h_params%N))
ALLOCATE(h_params%E_axis(h_params%N))
dset = "/E"
call load_array_from_hdf5(h5file_id,dset,h_params%E_axis)
h_params%E_axis = h_params%E_axis*C_E
dset = "/fRE_E"
call load_array_from_hdf5(h5file_id,dset,h_params%fRE_E)
dset = "/fRE_pitch"
call load_array_from_hdf5(h5file_id,dset,h_params%fRE_pitch)
else
dset = "/NE"
call load_from_hdf5(h5file_id,dset,rdatum)
h_params%NE = INT(rdatum)
dset = "/Nrho"
call load_from_hdf5(h5file_id,dset,rdatum)
h_params%Nrho = INT(rdatum)
ALLOCATE(h_params%E_axis(h_params%NE))
ALLOCATE(h_params%rho_axis(h_params%Nrho))
ALLOCATE(h_params%fRE_E_2D(h_params%Nrho,h_params%NE))
ALLOCATE(h_params%fRE_pitch_2D(h_params%Nrho,h_params%NE))
dset = "/E"
call load_array_from_hdf5(h5file_id,dset,h_params%E_axis)
h_params%E_axis = h_params%E_axis*C_E
dset = "/rho"
call load_array_from_hdf5(h5file_id,dset,h_params%rho_axis)
dset = "/fRE_E"
call load_array_from_hdf5(h5file_id,dset,h_params%fRE_E_2D)
dset = "/fRE_pitch"
call load_array_from_hdf5(h5file_id,dset,h_params%fRE_pitch_2D)
endif
call h5fclose_f(h5file_id, h5error)
if (h5error .EQ. -1) then
write(output_unit_write,'("KORC ERROR: Something went wrong in: load_data_from_hdf5 (korc_experimental) --> h5fclose_f")')
end if
END SUBROUTINE load_data_from_hdf5