MODFLOW 6  version 6.5.0.dev2
MODFLOW 6 Code Documentation
version.f90
Go to the documentation of this file.
1 !> @brief This module contains version information
2 !!
3 !! This module contains subroutines for accessing version information
4 !! and writing header information to the program listing files.
5 !!
6 !<
8  ! -- module imports
9  use kindmodule
12  use simvariablesmodule, only: istdout
16  implicit none
17  public
18  ! -- modflow 6 version
19  integer(I4B), parameter :: idevelopmode = 1
20  character(len=*), parameter :: versionnumber = '6.5.0.dev2'
21  character(len=*), parameter :: versiontag = ' (preliminary) 05/14/2024'
22  character(len=40), parameter :: version = versionnumber//versiontag
23  character(len=2), parameter :: mfvnam = ' 6'
24  character(len=*), parameter :: mftitle = &
25  &'U.S. GEOLOGICAL SURVEY MODULAR HYDROLOGIC MODEL'
26  character(len=*), parameter :: fmtlicense = &
27  "(/,&
28  &'As a work of the United States Government, this USGS product is ',/,&
29  &'in the public domain within the United States. You can copy, ',/,&
30  &'modify, distribute, and perform the work, even for commercial ',/,&
31  &'purposes, all without asking permission. Additionally, USGS ',/,&
32  &'waives copyright and related rights in the work worldwide ',/,&
33  &'through CC0 1.0 Universal Public Domain Dedication ',/,&
34  &'(https://creativecommons.org/publicdomain/zero/1.0/).',//,&
35  &'The following GNU Lesser General Public License (LGPL) libraries',/,&
36  &'are used in this USGS product:',//,"// &
37  "' SPARSKIT version 2.0',/,&
38  &' ilut, luson, and qsplit ',/,&
39  &' (https://www-users.cse.umn.edu/~saad/software/SPARSKIT/)',//,&
40  &' RCM - Reverse Cuthill McKee Ordering',/,&
41  &' (https://people.math.sc.edu/Burkardt/f_src/rcm/rcm.html)',//,&
42  &' BLAS - Basic Linear Algebra Subprograms Level 1',/,&
43  &' (https://people.math.sc.edu/Burkardt/f_src/blas1_d/',&
44  &'blas1_d.html)',//,"// &
45  "' SPARSEKIT - Sparse Matrix Utility Package',/,&
46  &' amux, dperm, dvperm, rperm, and cperm',/,&
47  &' (https://people.sc.fsu.edu/~jburkardt/f77_src/sparsekit/',&
48  &'sparsekit.html)',//,&
49  &'The following BSD-3 License libraries are used in this USGS product:',//,&
50  &' Modern Fortran DAG Library',/,&
51  &' Copyright (c) 2018, Jacob Williams',/,&
52  &' All rights reserved.',/,&
53  &' (https://github.com/jacobwilliams/daglib)',/&
54  &)"
55  character(len=*), parameter :: petsclicense = &
56  "(&
57  &'The following 2-clause BSD License library is used in this',/,&
58  &'USGS product:',//,&
59  &' PETSc, the Portable, Extensible Toolkit for Scientific',/,&
60  &' Computation Library',/,&
61  &' Copyright (c) 1991-2021, UChicago Argonne, LLC',/,&
62  &' and the PETSc Development Team All rights reserved.',/,&
63  &' (https://petsc.org/release/)',/&
64  &)"
65  character(len=*), parameter :: netcdflicense = &
66  "(&
67  &'The following library is used in this USGS product:',//,&
68  &' NetCDF, network Common Data Form software library',/,&
69  &' Copyright (c) 1993-2014 University Corporation for Atmospheric',/,&
70  &' Research/Unidata. Redistribution and use in source and binary',/,&
71  &' forms, with or without modification, are permitted provided that',/,&
72  &' the conditions in the NetCDF copyright are met',/,&
73  &' (https://www.unidata.ucar.edu/software/netcdf/copyright.html)',/&
74  &)"
75  ! -- disclaimer must be appropriate for version (release or release candidate)
76  character(len=*), parameter :: fmtdisclaimer = &
77  "(/,&
78  &'This software is preliminary or provisional and is subject to ',/,&
79  &'revision. It is being provided to meet the need for timely best ',/,&
80  &'science. The software has not received final approval by the U.S. ',/,&
81  &'Geological Survey (USGS). No warranty, expressed or implied, is made ',/,&
82  &'by the USGS or the U.S. Government as to the functionality of the ',/,&
83  &'software and related material nor shall the fact of release ',/,&
84  &'constitute any such warranty. The software is provided on the ',/,&
85  &'condition that neither the USGS nor the U.S. Government shall be held ',/,&
86  &'liable for any damages resulting from the authorized or unauthorized ',/,&
87  &'use of the software.',/)"
88 
89 contains
90 
91  !> @ brief Write program header
92  !!
93  !! Write header for program to the program listing file.
94  !!
95  !<
96  subroutine write_listfile_header(iout, cmodel_type, write_sys_command, &
97  write_kind_info)
98  ! -- dummy variables
99  integer(I4B), intent(in) :: iout !< program listing file
100  character(len=*), intent(in), optional :: cmodel_type !< optional model type string
101  logical(LGP), intent(in), optional :: write_sys_command !< boolean indicating if the system command should be written
102  logical(LGP), intent(in), optional :: write_kind_info !< boolean indicating in program data types should be written
103  ! -- local variables
104  integer(I4B), parameter :: iheader_width = 80
105  character(len=22) :: cheader
106  character(len=LENBIGLINE) :: syscmd
107  character(len=LENBIGLINE) :: compiler
108  character(len=LENBIGLINE) :: compiler_options
109  logical(LGP) :: wki
110  logical(LGP) :: wsc
111  !
112  ! -- set pro string
113  if (is_extended()) then
114  write (cheader, '(3a)') 'MODFLOW', mfvnam, ' EXTENDED'
115  else
116  write (cheader, '(2a)') 'MODFLOW', mfvnam
117  end if
118  !
119  ! -- Write title to iout
120  call write_message_centered(text=cheader, linelen=iheader_width, &
121  iunit=iout)
122  call write_message_centered(text=mftitle, linelen=iheader_width, &
123  iunit=iout)
124  !
125  ! -- Write model type to list file
126  if (present(cmodel_type)) then
127  call write_message_centered(text=cmodel_type, linelen=iheader_width, &
128  iunit=iout)
129  end if
130  !
131  ! -- Write version
132  call write_message_centered(text='VERSION '//version, &
133  linelen=iheader_width, iunit=iout)
134  !
135  ! -- Write if develop mode
136  if (idevelopmode == 1) then
137  call write_message_centered(text='***DEVELOP MODE***', &
138  linelen=iheader_width, iunit=iout)
139  end if
140  !
141  ! -- Write compiler version
142  call get_compiler(compiler)
143  call write_message_centered(text=' ', linelen=iheader_width, &
144  iunit=iout)
145  call write_message_centered(text=trim(adjustl(compiler)), &
146  linelen=iheader_width, iunit=iout)
147  !
148  ! -- Write disclaimer
149  write (iout, fmtdisclaimer)
150  !
151  ! -- Write license information
152  if (iout /= istdout) then
153  call write_license(iout)
154  end if
155  !
156  ! -- write compiler options
157  if (iout /= istdout) then
158  call get_compile_options(compiler_options)
159  call write_message_counter(text=compiler_options, iunit=iout)
160  end if
161  !
162  ! -- Write the system command used to initiate simulation
163  wsc = .true.
164  if (present(write_sys_command)) wsc = write_sys_command
165  if (wsc) then
166  call get_command(syscmd)
167  write (iout, '(/,a,/,a)') &
168  'System command used to initiate simulation:', trim(syscmd)
169  end if
170  !
171  ! -- Write precision of real variables
172  wki = .true.
173  if (present(write_kind_info)) wki = write_kind_info
174  if (wki) then
175  write (iout, '(/,a)') 'MODFLOW was compiled using uniform precision.'
176  call write_kindinfo(iout)
177  end if
178  write (iout, *)
179 
180  end subroutine write_listfile_header
181 
182  !> @ brief Write program license
183  !!
184  !! Write license for program to the program listing file.
185  !!
186  !<
187  subroutine write_license(iout)
188  ! -- dummy variables
189  integer(I4B), intent(in), optional :: iout !< program listing file
190  !
191  ! - write standard license
192  if (present(iout)) then
193  write (iout, fmtlicense)
194  else
195  call write_message('', fmt=fmtlicense)
196  end if
197  !
198  ! -- write NetCDF license
199  if (using_netcdf()) then
200  if (present(iout)) then
201  write (iout, netcdflicense)
202  else
203  call write_message('', fmt=netcdflicense)
204  end if
205  end if
206  !
207  ! -- write PETSc license
208  if (using_petsc()) then
209  if (present(iout)) then
210  write (iout, petsclicense)
211  else
212  call write_message('', fmt=petsclicense)
213  end if
214  end if
215 
216  end subroutine write_license
217 
218 end module versionmodule
219 
subroutine, public get_compiler(txt)
@ brief Get compiler information
subroutine, public get_compile_options(txt)
@ brief Get compilation options
This module contains simulation constants.
Definition: Constants.f90:9
integer(i4b), parameter lenhugeline
maximum length of a huge line
Definition: Constants.f90:16
integer(i4b), parameter lenbigline
maximum length of a big line
Definition: Constants.f90:15
real(dp), parameter dzero
real constant zero
Definition: Constants.f90:64
logical(lgp) function, public is_extended()
Determine if this is the extended version.
Definition: defmacro.F90:59
logical(lgp) function, public using_petsc()
Determine if using petsc.
Definition: defmacro.F90:91
logical(lgp) function, public using_netcdf()
Determine if using netcdf.
Definition: defmacro.F90:114
This module defines variable data types.
Definition: kind.f90:8
subroutine, public write_kindinfo(iout)
Write variable data types.
Definition: kind.f90:27
Store and issue logging messages to output units.
Definition: Message.f90:2
subroutine, public write_message_centered(text, linelen, iunit)
Write horizontally centered text, left-padding as needed.
Definition: Message.f90:426
subroutine, public write_message(text, iunit, fmt, skipbefore, skipafter, advance)
Write a message to an output unit.
Definition: Message.f90:210
subroutine, public write_message_counter(text, iunit, icount, iwidth, skipbefore, skipafter)
Write a message with configurable indentation and numbering.
Definition: Message.f90:286
This module contains simulation variables.
Definition: SimVariables.f90:9
integer(i4b) istdout
unit number for stdout
This module contains version information.
Definition: version.f90:7
character(len= *), parameter petsclicense
Definition: version.f90:55
subroutine write_license(iout)
@ brief Write program license
Definition: version.f90:188
subroutine write_listfile_header(iout, cmodel_type, write_sys_command, write_kind_info)
@ brief Write program header
Definition: version.f90:98
character(len= *), parameter fmtlicense
Definition: version.f90:26
character(len= *), parameter versiontag
Definition: version.f90:21
character(len= *), parameter fmtdisclaimer
Definition: version.f90:76
character(len= *), parameter mftitle
Definition: version.f90:24
character(len=40), parameter version
Definition: version.f90:22
integer(i4b), parameter idevelopmode
Definition: version.f90:19
character(len= *), parameter netcdflicense
Definition: version.f90:65
character(len= *), parameter versionnumber
Definition: version.f90:20
character(len=2), parameter mfvnam
Definition: version.f90:23