ReportEntropy_Model Subroutine

public subroutine ReportEntropy_Model(this)

Base method for reporting the entropy of a model to stdout. Only override this procedure if additional reporting is needed. Alternatively, if you think additional reporting would be valuable for all models, open a pull request with modifications to this base method.

Arguments

TypeIntentOptionalAttributesName
class(Model), intent(in) :: this

Contents

Source Code


Source Code

  subroutine ReportEntropy_Model(this)
  !! Base method for reporting the entropy of a model
  !! to stdout. Only override this procedure if additional
  !! reporting is needed. Alternatively, if you think
  !! additional reporting would be valuable for all models,
  !! open a pull request with modifications to this base
  !! method.
    implicit none
    class(Model),intent(in) :: this
    ! Local
    character(len=20) :: modelTime
    character(len=20) :: entropy
    character(len=:),allocatable :: str

    ! Copy the time and entropy to a string
    write(modelTime,"(ES16.7E3)") this%t
    write(entropy,"(ES16.7E3)") this%entropy

    ! Write the output to STDOUT
    open(output_unit,ENCODING='utf-8')
    write(output_unit,'(A," : ")',ADVANCE='no') __FILE__
    str = 'tᵢ ='//trim(modelTime)
    write(output_unit,'(A)',ADVANCE='no') str
    str = '  |  eᵢ ='//trim(entropy)
    write(output_unit,'(A)',ADVANCE='yes') str

  endsubroutine ReportEntropy_Model