FE-Project
Loading...
Searching...
No Matches
scale_atm_dyn_dgm_hydrostatic Module Reference

module FElib / Fluid dyn solver / Atmosphere / Common More...

Data Types

interface  hydrostatic_build_rho_xyz

Functions/Subroutines

subroutine, public hydrostatic_calc_basicstate_constt (dens_hyd, pres_hyd, temp0, pres_sfc, x, y, z, lcmesh3d, elem)
 Calculate density and pressure in hydrostatic balance with a constant temperature.
subroutine, public hydrostatic_calc_basicstate_constpt (dens_hyd, pres_hyd, pottemp0, pres_sfc, x, y, z, lcmesh3d, elem)
 Calculate density and pressure in hydrostatic balance with a constant potential temperature.
subroutine, public hydrostatic_calc_basicstate_constbvfreq (dens_hyd, pres_hyd, bruntvaisalafreq, pottemp0, pres_sfc, x, y, z, lcmesh3d, elem)
 Calculate density and pressure in hydrostatic balance with a constant Brunt–Väisälä frequency.
subroutine, public hydrostatic_calc_basicstate_consttlaps (dens_hyd, pres_hyd, tlaps, temp0, pres_sfc, x, y, z, lcmesh3d, elem)
 Calculate density and pressure in hydrostatic balance with a constant lapse rate of temperature.
subroutine, public hydrostatic_calc_basicstate_constptlaps (dens_hyd, pres_hyd, ptlaps, pottemp0, pres_sfc, x, y, z, lcmesh3d, elem)
 Calculate density and pressure in hydrostatic balance with a constant lapse rate of potential temperature.

Detailed Description

module FElib / Fluid dyn solver / Atmosphere / Common

Description
Construct hydrostatic state for atmospheric dynamical process.
Author
Yuta Kawai, Team SCALE

Function/Subroutine Documentation

◆ hydrostatic_calc_basicstate_constt()

subroutine, public scale_atm_dyn_dgm_hydrostatic::hydrostatic_calc_basicstate_constt ( real(rp), dimension(elem%np,lcmesh3d%nea), intent(out) dens_hyd,
real(rp), dimension(elem%np,lcmesh3d%nea), intent(out) pres_hyd,
real(rp), intent(in) temp0,
real(rp), intent(in) pres_sfc,
real(rp), dimension(elem%np,lcmesh3d%ne), intent(in) x,
real(rp), dimension(elem%np,lcmesh3d%ne), intent(in) y,
real(rp), dimension(elem%np,lcmesh3d%ne), intent(in) z,
class(localmesh3d), intent(in) lcmesh3d,
class(elementbase3d), intent(in) elem )

Calculate density and pressure in hydrostatic balance with a constant temperature.

Parameters
DENS_hydhydrostatic density [kg/m3]
PRES_hydhydrostatic pressure [Pa]
Temp0Temperature of isothermal atmosphere [K]
PRES_sfcSurface pressure [Pa]
xx-coordinate
yy-coordinate
zz-coordinate [m]
lcmesh3DA object to manage a local 3D mesh
elemA object to manage a 3D finite element

Definition at line 86 of file scale_atm_dyn_dgm_hydrostatic.F90.

89
90 implicit none
91
92 class(LocalMesh3D), intent(in) :: lcmesh3D
93 class(ElementBase3D), intent(in) :: elem
94 real(RP), intent(out) :: DENS_hyd(elem%Np,lcmesh3D%NeA)
95 real(RP), intent(out) :: PRES_hyd(elem%Np,lcmesh3D%NeA)
96 real(RP), intent(in) :: x(elem%Np,lcmesh3D%Ne)
97 real(RP), intent(in) :: y(elem%Np,lcmesh3D%Ne)
98 real(RP), intent(in) :: z(elem%Np,lcmesh3D%Ne)
99 real(RP), intent(in) :: Temp0
100 real(RP), intent(in) :: PRES_sfc
101
102 integer :: ke, p
103 real(RP) :: H0
104 !-----------------------------------------------
105
106 h0 = rdry * temp0 / grav
107
108 !$omp parallel do
109 !$acc parallel loop gang present(DENS_hyd, PRES_hyd, z, lcmesh3D, elem)
110 do ke=lcmesh3d%NeS, lcmesh3d%NeE
111 !$acc loop vector
112 do p=1, elem%Np
113 pres_hyd(p,ke) = pres_sfc * exp( - z(p,ke) / h0 )
114 dens_hyd(p,ke) = pres_hyd(p,ke) / ( rdry * temp0 )
115 end do
116 end do
117
118 return

◆ hydrostatic_calc_basicstate_constpt()

subroutine, public scale_atm_dyn_dgm_hydrostatic::hydrostatic_calc_basicstate_constpt ( real(rp), dimension(elem%np,lcmesh3d%nea), intent(out) dens_hyd,
real(rp), dimension(elem%np,lcmesh3d%nea), intent(out) pres_hyd,
real(rp), intent(in) pottemp0,
real(rp), intent(in) pres_sfc,
real(rp), dimension(elem%np,lcmesh3d%ne), intent(in) x,
real(rp), dimension(elem%np,lcmesh3d%ne), intent(in) y,
real(rp), dimension(elem%np,lcmesh3d%ne), intent(in) z,
class(localmesh3d), intent(in) lcmesh3d,
class(elementbase3d), intent(in) elem )

Calculate density and pressure in hydrostatic balance with a constant potential temperature.

Parameters
DENS_hydhydrostatic density [kg/m3]
PRES_hydhydrostatic pressure [Pa]
PotTemp0Constant potential temperature of atmosphere [K]
PRES_sfcSurface pressure [Pa]
xx-coordinate
yy-coordinate
zz-coordinate [m]
lcmesh3DA object to manage a local 3D mesh
elemA object to manage a 3D finite element

Definition at line 133 of file scale_atm_dyn_dgm_hydrostatic.F90.

136
137 implicit none
138
139 class(LocalMesh3D), intent(in) :: lcmesh3D
140 class(ElementBase3D), intent(in) :: elem
141 real(RP), intent(out) :: DENS_hyd(elem%Np,lcmesh3D%NeA)
142 real(RP), intent(out) :: PRES_hyd(elem%Np,lcmesh3D%NeA)
143 real(RP), intent(in) :: x(elem%Np,lcmesh3D%Ne)
144 real(RP), intent(in) :: y(elem%Np,lcmesh3D%Ne)
145 real(RP), intent(in) :: z(elem%Np,lcmesh3D%Ne)
146 real(RP), intent(in) :: PotTemp0
147 real(RP), intent(in) :: PRES_sfc
148
149 integer :: ke, p
150
151 real(RP) :: exner
152 real(RP) :: exner_sfc
153 real(RP) :: RovCP
154 real(RP) :: CPovR
155 !-----------------------------------------------
156
157 rovcp = rdry / cpdry
158 cpovr = cpdry / rdry
159 exner_sfc = (pres_sfc / pres00)**rovcp
160
161 !$omp parallel do private(exner)
162 !$acc parallel loop gang present(DENS_hyd, PRES_hyd, z, lcmesh3D, elem)
163 do ke=lcmesh3d%NeS, lcmesh3d%NeE
164 !$acc loop vector
165 do p=1, elem%Np
166 ! Cp * PT0 * d exner / dz = - g
167 exner = exner_sfc - grav / (cpdry * pottemp0) * z(p,ke)
168 pres_hyd(p,ke) = pres00 * exner**cpovr
169 dens_hyd(p,ke) = pres_hyd(p,ke) / ( rdry * exner * pottemp0 )
170 end do
171 end do
172
173 return

Referenced by hydrostatic_calc_basicstate_constptlaps().

◆ hydrostatic_calc_basicstate_constbvfreq()

subroutine, public scale_atm_dyn_dgm_hydrostatic::hydrostatic_calc_basicstate_constbvfreq ( real(rp), dimension(elem%np,lcmesh3d%nea), intent(out) dens_hyd,
real(rp), dimension(elem%np,lcmesh3d%nea), intent(out) pres_hyd,
real(rp), intent(in) bruntvaisalafreq,
real(rp), intent(in) pottemp0,
real(rp), intent(in) pres_sfc,
real(rp), dimension(elem%np,lcmesh3d%ne), intent(in) x,
real(rp), dimension(elem%np,lcmesh3d%ne), intent(in) y,
real(rp), dimension(elem%np,lcmesh3d%ne), intent(in) z,
class(localmesh3d), intent(in) lcmesh3d,
class(elementbase3d), intent(in) elem )

Calculate density and pressure in hydrostatic balance with a constant Brunt–Väisälä frequency.

Parameters
DENS_hydhydrostatic density [kg/m3]
PRES_hydhydrostatic pressure [Pa]
BruntVaisalaFreqConstant Brunt–Väisälä frequency [s-1]
PotTemp0Constant potential temperature of atmosphere [K]
PRES_sfcSurface pressure [Pa]
xx-coordinate
yy-coordinate
zz-coordinate [m]
lcmesh3DA object to manage a local 3D mesh
elemA object to manage a 3D finite element

Definition at line 189 of file scale_atm_dyn_dgm_hydrostatic.F90.

192
193 implicit none
194
195 class(LocalMesh3D), intent(in) :: lcmesh3D
196 class(ElementBase3D), intent(in) :: elem
197 real(RP), intent(out) :: DENS_hyd(elem%Np,lcmesh3D%NeA)
198 real(RP), intent(out) :: PRES_hyd(elem%Np,lcmesh3D%NeA)
199 real(RP), intent(in) :: x(elem%Np,lcmesh3D%Ne)
200 real(RP), intent(in) :: y(elem%Np,lcmesh3D%Ne)
201 real(RP), intent(in) :: z(elem%Np,lcmesh3D%Ne)
202 real(RP), intent(in) :: BruntVaisalaFreq
203 real(RP), intent(in) :: PotTemp0
204 real(RP), intent(in) :: PRES_sfc
205
206 integer :: ke, p
207
208 real(RP) :: PT
209 real(RP) :: exner
210 real(RP) :: exner_sfc
211 real(RP) :: RovCP
212 real(RP) :: CPovR
213 !-----------------------------------------------
214
215 rovcp = rdry / cpdry
216 cpovr = cpdry / rdry
217 exner_sfc = (pres_sfc / pres00)**rovcp
218
219 !$omp parallel do private(PT, exner)
220 !$acc parallel loop collapse(2) present(DENS_hyd, PRES_hyd, z, lcmesh3D, elem)
221 do ke=lcmesh3d%NeS, lcmesh3d%NeE
222 do p=1, elem%Np
223 ! d exner / dz = - g / ( Cp * PT0 ) * exp (- N2/g * z)
224 ! exner = exner(zs) - g^2 / (Cp * N^2) [ 1/PT (z) - 1/PT(zs) ]
225 pt = pottemp0 * exp( bruntvaisalafreq**2 / grav * z(p,ke) )
226 exner = exner_sfc + grav**2 / ( cpdry * bruntvaisalafreq**2 ) * ( 1.0_rp / pt - 1.0_rp / pottemp0 )
227
228 pres_hyd(p,ke) = pres00 * exner**cpovr
229 dens_hyd(p,ke) = pres_hyd(p,ke) / ( rdry * exner * pt )
230 end do
231 end do
232
233 return

◆ hydrostatic_calc_basicstate_consttlaps()

subroutine, public scale_atm_dyn_dgm_hydrostatic::hydrostatic_calc_basicstate_consttlaps ( real(rp), dimension(elem%np,lcmesh3d%nea), intent(out) dens_hyd,
real(rp), dimension(elem%np,lcmesh3d%nea), intent(out) pres_hyd,
real(rp), intent(in) tlaps,
real(rp), intent(in) temp0,
real(rp), intent(in) pres_sfc,
real(rp), dimension(elem%np,lcmesh3d%ne), intent(in) x,
real(rp), dimension(elem%np,lcmesh3d%ne), intent(in) y,
real(rp), dimension(elem%np,lcmesh3d%ne), intent(in) z,
class(localmesh3d), intent(in) lcmesh3d,
class(elementbase3d), intent(in) elem )

Calculate density and pressure in hydrostatic balance with a constant lapse rate of temperature.

Parameters
DENS_hydhydrostatic density [kg/m3]
PRES_hydhydrostatic pressure [Pa]
TLAPSConstant lapse rate of atmosphere [K/m]
Temp0Temperature at z=0 [K]
PRES_sfcSurface pressure [Pa]
xx-coordinate
yy-coordinate
zz-coordinate [m]
lcmesh3DA object to manage a local 3D mesh
elemA object to manage a 3D finite element

Definition at line 249 of file scale_atm_dyn_dgm_hydrostatic.F90.

252
253 implicit none
254
255 class(LocalMesh3D), intent(in) :: lcmesh3D
256 class(ElementBase3D), intent(in) :: elem
257 real(RP), intent(out) :: DENS_hyd(elem%Np,lcmesh3D%NeA)
258 real(RP), intent(out) :: PRES_hyd(elem%Np,lcmesh3D%NeA)
259 real(RP), intent(in) :: x(elem%Np,lcmesh3D%Ne)
260 real(RP), intent(in) :: y(elem%Np,lcmesh3D%Ne)
261 real(RP), intent(in) :: z(elem%Np,lcmesh3D%Ne)
262 real(RP), intent(in) :: TLAPS
263 real(RP), intent(in) :: Temp0
264 real(RP), intent(in) :: PRES_sfc
265
266 integer :: ke, p
267
268 real(RP) :: fac
269 real(RP) :: TEMP
270 !-----------------------------------------------
271
272 fac = grav / ( rdry * tlaps )
273
274 !$omp parallel do private(TEMP)
275 !$acc parallel loop collapse(2) present(DENS_hyd, PRES_hyd, z, lcmesh3D, elem)
276 do ke=lcmesh3d%NeS, lcmesh3d%NeE
277 do p=1, elem%Np
278 temp = temp0 * ( 1.0_rp - tlaps / temp0 * z(p,ke) )
279 pres_hyd(p,ke) = pres_sfc * ( temp / temp0 )**fac
280 dens_hyd(p,ke) = pres_hyd(p,ke) / ( rdry * temp )
281 end do
282 end do
283
284 return

◆ hydrostatic_calc_basicstate_constptlaps()

subroutine, public scale_atm_dyn_dgm_hydrostatic::hydrostatic_calc_basicstate_constptlaps ( real(rp), dimension(elem%np,lcmesh3d%nea), intent(out) dens_hyd,
real(rp), dimension(elem%np,lcmesh3d%nea), intent(out) pres_hyd,
real(rp), intent(in) ptlaps,
real(rp), intent(in) pottemp0,
real(rp), intent(in) pres_sfc,
real(rp), dimension(elem%np,lcmesh3d%ne), intent(in) x,
real(rp), dimension(elem%np,lcmesh3d%ne), intent(in) y,
real(rp), dimension(elem%np,lcmesh3d%ne), intent(in) z,
class(localmesh3d), intent(in) lcmesh3d,
class(elementbase3d), intent(in) elem )

Calculate density and pressure in hydrostatic balance with a constant lapse rate of potential temperature.

Parameters
DENS_hydhydrostatic density [kg/m3]
PRES_hydhydrostatic pressure [Pa]
PTLAPSConstant lapse rate of potential temperature in atmosphere [K/m]
PotTemp0Potentital temperature at z=0 [K]
PRES_sfcSurface pressure [Pa]
xx-coordinate
yy-coordinate
zz-coordinate [m]
lcmesh3DA object to manage a local 3D mesh
elemA object to manage a 3D finite element

Definition at line 300 of file scale_atm_dyn_dgm_hydrostatic.F90.

303
304 implicit none
305
306 class(LocalMesh3D), intent(in) :: lcmesh3D
307 class(ElementBase3D), intent(in) :: elem
308 real(RP), intent(out) :: DENS_hyd(elem%Np,lcmesh3D%NeA)
309 real(RP), intent(out) :: PRES_hyd(elem%Np,lcmesh3D%NeA)
310 real(RP), intent(in) :: x(elem%Np,lcmesh3D%Ne)
311 real(RP), intent(in) :: y(elem%Np,lcmesh3D%Ne)
312 real(RP), intent(in) :: z(elem%Np,lcmesh3D%Ne)
313 real(RP), intent(in) :: PTLAPS
314 real(RP), intent(in) :: PotTemp0
315 real(RP), intent(in) :: PRES_sfc
316
317 integer :: ke, p
318
319 real(RP) :: PT
320 real(RP) :: exner
321 real(RP) :: exner_sfc
322 real(RP) :: RovCP
323 real(RP) :: CPovR
324 !-----------------------------------------------
325
326 rovcp = rdry / cpdry
327 cpovr = cpdry / rdry
328 exner_sfc = (pres_sfc / pres00)**rovcp
329
330 if ( ptlaps == 0.0_rp ) then
331 call hydrostatic_calc_basicstate_constpt( &
332 dens_hyd, pres_hyd, &
333 pottemp0, pres_sfc, x, y, z, lcmesh3d, elem )
334 else
335 !$omp parallel do private(PT, exner)
336 !$acc parallel loop collapse(2) present(DENS_hyd,PRES_hyd,z)
337 do ke=lcmesh3d%NeS, lcmesh3d%NeE
338 do p=1, elem%Np
339 ! d exner / dz = - g / ( Cp * PT0 ) / (1 + PTLAPS/PT0 * z)
340 ! exner = exner(zs) - g / (Cp * PTLAPS ) * log[ 1 + PTLAPS/PT0 * z ]
341 pt = pottemp0 + ptlaps * z(p,ke)
342 exner = exner_sfc - grav / ( cpdry * ptlaps ) * log( 1.0_rp + ptlaps / pottemp0 * z(p,ke) )
343
344 pres_hyd(p,ke) = pres00 * exner**cpovr
345 dens_hyd(p,ke) = pres_hyd(p,ke) / ( rdry * exner * pt )
346 end do
347 end do
348 end if
349
350 return

References hydrostatic_calc_basicstate_constpt().