35 public :: atmos_saturation_alpha
37 public :: atmos_saturation_psat_all
38 public :: atmos_saturation_psat_liq
39 public :: atmos_saturation_psat_ice
41 public :: atmos_saturation_psat2qsat_pres
42 public :: atmos_saturation_psat2qsat_dens
44 public :: atmos_saturation_pres2qsat_all
45 public :: atmos_saturation_pres2qsat_all_para
46 public :: atmos_saturation_pres2qsat_liq
47 public :: atmos_saturation_pres2qsat_liq_para
48 public :: atmos_saturation_pres2qsat_ice
49 public :: atmos_saturation_pres2qsat_ice_para
51 public :: atmos_saturation_dens2qsat_all
52 public :: atmos_saturation_dens2qsat_liq
53 public :: atmos_saturation_dens2qsat_ice
55 public :: atmos_saturation_dalphadt
57 public :: atmos_saturation_dqs_dtem_dens_liq
58 public :: atmos_saturation_dqs_dtem_dens_ice
59 public :: atmos_saturation_dqs_dtem_dpre_liq
60 public :: atmos_saturation_dqs_dtem_dpre_ice
62 public :: atmos_saturation_tdew_liq
64 public :: atmos_saturation_pote
66 public :: atmos_saturation_moist_conversion_dens_liq
67 public :: atmos_saturation_moist_conversion_dens_all
68 public :: atmos_saturation_moist_conversion_pres_liq
70 interface atmos_saturation_alpha
72 module procedure atmos_saturation_alpha_1d
73 module procedure atmos_saturation_alpha_3d
74 end interface atmos_saturation_alpha
76 interface atmos_saturation_psat_all
77 module procedure atmos_saturation_psat_all_0d
78 module procedure atmos_saturation_psat_all_1d
79 module procedure atmos_saturation_psat_all_2d
80 module procedure atmos_saturation_psat_all_3d
81 end interface atmos_saturation_psat_all
82 interface atmos_saturation_psat_liq
83 module procedure atmos_saturation_psat_liq_0d
84 module procedure atmos_saturation_psat_liq_1d
85 module procedure atmos_saturation_psat_liq_2d
86 module procedure atmos_saturation_psat_liq_3d
87 end interface atmos_saturation_psat_liq
88 interface atmos_saturation_psat_ice
89 module procedure atmos_saturation_psat_ice_0d
90 module procedure atmos_saturation_psat_ice_1d
91 module procedure atmos_saturation_psat_ice_2d
92 module procedure atmos_saturation_psat_ice_3d
93 end interface atmos_saturation_psat_ice
95 interface atmos_saturation_psat2qsat_pres
96 module procedure atmos_saturation_psat2qsat_pres_0d
97 module procedure atmos_saturation_psat2qsat_pres_qdry_0d
98 end interface atmos_saturation_psat2qsat_pres
99 interface atmos_saturation_psat2qsat_dens
100 module procedure atmos_saturation_psat2qsat_dens_0d
101 end interface atmos_saturation_psat2qsat_dens
103 interface atmos_saturation_pres2qsat_all
104 module procedure atmos_saturation_pres2qsat_all_0d
105 module procedure atmos_saturation_pres2qsat_all_1d
106 module procedure atmos_saturation_pres2qsat_all_2d
107 module procedure atmos_saturation_pres2qsat_all_3d
108 module procedure atmos_saturation_pres2qsat_all_qdry_0d
109 module procedure atmos_saturation_pres2qsat_all_qdry_1d
110 module procedure atmos_saturation_pres2qsat_all_qdry_2d
111 module procedure atmos_saturation_pres2qsat_all_qdry_3d
112 end interface atmos_saturation_pres2qsat_all
113 interface atmos_saturation_pres2qsat_all_para
114 module procedure atmos_saturation_pres2qsat_all_1d_para
115 module procedure atmos_saturation_pres2qsat_all_qdry_1d_para
116 end interface atmos_saturation_pres2qsat_all_para
117 interface atmos_saturation_pres2qsat_liq
118 module procedure atmos_saturation_pres2qsat_liq_0d
119 module procedure atmos_saturation_pres2qsat_liq_1d
120 module procedure atmos_saturation_pres2qsat_liq_3d
121 module procedure atmos_saturation_pres2qsat_liq_qdry_0d
122 module procedure atmos_saturation_pres2qsat_liq_qdry_1d
123 module procedure atmos_saturation_pres2qsat_liq_qdry_3d
124 end interface atmos_saturation_pres2qsat_liq
125 interface atmos_saturation_pres2qsat_liq_para
126 module procedure atmos_saturation_pres2qsat_liq_1d_para
127 module procedure atmos_saturation_pres2qsat_liq_qdry_1d_para
128 end interface atmos_saturation_pres2qsat_liq_para
129 interface atmos_saturation_pres2qsat_ice
130 module procedure atmos_saturation_pres2qsat_ice_0d
131 module procedure atmos_saturation_pres2qsat_ice_1d
132 module procedure atmos_saturation_pres2qsat_ice_3d
133 module procedure atmos_saturation_pres2qsat_ice_qdry_0d
134 module procedure atmos_saturation_pres2qsat_ice_qdry_1d
135 module procedure atmos_saturation_pres2qsat_ice_qdry_3d
136 end interface atmos_saturation_pres2qsat_ice
137 interface atmos_saturation_pres2qsat_ice_para
138 module procedure atmos_saturation_pres2qsat_ice_1d_para
139 module procedure atmos_saturation_pres2qsat_ice_qdry_1d_para
140 end interface atmos_saturation_pres2qsat_ice_para
142 interface atmos_saturation_dens2qsat_all
143 module procedure atmos_saturation_dens2qsat_all_0d
144 module procedure atmos_saturation_dens2qsat_all_1d
145 module procedure atmos_saturation_dens2qsat_all_3d
146 end interface atmos_saturation_dens2qsat_all
147 interface atmos_saturation_dens2qsat_liq
148 module procedure atmos_saturation_dens2qsat_liq_0d
149 module procedure atmos_saturation_dens2qsat_liq_1d
150 module procedure atmos_saturation_dens2qsat_liq_3d
151 end interface atmos_saturation_dens2qsat_liq
152 interface atmos_saturation_dens2qsat_ice
153 module procedure atmos_saturation_dens2qsat_ice_0d
154 module procedure atmos_saturation_dens2qsat_ice_1d
155 module procedure atmos_saturation_dens2qsat_ice_3d
156 end interface atmos_saturation_dens2qsat_ice
158 interface atmos_saturation_dalphadt
159 module procedure atmos_saturation_dalphadt_0d
160 module procedure atmos_saturation_dalphadt_1d
161 module procedure atmos_saturation_dalphadt_3d
162 end interface atmos_saturation_dalphadt
164 interface atmos_saturation_dqs_dtem_dens_liq
165 module procedure atmos_saturation_dqs_dtem_dens_liq_0d
167 module procedure atmos_saturation_dqs_dtem_dens_liq_3d
168 end interface atmos_saturation_dqs_dtem_dens_liq
169 interface atmos_saturation_dqs_dtem_dens_ice
170 module procedure atmos_saturation_dqs_dtem_dens_ice_0d
172 module procedure atmos_saturation_dqs_dtem_dens_ice_3d
173 end interface atmos_saturation_dqs_dtem_dens_ice
174 interface atmos_saturation_dqs_dtem_dpre_liq
175 module procedure atmos_saturation_dqs_dtem_dpre_liq_0d
177 module procedure atmos_saturation_dqs_dtem_dpre_liq_3d
178 end interface atmos_saturation_dqs_dtem_dpre_liq
179 interface atmos_saturation_dqs_dtem_dpre_ice
180 module procedure atmos_saturation_dqs_dtem_dpre_ice_0d
182 module procedure atmos_saturation_dqs_dtem_dpre_ice_3d
183 end interface atmos_saturation_dqs_dtem_dpre_ice
185 interface atmos_saturation_tdew_liq
186 module procedure atmos_saturation_tdew_liq_0d
188 module procedure atmos_saturation_tdew_liq_3d
189 end interface atmos_saturation_tdew_liq
191 interface atmos_saturation_pote
194 module procedure atmos_saturation_pote_3d
195 end interface atmos_saturation_pote
197 interface atmos_saturation_moist_conversion_dens_liq
198 module procedure atmos_saturation_moist_conversion_dens_liq_0d
199 end interface atmos_saturation_moist_conversion_dens_liq
200 interface atmos_saturation_moist_conversion_dens_all
202 end interface atmos_saturation_moist_conversion_dens_all
203 interface atmos_saturation_moist_conversion_pres_liq
205 end interface atmos_saturation_moist_conversion_pres_liq
219 real(RP),
private,
parameter :: TEM_MIN = 10.0_rp
221 real(RP),
private :: ATMOS_SATURATION_ULIMIT_TEMP = 273.15_rp
222 real(RP),
private :: ATMOS_SATURATION_LLIMIT_TEMP = 233.15_rp
225 real(RP),
private :: RTEM00
226 real(RP),
private :: dalphadT_const
227 real(RP),
private :: psat_min_liq
228 real(RP),
private :: psat_min_ice
231 real(RP),
private :: CPovR_liq
232 real(RP),
private :: CPovR_ice
233 real(RP),
private :: CVovR_liq
234 real(RP),
private :: CVovR_ice
235 real(RP),
private :: LovR_liq
236 real(RP),
private :: LovR_ice
260 namelist / param_atmos_saturation / &
261 atmos_saturation_ulimit_temp, &
262 atmos_saturation_llimit_temp
268 log_info(
"ATMOS_SATURATION_setup",*)
'Setup'
272 read(
io_fid_conf,nml=param_atmos_saturation,iostat=ierr)
274 log_info(
"ATMOS_SATURATION_setup",*)
'Not found namelist. Default used.'
275 elseif( ierr > 0 )
then
276 log_error(
"ATMOS_SATURATION_setup",*)
'Not appropriate names in namelist PARAM_ATMOS_SATURATION. Check!'
279 log_nml(param_atmos_saturation)
281 rtem00 = 1.0_rp / tem00
285 cpovr_liq = ( cpvap - cl ) / rvap
286 cpovr_ice = ( cpvap - ci ) / rvap
287 cvovr_liq = ( cvvap - cl ) / rvap
288 cvovr_ice = ( cvvap - ci ) / rvap
290 lovr_liq = lhv00 / rvap
291 lovr_ice = lhs00 / rvap
300 lovr_liq = lhv0 / rvap
301 lovr_ice = lhs0 / rvap
305 dalphadt_const = 1.0_rp / ( atmos_saturation_ulimit_temp - atmos_saturation_llimit_temp )
308 log_info(
"ATMOS_SATURATION_setup",
'(1x,A,F7.2,A,F7.2)')
'Temperature range for liquid/ice mixture : ', &
309 atmos_saturation_llimit_temp,
' - ', &
310 atmos_saturation_ulimit_temp
318 call atmos_saturation_psat_liq( tem_min, psat_min_liq )
319 call atmos_saturation_psat_ice( tem_min, psat_min_ice )
334 real(RP),
intent(in) :: temp
335 real(RP),
intent(out) :: alpha
338 alpha = ( temp - atmos_saturation_llimit_temp ) &
339 / ( atmos_saturation_ulimit_temp - atmos_saturation_llimit_temp )
341 alpha = min( max( alpha, 0.0_rp ), 1.0_rp )
349 subroutine atmos_saturation_alpha_1d( &
355 integer,
intent(in) :: KA, KS, KE
357 real(RP),
intent(in) :: temp (KA)
359 real(RP),
intent(out) :: alpha(KA)
370 end subroutine atmos_saturation_alpha_1d
374 subroutine atmos_saturation_alpha_3d( &
375 KA, KS, KE, IA, IS, IE, JA, JS, JE, &
379 integer,
intent(in) :: KA, KS, KE
380 integer,
intent(in) :: IA, IS, IE
381 integer,
intent(in) :: JA, JS, JE
383 real(RP),
intent(in) :: temp (KA,IA,JA)
384 real(RP),
intent(out) :: alpha(KA,IA,JA)
403 end subroutine atmos_saturation_alpha_3d
407 subroutine atmos_saturation_psat_all_0d( &
413 real(RP),
intent(in) :: temp
414 real(RP),
intent(out) :: psat
416 real(RP) :: alpha, psatl, psati
419 call atmos_saturation_alpha ( temp, alpha )
420 call atmos_saturation_psat_liq( temp, psatl )
421 call atmos_saturation_psat_ice( temp, psati )
423 psat = psatl * ( alpha ) &
424 + psati * ( 1.0_rp - alpha )
427 end subroutine atmos_saturation_psat_all_0d
432 subroutine atmos_saturation_psat_all_1d( &
438 integer,
intent(in) :: KA, KS, KE
440 real(RP),
intent(in) :: temp(KA)
441 real(RP),
intent(out) :: psat(KA)
443 real(RP) :: alpha, psatl, psati
451 call atmos_saturation_alpha ( temp(k), alpha )
452 call atmos_saturation_psat_liq( temp(k), psatl )
453 call atmos_saturation_psat_ice( temp(k), psati )
455 psat(k) = psatl * ( alpha ) &
456 + psati * ( 1.0_rp - alpha )
460 end subroutine atmos_saturation_psat_all_1d
464 subroutine atmos_saturation_psat_all_2d( &
470 integer,
intent(in) :: IA, IS, IE
471 integer,
intent(in) :: JA, JS, JE
473 real(RP),
intent(in) :: temp(IA,JA)
475 real(RP),
intent(out) :: psat(IA,JA)
477 real(RP) :: alpha, psatl, psati
489 call atmos_saturation_alpha ( temp(i,j), alpha )
490 call atmos_saturation_psat_liq( temp(i,j), psatl )
491 call atmos_saturation_psat_ice( temp(i,j), psati )
493 psat(i,j) = psatl * ( alpha ) &
494 + psati * ( 1.0_rp - alpha )
500 end subroutine atmos_saturation_psat_all_2d
504 subroutine atmos_saturation_psat_all_3d( &
512 integer,
intent(in) :: KA, KS, KE
513 integer,
intent(in) :: IA, IS, IE
514 integer,
intent(in) :: JA, JS, JE
516 real(RP),
intent(in) :: temp(KA,IA,JA)
517 real(RP),
intent(out) :: psat(KA,IA,JA)
519 real(RP) :: alpha, psatl, psati
532 call atmos_saturation_alpha ( temp(k,i,j), alpha )
533 call atmos_saturation_psat_liq( temp(k,i,j), psatl )
534 call atmos_saturation_psat_ice( temp(k,i,j), psati )
536 psat(k,i,j) = psatl * ( alpha ) &
537 + psati * ( 1.0_rp - alpha )
544 end subroutine atmos_saturation_psat_all_3d
548 subroutine atmos_saturation_psat_liq_0d( &
554 real(RP),
intent(in) :: temp
555 real(RP),
intent(out) :: psat
560 psat = psat0 * exp( log( temp * rtem00 ) * cpovr_liq &
561 + lovr_liq * ( rtem00 - 1.0_rp/temp ) )
564 end subroutine atmos_saturation_psat_liq_0d
569 subroutine atmos_saturation_psat_liq_1d( &
575 integer,
intent(in) :: KA, KS, KE
577 real(RP),
intent(in) :: temp(KA)
578 real(RP),
intent(out) :: psat(KA)
584 call atmos_saturation_psat_liq_0d( temp(k), &
589 end subroutine atmos_saturation_psat_liq_1d
593 subroutine atmos_saturation_psat_liq_2d( &
600 integer,
intent(in) :: IA, IS, IE
601 integer,
intent(in) :: JA, JS, JE
603 real(RP),
intent(in) :: temp(IA,JA)
604 real(RP),
intent(out) :: psat(IA,JA)
613 call atmos_saturation_psat_liq_0d( temp(i,j), &
620 end subroutine atmos_saturation_psat_liq_2d
624 subroutine atmos_saturation_psat_liq_3d( &
632 integer,
intent(in) :: KA, KS, KE
633 integer,
intent(in) :: IA, IS, IE
634 integer,
intent(in) :: JA, JS, JE
636 real(RP),
intent(in) :: temp(KA,IA,JA)
637 real(RP),
intent(out) :: psat(KA,IA,JA)
647 call atmos_saturation_psat_liq_0d( temp(k,i,j), &
655 end subroutine atmos_saturation_psat_liq_3d
659 subroutine atmos_saturation_psat_ice_0d( &
665 real(RP),
intent(in) :: temp
667 real(RP),
intent(out) :: psat
672 psat = psat0 * exp( log( temp * rtem00 ) * cpovr_ice &
673 + lovr_ice * ( rtem00 - 1.0_rp/temp ) )
676 end subroutine atmos_saturation_psat_ice_0d
681 subroutine atmos_saturation_psat_ice_1d( &
687 integer,
intent(in) :: KA, KS, KE
689 real(RP),
intent(in) :: temp(KA)
690 real(RP),
intent(out) :: psat(KA)
696 call atmos_saturation_psat_ice_0d( temp(k), &
701 end subroutine atmos_saturation_psat_ice_1d
705 subroutine atmos_saturation_psat_ice_2d( &
712 integer,
intent(in) :: IA, IS, IE
713 integer,
intent(in) :: JA, JS, JE
715 real(RP),
intent(in) :: temp(IA,JA)
716 real(RP),
intent(out) :: psat(IA,JA)
725 call atmos_saturation_psat_ice_0d( temp(i,j), &
732 end subroutine atmos_saturation_psat_ice_2d
736 subroutine atmos_saturation_psat_ice_3d( &
744 integer,
intent(in) :: KA, KS, KE
745 integer,
intent(in) :: IA, IS, IE
746 integer,
intent(in) :: JA, JS, JE
748 real(RP),
intent(in) :: temp(KA,IA,JA)
749 real(RP),
intent(out) :: psat(KA,IA,JA)
759 call atmos_saturation_psat_ice_0d( temp(k,i,j), &
767 end subroutine atmos_saturation_psat_ice_3d
772 subroutine atmos_saturation_psat2qsat_pres_0d( &
778 real(RP),
intent(in) :: psat
779 real(RP),
intent(in) :: pres
781 real(RP),
intent(out) :: qsat
784 qsat = epsvap * psat / ( pres - ( 1.0_rp-epsvap ) * psat )
787 end subroutine atmos_saturation_psat2qsat_pres_0d
791 subroutine atmos_saturation_psat2qsat_pres_qdry_0d( &
797 real(RP),
intent(in) :: psat
798 real(RP),
intent(in) :: pres
799 real(RP),
intent(in) :: qdry
801 real(RP),
intent(out) :: qsat
803 qsat = epsvap * qdry * psat / ( pres - psat )
806 end subroutine atmos_saturation_psat2qsat_pres_qdry_0d
810 subroutine atmos_saturation_pres2qsat_all_0d( &
816 real(RP),
intent(in) :: temp
817 real(RP),
intent(in) :: pres
819 real(RP),
intent(out) :: qsat
824 call atmos_saturation_psat_all_0d( temp, psat )
826 call atmos_saturation_psat2qsat_pres_0d( psat, pres, &
830 end subroutine atmos_saturation_pres2qsat_all_0d
834 subroutine atmos_saturation_pres2qsat_all_qdry_0d( &
840 real(RP),
intent(in) :: temp
841 real(RP),
intent(in) :: pres
842 real(RP),
intent(in) :: qdry
844 real(RP),
intent(out) :: qsat
849 call atmos_saturation_psat_all_0d( temp, psat )
851 call atmos_saturation_psat2qsat_pres_qdry_0d( psat, pres, qdry, &
855 end subroutine atmos_saturation_pres2qsat_all_qdry_0d
860 subroutine atmos_saturation_pres2qsat_all_1d( &
866 integer,
intent(in) :: KA, KS, KE
868 real(RP),
intent(in) :: temp(KA)
869 real(RP),
intent(in) :: pres(KA)
871 real(RP),
intent(out) :: qsat(KA)
877 call atmos_saturation_pres2qsat_all_0d( temp(k), pres(k), &
882 end subroutine atmos_saturation_pres2qsat_all_1d
886 subroutine atmos_saturation_pres2qsat_all_1d_para( &
891 integer,
intent(in) :: KA, KS, KE
893 real(RP),
intent(in) :: temp(KA)
894 real(RP),
intent(in) :: pres(KA)
896 real(RP),
intent(out) :: qsat(KA)
904 call atmos_saturation_pres2qsat_all_0d( temp(k), pres(k), &
910 end subroutine atmos_saturation_pres2qsat_all_1d_para
915 subroutine atmos_saturation_pres2qsat_all_qdry_1d( &
921 integer,
intent(in) :: KA, KS, KE
923 real(RP),
intent(in) :: temp(KA)
924 real(RP),
intent(in) :: pres(KA)
925 real(RP),
intent(in) :: qdry(KA)
927 real(RP),
intent(out) :: qsat(KA)
933 call atmos_saturation_pres2qsat_all_qdry_0d( temp(k), pres(k), qdry(k), &
938 end subroutine atmos_saturation_pres2qsat_all_qdry_1d
942 subroutine atmos_saturation_pres2qsat_all_qdry_1d_para( &
947 integer,
intent(in) :: KA, KS, KE
949 real(RP),
intent(in) :: temp(KA)
950 real(RP),
intent(in) :: pres(KA)
951 real(RP),
intent(in) :: qdry(KA)
953 real(RP),
intent(out) :: qsat(KA)
961 call atmos_saturation_pres2qsat_all_qdry_0d( temp(k), pres(k), qdry(k), &
967 end subroutine atmos_saturation_pres2qsat_all_qdry_1d_para
971 subroutine atmos_saturation_pres2qsat_all_2d( &
972 IA, IS, IE, JA, JS, JE, &
976 integer,
intent(in) :: IA, IS, IE
977 integer,
intent(in) :: JA, JS, JE
979 real(RP),
intent(in) :: temp(IA,JA)
980 real(RP),
intent(in) :: pres(IA,JA)
982 real(RP),
intent(out) :: qsat(IA,JA)
991 call atmos_saturation_pres2qsat_all_0d( temp(i,j), pres(i,j), &
998 end subroutine atmos_saturation_pres2qsat_all_2d
1002 subroutine atmos_saturation_pres2qsat_all_qdry_2d( &
1003 IA, IS, IE, JA, JS, JE, &
1007 integer,
intent(in) :: IA, IS, IE
1008 integer,
intent(in) :: JA, JS, JE
1010 real(RP),
intent(in) :: temp(IA,JA)
1011 real(RP),
intent(in) :: pres(IA,JA)
1012 real(RP),
intent(in) :: qdry(IA,JA)
1014 real(RP),
intent(out) :: qsat(IA,JA)
1023 call atmos_saturation_pres2qsat_all_qdry_0d( temp(i,j), pres(i,j), qdry(i,j), &
1030 end subroutine atmos_saturation_pres2qsat_all_qdry_2d
1034 subroutine atmos_saturation_pres2qsat_all_3d( &
1035 KA, KS, KE, IA, IS, IE, JA, JS, JE, &
1039 integer,
intent(in) :: KA, KS, KE
1040 integer,
intent(in) :: IA, IS, IE
1041 integer,
intent(in) :: JA, JS, JE
1043 real(RP),
intent(in) :: temp(KA,IA,JA)
1044 real(RP),
intent(in) :: pres(KA,IA,JA)
1046 real(RP),
intent(out) :: qsat(KA,IA,JA)
1056 call atmos_saturation_pres2qsat_all_0d( temp(k,i,j), pres(k,i,j), &
1064 end subroutine atmos_saturation_pres2qsat_all_3d
1068 subroutine atmos_saturation_pres2qsat_all_qdry_3d( &
1069 KA, KS, KE, IA, IS, IE, JA, JS, JE, &
1073 integer,
intent(in) :: KA, KS, KE
1074 integer,
intent(in) :: IA, IS, IE
1075 integer,
intent(in) :: JA, JS, JE
1077 real(RP),
intent(in) :: temp(KA,IA,JA)
1078 real(RP),
intent(in) :: pres(KA,IA,JA)
1079 real(RP),
intent(in) :: qdry(KA,IA,JA)
1081 real(RP),
intent(out) :: qsat(KA,IA,JA)
1091 call atmos_saturation_pres2qsat_all_qdry_0d( temp(k,i,j), pres(k,i,j), qdry(k,i,j), &
1099 end subroutine atmos_saturation_pres2qsat_all_qdry_3d
1103 subroutine atmos_saturation_pres2qsat_liq_0d( &
1109 real(RP),
intent(in) :: temp
1110 real(RP),
intent(in) :: pres
1112 real(RP),
intent(out) :: qsat
1117 call atmos_saturation_psat_liq( temp, psat )
1118 call atmos_saturation_psat2qsat_pres_0d( psat, pres, &
1122 end subroutine atmos_saturation_pres2qsat_liq_0d
1126 subroutine atmos_saturation_pres2qsat_liq_qdry_0d( &
1132 real(RP),
intent(in) :: temp
1133 real(RP),
intent(in) :: pres
1134 real(RP),
intent(in) :: qdry
1136 real(RP),
intent(out) :: qsat
1141 call atmos_saturation_psat_liq( temp, psat )
1142 call atmos_saturation_psat2qsat_pres_qdry_0d( psat, pres, qdry, &
1146 end subroutine atmos_saturation_pres2qsat_liq_qdry_0d
1151 subroutine atmos_saturation_pres2qsat_liq_1d( &
1157 integer,
intent(in) :: KA, KS, KE
1159 real(RP),
intent(in) :: temp(KA)
1160 real(RP),
intent(in) :: pres(KA)
1162 real(RP),
intent(out) :: qsat(KA)
1168 call atmos_saturation_pres2qsat_liq_0d( temp(k), pres(k), &
1173 end subroutine atmos_saturation_pres2qsat_liq_1d
1177 subroutine atmos_saturation_pres2qsat_liq_1d_para( &
1182 integer,
intent(in) :: KA, KS, KE
1184 real(RP),
intent(in) :: temp(KA)
1185 real(RP),
intent(in) :: pres(KA)
1187 real(RP),
intent(out) :: qsat(KA)
1195 call atmos_saturation_pres2qsat_liq_0d( temp(k), pres(k), &
1201 end subroutine atmos_saturation_pres2qsat_liq_1d_para
1206 subroutine atmos_saturation_pres2qsat_liq_qdry_1d( &
1212 integer,
intent(in) :: KA, KS, KE
1214 real(RP),
intent(in) :: temp(KA)
1215 real(RP),
intent(in) :: pres(KA)
1216 real(RP),
intent(in) :: qdry(KA)
1218 real(RP),
intent(out) :: qsat(KA)
1224 call atmos_saturation_pres2qsat_liq_qdry_0d( temp(k), pres(k), qdry(k), &
1229 end subroutine atmos_saturation_pres2qsat_liq_qdry_1d
1233 subroutine atmos_saturation_pres2qsat_liq_qdry_1d_para( &
1238 integer,
intent(in) :: KA, KS, KE
1240 real(RP),
intent(in) :: temp(KA)
1241 real(RP),
intent(in) :: pres(KA)
1242 real(RP),
intent(in) :: qdry(KA)
1244 real(RP),
intent(out) :: qsat(KA)
1252 call atmos_saturation_pres2qsat_liq_qdry_0d( temp(k), pres(k), qdry(k), &
1258 end subroutine atmos_saturation_pres2qsat_liq_qdry_1d_para
1262 subroutine atmos_saturation_pres2qsat_liq_3d( &
1263 KA, KS, KE, IA, IS, IE, JA, JS, JE, &
1267 integer,
intent(in) :: KA, KS, KE
1268 integer,
intent(in) :: IA, IS, IE
1269 integer,
intent(in) :: JA, JS, JE
1271 real(RP),
intent(in) :: temp(KA,IA,JA)
1272 real(RP),
intent(in) :: pres(KA,IA,JA)
1274 real(RP),
intent(out) :: qsat(KA,IA,JA)
1284 call atmos_saturation_pres2qsat_liq_0d( temp(k,i,j), pres(k,i,j), &
1292 end subroutine atmos_saturation_pres2qsat_liq_3d
1296 subroutine atmos_saturation_pres2qsat_liq_qdry_3d( &
1297 KA, KS, KE, IA, IS, IE, JA, JS, JE, &
1301 integer,
intent(in) :: KA, KS, KE
1302 integer,
intent(in) :: IA, IS, IE
1303 integer,
intent(in) :: JA, JS, JE
1305 real(RP),
intent(in) :: temp(KA,IA,JA)
1306 real(RP),
intent(in) :: pres(KA,IA,JA)
1307 real(RP),
intent(in) :: qdry(KA,IA,JA)
1309 real(RP),
intent(out) :: qsat(KA,IA,JA)
1319 call atmos_saturation_pres2qsat_liq_qdry_0d( temp(k,i,j), pres(k,i,j), qdry(k,i,j), &
1327 end subroutine atmos_saturation_pres2qsat_liq_qdry_3d
1331 subroutine atmos_saturation_pres2qsat_ice_0d( &
1337 real(RP),
intent(in) :: temp
1338 real(RP),
intent(in) :: pres
1340 real(RP),
intent(out) :: qsat
1345 call atmos_saturation_psat_ice( temp, psat )
1346 call atmos_saturation_psat2qsat_pres_0d( psat, pres, &
1350 end subroutine atmos_saturation_pres2qsat_ice_0d
1354 subroutine atmos_saturation_pres2qsat_ice_qdry_0d( &
1360 real(RP),
intent(in) :: temp
1361 real(RP),
intent(in) :: pres
1362 real(RP),
intent(in) :: qdry
1364 real(RP),
intent(out) :: qsat
1369 call atmos_saturation_psat_ice( temp, psat )
1370 call atmos_saturation_psat2qsat_pres_qdry_0d( psat, pres, qdry, &
1374 end subroutine atmos_saturation_pres2qsat_ice_qdry_0d
1379 subroutine atmos_saturation_pres2qsat_ice_1d( &
1385 integer,
intent(in) :: KA, KS, KE
1387 real(RP),
intent(in) :: temp(KA)
1388 real(RP),
intent(in) :: pres(KA)
1390 real(RP),
intent(out) :: qsat(KA)
1396 call atmos_saturation_pres2qsat_ice_0d( temp(k), pres(k), &
1401 end subroutine atmos_saturation_pres2qsat_ice_1d
1405 subroutine atmos_saturation_pres2qsat_ice_1d_para( &
1410 integer,
intent(in) :: KA, KS, KE
1412 real(RP),
intent(in) :: temp(KA)
1413 real(RP),
intent(in) :: pres(KA)
1415 real(RP),
intent(out) :: qsat(KA)
1423 call atmos_saturation_pres2qsat_ice_0d( temp(k), pres(k), &
1429 end subroutine atmos_saturation_pres2qsat_ice_1d_para
1434 subroutine atmos_saturation_pres2qsat_ice_qdry_1d( &
1440 integer,
intent(in) :: KA, KS, KE
1442 real(RP),
intent(in) :: temp(KA)
1443 real(RP),
intent(in) :: pres(KA)
1444 real(RP),
intent(in) :: qdry(KA)
1446 real(RP),
intent(out) :: qsat(KA)
1452 call atmos_saturation_pres2qsat_ice_qdry_0d( temp(k), pres(k), qdry(k), &
1457 end subroutine atmos_saturation_pres2qsat_ice_qdry_1d
1461 subroutine atmos_saturation_pres2qsat_ice_qdry_1d_para( &
1466 integer,
intent(in) :: KA, KS, KE
1468 real(RP),
intent(in) :: temp(KA)
1469 real(RP),
intent(in) :: pres(KA)
1470 real(RP),
intent(in) :: qdry(KA)
1472 real(RP),
intent(out) :: qsat(KA)
1480 call atmos_saturation_pres2qsat_ice_qdry_0d( temp(k), pres(k), qdry(k), &
1486 end subroutine atmos_saturation_pres2qsat_ice_qdry_1d_para
1490 subroutine atmos_saturation_pres2qsat_ice_3d( &
1491 KA, KS, KE, IA, IS, IE, JA, JS, JE, &
1495 integer,
intent(in) :: KA, KS, KE
1496 integer,
intent(in) :: IA, IS, IE
1497 integer,
intent(in) :: JA, JS, JE
1499 real(RP),
intent(in) :: temp(KA,IA,JA)
1500 real(RP),
intent(in) :: pres(KA,IA,JA)
1502 real(RP),
intent(out) :: qsat(KA,IA,JA)
1512 call atmos_saturation_pres2qsat_ice_0d( temp(k,i,j), pres(k,i,j), &
1520 end subroutine atmos_saturation_pres2qsat_ice_3d
1524 subroutine atmos_saturation_pres2qsat_ice_qdry_3d( &
1525 KA, KS, KE, IA, IS, IE, JA, JS, JE, &
1529 integer,
intent(in) :: KA, KS, KE
1530 integer,
intent(in) :: IA, IS, IE
1531 integer,
intent(in) :: JA, JS, JE
1533 real(RP),
intent(in) :: temp(KA,IA,JA)
1534 real(RP),
intent(in) :: pres(KA,IA,JA)
1535 real(RP),
intent(in) :: qdry(KA,IA,JA)
1537 real(RP),
intent(out) :: qsat(KA,IA,JA)
1547 call atmos_saturation_pres2qsat_ice_qdry_0d( temp(k,i,j), pres(k,i,j), qdry(k,i,j), &
1555 end subroutine atmos_saturation_pres2qsat_ice_qdry_3d
1559 subroutine atmos_saturation_psat2qsat_dens_0d( &
1564 real(RP),
intent(in) :: psat
1565 real(RP),
intent(in) :: temp
1566 real(RP),
intent(in) :: dens
1568 real(RP),
intent(out) :: qsat
1570 qsat = psat / ( dens * rvap * temp )
1573 end subroutine atmos_saturation_psat2qsat_dens_0d
1577 subroutine atmos_saturation_dens2qsat_all_0d( &
1583 real(RP),
intent(in) :: temp
1584 real(RP),
intent(in) :: dens
1586 real(RP),
intent(out) :: qsat
1591 call atmos_saturation_psat_all( temp, psat )
1592 call atmos_saturation_psat2qsat_dens_0d( psat, temp, dens, &
1596 end subroutine atmos_saturation_dens2qsat_all_0d
1601 subroutine atmos_saturation_dens2qsat_all_1d( &
1607 integer,
intent(in) :: KA, KS, KE
1609 real(RP),
intent(in) :: temp(KA)
1610 real(RP),
intent(in) :: dens(KA)
1612 real(RP),
intent(out) :: qsat(KA)
1618 call atmos_saturation_dens2qsat_all_0d( temp(k), dens(k), &
1623 end subroutine atmos_saturation_dens2qsat_all_1d
1627 subroutine atmos_saturation_dens2qsat_all_3d( &
1635 integer,
intent(in) :: KA, KS, KE
1636 integer,
intent(in) :: IA, IS, IE
1637 integer,
intent(in) :: JA, JS, JE
1639 real(RP),
intent(in) :: temp(KA,IA,JA)
1640 real(RP),
intent(in) :: dens(KA,IA,JA)
1642 real(RP),
intent(out) :: qsat(KA,IA,JA)
1652 call atmos_saturation_dens2qsat_all_0d( temp(k,i,j), dens(k,i,j), &
1660 end subroutine atmos_saturation_dens2qsat_all_3d
1664 subroutine atmos_saturation_dens2qsat_liq_0d( &
1670 real(RP),
intent(in) :: temp
1671 real(RP),
intent(in) :: dens
1673 real(RP),
intent(out) :: qsat
1678 call atmos_saturation_psat_liq_0d( temp, psat )
1679 call atmos_saturation_psat2qsat_dens_0d( psat, temp, dens, &
1683 end subroutine atmos_saturation_dens2qsat_liq_0d
1688 subroutine atmos_saturation_dens2qsat_liq_1d( &
1694 integer,
intent(in) :: KA, KS, KE
1696 real(RP),
intent(in) :: temp(KA)
1697 real(RP),
intent(in) :: dens(KA)
1699 real(RP),
intent(out) :: qsat(KA)
1705 call atmos_saturation_dens2qsat_liq_0d( temp(k), dens(k), &
1710 end subroutine atmos_saturation_dens2qsat_liq_1d
1714 subroutine atmos_saturation_dens2qsat_liq_3d( &
1715 KA, KS, KE, IA, IS, IE, JA, JS, JE, &
1719 integer,
intent(in) :: KA, KS, KE
1720 integer,
intent(in) :: IA, IS, IE
1721 integer,
intent(in) :: JA, JS, JE
1723 real(RP),
intent(in) :: temp(KA,IA,JA)
1724 real(RP),
intent(in) :: dens(KA,IA,JA)
1726 real(RP),
intent(out) :: qsat(KA,IA,JA)
1736 call atmos_saturation_dens2qsat_liq_0d( temp(k,i,j), dens(k,i,j), &
1744 end subroutine atmos_saturation_dens2qsat_liq_3d
1748 subroutine atmos_saturation_dens2qsat_ice_0d( &
1754 real(RP),
intent(in) :: temp
1755 real(RP),
intent(in) :: dens
1757 real(RP),
intent(out) :: qsat
1762 call atmos_saturation_psat_ice( temp, psat )
1763 call atmos_saturation_psat2qsat_dens( psat, temp, dens, &
1766 end subroutine atmos_saturation_dens2qsat_ice_0d
1771 subroutine atmos_saturation_dens2qsat_ice_1d( &
1777 integer,
intent(in) :: KA, KS, KE
1779 real(RP),
intent(in) :: temp(KA)
1780 real(RP),
intent(in) :: dens(KA)
1782 real(RP),
intent(out) :: qsat(KA)
1788 call atmos_saturation_dens2qsat_ice_0d( temp(k), dens(k), &
1793 end subroutine atmos_saturation_dens2qsat_ice_1d
1797 subroutine atmos_saturation_dens2qsat_ice_3d( &
1798 KA, KS, KE, IA, IS, IE, JA, JS, JE, &
1802 integer,
intent(in) :: KA, KS, KE
1803 integer,
intent(in) :: IA, IS, IE
1804 integer,
intent(in) :: JA, JS, JE
1806 real(RP),
intent(in) :: temp(KA,IA,JA)
1807 real(RP),
intent(in) :: dens(KA,IA,JA)
1809 real(RP),
intent(out) :: qsat(KA,IA,JA)
1819 call atmos_saturation_dens2qsat_ice_0d( temp(k,i,j), dens(k,i,j), &
1827 end subroutine atmos_saturation_dens2qsat_ice_3d
1831 subroutine atmos_saturation_dalphadt_0d( &
1836 real(RP),
intent(in) :: temp
1838 real(RP),
intent(out) :: dalpha_dT
1840 real(RP) :: lim1, lim2
1844 lim1 = 0.5_rp + sign( 0.5_rp, atmos_saturation_ulimit_temp - temp )
1846 lim2 = 0.5_rp + sign( 0.5_rp, temp - atmos_saturation_llimit_temp )
1848 dalpha_dt = dalphadt_const * lim1 * lim2
1851 end subroutine atmos_saturation_dalphadt_0d
1856 subroutine atmos_saturation_dalphadt_1d( &
1862 integer,
intent(in) :: KA, KS, KE
1864 real(RP),
intent(in) :: temp (KA)
1866 real(RP),
intent(out) :: dalpha_dT(KA)
1872 call atmos_saturation_dalphadt_0d( temp(k), dalpha_dt(k) )
1876 end subroutine atmos_saturation_dalphadt_1d
1880 subroutine atmos_saturation_dalphadt_3d( &
1881 KA, KS, KE, IA, IS, IE, JA, JS, JE, &
1885 integer,
intent(in) :: KA, KS, KE
1886 integer,
intent(in) :: IA, IS, IE
1887 integer,
intent(in) :: JA, JS, JE
1889 real(RP),
intent(in) :: temp (KA,IA,JA)
1891 real(RP),
intent(out) :: dalpha_dT(KA,IA,JA)
1901 call atmos_saturation_dalphadt_0d( temp(k,i,j), dalpha_dt(k,i,j) )
1908 end subroutine atmos_saturation_dalphadt_3d
1912 subroutine atmos_saturation_dqs_dtem_dens_liq_0d( &
1917 hydrometeor_lhv => atmos_hydrometeor_lhv
1920 real(RP),
intent(in) :: temp
1921 real(RP),
intent(in) :: dens
1923 real(RP),
intent(out) :: dqsdtem
1924 real(RP),
intent(out),
optional :: qsat
1930 call hydrometeor_lhv( temp, lhv )
1931 call atmos_saturation_psat_liq( temp, psat )
1933 dqsdtem = psat / ( dens* rvap * temp**2 ) &
1934 * ( lhv / ( rvap * temp ) - 1.0_rp )
1936 if (
present(qsat) ) &
1937 call atmos_saturation_psat2qsat_dens( psat, temp, dens, &
1941 end subroutine atmos_saturation_dqs_dtem_dens_liq_0d
1951 integer,
intent(in) :: KA, KS, KE
1953 real(RP),
intent(in) :: temp (KA)
1954 real(RP),
intent(in) :: dens (KA)
1956 real(RP),
intent(out) :: dqsdtem(KA)
1962 call atmos_saturation_dqs_dtem_dens_liq_0d( temp(k), dens(k), &
1971 subroutine atmos_saturation_dqs_dtem_dens_liq_3d( &
1972 KA, KS, KE, IA, IS, IE, JA, JS, JE, &
1976 integer,
intent(in) :: KA, KS, KE
1977 integer,
intent(in) :: IA, IS, IE
1978 integer,
intent(in) :: JA, JS, JE
1980 real(RP),
intent(in) :: temp (KA,IA,JA)
1981 real(RP),
intent(in) :: dens (KA,IA,JA)
1983 real(RP),
intent(out) :: dqsdtem(KA,IA,JA)
1993 call atmos_saturation_dqs_dtem_dens_liq_0d( temp(k,i,j), dens(k,i,j), &
2001 end subroutine atmos_saturation_dqs_dtem_dens_liq_3d
2005 subroutine atmos_saturation_dqs_dtem_dens_ice_0d( &
2010 hydrometeor_lhs => atmos_hydrometeor_lhs
2013 real(RP),
intent(in) :: temp
2014 real(RP),
intent(in) :: dens
2016 real(RP),
intent(out) :: dqsdtem
2017 real(RP),
intent(out),
optional :: qsat
2023 call hydrometeor_lhs( temp, lhs )
2024 call atmos_saturation_psat_ice( temp, psat )
2026 dqsdtem = psat / ( dens * rvap * temp**2 ) &
2027 * ( lhs / ( rvap * temp ) - 1.0_rp )
2029 if (
present(qsat) ) &
2030 call atmos_saturation_psat2qsat_dens( psat, temp, dens, &
2034 end subroutine atmos_saturation_dqs_dtem_dens_ice_0d
2044 integer,
intent(in) :: KA, KS, KE
2046 real(RP),
intent(in) :: temp (KA)
2047 real(RP),
intent(in) :: dens (KA)
2049 real(RP),
intent(out) :: dqsdtem(KA)
2055 call atmos_saturation_dqs_dtem_dens_ice_0d( temp(k), dens(k), &
2064 subroutine atmos_saturation_dqs_dtem_dens_ice_3d( &
2065 KA, KS, KE, IA, IS, IE, JA, JS, JE, &
2069 integer,
intent(in) :: KA, KS, KE
2070 integer,
intent(in) :: IA, IS, IE
2071 integer,
intent(in) :: JA, JS, JE
2073 real(RP),
intent(in) :: temp (KA,IA,JA)
2074 real(RP),
intent(in) :: dens (KA,IA,JA)
2076 real(RP),
intent(out) :: dqsdtem(KA,IA,JA)
2086 call atmos_saturation_dqs_dtem_dens_ice_0d( temp(k,i,j), dens(k,i,j), &
2094 end subroutine atmos_saturation_dqs_dtem_dens_ice_3d
2098 subroutine atmos_saturation_dqs_dtem_dens_all_0d( &
2101 qsat, qsat_liq, qsat_ice, &
2106 real(RP),
intent(in) :: temp
2107 real(RP),
intent(in) :: dens
2109 real(RP),
intent(out) :: dqsat_dT
2111 real(RP),
intent(out),
optional :: qsat
2112 real(RP),
intent(out),
optional :: qsat_liq
2113 real(RP),
intent(out),
optional :: qsat_ice
2114 real(RP),
intent(out),
optional :: alpha
2116 real(RP) :: qsat_liq_, qsat_ice_, alpha_
2117 real(RP) :: dqsat_dT_liq, dqsat_dT_ice, dalpha_dT
2121 call atmos_saturation_dqs_dtem_dens_liq_0d( temp, dens, &
2122 dqsat_dt_liq, qsat_liq_ )
2123 call atmos_saturation_dqs_dtem_dens_ice_0d( temp, dens, &
2124 dqsat_dt_ice, qsat_ice_ )
2125 call atmos_saturation_alpha ( temp, alpha_ )
2126 call atmos_saturation_dalphadt( temp, dalpha_dt )
2128 dqsat_dt = qsat_liq_ * dalpha_dt + dqsat_dt_liq * ( alpha_ ) &
2129 - qsat_ice_ * dalpha_dt + dqsat_dt_ice * ( 1.0_rp-alpha_ )
2131 if (
present(qsat) ) qsat = qsat_liq_ * alpha_ + qsat_ice_ * ( 1.0_rp-alpha_ )
2132 if (
present(qsat_liq) ) qsat_liq = qsat_liq_
2133 if (
present(qsat_ice) ) qsat_ice = qsat_ice_
2134 if (
present(alpha ) ) alpha = alpha_
2137 end subroutine atmos_saturation_dqs_dtem_dens_all_0d
2141 subroutine atmos_saturation_dqs_dtem_dpre_liq_0d( &
2143 dqsat_dT, dqsat_dP, &
2147 hydrometeor_lhv => atmos_hydrometeor_lhv
2150 real(RP),
intent(in) :: temp
2151 real(RP),
intent(in) :: pres
2152 real(RP),
intent(in) :: qdry
2154 real(RP),
intent(out) :: dqsat_dT
2155 real(RP),
intent(out) :: dqsat_dP
2157 real(RP),
intent(out),
optional :: qsat
2158 real(RP),
intent(out),
optional :: psat
2162 real(RP) :: den1, den2
2166 call hydrometeor_lhv( temp, lhv )
2167 call atmos_saturation_psat_liq( temp, psat_ )
2169 den1 = ( pres - (1.0_rp-epsvap) * psat_ )**2
2170 den2 = den1 * rvap * temp**2
2172 dqsat_dp = - epsvap * psat_ / den1
2173 dqsat_dt = epsvap * psat_ / den2 * lhv * pres
2175 if (
present(qsat) ) &
2176 call atmos_saturation_psat2qsat_pres_qdry_0d( psat_, pres, qdry, &
2178 if (
present(psat) ) psat = psat_
2181 end subroutine atmos_saturation_dqs_dtem_dpre_liq_0d
2188 dqsat_dT, dqsat_dP )
2191 integer,
intent(in) :: KA, KS, KE
2193 real(RP),
intent(in) :: temp (KA)
2194 real(RP),
intent(in) :: pres (KA)
2195 real(RP),
intent(in) :: qdry (KA)
2197 real(RP),
intent(out) :: dqsat_dT(KA)
2198 real(RP),
intent(out) :: dqsat_dP(KA)
2204 call atmos_saturation_dqs_dtem_dpre_liq_0d( temp(k), pres(k), qdry(k), &
2205 dqsat_dt(k), dqsat_dp(k) )
2213 subroutine atmos_saturation_dqs_dtem_dpre_liq_3d( &
2214 KA, KS, KE, IA, IS, IE, JA, JS, JE, &
2216 dqsat_dT, dqsat_dP )
2218 integer,
intent(in) :: KA, KS, KE
2219 integer,
intent(in) :: IA, IS, IE
2220 integer,
intent(in) :: JA, JS, JE
2222 real(RP),
intent(in) :: temp (KA,IA,JA)
2223 real(RP),
intent(in) :: pres (KA,IA,JA)
2224 real(RP),
intent(in) :: qdry (KA,IA,JA)
2226 real(RP),
intent(out) :: dqsat_dT(KA,IA,JA)
2227 real(RP),
intent(out) :: dqsat_dP(KA,IA,JA)
2237 call atmos_saturation_dqs_dtem_dpre_liq_0d( temp(k,i,j), pres(k,i,j), qdry(k,i,j), &
2238 dqsat_dt(k,i,j), dqsat_dp(k,i,j) )
2245 end subroutine atmos_saturation_dqs_dtem_dpre_liq_3d
2250 subroutine atmos_saturation_dqs_dtem_dpre_ice_0d( &
2252 dqsat_dT, dqsat_dP, &
2256 hydrometeor_lhs => atmos_hydrometeor_lhs
2259 real(RP),
intent(in) :: temp
2260 real(RP),
intent(in) :: pres
2261 real(RP),
intent(in) :: qdry
2263 real(RP),
intent(out) :: dqsat_dT
2264 real(RP),
intent(out) :: dqsat_dP
2266 real(RP),
intent(out),
optional :: qsat
2270 real(RP) :: den1, den2
2274 call hydrometeor_lhs( temp, lhs )
2275 call atmos_saturation_psat_ice( temp, psat )
2277 den1 = ( pres - (1.0_rp-epsvap) * psat )**2
2278 den2 = den1 * rvap * temp**2
2280 dqsat_dp = - epsvap * psat / den1
2281 dqsat_dt = epsvap * psat / den2 * lhs * pres
2283 if (
present(qsat) ) &
2284 call atmos_saturation_psat2qsat_pres_qdry_0d( psat, pres, qdry, &
2287 end subroutine atmos_saturation_dqs_dtem_dpre_ice_0d
2294 dqsat_dT, dqsat_dP )
2297 integer,
intent(in) :: KA, KS, KE
2299 real(RP),
intent(in) :: temp (KA)
2300 real(RP),
intent(in) :: pres (KA)
2301 real(RP),
intent(in) :: qdry (KA)
2303 real(RP),
intent(out) :: dqsat_dT(KA)
2304 real(RP),
intent(out) :: dqsat_dP(KA)
2310 call atmos_saturation_dqs_dtem_dpre_ice( temp(k), pres(k), qdry(k), &
2311 dqsat_dt(k), dqsat_dp(k) )
2320 subroutine atmos_saturation_dqs_dtem_dpre_ice_3d( &
2321 KA, KS, KE, IA, IS, IE, JA, JS, JE, &
2323 dqsat_dT, dqsat_dP )
2325 integer,
intent(in) :: KA, KS, KE
2326 integer,
intent(in) :: IA, IS, IE
2327 integer,
intent(in) :: JA, JS, JE
2329 real(RP),
intent(in) :: temp (KA,IA,JA)
2330 real(RP),
intent(in) :: pres (KA,IA,JA)
2331 real(RP),
intent(in) :: qdry (KA,IA,JA)
2333 real(RP),
intent(out) :: dqsat_dT(KA,IA,JA)
2334 real(RP),
intent(out) :: dqsat_dP(KA,IA,JA)
2344 call atmos_saturation_dqs_dtem_dpre_ice( temp(k,i,j), pres(k,i,j), qdry(k,i,j), &
2345 dqsat_dt(k,i,j), dqsat_dp(k,i,j) )
2352 end subroutine atmos_saturation_dqs_dtem_dpre_ice_3d
2357 subroutine atmos_saturation_dqs_dtem_dpre_all_0d( &
2359 dqsat_dT, dqsat_dP, &
2360 qsat, qsat_liq, qsat_ice, &
2365 real(RP),
intent(in) :: temp
2366 real(RP),
intent(in) :: pres
2367 real(RP),
intent(in) :: qdry
2369 real(RP),
intent(out) :: dqsat_dT
2370 real(RP),
intent(out) :: dqsat_dP
2372 real(RP),
intent(out),
optional :: qsat
2373 real(RP),
intent(out),
optional :: qsat_liq
2374 real(RP),
intent(out),
optional :: qsat_ice
2375 real(RP),
intent(out),
optional :: alpha
2377 real(RP) :: qsat_liq_, qsat_ice_, alpha_
2378 real(RP) :: dqsat_dT_liq, dqsat_dT_ice
2379 real(RP) :: dqsat_dP_liq, dqsat_dP_ice
2380 real(RP) :: dalpha_dT
2384 call atmos_saturation_dqs_dtem_dpre_liq_0d( temp, pres, qdry, &
2385 dqsat_dt_liq, dqsat_dp_liq, &
2387 call atmos_saturation_dqs_dtem_dpre_ice_0d( temp, pres, qdry, &
2388 dqsat_dt_ice, dqsat_dp_ice, &
2390 call atmos_saturation_alpha ( temp, alpha_ )
2391 call atmos_saturation_dalphadt( temp, dalpha_dt )
2393 dqsat_dt = qsat_liq_ * dalpha_dt + dqsat_dt_liq * ( alpha_ ) &
2394 - qsat_ice_ * dalpha_dt + dqsat_dt_ice * ( 1.0_rp-alpha_ )
2395 dqsat_dp = dqsat_dp_liq * ( alpha_ ) &
2396 + dqsat_dp_ice * ( 1.0_rp-alpha_ )
2398 if (
present(qsat) ) qsat = qsat_liq * alpha_ + qsat_ice * ( 1.0_rp-alpha_ )
2399 if (
present(qsat_liq) ) qsat_liq = qsat_liq_
2400 if (
present(qsat_ice) ) qsat_ice = qsat_ice_
2401 if (
present(alpha ) ) alpha = alpha_
2404 end subroutine atmos_saturation_dqs_dtem_dpre_all_0d
2409 subroutine atmos_saturation_tdew_liq_0d( &
2417 atmos_hydrometeor_lhv
2418 real(RP),
intent(in) :: DENS
2419 real(RP),
intent(in) :: TEMP
2420 real(RP),
intent(in) :: QV
2422 real(RP),
intent(out) :: Tdew
2423 logical,
intent(out) :: converged
2425 real(RP),
parameter :: A = 17.625_rp
2426 real(RP),
parameter :: B = 243.04_rp
2427 real(RP),
parameter :: C = 610.94_rp
2428 integer,
parameter :: itelim = 100
2429 real(RP),
parameter :: criteria = 0.1_rp**(2+rp/2)
2432 real(RP) :: pvap, psat
2433 real(RP) :: dpsat_dT
2439 pvap = dens * qv * rvap * temp
2441 if ( pvap < psat_min_liq )
then
2449 tdew = b * log( pvap / c ) / ( a - log( pvap / c ) ) + tem00
2454 call atmos_saturation_psat_liq( tdew, psat )
2455 call atmos_hydrometeor_lhv( tdew, lhv )
2457 dpsat_dt = psat * lhv / ( rvap * tdew**2 )
2458 dtdew = ( psat - pvap ) / dpsat_dt
2459 if ( abs(dtdew) < criteria .or. abs(psat-pvap) < criteria )
then
2467 if( .not. converged )
then
2468 log_warn(
"ATMOS_SATURATION_tdew_liq_0D",*) dens, temp, qv, pvap, tdew, dtdew, dpsat_dt
2473 end subroutine atmos_saturation_tdew_liq_0d
2482 integer,
intent(in) :: KA, KS, KE
2484 real(RP),
intent(in) :: DENS(KA)
2485 real(RP),
intent(in) :: TEMP(KA)
2486 real(RP),
intent(in) :: QV (KA)
2488 real(RP),
intent(out) :: Tdew(KA)
2489 logical,
intent(out) :: converged
2495 call atmos_saturation_tdew_liq_0d( dens(k), temp(k), qv(k), &
2496 tdew(k), converged )
2497 if ( .not. converged )
exit
2502 subroutine atmos_saturation_tdew_liq_3d( &
2503 KA, KS, KE, IA, IS, IE, JA, JS, JE, &
2508 integer,
intent(in) :: KA, KS, KE
2509 integer,
intent(in) :: IA, IS, IE
2510 integer,
intent(in) :: JA, JS, JE
2512 real(RP),
intent(in) :: DENS(KA,IA,JA)
2513 real(RP),
intent(in) :: TEMP(KA,IA,JA)
2514 real(RP),
intent(in) :: QV (KA,IA,JA)
2516 real(RP),
intent(out) :: Tdew(KA,IA,JA)
2518 logical :: converged, error
2532 call atmos_saturation_tdew_liq_0d( dens(k,i,j), temp(k,i,j), qv(k,i,j), &
2533 tdew(k,i,j), converged )
2534 if ( .not. converged )
then
2537 log_error(
"ATMOS_SATURATION_tdew_liq_3D",*)
'not converged! ', k,i,j
2548 end subroutine atmos_saturation_tdew_liq_3d
2559 DENS, POTT, TEMP, QV, &
2566 atmos_hydrometeor_lhv
2567 real(RP),
intent(in) :: DENS
2568 real(RP),
intent(in) :: POTT
2569 real(RP),
intent(in) :: TEMP
2570 real(RP),
intent(in) :: QV
2572 real(RP),
intent(out) :: POTE
2578 pv = dens * qv * rvap * temp
2579 tl = 55.0_rp + 2840.0_rp / ( cpdry / rdry * log(temp) - log(pv) - 4.805_rp )
2580 call atmos_hydrometeor_lhv( temp, lhv )
2582 pote = pott * exp( lhv * qv / ( cpdry * tl ) &
2583 * 1.0784_rp * ( 1.0_rp + 0.810_rp * qv ) )
2591 DENS, POTT, TEMP, QV, &
2594 integer,
intent(in) :: KA, KS, KE
2596 real(RP),
intent(in) :: DENS(KA)
2597 real(RP),
intent(in) :: POTT(KA)
2598 real(RP),
intent(in) :: TEMP(KA)
2599 real(RP),
intent(in) :: QV (KA)
2601 real(RP),
intent(out) :: POTE(KA)
2613 subroutine atmos_saturation_pote_3d( &
2614 KA, KS, KE, IA, IS, IE, JA, JS, JE, &
2615 DENS, POTT, TEMP, QV, &
2617 integer,
intent(in) :: KA, KS, KE
2618 integer,
intent(in) :: IA, IS, IE
2619 integer,
intent(in) :: JA, JS, JE
2621 real(RP),
intent(in) :: DENS(KA,IA,JA)
2622 real(RP),
intent(in) :: POTT(KA,IA,JA)
2623 real(RP),
intent(in) :: TEMP(KA,IA,JA)
2624 real(RP),
intent(in) :: QV (KA,IA,JA)
2626 real(RP),
intent(out) :: POTE(KA,IA,JA)
2636 dens(k,i,j), pott(k,i,j), temp(k,i,j), qv(k,i,j), &
2644 end subroutine atmos_saturation_pote_3d
2650 subroutine atmos_saturation_moist_conversion_dens_liq_0d( &
2652 TEMP, QV, QC, CPtot, CVtot, &
2663 real(RP),
intent(in) :: DENS
2664 real(RP),
intent(in) :: Emoist0
2666 real(RP),
intent(inout) :: TEMP
2667 real(RP),
intent(inout) :: QV
2668 real(RP),
intent(inout) :: QC
2669 real(RP),
intent(inout) :: CPtot
2670 real(RP),
intent(inout) :: CVtot
2672 logical,
intent(out) :: converged
2676 real(RP) :: TEMP0, QV0, QC0
2677 real(RP) :: CPtot0, CVtot0
2682 real(RP) :: dqsatl_dT
2684 real(RP) :: dCVtot_dT
2685 real(RP) :: dEmoist_dT
2688 integer,
parameter :: itelim = 100
2689 real(RP),
parameter :: dtemp_criteria = 0.1_rp**(2+rp/2)
2705 temp = ( emoist0 -
lhv * qv ) / cvtot
2707 call atmos_saturation_dens2qsat_liq( temp, dens, &
2710 if ( qsum <= qsat )
then
2727 call atmos_saturation_dqs_dtem_dens_liq_0d( temp, dens, &
2730 dqc_dt = - dqsatl_dt
2735 demoist_dt = temp * dcvtot_dt + cvtot + dqsatl_dt *
lhv
2740 emoist = temp * cvtot + qsat *
lhv
2744 dtemp = ( emoist - emoist0 ) / demoist_dt
2747 if ( abs(dtemp) < dtemp_criteria )
then
2752 if( temp*0.0_rp /= 0.0_rp )
exit
2760 end subroutine atmos_saturation_moist_conversion_dens_liq_0d
2768 TEMP, QV, QC, QI, CPtot, CVtot, &
2781 real(RP),
intent(in) :: DENS
2782 real(RP),
intent(in) :: Emoist0
2784 real(RP),
intent(inout) :: TEMP
2785 real(RP),
intent(inout) :: QV
2786 real(RP),
intent(inout) :: QC
2787 real(RP),
intent(inout) :: QI
2788 real(RP),
intent(inout) :: CPtot
2789 real(RP),
intent(inout) :: CVtot
2791 logical,
intent(out) :: converged
2796 real(RP) :: QV0, QC0, QI0
2797 real(RP) :: CPtot0, CVtot0
2803 real(RP) :: dalpha_dT
2804 real(RP) :: dqsat_dT
2805 real(RP) :: dqc_dT, dqi_dT
2806 real(RP) :: dCVtot_dT
2807 real(RP) :: dEmoist_dT
2810 integer,
parameter :: itelim = 100
2811 real(RP),
parameter :: dtemp_criteria = 0.1_rp**(2+rp/2)
2829 temp = ( emoist0 -
lhv * qv ) / cvtot
2831 call atmos_saturation_dens2qsat_all( temp, dens, &
2834 if ( qsum <= qsat )
then
2852 call atmos_saturation_dqs_dtem_dens_all_0d( temp, dens, &
2854 qsat=qsat, alpha=alpha )
2855 call atmos_saturation_dalphadt( temp, dalpha_dt )
2857 dqc_dt = ( qsum - qv ) * dalpha_dt - dqsat_dt * ( alpha )
2858 dqi_dt = -( qsum - qv ) * dalpha_dt - dqsat_dt * ( 1.0_rp-alpha )
2864 demoist_dt = temp * dcvtot_dt + cvtot + dqsat_dt *
lhv - dqi_dt *
lhf
2868 qc = ( qsum - qsat ) * ( alpha )
2869 qi = ( qsum - qsat ) * ( 1.0_rp - alpha )
2878 emoist = temp * cvtot + qsat *
lhv - qi *
lhf
2881 dtemp = ( emoist - emoist0 ) / demoist_dt
2884 if ( abs(dtemp) < dtemp_criteria )
then
2889 if( temp*0.0_rp /= 0.0_rp )
exit
2914 atmos_hydrometeor_entr, &
2915 atmos_hydrometeor_entr2temp, &
2919 real(RP),
intent(in) :: PRES
2920 real(RP),
intent(in) :: ENTR
2921 real(RP),
intent(in) :: Qdry
2923 real(RP),
intent(inout) :: QV
2924 real(RP),
intent(inout) :: QC
2925 real(RP),
intent(inout) :: CPtot
2926 real(RP),
intent(inout) :: Rtot
2928 real(RP),
intent(out) :: TEMP
2929 logical,
intent(out) :: converged
2931 real(RP),
parameter :: TEMMIN = 0.1_rp
2932 real(RP),
parameter :: criteria = 1.e-8_rp
2933 integer,
parameter :: itelim = 100
2937 real(RP) :: qsat, psat
2939 real(RP) :: TEMP_ite
2941 real(RP) :: ENTR_ite
2942 real(RP) :: Rtot_ite
2943 real(RP) :: CPtot_ite
2945 real(RP) :: dqsat_dT, dqsat_dP
2947 real(RP) :: TEMP_prev
2948 real(RP) :: dENTR_dT
2954 rtot = rtot + qc * rvap
2959 call atmos_hydrometeor_entr2temp( entr, pres, qsum, 0.0_rp, qdry, &
2963 call atmos_saturation_pres2qsat_liq( temp, pres, qdry, &
2965 if ( qsum <= qsat )
then
2980 call atmos_saturation_dqs_dtem_dpre_liq_0d( temp_ite, pres, qdry, &
2981 dqsat_dt, dqsat_dp, &
2982 qsat=qsat, psat=psat )
2984 qv_ite = min( qsum, qsat )
2986 rtot_ite = rtot - ( qsum - qv_ite ) * rvap
2989 dentr_dt = cptot_ite / temp_ite &
2991 - rvap * log( psat/ psat0 ) &
2995 call atmos_hydrometeor_entr( temp_ite, pres, &
2996 qv_ite, 0.0_rp, qdry, &
2997 rtot_ite, cptot_ite, &
3000 temp_prev = temp_ite
3001 temp_ite = temp_ite - ( entr_ite - entr ) / max( dentr_dt, eps )
3002 temp_ite = max( temp_ite, temmin )
3004 if( abs(temp_ite-temp_prev) < criteria )
then