c file: decopen.for subroutine decopen c + + + Purpose + + + c opens the files for decomp output *$noereference include 'p1werm.inc' include 'wpath.inc' include 'm1flag.inc' include 'd1gen.inc' include 'h1temp.inc' *$reference c + + + LOCAL VARIABLES + + + character out1*80, out2*80 c character out1*80, out2*80, out3*80, out4*80 c logical fexist, opened integer lentrm c + + + FORMATS + + + c 2020 format (///////////) c 2210 format (/,' warning, the output file - ',a80,/,' already exists - c & press enter to overwrite this file or control break to stop') 2030 format( 29x,'Standing',9x,'Flat',9x,'Surface Cover Silhouett ' &'Area Total Residue Amounts') 2035 format (14x,'Pool',1x,'Stem',1x,2(2x,'decomp',3x,'bio-',1x),2x, & 15('-'),3x,14('-'),4x,24('-')) 2040 format ('sr day/mo/yr no. no. days mass days mass', & ' Stems Flat Total /5 Stand Flat ' &,' Buried ') c + + + DATA + + + out1='dabove.out' out2='dbelow.out' c out3='../out/droots.out' c out4='../out/dcover.out' c + + + END SPECIFICATIONS + + + c inquire(file = out1, exist = fexist) c if(fexist) then c write(*,2210) out1 c read (*,'(a)') c endif c write(*,2020) c inquire(file = out2, exist = fexist) c if(fexist) then c write(*,2210) out2 c read (*,'(a)') c endif c write(*,2020) c open output file for root residues c inquire(file = out3, exist = fexist) c if(fexist) then c write(*,2210) out3 c read (*,'(a)') c endif c open (unit = 43, file = rootp(1:lentrm(rootp)) // out3) c write(*,2020) c open output file for cover estiamtes c inquire(file = out4, exist = fexist) c if(fexist) then c write(*,2210) out4 c read (*,'(a)') c endif c open (unit = 44, file = rootp(1:lentrm(rootp)) // out4) c write(*,2020) c Write headers for output files c dabove.out c dbelow.out c open output file for above ground residues if requested if ((am0dfl .eq. 1) .or. (am0dfl .eq. 3)) then call fopenk(218, rootp(1:lentrm(rootp)) // out1, 'unknown') C *** open (unit = 218, file = rootp(1:lentrm(rootp)) // out1) write (218,*) 'Above Ground Residue Decomposition Output File' write (218,*) 'Standing and Surface Residues' write (218,*) ' ' write (218,2030) write (218,2035) write (218,2040) write (218,*) ' ' end if c open output file for below ground residues if requested if ((am0dfl .eq. 2) .or. (am0dfl .eq. 3)) then open (unit = 19, file = rootp(1:lentrm(rootp)) // out2) write (19,*) 'Below Ground Residue Decomposition Output File' write (19,*) 'Data by soil layer for age pools 1 and 2' write (19,*) ' ' write (19,*) ' day/mo/year ' end if c write (42,*) ' pool 1 c & pool 2' c write (42,*) ' cumddg admbgz cumddg admrtz' c &cumddg2 admbgz2 cumddg3 admbgz3 cumddg4 admbgz4' c write (42,*) ' ' c write (43,*) 'Root Residue Decomposition Output File' c & Sim. Region 1 Only' c write (43,*) 'Residue data for each soil layer ' c write (43,*) ' ' c write (43,*) 'pool 1 c & pool 2' c write (43,*) 'day cumddg1 admbgz1 c &cumddg2 admbgz2 cumddg3 admbgz3 cumddg4 admbgz4' c write (43,*) ' ' c write (44,*) ' Residue Cover Output File for sim Region 1' c write (44,*) ' ' c write (44,*) return end