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  logical :: MASS (1+nl+ni)
258  logical :: ADVC_(1+nl+ni)
259 
260  integer :: NQ
261  integer :: n
262  !---------------------------------------------------------------------------
263 
264  if ( .not. atmos_hydrometeor_dry ) then
265  log_error("ATMOS_HYDROMETEOR_regist",*) 'tracer for hydrometeor is already registerd'
266  call prc_abort
267  endif
268 
269  atmos_hydrometeor_dry = .false.
270 
271  nq = 0
272 
273  ! vapor
274  nq = nq + 1
275  cv(nq) = cv_vapor
276  cp(nq) = cp_vapor
277  r(nq) = rvap
278 
279  ! liquid
280  do n = 1, nl
281  nq = nq + 1
282  cv(nq) = cv_water
283  cp(nq) = cp_water
284  r(nq) = 0.0_rp
285  end do
286 
287  ! ice
288  do n = 1, ni
289  nq = nq + 1
290  cv(nq) = cv_ice
291  cp(nq) = cp_ice
292  r(nq) = 0.0_rp
293  end do
294 
295  ! NQ = 1 + NL + NI, vapor + liqid + ice
296 
297  if ( present(advc) ) then
298  advc_(:) = advc(:)
299  else
300  advc_(:) = .true.
301  endif
302 
303  do n = 1, nq
304  mass(n) = .true.
305  end do
306 
307  call tracer_regist( q0, & ! [OUT]
308  nq, & ! [IN]
309  name, & ! [IN]
310  desc, & ! [IN]
311  unit, & ! [IN]
312  cv, cp, r, & ! [IN], optional
313  advc_, mass ) ! [IN], optional
314 
315  i_qv = q0
316 
317  if ( nq > 1 ) then
318  qhs = q0 + 1
319  qha = nl + ni
320  qhe = qhs + qha - 1
321  endif
322 
323  if ( nl > 0 ) then
324  qls = q0 + 1
325  qla = nl
326  qle = qls + nl - 1
327  endif
328 
329  if ( ni > 0 ) then
330  qis = qle + 1
331  qia = ni
332  qie = qis + ni - 1
333  endif
334 
336 
337  return
338  end subroutine atmos_hydrometeor_regist
339 
340  !-----------------------------------------------------------------------------
341  subroutine atmos_hydrometeor_lhv_0d( &
342  temp, &
343  lhv )
344  use scale_const, only: &
345  tem00 => const_tem00, &
346  lhv0 => const_lhv0
347  implicit none
348  real(RP), intent(in) :: temp
349  real(RP), intent(out) :: lhv
350  !---------------------------------------------------------------------------
351 
352  lhv = lhv0 + ( cp_vapor - cp_water ) * ( temp - tem00 ) * thermodyn_emask
353 
354  return
355  end subroutine atmos_hydrometeor_lhv_0d
356 
357  !-----------------------------------------------------------------------------
358 !OCL SERIAL
359  subroutine atmos_hydrometeor_lhv_1d( &
360  KA, KS, KE, &
361  temp, &
362  lhv )
363  implicit none
364  integer, intent(in) :: KA, KS, KE
365 
366  real(RP), intent(in) :: temp(ka)
367 
368  real(RP), intent(out) :: lhv (ka)
369 
370  integer :: k
371  !---------------------------------------------------------------------------
372 
373  do k = ks, ke
374  call atmos_hydrometeor_lhv_0d( temp(k), lhv(k) )
375  enddo
376 
377  return
378  end subroutine atmos_hydrometeor_lhv_1d
379 
380  !-----------------------------------------------------------------------------
381  subroutine atmos_hydrometeor_lhv_2d( &
382  IA, IS, IE, JA, JS, JE, &
383  temp, &
384  lhv )
385  implicit none
386  integer, intent(in) :: IA, IS, IE
387  integer, intent(in) :: JA, JS, JE
388 
389  real(RP), intent(in) :: temp(ia,ja)
390  real(RP), intent(out) :: lhv (ia,ja)
391 
392  integer :: i, j
393  !---------------------------------------------------------------------------
394 
395  !$omp parallel do OMP_SCHEDULE_ collapse(2)
396  do j = js, je
397  do i = is, ie
398  call atmos_hydrometeor_lhv_0d( temp(i,j), lhv(i,j) )
399  enddo
400  enddo
401 
402  return
403  end subroutine atmos_hydrometeor_lhv_2d
404 
405  !-----------------------------------------------------------------------------
406  subroutine atmos_hydrometeor_lhv_3d( &
407  KA, KS, KE, &
408  IA, IS, IE, &
409  JA, JS, JE, &
410  temp, &
411  lhv )
412  implicit none
413  integer, intent(in) :: KA, KS, KE
414  integer, intent(in) :: IA, IS, IE
415  integer, intent(in) :: JA, JS, JE
416 
417  real(RP), intent(in) :: temp(ka,ia,ja)
418  real(RP), intent(out) :: lhv (ka,ia,ja)
419 
420  integer :: k, i, j
421  !---------------------------------------------------------------------------
422 
423  do j = js, je
424  do i = is, ie
425  do k = ks, ke
426  call atmos_hydrometeor_lhv_0d( temp(k,i,j), lhv(k,i,j) )
427  enddo
428  enddo
429  enddo
430 
431  return
432  end subroutine atmos_hydrometeor_lhv_3d
433 
434  !-----------------------------------------------------------------------------
435  subroutine atmos_hydrometeor_lhs_0d( &
436  temp, &
437  lhs )
438  use scale_const, only: &
439  tem00 => const_tem00, &
440  lhs0 => const_lhs0
441  implicit none
442  real(RP), intent(in) :: temp
443  real(RP), intent(out) :: lhs
444  !---------------------------------------------------------------------------
445 
446  lhs = lhs0 + ( cp_vapor - cp_ice ) * ( temp - tem00 ) * thermodyn_emask
447 
448  return
449  end subroutine atmos_hydrometeor_lhs_0d
450 
451  !-----------------------------------------------------------------------------
452 !OCL SERIAL
453  subroutine atmos_hydrometeor_lhs_1d( &
454  KA, KS, KE, &
455  temp, &
456  lhs )
457  implicit none
458  integer, intent(in) :: KA, KS, KE
459 
460  real(RP), intent(in) :: temp(ka)
461 
462  real(RP), intent(out) :: lhs (ka)
463 
464  integer :: k
465  !---------------------------------------------------------------------------
466 
467  do k = ks, ke
468  call atmos_hydrometeor_lhs( temp(k), lhs(k) )
469  enddo
470 
471  return
472  end subroutine atmos_hydrometeor_lhs_1d
473 
474  !-----------------------------------------------------------------------------
475  subroutine atmos_hydrometeor_lhs_2d( &
476  IA, IS, IE, JA, JS, JE, &
477  temp, &
478  lhs )
479  implicit none
480  integer, intent(in) :: IA, IS, IE
481  integer, intent(in) :: JA, JS, JE
482 
483  real(RP), intent(in) :: temp(ia,ja)
484  real(RP), intent(out) :: lhs (ia,ja)
485 
486  integer :: i, j
487  !---------------------------------------------------------------------------
488 
489  !$omp parallel do OMP_SCHEDULE_ collapse(2)
490  do j = js, je
491  do i = is, ie
492  call atmos_hydrometeor_lhs( temp(i,j), lhs(i,j) )
493  enddo
494  enddo
495 
496  return
497  end subroutine atmos_hydrometeor_lhs_2d
498 
499  !-----------------------------------------------------------------------------
500  subroutine atmos_hydrometeor_lhs_3d( &
501  KA, KS, KE, IA, IS, IE, JA, JS, JE, &
502  temp, &
503  lhs )
504  implicit none
505 
506  integer, intent(in) :: KA, KS, KE
507  integer, intent(in) :: IA, IS, IE
508  integer, intent(in) :: JA, JS, JE
509 
510  real(RP), intent(in) :: temp(ka,ia,ja)
511  real(RP), intent(out) :: lhs (ka,ia,ja)
512 
513  integer :: k, i, j
514  !---------------------------------------------------------------------------
515 
516  !$omp parallel do OMP_SCHEDULE_ collapse(2)
517  do j = js, je
518  do i = is, ie
519  do k = ks, ke
520  call atmos_hydrometeor_lhs( temp(k,i,j), lhs(k,i,j) )
521  enddo
522  enddo
523  enddo
524 
525  return
526  end subroutine atmos_hydrometeor_lhs_3d
527 
528  !-----------------------------------------------------------------------------
529  subroutine atmos_hydrometeor_lhf_0d( &
530  temp, &
531  lhf )
532  use scale_const, only: &
533  tem00 => const_tem00, &
534  lhf0 => const_lhf0
535  implicit none
536  real(RP), intent(in) :: temp
537  real(RP), intent(out) :: lhf
538  !---------------------------------------------------------------------------
539 
540  lhf = lhf0 + ( cp_water - cp_ice ) * ( temp - tem00 ) * thermodyn_emask
541 
542  return
543  end subroutine atmos_hydrometeor_lhf_0d
544 
545  !-----------------------------------------------------------------------------
546 !OCL SERIAL
547  subroutine atmos_hydrometeor_lhf_1d( &
548  KA, KS, KE, &
549  temp, &
550  lhf )
551  implicit none
552  integer, intent(in) :: KA, KS, KE
553 
554  real(RP), intent(in) :: temp(ka)
555  real(RP), intent(out) :: lhf (ka)
556 
557  integer :: k
558  !---------------------------------------------------------------------------
559 
560  do k = ks, ke
561  call atmos_hydrometeor_lhf( temp(k), lhf(k) )
562  enddo
563 
564  return
565  end subroutine atmos_hydrometeor_lhf_1d
566 
567  !-----------------------------------------------------------------------------
568  subroutine atmos_hydrometeor_lhf_2d( &
569  IA, IS, IE, JA, JS, JE, &
570  temp, &
571  lhf )
572  implicit none
573  integer, intent(in) :: IA, IS, IE
574  integer, intent(in) :: JA, JS, JE
575 
576  real(RP), intent(in) :: temp(ia,ja)
577  real(RP), intent(out) :: lhf (ia,ja)
578 
579  integer :: i, j
580  !---------------------------------------------------------------------------
581 
582  !$omp parallel do OMP_SCHEDULE_ collapse(2)
583  do j = js, je
584  do i = is, ie
585  call atmos_hydrometeor_lhf( temp(i,j), lhf(i,j) )
586  enddo
587  enddo
588 
589  return
590  end subroutine atmos_hydrometeor_lhf_2d
591 
592  !-----------------------------------------------------------------------------
593  subroutine atmos_hydrometeor_lhf_3d( &
594  KA, KS, KE, &
595  IA, IS, IE, &
596  JA, JS, JE, &
597  temp, &
598  lhf )
599  implicit none
600  integer, intent(in) :: KA, KS, KE
601  integer, intent(in) :: IA, IS, IE
602  integer, intent(in) :: JA, JS, JE
603 
604  real(RP), intent(in) :: temp(ka,ia,ja)
605  real(RP), intent(out) :: lhf (ka,ia,ja)
606 
607  integer :: k, i, j
608  !---------------------------------------------------------------------------
609 
610  !$omp parallel do OMP_SCHEDULE_ collapse(2)
611  do j = js, je
612  do i = is, ie
613  do k = ks, ke
614  call atmos_hydrometeor_lhf( temp(k,i,j), lhf(k,i,j) )
615  enddo
616  enddo
617  enddo
618 
619  return
620  end subroutine atmos_hydrometeor_lhf_3d
621 
622  !-----------------------------------------------------------------------------
624  subroutine atmos_hydrometeor_entr_0d( &
625  TEMP, PRES, &
626  QV, QI, Qdry, &
627  Rtot, CPtot, &
628  entr )
629  use scale_const, only: &
630  pre00 => const_pre00, &
631  tem00 => const_tem00, &
632  rdry => const_rdry, &
633  rvap => const_rvap, &
634  lhv0 => const_lhv0, &
635  lhf0 => const_lhf0, &
636  psat0 => const_psat0
637  implicit none
638 
639  real(RP), intent(in) :: TEMP
640  real(RP), intent(in) :: PRES
641  real(RP), intent(in) :: QV
642  real(RP), intent(in) :: QI
643  real(RP), intent(in) :: Qdry
644  real(RP), intent(in) :: Rtot
645  real(RP), intent(in) :: CPtot
646 
647  real(RP), intent(out) :: entr
648 
649  real(RP) :: pres_dry, pres_vap
650  !---------------------------------------------------------------------------
651 
652  pres_dry = pres * qdry * rdry / rtot
653  pres_vap = pres * qv * rvap / rtot
654 
655  entr = cptot * log( temp / tem00 ) &
656  - qdry * rdry * log( pres_dry / pre00 ) &
657  - qv * rvap * log( pres_vap / psat0 ) &
658  + ( qv * lhv0 - qi * lhf0 ) / tem00
659 
660  return
661  end subroutine atmos_hydrometeor_entr_0d
662 
663  !-----------------------------------------------------------------------------
665  subroutine atmos_hydrometeor_entr_2d( &
666  IA, IS, IE, JA, JS, JE, &
667  TEMP, PRES, &
668  QV, QI, Qdry, &
669  Rtot, CPtot, &
670  entr )
671  implicit none
672  integer, intent(in) :: IA, IS, IE
673  integer, intent(in) :: JA, JS, JE
674 
675  real(RP), intent(in) :: TEMP (ia,ja)
676  real(RP), intent(in) :: PRES (ia,ja)
677  real(RP), intent(in) :: QV (ia,ja)
678  real(RP), intent(in) :: QI (ia,ja)
679  real(RP), intent(in) :: Qdry (ia,ja)
680  real(RP), intent(in) :: Rtot (ia,ja)
681  real(RP), intent(in) :: CPtot(ia,ja)
682 
683  real(RP), intent(out) :: entr(ia,ja)
684 
685  integer :: i, j
686  !---------------------------------------------------------------------------
687 
688  !$omp parallel do OMP_SCHEDULE_ collapse(2)
689  do j = js, je
690  do i = is, ie
691  call atmos_hydrometeor_entr_0d( &
692  temp(i,j), pres(i,j), & ! [IN]
693  qv(i,j), qi(i,j), qdry(i,j), & ! [IN]
694  rtot(i,j), cptot(i,j), & ! [IN]
695  entr(i,j) ) ! [OUT]
696  enddo
697  enddo
698 
699  return
700  end subroutine atmos_hydrometeor_entr_2d
701  !-----------------------------------------------------------------------------
703  subroutine atmos_hydrometeor_entr_3d( &
704  KA, KS, KE, IA, IS, IE, JA, JS, JE, &
705  TEMP, PRES, &
706  QV, QI, Qdry, &
707  Rtot, CPtot, &
708  entr )
709  implicit none
710  integer, intent(in) :: KA, KS, KE
711  integer, intent(in) :: IA, IS, IE
712  integer, intent(in) :: JA, JS, JE
713 
714  real(RP), intent(in) :: TEMP (ka,ia,ja)
715  real(RP), intent(in) :: PRES (ka,ia,ja)
716  real(RP), intent(in) :: QV (ka,ia,ja)
717  real(RP), intent(in) :: QI (ka,ia,ja)
718  real(RP), intent(in) :: Qdry (ka,ia,ja)
719  real(RP), intent(in) :: Rtot (ka,ia,ja)
720  real(RP), intent(in) :: CPtot(ka,ia,ja)
721 
722  real(RP), intent(out) :: entr(ka,ia,ja)
723 
724  integer :: k, i, j
725  !---------------------------------------------------------------------------
726 
727  !$omp parallel do OMP_SCHEDULE_ collapse(2)
728  do j = js, je
729  do i = is, ie
730  do k = ks, ke
731  call atmos_hydrometeor_entr_0d( &
732  temp(k,i,j), pres(k,i,j), & ! [IN]
733  qv(k,i,j), qi(k,i,j), qdry(k,i,j), & ! [IN]
734  rtot(k,i,j), cptot(k,i,j), & ! [IN]
735  entr(k,i,j) ) ! [OUT]
736  enddo
737  enddo
738  enddo
739 
740  return
741  end subroutine atmos_hydrometeor_entr_3d
742 
743  !-----------------------------------------------------------------------------
745  subroutine atmos_hydrometeor_entr2temp_0d( &
746  entr, pres, &
747  qv, qi, qdry, &
748  Rtot, CPtot, &
749  temp )
750  use scale_const, only: &
751  pre00 => const_pre00, &
752  tem00 => const_tem00, &
753  rdry => const_rdry, &
754  rvap => const_rvap, &
755  lhv0 => const_lhv0, &
756  lhf0 => const_lhf0, &
757  psat0 => const_psat0
758  implicit none
759 
760  real(RP), intent(in) :: entr
761  real(RP), intent(in) :: pres
762  real(RP), intent(in) :: qv
763  real(RP), intent(in) :: qi
764  real(RP), intent(in) :: qdry
765  real(RP), intent(in) :: Rtot
766  real(RP), intent(in) :: CPtot
767 
768  real(RP), intent(out) :: temp
769 
770  real(RP) :: pres_dry, pres_vap
771  !---------------------------------------------------------------------------
772 
773  pres_dry = pres * qdry * rdry / rtot
774  pres_vap = pres * qv * rvap / rtot
775 
776  temp = tem00 &
777  * exp( ( entr &
778  + qdry * rdry * log( pres_dry / pre00 ) &
779  + qv * rvap * log( pres_vap / psat0 ) &
780  - ( qv * lhv0 - qi * lhf0 ) / tem00 ) / cptot )
781  return
782  end subroutine atmos_hydrometeor_entr2temp_0d
783 
784 end module scale_atmos_hydrometeor
real(rp), parameter, public const_psat0
saturate pressure of water vapor at 0C [Pa]
Definition: scale_const.F90:81
character(len=h_short), dimension(n_hyd), parameter, public hyd_name
subroutine atmos_hydrometeor_lhv_1d(KA, KS, KE, temp, lhv)
subroutine atmos_hydrometeor_lhf_1d(KA, KS, KE, temp, lhf)
real(rp), public cv_ice
CV for ice [J/kg/K].
real(rp), parameter, public const_ci
specific heat (ice) [J/kg/K]
Definition: scale_const.F90:67
real(rp), parameter, public const_dwatr
density of water [kg/m3]
Definition: scale_const.F90:82
real(rp), public cp_ice
CP for ice [J/kg/K].
integer, parameter, public i_hs
snow
real(rp), parameter, public const_cl
specific heat (liquid water) [J/kg/K]
Definition: scale_const.F90:66
integer, parameter, public i_hr
liquid water rain
integer, parameter, public i_hi
ice water cloud
real(rp), parameter, public const_tem00
temperature reference (0C) [K]
Definition: scale_const.F90:90
real(rp), public const_cvvap
specific heat (water vapor, constant volume) [J/kg/K]
Definition: scale_const.F90:65
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)
integer, parameter, public i_hh
hail
real(rp), public const_lhf0
latent heat of fusion at 0C [J/kg]
Definition: scale_const.F90:79
real(rp), parameter, public const_dice
density of ice [kg/m3]
Definition: scale_const.F90:83
real(rp), public const_rdry
specific gas constant (dry air) [J/kg/K]
Definition: scale_const.F90:55
real(rp), parameter, public const_lhs0
latent heat of sublimation at 0C [J/kg]
Definition: scale_const.F90:77
module TRACER
real(rp), public cv_vapor
CV for vapor [J/kg/K].
subroutine atmos_hydrometeor_lhs_1d(KA, KS, KE, temp, lhs)
module atmosphere / hydrometeor
real(rp), parameter, public const_lhv0
latent heat of vaporizaion at 0C [J/kg]
Definition: scale_const.F90:75
real(rp), public const_pre00
pressure reference [Pa]
Definition: scale_const.F90:88
module PROCESS
Definition: scale_prc.F90:11
subroutine, public const_setup
Setup.
real(rp), public const_lhf00
latent heat of fusion at 0K [J/kg]
Definition: scale_const.F90:80
real(rp), public const_lhs00
latent heat of sublimation at 0K [J/kg]
Definition: scale_const.F90:78
real(rp), public const_lhv00
latent heat of vaporizaion at 0K [J/kg]
Definition: scale_const.F90:76
logical, public atmos_hydrometeor_ice_phase
real(rp), public lhf
latent heat of fusion for use [J/kg]
real(rp), parameter, public const_rvap
specific gas constant (water vapor) [J/kg/K]
Definition: scale_const.F90:63
subroutine, public prc_abort
Abort Process.
Definition: scale_prc.F90:338
real(rp), public lhv
latent heat of vaporization for use [J/kg]
real(rp), public lhs
latent heat of sublimation for use [J/kg]
module CONSTANT
Definition: scale_const.F90:11
integer, parameter, public i_hc
liquid water cloud
subroutine atmos_hydrometeor_lhv_0d(temp, lhv)
module profiler
Definition: scale_prof.F90:11
subroutine, public atmos_hydrometeor_regist(NL, NI, NAME, DESC, UNIT, Q0, ADVC)
ATMOS_HYDROMETEOR_regist Regist tracer.
subroutine, public atmos_hydrometeor_setup
Setup.
real(rp), dimension(n_hyd), public hyd_dens
module PRECISION
subroutine, public tracer_regist(QS, NQ, NAME, DESC, UNIT, CV, CP, R, ADVC, MASS)
Regist tracer.
module STDIO
Definition: scale_io.F90:10
character(len=h_short), dimension(n_hyd), parameter, public num_name
integer, parameter, public n_hyd
character(len=h_mid), dimension(n_hyd), parameter, public hyd_desc
real(rp), parameter, public const_cpvap
specific heat (water vapor, constant pressure) [J/kg/K]
Definition: scale_const.F90:64
character(len=h_short), public const_thermodyn_type
internal energy type
Definition: scale_const.F90:96
real(rp), public cp_vapor
CP for vapor [J/kg/K].
real(rp), public cp_water
CP for water [J/kg/K].
integer, parameter, public i_hg
graupel
real(rp), public cv_water
CV for water [J/kg/K].