Merge remote-tracking branch 'origin/release-v4.5.2'
[WRF.git] / var / da / da_rain / da_get_hr_rain.inc
blob2b3509fb16b22a31eff2692b9d67605619d35dd8
1 subroutine da_get_hr_rain(k, grid, hr_rainc, hr_rainnc, savegridrainc, savegridrainnc)
3    !-----------------------------------------------------------------------
4    ! Purpose: TBD    
5    !-----------------------------------------------------------------------
7    implicit none
9    integer,          intent(in)    :: k     
10    type(domain),     intent(in)    :: grid    ! first guess state.
11    real, dimension(ims:ime,jms:jme,1:num_fgat_time), intent(inout) :: hr_rainc, hr_rainnc
12    real, dimension(ims:ime,jms:jme), intent(inout) :: savegridrainc, savegridrainnc
13    
14    if (trace_use) call da_trace_entry("da_get_hr_rain")
16 #ifdef DM_PARALLEL
17 #include "HALO_EM_RAIN.inc"
18 #endif
20    if (k .lt. num_fgat_time) then
21       !hr_rainc(:,:,k+1)  = hr_rainc (:,:,k+1) - grid%rainc(:,:) 
22       !hr_rainnc(:,:,k+1) = hr_rainnc(:,:,k+1) - grid%rainnc(:,:)
23       hr_rainc(:,:,k+1)  = savegridrainc(:,:)  - grid%rainc(:,:) 
24       hr_rainnc(:,:,k+1) = savegridrainnc(:,:) - grid%rainnc(:,:)
25       savegridrainc(:,:)  = grid%rainc(:,:)
26       savegridrainnc(:,:) = grid%rainnc(:,:)
27    else
28       hr_rainc(:,:,k)  = grid%rainc(:,:) 
29       hr_rainnc(:,:,k) = grid%rainnc(:,:)
30       savegridrainc(:,:)  = grid%rainc(:,:)
31       savegridrainnc(:,:) = grid%rainnc(:,:)
32    endif
34  if (trace_use) call da_trace_exit("da_get_hr_rain")
36 end subroutine da_get_hr_rain