title: Fortran execute_command_line runtime error, depends on memory consumption
body: <p>I am getting runtime errors when trying to create a directory using the execute_command_line intrinsic in Fortran. The error occurs both with Ifort (18.0.3 20180410) and gfortran (4.8.5).
  Here is a minimal example that fails with whatever compile flags I use:</p>
  
  <pre><code>PROGRAM directory_test
  
      IMPLICIT NONE
  
      INTEGER :: cstat, estat, i, j
      CHARACTER(LEN=100) :: cmsg
  
      REAL, DIMENSION(:,:), ALLOCATABLE :: field
      INTEGER, PARAMETER :: fieldsize = 80000
  
      allocate(field(fieldsize,fieldsize))
      do j=1, fieldsize
          do i=1, fieldsize
              field(i,j) = real(i+j)
          end do
      end do
  
      call execute_command_line('mkdir -p newdir', WAIT=.true., EXITSTAT=estat, CMDSTAT=cstat, CMDMSG=cmsg)
  
      write(*,*) 'estat: ', estat
      write(*,*) 'cstat: ', cstat
      write(*,*) 'cmsg:  ', cmsg
  
  END PROGRAM directory_test
  </code></pre>
  
  <p>Output ifort:<br>
  estat:            0<br>
  cstat:          124<br>
  cmsg:  Invalid command supplied to EXECUTE_COMMAND_LINE  </p>
  
  <p>Output gfortran:<br>
  estat:   -520880432<br>
  cstat:            1<br>
  cmsg:  Termination status of the command-language interpreter cannot be obtained  </p>
  
  <p><strong>Here is the catch:</strong> the program runs just fine as long as the array size is small enough. For me the threshold is about half of the physical memory used (adjust the value of "fieldsize" if you want to try the code). If the array is larger than that, the error occurs. If the array is smaller, the code executes without errors and the directory is created.
  The machines I used to test this all have 2 physical CPUs  and 128GB-256GB of RAM.<br>
  What am I doing wrong?</p>
  
  <p>OS: Linux, Opensuse 42.3<br>
  shell: bash<br>
  file system: Ext4</p>
  
  <p>Edit: the issue is not exclusive to "execute_command_line()". Trying to do the same with "call system()" I get similar behaviour. The new directory is not created in cases where the original method fails with a runtime error.
  Additional tests on smaller/older dual-socket machines down to 48GB of available RAM yield the same results. Some fail earlier, some need almost the entire physical memory occupied by the program to fail. Unfortunately I don't have a single-socket machine to test right now.</p>