FE-Project
Loading...
Searching...
No Matches
mod_atmos_mesh.F90
Go to the documentation of this file.
1!-------------------------------------------------------------------------------
2!> module Atmosphere / Mesh
3!!
4!! @par Description
5!! Base module for mesh with atmospheric model
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
29 use scale_sparsemat, only: sparsemat
32
36
37 !-----------------------------------------------------------------------------
38 implicit none
39 private
40 !-----------------------------------------------------------------------------
41 !
42 !++ Public type & procedures
43 !
44
45 !> Derived type to manage a computational mesh (base class)
46 !!
47 type, abstract, extends(modelmesh3d), public :: atmosmesh
48 type(hexahedralelement) :: element !< Object to manage 3D reference element
49 type(lineelement) :: element_v1d !< Object to manage 1D reference element for the vertical direction
50
51 type(meshtopography) :: topography !< Object to manage topography
52 integer :: vcoord_type_id !< ID of vertical coordinate type
53
54 logical :: comm_use_mpi_pc !< Flag whether persistent communication in MPI is used
55 logical :: comm_use_mpi_pc_fujitsu_ext !< Flag whether Fujitsu extension in MPI persistent communication is used
56 contains
57 procedure :: atmosmesh_init
58 procedure :: atmosmesh_final
59 procedure(atmosmesh_setup_restartfile1), public, deferred :: setup_restartfile1
60 procedure(atmosmesh_setup_restartfile2), public, deferred :: setup_restartfile2
61 procedure(atmosmesh_calc_uvmet), public, deferred :: calc_uvmet
62 generic :: setup_restartfile => setup_restartfile1, setup_restartfile2
63 procedure(atmosmesh_setup_vcoord), public, deferred :: setup_vcoordinate
64 end type atmosmesh
65
66 interface
67 subroutine atmosmesh_setup_restartfile1( this, restart_file, var_num )
68 import atmosmesh
70 class(atmosmesh), target, intent(inout) :: this
71 class(file_restart_meshfield_component), intent(inout) :: restart_file
72 integer, intent(in) :: var_num
73 end subroutine atmosmesh_setup_restartfile1
74 end interface
75 interface
76 subroutine atmosmesh_setup_restartfile2( this, restart_file, &
77 in_basename, in_postfix_timelabel, &
78 out_basename, out_postfix_timelabel, &
79 out_dtype, out_title, var_num )
80 import atmosmesh
82 class(atmosmesh), target, intent(inout) :: this
83 class(file_restart_meshfield_component), intent(inout) :: restart_file
84 character(*), intent(in) :: in_basename
85 logical, intent(in) :: in_postfix_timelabel
86 character(*), intent(in) :: out_basename
87 logical, intent(in) :: out_postfix_timelabel
88 character(*), intent(in) :: out_title
89 character(*), intent(in) :: out_dtype
90 integer, intent(in) :: var_num
91 end subroutine atmosmesh_setup_restartfile2
92 end interface
93 interface
94 subroutine atmosmesh_calc_uvmet( this, U, V, &
95 Umet, Vmet )
96 import atmosmesh
97 import meshfield3d
98 class(atmosmesh), target, intent(in) :: this
99 type(meshfield3d), intent(in) :: U
100 type(meshfield3d), intent(in) :: V
101 type(meshfield3d), intent(inout) :: Umet
102 type(meshfield3d), intent(inout) :: Vmet
103 end subroutine atmosmesh_calc_uvmet
104 end interface
105 interface
106 subroutine atmosmesh_setup_vcoord( this )
107 import atmosmesh
108 class(atmosmesh), target, intent(inout) :: this
109 end subroutine atmosmesh_setup_vcoord
110 end interface
111 integer, parameter, public :: atm_mesh_max_commnuicator_num = 10
112
113 !-----------------------------------------------------------------------------
114 !
115 !++ Public parameters & variables
116 !
117
118 !-----------------------------------------------------------------------------
119 !
120 !++ Private procedures
121 !
122 !-------------------
123
124 !-----------------------------------------------------------------------------
125 !
126 !++ Private parameters & variables
127 !
128
129contains
130
131!> Setup an object to manage a computational mesh
132 subroutine atmosmesh_init( this, mesh )
133
136
137 implicit none
138 class(atmosmesh), target, intent(inout) :: this
139 class(meshbase3d), intent(in) :: mesh !< Object to manage 3D computational mesh
140
141 class(meshbase2d), pointer :: mesh2d
142 !-------------------------------------------
143
144 call this%ModelMesh3D_Init( mesh )
145
146 !-
147 call file_monitor_meshfield_set_dim( mesh, 'ATM3D' )
148
149 !-
150 call mesh%GetMesh2D( mesh2d )
151 call this%topography%Init( "topo", mesh2d )
152
153 return
154 end subroutine atmosmesh_init
155
156!> Finalize an object to manage a computational mesh
157 subroutine atmosmesh_final(this)
158 implicit none
159
160 class(atmosmesh), intent(inout) :: this
161 !-------------------------------------------
162
163 call this%topography%Final()
164 call this%ModelMesh3D_Final()
165
166 call this%element%Final()
167 call this%element_v1D%Final()
168
169 return
170 end subroutine atmosmesh_final
171
172end module mod_atmos_mesh
module Atmosphere / Mesh
integer, parameter, public atm_mesh_max_commnuicator_num
module FElib / Element / Base
module FElib / Element / hexahedron
module FElib / Element / line
module FElib / Mesh / Local 2D
module FElib / Mesh / Local 3D
module FElib / Mesh / Base 2D
module FElib / Mesh / Base 3D
module FElib / Mesh / Topography
module FElib / Data / base
FElib / model framework / mesh manager.
FElib / model framework / variable manager.
Module common / sparsemat.
Derived type to manage a computational mesh (base class)
Derived type representing a 3D reference element.
Derived type representing a hexahedral element.
Derived type representing a line element.
Derived type to manage a local 3D computational domain.
Derived type representing a field with 2D mesh.
Derived type representing a field with 3D mesh.
Derived type to manage a sparse matrix.