18 USE iso_fortran_env,
ONLY: compiler_options
36#if defined(__COMPILE_REVISION)
37 CHARACTER(LEN=*),
PARAMETER :: compile_revision = __compile_revision
39 CHARACTER(LEN=*),
PARAMETER :: compile_revision =
"unknown"
43 CHARACTER(LEN=*),
PARAMETER ::
cp2k_version =
"CP2K version 2025.2 (Development Version)"
45 CHARACTER(LEN=*),
PARAMETER ::
cp2k_home =
"https://www.cp2k.org/"
48#if defined(__COMPILE_ARCH)
49 CHARACTER(LEN=*),
PARAMETER ::
compile_arch = __compile_arch
51 CHARACTER(LEN=*),
PARAMETER ::
compile_arch =
"unknown: -D__COMPILE_ARCH=?"
54#if defined(__COMPILE_DATE)
55 CHARACTER(LEN=*),
PARAMETER ::
compile_date = __compile_date
57 CHARACTER(LEN=*),
PARAMETER ::
compile_date =
"unknown: -D__COMPILE_DATE=?"
60#if defined(__COMPILE_HOST)
61 CHARACTER(LEN=*),
PARAMETER ::
compile_host = __compile_host
63 CHARACTER(LEN=*),
PARAMETER ::
compile_host =
"unknown: -D__COMPILE_HOST=?"
67 CHARACTER(LEN=default_path_length),
PUBLIC ::
r_cwd
72 CHARACTER(len=*),
PARAMETER,
PRIVATE :: modulen =
'cp2k_info'
81 CHARACTER(len=10*default_string_length) :: flags
83 CHARACTER(len=default_string_length) :: tmp_str
89 flags = trim(flags)//trim(tmp_str)
91 IF (index(compiler_options(),
"-fsanitize=leak") > 0)
THEN
92 flags = trim(flags)//
" lsan"
98#if defined(__INTEL_LLVM_COMPILER)
99 flags = trim(flags)//
" ifx"
102 flags = trim(flags)//
" libint"
105 flags = trim(flags)//
" fftw3"
108 flags = trim(flags)//
" libxc"
111 flags = trim(flags)//
" pexsi"
114 flags = trim(flags)//
" elpa"
116#if defined(__parallel)
117#if defined(__SCALAPACK_NO_WA)
118 flags = trim(flags)//
" parallel scalapack"
120 flags = trim(flags)//
" parallel scalapack"
123#if defined(__MPI_F08)
124 flags = trim(flags)//
" mpi_f08"
127 flags = trim(flags)//
" cosma"
130 flags = trim(flags)//
" ace"
133 flags = trim(flags)//
" deepmd"
135#if defined(__PW_FPGA)
136 flags = trim(flags)//
" pw_fpga"
138#if defined(__PW_FPGA_SP)
139 flags = trim(flags)//
" pw_fpga_sp"
141#if defined(__LIBXSMM)
142 flags = trim(flags)//
" xsmm"
144#if defined(__CRAY_PM_ACCEL_ENERGY)
145 flags = trim(flags)//
" cray_pm_accel_energy"
147#if defined(__CRAY_PM_ENERGY)
148 flags = trim(flags)//
" cray_pm_energy"
150#if defined(__CRAY_PM_FAKE_ENERGY)
151 flags = trim(flags)//
" cray_pm_fake_energy"
153#if defined(__DBCSR_ACC)
154 flags = trim(flags)//
" dbcsr_acc"
156#if defined(__MAX_CONTR)
158 flags = trim(flags)//
" max_contr="//trim(tmp_str)
160#if defined(__NO_SOCKETS)
161 flags = trim(flags)//
" no_sockets"
163#if defined(__NO_STATM_ACCESS)
164 flags = trim(flags)//
" no_statm_access"
166#if defined(__PW_CUDA_NO_HOSTALLOC)
167 flags = trim(flags)//
" pw_cuda_no_hostalloc"
169#if defined(__STATM_RESIDENT)
170 flags = trim(flags)//
" statm_resident"
172#if defined(__STATM_TOTAL)
173 flags = trim(flags)//
" statm_total"
175#if defined(__PLUMED2)
176 flags = trim(flags)//
" plumed2"
178#if defined(__HAS_IEEE_EXCEPTIONS)
179 flags = trim(flags)//
" has_ieee_exceptions"
181#if defined(__NO_ABORT)
182 flags = trim(flags)//
" no_abort"
185 flags = trim(flags)//
" spglib"
187#if defined(__ACCELERATE)
188 flags = trim(flags)//
" accelerate"
191 flags = trim(flags)//
" mkl"
194 flags = trim(flags)//
" libdftd4"
197 flags = trim(flags)//
" mctc-lib"
198 flags = trim(flags)//
" tblite"
201 flags = trim(flags)//
" sirius"
203#if defined(__SIRIUS_NLCG)
204 flags = trim(flags)//
" sirius_nlcg"
206#if defined(__SIRIUS_DFTD4)
207 flags = trim(flags)//
" sirius_dftd4"
209#if defined(__SIRIUS_VCSQNM)
210 flags = trim(flags)//
" sirius_vcsqnm"
212#if defined(__CHECK_DIAG)
213 flags = trim(flags)//
" check_diag"
215#if defined(__LIBVORI)
216 flags = trim(flags)//
" libvori"
217 flags = trim(flags)//
" libbqb"
219#if defined(__LIBMAXWELL)
220 flags = trim(flags)//
" libmaxwell"
222#if defined(__LIBTORCH)
223 flags = trim(flags)//
" libtorch"
225#if defined(__OFFLOAD_CUDA)
226 flags = trim(flags)//
" offload_cuda"
228#if defined(__OFFLOAD_HIP)
229 flags = trim(flags)//
" offload_hip"
231#if defined(__OFFLOAD_OPENCL)
232 flags = trim(flags)//
" offload_opencl"
234#if defined(__NO_OFFLOAD_GRID)
235 flags = trim(flags)//
" no_offload_grid"
237#if defined(__NO_OFFLOAD_DBM)
238 flags = trim(flags)//
" no_offload_dbm"
240#if defined(__NO_OFFLOAD_PW)
241 flags = trim(flags)//
" no_offload_pw"
243#if defined(__OFFLOAD_PROFILING)
244 flags = trim(flags)//
" offload_profiling"
246#if defined(__SPLA) && defined(__OFFLOAD_GEMM)
247 flags = trim(flags)//
" spla_gemm_offloading"
249#if defined(__CUSOLVERMP)
250 flags = trim(flags)//
" cusolvermp"
253 flags = trim(flags)//
" dlaf"
255#if defined(__LIBVDWXC)
256 flags = trim(flags)//
" libvdwxc"
259 flags = trim(flags)//
" hdf5"
262 flags = trim(flags)//
" trexio"
264#if defined(__OFFLOAD_UNIFIED_MEMORY)
265 flags = trim(flags)//
" offload_unified_memory"
267#if defined(__SMEAGOL)
268 flags = trim(flags)//
" libsmeagol"
271 flags = trim(flags)//
" greenx"
284 WRITE (unit=iunit, fmt=
"(T2,A)") &
285 "******************************************************************************", &
287 "* CP2K: A general program to perform molecular dynamics simulations *", &
288 "* Copyright (C) 2000-2025 CP2K developer group <https://www.cp2k.org/> *", &
290 "* This program is free software: you can redistribute it and/or modify *", &
291 "* it under the terms of the GNU General Public License as published by *", &
292 "* the Free Software Foundation, either version 2 of the License, or *", &
293 "* (at your option) any later version. *", &
295 "* This program is distributed in the hope that it will be useful, *", &
296 "* but WITHOUT ANY WARRANTY; without even the implied warranty of *", &
297 "* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *", &
298 "* GNU General Public License for more details. *", &
300 "* You should have received a copy of the GNU General Public License *", &
301 "* along with this program. If not, see <https://www.gnu.org/licenses/>. *", &
303 "******************************************************************************"
334 INTEGER,
INTENT(IN) :: iunit
336 CHARACTER(LEN=256) :: cwd
337 CHARACTER(LEN=timestamp_length) :: timestamp
342 WRITE (unit=iunit, fmt=
"(T2,A)")
"# Version information for this restart file "
343 WRITE (unit=iunit, fmt=
"(T2,A)")
"# current date "//timestamp
344 WRITE (unit=iunit, fmt=
"(T2,A)")
"# current working dir "//trim(cwd)
346 WRITE (unit=iunit, fmt=
"(T2,A,T31,A50)") &
347 "# Program compiled at", &
349 WRITE (unit=iunit, fmt=
"(T2,A,T31,A50)") &
350 "# Program compiled on", &
352 WRITE (unit=iunit, fmt=
"(T2,A,T31,A50)") &
353 "# Program compiled for", &
355 WRITE (unit=iunit, fmt=
"(T2,A,T31,A50)") &
356 "# Source code revision number", &
357 adjustr(compile_revision)
some minimal info about CP2K, including its version and license
character(len=default_string_length), public r_host_name
character(len= *), parameter, public cp2k_home
character(len= *), parameter, public compile_host
character(len= *), parameter, public compile_arch
subroutine, public print_cp2k_license(iunit)
...
subroutine, public write_restart_header(iunit)
Writes the header for the restart file.
character(len= *), parameter, public compile_revision
character(len= *), parameter, public compile_date
character(len=timestamp_length), public r_timestamp
character(len= *), parameter, public cp2k_year
character(len=10 *default_string_length) function, public cp2k_flags()
list all compile time options that influence the capabilities of cp2k. All new flags should be added ...
character(len= *), parameter, public cp2k_version
character(len=default_path_length), public r_cwd
subroutine, public get_runtime_info()
...
character(len=default_string_length), public r_user_name
Defines the basic variable types.
integer, parameter, public default_string_length
integer, parameter, public default_path_length
Machine interface based on Fortran 2003 and POSIX.
subroutine, public m_getpid(pid)
...
integer, parameter, public timestamp_length
subroutine, public m_timestamp(timestamp)
Returns a human readable timestamp.
subroutine, public m_getcwd(curdir)
...
subroutine, public m_getlog(user)
...
subroutine, public m_hostnm(hname)
...
Utilities for string manipulations.
subroutine, public integer_to_string(inumber, string)
Converts an integer number to a string. The WRITE statement will return an error message,...