122 qsat => atmos_saturation_pres2qsat_all
127 integer,
intent(in) ::
ia,
is,
ie 128 integer,
intent(in) ::
ja,
js,
je 129 real(RP),
intent(in) :: tmpa (
ia,
ja)
130 real(RP),
intent(in) :: prsa (
ia,
ja)
131 real(RP),
intent(in) :: wa (
ia,
ja)
132 real(RP),
intent(in) :: ua (
ia,
ja)
133 real(RP),
intent(in) ::
va (
ia,
ja)
134 real(RP),
intent(in) :: rhoa (
ia,
ja)
135 real(RP),
intent(in) :: qva (
ia,
ja)
136 real(RP),
intent(in) :: lh (
ia,
ja)
137 real(RP),
intent(in) :: z1 (
ia,
ja)
138 real(RP),
intent(in) :: pbl (
ia,
ja)
139 real(RP),
intent(in) :: rhos (
ia,
ja)
140 real(RP),
intent(in) :: prss (
ia,
ja)
141 real(RP),
intent(in) :: rflxd (
ia,
ja,n_rad_dir,n_rad_rgn)
142 real(RP),
intent(in) :: tg (
ia,
ja)
143 real(RP),
intent(in) :: qvef (
ia,
ja)
144 real(RP),
intent(in) :: albedo (
ia,
ja,n_rad_dir,n_rad_rgn)
145 real(RP),
intent(in) :: rb (
ia,
ja)
146 real(RP),
intent(in) :: tc_dz (
ia,
ja)
147 real(RP),
intent(in) :: z0m (
ia,
ja)
148 real(RP),
intent(in) :: z0h (
ia,
ja)
149 real(RP),
intent(in) :: z0e (
ia,
ja)
150 logical,
intent(in) :: calc_flag(
ia,
ja)
151 real(DP),
intent(in) :: dt
152 character(len=*),
intent(in) :: model_name
153 real(RP),
intent(inout) :: tmps (
ia,
ja)
154 real(RP),
intent(out) :: zmflx (
ia,
ja)
155 real(RP),
intent(out) :: xmflx (
ia,
ja)
156 real(RP),
intent(out) :: ymflx (
ia,
ja)
157 real(RP),
intent(out) :: shflx (
ia,
ja)
158 real(RP),
intent(out) :: qvflx (
ia,
ja)
159 real(RP),
intent(out) :: gflx (
ia,
ja)
160 real(RP),
intent(out) :: u10 (
ia,
ja)
161 real(RP),
intent(out) :: v10 (
ia,
ja)
162 real(RP),
intent(out) :: t2 (
ia,
ja)
163 real(RP),
intent(out) :: q2 (
ia,
ja)
165 real(RP),
parameter :: dts0 = 1.0e-4_rp
166 real(RP),
parameter :: redf_min = 1.0e-2_rp
167 real(RP),
parameter :: redf_max = 1.0e+0_rp
168 real(RP),
parameter :: tfa = 0.5e+0_rp
169 real(RP),
parameter :: tfb = 1.1e+0_rp
171 real(RP) :: tmps1(
ia,
ja)
184 real(RP) :: ustar, dustar
185 real(RP) :: tstar, dtstar
186 real(RP) :: qstar, dqstar
187 real(RP) :: uabs, duabs
190 real(RP) :: qvsat, dqvsat
191 real(RP) :: qvs, dqvs
202 log_progress(*)
'coupler / physics / surface / SKIN' 208 tmps1(i,j) = tmps(i,j)
229 if ( calc_flag(i,j) )
then 231 qdry = 1.0_rp - qva(i,j)
232 rtot = qdry * rdry + qva(i,j) * rvap
235 oldres = huge(0.0_rp)
238 do n = 1, cpl_phy_sfc_skin_itr_max
240 call qsat( tmps1(i,j), prss(i,j), qdry, qvsat )
241 call qsat( tmps1(i,j)+dts0, prss(i,j), qdry, dqvsat )
243 qvs = ( 1.0_rp-qvef(i,j) ) * qva(i,j) &
244 + ( qvef(i,j) ) * qvsat
245 dqvs = ( 1.0_rp-qvef(i,j) ) * qva(i,j) &
246 + ( qvef(i,j) ) * dqvsat
292 emis = ( 1.0_rp - albedo(i,j,i_r_diffuse,i_r_ir) ) * stb * tmps1(i,j)**4
294 lwd = rflxd(i,j,i_r_diffuse,i_r_ir)
295 lwu = rflxd(i,j,i_r_diffuse,i_r_ir) * albedo(i,j,i_r_diffuse,i_r_ir) + emis
296 swd = rflxd(i,j,i_r_direct ,i_r_nir) &
297 + rflxd(i,j,i_r_diffuse,i_r_nir) &
298 + rflxd(i,j,i_r_direct ,i_r_vis) &
299 + rflxd(i,j,i_r_diffuse,i_r_vis)
300 swu = rflxd(i,j,i_r_direct ,i_r_nir) * albedo(i,j,i_r_direct ,i_r_nir) &
301 + rflxd(i,j,i_r_diffuse,i_r_nir) * albedo(i,j,i_r_diffuse,i_r_nir) &
302 + rflxd(i,j,i_r_direct ,i_r_vis) * albedo(i,j,i_r_direct ,i_r_vis) &
303 + rflxd(i,j,i_r_diffuse,i_r_vis) * albedo(i,j,i_r_diffuse,i_r_vis)
306 res = swd - swu + lwd - lwu &
307 + cpdry * rhos(i,j) * ustar * tstar &
308 + lh(i,j) * rhos(i,j) * ustar * qstar * ra / ( ra+rb(i,j) ) &
309 - tc_dz(i,j) * ( tmps1(i,j) - tg(i,j) )
312 dres = -4.0_rp * emis / tmps1(i,j) &
313 + cpdry * rhos(i,j) * ( ustar*(dtstar-tstar)/dts0 + tstar*(dustar-ustar)/dts0 ) &
314 + lh(i,j) * rhos(i,j) * ( ustar*(dqstar-qstar)/dts0 + qstar*(dustar-ustar)/dts0 ) * ra / ( ra+rb(i,j) ) &
318 if ( abs(res ) < cpl_phy_sfc_skin_res_min &
319 .OR. abs(res/dres) < cpl_phy_sfc_skin_err_min )
then 324 if ( abs(dres) * cpl_phy_sfc_skin_dreslim < abs(res) )
then 329 if ( dres < 0.0_rp )
then 330 if ( abs(res) > abs(oldres) )
then 331 redf = max( tfa*abs(redf), redf_min )
333 redf = min( tfb*abs(redf), redf_max )
340 tmps1(i,j) = tmps1(i,j) - redf * res / dres
347 tmps1(i,j) = min( max( tmps1(i,j), &
348 tmps(i,j) - cpl_phy_sfc_skin_dts_max *
real(dt,kind=RP) ), &
349 tmps (i,j) + cpl_phy_sfc_skin_dts_max *
real(dt,kind=RP) )
351 if ( n > cpl_phy_sfc_skin_itr_max )
then 353 log_warn(
"CPL_PHY_SFC_skin",*)
'surface tempearture was not converged. ', trim(model_name)
355 log_info_cont(
'(A,I32)' )
'PRC_myrank [no unit] :',
prc_myrank 356 log_info_cont(
'(A,I32)' )
'number of i [no unit] :', i
357 log_info_cont(
'(A,I32)' )
'number of j [no unit] :', j
359 log_info_cont(
'(A,I32)' )
'loop number [no unit] :', n
360 log_info_cont(
'(A,F32.16)')
'Residual [J/m2/s] :', res
361 log_info_cont(
'(A,F32.16)')
'delta Residual [J/m2/s] :', dres
363 log_info_cont(
'(A,F32.16)')
'temperature [K] :', tmpa(i,j)
364 log_info_cont(
'(A,F32.16)')
'pressure [Pa] :', prsa(i,j)
365 log_info_cont(
'(A,F32.16)')
'velocity w [m/s] :', wa(i,j)
366 log_info_cont(
'(A,F32.16)')
'velocity u [m/s] :', ua(i,j)
367 log_info_cont(
'(A,F32.16)')
'velocity v [m/s] :',
va(i,j)
368 log_info_cont(
'(A,F32.16)')
'density [kg/m3] :', rhoa(i,j)
369 log_info_cont(
'(A,F32.16)')
'water vapor mass ratio [kg/kg] :', qva(i,j)
370 log_info_cont(
'(A,F32.16)')
'cell center height [m] :', z1(i,j)
371 log_info_cont(
'(A,F32.16)')
'atmospheric mixing layer height [m] :', pbl(i,j)
372 log_info_cont(
'(A,F32.16)')
'pressure at the surface [Pa] :', prss(i,j)
373 log_info_cont(
'(A,F32.16)')
'downward radiation (IR, direct ) [J/m2/s] :', rflxd(i,j,i_r_direct ,i_r_ir )
374 log_info_cont(
'(A,F32.16)')
'downward radiation (IR, diffuse) [J/m2/s] :', rflxd(i,j,i_r_diffuse,i_r_ir )
375 log_info_cont(
'(A,F32.16)')
'downward radiation (NIR,direct ) [J/m2/s] :', rflxd(i,j,i_r_direct ,i_r_nir)
376 log_info_cont(
'(A,F32.16)')
'downward radiation (NIR,diffuse) [J/m2/s] :', rflxd(i,j,i_r_diffuse,i_r_nir)
377 log_info_cont(
'(A,F32.16)')
'downward radiation (VIS,direct ) [J/m2/s] :', rflxd(i,j,i_r_direct ,i_r_vis)
378 log_info_cont(
'(A,F32.16)')
'downward radiation (VIS,diffuse) [J/m2/s] :', rflxd(i,j,i_r_diffuse,i_r_vis)
380 log_info_cont(
'(A,F32.16)')
'soil temperature [K] :', tg(i,j)
381 log_info_cont(
'(A,F32.16)')
'surface temperature [K] :', tmps(i,j)
382 log_info_cont(
'(A,F32.16)')
'efficiency of evaporation [1] :', qvef(i,j)
383 log_info_cont(
'(A,F32.16)')
'surface albedo (IR, direct ) [1] :', albedo(i,j,i_r_direct ,i_r_ir )
384 log_info_cont(
'(A,F32.16)')
'surface albedo (IR, diffuse) [1] :', albedo(i,j,i_r_diffuse,i_r_ir )
385 log_info_cont(
'(A,F32.16)')
'surface albedo (NIR,direct ) [1] :', albedo(i,j,i_r_direct ,i_r_nir)
386 log_info_cont(
'(A,F32.16)')
'surface albedo (NIR,diffuse) [1] :', albedo(i,j,i_r_diffuse,i_r_nir)
387 log_info_cont(
'(A,F32.16)')
'surface albedo (VIS,direct ) [1] :', albedo(i,j,i_r_direct ,i_r_vis)
388 log_info_cont(
'(A,F32.16)')
'surface albedo (VIS,diffuse) [1] :', albedo(i,j,i_r_diffuse,i_r_vis)
389 log_info_cont(
'(A,F32.16)')
'thermal conductivity / depth [J/m2/s/K] :', tc_dz(i,j)
390 log_info_cont(
'(A,F32.16)')
'roughness length for momemtum [m] :', z0m(i,j)
391 log_info_cont(
'(A,F32.16)')
'roughness length for heat [m] :', z0h(i,j)
392 log_info_cont(
'(A,F32.16)')
'roughness length for vapor [m] :', z0e(i,j)
394 log_info_cont(
'(A,F32.16)')
'latent heat [J/kg] :', lh(i,j)
395 log_info_cont(
'(A,F32.16)')
'friction velocity [m] :', ustar
396 log_info_cont(
'(A,F32.16)')
'friction potential temperature [K] :', tstar
397 log_info_cont(
'(A,F32.16)')
'friction water vapor mass ratio [kg/kg] :', qstar
398 log_info_cont(
'(A,F32.16)')
'd(friction velocity) [m] :', dustar
399 log_info_cont(
'(A,F32.16)')
'd(friction potential temperature) [K] :', dtstar
400 log_info_cont(
'(A,F32.16)')
'd(friction water vapor mass ratio) [kg/kg] :', dqstar
401 log_info_cont(
'(A,F32.16)')
'modified absolute velocity [m/s] :', uabs
402 log_info_cont(
'(A,F32.16)')
'next surface temperature [K] :', tmps1(i,j)
405 if ( .NOT. ( res > -1.0_rp .OR. res < 1.0_rp ) )
then 406 log_error(
"CPL_PHY_SFC_skin",*)
'NaN is detected for surface temperature. ', trim(model_name)
412 tmps(i,j) = tmps1(i,j)
414 qdry = 1.0_rp - qva(i,j)
415 rtot = qdry * rdry + qva(i,j) * rvap
417 call qsat( tmps(i,j), prss(i,j), qdry, qvsat )
419 qvs = ( 1.0_rp-qvef(i,j) ) * qva(i,j) &
420 + ( qvef(i,j) ) * qvsat
444 zmflx(i,j) = -rhos(i,j) * ustar * ustar / uabs * wa(i,j)
445 xmflx(i,j) = -rhos(i,j) * ustar * ustar / uabs * ua(i,j)
446 ymflx(i,j) = -rhos(i,j) * ustar * ustar / uabs *
va(i,j)
447 shflx(i,j) = -rhos(i,j) * ustar * tstar * cpdry
448 qvflx(i,j) = -rhos(i,j) * ustar * qstar * ra / ( ra+rb(i,j) )
450 emis = ( 1.0_rp-albedo(i,j,i_r_diffuse,i_r_ir) ) * stb * tmps(i,j)**4
452 lwd = rflxd(i,j,i_r_diffuse,i_r_ir)
453 lwu = rflxd(i,j,i_r_diffuse,i_r_ir) * albedo(i,j,i_r_diffuse,i_r_ir) + emis
454 swd = rflxd(i,j,i_r_direct ,i_r_nir) &
455 + rflxd(i,j,i_r_diffuse,i_r_nir) &
456 + rflxd(i,j,i_r_direct ,i_r_vis) &
457 + rflxd(i,j,i_r_diffuse,i_r_vis)
458 swu = rflxd(i,j,i_r_direct ,i_r_nir) * albedo(i,j,i_r_direct ,i_r_nir) &
459 + rflxd(i,j,i_r_diffuse,i_r_nir) * albedo(i,j,i_r_diffuse,i_r_nir) &
460 + rflxd(i,j,i_r_direct ,i_r_vis) * albedo(i,j,i_r_direct ,i_r_vis) &
461 + rflxd(i,j,i_r_diffuse,i_r_vis) * albedo(i,j,i_r_diffuse,i_r_vis)
463 gflx(i,j) = -tc_dz(i,j) * ( tmps(i,j) - tg(i,j) )
466 res = swd - swu + lwd - lwu - shflx(i,j) - qvflx(i,j) * lh(i,j) + gflx(i,j)
469 gflx(i,j) = gflx(i,j) - res
478 u10(i,j) = ua(i,j) * log( 10.0_rp / z0m(i,j) ) / log( z1(i,j) / z0m(i,j) )
479 v10(i,j) =
va(i,j) * log( 10.0_rp / z0m(i,j) ) / log( z1(i,j) / z0m(i,j) )
480 t2(i,j) = tmps(i,j) + ( tmpa(i,j) - tmps(i,j) ) * log( 2.0_rp / z0h(i,j) ) / log( z1(i,j) / z0h(i,j) )
481 q2(i,j) = qvs + ( qva(i,j) - qvs ) * log( 2.0_rp / z0e(i,j) ) / log( z1(i,j) / z0e(i,j) )
real(rp), public const_cpdry
specific heat (dry air,constant pressure) [J/kg/K]
module atmosphere / saturation
real(rp), parameter, public const_stb
Stefan-Boltzman constant [W/m2/K4].
integer, public ia
of whole cells: x, local, with HALO
integer, public ja
of whole cells: y, local, with HALO
real(rp), public const_rdry
specific gas constant (dry air) [J/kg/K]
integer, public is
start point of inner domain: x, local
integer, public ie
end point of inner domain: x, local
real(rp), public const_pre00
pressure reference [Pa]
integer, public je
end point of inner domain: y, local
procedure(bc), pointer, public bulkflux
integer, public prc_myrank
process num in local communicator
real(rp), parameter, public const_rvap
specific gas constant (water vapor) [J/kg/K]
subroutine, public prc_abort
Abort Process.
integer, public js
start point of inner domain: y, local