FE-Project
Loading...
Searching...
No Matches
mod_atmos_dyn_vars.F90
Go to the documentation of this file.
1!-------------------------------------------------------------------------------
2!> module Atmosphere / Dynamics
3!!
4!! @par Description
5!! Container for variables with dynamics component
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
25 use scale_mesh_base, only: meshbase
28
31
33
34 use scale_model_var_manager, only: &
35 modelvarmanager, variableinfo
37
38 use mod_atmos_mesh, only: atmosmesh
39
40 !-----------------------------------------------------------------------------
41 implicit none
42 private
43
44 !-----------------------------------------------------------------------------
45 !
46 !++ Public type & procedures
47 !
48
49 !> Derived type to manage variables with atmospheric dynamics component
50 type, public :: atmosdynvars
51 type(meshfield2d), allocatable :: aux_vars2d(:) !< Array of 2D auxiliary variables
52 type(modelvarmanager) :: auxvars2d_manager !< Object to manage 2D auxiliary variables
53 contains
54 procedure :: init => atmosdynvars_init
55 procedure :: final => atmosdynvars_final
56 procedure :: history => atmosdynvars_history
57 end type atmosdynvars
58
60 !public :: AtmosDynVars_GetLocalMeshFields_analysis
61
62 !-----------------------------------------------------------------------------
63 !
64 !++ Public parameters & variables
65 !
66
67 !-
68 integer, public, parameter :: atmos_dyn_auxvars2d_num = 1
69 integer, public, parameter :: atmos_dyn_auxvars2d_coriolis_id = 1
70
73 variableinfo( atmos_dyn_auxvars2d_coriolis_id, 'CORIOLIS', 'coriolis parameter', &
74 's-1', 2, 'XY', '' ) /
75
76
77 ! integer, public, parameter :: ATMOS_DYN_ANALYSISVARS_NUM = 6
78 ! integer, public, parameter :: ATMOS_DYN_ANALYSISVAR_MOMZ_t = 1
79 ! integer, public, parameter :: ATMOS_DYN_ANALYSISVAR_MOMZ_t_advX = 2
80 ! integer, public, parameter :: ATMOS_DYN_ANALYSISVAR_MOMZ_t_advY = 3
81 ! integer, public, parameter :: ATMOS_DYN_ANALYSISVAR_MOMZ_t_advZ = 4
82 ! integer, public, parameter :: ATMOS_DYN_ANALYSISVAR_MOMZ_t_lift = 5
83 ! integer, public, parameter :: ATMOS_DYN_ANALYSISVAR_MOMZ_t_buoy = 6
84
85 ! type(VariableInfo), public :: ATMOS_DYN_ANALYSISVAR_VINFO(ATMOS_DYN_ANALYSISVARS_NUM)
86 ! DATA ATMOS_DYN_ANALYSISVAR_VINFO / &
87 ! VariableInfo( ATMOS_DYN_ANALYSISVAR_MOMZ_t, 'MOMZ_t', 'MOMZ_t', &
88 ! 'kg.m-2.s-1', 3, 'XYZ', '' ), &
89 ! VariableInfo( ATMOS_DYN_ANALYSISVAR_MOMZ_t_advX, 'MOMZ_t_advx', 'MOMZ_t_advX', &
90 ! 'kg.m-2.s-1', 3, 'XYZ', '' ), &
91 ! VariableInfo( ATMOS_DYN_ANALYSISVAR_MOMZ_t_advY, 'MOMZ_t_advy', 'MOMZ_t_advY', &
92 ! 'kg.m-2.s-1', 3, 'XYZ', '' ), &
93 ! VariableInfo( ATMOS_DYN_ANALYSISVAR_MOMZ_t_advZ, 'MOMZ_t_advz', 'MOMZ_t_advZ', &
94 ! 'kg.m-2.s-1', 3, 'XYZ', '' ), &
95 ! VariableInfo( ATMOS_DYN_ANALYSISVAR_MOMZ_t_lift, 'MOMZ_t_lift', 'MOMZ_t_lift', &
96 ! 'kg.m-2.s-1', 3, 'XYZ', '' ), &
97 ! VariableInfo( ATMOS_DYN_ANALYSISVAR_MOMZ_t_buoy, 'MOMZ_t_buoy', 'MOMZ_t_buo', &
98 ! 'kg.m-2.s-1', 3, 'XYZ', '' ) &
99 ! /
100
101 !-----------------------------------------------------------------------------
102 !
103 !++ Private procedures
104 !
105 !-------------------
106
107contains
108
109!> Setup an object to manage variables with atmospheric dynamics component
110!!
111!! @param model_mesh Object to manage computational mesh of atmospheric model
112!!
113!OCL SERIAL
114 subroutine atmosdynvars_init( this, model_mesh )
116 implicit none
117 class(atmosdynvars), target, intent(inout) :: this
118 class(modelmeshbase), target, intent(in) :: model_mesh
119
120 integer :: v
121 integer :: n
122 logical :: reg_file_hist
123
124 class(atmosmesh), pointer :: atm_mesh
125 class(meshbase2d), pointer :: mesh2d
126 class(meshbase3d), pointer :: mesh3d
127
128 !--------------------------------------------------
129
130 log_info('AtmosDynVars_Init',*)
131
132 nullify( atm_mesh )
133 select type(model_mesh)
134 class is (atmosmesh)
135 atm_mesh => model_mesh
136 end select
137 mesh3d => atm_mesh%ptr_mesh
138
139 call mesh3d%GetMesh2D( mesh2d )
140
141 !- Initialize 2D auxiliary variables
142
143 call this%AUXVARS2D_manager%Init()
144 allocate( this%AUX_VARS2D(atmos_dyn_auxvars2d_num) )
145
146 reg_file_hist = .false.
148 call this%AUXVARS2D_manager%Regist( &
149 atmos_dyn_auxvars2d_vinfo(v), mesh2d, & ! (in)
150 this%AUX_VARS2D(v), reg_file_hist ) ! (out)
151
152 do n = 1, mesh3d%LOCAL_MESH_NUM
153 this%AUX_VARS2D(v)%local(n)%val(:,:) = 0.0_rp
154 end do
155 end do
156
157 !-
158 ! call this%ANALYSISVARS_manager%Init()
159 ! allocate( this%ANALYSIS_VARS3D(ATMOS_DYN_ANALYSISVARS_NUM) )
160
161 ! reg_file_hist = .true.
162 ! do v = 1, ATMOS_DYN_ANALYSISVARS_NUM
163 ! call this%ANALYSISVARS_manager%Regist( &
164 ! ATMOS_DYN_ANALYSISVAR_VINFO(v), atm_mesh%mesh, &
165 ! this%ANALYSIS_VARS3D(v), reg_file_hist )
166 ! end do
167
168 return
169 end subroutine atmosdynvars_init
170
171!> Finalize an object to manage variables with atmospheric dynamics component
172 subroutine atmosdynvars_final( this )
173 implicit none
174 class(atmosdynvars), intent(inout) :: this
175
176 !--------------------------------------------------
177
178 log_info('AtmosDynVars_Final',*)
179
180 call this%AUXVARS2D_manager%Final()
181 deallocate( this%AUX_VARS2D )
182
183 !call this%ANALYSISVARS_manager%Final()
184
185 return
186 end subroutine atmosdynvars_final
187
188 subroutine atmosdynvars_history( this )
190 implicit none
191 class(atmosdynvars), intent(in) :: this
192
193 ! integer :: v
194 ! integer :: hst_id
195 !-------------------------------------------------------------------------
196
197 ! do v = 1, ATMOS_DYN_ANALYSISVARS_NUM
198 ! hst_id = this%ANALYSIS_VARS3D(v)%hist_id
199 ! if ( hst_id > 0 ) call FILE_HISTORY_meshfield_put( hst_id, this%ANALYSIS_VARS3D(v) )
200 ! end do
201
202 return
203 end subroutine atmosdynvars_history
204
205 subroutine atmosdynauxvars_getlocalmeshfields( domID, mesh, auxvars_list, &
206 Coriolis, &
207 lcmesh3D &
208 )
209
210 use scale_mesh_base, only: meshbase
212 implicit none
213
214 integer, intent(in) :: domid
215 class(meshbase), intent(in) :: mesh
216 class(modelvarmanager), intent(inout) :: auxvars_list
217 class(localmeshfieldbase), pointer, intent(out) :: coriolis
218 class(localmesh3d), pointer, intent(out), optional :: lcmesh3d
219
220 class(meshfieldbase), pointer :: field
221 class(localmeshbase), pointer :: lcmesh
222 !-------------------------------------------------------
223
224 !--
225 call auxvars_list%Get(atmos_dyn_auxvars2d_coriolis_id, field)
226 call field%GetLocalMeshField(domid, coriolis)
227 !---
228
229 if (present(lcmesh3d)) then
230 call mesh%GetLocalMesh( domid, lcmesh )
231 nullify( lcmesh3d )
232
233 select type(lcmesh)
234 type is (localmesh3d)
235 if (present(lcmesh3d)) lcmesh3d => lcmesh
236 end select
237 end if
238
239 return
241
242 ! subroutine AtmosDynVars_GetLocalMeshFields_analysis( domID, mesh, analysis_list, &
243 ! MOMZ_t, MOMZ_t_advx, MOMZ_t_advY, MOMZ_t_advZ, MOMZ_t_lift, MOMZ_t_buoy, &
244 ! lcmesh3D &
245 ! )
246
247 ! use scale_mesh_base, only: MeshBase
248 ! use scale_meshfield_base, only: MeshFieldBase
249 ! implicit none
250
251 ! integer, intent(in) :: domID
252 ! class(MeshBase), intent(in) :: mesh
253 ! class(ModelVarManager), intent(inout) :: analysis_list
254 ! class(LocalMeshFieldBase), pointer, intent(out) :: &
255 ! MOMZ_t, MOMZ_t_advx, MOMZ_t_advY, MOMZ_t_advZ, MOMZ_t_lift, MOMZ_t_buoy
256 ! class(LocalMesh3D), pointer, intent(out), optional :: lcmesh3D
257
258 ! class(MeshFieldBase), pointer :: field
259 ! class(LocalMeshBase), pointer :: lcmesh
260 ! !-------------------------------------------------------
261
262 ! !--
263 ! call analysis_list%Get(ATMOS_DYN_ANALYSISVAR_MOMZ_t, field)
264 ! call field%GetLocalMeshField(domID, MOMZ_t)
265 ! !---
266 ! call analysis_list%Get(ATMOS_DYN_ANALYSISVAR_MOMZ_t_advx, field)
267 ! call field%GetLocalMeshField(domID, MOMZ_t_advx)
268 ! !---
269 ! call analysis_list%Get(ATMOS_DYN_ANALYSISVAR_MOMZ_t_advy, field)
270 ! call field%GetLocalMeshField(domID, MOMZ_t_advy)
271 ! !---
272 ! call analysis_list%Get(ATMOS_DYN_ANALYSISVAR_MOMZ_t_advz, field)
273 ! call field%GetLocalMeshField(domID, MOMZ_t_advz)
274 ! !---
275 ! call analysis_list%Get(ATMOS_DYN_ANALYSISVAR_MOMZ_t_lift, field)
276 ! call field%GetLocalMeshField(domID, MOMZ_t_lift)
277 ! !---
278 ! call analysis_list%Get(ATMOS_DYN_ANALYSISVAR_MOMZ_t_buoy, field)
279 ! call field%GetLocalMeshField(domID, MOMZ_t_buoy)
280
281
282 ! if (present(lcmesh3D)) then
283 ! call mesh%GetLocalMesh( domID, lcmesh )
284 ! nullify( lcmesh3D )
285
286 ! select type(lcmesh)
287 ! type is (LocalMesh3D)
288 ! if (present(lcmesh3D)) lcmesh3D => lcmesh
289 ! end select
290 ! end if
291
292 ! return
293 ! end subroutine AtmosDynVars_GetLocalMeshFields_analysis
294
295
296end module mod_atmos_dyn_vars
module Atmosphere / Dynamics
type(variableinfo), dimension(atmos_dyn_auxvars2d_num), public atmos_dyn_auxvars2d_vinfo
integer, parameter, public atmos_dyn_auxvars2d_coriolis_id
integer, parameter, public atmos_dyn_auxvars2d_num
subroutine, public atmosdynauxvars_getlocalmeshfields(domid, mesh, auxvars_list, coriolis, lcmesh3d)
module Atmosphere / Mesh
module FElib / Element / Base
module FElib / Mesh / Local 2D
module FElib / Mesh / Local 3D
module FElib / Mesh / Local, Base
integer, parameter, public local_meshfield_type_nodes_faceval
ID of data type with a field on face nodes in local mesh.
module FElib / Mesh / Base 2D
module FElib / Mesh / Base 3D
module FElib / Mesh / Base
module FElib / Data / base
module FElib / Data / Communication base
FElib / model framework / mesh manager (base)
FElib / model framework / variable manager.
Derived type to manage variables with atmospheric dynamics component.
Derived type to manage a computational mesh (base class)
Derived type representing a 3D reference element.
Derived type to manage a local 3D computational domain.
Derived type to manage a local computational domain (base type)
Derived type representing a field with local mesh (base type)
Derived type representing a field with 2D mesh.
Derived type representing a field with 3D mesh.
Derived type representing a field (base type)
Container to save a pointer of MeshField(1D, 2D, 3D) object.
Derived type to manage model mesh and spatial operators (base type)