!        CALL WDIALOGSELECT(IDD_NONSURF2)
C
C       LOAD UP VALUES
C
C       GAUSSIAN
!        CALL WDIALOGPUTDOUBLE(WRX,SYSTEM1(85))
!        CALL WDIALOGPUTDOUBLE(WRY,SYSTEM1(86))
!        CALL WDIALOGPUTDOUBLE(BDX,SYSTEM1(87))
!        CALL WDIALOGPUTDOUBLE(BDY,SYSTEM1(88))
C
C       AUTOFUNCTION
!        CALL WDIALOGPUTINTEGER(FUNCNUM,INT(SYSTEM1(91)))
!        CALL WDIALOGPUTCHECKBOX(AUTOFUNC,0)
!        IF(SYSTEM1(91).GT.0.0D0) CALL WDIALOGPUTCHECKBOX(AUTOFUNC,1)
C
C       IDEAL AND REAL
!        CALL WDIALOGFIELDSTATE(IDEALEFL,0)
!        CALL WDIALOGCLEARFIELD(IDEALEFL)
!        CALL WDIALOGPUTCHECKBOX(IDEAL,0)
!        CALL WDIALOGPUTCHECKBOX(PERFECT,0)
        IF(ALENS(121,INT(SYSTEM1(20))-1).NE.0.0D0) THEN
C       IDEAL
!        CALL WDIALOGFIELDSTATE(IDEALEFL,1)
!        CALL WDIALOGPUTDOUBLE(IDEALEFL,ALENS(121,NEWIMG-1))
!        CALL WDIALOGPUTCHECKBOX(IDEAL,1)
!        CALL WDIALOGPUTCHECKBOX(PERFECT,0)
                        END IF
        IF(GLANAM(INT(SYSTEM1(20))-1,2).EQ.'PERFECT      ') THEN
C       PERFECT
!        CALL WDIALOGFIELDSTATE(IDEALEFL,0)
!        CALL WDIALOGCLEARFIELD(IDEALEFL)
!        CALL WDIALOGPUTCHECKBOX(PERFECT,1)
!        CALL WDIALOGPUTCHECKBOX(IDEAL,0)
                        END IF
C
C       MAXFLDS
!        CALL WDIALOGPUTINTEGER(MAXFLDS,CFLDCNT)
                        DO I=1,10
!        CALL WDIALOGCLEARFIELD(X1)
!        CALL WDIALOGCLEARFIELD(X2)
!        CALL WDIALOGCLEARFIELD(X3)
!        CALL WDIALOGCLEARFIELD(X4)
!        CALL WDIALOGCLEARFIELD(X5)
!        CALL WDIALOGCLEARFIELD(X6)
!        CALL WDIALOGCLEARFIELD(X7)
!        CALL WDIALOGCLEARFIELD(X8)
!        CALL WDIALOGCLEARFIELD(X9)
!        CALL WDIALOGCLEARFIELD(X10)
!        CALL WDIALOGCLEARFIELD(Y1)
!        CALL WDIALOGCLEARFIELD(Y2)
!        CALL WDIALOGCLEARFIELD(Y3)
!        CALL WDIALOGCLEARFIELD(Y4)
!        CALL WDIALOGCLEARFIELD(Y5)
!        CALL WDIALOGCLEARFIELD(Y6)
!        CALL WDIALOGCLEARFIELD(Y7)
!        CALL WDIALOGCLEARFIELD(Y8)
!        CALL WDIALOGCLEARFIELD(Y9)
!        CALL WDIALOGCLEARFIELD(Y10)
!        CALL WDIALOGFIELDSTATE(X1,2)
!        CALL WDIALOGFIELDSTATE(X2,2)
!        CALL WDIALOGFIELDSTATE(X3,2)
!        CALL WDIALOGFIELDSTATE(X4,2)
!        CALL WDIALOGFIELDSTATE(X5,2)
!        CALL WDIALOGFIELDSTATE(X6,2)
!        CALL WDIALOGFIELDSTATE(X7,2)
!        CALL WDIALOGFIELDSTATE(X8,2)
!        CALL WDIALOGFIELDSTATE(X9,2)
!        CALL WDIALOGFIELDSTATE(X10,2)
!        CALL WDIALOGFIELDSTATE(Y1,2)
!        CALL WDIALOGFIELDSTATE(Y2,2)
!        CALL WDIALOGFIELDSTATE(Y3,2)
!        CALL WDIALOGFIELDSTATE(Y4,2)
!        CALL WDIALOGFIELDSTATE(Y5,2)
!        CALL WDIALOGFIELDSTATE(Y6,2)
!        CALL WDIALOGFIELDSTATE(Y7,2)
!        CALL WDIALOGFIELDSTATE(Y8,2)
!        CALL WDIALOGFIELDSTATE(Y9,2)
!        CALL WDIALOGFIELDSTATE(Y10,2)
                        END DO
                        IF(CFLDCNT.GE.1) THEN
!        CALL WDIALOGPUTDOUBLE(X1,CFLDS(1,1))
!        CALL WDIALOGPUTDOUBLE(Y1,CFLDS(2,1))
!        CALL WDIALOGFIELDSTATE(X1,1)
!        CALL WDIALOGFIELDSTATE(Y1,1)
                        END IF
                        IF(CFLDCNT.GE.2) THEN
!        CALL WDIALOGPUTDOUBLE(X2,CFLDS(1,2))
!        CALL WDIALOGPUTDOUBLE(Y2,CFLDS(2,2))
!        CALL WDIALOGFIELDSTATE(X2,1)
!        CALL WDIALOGFIELDSTATE(Y2,1)
                        END IF
                        IF(CFLDCNT.GE.3) THEN
!        CALL WDIALOGPUTDOUBLE(X3,CFLDS(1,3))
!        CALL WDIALOGPUTDOUBLE(Y3,CFLDS(2,3))
!        CALL WDIALOGFIELDSTATE(X3,1)
!        CALL WDIALOGFIELDSTATE(Y3,1)
                        END IF
                        IF(CFLDCNT.GE.4) THEN
!        CALL WDIALOGPUTDOUBLE(X4,CFLDS(1,4))
!        CALL WDIALOGPUTDOUBLE(Y4,CFLDS(2,4))
!        CALL WDIALOGFIELDSTATE(X4,1)
!        CALL WDIALOGFIELDSTATE(Y4,1)
                        END IF
                        IF(CFLDCNT.GE.5) THEN
!        CALL WDIALOGPUTDOUBLE(X5,CFLDS(1,5))
!        CALL WDIALOGPUTDOUBLE(Y5,CFLDS(2,5))
!        CALL WDIALOGFIELDSTATE(X5,1)
!        CALL WDIALOGFIELDSTATE(Y5,1)
                        END IF
                        IF(CFLDCNT.GE.6) THEN
!        CALL WDIALOGPUTDOUBLE(X6,CFLDS(1,6))
!        CALL WDIALOGPUTDOUBLE(Y6,CFLDS(2,6))
!        CALL WDIALOGFIELDSTATE(X6,1)
!        CALL WDIALOGFIELDSTATE(Y6,1)
                        END IF
                        IF(CFLDCNT.GE.7) THEN
!        CALL WDIALOGPUTDOUBLE(X7,CFLDS(1,7))
!        CALL WDIALOGPUTDOUBLE(Y7,CFLDS(2,7))
!        CALL WDIALOGFIELDSTATE(X7,1)
!        CALL WDIALOGFIELDSTATE(Y7,1)
                        END IF
                        IF(CFLDCNT.GE.8) THEN
!        CALL WDIALOGPUTDOUBLE(X8,CFLDS(1,8))
!        CALL WDIALOGPUTDOUBLE(Y8,CFLDS(2,8))
!        CALL WDIALOGFIELDSTATE(X8,1)
!        CALL WDIALOGFIELDSTATE(Y8,1)
                        END IF
                        IF(CFLDCNT.GE.9) THEN
!        CALL WDIALOGPUTDOUBLE(X9,CFLDS(1,9))
!        CALL WDIALOGPUTDOUBLE(Y9,CFLDS(2,9))
!        CALL WDIALOGFIELDSTATE(X9,1)
!        CALL WDIALOGFIELDSTATE(Y9,1)
                        END IF
                        IF(CFLDCNT.GE.10) THEN
!        CALL WDIALOGPUTDOUBLE(X10,CFLDS(1,10))
!        CALL WDIALOGPUTDOUBLE(Y10,CFLDS(2,10))
!        CALL WDIALOGFIELDSTATE(X10,1)
!        CALL WDIALOGFIELDSTATE(Y10,1)
                        END IF
C
C
!        CALL WDialogShow(-1,-1,0,Modeless)
