MODULE output
    USE definitions
    IMPLICIT NONE
CONTAINS
  SUBROUTINE write_output(alpha, beta, x, obs)
    IMPLICIT NONE


    TYPE(variables_real), INTENT(IN) :: alpha
    TYPE(variables_int), INTENT(IN) :: beta
    
    TYPE(variables_int), INTENT(IN) :: x
    TYPE(variables_int), INTENT(IN) :: obs    

    ! output the parameters which the user wants to output
    ! (the parameters to output and the file name are hard-coded here)
    INTEGER :: i
    LOGICAL, SAVE :: written = .FALSE.
    
    IF(.NOT. written) THEN
       ! HARD-CODED: the parameters to write and their order
       WRITE(15, *) '# x_1_1 x_2_1 x_3_1 ... x_1_2 x_2_2 ...  ... x_300_200 beta_1 beta_2 ... beta_200'
       written = .TRUE.
    END IF
    
    ! HARD-CODED: which parameters to write
    WRITE(15, *) x % two_dim(:, :) % value, beta % one_dim(:) % value
        
  END SUBROUTINE write_output

  SUBROUTINE write_summary(alpha, beta, x, obs)
    IMPLICIT NONE

    TYPE(variables_real), INTENT(IN) :: alpha
    TYPE(variables_int), INTENT(IN) :: beta
    
    TYPE(variables_int), INTENT(IN) :: x
    TYPE(variables_int), INTENT(IN) :: obs    

    ! output the summary wanted
    ! HARD-CODED: the file name of the summary file

  END SUBROUTINE write_summary
END MODULE output