522c522 < CALL horizontal_pressure_gradient( ru_tend,rv_tend, & --- > CALL horizontal_pressure_gradient( ru_tend,rv_tend, & 525c525,526 < cf1,cf2,cf3,rdx,rdy,msfux,msfuy,& --- > cf1,cf2,cf3,cfn,cfn1, & > rdx,rdy,msfux,msfuy, & 2201d2201 < !++mmb traj 2218,2223d2217 < < use module_date_time < use module_utility < use module_domain, only : domain_clock_get < use module_trajectory, only : traject, traj_cnt < 2227,2228c2221 < ! of the selecting points. The trajectory of each point is subjected to u, v, < ! and w. --- > ! of the selecting points. The trajectory of each point is subjected to u, v, and w. 2231,2232c2224 < ! The trajectories is initialized with given longitude (degree), latitude < ! (degree), and height(eta level). --- > ! The trajectories is initialized with given longitude (degree), latitude (degree), and height(eta level). 2234,2238c2226,2230 < !--traj_i grid number in x direction (on mass grid), float < !--traj_j grid number in y direction (on mass grid), float < !--traj_k grid number in z direction (on mass grid), float < !--traj_long longitude of trajectories, float < !--traj_lat longitude of trajectories, float --- > !--traj_i grid number in x direction (on mass grid), float > !--traj_j grid number in y direction (on mass grid), float > !--traj_k grid number in z direction (on mass grid), float > !--traj_long longitude of trajectories, float > !--traj_lat longitude of trajectories, float 2250c2242 < dt --- > dt 2261,2262c2253,2254 < real, dimension(config_flags%num_traj), intent(inout) :: traj_i,traj_j,traj_k < real, dimension(config_flags%num_traj), intent(inout) :: traj_long,traj_lat --- > real, dimension(1:config_flags%num_traj), intent(inout) :: traj_i,traj_j,traj_k > real, dimension(1:config_flags%num_traj), intent(inout) :: traj_long,traj_lat 2267,2270c2259 < integer :: j,k < integer :: i_beg,i_end < integer :: i_traj,j_traj,k_traj,tjk < integer :: dm --- > integer :: i_traj,j_traj,k_traj,tjk,k 2284,2286d2272 < character(len=256) :: dbg_mes < character(len=19) :: current_timestr, next_timestr, wrk_timestr < logical :: has_proj_map 2289,2291c2275 < TYPE (grid_config_rec_type) :: config_flags_temp < TYPE(WRFU_Time) :: current_time, next_time < TYPE(WRFU_Time) :: start_time, stop_time --- > TYPE (grid_config_rec_type) :: config_flags_temp 2299,2315c2283,2294 < < dm = grid%id < < write(dbg_mes,'(''trajectory('',i2.2,''): Entering trajectory'')') dm < call wrf_debug(200,trim(dbg_mes) ) < < i_beg = max( 1,its-1 ) < i_end = min( ite+2,ide-1 ) < do j=max(1,jts-1),min(jte+2,jde-1) < do k=kms,kme < u(its:i_end,k,j)=ru_m(its:i_end,k,j)/muu(its:i_end,j)*msfu(its:i_end,j) < v(its:i_end,k,j)=rv_m(its:i_end,k,j)/muv(its:i_end,j)*msfv(its:i_end,j) < w(its:i_end,k,j)=ww_m(its:i_end,k,j)/mut(its:i_end,j)*msft(its:i_end,j) < enddo < enddo < has_proj_map = & < ( proj%code .EQ. PROJ_LC ) .OR. & --- > do k=kms,kme > u(:,k,:)=ru_m(:,k,:)/muu(:,:)*msfu(:,:) > v(:,k,:)=rv_m(:,k,:)/muv(:,:)*msfv(:,:) > w(:,k,:)=ww_m(:,k,:)/mut(:,:)*msft(:,:) > enddo > do tjk = 1,config_flags%num_traj > eta_old = 0.0 > eta_new = 0.0 > keta=0 > keta_temp=0 > if (traj_i(tjk) .ne. -9999.0) then > if ( ( proj%code .EQ. PROJ_LC ) .OR. & 2324,2337c2303,2304 < ( proj%code .EQ. PROJ_ROTLL ) < < traj_loop: & < do tjk = 1,traj_cnt(dm) < !do tjk = 1,config_flags%num_traj < traj_is_active: & < if (traj_i(tjk) .ne. -9999.0) then < eta_old = 0.0 < eta_new = 0.0 < keta = 0 < keta_temp = 0 < if( has_proj_map ) then < call latlon_to_ij (proj, & < traj_lat(tjk),traj_long(tjk),traj_i(tjk),traj_j(tjk)) --- > ( proj%code .EQ. PROJ_ROTLL ) ) THEN > call latlon_to_ij (proj, traj_lat(tjk),traj_long(tjk),traj_i(tjk),traj_j(tjk)) 2339,2365c2306,2311 < i_traj = floor(traj_i(tjk)) ! find the lower_left_bottom corner for < !trajectory < j_traj = floor(traj_j(tjk)) ! < k_traj = floor(traj_k(tjk)) ! < traj_in_domain: & < if ((i_traj .ge. its .and. i_traj .le. ite .and. i_traj .lt. ide) .and. & < (j_traj .ge. jts .and. j_traj .le. jte .and. j_traj .lt. jde) .and. & < (k_traj .le. kte .and. k_traj .lt. kde)) then < !----------------------------------------------------------------------------- < ! is trajectory in time interval? < !----------------------------------------------------------------------------- < call domain_clock_get( grid, current_time=current_time, & < current_timestr=current_timestr) < call geth_newdate( next_timestr, current_timestr, int(grid%dt) ) < call wrf_atotime( next_timestr, next_time ) < wrk_timestr(1:19) = traject(tjk,dm)%start_time(1:19) < ! write(*,*) ' ' < ! write(*,*) traject(tjk,dm) < ! write(dbg_mes,'(''trajectory('',i2,2,''): tjk,start_time = '',i3,1x,a)') & < ! dm,tjk,wrk_timestr < ! call wrf_debug( 200,trim(dbg_mes) ) < call wrf_atotime( wrk_timestr(1:19), start_time ) < wrk_timestr(1:19) = traject(tjk,dm)%stop_time(1:19) < call wrf_atotime( wrk_timestr(1:19), stop_time ) < is_in_time_interval: & < if( next_time .ge. start_time .and. next_time .le. stop_time & < .and. .not. traject(tjk,dm)%is_stationary ) then --- > i_traj=floor(traj_i(tjk)) ! find the lower_left_bottom corner for trajectory > j_traj=floor(traj_j(tjk)) ! > k_traj=floor(traj_k(tjk)) ! > if ((i_traj .ge. its .and. i_traj .le. ite .and. i_traj .lt. ide) .and. & > (j_traj .ge. jts .and. j_traj .le. jte .and. j_traj .lt. jde) .and. & > (k_traj .le. kte .and. k_traj .lt. kde)) then 2494,2495c2440 < if (eta_new .le. grid%znw(keta) .and. eta_new .gt. grid%znw(keta+1)) & < then --- > if (eta_new .le. grid%znw(keta) .and. eta_new .gt. grid%znw(keta+1)) then 2508,2513c2453,2465 < if( has_proj_map ) then < call ij_to_latlon (proj, traj_i(tjk), & < traj_j(tjk),traj_lat(tjk),traj_long(tjk)) < endif < endif is_in_time_interval < else traj_in_domain --- > if ( ( proj%code .EQ. PROJ_LC ) .OR. & > ( proj%code .EQ. PROJ_PS ) .OR. & > ( proj%code .EQ. PROJ_PS_WGS84 ) .OR. & > ( proj%code .EQ. PROJ_ALBERS_NAD83 ) .OR. & > ( proj%code .EQ. PROJ_MERC ) .OR. & > ( proj%code .EQ. PROJ_LATLON ) .OR. & > ( proj%code .EQ. PROJ_CYL ) .OR. & > ( proj%code .EQ. PROJ_CASSINI ) .OR. & > ( proj%code .EQ. PROJ_GAUSS ) .OR. & > ( proj%code .EQ. PROJ_ROTLL ) ) THEN > call ij_to_latlon (proj, traj_i(tjk), traj_j(tjk),traj_lat(tjk),traj_long(tjk)) > end if > else 2519,2526c2471,2478 < endif traj_in_domain < endif traj_is_active < traj_i(tjk) = wrf_dm_max_real(traj_i(tjk)) < traj_j(tjk) = wrf_dm_max_real(traj_j(tjk)) < traj_k(tjk) = wrf_dm_max_real(traj_k(tjk)) < traj_long(tjk) = wrf_dm_max_real(traj_long(tjk)) < traj_lat(tjk) = wrf_dm_max_real(traj_lat(tjk)) < enddo traj_loop --- > endif > endif > traj_i(tjk) = wrf_dm_max_real(traj_i(tjk))! save the information from highest fomain > traj_j(tjk) = wrf_dm_max_real(traj_j(tjk)) > traj_k(tjk) = wrf_dm_max_real(traj_k(tjk)) > traj_long(tjk) = wrf_dm_max_real(traj_long(tjk)) > traj_lat(tjk) = wrf_dm_max_real(traj_lat(tjk)) > enddo 2529,2531d2480 < write(dbg_mes,'(''trajectory('',i2.2,''): Leaving trajectory'')') dm < call wrf_debug(200,trim(dbg_mes) ) < 2533,2534d2481 < !--mmb traj <