Write Einstein coefficients to HDF5 file
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer(kind=HID_T), | intent(inout) | :: | id | HDF5 file or group object id |
||
integer, | intent(in) | :: | n_max | Number of initial atomic energy states to calculate |
||
integer, | intent(in) | :: | m_max | Number of final atomic energy states to calculate |
subroutine write_einstein(id, n_max, m_max)
!+ Write Einstein coefficients to HDF5 file
integer(HID_T), intent(inout) :: id
!+ HDF5 file or group object id
integer, intent(in) :: n_max
!+ Number of initial atomic energy states to calculate
integer, intent(in) :: m_max
!+ Number of final atomic energy states to calculate
real(Float64), dimension(n_max,m_max) :: ein
integer(HID_T) :: gid
integer(HSIZE_T), dimension(1) :: dim1
integer(HSIZE_T), dimension(2) :: dim2
integer :: error
ein(:,:) = EINSTEIN(1:n_max,1:m_max)
call h5gcreate_f(id, "spontaneous", gid, error)
dim1 = [1]
dim2 = [n_max, m_max]
call h5ltmake_dataset_int_f(gid, "n_max", 0, dim1, [n_max], error)
call h5ltmake_dataset_int_f(gid, "m_max", 0, dim1, [m_max], error)
call h5ltmake_compressed_dataset_double_f(gid, "einstein", 2, dim2, ein, error)
call h5ltset_attribute_string_f(id, "spontaneous", "description", &
"Atomic rates for spontaneous emission/deexcitation", error)
call h5ltset_attribute_string_f(gid, "n_max", "description", &
"Number of initial energy levels", error)
call h5ltset_attribute_string_f(gid, "m_max", "description", &
"Number of final energy levels", error)
call h5ltset_attribute_string_f(gid, "einstein", "description", &
"n/m resolved einstein coefficients: einstein(n,m)", error)
call h5ltset_attribute_string_f(gid, "einstein", "units", "1/s", error)
call h5ltset_attribute_string_f(gid, "einstein", "reaction", &
"H(n) -> H(m) + ph, n > m", error)
call h5gclose_f(gid, error)
end subroutine write_einstein