Save time-serie results.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in), | optional | :: | title | Plot title. |
|
character(len=*), | intent(in), | optional | :: | filename | Output filename. |
|
logical, | intent(in), | optional | :: | finish | Flag for triggering the file closing. |
|
real(kind=R_P), | intent(in) | :: | t | Current integration time. |
Nodes of different colours represent the following:
Solid arrows point from a procedure to one which it calls. Dashed arrows point from an interface to procedures which implement that interface. This could include the module procedures in a generic interface or the implementation in a submodule of an interface in a parent module.
Nodes of different colours represent the following:
Solid arrows point from a procedure to one which it calls. Dashed arrows point from an interface to procedures which implement that interface. This could include the module procedures in a generic interface or the implementation in a submodule of an interface in a parent module.
subroutine save_time_serie(title, filename, finish, t)
!---------------------------------------------------------------------------------------------------------------------------------
!< Save time-serie results.
!---------------------------------------------------------------------------------------------------------------------------------
character(*), intent(IN), optional :: title !< Plot title.
character(*), intent(IN), optional :: filename !< Output filename.
logical, intent(IN), optional :: finish !< Flag for triggering the file closing.
real(R_P), intent(IN) :: t !< Current integration time.
integer(I_P), save :: tsfile !< File unit for saving time serie results.
integer(I_P) :: i !< Counter.
integer(I_P) :: v !< Counter.
!---------------------------------------------------------------------------------------------------------------------------------
!---------------------------------------------------------------------------------------------------------------------------------
if (time_serie) then
final_state = domain%output()
if (present(filename).and.present(title)) then
open(newunit=tsfile, file=filename)
write(tsfile, '(A)')'# '//title
endif
write(tsfile, '(A)')'# VARIABLES: "x" "rho(1)" "rho(2)"... "rho(Ns)" "u" "p" "rho" "gamma"'
write(tsfile, '(A)')'# Time: '//str(n=t)
do i=1, Ni
write(tsfile, '('//trim(str(.true.,Np+1))//'('//FR_P//',1X))')x(i), (final_state(v, i), v=1, Np)
enddo
if (present(finish)) then
if (finish) close(tsfile)
endif
endif
return
!---------------------------------------------------------------------------------------------------------------------------------
endsubroutine save_time_serie