#include "ctrparam.h" subroutine soilcarbon(iyr) #include "BD2G04.COM" parameter (nl=1610,nt=35) character *30, ll character * 9, fltem dimension aa(11,nl),bb(11), & tcar(jm0) data ncall /0/ if (ncall.eq.0) then open (11,file='soilcarbon.dat',status='new') endif ncall=ncall+1 if(ncall/2*2.eq.ncall) then fltem='temstateB' else fltem='temstateA' endif print *,fltem open (10,file=fltem,status='old') ss=0.0 sl=0.0 sl1=0.0 sl2=0.0 totcar=0.0 vegcar=0.0 soilcar=0.0 do j=1,jm tcar(j)=0.0 do n=1,35 read (10,*,end=500)bb tcar(j)=tcar(j)+bb(11)*bb(7) totcar=totcar+bb(11)*bb(7) vegcar=vegcar+bb(9)*bb(7) soilcar=soilcar+bb(10)*bb(7) sl2=sl2+bb(7) enddo a=dxyp(j)/(720*8) c print *,j,bb(6),a,bb(6)/a,fland(j) ss=ss+dxyp(j) sl=sl+dxyp(j)*FDATA(1,J,2) sl1=sl1+bb(6)*1.e6 enddo CAR=totcar*1.e6/1.e15 VCAR=vegcar*1.e6/1.e15 SCAR=soilcar*1.e6/1.e15 c print *,aa c print *,bb print *,'SS=',ss,' SL=',SL,SL1,sl2*1.e6 print *,'CAR=',CAR print *,'VCAR=',VCAR print *,'SCAR=',SCAR go to 600 500 continue print *,'end of file' 600 continue close (10) write (11,*),iyr,CAR,VCAR,SCAR return end