SCALE-RM
Data Types | Functions/Subroutines
scale_atmos_hydrostatic Module Reference

module atmosphere / hydrostatic barance More...

Functions/Subroutines

subroutine, public atmos_hydrostatic_setup
 Setup. More...
 
subroutine atmos_hydrostatic_buildrho_1d (KA, KS, KE, pott, qv, qc, pres_sfc, pott_sfc, qv_sfc, qc_sfc, cz, fz, dens, temp, pres, temp_sfc)
 Build up density from surface (1D) More...
 
subroutine atmos_hydrostatic_buildrho_3d (KA, KS, KE, IA, IS, IE, JA, JS, JE, pott, qv, qc, pres_sfc, pott_sfc, qv_sfc, qc_sfc, cz, fz, area, dens, temp, pres, temp_sfc)
 Build up density from surface (3D) More...
 
subroutine atmos_hydrostatic_buildrho_real_3d (KA, KS, KE, IA, IS, IE, JA, JS, JE, pott, qv, qc, cz, pres, dens, temp)
 Build up density from surface (3D), not to reverse from TOA. More...
 
subroutine atmos_hydrostatic_buildrho_atmos_0d (pott_L2, qv_L2, qc_L2, dens_L1, pott_L1, qv_L1, qc_L1, dz, k, dens_L2, temp_L2, pres_L2)
 Build up density (0D) More...
 
subroutine atmos_hydrostatic_buildrho_atmos_1d (KA, KS, KE, pott, qv, qc, dz, dens, temp, pres)
 Build up density from lowermost atmosphere (1D) More...
 
subroutine atmos_hydrostatic_buildrho_atmos_rev_1d (KA, KS, KE, pott, qv, qc, dz, dens, temp, pres)
 Build up density from upermost atmosphere (1D) More...
 
subroutine atmos_hydrostatic_buildrho_bytemp_3d (KA, KS, KE, IA, IS, IE, JA, JS, JE, temp, qv, qc, pres_sfc, temp_sfc, qv_sfc, qc_sfc, cz, fz, dens, pott, pres, pott_sfc)
 Build up density from surface (3D) More...
 
subroutine atmos_hydrostatic_buildrho_bytemp_atmos_rev_1d (KA, KS, KE, temp, qv, qc, dz, dens, pott, pres)
 Build up density from upermost atmosphere (1D) More...
 
subroutine atmos_hydrostatic_buildrho_bytemp_atmos_3d (KA, KS, KE, IA, IS, IE, JA, JS, JE, temp, qv, qc, dz, dens, pott, pres)
 Build up density from lowermost atmosphere (3D) More...
 

Detailed Description

module atmosphere / hydrostatic barance

Description
make hydrostatic profile in the model
Author
Team SCALE
NAMELIST
  • PARAM_ATMOS_HYDROSTATIC
    nametypedefault valuecomment
    HYDROSTATIC_USELAPSERATE logical .false. use lapse rate?
    HYDROSTATIC_BUILDRHO_REAL_KREF integer 1
    HYDROSTATIC_BAROMETRIC_LAW_MSLP_KREF integer 1 reference layer for MSLP calculation

History Output
No history output

Function/Subroutine Documentation

◆ atmos_hydrostatic_setup()

subroutine, public scale_atmos_hydrostatic::atmos_hydrostatic_setup

Setup.

Definition at line 116 of file scale_atmos_hydrostatic.F90.

116  use scale_prc, only: &
117  prc_abort
118  use scale_const, only: &
119  const_eps
120  implicit none
121 
122  namelist / param_atmos_hydrostatic / &
123  hydrostatic_uselapserate, &
124  hydrostatic_buildrho_real_kref, &
125  hydrostatic_barometric_law_mslp_kref
126 
127  integer :: ierr
128  !---------------------------------------------------------------------------
129 
130  log_newline
131  log_info("ATMOS_HYDROSTATIC_setup",*) 'Setup'
132 
133  !--- read namelist
134  rewind(io_fid_conf)
135  read(io_fid_conf,nml=param_atmos_hydrostatic,iostat=ierr)
136  if( ierr < 0 ) then !--- missing
137  log_info("ATMOS_HYDROSTATIC_setup",*) 'Not found namelist. Default used.'
138  elseif( ierr > 0 ) then !--- fatal error
139  log_error("ATMOS_HYDROSTATIC_setup",*) 'Not appropriate names in namelist PARAM_ATMOS_HYDROSTATIC. Check!'
140  call prc_abort
141  endif
142  log_nml(param_atmos_hydrostatic)
143 
144  criteria = sqrt( const_eps )
145 
146  log_newline
147  log_info("ATMOS_HYDROSTATIC_setup",*) 'Use lapse rate for estimation of surface temperature? : ', hydrostatic_uselapserate
148  log_info("ATMOS_HYDROSTATIC_setup",*) 'Buildrho conversion criteria : ', criteria
149 
150  return

References scale_const::const_eps, scale_io::io_fid_conf, and scale_prc::prc_abort().

Referenced by mod_rm_driver::rm_driver(), and mod_rm_prep::rm_prep().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ atmos_hydrostatic_buildrho_1d()

subroutine scale_atmos_hydrostatic::atmos_hydrostatic_buildrho_1d ( integer, intent(in)  KA,
integer, intent(in)  KS,
integer, intent(in)  KE,
real(rp), dimension(ka), intent(in)  pott,
real(rp), dimension (ka), intent(in)  qv,
real(rp), dimension (ka), intent(in)  qc,
real(rp), intent(in)  pres_sfc,
real(rp), intent(in)  pott_sfc,
real(rp), intent(in)  qv_sfc,
real(rp), intent(in)  qc_sfc,
real(rp), dimension (ka), intent(in)  cz,
real(rp), dimension (0:ka), intent(in)  fz,
real(rp), dimension(ka), intent(out)  dens,
real(rp), dimension(ka), intent(out)  temp,
real(rp), dimension(ka), intent(out)  pres,
real(rp), intent(out)  temp_sfc 
)

Build up density from surface (1D)

Parameters
[in]pottpotential temperature [K]
[in]qvwater vapor [kg/kg]
[in]qcliquid water [kg/kg]
[in]pres_sfcsurface pressure [Pa]
[in]pott_sfcsurface potential temperature [K]
[in]qv_sfcsurface water vapor [kg/kg]
[in]qc_sfcsurface liquid water [kg/kg]
[out]densdensity [kg/m3]
[out]temptemperature [K]
[out]prespressure [Pa]
[out]temp_sfcsurface temperature [K]

Definition at line 163 of file scale_atmos_hydrostatic.F90.

163  use scale_prc, only: &
164  prc_abort
165  use scale_atmos_hydrometeor, only: &
166  cv_vapor, &
167  cv_water, &
168  cp_vapor, &
169  cp_water
170  implicit none
171 
172  integer, intent(in) :: KA, KS, KE
173  real(RP), intent(in) :: pott(KA)
174  real(RP), intent(in) :: qv (KA)
175  real(RP), intent(in) :: qc (KA)
176  real(RP), intent(in) :: pres_sfc
177  real(RP), intent(in) :: pott_sfc
178  real(RP), intent(in) :: qv_sfc
179  real(RP), intent(in) :: qc_sfc
180  real(RP), intent(in) :: cz (KA)
181  real(RP), intent(in) :: fz (0:KA)
182  real(RP), intent(out) :: dens(KA)
183  real(RP), intent(out) :: temp(KA)
184  real(RP), intent(out) :: pres(KA)
185  real(RP), intent(out) :: temp_sfc
186 
187  real(RP) :: dens_sfc
188  real(RP) :: Rtot_sfc
189  real(RP) :: CVtot_sfc
190  real(RP) :: CPtot_sfc
191  real(RP) :: CPovCV_sfc
192  real(RP) :: Rtot
193  real(RP) :: CVtot
194  real(RP) :: CPtot
195  real(RP) :: CPovCV
196  real(RP) :: dz(KA)
197 
198  integer :: k
199  !---------------------------------------------------------------------------
200 
201  !--- from surface to lowermost atmosphere
202 
203  rtot_sfc = rdry * ( 1.0_rp - qv_sfc - qc_sfc ) &
204  + rvap * qv_sfc
205  cvtot_sfc = cvdry * ( 1.0_rp - qv_sfc - qc_sfc ) &
206  + cv_vapor * qv_sfc &
207  + cv_water * qc_sfc
208  cptot_sfc = cpdry * ( 1.0_rp - qv_sfc - qc_sfc ) &
209  + cp_vapor * qv_sfc &
210  + cp_water * qc_sfc
211  cpovcv_sfc = cptot_sfc / cvtot_sfc
212 
213  rtot = rdry * ( 1.0_rp - qv(ks) - qc(ks) ) &
214  + rvap * qv(ks)
215  cvtot = cvdry * ( 1.0_rp - qv(ks) - qc(ks) ) &
216  + cv_vapor * qv(ks) &
217  + cv_water * qc(ks)
218  cptot = cpdry * ( 1.0_rp - qv(ks) - qc(ks) ) &
219  + cp_vapor * qv(ks) &
220  + cp_water * qc(ks)
221  cpovcv = cptot / cvtot
222 
223  ! density at surface
224  dens_sfc = p00 / rtot_sfc / pott_sfc * ( pres_sfc/p00 )**(cvtot_sfc/cptot_sfc)
225  temp_sfc = pres_sfc / ( dens_sfc * rtot_sfc )
226 
227  dz(ks-1) = cz(ks) - fz(ks-1)
228  do k = ks, ke-1
229  dz(k) = cz(k+1) - cz(k)
230  end do
231 
232  ! make density at lowermost cell center
233  if ( hydrostatic_uselapserate ) then
234 
235  temp(ks) = pott_sfc - lapsdry * dz(ks-1) ! use dry lapse rate
236  pres(ks) = p00 * ( temp(ks)/pott(ks) )**(cptot/rtot)
237  dens(ks) = p00 / rtot / pott(ks) * ( pres(ks)/p00 )**(cvtot/cptot)
238 
239  else ! use itelation
240 
241  call atmos_hydrostatic_buildrho_atmos_0d( pott(ks), qv(ks), qc(ks), & ! [IN]
242  dens_sfc, pott_sfc, qv_sfc, qc_sfc, & ! [IN]
243  dz(ks-1), ks-1, & ! [IN]
244  dens(ks), temp(ks), pres(ks) ) ! [OUT]
245 
246  endif
247 
248  !--- from lowermost atmosphere to top of atmosphere
249  call atmos_hydrostatic_buildrho_atmos_1d( ka, ks, ke, &
250  pott(:), qv(:), qc(:), & ! [IN]
251  dz(:), & ! [IN]
252  dens(:), & ! [INOUT]
253  temp(:), pres(:) ) ! [OUT]
254  ! fill dummy
255  dens( 1:ks-1) = 0.0_rp
256  dens(ke+1:ka ) = 0.0_rp
257 
258  return

References atmos_hydrostatic_buildrho_atmos_0d(), atmos_hydrostatic_buildrho_atmos_1d(), scale_atmos_hydrometeor::cp_vapor, scale_atmos_hydrometeor::cp_water, scale_atmos_hydrometeor::cv_vapor, scale_atmos_hydrometeor::cv_water, and scale_prc::prc_abort().

Referenced by atmos_hydrostatic_buildrho_3d().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ atmos_hydrostatic_buildrho_3d()

subroutine scale_atmos_hydrostatic::atmos_hydrostatic_buildrho_3d ( integer, intent(in)  KA,
integer, intent(in)  KS,
integer, intent(in)  KE,
integer, intent(in)  IA,
integer, intent(in)  IS,
integer, intent(in)  IE,
integer, intent(in)  JA,
integer, intent(in)  JS,
integer, intent(in)  JE,
real(rp), dimension(ka,ia,ja), intent(in)  pott,
real(rp), dimension (ka,ia,ja), intent(in)  qv,
real(rp), dimension (ka,ia,ja), intent(in)  qc,
real(rp), dimension(ia,ja), intent(in)  pres_sfc,
real(rp), dimension(ia,ja), intent(in)  pott_sfc,
real(rp), dimension (ia,ja), intent(in)  qv_sfc,
real(rp), dimension (ia,ja), intent(in)  qc_sfc,
real(rp), dimension( ka,ia,ja), intent(in)  cz,
real(rp), dimension(0:ka,ia,ja), intent(in)  fz,
real(rp), dimension(ia,ja), intent(in)  area,
real(rp), dimension(ka,ia,ja), intent(out)  dens,
real(rp), dimension(ka,ia,ja), intent(out)  temp,
real(rp), dimension(ka,ia,ja), intent(out)  pres,
real(rp), dimension(ia,ja), intent(out)  temp_sfc 
)

Build up density from surface (3D)

Parameters
[in]pottpotential temperature [K]
[in]qvwater vapor [kg/kg]
[in]qcliquid water [kg/kg]
[in]pres_sfcsurface pressure [Pa]
[in]pott_sfcsurface potential temperature [K]
[in]qv_sfcsurface water vapor [kg/kg]
[in]qc_sfcsurface liquid water [kg/kg]
[out]densdensity [kg/m3]
[out]temptemperature [K]
[out]prespressure [Pa]
[out]temp_sfcsurface temperature [K]

Definition at line 271 of file scale_atmos_hydrostatic.F90.

271  use scale_statistics, only: &
272  statistics_horizontal_mean
273  implicit none
274 
275  integer, intent(in) :: KA, KS, KE
276  integer, intent(in) :: IA, IS, IE
277  integer, intent(in) :: JA, JS, JE
278 
279  real(RP), intent(in) :: pott(KA,IA,JA)
280  real(RP), intent(in) :: qv (KA,IA,JA)
281  real(RP), intent(in) :: qc (KA,IA,JA)
282  real(RP), intent(in) :: pres_sfc(IA,JA)
283  real(RP), intent(in) :: pott_sfc(IA,JA)
284  real(RP), intent(in) :: qv_sfc (IA,JA)
285  real(RP), intent(in) :: qc_sfc (IA,JA)
286  real(RP), intent(in) :: cz( KA,IA,JA)
287  real(RP), intent(in) :: fz(0:KA,IA,JA)
288  real(RP), intent(in) :: area(IA,JA)
289 
290  real(RP), intent(out) :: dens(KA,IA,JA)
291  real(RP), intent(out) :: temp(KA,IA,JA)
292  real(RP), intent(out) :: pres(KA,IA,JA)
293  real(RP), intent(out) :: temp_sfc(IA,JA)
294 
295  real(RP) :: dz(KA,IA,JA), dz_top(IA,JA)
296 
297  ! TOA
298  real(RP) :: pott_toa(IA,JA)
299  real(RP) :: qv_toa (IA,JA)
300  real(RP) :: qc_toa (IA,JA)
301  real(RP) :: dens_toa(IA,JA)
302  real(RP) :: temp_toa(IA,JA)
303  real(RP) :: pres_toa(IA,JA)
304 
305  real(RP) :: dens_mean
306 
307  integer :: k, i, j
308  !---------------------------------------------------------------------------
309 
310  !--- from surface to lowermost atmosphere
311  !$omp parallel do OMP_SCHEDULE_ collapse(2)
312  do j = js, je
313  do i = is, ie
314  call atmos_hydrostatic_buildrho_1d( ka, ks, ke, &
315  pott(:,i,j), qv(:,i,j), qc(:,i,j), & ! [IN]
316  pres_sfc(i,j), pott_sfc(i,j), qv_sfc(i,j), qc_sfc(i,j), & ! [IN]
317  cz(:,i,j), fz(:,i,j), & ! [IN]
318  dens(:,i,j), temp(:,i,j), pres(:,i,j), & ! [OUT]
319  temp_sfc(i,j) ) ! [OUT]
320  end do
321  end do
322 
323  !$omp parallel do OMP_SCHEDULE_ collapse(2)
324  do j = js, je
325  do i = is, ie
326  do k = ks, ke-1
327  dz(k,i,j) = cz(k+1,i,j) - cz(k,i,j)
328  end do
329  dz_top(i,j) = fz(ke,i,j) - cz(ke,i,j) ! distance from cell center to TOA
330 
331  ! value at TOA
332  pott_toa(i,j) = pott(ke,i,j)
333  qv_toa(i,j) = qv(ke,i,j)
334  qc_toa(i,j) = qc(ke,i,j)
335  end do
336  end do
337 
338  call atmos_hydrostatic_buildrho_atmos_2d( ia, is, ie, ja, js, je, &
339  pott_toa(:,:), qv_toa(:,:), qc_toa(:,:), & ! [IN]
340  dens(ke,:,:), pott(ke,:,:), qv(ke,:,:), qc(ke,:,:), & ! [IN]
341  dz_top(:,:), ke+1, & ! [IN]
342  dens_toa(:,:), temp_toa(:,:), pres_toa(:,:) ) ! [OUT]
343 
344  call statistics_horizontal_mean( ia, is, ie, ja, js, je, &
345  dens_toa(:,:), area(:,:), & ! [IN]
346  dens_mean ) ! [OUT]
347 
348  !$omp parallel do OMP_SCHEDULE_ collapse(2)
349  do j = js, je
350  do i = is, ie
351  dens_toa(i,j) = dens_mean
352  enddo
353  enddo
354 
355  call atmos_hydrostatic_buildrho_atmos_rev_2d( ia, is, ie, ja, js, je, &
356  pott(ke,:,:), qv(ke,:,:), qc(ke,:,:), & ! [IN]
357  dens_toa(:,:), pott_toa(:,:), qv_toa(:,:), qc_toa(:,:), & ! [IN]
358  dz_top(:,:), ke+1, & ! [IN]
359  dens(ke,:,:), temp(ke,:,:), pres(ke,:,:) ) ! [OUT]
360 
361  !--- from top of atmosphere to lowermost atmosphere
362  call atmos_hydrostatic_buildrho_atmos_rev_3d( ka, ks, ke, ia, is, ie, ja, js, je, &
363  pott(:,:,:), qv(:,:,:), qc(:,:,:), & ! [IN]
364  dz(:,:,:), & ! [IN]
365  dens(:,:,:), & ! [INOUT]
366  temp(:,:,:), pres(:,:,:) ) ! [OUT]
367 
368  return

References atmos_hydrostatic_buildrho_1d().

Here is the call graph for this function:

◆ atmos_hydrostatic_buildrho_real_3d()

subroutine scale_atmos_hydrostatic::atmos_hydrostatic_buildrho_real_3d ( integer, intent(in)  KA,
integer, intent(in)  KS,
integer, intent(in)  KE,
integer, intent(in)  IA,
integer, intent(in)  IS,
integer, intent(in)  IE,
integer, intent(in)  JA,
integer, intent(in)  JS,
integer, intent(in)  JE,
real(rp), dimension(ka,ia,ja), intent(in)  pott,
real(rp), dimension (ka,ia,ja), intent(in)  qv,
real(rp), dimension (ka,ia,ja), intent(in)  qc,
real(rp), dimension (ka,ia,ja), intent(in)  cz,
real(rp), dimension(ka,ia,ja), intent(inout)  pres,
real(rp), dimension(ka,ia,ja), intent(out)  dens,
real(rp), dimension(ka,ia,ja), intent(out)  temp 
)

Build up density from surface (3D), not to reverse from TOA.

Parameters
[in]pottpotential temperature [K]
[in]qvwater vapor [kg/kg]
[in]qcliquid water [kg/kg]
[in,out]prespressure [Pa]
[out]densdensity [kg/m3]
[out]temptemperature [K]

Definition at line 379 of file scale_atmos_hydrostatic.F90.

379  use scale_atmos_hydrometeor, only: &
380  cv_vapor, &
381  cv_water, &
382  cp_vapor, &
383  cp_water
384  use scale_const, only: &
385  undef => const_undef
386  implicit none
387  integer, intent(in) :: KA, KS, KE
388  integer, intent(in) :: IA, IS, IE
389  integer, intent(in) :: JA, JS, JE
390 
391  real(RP), intent(in) :: pott(KA,IA,JA)
392  real(RP), intent(in) :: qv (KA,IA,JA)
393  real(RP), intent(in) :: qc (KA,IA,JA)
394  real(RP), intent(in) :: cz (KA,IA,JA)
395 
396  real(RP), intent(inout) :: pres(KA,IA,JA)
397 
398  real(RP), intent(out) :: dens(KA,IA,JA)
399  real(RP), intent(out) :: temp(KA,IA,JA)
400 
401  real(RP) :: dz(KA,IA,JA)
402 
403  real(RP) :: pott_toa(IA,JA)
404  real(RP) :: qv_toa (IA,JA)
405  real(RP) :: qc_toa (IA,JA)
406 
407  real(RP) :: Rtot
408  real(RP) :: CVtot
409  real(RP) :: CPtot
410 
411  integer :: kref(IA,JA)
412  integer :: k, i, j
413  !---------------------------------------------------------------------------
414 
415  !--- from surface to lowermost atmosphere
416 
417  !$omp parallel do OMP_SCHEDULE_ collapse(2)
418  do j = js, je
419  do i = is, ie
420  do k = ks, ke-1
421  dz(k,i,j) = cz(k+1,i,j) - cz(k,i,j) ! distance from cell center to cell center
422  enddo
423  enddo
424  enddo
425 
426  !$omp parallel do OMP_SCHEDULE_ collapse(2)
427  do j = js, je
428  do i = is, ie
429  pott_toa(i,j) = pott(ke,i,j)
430  qv_toa(i,j) = qv(ke,i,j)
431  qc_toa(i,j) = qc(ke,i,j)
432  enddo
433  enddo
434 
435  !$omp parallel do OMP_SCHEDULE_ collapse(2)
436  do j = js, je
437  do i = is, ie
438  kref(i,j) = hydrostatic_buildrho_real_kref + ks - 1
439  do k = kref(i,j), ke
440  if ( pres(k,i,j) .ne. undef ) then
441  kref(i,j) = k
442  exit
443  end if
444  end do
445  end do
446  end do
447 
448  ! calc density at reference level
449  !$omp parallel do OMP_SCHEDULE_ collapse(2) &
450  !$omp private(Rtot,CVtot,CPtot,k)
451  do j = js, je
452  do i = is, ie
453  k = kref(i,j)
454  rtot = rdry * ( 1.0_rp - qv(k,i,j) - qc(k,i,j) ) &
455  + rvap * qv(k,i,j)
456  cvtot = cvdry * ( 1.0_rp - qv(k,i,j) - qc(k,i,j) ) &
457  + cv_vapor * qv(k,i,j) &
458  + cv_water * qc(k,i,j)
459  cptot = cpdry * ( 1.0_rp - qv(k,i,j) - qc(k,i,j) ) &
460  + cp_vapor * qv(k,i,j) &
461  + cp_water * qc(k,i,j)
462  dens(k,i,j) = p00 / ( rtot * pott(k,i,j) ) * ( pres(k,i,j)/p00 )**(cvtot/cptot)
463  enddo
464  enddo
465 
466  !--- from lowermost atmosphere to top of atmosphere
467  call atmos_hydrostatic_buildrho_atmos_3d( ka, ks, ke, ia, is, ie, ja, js, je, &
468  pott(:,:,:), qv(:,:,:), qc(:,:,:), & ! [IN]
469  dz(:,:,:), & ! [IN]
470  dens(:,:,:), & ! [INOUT]
471  temp(:,:,:), pres(:,:,:), & ! [OUT]
472  kref = kref ) ! [IN]
473  call atmos_hydrostatic_buildrho_atmos_rev_3d( ka, ks, ke, ia, is, ie, ja, js, je, &
474  pott(:,:,:), qv(:,:,:), qc(:,:,:), & ! [IN]
475  dz(:,:,:), & ! [IN]
476  dens(:,:,:), & ! [INOUT]
477  temp(:,:,:), pres(:,:,:), & ! [OUT]
478  kref = kref ) ! [IN]
479 
480 !!$ call ATMOS_HYDROSTATIC_buildrho_atmos_2D( IA, IS, IE, JA, JS, JE, &
481 !!$ pott_toa(:,:), qv_toa(:,:), qc_toa(:,:), & ! [IN]
482 !!$ dens(KE,:,:), & ! [IN]
483 !!$ pott(KE,:,:), qv(KE,:,:), qc(KE,:,:), & ! [IN]
484 !!$ dz(KE+1,:,:), KE+1, & ! [IN]
485 !!$ dens_toa(:,:), temp_toa(:,:), pres_toa(:,:) ) ! [OUT]
486 
487  ! density at TOA
488  dens( 1:ks-1,:,:) = 0.0_rp ! fill dummy
489 !!$ dens(KE+2:KA ,:,:) = 0.0_RP ! fill dummy
490  dens(ke+1:ka ,:,:) = 0.0_rp ! fill dummy
491 
492  return

References scale_const::const_undef, scale_atmos_hydrometeor::cp_vapor, scale_atmos_hydrometeor::cp_water, scale_atmos_hydrometeor::cv_vapor, and scale_atmos_hydrometeor::cv_water.

◆ atmos_hydrostatic_buildrho_atmos_0d()

subroutine scale_atmos_hydrostatic::atmos_hydrostatic_buildrho_atmos_0d ( real(rp), intent(in)  pott_L2,
real(rp), intent(in)  qv_L2,
real(rp), intent(in)  qc_L2,
real(rp), intent(in)  dens_L1,
real(rp), intent(in)  pott_L1,
real(rp), intent(in)  qv_L1,
real(rp), intent(in)  qc_L1,
real(rp), intent(in)  dz,
integer, intent(in)  k,
real(rp), intent(out)  dens_L2,
real(rp), intent(out)  temp_L2,
real(rp), intent(out)  pres_L2 
)

Build up density (0D)

Parameters
[in]pott_l2potential temperature at layer 2 [K]
[in]qv_l2water vapor at layer 2 [kg/kg]
[in]qc_l2liquid water at layer 2 [kg/kg]
[in]dens_l1density at layer 1 [Pa]
[in]pott_l1potential temperature at layer 1 [K]
[in]qv_l1water vapor at layer 1 [kg/kg]
[in]qc_l1liquid water at layer 1 [kg/kg]
[in]dzdistance from layer 1 to layer 2 [m]
[in]kfor monitor
[out]dens_l2density at layer 2 [kg/m3]
[out]temp_l2temperature at layer 2 [K]
[out]pres_l2pressure at layer 2 [Pa]

Definition at line 504 of file scale_atmos_hydrostatic.F90.

504  use scale_prc, only: &
505  prc_abort
506  use scale_atmos_hydrometeor, only: &
507  cv_vapor, &
508  cv_water, &
509  cp_vapor, &
510  cp_water
511  implicit none
512  real(RP), intent(in) :: pott_L2
513  real(RP), intent(in) :: qv_L2
514  real(RP), intent(in) :: qc_L2
515  real(RP), intent(in) :: dens_L1
516  real(RP), intent(in) :: pott_L1
517  real(RP), intent(in) :: qv_L1
518  real(RP), intent(in) :: qc_L1
519  real(RP), intent(in) :: dz
520  integer, intent(in) :: k
521 
522  real(RP), intent(out) :: dens_L2
523  real(RP), intent(out) :: temp_L2
524  real(RP), intent(out) :: pres_L2
525 
526  real(RP) :: Rtot_L1 , Rtot_L2
527  real(RP) :: CVtot_L1 , CVtot_L2
528  real(RP) :: CPtot_L1 , CPtot_L2
529  real(RP) :: CPovCV_L1, CPovCV_L2
530 
531  real(RP) :: pres_L1
532  real(RP) :: dens_s, dhyd, dgrd
533  integer :: ite
534  logical :: converged
535  !---------------------------------------------------------------------------
536 
537  rtot_l1 = rdry * ( 1.0_rp - qv_l1 - qc_l1 ) &
538  + rvap * qv_l1
539  cvtot_l1 = cvdry * ( 1.0_rp - qv_l1 - qc_l1 ) &
540  + cv_vapor * qv_l1 &
541  + cv_water * qc_l1
542  cptot_l1 = cpdry * ( 1.0_rp - qv_l1 - qc_l1 ) &
543  + cp_vapor * qv_l1 &
544  + cp_water * qc_l1
545  cpovcv_l1 = cptot_l1 / cvtot_l1
546 
547  rtot_l2 = rdry * ( 1.0_rp - qv_l2 - qc_l2 ) &
548  + rvap * qv_l2
549  cvtot_l2 = cvdry * ( 1.0_rp - qv_l2 - qc_l2 ) &
550  + cv_vapor * qv_l2 &
551  + cv_water * qc_l2
552  cptot_l2 = cpdry * ( 1.0_rp - qv_l2 - qc_l2 ) &
553  + cp_vapor * qv_l2 &
554  + cp_water * qc_l2
555  cpovcv_l2 = cptot_l2 / cvtot_l2
556 
557  dens_s = 0.0_rp
558  dens_l2 = dens_l1 ! first guess
559 
560  pres_l1 = p00 * ( dens_l1 * rtot_l1 * pott_l1 / p00 )**cpovcv_l1
561 
562  converged = .false.
563  do ite = 1, itelim
564  if ( abs(dens_l2-dens_s) <= criteria ) then
565  converged = .true.
566  exit
567  endif
568 
569  dens_s = dens_l2
570  pres_l2 = p00 * ( dens_s * rtot_l2 * pott_l2 / p00 )**cpovcv_l2
571 
572  dhyd = + ( pres_l1 - pres_l2 ) / dz & ! dp/dz
573  - grav * 0.5_rp * ( dens_l1 + dens_s ) ! rho*g
574 
575  dgrd = - pres_l2 * cpovcv_l2 / dens_s / dz &
576  - grav * 0.5_rp
577 
578  dens_l2 = dens_s - dhyd/dgrd
579 
580  if ( dens_l2*0.0_rp /= 0.0_rp ) exit
581  enddo
582 
583  if ( .NOT. converged ) then
584  log_error("ATMOS_HYDROSTATIC_buildrho_atmos_0D",*) 'iteration not converged!', &
585  k,dens_l2,ite,dens_s,dhyd,dgrd
586  call prc_abort
587  endif
588 
589  pres_l2 = p00 * ( dens_l2 * rtot_l2 * pott_l2 / p00 )**cpovcv_l2
590  temp_l2 = pres_l2 / ( dens_l2 * rtot_l2 )
591 
592  return

References scale_atmos_hydrometeor::cp_vapor, scale_atmos_hydrometeor::cp_water, scale_atmos_hydrometeor::cv_vapor, scale_atmos_hydrometeor::cv_water, and scale_prc::prc_abort().

Referenced by atmos_hydrostatic_buildrho_1d(), and atmos_hydrostatic_buildrho_atmos_rev_1d().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ atmos_hydrostatic_buildrho_atmos_1d()

subroutine scale_atmos_hydrostatic::atmos_hydrostatic_buildrho_atmos_1d ( integer, intent(in)  KA,
integer, intent(in)  KS,
integer, intent(in)  KE,
real(rp), dimension(ka), intent(in)  pott,
real(rp), dimension (ka), intent(in)  qv,
real(rp), dimension (ka), intent(in)  qc,
real(rp), dimension (ka), intent(in)  dz,
real(rp), dimension(ka), intent(inout)  dens,
real(rp), dimension(ka), intent(out)  temp,
real(rp), dimension(ka), intent(out)  pres 
)

Build up density from lowermost atmosphere (1D)

Parameters
[in]pottpotential temperature [K]
[in]qvwater vapor [kg/kg]
[in]qcliquid water [kg/kg]
[in,out]densdensity [kg/m3]
[out]temptemperature [K]
[out]prespressure [Pa]

Definition at line 604 of file scale_atmos_hydrostatic.F90.

604  use scale_const, only: &
605  undef => const_undef
606  use scale_prc, only: &
607  prc_abort
608  use scale_atmos_hydrometeor, only: &
609  cv_vapor, &
610  cv_water, &
611  cp_vapor, &
612  cp_water
613  implicit none
614  integer, intent(in) :: KA, KS, KE
615 
616  real(RP), intent(in) :: pott(KA)
617  real(RP), intent(in) :: qv (KA)
618  real(RP), intent(in) :: qc (KA)
619  real(RP), intent(in) :: dz (KA)
620 
621  real(RP), intent(inout) :: dens(KA)
622 
623  real(RP), intent(out) :: temp(KA)
624  real(RP), intent(out) :: pres(KA)
625 
626  real(RP) :: Rtot (KA)
627  real(RP) :: CPovCV(KA)
628  real(RP) :: CVtot
629  real(RP) :: CPtot
630 
631  real(RP) :: dens_s, dhyd, dgrd
632  integer :: ite
633  logical :: converged
634 
635  integer :: k
636  !---------------------------------------------------------------------------
637 
638  do k = ks, ke
639  rtot(k) = rdry * ( 1.0_rp - qv(k) - qc(k) ) &
640  + rvap * qv(k)
641  cvtot = cvdry * ( 1.0_rp - qv(k) - qc(k) ) &
642  + cv_vapor * qv(k) &
643  + cv_water * qc(k)
644  cptot = cpdry * ( 1.0_rp - qv(k) - qc(k) ) &
645  + cp_vapor * qv(k) &
646  + cp_water * qc(k)
647  cpovcv(k) = cptot / cvtot
648  enddo
649 
650  pres(ks) = p00 * ( dens(ks) * rtot(ks) * pott(ks) / p00 )**cpovcv(ks)
651 
652  do k = ks+1, ke
653 
654  dens_s = 0.0_rp
655  dens(k) = dens(k-1) ! first guess
656 
657  converged = .false.
658  do ite = 1, itelim
659  if ( abs(dens(k)-dens_s) <= criteria ) then
660  converged = .true.
661  exit
662  endif
663 
664  dens_s = dens(k)
665  pres(k) = p00 * ( dens_s * rtot(k) * pott(k) / p00 )**cpovcv(k)
666 
667  dhyd = + ( pres(k-1) - pres(k) ) / dz(k-1) & ! dpdz
668  - grav * 0.5_rp * ( dens(k-1) + dens_s ) ! rho*g
669 
670  dgrd = - cpovcv(k) * pres(k) / dens_s / dz(k-1) &
671  - grav * 0.5_rp
672 
673  dens(k) = dens_s - dhyd/dgrd
674 
675  if ( dens(k)*0.0_rp /= 0.0_rp ) exit
676  enddo
677 
678  if ( .NOT. converged ) then
679  log_error("ATMOS_HYDROSTATIC_buildrho_atmos_1D",*) 'iteration not converged!', &
680  k,dens(k),ite,dens_s,dhyd,dgrd
681  call prc_abort
682  endif
683 
684  pres(k) = p00 * ( dens(k) * rtot(k) * pott(k) / p00 )**cpovcv(k)
685 
686  enddo
687 
688  do k = ks, ke
689  temp(k) = pres(k) / ( dens(k) * rtot(k) )
690  enddo
691 
692  dens(ke+1:ka ) = dens(ke)
693  pres(ke+1:ka ) = pres(ke)
694  temp(ke+1:ka ) = temp(ke)
695 
696  return

References scale_const::const_undef, scale_atmos_hydrometeor::cp_vapor, scale_atmos_hydrometeor::cp_water, scale_atmos_hydrometeor::cv_vapor, scale_atmos_hydrometeor::cv_water, and scale_prc::prc_abort().

Referenced by atmos_hydrostatic_buildrho_1d(), and atmos_hydrostatic_buildrho_atmos_rev_1d().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ atmos_hydrostatic_buildrho_atmos_rev_1d()

subroutine scale_atmos_hydrostatic::atmos_hydrostatic_buildrho_atmos_rev_1d ( integer, intent(in)  KA,
integer, intent(in)  KS,
integer, intent(in)  KE,
real(rp), dimension(ka), intent(in)  pott,
real(rp), dimension (ka), intent(in)  qv,
real(rp), dimension (ka), intent(in)  qc,
real(rp), dimension (ka), intent(in)  dz,
real(rp), dimension(ka), intent(inout)  dens,
real(rp), dimension(ka), intent(out)  temp,
real(rp), dimension(ka), intent(out)  pres 
)

Build up density from upermost atmosphere (1D)

Parameters
[in]pottpotential temperature [K]
[in]qvwater vapor [kg/kg]
[in]qcliquid water [kg/kg]
[in,out]densdensity [kg/m3]
[out]temptemperature [K]
[out]prespressure [Pa]

Definition at line 708 of file scale_atmos_hydrostatic.F90.

708  use scale_const, only: &
709  undef => const_undef
710  use scale_prc, only: &
711  prc_abort
712  use scale_atmos_hydrometeor, only: &
713  cv_vapor, &
714  cv_water, &
715  cp_vapor, &
716  cp_water
717  implicit none
718  integer, intent(in) :: KA, KS, KE
719 
720  real(RP), intent(in) :: pott(KA)
721  real(RP), intent(in) :: qv (KA)
722  real(RP), intent(in) :: qc (KA)
723  real(RP), intent(in) :: dz (KA)
724 
725  real(RP), intent(inout) :: dens(KA)
726 
727  real(RP), intent(out) :: temp(KA)
728  real(RP), intent(out) :: pres(KA)
729 
730  real(RP) :: Rtot (KA)
731  real(RP) :: CPovCV(KA)
732  real(RP) :: CVtot
733  real(RP) :: CPtot
734 
735  real(RP) :: dens_s, dhyd, dgrd
736  integer :: ite
737  logical :: converged
738 
739  integer :: k
740  !---------------------------------------------------------------------------
741 
742  do k = ks, ke
743  rtot(k) = rdry * ( 1.0_rp - qv(k) - qc(k) ) &
744  + rvap * qv(k)
745  cvtot = cvdry * ( 1.0_rp - qv(k) - qc(k) ) &
746  + cv_vapor * qv(k) &
747  + cv_water * qc(k)
748  cptot = cpdry * ( 1.0_rp - qv(k) - qc(k) ) &
749  + cp_vapor * qv(k) &
750  + cp_water * qc(k)
751  cpovcv(k) = cptot / cvtot
752  enddo
753 
754  pres(ke) = p00 * ( dens(ke) * rtot(ke) * pott(ke) / p00 )**cpovcv(ke)
755 
756  do k = ke-1, ks, -1
757 
758  dens_s = 0.0_rp
759  dens(k) = dens(k+1) ! first guess
760 
761  converged = .false.
762  do ite = 1, itelim
763  if ( abs(dens(k)-dens_s) <= criteria ) then
764  converged = .true.
765  exit
766  endif
767 
768  dens_s = dens(k)
769  pres(k) = p00 * ( dens_s * rtot(k) * pott(k) / p00 )**cpovcv(k)
770 
771  dhyd = - ( pres(k+1) - pres(k) ) / dz(k) & ! dpdz
772  - grav * 0.5_rp * ( dens(k+1) + dens_s ) ! rho*g
773 
774  dgrd = + cpovcv(k) * pres(k) / dens_s / dz(k) &
775  - grav * 0.5_rp
776 
777  dens(k) = dens_s - dhyd/dgrd
778 
779  if ( dens(k)*0.0_rp /= 0.0_rp ) exit
780  enddo
781 
782  if ( .NOT. converged ) then
783  log_error("ATMOS_HYDROSTATIC_buildrho_atmos_rev_1D",*) 'iteration not converged!', &
784  k,dens(k),ite,dens_s,dhyd,dgrd
785  call prc_abort
786  endif
787 
788  pres(k) = p00 * ( dens(k) * rtot(k) * pott(k) / p00 )**cpovcv(k)
789 
790  enddo
791 
792  do k = ks, ke
793  temp(k) = pres(k) / ( dens(k) * rtot(k) )
794  enddo
795 
796  dens( 1:ks-1) = dens(ks)
797  pres( 1:ks-1) = pres(ks)
798  temp( 1:ks-1) = temp(ks)
799 
800  return

References atmos_hydrostatic_buildrho_atmos_0d(), atmos_hydrostatic_buildrho_atmos_1d(), scale_const::const_undef, scale_atmos_hydrometeor::cp_vapor, scale_atmos_hydrometeor::cp_water, scale_atmos_hydrometeor::cv_vapor, scale_atmos_hydrometeor::cv_water, and scale_prc::prc_abort().

Here is the call graph for this function:

◆ atmos_hydrostatic_buildrho_bytemp_3d()

subroutine scale_atmos_hydrostatic::atmos_hydrostatic_buildrho_bytemp_3d ( integer, intent(in)  KA,
integer, intent(in)  KS,
integer, intent(in)  KE,
integer, intent(in)  IA,
integer, intent(in)  IS,
integer, intent(in)  IE,
integer, intent(in)  JA,
integer, intent(in)  JS,
integer, intent(in)  JE,
real(rp), dimension(ka,ia,ja), intent(in)  temp,
real(rp), dimension (ka,ia,ja), intent(in)  qv,
real(rp), dimension (ka,ia,ja), intent(in)  qc,
real(rp), dimension(ia,ja), intent(in)  pres_sfc,
real(rp), dimension(ia,ja), intent(in)  temp_sfc,
real(rp), dimension (ia,ja), intent(in)  qv_sfc,
real(rp), dimension (ia,ja), intent(in)  qc_sfc,
real(rp), dimension(ka,ia,ja), intent(in)  cz,
real(rp), dimension(ka,ia,ja), intent(in)  fz,
real(rp), dimension(ka,ia,ja), intent(out)  dens,
real(rp), dimension(ka,ia,ja), intent(out)  pott,
real(rp), dimension(ka,ia,ja), intent(out)  pres,
real(rp), dimension(ia,ja), intent(out)  pott_sfc 
)

Build up density from surface (3D)

Parameters
[in]temptemperature [K]
[in]qvwater vapor [kg/kg]
[in]qcliquid water [kg/kg]
[in]pres_sfcsurface pressure [Pa]
[in]temp_sfcsurface temperature [K]
[in]qv_sfcsurface water vapor [kg/kg]
[in]qc_sfcsurface liquid water [kg/kg]
[out]densdensity [kg/m3]
[out]pottpotential temperature [K]
[out]prespressure [Pa]
[out]pott_sfcsurface potential temperature [K]

Definition at line 1139 of file scale_atmos_hydrostatic.F90.

1139  implicit none
1140  integer, intent(in) :: KA, KS, KE
1141  integer, intent(in) :: IA, IS, IE
1142  integer, intent(in) :: JA, JS, JE
1143 
1144  real(RP), intent(in) :: temp(KA,IA,JA)
1145  real(RP), intent(in) :: qv (KA,IA,JA)
1146  real(RP), intent(in) :: qc (KA,IA,JA)
1147  real(RP), intent(in) :: pres_sfc(IA,JA)
1148  real(RP), intent(in) :: temp_sfc(IA,JA)
1149  real(RP), intent(in) :: qv_sfc (IA,JA)
1150  real(RP), intent(in) :: qc_sfc (IA,JA)
1151  real(RP), intent(in) :: cz(KA,IA,JA)
1152  real(RP), intent(in) :: fz(KA,IA,JA)
1153 
1154  real(RP), intent(out) :: dens(KA,IA,JA)
1155  real(RP), intent(out) :: pott(KA,IA,JA)
1156  real(RP), intent(out) :: pres(KA,IA,JA)
1157  real(RP), intent(out) :: pott_sfc(IA,JA)
1158 
1159  integer :: i, j
1160  !---------------------------------------------------------------------------
1161 
1162  !--- from surface to lowermost atmosphere
1163  !$omp parallel do OMP_SCHEDULE_ collapse(2)
1164  do j = js, je
1165  do i = is, ie
1166  call atmos_hydrostatic_buildrho_bytemp_1d( ka, ks, ke, &
1167  temp(:,i,j), qv(:,i,j), qc(:,i,j), & ! [IN]
1168  pres_sfc(i,j), temp_sfc(i,j), qv_sfc(i,j), qc_sfc(i,j), & ! [IN]
1169  cz(:,i,j), fz(:,i,j), & ! [IN]
1170  dens(:,i,j), pott(:,i,j), pres(:,i,j), & ! [OUT]
1171  pott_sfc(i,j) ) ! [OUT]
1172  enddo
1173  enddo
1174 
1175  return

References scale_atmos_hydrometeor::cp_vapor, scale_atmos_hydrometeor::cp_water, scale_atmos_hydrometeor::cv_vapor, scale_atmos_hydrometeor::cv_water, and scale_prc::prc_abort().

Here is the call graph for this function:

◆ atmos_hydrostatic_buildrho_bytemp_atmos_rev_1d()

subroutine scale_atmos_hydrostatic::atmos_hydrostatic_buildrho_bytemp_atmos_rev_1d ( integer, intent(in)  KA,
integer, intent(in)  KS,
integer, intent(in)  KE,
real(rp), dimension(ka), intent(in)  temp,
real(rp), dimension (ka), intent(in)  qv,
real(rp), dimension (ka), intent(in)  qc,
real(rp), dimension (ka), intent(in)  dz,
real(rp), dimension(ka), intent(inout)  dens,
real(rp), dimension(ka), intent(out)  pott,
real(rp), dimension(ka), intent(out)  pres 
)

Build up density from upermost atmosphere (1D)

Parameters
[in]temptemperature [K]
[in]qvwater vapor [kg/kg]
[in]qcliquid water [kg/kg]
[in,out]densdensity [kg/m3]
[out]pottpotential temperature [K]
[out]prespressure [Pa]

Definition at line 1284 of file scale_atmos_hydrostatic.F90.

1284  use scale_prc, only: &
1285  prc_abort
1286  use scale_atmos_hydrometeor, only: &
1287  cv_vapor, &
1288  cv_water, &
1289  cp_vapor, &
1290  cp_water
1291  implicit none
1292  integer, intent(in) :: KA, KS, KE
1293 
1294  real(RP), intent(in) :: temp(KA)
1295  real(RP), intent(in) :: qv (KA)
1296  real(RP), intent(in) :: qc (KA)
1297  real(RP), intent(in) :: dz (KA)
1298 
1299  real(RP), intent(inout) :: dens(KA)
1300 
1301  real(RP), intent(out) :: pott(KA)
1302  real(RP), intent(out) :: pres(KA)
1303 
1304  real(RP) :: Rtot (KA)
1305  real(RP) :: CVtot (KA)
1306  real(RP) :: CPtot (KA)
1307 
1308  real(RP) :: RovCP
1309  real(RP) :: dens_s, dhyd, dgrd
1310  integer :: ite
1311  logical :: converged
1312 
1313  integer :: k
1314  !---------------------------------------------------------------------------
1315 
1316  do k = ks, ke
1317  rtot(k) = rdry * ( 1.0_rp - qv(k) - qc(k) ) &
1318  + rvap * qv(k)
1319  cvtot(k) = cvdry * ( 1.0_rp - qv(k) - qc(k) ) &
1320  + cv_vapor * qv(k) &
1321  + cv_water * qc(k)
1322  cptot(k) = cpdry * ( 1.0_rp - qv(k) - qc(k) ) &
1323  + cp_vapor * qv(k) &
1324  + cp_water * qc(k)
1325  enddo
1326 
1327  pres(ke) = dens(ke) * rtot(ke) * temp(ke)
1328 
1329  do k = ke-1, ke, -1
1330 
1331  dens_s = 0.0_rp
1332  dens(k) = dens(k+1) ! first guess
1333 
1334  converged = .false.
1335  do ite = 1, itelim
1336  if ( abs(dens(k)-dens_s) <= criteria ) then
1337  converged = .true.
1338  exit
1339  endif
1340 
1341  dens_s = dens(k)
1342 
1343  dhyd = - ( pres(k+1) - dens_s * rtot(k) * temp(k) ) / dz(k) & ! dp/dz
1344  - grav * 0.5_rp * ( dens(k+1) + dens_s ) ! rho*g
1345 
1346  dgrd = + rtot(k) * temp(k) / dz(k) &
1347  - 0.5_rp * grav
1348 
1349  dens(k) = dens_s - dhyd/dgrd
1350 
1351  if ( dens(k)*0.0_rp /= 0.0_rp ) exit
1352  enddo
1353 
1354  if ( .NOT. converged ) then
1355  log_error("ATMOS_HYDROSTATIC_buildrho_bytemp_atmos_rev_1D",*) 'iteration not converged!', &
1356  k,dens(k),ite,dens_s,dhyd,dgrd
1357  call prc_abort
1358  endif
1359 
1360  pres(k) = dens(k) * rtot(k) * temp(k)
1361 
1362  enddo
1363 
1364  do k = ks, ke
1365  rovcp = rtot(k) / cptot(k)
1366  pott(k) = temp(k) * ( p00 / pres(k) )**rovcp
1367  enddo
1368 
1369  return

References scale_atmos_hydrometeor::cp_vapor, scale_atmos_hydrometeor::cp_water, scale_atmos_hydrometeor::cv_vapor, scale_atmos_hydrometeor::cv_water, and scale_prc::prc_abort().

Here is the call graph for this function:

◆ atmos_hydrostatic_buildrho_bytemp_atmos_3d()

subroutine scale_atmos_hydrostatic::atmos_hydrostatic_buildrho_bytemp_atmos_3d ( integer, intent(in)  KA,
integer, intent(in)  KS,
integer, intent(in)  KE,
integer, intent(in)  IA,
integer, intent(in)  IS,
integer, intent(in)  IE,
integer, intent(in)  JA,
integer, intent(in)  JS,
integer, intent(in)  JE,
real(rp), dimension(ka,ia,ja), intent(in)  temp,
real(rp), dimension (ka,ia,ja), intent(in)  qv,
real(rp), dimension (ka,ia,ja), intent(in)  qc,
real(rp), dimension (ka,ia,ja), intent(in)  dz,
real(rp), dimension(ka,ia,ja), intent(inout)  dens,
real(rp), dimension(ka,ia,ja), intent(out)  pott,
real(rp), dimension(ka,ia,ja), intent(out)  pres 
)

Build up density from lowermost atmosphere (3D)

Parameters
[in]temptemperature [K]
[in]qvwater vapor [kg/kg]
[in]qcliquid water [kg/kg]
[in,out]densdensity [kg/m3]
[out]pottpotential temperature [K]
[out]prespressure [Pa]

Definition at line 1380 of file scale_atmos_hydrostatic.F90.

1380  implicit none
1381  integer, intent(in) :: KA, KS, KE
1382  integer, intent(in) :: IA, IS, IE
1383  integer, intent(in) :: JA, JS, JE
1384 
1385  real(RP), intent(in) :: temp(KA,IA,JA)
1386  real(RP), intent(in) :: qv (KA,IA,JA)
1387  real(RP), intent(in) :: qc (KA,IA,JA)
1388  real(RP), intent(in) :: dz (KA,IA,JA)
1389 
1390  real(RP), intent(inout) :: dens(KA,IA,JA)
1391  real(RP), intent(out) :: pott(KA,IA,JA)
1392  real(RP), intent(out) :: pres(KA,IA,JA)
1393 
1394  integer :: i, j
1395  !---------------------------------------------------------------------------
1396 
1397  !$omp parallel do OMP_SCHEDULE_ collapse(2)
1398  do j = js, je
1399  do i = is, ie
1400  call atmos_hydrostatic_buildrho_bytemp_atmos_1d( ka, ks, ke, &
1401  temp(:,i,j), qv(:,i,j), qc(:,i,j), & ! [IN]
1402  dz(:,i,j), & ! [IN]
1403  dens(:,i,j), & ! [INOUT]
1404  pott(:,i,j), pres(:,i,j) ) ! [OUT]
1405  enddo
1406  enddo
1407 
1408  return
scale_statistics
module Statistics
Definition: scale_statistics.F90:11
scale_prc::prc_abort
subroutine, public prc_abort
Abort Process.
Definition: scale_prc.F90:342
scale_const::const_eps
real(rp), public const_eps
small number
Definition: scale_const.F90:33
scale_atmos_hydrometeor
module atmosphere / hydrometeor
Definition: scale_atmos_hydrometeor.F90:12
scale_prc
module PROCESS
Definition: scale_prc.F90:11
scale_const
module CONSTANT
Definition: scale_const.F90:11
scale_const::const_undef
real(rp), public const_undef
Definition: scale_const.F90:41