subroutine cmptwgt101(p101lg,t_101,x_101lg,n_101,twgt) c c calculate the ozone weighted temperature profile c c input: c t_101 - temperature profile c x_101lg - log of cumulative ozone amount c c output: c twgt - the ozone weighted temperature profile c c implicit none c include 'switches.cmn' c integer n_101 real*8 t_101(n_101),x_101lg(n_101),p101lg(n_101) real*8 twgt(n_101) c local integer i real*8 tsum c c weight the temperature profile using the cummulative o3 profile twgt(1)=t_101(1) tsum=t_101(1)*exp(x_101lg(1)) do i=2,n_101 tsum=tsum+0.5d0*(t_101(i)+t_101(i-1))* &(exp(x_101lg(i))-exp(x_101lg(i-1))) twgt(i)=tsum/exp(x_101lg(i)) enddo if (jprint(6).eq.1)then i=1 write(6,'(a28,a28)')' p101lg t_101 ', &'cumo3 twgt do3' write(6,'(6e12.4)')-7*p101lg(i),t_101(i), &exp(x_101lg(i)),twgt(i),exp(x_101lg(i)) do i=2,101 write(6,'(6e12.4)')-7*p101lg(i),t_101(i), &exp(x_101lg(i)),twgt(i),exp(x_101lg(i))-exp(x_101lg(i-1)) enddo endif return end