-
Notifications
You must be signed in to change notification settings - Fork 0
/
puff3.f90
19365 lines (19364 loc) · 727 KB
/
puff3.f90
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
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
subroutine wrfiles(npt2,nar2,nln2,nvl2,nfl2,&
idryflg,mhill)
!----------------------------------------------------------------------
!
! --- CALPUFF Version: 7.3.1 Level: 150918 WRFILES
! J. Scire
!
! --- PURPOSE: Write a table of the input and output file names
! for the current run
!
! --- UPDATE
!
! --- V7.2.1-v7.3.0 150918 : add ROAD and SPRAY source types
! --- V6.302-TNG-7.0.0 140913 : add FLARE source
! --- V6.302-V6.42_x1.1 140521 : revise format for AUX filename list
!
! --- V6.301-V6.302 100917 (DGS): add NH3Z.DAT file of vertical NH3
! concentrations for each month
! (mchem=6,7)
! 100917 (DGS): add liquid water content file
! extension
! --- V6.3-V6.301 100827 (DGS): NMETDAT converted to array
! --- V6.267-V6.3 100212 (DGS): add nested CALMET grid
! --- V6.26-V6.267 090710 (DGS): add PFTRAK.DAT for puff tracking
! output
! --- V6.11-V6.26 080430 (DGS): add RISE.DAT: numerical rise output
! --- V5.725-V6.11 060309 (DGS): change filenames from c*70 to c*132
! --- V5.4-V5.725 050128 (DGS): add TK2D.DAT for 2D temperature
! 050128 (DGS): add RHO2D.DAT for 2D density
! --- V5.4-V5.74 040715 (DGS): add METFM=5 (AERMET)
! --- V5.4-V5.4 000602_3(DGS): add H2O2.DAT for aqueous chemistry
! --- V5.3-V5.4 000602 (DGS): multiple PTEMARB, BAEMARB, and
! VOLEMARB files
! 000602 (DGS): include FOG.DAT file
! --- V5.3-V5.3 991222a (DGS): use of PROFILE.DAT for turbulence
! when PLMMET.DAT option is used
! --- V5.2-V5.3 991222 (DGS): add BCON.DAT file
! --- V5.0-V5.1 990625b (DGS): drop mmodel='AUSPUFF' distinction
! --- V5.0-V5.0 990228d (DGS): add mass balance file
! --- V5.0-V5.0 990228c (DGS): add mass flux files
! --- V5.0-V5.0 990228a (DGS): add multiple CALMET.DAT files
! --- V5.0-V5.0 980918 (DGS): include MCHEM=4
! --- V5.0-V5.0 980515 (DGS): add COASTLN.DAT file
! --- V5.0-V5.0 980304 (DGS): add RESTART file
! --- V4.0-V5.0 971107 (DGS): add LNEMARB.DAT file
!
! --- INPUTS:
! NPT2 - integer - Number of point sources with variable
! emissions
! (PTEMARB.DAT - arbitrary emissions)
! NAR2 - integer - Number of buoyant area sources with
! variable location and emissions
! (BAEMARB.DAT - arbitrary emissions)
! NLN2 - integer - Number of buoyant line sources with
! variable location and emissions
! (LNEMARB.DAT - arbitrary emissions)
! NVL2 - integer - Number of volume sources with
! variable location and emissions
! (VOLEMARB.DAT - arbitrary emissions)
! NFL2 - integer - Number of FLARE sources with
! variable location and emissions
! (FLEMARB.DAT - arbitrary emissions)
! IDRYFLG(mxspec) - integer - Array of dry deposition flags for
! array each pollutant
! 0 = No deposition
! 1 = Resistance model - gas
! 2 = Resistance model - particle
! 3 = User-specified dep. velocities
! MHILL - integer - Flag controlling use of CTDM-format
! hill information files (for CTSG)
! 0 = No file (CTSG option not used)
! 1 = HILL.DAT & HILLRCT.DAT files
! 2 = No files (hill data from OPTHILL
! are supplied in Subgroup 6b,
! and CTSG receptors are
! supplied in Subgroup 6c)
!
! Common block /FILNAM/ variables:
! PUFINP, METDATL, METDOML, ISCDAT, PLMDAT,
! PTDAT, ARDAT, VOLDAT, FLDAT, LNDAT,
! VDDAT, OZDAT, CHEMDAT, HILDAT, RCTDAT, DEBUG, PUFLST,
! CONDAT, DFDAT, WFDAT, VISDAT, T2DDAT, RHODAT, PRFDAT, SFCDAT,
! RSTARTB, RSTARTE, CSTDAT, BDYDAT, FLXDAT, BALDAT, BCNDAT,
! H2O2DAT, RISDAT, TRKDAT, NH3ZDAT, AUXEXT, NMETDAT, NMETDOM,
! NPTDAT, NARDAT, NVOLDAT, NFLDAT
! Common block /CHEMDAT/ variables:
! MOZ, MH2O2, MNH3
! Common block /FLAGS/ variables:
! MCHEM, MDRY, MDISP, MCTSG, MTURBVW, MSGTIBL, MBCON,
! MAQCHEM, MLWC
! Common block /GEN/ variables:
! METFM, NSPEC, MRESTART
! Common block /OUTPT/ variables:
! ICON, IVIS, IT2D, IRHO, IDRY, IWET, IMFLX, IMBAL, IFOG,
! INRISE, IPFTRAK, LDEBUG
! --- Module |MROAD2| variables:
! nrddat,rddat
! --- Module |MRSPRAY2| variables:
! nspdat,spdat
!
! Parameters: IO6, IO7, IO8, IO9, IO10, IO11, IO12, IO13, IO14, IO15,
! IO19, IO20, IO22, IO23, IO24, IO25, IO28, IO29, IO30,
! IO31, IO32, IO35, IO36, IO37, IO38, IO40, MXSPEC,
! IOPT2, IOAR2, IOVOL, IOFL2, IOTRK, MXMETDAT, MXMETDOM
!
! --- OUTPUT: none
!
! --- WRFILES called by: SETUP
! --- WRFILES calls: none
!----------------------------------------------------------------------
!
! --- Modules
use mroad2
use mspray2
! --- Include parameter statements
include 'params.puf'
!
! --- Include common blocks
include 'filnam.puf'
include 'chemdat.puf'
include 'flags.puf'
include 'gen.puf'
include 'outpt.puf'
!
integer idryflg(mxspec)
!
! --------------------------------------------------
! --- Write the list of INPUT files used in this run
! --------------------------------------------------
write(io6,10)
10 format(//1x,13('----------')/10x,'INPUT FILES'//&
1x,'Default Name',5x,'Unit No.',5x,'File Name and Path'/&
1x,'------------',5x,'--------',5x,'------------------')
!
! --- CALPUFF.INP
write(io6,12)'CALPUFF.INP',io5,pufinp
12 format(1x,a12,7x,i3,8x,a132)
!
! --- Restart file for continuation run
if(mrestart.EQ.1 .OR. mrestart.EQ.3) &
write(io6,12)'RESTARTB.DAT',io3,rstartb
!
! --- Meteorological data file(s)
if(metfm.EQ.1) then
! --- CALMET meteorological data file (CALMET.DAT)
do k=1,nmetdom
iometgrd=io7+(k-1)
write(io6,*)'(CALMET Domain:',k,') '//TRIM(metdoml(k))
do i=1,nmetdat(k)
if(k.EQ.1 .AND. i.EQ.1) then
write(io6,12)'CALMET.DAT',iometgrd,metdatl(1,k)
else
write(io6,12)' (----) ',iometgrd,metdatl(i,k)
endif
enddo
enddo
! --- CALMET 3D gridded liquid water content files
if(maqchem.EQ.1 .AND. mlwc.EQ.1) then
! --- CALMET 3D water content data file (CALMET.DAT.AUX)
do k=1,nmetdom
iometgrd=io7+nmetdom+(k-1)
write(io6,*)'(CALMET Domain:',k,') '//TRIM(metdoml(k))
do i=1,nmetdat(k)
! --- 6.42_x1.1 140521
write(io6,'(1x,a12,7x,i3,8x,a)')' (.AUX) ',&
iometgrd,TRIM(metdatl(i,k))//TRIM(auxext)
enddo
enddo
endif
elseif(metfm.EQ.2) then
! --- ISC meteorological data file (ISCMET.DAT)
write(io6,12)'ISCMET.DAT',io7,iscdat
elseif(metfm.EQ.3) then
! --- PLUME meteorological data file (PLMMET.DAT)
write(io6,12)'PLMMET.DAT',io7,plmdat
elseif(metfm.EQ.4 .OR. metfm.EQ.5) then
! --- Tower data file (PROFILE.DAT)
write(io6,12)'PROFILE.DAT',io31,prfdat
! --- Surface parameter file (SURFACE.DAT)
write(io6,12)'SURFACE.DAT',io32,sfcdat
endif
!
! --- BOUNDARY CONCENTRATION file (BCON.DAT)
! --- (all information about both constant and variable boundary data)
if(mbcon.gt.0)write(io6,12)'BCON.DAT',io15,bcndat
!
! --- POINT SOURCE emissions file #2 (PTEMARB.DAT)
! --- (stationary point sources with arbitrary variation in emissions)
if(npt2.gt.0) then
do i=1,nptdat
io=iopt2+i-1
write(io6,12)'PTEMARB.DAT',io,ptdat(i)
enddo
endif
!
! --- BUOYANT AREA SOURCE file (BAEMARB.DAT)
! --- (area sources with arbitrary variation in location & emissions)
if(nar2.gt.0) then
do i=1,nardat
io=ioar2+i-1
write(io6,12)'BAEMARB.DAT',io,ardat(i)
enddo
endif
!
! --- BUOYANT LINE SOURCE file (LNEMARB.DAT)
! --- (line sources with arbitrary variation in location & emissions)
if(nln2.gt.0)write(io6,12)'LNEMARB.DAT',io19,lndat
!
! --- VOLUME SOURCE emissions file (VOLEMARB.DAT)
! --- (volume sources with arbitrary variation in location & emissions)
if(NVL2.gt.0) then
do iv=1,nvoldat
io=iovol+iv-1
write(io6,12)'VOLEMARB.DAT',io,voldat(iv)
enddo
endif
!
! --- FLARE SOURCE emissions file (FLEMARB.DAT)
! --- (FLARE sources with arbitrary variation in location & emissions)
if(NFL2.GT.0) then
do i=1,nfldat
io=iofl2+i-1
write(io6,12)'FLEMARB.DAT',io,fldat(i)
enddo
endif
! --- ROAD SOURCE emissions file (RDEMARB.DAT)
! --- (ROAD sources with arbitrary variation in location & emissions)
if(NRD2.GT.0) then
do i=1,nrddat
io=iord2+i-1
write(io6,12)'RDEMARB.DAT',io,rddat(i)
enddo
endif
! --- SPRAY SOURCE emissions file (SPEMARB.DAT)
! --- (SPRAY sources with arbitrary variation in location & emissions)
if(NSP2.GT.0) then
do i=1,nspdat
io=iosp2+i-1
write(io6,12)'SPEMARB.DAT',io,spdat(i)
enddo
endif
!
! --- DEPOSITION VELOCITY file (VD.DAT) (if user-specified
! deposition velocities are used for any species AND computation
! of dry deposition is requested
if(mdry.eq.1)then
do 20 i=1,nspec
if(idryflg(i).eq.3)then
write(io6,12)'VD.DAT',io20,vddat
exit ! add by @creaqi break the loop goto 22 in wrfiles with len equal 1
endif
20 continue
22 continue
endif
!
! --- OZONE data file (OZONE.DAT) (if MESOPUFF II chemical
! scheme is used AND hourly ozone input requested)
if((mchem.NE.0 .AND. mchem.NE.2 .AND. mchem.NE.5) .AND. moz.EQ.1)&
write(io6,12)'OZONE.DAT',io22,ozdat
!
! --- H2O2 data file (H2O2.DAT) (if aqueous phase chemical
! scheme is used AND hourly H2O2 input requested)
if(maqchem.EQ.1 .AND. mh2o2.EQ.1)&
write(io6,12)'H2O2.DAT',io23,h2o2dat
!
! --- CHEMICAL TRANSFORMATION file (CHEM.DAT) (if user-specified
! chemical transformation rates are used)
if(mchem.eq.2)write(io6,12)'CHEM.DAT',io24,chemdat
!
! --- Vertical NH3 concentration profiles (for MCHEM=6,7)
if(mnh3.EQ.1 .AND. (mchem.EQ.6 .OR. mchem.EQ.7))&
write(io6,12)'NH3Z.DAT',io40,nh3zdat
!
! --- TURBULENCE data file
if(mdisp.eq.1 .OR. mdisp.EQ.5) then
if(metfm.LT.4 .AND. mturbvw.LT.4) then
write(io6,12)'PROFILE.DAT',io31,prfdat
endif
endif
!
! --- CTSG hill information files (HILL.DAT, HILLRCT.DAT)
! (if CTDM processors are used to create them)
if(mctsg.eq.1.and.mhill.eq.1) then
write(io6,12)'HILL.DAT',io28,hildat
write(io6,12)'HILLRCT.DAT',io29,rctdat
endif
!
! --- Sub-Grid TIBL COAST LINE file (COASTLN.DAT) (if
! MSGTIBL option is selected)
if(msgtibl.eq.1)write(io6,12)'COASTLN.DAT',io25,cstdat
!
! --- Mass flux BOUNDARY file (FLUXBDY.DAT)
if(imflx.eq.1)write(io6,12)'FLUXBDY.DAT',io35,bdydat
!
! ---------------------------------------------------
! --- Write the list of OUTPUT files used in this run
! ---------------------------------------------------
write(io6,30)
30 format(//1x,13('----------')/10x,'OUTPUT FILES'//&
1x,'Default Name',5x,'Unit No.',5x,'File Name and Path'/&
1x,'------------',5x,'--------',5x,'------------------')
!
! --- CALPUFF.LST
write(io6,12)'CALPUFF.LST',io6,puflst
!
! --- Output concentration file (CONC.DAT)
if(ICON.eq.1)write(io6,12)'CONC.DAT',io8,condat
!
! --- Output dry flux file (DFLX.DAT)
if(IDRY.eq.1)write(io6,12)'DFLX.DAT',io9,dfdat
!
! --- Output wet flux file (WFLX.DAT)
if(IWET.eq.1)write(io6,12)'WFLX.DAT',io10,wfdat
!
! --- Visibility-related file (VISB.DAT)
if(IVIS.eq.1)write(io6,12)'VISB.DAT',io11,visdat
!
! --- 2D Temperature file (TK2D.DAT)
if(IT2D.eq.1)write(io6,12)'TK2D.DAT',io13,t2ddat
!
! --- 2D Density file (RHO2D.DAT)
if(IRHO.eq.1)write(io6,12)'RHO2D.DAT',io14,rhodat
!
! --- Mass flux file (MASSFLX.DAT)
if(imflx.eq.1)write(io6,12)'MASSFLX.DAT',io36,flxdat
!
! --- Mass balance file (MASSBAL.DAT)
if(imbal.eq.1)write(io6,12)'MASSBAL.DAT',io37,baldat
!
! --- Fog plume data file
if(IFOG.eq.1)write(io6,12)'FOG.DAT',io12,fogdat
!
! --- Numerical rise data file
if(INRISE.eq.1)write(io6,12)'RIS.DAT',io38,risdat
!
! --- Puff-tracking output file
if(IPFTRAK.GT.0)write(io6,12)'PFTRAK.DAT',iotrk,trkdat
!
! --- Restart file
if(mrestart.GE.2) write(io6,12)'RESTARTE.DAT',io4,rstarte
!
! --- Puff/Slug TRACKING file (DEBUG.DAT) (if in DEBUG mode)
if(LDEBUG)write(io6,12)'DEBUG.DAT',io30,debug
!
return
end
!----------------------------------------------------------------------
subroutine stktip(hs,diam,fluxm,vexit,wsstk,hdw)
!----------------------------------------------------------------------
!
! --- CALPUFF Version: 7.3.1 Level: 991222b STKTIP
! --- J. Scire, SRC
!
! --- PURPOSE: Calculate the plume height adjustment to account for
! stack-tip downwash effects
!
! --- UPDATE
! --- V5.3-V5.3 991222b (DGS): add momentum flux to argument list
! and test for zero (exit velocity may
! not be vertical)
!
! --- INPUTS:
! HS - real - Stack height (m)
! DIAM - real - Stack diameter (m)
! FLUXM - real - Vertical momentum flux (m**4/s**2)
! VEXIT - real - Stack gas exit velocity (m/s)
! WSSTK - real - Stack height wind speed (m/s)
!
! --- OUTPUT:
! HDW - real - Plume height DECREASE (m)
!
! --- STKTIP called by: POINTS1, POINTS2, PUFRECS, SLGRECS. PLGRECS
! --- STKTIP calls: none
!----------------------------------------------------------------------
!
! --- Compute adjustment in effective stack height due to stack-tip
! downwash effects. Note that the adjustment cannot be greater
! than the physical stack height! The adjustment is POSITIVE, and
! is SUBTRACTED from, not added to, the stack height.
if(fluxm.EQ.0.0) then
hdw=AMIN1(hs,(3.*diam))
elseif(vexit.LT.(1.5*wsstk)) then
vbyws=vexit/wsstk
hdw=AMIN1(hs,(2.*diam*(1.5-vbyws)))
else
hdw=0.0
endif
return
end
!----------------------------------------------------------------------
subroutine prb(fb,wsstk,x,xfinb,zfinb,zb)
!----------------------------------------------------------------------
!
! --- CALPUFF Version: 7.3.1 Level: 941215 PRB
! --- J. Scire, SRC
!
! --- PURPOSE: Calculate transitional buoyant plume rise
! (excluding building downwash effects).
! This routine is used for both neutral/unstable and
! stable conditions.
!
! --- INPUTS:
! FB - real - Buoyancy flux (m**4/s**3)
! WSSTK - real - Stack height wind speed (m/s)
! X - real - Downwind distance (m) from the
! stack to the receptor
! XFINB - real - Distance (m) to final buoyant
! plume rise for neutral/unstable
! conditions
! ZFINB - real - Final buoyant plume rise (m)
! (during stable conditions, taken as
! the min. of vertical and bent-over
! plume equations)
!
! --- OUTPUT:
! ZB - real - Transitional plume rise (m) due
! to plume buoyancy
!
! --- PRB called by: GRISE
! --- PRB calls: none
!----------------------------------------------------------------------
!
! --- Check for case of no buoyant rise
if(x.le.0.0.or.fb.le.0.0)then
zb=0.0
else
! --- Compute transitional buoyant plume rise
if(x.lt.xfinb .AND. wsstk.gt.0.0)then
zb=(1.6*(fb*x*x)**0.333333)/wsstk
!
! --- Final plume height in stable conditions is based on minimum
! --- of bent-over and vertical plume equations -- ensure plume
! --- height does not exceed final height
zb=amin1(zb,zfinb)
else
zb=zfinb
endif
endif
return
end
!----------------------------------------------------------------------
subroutine prm(diam,vexit,fm,wsstk,istab,sqrts,x,xfinm,zfinm,zm)
!----------------------------------------------------------------------
!
! --- CALPUFF Version: 7.3.1 Level: 950715 PRM
! --- J. Scire, SRC
!
! --- PURPOSE: Calculate transitional momentum plume rise
! (excluding building downwash effects).
! This routine is used for both neutral/unstable and
! stable conditions.
!
! --- INPUTS:
! DIAM - real - Stack diameter (m)
! VEXIT - real - Stack gas exit velocity (m/s)
! FM - real - Momentum flux (m**4/s**2)
! WSSTK - real - Stack height wind speed (m/s)
! ISTAB - integer - Stability class (1=A,...6=F)
! SQRTS - real - Square root of stability parameter,s
! (sqrt(s)=(g*(dtheta/dz)/tair)**0.5)
! X - real - Downwind distance (m) from the
! stack to the receptor
! XFINM - real - Distance (m) to final momentum
! plume rise
! ZFINM - real - Final momentum plume rise (m)
! (during stable conditions, taken as
! the min. of vertical and bent-over
! plume equations)
!
! --- OUTPUT:
! ZM - real - Transitional plume rise (m) due
! to momentum
!
! --- PRM called by: GRISE, POINTS1
! --- PRM calls: none
!----------------------------------------------------------------------
!
! --- Check for case of no momentum rise
if(vexit.le.0.0.or.fm.le.0.0.or.x.le.0.0)then
zm=0.0
else
! --- Compute transitional momentum plume rise
if(x.lt.xfinm .AND. wsstk.gt.0.0)then
!
! --- Compute the momentum entrainment coefficient
betaj=0.333333+(wsstk/vexit)
! --- Compute neutral/unstable final rise
zmfnu=3.*diam*vexit/wsstk
!
if(istab.le.4)then
!
! --- Neutral/unstable conditions
zm=(3.*fm*x/(betaj*betaj*wsstk*wsstk))**0.333333
! --- Test zm against neutral/unstable final rise (as in ISC2)
zm=amin1(zm,zmfnu)
else
!
! --- Stable conditions
zm=(3.*fm*sin(sqrts*x/wsstk)/(betaj*betaj*wsstk*&
sqrts))**0.333333
!
! --- Should make sure that zm is no greater than zfinm,
! --- which is the minimum of final momentum rise for either
! --- stable or non-stable conditions
!
! zm=amin1(zm,zfinm)
!
! --- BUT, to be consistent with ISC2, only test zm against
! --- neutral/unstable final rise (3.*diam*vexit/wsstk)
zm=amin1(zm,zmfnu)
endif
else
!
! --- Beyond distance to final rise
zm=zfinm
endif
endif
return
end
!----------------------------------------------------------------------
subroutine prfin(vexit,diam,fm,fb,wsstk,istab,sqrts,&
xfinm,xfinb,xfin,zfinm,zfinb,zfin)
!----------------------------------------------------------------------
!
! --- CALPUFF Version: 7.3.1 Level: 991222b PRFIN
! --- J. Scire, SRC
!
! --- PURPOSE: Calculate distance to final rise and height of final
! plume rise
!
! --- UPDATE
! --- V5.3-V5.3 991222b (DGS): Account for zero momentum flux that
! is caused by FMFAC=0
!
! --- INPUTS:
! VEXIT - real - Stack gas exit velocity (m/s)
! DIAM - real - Stack diameter (m)
! FM - real - Momentum flux (m**4/s**2)
! FB - real - Buoyancy flux (m**4/s**3)
! WSSTK - real - Stack height wind speed (m/s)
! ISTAB - integer - Stability class (1=A,...6=F)
! SQRTS - real - Square root of stability parameter,s
! (sqrt(s)=(g*(dtheta/dz)/tair)**0.5)
!
! --- OUTPUTS:
! XFINM - real - Distance (m) to final momentum
! plume rise
! XFINB - real - Distance (m) to final buoyant
! plume rise
! XFIN - real - Larger of XFINM and XFINB
! ZFINM - real - Final momentum plume rise (m)
! ZFINB - real - Final buoyant plume rise (m)
! ZFIN - real - Larger of ZFINM and ZFINB
!
! --- PRFIN called by: POINTS1, POINTS2
! --- PRFIN calls: none
!----------------------------------------------------------------------
!
! --- Set minimum allowed wind speed at stack-top (wsstk0). If wind
! --- speed is less than wsstk0, set distance to final rise equal to
! --- zero, and use the "calm rise" formula for stable conditions, or
! --- the neutral/unstable rise formulas with wsstk=wsstk0.
data wsstk0/1.0/
!
! ------------------------------------------
! --- Compute distance, height of final rise
! ------------------------------------------
!
if(wsstk.GE.wsstk0) then
! --- "non-CALM" conditions ------------------------
!
! --- Buoyant plume rise
if(istab.le.4)then
!
! --- Neutral/unstable conditions
if(fb.ge.55.)then
xfinb=119.*fb**0.4
zfinb=38.71*fb**0.6/wsstk
else if(fb.gt.0.0)then
xfinb=49.*fb**0.625
zfinb=21.425*fb**0.75/wsstk
else
!
! --- XFINB with FB le 0.0 follows ISC2 convention
vexit2=amax1(vexit,1.0e-10)
xfinb=4.*diam*(vexit2+3.*wsstk)**2/(vexit2*wsstk)
fb2=amax1(fb,1.0e-10)
zfinb=21.425*fb2**0.75/wsstk
endif
else
!
! --- Stable conditions
xfinb=2.0715*wsstk/sqrts
s=sqrts*sqrts
fb2=amax1(fb,1.0e-10)
!
! --- Bent-over plume equation
zfinb=2.6*(fb2/(wsstk*s))**0.333333
!
! --- Vertical plume equation
zfinv=4.*fb2**0.25/s**0.375
!
! --- Final stable rise is lower of bent-over and vertical plume
! --- values
zfinb=amin1(zfinb,zfinv)
endif
!
! --- Momentum plume rise
if(istab.le.4)then
!
! --- Neutral/unstable conditions
vexit2=amax1(vexit,1.0e-10)
xfinm=4.*diam*(vexit2+3.*wsstk)**2/(vexit2*wsstk)
zfinm=3.*diam*vexit/wsstk
else
!
! --- Stable conditions
! --- (Constant 1.57080 = pi/2.)
xfinm=1.57080*wsstk/sqrts
fm2=amax1(fm,1.0e-10)
zfinm=1.5*(fm2/(wsstk*sqrts))**0.333333
!
! --- Maximum stable momentum rise is restricted to be less than
! --- final neutral/unstable momentum rise
zfinm=amin1(zfinm,3.*diam*vexit/wsstk)
endif
! --- Set xfinm,zfinm to zero explicitly when FM is zero
if(fm.EQ.0.0) then
xfinm=0.0
zfinm=0.0
endif
!
else
! --- "CALM" conditions ----------------------------
!
! --- Buoyant plume rise
if(istab.le.4)then
!
! --- Neutral/unstable conditions
xfinb=0.0
if(fb.ge.55.)then
zfinb=38.71*fb**0.6/wsstk0
else
fb2=amax1(fb,1.0e-10)
zfinb=21.425*fb2**0.75/wsstk0
endif
else
!
! --- Stable conditions
xfinb=0.0
s=sqrts*sqrts
fb2=amax1(fb,1.0e-10)
!
! --- Vertical plume equation
zfinb=4.*fb2**0.25/s**0.375
endif
!
! --- Momentum plume rise
if(istab.le.4)then
!
! --- Neutral/unstable conditions
vexit2=amax1(vexit,1.0e-10)
xfinm=0.0
zfinm=3.*diam*vexit/wsstk0
else
!
! --- Stable conditions
xfinm=0.0
fm2=amax1(fm,1.0e-10)
zfinm=1.5*(fm2/(wsstk0*sqrts))**0.333333
!
! --- Maximum stable momentum rise is restricted to be less than
! --- final neutral/unstable momentum rise
zfinm=amin1(zfinm,3.*diam*vexit/wsstk0)
endif
! --- Set xfinm,zfinm to zero explicitly when FM is zero
if(fm.EQ.0.0) then
xfinm=0.0
zfinm=0.0
endif
endif
!
! --- Set overall maximum distance to final plume rise and maximum
! --- plume rise
xfin=amax1(xfinb,xfinm)
zfin=amax1(zfinb,zfinm)
!
return
end
!----------------------------------------------------------------------
subroutine grise(x,htgrise,risefac)
!----------------------------------------------------------------------
!
! --- CALPUFF Version: 7.3.1 Level: 141230 GRISE
! --- D. Strimaitis
!
! --- PURPOSE: Calculate height of gradual plume rise at position "x"
!
! --- UPDATE
! --- TNG-7.0.0 - TNG-7.1.0 141230 (DGS)
! : Apply adjustment for final rise that
! may have been reduced by wind shear
! and/or partial penetration
! --- V6.265 - TNG-7.0.0 140913 (DGS)
! : Add Flare source (istype=10,11)
! --- V6.262-V6.265 090612 (DGS): Set initial method=0 for all sources
! since it is actively defined for use
! with point sources and not others
! (LHEIGHT branch checks it for all
! sources)
! --- V6.261-V6.262 080725 (DGS): Refine test for invalid negative
! rise factor that halted a valid run
! instead of returning a zero factor
! 080725 (DGS): Change rise method from 2 (SS
! downwash) to 3 (tabulated rise) for
! point sources not subject to downwash
! that are modeled with numerical plume
! rise.
! --- V6.26-V6.261 080520 (DGS): Replace individual rise tables with
! /SRCTAB/ arrays from Direct Access
! file
! 080520 (DGS): Add call to PRSS to treat SS downwash
! --- V6.23-V6.26 080430 (DGS): Add numerical rise for point sources
! (not subject to downwash)
! Use source type alone for 1st-level
! logic branch, and consolidate 2nd-
! level branch with a METHOD flag
! --- V6.22-V6.23 080204 (DGS): Apply stack-tip downwash adjustment
! here instead of after call
! --- V6.1-V6.22 070921 (DGS): Check for imet outside valid range
! of 1 to MXMETSAV+1
! --- V5.725-V6.1 050915 (DGS): add emission step argument to
! numerical rise arrays (PT2,AR2)
! --- V5.7-V5.725 050128 (DGS): fix gradual rise factor for the PRIME
! module. The full rise (without
! streamline depression in a building
! wake) was divided by the final rise
! (with rather than without streamline
! depression).
! 050128 (DGS): add check for valid risefac
! --- V5.0-V5.7 030402 (DGS): introduce rise tables for point
! sources with PRIME downwash
! 030402 (DGS): use IMET in /CURRENT/ to select
! appropriate tabulated values
! --- V5.0-V5.0 980821 (DGS): replace use of IAGE for AREA-source
! tables since IAGE=1 for all puffs
! --- V4.0-V5.0 971107 (DGS): add variable line source treatment
!
! --- INPUTS:
! X - real - Downwind dist. from "pt." source (m)
!
! Common block /CURRENT/ variables:
! IPNUM, ISNUM, ISTYPE, ZFRISE, XSHIFT, IMET,
! IQSTEP
! Common block /PUFF/ variables:
! DIAM0(mxpuff), EXITW0(mxpuff), HT0(mxpuff), PLEXP0(mxpuff),
! WS0(mxpuff), ISTAB0(mxpuff), SQRTS0(mxpuff),
! FM(mxpuff), XMFIN(mxpuff), ZMFIN(mxpuff),
! FB(mxpuff), XBFIN(mxpuff), ZBFIN(mxpuff),
! ZLY0(mxpuff), R0(mxpuff), STIPDW(mxpuff)
! Common block /FLAGS/ variables:
! MSHEAR, MRISE, MRISE_FL
! Common block /SRCTAB/ variables:
! NTR,XTR(mxrise),ZTR(mxrise),HTR(mxrise)
!
! --- OUTPUTS:
! HTGRISE - real - Plume height (m) (stack+plume rise)
! RISEFAC - real - Corresponding plume rise as a
! fraction of final rise
!
! --- GRISE called by: PUFRECS, SLGRECS, RECSPEC0, RISEWIND
! --- GRISE calls: PRM, PRB, PRBL, PRSHEAR, PRSS, PRTAB, INTERTAB
!----------------------------------------------------------------------
!
include 'params.puf'
include 'current.puf'
include 'puff.puf'
include 'flags.puf'
include 'srctab.puf'
! --- Flag determines if height needs to be computed from rise
logical lheight
! --- Initialize full rise factor as the default
risefac=1.0
! --- Retain IMET for compatibility with previous treatment
! --- Validate imet index
if(imet.LT.1 .OR. imet.GT.mxmetsav+1) then
write(io6,*)
write(io6,*) 'FATAL ERROR in GRISE: bad met period index'
write(io6,*) 'Expected IMET = 1 to MXMETSAV+1'
write(io6,*) 'Found IMET = ',imet
write(io6,*) ' MXMETSAV = ',mxmetsav
write(io6,*)
write(*,*)
stop 'Halted in GRISE -- See list file'
endif
! --- Set rise calculation METHOD for Point sources
! --- 0 = No Rise
! --- 1 = Briggs Rise
! --- 2 = Briggs rise modified for SS downwash
! --- 3 = Tabulated Rise
method=0
if(istype.EQ.1 .OR. istype.EQ.2) then
if(idw0(ipnum).EQ.4) then
! --- PRIME downwash active - Cavity plume (no rise)
method=0
elseif(idw0(ipnum).EQ.3) then
! --- PRIME downwash active - Primary plume (tabulated rise)
method=3
elseif(idw0(ipnum).EQ.2) then
! --- SS downwash active (modified Briggs rise)
method=2
elseif(idw0(ipnum).EQ.1) then
! --- HS downwash active (Briggs rise)
method=1
elseif(idw0(ipnum).EQ.0) then
if(mrise.EQ.1) then
! --- No downwash active, Briggs rise option
method=1
elseif(mrise.EQ.2) then
! --- No downwash active, Numerical rise option
method=3
else
write(io6,*)
write(io6,*) 'FATAL ERROR in GRISE: invalid MRISE'
write(io6,*) 'Expected MRISE = 1 or 2'
write(io6,*) 'Found MRISE = ',mrise
write(io6,*)
write(*,*)
stop 'Halted in GRISE -- See list file'
endif
else
write(io6,*)
write(io6,*) 'FATAL ERROR in GRISE: invalid IDW0'
write(io6,*) 'Expected IDW0 = 0,1,2,3, or 4'
write(io6,*) 'Found IDW0 = ',idw0(ipnum)
write(io6,*)
write(*,*)
stop 'Halted in GRISE -- See list file'
endif
endif
! --- Process gradual rise by source type
if(istype.EQ.1 .OR. istype.EQ.2) then
! --- POINT source
! --- ------------
! --- Control-file (1) or Variable Emissions File (2)
if(method.EQ.0) then
! --- No rise
htgrise=zfinal(ipnum)
lheight=.FALSE.
elseif(method.EQ.1) then
! --- Briggs Rise
! --- Get gradual momentum rise
call prm(diam0(ipnum),exitw0(ipnum),fm(ipnum),ws0(ipnum),&
istab0(ipnum),sqrts0(ipnum),x,xmfin(ipnum),&
zmfin(ipnum),risem)
! --- Get gradual buoyant rise
call prb(fb(ipnum),ws0(ipnum),x,xbfin(ipnum),zbfin(ipnum),&
riseb)
! --- Compute effects of vertical wind shear
if(mshear.eq.1)then
call prshear(fb(ipnum),ws0(ipnum),plexp0(ipnum),&
ht0(ipnum),x,xbfin(ipnum),zbfin(ipnum),risesh)
! --- Take the minimum of the Briggs rise and shear rise
riseb=amin1(riseb,risesh)
endif
! --- Pick the larger of the buoyant rise & momentum rise
rise=AMAX1(risem,riseb)
lheight=.TRUE.
elseif(method.EQ.2) then
! --- Schulman-Scire building downwash
call prss(x,zly0(ipnum),r0(ipnum),ws0(ipnum),&
istab0(ipnum),sqrts0(ipnum),diam0(ipnum),&
exitw0(ipnum),fm(ipnum),fb(ipnum),&
xmfin(ipnum),xbfin(ipnum),rise_SS)
! --- Possible limit to final rise is stored
rise=AMAX1(zbfin(ipnum),zmfin(ipnum))
rise=AMIN1(rise,rise_SS)
lheight=.TRUE.
elseif(method.EQ.3) then
! --- Tabulated Rise
! --- Can be used if puff was released during current
! --- met. period: IMET must be 1 for this puff
if(imet.EQ.1) then
! --- Check array size
if(ntr.LE.0) then
write(io6,*)
write(io6,*) 'FATAL ERROR in GRISE: invalid array'
write(io6,*) 'Expected NTR greater than 0'
write(io6,*) 'Found NTR = ',ntr
write(io6,*)
write(*,*)
stop 'Halted in GRISE -- See list file'
endif
call INTERTAB(x,ntr,xtr,i1,i2,factor)
htgrise=ztr(i1)+factor*(ztr(i2)-ztr(i1))
rise=htr(i1)+factor*(htr(i2)-htr(i1))
! --- Look at full final rise without streamline depression
! !!! if(zfrise.GT.0.0) risefac=rise/zfrise
riselast=htr(ntr)
if(riselast.GT.0.0) risefac=rise/riselast
lheight=.FALSE.
else
htgrise=zfinal(ipnum)
lheight=.FALSE.
endif
endif
elseif(istype.EQ.4) then
! --- BUOYANT AREA source (interpolate in rise table)
! --- -------------------
! --- Tabulated rise can be used if puff was released during current
! --- met. period: IMET must be 1 for this puff
if(imet.EQ.1) then
! --- Check array size
if(ntr.LE.0) then
write(io6,*)
write(io6,*) 'FATAL ERROR in GRISE: invalid array'
write(io6,*) 'Expected NTR greater than 0'
write(io6,*) 'Found NTR = ',ntr
write(io6,*)
write(*,*)
stop 'Halted in GRISE -- See list file'
endif
! --- Get rise
call prtab(x,ht0(ipnum),ntr,xtr,ztr,rise)
else
rise=zfrise
endif
lheight=.TRUE.
elseif(istype.EQ.5 .OR. istype.EQ.6) then
! --- LINE source
! --- -----------
! --- Tabulated rise can be used if puff was released during current
! --- or previous met. period: IMET must be 1 or 2 for this puff
if(imet.GT.2) then
rise=zfrise
else
! --- Check array size
if(ntr.LE.0) then
write(io6,*)
write(io6,*) 'FATAL ERROR in GRISE: invalid array'
write(io6,*) 'Expected NTR greater than 0'
write(io6,*) 'Found NTR = ',ntr
write(io6,*)
write(*,*)
stop 'Halted in GRISE -- See list file'
endif
! --- Get rise
call prbl(x,xshift,ntr,xtr,ztr,rise)
endif
lheight=.TRUE.
elseif(istype.EQ.10 .OR. istype.EQ.11) then
! --- FLARE source
! --- ------------
! --- Control-file (10) or Variable Emissions File (11)
if(mrise_fl.EQ.1) then
! --- Briggs Rise
! --- Get gradual momentum rise
call prm(diam0(ipnum),exitw0(ipnum),fm(ipnum),ws0(ipnum),&
istab0(ipnum),sqrts0(ipnum),x,xmfin(ipnum),&
zmfin(ipnum),risem)
! --- Get gradual buoyant rise
call prb(fb(ipnum),ws0(ipnum),x,xbfin(ipnum),zbfin(ipnum),&
riseb)
! --- Compute effects of vertical wind shear
if(mshear.eq.1)then
call prshear(fb(ipnum),ws0(ipnum),plexp0(ipnum),&
ht0(ipnum),x,xbfin(ipnum),zbfin(ipnum),risesh)
! --- Take the minimum of the Briggs rise and shear rise
riseb=amin1(riseb,risesh)
endif
! --- Pick the larger of the buoyant rise & momentum rise
rise=AMAX1(risem,riseb)
lheight=.TRUE.
elseif(mrise_fl.EQ.2) then
! --- Tabulated Rise
! --- Can be used if puff was released during current
! --- met. period: IMET must be 1 for this puff
if(imet.EQ.1) then
! --- Check array size
if(ntr.LE.0) then
write(io6,*)
write(io6,*) 'FATAL ERROR in GRISE: invalid array'
write(io6,*) 'Expected NTR greater than 0'
write(io6,*) 'Found NTR = ',ntr
write(io6,*)
write(*,*)
stop 'Halted in GRISE -- See list file'
endif
call INTERTAB(x,ntr,xtr,i1,i2,factor)
htgrise=ztr(i1)+factor*(ztr(i2)-ztr(i1))
rise=htr(i1)+factor*(htr(i2)-htr(i1))
riselast=htr(ntr)
if(riselast.GT.0.0) risefac=rise/riselast
lheight=.FALSE.
endif
else
write(io6,*)
write(io6,*) 'FATAL ERROR in GRISE: flag'
write(io6,*) 'Expected MRISE_FL = 1,2'
write(io6,*) 'Found MRISE_FL = ',mrise_fl