subroutine phenolsw(isr, aepa,antes,antss,pdepth,bhfwsf,boots,cliname,cname,daa,dae, & & dap,daynum,ddae,ddap,dgdde,dgdds,drs,dummy2,emrgflg,ems, & & endphenol,first7,fps,gdda,gdde,gdds,gddwsf,gmethod,heads, & & hrs,ies,joints,lnpout,mats,pchron,pdate,seedbed,srs,tis,tss,& & year) ! ! the phenolsw subroutine ... finish description here. ! ! inputs: aepa(c,r), antes(c,r), antss(c,r), boots(c,r), dae(r), ! dap(r), daynum(r), ddae(20)(c), ddap(20)(c), ! dgdde(20)(c), dgdds(20)(c), ! drs(c,r), dummy2(15)(r), first7(c,r), fps(c,r), ! gdde(r), gdds(r), heads(c,r), hrs(c,r), ies(c,r), ! joints(c,r), mats(c,r), nolvs(c), pchron(r), srs(c,r), ! tis(c,r), tss(c,r) ! ! ! outputs: antes(c,r), antss(c,r), boots(c,r), ddae(20)(c), ! ddap(20)(c), dgdde(20)(c), dgdds(20)(c), ! drs(c,r), first7(c,r), fps(c,r), heads(c,r), ! hrs(c,r), ies(c,r), joints(c,r), mats(c,r), nolvs(c), ! srs(c,r), tis(c,r), tss(c,r) ! use file_io_mod, only: luophenol implicit none ! ! Dummy arguments ! integer, intent(in) :: isr ! subregion number real :: aepa,bhfwsf,gdda,gdde,gdds,pchron,pdepth character(80) :: cliname character(80) :: cname,seedbed integer :: daa,dae,dap,daynum,emrgflg,first7,gmethod,pdate,year logical :: endphenol integer,dimension(4) :: antes,antss,boots,drs,ems,fps,heads,hrs,ies,joints,mats,& & srs,tis,tss integer,dimension(20) :: ddae,ddap real,dimension(20) :: dgdde,dgdds real,dimension(30) :: dummy2 real,dimension(15,5) :: gddwsf real,dimension(100,2) :: lnpout ! ! Local variables ! real :: adjgdd integer :: i,j,row integer,dimension(4) :: pdatearr ! !debe changed upgm variable name 'bc0growdepth' to phenologymms variable name !of 'pdepth' to maintain consistency with phenologymms code. !debe added for writing out phenology info to a file. ! !debe changed dimensions of dummy 2 array for stressed and non-stressed values. !debe added bhfwsf to the call to each crop's phenol subroutine to ! implement daily water stress effect on time of reaching a growth stage !debe added initialized gddwsf array !debe added adjgdd value for use in returning the adjusted gdd value ! from the water_stress subroutine used in determining when a growth stage ! can be entered. !debe added this variable to stop the call to phenol !debe added cliname to write the climate location name to phenol.out ! ! + + + argument definitions + + + ! adjgdd - the adjusted gdd required to enter the growth stage. ! aepa - the parameter for duration of anthesis (i.e., gdd from start ! to end of anthesis ! antes - end of anthesis growth stage. this array includes daynum, year, ! month and day of when this stage was reached. ! antss - start of anthesis growth stage. this array includes daynum, year, ! month and day of when this stage was reached. ! bhfwsf - water stress factor ratio (0-1). this is read in daily. ! boots - booting growth stage. this array includes daynum, year, ! month and day of when this stage was reached. booting is ! defined as flag leaf has completed its growth. ! cliname - the name of the location for the climate data. ! cname - crop name. ! daa - days after anthesis. ! dae - days after emergence. ! dap - days after planting. ! daynum - the current day numbered from jan 1. ! ddae - an array holding the dae for each growth stage. ! ddap - an array holding the dap for each growth stage. ! dgdde - an array holding the gdde for each growth stage. ! dgdds - an array holding the gdds for each growth stage. ! drs - double ridge growth stage. this array includes daynum, year, ! month and day of when this stage was reached. ! dummy2 - an array to hold the gdd values, both under stressed ! and non- stressed conditions,required to reach each growth ! stage of the current crop. ! emrgflg - a flag to determine if the new emerge subroutine should be ! called (emrgflg=1) or to proceed with the weps/upgm method ! of achieving emergence (emrgflg=0). ! ems - day when emergence occurred. this array includes daynum, year, ! month and day of when this event occurred. ! endphenol - a flag to indicate if this subroutine should be called ! again on the next day. ! first7 - used to set the value of aepa the first time phenolsw is called. ! fps - flower primordium initiation growth stage. this array includes ! daynum, year, month and day of when this stage was reached. ! gdda - growing degree days from anthesis. ! gdde - growing degree days from emergence. ! gdds - growing degree days from seeding. ! gddwsf - an array to hold the gn and gs gdd values plus the high and ! low water stress factor values. these are used in calculating ! the slope of the line for each growth stage and this is then ! used to calculate the adjusted gdd value for the current ! growth stage. ! column one contains the gn values and is y2. ! column two contains the gs value and is y1. ! column three contains wsfhi (high water stress) and is x1. ! column four contains wsflo (low water stress) and is x2. ! column five contains the adjgdd value for the stage. ! gmethod - selects the method whereby gdd will be calculated. a value ! of 1 corresponds to method 1 in phenologymms and is used ! for crops such as winter wheat, winter barley and proso ! millet. a value of 2 corresponds to method 2 in ! phenologymms and is used for crops such as corn, sorghum ! and sunflower. a value of 3 is the way that weps/upgm ! calculated ggd for the day. ! heads - heading growth stage. this array includes daynum, year, ! month and day of when this stage was reached. ! hrs - time to harvest ripe growth stage. this array includes daynum, ! year, month and day of when this stage was reached. ! ies - start of internode elongation growth stage. this array includes ! daynum, year, month and day of when this stage was reached. ! joints - jointing growth stage. this array includes daynum, year, ! month and day of when this stage was reached. ! lnpout - an array used in writing out daynum and the number of leaves ! on that day. the values are written each time a new leaf has ! appeared. ! mats - physiological maturity growth stage. this array includes daynum, ! year, month and day of when this stage was reached. ! pchron - phyllochron value which is the number of gdd per leaf. ! pdate - planting date. ! pdepth - depth of growing point at time of planting (m). ! bc0growdepth is assed into pdepth. ! seedbed - contains the soil moisture condition of the seedbed. ! srs - single ridge growth stage. this array includes daynum, year, ! month and day of when this stage was reached. ! tis - start of tillering growth stage. this array includes daynum, year, ! month and day of when this stage was reached. ! tss - terminal spikelet growth stage. this array includes daynum, year, ! month and day of when this stage was reached. ! year - year. ! + + + local variable definitions + + + ! i - this tells which row is to be read in from the dummy2 array. ! j - a counter variable for outputting the leaf number array. ! pdatearr - the planting date array. it contains the daynum, ! year, month and day that planting occurred. ! row - this holds the row to be filled in the gddwsf array in the ! water_stress subroutine. ! initialize local variables j = 1 !debe initialize planting date array do i = 1,4 pdatearr(i) = 0 end do pdatearr(2) = year if (first7==0) then aepa = 120. ! this is the value for crops which use method 1 ! for gdd calculation. first7 = 1 end if ! emergence has occurred so fill the first row in the gddwsf array (only ! print for the first period from e to tiller initiation): if ((ems(1)/=999).and.(tis(1)==999)) then row = 1 i = 1 call water_stress(adjgdd,bhfwsf,dummy2,gddwsf,row,i) end if ! ! ******* fill growth stage arrays ******* !debe added code to change the adjusted value in gddwsf only when ! the growth stage has been reached. ! start of tillering: if (tis(1)==999) then row = 2 i = 2 call water_stress(adjgdd,bhfwsf,dummy2,gddwsf,row,i) if (gdde>=gddwsf(2,5)) then tis(1) = daynum tis(2) = year call date1(tis) ddap(2) = dap ddae(2) = dae dgdds(2) = gdds dgdde(2) = gdde print *,'tis = ',tis end if end if ! single ridge growth stage: ! single ridge occurs dummy2(3) gdd after vernalization, which is ! assumed to have occurred by midwinter (jan. 1 or july 1) for winter ! wheat, or after emergence for spring wheat and spring barley. !debe accumulate gdd simultaneously with that accumualted for tis stage. if (srs(1)==999) then row = 3 i = 3 call water_stress(adjgdd,bhfwsf,dummy2,gddwsf,row,i) if (gdde>=gddwsf(3,5)) then srs(1) = daynum srs(2) = year call date1(srs) ddap(3) = dap ddae(3) = dae dgdds(3) = gdds dgdde(3) = gdde print *,'srs = ',srs end if ! double ridge growth stage: ! double ridge occurs dummy2(4) gdd phyllochrons after single ridge growth ! stage. do not allow additional stages to occur on same day dr ! is reached. else if (drs(1)==999) then row = 4 i = 4 call water_stress(adjgdd,bhfwsf,dummy2,gddwsf,row,i) if (gdde>=(gddwsf(3,5)+gddwsf(4,5))) then drs(1) = daynum drs(2) = year call date1(drs) ddap(4) = dap ddae(4) = dae dgdds(4) = gdds dgdde(4) = gdde print *,'drs = ',drs end if ! flower primordium initiation: ! flower primordium initiation begins 0.3 phyllochrons after ! double ridge. else if (fps(1)==999) then ! debe skip writing to row 5 in gddwsf array so that 0's will show if (gdde>=(gddwsf(3,5)+gddwsf(4,5)+(0.3*pchron))) then fps(1) = daynum fps(2) = year call date1(fps) ddap(7) = dap ddae(7) = dae dgdds(7) = gdds dgdde(7) = gdde print *,'fps = ',fps end if ! terminal spikelet stage: else if ((tss(1)==999).and.(ies(1)==999)) then !debe changed following code so that the correct row in gddwsf array will be ! filled with the terminal spikelet information on the row for terminal ! spikelet (row 7) and row 5 will be skipped because fps is on that row and ! filled with zeros. need to read in value in row 5 in the dummy2 array. row = 7 i = 5 !debe changed the following code to add rows 3 and 4 to row 7 in gddwsf array. call water_stress(adjgdd,bhfwsf,dummy2,gddwsf,row,i) !debe changed last row to be added to rows 3 and 4 to row 7 in gddwsf because ! row 5 was left filled with zeros in the fps stage and ies stage corresponds ! to row 6. the tss stage needs to be in row 7. if (gdde>=(gddwsf(3,5)+gddwsf(4,5)+gddwsf(7,5))) then tss(1) = daynum tss(2) = year call date1(tss) ddap(5) = dap ddae(5) = dae dgdds(5) = gdds dgdde(5) = gdde print *,'tss = ',tss end if ! start of internode elongation: ! internode elongation begins dummy2(5) gdd phyllochrons after double ridge ! growth stage. !debe moved this to be part of the code for tss because both stages can ! occur at the same time. !debe changed the following code so that the correct row in gddwsf array is ! filled with the start of internode elongation information on the row for ! internode elongation and row 5 is skipped because fps is in that row and ! filled with zeros. need to read in value in row 5 in the dummy2 array. row = 6 i = 5 call water_stress(adjgdd,bhfwsf,dummy2,gddwsf,row,i) !debe changed last row to be added to rows 3 and 4 to be row 6 in gddwsf ! because row 5 was left filled with zeros in the fps stage. if (gdde>=(gddwsf(3,5)+gddwsf(4,5)+gddwsf(6,5))) then ies(1) = daynum ies(2) = year call date1(ies) ddap(6) = dap ddae(6) = dae dgdds(6) = gdds dgdde(6) = gdde print *,'ies = ',ies end if ! jointing growth stage prediction: else if (joints(1)==999) then row = 8 i = 6 call water_stress(adjgdd,bhfwsf,dummy2,gddwsf,row,i) !debe changed following code to add rows 7 and 8 of gddwsf array to ! rows 3 and 4 because row 7 is for end spikelet initiation and ! row 8 is for jointing. if (gdde>=(gddwsf(3,5)+gddwsf(4,5)+gddwsf(7,5)+gddwsf(8,5))) then joints(1) = daynum joints(2) = year call date1(joints) ddap(8) = dap ddae(8) = dae dgdds(8) = gdds dgdde(8) = gdde print *,'joints = ',joints end if ! booting growth stage: this is defined as flag leaf has ! completed its growth. else if (boots(1)==999) then row = 9 i = 7 ! this is the correct row for booting in dummy2 array. call water_stress(adjgdd,bhfwsf,dummy2,gddwsf,row,i) !debe changed following code to add rows 7, 8 and 9 of gddwsf array to ! rows 3 and 4 because row 7 is for end spikelet initiation, row 8 is for ! jointing and row 9 is for booting. if (gdde>=(gddwsf(3,5)+gddwsf(4,5)+gddwsf(7,5)+gddwsf(8,5)+gddwsf(9,5))) then boots(1) = daynum boots(2) = year call date1(boots) ddap(9) = dap ddae(9) = dae dgdds(9) = gdds dgdde(9) = gdde print *,'boots = ',boots end if ! heading growth stage: ! if enough gdd have passed, then heading begins. go to ! code for next stage since anthesis is allowed to occur on same day ! as heading if enough degree-days accumulated today. else if (heads(1)==999) then row = 10 i = 8 call water_stress(adjgdd,bhfwsf,dummy2,gddwsf,row,i) !debe changed following code to add rows 7,8,9 and 10 of gddwsf array to ! rows 3 and 4 because row 7 is for end spikelet initiation, row 8 is for ! jointing, row 9 is for booting and 10 is for heading. if (gdde>=(gddwsf(3,5)+gddwsf(4,5)+gddwsf(7,5)+gddwsf(8,5)+gddwsf(9,5) & & +gddwsf(10,5))) then heads(1) = daynum heads(2) = year call date1(heads) ddap(10) = dap ddae(10) = dae dgdds(10) = gdds dgdde(10) = gdde print *,'heads = ',heads end if ! beginnning of anthesis: ! allow end of anthesis to occur on same day if enough degree-days have ! accumulated today. else if (antss(1)==999) then row = 11 i = 9 call water_stress(adjgdd,bhfwsf,dummy2,gddwsf,row,i) !debe changed following code to add rows 7, 8, 9, 10 and 11 of gddwsf array ! to rows 3 and 4 because row 7 is for end spikelet initiation, row 8 is for ! jointing, row 9 is for booting, row 10 is for heading and row 11 is for ! anthesis starts. if (gdde>=(gddwsf(3,5)+gddwsf(4,5)+gddwsf(7,5)+gddwsf(8,5)+gddwsf(9,5) & & +gddwsf(10,5)+gddwsf(11,5))) then antss(1) = daynum antss(2) = year call date1(antss) ddap(11) = dap ddae(11) = dae dgdds(11) = gdds dgdde(11) = gdde print *,'antss = ',antss end if ! end of anthesis: else if (antes(1)==999) then ! i = 12 no row in dummy2 array corresponds to antes. !debe changed following code to add the correct rows in gddwsf array as ! noted above. anthesis ends has the same additions as anthesis starts with ! the additional value of the aepa parameter. if (gdde>=(gddwsf(3,5)+gddwsf(4,5)+gddwsf(7,5)+gddwsf(8,5)+gddwsf(9,5) & & +gddwsf(10,5)+gddwsf(11,5)+aepa)) then antes(1) = daynum antes(2) = year call date1(antes) ddap(12) = dap ddae(12) = dae dgdds(12) = gdds dgdde(12) = gdde print *,'antes = ',antes end if ! physiological maturity: else if (mats(1)==999) then row = 13 i = 10 call water_stress(adjgdd,bhfwsf,dummy2,gddwsf,row,i) !debe changed following code to add rows 7, 8, 9, 10, 11 and 13 of gddwsf ! array to rows 3 and 4 because row 7 is for end spikelet initiation, row 8 ! is for jointing, row 9 is for booting, row 10 is for heading, row 11 is for ! anthesis starts and row 13 is for physiological maturity. row 12 is used ! for anthesis ends and is left filled with zeros in gddwsf array. if (gdde>=(gddwsf(3,5)+gddwsf(4,5)+gddwsf(7,5)+gddwsf(8,5)+gddwsf(9,5) & & +gddwsf(10,5)+gddwsf(11,5)+gddwsf(13,5))) then mats(1) = daynum mats(2) = year call date1(mats) ddap(13) = dap ddae(13) = dae dgdds(13) = gdds dgdde(13) = gdde print *,'mats = ',mats end if ! time to harvest ripe: else if (hrs(1)==999) then row = 14 i = 11 call water_stress(adjgdd,bhfwsf,dummy2,gddwsf,row,i) !debe changed following code to add rows 7, 8, 9, 10, 11, 13 and 14 of gddwsf ! array to rows 3 and 4 because row 7 is for end spikelet initiation, row 8 ! is for jointing, row 9 is for booting, row 10 is for heading, row 11 is for ! anthesis starts, row 13 is for physiological maturity and row 14 is for ! harvest ready. row 12 is used for anthesis ends and is left filled with ! zeros in gddwsf array. if (gdde>=(gddwsf(3,5)+gddwsf(4,5)+gddwsf(7,5)+gddwsf(8,5)+gddwsf(9,5) & & +gddwsf(10,5)+gddwsf(11,5)+gddwsf(13,5)+gddwsf(14,5))) then hrs(1) = daynum hrs(2) = year call date1(hrs) ddap(14) = dap ddae(14) = dae dgdds(14) = gdds dgdde(14) = gdde print *,'hrs = ',hrs end if end if ! ! ******* output data ******* ! output information from each crop's phenol subroutine. ! print to the screen: if (hrs(1)/=999) then print *,'crop is: ',cname print *,'gdds = ',gdds print *,'dap = ',dap print *,'gdde = ',gdde print *,'dae = ',dae print *,'gdda = ',gdda print *,'daa = ',daa print *,'year = ',year ! fill pdatearr pdatearr(1) = pdate call date1(pdatearr) ! heading for leaf number table write (luophenol(isr),1000) cname ! write out a table with leaf numbers by doy do while (lnpout(j,2)