C       ARRAY AND DIFFRACTION GRATINGS
C
!        CALL WDialogSelect(GRTARRAY)
        J=EDIT_SURFACE
        CALL ITOAA(J,AJ)
!        CALL WDialogPutInteger(SURFNUM,J)
C
C       GRATING
C
C       NO GRATING
        IF(ALENS(96,EDIT_SURFACE).EQ.0.0D0) THEN
!        CALL WDIALOGPUTRADIOBUTTON(GRT1)
!        CALL WDIALOGPUTDOUBLE(GRO,0.0D0)
!        CALL WDIALOGPUTDOUBLE(GRS,0.0D0)
!        CALL WDIALOGPUTDOUBLE(GRX,1.0D0)
!        CALL WDIALOGPUTDOUBLE(GRY,0.0D0)
!        CALL WDIALOGPUTDOUBLE(GRZ,0.0D0)
                        END IF
C       GRATING
        IF(ALENS(96,EDIT_SURFACE).NE.0.0D0) THEN
!        CALL WDIALOGPUTRADIOBUTTON(GRT2)
!        CALL WDIALOGPUTDOUBLE(GRO,ALENS(97,J))
!        CALL WDIALOGPUTDOUBLE(GRS,ALENS(98,J))
!        CALL WDIALOGPUTDOUBLE(GRX,ALENS(99,J))
!        CALL WDIALOGPUTDOUBLE(GRY,ALENS(100,J))
!        CALL WDIALOGPUTDOUBLE(GRZ,ALENS(101,J))
                        END IF
C       ARRAY LENS
C
C       NO ARRAY
        IF(ALENS(133,EDIT_SURFACE).EQ.0.0D0) THEN
!        CALL WDIALOGPUTRADIOBUTTON(ARRAY1)
!        CALL WDIALOGPUTRADIOBUTTON(EVENODD1)
!        CALL WDIALOGPUTDOUBLE(DX,0.0D0)
!        CALL WDIALOGPUTDOUBLE(DY,0.0D0)
                        END IF
C       ARRAY
        IF(ALENS(133,EDIT_SURFACE).NE.0.0D0) THEN
!        CALL WDIALOGPUTRADIOBUTTON(ARRAY2)
!        IF(ALENS(133,J).LT.0.0D0)
!     1  CALL WDIALOGPUTRADIOBUTTON(EVENODD1)
!        IF(ALENS(133,J).GT.0.0D0)
!     1  CALL WDIALOGPUTRADIOBUTTON(EVENODD2)
!        CALL WDIALOGPUTDOUBLE(DX,ALENS(131,J))
!        CALL WDIALOGPUTDOUBLE(DY,ALENS(132,J))
                        END IF
!        CALL WDialogShow(-1,-1,0,Modeless)
