28 class(
list_t),
pointer:: task_list => null()
31 procedure,
nopass:: cast2gpatch
32 procedure:: init_task_list
37 procedure:: counter_update
39 procedure:: courant_condition
44 procedure:: gas_pressure => void_fun
45 procedure:: compression_magnitude => void_sub
46 procedure:: vorticity_magnitude => void_sub
47 procedure:: gas_velocity_scalar => void_fun1
48 procedure:: gas_velocity_vector => void_fun3
49 generic:: gas_velocity => gas_velocity_scalar, gas_velocity_vector
51 real(8),
save :: restart_time = 0d0
52 logical,
save :: detailed_timer=.false.
53 integer,
save :: verbose=0
54 integer,
save :: order=1
61 FUNCTION cast2gpatch (task)
RESULT(gpatch)
62 class(
task_t),
pointer:: task
70 call io%abort (
'gpatch_t%cast: failed to cast a task to patch_t')
72 END FUNCTION cast2gpatch
77 SUBROUTINE init_task_list (self, task_list)
79 class(
list_t),
pointer:: task_list
81 call trace%begin (
'gpatch_t%init_task_list')
82 self%task_list => task_list
84 END SUBROUTINE init_task_list
89 SUBROUTINE update (self)
92 call self%patch_t%update
99 SUBROUTINE input (self, ok)
103 call data_io%input (self, ok)
109 SUBROUTINE output (self)
112 call data_io%output (self)
113 END SUBROUTINE output
125 SUBROUTINE init (self)
127 real(kind=KindScalarVar),
pointer :: ff(:,:,:,:)
128 character(len=64) :: filename
130 real(kind=KindScalarVar),
pointer :: d(:,:,:)
132 if (self%is_set(bits%frozen)) &
134 call trace%begin (
'gpatch_t%init')
135 call self%initial%init (self%kind,
real(self%gamma))
136 call data_io%init (self)
137 call guard_zones%init
143 restart_time = self%time
153 ff => self%mem(:,:,:,:,1,1)
154 call self%initial%condition (self%mesh, ff, self%idx)
167 if (restart_time > 0d0)
then 168 call self%lock%set (
'gpatch_t')
169 self%time = restart_time
170 self%t(self%it) = self%time
171 self%out_next = (int(self%time/io%out_time+1.0e-4)+1)*io%out_time
172 self%iout = self%restart+1
174 write (filename,
'(a,i5.5,"/")') trim(io%outputname), self%iout
175 if (io%iodir/=self%iout)
call os%mkdir (trim(filename))
178 call self%lock%unset (
'gpatch_t')
187 SUBROUTINE counter_update (self)
190 call trace%begin (
'gpatch_t%counter_update')
192 timer%n_update = timer%n_update + product(self%n)
194 END SUBROUTINE counter_update
200 SUBROUTINE dnload (self, only)
202 integer,
optional:: only
204 call trace%begin (
'gpatch_t%dnload')
205 if (self%is_clear (bits%frozen))
then 206 if (self%use_data_hub)
then 207 call self%data_hub%update (self%link, only=only)
209 call download%download_link (self%link, only=only)
213 END SUBROUTINE dnload
218 SUBROUTINE courant_condition (self, detailed_timer)
220 logical,
optional:: detailed_timer
222 call trace%begin (
'gpatch_t%courant_condition')
223 call validate%check (self%link, self%u_max,
'courant')
224 call self%patch_t%courant_condition (detailed_timer)
226 END SUBROUTINE courant_condition
231 SUBROUTINE void_sub (self, w)
233 real,
dimension(:,:,:):: w
235 w = self%mem(:,:,:,1,1,1)
236 END SUBROUTINE void_sub
239 FUNCTION void_fun (self)
RESULT (pg)
241 real,
dimension(self%gn(1),self%gn(2),self%gn(3)):: pg
243 pg = self%mem(:,:,:,1,1,1)
244 END FUNCTION void_fun
247 FUNCTION void_fun1 (self, idir)
RESULT (v)
250 real(4),
dimension(self%gn(1),self%gn(2),self%gn(3)):: v
252 v = self%mem(:,:,:,1,1,1)
253 END FUNCTION void_fun1
256 FUNCTION void_fun3 (self)
RESULT (v)
258 real(4),
dimension(self%gn(1),self%gn(2),self%gn(3),3):: v
260 v = self%mem(:,:,:,1,1:3,1)
261 END FUNCTION void_fun3
Each thread uses a private timer data type, with arrays for start time and total time for each regist...
download_link: takes care of downloads to linktask same: called for patches on the same level differ:...
A communications hub between patches. Three methods are used: download_same, download_higher and down...
The gpath_t layer now essentially only handles restarts.
Support tic/toc timing, as in MATLAB, and accurate wallclock() function. The timing is generally much...
Generic validation module. The general idea is to be able to compare two runs at critical points in t...
Module with list handling for generic class task_t objects.
Interface from gpatch_mod to a choice of binary data I/O methods, controlled by the iomethod text str...
Template module for patches, which adds pointers to memory and mesh, and number of dimensions and var...
Fundamental constants in CGS and SI units.
Template module for mesh.
Simple initical condition module for tests.
Optimized restrict operations, intended for guard zones (not conservative)
Template module for tasks.