\documentclass[11pt,twocolumn]{article}
\usepackage{graphicx}
\usepackage{color}
\usepackage{epstopdf}
\usepackage{alltt}
\usepackage{hyperref}

\hypersetup{colorlinks=true}

\textheight = 10.5 in
\linewidth = 8.0in
\oddsidemargin = 0.0 in
\evensidemargin = 0.0 in
\marginparwidth=0.0in
\marginparsep=0.0in
\topmargin = 0.0 in
\headheight = 0.0 in
\headsep = 0.0 in
\parskip = 1pt
\parindent = 0.0in

\setlength{\hoffset}{-24pt}
\setlength{\voffset}{-50pt}
\newcommand{\ttnrbf}[1]{\textnormal{\textbf{#1}}}
\newcommand{\ttnr}[1]{\textnormal{#1}}
\newcommand{\ttitbf}[1]{\textnormal{\textbf{#1}}}
\newcommand{\ttit}[1]{\textit{#1}}
\newcommand{\sSecBox}[1]{\begin{minipage}{3in}\begin{alltt}{\small\textrm{\textbf{#1}}}}
\newcommand{\eSecBox}{\end{alltt}\end{minipage}\\\rule{0pt}{0pt}\hrule}

\newcommand{\srb}[2]{\parbox[t]{#1}{#2}\rule{5pt}{0pt}}

\newcommand{\blt}{\makebox[2ex]{\(\bullet\)}}
\newcommand{\bsp}{\makebox[2ex]{}}

\newcommand{\ifa}{\(\Rightarrow\)}
\newcommand{\iffa}{\(\Leftrightarrow\)}
\newcommand{\dfa}{\makebox[2ex]{\(\mapsto\)}}    % Define Arrow

\newcommand{\aSymb}{\ttit{symb}}
\newcommand{\aChar}{\ttit{char}}
\newcommand{\aByteS}{\ttit{bytespec}}
\newcommand{\aHash}{\ttit{hash}}
\newcommand{\aBody}{\ttit{body}}
\newcommand{\aVal}{\ttit{value}}
\newcommand{\aVec}{\ttit{vector}}
\newcommand{\aArr}{\ttit{array}}
\newcommand{\aList}{\ttit{list}}
\newcommand{\aForm}{\ttit{form}}
\newcommand{\aInt}{\ttit{n}}
\newcommand{\aArg}{\ttit{arg}}
\newcommand{\aFunc}{\ttit{func}}
\newcommand{\aTest}{\ttit{test}}
\newcommand{\aString}{\ttit{string}}
\newcommand{\aName}{\ttit{name}}
\newcommand{\aPair}{\ttit{pair}}
\newcommand{\aSeq}{\ttit{seq}}
\newcommand{\aType}{\ttit{aType}}
\newcommand{\aBitVec}{\ttit{bit-vector}}
\newcommand{\aStream}{\ttit{stream}}

\newcommand{\aExpr}{\ttit{expr}}
\newcommand{\aBool}{\ttit{bool}}
\newcommand{\aSName}{\ttit{Struct\_Name}}
\newcommand{\aLab}{\ttit{label}}

\newcommand{\nByteS}[1]{\ttit{bytespec#1}}
\newcommand{\nPred}[1]{\ttit{predicate#1}}
\newcommand{\nPath}[1]{\ttit{path#1}}
\newcommand{\nBool}[1]{\ttit{bool#1}}
\newcommand{\nSeq}[1]{\ttit{seq#1}}
\newcommand{\nArg}[1]{\ttit{arg#1}}
\newcommand{\nSymb}[1]{\ttit{symb#1}}
\newcommand{\nBody}[1]{\ttit{body#1}}
\newcommand{\nVal}[1]{\ttit{value#1}}
\newcommand{\nList}[1]{\ttit{list#1}}
\newcommand{\nForm}[1]{\ttit{form#1}}
\newcommand{\nTest}[1]{\ttit{test#1}}
\newcommand{\nString}[1]{\ttit{string#1}}
\newcommand{\nInt}[1]{\ttit{int#1}}

%\newcommand{\opt}[1]{\ttit{#1}}
\newcommand{\opt}[1]{\textcolor{blue}{#1}}



\definecolor{grey50}{gray}{0.50}
%\colorbox{grey50}{}
%\textcolor{blue}{}

\begin{document}

\pagestyle{empty}

\fbox{{\parbox[b]{2.5in}{\huge \bf Fortran 95 \\ \tiny \copyright 1996-2016 Mitch Richling \url{https://www.mitchr.me}  \\ Last Updated 2016-07-09}}}
\tiny

\sloppy


\sSecBox{Formats}
\blt Format Items
\bsp\bsp\blt \srb{5pt}{w}\srb{79pt}{total width of the field}\blt\srb{5pt}{m}\srb{70pt}{least number of digits}
\bsp\bsp\blt \srb{5pt}{d}\srb{79pt}{number of digits        }\blt\srb{5pt}{e}\srb{70pt}{number of digits inexponent}
\bsp\bsp\blt \srb{5pt}{c}\srb{79pt}{repeat count}
\bsp\blt \srb{25pt}{\opt{c}Lw            } logical (.TRUE. or .FALSE.)
\bsp\blt \srb{25pt}{\opt{c}A\opt{w}      } character
\bsp\blt \srb{25pt}{\opt{c}Iw\opt{.m}    } integer
\bsp\blt \srb{25pt}{\opt{c}Bw\opt{.m}    } integer in binary
\bsp\blt \srb{25pt}{\opt{c}Ow\opt{.m}    } integer with octal base
\bsp\blt \srb{25pt}{\opt{c}Zw\opt{.m}    } integer with hexadecimal base
\bsp\blt \srb{25pt}{\opt{c}Ew.d\opt{Ee}  } real
\bsp\blt \srb{25pt}{\opt{c}ENw.d\opt{Ee} } real  -- exponent a multiple of 3
\bsp\blt \srb{25pt}{\opt{c}ESw.d\opt{Ee} } real  -- first digit non zero
\bsp\blt \srb{25pt}{\opt{c}Fw.d          } real  -- no exponent printed
\bsp\blt \srb{25pt}{\opt{c}Gw.d\opt{Ee}  } real  -- auto format to F or E
\bsp\blt \srb{25pt}{\opt{c}Dw.d          } real  -- same as E (old double precision)
\blt Format control and control edit descriptors
\bsp\blt \srb{25pt}{BN  }ignore non-leading blanks in numeric fields
\bsp\blt \srb{25pt}{BZ  }treat non-leading blanks in numeric fields as zeros
\bsp\blt \srb{25pt}{S   }printing of optional plus signs is implementation dependent
\bsp\blt \srb{25pt}{SP  }print optional plus signs
\bsp\blt \srb{25pt}{SS  }do not print optional plus signs
\bsp\blt \srb{25pt}{Tn  }tab to column n
\bsp\blt \srb{25pt}{TLn }tab left n columns
\bsp\blt \srb{25pt}{TRn }tab right n columns
\bsp\blt \srb{25pt}{nX  }tab right n columns
\blt Useing formats:
\bsp\blt String Literal:      write (*,\opt{FMT=}'(E10.2)') 10.43
\bsp\blt Character variable:  write (*,\opt{FMT=}aStrVar)   10.43
\bsp\blt Line number:         write (*,\opt{FMT=}10)        10.43
\bsp\bsp                      10 format(xxx)
\eSecBox

\sSecBox{Operators}
\blt \srb{15pt}{**    }\srb{70pt}{exponentiation         }
\blt \srb{15pt}{*     }\srb{70pt}{multiplication         }\blt \srb{15pt}{/     }\srb{70pt}{division               }
\blt \srb{15pt}{+     }\srb{70pt}{addition               }\blt \srb{15pt}{-     }\srb{70pt}{subtraction            }
\blt \srb{15pt}{//    }\srb{70pt}{concatenation          }
\blt \srb{15pt}{==    }\srb{70pt}{equality               }\blt \srb{15pt}{.eq.  }\srb{70pt}{equality               }
\blt \srb{15pt}{/=    }\srb{70pt}{not equal              }\blt \srb{15pt}{.ne.  }\srb{70pt}{not equal              }
\blt \srb{15pt}{<     }\srb{70pt}{less than              }\blt \srb{15pt}{.lt.  }\srb{70pt}{less than              }
\blt \srb{15pt}{>     }\srb{70pt}{greater than           }\blt \srb{15pt}{.gt.  }\srb{70pt}{greater than           }
\blt \srb{15pt}{<=    }\srb{70pt}{less than or equal     }\blt \srb{15pt}{.le.  }\srb{70pt}{less than or equal     }
\blt \srb{15pt}{>=    }\srb{70pt}{greater than or equal  }\blt \srb{15pt}{.ge.  }\srb{70pt}{greater than or equal  }
\blt \srb{15pt}{.not. }\srb{70pt}{complement, negation   }
\blt \srb{15pt}{.and. }\srb{70pt}{logical and            }\blt \srb{15pt}{.or.  }\srb{70pt}{logical or             }
\blt \srb{15pt}{.eqv. }\srb{70pt}{logical equivalence    }\blt \srb{15pt}{.neqv.}\srb{70pt}{logical not equivalence}
\eSecBox

\sSecBox{Array declaration and initialisation}
\blt Declaration in two forms:
\bsp \blt REAL :: scalar, vector(12345), matrix(3,4), array(2,3,4)
\bsp \blt REAL, DIMENSION(2,3) :: matrix
\blt Index extents can be non-one based
\bsp \blt REAL :: X(-1:2,3,4)
\bsp \blt REAL :: CstyleArr(0:9)
\blt Initalization
\bsp \blt INTEGER          :: vec(3) = (/ 1, 2, 3 /)
\bsp \blt CHARACTER(LEN=3) :: workday(0:6) = (/'Mon','Tue','Wed','Thu','Fri'/)
\blt Arrays and array sections may be assigned to
\blt Array sections:
\bsp \blt Range: a(2:10)
\bsp \blt Range with stride: b(1:10:2) ! elements: 1, 3, 5, 7, 9
\bsp \blt Vector indexing: a=(/1,2,4/); b(a) = (/9,8,7/)
\eSecBox

\sSecBox{Some Array Functions}
\blt \srb{74pt}{ALL(MASK\opt{, dim})            } .TRUE. iff all elements of MASK are .TRUE.
\blt \srb{74pt}{ANY(MASK\opt{, dim})            } .TRUE. iff any elements of MASK are .TRUE.
\blt \srb{74pt}{COUNT(MASK\opt{, dim})          } Number of elements in MASK that are .TRUE.
\blt \srb{74pt}{MAXVAL(ARRAY\opt{, dim, mask})  } Largest value in ARRAY
\blt \srb{74pt}{MINVAL(ARRAY\opt{, dim, mask})  } Smallest value in ARRAY
\blt \srb{74pt}{PRODUCT(ARRAY\opt{, dim, mask}) } Product of elements in ARRAY
\blt \srb{74pt}{SUM (ARRAY\opt{, dim, mask})    } Sum of elements in ARRAY

\blt \srb{80pt}{MATMUL(matrixA, matrixB)  }\srb{74pt}{Matrix/vector multiplication }
\blt \srb{80pt}{TRANSPOSE(matrix)         }\srb{74pt}{Transpose of matrix          }
\blt \srb{80pt}{CSHIFT(array, shift, dim) }\srb{74pt}{Circular shift of elements   }
\blt \srb{80pt}{EOSHIFT(array, shift, dim)}\srb{74pt}{End-off shift of elements    }
\blt \srb{80pt}{PACK(array, mask, pad)    }\srb{74pt}{Pack values of array         }
\blt \srb{80pt}{MERGE(tsrc, fsrc, mask)   }\srb{74pt}{Use tsrc if mask is true, else fsrc}
\blt \srb{80pt}{MAXLOC(array, mask)       }\srb{74pt}{Location of maximum element  }
\blt \srb{80pt}{MINLOC(array, mask)       }\srb{74pt}{Location of minimum element  }
\eSecBox

\sSecBox{Bit Manipulation Functions}
\blt \srb{75pt}{BIT_SIZE(I)             }\srb{74pt}{Return number of bits in I}
\blt \srb{75pt}{BTEST(I, POS)           }\srb{74pt}{.TRUE. if bit POS is 1}
\blt \srb{75pt}{IBCLR(I, POS)           }\srb{74pt}{Set bit POS to 0}
\blt \srb{75pt}{IBSET(I, POS)           }\srb{74pt}{Set bit POS to 1}
\blt \srb{75pt}{IAND(I, J)              }\srb{74pt}{Bitwise AND}
\blt \srb{75pt}{IEOR(I, J)              }\srb{74pt}{Bitwise XOR}
\blt \srb{75pt}{IOR(I, J)               }\srb{74pt}{Bitwise OR}
\blt \srb{75pt}{NOT(I)                  }\srb{74pt}{Bitwise NOT}
\blt \srb{75pt}{IBITS(I, POS, LEN)      }\srb{74pt}{Extract LEN bits starting at POS}
\blt \srb{75pt}{ISHIFT(I, SHIFT)        }\srb{74pt}{Shift bits (left for SHIFT>0, right for SHIFT<0}
\blt \srb{75pt}{ISHIFTC(I, SHIFT, SIZE) }\srb{74pt}{Circular bit SHIFT bits.  Only do SIZE right most}
\bsp \srb{75pt}{                        }\srb{74pt}{bits if SIZE given.}
\blt \srb{75pt}{TRANSFER(SOR, DST, SIZE)}\srb{74pt}{Transfer SIZE bits of SRC to DST.}

\eSecBox

\sSecBox{String Functions}
\blt \srb{75pt}{ACHAR(I)                  }\srb{74pt}{ASCII character with number I}
\blt \srb{75pt}{IACHAR(C)                 }\srb{74pt}{ASCII number of the character C}
\blt \srb{75pt}{CHAR(I, kind)             }\srb{74pt}{Character with number I}
\blt \srb{75pt}{ICHAR(C)                  }\srb{74pt}{number of character C}
\blt \srb{75pt}{ADJUSTL(STR)              }\srb{74pt}{Adjusts to the left}
\blt \srb{75pt}{ADJUSTR(STR)              }\srb{74pt}{Adjusts to the right}
\blt \srb{75pt}{LEN_TRIM(STR)             }\srb{74pt}{String length ignoreing trailing blanks}
\blt \srb{75pt}{LEN(STR)                  }\srb{74pt}{String length}
\blt \srb{75pt}{LGE(STR_A, STR_B)         }\srb{74pt}{ASCII string .GE.}
\blt \srb{75pt}{LGT(STR-A, STR_B)         }\srb{74pt}{ASCII string .GT.}
\blt \srb{75pt}{LLE(STR_A, STR_B)         }\srb{74pt}{ASCII string .LE.}
\blt \srb{75pt}{LLT(STR_A, STR_B)         }\srb{74pt}{ASCII string .LT.}
\blt \srb{75pt}{INDEX(STR, SUBSTR, BACK)  }\srb{74pt}{Return starting position of SUBSTR in STR.  First}
\bsp \srb{75pt}{                          }\srb{74pt}{one with BACK missing or .FALSE., else last one.}
\blt \srb{75pt}{REPEAT(STR, NCOPIES)      }\srb{74pt}{Concatenate NCOPIES of STR}
\blt \srb{75pt}{SCAN(STR, SET, BACK)      }\srb{74pt}{Returns position of the first of any character }
\bsp \srb{75pt}{                          }\srb{74pt}{in string SET.  If BACK .FALSE. or missing, first}
\bsp \srb{75pt}{                          }\srb{74pt}{one, else right most character.}
\blt \srb{75pt}{TRIM(STRING)              }\srb{74pt}{Return string minus trailing blanks.}
\blt \srb{75pt}{VERIFY(STR, SET, BACK)    }\srb{74pt}{Returns position of the first character in STR}
\bsp \srb{75pt}{                          }\srb{74pt}{not in SET.  If BACK missing or .FALSE. return}
\bsp \srb{75pt}{                          }\srb{74pt}{first, else last.  Return 0 if all chars included}
\eSecBox

\sSecBox{Real Variable Functions}
\blt \srb{75pt}{EXPONENT(X)       }\srb{74pt}{Exponent of the X}
\blt \srb{75pt}{FRACTION(X)       }\srb{74pt}{Fractional part X}
\blt \srb{75pt}{NEAREST(X, S)     }\srb{74pt}{Nearest value in direction of sign of S}
\blt \srb{75pt}{RRSPACING(X)      }\srb{74pt}{Reciprocal of relative spacing of model numbers near X}
\blt \srb{75pt}{SCALE(X, I)       }\srb{74pt}{Multiply X by the base to the power I}
\blt \srb{75pt}{SET_EXPONENT(X, I)}\srb{74pt}{The number fraction=X and exponent=I}
\blt \srb{75pt}{SPACING(X)        }\srb{74pt}{Spacing of model numbers near X}
\eSecBox

\sSecBox{Real Type Query Functions}
\blt \srb{75pt}{DIGITS(X)     }\srb{74pt}{Number of significant digits}
\blt \srb{75pt}{EPSILON(X)    }\srb{74pt}{Least positive number E such that E+1>1}
\blt \srb{75pt}{HUGE(X)       }\srb{74pt}{Largest positive number}
\blt \srb{75pt}{MAXEXPONENT(X)}\srb{74pt}{Largest exponent}
\blt \srb{75pt}{MINEXPONENT   }\srb{74pt}{Smallest exponent}
\blt \srb{75pt}{PRECISION(X)  }\srb{74pt}{Decimal precision}
\blt \srb{75pt}{RADIX(X)      }\srb{74pt}{Base in the model}
\blt \srb{75pt}{RANGE(X)      }\srb{74pt}{Decimal exponent}
\blt \srb{75pt}{TINY(X)       }\srb{74pt}{Smallest positive number}
\eSecBox

\end{document}

