43 integer,
private :: cpl_phy_sfc_skin_itr_max = 100
45 real(RP),
private :: cpl_phy_sfc_skin_dts_max = 5.0e-2_rp
46 real(RP),
private :: cpl_phy_sfc_skin_res_min = 1.0e+0_rp
47 real(RP),
private :: cpl_phy_sfc_skin_err_min = 1.0e-2_rp
48 real(RP),
private :: cpl_phy_sfc_skin_dreslim = 1.0e+2_rp
50 logical,
private :: initialized = .false.
61 namelist / param_cpl_phy_sfc_skin / &
62 cpl_phy_sfc_skin_itr_max, &
63 cpl_phy_sfc_skin_dts_max, &
64 cpl_phy_sfc_skin_res_min, &
65 cpl_phy_sfc_skin_err_min, &
66 cpl_phy_sfc_skin_dreslim
71 if ( initialized )
return 74 log_info(
"CPL_PHY_SFC_SKIN_setup",*)
'Setup' 78 read(
io_fid_conf,nml=param_cpl_phy_sfc_skin,iostat=ierr)
80 log_info(
"CPL_PHY_SFC_SKIN_setup",*)
'Not found namelist. Default used.' 81 elseif( ierr > 0 )
then 82 log_error(
"CPL_PHY_SFC_SKIN_setup",*)
'Not appropriate names in namelist PARAM_CPL_PHY_SFC_SKIN. Check!' 85 log_nml(param_cpl_phy_sfc_skin)
109 ZMFLX, XMFLX, YMFLX, &
110 SHFLX, QVFLX, GFLX, &
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)
142 real(RP),
intent(in) :: TG (ia,ja)
143 real(RP),
intent(in) :: QVEF (ia,ja)
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
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) )
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].
module coupler / surface-atmospehre
integer, parameter, public i_r_vis
module coupler / physics / surface skin
integer, public io_fid_conf
Config file ID.
integer, parameter, public n_rad_dir
integer, parameter, public n_rad_rgn
real(rp), public const_rdry
specific gas constant (dry air) [J/kg/K]
real(rp), public const_pre00
pressure reference [Pa]
procedure(bc), pointer, public bulkflux
subroutine, public cpl_phy_sfc_skin_setup
Setup.
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, parameter, public i_r_direct
integer, parameter, public i_r_nir
integer, parameter, public i_r_ir
integer, parameter, public i_r_diffuse
subroutine, public cpl_phy_sfc_skin(IA, IS, IE, JA, JS, JE, TMPA, PRSA, WA, UA, VA, RHOA, QVA, LH, Z1, PBL, RHOS, PRSS, RFLXD, TG, QVEF, ALBEDO, Rb, TC_dZ, Z0M, Z0H, Z0E, calc_flag, dt, model_name, TMPS, ZMFLX, XMFLX, YMFLX, SHFLX, QVFLX, GFLX, U10, V10, T2, Q2)