environment_report.F90 Source File


Source Code

subroutine environment_report(tCPMD)

!= Print out a summary of the environment:
!=   * When the code was compiled
!=   * The version control system (VCS) repository id of the codebase.
!=   * Whether the codebase contains local changes.
!=   * The working directory.
!=   * The host computer.
!=   * The time the calculation started.
!= The VCS information is added via preproccessing and requires various settings
!= in the makefile.
!= This has been tested with gfortran, g95, ifort, pgf90.
!= Note that hostnm and getcwd are intrinsic functions (at least according to gnu
!= documentation).  There should also exist the intrinsic subroutines, but pgf90
!= and ifort gave segmentation faults when they were used.

!= In:
!=   tCPMD: true if doing a CPMD-based calculation.  CPMD already prints out the
!=          directory and host names, so we avoid printing duplicate information.

#ifdef NAGF95
use f90_unix_dir
use constants, only: int32
use constants, only: stdout
implicit none
logical :: tCPMD
integer :: stat,hostnm
#ifndef NAGF95
integer :: getcwd
integer(kind=int32) :: stat_dum
character(255) :: dirname,host
integer :: date_values(8)
write (stdout,'(/,1X,64("="))')
write (stdout,'(a13,a,a4,a)') 'Compiled on ',__DATE__,'at ',__TIME__
write (stdout,'(a30,/,5X,a)') 'Compiled using configuration:',_CONFIG
write (stdout,'(a29,/,5X,a)') 'VCS BASE repository version:',_VCS_VER
write (stdout,'(a42)') 'Working directory contains local changes.'
#ifdef NAGF95
call getcwd(path=dirname,errno=stat_dum)
if (stat.eq.0.and..not.tCPMD) then
    write (stdout,'(a20)') 'Working directory: '
    write (stdout,'(5X,a)') trim(dirname)
end if
#if defined(NAGF95) || defined(_WIN32_)
!Can't find a hostnm intrinsic equivalent in the nag system modules
if (stat.eq.0.and..not.tCPMD) then
    write (stdout,'(a13,a)') 'Running on: ',trim(host)
end if

call date_and_time(VALUES=date_values)

write (stdout,'(1X,"Started running on",1X,i2.2,"/",i2.2,"/",i4.4,1X,"at",1X,i2.2,2(":",i2.2))') date_values(3:1:-1), date_values(5:7)

write (stdout,'(1X,64("="),/)')

end subroutine environment_report