anchor.diff:          !
           ivib = 0 
           i = -imin
  +        iline = 0
           !
           do
              !
  
positive.code: 
                 elseif(vibpopulation_do) then
                    ! apply vibrational population
                    read(quantum_numbers(QN%dens_col-4,ilevelf),*) ndensity
                    !
                    abscoef=emcoef*acoef*gtot(ilevelf)*exp(-c2/temp*ener_rot)*ndensity*&
                            tranfreq/(partfunc)
  
negative.code:                   !
                    ! let's assume that negative rotational energies can be made positive without breaking the physics
                    ener_rot = abs(energyi-ener_vib)
                    !
                  else
                    ivib = ivib_state(ilevelf)
                    ener_vib = energies_vib(ivib)
                    ener_rot = abs(energyf-ener_vib)
                    !
                    ndensity = dens_vib(ivib)
                    !
                  endif
               endif
               !
  