parameter (nb_niveaux=14,nb_labels=nb_niveaux+1) parameter (m=23,n=14) dimension z(m,n),rwrk(1000),iwrk(1000),map(20000) dimension xca(1000),yca(1000),aia(10),gia(10) dimension index_col(nb_niveaux) ! indices de couleurs data index_col / 2,3,4,5,6,7,8,9,10,11,12,13,14,15 / character*10 labels(nb_labels) ! liste des labels integer orient_barre,orient_texte character*10 labels(nb_labels) ! liste des labels external COLOR ! sp externe pour colorer les surfaces call OPNGKS ! Ouverture de GKS call GSFAIS(1) ! Remplissage en mode plein call DEFCOL ! Definition des couleurs ! ! Generation du fichier des donnees 23x14 de -136. a 451. ! call GENDAT (z,m,m,n,20,20,-136.,451.) ! ! Definition du cadre du trace dans la partie superieure ! call CPSETR ('VPB - viewport bottom',.25) ! ! Definition de 13 niveaux repartis en 14 intervals ! call CPSETI ('CLS - contour level selector',-13) ! ! Initialisation de conpack ! call CPRECT (z,m,m,n,rwrk,1000,iwrk,1000) ! ! Initialisation area map et lignes de contour lines au-dessus ! call ARINAM (map,20000) call CPCLAM (z,rwrk,iwrk,map) ! ! Coloration par appel du sous-programme COLOR ! call ARSCAM (map,xca,yca,1000,ai,ag,10,color) ! ! Trace des lignes de contours ! call GSPLCI (0) call CPCLDR (zt,rwrk,iwrk) call GSPLCI (1) ! ! Ecriture labels apres recuperation des valeurs min et max ! orient_barre = 0 orient_texte = 1 xorlab=.05 xfinlab=.95 yorlab=.15 yfinlab=.25 call CPGETR ('ZMN',zmin) call CPGETR ('ZMX',zmax) do i=1,nb_labels call CPSETR ('ZDV - z data value', + zmin+real(i-1)*(zmax-zmin)/nb_niveaux) call CPGETC ('ZDV - z data value',labels(i)) enddo call LBSETI ('CBL - color of box lines',0) call LBLBAR (orient_barre,xorlab,xfinlab,yorlab,yfinlab, + nb_niveaux,1.,.5,index_col,0,labels,nb_labels,orient_texte) call CLSGKS ! Fermeture de GKS end subroutine COLOR(xca,yca,nca,ai,ag,nai) implicit none real xca(nca),yca(nca) integer ai(nai),ag(nai) integer fill ! ! Les tableaux xca et yca contiennent les coordonnees de ! polygones de nca points ! ! Les tableaux ai et ag sont de longueur 2 ! ai : identificateur d'aire ! ai(1) = 1 a nb_niveau representant un identificateur d'aire ! ai(2) = -1 -> zone hors cadre - ai(2) = 0 -> zone hors cadre ! ag = 1-2 (ezmap) 3-4 (conpack) identificateur de groupes ! fill = 1 ! Par defaut, polygone rempli do i=1,nai if (ai(i).lt.0) fill = 0 !Mais pas si un ai < 0 end do * if (fill.ne.0) then ! Si polygone a remplir fill = 0 do i=1,nai ! Balayage indices d'identifier if (ag(i).eq.3) fill = ai(i) ! Si groupe 3 c'est un contour end do if (fill.gt.0) then call gsfaci(fill+2) call gfa(nca-1,xca,yca) end if end if return end subroutine DEFCOL dimension rgbv(3,0:15) data rgbv /0.00 , 0.00 , 0.00 , ! noir + 1.00 , 1.00 , 1.00 , ! blanc + 0.70 , 0.70 , 0.70 , + 0.75 , 0.50 , 1.00 , + 0.50 , 0.00 , 1.00 , + 0.00 , 0.00 , 1.00 , + 0.00 , 0.50 , 1.00 , + 0.00 , 1.00 , 1.00 , + 0.00 , 1.00 , 0.00 , + 0.70 , 1.00 , 0.00 , + 1.00 , 1.00 , 0.00 , + 1.00 , 0.75 , 0.00 , + 1.00 , 0.38 , 0.38 , + 1.00 , 0.00 , 0.38 , + 1.00 , 0.00 , 0.00 / do i=0,15 ! Definition de 16 couleurs en mode RGB call gscr(1,i,rgbv(1,i),rgbv(2,i),rgbv(3,i)) enddo return end