INSTRUCTIONS FOR CALCULATING PRODUCTION FILES

 

  1. Create PRODUCTION files (i.e. prod101) using PRODANN program.
  2. See Appendix A

  3. Create LIVE TO DEAD files (i.e. A1I) using LIVDEAD program.
  4. See Appendix B

  5. Create DEAD TO MISSING files (i.e. DDA1I) using DEADMISS program
  6. See Appendix C

  7. Create production files of individual tubes

See Appendix D

APPENDIX A

INSTRUCTIONS FOR PRODANN.PRG

 

This is the main dBASE program that calculates production and mortality for each time period from the raw ROOTS dBASE files.

1. Add new DEPTHCODE field to "super" all file ALL101 ( our site A1 in) (the "super" ALL file is the 5 ALL files for one site combined into 1 file. Create these if you haven’t already.)

1a. Use the "super" all file. MODIFY THE DATABASE, adding DEPTHCODE field after the DEPTH field. Make it numeric with width = 1, dec = 0.

1b.Replace the depthcode with the number of depths you're interested in looking at and at the depths you want. For example:

REPLACE DEPTHCODE with 1 for DEPTH>0.0 .and. DEPTH<=20.00.

REPLACE DEPTHCODE with 2 for DEPTH>20.01 .and. DEPTH<=40.00

and so on for each depthcode.

 

2. Create a new file which we called "prod101" for the production at site 101 . *(You don't need to do this step once you've created your first prod file - skip to step #3.) The fields will be:

FIELDS

Time which is between 2 times i.e. "a__to__b"

Depthcode

LEG which is live extension growth

DEG which is dead extension growth

TEG which is total extension growth

NEWPROD which is production of roots not in the previous time

TOTPROD which is TEG plus NEWPROD

MORTPRE which is mortality of preexisting roots

MORTNEW which is mortality of non-preexisting roots

SHRINK which is roots live in time1 that in time2 are dead and shorter (not accounted for in MORTPRE)

TOTMORT which is MORTPRE plus MORTNEW minus SHRINK

 

For the "Time" field, the type will be character with width = 6. All other fields the type will be numeric with width = 10 and dec = 3.

 

3. Once you have created this first production file, you can use it to create all your other production files. Use this first production file, prod101. Use the "copy stru to prod102" command, using the names of your other "super" all files. You should now have "prod__" files for all your "super" all files.

 

4. MODI COMM PRODANN.PRG

A. After sele a, you will use the name of your "super"all file (i.e. all101).

B. After sele b, you will use the name of your production file (i.e. prod101).

C. At "do while d<>6", you will fill in the number of depthcodes you have plus one. We have 5 depthcodes so the number is 6.

D. At "do while t2<'k'", you will fill in the letter of the time you have digitized to in that "super" all file plus 1 letter. We have digitized through "j" so the letter is "k".

E. In the "set filter to" lines, we used upper case letters for "type". If you didn't use upper case in your "super" all file for "type", you need to change that in the filter.

You can keep or leave out the starred lines. They are just comment lines. You can write what ever comments you want in the program if you use * key.

 

5. Running the program. For each prod___ file, you will have to go into the program and change the files "used" under "sele a" and "sele b". Then you type DO PRODANN.

6. To save this new file to disk, use the production file you just created. "Copy to a:\prod101.txt delimited with blank.

 

 

APPENDIX B

INSTRUCTIONS FOR CREATING LIVE TO DEAD RECAPTURE FILES USING LIVDEAD.PRG

 

This creates recapture files for MARK from raw ROOTS dBASE files for Live to Dead or Missing (live = 1 and dead or missing = 0). Note that the file stores 5 histories on each line, and that the trailer at the end of each history may not be exactly what your run for MARK requires. I use one global replace command in Word to attach the correct trailer and put a line break after each recapture history.

(*Note that we have 11 times "z" through "j". In #2, 4, 5 and 6, create the number of time periods you have with their correct letter names.)

1. In dBase, use "super"ALL file (i.e. all101)

2. F2, ORGANIZE, COPY to new temporary file name (i.e., A1ITemp), CONSTRUCT FIELD LIST: type_z through type_j, site, depth, rootcode.

3. Use new file (i.e. A1ITemp)

4. F2, MODIFY DATABASE - add T1 and C1 through T11 and C11 (All of these are character with width=1), CH (character, width=11), ONE (character, width=1), SEMI (character, width=1.)

5. "Replace T1 with type_z all"; do this for T2 through T11.

6. F2, MODIFY DATABASE - delete all type_z through type_j

7. "Modi comm LIVDEAD.prg" Change "use" line, site

8. Do LIVDEAD

9. F2, ORGANIZE, COPY to new file name (i.e. A1I), CONSTRUCT FIELD LIST: CH, SEMI

10. F2, UPDATE, DELETE, Build Search: CH=000000000 Scope=All

11. "Pack"

12. Copy the new file (i.e. A1I) to disk (copy to a:\A1I.inp)

 

 

APPENDIX C

INSTRUCTIONS FOR CREATING DEAD TO MISSING RECAPTURE FILES USING DEADMISS.PRG

 

This creates recapture files for MARK from raw ROOTS dBASE files for dead to missing, and includes roots going directly from live to missing. Again, the structure of this file needs some editing using Word.

(*Note that we have 11 times "z" through "j". In #2, and 5, create the number of time periods you have with their correct letter names.)

1. Use the live to dead temporary file (i.e. A1ITemp)

2. F2, ORGANIZE, COPY to new temporary file name (i.e. 401misst), CONSTRUCT FIELD LIST: T1, C1 through T11, C11, CH, SEMI.

3. "Modi comm DEADMISS.prg" Change the "use" line to new temporary file name (i.e. DDA1INTemp)

4. "Do DEADMISS.prg"

5. F2, ORGANIZE, COPY to new file name (i.e. 401miss) CONSTRUCT FIELD LIST: CH, SEMI, SCOPE=ALL

  1. F2, UPDATE, DELETE, BUILD SEARCH: CH=00000000000, SCOPE=ALL
  2. PACK
  1. Copy the new file (i.e. DDA1IN) to disk (copy to a:\DDA1IN.inp)

 

APPENDIX D

INSTRUCTIONS FOR CREATING PRODUCTION FILES OF INDIVIDUAL TUBES

 

 

  1. Go to \dbase\rwr and rename the all___ and prod___ files to the new file names (i.e. all101 becomes all1011 and prod101 becomes prod1011.)
  1. Go into dBase and use "super" all file (i.e. all101)
  1. "Copy to c:\dbase\rwr\all1011 for tube=’ 1’ using the all file just named in \dbase\rwr.
  1. "Modi comm c:\dbase\rwr\prog.prg" Change the "use" lines (i.e. all1011 and prod1011)
  1. "Do c:\dbase\rwr\prog.prg"
  1. Copy newly created file to disk - "Copy to a:\ proda101.txt delimited with blank" using the site and tube number (i.e. prod1011 is site a1 tube 1 therefore proda101.)
  1. Go back to step #1 and rename the all___ and prod___ files to the next tube (i.e. all1012 and prod1012.)
  1. Repeat steps #2 through #7 until all 5 tubes for the site are completed.

 

 

TEXT FOR PRODANN.PRG

store 'a' to t2

store 'z' to t1

store 1 to d

sele a

use all101

sele b

use prod101

do while d <> 6

do while t2 < 'k'

store 'type_' + t2 to time2

store 'length_' + t2 to length2

store 'length_' + t1 to length1

store 'type_' + t1 to time1

sele a

 

* live extension growth

set filter to (&time2 <> 'D' .and. &time2 <> 'M' .and. &time2 <>

' ') .and. &time1 <> 'D' .and. &time1 <> ' '.and. &time1 <> 'M'

.and. depthcode = d

sum &length2 to A1

sum &length1 to A2

store A1 - A2 to A3

 

*dead extension growth

 

set filter to &time2 = 'D' .and. &time1 <> 'D' .and. &time1 <>

'M' .and. &time1 <> ' ' .and. &length2 > &length1 .and. depthcode

=d

sum &length2 to B1

sum &length1 to B2

store B1 -B2 to B3

 

*new production

 

set filter to &time1 = ' ' .and. &time2 <> ' ' .and. depthcode = d

sum &length2 to C1

 

*Mortality of non-preexisting roots

 

set filter to &time2 = 'D' .and. &time1 = ' ' .and. depthcode = d

sum &length2 to D1

 

*Mortality of preexisting roots

 

set filter to &time2 <> 'N'.and. &time2 <>'U'.and.&time2<>'B'.and.

&time2<>'W' .and. &time2<>' '.and. &time1 <> 'D' .and. &time1 <>

'M'.and. &time1 <> ' '.and.depthcode = d

sum &length1 to D2

 

*shrinkage note: this is a negative number

 

set filter to &time1 <> 'D'.and. &time1 <> 'M' .and. &time1 <>' '

.and. &time2 = 'D' .and. &length2 < &length1 .and.depthcode = d

sum &length2 to E1

sum &length1 to E2

store E1 - E2 to E3

sele b

append blank

repl depthcode with d

repl time with t1 + ' to '+ t2

repl leg with A3

repl deg with B3

repl teg with A3 + B3

repl newprod with C1

repl totprod with teg + newprod

repl mortnew with D1

repl mortpre with D2

repl shrink with E3

*note needs to be added here, but because it is a negative

*number above, we are subtracting it in the equation below.

repl totmort with mortpre + mortnew - shrink

store t2 to t1

store chr(asc(t2) + 1) to t2

enddo

store 'a' to t2

store 'z' to t1

d = d + 1

enddo

return

 

 

TEXT FOR LIVDEAD.PRG

 

close all

use A1ITemp

xcount=1

do while xcount<12

if xcount<10

xt ='t'+(str(xcount,1))

xc ='c'+(str(xcount,1))

endif

if xcount>9

xt='t'+(str(xcount,2))

xc='c'+(str(xcount,2))

endif

repl &xt with 'X' for &xt =' '

repl &xc with '0' for &xt='X' .or.&xt='D'.or.&xt='M'

repl &xc with '1' for &xt='N'.or.&xt='U'.or.&xt='B' .or. &xt='W'

xcount=xcount+1

enddo

repl all ch with c1+c2+c3+c4+c5+c6+c7+c8+c9+c10+c11

repl all semi with ';'

repl all trmt with ‘O’ for trmt=’ ‘

repl all one with '1'

 

 

TEXT FOR DEADMISS.PRG

close all

use DDA1INTemp

xcount=1

do while xcount<12

if xcount<9

xt ='t'+(str(xcount,1))

xc ='c'+(str(xcount,1))

xtplus1='t'+(str(xcount+1,1))

endif

if xcount=9

xt=’t’+(str(xcount,1))

xc=’c’+(str(xcount,1))

xtplus1=’t’+(str(xcount+1,2))

endif

if xcount=10

xt=’t’+(str(xcount,2))

xc=’c’+(str(xcount,2))

xtplus1=’t’+(str(xcount+1,2))

endif

if xcount<11

repl &xt with 'X' for &xt =' '

repl &xc with '1' for &xt='D'

repl &xc with '0' for &xt='N'.and. &xtplus1<>'M' .or. &xt='U' .and.

&xtplus1<>'M' .or. &xt='B' .and. &xtplus1<>'M' .or. &xt='W' .and.

&xtplus1<>'M' .or. &xt='M'

repl &xc with '1' for &xt='N' .and. &xtplus1='M' .or. &xt='U'

.and. &xtplus1='M' .or. &xt='B' .and. &xtplus1='M' .or. &xt='W' .and.

&xtplus1='M'

endif

if xcount=11

xt='t'+(str(xcount,2))

xc='c'+(str(xcount,2))

repl &xt with 'X' for &xt=' '

repl &xc with '1' for &xt='D'

repl &xc with '0' for &xt='N' .or. &xt='U' .or. &xt='B' .or.

&xt='W' .or. &xt='M'

endif

xcount=xcount+1

enddo

repl all ch with c1+c2+c3+c4+c5+c6+c7+c8+c9+c10+c11

repl all semi with ';'

repl all trmt with ‘I’ for trmt=’ ‘