Skip to content

Commit

Permalink
Fix datum associated ele logic. (#810)
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidSagan authored Feb 14, 2024
1 parent 7f0e745 commit b569c4e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
6 changes: 4 additions & 2 deletions tao/code/tao_data_sanity_check.f90
Original file line number Diff line number Diff line change
Expand Up @@ -86,12 +86,14 @@ function tao_data_sanity_check (datum, print_err, default_data_type) result (is_
return
endif

else ! has_associated_ele = yes$. Also invalid data_types here.
else ! has_associated_ele = yes$
if (datum%ele_name == '') then
datum%why_invalid = 'NO LATTICE ELEMENT ASSOCIATED WITH DATUM.'
! Datum is invalid but this is do not generate an error message since having "gaps" in the d1 array is a common situation.
if (print_err .and. datum%data_type /= default_data_type .and. datum%data_type /= '') then
call out_io (s_error$, r_name, 'DATA_SOURCE NOT SET FOR DATUM: ' // tao_datum_name(datum))
call out_io (s_error$, r_name, 'DATUM: ' // tao_datum_name(datum), &
'OF TYPE: ' // d_type, &
'MUST HAVE AN ASSOCIATED ELEMENT.')
endif
return
endif
Expand Down
3 changes: 2 additions & 1 deletion tao/code/tao_datum_has_associated_ele.f90
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ function tao_datum_has_associated_ele (data_type, branch_geometry) result (has_a
data_type(1:18) == 'spin.polarization_' .or. data_type == 'spin.depolarization_rate' .or. &
data_type == 'chrom.a' .or. data_type == 'chrom.b' .or. short_type == 'chrom_ptc' .or. &
data_type(1:12) == 'chrom.dtune.' .or. short_type == 'slip_factor_ptc' .or. &
short_type == 'srdt' .or. short_type == 'damp' .or. short_type == 'tune') then
short_type == 'srdt' .or. short_type == 'damp' .or. short_type == 'tune' .or. &
short_type == 'momentum_compaction_ptc') then
has_associated_ele = no$

elseif (data_type == 'emit.a' .or. data_type == 'norm_emit.a' .or. data_type == 'emit.b' .or. &
Expand Down
2 changes: 1 addition & 1 deletion tao/version/tao_version_mod.f90
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@
!-

module tao_version_mod
character(*), parameter :: tao_version_date = "2024/02/12 21:53:33"
character(*), parameter :: tao_version_date = "2024/02/13 23:14:17"
end module

0 comments on commit b569c4e

Please sign in to comment.