C PROGRAM TO READ H K L F AND WRITE H K L F2 SIG(F2) C C To run the program using the batch file FTOI.BAT C enter: C FTOI name C C For name substitute the name of the .RED file (without C .RED extension) C.................................................................... C Example : FTOI MNCU C MNCU.RED containing h k l f sigmaf (format free) will C be read and MNCU.HKL will be created - it will have C h k l f2 sigmaf2 in the proper format for SHELX input C (HKLF 4). MNCU.RED must be available in your current C directory. MNCU.HKL may or may not exist. C.................................................................... 100 READ (1,*,END=110)IH,IK,IL,F,SF IF (IH.EQ.0.AND.IK.EQ.0.AND.IL.EQ.0) GOTO 110 IF (F.LT.0.) GOTO 105 SF = 2.*F*SF F = F*F GOTO 112 105 SF = ABS(2.*F*SF) F = -(F*F) IF(F.LT.-9999.) THEN WRITE(2,26)IH,IK,IL,F,SF GOTO 100 ENDIF 112 IF(F.GT.99999.) THEN WRITE(2,26)IH,IK,IL,F,SF ELSE WRITE(2,25)IH,IK,IL,F,SF ENDIF GOTO 100 110 F=0 SF=0 IH=0 IK=0 IL=0 111 WRITE (2,25)IH,IK,IL,F,SF 25 FORMAT (3I4,2F8.2) 26 FORMAT (3I4,2F8.1) STOP END