18 USE iso_fortran_env,
ONLY: compiler_options
35#if defined(__COMPILE_REVISION)
36 CHARACTER(LEN=*),
PARAMETER :: compile_revision = __compile_revision
38 CHARACTER(LEN=*),
PARAMETER :: compile_revision =
"unknown"
42 CHARACTER(LEN=*),
PARAMETER ::
cp2k_version =
"CP2K version 2025.1 (Development Version)"
44 CHARACTER(LEN=*),
PARAMETER ::
cp2k_home =
"https://www.cp2k.org/"
47#if defined(__COMPILE_ARCH)
48 CHARACTER(LEN=*),
PARAMETER ::
compile_arch = __compile_arch
50 CHARACTER(LEN=*),
PARAMETER ::
compile_arch =
"unknown: -D__COMPILE_ARCH=?"
53#if defined(__COMPILE_DATE)
54 CHARACTER(LEN=*),
PARAMETER ::
compile_date = __compile_date
56 CHARACTER(LEN=*),
PARAMETER ::
compile_date =
"unknown: -D__COMPILE_DATE=?"
59#if defined(__COMPILE_HOST)
60 CHARACTER(LEN=*),
PARAMETER ::
compile_host = __compile_host
62 CHARACTER(LEN=*),
PARAMETER ::
compile_host =
"unknown: -D__COMPILE_HOST=?"
67 CHARACTER(LEN=default_path_length),
PUBLIC ::
r_cwd
71 CHARACTER(len=*),
PARAMETER,
PRIVATE :: modulen =
'cp2k_info'
80 CHARACTER(len=10*default_string_length) :: flags
82 CHARACTER(len=default_string_length) :: tmp_str
88 flags = trim(flags)//trim(tmp_str)
90 IF (index(compiler_options(),
"-fsanitize=leak") > 0)
THEN
91 flags = trim(flags)//
" lsan"
96 flags = trim(flags)//
" libint"
99 flags = trim(flags)//
" fftw3"
101#if defined(__FFTW3_MKL)
102 flags = trim(flags)//
" fftw3_mkl"
105 flags = trim(flags)//
" libxc"
107#if defined(__LIBGRPP)
108 flags = trim(flags)//
" libgrpp"
110#if defined(__LIBPEXSI)
111 flags = trim(flags)//
" pexsi"
114 flags = trim(flags)//
" elpa"
116#if defined(__ELPA_NVIDIA_GPU)
117 flags = trim(flags)//
" elpa_nvidia_gpu"
119#if defined(__ELPA_AMD_GPU)
120 flags = trim(flags)//
" elpa_amd_gpu"
122#if defined(__ELPA_INTEL_GPU)
123 flags = trim(flags)//
" elpa_intel_gpu"
125#if defined(__parallel)
126 flags = trim(flags)//
" parallel scalapack"
128#if defined(__MPI_F08)
129 flags = trim(flags)//
" mpi_f08"
132 flags = trim(flags)//
" cosma"
136 flags = trim(flags)//
" quip"
139#if defined(__HAS_PATCHED_CUFFT_70)
140 flags = trim(flags)//
" patched_cufft_70"
144 flags = trim(flags)//
" deepmd"
147#if defined(__PW_FPGA)
148 flags = trim(flags)//
" pw_fpga"
151#if defined(__PW_FPGA_SP)
152 flags = trim(flags)//
" pw_fpga_sp"
155#if defined(__LIBXSMM)
156 flags = trim(flags)//
" xsmm"
159#if defined(__CRAY_PM_ACCEL_ENERGY)
160 flags = trim(flags)//
" cray_pm_accel_energy"
162#if defined(__CRAY_PM_ENERGY)
163 flags = trim(flags)//
" cray_pm_energy"
165#if defined(__CRAY_PM_FAKE_ENERGY)
166 flags = trim(flags)//
" cray_pm_fake_energy"
168#if defined(__DBCSR_ACC)
169 flags = trim(flags)//
" dbcsr_acc"
171#if defined(__MAX_CONTR)
173 flags = trim(flags)//
" max_contr="//trim(tmp_str)
175#if defined(__NO_SOCKETS)
176 flags = trim(flags)//
" no_sockets"
178#if defined(__NO_MPI_THREAD_SUPPORT_CHECK)
179 flags = trim(flags)//
" no_mpi_thread_support_check"
181#if defined(__NO_STATM_ACCESS)
182 flags = trim(flags)//
" no_statm_access"
185 flags = trim(flags)//
" mingw"
187#if defined(__PW_CUDA_NO_HOSTALLOC)
188 flags = trim(flags)//
" pw_cuda_no_hostalloc"
190#if defined(__STATM_RESIDENT)
191 flags = trim(flags)//
" statm_resident"
193#if defined(__STATM_TOTAL)
194 flags = trim(flags)//
" statm_total"
196#if defined(__PLUMED2)
197 flags = trim(flags)//
" plumed2"
199#if defined(__HAS_IEEE_EXCEPTIONS)
200 flags = trim(flags)//
" has_ieee_exceptions"
202#if defined(__NO_ABORT)
203 flags = trim(flags)//
" no_abort"
206 flags = trim(flags)//
" spglib"
208#if defined(__ACCELERATE)
209 flags = trim(flags)//
" accelerate"
212 flags = trim(flags)//
" mkl"
215 flags = trim(flags)//
" libdftd4"
218 flags = trim(flags)//
" sirius"
220#if defined(__CHECK_DIAG)
221 flags = trim(flags)//
" check_diag"
223#if defined(__LIBVORI)
224 flags = trim(flags)//
" libvori"
225 flags = trim(flags)//
" libbqb"
227#if defined(__LIBMAXWELL)
228 flags = trim(flags)//
" libmaxwell"
230#if defined(__LIBTORCH)
231 flags = trim(flags)//
" libtorch"
233#if defined(__OFFLOAD_CUDA)
234 flags = trim(flags)//
" offload_cuda"
236#if defined(__OFFLOAD_HIP)
237 flags = trim(flags)//
" offload_hip"
239#if defined(__OFFLOAD_OPENCL)
240 flags = trim(flags)//
" offload_opencl"
242#if defined(__NO_OFFLOAD_GRID)
243 flags = trim(flags)//
" no_offload_grid"
245#if defined(__NO_OFFLOAD_DBM)
246 flags = trim(flags)//
" no_offload_dbm"
248#if defined(__NO_OFFLOAD_PW)
249 flags = trim(flags)//
" no_offload_pw"
251#if defined(__OFFLOAD_PROFILING)
252 flags = trim(flags)//
" offload_profiling"
255#if defined(__SPLA) && defined(__OFFLOAD_GEMM)
256 flags = trim(flags)//
" spla_gemm_offloading"
259#if defined(__CUSOLVERMP)
260 flags = trim(flags)//
" cusolvermp"
264 flags = trim(flags)//
" dlaf"
267#if defined(__LIBVDWXC)
268 flags = trim(flags)//
" libvdwxc"
272 flags = trim(flags)//
" hdf5"
276 flags = trim(flags)//
" trexio"
279#if defined(__OFFLOAD_UNIFIED_MEMORY)
280 flags = trim(flags)//
" offload_unified_memory"
283#if defined(__SMEAGOL)
284 flags = trim(flags)//
" libsmeagol"
288 flags = trim(flags)//
" greenx"
301 WRITE (unit=iunit, fmt=
"(T2,A)") &
302 "******************************************************************************", &
304 "* CP2K: A general program to perform molecular dynamics simulations *", &
305 "* Copyright (C) 2000-2025 CP2K developer group <https://www.cp2k.org/> *", &
307 "* This program is free software: you can redistribute it and/or modify *", &
308 "* it under the terms of the GNU General Public License as published by *", &
309 "* the Free Software Foundation, either version 2 of the License, or *", &
310 "* (at your option) any later version. *", &
312 "* This program is distributed in the hope that it will be useful, *", &
313 "* but WITHOUT ANY WARRANTY; without even the implied warranty of *", &
314 "* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *", &
315 "* GNU General Public License for more details. *", &
317 "* You should have received a copy of the GNU General Public License *", &
318 "* along with this program. If not, see <https://www.gnu.org/licenses/>. *", &
320 "******************************************************************************"
351 INTEGER,
INTENT(IN) :: iunit
353 CHARACTER(LEN=256) :: cwd, datx
358 WRITE (unit=iunit, fmt=
"(T2,A)")
"# Version information for this restart file "
359 WRITE (unit=iunit, fmt=
"(T2,A)")
"# current date "//trim(datx)
360 WRITE (unit=iunit, fmt=
"(T2,A)")
"# current working dir "//trim(cwd)
362 WRITE (unit=iunit, fmt=
"(T2,A,T31,A50)") &
363 "# Program compiled at", &
365 WRITE (unit=iunit, fmt=
"(T2,A,T31,A50)") &
366 "# Program compiled on", &
368 WRITE (unit=iunit, fmt=
"(T2,A,T31,A50)") &
369 "# Program compiled for", &
371 WRITE (unit=iunit, fmt=
"(T2,A,T31,A50)") &
372 "# Source code revision number", &
373 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= *), 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
character(len=26), public r_datx
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)
...
subroutine, public m_datum(cal_date)
returns a datum in human readable format using a standard Fortran routine
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,...