subroutine openfils C ***************************************************************** wjr C Contains init code from main C C Edit History C 10-Mar-99 wjr created C include 'p1werm.inc' include 'wpath.inc' include 'file.fi' include 'm1flag.inc' C + + + Called functions + + + integer ios integer lentrm c open erosion output files if( am0efl.gt.0) then call fopenk (20, rootp(1:lentrm(rootp)) // 'erosion.out', * 'unknown') call fopenk (21, rootp(1:lentrm(rootp)) // 'eegt.out', * 'unknown') c open temporary file to hold accounting region erosion values call fopenk (40, rootp(1:lentrm(rootp)) // 'eros.tmp', * 'unknown') endif c open (unit = 22, file = outp(1:lentrm(outp)) // 'eegtss.out') c open (unit = 23, file = outp(1:lentrm(outp)) // 'eegt10.out') c call fopenk (7, rootp(1:lentrm(rootp)) // 'grid.out', 'unknown') c open plot data file if((am0hfl.gt.0).or.(am0sfl.gt.0).or.(am0tfl.gt.0) & .or.(am0cfl.gt.0).or.(am0dfl.gt.0).or.(am0efl.gt.0)) then call fopenk (luoplt, rootp(1:lentrm(rootp)) // 'plot.out', * 'unknown') endif if ((am0hfl .eq. 1).or.(am0hfl .eq. 3) & .or. (am0hfl .eq. 5) .or. (am0hfl .eq. 7)) then call fopenk (14, rootp(1:lentrm(rootp)) // 'hydro.out', * 'unknown') endif if ((am0hfl .eq. 2).or.(am0hfl .eq. 6) & .or. (am0hfl .eq. 3) .or. (am0hfl .eq. 7)) then call fopenk (12, rootp(1:lentrm(rootp)) // 'water.out', * 'unknown') end if open (41,file=rootp(1:lentrm(rootp)) // 'output.tmp', * recl=500, IOSTAT=ios, ERR=100) goto 101 100 write(*,1000) rootp(1:lentrm(rootp)) // 'output.tmp',ios 1000 format('Cannot open file: ',a,' with I/O status ', i5) stop 101 continue C open files for outputing the crop and decomp biomass variables - LEW if ((am0dfl .eq. 1).or.(am0dfl.eq.3)) then call fopenk (luocrp1, rootp(1:lentrm(rootp)) // 'crp1.btmp', * 'unknown') call fopenk (luobio1, rootp(1:lentrm(rootp)) // 'bio1.btmp', * 'unknown') call fopenk(218, rootp(1:lentrm(rootp)) // 'dabove.out', * 'unknown') endif if ((am0dfl .eq. 2).or.(am0dfl.eq.3)) then call fopenk (luodec1, rootp(1:lentrm(rootp)) // 'dec1.btmp', * 'unknown') call fopenk (luodec2, rootp(1:lentrm(rootp)) // 'dec2.btmp', * 'unknown') call fopenk (luodec3, rootp(1:lentrm(rootp)) // 'dec3.btmp', * 'unknown') call fopenk (19, rootp(1:lentrm(rootp)) // 'dbelow.out', * 'unknown') endif if (am0cfl .gt. 0) then C daily crop output of most state variables (mass units are t/ha)- AR call fopenk (17, rootp(1:lentrm(rootp)) // 'crop.out', * 'unknown') C daily crop output of selected state variables (mass units are lb/ac)- AR call fopenk (57, rootp(1:lentrm(rootp)) // 'part.out', * 'unknown') C annual summaries of yield and biomass (mass units are t/ha)- AR call fopenk (59, rootp(1:lentrm(rootp)) // 'annl.out', * 'unknown') C summary output from perennials like alfalfa - AR call fopenk (58, rootp(1:lentrm(rootp)) // 'prnl.out', * 'unknown') C echo crop input data - AR call fopenk (60, rootp(1:lentrm(rootp)) // 'inpt.out', * 'unknown') C print headings for crop output files call cpout endif if (am0cfl .gt. 1) then c main crop debug file call fopenk (61, rootp(1:lentrm(rootp)) // 'allcrop.prn', * 'unknown') endif end