# Outputting time (or iteration count)¶

Outputs the timestamp information or the iteration count to the CGNS file.

Be sure to perform this before outputting the calculation grid or calculation results.

Also note that the time and iteration-count information cannot be output at the same time. Output either, not both.

Subroutine |
Remarks |
---|---|

cg_iric_write_sol_start |
Starts outputting calculation results |

cg_iric_write_sol_end |
Ends outputting calculation results |

cg_iric_write_sol_time |
Outputs time |

cg_iric_write_sol_iteration |
Outputs iteration count |

List 100 shows an example of source code to output timestamp information.

```
1program Sample4
2 use iric
3 implicit none
4
5 integer:: fin, ier, i
6 double precision:: time
7
8 ! Open CGNS file.
9 call cg_iric_open('test.cgn', IRIC_MODE_MODIFY, fin, ier)
10 if (ier /=0) STOP "*** Open error of CGNS file ***"
11
12 ! Output the initial state information.
13 time = 0
14
15 call cg_iric_write_sol_start(fin, ier)
16 call cg_iric_write_sol_time(fin, time, ier)
17 ! (Here, output initial calculation grid or calculation results.)
18 call cg_iric_write_sol_end(fin, ier)
19
20 do
21 time = time + 10.0
22 ! (Perform calculation here.)
23 call cg_iric_write_sol_start(fin, ier)
24 call cg_iric_write_sol_time(fin, time, ier)
25 ! (Here, output calculation grid or calculation results.)
26 call cg_iric_write_sol_end(fin, ier)
27 If (time > 1000) exit
28 end do
29
30 ! Close CGNS file.
31 call cg_iric_close(fin, ier)
32 stop
33end program Sample4
```