#2487: *_evolution_method = "LeanBSSNMoL" in Lean does nothing
| Reporter: | Gabriele Bozzola |
| Status: | open |
| Milestone: | |
| Version: | development version |
| Type: | bug |
| Priority: | major |
| Component: | EinsteinToolkit thorn |
Comment (by Roland Haas):
Looking at your code in particular the bits that have string comparisons:
if (CCTK_EQUALS(lapse_evolution_method, "LeanBSSNMoL")) then
in 3D loops, then yes, these will be quite slow since the compiler will not cache the result of the comparison and really due the comparison each and every loop iteration.
Instead I would have a logical variable that is initialized outside of the loop with the result of the comparison, ie:
logical :: want_lapse want_lapse = CCTK_EQUALS(lapse_evolution_method, "LeanBSSNMoL") do i =1,cctk_lsh(1) if (want_lapse) then do_something endif end do
--
Ticket URL: https://bitbucket.org/einsteintoolkit/tickets/issues/2487/_evolution_method-leanbssnmol-in-lean-does