<p><b>laura@ucar.edu</b> 2010-12-21 15:55:09 -0700 (Tue, 21 Dec 2010)</p><p>updated to handle new physics<br>
</p><hr noshade><pre><font color="gray">Modified: branches/atmos_physics/src/core_physics/module_driver_convection_deep.F
===================================================================
--- branches/atmos_physics/src/core_physics/module_driver_convection_deep.F        2010-12-21 22:51:10 UTC (rev 657)
+++ branches/atmos_physics/src/core_physics/module_driver_convection_deep.F        2010-12-21 22:55:09 UTC (rev 658)
@@ -144,8 +144,7 @@
  convection_select: select case(conv_deep_scheme)
 
     case (&quot;kain_fritsch&quot;)
-       write(0,*)
-       write(0,*) '--- begin kain-fritsch initialization:'
+       write(0,*) '    begin kain-fritsch initialization:'
 
        allowed_to_read = .false.
        p_first = state % moist_start + 1
@@ -169,7 +168,7 @@
                ims = ims , ime = ime , jms = jms , jme = jme , kms = kds , kme = kme ,       &amp;
                its = its , ite = ite , jts = jts , jte = jte , kts = kts , kte = kte         &amp;
                        )
-       write(0,*) '--- end kain-kritsch initialization:'
+       write(0,*) '    end kain-kritsch initialization:'
 
     case default
 

Modified: branches/atmos_physics/src/core_physics/module_physics_constants.F
===================================================================
--- branches/atmos_physics/src/core_physics/module_physics_constants.F        2010-12-21 22:51:10 UTC (rev 657)
+++ branches/atmos_physics/src/core_physics/module_physics_constants.F        2010-12-21 22:55:09 UTC (rev 658)
@@ -1,43 +1,50 @@
-!==============================================================================
+!=============================================================================================
  module module_physics_constants
- use constants, R_d =&gt; rgas, g =&gt; gravity
+ use constants, cp =&gt; cp, R_d =&gt; rgas, g =&gt; gravity
 
  implicit none
+ public
  save
  
 !DESCRIPTION:
 !This module defines the constants needed for the physics parameterizations.
  
-!==============================================================================
+!=============================================================================================
 
- real(KIND=RKIND),parameter:: P0     = 100000.
- real(KIND=RKIND),parameter:: R_v    = 461.6
- real(KIND=RKIND),parameter:: ep_1   = R_v/R_d-1.
- real(KIND=RKIND),parameter:: ep_2   = R_d/R_v
- real(KIND=RKIND),parameter:: rdg    = R_d/g
- real(KIND=RKIND),parameter:: rcp    = R_d/cp
- real(KIND=RKIND),parameter:: rcv    = R_d/(cp-R_d)
+ real(kind=RKIND),parameter:: P0     = 100000.          !reference pressure               [Pa]
+ real(kind=RKIND),parameter:: t00    = 273.15           !reference temperarure             [K] 
+ real(kind=RKIND),parameter:: R_v    = 461.6            !gas constant for water vapor [J/kg/K]
+ real(kind=RKIND),parameter:: ep_1   = R_v/R_d-1.
+ real(kind=RKIND),parameter:: ep_2   = R_d/R_v
+ real(kind=RKIND),parameter:: rdg    = R_d/g
+ real(kind=RKIND),parameter:: rcp    = R_d/cp
+ real(kind=RKIND),parameter:: rcv    = R_d/(cp-R_d)
 
- real(KIND=RKIND),parameter:: rho_w  = 1000.0
+ real(kind=RKIND),parameter:: rho_w  = 1000.0
 
- real(KIND=RKIND),parameter:: svp1   = 0.6112
- real(KIND=RKIND),parameter:: svp2   = 17.67
- real(KIND=RKIND),parameter:: svp3   = 29.65
- real(KIND=RKIND),parameter:: svpt0  = 273.15
+ real(kind=RKIND),parameter:: svp1   = 0.6112
+ real(kind=RKIND),parameter:: svp2   = 17.67
+ real(kind=RKIND),parameter:: svp3   = 29.65
+ real(kind=RKIND),parameter:: svpt0  = 273.15
 
- real(KIND=RKIND),parameter:: xlv    = 2.15e6
- real(KIND=RKIND),parameter:: xlf    = 3.50e5
- real(KIND=RKIND),parameter:: xls    = xlv + xlf
+ real(kind=RKIND),parameter:: xlv    = 2.15e6           !latent heat of vaporization    [J/kg]
+ real(kind=RKIND),parameter:: xlf    = 3.50e5           !latent heat of fusion          [J/kg]
+ real(kind=RKIND),parameter:: xls    = xlv + xlf        !latent heat of sublimation     [J/kg]
 
- real(KIND=RKIND),parameter:: xlv0   = 3.15e6
- real(KIND=RKIND),parameter:: xlv1   = 2370.
- real(KIND=RKIND),parameter:: xls0   = 2.905e6
- real(KIND=RKIND),parameter:: xls1   = 259.532
+ real(kind=RKIND),parameter:: xlv0   = 3.15e6        
+ real(kind=RKIND),parameter:: xlv1   = 2370.
+ real(kind=RKIND),parameter:: xls0   = 2.905e6
+ real(kind=RKIND),parameter:: xls1   = 259.532
  
- real(KIND=RKIND),parameter:: karman = 0.4
- real(KIND=RKIND),parameter:: eomeg  = 7.29210e-5
- real(KIND=RKIND),parameter:: stbolt = 5.67051e-8
+ real(kind=RKIND),parameter:: karman = 0.4              !Von Karman constant
+ real(kind=RKIND),parameter:: eomeg  = 7.29210e-5
+ real(kind=RKIND),parameter:: stbolt = 5.67051e-8
 
-!==============================================================================
+!constants specific to long- and short-wave radiation codes:
+ real(kind=RKIND),parameter:: solcon_0 = 1365.          !solar constant                 [W/m2]
+ real(kind=RKIND),parameter:: degrad   = 3.1415926/180. !conversion from degree to radiant [-]
+ real(kind=RKIND),parameter:: dpd      = 360./365.
+
+!=============================================================================================
  end module module_physics_constants
-!==============================================================================
+!=============================================================================================

Modified: branches/atmos_physics/src/core_physics/module_physics_control.F
===================================================================
--- branches/atmos_physics/src/core_physics/module_physics_control.F        2010-12-21 22:51:10 UTC (rev 657)
+++ branches/atmos_physics/src/core_physics/module_physics_control.F        2010-12-21 22:55:09 UTC (rev 658)
@@ -220,8 +220,8 @@
        diag_physics % qsfc       % array(icell) = 0.
        diag_physics % regime     % array(icell) = 0.
        diag_physics % rmol       % array(icell) = 0.
-       diag_physics % t2         % array(icell) = 0.
-       diag_physics % th2        % array(icell) = 0.
+       diag_physics % t2m        % array(icell) = 0.
+       diag_physics % th2m       % array(icell) = 0.
        diag_physics % u10        % array(icell) = 0.
        diag_physics % ust        % array(icell) = 0.
        diag_physics % ustm       % array(icell) = 0.

Modified: branches/atmos_physics/src/core_physics/module_physics_driver.F
===================================================================
--- branches/atmos_physics/src/core_physics/module_physics_driver.F        2010-12-21 22:51:10 UTC (rev 657)
+++ branches/atmos_physics/src/core_physics/module_physics_driver.F        2010-12-21 22:55:09 UTC (rev 658)
@@ -3,8 +3,12 @@
  use configure
  use grid_types
 
- use module_pbl
+ use module_driver_cloudiness
  use module_driver_convection_deep
+ use module_driver_pbl
+!use module_driver_radiation_sw
+!use module_driver_radiation_lw
+ use module_driver_sfclayer
  use module_physics_constants
  use module_physics_vars
 #ifdef non_hydrostatic_core
@@ -55,14 +59,36 @@
     call MPAS_to_physics(block%state%time_levs(1)%state,block%diag)
 #endif
 
-    !call to convection:
+    !call to convection scheme:
     if(config_conv_deep_scheme .ne. 'off') &amp;
        call convection_deep_driver(itimestep,block%mesh,block%diag_physics,block%tend_physics)
 
+    !call to surface-layer scheme:
+    if(config_sfclayer_scheme .ne. 'off') &amp;
+       call sfclayer_driver(itimestep,block%mesh,block%diag_physics)
+
     !call to pbl schemes:
-!   if(config_pbl_scheme .ne. 'off') &amp;
-!      call pbl_driver(itimestep,block%mesh,block%state%time_levs(1)%state)
+    if(config_pbl_scheme .ne. 'off' .and. config_sfclayer_scheme .ne. 'off') &amp;
+       call pbl_driver(block%diag_physics,block%tend_physics)
 
+    !call to cloud scheme:
+    if(config_radt_sw_scheme.ne.'off' .or. config_radt_lw_scheme.ne.'off') then
+       call allocate_cloudiness
+       call driver_cloudiness(block%diag_physics)
+    endif
+
+!   !call to short wave radiation scheme:
+!   if(config_radt_sw_scheme .ne. 'off') then
+!      call allocate_radiation_sw
+!      call driver_radiation_sw(block%mesh,block%state%time_levs(1)%state,block%diag_physics,&amp;
+!                               block%tend_physics)
+!   endif
+
+!   !deallocate all arrays:
+!   if(config_radt_sw_scheme.ne.'off' .or. config_radt_lw_scheme.ne.'off') &amp;
+!      call deallocate_cloudiness
+!   if(config_radt_sw_scheme.ne.'off') call deallocate_radiation_sw
+
     block =&gt; block % next
  end do 
 

Modified: branches/atmos_physics/src/core_physics/module_physics_init.F
===================================================================
--- branches/atmos_physics/src/core_physics/module_physics_init.F        2010-12-21 22:51:10 UTC (rev 657)
+++ branches/atmos_physics/src/core_physics/module_physics_init.F        2010-12-21 22:55:09 UTC (rev 658)
@@ -1,14 +1,18 @@
 !=============================================================================================
  module module_physics_init
  use grid_types
- use configure, only: config_do_restart,       &amp;
-                      config_microp_scheme,    &amp;
-                      config_conv_deep_scheme, &amp;
-                      config_sfclayer_scheme
+ use configure, only: config_do_restart,          &amp;
+                      config_microp_scheme,       &amp;
+                      config_conv_deep_scheme,    &amp;
+                      config_sfclayer_scheme,     &amp;
+                      config_radt_lw_scheme,      &amp;
+                      config_radt_sw_scheme
 
  use module_driver_convection_deep
  use module_driver_microphysics
- use module_physics_sfclayer
+ use module_driver_sfclayer
+ use module_physics_rrtmg_lwinit
+ use module_physics_rrtmg_swinit
 
  implicit none
  private
@@ -17,16 +21,17 @@
  contains
 
 !=============================================================================================
- subroutine physics_init(mesh,state,diag_physics)
+ subroutine physics_init(dminfo,mesh,state,diag_physics)
 !=============================================================================================
 
 !input and output arguments:
 !---------------------------
+ type (dm_info), intent(in):: dminfo
  type(mesh_type),intent(in):: mesh
  type(state_type),intent(inout):: state
  type(diag_physics_type),intent(inout):: diag_physics
 
-!=============================================================================================
+!---------------------------------------------------------------------------------------------
  write(0,*)
  write(0,*) '--- enter subroutine physics_init:'
 
@@ -39,12 +44,17 @@
  if(config_microp_scheme .ne. 'off') call microphysics_init
 
 !initialization of surface layer processes:
- if(config_sfclayer_scheme .ne. 'off') then

-    call sfclayer_interface_init(diag_physics)
-    write(0,*) '--- end subroutine sfclayer_interface_init:'
-  
- endif
+ if(config_sfclayer_scheme .ne. 'off') call sfclayer_init(mesh,diag_physics)
+
+!initialization of shortwave radiation processes:
+!if(config_radt_sw_scheme.ne.'off') call init_radiation_sw(dminfo)
+
+!initialization of longwave radiation processes:
+ if(config_radt_lw_scheme.ne.'off') call rrtmg_lwinit_forMPAS(dminfo)
+
+!initialization of shortwave radiation processes:
+ if(config_radt_sw_scheme.ne.'off') call rrtmg_swinit_forMPAS(dminfo)
+
  write(0,*) '--- end subroutine physics_init:'
  write(0,*)
 

Modified: branches/atmos_physics/src/core_physics/module_physics_interface_nhyd.F
===================================================================
--- branches/atmos_physics/src/core_physics/module_physics_interface_nhyd.F        2010-12-21 22:51:10 UTC (rev 657)
+++ branches/atmos_physics/src/core_physics/module_physics_interface_nhyd.F        2010-12-21 22:55:09 UTC (rev 658)
@@ -53,14 +53,20 @@
  u          =&gt; diag  % uReconstructZonal % array
  v          =&gt; diag  % uReconstructMeridional % array
 
-!copy sounding variables from the geodesic grid to the wrf-physics grid:
+!copy sounding variables from the geodesic grid to the rectangular grid:
  do j = jts, jtf
+ do i = its, itf
+    psfc_p(i,j) = diag % surface_pressure % array(i)
+ enddo
+ enddo
+
+ do j = jts, jtf
  do k = kts, ktf
  do i = its, itf
 
+    !arrays located at theta points:
     u_p(i,k,j) = u(k,i)
     v_p(i,k,j) = v(k,i)
-    w_p(i,k,j) = w(k,i)
 
     rho_p(i,k,j) = zz(k,i) * rho(k,i)
     th_p(i,k,j)  = theta(k,i) / (1. + R_v/R_d * qv(k,i))
@@ -72,11 +78,35 @@
     dz_p(i,k,j) = zgrid(k+1,i)-zgrid(k,i)
 
     qv_p(i,k,j) = max(0.,state % scalars % array(state%index_qv,k,i))
+    qc_p(i,k,j) = max(0.,state % scalars % array(state%index_qc,k,i))
+    qr_p(i,k,j) = max(0.,state % scalars % array(state%index_qr,k,i))
+    qi_p(i,k,j) = max(0.,state % scalars % array(state%index_qi,k,i))
+    qs_p(i,k,j) = max(0.,state % scalars % array(state%index_qs,k,i))
+    qg_p(i,k,j) = max(0.,state % scalars % array(state%index_qg,k,i))
+    
+    !arrays located at w points:
+    w_p(i,k,j) = w(k,i)
+   
+ enddo
+ enddo
 
+ do k = 1, 1
+ do i = its, itf
+    pres2_p(i,k,j) = psfc_p(i,j)
  enddo
  enddo

+ do k = 2, ktf
+ do i = its, itf
+    pres2_p(i,k,j) = 0.5*(pres_p(i,k-1,j)+pres_p(i,k,j))
  enddo
+ enddo
 
+ enddo

+ write(0,*) '--- end subroutine MPAS_to_phys:'
+ write(0,*)
+
 !formats: 
  201 format(3i8,10(1x,e15.8))
  202 format(2i6,10(1x,e15.8))

Modified: branches/atmos_physics/src/core_physics/module_physics_manager.F
===================================================================
--- branches/atmos_physics/src/core_physics/module_physics_manager.F        2010-12-21 22:51:10 UTC (rev 657)
+++ branches/atmos_physics/src/core_physics/module_physics_manager.F        2010-12-21 22:55:09 UTC (rev 658)
@@ -5,8 +5,8 @@
  
  use module_driver_convection_deep
  use module_driver_microphysics
- use module_pbl
- use module_physics_sfclayer
+ use module_driver_pbl
+ use module_driver_sfclayer
  use module_physics_vars
 
  implicit none
@@ -97,6 +97,8 @@
  dt_cu      = dt_physics            !for now.
  dt_pbl     = dt_physics            !for now.
 
+ dt_radtsw = (dt_dyn * config_n_radt_sw) / 60.
+
 !allocation of all physics arrays:
  call physics_allocate_all
 
@@ -118,49 +120,81 @@
  if(config_conv_shallow_scheme .ne. 'off') &amp;
     conv_shallow_scheme = trim(config_conv_shallow_scheme)
 
+!initialization of variables and allocation of arrays related to surface processes:
+ if(config_sfclayer_scheme .ne. 'off') then
+    sfclayer_scheme = trim(config_sfclayer_scheme)
+    call sfclayer_allocate
+ endif
+
 !initialization of variables and allocation of arrays related to pbl processes:
- if(config_pbl_scheme .ne. 'off') pbl_scheme = trim(config_pbl_scheme)
+ if(config_pbl_scheme .ne. 'off' .and. config_sfclayer_scheme .ne. 'off') then
+    pbl_scheme = trim(config_pbl_scheme)
+    call pbl_allocate
+ endif
 
-!initialization of variables and allocation of arrays related to surface processes:
- if(config_sfclayer_scheme .ne. 'off') sfclayer_scheme = trim(config_sfclayer_scheme)
-
  end subroutine physics_wrf_interface
 
 !=============================================================================================
  subroutine physics_allocate_all
 !=============================================================================================
- if(.not.allocated(u_p)   )  allocate(u_p(ims:ime,kms:kme,jms:jme)     )
- if(.not.allocated(v_p)   )  allocate(v_p(ims:ime,kms:kme,jms:jme)     )
- if(.not.allocated(w_p)   )  allocate(w_p(ims:ime,kms:kme,jms:jme)     )
- if(.not.allocated(pres_p))  allocate(pres_p(ims:ime,kms:kme,jms:jme)  )
- if(.not.allocated(pi_p)  )  allocate(pi_p(ims:ime,kms:kme,jms:jme)    )
- if(.not.allocated(z_p)   )  allocate(z_p(ims:ime,kms:kme,jms:jme)     )
- if(.not.allocated(dz_p)  )  allocate(dz_p(ims:ime,kms:kme,jms:jme)    )
- if(.not.allocated(t_p)   )  allocate(t_p(ims:ime,kms:kme,jms:jme)     )
- if(.not.allocated(th_p)  )  allocate(th_p(ims:ime,kms:kme,jms:jme)    )
- if(.not.allocated(al_p)  )  allocate(al_p(ims:ime,kms:kme,jms:jme)    )
- if(.not.allocated(rho_p) )  allocate(rho_p(ims:ime,kms:kme,jms:jme)   )
- if(.not.allocated(rh_p)  )  allocate(rh_p(ims:ime,kms:kme,jms:jme)    )
 
+ if(.not.allocated(psfc_p))  allocate(psfc_p(ims:ime,jms:jme)           )
+ if(.not.allocated(ptop_p))  allocate(ptop_p(ims:ime,jms:jme)           )
+
+ if(.not.allocated(u_p)    )  allocate(u_p(ims:ime,kms:kme,jms:jme)     )
+ if(.not.allocated(v_p)    )  allocate(v_p(ims:ime,kms:kme,jms:jme)     )
+ if(.not.allocated(pres_p) )  allocate(pres_p(ims:ime,kms:kme,jms:jme)  )
+ if(.not.allocated(pi_p)   )  allocate(pi_p(ims:ime,kms:kme,jms:jme)    )
+ if(.not.allocated(z_p)    )  allocate(z_p(ims:ime,kms:kme,jms:jme)     )
+ if(.not.allocated(dz_p)   )  allocate(dz_p(ims:ime,kms:kme,jms:jme)    )
+ if(.not.allocated(t_p)    )  allocate(t_p(ims:ime,kms:kme,jms:jme)     )
+ if(.not.allocated(th_p)   )  allocate(th_p(ims:ime,kms:kme,jms:jme)    )
+ if(.not.allocated(al_p)   )  allocate(al_p(ims:ime,kms:kme,jms:jme)    )
+ if(.not.allocated(rho_p)  )  allocate(rho_p(ims:ime,kms:kme,jms:jme)   )
+ if(.not.allocated(rh_p)   )  allocate(rh_p(ims:ime,kms:kme,jms:jme)    )
+
+ if(.not.allocated(w_p)    )  allocate(w_p(ims:ime,kms:kme,jms:jme)     )
+ if(.not.allocated(pres2_p))  allocate(pres2_p(ims:ime,kms:kme,jms:jme) )
+ if(.not.allocated(t2_p)   )  allocate(t2_p(ims:ime,kms:kme,jms:jme)    )
+
  do j = jms,jme
+ do i = ims,ime
+    psfc_p(i,j)   = 0.
+    ptop_p(i,j)   = 0.
+ enddo
+ enddo
+
+ do j = jms,jme
  do k = kms,kme
  do i = ims,ime
-    u_p(i,k,j)    = 0.
-    v_p(i,k,j)    = 0.
-    w_p(i,k,j)    = 0.
-    pres_p(i,k,j) = 0.
-    pi_p(i,k,j)   = 0.
-    z_p(i,k,j)    = 0.
-    dz_p(i,k,j)   = 0.
-    t_p(i,k,j)    = 0.
-    th_p(i,k,j)   = 0.
-    al_p(i,k,j)   = 0.
-    rho_p(i,k,j)  = 0.
-    rh_p(i,k,j)   = 0.
+    u_p(i,k,j)     = 0.
+    v_p(i,k,j)     = 0.
+    w_p(i,k,j)     = 0.
+    pres_p(i,k,j)  = 0.
+    pi_p(i,k,j)    = 0.
+    z_p(i,k,j)     = 0.
+    dz_p(i,k,j)    = 0.
+    t_p(i,k,j)     = 0.
+    th_p(i,k,j)    = 0.
+    al_p(i,k,j)    = 0.
+    rho_p(i,k,j)   = 0.
+    rh_p(i,k,j)    = 0.
+
+    w_p(i,k,j)     = 0.
+    pres2_p(i,k,j) = 0.
+    t2_p(i,k,j)    = 0.
  enddo
  enddo
  enddo
 
+!allocate moist species (to be revisited!):
+ if(.not.allocated(qv_p)   ) allocate(qv_p(ims:ime,kms:kme,jms:jme)     )
+ if(.not.allocated(qc_p)   ) allocate(qc_p(ims:ime,kms:kme,jms:jme)     )
+ if(.not.allocated(qr_p)   ) allocate(qr_p(ims:ime,kms:kme,jms:jme)     )
+ if(.not.allocated(qi_p)   ) allocate(qi_p(ims:ime,kms:kme,jms:jme)     )
+ if(.not.allocated(qs_p)   ) allocate(qs_p(ims:ime,kms:kme,jms:jme)     )
+ if(.not.allocated(qg_p)   ) allocate(qg_p(ims:ime,kms:kme,jms:jme)     )
+
  end subroutine physics_allocate_all
 
 !=============================================================================================
@@ -168,9 +202,11 @@
 !=============================================================================================
 
 !de-allocation of all physics arrays:
+ if(allocated(psfc_p)  ) deallocate(psfc_p  )
+ if(allocated(ptop_p)  ) deallocate(ptop_p  )
+
  if(allocated(u_p)     ) deallocate(u_p     )
  if(allocated(v_p)     ) deallocate(v_p     )
- if(allocated(w_p)     ) deallocate(w_p     )
  if(allocated(pres_p)  ) deallocate(pres_p  )
  if(allocated(pi_p)    ) deallocate(pi_p    )
  if(allocated(z_p)     ) deallocate(z_p     )
@@ -181,6 +217,17 @@
  if(allocated(rho_p)   ) deallocate(rho_p   ) 
  if(allocated(rh_p)    ) deallocate(rh_p    ) 
 
+ if(allocated(w_p)     ) deallocate(w_p     )
+ if(allocated(pres2_p) ) deallocate(pres2_p )
+ if(allocated(t2_p)    ) deallocate(t2_p    )
+
+ if(allocated(qv_p)    ) deallocate(qv_p    )
+ if(allocated(qc_p)    ) deallocate(qc_p    )
+ if(allocated(qr_p)    ) deallocate(qr_p    )
+ if(allocated(qi_p)    ) deallocate(qi_p    )
+ if(allocated(qs_p)    ) deallocate(qs_p    )
+ if(allocated(qg_p)    ) deallocate(qg_p    )
+
  end subroutine physics_wrf_deallocate
 
 !=============================================================================================

Modified: branches/atmos_physics/src/core_physics/module_physics_vars.F
===================================================================
--- branches/atmos_physics/src/core_physics/module_physics_vars.F        2010-12-21 22:51:10 UTC (rev 657)
+++ branches/atmos_physics/src/core_physics/module_physics_vars.F        2010-12-21 22:55:09 UTC (rev 658)
@@ -13,8 +13,8 @@
  character(len=32),public:: conv_deep_scheme
  character(len=32),public:: conv_shallow_scheme
  character(len=32),public:: pbl_scheme
- character(len=32),public:: radiation_lw_scheme
- character(len=32),public:: radiation_sw_scheme
+ character(len=32),public:: radt_lw_scheme
+ character(len=32),public:: radt_sw_scheme
  character(len=32),public:: sfclayer_scheme
 
 !=============================================================================================
@@ -34,41 +34,63 @@
  
 !... arrays related to surface:
  real(kind=RKIND),dimension(:,:),allocatable:: &amp;
-    psfc_phy           !surface pressure                                                 (Pa).
+    psfc_p,           &amp;!surface pressure                                                 [Pa].
+    ptop_p             !model-top pressure                                               [Pa].
 
 !... arrays related to u- and v-velocities interpolated to theta points:
  real(kind=RKIND),dimension(:,:,:),allocatable:: &amp;
-    u_p,              &amp;!u-velocity interpolated to theta points                         (m/s).
-    v_p                !v-velocity interpolated to theta points                         (m/s).
+    u_p,              &amp;!u-velocity interpolated to theta points                         [m/s].
+    v_p                !v-velocity interpolated to theta points                         [m/s].
     
 !... arrays related to vertical sounding:
  real(kind=RKIND),dimension(:,:,:),allocatable:: &amp;
-    w_p,              &amp;!vertical velocity                                               (m/s).
-    pres_p,           &amp;!pressure                                                         (Pa).
-    pi_p,             &amp;!(p_phy/p0)**(r_d/cp)                                              (-).
-    z_p,              &amp;!height of layer                                                   (m).
-    dz_p,             &amp;!layer thickness                                                   (m).
-    t_p,              &amp;!temperature                                                       (K).
-    th_p,             &amp;!potential temperature                                             (K).
-    al_p,             &amp;!inverse of air density                                        (m3/kg).
-    rho_p,            &amp;!air density                                                   (kg/m3).
-    rh_p               !relative humidity                                                 (-).
+    pres_p,           &amp;!pressure                                                         [Pa].
+    pi_p,             &amp;!(p_phy/p0)**(r_d/cp)                                              [-].
+    z_p,              &amp;!height of layer                                                   [m].
+    dz_p,             &amp;!layer thickness                                                   [m].
+    t_p,              &amp;!temperature                                                       [K].
+    th_p,             &amp;!potential temperature                                             [K].
+    al_p,             &amp;!inverse of air density                                        [m3/kg].
+    rho_p,            &amp;!air density                                                   [kg/m3].
+    rh_p               !relative humidity                                                 [-].
 
  real(kind=RKIND),dimension(:,:,:),allocatable:: &amp;
-    qv_p,             &amp;!water vapor mixing ratio                                      (kg/kg).
-    qc_p,             &amp;!cloud water mixing ratio                                      (kg/kg).
-    qr_p,             &amp;!rain mixing ratio                                             (kg/kg).
-    qi_p,             &amp;!cloud ice mixing ratio                                        (kg/kg).
-    qs_p,             &amp;!snow mixing ratio                                             (kg/kg).
-    qg_p               !graupel mixing ratio                                          (kg/kg).
+    qv_p,             &amp;!water vapor mixing ratio                                      [kg/kg].
+    qc_p,             &amp;!cloud water mixing ratio                                      [kg/kg].
+    qr_p,             &amp;!rain mixing ratio                                             [kg/kg].
+    qi_p,             &amp;!cloud ice mixing ratio                                        [kg/kg].
+    qs_p,             &amp;!snow mixing ratio                                             [kg/kg].
+    qg_p               !graupel mixing ratio                                          [kg/kg].
  
  real(kind=RKIND),dimension(:,:,:),allocatable:: &amp;
-    qni_p,            &amp;!number concentration for cloud ice                             (#/kg).
-    qnr_p              !number concentration for rain                                  (#/kg).
+    qni_p,            &amp;!number concentration for cloud ice                             [#/kg].
+    qnr_p              !number concentration for rain                                  [#/kg].
 
+!... arrays located at w (vertical velocity) points, or at interface between layers:
+ real(kind=RKIND),dimension(:,:,:),allocatable:: &amp;
+    w_p,              &amp;!vertical velocity                                               [m/s].
+    pres2_p,          &amp;!pressure                                                        [hPa].
+    t2_p               !temperature                                                       [K].
+
 !=============================================================================================
 !... variables and arrays related to parameterization of cloud microphysics:
 !=============================================================================================
+
+ logical,parameter:: &amp;
+    warm_rain=.false.  !warm-phase cloud microphysics only (used in WRF).
+
+ logical:: &amp;
+    f_qv,             &amp;!
+    f_qc,             &amp;!
+    f_qr,             &amp;!
+    f_qi,             &amp;!
+    f_qs,             &amp;!
+    f_qg               !
+
+ real(kind=RKIND),parameter:: &amp;
+    f_ice  = 0.,      &amp;!fraction of cloud ice (used in WRF only).
+    f_rain = 0.        !fraction of rain (used in WRF only).
+
  real(kind=RKIND),dimension(:,:),allocatable:: &amp;
     rainnc_p,         &amp;!
     rainncv_p,        &amp;!
@@ -84,13 +106,6 @@
  integer,public:: n_cu
  real(kind=RKIND),public:: dt_cu
 
- logical:: &amp;
-    f_qv,             &amp;!
-    f_qc,             &amp;!
-    f_qr,             &amp;!
-    f_qi,             &amp;!
-    f_qs,             &amp;!
-    f_qg               !
  logical,dimension(:,:),allocatable:: &amp;
          cu_act_flag
  real(kind=RKIND),dimension(:,:),allocatable::   &amp;
@@ -115,21 +130,39 @@
 !... variables and arrays related to parameterization of pbl:
 !=============================================================================================
  integer,public:: n_pbl
+
+ integer,dimension(:,:),allocatable:: &amp;
+    kpbl_p             !index of PBL top                                                  [-].
+
  real(kind=RKIND),public:: dt_pbl
 
+ real(kind=RKIND),dimension(:,:),allocatable:: &amp;
+    hpbl_p             !PBL height                                                        [m].
+
  real(kind=RKIND),dimension(:,:,:),allocatable:: &amp;
-    rublten_phy,      &amp;!
-    rvblten_phy,      &amp;!
-    rthblten_phy,     &amp;!
-    rqvblten_phy,     &amp;!
-    rqcblten_phy,     &amp;!
-    rqiblten_phy       !
+    exch_p             !exchange coefficient                                              [-].
 
+ real(kind=RKIND),dimension(:,:,:),allocatable:: &amp;
+    rublten_p,        &amp;!
+    rvblten_p,        &amp;!
+    rthblten_p,       &amp;!
+    rqvblten_p,       &amp;!
+    rqcblten_p,       &amp;!
+    rqiblten_p         !
+
 !=============================================================================================
 !... variables and arrays related to parameterization of surface layer:
 !=============================================================================================
  real(kind=RKIND),dimension(:,:),allocatable:: &amp;
     br_p,             &amp;!bulk richardson number                                            [-].
+    cd_p,             &amp;!
+    cda_p,            &amp;!
+    ck_p,             &amp;!
+    cka_p,            &amp;!
+    cpm_p,            &amp;!
+    chs_p,            &amp;!
+    chs2_p,           &amp;!
+    cqs2_p,           &amp;!
     gz1oz0_p,         &amp;!log of z1 over z0                                                 [-].
     flhc_p,           &amp;!exchange coefficient for heat                                     [-].
     flqc_p,           &amp;!exchange coefficient for moisture                                 [-].
@@ -142,20 +175,99 @@
     psim_p,           &amp;!similarity theory for momentum                                    [-].
     q2_p,             &amp;!specific humidity at 2m                                       [kg/kg].
     qfx_p,            &amp;!upward moisture flux at the surface                         [kg/m2/s].
+    qgh_p,            &amp;!
     qsfc_p,           &amp;!specific humidity at lower boundary                           [kg/kg].
     regime_p,         &amp;!flag indicating PBL regime (stable_p,unstable_p,etc...)           [-].
     rmol_p,           &amp;!1 / Monin Ob length                                               [-].
-    t2_p,             &amp;!temperature at 2m                                                 [K].
-    tsk_p,            &amp;!surface-skin temperature                                          [K].
-    th2_p,            &amp;!potential temperature at 2m                                       [K].
+    t2m_p,            &amp;!temperature at 2m                                                 [K].
+    th2m_p,           &amp;!potential temperature at 2m                                       [K].
     u10_p,            &amp;!u at 10 m                                                       [m/s].
     ust_p,            &amp;!u* in similarity theory                                         [m/s].
     ustm_p,           &amp;!u* in similarity theory without vconv                           [m/s].
     v10_p,            &amp;!v at 10 m                                                       [m/s].
     wspd_p,           &amp;!wind speed                                                      [m/s].
-    xland_p,          &amp;!land mask (1 for land; 2 for water)                               [-].
-    znt_p              !time-varying roughness length                                     [m].
+    znt_p,            &amp;!time-varying roughness length                                     [m].
+    zol_p              !
 
 !=============================================================================================
+!... variables and arrays related to parameterization of short-wave radiation:
+!=============================================================================================
+
+ real(kind=RKIND):: &amp;
+    dt_radtsw,        &amp;!time-step for shortwave radiation parameterization              [mns].
+    declin,           &amp;!solar declination                                                 [-].
+    solcon             !solar constant                                                [W m-2].
+
+ real(kind=RKIND),dimension(:,:),allocatable:: &amp;
+    coszr_p,          &amp;!cosine of the solar zenith angle                                  [-].
+    gsw_p,            &amp;!net shortwave flux at surface                                 [W m-2].
+    swcf_p,           &amp;!shortwave cloud forcing at top-of-atmosphere                  [W m-2].
+    swdnb_p,          &amp;!all-sky downwelling shortwave flux at bottom-of-atmosphere    [J m-2].
+    swdnbc_p,         &amp;!clear-sky downwelling shortwave flux at bottom-of-atmosphere  [J m-2].
+    swdnt_p,          &amp;!all-sky downwelling shortwave flux at top-of-atmosphere       [J m-2].
+    swdntc_p,         &amp;!clear-sky downwelling shortwave flux at top-of-atmosphere     [J m-2].
+    swupb_p,          &amp;!all-sky upwelling shortwave flux at bottom-of-atmosphere      [J m-2].
+    swupbc_p,         &amp;!clear-sky upwelling shortwave flux at bottom-of-atmosphere    [J m-2].
+    swupt_p,          &amp;!all-sky upwelling shortwave flux at top-of-atmosphere         [J m-2].
+    swuptc_p,         &amp;!clear-sky upwelling shortwave flux at top-of-atmosphere       [J m-2].
+    swdnflx_p,        &amp;!
+    swdnflxc_p,       &amp;!
+    swupflx_p,        &amp;!
+    swupflxc_p         !
+
+ real(kind=RKIND),dimension(:,:,:),allocatable:: &amp;
+    rthratensw_p       !uncoupled theta tendency due to shortwave radiation           [K s-1].
+
+!=============================================================================================
+!... variables and arrays related to parameterization of long-wave radiation:
+!=============================================================================================
+
+ real(kind=RKIND),dimension(:,:),allocatable:: &amp;
+    glw_p,            &amp;!net shortwave flux at surface                                 [W m-2].
+    lwcf_p,           &amp;!shortwave cloud forcing at top-of-atmosphere                  [W m-2].
+    lwdnb_p,          &amp;!all-sky downwelling shortwave flux at bottom-of-atmosphere    [J m-2].
+    lwdnbc_p,         &amp;!clear-sky downwelling shortwave flux at bottom-of-atmosphere  [J m-2].
+    lwdnt_p,          &amp;!all-sky downwelling shortwave flux at top-of-atmosphere       [J m-2].
+    lwdntc_p,         &amp;!clear-sky downwelling shortwave flux at top-of-atmosphere     [J m-2].
+    lwupb_p,          &amp;!all-sky upwelling shortwave flux at bottom-of-atmosphere      [J m-2].
+    lwupbc_p,         &amp;!clear-sky upwelling shortwave flux at bottom-of-atmosphere    [J m-2].
+    lwupt_p,          &amp;!all-sky upwelling shortwave flux at top-of-atmosphere         [J m-2].
+    lwuptc_p,         &amp;!clear-sky upwelling shortwave flux at top-of-atmosphere       [J m-2].
+    lwdnflx_p,        &amp;!
+    lwdnflxc_p,       &amp;!
+    lwupflx_p,        &amp;!
+    lwupflxc_p,       &amp;!
+    olrtoa_p           !outgoing longwave radiation at top-of-the-atmosphere          [W m-2].
+
+ real(kind=RKIND),dimension(:,:,:),allocatable:: &amp;
+    rthratenlw_p       !uncoupled theta tendency due to shortwave radiation           [K s-1].
+
+!=============================================================================================
+!.. variables and arrays related to cloudiness:
+!=============================================================================================
+
+ integer,parameter:: &amp;
+    icloud= 0          !used in WRF only.
+
+ real(kind=RKIND),dimension(:,:,:),allocatable:: &amp;
+    cldfrac_p          !cloud fraction                                                    [-].
+
+!=============================================================================================
+!.. variables and arrays related to surface characteristics:
+!=============================================================================================
+
+ real(kind=RKIND),dimension(:,:),allocatable:: &amp;
+    xlat_p,           &amp;!longitude, west is negative                                 [degrees].
+    xlon_p             !latitude, south is negative                                 [degrees].
+
+ real(kind=RKIND),dimension(:,:),allocatable:: &amp;
+    sfc_albedo_p,     &amp;!surface albedo                                                    [-].
+    sfc_emiss_p,      &amp;!land surface emissivity                                           [-].
+    snow_p,           &amp;!snow water equivalent                                        [kg m-2].
+    tsk_p,            &amp;!surface-skin temperature                                          [K].
+    xice_p,           &amp;!ice mask                                                          [-].
+    xland_p            !land mask    (1 for land; 2 for water)                            [-].
+
+!=============================================================================================
  end module module_physics_vars
 !=============================================================================================

</font>
</pre>