Add Z resolved output files
This commit is contained in:
parent
367a39db00
commit
535797ce7e
1 changed files with 86 additions and 40 deletions
|
|
@ -13,6 +13,7 @@ module output
|
||||||
integer, parameter:: dataF_id = 30
|
integer, parameter:: dataF_id = 30
|
||||||
integer, parameter:: dataPhi_id = 40
|
integer, parameter:: dataPhi_id = 40
|
||||||
integer, parameter:: dataCum_id = 50
|
integer, parameter:: dataCum_id = 50
|
||||||
|
character(len=*), parameter :: formatInt = 'I10'
|
||||||
character(len=7), parameter:: formatFloat = 'ES0.6e3'
|
character(len=7), parameter:: formatFloat = 'ES0.6e3'
|
||||||
character(len=3), parameter:: formatSep = '","'
|
character(len=3), parameter:: formatSep = '","'
|
||||||
character(len=7):: formatTime
|
character(len=7):: formatTime
|
||||||
|
|
@ -41,27 +42,37 @@ module output
|
||||||
|
|
||||||
end subroutine createPath
|
end subroutine createPath
|
||||||
|
|
||||||
subroutine writeOutputF(t, dt, nr, r, nv, v, f)
|
subroutine writeOutputF(t, dt, nz, nr, r, nv, v, f, Z_list)
|
||||||
use referenceValues, only: L_ref, n_ref, u_ref, t_ref
|
use referenceValues, only: L_ref, n_ref, u_ref, t_ref
|
||||||
|
|
||||||
integer, intent(in):: t
|
integer, intent(in):: t
|
||||||
integer, intent(in):: nr, nv
|
integer, intent(in):: nz, nr, nv
|
||||||
real(dp), intent(in):: dt
|
real(dp), intent(in):: dt
|
||||||
real(dp), intent(in):: r(1:nr)
|
real(dp), intent(in):: r(1:nr)
|
||||||
real(dp), intent(in):: v(1:nv)
|
real(dp), intent(in):: v(1:nv)
|
||||||
real(dp), intent(in):: f(1:nr,1:nv)
|
real(dp), intent(in):: f(1:nr,1:nv)
|
||||||
|
real(dp), intent(in):: Z_list(1:nz)
|
||||||
character(len=30) :: myfmt
|
character(len=30) :: myfmt
|
||||||
character(:), allocatable:: filename
|
character(:), allocatable:: filename
|
||||||
integer:: i
|
integer:: i, j
|
||||||
character(len=10):: timeString
|
character(len=10):: timeString
|
||||||
|
character(len=10) :: ZString
|
||||||
|
|
||||||
|
do j = 1, nz
|
||||||
write (timeString, formatTime) t
|
write (timeString, formatTime) t
|
||||||
filename = 'time_' // trim(timeString) // '_f_i.csv'
|
write(ZString, '(F6.3)') Z_list(j)
|
||||||
|
ZString = adjustl(trim(ZString))
|
||||||
|
|
||||||
|
ZString = adjustl(ZString)
|
||||||
|
ZString = ZString(:index(ZString // '.', '.') - 1) // ZString(index(ZString, '.') + 1:)
|
||||||
|
filename = 'time_' // trim(timeString) // '_Z' // trim(ZString) // '_f_i.csv'
|
||||||
write (*, '(A, A)') 'Writing: ', filename
|
write (*, '(A, A)') 'Writing: ', filename
|
||||||
|
|
||||||
open(unit=dataF_id, file=pathOutput // filename)
|
open(unit=dataF_id, file=pathOutput // filename)
|
||||||
write(dataF_id, '(A)') "t (s)"
|
write(dataF_id, '(A)') "t (s)"
|
||||||
write(dataF_id, '('//formatFloat//')') t*dt*t_ref
|
write(dataF_id, '('//formatFloat//')') t*dt*t_ref
|
||||||
|
write(dataPhi_id, '(A)') "Z"
|
||||||
|
write(dataPhi_id, '('//formatFloat//')') Z_list(j)
|
||||||
write(myfmt, "(I0)") nr
|
write(myfmt, "(I0)") nr
|
||||||
myfmt = '(A,' // trim(myfmt) // '(' // formatSep // ',' // formatFloat // '))'
|
myfmt = '(A,' // trim(myfmt) // '(' // formatSep // ',' // formatFloat // '))'
|
||||||
write(dataF_id, myfmt) "v (m/s) / r (m)", r*L_ref
|
write(dataF_id, myfmt) "v (m/s) / r (m)", r*L_ref
|
||||||
|
|
@ -73,6 +84,7 @@ module output
|
||||||
end do
|
end do
|
||||||
|
|
||||||
close(unit=dataF_id)
|
close(unit=dataF_id)
|
||||||
|
end do
|
||||||
|
|
||||||
end subroutine writeOutputF
|
end subroutine writeOutputF
|
||||||
|
|
||||||
|
|
@ -133,8 +145,8 @@ module output
|
||||||
|
|
||||||
do j = 1, nz
|
do j = 1, nz
|
||||||
write (timeString, formatTime) t
|
write (timeString, formatTime) t
|
||||||
write(ZString, '(F6.3)') Z_list(j) ! Format Z_list(j) with 3 decimal places
|
write(ZString, '(F6.3)') Z_list(j)
|
||||||
ZString = adjustl(trim(ZString)) ! Remove leading spaces
|
ZString = adjustl(trim(ZString))
|
||||||
|
|
||||||
ZString = adjustl(ZString)
|
ZString = adjustl(ZString)
|
||||||
ZString = ZString(:index(ZString // '.', '.') - 1) // ZString(index(ZString, '.') + 1:)
|
ZString = ZString(:index(ZString // '.', '.') - 1) // ZString(index(ZString, '.') + 1:)
|
||||||
|
|
@ -187,6 +199,29 @@ module output
|
||||||
|
|
||||||
end subroutine writeOutputBoundary
|
end subroutine writeOutputBoundary
|
||||||
|
|
||||||
|
subroutine writeOutputTime(t, time)
|
||||||
|
integer, intent(in):: t
|
||||||
|
real(dp), intent(in):: time
|
||||||
|
character(len=8), parameter:: filename = 'time.csv'
|
||||||
|
logical:: res
|
||||||
|
|
||||||
|
inquire(file=pathOutput // filename, exist=res)
|
||||||
|
if (.not. res) then
|
||||||
|
write (*, '(A, A)') 'Writing: ', filename
|
||||||
|
open(unit=dataBC_id, file=pathOutput // filename, action='write', position='append')
|
||||||
|
write(dataBC_id, '(A,1(' // formatSep // ',A))') 'timestep', 'duration (s)'
|
||||||
|
close(dataBC_id)
|
||||||
|
|
||||||
|
end if
|
||||||
|
|
||||||
|
open(unit=dataBC_id, file=pathOutput // filename, action='write', position='append')
|
||||||
|
write(dataBC_id, '(' // formatInt // ',' // formatSep // ',' // formatFloat // ')') &
|
||||||
|
t, time
|
||||||
|
|
||||||
|
close(dataBC_id)
|
||||||
|
|
||||||
|
end subroutine writeOutputTime
|
||||||
|
|
||||||
subroutine writeOutputRef()
|
subroutine writeOutputRef()
|
||||||
use referenceValues, only: t_ref, L_ref, n_ref, u_ref, Temp_ref, phi_ref
|
use referenceValues, only: t_ref, L_ref, n_ref, u_ref, Temp_ref, phi_ref
|
||||||
use constantParameters, only: eV_to_K
|
use constantParameters, only: eV_to_K
|
||||||
|
|
@ -205,39 +240,50 @@ module output
|
||||||
|
|
||||||
end subroutine writeOutputRef
|
end subroutine writeOutputRef
|
||||||
|
|
||||||
subroutine writeOutputFCum(t, dt, r, nv, v, f)
|
subroutine writeOutputFCum(t, dt, nz, r, nv, v, f, Z_list)
|
||||||
use referenceValues, only: L_ref, n_ref, u_ref, t_ref
|
use referenceValues, only: L_ref, n_ref, u_ref, t_ref
|
||||||
|
|
||||||
integer, intent(in):: t
|
integer, intent(in):: t
|
||||||
real(dp), intent(in):: dt
|
real(dp), intent(in):: dt
|
||||||
integer, intent(in):: nv
|
integer, intent(in):: nz, nv
|
||||||
real(dp), intent(in):: r
|
real(dp), intent(in):: r
|
||||||
real(dp), intent(in):: v(1:nv)
|
real(dp), intent(in):: v(1:nv)
|
||||||
real(dp), intent(in):: f(1:nv)
|
real(dp), intent(in):: f(1:nz, 1:nv)
|
||||||
|
real(dp), intent(in):: Z_list(1:nz)
|
||||||
character(len=30) :: myfmt
|
character(len=30) :: myfmt
|
||||||
character(:), allocatable:: filename
|
character(:), allocatable:: filename
|
||||||
integer:: i
|
integer:: i, j
|
||||||
character(len=10):: timeString
|
character(len=10):: timeString
|
||||||
|
character(len=10) :: ZString
|
||||||
|
|
||||||
|
|
||||||
|
do j = 1, nz
|
||||||
write (timeString, formatTime) t
|
write (timeString, formatTime) t
|
||||||
filename = 'time_' // trim(timeString) // '_fCum_i.csv'
|
write(ZString, '(F6.3)') Z_list(j)
|
||||||
|
ZString = adjustl(trim(ZString))
|
||||||
|
|
||||||
|
ZString = adjustl(ZString)
|
||||||
|
ZString = ZString(:index(ZString // '.', '.') - 1) // ZString(index(ZString, '.') + 1:)
|
||||||
|
filename = 'time_' // trim(timeString) // '_Z' // trim(ZString) // '_fCum_i.csv'
|
||||||
write (*, '(A, A)') 'Writing: ', filename
|
write (*, '(A, A)') 'Writing: ', filename
|
||||||
|
|
||||||
open(unit=dataCum_id, file=pathOutput // filename)
|
open(unit=dataCum_id, file=pathOutput // filename)
|
||||||
write(dataCum_id, '(A)') "t (s)"
|
write(dataCum_id, '(A)') "t (s)"
|
||||||
write(dataCum_id, '('//formatFloat//')') t*dt*t_ref
|
write(dataCum_id, '('//formatFloat//')') t*dt*t_ref
|
||||||
|
write(dataPhi_id, '(A)') "Z"
|
||||||
|
write(dataPhi_id, '('//formatFloat//')') Z_list(j)
|
||||||
write(myfmt, "(I0)") 1
|
write(myfmt, "(I0)") 1
|
||||||
myfmt = '(A,' // trim(myfmt) // '(' // formatSep // ',' // formatFloat // '))'
|
myfmt = '(A,' // trim(myfmt) // '(' // formatSep // ',' // formatFloat // '))'
|
||||||
write(dataCum_id, myfmt) "v (m/s) / r (m)", r*L_ref
|
write(dataCum_id, myfmt) "v (m/s) / r (m)", r*L_ref
|
||||||
write(myfmt, "(I0)") 1
|
write(myfmt, "(I0)") 1
|
||||||
myfmt = '(' // formatFloat // ',' // trim(myfmt) // '(' // formatSep // ',' // formatFloat // '))'
|
myfmt = '(' // formatFloat // ',' // trim(myfmt) // '(' // formatSep // ',' // formatFloat // '))'
|
||||||
do i = 1, nv
|
do i = 1, nv
|
||||||
write(dataCum_id, myfmt) v(i)*u_ref, f(i)*n_ref/u_ref
|
write(dataCum_id, myfmt) v(i)*u_ref, f(j,i)*n_ref/u_ref
|
||||||
|
|
||||||
end do
|
end do
|
||||||
|
|
||||||
close(unit=dataCum_id)
|
close(unit=dataCum_id)
|
||||||
|
end do
|
||||||
end subroutine writeOutputFCum
|
end subroutine writeOutputFCum
|
||||||
|
|
||||||
end module output
|
end module output
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue