161       qsat => atmos_saturation_pres2qsat_all
   163        atmos_thermodyn_templhv
   169     real(RP), 
parameter :: dts0     = 1.0e-4_rp 
   171     real(RP), 
parameter :: redf_min = 1.0e-2_rp 
   172     real(RP), 
parameter :: redf_max = 1.0e+0_rp 
   173     real(RP), 
parameter :: tfa      = 0.5e+0_rp 
   174     real(RP), 
parameter :: tfb      = 1.1e+0_rp 
   177     real(RP), 
intent(out) :: lst_t(
ia,
ja) 
   178     real(RP), 
intent(out) :: zmflx(
ia,
ja) 
   179     real(RP), 
intent(out) :: xmflx(
ia,
ja) 
   180     real(RP), 
intent(out) :: ymflx(
ia,
ja) 
   181     real(RP), 
intent(out) :: shflx(
ia,
ja) 
   182     real(RP), 
intent(out) :: lhflx(
ia,
ja) 
   183     real(RP), 
intent(out) :: ghflx(
ia,
ja) 
   184     real(RP), 
intent(out) :: u10  (
ia,
ja) 
   185     real(RP), 
intent(out) :: v10  (
ia,
ja) 
   186     real(RP), 
intent(out) :: t2   (
ia,
ja) 
   187     real(RP), 
intent(out) :: q2   (
ia,
ja) 
   189     real(RP), 
intent(in) :: tmpa(
ia,
ja) 
   190     real(RP), 
intent(in) :: prsa(
ia,
ja) 
   191     real(RP), 
intent(in) :: wa  (
ia,
ja) 
   192     real(RP), 
intent(in) :: ua  (
ia,
ja) 
   193     real(RP), 
intent(in) :: 
va  (
ia,
ja) 
   194     real(RP), 
intent(in) :: rhoa(
ia,
ja) 
   195     real(RP), 
intent(in) :: qva (
ia,
ja) 
   196     real(RP), 
intent(in) :: z1  (
ia,
ja) 
   197     real(RP), 
intent(in) :: pbl (
ia,
ja) 
   198     real(RP), 
intent(in) :: prss(
ia,
ja) 
   199     real(RP), 
intent(in) :: lwd (
ia,
ja) 
   200     real(RP), 
intent(in) :: swd (
ia,
ja) 
   202     real(RP), 
intent(in) :: tg    (
ia,
ja) 
   203     real(RP), 
intent(in) :: lst   (
ia,
ja) 
   204     real(RP), 
intent(in) :: qvef  (
ia,
ja) 
   205     real(RP), 
intent(in) :: alb_lw(
ia,
ja) 
   206     real(RP), 
intent(in) :: alb_sw(
ia,
ja) 
   207     real(RP), 
intent(in) :: dzg   (
ia,
ja) 
   208     real(RP), 
intent(in) :: tcs   (
ia,
ja) 
   209     real(RP), 
intent(in) :: z0m   (
ia,
ja) 
   210     real(RP), 
intent(in) :: z0h   (
ia,
ja) 
   211     real(RP), 
intent(in) :: z0e   (
ia,
ja) 
   212     real(DP), 
intent(in) :: dt            
   215     real(RP) :: lst1(
ia,
ja)
   222     real(RP) :: ustar, dustar 
   223     real(RP) :: tstar, dtstar 
   224     real(RP) :: qstar, dqstar 
   225     real(RP) :: uabs, duabs   
   226     real(RP) :: sqv, dsqv     
   228     real(RP) :: lhv(
ia,
ja)    
   240     call atmos_thermodyn_templhv( lhv, tmpa )
   243     if( lst_update ) 
then   248         if( is_lnd(i,j) ) 
then   251           oldres = huge(0.0_rp)
   254           do n = 1, land_sfc_slab_itr_max
   302             res = ( 1.0_rp - alb_sw(i,j) ) * swd(i,j) &
   303                 + ( 1.0_rp - alb_lw(i,j) ) * ( lwd(i,j) - stb * lst1(i,j)**4 ) &
   304                 + cpdry    * rhoa(i,j) * ustar * tstar &
   305                 + lhv(i,j) * rhoa(i,j) * ustar * qstar * qvef(i,j) &
   306                 - 2.0_rp * tcs(i,j) * ( lst1(i,j) - tg(i,j) ) / dzg(i,j)
   309             dres = -4.0_rp * ( 1.0_rp - alb_lw(i,j) ) * stb * lst1(i,j)**3 &
   310                  + cpdry    * rhoa(i,j) * ( (dustar-ustar)/dts0 * tstar + ustar * (dtstar-tstar)/dts0 ) &
   311                  + lhv(i,j) * rhoa(i,j) * ( (dustar-ustar)/dts0 * qstar + ustar * (dqstar-qstar)/dts0 ) * qvef(i,j) &
   312                  - 2.0_rp * tcs(i,j) / dzg(i,j)
   315             if( abs( res      ) < land_sfc_slab_res_min .OR. &
   316                 abs( res/dres ) < land_sfc_slab_err_min      ) 
then   321             if( abs(dres) * land_sfc_slab_dreslim < abs(res) ) 
then   326             if( dres < 0.0_rp ) 
then   327               if( abs(res) > abs(oldres) ) 
then   328                 redf = max( tfa*abs(redf), redf_min )
   330                 redf = min( tfb*abs(redf), redf_max )
   337             lst1(i,j) = lst1(i,j) - redf * res / dres
   345           lst1(i,j) = min( max( lst1(i,j), &
   346                                 lst(i,j) - land_sfc_slab_dts_max * dt ), &
   347                                 lst(i,j) + land_sfc_slab_dts_max * dt )
   349           if( n > land_sfc_slab_itr_max ) 
then   351             if( io_l ) 
write(io_fid_log,
'(A)'       ) 
'Warning: land surface tempearture was not converged.'   352             if( io_l ) 
write(io_fid_log,
'(A)'       ) 
''   353             if( io_l ) 
write(io_fid_log,
'(A,I32)'   ) 
'DEBUG --- PRC_myrank                         [no unit] :', 
prc_myrank   354             if( io_l ) 
write(io_fid_log,
'(A,I32)'   ) 
'DEBUG --- number of i                        [no unit] :', i
   355             if( io_l ) 
write(io_fid_log,
'(A,I32)'   ) 
'DEBUG --- number of j                        [no unit] :', j
   356             if( io_l ) 
write(io_fid_log,
'(A)'       ) 
''   357             if( io_l ) 
write(io_fid_log,
'(A,I32)'   ) 
'DEBUG --- loop number                        [no unit] :', n
   358             if( io_l ) 
write(io_fid_log,
'(A,F32.16)') 
'DEBUG --- Residual                           [J/m2/s]  :', res
   359             if( io_l ) 
write(io_fid_log,
'(A,F32.16)') 
'DEBUG --- delta Residual                     [J/m2/s]  :', dres
   360             if( io_l ) 
write(io_fid_log,
'(A,F32.16)') 
''   361             if( io_l ) 
write(io_fid_log,
'(A,F32.16)') 
'DEBUG --- temperature                        [K]       :', tmpa(i,j)
   362             if( io_l ) 
write(io_fid_log,
'(A,F32.16)') 
'DEBUG --- pressure                           [Pa]      :', prsa(i,j)
   363             if( io_l ) 
write(io_fid_log,
'(A,F32.16)') 
'DEBUG --- velocity w                         [m/s]     :', wa(i,j)
   364             if( io_l ) 
write(io_fid_log,
'(A,F32.16)') 
'DEBUG --- velocity u                         [m/s]     :', ua(i,j)
   365             if( io_l ) 
write(io_fid_log,
'(A,F32.16)') 
'DEBUG --- velocity v                         [m/s]     :', 
va(i,j)
   366             if( io_l ) 
write(io_fid_log,
'(A,F32.16)') 
'DEBUG --- density                            [kg/m3]   :', rhoa(i,j)
   367             if( io_l ) 
write(io_fid_log,
'(A,F32.16)') 
'DEBUG --- water vapor mass ratio             [kg/kg]   :', qva(i,j)
   368             if( io_l ) 
write(io_fid_log,
'(A,F32.16)') 
'DEBUG --- cell center height                 [m]       :', z1(i,j)
   369             if( io_l ) 
write(io_fid_log,
'(A,F32.16)') 
'DEBUG --- atmospheric mixing layer height    [m]       :', pbl(i,j)
   370             if( io_l ) 
write(io_fid_log,
'(A,F32.16)') 
'DEBUG --- pressure at the surface            [Pa]      :', prss(i,j)
   371             if( io_l ) 
write(io_fid_log,
'(A,F32.16)') 
'DEBUG --- downward long-wave radiation       [J/m2/s]  :', lwd(i,j)
   372             if( io_l ) 
write(io_fid_log,
'(A,F32.16)') 
'DEBUG --- downward short-wave radiation      [J/m2/s]  :', swd(i,j)
   373             if( io_l ) 
write(io_fid_log,
'(A)'       ) 
''   374             if( io_l ) 
write(io_fid_log,
'(A,F32.16)') 
'DEBUG --- soil temperature                   [K]       :', tg(i,j)
   375             if( io_l ) 
write(io_fid_log,
'(A,F32.16)') 
'DEBUG --- land surface temperature           [K]       :', lst(i,j)
   376             if( io_l ) 
write(io_fid_log,
'(A,F32.16)') 
'DEBUG --- efficiency of evaporation          [0-1]     :', qvef(i,j)
   377             if( io_l ) 
write(io_fid_log,
'(A,F32.16)') 
'DEBUG --- surface albedo for LW              [0-1]     :', alb_lw(i,j)
   378             if( io_l ) 
write(io_fid_log,
'(A,F32.16)') 
'DEBUG --- surface albedo for SW              [0-1]     :', alb_sw(i,j)
   379             if( io_l ) 
write(io_fid_log,
'(A,F32.16)') 
'DEBUG --- soil depth                         [m]       :', dzg(i,j)
   380             if( io_l ) 
write(io_fid_log,
'(A,F32.16)') 
'DEBUG --- thermal conductivity for soil      [J/m/K/s] :', tcs(i,j)
   381             if( io_l ) 
write(io_fid_log,
'(A,F32.16)') 
'DEBUG --- roughness length for momemtum      [m]       :', z0m(i,j)
   382             if( io_l ) 
write(io_fid_log,
'(A,F32.16)') 
'DEBUG --- roughness length for heat          [m]       :', z0h(i,j)
   383             if( io_l ) 
write(io_fid_log,
'(A,F32.16)') 
'DEBUG --- roughness length for vapor         [m]       :', z0e(i,j)
   384             if( io_l ) 
write(io_fid_log,
'(A)'       ) 
''   385             if( io_l ) 
write(io_fid_log,
'(A,F32.16)') 
'DEBUG --- latent heat                        [J/kg]    :', lhv(i,j)
   386             if( io_l ) 
write(io_fid_log,
'(A,F32.16)') 
'DEBUG --- friction velocity                  [m]       :', ustar
   387             if( io_l ) 
write(io_fid_log,
'(A,F32.16)') 
'DEBUG --- friction potential temperature     [K]       :', tstar
   388             if( io_l ) 
write(io_fid_log,
'(A,F32.16)') 
'DEBUG --- friction water vapor mass ratio    [kg/kg]   :', qstar
   389             if( io_l ) 
write(io_fid_log,
'(A,F32.16)') 
'DEBUG --- d(friction velocity)               [m]       :', dustar
   390             if( io_l ) 
write(io_fid_log,
'(A,F32.16)') 
'DEBUG --- d(friction potential temperature)  [K]       :', dtstar
   391             if( io_l ) 
write(io_fid_log,
'(A,F32.16)') 
'DEBUG --- d(friction water vapor mass ratio) [kg/kg]   :', dqstar
   392             if( io_l ) 
write(io_fid_log,
'(A,F32.16)') 
'DEBUG --- modified absolute velocity         [m/s]     :', uabs
   393             if( io_l ) 
write(io_fid_log,
'(A,F32.16)') 
'DEBUG --- next land surface temperature      [K]       :', lst1(i,j)
   396             if ( .NOT. ( res > -1.0_rp .OR. res < 1.0_rp ) ) 
then    397                write(*,*) 
'xxx NaN is detected for land surface temperature.'   399                write(*,*) 
'DEBUG --- PRC_myrank                                   :', 
prc_myrank   400                write(*,*) 
'DEBUG --- number of i                                  :', i
   401                write(*,*) 
'DEBUG --- number of j                                  :', j
   403                write(*,*) 
'DEBUG --- Residual                           [J/m2/s]  :', res
   404                write(*,*) 
'DEBUG --- delta Residual                     [J/m2/s]  :', dres
   406                write(*,*) 
'DEBUG --- temperature                        [K]       :', tmpa(i,j)
   407                write(*,*) 
'DEBUG --- pressure                           [Pa]      :', prsa(i,j)
   408                write(*,*) 
'DEBUG --- velocity w                         [m/s]     :', wa(i,j)
   409                write(*,*) 
'DEBUG --- velocity u                         [m/s]     :', ua(i,j)
   410                write(*,*) 
'DEBUG --- velocity v                         [m/s]     :', 
va(i,j)
   411                write(*,*) 
'DEBUG --- density                            [kg/m3]   :', rhoa(i,j)
   412                write(*,*) 
'DEBUG --- water vapor mass ratio             [kg/kg]   :', qva(i,j)
   413                write(*,*) 
'DEBUG --- cell center height                 [m]       :', z1(i,j)
   414                write(*,*) 
'DEBUG --- atmospheric mixing layer height    [m]       :', pbl(i,j)
   415                write(*,*) 
'DEBUG --- pressure at the surface            [Pa]      :', prss(i,j)
   416                write(*,*) 
'DEBUG --- downward long-wave radiation       [J/m2/s]  :', lwd(i,j)
   417                write(*,*) 
'DEBUG --- downward short-wave radiation      [J/m2/s]  :', swd(i,j)
   419                write(*,*) 
'DEBUG --- soil temperature                   [K]       :', tg(i,j)
   420                write(*,*) 
'DEBUG --- land surface temperature           [K]       :', lst(i,j)
   421                write(*,*) 
'DEBUG --- efficiency of evaporation          [0-1]     :', qvef(i,j)
   422                write(*,*) 
'DEBUG --- surface albedo for LW              [0-1]     :', alb_lw(i,j)
   423                write(*,*) 
'DEBUG --- surface albedo for SW              [0-1]     :', alb_sw(i,j)
   424                write(*,*) 
'DEBUG --- soil depth                         [m]       :', dzg(i,j)
   425                write(*,*) 
'DEBUG --- thermal conductivity for soil      [J/m/K/s] :', tcs(i,j)
   426                write(*,*) 
'DEBUG --- roughness length for momemtum      [m]       :', z0m(i,j)
   427                write(*,*) 
'DEBUG --- roughness length for heat          [m]       :', z0h(i,j)
   428                write(*,*) 
'DEBUG --- roughness length for vapor         [m]       :', z0e(i,j)
   430                write(*,*) 
'DEBUG --- latent heat                        [J/kg]    :', lhv(i,j)
   431                write(*,*) 
'DEBUG --- friction velocity                  [m]       :', ustar
   432                write(*,*) 
'DEBUG --- friction potential temperature     [K]       :', tstar
   433                write(*,*) 
'DEBUG --- friction water vapor mass ratio    [kg/kg]   :', qstar
   434                write(*,*) 
'DEBUG --- d(friction velocity)               [m]       :', dustar
   435                write(*,*) 
'DEBUG --- d(friction potential temperature)  [K]       :', dtstar
   436                write(*,*) 
'DEBUG --- d(friction water vapor mass ratio) [kg/kg]   :', dqstar
   437                write(*,*) 
'DEBUG --- modified absolute velocity         [m/s]     :', uabs
   438                write(*,*) 
'DEBUG --- next land surface temperature      [K]       :', lst1(i,j)
   448         lst_t(i,j) = ( lst1(i,j) - lst(i,j) ) / dt
   469       if( is_lnd(i,j) ) 
then   494         zmflx(i,j) = -rhoa(i,j) * ustar**2 / uabs * wa(i,j)
   495         xmflx(i,j) = -rhoa(i,j) * ustar**2 / uabs * ua(i,j)
   496         ymflx(i,j) = -rhoa(i,j) * ustar**2 / uabs * 
va(i,j)
   497         shflx(i,j) = -cpdry    * rhoa(i,j) * ustar * tstar
   498         lhflx(i,j) = -lhv(i,j) * rhoa(i,j) * ustar * qstar * qvef(i,j)
   499         ghflx(i,j) = -2.0_rp * tcs(i,j) * ( lst1(i,j) - tg(i,j) ) / dzg(i,j)
   502         res = ( 1.0_rp - alb_sw(i,j) ) * swd(i,j) &
   503             + ( 1.0_rp - alb_lw(i,j) ) * ( lwd(i,j) - stb * lst1(i,j)**4 ) &
   504             - shflx(i,j) - lhflx(i,j) + ghflx(i,j)
   507         ghflx(i,j) = ghflx(i,j) - res
   510         u10(i,j) = ua(i,j) * 
log( 10.0_rp / z0m(i,j) ) / 
log( z1(i,j) / z0m(i,j) )
   511         v10(i,j) = 
va(i,j) * 
log( 10.0_rp / z0m(i,j) ) / 
log( z1(i,j) / z0m(i,j) )
   512         t2(i,j) = lst1(i,j) + ( tmpa(i,j) - lst1(i,j) ) * ( 
log(  2.0_rp / z0m(i,j) ) * 
log(  2.0_rp / z0h(i,j) ) ) &
   513                                                          / ( 
log( z1(i,j) / z0m(i,j) ) * 
log( z1(i,j) / z0h(i,j) ) )
   514         q2(i,j) = sqv       + (  qva(i,j) - sqv       ) * ( 
log(  2.0_rp / z0m(i,j) ) * 
log(  2.0_rp / z0e(i,j) ) ) &
   515                                                          / ( 
log( z1(i,j) / z0m(i,j) ) * 
log( z1(i,j) / z0e(i,j) ) )
 integer, public is
start point of inner domain: x, local 
 
integer, public je
end point of inner domain: y, local 
 
real(rp), public const_cpdry
specific heat (dry air,constant pressure) [J/kg/K] 
 
module ATMOSPHERE / Saturation adjustment 
 
subroutine, public prc_mpistop
Abort MPI. 
 
real(rp), parameter, public const_stb
Stefan-Boltzman constant [W/m2/K4]. 
 
real(rp), public const_rdry
specific gas constant (dry air) [J/kg/K] 
 
integer, public ia
of x whole cells (local, with HALO)
 
procedure(bc), pointer, public bulkflux
 
integer, public js
start point of inner domain: y, local 
 
subroutine, public log(type, message)
 
integer, public prc_myrank
process num in local communicator 
 
integer, public ie
end point of inner domain: x, local 
 
real(rp), public const_eps
small number 
 
module ATMOSPHERE / Thermodynamics 
 
integer, public ja
of y whole cells (local, with HALO)