title: How to initialize two-dimensional arrays in Fortran
body: <p>In C you can easily initialize an array using the curly braces syntax, if I remember correctly:</p>
  
  <pre><code>int* a = new int[] { 1, 2, 3, 4 };
  </code></pre>
  
  <p>How can you do the same in Fortran for two-dimensional arrays when you wish to initialize a matrix with specific test values for mathematical purposes? (Without having to doubly index every element on separate statements)</p>
  
  <p>The array is either defined by</p>
  
  <pre><code>real, dimension(3, 3) :: a
  </code></pre>
  
  <p>or</p>
  
  <pre><code>real, dimension(:), allocatable :: a
  </code></pre>