save_params_ms Subroutine

private subroutine save_params_ms(params)

Arguments

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

Calls

proc~~save_params_ms~~CallsGraph proc~save_params_ms save_params_ms h5fclose_f h5fclose_f proc~save_params_ms->h5fclose_f interface~save_1d_array_to_hdf5 save_1d_array_to_hdf5 proc~save_params_ms->interface~save_1d_array_to_hdf5 interface~save_to_hdf5 save_to_hdf5 proc~save_params_ms->interface~save_to_hdf5 proc~save_string_parameter save_string_parameter proc~save_params_ms->proc~save_string_parameter h5gclose_f h5gclose_f proc~save_params_ms->h5gclose_f proc~isave_1d_array_to_hdf5 isave_1d_array_to_hdf5 interface~save_1d_array_to_hdf5->proc~isave_1d_array_to_hdf5 proc~rsave_1d_array_to_hdf5 rsave_1d_array_to_hdf5 interface~save_1d_array_to_hdf5->proc~rsave_1d_array_to_hdf5 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 h5dwrite_vl_f h5dwrite_vl_f proc~save_string_parameter->h5dwrite_vl_f h5dclose_f h5dclose_f proc~save_string_parameter->h5dclose_f h5tcopy_f h5tcopy_f proc~save_string_parameter->h5tcopy_f h5screate_simple_f h5screate_simple_f proc~save_string_parameter->h5screate_simple_f h5sclose_f h5sclose_f proc~save_string_parameter->h5sclose_f h5tset_strpad_f h5tset_strpad_f proc~save_string_parameter->h5tset_strpad_f proc~isave_1d_array_to_hdf5->h5dclose_f proc~isave_1d_array_to_hdf5->h5tcopy_f proc~isave_1d_array_to_hdf5->h5screate_simple_f proc~isave_1d_array_to_hdf5->h5sclose_f h5tset_size_f h5tset_size_f proc~isave_1d_array_to_hdf5->h5tset_size_f h5aclose_f h5aclose_f proc~isave_1d_array_to_hdf5->h5aclose_f h5awrite_f h5awrite_f proc~isave_1d_array_to_hdf5->h5awrite_f h5dwrite_f h5dwrite_f proc~isave_1d_array_to_hdf5->h5dwrite_f h5acreate_f h5acreate_f proc~isave_1d_array_to_hdf5->h5acreate_f proc~i2save_to_hdf5->h5dclose_f proc~i2save_to_hdf5->h5tcopy_f proc~i2save_to_hdf5->h5screate_simple_f proc~i2save_to_hdf5->h5sclose_f proc~i2save_to_hdf5->h5tset_size_f proc~i2save_to_hdf5->h5aclose_f proc~i2save_to_hdf5->h5awrite_f proc~i2save_to_hdf5->h5acreate_f proc~i1save_to_hdf5->h5dclose_f proc~i1save_to_hdf5->h5tcopy_f proc~i1save_to_hdf5->h5screate_simple_f proc~i1save_to_hdf5->h5sclose_f proc~i1save_to_hdf5->h5tset_size_f proc~i1save_to_hdf5->h5aclose_f proc~i1save_to_hdf5->h5awrite_f proc~i1save_to_hdf5->h5acreate_f proc~i4save_to_hdf5->h5dclose_f proc~i4save_to_hdf5->h5tcopy_f proc~i4save_to_hdf5->h5screate_simple_f proc~i4save_to_hdf5->h5sclose_f proc~i4save_to_hdf5->h5tset_size_f proc~i4save_to_hdf5->h5aclose_f proc~i4save_to_hdf5->h5awrite_f proc~i4save_to_hdf5->h5acreate_f proc~i8save_to_hdf5->h5dclose_f proc~i8save_to_hdf5->h5tcopy_f proc~i8save_to_hdf5->h5screate_simple_f proc~i8save_to_hdf5->h5sclose_f proc~i8save_to_hdf5->h5tset_size_f proc~i8save_to_hdf5->h5aclose_f proc~i8save_to_hdf5->h5awrite_f proc~i8save_to_hdf5->h5acreate_f proc~rsave_to_hdf5->h5dclose_f proc~rsave_to_hdf5->h5tcopy_f proc~rsave_to_hdf5->h5screate_simple_f proc~rsave_to_hdf5->h5sclose_f proc~rsave_to_hdf5->h5tset_size_f proc~rsave_to_hdf5->h5aclose_f proc~rsave_to_hdf5->h5awrite_f proc~rsave_to_hdf5->h5dwrite_f proc~rsave_to_hdf5->h5acreate_f proc~rsave_1d_array_to_hdf5->h5dclose_f proc~rsave_1d_array_to_hdf5->h5tcopy_f proc~rsave_1d_array_to_hdf5->h5screate_simple_f proc~rsave_1d_array_to_hdf5->h5sclose_f proc~rsave_1d_array_to_hdf5->h5tset_size_f proc~rsave_1d_array_to_hdf5->h5aclose_f proc~rsave_1d_array_to_hdf5->h5awrite_f proc~rsave_1d_array_to_hdf5->h5dwrite_f proc~rsave_1d_array_to_hdf5->h5acreate_f

Called by

proc~~save_params_ms~~CalledByGraph proc~save_params_ms save_params_ms proc~save_collision_params save_collision_params proc~save_collision_params->proc~save_params_ms program~main main program~main->proc~save_collision_params

Contents

Source Code


Source Code

  subroutine save_params_ms(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) // "simulation_parameters.h5"
       call h5fopen_f(TRIM(filename), H5F_ACC_RDWR_F, h5file_id, h5error)

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

       ALLOCATE(attr_array(cparams_ms%num_impurity_species))

       dset = TRIM(gname) // "/model"
       call save_string_parameter(h5file_id,dset,(/params%collisions_model/))

       dset = TRIM(gname) // "/num_impurity_species"
       attr = "Number of impurity species"
       call save_to_hdf5(h5file_id,dset,cparams_ms%num_impurity_species,attr)

       dset = TRIM(gname) // "/Te"
       attr = "Background electron temperature in eV"
       units = params%cpp%temperature/C_E
       call save_to_hdf5(h5file_id,dset,units*cparams_ms%Te,attr)

       dset = TRIM(gname) // "/ne"
       attr = "Background electron density in m^-3"
       units = params%cpp%density
       call save_to_hdf5(h5file_id,dset,units*cparams_ms%ne,attr)

       dset = TRIM(gname) // "/nH"
       attr = "Background proton density in m^-3"
       units = params%cpp%density
       call save_to_hdf5(h5file_id,dset,units*cparams_ms%nH,attr)

       dset = TRIM(gname) // "/nef"
       attr = "Free electron density in m^-3"
       units = params%cpp%density
       call save_to_hdf5(h5file_id,dset,units*cparams_ms%nef,attr)

       dset = TRIM(gname) // "/neb"
       attr_array(1) = "Bound electron density per impurity in m^-3"
       units = params%cpp%density
       call save_1d_array_to_hdf5(h5file_id,dset,units*cparams_ms%neb, &
            attr_array)

       dset = TRIM(gname) // "/Zo"
       attr_array(1) = "Full nuclear charge of impurities"
       call save_1d_array_to_hdf5(h5file_id,dset,cparams_ms%Zo,attr_array)

       dset = TRIM(gname) // "/Zj"
       attr_array(1) = "Average charge state of impurities"
       call save_1d_array_to_hdf5(h5file_id,dset,cparams_ms%Zj,attr_array)

       dset = TRIM(gname) // "/nz"
       attr_array(1) = "Density of impurities in m^-3"
       units = params%cpp%density
       call save_1d_array_to_hdf5(h5file_id,dset,units*cparams_ms%nz,attr_array)

       dset = TRIM(gname) // "/IZj"
       attr_array(1) = " Ionization energy of impurities in eV"
       units = params%cpp%energy/C_E
       call save_1d_array_to_hdf5(h5file_id,dset,units*cparams_ms%IZj, &
            attr_array)

       dset = TRIM(gname) // "/rD"
       attr = "Debye length in m"
       units = params%cpp%length
       call save_to_hdf5(h5file_id,dset,units*cparams_ms%rD,attr)

       dset = TRIM(gname) // "/re"
       attr = "Classical electron radius in m"
       units = params%cpp%length
       call save_to_hdf5(h5file_id,dset,units*cparams_ms%re,attr)

       dset = TRIM(gname) // "/Ec"
       attr = "Critical electric field with impurities"
       units = params%cpp%Eo
       call save_to_hdf5(h5file_id,dset,units*cparams_ms%Ec_min,attr)
       
       DEALLOCATE(attr_array)

       call h5gclose_f(group_id, h5error)

       call h5fclose_f(h5file_id, h5error)
    end if
  end subroutine save_params_ms