1 subroutine da_solve_init(grid &
2 #include "dummy_new_args.inc"
5 !-----------------------------------------------------------------------
7 !-----------------------------------------------------------------------
11 type(domain), intent(inout) :: grid
13 #include "dummy_new_decl.inc"
19 integer :: sm31,sm32,sm33,sm31x,sm32x,sm33x,sm31y,sm32y,sm33y
20 integer :: em31,em32,em33,ep_dim
22 if ( use_4denvar ) ep_dim=num_fgat_time ! 4D-En-Var
23 ! if (dwordsize != rwordsize)
24 #define true_MSG_XPOSE add_msg_xpose_real
26 ! define true_MSG_XPOSE add_msg_xpose_doubleprecision
29 if (trace_use) call da_trace_entry("da_solve_init")
31 ! De-reference dimension information stored in the grid data structure.
33 call da_copy_dims(grid)
35 ! Compute these starting and stopping locations for each tile and number
38 call set_tiles (grid , ids , ide , jds , jde , ips , ipe , jps , jpe)
40 call da_copy_tile_dims(grid)
58 #include "data_calls.inc"
60 if (trace_use) call da_trace("da_solve_init", &
61 Message="Setup halo region communication")
63 ! Define halo region communication.
64 !-----------------------------------------------------------------------
65 ! Stencils for patch communications
68 ! * + * * + * * * + * *
76 !--------------------------------------------------------------
77 #include "HALO_INIT.inc"
78 #include "HALO_PSICHI_UV.inc"
79 #include "HALO_BAL_EQN_ADJ.inc"
80 #include "HALO_PSICHI_UV_ADJ.inc"
81 #include "HALO_XA.inc"
82 #include "HALO_SFC_XA.inc"
83 #include "HALO_SSMI_XA.inc"
84 #include "HALO_2D_WORK.inc"
85 #include "HALO_RADAR_XA_W.inc"
88 #include "HALO_CHEM_INIT.inc"
89 #include "HALO_CHEM_XA.inc"
92 if (trace_use) call da_trace("da_solve_init", &
93 Message="Copy domain and transpose descriptors")
95 ! Copy domain and transpose descriptors.
97 grid%xp%domdesc = grid%domdesc
99 grid%xp%comms(ii) = grid%comms(ii)
104 ! Fill background scalars:
106 grid%xb%ids = grid%xp%ids
107 grid%xb%ide = grid%xp%ide
108 grid%xb%jds = grid%xp%jds
109 grid%xb%jde = grid%xp%jde
110 grid%xb%kds = grid%xp%kds
111 grid%xb%kde = grid%xp%kde
113 grid%xb%ims = grid%xp%ims
114 grid%xb%ime = grid%xp%ime
115 grid%xb%jms = grid%xp%jms
116 grid%xb%jme = grid%xp%jme
117 grid%xb%kms = grid%xp%kms
118 grid%xb%kme = grid%xp%kme
120 grid%xb%its = grid%xp%its
121 grid%xb%ite = grid%xp%ite
122 grid%xb%jts = grid%xp%jts
123 grid%xb%jte = grid%xp%jte
124 grid%xb%kts = grid%xp%kts
125 grid%xb%kte = grid%xp%kte
127 ! if anal_type_hybrid_dual_res,
128 ! grid%ep is already allocated in the call to reallocate_analysis_grid
129 if ( .not. anal_type_hybrid_dual_res ) then
131 ! allocate grid%ep%v1
133 ALLOCATE(grid%ep%v1(sm31:em31,sm32:em32,sm33:em33,1:config_flags%ensdim_alpha*ep_dim),STAT=ierr)
135 print *,' Failed to allocate grid%ep%v1(sm31:em31,sm32:em32,sm33:em33,1:config_flags%ensdim_alpha). '
140 ! allocate grid%ep%v2
142 ALLOCATE(grid%ep%v2(sm31:em31,sm32:em32,sm33:em33,1:config_flags%ensdim_alpha*ep_dim),STAT=ierr)
144 print *,' Failed to allocate grid%ep%v2(sm31:em31,sm32:em32,sm33:em33,1:config_flags%ensdim_alpha). '
149 ! allocate grid%ep%v3
151 ALLOCATE(grid%ep%v3(sm31:em31,sm32:em32,sm33:em33,1:config_flags%ensdim_alpha*ep_dim),STAT=ierr)
153 print *,' Failed to allocate grid%ep%v3(sm31:em31,sm32:em32,sm33:em33,1:config_flags%ensdim_alpha). '
158 ! allocate grid%ep%v4
160 ALLOCATE(grid%ep%v4(sm31:em31,sm32:em32,sm33:em33,1:config_flags%ensdim_alpha*ep_dim),STAT=ierr)
162 print *,' Failed to allocate grid%ep%v4(sm31:em31,sm32:em32,sm33:em33,1:config_flags%ensdim_alpha). '
167 ! allocate grid%ep%v5
169 ALLOCATE(grid%ep%v5(sm31:em31,sm32:em32,sm33:em33,1:config_flags%ensdim_alpha*ep_dim),STAT=ierr)
171 print *,' Failed to allocate grid%ep%v5(sm31:em31,sm32:em32,sm33:em33,1:config_flags%ensdim_alpha). '
175 if ( alpha_hydrometeors ) then
177 ! allocate grid%ep%cw
179 ALLOCATE(grid%ep%cw(sm31:em31,sm32:em32,sm33:em33,1:config_flags%ensdim_alpha*ep_dim),STAT=ierr)
181 write(unit=message(1),fmt='(a)') 'Failed to allocate grid%ep%cw(sm31:em31,sm32:em32,sm33:em33,1:config_flags%ensdim_alpha) '
182 call da_error(__FILE__,__LINE__,message(1:1))
186 ! allocate grid%ep%rn
188 ALLOCATE(grid%ep%rn(sm31:em31,sm32:em32,sm33:em33,1:config_flags%ensdim_alpha*ep_dim),STAT=ierr)
190 write(unit=message(1),fmt='(a)') 'Failed to allocate grid%ep%rn(sm31:em31,sm32:em32,sm33:em33,1:config_flags%ensdim_alpha) '
191 call da_error(__FILE__,__LINE__,message(1:1))
195 ! allocate grid%ep%ci
197 ALLOCATE(grid%ep%ci(sm31:em31,sm32:em32,sm33:em33,1:config_flags%ensdim_alpha*ep_dim),STAT=ierr)
199 write(unit=message(1),fmt='(a)') 'Failed to allocate grid%ep%ci(sm31:em31,sm32:em32,sm33:em33,1:config_flags%ensdim_alpha) '
200 call da_error(__FILE__,__LINE__,message(1:1))
204 ! allocate grid%ep%sn
206 ALLOCATE(grid%ep%sn(sm31:em31,sm32:em32,sm33:em33,1:config_flags%ensdim_alpha*ep_dim),STAT=ierr)
208 write(unit=message(1),fmt='(a)') 'Failed to allocate grid%ep%sn(sm31:em31,sm32:em32,sm33:em33,1:config_flags%ensdim_alpha) '
209 call da_error(__FILE__,__LINE__,message(1:1))
213 ! allocate grid%ep%gr
215 ALLOCATE(grid%ep%gr(sm31:em31,sm32:em32,sm33:em33,1:config_flags%ensdim_alpha*ep_dim),STAT=ierr)
217 write(unit=message(1),fmt='(a)') 'Failed to allocate grid%ep%gr(sm31:em31,sm32:em32,sm33:em33,1:config_flags%ensdim_alpha) '
218 call da_error(__FILE__,__LINE__,message(1:1))
221 end if ! alpha_hydrometeors
223 end if !not anal_type_hybrid_dual_res
225 if (trace_use) call da_trace_exit("da_solve_init")
227 end subroutine da_solve_init