1 | ! WRF:MEDIATION_LAYER:FIRE_MODEL |
---|
2 | |
---|
3 | |
---|
4 | #define DEBUG_OUT |
---|
5 | |
---|
6 | module module_fr_sfire_driver_wrf |
---|
7 | ! wrf-specific driver |
---|
8 | |
---|
9 | use module_fr_sfire_driver |
---|
10 | use module_fr_sfire_atm |
---|
11 | implicit none |
---|
12 | |
---|
13 | contains |
---|
14 | |
---|
15 | subroutine sfire_driver_em_init (grid , config_flags & |
---|
16 | ,ids,ide, kds,kde, jds,jde & |
---|
17 | ,ims,ime, kms,kme, jms,jme & |
---|
18 | ,ips,ipe, kps,kpe, jps,jpe) |
---|
19 | |
---|
20 | ! stub to call sfire_driver_em with irun=0 and omit last 3 args |
---|
21 | |
---|
22 | USE module_domain , only: domain , get_ijk_from_subgrid |
---|
23 | USE module_configure , only : grid_config_rec_type |
---|
24 | implicit none |
---|
25 | |
---|
26 | TYPE(domain) , TARGET :: grid ! data |
---|
27 | TYPE (grid_config_rec_type) , INTENT(IN) :: config_flags |
---|
28 | integer, intent(in):: & |
---|
29 | ids,ide, kds,kde, jds,jde & |
---|
30 | ,ims,ime, kms,kme, jms,jme & |
---|
31 | ,ips,ipe, kps,kpe, jps,jpe |
---|
32 | |
---|
33 | ! local |
---|
34 | integer :: & ! fire mesh sizes |
---|
35 | ifds,ifde, kfds,kfde, jfds,jfde, & |
---|
36 | ifms,ifme, kfms,kfme, jfms,jfme, & |
---|
37 | ifps,ifpe, kfps,kfpe, jfps,jfpe |
---|
38 | ! dummies |
---|
39 | |
---|
40 | real,dimension(1,1,1)::rho,z_at_w,dz8w |
---|
41 | |
---|
42 | call message('sfire_driver_em_init: SFIRE initialization start') |
---|
43 | |
---|
44 | ! get fire mesh dimensions |
---|
45 | CALL get_ijk_from_subgrid ( grid , & |
---|
46 | ifds,ifde, jfds,jfde,kfds,kfde, & |
---|
47 | ifms,ifme, jfms,jfme,kfms,kfme, & |
---|
48 | ifps,ifpe, jfps,jfpe,kfps,kfpe) |
---|
49 | |
---|
50 | call sfire_driver_em ( grid , config_flags & |
---|
51 | ,1,3,0 & ! ifun start, end, test steps |
---|
52 | ,ids,ide, kds,kde, jds,jde & |
---|
53 | ,ims,ime, kms,kme, jms,jme & |
---|
54 | ,ips,ipe, kps,kpe, jps,jpe & |
---|
55 | ,ifds,ifde, jfds,jfde & |
---|
56 | ,ifms,ifme, jfms,jfme & |
---|
57 | ,ifps,ifpe, jfps,jfpe & |
---|
58 | ) |
---|
59 | |
---|
60 | call message('sfire_driver_em_init: SFIRE initialization complete') |
---|
61 | |
---|
62 | end subroutine sfire_driver_em_init |
---|
63 | |
---|
64 | ! |
---|
65 | !*** |
---|
66 | ! |
---|
67 | |
---|
68 | subroutine sfire_driver_em_step (grid , config_flags & |
---|
69 | ,ids,ide, kds,kde, jds,jde & |
---|
70 | ,ims,ime, kms,kme, jms,jme & |
---|
71 | ,ips,ipe, kps,kpe, jps,jpe & |
---|
72 | ,rho,z_at_w,dz8w ) |
---|
73 | |
---|
74 | ! stub to call sfire_driver_em |
---|
75 | |
---|
76 | USE module_domain, only: domain , get_ijk_from_subgrid |
---|
77 | USE module_configure , only : grid_config_rec_type |
---|
78 | USE module_fr_sfire_util, only : fire_test_steps |
---|
79 | implicit none |
---|
80 | |
---|
81 | TYPE(domain) , TARGET :: grid ! data |
---|
82 | TYPE (grid_config_rec_type) , INTENT(IN) :: config_flags |
---|
83 | integer, intent(in):: & |
---|
84 | ids,ide, kds,kde, jds,jde & |
---|
85 | ,ims,ime, kms,kme, jms,jme & |
---|
86 | ,ips,ipe, kps,kpe, jps,jpe |
---|
87 | real,dimension(ims:ime, kms:kme, jms:jme),intent(in)::rho,z_at_w,dz8w |
---|
88 | |
---|
89 | ! local |
---|
90 | integer :: & ! fire mesh sizes |
---|
91 | ifds,ifde, kfds,kfde, jfds,jfde, & |
---|
92 | ifms,ifme, kfms,kfme, jfms,jfme, & |
---|
93 | ifps,ifpe, kfps,kfpe, jfps,jfpe |
---|
94 | integer :: its,ite,jts,jte,kts,kte ! atm tile |
---|
95 | integer:: ij |
---|
96 | |
---|
97 | call message('sfire_driver_em_step: SFIRE step start') |
---|
98 | |
---|
99 | ! get fire mesh dimensions |
---|
100 | CALL get_ijk_from_subgrid ( grid , & |
---|
101 | ifds,ifde, jfds,jfde,kfds,kfde, & |
---|
102 | ifms,ifme, jfms,jfme,kfms,kfme, & |
---|
103 | ifps,ifpe, jfps,jfpe,kfps,kfpe) |
---|
104 | |
---|
105 | call sfire_driver_em ( grid , config_flags & |
---|
106 | ,3,6,fire_test_steps & |
---|
107 | ,ids,ide, kds,kde, jds,jde & |
---|
108 | ,ims,ime, kms,kme, jms,jme & |
---|
109 | ,ips,ipe, kps,kpe, jps,jpe & |
---|
110 | ,ifds,ifde, jfds,jfde & |
---|
111 | ,ifms,ifme, jfms,jfme & |
---|
112 | ,ifps,ifpe, jfps,jfpe & |
---|
113 | ) |
---|
114 | |
---|
115 | ! --- add heat and moisture fluxes to tendency variables by postulated decay |
---|
116 | do ij=1,grid%num_tiles |
---|
117 | ! SFIRE works on domain by 1 smaller, in last row&col winds are not set properly |
---|
118 | its = grid%i_start(ij) ! start atmospheric tile in i |
---|
119 | ite = min(grid%i_end(ij),ide-1) ! end atmospheric tile in i |
---|
120 | jts = grid%j_start(ij) ! start atmospheric tile in j |
---|
121 | jte = min(grid%j_end(ij),jde-1) ! end atmospheric tile in j |
---|
122 | kts=kds |
---|
123 | kte=kde |
---|
124 | |
---|
125 | call fire_tendency( & |
---|
126 | ids,ide-1, kds,kde, jds,jde-1, & ! domain dimensions |
---|
127 | ims,ime, kms,kme, jms,jme, & |
---|
128 | its,ite, kts,kte, jts,jte, & ! |
---|
129 | grid%grnhfx,grid%grnqfx,grid%canhfx,grid%canqfx, & ! fluxes on atm grid |
---|
130 | config_flags%fire_ext_grnd,config_flags%fire_ext_crwn,config_flags%fire_crwn_hgt, & |
---|
131 | grid%ht,z_at_w,dz8w,grid%mut,rho, & |
---|
132 | grid%rthfrten,grid%rqvfrten) ! out |
---|
133 | |
---|
134 | enddo |
---|
135 | |
---|
136 | ! debug print to compare |
---|
137 | |
---|
138 | call print_3d_stats(its,ite,kts,kte,jts,jte,ims,ime,kms,kme,jms,jme,grid%rthfrten,'fire_driver_phys:rthfrten') |
---|
139 | call print_3d_stats(its,ite,kts,kte,jts,jte,ims,ime,kms,kme,jms,jme,grid%rqvfrten,'fire_driver_phys:rqvfrten') |
---|
140 | |
---|
141 | call message('sfire_driver_em_step: SFIRE step complete') |
---|
142 | |
---|
143 | end subroutine sfire_driver_em_step |
---|
144 | |
---|
145 | end module module_fr_sfire_driver_wrf |
---|
146 | |
---|