uEMEP_calculate_all_trajectory Subroutine

public subroutine uEMEP_calculate_all_trajectory(x_emis, y_emis, t, traj_max_index, dr_traj, x_traj, y_traj)

Uses

  • proc~~uemep_calculate_all_trajectory~~UsesGraph proc~uemep_calculate_all_trajectory uEMEP_calculate_all_trajectory module~uemep_definitions uEMEP_definitions proc~uemep_calculate_all_trajectory->module~uemep_definitions

Arguments

Type IntentOptional Attributes Name
real :: x_emis
real :: y_emis
integer :: t
integer :: traj_max_index
real :: dr_traj
real :: x_traj(traj_max_index)
real :: y_traj(traj_max_index)

Called by

proc~~uemep_calculate_all_trajectory~~CalledByGraph proc~uemep_calculate_all_trajectory uEMEP_calculate_all_trajectory proc~uemep_subgrid_deposition uEMEP_subgrid_deposition proc~uemep_subgrid_deposition->proc~uemep_calculate_all_trajectory proc~uemep_subgrid_dispersion uEMEP_subgrid_dispersion proc~uemep_subgrid_dispersion->proc~uemep_calculate_all_trajectory proc~uemep_subgrid_dispersion_integral uEMEP_subgrid_dispersion_integral proc~uemep_subgrid_dispersion->proc~uemep_subgrid_dispersion_integral proc~uemep_subgrid_dispersion_integral->proc~uemep_calculate_all_trajectory program~uemep uEMEP program~uemep->proc~uemep_subgrid_deposition program~uemep->proc~uemep_subgrid_dispersion

Source Code

    subroutine uEMEP_calculate_all_trajectory(x_emis,y_emis,t,traj_max_index,dr_traj,x_traj,y_traj)

        use uEMEP_definitions

        implicit none

        integer k
        !integer i_rec,j_rec,i_emis,j_emis
        integer t,traj_max_index
        !integer i_source
        real dr_traj
        real x_emis,y_emis
        real x_traj(traj_max_index),y_traj(traj_max_index)
        integer i_integral,j_integral
        logical exit_traj

        k=1
        !Set the initial trajectory position to the emission source
        x_traj(k)=x_emis
        y_traj(k)=y_emis

        exit_traj=.false.

        do while (.not.exit_traj.and.k.lt.traj_max_index)

            !Find what meteorological grid the trajectory point is in
            i_integral=1+floor((x_traj(k)-integral_subgrid_min(x_dim_index))/integral_subgrid_delta(x_dim_index))
            j_integral=1+floor((y_traj(k)-integral_subgrid_min(y_dim_index))/integral_subgrid_delta(y_dim_index))

            !Test to see if it is still in the grid
            if (i_integral.ge.1.and.i_integral.le.integral_subgrid_dim(x_dim_index).and.j_integral.ge.1.and.j_integral.le.integral_subgrid_dim(y_dim_index)) then

                k=k+1
                x_traj(k)=x_traj(k-1)+dr_traj*meteo_subgrid(i_integral,j_integral,t,cos_subgrid_index)
                y_traj(k)=y_traj(k-1)+dr_traj*meteo_subgrid(i_integral,j_integral,t,sin_subgrid_index)

            else
                exit_traj=.true.
            endif

        enddo

    end subroutine uEMEP_calculate_all_trajectory