implicit none character*80 FAO_soil,Texture integer SNUM,i character*13 FAOSOIL character*7 OTHER character*1 CMS,CMS1,CMS2 character*2 SOIL_UNIT real PERCENT real a1(8),b1(8),c1(8),a2(8),b2(8),c2(8) real a3(8),b3(8),c3(8),no_ts(8) real Porosity,psi_s,K_s,b_exp,avg_slope real yield real text1,text2,text3,text0,tot real slopea,slopeb,slopec,slope0 real Wet,Href,psi_sref do i=1,8 a1(i)=0.0 b1(i)=0.0 c1(i)=0.0 a2(i)=0.0 b2(i)=0.0 c2(i)=0.0 a3(i)=0.0 b3(i)=0.0 c3(i)=0.0 no_ts(i)=0.0 enddo FAO_soil="WORLDEXP.DAT" Texture="Texture.DAT" open(999,file=FAO_soil,status='old') open(777,file=Texture,status='unknown') read(999,*) DO WHILE (.NOT. EOF(999)) text1=0.0 text2=0.0 text3=0.0 text0=0.0 tot =0.0 slopea=0.0 slopeb=0.0 slopec=0.0 slope0=0.0 read(999,888) SNUM,FAOSOIL,CMS,OTHER, $ (CMS,SOIL_UNIT,CMS,PERCENT,CMS,a1(i),CMS,b1(i),CMS,c1(i),CMS, $ a2(i),CMS,b2(i),CMS,c2(i),CMS,a3(i),CMS,b3(i),CMS,c3(i),CMS, $ no_ts(i),i=1,8) do i=1,8 text1 =text1 + a1(i) +b1(i) + c1(i) text2 =text2 + a2(i) +b2(i) + c2(i) text3 =text3 + a3(i) +b3(i) + c3(i) text0 =text0 + no_ts(i) tot=tot+a1(i)+b1(i)+c1(i)+a2(i)+b2(i)+ $ c2(i)+a3(i)+b3(i)+c3(i)+no_ts(i) slopea =slopea + a1(i) +a2(i) + a3(i) slopeb =slopeb + b1(i) +b2(i) + b3(i) slopec =slopec + c1(i) +c2(i) + c3(i) slope0 =slope0 + no_ts(i) enddo text1 = text1 + text0/3. !coarse (as sand) text2 = text2 + text0/3. !medium text3 = text3 + text0/3. !fine (as clay) c porosity (dimensionless) Porosity = 0.489-0.00126* text1 yield = ( 0.07*text3 +(0.07+0.75*Porosity)*0.5*text2 + $ 0.75*Porosity*text1 ) /100. c matric potential at saturation( in m) psi_s = -0.01 * (10**(1.88 - 0.0131 * text1)) c saturated hydraulic conductivity (in m/s) c Refer to FAO Soils table c http://ioc.unesco.org/oceanteacher/RegionalData/IOCINCWIO%20Data/Documentation/Soil%20Data%20from%20FAO%20&%20GISS/Soil%20Data%20from%20FAO%20&%20GISS.htm c K_s < 1.41E-5 K_s = 7.0556* (10**(-6.884 + 0.0153* text1)) K_s = amin1(K_s, 1.41E-5) c b slope of the retention curve on a logarithmic graphy (dimensionless) b_exp = 2.91 + 0.159 * text3 c Revised it to fit the relationship psi = psi_s * Wet ^(-b_exp) c Take refered Wet = 0.6; refered H Href = -15 m; c Here Href mean: to support surface wet 0.6, groundwater table can be 15 m underground c If not limite the Href, the parameter will give: "groundwater table depth 100 m or more, can support surface wet 0.6" c See Soil_Ground.xls sheet 'W-B' c Refer to FAO Soils table c http://ioc.unesco.org/oceanteacher/RegionalData/IOCINCWIO%20Data/Documentation/Soil%20Data%20from%20FAO%20&%20GISS/Soil%20Data%20from%20FAO%20&%20GISS.htm Wet = 0.6 Href = -15 b_exp = amin1 ( b_exp , 8.17) psi_sref = Href * Wet **( b_exp ) psi_s = amax1 (psi_sref , psi_s) slopea = slopea + slope0/3. !0-8% slopeb = slopeb + slope0/3. !8-30% slopec = slopec + slope0/3. !>30% avg_slope =( slopea*0.04 + slopeb*0.19 + slopec*0.40 )/ $ (slopea + slopeb + slopec) c print *, slopea,slopeb,slopec,slope0,avg_slope c pause c Convert to sine(slope) for Sib2 directly use avg_slope=avg_slope/sqrt(1.+avg_slope**2) if (avg_slope.le.0.00005) avg_slope=0.00005 write(777,666) SNUM,Porosity,psi_s,K_s,b_exp,avg_slope,yield c if (text0.gt.0) print *,SNUM,text0 c print*, SNUM,"|",FAOSOIL,"|",OTHER,"|",SOIL_UNIT,"|",PERCENT c PRINT*, a1(i),b1(i),c1(i),a2(i),b2(i),c2(i),a3(i),b3(i),c3(i),no_ts(i) ENDDO close(999) close(777) 888 FORMAT (I5,A13,A1,A7,8(A1,A2,A1,F8.3,10(A1,F7.2))) 666 FORMAT (I5,6F15.10) END