FE-Project
Loading...
Searching...
No Matches
mod_ocean_dyn_vars.F90
Go to the documentation of this file.
1!-------------------------------------------------------------------------------
2!> module Ocean / 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_ocean_mesh, only: oceanmesh
39
40 !-----------------------------------------------------------------------------
41 implicit none
42 private
43
44 !-----------------------------------------------------------------------------
45 !
46 !++ Public type & procedures
47 !
48
49 !> Derived type to manage variables with oceanic dynamics component
50 type, public :: oceandynvars
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 => oceandynvars_init
55 procedure :: final => oceandynvars_final
56 procedure :: history => oceandynvars_history
57 end type oceandynvars
58
60 !public :: OceanDynVars_GetLocalMeshFields_analysis
61
62 !-----------------------------------------------------------------------------
63 !
64 !++ Public parameters & variables
65 !
66
67 !-
68 integer, public, parameter :: ocean_dyn_auxvars2d_num = 1
69 integer, public, parameter :: ocean_dyn_auxvars2d_coriolis_id = 1
70
73 variableinfo( ocean_dyn_auxvars2d_coriolis_id, 'CORIOLIS', 'coriolis parameter', &
74 's-1', 2, 'XY', '' ) /
75 !-----------------------------------------------------------------------------
76 !
77 !++ Private procedures
78 !
79 !-------------------
80
81contains
82
83!> Setup an object to manage variables with oceanic dynamics component
84!!
85!! @param model_mesh Object to manage computational mesh of oceanic model
86!!
87!OCL SERIAL
88 subroutine oceandynvars_init( this, model_mesh )
90 implicit none
91 class(oceandynvars), target, intent(inout) :: this
92 class(modelmeshbase), target, intent(in) :: model_mesh
93
94 integer :: v
95 integer :: n
96 logical :: reg_file_hist
97
98 class(oceanmesh), pointer :: ocean_mesh
99 class(meshbase2d), pointer :: mesh2d
100 class(meshbase3d), pointer :: mesh3d
101
102 !--------------------------------------------------
103
104 log_info('OceanDynVars_Init',*)
105
106 nullify( ocean_mesh )
107 select type(model_mesh)
108 class is (oceanmesh)
109 ocean_mesh => model_mesh
110 end select
111 mesh3d => ocean_mesh%ptr_mesh
112
113 call mesh3d%GetMesh2D( mesh2d )
114
115 !- Initialize 2D auxiliary variables
116
117 call this%AUXVARS2D_manager%Init()
118 allocate( this%AUX_VARS2D(ocean_dyn_auxvars2d_num) )
119
120 reg_file_hist = .false.
122 call this%AUXVARS2D_manager%Regist( &
123 ocean_dyn_auxvars2d_vinfo(v), mesh2d, & ! (in)
124 this%AUX_VARS2D(v), reg_file_hist ) ! (out)
125
126 do n = 1, mesh3d%LOCAL_MESH_NUM
127 this%AUX_VARS2D(v)%local(n)%val(:,:) = 0.0_rp
128 end do
129 end do
130
131 return
132 end subroutine oceandynvars_init
133
134!> Finalize an object to manage variables with oceanic dynamics component
135 subroutine oceandynvars_final( this )
136 implicit none
137 class(oceandynvars), intent(inout) :: this
138
139 !--------------------------------------------------
140
141 log_info('OceanDynVars_Final',*)
142
143 call this%AUXVARS2D_manager%Final()
144 deallocate( this%AUX_VARS2D )
145
146 !call this%ANALYSISVARS_manager%Final()
147
148 return
149 end subroutine oceandynvars_final
150
151 !> Output history files for variables with oceanic dynamics component
152 subroutine oceandynvars_history( this )
154 implicit none
155 class(oceandynvars), intent(in) :: this
156 !-------------------------------------------------------------------------
157 return
158 end subroutine oceandynvars_history
159
160 subroutine oceandynauxvars_getlocalmeshfields( domID, mesh, auxvars_list, &
161 Coriolis, &
162 lcmesh3D &
163 )
164
165 use scale_mesh_base, only: meshbase
167 implicit none
168
169 integer, intent(in) :: domid
170 class(meshbase), intent(in) :: mesh
171 class(modelvarmanager), intent(inout) :: auxvars_list
172 class(localmeshfieldbase), pointer, intent(out) :: coriolis
173 class(localmesh3d), pointer, intent(out), optional :: lcmesh3d
174
175 class(meshfieldbase), pointer :: field
176 class(localmeshbase), pointer :: lcmesh
177 !-------------------------------------------------------
178
179 !--
180 call auxvars_list%Get(ocean_dyn_auxvars2d_coriolis_id, field)
181 call field%GetLocalMeshField(domid, coriolis)
182 !---
183
184 if (present(lcmesh3d)) then
185 call mesh%GetLocalMesh( domid, lcmesh )
186 nullify( lcmesh3d )
187
188 select type(lcmesh)
189 type is (localmesh3d)
190 if (present(lcmesh3d)) lcmesh3d => lcmesh
191 end select
192 end if
193
194 return
196end module mod_ocean_dyn_vars
module Ocean / Dynamics
integer, parameter, public ocean_dyn_auxvars2d_coriolis_id
subroutine, public oceandynauxvars_getlocalmeshfields(domid, mesh, auxvars_list, coriolis, lcmesh3d)
integer, parameter, public ocean_dyn_auxvars2d_num
type(variableinfo), dimension(ocean_dyn_auxvars2d_num), public ocean_dyn_auxvars2d_vinfo
module Ocean / 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 oceanic dynamics component.
Derived type to manage a computational mesh (base class)
Derived type representing a 3D reference element.
Derived type representing a local mesh for 2D domain.
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 to manage a computational mesh (base type for 2D domain)
Derived type to manage a computational mesh (base type for 3D domain)
Base type to manage a computational mesh.
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)