c This program reads in bio adv fields and outputs level fields parameter (imax=162) parameter (jmax=110) parameter (maxlev=401) dimension rntadvl(maxlev),phyadvl(maxlev),zooadvl(maxlev), . detadvl(maxlev) logical diurnal dimension div(4) dimension rntadv(4),phyadv(4),zooadv(4),detadv(4) c Set logical for diurnal forcing C Open input file open(10,file='bioadv_71_layer.asc',status='old',readonly, . carriagecontrol='list') C Open output file if(diurnal) then open(11,file='bioadv_level.dat',status='new',form='unformatted') else open(11,file='bioadv_nod_level.dat',status='new', . form='unformatted') endif 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,*,end=900)djd,h1b,h2b,h3b,h4b read(10,*)rntadv read(10,*)phyadv read(10,*)zooadv read(10,*)detadv c Interpolate velocity level fields from convergences 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 rntadvl(m)=rntadv(lay) phyadvl(m)=phyadv(lay) zooadvl(m)=zooadv(lay) detadvl(m)=detadv(lay) enddo write(11)rntadvl write(11)phyadvl write(11)zooadvl write(11)detadvl goto 5 900 close(10) close(11) end