SCALE-RM
scale_atmos_hydrometeor.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  !-----------------------------------------------------------------------------
21  implicit none
22  private
23  !-----------------------------------------------------------------------------
24  !
25  !++ Public procedure
26  !
27  public :: atmos_hydrometeor_setup
28  public :: atmos_hydrometeor_regist
29  public :: atmos_hydrometeor_lhv
30  public :: atmos_hydrometeor_lhs
31  public :: atmos_hydrometeor_lhf
32  public :: atmos_hydrometeor_entr
33  public :: atmos_hydrometeor_entr2temp
34 
35  interface atmos_hydrometeor_regist
36  module procedure atmos_hydrometeor_regist
37  end interface atmos_hydrometeor_regist
38 
39  interface atmos_hydrometeor_lhv
40  module procedure atmos_hydrometeor_lhv_0d
41  module procedure atmos_hydrometeor_lhv_1d
42  module procedure atmos_hydrometeor_lhv_2d
43  module procedure atmos_hydrometeor_lhv_3d
44  end interface atmos_hydrometeor_lhv
45 
46  interface atmos_hydrometeor_lhs
47  module procedure atmos_hydrometeor_lhs_0d
48  module procedure atmos_hydrometeor_lhs_1d
49  module procedure atmos_hydrometeor_lhs_2d
50  module procedure atmos_hydrometeor_lhs_3d
51  end interface atmos_hydrometeor_lhs
52 
53  interface atmos_hydrometeor_lhf
54  module procedure atmos_hydrometeor_lhf_0d
55  module procedure atmos_hydrometeor_lhf_1d
56  module procedure atmos_hydrometeor_lhf_2d
57  module procedure atmos_hydrometeor_lhf_3d
58  end interface atmos_hydrometeor_lhf
59 
60  interface atmos_hydrometeor_entr
61  module procedure atmos_hydrometeor_entr_0d
62  module procedure atmos_hydrometeor_entr_2d
63  module procedure atmos_hydrometeor_entr_3d
64  end interface atmos_hydrometeor_entr
65 
66  interface atmos_hydrometeor_entr2temp
67  module procedure atmos_hydrometeor_entr2temp_0d
68  end interface atmos_hydrometeor_entr2temp
69 
70  !-----------------------------------------------------------------------------
71  !
72  !++ Public parameters & variables
73  !
74  logical, public :: atmos_hydrometeor_ice_phase
75 
76 
77  integer, public :: i_qv = -1
78 
79  integer, public, parameter :: n_hyd = 6
80 
81  integer, public, parameter :: i_hc = 1
82  integer, public, parameter :: i_hr = 2
83  integer, public, parameter :: i_hi = 3
84  integer, public, parameter :: i_hs = 4
85  integer, public, parameter :: i_hg = 5
86  integer, public, parameter :: i_hh = 6
87 
88  character(len=H_SHORT), public, parameter :: hyd_name(n_hyd) = &
89  (/ "QC", "QR", "QI", "QS", "QG", "QH" /)
90  character(len=H_MID), public, parameter :: hyd_desc(n_hyd) = &
91  (/ "cloud ", "rain ", "ice water", "snow ", "graupel ", "hail " /)
92  character(len=H_SHORT), public, parameter :: num_name(n_hyd) = &
93  (/ "NC", "NR", "NI", "NS", "NG", "NH" /)
94 
95  real(rp), public :: hyd_dens(n_hyd)
96 
97  logical, public :: atmos_hydrometeor_dry = .true.
98 
99 ! integer, public :: I_NC = -1
100 ! integer, public :: I_NR = -1
101 ! integer, public :: I_NI = -1
102 ! integer, public :: I_NS = -1
103 ! integer, public :: I_NG = -1
104 ! integer, public :: I_NH = -1
105 
106 ! integer, public :: I_QC = -1
107 ! integer, public :: I_QR = -1
108 ! integer, public :: I_QI = -1
109 ! integer, public :: I_QS = -1
110 ! integer, public :: I_QG = -1
111 ! integer, public :: I_QH = -1
112 
113  ! hydrometeor (water + ice)
114  integer, public :: qha = 0
115  integer, public :: qhs = -1
116  integer, public :: qhe = -2
117  ! water
118  integer, public :: qla = 0
119  integer, public :: qls = -1
120  integer, public :: qle = -2
121  ! ice
122  integer, public :: qia = 0
123  integer, public :: qis = -1
124  integer, public :: qie = -2
125 
126  real(rp), public :: lhv
127  real(rp), public :: lhs
128  real(rp), public :: lhf
129 
130  real(rp), public :: cv_vapor
131  real(rp), public :: cp_vapor
132  real(rp), public :: cv_water
133  real(rp), public :: cp_water
134  real(rp), public :: cv_ice
135  real(rp), public :: cp_ice
136 
137  !-----------------------------------------------------------------------------
138  !
139  !++ Private procedure
140  !
141  !-----------------------------------------------------------------------------
142  !
143  !++ Private parameters & variables
144  !
145  real(rp), private :: thermodyn_emask = 1.0_rp
146 
147  logical, private :: initialized = .false.
148 
149  !-----------------------------------------------------------------------------
150 contains
151  !-----------------------------------------------------------------------------
153  subroutine atmos_hydrometeor_setup
154  use scale_const, only: &
155  const_setup, &
156  cpvap => const_cpvap, &
157  cvvap => const_cvvap, &
158  cl => const_cl, &
159  ci => const_ci, &
160  lhv00 => const_lhv00, &
161  lhs00 => const_lhs00, &
162  lhf00 => const_lhf00, &
163  lhv0 => const_lhv0, &
164  lhs0 => const_lhs0, &
165  lhf0 => const_lhf0, &
166  dwatr => const_dwatr, &
167  dice => const_dice, &
168  thermodyn_type => const_thermodyn_type
169  use scale_prc, only: &
170  prc_abort
171  implicit none
172  !---------------------------------------------------------------------------
173 
174  if ( initialized ) return
175  initialized = .true.
176 
177  call const_setup
178 
179  log_newline
180  log_info("ATMOS_HYDROMETEOR_setup",*) 'Setup'
181 
182  if ( thermodyn_type == 'EXACT' ) then
183 
184  cv_vapor = cvvap
185  cp_vapor = cpvap
186  cv_water = cl
188  cv_ice = ci
189  cp_ice = cv_ice
190 
191  lhv = lhv00
192  lhs = lhs00
193  lhf = lhf00
194  thermodyn_emask = 1.0_rp
195 
196  elseif( thermodyn_type == 'SIMPLE' ) then
197 
198  cv_vapor = cvvap
199  cp_vapor = cpvap
200  cv_water = cvvap
202  cv_ice = cvvap
203  cp_ice = cv_ice
204 
205  lhv = lhv0
206  lhs = lhs0
207  lhf = lhf0
208  thermodyn_emask = 0.0_rp
209 
210  else
211  log_error("ATMOS_HYDROMETEOR_setup",*) 'Not appropriate ATMOS_THERMODYN_ENERGY_TYPE. Check!', trim(thermodyn_type)
212  call prc_abort
213  endif
214 
215  hyd_dens(:) = (/ dwatr, & ! HC
216  dwatr, & ! HR
217  dice, & ! HI
218  dice, & ! HS
219  dice, & ! HG
220  dice /) ! HH
221 
222  return
223  end subroutine atmos_hydrometeor_setup
224 
225  !-----------------------------------------------------------------------------
229  subroutine atmos_hydrometeor_regist( &
230  NL, &
231  NI, &
232  NAME, &
233  DESC, &
234  UNIT, &
235  Q0, &
236  ADVC )
237  use scale_prc, only: &
238  prc_abort
239  use scale_tracer, only: &
241  use scale_const, only: &
242  rvap => const_rvap
243  implicit none
244  integer, intent(in) :: nl
245  integer, intent(in) :: ni
246  character(len=*), intent(in) :: name(1+nl+ni)
247  character(len=*), intent(in) :: desc(1+nl+ni)
248  character(len=*), intent(in) :: unit(1+nl+ni)
249 
250  integer, intent(out) :: q0
251 
252  logical, intent(in), optional :: advc(1+nl+ni)
253 
254  real(rp) :: cv (1+nl+ni)
255  real(rp) :: cp (1+nl+ni)
256  real(rp) :: r (1+nl+ni)
257  real(rp) :: ei0 (1+nl+ni)
258  logical :: mass (1+nl+ni)
259  logical :: advc_(1+nl+ni)
260 
261  integer :: nq
262  integer :: n
263  !---------------------------------------------------------------------------
264 
265  if ( .not. atmos_hydrometeor_dry ) then
266  log_error("ATMOS_HYDROMETEOR_regist",*) 'tracer for hydrometeor is already registerd'
267  call prc_abort
268  endif
269 
270  atmos_hydrometeor_dry = .false.
271 
272  nq = 0
273 
274  ! vapor
275  nq = nq + 1
276  cv(nq) = cv_vapor
277  cp(nq) = cp_vapor
278  r(nq) = rvap
279  ei0(nq) = lhv
280 
281  ! liquid
282  do n = 1, nl
283  nq = nq + 1
284  cv(nq) = cv_water
285  cp(nq) = cp_water
286  r(nq) = 0.0_rp
287  ei0(nq) = 0.0_rp
288  end do
289 
290  ! ice
291  do n = 1, ni
292  nq = nq + 1
293  cv(nq) = cv_ice
294  cp(nq) = cp_ice
295  r(nq) = 0.0_rp
296  ei0(nq) = - lhf
297  end do
298 
299  ! NQ = 1 + NL + NI, vapor + liqid + ice
300 
301  if ( present(advc) ) then
302  advc_(:) = advc(:)
303  else
304  advc_(:) = .true.
305  endif
306 
307  do n = 1, nq
308  mass(n) = .true.
309  end do
310 
311  call tracer_regist( q0, & ! [OUT]
312  nq, & ! [IN]
313  name, & ! [IN]
314  desc, & ! [IN]
315  unit, & ! [IN]
316  cv, cp, r, ei0, & ! [IN], optional
317  advc_, mass ) ! [IN], optional
318 
319  i_qv = q0
320 
321  if ( nq > 1 ) then
322  qhs = q0 + 1
323  qha = nl + ni
324  qhe = qhs + qha - 1
325  endif
326 
327  if ( nl > 0 ) then
328  qls = q0 + 1
329  qla = nl
330  qle = qls + nl - 1
331  endif
332 
333  if ( ni > 0 ) then
334  qis = qle + 1
335  qia = ni
336  qie = qis + ni - 1
337  endif
338 
340 
341  return
342  end subroutine atmos_hydrometeor_regist
343 
344  !-----------------------------------------------------------------------------
345  subroutine atmos_hydrometeor_lhv_0d( &
346  temp, &
347  lhv )
348  use scale_const, only: &
349  tem00 => const_tem00, &
350  lhv0 => const_lhv0
351  implicit none
352  real(RP), intent(in) :: temp
353  real(RP), intent(out) :: lhv
354  !---------------------------------------------------------------------------
355 
356  lhv = lhv0 + ( cp_vapor - cp_water ) * ( temp - tem00 ) * thermodyn_emask
357 
358  return
359  end subroutine atmos_hydrometeor_lhv_0d
360 
361  !-----------------------------------------------------------------------------
362 !OCL SERIAL
363  subroutine atmos_hydrometeor_lhv_1d( &
364  KA, KS, KE, &
365  temp, &
366  lhv )
367  implicit none
368  integer, intent(in) :: KA, KS, KE
369 
370  real(RP), intent(in) :: temp(KA)
371 
372  real(RP), intent(out) :: lhv (KA)
373 
374  integer :: k
375  !---------------------------------------------------------------------------
376 
377  do k = ks, ke
378  call atmos_hydrometeor_lhv_0d( temp(k), lhv(k) )
379  enddo
380 
381  return
382  end subroutine atmos_hydrometeor_lhv_1d
383 
384  !-----------------------------------------------------------------------------
385  subroutine atmos_hydrometeor_lhv_2d( &
386  IA, IS, IE, JA, JS, JE, &
387  temp, &
388  lhv )
389  implicit none
390  integer, intent(in) :: IA, IS, IE
391  integer, intent(in) :: JA, JS, JE
392 
393  real(RP), intent(in) :: temp(IA,JA)
394  real(RP), intent(out) :: lhv (IA,JA)
395 
396  integer :: i, j
397  !---------------------------------------------------------------------------
398 
399  !$omp parallel do OMP_SCHEDULE_ collapse(2)
400  do j = js, je
401  do i = is, ie
402  call atmos_hydrometeor_lhv_0d( temp(i,j), lhv(i,j) )
403  enddo
404  enddo
405 
406  return
407  end subroutine atmos_hydrometeor_lhv_2d
408 
409  !-----------------------------------------------------------------------------
410  subroutine atmos_hydrometeor_lhv_3d( &
411  KA, KS, KE, &
412  IA, IS, IE, &
413  JA, JS, JE, &
414  temp, &
415  lhv )
416  implicit none
417  integer, intent(in) :: KA, KS, KE
418  integer, intent(in) :: IA, IS, IE
419  integer, intent(in) :: JA, JS, JE
420 
421  real(RP), intent(in) :: temp(KA,IA,JA)
422  real(RP), intent(out) :: lhv (KA,IA,JA)
423 
424  integer :: k, i, j
425  !---------------------------------------------------------------------------
426 
427  do j = js, je
428  do i = is, ie
429  do k = ks, ke
430  call atmos_hydrometeor_lhv_0d( temp(k,i,j), lhv(k,i,j) )
431  enddo
432  enddo
433  enddo
434 
435  return
436  end subroutine atmos_hydrometeor_lhv_3d
437 
438  !-----------------------------------------------------------------------------
439  subroutine atmos_hydrometeor_lhs_0d( &
440  temp, &
441  lhs )
442  use scale_const, only: &
443  tem00 => const_tem00, &
444  lhs0 => const_lhs0
445  implicit none
446  real(RP), intent(in) :: temp
447  real(RP), intent(out) :: lhs
448  !---------------------------------------------------------------------------
449 
450  lhs = lhs0 + ( cp_vapor - cp_ice ) * ( temp - tem00 ) * thermodyn_emask
451 
452  return
453  end subroutine atmos_hydrometeor_lhs_0d
454 
455  !-----------------------------------------------------------------------------
456 !OCL SERIAL
457  subroutine atmos_hydrometeor_lhs_1d( &
458  KA, KS, KE, &
459  temp, &
460  lhs )
461  implicit none
462  integer, intent(in) :: KA, KS, KE
463 
464  real(RP), intent(in) :: temp(KA)
465 
466  real(RP), intent(out) :: lhs (KA)
467 
468  integer :: k
469  !---------------------------------------------------------------------------
470 
471  do k = ks, ke
472  call atmos_hydrometeor_lhs( temp(k), lhs(k) )
473  enddo
474 
475  return
476  end subroutine atmos_hydrometeor_lhs_1d
477 
478  !-----------------------------------------------------------------------------
479  subroutine atmos_hydrometeor_lhs_2d( &
480  IA, IS, IE, JA, JS, JE, &
481  temp, &
482  lhs )
483  implicit none
484  integer, intent(in) :: IA, IS, IE
485  integer, intent(in) :: JA, JS, JE
486 
487  real(RP), intent(in) :: temp(IA,JA)
488  real(RP), intent(out) :: lhs (IA,JA)
489 
490  integer :: i, j
491  !---------------------------------------------------------------------------
492 
493  !$omp parallel do OMP_SCHEDULE_ collapse(2)
494  do j = js, je
495  do i = is, ie
496  call atmos_hydrometeor_lhs( temp(i,j), lhs(i,j) )
497  enddo
498  enddo
499 
500  return
501  end subroutine atmos_hydrometeor_lhs_2d
502 
503  !-----------------------------------------------------------------------------
504  subroutine atmos_hydrometeor_lhs_3d( &
505  KA, KS, KE, IA, IS, IE, JA, JS, JE, &
506  temp, &
507  lhs )
508  implicit none
509 
510  integer, intent(in) :: KA, KS, KE
511  integer, intent(in) :: IA, IS, IE
512  integer, intent(in) :: JA, JS, JE
513 
514  real(RP), intent(in) :: temp(KA,IA,JA)
515  real(RP), intent(out) :: lhs (KA,IA,JA)
516 
517  integer :: k, i, j
518  !---------------------------------------------------------------------------
519 
520  !$omp parallel do OMP_SCHEDULE_ collapse(2)
521  do j = js, je
522  do i = is, ie
523  do k = ks, ke
524  call atmos_hydrometeor_lhs( temp(k,i,j), lhs(k,i,j) )
525  enddo
526  enddo
527  enddo
528 
529  return
530  end subroutine atmos_hydrometeor_lhs_3d
531 
532  !-----------------------------------------------------------------------------
533  subroutine atmos_hydrometeor_lhf_0d( &
534  temp, &
535  lhf )
536  use scale_const, only: &
537  tem00 => const_tem00, &
538  lhf0 => const_lhf0
539  implicit none
540  real(RP), intent(in) :: temp
541  real(RP), intent(out) :: lhf
542  !---------------------------------------------------------------------------
543 
544  lhf = lhf0 + ( cp_water - cp_ice ) * ( temp - tem00 ) * thermodyn_emask
545 
546  return
547  end subroutine atmos_hydrometeor_lhf_0d
548 
549  !-----------------------------------------------------------------------------
550 !OCL SERIAL
551  subroutine atmos_hydrometeor_lhf_1d( &
552  KA, KS, KE, &
553  temp, &
554  lhf )
555  implicit none
556  integer, intent(in) :: KA, KS, KE
557 
558  real(RP), intent(in) :: temp(KA)
559  real(RP), intent(out) :: lhf (KA)
560 
561  integer :: k
562  !---------------------------------------------------------------------------
563 
564  do k = ks, ke
565  call atmos_hydrometeor_lhf( temp(k), lhf(k) )
566  enddo
567 
568  return
569  end subroutine atmos_hydrometeor_lhf_1d
570 
571  !-----------------------------------------------------------------------------
572  subroutine atmos_hydrometeor_lhf_2d( &
573  IA, IS, IE, JA, JS, JE, &
574  temp, &
575  lhf )
576  implicit none
577  integer, intent(in) :: IA, IS, IE
578  integer, intent(in) :: JA, JS, JE
579 
580  real(RP), intent(in) :: temp(IA,JA)
581  real(RP), intent(out) :: lhf (IA,JA)
582 
583  integer :: i, j
584  !---------------------------------------------------------------------------
585 
586  !$omp parallel do OMP_SCHEDULE_ collapse(2)
587  do j = js, je
588  do i = is, ie
589  call atmos_hydrometeor_lhf( temp(i,j), lhf(i,j) )
590  enddo
591  enddo
592 
593  return
594  end subroutine atmos_hydrometeor_lhf_2d
595 
596  !-----------------------------------------------------------------------------
597  subroutine atmos_hydrometeor_lhf_3d( &
598  KA, KS, KE, &
599  IA, IS, IE, &
600  JA, JS, JE, &
601  temp, &
602  lhf )
603  implicit none
604  integer, intent(in) :: KA, KS, KE
605  integer, intent(in) :: IA, IS, IE
606  integer, intent(in) :: JA, JS, JE
607 
608  real(RP), intent(in) :: temp(KA,IA,JA)
609  real(RP), intent(out) :: lhf (KA,IA,JA)
610 
611  integer :: k, i, j
612  !---------------------------------------------------------------------------
613 
614  !$omp parallel do OMP_SCHEDULE_ collapse(2)
615  do j = js, je
616  do i = is, ie
617  do k = ks, ke
618  call atmos_hydrometeor_lhf( temp(k,i,j), lhf(k,i,j) )
619  enddo
620  enddo
621  enddo
622 
623  return
624  end subroutine atmos_hydrometeor_lhf_3d
625 
626  !-----------------------------------------------------------------------------
628  subroutine atmos_hydrometeor_entr_0d( &
629  TEMP, PRES, &
630  QV, QI, Qdry, &
631  Rtot, CPtot, &
632  entr )
633  use scale_const, only: &
634  pre00 => const_pre00, &
635  tem00 => const_tem00, &
636  rdry => const_rdry, &
637  rvap => const_rvap, &
638  lhv0 => const_lhv0, &
639  lhf0 => const_lhf0, &
640  psat0 => const_psat0
641  implicit none
642 
643  real(RP), intent(in) :: TEMP
644  real(RP), intent(in) :: PRES
645  real(RP), intent(in) :: QV
646  real(RP), intent(in) :: QI
647  real(RP), intent(in) :: Qdry
648  real(RP), intent(in) :: Rtot
649  real(RP), intent(in) :: CPtot
650 
651  real(RP), intent(out) :: entr
652 
653  real(RP) :: pres_dry, pres_vap
654  !---------------------------------------------------------------------------
655 
656  pres_dry = pres * qdry * rdry / rtot
657  pres_vap = pres * qv * rvap / rtot
658 
659  entr = cptot * log( temp / tem00 ) &
660  - qdry * rdry * log( pres_dry / pre00 ) &
661  - qv * rvap * log( pres_vap / psat0 ) &
662  + ( qv * lhv0 - qi * lhf0 ) / tem00
663 
664  return
665  end subroutine atmos_hydrometeor_entr_0d
666 
667  !-----------------------------------------------------------------------------
669  subroutine atmos_hydrometeor_entr_2d( &
670  IA, IS, IE, JA, JS, JE, &
671  TEMP, PRES, &
672  QV, QI, Qdry, &
673  Rtot, CPtot, &
674  entr )
675  implicit none
676  integer, intent(in) :: IA, IS, IE
677  integer, intent(in) :: JA, JS, JE
678 
679  real(RP), intent(in) :: TEMP (IA,JA)
680  real(RP), intent(in) :: PRES (IA,JA)
681  real(RP), intent(in) :: QV (IA,JA)
682  real(RP), intent(in) :: QI (IA,JA)
683  real(RP), intent(in) :: Qdry (IA,JA)
684  real(RP), intent(in) :: Rtot (IA,JA)
685  real(RP), intent(in) :: CPtot(IA,JA)
686 
687  real(RP), intent(out) :: entr(IA,JA)
688 
689  integer :: i, j
690  !---------------------------------------------------------------------------
691 
692  !$omp parallel do OMP_SCHEDULE_ collapse(2)
693  do j = js, je
694  do i = is, ie
695  call atmos_hydrometeor_entr_0d( &
696  temp(i,j), pres(i,j), & ! [IN]
697  qv(i,j), qi(i,j), qdry(i,j), & ! [IN]
698  rtot(i,j), cptot(i,j), & ! [IN]
699  entr(i,j) ) ! [OUT]
700  enddo
701  enddo
702 
703  return
704  end subroutine atmos_hydrometeor_entr_2d
705  !-----------------------------------------------------------------------------
707  subroutine atmos_hydrometeor_entr_3d( &
708  KA, KS, KE, IA, IS, IE, JA, JS, JE, &
709  TEMP, PRES, &
710  QV, QI, Qdry, &
711  Rtot, CPtot, &
712  entr )
713  implicit none
714  integer, intent(in) :: KA, KS, KE
715  integer, intent(in) :: IA, IS, IE
716  integer, intent(in) :: JA, JS, JE
717 
718  real(RP), intent(in) :: TEMP (KA,IA,JA)
719  real(RP), intent(in) :: PRES (KA,IA,JA)
720  real(RP), intent(in) :: QV (KA,IA,JA)
721  real(RP), intent(in) :: QI (KA,IA,JA)
722  real(RP), intent(in) :: Qdry (KA,IA,JA)
723  real(RP), intent(in) :: Rtot (KA,IA,JA)
724  real(RP), intent(in) :: CPtot(KA,IA,JA)
725 
726  real(RP), intent(out) :: entr(KA,IA,JA)
727 
728  integer :: k, i, j
729  !---------------------------------------------------------------------------
730 
731  !$omp parallel do OMP_SCHEDULE_ collapse(2)
732  do j = js, je
733  do i = is, ie
734  do k = ks, ke
735  call atmos_hydrometeor_entr_0d( &
736  temp(k,i,j), pres(k,i,j), & ! [IN]
737  qv(k,i,j), qi(k,i,j), qdry(k,i,j), & ! [IN]
738  rtot(k,i,j), cptot(k,i,j), & ! [IN]
739  entr(k,i,j) ) ! [OUT]
740  enddo
741  enddo
742  enddo
743 
744  return
745  end subroutine atmos_hydrometeor_entr_3d
746 
747  !-----------------------------------------------------------------------------
749  subroutine atmos_hydrometeor_entr2temp_0d( &
750  entr, pres, &
751  qv, qi, qdry, &
752  Rtot, CPtot, &
753  temp )
754  use scale_const, only: &
755  pre00 => const_pre00, &
756  tem00 => const_tem00, &
757  rdry => const_rdry, &
758  rvap => const_rvap, &
759  lhv0 => const_lhv0, &
760  lhf0 => const_lhf0, &
761  psat0 => const_psat0
762  implicit none
763 
764  real(RP), intent(in) :: entr
765  real(RP), intent(in) :: pres
766  real(RP), intent(in) :: qv
767  real(RP), intent(in) :: qi
768  real(RP), intent(in) :: qdry
769  real(RP), intent(in) :: Rtot
770  real(RP), intent(in) :: CPtot
771 
772  real(RP), intent(out) :: temp
773 
774  real(RP) :: pres_dry, pres_vap
775  !---------------------------------------------------------------------------
776 
777  pres_dry = pres * qdry * rdry / rtot
778  pres_vap = pres * qv * rvap / rtot
779 
780  temp = tem00 &
781  * exp( ( entr &
782  + qdry * rdry * log( pres_dry / pre00 ) &
783  + qv * rvap * log( pres_vap / psat0 ) &
784  - ( qv * lhv0 - qi * lhf0 ) / tem00 ) / cptot )
785  return
786  end subroutine atmos_hydrometeor_entr2temp_0d
787 
788 end module scale_atmos_hydrometeor
scale_atmos_hydrometeor::num_name
character(len=h_short), dimension(n_hyd), parameter, public num_name
Definition: scale_atmos_hydrometeor.F90:92
scale_const::const_lhv0
real(rp), parameter, public const_lhv0
latent heat of vaporizaion at 0C [J/kg]
Definition: scale_const.F90:75
scale_atmos_hydrometeor::hyd_desc
character(len=h_mid), dimension(n_hyd), parameter, public hyd_desc
Definition: scale_atmos_hydrometeor.F90:90
scale_atmos_hydrometeor::atmos_hydrometeor_lhf_1d
subroutine atmos_hydrometeor_lhf_1d(KA, KS, KE, temp, lhf)
Definition: scale_atmos_hydrometeor.F90:555
scale_prc::prc_abort
subroutine, public prc_abort
Abort Process.
Definition: scale_prc.F90:342
scale_atmos_hydrometeor::i_hr
integer, parameter, public i_hr
liquid water rain
Definition: scale_atmos_hydrometeor.F90:82
scale_atmos_hydrometeor::qia
integer, public qia
Definition: scale_atmos_hydrometeor.F90:122
scale_atmos_hydrometeor::cp_water
real(rp), public cp_water
CP for water [J/kg/K].
Definition: scale_atmos_hydrometeor.F90:133
scale_atmos_hydrometeor::i_hs
integer, parameter, public i_hs
snow
Definition: scale_atmos_hydrometeor.F90:84
scale_atmos_hydrometeor::hyd_name
character(len=h_short), dimension(n_hyd), parameter, public hyd_name
Definition: scale_atmos_hydrometeor.F90:88
scale_const::const_lhs00
real(rp), public const_lhs00
latent heat of sublimation at 0K [J/kg]
Definition: scale_const.F90:78
scale_const::const_lhv00
real(rp), public const_lhv00
latent heat of vaporizaion at 0K [J/kg]
Definition: scale_const.F90:76
scale_atmos_hydrometeor::qhs
integer, public qhs
Definition: scale_atmos_hydrometeor.F90:115
scale_precision
module PRECISION
Definition: scale_precision.F90:14
scale_const::const_rvap
real(rp), parameter, public const_rvap
specific gas constant (water vapor) [J/kg/K]
Definition: scale_const.F90:63
scale_atmos_hydrometeor
module atmosphere / hydrometeor
Definition: scale_atmos_hydrometeor.F90:12
scale_atmos_hydrometeor::atmos_hydrometeor_entr_2d
subroutine atmos_hydrometeor_entr_2d(IA, IS, IE, JA, JS, JE, TEMP, PRES, QV, QI, Qdry, Rtot, CPtot, entr)
calc temp, pres, q -> entropy (2D)
Definition: scale_atmos_hydrometeor.F90:675
scale_atmos_hydrometeor::i_hh
integer, parameter, public i_hh
hail
Definition: scale_atmos_hydrometeor.F90:86
scale_atmos_hydrometeor::atmos_hydrometeor_dry
logical, public atmos_hydrometeor_dry
Definition: scale_atmos_hydrometeor.F90:97
scale_const::const_thermodyn_type
character(len=h_short), public const_thermodyn_type
internal energy type
Definition: scale_const.F90:99
scale_const::const_cpvap
real(rp), parameter, public const_cpvap
specific heat (water vapor, constant pressure) [J/kg/K]
Definition: scale_const.F90:64
scale_prc
module PROCESS
Definition: scale_prc.F90:11
scale_atmos_hydrometeor::qle
integer, public qle
Definition: scale_atmos_hydrometeor.F90:120
scale_precision::rp
integer, parameter, public rp
Definition: scale_precision.F90:41
scale_atmos_hydrometeor::cv_vapor
real(rp), public cv_vapor
CV for vapor [J/kg/K].
Definition: scale_atmos_hydrometeor.F90:130
scale_atmos_hydrometeor::i_hi
integer, parameter, public i_hi
ice water cloud
Definition: scale_atmos_hydrometeor.F90:83
scale_io
module STDIO
Definition: scale_io.F90:10
scale_atmos_hydrometeor::qhe
integer, public qhe
Definition: scale_atmos_hydrometeor.F90:116
scale_const
module CONSTANT
Definition: scale_const.F90:11
scale_atmos_hydrometeor::lhv
real(rp), public lhv
latent heat of vaporization for use [J/kg]
Definition: scale_atmos_hydrometeor.F90:126
scale_atmos_hydrometeor::atmos_hydrometeor_lhs_1d
subroutine atmos_hydrometeor_lhs_1d(KA, KS, KE, temp, lhs)
Definition: scale_atmos_hydrometeor.F90:461
scale_atmos_hydrometeor::qis
integer, public qis
Definition: scale_atmos_hydrometeor.F90:123
scale_prof
module profiler
Definition: scale_prof.F90:11
scale_atmos_hydrometeor::qha
integer, public qha
Definition: scale_atmos_hydrometeor.F90:114
scale_const::const_psat0
real(rp), parameter, public const_psat0
saturate pressure of water vapor at 0C [Pa]
Definition: scale_const.F90:81
scale_atmos_hydrometeor::i_hc
integer, parameter, public i_hc
liquid water cloud
Definition: scale_atmos_hydrometeor.F90:81
scale_tracer::tracer_regist
subroutine, public tracer_regist(QS, NQ, NAME, DESC, UNIT, CV, CP, R, ENGI0, ADVC, MASS)
Regist tracer.
Definition: scale_tracer.F90:65
scale_tracer
module TRACER
Definition: scale_tracer.F90:12
scale_atmos_hydrometeor::i_qv
integer, public i_qv
Definition: scale_atmos_hydrometeor.F90:77
scale_const::const_ci
real(rp), parameter, public const_ci
specific heat (ice) [J/kg/K]
Definition: scale_const.F90:67
scale_const::const_dwatr
real(rp), parameter, public const_dwatr
density of water [kg/m3]
Definition: scale_const.F90:82
scale_atmos_hydrometeor::atmos_hydrometeor_ice_phase
logical, public atmos_hydrometeor_ice_phase
Definition: scale_atmos_hydrometeor.F90:74
scale_const::const_tem00
real(rp), parameter, public const_tem00
temperature reference (0C) [K]
Definition: scale_const.F90:90
scale_const::const_cl
real(rp), parameter, public const_cl
specific heat (liquid water) [J/kg/K]
Definition: scale_const.F90:66
scale_atmos_hydrometeor::atmos_hydrometeor_lhv_0d
subroutine atmos_hydrometeor_lhv_0d(temp, lhv)
Definition: scale_atmos_hydrometeor.F90:348
scale_const::const_cvvap
real(rp), public const_cvvap
specific heat (water vapor, constant volume) [J/kg/K]
Definition: scale_const.F90:65
scale_const::const_lhf0
real(rp), public const_lhf0
latent heat of fusion at 0C [J/kg]
Definition: scale_const.F90:79
scale_atmos_hydrometeor::lhf
real(rp), public lhf
latent heat of fusion for use [J/kg]
Definition: scale_atmos_hydrometeor.F90:128
scale_atmos_hydrometeor::atmos_hydrometeor_regist
subroutine, public atmos_hydrometeor_regist(NL, NI, NAME, DESC, UNIT, Q0, ADVC)
ATMOS_HYDROMETEOR_regist Regist tracer.
Definition: scale_atmos_hydrometeor.F90:237
scale_const::const_rdry
real(rp), public const_rdry
specific gas constant (dry air) [J/kg/K]
Definition: scale_const.F90:55
scale_const::const_lhs0
real(rp), parameter, public const_lhs0
latent heat of sublimation at 0C [J/kg]
Definition: scale_const.F90:77
scale_atmos_hydrometeor::lhs
real(rp), public lhs
latent heat of sublimation for use [J/kg]
Definition: scale_atmos_hydrometeor.F90:127
scale_const::const_dice
real(rp), parameter, public const_dice
density of ice [kg/m3]
Definition: scale_const.F90:83
scale_atmos_hydrometeor::qla
integer, public qla
Definition: scale_atmos_hydrometeor.F90:118
scale_atmos_hydrometeor::qie
integer, public qie
Definition: scale_atmos_hydrometeor.F90:124
scale_atmos_hydrometeor::qls
integer, public qls
Definition: scale_atmos_hydrometeor.F90:119
scale_atmos_hydrometeor::atmos_hydrometeor_setup
subroutine, public atmos_hydrometeor_setup
Setup.
Definition: scale_atmos_hydrometeor.F90:154
scale_atmos_hydrometeor::hyd_dens
real(rp), dimension(n_hyd), public hyd_dens
Definition: scale_atmos_hydrometeor.F90:95
scale_atmos_hydrometeor::atmos_hydrometeor_lhv_1d
subroutine atmos_hydrometeor_lhv_1d(KA, KS, KE, temp, lhv)
Definition: scale_atmos_hydrometeor.F90:367
scale_const::const_pre00
real(rp), public const_pre00
pressure reference [Pa]
Definition: scale_const.F90:88
scale_atmos_hydrometeor::n_hyd
integer, parameter, public n_hyd
Definition: scale_atmos_hydrometeor.F90:79
scale_atmos_hydrometeor::cp_vapor
real(rp), public cp_vapor
CP for vapor [J/kg/K].
Definition: scale_atmos_hydrometeor.F90:131
scale_atmos_hydrometeor::cv_water
real(rp), public cv_water
CV for water [J/kg/K].
Definition: scale_atmos_hydrometeor.F90:132
scale_atmos_hydrometeor::cv_ice
real(rp), public cv_ice
CV for ice [J/kg/K].
Definition: scale_atmos_hydrometeor.F90:134
scale_const::const_setup
subroutine, public const_setup
Setup.
Definition: scale_const.F90:115
scale_atmos_hydrometeor::cp_ice
real(rp), public cp_ice
CP for ice [J/kg/K].
Definition: scale_atmos_hydrometeor.F90:135
scale_const::const_lhf00
real(rp), public const_lhf00
latent heat of fusion at 0K [J/kg]
Definition: scale_const.F90:80
scale_atmos_hydrometeor::i_hg
integer, parameter, public i_hg
graupel
Definition: scale_atmos_hydrometeor.F90:85