-
Notifications
You must be signed in to change notification settings - Fork 18
/
module_fr_sfire_phys.F
843 lines (734 loc) · 31.7 KB
/
module_fr_sfire_phys.F
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
!
!*** Jan Mandel August-October 2007 email: jmandel@ucar.edu or Jan.Mandel@gmail.com
!
! This file contains parts copied and/or adapted from earlier codes by
! Terry Clark, Janice Coen, Don Latham, and Net Patton.
module module_fr_sfire_phys
use module_model_constants, only: cp,xlv
use module_fr_sfire_util
PRIVATE
! subroutines and functions
PUBLIC:: init_fuel_cats,fire_ros,heat_fluxes,set_nfuel_cat,set_fire_params,write_fuels_m
! types
PUBLIC::fire_params
! variables
PUBLIC:: fire_wind_height
! arrays passed to fire_ros
type fire_params
real,pointer,dimension(:,:):: vx,vy ! wind velocity (m/s)
real,pointer,dimension(:,:):: zsf ! terrain height (m)
real,pointer,dimension(:,:):: dzdxf,dzdyf ! terrain grad (1)
real,pointer,dimension(:,:):: bbb,betafl,phiwc,r_0 ! spread formula coefficients
real,pointer,dimension(:,:):: fgip ! init mass of surface fuel (kg/m^2)
real,pointer,dimension(:,:):: ischap ! 1 if chapparal
end type fire_params
! use as
! type(fire_params)::fp
! Following table copied from module_fr_cawfe_fuel by Ned Patton with minor changes.
! Based on: Clark, T. L., J. L. Coen and D. Latham: 2004,
! "Description of a coupled atmosphere-fire model",
! International Journal of Wildland Fire, 13, 49-63.
!
! edited by Jan Mandel jmandel@ucar.edu September 2007
!
! - moved all fuel related constants and the initialization subroutine here
! - copied descriptions for fuel categories from fire_sfc.m4 in the original CAWFE code
! This file had to be copied under a new name because packages in wrf physics
! layer are not allowed to call each other.
!D in col 2 means quantity derived from the others
!
! Scalar constants (data same for all fuel categories):
! HFGL SURFACE FIRE HEAT FLUX THRESHOLD TO IGNITE CANOPY (W/m^2)
! CMBCNST JOULES PER KG OF DRY FUEL
! FUELHEAT FUEL PARTICLE LOW HEAT CONTENT, BTU/LB
! FUELMC_G FUEL PARTICLE (SURFACE) MOISTURE CONTENT
!D BMST RATIO OF LATENT TO SENSIBLE HEAT FROM SFC BURN:
! % of total fuel mass that is water (not quite
! = % fuel moisture). BMST= (H20)/(H20+DRY)
! so BMST = FUELMC_G / (1 + FUELMC_G) where
! FUELMC_G = ground fuel moisture
!
! Data arrays indexed by fuel category:
! FGI INITIAL TOTAL MASS OF SURFACE FUEL (KG/M**2)
! FUELDEPTHM FUEL DEPTH, IN M (CONVERTED TO FT)
! SAVR FUEL PARTICLE SURFACE-AREA-TO-VOLUME RATIO, 1/FT
! GRASS: 3500., 10 hr fuel: 109., 100 hr fuel: 30.
! FUELMCE MOISTURE CONTENT OF EXTINCTION; 0.30 FOR MANY DEAD FUELS; 0.15 FOR GRASS
! FUELDENS OVENDRY PARTICLE DENSITY, LB/FT^3
! ST FUEL PARTICLE TOTAL MINERAL CONTENT
! SE FUEL PARTICLE EFFECTIVE MINERAL CONTENT
! WEIGHT WEIGHTING PARAMETER THAT DETERMINES THE SLOPE OF THE MASS LOSS CURVE
! RANGES FROM ~5 (FAST BURNUP) TO 1000 ( ~40% DECR OVER 10 MIN).
! FCI_D INITIAL DRY MASS OF CANOPY FUEL
! FCT BURN OUT TIME FOR CANOPY FUEL, AFTER DRY (S)
! ichap 1 if chaparral, 0 if not
!D FCI INITIAL TOTAL MASS OF CANOPY FUEL
!D FCBR FUEL CANOPY BURN RATE (KG/M**2/S)
! =============================================================================
! Standard 13 fire behavior fuel models (for surface fires), along with some
! estimated canopy properties (for crown fire).
! =============================================================================
! FUEL MODEL 1: Short grass (1 ft)
! FUEL MODEL 2: Timber (grass and understory)
! FUEL MODEL 3: Tall grass (2.5 ft)
! FUEL MODEL 4: Chaparral (6 ft)
! FUEL MODEL 5: Brush (2 ft)
! FUEL MODEL 6: Dormant brush, hardwood slash
! FUEL MODEL 7: Southern rough
! FUEL MODEL 8: Closed timber litter
! FUEL MODEL 9: Hardwood litter
! FUEL MODEL 10: Timber (litter + understory)
! FUEL MODEL 11: Light logging slash
! FUEL MODEL 12: Medium logging slash
! FUEL MODEL 13: Heavy logging slash
! FUEL MODEL 14: no fuel
!
! scalar fuel coefficients
REAL, SAVE:: cmbcnst,hfgl,fuelmc_g,fuelmc_c, fire_wind_height
! computed values
REAL, SAVE:: bmst,fuelheat
! defaults, may be changed in init_fuel_cats
DATA cmbcnst / 17.433e+06/ ! J/kg dry fuel
DATA hfgl / 17.e4 / ! W/m^2
DATA fuelmc_g / 0.08 / ! set = 0 for dry ground fuel
DATA fuelmc_c / 1.00 / ! set = 0 for dry canopy
DATA fire_wind_height/0./ ! m, 6.1m Behave, 0 to use fcwh in each category
! REAL, PARAMETER :: bmst = fuelmc_g/(1+fuelmc_g)
! REAL, PARAMETER :: fuelheat = cmbcnst * 4.30e-04 ! convert J/kg to BTU/lb
! real, parameter :: xlv = 2.5e6 ! to make it selfcontained
! real, parameter :: cp = 7.*287./2 ! to make it selfcontained
! fuel categorytables
INTEGER, PARAMETER :: nf=14 ! fuel cats in data stmts, for fillers only`
INTEGER, SAVE :: nfuelcats = 13 ! number of fuel categories,
INTEGER, PARAMETER :: mfuelcats = 30 ! number of fuel categories
INTEGER, PARAMETER :: zf = mfuelcats-nf ! number of zero fillers in data stmt
INTEGER, SAVE :: no_fuel_cat = 14 ! special category outside of 1:nfuelcats
CHARACTER (len=80), DIMENSION(mfuelcats ), save :: fuel_name
INTEGER, DIMENSION( mfuelcats ), save :: ichap
REAL , DIMENSION( mfuelcats ), save :: windrf,weight,fgi,fci,fci_d,fct,fcbr, &
fueldepthm,fueldens,fuelmce, &
savr,st,se,fcwh,fcz0
DATA windrf /0.36, 0.36, 0.44, 0.55, 0.42, 0.44, 0.44, &
0.36, 0.36, 0.36, 0.36, 0.43, 0.46, 1e-7, zf*0 / ! added jmandel October 2010
DATA fgi / 0.166, 0.897, 0.675, 2.468, 0.785, 1.345, 1.092, &
1.121, 0.780, 2.694, 2.582, 7.749, 13.024, 1.e-7, zf*0. /
DATA fueldepthm /0.305, 0.305, 0.762, 1.829, 0.61, 0.762,0.762, &
0.0610, 0.0610, 0.305, 0.305, 0.701, 0.914, 0.305,zf*0. /
DATA savr / 3500., 2784., 1500., 1739., 1683., 1564., 1562., &
1889., 2484., 1764., 1182., 1145., 1159., 3500., zf*0. /
DATA fuelmce / 0.12, 0.15, 0.25, 0.20, 0.20, 0.25, 0.40, &
0.30, 0.25, 0.25, 0.15, 0.20, 0.25, 0.12 , zf*0. /
DATA fueldens / nf * 32., zf*0. / ! 32 if solid, 19 if rotten.
DATA st / nf* 0.0555 , zf*0./
DATA se / nf* 0.010 , zf*0./
! ----- Notes on weight: (4) - best fit of Latham data;
! (5)-(7) could be 60-120; (8)-(10) could be 300-1600;
! (11)-(13) could be 300-1600
DATA weight / 7., 7., 7., 180., 100., 100., 100., &
900., 900., 900., 900., 900., 900., 7. , zf*0./
! ----- 1.12083 is 5 tons/acre. 5-50 tons/acre orig., 100-300 after blowdown
DATA fci_d / 0., 0., 0., 1.123, 0., 0., 0., &
1.121, 1.121, 1.121, 1.121, 1.121, 1.121, 0., zf*0./
DATA fct / 60., 60., 60., 60., 60., 60., 60., &
60., 120., 180., 180., 180., 180. , 60. , zf*0. /
DATA ichap / 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 , zf*0/
DATA fcwh /0.6 , 0.6, 1.5, 36, 1.2, 1.5, 1.5, &
0.12, 0.12, 0.6, 0.6, 1.38, 1.8, 1.8, zf*0 / ! fuel wind height, added jm 2/23/11
DATA fcz0 /0.3, 0.3, 0.75, 18., 0.6, 0.75, 0.75, &
0.06, 0.06, 0.3, 0.3, 0.69, 0.9, 0.9, zf*0 / ! fuel roughness height, added jm 2/23/11
! =========================================================================
contains
subroutine init_fuel_cats
implicit none
!*** purpose: initialize fuel tables and variables by constants
!*** arguments: none
logical, external:: wrf_dm_on_monitor
!$ integer, external:: OMP_GET_THREAD_NUM
!*** local
integer:: i,j,k,ii,iounit
character(len=128):: msg
!*** executable
! read
namelist /fuel_scalars/ cmbcnst,hfgl,fuelmc_g,fuelmc_c,nfuelcats,no_fuel_cat,fire_wind_height
namelist /fuel_categories/ fuel_name,windrf,fgi,fueldepthm,savr, &
fuelmce,fueldens,st,se,weight,fci_d,fct,ichap,fcwh,fcz0
!$ if (OMP_GET_THREAD_NUM() .ne. 0)then
!$ call crash('init_fuel_cats: must be called from master thread')
!$ endif
IF ( wrf_dm_on_monitor() ) THEN
! if we are the master task, read the file
iounit=open_text_file('namelist.fire','read')
read(iounit,fuel_scalars)
read(iounit,fuel_categories)
CLOSE(iounit)
if (nfuelcats>mfuelcats) then
write(msg,*)'nfuelcats=',nfuelcats,' too large, increase mfuelcats'
call crash(msg)
endif
if (no_fuel_cat >= 1 .and. no_fuel_cat <= nfuelcats)then
write(msg,*)'no_fuel_cat=',no_fuel_cat,' may not be between 1 and nfuelcats=',nfuelcats
call crash(msg)
endif
ENDIF
! broadcast the contents of the file
call wrf_dm_bcast_real(cmbcnst,1)
call wrf_dm_bcast_real(hfgl,1)
call wrf_dm_bcast_real(fuelmc_g,1)
call wrf_dm_bcast_real(fuelmc_c,1)
call wrf_dm_bcast_real(fire_wind_height,1)
call wrf_dm_bcast_integer(nfuelcats,1)
call wrf_dm_bcast_integer(no_fuel_cat,1)
call wrf_dm_bcast_real(windrf, nfuelcats)
call wrf_dm_bcast_real(fgi, nfuelcats)
call wrf_dm_bcast_real(fueldepthm,nfuelcats)
call wrf_dm_bcast_real(savr, nfuelcats)
call wrf_dm_bcast_real(fuelmce, nfuelcats)
call wrf_dm_bcast_real(fueldens, nfuelcats)
call wrf_dm_bcast_real(st, nfuelcats)
call wrf_dm_bcast_real(se, nfuelcats)
call wrf_dm_bcast_real(weight, nfuelcats)
call wrf_dm_bcast_real(fci_d, nfuelcats)
call wrf_dm_bcast_real(fct, nfuelcats)
call wrf_dm_bcast_integer(ichap, nfuelcats)
call wrf_dm_bcast_integer(fcwh, nfuelcats)
call wrf_dm_bcast_integer(fcz0, nfuelcats)
! compute derived scalars
bmst = fuelmc_g/(1+fuelmc_g)
fuelheat = cmbcnst * 4.30e-04 ! convert J/kg to BTU/lb
! compute derived fuel category coefficients
DO i = 1,nfuelcats
fci(i) = (1.+fuelmc_c)*fci_d(i)
if(fct(i) .ne. 0.)then
fcbr(i) = fci_d(i)/fct(i) ! to avoid division by zero
else
fcbr(i) = 0
endif
END DO
if(.not. fire_wind_height>0)then
! reset wind reduction factors
do i=1,nfuelcats
windrf(i)=1.
enddo
endif
! prints
call message('**********************************************************')
call message('FUEL COEFFICIENTS')
write(msg,8)'cmbcnst ',cmbcnst
call message(msg)
write(msg,8)'hfgl ',hfgl
call message(msg)
write(msg,8)'fuelmc_g ',fuelmc_g
call message(msg)
write(msg,8)'fuelmc_c ',fuelmc_c
call message(msg)
write(msg,8)'bmst ',bmst
call message(msg)
write(msg,8)'fuelheat ',fuelheat
call message(msg)
write(msg,7)'nfuelcats ',nfuelcats
call message(msg)
write(msg,7)'no_fuel_cat',no_fuel_cat
call message(msg)
j=1
7 format(a,5(1x,i8,4x))
8 format(a,5(1x,g12.5e2))
9 format(a,5(1x,a))
do i=1,nfuelcats,j
k=min(i+j-1,nfuelcats)
call message(' ')
write(msg,7)'CATEGORY ',(ii,ii=i,k)
call message(msg)
write(msg,9)'fuel name ',(fuel_name(ii),ii=i,k)
call message(msg)
write(msg,8)'windrf ',(windrf(ii),ii=i,k)
call message(msg)
write(msg,8)'fgi ',(fgi(ii),ii=i,k)
call message(msg)
write(msg,8)'fueldepthm',(fueldepthm(ii),ii=i,k)
call message(msg)
write(msg,8)'savr ',(savr(ii),ii=i,k)
call message(msg)
write(msg,8)'fuelmce ',(fuelmce(ii),ii=i,k)
call message(msg)
write(msg,8)'fueldens ',(fueldens(ii),ii=i,k)
call message(msg)
write(msg,8)'st ',(st(ii),ii=i,k)
call message(msg)
write(msg,8)'se ',(se(ii),ii=i,k)
call message(msg)
write(msg,8)'weight ',(weight(ii),ii=i,k)
call message(msg)
write(msg,8)'fci_d ',(fci_d(ii),ii=i,k)
call message(msg)
write(msg,8)'fct ',(fct(ii),ii=i,k)
call message(msg)
write(msg,7)'ichap ',(ichap(ii),ii=i,k)
call message(msg)
write(msg,8)'fci ',(fci(ii),ii=i,k)
call message(msg)
write(msg,8)'fcbr ',(fcbr(ii),ii=i,k)
call message(msg)
enddo
call message('**********************************************************')
! and print to file
IF ( wrf_dm_on_monitor() ) THEN
call write_fuels_m(61,30.,1.)
ENDIF
end subroutine init_fuel_cats
subroutine write_fuels_m(nsteps,maxwind,maxslope)
implicit none
integer, intent(in):: nsteps ! number of steps for speed computation
real, intent(in):: maxwind,maxslope ! computer from zero to these
integer:: iounit,k,j,i
type(fire_params)::fp
!type fire_params
!real,pointer,dimension(:,:):: vx,vy ! wind velocity (m/s)
!real,pointer,dimension(:,:):: zsf ! terrain height (m)
!real,pointer,dimension(:,:):: dzdxf,dzdyf ! terrain grad (1)
!real,pointer,dimension(:,:):: bbb,betafl,phiwc,r_0 ! spread formula coefficients
!real,pointer,dimension(:,:):: fgip ! init mass of surface fuel (kg/m^2)
!real,pointer,dimension(:,:):: ischap ! 1 if chapparal
!end type fire_params
real, dimension(1:2,1:nsteps), target::vx,vy,zsf,dzdxf,dzdyf,bbb,betafl,phiwc,r_0,fgip,ischap
real, dimension(1:2,1:nsteps)::nfuel_cat,fuel_time,ros,fwh,fz0
real::ros_back,ros_wind,ros_slope,propx,propy,r
fp%vx=>vx
fp%vy=>vy
fp%dzdxf=>dzdxf
fp%dzdyf=>dzdyf
fp%bbb=>bbb
fp%betafl=>betafl
fp%phiwc=>phiwc
fp%r_0=>r_0
fp%fgip=>fgip
fp%ischap=>ischap
iounit = open_text_file('fuels.m','write')
10 format('fuel(',i3,').',a,'=',"'",a,"'",';% ',a)
do k=1,nfuelcats
write(iounit,10)k,'fuel_name',trim(fuel_name(k)),'FUEL MODEL NAME'
call write_var(k,'windrf',windrf(k),'WIND REDUCTION FACTOR FROM 20ft TO MIDFLAME HEIGHT' )
call write_var(k,'fgi',fgi(k),'INITIAL TOTAL MASS OF SURFACE FUEL (KG/M**2)' )
call write_var(k,'fueldepthm',fueldepthm(k),'FUEL DEPTH (M)')
call write_var(k,'savr',savr(k),'FUEL PARTICLE SURFACE-AREA-TO-VOLUME RATIO, 1/FT')
call write_var(k,'fuelmce',fuelmce(k),'MOISTURE CONTENT OF EXTINCTION')
call write_var(k,'fueldens',fueldens(k),'OVENDRY PARTICLE DENSITY, LB/FT^3')
call write_var(k,'st',st(k),'FUEL PARTICLE TOTAL MINERAL CONTENT')
call write_var(k,'se',se(k),'FUEL PARTICLE EFFECTIVE MINERAL CONTENT')
call write_var(k,'weight',weight(k),'WEIGHTING PARAMETER THAT DETERMINES THE SLOPE OF THE MASS LOSS CURVE')
call write_var(k,'fci_d',fci_d(k),'INITIAL DRY MASS OF CANOPY FUEL')
call write_var(k,'fct',fct(k),'BURN OUT TIME FOR CANOPY FUEL, AFTER DRY (S)')
call write_var(k,'ichap',float(ichap(k)),'1 if chaparral, 0 if not')
call write_var(k,'fci',fci(k),'INITIAL TOTAL MASS OF CANOPY FUEL')
call write_var(k,'fcbr',fcbr(k),'FUEL CANOPY BURN RATE (KG/M**2/S)')
call write_var(k,'hfgl',hfgl,'SURFACE FIRE HEAT FLUX THRESHOLD TO IGNITE CANOPY (W/m^2)')
call write_var(k,'cmbcnst',cmbcnst,'JOULES PER KG OF DRY FUEL')
call write_var(k,'fuelheat',fuelheat,'FUEL PARTICLE LOW HEAT CONTENT, BTU/LB')
call write_var(k,'fuelmc_g',fuelmc_g,'FUEL PARTICLE (SURFACE) MOISTURE CONTENT')
call write_var(k,'fuelmc_c',fuelmc_c,'FUEL PARTICLE (CANOPY) MOISTURE CONTENT')
! set up fuel arrays
!subroutine set_fire_params( &
! ifds,ifde,jfds,jfde, &
! ifms,ifme,jfms,jfme, &
! ifts,ifte,jfts,jfte, &
! fdx,fdy,nfuel_cat0, &
! nfuel_cat,fuel_time, &
! fp )
nfuel_cat = k
call set_fire_params( &
1,2,1,nsteps, &
1,2,1,nsteps, &
1,2,1,nsteps, &
0.,0.,k, &
nfuel_cat,fuel_time, &
fwh,fz0, &
fp )
! set up windspeed and slope table
propx=1.
propy=0.
do j=1,nsteps
r=float(j-1)/float(nsteps-1)
! line 1 varies windspeed (in x direction), zero slope
vx(1,j)=maxwind*r
vy(1,j)=0.
dzdxf(1,j)=0.
dzdyf(1,j)=0.
! line 2 varies slope (in x direction), zero slope
vx(2,j)=0.
vy(2,j)=0.
dzdxf(2,j)=maxslope*r
dzdyf(2,j)=0.
enddo
do j=1,nsteps
do i=1,2
call fire_ros(ros_back,ros_wind,ros_slope, &
propx,propy,i,j,fp)
ros(i,j)=ros_back+ros_wind+ros_slope
enddo
write(iounit,13)k,'wind',j,vx(1,j),'wind speed'
write(iounit,13)k,'ros_wind',j,ros(1,j),'rate of spread for the wind speed'
write(iounit,13)k,'slope',j,dzdxf(2,j),'slope'
write(iounit,13)k,'ros_slope',j,ros(2,j),'rate of spread for the slope'
enddo
enddo
13 format('fuel(',i3,').',a,'(',i3,')=',g12.5e2,';% ',a)
close(iounit)
! stop
contains
subroutine write_var(k,name,value,descr)
! write entry for one variable
integer, intent(in)::k
character(len=*), intent(in)::name,descr
real, intent(in)::value
write(iounit,11)k,name,value
write(iounit,12)k,name,descr
11 format('fuel(',i3,').',a,'=',g12.5e2, ';')
12 format('fuel(',i3,').',a,"_descr='",a,"';")
end subroutine write_var
end subroutine write_fuels_m
!
!*******************
!
subroutine set_fire_params( &
ifds,ifde,jfds,jfde, &
ifms,ifme,jfms,jfme, &
ifts,ifte,jfts,jfte, &
fdx,fdy,nfuel_cat0, &
nfuel_cat,fuel_time, &
fwh,fz0, &
fp )
implicit none
!*** purpose: Set all fire model params arrays, constant values.
!*** arguments
integer, intent(in)::ifds,ifde,jfds,jfde ! fire domain bounds
integer, intent(in)::ifts,ifte,jfts,jfte ! fire tile bounds
integer, intent(in)::ifms,ifme,jfms,jfme ! memory array bounds
real, intent(in):: fdx,fdy ! fire mesh spacing
integer,intent(in)::nfuel_cat0 ! default fuel category, if nfuel_cat=0
real, intent(in),dimension(ifms:ifme, jfms:jfme)::nfuel_cat ! fuel data
real, intent(out), dimension(ifms:ifme, jfms:jfme)::fuel_time, &! fire params arrays
fwh,fz0
type(fire_params),intent(inout)::fp
!*** local
real:: fuelload, fueldepth, rtemp1, rtemp2, &
qig, epsilon, rhob, wn, betaop, e, c, &
xifr, etas, etam, a, gammax, gamma, ratio, ir, &
fuelloadm,fdxinv,fdyinv
integer:: i,j,k
integer::nerr
character(len=128)::msg
!*** executable
nerr=0
do j=jfts,jfte
do i=ifts,ifte
! fuel category
k=int( nfuel_cat(i,j) )
if(k.eq.no_fuel_cat)then ! no fuel
fp%fgip(i,j)=0. ! no mass
fp%ischap(i,j)=0.
fp%betafl(i,j)=0. ! to prevent division by zero
fp%bbb(i,j)=1. !
fuel_time(i,j)=7./0.85 ! does not matter, just what was there before
fp%phiwc(i,j)=0.
fp%r_0(i,j)=0. ! no fuel, no spread.
fwh(i,j) = 0.2 ! just so that something is there
fz0(i,j) = 0.1
else
if(k.eq.0.and.nfuel_cat0.ge.1.and.nfuel_cat0.le.nfuelcats)then
! replace k=0 by default
k=nfuel_cat0
nerr=nerr+1
endif
if(k.lt.1.or.k.gt.nfuelcats)then
!$OMP CRITICAL(SFIRE_PHYS_CRIT)
write(msg,'(3(a,i5))')'nfuel_cat(', i ,',',j,')=',k
!$OMP END CRITICAL(SFIRE_PHYS_CRIT)
call message(msg)
call crash('set_fire_params: fuel category out of bounds')
endif
! other quantities passed directly, not in fp
if(fire_wind_height>0)then
fwh(i,j)=fire_wind_height
else
fwh(i,j)=fcwh(k)
endif
fz0(i,j)=fcz0(k)
fuel_time(i,j)=weight(k)/0.85 ! cell based
! do not understand calculations of stime in binit.m4
! set fuel time constant: weight=1000=>40% decrease over 10 min
! fuel decreases as exp(-t/fuel_time)
! exp(-600*0.85/1000) = approx 0.6
fp%ischap(i,j)=ichap(k)
fp%fgip(i,j)=fgi(k)
! end jm addition
!
!*** rest copied from wf2_janice/fire_startup.m4 with minimal changes
!
! ...Settings of fire spread parameters from Rothermel follows. These
! don't need to be recalculated later.
fuelloadm= (1.-bmst) * fgi(k) ! fuelload without moisture
fuelload = fuelloadm * (.3048)**2 * 2.205 ! to lb/ft^2
fueldepth = fueldepthm(k)/0.3048 ! to ft
fp%betafl(i,j) = fuelload/(fueldepth * fueldens(k))! packing ratio
betaop = 3.348 * savr(k)**(-0.8189) ! optimum packing ratio
qig = 250. + 1116.*fuelmc_g ! heat of preignition, btu/lb
epsilon = exp(-138./savr(k) ) ! effective heating number
rhob = fuelload/fueldepth ! ovendry bulk density, lb/ft^3
c = 7.47 * exp( -0.133 * savr(k)**0.55) ! const in wind coef
fp%bbb(i,j) = 0.02526 * savr(k)**0.54 ! const in wind coef
c = c * windrf(k)**fp%bbb(i,j) ! jm: wind reduction from 20ft per Baughman&Albini(1980)
e = 0.715 * exp( -3.59e-4 * savr(k)) ! const in wind coef
fp%phiwc(i,j) = c * (fp%betafl(i,j)/betaop)**(-e)
rtemp2 = savr(k)**1.5
gammax = rtemp2/(495. + 0.0594*rtemp2) ! maximum rxn vel, 1/min
a = 1./(4.774 * savr(k)**0.1 - 7.27) ! coef for optimum rxn vel
ratio = fp%betafl(i,j)/betaop
gamma = gammax *(ratio**a) *exp(a*(1.-ratio)) !optimum rxn vel, 1/min
wn = fuelload/(1 + st(k)) ! net fuel loading, lb/ft^2
rtemp1 = fuelmc_g/fuelmce(k)
etam = 1.-2.59*rtemp1 +5.11*rtemp1**2 -3.52*rtemp1**3 !moist damp coef
etas = 0.174* se(k)**(-0.19) ! mineral damping coef
ir = gamma * wn * fuelheat * etam * etas !rxn intensity,btu/ft^2 min
! jm irm = ir * 1055./( 0.3048**2 * 60.) * 1.e-6 !for mw/m^2
! jm: irm set but never used??
xifr = exp( (0.792 + 0.681*savr(k)**0.5) &
* (fp%betafl(i,j)+0.1)) /(192. + 0.2595*savr(k)) ! propagating flux ratio
! ... r_0 is the spread rate for a fire on flat ground with no wind.
fp%r_0(i,j) = ir*xifr/(rhob * epsilon *qig) ! default spread rate in ft/min
endif
enddo
enddo
if(nerr.gt.1)then
!$OMP CRITICAL(SFIRE_PHYS_CRIT)
write(msg,'(a,i6,a)')'set_fire_params: WARNING: fuel category 0 replaced in',nerr,' cells'
!$OMP END CRITICAL(SFIRE_PHYS_CRIT)
call message(msg)
endif
end subroutine set_fire_params
!
!*******************
!
subroutine heat_fluxes(dt, &
ifms,ifme,jfms,jfme, & ! memory dims
ifts,ifte,jfts,jfte, & ! tile dims
iffs,iffe,jffs,jffe, & ! fuel_frac_burnt dims
fgip,fuel_frac_burnt, & !in
grnhft,grnqft) !out
implicit none
!*** purpose
! compute the heat fluxes on the fire grid cells
!*** arguments
real, intent(in)::dt ! dt the fire time step (the fire model advances time by this)
integer, intent(in)::ifts,ifte,jfts,jfte,ifms,ifme,jfms,jfme,iffs,iffe,jffs,jffe ! dimensions
real, intent(in),dimension(ifms:ifme,jfms:jfme):: fgip
real, intent(in),dimension(iffs:iffe,jffs:jffe):: fuel_frac_burnt
real, intent(out),dimension(ifms:ifme,jfms:jfme):: grnhft,grnqft
!*** local
integer::i,j
real:: dmass
!*** executable
do j=jfts,jfte
do i=ifts,ifte
dmass = & ! ground fuel dry mass burnt this call (kg/m^2)
fgip(i,j) & ! init mass from fuel model no (kg/m^2) = fgi(nfuel_cat(i,j)
* fuel_frac_burnt(i,j) ! fraction burned this call (1)
grnhft(i,j) = (dmass/dt)*(1.-bmst)*cmbcnst ! J/m^2/sec
grnqft(i,j) = (bmst+(1.-bmst)*.56)*(dmass/dt)*xlv ! what the #!@* is that??
! xlv is defined in module_model_constants.. who knows that it is.. why .56 ??
enddo
enddo
end subroutine heat_fluxes
!
!**********************
!
subroutine set_nfuel_cat( &
ifms,ifme,jfms,jfme, &
ifts,ifte,jfts,jfte, &
ifuelread,nfuel_cat0,zsf,nfuel_cat)
implicit none
! set fuel distributions for testing
integer, intent(in):: ifts,ifte,jfts,jfte, &
ifms,ifme,jfms,jfme
integer, intent(in)::ifuelread,nfuel_cat0
real, intent(in), dimension(ifms:ifme, jfms:jfme)::zsf
real, intent(out), dimension(ifms:ifme, jfms:jfme)::nfuel_cat
!*** local
! parameters to control execution
integer:: i,j,iu1
real:: t1
character(len=128)msg
!$OMP CRITICAL(SFIRE_PHYS_CRIT)
write(msg,'(a,i3)')'set_nfuel_cat: ifuelread=',ifuelread
!$OMP END CRITICAL(SFIRE_PHYS_CRIT)
call message(msg)
if (ifuelread .eq. -1 .or. ifuelread .eq. 2) then
!$OMP CRITICAL(SFIRE_PHYS_CRIT)
call message('set_nfuel_cat: assuming nfuel_cat initialized already')
call message(msg)
!$OMP END CRITICAL(SFIRE_PHYS_CRIT)
else if (ifuelread .eq. 0) then
!
do j=jfts,jfte
do i=ifts,ifte
nfuel_cat(i,j)=real(nfuel_cat0)
enddo
enddo
!$OMP CRITICAL(SFIRE_PHYS_CRIT)
write(msg,'(a,i3)')'set_nfuel_cat: fuel initialized with category',nfuel_cat0
!$OMP END CRITICAL(SFIRE_PHYS_CRIT)
call message(msg)
else if (ifuelread .eq. 1) then
!
! make dependent on altitude (co mountains/forest vs. plains)
! 2000 m : 6562 ft ; 1600 m: 5249 ft
! ... user defines fuel category spatial variability ! param!
do j=jfts,jfte
do i=ifts,ifte
! nfuel_cat(i,j)= 2 ! grass with understory ! jm does nothing
!jm t1=zsf(i,j)*slngth/100.
t1 = zsf(i,j) ! this is in m
if(t1.le.1524.)then ! up to 5000 ft
nfuel_cat(i,j)= 3 ! tall grass
else if(t1.ge.1524. .and. t1.le.2073.)then ! 5.0-6.8 kft.
nfuel_cat(i,j)= 2 ! grass with understory
else if(t1.ge.2073..and.t1.le.2438.)then ! 6.8-8.0 kft.
nfuel_cat(i,j)= 8 ! timber litter - 10 (ponderosa)
else if(t1.gt.2438. .and. t1.le. 3354.) then ! 8.0-11.0 kft.
! ... could also be mixed conifer.
nfuel_cat(i,j)= 10 ! timber litter - 8 (lodgepole)
else if(t1.gt.3354. .and. t1.le. 3658.) then ! 11.0-12.0 kft
nfuel_cat(i,j)= 1 ! alpine meadow - 1
else if(t1.gt.3658. ) then ! > 12.0 kft
nfuel_cat(i,j)= 14 ! no fuel.
endif
enddo
enddo
call message('set_nfuel_cat: fuel initialized by altitude')
else
call crash('set_nfuel_cat: bad ifuelread')
endif
! .............end load fuel categories (or constant) here.
end subroutine set_nfuel_cat
!
!**********************
!
subroutine fire_ros(ros_back,ros_wind,ros_slope, &
propx,propy,i,j,fp)
implicit none
! copied from wf2_janice
! with the following changes ONLY:
! 0.5*(speed + abs(speed)) -> max(speed,0.)
! index l -> j
! took out some prints
! argument fuelloadm never used??
! not using nfuel_cat here - cell info was put into arrays passed as arguments
! in include file to avoid transcription errors when used elsewhere
! betaop is absorbed in phiwc, see module_fr_sfire_model/fire_startup
! return the backing, wind, and slope contributions to the rate of spread separately
! because they may be needed to take advantage of known wind and slope vectors.
! They should add up to get the total rate of spread.
!ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
! ... calculates fire spread rate with mcarthur formula or Rothermel
! using fuel type of fuel cell
!
!
! m/s =(ft/min) *.3048/60. =(ft/min) * .00508 ! conversion rate
! ft/min = m/s * 2.2369 * 88. = m/s * 196.850 ! conversion rate
!
!ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
!*** arguments
real, intent(out)::ros_back,ros_wind,ros_slope ! rate of spread: backing, due to wind, due to slope
real, intent(in)::propx,propy
integer, intent(in)::i,j ! node mesh coordinates
type(fire_params),intent(in)::fp
!*** local
real:: speed, tanphi ! windspeed and slope in the directino normal to the fireline
real:: umid, phis, phiw, spdms, umidm, excess, tanphim
integer, parameter::ibeh=1
real, parameter::ros_max=6.
character(len=128)msg
real::cor_wind,cor_slope,nvx,nvy,scale
!*** executable
! make sure normal direction is size 1
!scale=sqrt(propx*propx+propy*propy)+tiny(scale)
scale=1.
nvx=propx/scale
nvy=propy/scale
if (fire_advection.ne.0) then ! from flags in module_fr_sfire_util
! wind speed is total speed
speed = sqrt(fp%vx(i,j)*fp%vx(i,j)+ fp%vy(i,j)*fp%vy(i,j))+tiny(speed)
! slope is total slope
tanphi = sqrt(fp%dzdxf(i,j)*fp%dzdxf(i,j) + fp%dzdyf(i,j)*fp%dzdyf(i,j))+tiny(tanphi)
! cos of wind and spread, if >0
cor_wind = max(0.,(fp%vx(i,j)*nvx + fp%vy(i,j)*nvy)/speed)
! cos of slope and spread, if >0
cor_slope = max(0., (fp%dzdxf(i,j)*nvx + fp%dzdyf(i,j)*nvy)/tanphi)
else
! wind speed in spread direction
speed = fp%vx(i,j)*nvx + fp%vy(i,j)*nvy
! slope in spread direction
tanphi = fp%dzdxf(i,j)*nvx + fp%dzdyf(i,j)*nvy
cor_wind=1.
cor_slope=1.
endif
if (.not. fp%ischap(i,j) > 0.) then ! if not chaparral, do not test for .eq. 0 for speed
if (ibeh .eq. 1) then ! use Rothermel formula
! ... if wind is 0 or into fireline, phiw = 0, &this reduces to backing ros.
spdms = max(speed,0.) !
umidm = min(spdms,30.) ! max input wind spd is 30 m/s !param!
umid = umidm * 196.850 ! m/s to ft/min
! eqn.: phiw = c * umid**bbb(i,j) * (fp%betafl(i,j)/betaop)**(-e) ! wind coef
phiw = umid**fp%bbb(i,j) * fp%phiwc(i,j) ! wind coef
phis=0.
tanphim=max(tanphi,0.0)
tanphim=min(tanphim,5.0) ! jm
phis = 5.275 *(fp%betafl(i,j))**(-0.3) *tanphim**2 ! slope factor
! rosm = fp%r_0(i,j)*(1. + phiw + phis) * .00508 ! spread rate, m/s
ros_back = fp%r_0(i,j) * .00508
ros_wind = ros_back*phiw
ros_slope= ros_back*phis
else ! MacArthur formula (Australian)
! rosm = 0.18*exp(0.8424*max(speed,0.))
ros_back = 0.18*exp(0.8424)
ros_wind = 0.18*exp(0.8424*max(speed,0.)) - ros_back
ros_slope =0.
endif
!
else ! chaparral
! .... spread rate has no dependency on fuel character, only windspeed.
spdms = max(speed,0.)
! rosm = 1.2974 * spdms**1.41 ! spread rate, m/s
! note: backing ros is 0 for chaparral without setting nozero value below
!sp_n=.03333
! chaparral backing fire spread rate 0.033 m/s ! param!
!rosm= max(rosm, sp_n) ! no less than backing r.o.s.
ros_back=.03333 ! chaparral backing fire spread rate 0.033 m/s ! param!
ros_wind = 1.2974 * spdms**1.41 ! spread rate, m/s
ros_wind = max(ros_wind, ros_back)-ros_back
ros_slope =0.
endif
! if advection, multiply by the cosines
ros_wind=ros_wind*cor_wind
ros_slope=ros_slope*cor_slope
!
! ----------note! put an 6 m/s cap on max spread rate -----------
! rosm= min(rosm, 6.) ! no faster than this cap ! param !
excess = ros_back + ros_wind + ros_slope - ros_max
if (excess > 0.)then
! take it out of wind and slope in proportion
ros_wind = ros_wind - excess*ros_wind/(ros_wind+ros_slope)
ros_slope = ros_slope - excess*ros_slope/(ros_wind+ros_slope)
endif
! ... to rescale to veloc. carried by model, mult x (svel*snorm(1,3))= .1
!jm: huh ???
! fire_ros = 0.1*rosm
!
!write(msg,*)i,j,' speed=',speed,' tanphi',tanphi,' ros=',ros_back,ros_wind,ros_slope
!call message(msg)
return
contains
real function nrm2(u,v)
real, intent(in)::u,v
nrm2=sqrt(u*u+v*v)
end function nrm2
end subroutine fire_ros
end module module_fr_sfire_phys