MOM6
mom_file_parser::get_param Interface Reference

Detailed Description

An overloaded interface to read and log the values of various types of parameters.

Definition at line 102 of file MOM_file_parser.F90.

Private functions

subroutine get_param_int (CS, modulename, varname, value, desc, units, default, fail_if_missing, do_not_read, do_not_log, static_value, layoutParam, debuggingParam)
 This subroutine reads the value of an integer model parameter from a parameter file and logs it in documentation files. More...
 
subroutine get_param_real (CS, modulename, varname, value, desc, units, default, fail_if_missing, do_not_read, do_not_log, static_value, debuggingParam, scale, unscaled)
 This subroutine reads the value of a real model parameter from a parameter file and logs it in documentation files. More...
 
subroutine get_param_logical (CS, modulename, varname, value, desc, units, default, fail_if_missing, do_not_read, do_not_log, static_value, layoutParam, debuggingParam)
 This subroutine reads the value of a logical model parameter from a parameter file and logs it in documentation files. More...
 
subroutine get_param_char (CS, modulename, varname, value, desc, units, default, fail_if_missing, do_not_read, do_not_log, static_value, layoutParam, debuggingParam)
 This subroutine reads the value of a character string model parameter from a parameter file and logs it in documentation files. More...
 
subroutine get_param_char_array (CS, modulename, varname, value, desc, units, default, fail_if_missing, do_not_read, do_not_log, static_value)
 This subroutine reads the values of an array of character string model parameters from a parameter file and logs them in documentation files. More...
 
subroutine get_param_time (CS, modulename, varname, value, desc, units, default, fail_if_missing, do_not_read, do_not_log, timeunit, static_value, layoutParam, debuggingParam, log_as_date)
 This subroutine reads the value of a time-type model parameter from a parameter file and logs it in documentation files. More...
 
subroutine get_param_int_array (CS, modulename, varname, value, desc, units, default, fail_if_missing, do_not_read, do_not_log, static_value, layoutParam, debuggingParam)
 This subroutine reads the values of an array of integer model parameters from a parameter file and logs them in documentation files. More...
 
subroutine get_param_real_array (CS, modulename, varname, value, desc, units, default, fail_if_missing, do_not_read, do_not_log, debuggingParam, static_value, scale, unscaled)
 This subroutine reads the values of an array of real model parameters from a parameter file and logs them in documentation files. More...
 

Detailed Description

An overloaded interface to read and log the values of various types of parameters.

Definition at line 102 of file MOM_file_parser.F90.

Functions and subroutines

◆ get_param_char()

subroutine mom_file_parser::get_param::get_param_char ( type(param_file_type), intent(in)  CS,
character(len=*), intent(in)  modulename,
character(len=*), intent(in)  varname,
character(len=*), intent(inout)  value,
character(len=*), intent(in), optional  desc,
character(len=*), intent(in), optional  units,
character(len=*), intent(in), optional  default,
logical, intent(in), optional  fail_if_missing,
logical, intent(in), optional  do_not_read,
logical, intent(in), optional  do_not_log,
character(len=*), intent(in), optional  static_value,
logical, intent(in), optional  layoutParam,
logical, intent(in), optional  debuggingParam 
)
private

This subroutine reads the value of a character string model parameter from a parameter file and logs it in documentation files.

Parameters
[in]csThe control structure for the file_parser module, it is also a structure to parse for run-time parameters
[in]modulenameThe name of the calling module
[in]varnameThe case-sensitive name of the parameter to read
[in,out]valueThe value of the parameter that may be read from the parameter file and logged
[in]descA description of this variable; if not present, this parameter is not written to a doc file
[in]unitsThe units of this parameter
[in]defaultThe default value of the parameter
[in]static_valueIf this parameter is static, it takes this value, which can be compared for consistency with what is in the parameter file.
[in]fail_if_missingIf present and true, a fatal error occurs if this variable is not found in the parameter file
[in]do_not_readIf present and true, do not read a value for this parameter, although it might be logged.
[in]do_not_logIf present and true, do not log this parameter to the documentation files
[in]layoutparamIf present and true, this parameter is logged in the layout parameter file
[in]debuggingparamIf present and true, this parameter is logged in the debugging parameter file

Definition at line 1827 of file MOM_file_parser.F90.

1827  type(param_file_type), intent(in) :: CS !< The control structure for the file_parser module,
1828  !! it is also a structure to parse for run-time parameters
1829  character(len=*), intent(in) :: modulename !< The name of the calling module
1830  character(len=*), intent(in) :: varname !< The case-sensitive name of the parameter to read
1831  character(len=*), intent(inout) :: value !< The value of the parameter that may be
1832  !! read from the parameter file and logged
1833  character(len=*), optional, intent(in) :: desc !< A description of this variable; if not
1834  !! present, this parameter is not written to a doc file
1835  character(len=*), optional, intent(in) :: units !< The units of this parameter
1836  character(len=*), optional, intent(in) :: default !< The default value of the parameter
1837  character(len=*), optional, intent(in) :: static_value !< If this parameter is static, it takes
1838  !! this value, which can be compared for consistency with
1839  !! what is in the parameter file.
1840  logical, optional, intent(in) :: fail_if_missing !< If present and true, a fatal error occurs
1841  !! if this variable is not found in the parameter file
1842  logical, optional, intent(in) :: do_not_read !< If present and true, do not read a
1843  !! value for this parameter, although it might be logged.
1844  logical, optional, intent(in) :: do_not_log !< If present and true, do not log this
1845  !! parameter to the documentation files
1846  logical, optional, intent(in) :: layoutParam !< If present and true, this parameter is
1847  !! logged in the layout parameter file
1848  logical, optional, intent(in) :: debuggingParam !< If present and true, this parameter is
1849  !! logged in the debugging parameter file
1850 
1851  logical :: do_read, do_log
1852 
1853  do_read = .true. ; if (present(do_not_read)) do_read = .not.do_not_read
1854  do_log = .true. ; if (present(do_not_log)) do_log = .not.do_not_log
1855 
1856  if (do_read) then
1857  if (present(default)) value = default
1858  if (present(static_value)) value = static_value
1859  call read_param_char(cs, varname, value, fail_if_missing)
1860  endif
1861 
1862  if (do_log) then
1863  call log_param_char(cs, modulename, varname, value, desc, units, &
1864  default, layoutparam, debuggingparam)
1865  endif
1866 

◆ get_param_char_array()

subroutine mom_file_parser::get_param::get_param_char_array ( type(param_file_type), intent(in)  CS,
character(len=*), intent(in)  modulename,
character(len=*), intent(in)  varname,
character(len=*), dimension(:), intent(inout)  value,
character(len=*), intent(in), optional  desc,
character(len=*), intent(in), optional  units,
character(len=*), intent(in), optional  default,
logical, intent(in), optional  fail_if_missing,
logical, intent(in), optional  do_not_read,
logical, intent(in), optional  do_not_log,
character(len=*), intent(in), optional  static_value 
)
private

This subroutine reads the values of an array of character string model parameters from a parameter file and logs them in documentation files.

Parameters
[in]csThe control structure for the file_parser module, it is also a structure to parse for run-time parameters
[in]modulenameThe name of the calling module
[in]varnameThe case-sensitive name of the parameter to read
[in,out]valueThe value of the parameter that may be read from the parameter file and logged
[in]descA description of this variable; if not present, this parameter is not written to a doc file
[in]unitsThe units of this parameter
[in]defaultThe default value of the parameter
[in]static_valueIf this parameter is static, it takes this value, which can be compared for consistency with what is in the parameter file.
[in]fail_if_missingIf present and true, a fatal error occurs if this variable is not found in the parameter file
[in]do_not_readIf present and true, do not read a value for this parameter, although it might be logged.
[in]do_not_logIf present and true, do not log this parameter to the documentation files

Definition at line 1873 of file MOM_file_parser.F90.

1873  type(param_file_type), intent(in) :: CS !< The control structure for the file_parser module,
1874  !! it is also a structure to parse for run-time parameters
1875  character(len=*), intent(in) :: modulename !< The name of the calling module
1876  character(len=*), intent(in) :: varname !< The case-sensitive name of the parameter to read
1877  character(len=*), dimension(:), intent(inout) :: value !< The value of the parameter that may be
1878  !! read from the parameter file and logged
1879  character(len=*), optional, intent(in) :: desc !< A description of this variable; if not
1880  !! present, this parameter is not written to a doc file
1881  character(len=*), optional, intent(in) :: units !< The units of this parameter
1882  character(len=*), optional, intent(in) :: default !< The default value of the parameter
1883  character(len=*), optional, intent(in) :: static_value !< If this parameter is static, it takes
1884  !! this value, which can be compared for consistency with
1885  !! what is in the parameter file.
1886  logical, optional, intent(in) :: fail_if_missing !< If present and true, a fatal error occurs
1887  !! if this variable is not found in the parameter file
1888  logical, optional, intent(in) :: do_not_read !< If present and true, do not read a
1889  !! value for this parameter, although it might be logged.
1890  logical, optional, intent(in) :: do_not_log !< If present and true, do not log this
1891  !! parameter to the documentation files
1892 
1893  ! Local variables
1894  logical :: do_read, do_log
1895  integer :: i, len_tot, len_val
1896  character(len=1024) :: cat_val
1897 
1898  do_read = .true. ; if (present(do_not_read)) do_read = .not.do_not_read
1899  do_log = .true. ; if (present(do_not_log)) do_log = .not.do_not_log
1900 
1901  if (do_read) then
1902  if (present(default)) then ; value(:) = default ; endif
1903  if (present(static_value)) then ; value(:) = static_value ; endif
1904  call read_param_char_array(cs, varname, value, fail_if_missing)
1905  endif
1906 
1907  if (do_log) then
1908  cat_val = trim(value(1)); len_tot = len_trim(value(1))
1909  do i=2,size(value)
1910  len_val = len_trim(value(i))
1911  if ((len_val > 0) .and. (len_tot + len_val + 2 < 240)) then
1912  cat_val = trim(cat_val)//achar(34)// ", "//achar(34)//trim(value(i))
1913  len_tot = len_tot + len_val
1914  endif
1915  enddo
1916  call log_param_char(cs, modulename, varname, cat_val, desc, &
1917  units, default)
1918  endif
1919 

◆ get_param_int()

subroutine mom_file_parser::get_param::get_param_int ( type(param_file_type), intent(in)  CS,
character(len=*), intent(in)  modulename,
character(len=*), intent(in)  varname,
integer, intent(inout)  value,
character(len=*), intent(in), optional  desc,
character(len=*), intent(in), optional  units,
integer, intent(in), optional  default,
logical, intent(in), optional  fail_if_missing,
logical, intent(in), optional  do_not_read,
logical, intent(in), optional  do_not_log,
integer, intent(in), optional  static_value,
logical, intent(in), optional  layoutParam,
logical, intent(in), optional  debuggingParam 
)
private

This subroutine reads the value of an integer model parameter from a parameter file and logs it in documentation files.

Parameters
[in]csThe control structure for the file_parser module, it is also a structure to parse for run-time parameters
[in]modulenameThe name of the calling module
[in]varnameThe case-sensitive name of the parameter to read
[in,out]valueThe value of the parameter that may be read from the parameter file and logged
[in]descA description of this variable; if not present, this parameter is not written to a doc file
[in]unitsThe units of this parameter
[in]defaultThe default value of the parameter
[in]static_valueIf this parameter is static, it takes this value, which can be compared for consistency with what is in the parameter file.
[in]fail_if_missingIf present and true, a fatal error occurs if this variable is not found in the parameter file
[in]do_not_readIf present and true, do not read a value for this parameter, although it might be logged.
[in]do_not_logIf present and true, do not log this parameter to the documentation files
[in]layoutparamIf present and true, this parameter is logged in the layout parameter file
[in]debuggingparamIf present and true, this parameter is logged in the debugging parameter file

Definition at line 1629 of file MOM_file_parser.F90.

1629  type(param_file_type), intent(in) :: CS !< The control structure for the file_parser module,
1630  !! it is also a structure to parse for run-time parameters
1631  character(len=*), intent(in) :: modulename !< The name of the calling module
1632  character(len=*), intent(in) :: varname !< The case-sensitive name of the parameter to read
1633  integer, intent(inout) :: value !< The value of the parameter that may be
1634  !! read from the parameter file and logged
1635  character(len=*), optional, intent(in) :: desc !< A description of this variable; if not
1636  !! present, this parameter is not written to a doc file
1637  character(len=*), optional, intent(in) :: units !< The units of this parameter
1638  integer, optional, intent(in) :: default !< The default value of the parameter
1639  integer, optional, intent(in) :: static_value !< If this parameter is static, it takes
1640  !! this value, which can be compared for consistency with
1641  !! what is in the parameter file.
1642  logical, optional, intent(in) :: fail_if_missing !< If present and true, a fatal error occurs
1643  !! if this variable is not found in the parameter file
1644  logical, optional, intent(in) :: do_not_read !< If present and true, do not read a
1645  !! value for this parameter, although it might be logged.
1646  logical, optional, intent(in) :: do_not_log !< If present and true, do not log this
1647  !! parameter to the documentation files
1648  logical, optional, intent(in) :: layoutParam !< If present and true, this parameter is
1649  !! logged in the layout parameter file
1650  logical, optional, intent(in) :: debuggingParam !< If present and true, this parameter is
1651  !! logged in the debugging parameter file
1652 
1653  logical :: do_read, do_log
1654 
1655  do_read = .true. ; if (present(do_not_read)) do_read = .not.do_not_read
1656  do_log = .true. ; if (present(do_not_log)) do_log = .not.do_not_log
1657 
1658  if (do_read) then
1659  if (present(default)) value = default
1660  if (present(static_value)) value = static_value
1661  call read_param_int(cs, varname, value, fail_if_missing)
1662  endif
1663 
1664  if (do_log) then
1665  call log_param_int(cs, modulename, varname, value, desc, units, &
1666  default, layoutparam, debuggingparam)
1667  endif
1668 

◆ get_param_int_array()

subroutine mom_file_parser::get_param::get_param_int_array ( type(param_file_type), intent(in)  CS,
character(len=*), intent(in)  modulename,
character(len=*), intent(in)  varname,
integer, dimension(:), intent(inout)  value,
character(len=*), intent(in), optional  desc,
character(len=*), intent(in), optional  units,
integer, intent(in), optional  default,
logical, intent(in), optional  fail_if_missing,
logical, intent(in), optional  do_not_read,
logical, intent(in), optional  do_not_log,
integer, intent(in), optional  static_value,
logical, intent(in), optional  layoutParam,
logical, intent(in), optional  debuggingParam 
)
private

This subroutine reads the values of an array of integer model parameters from a parameter file and logs them in documentation files.

Parameters
[in]csThe control structure for the file_parser module, it is also a structure to parse for run-time parameters
[in]modulenameThe name of the calling module
[in]varnameThe case-sensitive name of the parameter to read
[in,out]valueThe value of the parameter that may be reset from the parameter file
[in]descA description of this variable; if not present, this parameter is not written to a doc file
[in]unitsThe units of this parameter
[in]defaultThe default value of the parameter
[in]static_valueIf this parameter is static, it takes this value, which can be compared for consistency with what is in the parameter file.
[in]fail_if_missingIf present and true, a fatal error occurs if this variable is not found in the parameter file
[in]do_not_readIf present and true, do not read a value for this parameter, although it might be logged.
[in]do_not_logIf present and true, do not log this parameter to the documentation files
[in]layoutparamIf present and true, this parameter is logged in the layout parameter file
[in]debuggingparamIf present and true, this parameter is logged in the debugging parameter file

Definition at line 1676 of file MOM_file_parser.F90.

1676  type(param_file_type), intent(in) :: CS !< The control structure for the file_parser module,
1677  !! it is also a structure to parse for run-time parameters
1678  character(len=*), intent(in) :: modulename !< The name of the calling module
1679  character(len=*), intent(in) :: varname !< The case-sensitive name of the parameter to read
1680  integer, dimension(:), intent(inout) :: value !< The value of the parameter that may be reset
1681  !! from the parameter file
1682  character(len=*), optional, intent(in) :: desc !< A description of this variable; if not
1683  !! present, this parameter is not written to a doc file
1684  character(len=*), optional, intent(in) :: units !< The units of this parameter
1685  integer, optional, intent(in) :: default !< The default value of the parameter
1686  integer, optional, intent(in) :: static_value !< If this parameter is static, it takes
1687  !! this value, which can be compared for consistency with
1688  !! what is in the parameter file.
1689  logical, optional, intent(in) :: fail_if_missing !< If present and true, a fatal error occurs
1690  !! if this variable is not found in the parameter file
1691  logical, optional, intent(in) :: do_not_read !< If present and true, do not read a
1692  !! value for this parameter, although it might be logged.
1693  logical, optional, intent(in) :: do_not_log !< If present and true, do not log this
1694  !! parameter to the documentation files
1695  logical, optional, intent(in) :: layoutParam !< If present and true, this parameter is
1696  !! logged in the layout parameter file
1697  logical, optional, intent(in) :: debuggingParam !< If present and true, this parameter is
1698  !! logged in the debugging parameter file
1699 
1700  logical :: do_read, do_log
1701 
1702  do_read = .true. ; if (present(do_not_read)) do_read = .not.do_not_read
1703  do_log = .true. ; if (present(do_not_log)) do_log = .not.do_not_log
1704 
1705  if (do_read) then
1706  if (present(default)) then ; value(:) = default ; endif
1707  if (present(static_value)) then ; value(:) = static_value ; endif
1708  call read_param_int_array(cs, varname, value, fail_if_missing)
1709  endif
1710 
1711  if (do_log) then
1712  call log_param_int_array(cs, modulename, varname, value, desc, &
1713  units, default, layoutparam, debuggingparam)
1714  endif
1715 

◆ get_param_logical()

subroutine mom_file_parser::get_param::get_param_logical ( type(param_file_type), intent(in)  CS,
character(len=*), intent(in)  modulename,
character(len=*), intent(in)  varname,
logical, intent(inout)  value,
character(len=*), intent(in), optional  desc,
character(len=*), intent(in), optional  units,
logical, intent(in), optional  default,
logical, intent(in), optional  fail_if_missing,
logical, intent(in), optional  do_not_read,
logical, intent(in), optional  do_not_log,
logical, intent(in), optional  static_value,
logical, intent(in), optional  layoutParam,
logical, intent(in), optional  debuggingParam 
)
private

This subroutine reads the value of a logical model parameter from a parameter file and logs it in documentation files.

Parameters
[in]csThe control structure for the file_parser module, it is also a structure to parse for run-time parameters
[in]modulenameThe name of the calling module
[in]varnameThe case-sensitive name of the parameter to read
[in,out]valueThe value of the parameter that may be read from the parameter file and logged
[in]descA description of this variable; if not present, this parameter is not written to a doc file
[in]unitsThe units of this parameter
[in]defaultThe default value of the parameter
[in]static_valueIf this parameter is static, it takes this value, which can be compared for consistency with what is in the parameter file.
[in]fail_if_missingIf present and true, a fatal error occurs if this variable is not found in the parameter file
[in]do_not_readIf present and true, do not read a value for this parameter, although it might be logged.
[in]do_not_logIf present and true, do not log this parameter to the documentation files
[in]layoutparamIf present and true, this parameter is logged in the layout parameter file
[in]debuggingparamIf present and true, this parameter is logged in the debugging parameter file

Definition at line 1927 of file MOM_file_parser.F90.

1927  type(param_file_type), intent(in) :: CS !< The control structure for the file_parser module,
1928  !! it is also a structure to parse for run-time parameters
1929  character(len=*), intent(in) :: modulename !< The name of the calling module
1930  character(len=*), intent(in) :: varname !< The case-sensitive name of the parameter to read
1931  logical, intent(inout) :: value !< The value of the parameter that may be
1932  !! read from the parameter file and logged
1933  character(len=*), optional, intent(in) :: desc !< A description of this variable; if not
1934  !! present, this parameter is not written to a doc file
1935  character(len=*), optional, intent(in) :: units !< The units of this parameter
1936  logical, optional, intent(in) :: default !< The default value of the parameter
1937  logical, optional, intent(in) :: static_value !< If this parameter is static, it takes
1938  !! this value, which can be compared for consistency with
1939  !! what is in the parameter file.
1940  logical, optional, intent(in) :: fail_if_missing !< If present and true, a fatal error occurs
1941  !! if this variable is not found in the parameter file
1942  logical, optional, intent(in) :: do_not_read !< If present and true, do not read a
1943  !! value for this parameter, although it might be logged.
1944  logical, optional, intent(in) :: do_not_log !< If present and true, do not log this
1945  !! parameter to the documentation files
1946  logical, optional, intent(in) :: layoutParam !< If present and true, this parameter is
1947  !! logged in the layout parameter file
1948  logical, optional, intent(in) :: debuggingParam !< If present and true, this parameter is
1949  !! logged in the debugging parameter file
1950 
1951  logical :: do_read, do_log
1952 
1953  do_read = .true. ; if (present(do_not_read)) do_read = .not.do_not_read
1954  do_log = .true. ; if (present(do_not_log)) do_log = .not.do_not_log
1955 
1956  if (do_read) then
1957  if (present(default)) value = default
1958  if (present(static_value)) value = static_value
1959  call read_param_logical(cs, varname, value, fail_if_missing)
1960  endif
1961 
1962  if (do_log) then
1963  call log_param_logical(cs, modulename, varname, value, desc, &
1964  units, default, layoutparam, debuggingparam)
1965  endif
1966 

◆ get_param_real()

subroutine mom_file_parser::get_param::get_param_real ( type(param_file_type), intent(in)  CS,
character(len=*), intent(in)  modulename,
character(len=*), intent(in)  varname,
real, intent(inout)  value,
character(len=*), intent(in), optional  desc,
character(len=*), intent(in), optional  units,
real, intent(in), optional  default,
logical, intent(in), optional  fail_if_missing,
logical, intent(in), optional  do_not_read,
logical, intent(in), optional  do_not_log,
real, intent(in), optional  static_value,
logical, intent(in), optional  debuggingParam,
real, intent(in), optional  scale,
real, intent(out), optional  unscaled 
)
private

This subroutine reads the value of a real model parameter from a parameter file and logs it in documentation files.

Parameters
[in]csThe control structure for the file_parser module, it is also a structure to parse for run-time parameters
[in]modulenameThe name of the calling module
[in]varnameThe case-sensitive name of the parameter to read
[in,out]valueThe value of the parameter that may be read from the parameter file and logged
[in]descA description of this variable; if not present, this parameter is not written to a doc file
[in]unitsThe units of this parameter
[in]defaultThe default value of the parameter
[in]static_valueIf this parameter is static, it takes this value, which can be compared for consistency with what is in the parameter file.
[in]fail_if_missingIf present and true, a fatal error occurs if this variable is not found in the parameter file
[in]do_not_readIf present and true, do not read a value for this parameter, although it might be logged.
[in]do_not_logIf present and true, do not log this parameter to the documentation files
[in]debuggingparamIf present and true, this parameter is logged in the debugging parameter file
[in]scaleA scaling factor that the parameter is multiplied by before it is returned.
[out]unscaledThe value of the parameter that would be returned without any multiplication by a scaling factor.

Definition at line 1723 of file MOM_file_parser.F90.

1723  type(param_file_type), intent(in) :: CS !< The control structure for the file_parser module,
1724  !! it is also a structure to parse for run-time parameters
1725  character(len=*), intent(in) :: modulename !< The name of the calling module
1726  character(len=*), intent(in) :: varname !< The case-sensitive name of the parameter to read
1727  real, intent(inout) :: value !< The value of the parameter that may be
1728  !! read from the parameter file and logged
1729  character(len=*), optional, intent(in) :: desc !< A description of this variable; if not
1730  !! present, this parameter is not written to a doc file
1731  character(len=*), optional, intent(in) :: units !< The units of this parameter
1732  real, optional, intent(in) :: default !< The default value of the parameter
1733  real, optional, intent(in) :: static_value !< If this parameter is static, it takes
1734  !! this value, which can be compared for consistency with
1735  !! what is in the parameter file.
1736  logical, optional, intent(in) :: fail_if_missing !< If present and true, a fatal error occurs
1737  !! if this variable is not found in the parameter file
1738  logical, optional, intent(in) :: do_not_read !< If present and true, do not read a
1739  !! value for this parameter, although it might be logged.
1740  logical, optional, intent(in) :: do_not_log !< If present and true, do not log this
1741  !! parameter to the documentation files
1742  logical, optional, intent(in) :: debuggingParam !< If present and true, this parameter is
1743  !! logged in the debugging parameter file
1744  real, optional, intent(in) :: scale !< A scaling factor that the parameter is
1745  !! multiplied by before it is returned.
1746  real, optional, intent(out) :: unscaled !< The value of the parameter that would be
1747  !! returned without any multiplication by a scaling factor.
1748 
1749  logical :: do_read, do_log
1750 
1751  do_read = .true. ; if (present(do_not_read)) do_read = .not.do_not_read
1752  do_log = .true. ; if (present(do_not_log)) do_log = .not.do_not_log
1753 
1754  if (do_read) then
1755  if (present(default)) value = default
1756  if (present(static_value)) value = static_value
1757  call read_param_real(cs, varname, value, fail_if_missing)
1758  endif
1759 
1760  if (do_log) then
1761  call log_param_real(cs, modulename, varname, value, desc, units, &
1762  default, debuggingparam)
1763  endif
1764 
1765  if (present(unscaled)) unscaled = value
1766  if (present(scale)) value = scale*value
1767 

◆ get_param_real_array()

subroutine mom_file_parser::get_param::get_param_real_array ( type(param_file_type), intent(in)  CS,
character(len=*), intent(in)  modulename,
character(len=*), intent(in)  varname,
real, dimension(:), intent(inout)  value,
character(len=*), intent(in), optional  desc,
character(len=*), intent(in), optional  units,
real, intent(in), optional  default,
logical, intent(in), optional  fail_if_missing,
logical, intent(in), optional  do_not_read,
logical, intent(in), optional  do_not_log,
logical, intent(in), optional  debuggingParam,
real, intent(in), optional  static_value,
real, intent(in), optional  scale,
real, dimension(:), intent(out), optional  unscaled 
)
private

This subroutine reads the values of an array of real model parameters from a parameter file and logs them in documentation files.

Parameters
[in]csThe control structure for the file_parser module, it is also a structure to parse for run-time parameters
[in]modulenameThe name of the calling module
[in]varnameThe case-sensitive name of the parameter to read
[in,out]valueThe value of the parameter that may be read from the parameter file and logged
[in]descA description of this variable; if not present, this parameter is not written to a doc file
[in]unitsThe units of this parameter
[in]defaultThe default value of the parameter
[in]static_valueIf this parameter is static, it takes this value, which can be compared for consistency with what is in the parameter file.
[in]fail_if_missingIf present and true, a fatal error occurs if this variable is not found in the parameter file
[in]do_not_readIf present and true, do not read a value for this parameter, although it might be logged.
[in]do_not_logIf present and true, do not log this parameter to the documentation files
[in]debuggingparamIf present and true, this parameter is logged in the debugging parameter file
[in]scaleA scaling factor that the parameter is multiplied by before it is returned.
[out]unscaledThe value of the parameter that would be returned without any multiplication by a scaling factor.

Definition at line 1775 of file MOM_file_parser.F90.

1775  type(param_file_type), intent(in) :: CS !< The control structure for the file_parser module,
1776  !! it is also a structure to parse for run-time parameters
1777  character(len=*), intent(in) :: modulename !< The name of the calling module
1778  character(len=*), intent(in) :: varname !< The case-sensitive name of the parameter to read
1779  real, dimension(:), intent(inout) :: value !< The value of the parameter that may be
1780  !! read from the parameter file and logged
1781  character(len=*), optional, intent(in) :: desc !< A description of this variable; if not
1782  !! present, this parameter is not written to a doc file
1783  character(len=*), optional, intent(in) :: units !< The units of this parameter
1784  real, optional, intent(in) :: default !< The default value of the parameter
1785  real, optional, intent(in) :: static_value !< If this parameter is static, it takes
1786  !! this value, which can be compared for consistency with
1787  !! what is in the parameter file.
1788  logical, optional, intent(in) :: fail_if_missing !< If present and true, a fatal error occurs
1789  !! if this variable is not found in the parameter file
1790  logical, optional, intent(in) :: do_not_read !< If present and true, do not read a
1791  !! value for this parameter, although it might be logged.
1792  logical, optional, intent(in) :: do_not_log !< If present and true, do not log this
1793  !! parameter to the documentation files
1794  logical, optional, intent(in) :: debuggingParam !< If present and true, this parameter is
1795  !! logged in the debugging parameter file
1796  real, optional, intent(in) :: scale !< A scaling factor that the parameter is
1797  !! multiplied by before it is returned.
1798  real, dimension(:), optional, intent(out) :: unscaled !< The value of the parameter that would be
1799  !! returned without any multiplication by a scaling factor.
1800 
1801  logical :: do_read, do_log
1802 
1803  do_read = .true. ; if (present(do_not_read)) do_read = .not.do_not_read
1804  do_log = .true. ; if (present(do_not_log)) do_log = .not.do_not_log
1805 
1806  if (do_read) then
1807  if (present(default)) then ; value(:) = default ; endif
1808  if (present(static_value)) then ; value(:) = static_value ; endif
1809  call read_param_real_array(cs, varname, value, fail_if_missing)
1810  endif
1811 
1812  if (do_log) then
1813  call log_param_real_array(cs, modulename, varname, value, desc, &
1814  units, default, debuggingparam)
1815  endif
1816 
1817  if (present(unscaled)) unscaled(:) = value(:)
1818  if (present(scale)) value(:) = scale*value(:)
1819 

◆ get_param_time()

subroutine mom_file_parser::get_param::get_param_time ( type(param_file_type), intent(in)  CS,
character(len=*), intent(in)  modulename,
character(len=*), intent(in)  varname,
type(time_type), intent(inout)  value,
character(len=*), intent(in), optional  desc,
character(len=*), intent(in), optional  units,
type(time_type), intent(in), optional  default,
logical, intent(in), optional  fail_if_missing,
logical, intent(in), optional  do_not_read,
logical, intent(in), optional  do_not_log,
real, intent(in), optional  timeunit,
type(time_type), intent(in), optional  static_value,
logical, intent(in), optional  layoutParam,
logical, intent(in), optional  debuggingParam,
logical, intent(in), optional  log_as_date 
)
private

This subroutine reads the value of a time-type model parameter from a parameter file and logs it in documentation files.

Parameters
[in]csThe control structure for the file_parser module, it is also a structure to parse for run-time parameters
[in]modulenameThe name of the calling module
[in]varnameThe case-sensitive name of the parameter to read
[in,out]valueThe value of the parameter that may be read from the parameter file and logged
[in]descA description of this variable; if not present, this parameter is not written to a doc file
[in]unitsThe units of this parameter
[in]defaultThe default value of the parameter
[in]static_valueIf this parameter is static, it takes this value, which can be compared for consistency with what is in the parameter file.
[in]fail_if_missingIf present and true, a fatal error occurs if this variable is not found in the parameter file
[in]do_not_readIf present and true, do not read a value for this parameter, although it might be logged.
[in]do_not_logIf present and true, do not log this parameter to the documentation files
[in]timeunitThe number of seconds in a time unit for real-number input to be translated to a time.
[in]layoutparamIf present and true, this parameter is logged in the layout parameter file
[in]debuggingparamIf present and true, this parameter is logged in the debugging parameter file
[in]log_as_dateIf true, log the time_type in date format. The default is false.

Definition at line 1975 of file MOM_file_parser.F90.

1975  type(param_file_type), intent(in) :: CS !< The control structure for the file_parser module,
1976  !! it is also a structure to parse for run-time parameters
1977  character(len=*), intent(in) :: modulename !< The name of the calling module
1978  character(len=*), intent(in) :: varname !< The case-sensitive name of the parameter to read
1979  type(time_type), intent(inout) :: value !< The value of the parameter that may be
1980  !! read from the parameter file and logged
1981  character(len=*), optional, intent(in) :: desc !< A description of this variable; if not
1982  !! present, this parameter is not written to a doc file
1983  character(len=*), optional, intent(in) :: units !< The units of this parameter
1984  type(time_type), optional, intent(in) :: default !< The default value of the parameter
1985  type(time_type), optional, intent(in) :: static_value !< If this parameter is static, it takes
1986  !! this value, which can be compared for consistency with
1987  !! what is in the parameter file.
1988  logical, optional, intent(in) :: fail_if_missing !< If present and true, a fatal error occurs
1989  !! if this variable is not found in the parameter file
1990  logical, optional, intent(in) :: do_not_read !< If present and true, do not read a
1991  !! value for this parameter, although it might be logged.
1992  logical, optional, intent(in) :: do_not_log !< If present and true, do not log this
1993  !! parameter to the documentation files
1994  real, optional, intent(in) :: timeunit !< The number of seconds in a time unit for
1995  !! real-number input to be translated to a time.
1996  logical, optional, intent(in) :: layoutParam !< If present and true, this parameter is
1997  !! logged in the layout parameter file
1998  logical, optional, intent(in) :: debuggingParam !< If present and true, this parameter is
1999  !! logged in the debugging parameter file
2000  logical, optional, intent(in) :: log_as_date !< If true, log the time_type in date
2001  !! format. The default is false.
2002 
2003  logical :: do_read, do_log, date_format, log_date
2004 
2005  do_read = .true. ; if (present(do_not_read)) do_read = .not.do_not_read
2006  do_log = .true. ; if (present(do_not_log)) do_log = .not.do_not_log
2007  log_date = .false.
2008 
2009  if (do_read) then
2010  if (present(default)) value = default
2011  if (present(static_value)) value = static_value
2012  call read_param_time(cs, varname, value, timeunit, fail_if_missing, date_format=log_date)
2013  endif
2014 
2015  if (do_log) then
2016  if (present(log_as_date)) log_date = log_as_date
2017  call log_param_time(cs, modulename, varname, value, desc, units, default, &
2018  timeunit, layoutparam=layoutparam, &
2019  debuggingparam=debuggingparam, log_date=log_date)
2020  endif
2021 

The documentation for this interface was generated from the following file: