MOM6
mom_file_parser::log_param Interface Reference

Detailed Description

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

Definition at line 96 of file MOM_file_parser.F90.

Private functions

subroutine log_param_int (CS, modulename, varname, value, desc, units, default, layoutParam, debuggingParam)
 Log the name and value of an integer model parameter in documentation files. More...
 
subroutine log_param_real (CS, modulename, varname, value, desc, units, default, debuggingParam)
 Log the name and value of a real model parameter in documentation files. More...
 
subroutine log_param_logical (CS, modulename, varname, value, desc, units, default, layoutParam, debuggingParam)
 Log the name and value of a logical model parameter in documentation files. More...
 
subroutine log_param_char (CS, modulename, varname, value, desc, units, default, layoutParam, debuggingParam)
 Log the name and value of a character string model parameter in documentation files. More...
 
subroutine log_param_time (CS, modulename, varname, value, desc, units, default, timeunit, layoutParam, debuggingParam, log_date)
 This subroutine writes the value of a time-type parameter to a log file, along with its name and the module it came from. More...
 
subroutine log_param_int_array (CS, modulename, varname, value, desc, units, default, layoutParam, debuggingParam)
 Log the name and values of an array of integer model parameter in documentation files. More...
 
subroutine log_param_real_array (CS, modulename, varname, value, desc, units, default, debuggingParam)
 Log the name and values of an array of real model parameter in documentation files. More...
 

Functions and subroutines

◆ log_param_char()

subroutine mom_file_parser::log_param::log_param_char ( type(param_file_type), intent(in)  CS,
character(len=*), intent(in)  modulename,
character(len=*), intent(in)  varname,
character(len=*), intent(in)  value,
character(len=*), intent(in), optional  desc,
character(len=*), intent(in), optional  units,
character(len=*), intent(in), optional  default,
logical, intent(in), optional  layoutParam,
logical, intent(in), optional  debuggingParam 
)
private

Log the name and value of a character string model parameter 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 name of the parameter to log
[in]valueThe value of the parameter to log
[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]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 1445 of file MOM_file_parser.F90.

1445  type(param_file_type), intent(in) :: CS !< The control structure for the file_parser module,
1446  !! it is also a structure to parse for run-time parameters
1447  character(len=*), intent(in) :: modulename !< The name of the calling module
1448  character(len=*), intent(in) :: varname !< The name of the parameter to log
1449  character(len=*), intent(in) :: value !< The value of the parameter to log
1450  character(len=*), optional, intent(in) :: desc !< A description of this variable; if not
1451  !! present, this parameter is not written to a doc file
1452  character(len=*), optional, intent(in) :: units !< The units of this parameter
1453  character(len=*), optional, intent(in) :: default !< The default value of the parameter
1454  logical, optional, intent(in) :: layoutParam !< If present and true, this parameter is
1455  !! logged in the layout parameter file
1456  logical, optional, intent(in) :: debuggingParam !< If present and true, this parameter is
1457  !! logged in the debugging parameter file
1458 
1459  character(len=240) :: mesg, myunits
1460 
1461  write(mesg, '(" ",a," ",a,": ",a)') &
1462  trim(modulename), trim(varname), trim(value)
1463  if (is_root_pe()) then
1464  if (cs%log_open) write(cs%stdlog,'(a)') trim(mesg)
1465  if (cs%log_to_stdout) write(cs%stdout,'(a)') trim(mesg)
1466  endif
1467 
1468  myunits=" "; if (present(units)) write(myunits(1:240),'(A)') trim(units)
1469  if (present(desc)) &
1470  call doc_param(cs%doc, varname, desc, myunits, value, default, &
1471  layoutparam=layoutparam, debuggingparam=debuggingparam)
1472 

◆ log_param_int()

subroutine mom_file_parser::log_param::log_param_int ( type(param_file_type), intent(in)  CS,
character(len=*), intent(in)  modulename,
character(len=*), intent(in)  varname,
integer, intent(in)  value,
character(len=*), intent(in), optional  desc,
character(len=*), intent(in), optional  units,
integer, intent(in), optional  default,
logical, intent(in), optional  layoutParam,
logical, intent(in), optional  debuggingParam 
)
private

Log the name and value of an integer model parameter 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 module using this parameter
[in]varnameThe name of the parameter to log
[in]valueThe value of the parameter to log
[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]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 1278 of file MOM_file_parser.F90.

1278  type(param_file_type), intent(in) :: CS !< The control structure for the file_parser module,
1279  !! it is also a structure to parse for run-time parameters
1280  character(len=*), intent(in) :: modulename !< The name of the module using this parameter
1281  character(len=*), intent(in) :: varname !< The name of the parameter to log
1282  integer, intent(in) :: value !< The value of the parameter to log
1283  character(len=*), optional, intent(in) :: desc !< A description of this variable; if not
1284  !! present, this parameter is not written to a doc file
1285  character(len=*), optional, intent(in) :: units !< The units of this parameter
1286  integer, optional, intent(in) :: default !< The default value of the parameter
1287  logical, optional, intent(in) :: layoutParam !< If present and true, this parameter is
1288  !! logged in the layout parameter file
1289  logical, optional, intent(in) :: debuggingParam !< If present and true, this parameter is
1290  !! logged in the debugging parameter file
1291 
1292  character(len=240) :: mesg, myunits
1293 
1294  write(mesg, '(" ",a," ",a,": ",a)') trim(modulename), trim(varname), trim(left_int(value))
1295  if (is_root_pe()) then
1296  if (cs%log_open) write(cs%stdlog,'(a)') trim(mesg)
1297  if (cs%log_to_stdout) write(cs%stdout,'(a)') trim(mesg)
1298  endif
1299 
1300  myunits=" "; if (present(units)) write(myunits(1:240),'(A)') trim(units)
1301  if (present(desc)) &
1302  call doc_param(cs%doc, varname, desc, myunits, value, default, &
1303  layoutparam=layoutparam, debuggingparam=debuggingparam)
1304 

◆ log_param_int_array()

subroutine mom_file_parser::log_param::log_param_int_array ( type(param_file_type), intent(in)  CS,
character(len=*), intent(in)  modulename,
character(len=*), intent(in)  varname,
integer, dimension(:), intent(in)  value,
character(len=*), intent(in), optional  desc,
character(len=*), intent(in), optional  units,
integer, intent(in), optional  default,
logical, intent(in), optional  layoutParam,
logical, intent(in), optional  debuggingParam 
)
private

Log the name and values of an array of integer model parameter 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 module using this parameter
[in]varnameThe name of the parameter to log
[in]valueThe value of the parameter to log
[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]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 1310 of file MOM_file_parser.F90.

1310  type(param_file_type), intent(in) :: CS !< The control structure for the file_parser module,
1311  !! it is also a structure to parse for run-time parameters
1312  character(len=*), intent(in) :: modulename !< The name of the module using this parameter
1313  character(len=*), intent(in) :: varname !< The name of the parameter to log
1314  integer, dimension(:), intent(in) :: value !< The value of the parameter to log
1315  character(len=*), optional, intent(in) :: desc !< A description of this variable; if not
1316  !! present, this parameter is not written to a doc file
1317  character(len=*), optional, intent(in) :: units !< The units of this parameter
1318  integer, optional, intent(in) :: default !< The default value of the parameter
1319  logical, optional, intent(in) :: layoutParam !< If present and true, this parameter is
1320  !! logged in the layout parameter file
1321  logical, optional, intent(in) :: debuggingParam !< If present and true, this parameter is
1322  !! logged in the debugging parameter file
1323 
1324  character(len=1320) :: mesg
1325  character(len=240) :: myunits
1326 
1327  write(mesg, '(" ",a," ",a,": ",A)') trim(modulename), trim(varname), trim(left_ints(value))
1328  if (is_root_pe()) then
1329  if (cs%log_open) write(cs%stdlog,'(a)') trim(mesg)
1330  if (cs%log_to_stdout) write(cs%stdout,'(a)') trim(mesg)
1331  endif
1332 
1333  myunits=" "; if (present(units)) write(myunits(1:240),'(A)') trim(units)
1334  if (present(desc)) &
1335  call doc_param(cs%doc, varname, desc, myunits, value, default, &
1336  layoutparam=layoutparam, debuggingparam=debuggingparam)
1337 

◆ log_param_logical()

subroutine mom_file_parser::log_param::log_param_logical ( type(param_file_type), intent(in)  CS,
character(len=*), intent(in)  modulename,
character(len=*), intent(in)  varname,
logical, intent(in)  value,
character(len=*), intent(in), optional  desc,
character(len=*), intent(in), optional  units,
logical, intent(in), optional  default,
logical, intent(in), optional  layoutParam,
logical, intent(in), optional  debuggingParam 
)
private

Log the name and value of a logical model parameter 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 name of the parameter to log
[in]valueThe value of the parameter to log
[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]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 1409 of file MOM_file_parser.F90.

1409  type(param_file_type), intent(in) :: CS !< The control structure for the file_parser module,
1410  !! it is also a structure to parse for run-time parameters
1411  character(len=*), intent(in) :: modulename !< The name of the calling module
1412  character(len=*), intent(in) :: varname !< The name of the parameter to log
1413  logical, intent(in) :: value !< The value of the parameter to log
1414  character(len=*), optional, intent(in) :: desc !< A description of this variable; if not
1415  !! present, this parameter is not written to a doc file
1416  character(len=*), optional, intent(in) :: units !< The units of this parameter
1417  logical, optional, intent(in) :: default !< The default value of the parameter
1418  logical, optional, intent(in) :: layoutParam !< If present and true, this parameter is
1419  !! logged in the layout parameter file
1420  logical, optional, intent(in) :: debuggingParam !< If present and true, this parameter is
1421  !! logged in the debugging parameter file
1422 
1423  character(len=240) :: mesg, myunits
1424 
1425  if (value) then
1426  write(mesg, '(" ",a," ",a,": True")') trim(modulename), trim(varname)
1427  else
1428  write(mesg, '(" ",a," ",a,": False")') trim(modulename), trim(varname)
1429  endif
1430  if (is_root_pe()) then
1431  if (cs%log_open) write(cs%stdlog,'(a)') trim(mesg)
1432  if (cs%log_to_stdout) write(cs%stdout,'(a)') trim(mesg)
1433  endif
1434 
1435  myunits="Boolean"; if (present(units)) write(myunits(1:240),'(A)') trim(units)
1436  if (present(desc)) &
1437  call doc_param(cs%doc, varname, desc, myunits, value, default, &
1438  layoutparam=layoutparam, debuggingparam=debuggingparam)
1439 

◆ log_param_real()

subroutine mom_file_parser::log_param::log_param_real ( type(param_file_type), intent(in)  CS,
character(len=*), intent(in)  modulename,
character(len=*), intent(in)  varname,
real, intent(in)  value,
character(len=*), intent(in), optional  desc,
character(len=*), intent(in), optional  units,
real, intent(in), optional  default,
logical, intent(in), optional  debuggingParam 
)
private

Log the name and value of a real model parameter 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 name of the parameter to log
[in]valueThe value of the parameter to log
[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]debuggingparamIf present and true, this parameter is logged in the debugging parameter file

Definition at line 1343 of file MOM_file_parser.F90.

1343  type(param_file_type), intent(in) :: CS !< The control structure for the file_parser module,
1344  !! it is also a structure to parse for run-time parameters
1345  character(len=*), intent(in) :: modulename !< The name of the calling module
1346  character(len=*), intent(in) :: varname !< The name of the parameter to log
1347  real, intent(in) :: value !< The value of the parameter to log
1348  character(len=*), optional, intent(in) :: desc !< A description of this variable; if not
1349  !! present, this parameter is not written to a doc file
1350  character(len=*), optional, intent(in) :: units !< The units of this parameter
1351  real, optional, intent(in) :: default !< The default value of the parameter
1352  logical, optional, intent(in) :: debuggingParam !< If present and true, this parameter is
1353  !! logged in the debugging parameter file
1354 
1355  character(len=240) :: mesg, myunits
1356 
1357  write(mesg, '(" ",a," ",a,": ",a)') &
1358  trim(modulename), trim(varname), trim(left_real(value))
1359  if (is_root_pe()) then
1360  if (cs%log_open) write(cs%stdlog,'(a)') trim(mesg)
1361  if (cs%log_to_stdout) write(cs%stdout,'(a)') trim(mesg)
1362  endif
1363 
1364  myunits="not defined"; if (present(units)) write(myunits(1:240),'(A)') trim(units)
1365  if (present(desc)) &
1366  call doc_param(cs%doc, varname, desc, myunits, value, default, &
1367  debuggingparam=debuggingparam)
1368 

◆ log_param_real_array()

subroutine mom_file_parser::log_param::log_param_real_array ( type(param_file_type), intent(in)  CS,
character(len=*), intent(in)  modulename,
character(len=*), intent(in)  varname,
real, dimension(:), intent(in)  value,
character(len=*), intent(in), optional  desc,
character(len=*), intent(in), optional  units,
real, intent(in), optional  default,
logical, intent(in), optional  debuggingParam 
)
private

Log the name and values of an array of real model parameter 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 name of the parameter to log
[in]valueThe value of the parameter to log
[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]debuggingparamIf present and true, this parameter is logged in the debugging parameter file

Definition at line 1374 of file MOM_file_parser.F90.

1374  type(param_file_type), intent(in) :: CS !< The control structure for the file_parser module,
1375  !! it is also a structure to parse for run-time parameters
1376  character(len=*), intent(in) :: modulename !< The name of the calling module
1377  character(len=*), intent(in) :: varname !< The name of the parameter to log
1378  real, dimension(:), intent(in) :: value !< The value of the parameter to log
1379  character(len=*), optional, intent(in) :: desc !< A description of this variable; if not
1380  !! present, this parameter is not written to a doc file
1381  character(len=*), optional, intent(in) :: units !< The units of this parameter
1382  real, optional, intent(in) :: default !< The default value of the parameter
1383  logical, optional, intent(in) :: debuggingParam !< If present and true, this parameter is
1384  !! logged in the debugging parameter file
1385 
1386  character(len=1320) :: mesg
1387  character(len=240) :: myunits
1388 
1389  !write(mesg, '(" ",a," ",a,": ",ES19.12,99(",",ES19.12))') &
1390  !write(mesg, '(" ",a," ",a,": ",G,99(",",G))') &
1391  ! trim(modulename), trim(varname), value
1392  write(mesg, '(" ",a," ",a,": ",a)') &
1393  trim(modulename), trim(varname), trim(left_reals(value))
1394  if (is_root_pe()) then
1395  if (cs%log_open) write(cs%stdlog,'(a)') trim(mesg)
1396  if (cs%log_to_stdout) write(cs%stdout,'(a)') trim(mesg)
1397  endif
1398 
1399  myunits="not defined"; if (present(units)) write(myunits(1:240),'(A)') trim(units)
1400  if (present(desc)) &
1401  call doc_param(cs%doc, varname, desc, myunits, value, default, &
1402  debuggingparam=debuggingparam)
1403 

◆ log_param_time()

subroutine mom_file_parser::log_param::log_param_time ( type(param_file_type), intent(in)  CS,
character(len=*), intent(in)  modulename,
character(len=*), intent(in)  varname,
type(time_type), intent(in)  value,
character(len=*), intent(in), optional  desc,
character(len=*), intent(in), optional  units,
type(time_type), intent(in), optional  default,
real, intent(in), optional  timeunit,
logical, intent(in), optional  layoutParam,
logical, intent(in), optional  debuggingParam,
logical, intent(in), optional  log_date 
)
private

This subroutine writes the value of a time-type parameter to a log file, along with its name and the module it came from.

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 name of the parameter to log
[in]valueThe value of the parameter to log
[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]timeunitThe number of seconds in a time unit for real-number output.
[in]log_dateIf true, log the time_type in date format. If missing the default is false.
[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 1479 of file MOM_file_parser.F90.

1479  type(param_file_type), intent(in) :: CS !< The control structure for the file_parser module,
1480  !! it is also a structure to parse for run-time parameters
1481  character(len=*), intent(in) :: modulename !< The name of the calling module
1482  character(len=*), intent(in) :: varname !< The name of the parameter to log
1483  type(time_type), intent(in) :: value !< The value of the parameter to log
1484  character(len=*), optional, intent(in) :: desc !< A description of this variable; if not
1485  !! present, this parameter is not written to a doc file
1486  character(len=*), optional, intent(in) :: units !< The units of this parameter
1487  type(time_type), optional, intent(in) :: default !< The default value of the parameter
1488  real, optional, intent(in) :: timeunit !< The number of seconds in a time unit for
1489  !! real-number output.
1490  logical, optional, intent(in) :: log_date !< If true, log the time_type in date format.
1491  !! If missing the default is false.
1492  logical, optional, intent(in) :: layoutParam !< If present and true, this parameter is
1493  !! logged in the layout parameter file
1494  logical, optional, intent(in) :: debuggingParam !< If present and true, this parameter is
1495  !! logged in the debugging parameter file
1496 
1497  ! Local variables
1498  real :: real_time, real_default
1499  logical :: use_timeunit, date_format
1500  character(len=240) :: mesg, myunits
1501  character(len=80) :: date_string, default_string
1502  integer :: days, secs, ticks, ticks_per_sec
1503 
1504  use_timeunit = .false.
1505  date_format = .false. ; if (present(log_date)) date_format = log_date
1506 
1507  call get_time(value, secs, days, ticks)
1508 
1509  if (ticks == 0) then
1510  write(mesg, '(" ",a," ",a," (Time): ",i0,":",i0)') trim(modulename), &
1511  trim(varname), days, secs
1512  else
1513  write(mesg, '(" ",a," ",a," (Time): ",i0,":",i0,":",i0)') trim(modulename), &
1514  trim(varname), days, secs, ticks
1515  endif
1516  if (is_root_pe()) then
1517  if (cs%log_open) write(cs%stdlog,'(a)') trim(mesg)
1518  if (cs%log_to_stdout) write(cs%stdout,'(a)') trim(mesg)
1519  endif
1520 
1521  if (present(desc)) then
1522  if (present(timeunit)) use_timeunit = (timeunit > 0.0)
1523  if (date_format) then
1524  myunits='[date]'
1525 
1526  date_string = convert_date_to_string(value)
1527  if (present(default)) then
1528  default_string = convert_date_to_string(default)
1529  call doc_param(cs%doc, varname, desc, myunits, date_string, &
1530  default=default_string, layoutparam=layoutparam, &
1531  debuggingparam=debuggingparam)
1532  else
1533  call doc_param(cs%doc, varname, desc, myunits, date_string, &
1534  layoutparam=layoutparam, debuggingparam=debuggingparam)
1535  endif
1536  elseif (use_timeunit) then
1537  if (present(units)) then
1538  write(myunits(1:240),'(A)') trim(units)
1539  else
1540  if (abs(timeunit-1.0) < 0.01) then ; myunits = "seconds"
1541  elseif (abs(timeunit-3600.0) < 1.0) then ; myunits = "hours"
1542  elseif (abs(timeunit-86400.0) < 1.0) then ; myunits = "days"
1543  elseif (abs(timeunit-3.1e7) < 1.0e6) then ; myunits = "years"
1544  else ; write(myunits,'(es8.2," sec")') timeunit ; endif
1545  endif
1546  real_time = (86400.0/timeunit)*days + secs/timeunit
1547  if (ticks > 0) real_time = real_time + &
1548  real(ticks) / (timeunit*get_ticks_per_second())
1549  if (present(default)) then
1550  call get_time(default, secs, days, ticks)
1551  real_default = (86400.0/timeunit)*days + secs/timeunit
1552  if (ticks > 0) real_default = real_default + &
1553  real(ticks) / (timeunit*get_ticks_per_second())
1554  call doc_param(cs%doc, varname, desc, myunits, real_time, real_default)
1555  else
1556  call doc_param(cs%doc, varname, desc, myunits, real_time)
1557  endif
1558  else
1559  myunits='not defined'; if (present(units)) write(myunits(1:240),'(A)') trim(units)
1560  call doc_param(cs%doc, varname, desc, myunits, value, default)
1561  endif
1562  endif
1563 

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