anchor.diff:  
       end subroutine end_logging
   
  -    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
  +! --- Log-specific initialisation functions ---
   
       subroutine init_logging_calc(logging_in, logging_info)
   
  
positive.code:         call write_logging_death_preamble(logging_info)
  
      end subroutine init_logging_death
  
      subroutine write_logging_calc_header(logging_info)
          ! Write header and preamble for calculation log file.
  
negative.code: 
      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
  
  