FE-Project
Loading...
Searching...
No Matches
mod_mkinit.F90
Go to the documentation of this file.
1!-------------------------------------------------------------------------------
10!-------------------------------------------------------------------------------
11#include "scalelib.h"
13 !-----------------------------------------------------------------------------
14 !
15 !++ used modules
16 !
17 use scale_precision
18 use scale_io
19 use scale_prof
20 use scale_prc
21
22 use scale_const, only: &
23 pi => const_pi, &
24 grav => const_grav, &
25 rplanet => const_radius, &
26 ohm => const_ohm, &
27 rdry => const_rdry, &
28 cpdry => const_cpdry, &
29 cvdry => const_cvdry, &
30 pres00 => const_pre00, &
31 pstd => const_pstd
32
33
41
42 use mod_atmos_component, only: &
44
45 !-----------------------------------------------------------------------------
46 implicit none
47 private
48 !-----------------------------------------------------------------------------
49 !
50 !++ Public procedure
51 !
52 public :: mkinit_setup
53 public :: mkinit
54
55 !-----------------------------------------------------------------------------
56 !
57 !++ Public parameters & variables
58 !
59
60 integer, public :: mkinit_type = -1
61 integer, public :: i_ignore = 0
62
63 !-----------------------------------------------------------------------------
64 !
65 !++ Private procedure
66 !
67
68 !-----------------------------------------------------------------------------
69contains
70 !-----------------------------------------------------------------------------
72 subroutine mkinit_setup
73 implicit none
74
75 character(len=H_SHORT) :: initname = 'NONE'
76
77 namelist / param_mkinit / &
78 initname
79
80 integer :: ierr
81 !---------------------------------------------------------------------------
82
83 log_newline
84 log_info("MKINIT_setup",*) 'Setup'
85
86 !--- read namelist
87 rewind(io_fid_conf)
88 read(io_fid_conf,nml=param_mkinit,iostat=ierr)
89 if( ierr < 0 ) then !--- missing
90 log_info("MKINIT_setup",*) 'Not found namelist. Default used.'
91 elseif( ierr > 0 ) then !--- fatal error
92 log_error("MKINIT_setup",*) 'Not appropriate names in namelist PARAM_MKINIT. Check!'
93 call prc_abort
94 endif
95 log_nml(param_mkinit)
96
97 select case(trim(initname))
98 case('NONE')
100 end select
101
102 return
103 end subroutine mkinit_setup
104
105 !-----------------------------------------------------------------------------
107 subroutine mkinit( output, & ! (out)
108 model_mesh, & ! (in)
109 atm_prgvars_manager, atm_auxvars_manager, atm_trcvars_manager )
110
112 use mod_atmos_mesh, only: atmosmesh
113 use mod_atmos_vars, only: &
115
116 implicit none
117
118 logical, intent(out) :: output
119 class(atmosmesh), target, intent(in) :: model_mesh
120 class(modelvarmanager), intent(inout) :: atm_prgvars_manager
121 class(modelvarmanager), intent(inout) :: atm_auxvars_manager
122 class(modelvarmanager), intent(inout) :: atm_trcvars_manager
123
124 class(localmeshfieldbase), pointer :: ddens, momx, momy, momz, drhot
125 class(localmeshfieldbase), pointer :: dens_hyd, pres_hyd
126 class(localmeshfieldbase), pointer :: rtot, cptot, cvtot
127
128 integer :: n
129 integer :: ke
130 class(localmesh3d), pointer :: lcmesh3d
131 class(meshbase3d), pointer :: mesh
132 !---------------------------------------------------------------------------
133
134 mesh => model_mesh%ptr_mesh
135
136 if ( mkinit_type == i_ignore ) then
137 log_newline
138 log_progress(*) 'skip making initial data'
139 output = .false.
140 else
141 log_newline
142 log_progress(*) 'start making initial data'
143
144 ! call PROF_rapstart('_MkInit_main',3)
145
146 do n=1, mesh%LOCAL_MESH_NUM
148 mesh, atm_prgvars_manager, atm_auxvars_manager, &
149 ddens, momx, momy, momz, drhot, &
150 dens_hyd, pres_hyd, rtot, cvtot, cptot, &
151 lcmesh3d )
152
153 !$omp parallel do
154 do ke=lcmesh3d%NeS, lcmesh3d%NeE
155 momx %val(:,ke) = 0.0_rp
156 momy %val(:,ke) = 0.0_rp
157 momz %val(:,ke) = 0.0_rp
158 ddens%val(:,ke) = 0.0_rp
159 drhot%val(:,ke) = 0.0_rp
160
161 cptot%val(:,ke) = cpdry
162 cvtot%val(:,ke) = cvdry
163 rtot%val(:,ke) = rdry
164 end do
165 end do
166 ! call PROF_rapend ('_MkInit_main',3)
167
168 ! LOG_PROGRESS(*) 'end making initial data'
169 output = .true.
170 end if
171
172 return
173 end subroutine mkinit
174
175 !-- private---------------------------------------------------------------------
176end module mod_mkinit
module ATMOSPHERE component
module Atmosphere / Mesh
module ATMOSPHERE / Variables
subroutine, public atmosvars_getlocalmeshprgvars(domid, mesh, prgvars_list, auxvars_list, ddens, momx, momy, momz, therm, dens_hyd, pres_hyd, rtot, cvtot, cptot, lcmesh3d)
module INITIAL
subroutine, public mkinit_setup
Setup.
subroutine, public mkinit(output, model_mesh, atm_prgvars_manager, atm_auxvars_manager, atm_trcvars_manager)
Driver.
integer, public mkinit_type
integer, public i_ignore
module FElib / Fluid dyn solver / Atmosphere / Common
module FElib / Element / Base
module FElib / Element / hexahedron
module FElib / Mesh / Local 3D
module FElib / Mesh / Base 3D
FElib / model framework / variable manager.