subroutine calc_level_1( time_step, Nx, Ny, k1, k2, k3, A, B, C )
    implicit none
        integer, intent(in) :: time_step, Nx, Ny ! Nx,Ny - number of nodes in 2D grid;
        integer, intent(in) :: k1, k2, k3
        real*8, intent(inout) :: A, B, C
    !local
        integer :: k        
        logical :: is_success
    !--------------------------------------------------------------------

    Loop A: do k = 1, k1 
    ! k1 = 1 ~30% simulation time, k1 >=1 [typical 2, or 3--4] ~70% sim.time
        n = get_data_size( A, k, time_step, Nx, Ny ) 
        ! n ~ O(time_step * Nx * Ny )
        call calc_level_0( n, A( 1:n, k) )
        if( .not. is_success ) then
            return
        end if
    end do

    Loop B: do k = 1, k2
    ! k2 = 0 ~30% simulation time, k2 = 1 ~70% sim.time, sometimes k2 = 2--5
        n = get_data_size( B, k, time_step, Nx, Ny ) 
        ! n ~ O(time_step * Nx * Ny )
        call calc_level_0( n, B( 1:n, k) )
        if( .not. is_success ) then
            return
        end if

    end do

    Loop C: do k = 1, k3 
    ! k3 = 0 ~30% simulation time, k3 = 1 ~70% sim.time
        n = get_data_size( C, k, time_step, Nx, Ny ) 
        ! n ~ O(time_step * Nx * Ny )
        call calc_level_0( n, C( 1:n, k) )
        if( .not. is_success ) then
            return
        end if

    end do

end subroutine calc_level_1
!--------------------------------------------------------------------