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