MOM6
mom_file_parser::log_param Interface Reference

Detailed Description

Definition at line 130 of file MOM_file_parser.F90.

Private functions

subroutine log_param_int (CS, modulename, varname, value, desc, units, default, layoutParam)
 
subroutine log_param_real (CS, modulename, varname, value, desc, units, default)
 
subroutine log_param_logical (CS, modulename, varname, value, desc, units, default, layoutParam)
 
subroutine log_param_char (CS, modulename, varname, value, desc, units, default, layoutParam)
 
subroutine log_param_time (CS, modulename, varname, value, desc, units, default, timeunit, layoutParam, 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)
 
subroutine log_param_real_array (CS, modulename, varname, value, desc, units, default)
 

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 
)
private

Definition at line 1395 of file MOM_file_parser.F90.

1395  type(param_file_type), intent(in) :: cs
1396  character(len=*), intent(in) :: modulename
1397  character(len=*), intent(in) :: varname
1398  character(len=*), intent(in) :: value
1399  character(len=*), optional, intent(in) :: desc, units
1400  character(len=*), optional, intent(in) :: default
1401  logical, optional, intent(in) :: layoutparam
1402 ! This subroutine writes the value of a character string parameter to a log
1403 ! file, along with its name and the module it came from.
1404  character(len=240) :: mesg, myunits
1405 
1406  write(mesg, '(" ",a," ",a,": ",a)') &
1407  trim(modulename), trim(varname), trim(value)
1408  if (is_root_pe()) then
1409  if (cs%log_open) write(cs%stdlog,'(a)') trim(mesg)
1410  if (cs%log_to_stdout) write(cs%stdout,'(a)') trim(mesg)
1411  endif
1412 
1413  myunits=" "; if (present(units)) write(myunits(1:240),'(A)') trim(units)
1414  if (present(desc)) &
1415  call doc_param(cs%doc, varname, desc, myunits, value, default, &
1416  layoutparam=layoutparam)
1417 

◆ 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 
)
private

Definition at line 1258 of file MOM_file_parser.F90.

1258  type(param_file_type), intent(in) :: cs
1259  character(len=*), intent(in) :: modulename
1260  character(len=*), intent(in) :: varname
1261  integer, intent(in) :: value
1262  character(len=*), optional, intent(in) :: desc, units
1263  integer, optional, intent(in) :: default
1264  logical, optional, intent(in) :: layoutparam
1265 ! This subroutine writes the value of an integer parameter to a log file,
1266 ! along with its name and the module it came from.
1267  character(len=240) :: mesg, myunits
1268 
1269  write(mesg, '(" ",a," ",a,": ",a)') trim(modulename), trim(varname), trim(left_int(value))
1270  if (is_root_pe()) then
1271  if (cs%log_open) write(cs%stdlog,'(a)') trim(mesg)
1272  if (cs%log_to_stdout) write(cs%stdout,'(a)') trim(mesg)
1273  endif
1274 
1275  myunits=" "; if (present(units)) write(myunits(1:240),'(A)') trim(units)
1276  if (present(desc)) &
1277  call doc_param(cs%doc, varname, desc, myunits, value, default, &
1278  layoutparam=layoutparam)
1279 

◆ 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 
)
private

Definition at line 1284 of file MOM_file_parser.F90.

1284  type(param_file_type), intent(in) :: cs
1285  character(len=*), intent(in) :: modulename
1286  character(len=*), intent(in) :: varname
1287  integer, intent(in) :: value(:)
1288  character(len=*), optional, intent(in) :: desc, units
1289  integer, optional, intent(in) :: default
1290  logical, optional, intent(in) :: layoutparam
1291 ! This subroutine writes the value of an integer parameter to a log file,
1292 ! along with its name and the module it came from.
1293  character(len=1320) :: mesg
1294  character(len=240) :: myunits
1295 
1296  write(mesg, '(" ",a," ",a,": ",A)') trim(modulename), trim(varname), trim(left_ints(value))
1297  if (is_root_pe()) then
1298  if (cs%log_open) write(cs%stdlog,'(a)') trim(mesg)
1299  if (cs%log_to_stdout) write(cs%stdout,'(a)') trim(mesg)
1300  endif
1301 
1302  myunits=" "; if (present(units)) write(myunits(1:240),'(A)') trim(units)
1303  if (present(desc)) &
1304  call doc_param(cs%doc, varname, desc, myunits, value, default, &
1305  layoutparam=layoutparam)
1306 

◆ 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 
)
private

Definition at line 1365 of file MOM_file_parser.F90.

1365  type(param_file_type), intent(in) :: cs
1366  character(len=*), intent(in) :: modulename
1367  character(len=*), intent(in) :: varname
1368  logical, intent(in) :: value
1369  character(len=*), optional, intent(in) :: desc, units
1370  logical, optional, intent(in) :: default
1371  logical, optional, intent(in) :: layoutparam
1372 ! This subroutine writes the value of a logical parameter to a log file,
1373 ! along with its name and the module it came from.
1374  character(len=240) :: mesg, myunits
1375 
1376  if (value) then
1377  write(mesg, '(" ",a," ",a,": True")') trim(modulename), trim(varname)
1378  else
1379  write(mesg, '(" ",a," ",a,": False")') trim(modulename), trim(varname)
1380  endif
1381  if (is_root_pe()) then
1382  if (cs%log_open) write(cs%stdlog,'(a)') trim(mesg)
1383  if (cs%log_to_stdout) write(cs%stdout,'(a)') trim(mesg)
1384  endif
1385 
1386  myunits="Boolean"; if (present(units)) write(myunits(1:240),'(A)') trim(units)
1387  if (present(desc)) &
1388  call doc_param(cs%doc, varname, desc, myunits, value, default, &
1389  layoutparam=layoutparam)
1390 

◆ 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 
)
private

Definition at line 1311 of file MOM_file_parser.F90.

1311  type(param_file_type), intent(in) :: cs
1312  character(len=*), intent(in) :: modulename
1313  character(len=*), intent(in) :: varname
1314  real, intent(in) :: value
1315  character(len=*), optional, intent(in) :: desc, units
1316  real, optional, intent(in) :: default
1317 ! This subroutine writes the value of a real parameter to a log file,
1318 ! along with its name and the module it came from.
1319  character(len=240) :: mesg, myunits
1320 
1321  write(mesg, '(" ",a," ",a,": ",a)') &
1322  trim(modulename), trim(varname), trim(left_real(value))
1323  if (is_root_pe()) then
1324  if (cs%log_open) write(cs%stdlog,'(a)') trim(mesg)
1325  if (cs%log_to_stdout) write(cs%stdout,'(a)') trim(mesg)
1326  endif
1327 
1328  myunits="not defined"; if (present(units)) write(myunits(1:240),'(A)') trim(units)
1329  if (present(desc)) &
1330  call doc_param(cs%doc, varname, desc, myunits, value, default)
1331 

◆ 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 
)
private

Definition at line 1336 of file MOM_file_parser.F90.

1336  type(param_file_type), intent(in) :: cs
1337  character(len=*), intent(in) :: modulename
1338  character(len=*), intent(in) :: varname
1339  real, intent(in) :: value(:)
1340  character(len=*), optional, intent(in) :: desc, units
1341  real, optional, intent(in) :: default
1342 ! This subroutine writes the value of a real parameter to a log file,
1343 ! along with its name and the module it came from.
1344  character(len=1320) :: mesg
1345  character(len=240) :: myunits
1346 
1347  !write(mesg, '(" ",a," ",a,": ",ES19.12,99(",",ES19.12))') &
1348  !write(mesg, '(" ",a," ",a,": ",G,99(",",G))') &
1349  ! trim(modulename), trim(varname), value
1350  write(mesg, '(" ",a," ",a,": ",a)') &
1351  trim(modulename), trim(varname), trim(left_reals(value))
1352  if (is_root_pe()) then
1353  if (cs%log_open) write(cs%stdlog,'(a)') trim(mesg)
1354  if (cs%log_to_stdout) write(cs%stdout,'(a)') trim(mesg)
1355  endif
1356 
1357  myunits="not defined"; if (present(units)) write(myunits(1:240),'(A)') trim(units)
1358  if (present(desc)) &
1359  call doc_param(cs%doc, varname, desc, myunits, value, default)
1360 

◆ 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  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]log_dateIf true, log the time_type in date format.

Definition at line 1424 of file MOM_file_parser.F90.

1424  type(param_file_type), intent(in) :: cs
1425  character(len=*), intent(in) :: modulename
1426  character(len=*), intent(in) :: varname
1427  type(time_type), intent(in) :: value
1428  character(len=*), optional, intent(in) :: desc, units
1429  type(time_type), optional, intent(in) :: default
1430  real, optional, intent(in) :: timeunit
1431  logical, optional, intent(in) :: log_date !< If true, log the time_type in date format.
1432  logical, optional, intent(in) :: layoutparam
1433 
1434  real :: real_time, real_default
1435  logical :: use_timeunit, date_format
1436  character(len=240) :: mesg, myunits
1437  character(len=80) :: date_string, default_string
1438  integer :: days, secs, ticks, ticks_per_sec
1439 
1440  use_timeunit = .false.
1441  date_format = .false. ; if (present(log_date)) date_format = log_date
1442 
1443  call get_time(value, secs, days, ticks)
1444 
1445  if (ticks == 0) then
1446  write(mesg, '(" ",a," ",a," (Time): ",i0,":",i0)') trim(modulename), &
1447  trim(varname), days, secs
1448  else
1449  write(mesg, '(" ",a," ",a," (Time): ",i0,":",i0,":",i0)') trim(modulename), &
1450  trim(varname), days, secs, ticks
1451  endif
1452  if (is_root_pe()) then
1453  if (cs%log_open) write(cs%stdlog,'(a)') trim(mesg)
1454  if (cs%log_to_stdout) write(cs%stdout,'(a)') trim(mesg)
1455  endif
1456 
1457  if (present(desc)) then
1458  if (present(timeunit)) use_timeunit = (timeunit > 0.0)
1459  if (date_format) then
1460  myunits='[date]'
1461 
1462  date_string = convert_date_to_string(value)
1463  if (present(default)) then
1464  default_string = convert_date_to_string(default)
1465  call doc_param(cs%doc, varname, desc, myunits, date_string, &
1466  default=default_string, layoutparam=layoutparam)
1467  else
1468  call doc_param(cs%doc, varname, desc, myunits, date_string, &
1469  layoutparam=layoutparam)
1470  endif
1471  elseif (use_timeunit) then
1472  if (present(units)) then
1473  write(myunits(1:240),'(A)') trim(units)
1474  else
1475  if (abs(timeunit-1.0) < 0.01) then ; myunits = "seconds"
1476  elseif (abs(timeunit-3600.0) < 1.0) then ; myunits = "hours"
1477  elseif (abs(timeunit-86400.0) < 1.0) then ; myunits = "days"
1478  elseif (abs(timeunit-3.1e7) < 1.0e6) then ; myunits = "years"
1479  else ; write(myunits,'(es8.2," sec")') timeunit ; endif
1480  endif
1481  real_time = (86400.0/timeunit)*days + secs/timeunit
1482  if (ticks > 0) real_time = real_time + &
1483  real(ticks) / (timeunit*get_ticks_per_second())
1484  if (present(default)) then
1485  call get_time(default, secs, days, ticks)
1486  real_default = (86400.0/timeunit)*days + secs/timeunit
1487  if (ticks > 0) real_default = real_default + &
1488  real(ticks) / (timeunit*get_ticks_per_second())
1489  call doc_param(cs%doc, varname, desc, myunits, real_time, real_default)
1490  else
1491  call doc_param(cs%doc, varname, desc, myunits, real_time)
1492  endif
1493  else
1494  myunits='not defined'; if (present(units)) write(myunits(1:240),'(A)') trim(units)
1495  call doc_param(cs%doc, varname, desc, myunits, value, default)
1496  endif
1497  endif
1498 

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