Array visualizer problems

Array visualizer problems

Hello folks,

I am using the latest version of Array Visualizer with CVF 6.6 on Windows 2000. The program is using AV to make contour plots of temperature, dissolved oxygen, etc. for a reservoir water quality simulation that are updated periodically (generally every day) through the simulation. I am having several problems and was wondering if anyone else has run into them.

First, I encounter random occurences of illegal memory access when initializing the array viewer screen output. The workaround has been to shut down the simulation and start all over. The problem does not occur when updating the array in the contour plot - only during initialization.

Second, data values in the array viewer sometimes take on completely different values than are plotted in the contour plot. For example, temperature values will be > 50 deg C in the data pane, but the contour plot will show that the highest temperature is 25 deg C.

Third, sometimes the contour plot values will display completely erroneous values, such as temperature being verticaly stratified one day, 15 deg C everywhere the next day, and the following day go back to showing vertically stratified conditions. This also appears to be random. I have verified that the isothermal contour plot is erroneous by comparing to hardcopy output from the program.

Last, the updates of the contour plots are extremely jerky. The computational grid that is being displayed changes shape (gets very "blocky" - I don't know how to explain it better) when being updated and a second later takes on the correct shape with appropriate values.

I think the last problem may be related to very slow updates. For example, updating 3 contour plots in the AV once a day can easily double the runtime of the simulation over 300 days. Since AV is using openGL to plot the arrays, I am puzzled by the poor performance. After a lot of poking around in the documentation and the CVF newsletter on AV, I thought that putting in

!DEC$ATTRIBUTE array_visualizer :: CONC

where CONC is the concentration/temperature array being updated, might help with the performance problem, but it doesn't appear to make any difference. I have also enabled the hardware acceleration option with no discernable difference in the update speed.

Anyway, has anyone else run into any of these problems, and, if so, is there a quick solution to any of them? Any help is greatly appreciated.

Tom

4 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

I suggest you send mail to vf-support@compaq.com and describe the problems - our AV experts don't follow this forum.

Steve

Steve - Intel Developer Support

Steve,

Thanks. The more I delve into this, the more I think the problems I am experiencing are due to my inexperience with F90/F95 and the way arrays are efficiently passed. I am going to post the code here in hopes that this example may help others to get a feel for how to efficiently handle arrays, if what I suspect is true.

Here is the code:

 
    DO JC=1,NCT   ! The following initializes the array viewer using a portion of C2 
      IF (CONSTITUENT_PLOT(JC)) CALL GRAPH_OPEN (JH+JC,C2(:,:,JC),   CNAME(JC), CMIN(JC), CMAX(JC), CMULT(JC), LNAME(JH+JC)) 
    END DO 
 
. 
. 
    DO JC=1,NCT  !The following updates the array viewer using a portion of C2 
      IF (CONSTITUENT_PLOT(JC)) CALL GRAPH_UPDATE (JH+JC,C2(:,:,JC),   CNAME(JC), CMIN(JC), CMULT(JC), LNAME(JH+JC)) 
    END DO 
 
. 
. 
. 
 
RECURSIVE SUBROUTINE GRAPH 
  USE DFCOM; USE DFLIB;  USE AVVIEWER; USE AVDEF 
  USE PREC;  USE GLOBAL; USE GDAYC;    USE SCREENC 
 
! Variable declarations 
 
  REAL                       :: MULT,   C(KMX,IMX), C0(KMX,IMX) 
  REAL,    SAVE, ALLOCATABLE :: CONC(:,:) 
  REAL(R8)                   :: PALMIN, PALMAX 
  INTEGER                    :: STATUS 
  INTEGER, SAVE, ALLOCATABLE :: H(:) 
  INTEGER(I2)                :: ONE=1,  TWO=2 
  LOGICAL                    :: AUTO_ADJUST 
  CHARACTER(*)               :: NAME 
  CHARACTER(12)              :: YTITLE='Layer number' 
  CHARACTER(14)              :: XTITLE='Segment number' 
  CHARACTER(44)              :: DATE 
  ALLOCATE (H(NCT+NHY+NDC),CONC(KMX,IMX)) 
RETURN 
 
ENTRY GRAPH_OPEN (J,C,NAME,PALMIN,PALMAX,MULT,L) 
  AUTO_ADJUST = PALMAX < 0 
  L           = MAX(SCAN(NAME,']'),SCAN(NAME,',')-1) 
  IF (L == 0) L = LEN_TRIM(ADJUSTL(NAME)) 
  WRITE (DATE,'("    Julian day = ",F8.2,1X,A9,1X,I2,",",1X,I4)') JDAY,MONTH,GDAY,YEAR 
  CALL ARRAY_INITIALIZE (C,PALMIN,MULT) 
 
! Array viewer setup 
 
  CALL ComInitialize  (STATUS) 
  CALL faglStartWatch (CONC,STATUS) 
  CALL favStartViewer (H(J),STATUS) 
 
! Graph setup  
 
  CALL favSetPrecision           (H(J),1,              STATUS) 
  CALL favSetArray               (H(J),CONC,           STATUS) 
  CALL favSetImageOrientation    (H(J),YFLIP,          STATUS) 
  CALL favSetArrayName           (H(J),NAME(1:L)//DATE,STATUS) 
  CALL favSetGraphType           (H(J),IMAGEMAP,       STATUS) 
  IF (.NOT. AUTO_ADJUST) THEN 
    CALL favSetPaletteAutoAdjust (H(J),AV_FALSE,       STATUS) 
    CALL favSetPaletteRange      (H(J),PALMIN,PALMAX,  STATUS) 
  END IF 
  CALL favSetShowPalette         (H(J),AV_TRUE,        STATUS) 
  CALL favShowWindow             (H(J),AV_TRUE,        STATUS) 
  CALL favSetDimName             (H(J),TWO,XTITLE,     STATUS) 
  CALL favSetDimName             (H(J),ONE,YTITLE,     STATUS) 
RETURN 
 
ENTRY GRAPH_UPDATE (J,C,NAME,PALMIN,MULT,L) 
  WRITE (DATE,'("    Julian day = ",F8.2,1X,A9,1X,I2,",",1X,I4)') JDAY,MONTH,GDAY,YEAR 
  CALL ARRAY_INITIALIZE  (C,   PALMIN,         MULT) 
  CALL favSetArrayName   (H(J),NAME(1:L)//DATE,STATUS) 
  CALL favSetShowPalette (H(J),AV_TRUE,        STATUS) 
  CALL favUpdate         (H(J),0,              STATUS) 
RETURN 
 
ENTRY ARRAY_INITIALIZE (C0,PALMIN,MULT) 
  CONC = PALMIN 
  DO JJW=1,NWB 
    KT = KTWB(JJW) 
    DO JB=BS(JJW),BE(JJW) 
      DO I=CUS(JB),DS(JB) 
        DO K=KT,KB(I) 
          CONC(K,I) = C0(K,I)*MULT 
        END DO 
      END DO 
    END DO 
  END DO 
RETURN 
END SUBROUTINE GRAPH

What this code does is pass a port
ion of a previously allocated array C2 that represents the x,z values of a constituent (e.g., temperature, salinity, etc.) to the array C in the routines GRAPH_OPEN and GRAPH_UPDATE. The call to ARRAY_INITIALIZE sets a mask for values outside of the computational grid so that the computational grid "stands out" from the PALMIN value (areas outside the domain of the computational grid take on a negative value that is not allow

The 'blocky' problem seems to come from a property of the graphic control
that allows it to automatically adjust the resolution whenever it thinks it
needs to. I found something in the sample programs that seems to do the
trick:

call favSetResolution(h(j), 1, status)
call favSetResolutionAutoAdjust(h(j),AV_FALSE , status)

added to the GRAPH_OPEN routine.

These routines are not mentioned in any of the documentation, and I
only ran across them by chance as I was browsing the sample programs.

Leave a Comment

Please sign in to add a comment. Not a member? Join today