save_params Subroutine

private subroutine save_params(params)

Arguments

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

Calls

proc~~save_params~2~~CallsGraph proc~save_params~2 save_params interface~save_to_hdf5 save_to_hdf5 proc~save_params~2->interface~save_to_hdf5 h5fclose_f h5fclose_f proc~save_params~2->h5fclose_f h5gclose_f h5gclose_f proc~save_params~2->h5gclose_f proc~i2save_to_hdf5 i2save_to_hdf5 interface~save_to_hdf5->proc~i2save_to_hdf5 proc~i1save_to_hdf5 i1save_to_hdf5 interface~save_to_hdf5->proc~i1save_to_hdf5 proc~i4save_to_hdf5 i4save_to_hdf5 interface~save_to_hdf5->proc~i4save_to_hdf5 proc~i8save_to_hdf5 i8save_to_hdf5 interface~save_to_hdf5->proc~i8save_to_hdf5 proc~rsave_to_hdf5 rsave_to_hdf5 interface~save_to_hdf5->proc~rsave_to_hdf5 h5tset_size_f h5tset_size_f proc~i2save_to_hdf5->h5tset_size_f h5dclose_f h5dclose_f proc~i2save_to_hdf5->h5dclose_f h5aclose_f h5aclose_f proc~i2save_to_hdf5->h5aclose_f h5tcopy_f h5tcopy_f proc~i2save_to_hdf5->h5tcopy_f h5screate_simple_f h5screate_simple_f proc~i2save_to_hdf5->h5screate_simple_f h5awrite_f h5awrite_f proc~i2save_to_hdf5->h5awrite_f h5sclose_f h5sclose_f proc~i2save_to_hdf5->h5sclose_f h5acreate_f h5acreate_f proc~i2save_to_hdf5->h5acreate_f proc~i1save_to_hdf5->h5tset_size_f proc~i1save_to_hdf5->h5dclose_f proc~i1save_to_hdf5->h5aclose_f proc~i1save_to_hdf5->h5tcopy_f proc~i1save_to_hdf5->h5screate_simple_f proc~i1save_to_hdf5->h5awrite_f proc~i1save_to_hdf5->h5sclose_f proc~i1save_to_hdf5->h5acreate_f proc~i4save_to_hdf5->h5tset_size_f proc~i4save_to_hdf5->h5dclose_f proc~i4save_to_hdf5->h5aclose_f proc~i4save_to_hdf5->h5tcopy_f proc~i4save_to_hdf5->h5screate_simple_f proc~i4save_to_hdf5->h5awrite_f proc~i4save_to_hdf5->h5sclose_f proc~i4save_to_hdf5->h5acreate_f proc~i8save_to_hdf5->h5tset_size_f proc~i8save_to_hdf5->h5dclose_f proc~i8save_to_hdf5->h5aclose_f proc~i8save_to_hdf5->h5tcopy_f proc~i8save_to_hdf5->h5screate_simple_f proc~i8save_to_hdf5->h5awrite_f proc~i8save_to_hdf5->h5sclose_f proc~i8save_to_hdf5->h5acreate_f proc~rsave_to_hdf5->h5tset_size_f proc~rsave_to_hdf5->h5dclose_f proc~rsave_to_hdf5->h5aclose_f proc~rsave_to_hdf5->h5tcopy_f proc~rsave_to_hdf5->h5screate_simple_f proc~rsave_to_hdf5->h5awrite_f h5dwrite_f h5dwrite_f proc~rsave_to_hdf5->h5dwrite_f proc~rsave_to_hdf5->h5sclose_f proc~rsave_to_hdf5->h5acreate_f

Called by

proc~~save_params~2~~CalledByGraph proc~save_params~2 save_params proc~get_experimentalg_distribution get_experimentalG_distribution proc~get_experimentalg_distribution->proc~save_params~2

Contents

Source Code


Source Code

  SUBROUTINE save_params(params)
    TYPE(KORC_PARAMS), INTENT(IN) :: params
    CHARACTER(MAX_STRING_LENGTH) :: filename
    CHARACTER(MAX_STRING_LENGTH) :: gname
    CHARACTER(MAX_STRING_LENGTH), DIMENSION(:), ALLOCATABLE :: attr_array
    CHARACTER(MAX_STRING_LENGTH) :: dset
    CHARACTER(MAX_STRING_LENGTH) :: attr
    INTEGER(HID_T) :: h5file_id
    INTEGER(HID_T) :: group_id
    INTEGER :: h5error
    REAL(rp) :: units

    if (params%mpi_params%rank .EQ. 0) then
       filename = TRIM(params%path_to_outputs) // "experimental_distribution_parameters.h5"
       call h5fcreate_f(TRIM(filename), H5F_ACC_TRUNC_F, h5file_id, h5error)

       gname = "pdf_params"
       call h5gcreate_f(h5file_id, TRIM(gname), group_id, h5error)

       dset = TRIM(gname) // "/max_pitch_angle"
       attr = "Maximum pitch angle in PDF (degrees)"
       call save_to_hdf5(h5file_id,dset,pdf_params%max_pitch_angle,attr)

       dset = TRIM(gname) // "/min_pitch_angle"
       attr = "Minimum pitch angle in PDF (degrees)"
       call save_to_hdf5(h5file_id,dset,pdf_params%min_pitch_angle,attr)

       dset = TRIM(gname) // "/min_energy"
       attr = "Minimum energy in PDF (eV)"
       units = 1.0_rp/C_E
       call save_to_hdf5(h5file_id,dset,units*pdf_params%min_energy,attr)

       dset = TRIM(gname) // "/max_energy"
       attr = "Maximum energy in PDF (eV)"
       units = 1.0_rp/C_E
       call save_to_hdf5(h5file_id,dset,units*pdf_params%max_energy,attr)

       dset = TRIM(gname) // "/max_p"
       attr = "Maximum momentum in PDF (me*c)"
       call save_to_hdf5(h5file_id,dset,pdf_params%max_p,attr)

       dset = TRIM(gname) // "/min_p"
       attr = "Maximum momentum in PDF (me*c)"
       call save_to_hdf5(h5file_id,dset,pdf_params%min_p,attr)

       dset = TRIM(gname) // "/Zeff"
       attr = "Effective atomic number of ions."
       call save_to_hdf5(h5file_id,dset,pdf_params%Zeff,attr)

       dset = TRIM(gname) // "/E"
       attr = "Parallel electric field in (Ec)"
       call save_to_hdf5(h5file_id,dset,pdf_params%E,attr)

       dset = TRIM(gname) // "/k"
       attr = "Shape factor"
       call save_to_hdf5(h5file_id,dset,pdf_params%k,attr)

       dset = TRIM(gname) // "/t"
       attr = "Scale factor"
       call save_to_hdf5(h5file_id,dset,pdf_params%t,attr)

       dset = TRIM(gname) // "/fGo"
       attr = "Normalization of Gamma function"
       call save_to_hdf5(h5file_id,dset,pdf_params%fGo,attr)

       dset = TRIM(gname) // "/lambda"
       attr = "Wavelength used when PDF is weighted with the distribution of synchrotron radiation."
       call save_to_hdf5(h5file_id,dset,pdf_params%lambda,attr)

       dset = TRIM(gname) // "/Bo"
       attr = "Magnetic field used when PDF is weighted with the distribution of synchrotron radiation."
       call save_to_hdf5(h5file_id,dset,pdf_params%Bo,attr)

       call h5gclose_f(group_id, h5error)

       call h5fclose_f(h5file_id, h5error)
    end if
  END SUBROUTINE save_params