subroutine stnprf(xlat, ozone, lprint, stnpro) c c*********************************************************************** c c stnprf c c march, 2001 by charlie wellemeyer SSAI c c purpose c determine a standard profile associated with a specific total c ozone and latitude. currently uses v8 low mid and high c profiles to emulate final version of the software. c c modification c none c c variables c name type i/o description c ---- ---- --- ------------ c c arguments c xlat r*4 i latitude c ozone r*4 i total ozone interpolation target c lprint(30) l*4 i logical switches for debug printout c stnpro(11) r*4 o interpolated standard ozone profile c c internal c l1 i*4 latitude index for lower interpolation node c l2 i*4 latitude index for upper interpolation node c c*********************************************************************** c implicit none integer*4 indoz, ilev, i real profil, abslat, tot1, tot2, terp, total c c -- input parameters c real xlat,ozone logical lprint(30) c c internal parameters c real stnprm(11), ozind(21), tot integer*4 indl1, indl2, indm1, indm2, indh1, indh2 c c output parameters c real stnpro(11) c data ozind/225.0,275.0,325.0,225.0,275.0,325.0,375.0, 1 425.0,475.0,525.0,575.0,125.0,175.0,225.0, 2 275.0,325.0,375.0,425.0,475.0,525.0,575.0/ c real fgtmp, stprf, newstd, profl, terroz common /stndprof/fgtmp(11),stprf(11,21),profl(21),terroz(21) c c estimate standard profile for given ozone and latitude c interpolate a mid latitude standard profile where required c abslat=abs(xlat) if(abslat.ge.20.0.and.abslat.le.60.0) then indm1 = 4 do 200 indoz=4,10 if(ozone.gt.ozind(indoz)) indm1 = indoz 200 continue indm2 = indm1 + 1 c tot = 0.0 tot1 = 0.0 tot2 = 0.0 do 300 ilev=1,11 stnprm(ilev) = terp(ozone,ozind(indm1),ozind(indm2), 1 stprf(ilev,indm1),stprf(ilev,indm2)) tot=tot+stnprm(ilev) tot1=tot1+stprf(ilev,indm1) tot2=tot2+stprf(ilev,indm2) 300 continue c c write(6,7010) indm1, indm2, stnprm, tot c7010 format(' stnprf: indm1, indm2=',2i5,' mid-lat prof',/, c 1 12f6.1) c endif c c low to mid latitude interpolations c c 1 2 3 4 5 6 7 8 9 10 c low 225 275 325 c mid 225 275 325 375 425 475 525 575 c high 125 175 225 275 325 375 425 475 525 575 c if(abslat.lt.45.0) then indl1 = 1 do 350 indoz=1,2 if(ozone.gt.ozind(indoz)) indl1 = indoz 350 continue indl2 = indl1 + 1 c tot = 0.0 do 400 ilev=1,11 stnpro(ilev) = terp(ozone,ozind(indl1),ozind(indl2), 1 stprf(ilev,indl1),stprf(ilev,indl2)) tot=tot+stnpro(ilev) 400 continue c c write(6,7020) indl1, indl2, stnpro, tot c7020 format(' stnprf: indl1, indl2=',2i5,' low-lat prof',/, c 1 12f6.1) tot = 0.0 if(abslat.gt.20.0) then do 500 ilev=1,11 stnpro(ilev) = terp(abslat,20.0,45.0,stnpro(ilev), 1 stnprm(ilev)) tot=tot+stnpro(ilev) 500 continue endif c c mid to high latitude interpolations c c 1 2 3 4 5 6 7 8 9 10 c low 225 275 325 c mid 225 275 325 375 425 475 525 575 c high 125 175 225 275 325 375 425 475 525 575 c else indh1 = 12 do 600 indoz=12,20 if(ozone.gt.ozind(indoz)) indh1 = indoz 600 continue indh2 = indh1 + 1 c tot = 0.0 do 700 ilev=1,11 stnpro(ilev) = terp(ozone,ozind(indh1),ozind(indh2), 1 stprf(ilev,indh1),stprf(ilev,indh2)) tot=tot+stnpro(ilev) 700 continue c c write(6,7030) indh1, indh2, stnpro, tot c7030 format(' stnprf: indh1, indh2=',2i5,' hi-lat prof',/, c 1 12f6.1) c if(abslat.lt.60.0) then tot = 0.0 do 800 ilev=1,11 stnpro(ilev) = terp(abslat,45.0,60.0,stnprm(ilev), 1 stnpro(ilev)) tot=tot+stnpro(ilev) 800 continue endif c endif c c write(6,7040) stnpro, tot c7040 format(' stnprf: retrieved standard profile:',/, c 1 12f6.1) c total = 0.0 do 900 i=1,11 total = total + stnpro(i) 900 continue if(abs(total-ozone).gt.0.1) then print*,'non-linearity error in stnprf' print*,total,ozone,abs(total-ozone) endif c 999 continue return c c formats c end