MVLib - Short Writeup - Version 4.0
Example Number 24 - How to produce the windrose plots using the MVLib
This example shows how to produce windrose plots using the routines windrosebook and windroseplot; the first routine allows to book the single data in the vectors provided as input parameters, the second routine allows to produce the windroseplot. IN the following example the field of ground wind speed are retrieved from MuSEO data base of MM5 simulation, for the specific application the data for the month of february are selected. The data are interpolated on specific location by the ginterp routine. The source code to produce these plots is available here, the complete script running the code is available here.
Previous Example MVLib Home Page Next Example
	parameter (nsec=72,ixm=100,jxm=100,nloc=4,maxdat=6000)
	real u(ixm,jxm,25),v(ixm,jxm,25),lat(ixm,jxm),lon(ixm,jxm)
	character file*80,title*80,mtitle*80,loc(nloc)*40
	real rq(nsec),rf(nsec)
	real xlat(nloc),xlon(nloc),ux(maxdat,nloc),vx(maxdat,nloc)
	data loc /'Pescara','L''Aquila','Chieti','Teramo'/
	data xlat /42.46361,42.35583,42.35111,42.65861/
	data xlon /14.21389,13.39556,14.16833,13.70389/
	do iloc=1,nloc 
	   ndat=0
	   do iy=2004,2008
	   call openmuseodb(91,'mm5ugr',iy*10+3)
	   call openmuseodb(92,'mm5vgr',iy*10+3)
	   do iday=1,31 ; read (91) ; read (92) ; enddo ! Skip January
	   do iday=32,59				! Read February
	      read (91) lix1,ljx1,lkx1,nh,
	2	((lat(ii,jj),ii=1,lix1),jj=1,ljx1),
	3	((lon(ii,jj),ii=1,lix1),jj=1,ljx1),
	4	(((u(ii,jj,n),ii=1,lix1),jj=1,ljx1),n=1,nh)
	      read (92) lix2,ljx2,lkx2,nh,
	2	((lat(ii,jj),ii=1,lix2),jj=1,ljx2),
	3	((lon(ii,jj),ii=1,lix2),jj=1,ljx2),
	4	(((v(ii,jj,n),ii=1,lix2),jj=1,ljx2),n=1,nh)
	      if (lix1.eq.lix2.and.lix2.gt.0) then
	         do ih=1,24
		    ndat=ndat+1
	            vx(ndat,iloc)=ginterp(v(1,1,ih),lat,lon,ixm,jxm,xlat(iloc),xlon(iloc))
	            ux(ndat,iloc)=ginterp(u(1,1,ih),lat,lon,ixm,jxm,xlat(iloc),xlon(iloc))
	          enddo
	      endif
	   enddo 
	   close(91)
	   close(92)
	enddo ; enddo
	call mvsetflags('Ogni quanti colori',2.0)
	mtitle='MM5 simulation 2004-2008   Surface Wind (m/sec)'
	do iloc=1,nloc
	   do i=1,nsec ; rf(i)=0.0 ; rq(i)=0.0 ; enddo
	   do i=1,ndat
	      call windrosebook(ux(i,iloc),vx(i,iloc),rf,rq,nsec)
	   enddo
	   call windroseplot(rq,rf,nsec)
	   write(title,'(a)') loc(iloc)(1:lenstr(loc(iloc)))//' - February'
	   call scrivisulplot(title,0.5,0.94)
	   call displayexample('example24',mtitle,' ')
	enddo
	end