subroutine push_char(c) character, intent(inout) :: c pushed_index = pushed_index + 1 pushed_char(pushed_index:pushed_index) = c end subroutine push_char