1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68
| program interpolation
implicit none
integer hour, day, year, stime, index, var, altitude, line
integer tempi, nlines, harp, maxwp, tropp, topindex, source
integer nlevs ! ss sounding start
character (len=6), month, lat, lon, sindex, tempc, ss, unit,tempj
integer, allocatable :: pressure(:), height(:), winddir(:),windspeed(:)
integer, allocatable :: temperature(:), dewpoint(:), leveltype(:)
integer i, j, k
integer, dimension (15,3) :: t
t= reshape ((/10000., 9250., 8500., 7000., 5000., 4000., 3000., 2500., 2000., 1500., 1000., 700., 500., 300., 200., 83., 49., -6., -35., 1., -17., -1., 27., -107., -27., -3., 11., 10., 28., -2.,2.,2.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1./), (/15,3/))
open (unit=20, file="data", status="old")
open (unit=30, file="output", status="replace")
ss = "254"
read(20,*) tempc
tempc = trim(tempc)
if (tempc .eq. ss) then
print*, "debut de la ligne "
backspace(20)
end if
do while (tempc.eq.ss)
read(20,*) tempc, hour, day, month, year
read(20,*) line, tempi, index, lat, lon, altitude, stime
read(20,*) line, harp, maxwp, tropp, nlines, topindex, source
read(20,*) line, sindex, tempc, unit
print*, tempc, hour, day, month, year
print*, line, tempi, index, lat, lon, altitude, stime
print*, line, harp, maxwp, tropp, nlines, topindex, source
print*, line, sindex, tempc, unit
end do
nlevs= nlines - 4
allocate(pressure(nlevs), height(nlevs), winddir(nlevs),windspeed(nlevs))
allocate(temperature(nlevs), dewpoint(nlevs), leveltype(nlevs))
do i = 1, nlevs
read(20,*) leveltype(i), pressure(i), height(i),temperature(i), dewpoint(i),winddir(i),windspeed(i)
print*, leveltype(i), pressure(i), height(i),temperature(i), dewpoint(i),winddir(i),windspeed(i)
end do
do i = 1, nlevs
do j=1,3
if (pressure(i).eq.t(i,1)) then
write(30,*) leveltype(i), pressure(i), height(i),temperature(i), dewpoint(i),winddir(i)- t(i,2),windspeed(i)*t(i,3)
end if
end do
end do
deallocate(pressure, height, winddir,windspeed,temperature, dewpoint, leveltype)
close(20)
end program |
Partager