anchor.diff:  
       end function get_log_filename
   
  +    subroutine write_iter_to_log(iter, iunit)
  +
  +        ! Writes iteration number to given io unit for logging.
  +
  +        ! In:
  +        !   iter: iteration number.
  +        !   iunit: io unit.
  +
  +        integer :: iter, iunit
  +
  +        write(iunit, '("#",1X,20("="))')
  +        write(iunit, '("#",1X,"Iteration",1X,i10)') iter
  +        write(iunit, '("#",1X,20("="))')
  +
  +    end subroutine write_iter_to_log
  +
  +    subroutine write_date_time_close(iunit, date_values)
  +
  +        ! Write final message to log and close
  +
  +        integer, intent(in) :: iunit, date_values(8)
  +
  +        if (iunit /= huge(1)) then
  +            write (iunit,'(1X,64("="))')
  +            write (iunit,'(1X,a19,1X,i2.2,"/",i2.2,"/",i4.4,1X,a2,1X,i2.2,2(":",i2.2))') &
  +                      "Finished running on", date_values(3:1:-1), "at", date_values(5:7)
  +            write (iunit,'(1X,64("="))')
  +
  +            close(iunit, status='keep')
  +        end if
  +
  +    end subroutine write_date_time_close
  +
  +! --- Json functions for logging types ---
  +
       subroutine logging_in_t_json(js, logging_in, terminal)
  +
  +        ! Serialise a logging_in_t object in JSON format.
  +
  +        ! In/Out:
  +        !   js: json_out_t controlling the output unit and handling JSON internal state.  Unchanged on output.
  +        ! In:
  +        !   logging_in: logging_in_t object containing logging input values (including any defaults set).
  +        !   terminal (optional): if true, this is the last entry in the enclosing JSON object.  Default: false.
   
           use json_out
   
  
positive.code: 
      end subroutine write_logging_death
  
      function get_log_filename(in_name) result(out_name)
  
          ! Helper function to generate filenames to use for a generic log file.
  
negative.code: 
      end subroutine end_logging
  
  ! --- Log-specific initialisation functions ---
  
      subroutine init_logging_calc(logging_in, logging_info)
  
  