Skip to content

Instantly share code, notes, and snippets.

@t-nissie
Last active August 29, 2015 14:03
Show Gist options
  • Save t-nissie/991dba9fd80b56f35e9f to your computer and use it in GitHub Desktop.
Save t-nissie/991dba9fd80b56f35e9f to your computer and use it in GitHub Desktop.
COUNT_RATE and COUNT_MAX of SYSTEM_CLOCK() in Fortran

COUNT_RATE and COUNT_MAX of SYSTEM_CLOCK() in Fortran

In Fortran, SYSTEM_CLOCK() internal subroutine is commonly used for timing. However, on some platforms, it is difficult to measure a time interval longer than one day, bucause the counter is reset once a day.

Here is a list of COUNT_RATE and COUNT_MAX from CALL SYSTEM_CLOCK(COUNT, COUNT_RATE, COUNT_MAX) on various platforms.

Platform COUNT_RATE COUNT_MAX
Linux 2.6.32 with gfortran 4.9.0 1000 2147483647
Mac OS X 10.9.4 with gfortran 4.8.2 1000 2147483647
SR16000: AIX 7.1 with XL Fortran 14.01 100 8639999
FX10: Linux 2.6 with frtpx 1.2.1 1000 86399999

cf. 2**31=2147483648, 1 day = 86400 second

On SR16000, it seems that the counter of system_clock starts at 00:00:00 of local time. What will happen when they do intercalation of a leap second?

Gist

This document is placed at https://gist.github.com/t-nissie/991dba9fd80b56f35e9f . You can clone it with git clone https://gist.github.com/991dba9fd80b56f35e9f.git system_clock or git clone git@gist.github.com:991dba9fd80b56f35e9f.git system_clock.

# -*-Makefile-*-
##
MD = 00Fortran_system_clock.md
all: index.html
index.html: $(MD)
gfm2html.rb --readme -l ja -n 'Takeshi Nishimatsu' -s style.css $(MD) > $@
clean:
rm -f index.html
/* -*-CSS-*-
* style.css for README.html of feram
* Time-stamp: <2014-07-14 13:44:59 takeshi>
* Author: Takeshi NISHIMATSU
*/
body {
color: black;
font-family: verdana, arial, helvetica, sans-serif;
}
h1, h2, h3, h4, h6 {
font-family: verdana, arial, helvetica, sans-serif;
}
h1 {
color: #dd0000;
background-color: #fff0f0;
font-size: 240%;
}
h2 {
border-top: red 5px solid;
border-bottom: red 1px solid;
padding-left: 8px;
background-color: #fff0f0;
}
h3 {
border-top: red 2px solid;
border-bottom: red 1px solid;
padding-left: 4px;
}
h4 {
border-top: red 1px solid;
padding-left: 4px;
background-color: #fff0f0;
}
h5 {
font-size: larger;
font-family: courier, verdana, arial, helvetica, sans-serif;
padding-top: 10px;
color: darkred;
}
pre {
font-family: monospace, courier, verdana, arial, helvetica, sans-serif;
padding-right: 0.5em;
padding-left: 0.5em;
padding-top: 0.1ex;
padding-bottom: 0.1ex;
margin-left: 0.5em;
margin-right: 1.0em;
white-space: pre;
color: darkred;
background-color: #f3f3f3;
}
p img {
width: 60%;
margin: auto;
display: block;
}
div.figure div.figcaption {
width: 60%;
margin: auto;
display: block;
}
div.navi {
text-align: right;
margin-right: 1.0em;
}
div.contents {
margin-left: 10%;
}
img{
width: 30%;
margin: auto;
margin-top: 3.0em;
display: block;
}
figure figcaption{
width: 60%;
margin: auto;
margin-bottom: 3.0em;
display: block;
}
table{
border-top: 1px solid;
border-left: 1px solid;
border-collapse: collapse;
border-spacing: 0;
empty-cells: show;
text-align: center;
margin: auto;
}
th{
border-right: 1px solid;
border-bottom: 1px solid;
background-color: #fff0f0;
padding: 0.3em 1em;
}
td{
border-right: 1px solid;
border-bottom: 1px solid;
padding: 0.3em 1em;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment