 !       CALL WDIALOGSELECT(IDD_NONSURF1)
C
C       LOAD UP VALUES
C
C       CW,PWP,SWP
 !       CALL WDIALOGPUTINTEGER(IDF_CW,INT(SYSTEM1(11)))
 !       CALL WDIALOGPUTINTEGER(IDF_PWP1,INT(SYSTEM1(7)))
 !       CALL WDIALOGPUTINTEGER(IDF_PWP2,INT(SYSTEM1(8)))
 !       CALL WDIALOGPUTINTEGER(IDF_SWP1,INT(SYSTEM1(9)))
 !       CALL WDIALOGPUTINTEGER(IDF_SWP2,INT(SYSTEM1(10)))
C
C       WAVELENGTHS
 !       CALL WDIALOGPUTDOUBLE(IDF_WV1,SYSTEM1(1))
 !       CALL WDIALOGPUTDOUBLE(IDF_WV2,SYSTEM1(2))
 !       CALL WDIALOGPUTDOUBLE(IDF_WV3,SYSTEM1(3))
 !       CALL WDIALOGPUTDOUBLE(IDF_WV4,SYSTEM1(4))
 !       CALL WDIALOGPUTDOUBLE(IDF_WV5,SYSTEM1(5))
 !       CALL WDIALOGPUTDOUBLE(IDF_WV6,SYSTEM1(71))
 !       CALL WDIALOGPUTDOUBLE(IDF_WV7,SYSTEM1(72))
 !       CALL WDIALOGPUTDOUBLE(IDF_WV8,SYSTEM1(73))
 !       CALL WDIALOGPUTDOUBLE(IDF_WV9,SYSTEM1(74))
 !       CALL WDIALOGPUTDOUBLE(IDF_WV10,SYSTEM1(75))
C       SPECTRAL WEIGHTS
 !       CALL WDIALOGPUTDOUBLE(IDF_SPTWT1,SYSTEM1(31))
 !       CALL WDIALOGPUTDOUBLE(IDF_SPTWT2,SYSTEM1(32))
 !       CALL WDIALOGPUTDOUBLE(IDF_SPTWT3,SYSTEM1(33))
 !       CALL WDIALOGPUTDOUBLE(IDF_SPTWT4,SYSTEM1(34))
 !       CALL WDIALOGPUTDOUBLE(IDF_SPTWT5,SYSTEM1(35))
 !       CALL WDIALOGPUTDOUBLE(IDF_SPTWT6,SYSTEM1(76))
 !       CALL WDIALOGPUTDOUBLE(IDF_SPTWT7,SYSTEM1(77))
 !       CALL WDIALOGPUTDOUBLE(IDF_SPTWT8,SYSTEM1(78))
 !       CALL WDIALOGPUTDOUBLE(IDF_SPTWT9,SYSTEM1(79))
 !       CALL WDIALOGPUTDOUBLE(IDF_SPTWT10,SYSTEM1(80))
C       LENS MODE
!        IF(SYSTEM1(30).EQ.1.0D0) CALL WDIALOGPUTRADIOBUTTON(IDF_MODE1)
!        IF(SYSTEM1(30).EQ.2.0D0) CALL WDIALOGPUTRADIOBUTTON(IDF_MODE3)
!        IF(SYSTEM1(30).EQ.3.0D0) CALL WDIALOGPUTRADIOBUTTON(IDF_MODE2)
!        IF(SYSTEM1(30).EQ.4.0D0) CALL WDIALOGPUTRADIOBUTTON(IDF_MODE4)
C       AIMING
!        IF(SYSTEM1(70).EQ.0.0D0) THEN
!        IF(SYSTEM1(63).EQ.0.0D0) THEN
!        IF(SYSTEM1(62).EQ.1.0D0) CALL WDIALOGPUTRADIOBUTTON(IDF_AIM1)
!        IF(SYSTEM1(62).EQ.0.0D0) CALL WDIALOGPUTRADIOBUTTON(IDF_AIM2)
!                        END IF
!        IF(SYSTEM1(62).EQ.0.0D0) THEN
!        IF(SYSTEM1(63).EQ.1.0D0) CALL WDIALOGPUTRADIOBUTTON(IDF_AIM3)
!                        END IF
!                        ELSE
C       APLANATIC AIMING
 !       CALL WDIALOGPUTRADIOBUTTON(IDF_AIM4)
!                        END IF
C       UNITS
!        IF(SYSTEM1(6).EQ.1.0D0) CALL WDIALOGPUTRADIOBUTTON(IDF_UNITS1)
!        IF(SYSTEM1(6).EQ.2.0D0) CALL WDIALOGPUTRADIOBUTTON(IDF_UNITS2)
!        IF(SYSTEM1(6).EQ.3.0D0) CALL WDIALOGPUTRADIOBUTTON(IDF_UNITS3)
!        IF(SYSTEM1(6).EQ.4.0D0) CALL WDIALOGPUTRADIOBUTTON(IDF_UNITS4)
C
C       LI
 !       CALL WDIALOGPUTSTRING(IDF_LI,LI)
C
C       LIC 1
 !       CALL WDIALOGPUTSTRING(IDF_LIC1,LIC(1))
C
C       LIC 2
 !       CALL WDIALOGPUTSTRING(IDF_LIC2,LIC(2))
C
C       LIC 3
 !       CALL WDIALOGPUTSTRING(IDF_LIC3,LIC(3))
C
C       LIC 4
 !       CALL WDIALOGPUTSTRING(IDF_LIC4,LIC(4))
C
C       INI
 !       CALL WDIALOGPUTSTRING(IDF_INI,INNI)
C
C       APERTURES
C
C       FIX SYSTEM1(49)
        IF(SYSTEM1(12).EQ.SYSTEM1(13).AND.SYSTEM1(49).EQ.1.0D0.OR.
     1  SYSTEM1(12).EQ.SYSTEM1(13).AND.SYSTEM1(49).EQ.3.0D0)
     2  SYSTEM1(49)=SYSTEM1(49)-1.0D0
C
        IF(SYSTEM1(49).NE.1.0D0.AND.SYSTEM1(49).NE.3.0D0) THEN
 !       CALL WDIALOGPUTCHECKBOX(IDF_SAMEAPE,1)
                        ELSE
 !       CALL WDIALOGPUTCHECKBOX(IDF_SAMEAPE,0)
                        END IF
        IF(SYSTEM1(64).EQ.1.0D0) THEN
C       NAO
 !       CALL WDIALOGPUTRADIOBUTTON(IDF_SAY2)
 !       CALL WDIALOGPUTDOUBLE(IDF_X,SYSTEM1(66))
 !       CALL WDIALOGPUTDOUBLE(IDF_Y,SYSTEM1(65))
                        END IF
        IF(SYSTEM1(67).EQ.1.0D0) THEN
C       NAO
 !       CALL WDIALOGPUTRADIOBUTTON(IDF_SAY3)
 !       CALL WDIALOGPUTDOUBLE(IDF_X,SYSTEM1(69))
 !       CALL WDIALOGPUTDOUBLE(IDF_Y,SYSTEM1(67))
                        END IF
        IF(SYSTEM1(83).EQ.1.0D0) SYSTEM1(84)=1.0D0
        IF(SYSTEM1(84).EQ.1.0D0) SYSTEM1(83)=1.0D0
        IF(SYSTEM1(83).EQ.1.0D0) THEN
C       SAY/SAX FLOAT
 !       CALL WDIALOGPUTRADIOBUTTON(IDF_SAY4)
 !       CALL WDIALOGPUTDOUBLE(IDF_X,(2.0D0*SYSTEM1(13)))
 !       CALL WDIALOGPUTDOUBLE(IDF_Y,(2.0D0*SYSTEM1(12)))
                        END IF
        IF(SYSTEM1(83).EQ.0.0D0.AND.SYSTEM1(84).EQ.0.0D0.AND.
     1  SYSTEM1(67).EQ.0.0D0.AND.SYSTEM1(64).EQ.0.0D0) THEN
C       EPD
 !       CALL WDIALOGPUTRADIOBUTTON(IDF_SAY1)
 !       CALL WDIALOGPUTDOUBLE(IDF_X,(2.0D0*SYSTEM1(13)))
 !       CALL WDIALOGPUTDOUBLE(IDF_Y,(2.0D0*SYSTEM1(12)))
                        END IF
C
C       FIELDS
        IF(SYSTEM1(92).EQ.0.0D0.AND.SYSTEM1(93).EQ.0.0D0.AND.
     1  SYSTEM1(96).EQ.0.0D0.AND.SYSTEM1(97).EQ.0.0D0) THEN
C       NOT PYIM,PXIM,RYIM OR RXIM
C
C       FIX SYSTEM1(49)
        IF(SYSTEM1(18).EQ.0.0D0.AND.SYSTEM1(18).EQ.SYSTEM1(19)) THEN
C       OBJ HT SAME MODE
C       WRITE(OUTLYNE,*) SYSTEM1(14),SYSTEM1(16)
C       CALL SHOWIT(1)
C       WRITE(OUTLYNE,*) SYSTEM1(15),SYSTEM1(17)
C       CALL SHOWIT(1)
        IF(SYSTEM1(14).EQ.SYSTEM1(16).AND.SYSTEM1(15).EQ.SYSTEM1(17)
     1  .AND.SYSTEM1(49).EQ.2.0D0.OR.
     1  SYSTEM1(14).EQ.SYSTEM1(16).AND.SYSTEM1(15).EQ.SYSTEM1(17).AND.
     1  SYSTEM1(49).EQ.3.0D0) SYSTEM1(49)=SYSTEM1(49)-1.0D0
                        END IF
        IF(SYSTEM1(18).EQ.1.0D0.AND.SYSTEM1(18).EQ.SYSTEM1(19)) THEN
C       OBJ ANG SAME MODE
C       WRITE(OUTLYNE,*) SYSTEM1(21),SYSTEM1(23)
C       CALL SHOWIT(1)
C       WRITE(OUTLYNE,*) SYSTEM1(22),SYSTEM1(24)
C       CALL SHOWIT(1)
        IF(SYSTEM1(21).EQ.SYSTEM1(23).AND.SYSTEM1(22).EQ.SYSTEM1(24)
     1  .AND.SYSTEM1(49).EQ.2.0D0.OR.
     1  SYSTEM1(21).EQ.SYSTEM1(23).AND.SYSTEM1(22).EQ.SYSTEM1(24).AND.
     1  SYSTEM1(49).EQ.3.0D0) SYSTEM1(49)=SYSTEM1(49)-1.0D0
                        END IF
                        ELSE
        IF(SYSTEM1(92).NE.0.0D0.AND.SYSTEM1(93).NE.0.0D0.AND.
     1SYSTEM1(92).EQ.SYSTEM1(93).AND.SYSTEM1(49).EQ.2.0D0.OR.
     1SYSTEM1(92).NE.0.0D0.AND.SYSTEM1(93).NE.0.0D0.AND.
     1SYSTEM1(92).EQ.SYSTEM1(93).AND.SYSTEM1(49).EQ.3.0D0)
     4SYSTEM1(49)=SYSTEM1(49)-1.0D0
        IF(SYSTEM1(96).NE.0.0D0.AND.SYSTEM1(97).NE.0.0D0.AND.
     1SYSTEM1(96).EQ.SYSTEM1(97).AND.SYSTEM1(49).EQ.2.0D0.OR.
     1SYSTEM1(96).NE.0.0D0.AND.SYSTEM1(97).NE.0.0D0.AND.
     1SYSTEM1(96).EQ.SYSTEM1(97).AND.SYSTEM1(49).EQ.3.0D0)
     4SYSTEM1(49)=SYSTEM1(49)-1.0D0
                        END IF
C
        IF(SYSTEM1(49).NE.2.0D0.AND.SYSTEM1(49).NE.3.0D0) THEN
 !       CALL WDIALOGPUTCHECKBOX(IDF_SAMEFIELD,1)
                        ELSE
 !       CALL WDIALOGPUTCHECKBOX(IDF_SAMEFIELD,0)
                        END IF
        IF(SYSTEM1(60).EQ.1.0D0.OR.SYSTEM1(61).EQ.1.0D0) THEN
        SYSTEM1(60)=1.0D0
        SYSTEM1(61)=1.0D0
        END IF
C       SCY/SCX OR SCY FANG/SCX FANG EXPLICITLY
        IF(SYSTEM1(18).EQ.0.0D0) THEN
C       SCY/SCX
 !       CALL WDIALOGPUTRADIOBUTTON(IDF_F1)
 !       CALL WDIALOGPUTDOUBLE(IDF_XREF,SYSTEM1(16))
 !       CALL WDIALOGPUTDOUBLE(IDF_YREF,SYSTEM1(14))
 !       CALL WDIALOGFIELDSTATE(IDF_CX,1)
 !       CALL WDIALOGFIELDSTATE(IDF_CY,1)
 !       CALL WDIALOGPUTDOUBLE(IDF_CX,SYSTEM1(17))
 !       CALL WDIALOGPUTDOUBLE(IDF_CY,SYSTEM1(15))
                        ELSE
C       SCY FANG/SCX FANG
 !       CALL WDIALOGPUTRADIOBUTTON(IDF_F2)
 !       CALL WDIALOGPUTDOUBLE(IDF_XREF,SYSTEM1(23))
 !       CALL WDIALOGPUTDOUBLE(IDF_YREF,SYSTEM1(21))
 !       CALL WDIALOGFIELDSTATE(IDF_CX,1)
 !       CALL WDIALOGFIELDSTATE(IDF_CY,1)
 !       CALL WDIALOGPUTDOUBLE(IDF_CX,SYSTEM1(24))
 !       CALL WDIALOGPUTDOUBLE(IDF_CY,SYSTEM1(22))
                        END IF
        IF(SYSTEM1(94).NE.0.0D0.OR.SYSTEM1(95).NE.0.0D0) THEN
        SYSTEM1(94)=SYSTEM1(95)
C       PYIM AND PXIM
        IF(SYSTEM1(94).EQ.-1.0D0) THEN
C       PXIM/PYIM
 !       CALL WDIALOGPUTRADIOBUTTON(IDF_F3)
 !       CALL WDIALOGPUTDOUBLE(IDF_XREF,SYSTEM1(92))
 !       CALL WDIALOGPUTDOUBLE(IDF_YREF,SYSTEM1(93))
 !       CALL WDIALOGCLEARFIELD(IDF_CX)
 !       CALL WDIALOGCLEARFIELD(IDF_CY)
 !       CALL WDIALOGFIELDSTATE(IDF_CX,2)
 !       CALL WDIALOGFIELDSTATE(IDF_CY,2)
                        ELSE
C       PXIM FANG, PXIM FANG
 !       CALL WDIALOGPUTRADIOBUTTON(IDF_F4)
 !       CALL WDIALOGPUTDOUBLE(IDF_XREF,SYSTEM1(92))
 !       CALL WDIALOGPUTDOUBLE(IDF_YREF,SYSTEM1(93))
 !       CALL WDIALOGCLEARFIELD(IDF_CX)
 !       CALL WDIALOGCLEARFIELD(IDF_CY)
 !       CALL WDIALOGFIELDSTATE(IDF_CX,2)
 !       CALL WDIALOGFIELDSTATE(IDF_CY,2)
                        END IF
                        END IF
        IF(SYSTEM1(98).NE.0.0D0.OR.SYSTEM1(99).NE.0.0D0) THEN
        SYSTEM1(98)=SYSTEM1(99)
C       RYIM AND RXIM
        IF(SYSTEM1(98).EQ.-1.0D0) THEN
C       RXIM/RYIM
 !       CALL WDIALOGPUTRADIOBUTTON(IDF_F5)
 !       CALL WDIALOGPUTDOUBLE(IDF_XREF,SYSTEM1(96))
 !       CALL WDIALOGPUTDOUBLE(IDF_YREF,SYSTEM1(97))
 !       CALL WDIALOGCLEARFIELD(IDF_CX)
 !       CALL WDIALOGCLEARFIELD(IDF_CY)
 !       CALL WDIALOGFIELDSTATE(IDF_CX,2)
 !       CALL WDIALOGFIELDSTATE(IDF_CY,2)
                        ELSE
C       RXIM FANG, RXIM FANG
 !       CALL WDIALOGPUTRADIOBUTTON(IDF_F6)
 !       CALL WDIALOGPUTDOUBLE(IDF_XREF,SYSTEM1(96))
 !       CALL WDIALOGPUTDOUBLE(IDF_YREF,SYSTEM1(97))
 !       CALL WDIALOGCLEARFIELD(IDF_CX)
 !       CALL WDIALOGCLEARFIELD(IDF_CY)
 !       CALL WDIALOGFIELDSTATE(IDF_CX,2)
 !       CALL WDIALOGFIELDSTATE(IDF_CY,2)
                        END IF
                        END IF
 !       CALL WDialogShow(-1,-1,0,Modeless)
