c c subroutine flat i (fltcoef, m cstand, cstems, o tflat, m dstand, dflat, dstems, i bflg) c + + + PURPOSE + + + c Process # 33 called from doeffect.for c c This subroutine performs the biomass manipulation process of transferring c standing biomass to flat biomass based upon a flatenning coefficient. c The standing component (either crop or a biomass pool) flattened c is determined by a flag which is set before the call to this c subroutine. The flag may contain any number of combinations c found below. c c Flags values (binary #'s actually) c bit no. decimal value c x - flatten standing material in all pools (0) c 0 - flatten standing crop (1) c 1 - flatten standing residue in decomp pool #1 (2) c 2 - flatten standing residue in decomp pool #2 (4) c 3 - flatten standing residue in decomp pool #3 (8) c c Note that biomass for any of these pools that are flattened c is transfered to the cooresponding flat pool. c c + + + KEYWORDS + + + c flatten, biomass manipulation include 'p1werm.inc' c c + + + ARGUMENT DECLARATIONS + + + real fltcoef real cstand real cstems real tflat real dstand(mnbpls),dflat(mnbpls),dstems(mnbpls) integer bflg c c + + + ARGUMENT DEFINITIONS + + + c c fltcoef - flattening coefficient of an implement (m^2/m^2) c cstand - (crop pool) standing biomass (kg/m^2) c cstems - (crop pool) number of standing crop stems (#/m^2) c tflat - (temporary crop pool) flat biomass (kg/m^2) c dstand - (decomp pool) standing biomass by age pool (kg/m^2) c dflat - (decomp pool) surface biomass by age pool (kg/m^2) c dstems - (decomp pool) number of standing residue stems (#/m^2) c c bflg - flag indicating what to cut c 0 - All standing material is cut (both crop and residue) c 1 - Crop is cut c 2 - 1'st residue pool c 4 - 2'nd residue pool c 8 - 3'rd residue pool c Note that any combination of pools or crop may be used c A bit test is done on the binary number to see what to modify c c + + + ACCESSED COMMON BLOCK VARIABLE DEFINITIONS + + + c c mnbpls - max number of biomass pools c c + + + PARAMETERS + + + c c + + + LOCAL VARIABLES + + + c integer i integer tflg c c + + + LOCAL VARIABLE DEFINITIONS + + + c c i - loop variable for decomp pools (3 pools total) c tflg - temporary biomass flag c c + + + END SPECIFICATIONS + + + c c set tflg bits correctly for "all" pools if bflg=0 if (bflg .eq. 0) then tflg = 1 ! crop pool do 10 i=1,mnbpls tflg = tflg + 2**i ! decomp pools 10 continue else tflg = bflg endif if (BTEST(tflg,0)) then ! flatten standing crop tflat = tflat + cstand * fltcoef cstand = cstand * (1.0 - fltcoef) cstems = cstems * (1.0 - fltcoef) ! reduce # of crop stems endif c do 40 i=1,mnbpls ! flatten standing residue if (BTEST(tflg,i)) then ! from specified decomp pools dflat(i) = dflat(i) + dstand(i) * fltcoef dstand(i) = dstand(i) * (1.0 - fltcoef) dstems(i) = dstems(i) * (1.0 - fltcoef) ! reduce # of residue stalks endif 40 continue end