MVLib - Short Writeup - Version 4.0
Example Number 45 - Use of chymplotdiff routine
This example shows how to use the different options of chymplotdiff routine, the matrix chymf is supposed to be an arbitrary matrix representing a difference between two fields simulated by CHyM model. The last argument passed to this routine is a character string containing any combination of the following characters:
  • a To avoid the automatic setting of window frame. The plot is produced with current settings allowing, as an example, to produce several plots on the same figure as in this case. The graphic setting is here done by the subrotine setplotframe.
  • d To activate the display of the plot
  • l To add an appropriate label bar to the plot
  • L To activate the the tracking of lat/lon lines
  • cXX To set the boundary flag to XX (range 1-9), if XX is omitted or a wrong value is passed, the routine will draw provinces boundaries for Italy and political boundaries for the rest of the wordl
  • MXX To set the maximum and minimum value of plot to XX, if the maximum is not specified it will be set as the maximum value of the input array passed as first argument, note that the special value -9999 isconsidered a no-data value. The minimum value is alway set to minus the maximum value.
  • r To reverse the color bar, by default the color bar are from blu to red tones
  • Txx To set the style of the plot to the value XX, valid ragnges are 0-4 and 10-14. If this parameter is greater than 10 the label bar is produced under the current frame, instead at bottom of the plot. If you pass T0 (default) the whole palette is used (10 or 15 if r is specified); if you pass T1 only three colours are used; a colour for the values less than -max, a colour for the values greater than max, and a colour for other values. If you pass T2 subset of 16 colours are used centered around the zero; if you pass T3 a subset of 9 colours are used centered around the zero; if you pass T4 a subset of 5 colours are used centered around the zero. In this option the 4 different plot are produced using options T0, T1 , T2 and T4.

The fortran code is available here and the complete script running the code is available here.
Previous Example List of Examples Next Example
MVLib Home Page
	use chymdata , only : chymreadrec,nlon,nlat,mchym,rchym,schym
	implicit none
	character title*32,vsource*50 ; integer idate,i,j
	real , allocatable , dimension(:,:) :: chymf
	open(10,file='/home/verdecch/tmp/Po.chym',status='old',form='unformatted')
	call chymheader(10) ; allocate(chymf(nlon,nlat))
	call chymreadrec(10,'dra',vsource,chymf,idate)
	close(10)
	do i=1,nlon ; do j=1,nlat
	   if (chymf(i,j).lt.100) then
	      chymf(i,j)=-9999
	   else
	      chymf(i,j)=chymf(i,j)*0.001-30
	   endif
	enddo ; enddo
	call setplotframe(rchym(1),rchym(3),rchym(2),rchym(4),1)
	call chymplotdiff(chymf,nlon,nlat,'ac5LlM50T10')
	call setplotframe(rchym(1),rchym(3),rchym(2),rchym(4),2)
	call chymplotdiff(chymf,nlon,nlat,'ac5LlM10T11')
	call setplotframe(rchym(1),rchym(3),rchym(2),rchym(4),3)
	call chymplotdiff(chymf,nlon,nlat,'ac5LlM50T12')
	call setplotframe(rchym(1),rchym(3),rchym(2),rchym(4),4)
	call chymplotdiff(chymf,nlon,nlat,'ac5LlM40T14')
	call displayexample('example45','chymplotdiff options',' ')
	end

	subroutine setplotframe(slon,elon,slat,elat,flag)
	implicit none
	real slon,elon,slat,elat,xc,yc,ds ; integer flag
	ds=0.35
	if (flag.eq.1) then
	   xc=0.25 ; yc=0.72
	else if (flag.eq.2) then
	   xc=0.75 ; yc=0.72
	else if (flag.eq.3) then
	   xc=0.25 ; yc=0.28
	else
	   xc=0.75 ; yc=0.28
	endif
	call setgeobounds(slon,elon,slat,elat,xc,yc,ds)
	return
	end