!$Author$ !$Date$ !$Revision$ !$HeadURL$ subroutine cropinit(isr, crop) use weps_interface_defs, ignore_me=>cropinit use biomaterial, only: biomatter ! + + + ARGUMENT DECLARATIONS + + + integer isr type(biomatter), intent(inout) :: crop ! structure containing full crop description ! + + + PARAMETERS AND COMMON BLOCKS + + + include 'p1werm.inc' include 'c1info.inc' include 'c1gen.inc' include 'c1report.inc' include 'c1db1.inc' include 'c1db2.inc' include 's1layr.inc' include 'manage/tcrop.inc' include 'crop/gcrop.inc' ! + + + LOCAL VARIABLE DECLARATIONS + + + integer idx, row, newrow, i, dn, y, mo, d, k ! no crop growing at start of simulation crop%growth%am0cgf = .false. crop%growth%am0cif = .false. crop%mass%standstem = 0.0 crop%mass%standleaf = 0.0 crop%mass%standstore = 0.0 crop%mass%flatstem = 0.0 crop%mass%flatleaf = 0.0 crop%mass%flatstore = 0.0 crop%mass%flatrootstore = 0.0 crop%mass%flatrootfiber = 0.0 do idx = 1, size(crop%mass%rootstorez) crop%mass%stemz(idx) = 0.0 crop%mass%leafz(idx) = 0.0 crop%mass%storez(idx) = 0.0 crop%mass%rootstorez(idx) = 0.0 crop%mass%rootfiberz(idx) = 0.0 end do acxrow(isr) = 0.0 crop%geometry%zht = 0.0 crop%geometry%dstm = 0.0 crop%geometry%zrtd = 0.0 crop%growth%dayap = 0 crop%growth%thucum = 0.0 crop%growth%trthucum = 0.0 crop%geometry%grainf = 0.0 crop%deriv%mbgrootstore = 0.0 crop%deriv%mbgrootfiber = 0.0 crop%geometry%xstmrep = 0.0 crop%growth%fliveleaf = 0.0 crop%deriv%m = 0.0 crop%deriv%mst = 0.0 crop%deriv%mf = 0.0 crop%deriv%mrt = 0.0 do idx = 1, size(crop%deriv%mrtz) crop%deriv%mrtz(idx) = 0.0 end do crop%deriv%rsai = 0.0 crop%deriv%rlai = 0.0 do idx = 1, size(crop%deriv%rsaz) crop%deriv%rsaz(idx) = 0.0 crop%deriv%rlaz(idx) = 0.0 end do crop%deriv%ffcv = 0.0 crop%deriv%fscv = 0.0 crop%deriv%ftcv = 0.0 crop%database%xstm = 0.0 crop%database%rbc = 1 crop%database%covfact = 0.0 crop%database%ck = 0.0 ! initialize some derived globals for crop global variables crop%deriv%fcancov = 0.0 crop%deriv%rcd = 0.0 ! crop harvest reporting day counters cprevrotation(isr) = 1 ! initialize crop yield reporting parameters in case harvest call before planting crop%bname = '' acynmu(isr) = '' acycon(isr) = 1.0 acywct(isr) = 0.0 ! initialize crop type id to 0 indicating no crop type is growing ac0idc(isr) = 0 crop%database%sla = 0.0 acdpop(isr) = 0.0 ! initialize row placement to be on the ridge ac0rg(isr) = 1 ! initialize harvestable yield fraction flag crop%geometry%hyfg = 0 ! initialize decomp parameters since they are used before a crop is growing do idx = 1, size(crop%database%dkrate) crop%database%dkrate(idx) = 0.0 end do crop%database%ddsthrsh = 0.0 ! temporary crop atmstandstem(isr) = 0.0 atmstandleaf(isr) = 0.0 atmstandstore(isr) = 0.0 atmflatstem(isr) = 0.0 atmflatleaf(isr) = 0.0 atmflatstore(isr) = 0.0 atmflatrootstore(isr) = 0.0 atmflatrootfiber(isr) = 0.0 do idx = 1, mnsz atmbgstemz(idx,isr) = 0.0 atmbgleafz(idx,isr) = 0.0 atmbgstorez(idx,isr) = 0.0 atmbgrootstorez(idx,isr) = 0.0 atmbgrootfiberz(idx,isr) = 0.0 end do atzht(isr) = 0.0 atdstm(isr) = 0.0 atxstmrep(isr) = 0.0 atzrtd(isr) = 0.0 atgrainf(isr) = 0.0 ! temporary crop agmstandstem(isr) = 0.0 agmstandleaf(isr) = 0.0 agmstandstore(isr) = 0.0 agmflatstem(isr) = 0.0 agmflatleaf(isr) = 0.0 agmflatstore(isr) = 0.0 agmflatrootstore(isr) = 0.0 agmflatrootfiber(isr) = 0.0 do idx = 1, mnsz agmbgstemz(idx,isr) = 0.0 agmbgleafz(idx,isr) = 0.0 agmbgstorez(idx,isr) = 0.0 agmbgrootstorez(idx,isr) = 0.0 agmbgrootfiberz(idx,isr) = 0.0 end do agzht(isr) = 0.0 agdstm(isr) = 0.0 agxstmrep(isr) = 0.0 agzrtd(isr) = 0.0 aggrainf(isr) = 0.0 ! values that need initialization for cdbug calls (before initial crop entry) actdtm(isr) = 0 ac0shoot(isr) = 0.0 !debe initialize emergence and phenology variables. row = 4 newrow = 6 ! emergence variables crop%upgm%emrgflg = 0 crop%upgm%seedsw = 0 crop%upgm%gddtbg = 0.0 do idx = 1,row crop%upgm%ergdd(idx) = 0.0 crop%upgm%germgdd(idx) = 0.0 crop%upgm%wfpslo(idx) = 0.0 crop%upgm%wfpsup(idx) = 0.0 crop%upgm%soilwat(idx) = '' end do do idx = 1,newrow crop%upgm%egdd(idx) = 0.0 crop%upgm%ggdd(idx) = 0.0 end do ! phenology variables crop%upgm%pchron = 0.0 crop%upgm%phenolflg = 0 ! do i = 1,30 crop%upgm%dummy1(i) = '' crop%upgm%dummy2(i) = 0.0 end do ! crop%upgm%first7 = 0 crop%upgm%aepa = 0.0 ! ! gddcalc variables crop%upgm%callgdd = .true. ! !climate file name crop%upgm%cliname = ' ' ! !canopy height crop%upgm%ecanht = 0.0 crop%upgm%maxht = 0.0 crop%upgm%canopyflg = 0 crop%upgm%dayhtinc = 0.0 !growth_stress crop%upgm%growth_stress = 0 ! ! initialize arrays: ! debe added initialization for phenol variables dn = 999 !day number of the year (daynum) y = 0000 !year mo = 0 !month d = 0 !day ! growth stages arrays (daynum, year, mo, day) do i = 1,4 if (i==1) then crop%upgm%aifs(i) = dn crop%upgm%antes(i) = dn crop%upgm%antss(i) = dn crop%upgm%blstrs(i) = dn crop%upgm%browns(i) = dn crop%upgm%boots(i) = dn crop%upgm%cots(i) = dn crop%upgm%dents(i) = dn crop%upgm%doughs(i) = dn crop%upgm%drs(i) = dn crop%upgm%ears(i) = dn crop%upgm%ems(i) = dn crop%upgm%endlgs(i) = dn crop%upgm%epods(i) = dn crop%upgm%eseeds(i) = dn crop%upgm%fps(i) = dn crop%upgm%fullbs(i) = dn crop%upgm%germs(i) = dn crop%upgm%gpds(i) = dn crop%upgm%halfbs(i) = dn crop%upgm%heads(i) = dn crop%upgm%hrs(i) = dn crop%upgm%ies(i) = dn crop%upgm%ies2(i) = dn crop%upgm%infls(i) = dn crop%upgm%joints(i) = dn crop%upgm%lf1s(i) = dn crop%upgm%lf12s(i) = dn crop%upgm%lf2s(i) = dn crop%upgm%lf3s(i) = dn crop%upgm%lf4s(i) = dn crop%upgm%lf8s(i) = dn crop%upgm%mats(i) = dn crop%upgm%mffls(i) = dn crop%upgm%milks(i) = dn crop%upgm%mpods(i) = dn crop%upgm%mseeds(i) = dn crop%upgm%opens(i) = dn crop%upgm%silks(i) = dn crop%upgm%srs(i) = dn crop%upgm%tis(i) = dn crop%upgm%tsints(i) = dn crop%upgm%tss(i) = dn crop%upgm%yelows(i) = dn else if (i==2) then crop%upgm%aifs(i) = y crop%upgm%antes(i) = y crop%upgm%antss(i) = y crop%upgm%blstrs(i) = y crop%upgm%browns(i) = y crop%upgm%boots(i) = y crop%upgm%cots(i) = y crop%upgm%dents(i) = y crop%upgm%doughs(i) = y crop%upgm%drs(i) = y crop%upgm%ears(i) = y crop%upgm%ems(i) = y crop%upgm%endlgs(i) = y crop%upgm%epods(i) = y crop%upgm%eseeds(i) = y crop%upgm%fps(i) = y crop%upgm%fullbs(i) = y crop%upgm%germs(i) = y crop%upgm%gpds(i) = y crop%upgm%halfbs(i) = y crop%upgm%heads(i) = y crop%upgm%hrs(i) = y crop%upgm%ies(i) = y crop%upgm%ies2(i) = y crop%upgm%infls(i) = y crop%upgm%joints(i) = y crop%upgm%lf1s(i) = y crop%upgm%lf12s(i) = y crop%upgm%lf2s(i) = y crop%upgm%lf3s(i) = y crop%upgm%lf4s(i) = y crop%upgm%lf8s(i) = y crop%upgm%mats(i) = y crop%upgm%mffls(i) = y crop%upgm%milks(i) = y crop%upgm%mpods(i) = y crop%upgm%mseeds(i) = y crop%upgm%opens(i) = y crop%upgm%silks(i) = y crop%upgm%srs(i) = y crop%upgm%tis(i) = y crop%upgm%tsints(i) = y crop%upgm%tss(i) = y crop%upgm%yelows(i) = y else if (i==3) then crop%upgm%aifs(i) = mo crop%upgm%antes(i) = mo crop%upgm%antss(i) = mo crop%upgm%blstrs(i) = mo crop%upgm%browns(i) = mo crop%upgm%boots(i) = mo crop%upgm%cots(i) = mo crop%upgm%dents(i) = mo crop%upgm%doughs(i) = mo crop%upgm%drs(i) = mo crop%upgm%ears(i) = mo crop%upgm%ems(i) = mo crop%upgm%endlgs(i) = mo crop%upgm%epods(i) = mo crop%upgm%eseeds(i) = mo crop%upgm%fps(i) = mo crop%upgm%fullbs(i) = mo crop%upgm%germs(i) = mo crop%upgm%gpds(i) = mo crop%upgm%halfbs(i) = mo crop%upgm%heads(i) = mo crop%upgm%hrs(i) = mo crop%upgm%ies(i) = mo crop%upgm%ies2(i) = mo crop%upgm%infls(i) = mo crop%upgm%joints(i) = mo crop%upgm%lf1s(i) = mo crop%upgm%lf12s(i) = mo crop%upgm%lf2s(i) = mo crop%upgm%lf3s(i) = mo crop%upgm%lf4s(i) = mo crop%upgm%lf8s(i) = mo crop%upgm%mats(i) = mo crop%upgm%milks(i) = mo crop%upgm%mffls(i) = mo crop%upgm%mpods(i) = mo crop%upgm%mseeds(i) = mo crop%upgm%opens(i) = mo crop%upgm%silks(i) = mo crop%upgm%srs(i) = mo crop%upgm%tis(i) = mo crop%upgm%tsints(i) = mo crop%upgm%tss(i) = mo crop%upgm%yelows(i) = mo else if (i==4) then crop%upgm%aifs(i) = d crop%upgm%antes(i) = d crop%upgm%antss(i) = d crop%upgm%blstrs(i) = d crop%upgm%browns(i) = d crop%upgm%boots(i) = d crop%upgm%cots(i) = d crop%upgm%dents(i) = d crop%upgm%doughs(i) = d crop%upgm%drs(i) = d crop%upgm%ears(i) = d crop%upgm%ems(i) = d crop%upgm%endlgs(i) = d crop%upgm%epods(i) = d crop%upgm%eseeds(i) = d crop%upgm%fps(i) = d crop%upgm%fullbs(i) = d crop%upgm%germs(i) = d crop%upgm%gpds(i) = d crop%upgm%halfbs(i) = d crop%upgm%heads(i) = d crop%upgm%hrs(i) = d crop%upgm%ies(i) = d crop%upgm%ies2(i) = d crop%upgm%infls(i) = d crop%upgm%joints(i) = d crop%upgm%lf1s(i) = d crop%upgm%lf12s(i) = d crop%upgm%lf2s(i) = d crop%upgm%lf3s(i) = d crop%upgm%lf4s(i) = d crop%upgm%lf8s(i) = d crop%upgm%mats(i) = d crop%upgm%milks(i) = d crop%upgm%mffls(i) = d crop%upgm%mpods(i) = d crop%upgm%mseeds(i) = d crop%upgm%opens(i) = d crop%upgm%silks(i) = d crop%upgm%srs(i) = d crop%upgm%tis(i) = d crop%upgm%tsints(i) = d crop%upgm%tss(i) = d crop%upgm%yelows(i) = d end if end do !initialize CO2 arrays and variable do k = 1,10 crop%upgm%co2x(k) = 0.0 crop%upgm%co2y(k) = 0.0 end do return end