c subroutine doeffect (sr) c c + + + PURPOSE + + + c Doeffect is called when an effect line is found in the prfind c subroutine. Doeffect reads in any coefficients associated with the c effect. Doeffect then makes a call to a subroutine which, in turn, c modifies the state variables to mimic the effects of doing the c effect. C C Edit History C 19-Feb-99 wjr put selection into case statement C 19-Feb-99 wjr removed iunit; cvt to using mtbl C 20-Feb-99 wjr used skpnam to parse tbl lines C c c + + + KEYWORDS + + + c tillage, process, management c c + + + PARAMETERS AND COMMON BLOCKS + + + include 'p1werm.inc' include 'm1flag.inc' include 'm1sim.inc' include 'm1dbug.inc' include 's1layr.inc' include 's1layd.inc' include 's1agg.inc' include 's1sgeo.inc' include 's1phys.inc' include 's1surf.inc' include 's1dbh.inc' include 's1dbc.inc' include 'c1gen.inc' include 'c1db1.inc' include 'c1glob.inc' include 'c1info.inc' include 'd1glob.inc' include 'd1gen.inc' include 'h1hydro.inc' include 'h1db1.inc' include 'decomp/decomp.inc' include 'manage/oper.inc' include 'manage/asd.inc' include 'manage/man.inc' include 'manage/harv.inc' include 'manage/mproc.inc' include 'manage/tcrop.inc' c c + + + ARGUMENT DECLARATIONS + + + integer sr c + + + ARGUMENT DEFINITIONS + + + c sr - the number of subregions c c + + + ACCESSED COMMON BLOCK VARIABLE DEFINITIONS + + + c c acdpop - crop seeding density c acrlai - crop leaf area index c aheaep - soil air entery potential c ahrwc - soil water content (mass bases) c ahrwca - available soil water content c ahrwcf - 1/3 bar soil water content c ahrwcs - saturation soil water content c ahrwcw - 15 bar soil water content c am0cgf - flag to call crop growth between plant and harvest c am0hrvfl - flag to determine if the crop is perennial and killed c during a harvest. Values are c 0 - no harvesting being done c 1 - perennial crop which is NOT killed c 2 - annual crop which is killed c am0tdb - flag for outputing debug information to a file c 0 - no output c 1 - output to file ../out/tdbug.out c am0tfl - flag for outputing management operations to a file c 0 - no output c 1 - output to file ../out/manage.out c as0ags - aggr. size geom. mean std. dev. c as0ph - soil Ph c asargo - ridge orientation (clockwise from true North) (degrees) c ascmg - magnesium ion concentration c ascna - sodium ion concentration c asdadg - aggregrate density c asdblk - soil layer bulk density c aseags - dry aggregrate stability c asfcce - fraction of calcium carbonate c asfcec - cation exchange capcity c asfcla - fraction of clay c asfesp - exchangable sodium percentage c asfnoh - organic N concentration of humus c asfom - fraction of organic matter c asfpoh - organic P concentration of humus c asfpsp - fraction of fertilizer P that is labile c asfsan - fraction of sand c asfsil - fraction of silt c asfsmb - sum of bases c aslagm - aggr. size geom. mean diameter (mm) c aslagn - min. aggr. size of each layer (mm) c aslagx - max aggr. size of each layer (mm) c aslrr - Allmaras random roughness parameter (mm) c asxrgs - ridge spacing (mm) c asxrgw - ridge width (mm) c aszlyt - soil layer thickness (mm) c aszrgh - ridge height (mm) c efcode - the effect id number c prname - the effect name c + + + LOCAL VARIABLES + + + integer flag,rdgflag,bflg real massf (msieve+1,mnsz) real alpha, beta, mu, rho real rrimpl c real intens, rrimpl real kappa real tibcp,ros real grainf,cropf,decompf,bgf real rdght,rdgwt,rdgspac,dikeht,dikespac real af,cf,mf,tf real irrig real rdght1 character*1 efdumy character*80 line integer idx c c + + + LOCAL VARIABLE DEFINITIONS + + + c c alpha - parameter reflecting the breakage of all soil c aggregrates regardless of size c beta - parameter reflecting the uneveness of breakage among c aggregrates in different size classes c bgf - percent of below ground mass to be removed c buryf - fraction of mass to be buried c cropf - percent of crop to be removed c kappa - fraction of the crust destroyed during a tillage operation c decompf - percent if decomp pool material to be removed c dikeht - dike height (mm) c dikespac - dike spacing (mm) c flag - flag used in the remove subroutine which determines c what needs to be removed c fltcoef - flattening coefficient of an implement c grainf - percent of grain to be removed c harvflag - flag indicating a harvest c intens - tillage intensity factor c liftf - fraction of mass to be lifted c massf - mass fractions of aggregrates within sieve cuts c (sum of all the mass fractions are expected to be 1.0) c tarea - fraction of the surface tilled c rdght - ridge height (mm) c rdght1 - tmp variable - ridge height (mm) c rdgflag - flag indicating whether ridge modifications are needed c rdgspac - ridge spacing (mm) c rdgwt - ridge top width (mm) c rrimpl - assigned nominal RR value for the tillage operation (mm) c tibcp - tillage intensity factor used for below tillage compaction c mu - loosening coefficient (0 <= mu <= 1) c rho - mixing coefficient (0 <= rho <= 1) c irrig - irrigation quantity for a day (mm) c c + + + SUBROUTINES CALLED + + + c c asd2m - aggregate size distribution to mass fraction converter c burylift - performs the biomass transfer either into the soil c or from the soil to the surface (deals with decomp c pools only c crush - the crushing effect c crust - destroys a cursted surface depending on the operation that c is performed c invert - performs an inversion of the vertical soil layers c loosn - performs the loosen/compact effect c m2asd - mass fraction to aggregate size distribution converter c mix - mixes components in specified layers c orient - calculates the oriented roughness c remove - performs the biomass removal during a harvest, burn, etc. c and updates the decomposition pools accordingly. c rough - calculated the post tillage random roughness c tdbug - subroutine which writes out variables for debugging purposes c c + + + FUNCTION DECLARATONS + + + integer tillay integer skpnam integer lentrm c c + + + DATA INITIALIZATIONS + + + c None c c + + + OUTPUT FORMATS + + + 2015 format (' Effect code ',i2,1x,'Effect ',1x,a20 ) c c + + + END SPECIFICATIONS + + + data massf /110*0/ line = mtbl(mcur(sr)) read(line, 1001, err=901) efdumy, efcode, efname 1001 format(a1,1x,i2,1x,a) C if (am0tfl .eq. 1) write (15,2015) efcode,efname C C*** print*, 'SR',sr,' Performing effect:', C*** & efcode,' ',efname c Default all flatten, bury, and lift processes to "all" biomass c for now. bioflg = 15 c c effect calls follow select case (efcode) C case (1) c-----START crust breakdown effect (effect code 01) c pre-effect stuff kappa = 1.0 ! *** NOTE that kappa is NOT being read from file if (am0tdb .eq. 1) then write (29,*) write (29,*) '//Before crust breakdown effect//' call tdbug(sr, nslay(sr),efcode) end if am0til = .true. !set flag for surface modification c do effect call crust(kappa,tarea,asfcr(sr),asflos(sr),asmlos(sr)) c post-effect stuff if (am0tdb .eq. 1) then write (29,*) '//After crust breakdown effect//' call tdbug(sr, nslay(sr),efcode) end if c-----END crust breakdown effect (effect code 01) case (2) c-----START random roughness effect (effect code 02) c pre-effect stuff if (am0tdb .eq. 1) then write (29,*) write (29,*) '//Before random roughness effect//' call tdbug(sr, nslay(sr),efcode) end if c read the random roughness for the implement, tillage intensity c factor, and the fraction of the surface tilled from the data file read(line(skpnam(line):lentrm(line)), *, err=901) rrimpl am0til = .true. !set flag for surface modification c do effect call rough(rrimpl,ti,tarea,aslrr(sr)) c post-effect stuff if (am0tdb .eq. 1) then write (29,*) '//After random roughness effect//' call tdbug(sr, nslay(sr),efcode) end if c-----END random roughness effect (effect code 02) case (3) c-----START oriented roughness ridge only effect (effect code 03) c pre-effect stuff if (am0tdb .eq. 1) then write (29,*) write (29,*) '//Before oriented roughness1 effect//' call tdbug(sr, nslay(sr),efcode) end if c read the oriented roughness (ridge) parameters for the implement read(line(skpnam(line):lentrm(line)), *, err=901) & rdght, rdgspac, rdgwt, rdgflag rdght1 = aszrgh(sr) !keep initial ridge height value am0til = .true. !set flag for surface modification c do effect call orient1(aszrgh(sr),asxrgw(sr),asxrgs(sr),asargo(sr), & rdght,rdgwt,rdgspac,tdir,tdepth,rdgflag) c post-effect stuff !if the ridge height changed or is very small, !then assume any dikes got destroyed if (rdght1 .ne. aszrgh(sr) .or. (aszrgh(sr) .le. 0.1)) then asxdkh(sr) = 0.0 asxdks(sr) = 0.0 end if if (am0tdb .eq. 1) then write (29,*) '//After oriented roughness effect//' call tdbug(sr, nslay(sr),efcode) end if c-----END oriented roughness effect (effect code 03) case (4) c-----START oriented roughness effect dike only (effect code 04) c pre-effect stuff if (am0tdb .eq. 1) then write (29,*) write (29,*) '//Before oriented roughness2 effect//' call tdbug(sr, nslay(sr),efcode) end if c read the oriented roughness (dike) parameters for the implement read(line(skpnam(line):lentrm(line)), *, err=901) * dikeht, dikespac, rdgflag c NOTE: we don't need rdgflag anymore - LEW am0til = .true. !set flag for surface modification c do effect call orient2(asxdkh(sr),asxdks(sr),dikeht,dikespac) c post-effect stuff if (am0tdb .eq. 1) then write (29,*) '//After oriented roughness effect//' call tdbug(sr, nslay(sr),efcode) end if c-----END oriented roughness dike only effect (effect code 04) case (5) c-----START oriented roughness effect (effect code 05) c pre-effect stuff if (am0tdb .eq. 1) then write (29,*) write (29,*) '//Before oriented roughness effect//' call tdbug(sr, nslay(sr),efcode) end if c read the oriented roughness parameters for the implement read(line(skpnam(line):lentrm(line)), *, err=901) * rdght, rdgspac, rdgwt, dikeht, dikespac, rdgflag c NOTE: we don't need rdgflag anymore - LEW am0til = .true. !set flag for surface modification c do effect call orient(aszrgh(sr),asxrgw(sr),asxrgs(sr),asargo(sr), & asxdkh(sr),asxdks(sr), & rdght,rdgwt,rdgspac,tdir,dikeht,dikespac) c post-effect stuff if (am0tdb .eq. 1) then write (29,*) '//After oriented roughness effect//' call tdbug(sr, nslay(sr),efcode) end if c-----END oriented roughness effect (effect code 05) case (11) c-----START crushing effect (effect code 11) c pre-effect stuff if (am0tdb .eq. 1) then write (29,*) write (29,*) '//Before crushing effect//' call tdbug(sr, nslay(sr),efcode) end if c c Convert ASD from modified log-normal to sieve classes call asd2m(aslagn(1,sr), aslagx(1,sr), aslagm(1,sr), & as0ags(1,sr), nslay(sr), massf) c c c read the crushing parameters for the implement read(line(skpnam(line):lentrm(line)), *, err=901) alpha, beta c do effect call crush(alpha, beta, tlayer, massf) c c post-effect stuff c c Convert ASD back from sieve classes to modified log-normal call m2asd(massf, nslay(sr), & aslagn(1,sr), aslagx(1,sr), aslagm(1,sr), as0ags(1,sr)) c if (am0tdb .eq. 1) then write (29,*) '//After crushing effect//' call tdbug(sr, nslay(sr),efcode) end if c-----END crushing effect (effect code 11) case (12) c-----START loosening effect (effect code 12) c pre-effect stuff if (am0tdb .eq. 1) then write (29,*) write (29,*) '//Before loosening effect//' call tdbug(sr, nslay(sr),efcode) end if c read the loosening parameter for the implement read(line(skpnam(line):lentrm(line)), *, err=901) mu c do effect call loosn(mu,tlayer, & asdblk(1,sr),asdsbk(1,sr),aszlyt(1,sr)) c post-effect stuff if (am0tdb .eq. 1) then write (29,*) '//After loosening effect//' call tdbug(sr, nslay(sr),efcode) end if c-----END loosening effect (effect code 12) case (13) c-----START mixing effect (effect code 13) c pre-effect stuff if (am0tdb .eq. 1) then write (29,*) write (29,*) '//Before mixing effect//' write (29,*) 'Tillage layer depth is', tlayer call tdbug(sr, nslay(sr),efcode) end if c read the mixing coefficient from the data file read(line(skpnam(line):lentrm(line)), *, err=901) rho c Convert ASD from modified log-normal to sieve classes call asd2m(aslagn(1,sr), aslagx(1,sr), aslagm(1,sr), & as0ags(1,sr), nslay(sr), massf) c do effect call mix(rho,tlayer,asdblk(1,sr),aszlyt(1,sr),asfsan(1,sr), & asfsil(1,sr),asfcla(1,sr),as0ph(1,sr),ascmg(1,sr), & ascna(1,sr),asfcce(1,sr),asfcec(1,sr),asfesp(1,sr), & asfom(1,sr),asfnoh(1,sr),asfpoh(1,sr),asfpsp(1,sr), & asfsmb(1,sr),asdagd(1,sr),aseags(1,sr),ahrwc(1,sr), & aheaep(1,sr),ahrwcw(1,sr),ahrwcf(1,sr),ahrwca(1,sr), & ahrwcs(1,sr), & admrtz(1,1,sr),admbgz(1,1,sr), & massf) c post-effect stuff c Convert ASD back from sieve classes to modified log-normal call m2asd(massf, nslay(sr), & aslagn(1,sr), aslagx(1,sr), aslagm(1,sr), as0ags(1,sr)) if (am0tdb .eq. 1) then write (29,*) '//After mixing effect//' call tdbug(sr, nslay(sr),efcode) end if c-----END mixing effect (effect code 13) c case (14) c-----START inversion effect (effect code 14) c pre-effect stuff if (am0tdb .eq. 1) then write (29,*) write (29,*) '//Before inversion effect//' call tdbug(sr, nslay(sr),efcode) end if c Convert ASD from modified log-normal to sieve classes call asd2m(aslagn(1,sr), aslagx(1,sr), aslagm(1,sr), & as0ags(1,sr), nslay(sr), massf) c do effect call invert(tlayer,asdblk(1,sr),aszlyt(1,sr),asfsan(1,sr), & asfsil(1,sr),asfcla(1,sr),as0ph(1,sr),ascmg(1,sr), & ascna(1,sr),asfcce(1,sr),asfcec(1,sr),asfesp(1,sr), & asfom(1,sr),asfnoh(1,sr),asfpoh(1,sr),asfpsp(1,sr), & asfsmb(1,sr),asdagd(1,sr),aseags(1,sr),ahrwc(1,sr), & aheaep(1,sr),ahrwcw(1,sr),ahrwcf(1,sr),ahrwca(1,sr), & ahrwcs(1,sr), & admrtz(1,1,sr),admbgz(1,1,sr), & massf) c post-effect stuff c Convert ASD back from sieve classes to modified log-normal call m2asd(massf, nslay(sr), & aslagn(1,sr), aslagx(1,sr), aslagm(1,sr), as0ags(1,sr)) if (am0tdb .eq. 1) then write (29,*) '//After inversion effect//' call tdbug(sr, nslay(sr),efcode) end if c-----END inversion effect (effect code 14) c case (21) c-----START below layer compaction (effect code 21) c pre-effect stuff c do effect c post-effect stuff read(line(skpnam(line):lentrm(line)), *, err=901) tibcp c-----END below layer compaction (effect code 21) c case (31) c-----START killing effect (effect code 31) c Note that the "kill" effect only stops the crop growth c submodel and moves the "crop" parameters to the "temporary" c crop pool. The "transfer" effect does the final transfer c of the "temporary" crop pool values over to the "decomp" c pools where they can now begin to decay. c pre-effect stuff c Some operations will not kill certain types of crops, c ie., a mowing operation usually will not kill a perennial c crop like alfalfa but would kill many annual crops. c So, we have a "kill flag" that makes that distinction. c This flag may get expanded in the future as new situations c arise. c set am0hrvfl c 0 - no kill being done c 1 - perennial crop which is NOT killed c 2 - annual or perennial crop which is killed read(line(skpnam(line):lentrm(line)), *, err=901) am0hrvfl c do effect write(*,*) ' doeffect: am0hrvfl ', am0hrvfl if (am0hrvfl.gt.1) then c need to stop the crop growth (ie. stop calling crop submodel) am0cgf = .false. !copy the stem diameter over tcxstm(sr) = acxstm(sr) !transfer plant properties to temporary pool tczht(sr) = aczht(sr) !crop height aczht(sr) = 0.0 tcdstm(sr) = tcdstm(sr) + acdstm(sr) !stem diameter acdstm(sr) = 0.0 tcmst(sr) = tcmst(sr) + acmst(sr) !mass of standing biomass acmst(sr) = 0.0 tcmyld(sr) = tcmyld(sr) + acmyld(sr) !mass of yield component acmyld(sr) = 0.0 tcmrt(sr) = tcmrt(sr) + acmrt(sr) !mass of roots (total) acmrt(sr) = 0.0 tczrtd(sr) = aczrtd(sr) !root depth aczrtd(sr) = 0.0 do 666 idx=1,nslay(sr) !mass of roots (by layer) tcmrtz(idx,sr) = tcmrtz(idx,sr) + acmrtz(idx,sr) acmrtz(idx,sr) = 0.0 666 continue ! once we move crop biomass into the "temporary" crop pool ! it is assumed to be dead biomass. Currently we assume that ! dead biomass does not have "leaves" which significantly ! influence wind erosion. Probably not a good generic assumption, ! but that's the way it is right now. acrlai(sr) = 0.0 endif c post-effect stuff harvdate = am0jd !not sure what this is used for - LEW - 8/26/1999 c-----END killing effect (effect code 31) case (32) c-----START cutting effect (effect code 32) c pre-effect stuff read(line(skpnam(line):lentrm(line)), *, err=901) * af, cutht, bflg c do effect call cut(af,cutht, & aczht(sr), acmst(sr), & tczht(sr), tcmst(sr), tcmf(sr), & adzht(1,sr), admst(1,sr), admf(1,sr), & bflg) c post-effect stuff c-----END cutting effect (effect code 32) case (33) c-----START flatten effect (effect code 33) c pre-effect stuff read(line(skpnam(line):lentrm(line)), *, err=901) af c Default all flatten effects to "all" biomass for now. bioflg = 0 c do effect call flat(af, & acmst(sr), acdstm(sr), & tcmf(sr), & admst(1,sr),admf(1,sr), addstm(1,sr), & bioflg) c post-effect stuff c-----END flatten effect (effect code 33) c case (34) c-----START mass bury effect (effect code 34) c pre-effect stuff read(line(skpnam(line):lentrm(line)), *, err=901) mf c Default all flatten effects to "all" biomass for now. bioflg = 0 c do effect if (am0tdb .eq. 1) then write (29,*) write (29,*) '//Before mass bury effect//' call tdbug(sr, nslay(sr),efcode) end if call mbury(mf,tlayer,admf(1,sr), admbgz(1,1,sr), & tcmf(sr), tcmbgz(1,sr), bioflg) if (am0tdb .eq. 1) then write (29,*) '//After mass bury effect//' call tdbug(sr, nslay(sr),efcode) end if c post-effect stuff c-----END mass bury effect (effect code 34) c case (35) c-----START cover bury effect (effect code 35) c pre-effect stuff read(line(skpnam(line):lentrm(line)), *, err=901) cf c Default all cbury effects to only decomp biomass pools for now. bioflg = (2**mnbpls - 1) - 1 c do effect call cbury(cf,tlayer,admf(1,sr), admbgz(1,1,sr), & tcmf(sr), tcmbgz(1,sr), bioflg) c post-effect stuff c-----END cover bury effect (effect code 35) c case (36) c-----START re-surface effect (effect code 36) c pre-effect stuff read(line(skpnam(line):lentrm(line)), *, err=901) mf c Default all lift effects to only decomp biomass pools for now. bioflg = (2**mnbpls - 1) - 1 c do effect call lift(mf,tlayer, & admf(1,sr),admrtz(1,1,sr),admbgz(1,1,sr), & bioflg) c post-effect stuff c-----END re-surface effect (effect code 36) c case (40) c-----START crop to biomass transfer effect (effect code 40) c pre-effect stuff ! we will currently ignore the "transfer fraction" parm read(line(skpnam(line):lentrm(line)), *, err=901) tf C c do effect C put in code to check if a crop is actually "growing" here C if so, then do the "transfer" effect (default action) C may later want to include a "transfer effect" flag that could C force a "biomass transfer" to occur C if ((tczht(sr) .gt. 0.0) .or. & (tcdstm(sr) .gt. 0.0) .or. & (tcmst(sr) .gt. 0.0) .or. & (tcmf(sr) .gt. 0.0) .or. & (tcmrt(sr) .gt. 0.0) .or. & (tcmyld(sr) .gt. 0.0)) then ! assume these are enough to check C*** if (tczht(sr) .gt. 0.0) write(*,*) 'tczht: ', tczht(sr) C*** if (tcdstm(sr) .gt. 0.0) write(*,*) 'tcdstm: ', tcdstm(sr) C*** if (tcmst(sr) .gt. 0.0) write(*,*) 'tcmst: ', tcmst(sr) C*** if (tcmf(sr) .gt. 0.0) write(*,*) 'tcmf: ', tcmf(sr) C*** if (tcmrt(sr) .gt. 0.0) write(*,*) 'tcmrt: ', tcmrt(sr) C*** if (tcmyld(sr) .gt. 0.0) write(*,*) 'tcmyld: ', tcmyld(sr) call trans( & tczht(sr), adzht(1,sr), & tcxstm(sr), adxstm(1,sr), & tcdstm(sr), addstm(1,sr), & tcmyld(sr), & tcmst(sr), admst(1,sr), & tcmf(sr), admf(1,sr), & tcmbg(sr), admbg(1,sr), & tcmrt(sr), admrt(1,sr), & tcmbgz(1,sr), admbgz(1,1,sr), & tcmrtz(1,sr), admrtz(1,1,sr), & cumdds(1,sr), cumddf(1,sr), cumddg(1,1,sr), & dkrate(1,1,sr), covfact(1,sr), & ddsthrsh(1,sr), & acdkrate(1,sr), accovfact(sr), & acddsthrsh(sr), & ac0nam(sr), ad0nam(sr), & nslay(sr)) C zero these "dependent" values - they will be updated by crop if necessary acm(sr) = acmst(sr) + acmrt(sr) + acmyld(sr) acrsai(sr) = 0.0 acrlai(sr) = 0.0 do 667 idx=1,mncz acrsaz(idx,sr) = 0.0 acrlaz(idx,sr) = 0.0 667 continue acffcv(sr) = 0.0 acfscv(sr) = 0.0 acftcv(sr) = 0.0 end if c c post-effect stuff c c-----END crop to biomass transfer effect (effect code 40) c case (51) c-----START row planting effect (effect code 51) c set the crop id number, cropno read in effect read(line(skpnam(line):lentrm(line)), *, err=901) * acdpop(sr), ros c check to see if ros = 0.0 then set ros = rs if rs has been c set (ie. rs > 0.0) otherwise the crop is assumed to be broadcast. C *** FIX ME!!!!!! if (ros .lt. 0.01.and.asxrgs(sr).gt.0.01) ros=asxrgs(sr) ac0id(sr)=cropno c pre-effect stuff c do effect c set flag for crop initialization - jt am0cif = .true. c set crop growth flag on - jt am0cgf = .true. call cinput c post-effect stuff acdstm(sr) = acdpop(sr) !eventually we will multiply by tillering factor c-----END row planting effect (effect code 51) c case (52) c-----START broadcast planting effect (effect code 52) c set the crop id number, cropno read in effect read(line(skpnam(line):lentrm(line)), *, err=901) * acdpop(sr) C *** 52 if (getr(iunit, sr, acdpop,acdpop,acdpop,1,'r').gt.0) then C *** print*,'ERROR in doproc' C *** stop C *** endif ac0id(sr)=cropno c pre-effect stuff c do effect c set flag for crop initialization - jt am0cif = .true. c set crop growth flag on - jt am0cgf = .true. call cinput c post-effect stuff acdstm(sr) = acdpop(sr) !eventually we will multiply by tillering factor c-----END broadcast planting effect (effect code 52) c case (61) c-----START biomass remove effect (effect code 61) c 10 print*, 'SR',sr,' Effect:',efcode,' is ',prname c pre-effect stuff read(line(skpnam(line):lentrm(line)), *, err=901) grainf, cropf, * decompf, cutht, bgf, flag c do effect if (am0tdb .eq. 1) then write (29,*) write (29,*) '//Before biomass remove effect//' call tdbug(sr, nslay(sr),efcode) end if call remove(grainf,cropf,decompf,bgf,cutht, & aczht(sr),acdstm(sr),acmyld(sr),acmst(sr), & acmrt(sr), acmrtz(1,sr), & tczht(sr),tcdstm(sr),tcmyld(sr),tcmst(sr),tcmf(sr), & tcmbg(sr), tcmbgz(1,sr),tcmrt(sr), tcmrtz(1,sr), & adzht(1,sr),addstm(1,sr),admst(1,sr),admf(1,sr), & admbgz(1,1,sr),admrtz(1,1,sr), & nslay(sr),flag) if (am0tdb .eq. 1) then write (29,*) '//After biomass remove effect//' call tdbug(sr, nslay(sr),efcode) end if c post-effect stuff c-----END biomass remove effect (effect code 61) c case (71) c-----START irrigate effect (effect code 71) c pre-effect stuff ! write (*,*) 'prior to irrig -> ahzirr(sr), amt', ahzirr(sr), irrig read(line(skpnam(line):lentrm(line)), *, err=901) irrig ahzirr(sr) = ahzirr(sr) + irrig ! write (*,*) 'irrig this much -> ahzirr(sr), amt', ahzirr(sr), irrig c do effect if (am0tdb .eq. 1) then write (29,*) write (29,*) '//Before irrigate effect//' !call tdbug(sr, nslay(sr),efcode) end if c Hmm, don't really need to "call" an irrigation routine yet. c call irrig(am0irr(sr), ahzirr(sr)) c call irrig(0, 254.0) if (am0tdb .eq. 1) then write (29,*) '//After irrigate effect//' !call tdbug(sr, nslay(sr),efcode) end if c post-effect stuff c-----END irrigate effect (effect code 71) c case default goto 902 end select C return C C Error stops C 901 write(*,*) 'Error reading parameter ', line stop 1003 902 write(*,*) 'Invalid effect ', efname, ' ', efcode stop 1003 end