Merge remote-tracking branch 'origin/release-v4.6.1'
[WRF.git] / var / da / da_transfer_model / da_get_2nd_firstguess.inc
blob0d4206a1261a4dbcd55c3667c2dc656945ab4780
1  SUBROUTINE da_get_2nd_firstguess ( grid )
3 !-------------------------------------------------------------------------
4 !  Calculate the first guess at the end of thr time window
5 !  The original grid%u_2,v_2 etc. will be overwrittedm but we need the boundary area only
6 !  Author: Xin Zhang, 10/7/2010
7 !-------------------------------------------------------------------------
9    IMPLICIT NONE
11    TYPE(domain), INTENT(INOUT)        :: grid
13 #ifdef VAR4D
15    INTEGER  :: spec_bdy_width, i, j
17    spec_bdy_width =  grid%spec_bdy_width
19    CALL da_calc_2nd_fg ( grid%moist(:,:,:,P_QV), grid%moist_bxs(:,:,:,P_QV), grid%moist_bxe(:,:,:,P_QV),     &
20                                     grid%moist_bys(:,:,:,P_QV), grid%moist_bye(:,:,:,P_QV),     &
21                                     grid%moist_btxs(:,:,:,P_QV), grid%moist_btxe(:,:,:,P_QV),     &
22                                     grid%moist_btys(:,:,:,P_QV), grid%moist_btye(:,:,:,P_QV),     &
23                                     REAL(interval_seconds), 'T' , spec_bdy_width      ,               &
24                                     grid%sd31, grid%ed31, grid%sd32, grid%ed32, grid%sd33, grid%ed33, &
25                                     grid%sm31, grid%em31, grid%sm32, grid%em32, grid%sm33, grid%em33, &
26                                     grid%sp31, grid%ep31, grid%sp32, grid%ep32, grid%sp33, grid%ep33 )
28    CALL da_calc_2nd_fg ( grid%mu_2 , grid%mu_bxs, grid%mu_bxe, grid%mu_bys, grid%mu_bye,    &
29                                     grid%mu_btxs, grid%mu_btxe, grid%mu_btys, grid%mu_btye,    &
30                                     REAL(interval_seconds), 'M' , spec_bdy_width      ,               &
31                                     grid%sd31, grid%ed31, grid%sd32, grid%ed32, 1, 1, &
32                                     grid%sm31, grid%em31, grid%sm32, grid%em32, 1, 1, &
33                                     grid%sp31, grid%ep31, grid%sp32, grid%ep32, 1, 1 )
35    CALL da_calc_2nd_fg ( grid%u_2 , grid%u_bxs, grid%u_bxe, grid%u_bys, grid%u_bye, &
36                                     grid%u_btxs, grid%u_btxe, grid%u_btys, grid%u_btye,    &
37                                     REAL(interval_seconds), 'U' , spec_bdy_width      , &
38                                     grid%sd31, grid%ed31, grid%sd32, grid%ed32, grid%sd33, grid%ed33, &
39                                     grid%sm31, grid%em31, grid%sm32, grid%em32, grid%sm33, grid%em33, &
40                                     grid%sp31, grid%ep31, grid%sp32, grid%ep32, grid%sp33, grid%ep33 )
42    CALL da_calc_2nd_fg ( grid%v_2 , grid%v_bxs, grid%v_bxe, grid%v_bys, grid%v_bye, &
43                                     grid%v_btxs, grid%v_btxe, grid%v_btys, grid%v_btye,    &
44                                     REAL(interval_seconds), 'V' , spec_bdy_width      , &
45                                     grid%sd31, grid%ed31, grid%sd32, grid%ed32, grid%sd33, grid%ed33, &
46                                     grid%sm31, grid%em31, grid%sm32, grid%em32, grid%sm33, grid%em33, &
47                                     grid%sp31, grid%ep31, grid%sp32, grid%ep32, grid%sp33, grid%ep33 )
49    CALL da_calc_2nd_fg ( grid%t_2 , grid%t_bxs, grid%t_bxe, grid%t_bys, grid%t_bye, &
50                                     grid%t_btxs, grid%t_btxe, grid%t_btys, grid%t_btye,    &
51                                     REAL(interval_seconds), 'T' , spec_bdy_width      , &
52                                     grid%sd31, grid%ed31, grid%sd32, grid%ed32, grid%sd33, grid%ed33, &
53                                     grid%sm31, grid%em31, grid%sm32, grid%em32, grid%sm33, grid%em33, &
54                                     grid%sp31, grid%ep31, grid%sp32, grid%ep32, grid%sp33, grid%ep33 )
56    CALL da_calc_2nd_fg ( grid%ph_2 , grid%ph_bxs, grid%ph_bxe, grid%ph_bys, grid%ph_bye, &
57                                     grid%ph_btxs, grid%ph_btxe, grid%ph_btys, grid%ph_btye,    &
58                                     REAL(interval_seconds), 'W' , spec_bdy_width      , &
59                                     grid%sd31, grid%ed31, grid%sd32, grid%ed32, grid%sd33, grid%ed33, &
60                                     grid%sm31, grid%em31, grid%sm32, grid%em32, grid%sm33, grid%em33, &
61                                     grid%sp31, grid%ep31, grid%sp32, grid%ep32, grid%sp33, grid%ep33 )
63 #ifdef DM_PARALLEL
64 #include "HALO_EM_E.inc"
65 #endif
67    CALL decouple ( grid%mu_2 , grid%mub , grid%u_2                 , 'u' , grid%msfuy , &
68                                     grid%sd31, grid%ed31, grid%sd32, grid%ed32, grid%sd33, grid%ed33, &
69                                     grid%sm31, grid%em31, grid%sm32, grid%em32, grid%sm33, grid%em33, &
70                                     grid%sp31, grid%ep31, grid%sp32, grid%ep32, grid%sp33, grid%ep33 )
72    CALL decouple ( grid%mu_2 , grid%mub , grid%v_2                 , 'v' , grid%msfvx , &
73                                     grid%sd31, grid%ed31, grid%sd32, grid%ed32, grid%sd33, grid%ed33, &
74                                     grid%sm31, grid%em31, grid%sm32, grid%em32, grid%sm33, grid%em33, &
75                                     grid%sp31, grid%ep31, grid%sp32, grid%ep32, grid%sp33, grid%ep33 )
77    CALL decouple ( grid%mu_2 , grid%mub , grid%t_2                 , 't' , grid%msfty , &
78                                     grid%sd31, grid%ed31, grid%sd32, grid%ed32, grid%sd33, grid%ed33, &
79                                     grid%sm31, grid%em31, grid%sm32, grid%em32, grid%sm33, grid%em33, &
80                                     grid%sp31, grid%ep31, grid%sp32, grid%ep32, grid%sp33, grid%ep33 )
82    CALL decouple ( grid%mu_2 , grid%mub , grid%ph_2                , 'h' , grid%msfty , &
83                                     grid%sd31, grid%ed31, grid%sd32, grid%ed32, grid%sd33, grid%ed33, &
84                                     grid%sm31, grid%em31, grid%sm32, grid%em32, grid%sm33, grid%em33, &
85                                     grid%sp31, grid%ep31, grid%sp32, grid%ep32, grid%sp33, grid%ep33 )
87    CALL decouple ( grid%mu_2 , grid%mub , grid%moist(:,:,:,P_QV)      , 't' , grid%msfty , &
88                                     grid%sd31, grid%ed31, grid%sd32, grid%ed32, grid%sd33, grid%ed33, &
89                                     grid%sm31, grid%em31, grid%sm32, grid%em32, grid%sm33, grid%em33, &
90                                     grid%sp31, grid%ep31, grid%sp32, grid%ep32, grid%sp33, grid%ep33 )
91 #endif
93  END SUBROUTINE da_get_2nd_firstguess