c This program reads in initial bio fields and outputs level fields parameter (imax=162) parameter (jmax=110) parameter (maxlev=401) dimension rntkml(maxlev),phykml(maxlev),zookml(maxlev), . detkml(maxlev) dimension div(4) dimension rntkm(4),phykm(4),zookm(4),detkm(4) C Open input file open(10,file='initbio_layer.asc',status='old',readonly, . carriagecontrol='list') C Open output file open(11,file='initbio_level.dat',status='new',form='unformatted') pi=4.*abs(atan(1.)) rearth=6370.e5 dypdeg=pi/180.*rearth ymin=-29.*dypdeg ymax=+25.*dypdeg xmin=0.*dypdeg xmax=+80.*dypdeg dx=(xmax-xmin)/(imax-2) dy=(ymax-ymin)/(jmax-2) 5 continue read(10,*)h1b,h2b,h3b,h4b read(10,*)rntkm read(10,*)phykm read(10,*)zookm read(10,*)detkm c Interpolate to levels do m=1,maxlev c Find the desired layer dep=(m-1) if(dep.le.h1b) then lay=1 elseif(dep.le.(h1b+h2b)) then lay=2 elseif(dep.le.(h1b+h2b+h3b)) then lay=3 elseif(dep.le.(h1b+h2b+h3b+h4b)) then lay=4 else lay=4 endif rntkml(m)=rntkm(lay) phykml(m)=phykm(lay) zookml(m)=zookm(lay) detkml(m)=detkm(lay) enddo write(11)rntkml write(11)phykml write(11)zookml write(11)detkml 900 continue close(10) close(11) end