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_time_f |
Outputs time |
cg_iric_write_sol_iteration_f |
Outputs iteration count |
List 100 shows an example of source code to output timestamp information.
1program Sample4
2 implicit none
3 include 'cgnslib_f.h'
4
5 integer:: fin, ier, i
6 double precision:: time
7
8 ! Open CGNS file.
9 call cg_open_f('test.cgn', CG_MODE_MODIFY, fin, ier)
10 if (ier /=0) STOP "*** Open error of CGNS file ***"
11
12 ! Initialize iRIClib.
13 call cg_iric_init_f(fin, ier)
14 if (ier /=0) STOP "*** Initialize error of CGNS file ***"
15
16 ! Output the initial state information.
17 time = 0
18
19 call cg_iric_write_sol_time_f(time, ier)
20 ! (Here, output initial calculation grid or calculation results.)
21
22 do
23 time = time + 10.0
24 ! (Perform calculation here.)
25 call cg_iric_write_sol_time_f(time, ier)
26 ! (Here, output calculation grid or calculation results.)
27 If (time > 1000) exit
28 end do
29
30 ! Close CGNS file.
31 call cg_close_f(fin, ier)
32 stop
33end program Sample4