31 real,
dimension(:,:,:),
pointer:: ux=>null(), uy=>null(), uz=>null()
35 procedure:: pre_update
36 procedure:: post_update
43 SUBROUTINE init (self, link)
47 call trace%begin (
'forces_t%init')
48 self%patch => task2patch(link%task)
49 call self%force%init (self%patch%kind, self%patch%id, self%patch%mesh)
56 SUBROUTINE dealloc (self)
59 call trace%begin (
'forces_t%dealloc')
60 call self%force%dealloc
62 END SUBROUTINE dealloc
67 SUBROUTINE pre_update (self)
70 real,
dimension(:,:,:),
pointer:: d
71 real,
dimension(:,:,:,:),
pointer:: p
75 associate(patch => self%patch, m => self%patch%gn)
76 d => patch%mem(:,:,:,patch%idx%d,patch%it,1)
77 p => patch%mem(:,:,:,patch%idx%px:patch%idx%pz,patch%it,1)
78 if (.not.
allocated(patch%force_per_unit_mass))
then 79 allocate (patch%force_per_unit_mass(m(1),m(2),m(3),3))
80 call io%bits_mem (storage_size(patch%force_per_unit_mass), &
81 product(shape(patch%force_per_unit_mass)),
'fpm')
83 patch%force_per_unit_mass = &
84 self%force%selected(patch%time, d, p, self%Ux, self%Uy, self%Uz, patch%mesh)
86 END SUBROUTINE pre_update
91 SUBROUTINE post_update (self)
94 if (
allocated(self%patch%force_per_unit_mass))
then 95 call io%bits_mem (-storage_size(self%patch%force_per_unit_mass), &
96 product(shape(self%patch%force_per_unit_mass)),
'-fpm')
97 deallocate (self%patch%force_per_unit_mass)
99 END SUBROUTINE post_update
This is a bare minimum interface to the new extras module, showing how to interface with a pre-existi...
Template module for patches, which adds pointers to memory and mesh, and number of dimensions and var...
Module with list handling for generic class task_t objects.
Simple forcing module for tests.