FE-Project
Loading...
Searching...
No Matches
mod_atmos_phy_preproc.F90
Go to the documentation of this file.
1!-------------------------------------------------------------------------------
2!> module Atmosphere / Physics / Preprocessing
3!!
4!! @par Description
5!! A module to provide preprocessing operations for variables before evaluating physics tendencies
6!!
7!! @author Yuta Kawai, Team SCALE
8!!
9!<
10!-------------------------------------------------------------------------------
11#include "scaleFElib.h"
13 !-----------------------------------------------------------------------------
14 !
15 !++ Used modules
16 !
17 use scale_precision
18 use scale_io
19 use scale_prc
20 use scale_tracer, only: qa
21
22 use scale_element_base, only: &
26 use scale_localmeshfield_base, only: &
30
31 use scale_meshfield_base, only: &
33
35 prgvar_num, auxvar_num, phytend_num1 => phytend_num, &
42
45
49
50 !-----------------------------------------------------------------------------
51 implicit none
52 private
53
54 !-----------------------------------------------------------------------------
55 !
56 !++ Public type & procedures
57 !
58
59 !> Base type for preprocessing operations for variables before evaluating physics tendencies
60 type, abstract, public :: physpreprocbase
61 class(meshbase3d), pointer :: mesh3d
62 contains
63 procedure(physpreprocmodalbase_operate), public, deferred :: operate
64 procedure(physpreprocmodalbase_final), public, deferred :: final
65 end type physpreprocbase
66 abstract interface
67 subroutine physpreprocmodalbase_operate( this, &
68 PRG_VARS, QTRC_VARS, AUX_VARS, &
69 PRG_VARS0, QTRC_VARS0, AUX_VARS0 )
70 import physpreprocbase
71 import meshfield3d
72 import prgvar_num
73 import auxvar_num
74 import qa
75 class(physpreprocbase), intent(inout) :: this
76 type(meshfield3d), intent(inout) :: PRG_VARS(PRGVAR_NUM)
77 type(meshfield3d), intent(inout) :: AUX_VARS(AUXVAR_NUM)
78 type(meshfield3d), intent(inout) :: QTRC_VARS(0:QA)
79 type(meshfield3d), intent(in) :: PRG_VARS0(PRGVAR_NUM)
80 type(meshfield3d), intent(in) :: AUX_VARS0(AUXVAR_NUM)
81 type(meshfield3d), intent(in) :: QTRC_VARS0(0:QA)
82 end subroutine physpreprocmodalbase_operate
83
84 subroutine physpreprocmodalbase_final( this )
85 import physpreprocbase
86 class(physpreprocbase), intent(inout) :: this
87 end subroutine physpreprocmodalbase_final
88 end interface
89
90 !> Derived type to represent no preprocessing operation for variables before evaluating physics tendencies
91 type, extends(physpreprocbase), public :: physpreprocnone
92 contains
93 procedure :: init => physpreprocnone_init
94 procedure :: final => physpreprocnone_final
95 procedure :: operate => physpreprocnone_operate
96 end type physpreprocnone
97
98 !> Derived type to represent modal filtering operation for variables before evaluating physics tendencies
99 type, extends(physpreprocbase), public :: physpreprocmodalfilter
100 type(modalfilter) :: mfilter
101 class(elementoperationtensorprod3d), allocatable :: elem_optr
102 contains
103 procedure :: init => physpreprocmodalfilter_init
104 procedure :: final => physpreprocmodalfilter_final
105 procedure :: operate => physpreprocmodalfilter_operate
107
108 !> Derived type to represent quasi-global filtering operation for variables before evaluating physics tendencies
109 type, extends(physpreprocbase), public :: physpreprocglobalfilter
110 type(meshfieldfilteroperation3d) :: gfilter_prgvar
111 type(meshfieldfilteroperation3d) :: gfilter_trcvar
112 type(meshfield3d), allocatable :: rhoq(:)
113 contains
114 procedure :: init => physpreprocglobalfilter_init
115 procedure :: final => physpreprocglobalfilter_final
116 procedure :: operate => physpreprocglobalfilter_operate
118
119
120 !-----------------------------------------------------------------------------
121 !
122 !++ Public parameters & variables
123 !
124 !-----------------------------------------------------------------------------
125 !
126 !++ Private procedures & variables
127 !
128contains
129!--
130 !> Initialize an object to represent no preprocessing operation before evaluating physics tendencies
131!OCL SERIAL
132 subroutine physpreprocnone_init( this, mesh3D )
133 implicit none
134 class(physpreprocnone), intent(inout) :: this
135 class(meshbase3d), intent(in), target :: mesh3D
136 !----------------------------------------------------
137 this%mesh3D => mesh3d
138 return
139 end subroutine physpreprocnone_init
140
141 !> Finalize an object to represent no preprocessing operation before evaluating physics tendencies
142!OCL SERIAL
143 subroutine physpreprocnone_final( this )
144 implicit none
145 class(physpreprocnone), intent(inout) :: this
146 !----------------------------------------------------
147 return
148 end subroutine physpreprocnone_final
149
150 !> Perform no preprocessing operation before evaluating physics tendencies
151 !! This subroutine simply copies the input variables to the output variables without any modification.
152!OCL SERIAL
153 subroutine physpreprocnone_operate( this, &
154 PRG_VARS, QTRC_VARS, AUX_VARS, &
155 PRG_VARS0, QTRC_VARS0, AUX_VARS0 )
156 use scale_tracer, only: qa
157 implicit none
158 class(physpreprocnone), intent(inout) :: this
159 type(meshfield3d), intent(inout) :: PRG_VARS(PRGVAR_NUM)
160 type(meshfield3d), intent(inout) :: AUX_VARS(AUXVAR_NUM)
161 type(meshfield3d), intent(inout) :: QTRC_VARS(0:QA)
162 type(meshfield3d), intent(in) :: PRG_VARS0(PRGVAR_NUM)
163 type(meshfield3d), intent(in) :: AUX_VARS0(AUXVAR_NUM)
164 type(meshfield3d), intent(in) :: QTRC_VARS0(0:QA)
165
166 integer :: n
167 integer :: iq, iqs
168 !----------------------------------------------------
169
170 do n=1, this%mesh3D%LOCAL_MESH_NUM
171 call copy_data( &
172 prg_vars(prgvar_ddens_id)%local(n)%val, prg_vars(prgvar_momx_id)%local(n)%val, prg_vars(prgvar_momy_id)%local(n)%val, prg_vars(prgvar_momz_id)%local(n)%val, prg_vars(prgvar_therm_id)%local(n)%val, & ! (inout)
173 aux_vars(auxvar_denshydro_id)%local(n)%val, aux_vars(auxvar_preshydro_id)%local(n)%val, & ! (inout)
174 prg_vars0(prgvar_ddens_id)%local(n)%val, prg_vars0(prgvar_momx_id)%local(n)%val, prg_vars0(prgvar_momy_id)%local(n)%val, prg_vars0(prgvar_momz_id)%local(n)%val, prg_vars0(prgvar_therm_id)%local(n)%val, & ! (in)
175 aux_vars0(auxvar_denshydro_id)%local(n)%val, aux_vars0(auxvar_preshydro_id)%local(n)%val, & ! (in)
176 this%mesh3D%lcmesh_list(n), this%mesh3D%refElem3D ) ! (in)
177 end do
178
179 if ( qa == 0 ) then
180 iqs = 0
181 else
182 iqs = 1
183 end if
184 do iq=iqs, qa
185 do n=1, this%mesh3D%LOCAL_MESH_NUM
186 call copy_data_qtrc( qtrc_vars(iq)%local(n)%val, & ! (inout)
187 qtrc_vars0(iq)%local(n)%val, aux_vars(auxvar_denshydro_id)%local(n)%val, prg_vars(prgvar_ddens_id)%local(n)%val, & ! (in)
188 this%mesh3D%lcmesh_list(n), this%mesh3D%refElem3D ) ! (in)
189 end do
190 end do
191 return
192 end subroutine physpreprocnone_operate
193
194!--------------------------------------------
195 !> Initialize an object to represent modal filtering operation before evaluating physics tendencies
196!OCL SERIAL
197 subroutine physpreprocmodalfilter_init( this, &
198 MF_ALPHA_h, MF_ORDER_h, MF_ALPHA_v, MF_ORDER_v, &
199 mesh3D )
200 implicit none
201 class(physpreprocmodalfilter), intent(inout) :: this
202 real(RP), intent(in) :: MF_ALPHA_h
203 integer, intent(in) :: MF_ORDER_h
204 real(RP), intent(in) :: MF_ALPHA_v
205 integer, intent(in) :: MF_ORDER_v
206 class(meshbase3d), intent(in), target :: mesh3D
207 !----------------------------------------------------
208
209 this%mesh3D => mesh3d
210
211 call elementoperationtensorprod3d_create( mesh3d%refElem3D, &
212 this%elem_optr )
213
214 call this%elem_optr%Setup_ModalFilter( 0.0_rp, mf_alpha_h, mf_order_h, 0.0_rp, mf_alpha_v, mf_order_v )
215 call this%elem_optr%Setup_ModalFilter_tracer( 0.0_rp, mf_alpha_h, mf_order_h, 0.0_rp, mf_alpha_v, mf_order_v )
216 return
217 end subroutine physpreprocmodalfilter_init
218
219 !> Finalize an object to represent modal filtering operation before evaluating physics tendencies
220!OCL SERIAL
221 subroutine physpreprocmodalfilter_final( this )
223 implicit none
224 class(physpreprocmodalfilter), intent(inout) :: this
225 !----------------------------------------------------
226
227 call this%mfilter%Final()
228
229 call this%elem_optr%Final()
230 deallocate( this%elem_optr )
231 return
232 end subroutine physpreprocmodalfilter_final
233
234 !> Perform modal filtering operation before evaluating physics tendencies
235!OCL SERIAL
236 subroutine physpreprocmodalfilter_operate( this, &
237 PRG_VARS, QTRC_VARS, AUX_VARS, &
238 PRG_VARS0, QTRC_VARS0, AUX_VARS0 )
240 use scale_tracer, only: qa
241 implicit none
242 class(physpreprocmodalfilter), intent(inout) :: this
243 type(meshfield3d), intent(inout) :: PRG_VARS(PRGVAR_NUM)
244 type(meshfield3d), intent(inout) :: AUX_VARS(AUXVAR_NUM)
245 type(meshfield3d), intent(inout) :: QTRC_VARS(0:QA)
246 type(meshfield3d), intent(in) :: PRG_VARS0(PRGVAR_NUM)
247 type(meshfield3d), intent(in) :: AUX_VARS0(AUXVAR_NUM)
248 type(meshfield3d), intent(in) :: QTRC_VARS0(0:QA)
249
250 integer :: n
251 integer :: iq, iqs
252 !----------------------------------------------------
253
254 do n=1, this%mesh3D%LOCAL_MESH_NUM
255 call apply_modal_filter_core( &
256 prg_vars(prgvar_ddens_id)%local(n)%val, prg_vars(prgvar_momx_id)%local(n)%val, prg_vars(prgvar_momy_id)%local(n)%val, prg_vars(prgvar_momz_id)%local(n)%val, prg_vars(prgvar_therm_id)%local(n)%val, & ! (inout)
257 aux_vars(auxvar_denshydro_id)%local(n)%val, aux_vars(auxvar_preshydro_id)%local(n)%val, & ! (inout)
258 prg_vars0(prgvar_ddens_id)%local(n)%val, prg_vars0(prgvar_momx_id)%local(n)%val, prg_vars0(prgvar_momy_id)%local(n)%val, prg_vars0(prgvar_momz_id)%local(n)%val, prg_vars0(prgvar_therm_id)%local(n)%val, & ! (in)
259 aux_vars0(auxvar_denshydro_id)%local(n)%val, aux_vars0(auxvar_preshydro_id)%local(n)%val, & ! (in)
260 this%elem_optr, this%mesh3D%lcmesh_list(n), this%mesh3D%refElem3D ) ! (in)
261 end do
262
263 if ( qa == 0 ) then
264 iqs = 0
265 else
266 iqs = 1
267 end if
268 do iq=iqs, qa
269 do n=1, this%mesh3D%LOCAL_MESH_NUM
270 call apply_modal_filter_qtrc_core( qtrc_vars(iq)%local(n)%val, & ! (inout)
271 qtrc_vars0(iq)%local(n)%val, aux_vars(auxvar_denshydro_id)%local(n)%val, prg_vars(prgvar_ddens_id)%local(n)%val, & ! (in)
272 this%elem_optr, this%mesh3D%lcmesh_list(n), this%mesh3D%refElem3D ) ! (in)
273 end do
274 end do
275 return
276 end subroutine physpreprocmodalfilter_operate
277
278!--
279 !> Initialize an object to represent quasi-global filtering operation before evaluating physics tendencies
280!OCL SERIAL
281 subroutine physpreprocglobalfilter_init( this, &
282 GLFilterOptrType, GLFilterShape, GLFilterWidthFac, &
283 Nnode_h1D_reconst, &
284 mesh3D )
285 implicit none
286 class(physpreprocglobalfilter), intent(inout) :: this
287 character(len=*), intent(in) :: GLFilterOptrType
288 character(len=*), intent(in) :: GLFilterShape
289 real(RP), intent(in) :: GLFilterWidthFac
290 integer, intent(in) :: Nnode_h1D_reconst
291 class(meshbase3d), intent(in), target :: mesh3D
292
293 integer :: iq
294 character(len=H_SHORT) :: varname
295 !----------------------------------------------------
296
297 this%mesh3D => mesh3d
298
299 call this%gFilter_prgvar%Init( glfilteroptrtype, glfiltershape, glfilterwidthfac, nnode_h1d_reconst, &
300 prgvar_num, 0, 0, mesh3d )
301 call this%gFilter_trcvar%Init( glfilteroptrtype, glfiltershape, glfilterwidthfac, nnode_h1d_reconst, &
302 max(1,qa), 0, 0, mesh3d )
303
304 allocate( this%RHOQ(0:qa) )
305 do iq=0, qa
306 write(varname,'(a,I2.2)') 'RHOQ', iq
307 call this%RHOQ(iq)%Init( trim(varname), "kg/m3", mesh3d )
308 end do
309 return
310 end subroutine physpreprocglobalfilter_init
311
312 !> Finalize an object to represent quasi-global filtering operation before evaluating physics tendencies
313!OCL SERIAL
314 subroutine physpreprocglobalfilter_final( this )
316 implicit none
317 class(physpreprocglobalfilter), intent(inout) :: this
318
319 integer :: iq
320 !----------------------------------------------------
321 call this%gFilter_prgvar%Final()
322 call this%gFilter_trcvar%Final()
323
324 do iq=0, qa
325 call this%RHOQ(iq)%Final()
326 end do
327 deallocate( this%RHOQ )
328 return
329 end subroutine physpreprocglobalfilter_final
330
331 !> Perform quasi-global filtering operation before evaluating physics tendencies
332!OCL SERIAL
333 subroutine physpreprocglobalfilter_operate( this, &
334 PRG_VARS, QTRC_VARS, AUX_VARS, &
335 PRG_VARS0, QTRC_VARS0, AUX_VARS0 )
337 use scale_tracer, only: qa
338 implicit none
339 class(physpreprocglobalfilter), intent(inout) :: this
340 type(meshfield3d), intent(inout) :: PRG_VARS(PRGVAR_NUM)
341 type(meshfield3d), intent(inout) :: AUX_VARS(AUXVAR_NUM)
342 type(meshfield3d), intent(inout) :: QTRC_VARS(0:QA)
343 type(meshfield3d), intent(in) :: PRG_VARS0(PRGVAR_NUM)
344 type(meshfield3d), intent(in) :: AUX_VARS0(AUXVAR_NUM)
345 type(meshfield3d), intent(in) :: QTRC_VARS0(0:QA)
346
347 integer :: n
348 integer :: iq, iqs
349 !----------------------------------------------------
350
351 do n=1, this%mesh3D%LOCAL_MESH_NUM
352 call copy_data( &
353 prg_vars(prgvar_ddens_id)%local(n)%val, prg_vars(prgvar_momx_id)%local(n)%val, prg_vars(prgvar_momy_id)%local(n)%val, prg_vars(prgvar_momz_id)%local(n)%val, prg_vars(prgvar_therm_id)%local(n)%val, & ! (inout)
354 aux_vars(auxvar_denshydro_id)%local(n)%val, aux_vars(auxvar_preshydro_id)%local(n)%val, & ! (inout)
355 prg_vars0(prgvar_ddens_id)%local(n)%val, prg_vars0(prgvar_momx_id)%local(n)%val, prg_vars0(prgvar_momy_id)%local(n)%val, prg_vars0(prgvar_momz_id)%local(n)%val, prg_vars0(prgvar_therm_id)%local(n)%val, & ! (in)
356 aux_vars0(auxvar_denshydro_id)%local(n)%val, aux_vars0(auxvar_preshydro_id)%local(n)%val, & ! (in)
357 this%mesh3D%lcmesh_list(n), this%mesh3D%refElem3D ) ! (in)
358 end do
359
360 call this%gFilter_prgvar%Apply( prg_vars, this%mesh3D )
361
362 if ( qa == 0 ) then
363 iqs = 0
364 else
365 iqs = 1
366 end if
367 do iq=iqs, qa
368 do n=1, this%mesh3D%LOCAL_MESH_NUM
369 call calc_data_rhoq( this%RHOQ(iq)%local(n)%val, & ! (inout)
370 qtrc_vars0(iq)%local(n)%val, aux_vars(auxvar_denshydro_id)%local(n)%val, prg_vars0(prgvar_ddens_id)%local(n)%val, & ! (in)
371 this%mesh3D%lcmesh_list(n), this%mesh3D%refElem3D ) ! (in)
372 end do
373 end do
374
375 call this%gFilter_trcvar%Apply( this%RHOQ(iqs:qa), this%mesh3D )
376
377 do iq=iqs, qa
378 do n=1, this%mesh3D%LOCAL_MESH_NUM
379 call calc_data_rhoq2qtrc( qtrc_vars(iq)%local(n)%val, & ! (inout)
380 this%RHOQ(iq)%local(n)%val, aux_vars(auxvar_denshydro_id)%local(n)%val, prg_vars(prgvar_ddens_id)%local(n)%val, & ! (in)
381 this%mesh3D%lcmesh_list(n), this%mesh3D%refElem3D ) ! (in)
382 end do
383 end do
384
385 return
386 end subroutine physpreprocglobalfilter_operate
387
388!-- private --------------------------------
389!OCL SERIAL
390 subroutine copy_data( &
391 DDENS, MOMX, MOMY, MOMZ, THERM, DENS_hyd, PRES_hyd, &
392 DDENS0, MOMX0, MOMY0, MOMZ0, THERM0, DENS_hyd0, PRES_hyd0, &
393 lmesh, elem )
394 implicit none
395 class(localmesh3d), intent(in) :: lmesh
396 class(elementbase3d), intent(in) :: elem
397 real(RP), intent(out) :: DDENS(elem%Np,lmesh%NeA)
398 real(RP), intent(out) :: MOMX(elem%Np,lmesh%NeA)
399 real(RP), intent(out) :: MOMY(elem%Np,lmesh%NeA)
400 real(RP), intent(out) :: MOMZ(elem%Np,lmesh%NeA)
401 real(RP), intent(out) :: THERM(elem%Np,lmesh%NeA)
402 real(RP), intent(out) :: DENS_hyd(elem%Np,lmesh%NeA)
403 real(RP), intent(out) :: PRES_hyd(elem%Np,lmesh%NeA)
404 real(RP), intent(in) :: DDENS0(elem%Np,lmesh%NeA)
405 real(RP), intent(in) :: MOMX0(elem%Np,lmesh%NeA)
406 real(RP), intent(in) :: MOMY0(elem%Np,lmesh%NeA)
407 real(RP), intent(in) :: MOMZ0(elem%Np,lmesh%NeA)
408 real(RP), intent(in) :: THERM0(elem%Np,lmesh%NeA)
409 real(RP), intent(in) :: DENS_hyd0(elem%Np,lmesh%NeA)
410 real(RP), intent(in) :: PRES_hyd0(elem%Np,lmesh%NeA)
411
412 integer :: ke
413 !--------------------------------------------------
414
415 !$omp parallel do private(ke)
416 do ke=lmesh%NeS, lmesh%NeE
417 ddens(:,ke) = ddens0(:,ke)
418 momx(:,ke) = momx0(:,ke)
419 momy(:,ke) = momy0(:,ke)
420 momz(:,ke) = momz0(:,ke)
421 therm(:,ke) = therm0(:,ke)
422
423 dens_hyd(:,ke) = dens_hyd0(:,ke)
424 pres_hyd(:,ke) = pres_hyd0(:,ke)
425 end do
426 return
427 end subroutine copy_data
428!OCL SERIAL
429 subroutine copy_data_qtrc( QTRC, &
430 QTRC0, DENS_hyd, DDENS, &
431 lmesh, elem )
432 implicit none
433 class(localmesh3d), intent(in) :: lmesh
434 class(elementbase3d), intent(in) :: elem
435 real(RP), intent(inout) :: QTRC(elem%Np,lmesh%NeA)
436 real(RP), intent(in) :: QTRC0(elem%Np,lmesh%NeA)
437 real(RP), intent(in) :: DENS_hyd(elem%Np,lmesh%NeA)
438 real(RP), intent(in) :: DDENS(elem%Np,lmesh%NeA)
439
440 integer :: ke
441 !--------------------------------------------------
442
443 !$omp parallel do private(ke)
444 do ke=lmesh%NeS, lmesh%NeE
445 qtrc(:,ke) = qtrc0(:,ke)
446 end do
447 return
448 end subroutine copy_data_qtrc
449
450!OCL SERIAL
451 subroutine calc_data_rhoq( RHOQ, &
452 QTRC0, DENS_hyd, DDENS0, &
453 lmesh, elem )
454 implicit none
455 class(localmesh3d), intent(in) :: lmesh
456 class(elementbase3d), intent(in) :: elem
457 real(RP), intent(inout) :: RHOQ(elem%Np,lmesh%NeA)
458 real(RP), intent(in) :: QTRC0(elem%Np,lmesh%NeA)
459 real(RP), intent(in) :: DENS_hyd(elem%Np,lmesh%NeA)
460 real(RP), intent(in) :: DDENS0(elem%Np,lmesh%NeA)
461
462 integer :: ke
463 !--------------------------------------------------
464
465 !$omp parallel do private(ke)
466 do ke=lmesh%NeS, lmesh%NeE
467 rhoq(:,ke) = qtrc0(:,ke) * ( ddens0(:,ke) + dens_hyd(:,ke) )
468 end do
469 return
470 end subroutine calc_data_rhoq
471
472!OCL SERIAL
473 subroutine calc_data_rhoq2qtrc( QTRC, &
474 RHOQ0, DENS_hyd, DDENS0, &
475 lmesh, elem )
476 implicit none
477 class(localmesh3d), intent(in) :: lmesh
478 class(elementbase3d), intent(in) :: elem
479 real(RP), intent(inout) :: QTRC(elem%Np,lmesh%NeA)
480 real(RP), intent(in) :: RHOQ0(elem%Np,lmesh%NeA)
481 real(RP), intent(in) :: DENS_hyd(elem%Np,lmesh%NeA)
482 real(RP), intent(in) :: DDENS0(elem%Np,lmesh%NeA)
483
484 integer :: ke
485 !--------------------------------------------------
486
487 !$omp parallel do private(ke)
488 do ke=lmesh%NeS, lmesh%NeE
489 qtrc(:,ke) = rhoq0(:,ke) / ( ddens0(:,ke) + dens_hyd(:,ke) )
490 end do
491 return
492 end subroutine calc_data_rhoq2qtrc
493
494!-
495!OCL SERIAL
496 subroutine apply_modal_filter_core( &
497 DDENS, MOMX, MOMY, MOMZ, THERM, DENS_hyd, PRES_hyd, &
498 DDENS0, MOMX0, MOMY0, MOMZ0, THERM0, DENS_hyd0, PRES_hyd0, &
499 elem_optr, lmesh, elem )
502 implicit none
503 class(localmesh3d), intent(in) :: lmesh
504 class(elementbase3d), intent(in) :: elem
505 real(RP), intent(out) :: DDENS(elem%Np,lmesh%NeA)
506 real(RP), intent(out) :: MOMX(elem%Np,lmesh%NeA)
507 real(RP), intent(out) :: MOMY(elem%Np,lmesh%NeA)
508 real(RP), intent(out) :: MOMZ(elem%Np,lmesh%NeA)
509 real(RP), intent(out) :: THERM(elem%Np,lmesh%NeA)
510 real(RP), intent(out) :: DENS_hyd(elem%Np,lmesh%NeA)
511 real(RP), intent(out) :: PRES_hyd(elem%Np,lmesh%NeA)
512 real(RP), intent(in) :: DDENS0(elem%Np,lmesh%NeA)
513 real(RP), intent(in) :: MOMX0(elem%Np,lmesh%NeA)
514 real(RP), intent(in) :: MOMY0(elem%Np,lmesh%NeA)
515 real(RP), intent(in) :: MOMZ0(elem%Np,lmesh%NeA)
516 real(RP), intent(in) :: THERM0(elem%Np,lmesh%NeA)
517 real(RP), intent(in) :: DENS_hyd0(elem%Np,lmesh%NeA)
518 real(RP), intent(in) :: PRES_hyd0(elem%Np,lmesh%NeA)
519 class(elementoperationtensorprod3d), intent(in) :: elem_optr
520
521 integer :: ke
522 !--------------------------------------------------
523
524 !$omp parallel do private(ke)
525 do ke=lmesh%NeS, lmesh%NeE
526 ddens(:,ke) = ddens0(:,ke)
527 momx(:,ke) = momx0(:,ke)
528 momy(:,ke) = momy0(:,ke)
529 momz(:,ke) = momz0(:,ke)
530 therm(:,ke) = therm0(:,ke)
531
532 dens_hyd(:,ke) = dens_hyd0(:,ke)
533 pres_hyd(:,ke) = pres_hyd0(:,ke)
534 end do
535 call atm_dyn_dgm_modalfilter_apply( ddens, momx, momy, momz, therm, &
536 lmesh, elem, elem_optr, .true. )
537 return
538 end subroutine apply_modal_filter_core
539
540!OCL SERIAL
541 subroutine apply_modal_filter_qtrc_core( QTRC, &
542 QTRC0, DENS_hyd, DDENS, &
543 elem_optr, lmesh, elem )
546 implicit none
547 class(localmesh3d), intent(in) :: lmesh
548 class(elementbase3d), intent(in) :: elem
549 real(RP), intent(inout) :: QTRC(elem%Np,lmesh%NeA)
550 real(RP), intent(in) :: QTRC0(elem%Np,lmesh%NeA)
551 real(RP), intent(in) :: DENS_hyd(elem%Np,lmesh%NeA)
552 real(RP), intent(in) :: DDENS(elem%Np,lmesh%NeA)
553 class(elementoperationtensorprod3d), intent(in) :: elem_optr
554
555 integer :: ke
556 !--------------------------------------------------
557
558 !$omp parallel do private(ke)
559 do ke=lmesh%NeS, lmesh%NeE
560 qtrc(:,ke) = qtrc0(:,ke)
561 end do
562 call atm_dyn_dgm_tracer_modalfilter_apply( qtrc, & ! (inout)
563 dens_hyd, ddens, ddens, lmesh, elem, elem_optr ) ! (in)
564 return
565 end subroutine apply_modal_filter_qtrc_core
566end module mod_atmos_phy_preproc
module Atmosphere / Physics / Preprocessing
subroutine physpreprocnone_init(this, mesh3d)
Initialize an object to represent no preprocessing operation before evaluating physics tendencies.
module FElib / Fluid dyn solver / Atmosphere / Common / Modal filter
subroutine, public atm_dyn_dgm_tracer_modalfilter_apply(qtrc_, dens_hyd_, ddens0_, ddens_, lmesh, elem, elem_operation)
Apply a modal filtering to tracer variables.
subroutine, public atm_dyn_dgm_modalfilter_apply(ddens_, momx_, momy_, momz_, drhot_, lmesh, elem, elem_operation, do_weight_gsqrt)
module FElib / Fluid dyn solver / Atmosphere / Nonhydrostatic model / Common
module FElib / Element / Base
module FElib / Element / hexahedron
module FElib / Element/ ModalFilter
module FElib / Element / Operation with 3D tensor product elements for GPU
subroutine, public elementoperationtensorprod3d_create(elem3d, obj)
Factory subroutine to create an object of ElementOperationTensorProd3D.
module FElib / Mesh / Local 2D
module FElib / Mesh / Local 3D
module FElib / Mesh / Base 2D
module FElib / Mesh / Base 3D
module FElib / Data / base
Base type for preprocessing operations for variables before evaluating physics tendencies.
Derived type to represent quasi-global filtering operation for variables before evaluating physics te...
Derived type to represent modal filtering operation for variables before evaluating physics tendencie...
Derived type to represent no preprocessing operation for variables before evaluating physics tendenci...
Derived type representing a 2D reference element.
Derived type representing a 3D reference element.
Derived type representing a hexahedral element.
Derived type representing a modal filter.
Derived type for elementwise operations with 3D tensor product elements.
Derived type representing a local mesh for 2D domain.
Derived type to manage a local 3D computational domain.
Derived type representing a field with local mesh (base type)
Derived type to manage a computational mesh (base type for 2D domain)
Derived type to manage a computational mesh (base type for 3D domain)
Derived type representing a field with 2D mesh.
Derived type representing a field with 3D mesh.
Derived type to represent filter operation for 3D mesh field.