c c subroutine trans i (sr,tf, i stand,roott,nlay, i cropht,rootdt, i cropname,croppop) c + + + PURPOSE + + + c c This subroutine performs the biomass manipulation of transfering c biomass. Transfer of biomass is performed on both the standing c or above ground biomass and the root biomass. It is assumed that c the same fraction of root ans crop mass are killed. c c c + + + KEYWORDS + + + c transfer, biomass manipulation *$noereference include 'p1werm.inc' include 's1layr.inc' include 'c1glob.inc' include 'manage/harv.inc' *$reference c c + + + ARGUMENT DECLARATIONS + + + c real stand,roott real cropht,rootdt,croppop c c + + + ARGUMENT DEFINITIONS + + + c c cropht - current crop height (m) c croppop - crop population (number of stems) c a (-1) indicates the crop is below ground c roott - crop root biomass (kg / m^2) NOT!! by layer c rootdt - crop root depth (m) c stand - standing crop biomass (kg / m^2) c yield - crop yield (kg / m^2) c c + + + ACCESSED COMMON BLOCK VARIABLE DEFINITIONS + + + c c mnbpls - max number of decomposition pools (currently=3) c mnsz - max number of soil layers c nslay - number of soil layers used in a subregion c c + + + PARAMETERS + + + c c + + + LOCAL VARIABLES + + + c character cropname*80 integer sr,j,k,lay,nlay,rtlay,rootlay real s,ss,ad,bd,dd,ratio(mnsz) real tf real flatmass,standmass,bgmass(mnsz),rtmass(mnsz) c c + + + LOCAL VARIABLE DEFINITIONS + + + c c ad - begining limit of integration for the triangular root distribution (mm) c bd - endind limit of integration for the triangular root distribution (mm) c bgmass - temporary below ground mass / layer (kg / m^2) c dd - root depth for all layers summed (mm) c flatmass - temporary flatmass pool (kg / m^2) c j - loop variable for # of integration steps in trapzd.for c k - loop variable for # of layers containing root mass c lay - number of layers in a specified subregion c nlay - number of layers in the tillage zone c ratio - ratio of total area roots are in to area in a layer c containing roots. Should always be < 1.0 and sum of c ratios should add up to 1.0. Used to determing root c in individual layers. c rtlay - number of layers containing root mass c rtmass - temporary rootmass pool / layer (kg / m^2) c s - returned value for the integrated function used c to determine root mass distribution. s containes c the integral for the entire root depht c (or more accuratly all layers containing roots) c ss - returned value for the integrated function used c to determine root mass distribution. ss containes c the integration over over a single layer. c standmass - temporary standing mass pool (kg / m^2) c all temporary pools are used when the call to kill (dechrv.for) is c made. The variables get stuck in the first biomass pool. c + + + END SPECIFICATIONS + + + c Remove nothing. Put current crop into most recent decomp pool. Note c there is no need to pass cutht and other percentages if this is what c is being done. May want to implement this in another routine somewhere do 70 lay=1,nslay(sr) c zero out the current live crop root biomass c bgmass(lay) = acmbgr(lay) c bgmass(lay)=(1.0-tf)*bgmass(lay) bgmass(lay)=(1.0-tf)*acmrtz(lay,sr) 70 continue c place the transfered crop fraction into the temp variable standmass c which will later be transfered to the 1'st residue pool. standmass=stand*tf c set the temp. variable flatmass to zero because we assume you c can't have a previously live crop that is considered flat. flatmass=0.0 c Kill root mass and transfer it to the first decomp pool c This will need to be done along with several process above. c For you kill the crop and remove it the rootmass needs to be c placed into the decomp pools c The following code allocates rootmass to each layer based on c a function. The function currently used is in func.for and is c a straight line which represents a triangular distribution c for the root mass. This function can be changed. The c subroutine trapzd is an algorithm which integrates a function c over the limits a to b (see description in trapzd.for). The c function rootlay determines the # of layers a root is in. rtlay=rootlay(rootdt,aszlyt(1,sr),nslay(sr)) dd=0.0 ss=0.0 s=0.0 ad=0.0 bd=0.0 do 32 k=1,rtlay dd=dd+aszlyt(k,sr) 32 continue c print *,'dd=',dd do 31 j=1,4 call trapzd(0.0,dd,ss,j) 31 continue c print *,'ss=',ss do 33 k=1,rtlay c print *,aszlyt(k,sr) ad=bd bd=bd+aszlyt(k,sr) c print *,ad,bd do 34 j=1,4 call trapzd(ad,bd,s,j) 34 continue c ratio is calculated by taking the area in a rectangle and c subtracting off the area under the line specified in func.for. ratio(k)=(0.5*dd*(bd-ad)-s)/(0.5*dd**2-ss) c print *,ratio(k) s=0.0 33 continue c Update the rootmass in each layer based on the area ratios. c The integration is done from bottom to top and the ratio is also c calculated this way so when updating rtmass need to go from top c to bottom thus "(rtlay-lay+1)" Also only place a fraction of the c root mass into the temporary rootmass variable. c print *, 'rootmass from remove', roott do 35 lay=1,rtlay rtmass(lay)=roott*ratio(rtlay-lay+1)*tf c print *, 'rtmass from remove', rtmass(lay) 35 continue c c make a call to dochrv to increment the biomass pools c call dechrv(sr,cropname,standmass,flatmass,bgmass(1), c & rtmass(1),cutht,croppop) end