PageRenderTime 54ms CodeModel.GetById 13ms RepoModel.GetById 1ms app.codeStats 1ms

/wrfv2_fire/dyn_em/solve_em.F

http://github.com/jbeezley/wrf-fire
FORTRAN Legacy | 4014 lines | 2574 code | 461 blank | 979 comment | 12 complexity | b11609b3a9b0c8f951dfd34819ba8f0b MD5 | raw file
Possible License(s): AGPL-1.0

Large files files are truncated, but you can click here to view the full file

  1. !WRF:MEDIATION_LAYER:SOLVER
  2. SUBROUTINE solve_em ( grid , config_flags &
  3. ! Arguments generated from Registry
  4. #include "dummy_new_args.inc"
  5. !
  6. )
  7. ! Driver layer modules
  8. USE module_state_description
  9. USE module_domain, ONLY : &
  10. domain, get_ijk_from_grid, get_ijk_from_subgrid &
  11. ,domain_get_current_time, domain_get_start_time &
  12. ,domain_get_sim_start_time, domain_clock_get
  13. USE module_domain_type, ONLY : history_alarm, restart_alarm
  14. USE module_configure, ONLY : grid_config_rec_type
  15. USE module_driver_constants
  16. USE module_machine
  17. USE module_tiles, ONLY : set_tiles
  18. #ifdef DM_PARALLEL
  19. USE module_dm, ONLY : &
  20. local_communicator, mytask, ntasks, ntasks_x, ntasks_y &
  21. ,local_communicator_periodic, wrf_dm_maxval
  22. USE module_comm_dm, ONLY : &
  23. halo_em_a_sub,halo_em_b_sub,halo_em_c2_sub,halo_em_chem_e_3_sub &
  24. ,halo_em_chem_e_5_sub,halo_em_chem_e_7_sub,halo_em_chem_old_e_5_sub &
  25. ,halo_em_chem_old_e_7_sub,halo_em_c_sub,halo_em_d2_3_sub &
  26. ,halo_em_d2_5_sub,halo_em_d3_3_sub,halo_em_d3_5_sub,halo_em_d_sub &
  27. ,halo_em_e_3_sub,halo_em_e_5_sub,halo_em_hydro_uv_sub &
  28. ,halo_em_moist_e_3_sub,halo_em_moist_e_5_sub,halo_em_moist_e_7_sub &
  29. ,halo_em_moist_old_e_5_sub,halo_em_moist_old_e_7_sub &
  30. ,halo_em_scalar_e_3_sub,halo_em_scalar_e_5_sub,halo_em_scalar_e_7_sub &
  31. ,halo_em_scalar_old_e_5_sub,halo_em_scalar_old_e_7_sub,halo_em_tke_3_sub &
  32. ,halo_em_tke_5_sub,halo_em_tke_7_sub,halo_em_tke_advect_3_sub &
  33. ,halo_em_tke_advect_5_sub,halo_em_tke_old_e_5_sub &
  34. ,halo_em_tke_old_e_7_sub,halo_em_tracer_e_3_sub,halo_em_tracer_e_5_sub &
  35. ,halo_em_tracer_e_7_sub,halo_em_tracer_old_e_5_sub &
  36. ,halo_em_tracer_old_e_7_sub,period_bdy_em_a_sub &
  37. ,period_bdy_em_b3_sub,period_bdy_em_b_sub,period_bdy_em_chem2_sub &
  38. ,period_bdy_em_chem_old_sub,period_bdy_em_chem_sub,period_bdy_em_d3_sub &
  39. ,period_bdy_em_d_sub,period_bdy_em_e_sub,period_bdy_em_moist2_sub &
  40. ,period_bdy_em_moist_old_sub,period_bdy_em_moist_sub &
  41. ,period_bdy_em_scalar2_sub,period_bdy_em_scalar_old_sub &
  42. ,period_bdy_em_scalar_sub,period_bdy_em_tke_old_sub &
  43. ,period_bdy_em_tracer2_sub,period_bdy_em_tracer_old_sub &
  44. ,period_bdy_em_tracer_sub,period_em_da_sub,period_em_hydro_uv_sub
  45. #endif
  46. USE module_utility
  47. ! Mediation layer modules
  48. ! Model layer modules
  49. USE module_model_constants
  50. USE module_small_step_em
  51. USE module_em
  52. USE module_big_step_utilities_em
  53. USE module_bc
  54. USE module_bc_em
  55. USE module_solvedebug_em
  56. USE module_physics_addtendc
  57. USE module_diffusion_em
  58. USE module_polarfft
  59. USE module_microphysics_driver
  60. USE module_microphysics_zero_out
  61. USE module_fddaobs_driver
  62. USE module_diagnostics
  63. #ifdef WRF_CHEM
  64. USE module_input_chem_data
  65. USE module_input_tracer
  66. USE module_chem_utilities
  67. #endif
  68. USE module_first_rk_step_part1
  69. USE module_first_rk_step_part2
  70. USE module_llxy, ONLY : proj_cassini
  71. USE module_avgflx_em, ONLY : zero_avgflx, upd_avgflx
  72. IMPLICIT NONE
  73. ! Input data.
  74. TYPE(domain) , TARGET :: grid
  75. ! Definitions of dummy arguments to this routine (generated from Registry).
  76. #include "dummy_new_decl.inc"
  77. ! Structure that contains run-time configuration (namelist) data for domain
  78. TYPE (grid_config_rec_type) , INTENT(IN) :: config_flags
  79. ! Local data
  80. INTEGER :: k_start , k_end, its, ite, jts, jte
  81. INTEGER :: ids , ide , jds , jde , kds , kde , &
  82. ims , ime , jms , jme , kms , kme , &
  83. ips , ipe , jps , jpe , kps , kpe
  84. INTEGER :: sids , side , sjds , sjde , skds , skde , &
  85. sims , sime , sjms , sjme , skms , skme , &
  86. sips , sipe , sjps , sjpe , skps , skpe
  87. INTEGER :: imsx, imex, jmsx, jmex, kmsx, kmex, &
  88. ipsx, ipex, jpsx, jpex, kpsx, kpex, &
  89. imsy, imey, jmsy, jmey, kmsy, kmey, &
  90. ipsy, ipey, jpsy, jpey, kpsy, kpey
  91. INTEGER :: ij , iteration
  92. INTEGER :: im , num_3d_m , ic , num_3d_c , is , num_3d_s
  93. INTEGER :: loop
  94. INTEGER :: sz
  95. INTEGER :: iswater
  96. LOGICAL :: specified_bdy, channel_bdy
  97. REAL :: t_new
  98. ! Changes in tendency at this timestep
  99. real ,DIMENSION(grid%sm31:grid%em31,grid%sm32:grid%em32,grid%sm33:grid%em33) :: h_tendency, &
  100. z_tendency
  101. ! Whether advection should produce decoupled horizontal and vertical advective tendency outputs
  102. LOGICAL :: tenddec
  103. ! Flag for microphysics routines to produce diagnostic fields (e.g., radar reflectivity)
  104. LOGICAL :: diagflag
  105. #ifdef WRF_CHEM
  106. ! Index cross-referencing array for tendency accumulation
  107. INTEGER, DIMENSION( num_chem ) :: adv_ct_indices
  108. #endif
  109. ! storage for tendencies and decoupled state (generated from Registry)
  110. #include <i1_decl.inc>
  111. ! Previous time level of tracer arrays now defined as i1 variables;
  112. ! the state 4d arrays now redefined as 1-time level arrays in Registry.
  113. ! Benefit: save memory in nested runs, since only 1 domain is active at a
  114. ! time. Potential problem on stack-limited architectures: increases
  115. ! amount of data on program stack by making these automatic arrays.
  116. INTEGER :: rc
  117. INTEGER :: number_of_small_timesteps, rk_step
  118. INTEGER :: klevel,ijm,ijp,i,j,k,size1,size2 ! for prints/plots only
  119. INTEGER :: idum1, idum2, dynamics_option
  120. INTEGER :: rk_order, iwmax, jwmax, kwmax
  121. REAL :: dt_rk, dts_rk, dts, dtm, wmax
  122. REAL , ALLOCATABLE , DIMENSION(:) :: max_vert_cfl_tmp, max_horiz_cfl_tmp
  123. LOGICAL :: leapfrog
  124. INTEGER :: l,kte,kk
  125. LOGICAL :: f_flux ! flag for computing averaged fluxes in cu_gd
  126. REAL :: curr_secs
  127. INTEGER :: num_sound_steps
  128. INTEGER :: idex, jdex
  129. REAL :: max_msft
  130. REAL :: spacing
  131. INTEGER :: ii, jj !kk is above after l,kte
  132. REAL :: dclat
  133. INTEGER :: debug_level
  134. ! urban related variables
  135. INTEGER :: NUM_ROOF_LAYERS, NUM_WALL_LAYERS, NUM_ROAD_LAYERS ! urban
  136. TYPE(WRFU_TimeInterval) :: tmpTimeInterval
  137. REAL :: real_time
  138. LOGICAL :: adapt_step_flag
  139. LOGICAL :: fill_w_flag
  140. ! variables for flux-averaging code 20091223
  141. CHARACTER*256 :: message, message2
  142. REAL :: old_dt
  143. TYPE(WRFU_Time) :: temp_time, CurrTime, restart_time
  144. INTEGER, PARAMETER :: precision = 100
  145. INTEGER :: num, den
  146. TYPE(WRFU_TimeInterval) :: dtInterval, intervaltime,restartinterval
  147. ! Define benchmarking timers if -DBENCH is compiled
  148. #include <bench_solve_em_def.h>
  149. !----------------------
  150. ! Executable statements
  151. !----------------------
  152. !<DESCRIPTION>
  153. !<pre>
  154. ! solve_em is the main driver for advancing a grid a single timestep.
  155. ! It is a mediation-layer routine -> DM and SM calls are made where
  156. ! needed for parallel processing.
  157. !
  158. ! solve_em can integrate the equations using 3 time-integration methods
  159. !
  160. ! - 3rd order Runge-Kutta time integration (recommended)
  161. !
  162. ! - 2nd order Runge-Kutta time integration
  163. !
  164. ! The main sections of solve_em are
  165. !
  166. ! (1) Runge-Kutta (RK) loop
  167. !
  168. ! (2) Non-timesplit physics (i.e., tendencies computed for updating
  169. ! model state variables during the first RK sub-step (loop)
  170. !
  171. ! (3) Small (acoustic, sound) timestep loop - within the RK sub-steps
  172. !
  173. ! (4) scalar advance for moist and chem scalar variables (and TKE)
  174. ! within the RK sub-steps.
  175. !
  176. ! (5) time-split physics (after the RK step), currently this includes
  177. ! only microphyics
  178. !
  179. ! A more detailed description of these sections follows.
  180. !</pre>
  181. !</DESCRIPTION>
  182. ! Initialize timers if compiled with -DBENCH
  183. #include <bench_solve_em_init.h>
  184. ! set runge-kutta solver (2nd or 3rd order)
  185. dynamics_option = config_flags%rk_ord
  186. ! Obtain dimension information stored in the grid data structure.
  187. CALL get_ijk_from_grid ( grid , &
  188. ids, ide, jds, jde, kds, kde, &
  189. ims, ime, jms, jme, kms, kme, &
  190. ips, ipe, jps, jpe, kps, kpe, &
  191. imsx, imex, jmsx, jmex, kmsx, kmex, &
  192. ipsx, ipex, jpsx, jpex, kpsx, kpex, &
  193. imsy, imey, jmsy, jmey, kmsy, kmey, &
  194. ipsy, ipey, jpsy, jpey, kpsy, kpey )
  195. CALL get_ijk_from_subgrid ( grid , &
  196. sids, side, sjds, sjde, skds, skde, &
  197. sims, sime, sjms, sjme, skms, skme, &
  198. sips, sipe, sjps, sjpe, skps, skpe )
  199. k_start = kps
  200. k_end = kpe
  201. num_3d_m = num_moist
  202. num_3d_c = num_chem
  203. num_3d_s = num_scalar
  204. f_flux = config_flags%do_avgflx_cugd .EQ. 1
  205. ! Compute these starting and stopping locations for each tile and number of tiles.
  206. ! See: http://www.mmm.ucar.edu/wrf/WG2/topics/settiles
  207. CALL set_tiles ( grid , ids , ide , jds , jde , ips , ipe , jps , jpe )
  208. ! Max values of CFL for adaptive time step scheme
  209. ALLOCATE (max_vert_cfl_tmp(grid%num_tiles))
  210. ALLOCATE (max_horiz_cfl_tmp(grid%num_tiles))
  211. !
  212. ! Calculate current time in seconds since beginning of model run.
  213. ! Unfortunately, ESMF does not seem to have a way to return
  214. ! floating point seconds based on a TimeInterval. So, we will
  215. ! calculate it here--but, this is not clean!!
  216. !
  217. tmpTimeInterval = domain_get_current_time ( grid ) - domain_get_sim_start_time ( grid )
  218. curr_secs = real_time(tmpTimeInterval)
  219. old_dt = grid%dt ! store old time step for flux averaging code at end of RK loop
  220. !-----------------------------------------------------------------------------
  221. ! Adaptive time step: Added by T. Hutchinson, WSI 3/5/07
  222. ! In this call, we do the time-step adaptation and set time-dependent lateral
  223. ! boundary condition nudging weights.
  224. !
  225. IF ( (config_flags%use_adaptive_time_step) .and. &
  226. ( (.not. grid%nested) .or. &
  227. ( (grid%nested) .and. (abs(grid%dtbc) < 0.0001) ) ) )THEN
  228. CALL adapt_timestep(grid, config_flags)
  229. adapt_step_flag = .TRUE.
  230. ELSE
  231. adapt_step_flag = .FALSE.
  232. ENDIF
  233. ! End of adaptive time step modifications
  234. !-----------------------------------------------------------------------------
  235. grid%itimestep = grid%itimestep + 1
  236. IF (config_flags%polar) dclat = 90./REAL(jde-jds) !(0.5 * 180/ny)
  237. #ifdef WRF_CHEM
  238. kte=min(k_end,kde-1)
  239. # ifdef DM_PARALLEL
  240. if ( num_chem >= PARAM_FIRST_SCALAR ) then
  241. !-----------------------------------------------------------------------
  242. ! see matching halo calls below for stencils
  243. !--------------------------------------------------------------
  244. CALL wrf_debug ( 200 , ' call HALO_RK_CHEM' )
  245. IF ( config_flags%h_mom_adv_order <= 4 ) THEN
  246. # include "HALO_EM_CHEM_E_3.inc"
  247. IF( config_flags%progn > 0 ) THEN
  248. # include "HALO_EM_SCALAR_E_3.inc"
  249. ENDIF
  250. ELSE IF ( config_flags%h_mom_adv_order <= 6 ) THEN
  251. # include "HALO_EM_CHEM_E_5.inc"
  252. IF( config_flags%progn > 0 ) THEN
  253. # include "HALO_EM_SCALAR_E_5.inc"
  254. ENDIF
  255. ELSE
  256. WRITE(wrf_err_message,*)'solve_em: invalid h_mom_adv_order = ',config_flags%h_mom_adv_order
  257. CALL wrf_error_fatal(TRIM(wrf_err_message))
  258. ENDIF
  259. ENDIF
  260. if ( num_tracer >= PARAM_FIRST_SCALAR ) then
  261. !-----------------------------------------------------------------------
  262. ! see matching halo calls below for stencils
  263. !--------------------------------------------------------------
  264. CALL wrf_debug ( 200 , ' call HALO_RK_tracer' )
  265. IF ( config_flags%h_mom_adv_order <= 4 ) THEN
  266. # include "HALO_EM_TRACER_E_3.inc"
  267. ELSE IF ( config_flags%h_mom_adv_order <= 6 ) THEN
  268. # include "HALO_EM_TRACER_E_5.inc"
  269. ELSE
  270. WRITE(wrf_err_message,*)'solve_em: invalid h_mom_adv_order = ',config_flags%h_mom_adv_order
  271. CALL wrf_error_fatal(TRIM(wrf_err_message))
  272. ENDIF
  273. ENDIF
  274. # endif
  275. !--------------------------------------------------------------
  276. adv_ct_indices( : ) = 1
  277. IF ( config_flags%chemdiag == USECHEMDIAG ) THEN
  278. ! modify tendency list here
  279. ! note that the referencing direction here is opposite of that in chem_driver
  280. adv_ct_indices(p_co ) = p_advh_co
  281. adv_ct_indices(p_o3 ) = p_advh_o3
  282. adv_ct_indices(p_no ) = p_advh_no
  283. adv_ct_indices(p_no2 ) = p_advh_no2
  284. adv_ct_indices(p_hno3) = p_advh_hno3
  285. adv_ct_indices(p_iso ) = p_advh_iso
  286. adv_ct_indices(p_ho ) = p_advh_ho
  287. adv_ct_indices(p_ho2 ) = p_advh_ho2
  288. END IF
  289. #endif
  290. rk_order = config_flags%rk_ord
  291. IF ( grid%time_step_sound == 0 ) THEN
  292. ! This function will give 4 for 6*dx and 6 for 10*dx and returns even numbers only
  293. spacing = min(grid%dx, grid%dy)
  294. IF ( ( config_flags%use_adaptive_time_step ) .AND. ( config_flags%map_proj == PROJ_CASSINI ) ) THEN
  295. max_msft=MIN ( MAX(grid%max_msftx, grid%max_msfty) , &
  296. 1.0/COS(config_flags%fft_filter_lat*degrad) )
  297. num_sound_steps = max ( 2 * ( INT (300. * grid%dt / (spacing / max_msft) - 0.01 ) + 1 ), 4 )
  298. ELSE IF ( config_flags%use_adaptive_time_step ) THEN
  299. max_msft= MAX(grid%max_msftx, grid%max_msfty)
  300. num_sound_steps = max ( 2 * ( INT (300. * grid%dt / (spacing / max_msft) - 0.01 ) + 1 ), 4 )
  301. ELSE
  302. num_sound_steps = max ( 2 * ( INT (300. * grid%dt / spacing - 0.01 ) + 1 ), 4 )
  303. END IF
  304. WRITE(wrf_err_message,*)'grid spacing, dt, time_step_sound=',spacing,grid%dt,num_sound_steps
  305. CALL wrf_debug ( 50 , wrf_err_message )
  306. ELSE
  307. num_sound_steps = grid%time_step_sound
  308. ENDIF
  309. dts = grid%dt/float(num_sound_steps)
  310. IF (config_flags%use_adaptive_time_step) THEN
  311. CALL get_wrf_debug_level( debug_level )
  312. IF ((config_flags%time_step < 0) .AND. (debug_level.GE.50)) THEN
  313. #ifdef DM_PARALLEL
  314. CALL wrf_dm_maxval(grid%max_vert_cfl, idex, jdex)
  315. #endif
  316. WRITE(wrf_err_message,*)'variable dt, max horiz cfl, max vert cfl: ',&
  317. grid%dt, grid%max_horiz_cfl, grid%max_vert_cfl
  318. CALL wrf_debug ( 0 , wrf_err_message )
  319. ENDIF
  320. grid%max_cfl_val = 0
  321. grid%max_horiz_cfl = 0
  322. grid%max_vert_cfl = 0
  323. ENDIF
  324. ! setting bdy tendencies to zero for DFI if constant_bc = true
  325. !$OMP PARALLEL DO &
  326. !$OMP PRIVATE ( ij )
  327. DO ij = 1 , grid%num_tiles
  328. ! IF( config_flags%specified .AND. grid%dfi_opt .NE. DFI_NODFI &
  329. ! .AND. config_flags%constant_bc .AND. (grid%dfi_stage .EQ. DFI_BCK .OR. grid%dfi_stage .EQ. DFI_FWD) ) THEN
  330. IF( config_flags%specified .AND. config_flags%constant_bc ) THEN
  331. CALL zero_bdytend (grid%u_btxs,grid%u_btxe,grid%u_btys,grid%u_btye, &
  332. grid%v_btxs,grid%v_btxe,grid%v_btys,grid%v_btye, &
  333. grid%ph_btxs,grid%ph_btxe,grid%ph_btys,grid%ph_btye, &
  334. grid%t_btxs,grid%t_btxe,grid%t_btys,grid%t_btye, &
  335. grid%w_btxs,grid%w_btxe,grid%w_btys,grid%w_btye, &
  336. grid%mu_btxs,grid%mu_btxe,grid%mu_btys,grid%mu_btye, &
  337. moist_btxs,moist_btxe, &
  338. moist_btys,moist_btye, &
  339. grid%spec_bdy_width,num_3d_m, &
  340. ids,ide, jds,jde, kds,kde, &
  341. ims,ime, jms,jme, kms,kme, &
  342. ips,ipe, jps,jpe, kps,kpe, &
  343. grid%i_start(ij), grid%i_end(ij), &
  344. grid%j_start(ij), grid%j_end(ij), &
  345. k_start, k_end )
  346. ENDIF
  347. ENDDO
  348. !$OMP END PARALLEL DO
  349. !**********************************************************************
  350. !
  351. ! LET US BEGIN.......
  352. !
  353. !<DESCRIPTION>
  354. !<pre>
  355. ! (1) RK integration loop is named the "Runge_Kutta_loop:"
  356. !
  357. ! Predictor-corrector type time integration.
  358. ! Advection terms are evaluated at time t for the predictor step,
  359. ! and advection is re-evaluated with the latest predicted value for
  360. ! each succeeding time corrector step
  361. !
  362. ! 2nd order Runge Kutta (rk_order = 2):
  363. ! Step 1 is taken to the midpoint predictor, step 2 is the full step.
  364. !
  365. ! 3rd order Runge Kutta (rk_order = 3):
  366. ! Step 1 is taken to from t to dt/3, step 2 is from t to dt/2,
  367. ! and step 3 is from t to dt.
  368. !
  369. ! non-timesplit physics are evaluated during first RK step and
  370. ! these physics tendencies are stored for use in each RK pass.
  371. !</pre>
  372. !</DESCRIPTION>
  373. !**********************************************************************
  374. Runge_Kutta_loop: DO rk_step = 1, rk_order
  375. ! Set the step size and number of small timesteps for
  376. ! each part of the timestep
  377. dtm = grid%dt
  378. IF ( rk_order == 1 ) THEN
  379. write(wrf_err_message,*)' leapfrog removed, error exit for dynamics_option = ',dynamics_option
  380. CALL wrf_error_fatal( wrf_err_message )
  381. ELSE IF ( rk_order == 2 ) THEN ! 2nd order Runge-Kutta timestep
  382. IF ( rk_step == 1) THEN
  383. dt_rk = 0.5*grid%dt
  384. dts_rk = dts
  385. number_of_small_timesteps = num_sound_steps/2
  386. ELSE
  387. dt_rk = grid%dt
  388. dts_rk = dts
  389. number_of_small_timesteps = num_sound_steps
  390. ENDIF
  391. ELSE IF ( rk_order == 3 ) THEN ! third order Runge-Kutta
  392. IF ( rk_step == 1) THEN
  393. dt_rk = grid%dt/3.
  394. dts_rk = dt_rk
  395. number_of_small_timesteps = 1
  396. ELSE IF (rk_step == 2) THEN
  397. dt_rk = 0.5*grid%dt
  398. dts_rk = dts
  399. number_of_small_timesteps = num_sound_steps/2
  400. ELSE
  401. dt_rk = grid%dt
  402. dts_rk = dts
  403. number_of_small_timesteps = num_sound_steps
  404. ENDIF
  405. ELSE
  406. write(wrf_err_message,*)' unknown solver, error exit for dynamics_option = ',dynamics_option
  407. CALL wrf_error_fatal( wrf_err_message )
  408. END IF
  409. ! Ensure that polar meridional velocity is zero
  410. IF (config_flags%polar) THEN
  411. !$OMP PARALLEL DO &
  412. !$OMP PRIVATE ( ij )
  413. DO ij = 1 , grid%num_tiles
  414. CALL zero_pole ( grid%v_1, &
  415. ids, ide, jds, jde, kds, kde, &
  416. ims, ime, jms, jme, kms, kme, &
  417. grid%i_start(ij), grid%i_end(ij), &
  418. grid%j_start(ij), grid%j_end(ij), &
  419. k_start, k_end )
  420. CALL zero_pole ( grid%v_2, &
  421. ids, ide, jds, jde, kds, kde, &
  422. ims, ime, jms, jme, kms, kme, &
  423. grid%i_start(ij), grid%i_end(ij), &
  424. grid%j_start(ij), grid%j_end(ij), &
  425. k_start, k_end )
  426. END DO
  427. !$OMP END PARALLEL DO
  428. END IF
  429. !
  430. ! Time level t is in the *_2 variable in the first part
  431. ! of the step, and in the *_1 variable after the predictor.
  432. ! the latest predicted values are stored in the *_2 variables.
  433. !
  434. CALL wrf_debug ( 200 , ' call rk_step_prep ' )
  435. BENCH_START(step_prep_tim)
  436. !$OMP PARALLEL DO &
  437. !$OMP PRIVATE ( ij )
  438. DO ij = 1 , grid%num_tiles
  439. CALL rk_step_prep ( config_flags, rk_step, &
  440. grid%u_2, grid%v_2, grid%w_2, grid%t_2, grid%ph_2, grid%mu_2, &
  441. moist, &
  442. grid%ru, grid%rv, grid%rw, grid%ww, grid%php, grid%alt, grid%muu, grid%muv, &
  443. grid%mub, grid%mut, grid%phb, grid%pb, grid%p, grid%al, grid%alb, &
  444. cqu, cqv, cqw, &
  445. grid%msfux, grid%msfuy, grid%msfvx, grid%msfvx_inv, &
  446. grid%msfvy, grid%msftx, grid%msfty, &
  447. grid%fnm, grid%fnp, grid%dnw, grid%rdx, grid%rdy, &
  448. num_3d_m, &
  449. ids, ide, jds, jde, kds, kde, &
  450. ims, ime, jms, jme, kms, kme, &
  451. grid%i_start(ij), grid%i_end(ij), &
  452. grid%j_start(ij), grid%j_end(ij), &
  453. k_start, k_end )
  454. END DO
  455. !$OMP END PARALLEL DO
  456. BENCH_END(step_prep_tim)
  457. #ifdef DM_PARALLEL
  458. !-----------------------------------------------------------------------
  459. ! Stencils for patch communications (WCS, 29 June 2001)
  460. ! Note: the small size of this halo exchange reflects the
  461. ! fact that we are carrying the uncoupled variables
  462. ! as state variables in the mass coordinate model, as
  463. ! opposed to the coupled variables as in the height
  464. ! coordinate model.
  465. !
  466. ! * * * * *
  467. ! * * * * * * * * *
  468. ! * + * * + * * * + * *
  469. ! * * * * * * * * *
  470. ! * * * * *
  471. !
  472. ! 3D variables - note staggering! ru(X), rv(Y), ww(Z), php(Z)
  473. !
  474. ! ru x
  475. ! rv x
  476. ! ww x
  477. ! php x
  478. ! alt x
  479. ! ph_2 x
  480. ! phb x
  481. !
  482. ! the following are 2D (xy) variables
  483. !
  484. ! muu x
  485. ! muv x
  486. ! mut x
  487. !--------------------------------------------------------------
  488. # include "HALO_EM_A.inc"
  489. #endif
  490. ! set boundary conditions on variables
  491. ! from big_step_prep for use in big_step_proc
  492. #ifdef DM_PARALLEL
  493. # include "PERIOD_BDY_EM_A.inc"
  494. #endif
  495. BENCH_START(set_phys_bc_tim)
  496. !$OMP PARALLEL DO &
  497. !$OMP PRIVATE ( ij, ii, jj, kk )
  498. DO ij = 1 , grid%num_tiles
  499. CALL wrf_debug ( 200 , ' call rk_phys_bc_dry_1' )
  500. CALL rk_phys_bc_dry_1( config_flags, grid%ru, grid%rv, grid%rw, grid%ww, &
  501. grid%muu, grid%muv, grid%mut, grid%php, grid%alt, grid%p, &
  502. ids, ide, jds, jde, kds, kde, &
  503. ims, ime, jms, jme, kms, kme, &
  504. ips, ipe, jps, jpe, kps, kpe, &
  505. grid%i_start(ij), grid%i_end(ij), &
  506. grid%j_start(ij), grid%j_end(ij), &
  507. k_start, k_end )
  508. CALL set_physical_bc3d( grid%al, 'p', config_flags, &
  509. ids, ide, jds, jde, kds, kde, &
  510. ims, ime, jms, jme, kms, kme, &
  511. ips, ipe, jps, jpe, kps, kpe, &
  512. grid%i_start(ij), grid%i_end(ij), &
  513. grid%j_start(ij), grid%j_end(ij), &
  514. k_start , k_end )
  515. CALL set_physical_bc3d( grid%ph_2, 'w', config_flags, &
  516. ids, ide, jds, jde, kds, kde, &
  517. ims, ime, jms, jme, kms, kme, &
  518. ips, ipe, jps, jpe, kps, kpe, &
  519. grid%i_start(ij), grid%i_end(ij), &
  520. grid%j_start(ij), grid%j_end(ij), &
  521. k_start, k_end )
  522. IF (config_flags%polar) THEN
  523. !-------------------------------------------------------
  524. ! lat-lon grid pole-point (v) specification (extrapolate v, rv to the pole)
  525. !-------------------------------------------------------
  526. CALL pole_point_bc ( grid%v_1, &
  527. ids, ide, jds, jde, kds, kde, &
  528. ims, ime, jms, jme, kms, kme, &
  529. grid%i_start(ij), grid%i_end(ij), &
  530. grid%j_start(ij), grid%j_end(ij), &
  531. k_start, k_end )
  532. CALL pole_point_bc ( grid%v_2, &
  533. ids, ide, jds, jde, kds, kde, &
  534. ims, ime, jms, jme, kms, kme, &
  535. grid%i_start(ij), grid%i_end(ij), &
  536. grid%j_start(ij), grid%j_end(ij), &
  537. k_start, k_end )
  538. !-------------------------------------------------------
  539. ! end lat-lon grid pole-point (v) specification
  540. !-------------------------------------------------------
  541. ENDIF
  542. END DO
  543. !$OMP END PARALLEL DO
  544. BENCH_END(set_phys_bc_tim)
  545. rk_step_is_one : IF (rk_step == 1) THEN ! only need to initialize diffusion tendencies
  546. !<DESCRIPTION>
  547. !<pre>
  548. !(2) The non-timesplit physics begins with a call to "phy_prep"
  549. ! (which computes some diagnostic variables such as temperature,
  550. ! pressure, u and v at p points, etc). This is followed by
  551. ! calls to the physics drivers:
  552. !
  553. ! radiation,
  554. ! surface,
  555. ! pbl,
  556. ! cumulus,
  557. ! fddagd,
  558. ! 3D TKE and mixing.
  559. !<pre>
  560. !</DESCRIPTION>
  561. CALL first_rk_step_part1 ( grid, config_flags &
  562. , moist , moist_tend &
  563. , chem , chem_tend &
  564. , tracer, tracer_tend &
  565. , scalar , scalar_tend &
  566. , fdda3d, fdda2d &
  567. , ru_tendf, rv_tendf &
  568. , rw_tendf, t_tendf &
  569. , ph_tendf, mu_tendf &
  570. , tke_tend &
  571. , config_flags%use_adaptive_time_step &
  572. , curr_secs &
  573. , psim , psih , wspd , gz1oz0 &
  574. , br , chklowq &
  575. , cu_act_flag , hol , th_phy &
  576. , pi_phy , p_phy , grid%t_phy &
  577. , u_phy , v_phy &
  578. , dz8w , p8w , t8w , rho_phy , rho &
  579. , ids, ide, jds, jde, kds, kde &
  580. , ims, ime, jms, jme, kms, kme &
  581. , ips, ipe, jps, jpe, kps, kpe &
  582. , imsx, imex, jmsx, jmex, kmsx, kmex &
  583. , ipsx, ipex, jpsx, jpex, kpsx, kpex &
  584. , imsy, imey, jmsy, jmey, kmsy, kmey &
  585. , ipsy, ipey, jpsy, jpey, kpsy, kpey &
  586. , k_start , k_end &
  587. , f_flux &
  588. )
  589. #ifdef DM_PARALLEL
  590. IF ( config_flags%bl_pbl_physics == MYNNPBLSCHEME2 .OR. &
  591. config_flags%bl_pbl_physics == MYNNPBLSCHEME3 ) THEN
  592. # include "HALO_EM_SCALAR_E_5.inc"
  593. ENDIF
  594. #endif
  595. CALL first_rk_step_part2 ( grid, config_flags &
  596. , moist , moist_tend &
  597. , chem , chem_tend &
  598. , tracer, tracer_tend &
  599. , scalar , scalar_tend &
  600. , fdda3d, fdda2d &
  601. , ru_tendf, rv_tendf &
  602. , rw_tendf, t_tendf &
  603. , ph_tendf, mu_tendf &
  604. , tke_tend &
  605. , adapt_step_flag , curr_secs &
  606. , psim , psih , wspd , gz1oz0 &
  607. , br , chklowq &
  608. , cu_act_flag , hol , th_phy &
  609. , pi_phy , p_phy , grid%t_phy &
  610. , u_phy , v_phy &
  611. , dz8w , p8w , t8w , rho_phy , rho &
  612. , nba_mij, num_nba_mij & !JDM
  613. , nba_rij, num_nba_rij & !JDM
  614. , ids, ide, jds, jde, kds, kde &
  615. , ims, ime, jms, jme, kms, kme &
  616. , ips, ipe, jps, jpe, kps, kpe &
  617. , imsx, imex, jmsx, jmex, kmsx, kmex &
  618. , ipsx, ipex, jpsx, jpex, kpsx, kpex &
  619. , imsy, imey, jmsy, jmey, kmsy, kmey &
  620. , ipsy, ipey, jpsy, jpey, kpsy, kpey &
  621. , k_start , k_end &
  622. )
  623. END IF rk_step_is_one
  624. BENCH_START(rk_tend_tim)
  625. !$OMP PARALLEL DO &
  626. !$OMP PRIVATE ( ij )
  627. DO ij = 1 , grid%num_tiles
  628. CALL wrf_debug ( 200 , ' call rk_tendency' )
  629. CALL rk_tendency ( config_flags, rk_step &
  630. ,grid%ru_tend, grid%rv_tend, rw_tend, ph_tend, t_tend &
  631. ,ru_tendf, rv_tendf, rw_tendf, ph_tendf, t_tendf &
  632. ,mu_tend, grid%u_save, grid%v_save, w_save, ph_save &
  633. ,grid%t_save, mu_save, grid%rthften &
  634. ,grid%ru, grid%rv, grid%rw, grid%ww &
  635. ,grid%u_2, grid%v_2, grid%w_2, grid%t_2, grid%ph_2 &
  636. ,grid%u_1, grid%v_1, grid%w_1, grid%t_1, grid%ph_1 &
  637. ,grid%h_diabatic, grid%phb, grid%t_init &
  638. ,grid%mu_2, grid%mut, grid%muu, grid%muv, grid%mub &
  639. ,grid%al, grid%alt, grid%p, grid%pb, grid%php, cqu, cqv, cqw &
  640. ,grid%u_base, grid%v_base, grid%t_base, grid%qv_base, grid%z_base &
  641. ,grid%msfux,grid%msfuy, grid%msfvx, grid%msfvx_inv &
  642. ,grid%msfvy, grid%msftx,grid%msfty, grid%clat, grid%f, grid%e, grid%sina, grid%cosa &
  643. ,grid%fnm, grid%fnp, grid%rdn, grid%rdnw &
  644. ,grid%dt, grid%rdx, grid%rdy, grid%khdif, grid%kvdif, grid%xkmh, grid%xkhh &
  645. ,grid%diff_6th_opt, grid%diff_6th_factor &
  646. ,config_flags%momentum_adv_opt &
  647. ,grid%dampcoef,grid%zdamp,config_flags%damp_opt,config_flags%rad_nudge &
  648. ,grid%cf1, grid%cf2, grid%cf3, grid%cfn, grid%cfn1, num_3d_m &
  649. ,config_flags%non_hydrostatic, config_flags%top_lid &
  650. ,grid%u_frame, grid%v_frame &
  651. ,ids, ide, jds, jde, kds, kde &
  652. ,ims, ime, jms, jme, kms, kme &
  653. ,grid%i_start(ij), grid%i_end(ij) &
  654. ,grid%j_start(ij), grid%j_end(ij) &
  655. ,k_start, k_end &
  656. ,max_vert_cfl_tmp(ij), max_horiz_cfl_tmp(ij) )
  657. END DO
  658. !$OMP END PARALLEL DO
  659. BENCH_END(rk_tend_tim)
  660. IF (config_flags%use_adaptive_time_step) THEN
  661. DO ij = 1 , grid%num_tiles
  662. IF (max_horiz_cfl_tmp(ij) .GT. grid%max_horiz_cfl) THEN
  663. grid%max_horiz_cfl = max_horiz_cfl_tmp(ij)
  664. ENDIF
  665. IF (max_vert_cfl_tmp(ij) .GT. grid%max_vert_cfl) THEN
  666. grid%max_vert_cfl = max_vert_cfl_tmp(ij)
  667. ENDIF
  668. END DO
  669. IF (grid%max_horiz_cfl .GT. grid%max_cfl_val) THEN
  670. grid%max_cfl_val = grid%max_horiz_cfl
  671. ENDIF
  672. IF (grid%max_vert_cfl .GT. grid%max_cfl_val) THEN
  673. grid%max_cfl_val = grid%max_vert_cfl
  674. ENDIF
  675. ENDIF
  676. BENCH_START(relax_bdy_dry_tim)
  677. !$OMP PARALLEL DO &
  678. !$OMP PRIVATE ( ij )
  679. DO ij = 1 , grid%num_tiles
  680. IF( (config_flags%specified .or. config_flags%nested) .and. rk_step == 1 ) THEN
  681. CALL relax_bdy_dry ( config_flags, &
  682. grid%u_save, grid%v_save, ph_save, grid%t_save, &
  683. w_save, mu_tend, &
  684. grid%ru, grid%rv, grid%ph_2, grid%t_2, &
  685. grid%w_2, grid%mu_2, grid%mut, &
  686. grid%u_bxs,grid%u_bxe,grid%u_bys,grid%u_bye, &
  687. grid%v_bxs,grid%v_bxe,grid%v_bys,grid%v_bye, &
  688. grid%ph_bxs,grid%ph_bxe,grid%ph_bys,grid%ph_bye, &
  689. grid%t_bxs,grid%t_bxe,grid%t_bys,grid%t_bye, &
  690. grid%w_bxs,grid%w_bxe,grid%w_bys,grid%w_bye, &
  691. grid%mu_bxs,grid%mu_bxe,grid%mu_bys,grid%mu_bye, &
  692. grid%u_btxs,grid%u_btxe,grid%u_btys,grid%u_btye, &
  693. grid%v_btxs,grid%v_btxe,grid%v_btys,grid%v_btye, &
  694. grid%ph_btxs,grid%ph_btxe,grid%ph_btys,grid%ph_btye, &
  695. grid%t_btxs,grid%t_btxe,grid%t_btys,grid%t_btye, &
  696. grid%w_btxs,grid%w_btxe,grid%w_btys,grid%w_btye, &
  697. grid%mu_btxs,grid%mu_btxe,grid%mu_btys,grid%mu_btye, &
  698. config_flags%spec_bdy_width, grid%spec_zone, grid%relax_zone, &
  699. grid%dtbc, grid%fcx, grid%gcx, &
  700. ids,ide, jds,jde, kds,kde, &
  701. ims,ime, jms,jme, kms,kme, &
  702. ips,ipe, jps,jpe, kps,kpe, &
  703. grid%i_start(ij), grid%i_end(ij), &
  704. grid%j_start(ij), grid%j_end(ij), &
  705. k_start, k_end )
  706. ENDIF
  707. CALL rk_addtend_dry( grid%ru_tend, grid%rv_tend, rw_tend, ph_tend, t_tend, &
  708. ru_tendf, rv_tendf, rw_tendf, ph_tendf, t_tendf, &
  709. grid%u_save, grid%v_save, w_save, ph_save, grid%t_save, &
  710. mu_tend, mu_tendf, rk_step, &
  711. grid%h_diabatic, grid%mut, grid%msftx, &
  712. grid%msfty, grid%msfux,grid%msfuy, &
  713. grid%msfvx, grid%msfvx_inv, grid%msfvy, &
  714. ids,ide, jds,jde, kds,kde, &
  715. ims,ime, jms,jme, kms,kme, &
  716. ips,ipe, jps,jpe, kps,kpe, &
  717. grid%i_start(ij), grid%i_end(ij), &
  718. grid%j_start(ij), grid%j_end(ij), &
  719. k_start, k_end )
  720. IF( config_flags%specified .or. config_flags%nested ) THEN
  721. CALL spec_bdy_dry ( config_flags, &
  722. grid%ru_tend, grid%rv_tend, ph_tend, t_tend, &
  723. rw_tend, mu_tend, &
  724. grid%u_bxs,grid%u_bxe,grid%u_bys,grid%u_bye, &
  725. grid%v_bxs,grid%v_bxe,grid%v_bys,grid%v_bye, &
  726. grid%ph_bxs,grid%ph_bxe,grid%ph_bys,grid%ph_bye, &
  727. grid%t_bxs,grid%t_bxe,grid%t_bys,grid%t_bye, &
  728. grid%w_bxs,grid%w_bxe,grid%w_bys,grid%w_bye, &
  729. grid%mu_bxs,grid%mu_bxe,grid%mu_bys,grid%mu_bye, &
  730. grid%u_btxs,grid%u_btxe,grid%u_btys,grid%u_btye, &
  731. grid%v_btxs,grid%v_btxe,grid%v_btys,grid%v_btye, &
  732. grid%ph_btxs,grid%ph_btxe,grid%ph_btys,grid%ph_btye, &
  733. grid%t_btxs,grid%t_btxe,grid%t_btys,grid%t_btye, &
  734. grid%w_btxs,grid%w_btxe,grid%w_btys,grid%w_btye, &
  735. grid%mu_btxs,grid%mu_btxe,grid%mu_btys,grid%mu_btye, &
  736. config_flags%spec_bdy_width, grid%spec_zone, &
  737. ids,ide, jds,jde, kds,kde, & ! domain dims
  738. ims,ime, jms,jme, kms,kme, & ! memory dims
  739. ips,ipe, jps,jpe, kps,kpe, & ! patch dims
  740. grid%i_start(ij), grid%i_end(ij), &
  741. grid%j_start(ij), grid%j_end(ij), &
  742. k_start, k_end )
  743. ENDIF
  744. END DO
  745. !$OMP END PARALLEL DO
  746. BENCH_END(relax_bdy_dry_tim)
  747. !<DESCRIPTION>
  748. !<pre>
  749. ! (3) Small (acoustic,sound) steps.
  750. !
  751. ! Several acoustic steps are taken each RK pass. A small step
  752. ! sequence begins with calculating perturbation variables
  753. ! and coupling them to the column dry-air-mass mu
  754. ! (call to small_step_prep). This is followed by computing
  755. ! coefficients for the vertically implicit part of the
  756. ! small timestep (call to calc_coef_w).
  757. !
  758. ! The small steps are taken
  759. ! in the named loop "small_steps:". In the small_steps loop, first
  760. ! the horizontal momentum (u and v) are advanced (call to advance_uv),
  761. ! next mu and theta are advanced (call to advance_mu_t) followed by
  762. ! advancing w and the geopotential (call to advance_w). Diagnostic
  763. ! values for pressure and inverse density are updated at the end of
  764. ! each small_step.
  765. !
  766. ! The small-step section ends with the change of the perturbation variables
  767. ! back to full variables (call to small_step_finish).
  768. !</pre>
  769. !</DESCRIPTION>
  770. BENCH_START(small_step_prep_tim)
  771. !$OMP PARALLEL DO &
  772. !$OMP PRIVATE ( ij )
  773. DO ij = 1 , grid%num_tiles
  774. ! Calculate coefficients for the vertically implicit acoustic/gravity wave
  775. ! integration. We only need calculate these for the first pass through -
  776. ! the predictor step. They are reused as is for the corrector step.
  777. ! For third-order RK, we need to recompute these after the first
  778. ! predictor because we may have changed the small timestep -> grid%dts.
  779. CALL wrf_debug ( 200 , ' call small_step_prep ' )
  780. CALL small_step_prep( grid%u_1,grid%u_2,grid%v_1,grid%v_2,grid%w_1,grid%w_2, &
  781. grid%t_1,grid%t_2,grid%ph_1,grid%ph_2, &
  782. grid%mub, grid%mu_1, grid%mu_2, &
  783. grid%muu, muus, grid%muv, muvs, &
  784. grid%mut, grid%muts, grid%mudf, &
  785. grid%u_save, grid%v_save, w_save, &
  786. grid%t_save, ph_save, mu_save, &
  787. grid%ww, ww1, &
  788. grid%dnw, c2a, grid%pb, grid%p, grid%alt, &
  789. grid%msfux,grid%msfuy, grid%msfvx, grid%msfvx_inv, &
  790. grid%msfvy, grid%msftx,grid%msfty, &
  791. grid%rdx, grid%rdy, rk_step, &
  792. ids, ide, jds, jde, kds, kde, &
  793. ims, ime, jms, jme, kms, kme, &
  794. grid%i_start(ij), grid%i_end(ij), &
  795. grid%j_start(ij), grid%j_end(ij), &
  796. k_start , k_end )
  797. CALL calc_p_rho( grid%al, grid%p, grid%ph_2, &
  798. grid%alt, grid%t_2, grid%t_save, c2a, pm1, &
  799. grid%mu_2, grid%muts, grid%znu, t0, &
  800. grid%rdnw, grid%dnw, grid%smdiv, &
  801. config_flags%non_hydrostatic, 0, &
  802. ids, ide, jds, jde, kds, kde, &
  803. ims, ime, jms, jme, kms, kme, &
  804. grid%i_start(ij), grid%i_end(ij), &
  805. grid%j_start(ij), grid%j_end(ij), &
  806. k_start , k_end )
  807. IF (config_flags%non_hydrostatic) THEN
  808. CALL calc_coef_w( a,alpha,gamma, &
  809. grid%mut, cqw, &
  810. grid%rdn, grid%rdnw, c2a, &
  811. dts_rk, g, grid%epssm, &
  812. config_flags%top_lid, &
  813. ids, ide, jds, jde, kds, kde, &
  814. ims, ime, jms, jme, kms, kme, &
  815. grid%i_start(ij), grid%i_end(ij), &
  816. grid%j_start(ij), grid%j_end(ij), &
  817. k_start , k_end )
  818. ENDIF
  819. ENDDO
  820. !$OMP END PARALLEL DO
  821. BENCH_END(small_step_prep_tim)
  822. #ifdef DM_PARALLEL
  823. !-----------------------------------------------------------------------
  824. ! Stencils for patch communications (WCS, 29 June 2001)
  825. ! Note: the small size of this halo exchange reflects the
  826. ! fact that we are carrying the uncoupled variables
  827. ! as state variables in the mass coordinate model, as
  828. ! opposed to the coupled variables as in the height
  829. ! coordinate model.
  830. !
  831. ! * * * * *
  832. ! * * * * * * * * *
  833. ! * + * * + * * * + * *
  834. ! * * * * * * * * *
  835. ! * * * * *
  836. !
  837. ! 3D variables - note staggering! ph_2(Z), u_save(X), v_save(Y)
  838. !
  839. ! ph_2 x
  840. ! al x
  841. ! p x
  842. ! t_1 x
  843. ! t_save x
  844. ! u_save x
  845. ! v_save x
  846. !
  847. ! the following are 2D (xy) variables
  848. !
  849. ! mu_1 x
  850. ! mu_2 x
  851. ! mudf x
  852. ! php x
  853. ! alt x
  854. ! pb x
  855. !--------------------------------------------------------------
  856. # include "HALO_EM_B.inc"
  857. # include "PERIOD_BDY_EM_B.inc"
  858. #endif
  859. BENCH_START(set_phys_bc2_tim)
  860. !$OMP PARALLEL DO &
  861. !$OMP PRIVATE ( ij )
  862. DO ij = 1 , grid%num_tiles
  863. CALL set_physical_bc3d( grid%ru_tend, 'u', config_flags, &
  864. ids, ide, jds, jde, kds, kde, &
  865. ims, ime, jms, jme, kms, kme, &
  866. ips, ipe, jps, jpe, kps, kpe, &
  867. grid%i_start(ij), grid%i_end(ij), &
  868. grid%j_start(ij), grid%j_end(ij), &
  869. k_start , k_end )
  870. CALL set_physical_bc3d( grid%rv_tend, 'v', config_flags, &
  871. ids, ide, jds, jde, kds, kde, &
  872. ims, ime, jms, jme, kms, kme, &
  873. ips, ipe, jps, jpe, kps, kpe, &
  874. grid%i_start(ij), grid%i_end(ij), &
  875. grid%j_start(ij), grid%j_end(ij), &
  876. k_start , k_end )
  877. CALL set_physical_bc3d( grid%ph_2, 'w', config_flags, &
  878. ids, ide, jds, jde, kds, kde, &
  879. ims, ime, jms, jme, kms, kme, &
  880. ips, ipe, jps, jpe, kps, kpe, &
  881. grid%i_start(ij), grid%i_end(ij), &
  882. grid%j_start(ij), grid%j_end(ij), &
  883. k_start , k_end )
  884. CALL set_physical_bc3d( grid%al, 'p', config_flags, &
  885. ids, ide, jds, jde, kds, kde, &
  886. ims, ime, jms, jme, kms, kme, &
  887. ips, ipe, jps, jpe, kps, kpe, &
  888. grid%i_start(ij), grid%i_end(ij), &
  889. grid%j_start(ij), grid%j_end(ij), &
  890. k_start , k_end )
  891. CALL set_physical_bc3d( grid%p, 'p', config_flags, &
  892. ids, ide, jds, jde, kds, kde, &
  893. ims, ime, jms, jme, kms, kme, &
  894. ips, ipe, jps, jpe, kps, kpe, &
  895. grid%i_start(ij), grid%i_end(ij), &
  896. grid%j_start(ij), grid%j_end(ij), &
  897. k_start , k_end )
  898. CALL set_physical_bc3d( grid%t_1, 'p', config_flags, &
  899. ids, ide, jds, jde, kds, kde, &
  900. ims, ime, jms, jme, kms, kme, &
  901. ips, ipe, jps, jpe, kps, kpe, &
  902. grid%i_start(ij), grid%i_end(ij), &
  903. grid%j_start(ij), grid%j_end(ij), &
  904. k_start , k_end )
  905. CALL set_physical_bc3d( grid%t_save, 't', config_flags, &
  906. ids, ide, jds, jde, kds, kde, &
  907. ims, ime, jms, jme, kms, kme, &
  908. ips, ipe, jps, jpe, kps, kpe, &
  909. grid%i_start(ij), grid%i_end(ij), &
  910. grid%j_start(ij), grid%j_end(ij), &
  911. k_start , k_end )
  912. CALL set_physical_bc2d( grid%mu_1, 't', config_flags, &
  913. ids, ide, jds, jde, &
  914. ims, ime, jms, jme, &
  915. ips, ipe, jps, jpe, &
  916. grid%i_start(ij), grid%i_end(ij), &
  917. grid%j_start(ij), grid%j_end(ij) )
  918. CALL set_physical_bc2d( grid%mu_2, 't', config_flags, &
  919. ids, ide, jds, jde, &
  920. ims, ime, jms, jme, &
  921. ips, ipe, jps, jpe, &
  922. grid%i_start(ij), grid%i_end(ij), &
  923. grid%j_start(ij), grid%j_end(ij) )
  924. CALL set_physical_bc2d( grid%mudf, 't', config_flags, &
  925. ids, ide, jds, jde,

Large files files are truncated, but you can click here to view the full file