PageRenderTime 59ms CodeModel.GetById 24ms RepoModel.GetById 0ms app.codeStats 0ms

/OPENFVS_DIR_RESTRUCT_TEST_BRANCH/src/extensions/fire/fire/ni/src/fmcfmd.f

http://open-fvs.googlecode.com/
FORTRAN Legacy | 195 lines | 78 code | 21 blank | 96 comment | 0 complexity | 0690d0f9482f6948033386b68afbc9fa MD5 | raw file
  1. SUBROUTINE FMCFMD (IYR, FMD)
  2. IMPLICIT NONE
  3. C----------
  4. C **FMCFMD FIRE-NI-DATE OF LAST REVISION: 07/15/03
  5. C----------
  6. * SINGLE-STAND VERSION
  7. * CALLED FROM: FMBURN
  8. * PURPOSE:
  9. * THIS SUBROUTINE RETURNS TWO TYPES OF INFORMATION: THE FUEL MODEL
  10. * THAT WOULD BE USED IF THE STATIC FUEL MODEL OPTION IS SELECTED
  11. * (STORED AS IFMD(1), WITH A WEIGTH OF FWT(1)=1.0 AND THE CLOSEST
  12. * THE CLOSEST FUEL MODELS (UP TO 4) AND THEIR WEIGHTINGS FOR USE
  13. * BY THE DYNAMIC FUEL MODEL
  14. *----------------------------------------------------------------------
  15. *
  16. * CALL LIST DEFINITIONS:
  17. * FMD: FUEL MODEL NUMBER
  18. *
  19. *
  20. * COMMON BLOCK VARIABLES AND PARAMETERS:
  21. * SMALL: SMALL FUELS FROM DYNAMIC FUEL MODEL
  22. * LARGE: LARGE FUELS FROM DYNAMIC FUEL MODEL
  23. *
  24. ***********************************************************************
  25. C
  26. C.... PARAMETER INCLUDE FILES.
  27. C
  28. INCLUDE 'PRGPRM.F77'
  29. INCLUDE 'FMPARM.F77'
  30. C
  31. C.... COMMON INCLUDE FILES.
  32. C
  33. INCLUDE 'FMFCOM.F77'
  34. INCLUDE 'FMCOM.F77'
  35. INCLUDE 'CONTRL.F77'
  36. INCLUDE 'ARRAYS.F77'
  37. C
  38. C LOCAL VARIABLE DECLARATIONS
  39. C
  40. INTEGER ICLSS
  41. PARAMETER(ICLSS = 14)
  42. INTEGER IYR,FMD
  43. INTEGER IPTR(ICLSS), ITYP(ICLSS)
  44. INTEGER I,J,IDRY
  45. REAL X(2), Y(2), ALGSLP, WT1(2)
  46. REAL XPTS(ICLSS,2),EQWT(ICLSS),AFWT
  47. LOGICAL DEBUG
  48. C
  49. C FIXED VALUES FOR INTERPOLATION FUNCTION
  50. C
  51. DATA Y / 0.0, 1.0 /
  52. C
  53. C THESE ARE THE INTEGER TAGS ASSOCIATED WITH EACH FIRE MODEL
  54. C CLASS. THEY ARE RETURNED WITH THE WEIGHT
  55. C
  56. DATA IPTR / 1,2,3,4,5,6,7,8,9,10,11,12,13,14 /
  57. C
  58. C THESE ARE 0 FOR REGULAR LINES, -1 FOR HORIZONTAL AND 1 FOR
  59. C VERTICAL LINES. IF ANY OF THE LINES DEFINED BY XPTS() ARE OF
  60. C AN UNUSUAL VARIETY, THIS MUST BE ENTERED HERE SO THAT
  61. C SPECIAL LOGIC CAN BE INVOKED. IN THIS CASE, ALL THE LINE
  62. C SEGMENTS HAVE A |SLOPE| THAT IS > 0 AND LESS THAN INIF.
  63. C
  64. DATA ITYP / ICLSS * 0 /
  65. C
  66. C XPTS: FIRST COLUMN ARE THE SMALL FUEL VALUES FOR EACH FIRE MODEL
  67. C WHEN LARGE FUEL= 0 (I.E. THE X-INTERCEPT OF THE LINE). SECOND
  68. C COLUMN CONTAINS THE LARGE FUEL VALUE FOR EACH FIRE MODEL WHEN
  69. C SMALL FUEL=0 (I.E. THE Y-INTERCEPT OF THE LINE).
  70. C
  71. DATA ((XPTS(I,J), J=1,2), I=1,ICLSS) /
  72. > 5., 15., ! FMD 1
  73. > 5., 15., ! FMD 2
  74. > 5., 15., ! FMD 3
  75. > 5., 15., ! FMD 4
  76. > 5., 15., ! FMD 5
  77. > 5., 15., ! FMD 6
  78. > 5., 15., ! FMD 7
  79. > 5., 15., ! FMD 8
  80. > 5., 15., ! FMD 9
  81. > 15., 30., ! FMD 10 ! shares with 11
  82. > 15., 30., ! FMD 11
  83. > 30., 60., ! FMD 12 ! shares with 14
  84. > 45.,100., ! FMD 13
  85. > 30., 60./ ! FMD 14
  86. C
  87. C INITIALLY SET ALL MODELS OFF; NO TWO CANDIDATE MODELS ARE
  88. C COLINEAR, AND COLINEARITY WEIGHTS ARE ZERO. IF TWO CANDIDATE
  89. C MODELS ARE COLINEAR, THE WEIGHTS MUST BE SET, AND
  90. C MUST SUM TO 1, WRT EACH OTHER
  91. C
  92. DO I = 1,ICLSS
  93. EQWT(I) = 0.0
  94. ENDDO
  95. C BEGIN ROUTINE
  96. C
  97. CALL DBCHK (DEBUG,'FMCFMD',6,ICYC)
  98. IF (DEBUG) WRITE(JOSTND,1) ICYC,IYR,LUSRFM
  99. 1 FORMAT(' FMCFMD CYCLE= ',I2,' IYR=',I5,' LUSRFM=',L5)
  100. C IF USER-SPECIFIED FM DEFINITIONS, THEN WE ARE DONE.
  101. IF (LUSRFM) RETURN
  102. IF (DEBUG) WRITE(JOSTND,7) ICYC,IYR,HARVYR,LDYNFM,PERCOV,FMKOD,
  103. > SMALL,LARGE
  104. 7 FORMAT(' FMCFMD CYCLE= ',I2,' IYR=',I5,' HARVYR=',I5,
  105. > ' LDYNFM=',L2,' PERCOV=',F7.2,' FMKOD=',I4,
  106. > ' SMALL=',F7.2,' LARGE=',F7.2)
  107. C
  108. C SEE WHICH FUEL MODELS ARE ACTIVE. THE AMOUNT OF SMALL AND LARGE FUEL
  109. C PRESENT CAN MODIFY THE CHOICE OF MODEL, AS CAN THE HABITAT TYPE OR
  110. C WHEN THE LAST HARVEST ACTIVITY WAS DONE.
  111. C FROM FAX FROM ELIZABETH REINHARDT
  112. C
  113. C THE ORIGINAL RULE FROM J.BROWN WAS:
  114. C FMD = 9
  115. C IF (PERCOV .LE. 40.0) FMD = 1
  116. C HOWEVER, IT HAS BEEN ENHANCED WITH THE FOLLOWING CODE:
  117. C
  118. IDRY = 0
  119. CALL NIFMHAB(IDRY)
  120. SELECT CASE (IDRY)
  121. CASE (1) ! DRY GRASSY HABITAT CODES
  122. X(1) = 30.0
  123. X(2) = 50.0
  124. J = 2
  125. WT1(J) = ALGSLP(PERCOV,X,Y,2)
  126. WT1(J-1) = 1.0 - WT1(J)
  127. EQWT(1) = WT1(1)
  128. EQWT(9) = WT1(2)
  129. CASE (2) ! DRY SHRUBBY HABITAT CODES
  130. X(1) = 30.0
  131. X(2) = 50.0
  132. J = 2
  133. WT1(J) = ALGSLP(PERCOV,X,Y,2)
  134. WT1(J-1) = 1.0 - WT1(J)
  135. EQWT(2) = WT1(1)
  136. EQWT(9) = WT1(2)
  137. CASE DEFAULT ! ALL OTHER HABITAT CODES
  138. EQWT(8) = 1.0
  139. END SELECT
  140. C
  141. C END OF DETAILED LOW FUEL MODEL SELECTION
  142. C
  143. C DURING THE 5 YEARS AFTER AN ENTRY, AND ASSUMING THAT SMALL+LARGE
  144. C ACTIVIVITY FUELS HAVE JUMPED BY 10%, THEN MODEL 11 AND 14 ARE
  145. C CANDIDATE MODELS, SHARING WITH 10 AND 12 RESPECTIVELY. THE
  146. C WEIGHT OF THE SHARED RELATIONSHIP DECLINES FROM PURE 11 INITIALLY,
  147. C TO PURE 10 AFTER THE PERIOD EXPIRES. SIMILARLY, COMPUTE WEIGHT FOR
  148. C MODEL 14 ACTIVITY FUELS, SHARED WITH CURRENT MODEL 12. THE
  149. C RELATIONSHIP CHANGES IN THE SAME WAS AS THE 10/11 FUELS.
  150. C
  151. AFWT = MAX(0.0, 1.0 - (IYR - HARVYR) / 5.0)
  152. IF (SLCHNG .GE. SLCRIT .OR. LATFUEL) THEN
  153. LATFUEL = .TRUE.
  154. EQWT(11) = AFWT
  155. EQWT(14) = AFWT
  156. IF (AFWT .LE. 0.0) LATFUEL = .FALSE.
  157. ENDIF
  158. IF (.NOT. LATFUEL) AFWT = 0.0
  159. C
  160. C MODELS 10,12,13 ARE ALWAYS CANDIDATE MODELS FOR NATURAL FUELS
  161. C OTHER MODELS ARE ALSO CANDIDATES, DEPENDING ON COVER TYPE, ETC
  162. C
  163. EQWT(10) = 1.0 - AFWT
  164. EQWT(12) = 1.0 - AFWT
  165. EQWT(13) = 1.0
  166. C
  167. C CALL FMDYN TO RESOLVE WEIGHTS, SORT THE WEIGHTED FUEL MODELS
  168. C FROM THE HIGHEST TO LOWEST, SET FMD (UGING THE HIGHEST WEIGHT)
  169. C
  170. CALL FMDYN(SMALL,LARGE,ITYP,XPTS,EQWT,IPTR,ICLSS,LDYNFM,FMD)
  171. IF (DEBUG) WRITE (JOSTND,8) SLCHNG,FMD,LDYNFM
  172. 8 FORMAT (' FMCFMD, SLCHNG=', F5.1, ' FMD=',I4,' LDYNFM=',L2)
  173. RETURN
  174. END