load_data_from_hdf5 Subroutine

public subroutine load_data_from_hdf5(params)

Arguments

Type IntentOptional AttributesName
type(KORC_PARAMS), intent(in) :: params

Calls

proc~~load_data_from_hdf5~~CallsGraph proc~load_data_from_hdf5 load_data_from_hdf5 h5fclose_f h5fclose_f proc~load_data_from_hdf5->h5fclose_f proc~korc_abort korc_abort proc~load_data_from_hdf5->proc~korc_abort interface~load_array_from_hdf5 load_array_from_hdf5 proc~load_data_from_hdf5->interface~load_array_from_hdf5 h5fopen_f h5fopen_f proc~load_data_from_hdf5->h5fopen_f interface~load_from_hdf5 load_from_hdf5 proc~load_data_from_hdf5->interface~load_from_hdf5 mpi_abort mpi_abort proc~korc_abort->mpi_abort proc~rload_1d_array_from_hdf5 rload_1d_array_from_hdf5 interface~load_array_from_hdf5->proc~rload_1d_array_from_hdf5 proc~rload_2d_array_from_hdf5 rload_2d_array_from_hdf5 interface~load_array_from_hdf5->proc~rload_2d_array_from_hdf5 proc~rload_3d_array_from_hdf5 rload_3d_array_from_hdf5 interface~load_array_from_hdf5->proc~rload_3d_array_from_hdf5 proc~iload_from_hdf5 iload_from_hdf5 interface~load_from_hdf5->proc~iload_from_hdf5 proc~rload_from_hdf5 rload_from_hdf5 interface~load_from_hdf5->proc~rload_from_hdf5 proc~iload_from_hdf5->proc~korc_abort h5dclose_f h5dclose_f proc~iload_from_hdf5->h5dclose_f h5dread_f h5dread_f proc~iload_from_hdf5->h5dread_f proc~rload_from_hdf5->proc~korc_abort proc~rload_from_hdf5->h5dclose_f proc~rload_from_hdf5->h5dread_f proc~rload_1d_array_from_hdf5->proc~korc_abort proc~rload_1d_array_from_hdf5->h5dclose_f proc~rload_1d_array_from_hdf5->h5dread_f proc~rload_2d_array_from_hdf5->proc~korc_abort proc~rload_2d_array_from_hdf5->h5dclose_f proc~rload_2d_array_from_hdf5->h5dread_f proc~rload_3d_array_from_hdf5->proc~korc_abort proc~rload_3d_array_from_hdf5->h5dclose_f proc~rload_3d_array_from_hdf5->h5dread_f

Called by

proc~~load_data_from_hdf5~~CalledByGraph proc~load_data_from_hdf5 load_data_from_hdf5 proc~initialize_hollmann_params initialize_Hollmann_params proc~initialize_hollmann_params->proc~load_data_from_hdf5 proc~get_hollmann_distribution_3d get_Hollmann_distribution_3D proc~get_hollmann_distribution_3d->proc~initialize_hollmann_params proc~get_hollmann_distribution_3d_psi get_Hollmann_distribution_3D_psi proc~get_hollmann_distribution_3d_psi->proc~initialize_hollmann_params proc~get_hollmann_distribution get_Hollmann_distribution proc~get_hollmann_distribution->proc~initialize_hollmann_params proc~get_hollmann_distribution_1dtransport get_Hollmann_distribution_1Dtransport proc~get_hollmann_distribution_1dtransport->proc~initialize_hollmann_params

Contents

Source Code


Source Code

  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