15 type(hecmwst_local_mesh),
intent(in) :: hecmesh
16 integer(kind=kint),
intent(in) :: nstep
17 integer(kind=kint),
intent(in) :: sstep
18 integer(kind=kint),
intent(in) :: rtype
19 integer(kind=kint),
intent(in) :: interval
20 real(kind=kreal),
intent(in) :: factor
21 real(kind=kreal),
intent(in) :: ctime
22 real(kind=kreal),
pointer :: temp(:)
23 real(kind=kreal),
pointer :: temp_bak(:)
26 elseif( rtype == 2 )
then
29 write(
idbg,*)
' Read temperature from result file : OK'
35 type(hecmwst_local_mesh),
intent(in) :: hecmesh
36 integer(kind=kint),
intent(in) :: nstep
37 integer(kind=kint),
intent(in) :: sstep
38 integer(kind=kint),
intent(in) :: interval
39 real(kind=kreal),
intent(in) :: factor
40 real(kind=kreal),
pointer :: temp(:)
41 real(kind=kreal),
pointer :: temp_bak(:)
42 type(hecmwst_result_data) :: result
43 character(len=HECMW_NAME_LEN) :: name_id
44 integer(kind=kint) :: i, k0, kt, nstep_active, tstep
47 real(kind=kreal),
pointer :: temp0(:,:)
49 allocate(temp0(2,
size(temp)), stat=i)
51 write(*,*)
'Allocation error: temp0'
52 call hecmw_abort(hecmw_comm_get_comm())
55 nstep_active = (nstep-sstep)/interval + 1
56 kt = floor(factor*dble(nstep_active)-1.d-10)
57 w = factor*dble(nstep_active)-dble(kt)
60 tstep = sstep+(kt+k0-2)*interval
62 do i=1, hecmesh%n_node
63 temp0(k0,i) = temp_bak(i)
72 if (result%nn_component /= 1 .or. result%nn_dof(1) /= 1)
then
73 write(*,*)
' Read temperature result failed; not heat analysis result'
76 do i=1, hecmesh%n_node
77 temp0(k0,i) = result%node_val_item(i)
83 do i=1, hecmesh%n_node
84 temp(i) = (1.d0-w)*temp0(1,i)+w*temp0(2,i)
94 type(hecmwst_local_mesh),
intent(in) :: hecmesh
95 integer(kind=kint),
intent(in) :: nstep
96 integer(kind=kint),
intent(in) :: sstep
97 real(kind=kreal),
intent(in) :: ctime
98 real(kind=kreal),
pointer :: temp(:)
100 logical,
save :: flg_first_call = .true.
101 logical,
save :: flg_constant = .false.
102 logical,
save :: flg_finished = .false.
103 integer(kind=kint),
save :: tstep1, tstep2
104 real(kind=kreal),
save :: ttime1, ttime2
106 integer(kind=kint) :: ierr, i
107 real(kind=kreal) :: w
108 logical :: flg_read1, flg_read2
109 real(kind=kreal),
allocatable :: temp0(:,:)
111 allocate(temp0(2,
size(temp)), stat=ierr)
113 write(*,*)
'Allocation error: temp0'
114 call hecmw_abort(hecmw_comm_get_comm())
119 if (flg_first_call)
then
120 call read_next_result(hecmesh, nstep, sstep, tstep1, ttime1, temp0(1,:), ierr)
123 write(*,*)
' Read temperature result failed; no result file'
124 call hecmw_abort(hecmw_comm_get_comm())
127 call read_next_result(hecmesh, nstep, tstep1+1, tstep2, ttime2, temp0(2,:), ierr)
129 if (ierr /= 0) flg_constant = .true.
131 flg_first_call = .false.
134 if (flg_constant)
then
135 if (.not. flg_read1)
call read_result_at(hecmesh, tstep1, ttime1, temp0(1,:))
136 do i=1, hecmesh%n_node
142 if (ctime <= ttime1)
then
143 if (.not. flg_read1)
call read_result_at(hecmesh, tstep1, ttime1, temp0(1,:))
144 do i=1, hecmesh%n_node
150 do while (ttime2 < ctime)
154 do i=1, hecmesh%n_node
155 temp0(1,i) = temp0(2,i)
160 call read_next_result(hecmesh, nstep, tstep1+1, tstep2, ttime2, temp0(2,:), ierr)
163 flg_finished = .true.
169 if (flg_finished)
then
170 if (.not. flg_read1)
call read_result_at(hecmesh, tstep1, ttime1, temp0(1,:))
171 do i=1, hecmesh%n_node
177 if (.not. flg_read1)
call read_result_at(hecmesh, tstep1, ttime1, temp0(1,:))
178 if (.not. flg_read2)
call read_result_at(hecmesh, tstep2, ttime2, temp0(2,:))
179 w = (ctime - ttime1) / (ttime2 - ttime1)
180 do i=1, hecmesh%n_node
181 temp(i) = (1-w)*temp0(1,i) + w*temp0(2,i)
192 type(hecmwst_local_mesh),
intent(in) :: hecmesh
193 integer(kind=kint),
intent(in) :: tstep
194 real(kind=kreal),
intent(out) :: ttime
195 real(kind=kreal),
intent(out) :: temp(:)
196 type(hecmwst_result_data) :: result
197 character(len=HECMW_NAME_LEN) :: name_id
198 integer(kind=kint) :: i
202 if (result%nn_component /= 1 .or. result%nn_dof(1) /= 1)
then
203 write(*,*)
' Read temperature result failed; not heat analysis result'
205 ttime = result%global_val_item(1)
206 do i=1, hecmesh%n_node
207 temp(i) = result%node_val_item(i)
216 type(hecmwst_local_mesh),
intent(in) :: hecMESH
217 integer(kind=kint),
intent(in) :: nstep
218 integer(kind=kint),
intent(in) :: sstep
219 integer(kind=kint),
intent(out) :: tstep
220 real(kind=kreal),
intent(out) :: ttime
221 real(kind=kreal),
intent(out) :: temp(:)
222 integer(kind=kint),
intent(out) :: ierr
223 character(len=HECMW_NAME_LEN) :: name_ID
224 integer(kind=kint) :: istep
227 do istep = sstep, nstep
subroutine, public hecmw_result_checkfile_by_name(name_ID, i_step, ierr)
subroutine, public hecmw_result_read_by_name(hecMESH, name_ID, i_step, result)
subroutine, public hecmw_nullify_result_data(P)
subroutine, public hecmw_result_free(result_data)
This module defines common data and basic structures for analysis.
integer(kind=kint), parameter idbg
subroutine read_next_result(hecMESH, nstep, sstep, tstep, ttime, temp, ierr)
subroutine read_temperature_result_by_step(hecMESH, nstep, sstep, interval, factor, temp, temp_bak)
subroutine read_temperature_result_by_time(hecMESH, nstep, sstep, ctime, temp)
Read in temperature distribution from external file.
subroutine read_result_at(hecMESH, tstep, ttime, temp)
subroutine, public read_temperature_result(hecMESH, nstep, sstep, rtype, interval, factor, ctime, temp, temp_bak)
Read in temperature distribution from external file.