LCOV - code coverage report
Current view: top level - physics/clubb/src/CLUBB_core - stats_zt_module.F90 (source / functions) Hit Total Coverage
Test: coverage.info Lines: 0 1769 0.0 %
Date: 2025-03-13 18:42:46 Functions: 0 1 0.0 %

          Line data    Source code
       1             : !---------------------------------------------------------------------------
       2             : ! $Id$
       3             : !===============================================================================
       4             : module stats_zt_module
       5             : 
       6             :   implicit none
       7             : 
       8             :   private ! Default Scope
       9             : 
      10             :   public :: stats_init_zt
      11             : 
      12             :   ! Constant parameters
      13             :   integer, parameter, public :: nvarmax_zt = 800 ! Maximum variables allowed
      14             : 
      15             :   contains
      16             : 
      17             :   !=============================================================================
      18           0 :   subroutine stats_init_zt( vars_zt,                    & ! intent(in)
      19             :                             l_error,                    & ! intent(inout)
      20             :                             stats_metadata, stats_zt )    ! intent(inout)
      21             : 
      22             :     ! Description:
      23             :     ! Initializes array indices for stats_zt
      24             : 
      25             :     ! Note:
      26             :     ! All code that is within subroutine stats_init_zt, including variable
      27             :     ! allocation code, is not called if l_stats is false.  This subroutine is
      28             :     ! called only when l_stats is true.
      29             : 
      30             :     !-----------------------------------------------------------------------
      31             : 
      32             :     use constants_clubb, only:  &
      33             :         fstderr ! Constant(s)
      34             : 
      35             : 
      36             :     use stats_type_utilities, only: &
      37             :         stat_assign ! Procedure
      38             : 
      39             :     use parameters_model, only: &
      40             :         hydromet_dim, & ! Variable(s)
      41             :         sclr_dim,     &
      42             :         edsclr_dim
      43             : 
      44             :     use array_index, only: &
      45             :         hydromet_list, &  ! Variable(s)
      46             :         l_mix_rat_hm
      47             : 
      48             :     use stats_type, only: &
      49             :         stats ! Type
      50             : 
      51             :     use stats_variables, only: &
      52             :         stats_metadata_type
      53             : 
      54             :     implicit none
      55             : 
      56             :     ! External
      57             :     intrinsic :: trim
      58             : 
      59             :     ! Local Constants
      60             : 
      61             :     !--------------------- Input Variable ---------------------
      62             :     character(len= * ), dimension(nvarmax_zt), intent(in) :: &
      63             :       vars_zt
      64             : 
      65             :     !--------------------- InOut Variables ---------------------      
      66             :     type (stats_metadata_type), intent(inout) :: &
      67             :       stats_metadata
      68             : 
      69             :     type (stats), target, intent(inout) :: &
      70             :       stats_zt
      71             : 
      72             :     logical, intent(inout) :: l_error
      73             :  
      74             :     !--------------------- Local Varables ---------------------
      75             :     integer :: tot_zt_loops
      76             : 
      77             :     integer :: i, j, k
      78             : 
      79             :     integer :: hm_idx, hmx_idx, hmy_idx
      80             : 
      81             :     character(len=10) :: hm_type, hmx_type, hmy_type
      82             : 
      83             :     character(len=50) :: sclr_idx
      84             : 
      85             :     !--------------------- Begin Code ---------------------
      86             : 
      87             :     ! The default initialization for array indices for stats_zt is zero (see module
      88             :     ! stats_variables)
      89             : 
      90             :     ! If any of the index arrays are allocated, then we have called this before
      91             :     ! to set up stats_metadata, so all we want to do is set stats_zt via stats_assign
      92           0 :     if ( .not. allocated(stats_metadata%ihm_1) ) then
      93             : 
      94             :       ! Allocate and initialize hydrometeor statistical variables.
      95           0 :       allocate( stats_metadata%ihm_1(1:hydromet_dim) )
      96           0 :       allocate( stats_metadata%ihm_2(1:hydromet_dim) )
      97           0 :       allocate( stats_metadata%imu_hm_1(1:hydromet_dim) )
      98           0 :       allocate( stats_metadata%imu_hm_2(1:hydromet_dim) )
      99           0 :       allocate( stats_metadata%imu_hm_1_n(1:hydromet_dim) )
     100           0 :       allocate( stats_metadata%imu_hm_2_n(1:hydromet_dim) )
     101           0 :       allocate( stats_metadata%isigma_hm_1(1:hydromet_dim) )
     102           0 :       allocate( stats_metadata%isigma_hm_2(1:hydromet_dim) )
     103           0 :       allocate( stats_metadata%isigma_hm_1_n(1:hydromet_dim) )
     104           0 :       allocate( stats_metadata%isigma_hm_2_n(1:hydromet_dim) )
     105             : 
     106           0 :       allocate( stats_metadata%icorr_w_hm_1(1:hydromet_dim) )
     107           0 :       allocate( stats_metadata%icorr_w_hm_2(1:hydromet_dim) )
     108           0 :       allocate( stats_metadata%icorr_chi_hm_1(1:hydromet_dim) )
     109           0 :       allocate( stats_metadata%icorr_chi_hm_2(1:hydromet_dim) )
     110           0 :       allocate( stats_metadata%icorr_eta_hm_1(1:hydromet_dim) )
     111           0 :       allocate( stats_metadata%icorr_eta_hm_2(1:hydromet_dim) )
     112           0 :       allocate( stats_metadata%icorr_Ncn_hm_1(1:hydromet_dim) )
     113           0 :       allocate( stats_metadata%icorr_Ncn_hm_2(1:hydromet_dim) )
     114           0 :       allocate( stats_metadata%icorr_hmx_hmy_1(1:hydromet_dim,1:hydromet_dim) )
     115           0 :       allocate( stats_metadata%icorr_hmx_hmy_2(1:hydromet_dim,1:hydromet_dim) )
     116             : 
     117           0 :       allocate( stats_metadata%icorr_w_hm_1_n(1:hydromet_dim) )
     118           0 :       allocate( stats_metadata%icorr_w_hm_2_n(1:hydromet_dim) )
     119           0 :       allocate( stats_metadata%icorr_chi_hm_1_n(1:hydromet_dim) )
     120           0 :       allocate( stats_metadata%icorr_chi_hm_2_n(1:hydromet_dim) )
     121           0 :       allocate( stats_metadata%icorr_eta_hm_1_n(1:hydromet_dim) )
     122           0 :       allocate( stats_metadata%icorr_eta_hm_2_n(1:hydromet_dim) )
     123           0 :       allocate( stats_metadata%icorr_Ncn_hm_1_n(1:hydromet_dim) )
     124           0 :       allocate( stats_metadata%icorr_Ncn_hm_2_n(1:hydromet_dim) )
     125           0 :       allocate( stats_metadata%icorr_hmx_hmy_1_n(1:hydromet_dim,1:hydromet_dim) )
     126           0 :       allocate( stats_metadata%icorr_hmx_hmy_2_n(1:hydromet_dim,1:hydromet_dim) )
     127             : 
     128           0 :       allocate( stats_metadata%ihmp2_zt(1:hydromet_dim) )
     129             : 
     130           0 :       allocate( stats_metadata%iwp2hmp(1:hydromet_dim) )
     131             : 
     132           0 :       stats_metadata%ihm_1(:) = 0
     133           0 :       stats_metadata%ihm_2(:) = 0
     134           0 :       stats_metadata%imu_hm_1(:) = 0
     135           0 :       stats_metadata%imu_hm_2(:) = 0
     136           0 :       stats_metadata%imu_hm_1_n(:) = 0
     137           0 :       stats_metadata%imu_hm_2_n(:) = 0
     138           0 :       stats_metadata%isigma_hm_1(:) = 0
     139           0 :       stats_metadata%isigma_hm_2(:) = 0
     140           0 :       stats_metadata%isigma_hm_1_n(:) = 0
     141           0 :       stats_metadata%isigma_hm_2_n(:) = 0
     142             : 
     143           0 :       stats_metadata%icorr_w_hm_1(:) = 0
     144           0 :       stats_metadata%icorr_w_hm_2(:) = 0
     145           0 :       stats_metadata%icorr_chi_hm_1(:) = 0
     146           0 :       stats_metadata%icorr_chi_hm_2(:) = 0
     147           0 :       stats_metadata%icorr_eta_hm_1(:) = 0
     148           0 :       stats_metadata%icorr_eta_hm_2(:) = 0
     149           0 :       stats_metadata%icorr_Ncn_hm_1(:) = 0
     150           0 :       stats_metadata%icorr_Ncn_hm_2(:) = 0
     151           0 :       stats_metadata%icorr_hmx_hmy_1(:,:) = 0
     152           0 :       stats_metadata%icorr_hmx_hmy_2(:,:) = 0
     153             : 
     154           0 :       stats_metadata%icorr_w_hm_1_n(:) = 0
     155           0 :       stats_metadata%icorr_w_hm_2_n(:) = 0
     156           0 :       stats_metadata%icorr_chi_hm_1_n(:) = 0
     157           0 :       stats_metadata%icorr_chi_hm_2_n(:) = 0
     158           0 :       stats_metadata%icorr_eta_hm_1_n(:) = 0
     159           0 :       stats_metadata%icorr_eta_hm_2_n(:) = 0
     160           0 :       stats_metadata%icorr_Ncn_hm_1_n(:) = 0
     161           0 :       stats_metadata%icorr_Ncn_hm_2_n(:) = 0
     162           0 :       stats_metadata%icorr_hmx_hmy_1_n(:,:) = 0
     163           0 :       stats_metadata%icorr_hmx_hmy_2_n(:,:) = 0
     164             : 
     165           0 :       stats_metadata%ihmp2_zt(:) = 0
     166             : 
     167           0 :       stats_metadata%iwp2hmp(:) = 0
     168             : 
     169             :       ! Allocate and then zero out passive scalar arrays
     170           0 :       allocate( stats_metadata%isclrm(1:sclr_dim) )
     171           0 :       allocate( stats_metadata%isclrm_f(1:sclr_dim) )
     172             : 
     173           0 :       stats_metadata%isclrm(:)     = 0
     174           0 :       stats_metadata%isclrm_f(:)   = 0
     175             : 
     176           0 :       allocate( stats_metadata%iedsclrm(1:edsclr_dim) )
     177           0 :       allocate( stats_metadata%iedsclrm_f(1:edsclr_dim) )
     178             : 
     179           0 :       stats_metadata%iedsclrm(:)   = 0
     180           0 :       stats_metadata%iedsclrm_f(:) = 0
     181             : 
     182             :     end if
     183             : 
     184             :     ! Assign pointers for statistics variables stats_zt using stat_assign
     185             : 
     186           0 :     tot_zt_loops = stats_zt%num_output_fields
     187             : 
     188           0 :     if ( any( vars_zt == "hm_i" ) ) then
     189             :        ! Correct for number of variables found under "hm_i".
     190             :        ! Subtract 2 from the loop size (1st PDF component and 2nd PDF component)
     191             :        ! for each hydrometeor.
     192           0 :        tot_zt_loops = tot_zt_loops - 2 * hydromet_dim
     193             :        ! Add 1 for "hm_i" to the loop size.
     194           0 :        tot_zt_loops = tot_zt_loops + 1
     195             :     endif
     196           0 :     if ( any( vars_zt == "mu_hm_i" ) ) then
     197             :        ! Correct for number of variables found under "mu_hm_i".
     198             :        ! Subtract 2 from the loop size (1st PDF component and 2nd PDF component)
     199             :        ! for each hydrometeor.
     200           0 :        tot_zt_loops = tot_zt_loops - 2 * hydromet_dim
     201             :        ! Add 1 for "mu_hm_i" to the loop size.
     202           0 :        tot_zt_loops = tot_zt_loops + 1
     203             :     endif
     204           0 :     if ( any( vars_zt == "mu_Ncn_i" ) ) then
     205             :        ! Correct for number of variables found under "mu_Ncn_i".
     206             :        ! Subtract 2 from the loop size (1st PDF comp. and 2nd PDF comp.).
     207           0 :        tot_zt_loops = tot_zt_loops - 2
     208             :        ! Add 1 for "mu_Ncn_i" to the loop size.
     209           0 :        tot_zt_loops = tot_zt_loops + 1
     210             :     endif
     211           0 :     if ( any( vars_zt == "mu_hm_i_n" ) ) then
     212             :        ! Correct for number of variables found under "mu_hm_i_n".
     213             :        ! Subtract 2 from the loop size (1st PDF component and 2nd PDF component)
     214             :        ! for each hydrometeor.
     215           0 :        tot_zt_loops = tot_zt_loops - 2 * hydromet_dim
     216             :        ! Add 1 for "mu_hm_i_n" to the loop size.
     217           0 :        tot_zt_loops = tot_zt_loops + 1
     218             :     endif
     219           0 :     if ( any( vars_zt == "mu_Ncn_i_n" ) ) then
     220             :        ! Correct for number of variables found under "mu_Ncn_i_n".
     221             :        ! Subtract 2 from the loop size (1st PDF comp. and 2nd PDF comp.).
     222           0 :        tot_zt_loops = tot_zt_loops - 2
     223             :        ! Add 1 for "mu_Ncn_i_n" to the loop size.
     224           0 :        tot_zt_loops = tot_zt_loops + 1
     225             :     endif
     226           0 :     if ( any( vars_zt == "sigma_hm_i" ) ) then
     227             :        ! Correct for number of variables found under "sigma_hm_i".
     228             :        ! Subtract 2 from the loop size (1st PDF component and 2nd PDF component)
     229             :        ! for each hydrometeor.
     230           0 :        tot_zt_loops = tot_zt_loops - 2 * hydromet_dim
     231             :        ! Add 1 for "sigma_hm_i" to the loop size.
     232           0 :        tot_zt_loops = tot_zt_loops + 1
     233             :     endif
     234           0 :     if ( any( vars_zt == "sigma_Ncn_i" ) ) then
     235             :        ! Correct for number of variables found under "sigma_Ncn_i".
     236             :        ! Subtract 2 from the loop size (1st PDF comp. and 2nd PDF comp.).
     237           0 :        tot_zt_loops = tot_zt_loops - 2
     238             :        ! Add 1 for "sigma_Ncn_i" to the loop size.
     239           0 :        tot_zt_loops = tot_zt_loops + 1
     240             :     endif
     241           0 :     if ( any( vars_zt == "sigma_hm_i_n" ) ) then
     242             :        ! Correct for number of variables found under "sigma_hm_i_n".
     243             :        ! Subtract 2 from the loop size (1st PDF component and 2nd PDF component)
     244             :        ! for each hydrometeor.
     245           0 :        tot_zt_loops = tot_zt_loops - 2 * hydromet_dim
     246             :        ! Add 1 for "sigma_hm_i_n" to the loop size.
     247           0 :        tot_zt_loops = tot_zt_loops + 1
     248             :     endif
     249           0 :     if ( any( vars_zt == "sigma_Ncn_i_n" ) ) then
     250             :        ! Correct for number of variables found under "sigma_Ncn_i_n".
     251             :        ! Subtract 2 from the loop size (1st PDF comp. and 2nd PDF comp.).
     252           0 :        tot_zt_loops = tot_zt_loops - 2
     253             :        ! Add 1 for "sigma_Ncn_i_n" to the loop size.
     254           0 :        tot_zt_loops = tot_zt_loops + 1
     255             :     endif
     256             : 
     257           0 :     if ( any( vars_zt == "corr_w_hm_i" ) ) then
     258             :        ! Correct for number of variables found under "corr_whm_i".
     259             :        ! Subtract 2 from the loop size (1st PDF component and 2nd PDF component)
     260             :        ! for each hydrometeor.
     261           0 :        tot_zt_loops = tot_zt_loops - 2 * hydromet_dim
     262             :        ! Add 1 for "corr_whm_i" to the loop size.
     263           0 :        tot_zt_loops = tot_zt_loops + 1
     264             :     endif
     265           0 :     if ( any( vars_zt == "corr_w_Ncn_i" ) ) then
     266             :        ! Correct for number of variables found under "corr_wNcn_i".
     267             :        ! Subtract 2 from the loop size (1st PDF comp. and 2nd PDF comp.).
     268           0 :        tot_zt_loops = tot_zt_loops - 2
     269             :        ! Add 1 for "corr_wNcn_i" to the loop size.
     270           0 :        tot_zt_loops = tot_zt_loops + 1
     271             :     endif
     272           0 :     if ( any( vars_zt == "corr_chi_hm_i" ) ) then
     273             :        ! Correct for number of variables found under "corr_chi_hm_i".
     274             :        ! Subtract 2 from the loop size (1st PDF component and 2nd PDF component)
     275             :        ! for each hydrometeor.
     276           0 :        tot_zt_loops = tot_zt_loops - 2 * hydromet_dim
     277             :        ! Add 1 for "corr_chi_hm_i" to the loop size.
     278           0 :        tot_zt_loops = tot_zt_loops + 1
     279             :     endif
     280           0 :     if ( any( vars_zt == "corr_chi_Ncn_i" ) ) then
     281             :        ! Correct for number of variables found under "corr_chi_Ncn_i".
     282             :        ! Subtract 2 from the loop size (1st PDF comp. and 2nd PDF comp.).
     283           0 :        tot_zt_loops = tot_zt_loops - 2
     284             :        ! Add 1 for "corr_chi_Ncn_i" to the loop size.
     285           0 :        tot_zt_loops = tot_zt_loops + 1
     286             :     endif
     287           0 :     if ( any( vars_zt == "corr_eta_hm_i" ) ) then
     288             :        ! Correct for number of variables found under "corr_eta_hm_i".
     289             :        ! Subtract 2 from the loop size (1st PDF component and 2nd PDF component)
     290             :        ! for each hydrometeor.
     291           0 :        tot_zt_loops = tot_zt_loops - 2 * hydromet_dim
     292             :        ! Add 1 for "corr_eta_hm_i" to the loop size.
     293           0 :        tot_zt_loops = tot_zt_loops + 1
     294             :     endif
     295           0 :     if ( any( vars_zt == "corr_eta_Ncn_i" ) ) then
     296             :        ! Correct for number of variables found under "corr_eta_Ncn_i".
     297             :        ! Subtract 2 from the loop size (1st PDF comp. and 2nd PDF comp.).
     298           0 :        tot_zt_loops = tot_zt_loops - 2
     299             :        ! Add 1 for "corr_eta_Ncn_i" to the loop size.
     300           0 :        tot_zt_loops = tot_zt_loops + 1
     301             :     endif
     302           0 :     if ( any( vars_zt == "corr_Ncn_hm_i" ) ) then
     303             :        ! Correct for number of variables found under "corr_Ncnhm_i".
     304             :        ! Subtract 2 from the loop size (1st PDF component and 2nd PDF component)
     305             :        ! for each hydrometeor.
     306           0 :        tot_zt_loops = tot_zt_loops - 2 * hydromet_dim
     307             :        ! Add 1 for "corr_Ncnhm_i" to the loop size.
     308           0 :        tot_zt_loops = tot_zt_loops + 1
     309             :     endif
     310           0 :     if ( any( vars_zt == "corr_hmx_hmy_i" ) ) then
     311             :        ! Correct for number of variables found under "corr_hmxhmy_i".
     312             :        ! Subtract 2 (1st PDF component and 2nd PDF component) multipled by the
     313             :        ! number of correlations of two hydrometeors, which is found by:
     314             :        ! (1/2) * hydromet_dim * ( hydromet_dim - 1 ); from the loop size.
     315           0 :        tot_zt_loops = tot_zt_loops - hydromet_dim * ( hydromet_dim - 1 )
     316             :        ! Add 1 for "corr_hmxhmy_i" to the loop size.
     317           0 :        tot_zt_loops = tot_zt_loops + 1
     318             :     endif
     319             : 
     320           0 :     if ( any( vars_zt == "corr_w_hm_i_n" ) ) then
     321             :        ! Correct for number of variables found under "corr_whm_i_n".
     322             :        ! Subtract 2 from the loop size (1st PDF component and 2nd PDF component)
     323             :        ! for each hydrometeor.
     324           0 :        tot_zt_loops = tot_zt_loops - 2 * hydromet_dim
     325             :        ! Add 1 for "corr_whm_i_n" to the loop size.
     326           0 :        tot_zt_loops = tot_zt_loops + 1
     327             :     endif
     328           0 :     if ( any( vars_zt == "corr_w_Ncn_i_n" ) ) then
     329             :        ! Correct for number of variables found under "corr_wNcn_i_n".
     330             :        ! Subtract 2 from the loop size (1st PDF comp. and 2nd PDF comp.).
     331           0 :        tot_zt_loops = tot_zt_loops - 2
     332             :        ! Add 1 for "corr_wNcn_i_n" to the loop size.
     333           0 :        tot_zt_loops = tot_zt_loops + 1
     334             :     endif
     335           0 :     if ( any( vars_zt == "corr_chi_hm_i_n" ) ) then
     336             :        ! Correct for number of variables found under "corr_chi_hm_i_n".
     337             :        ! Subtract 2 from the loop size (1st PDF component and 2nd PDF component)
     338             :        ! for each hydrometeor.
     339           0 :        tot_zt_loops = tot_zt_loops - 2 * hydromet_dim
     340             :        ! Add 1 for "corr_chi_hm_i_n" to the loop size.
     341           0 :        tot_zt_loops = tot_zt_loops + 1
     342             :     endif
     343           0 :     if ( any( vars_zt == "corr_chi_Ncn_i_n" ) ) then
     344             :        ! Correct for number of variables found under "corr_chi_Ncn_i_n".
     345             :        ! Subtract 2 from the loop size (1st PDF comp. and 2nd PDF comp.).
     346           0 :        tot_zt_loops = tot_zt_loops - 2
     347             :        ! Add 1 for "corr_chi_Ncn_i_n" to the loop size.
     348           0 :        tot_zt_loops = tot_zt_loops + 1
     349             :     endif
     350           0 :     if ( any( vars_zt == "corr_eta_hm_i_n" ) ) then
     351             :        ! Correct for number of variables found under "corr_eta_hm_i_n".
     352             :        ! Subtract 2 from the loop size (1st PDF component and 2nd PDF component)
     353             :        ! for each hydrometeor.
     354           0 :        tot_zt_loops = tot_zt_loops - 2 * hydromet_dim
     355             :        ! Add 1 for "corr_eta_hm_i_n" to the loop size.
     356           0 :        tot_zt_loops = tot_zt_loops + 1
     357             :     endif
     358           0 :     if ( any( vars_zt == "corr_eta_Ncn_i_n" ) ) then
     359             :        ! Correct for number of variables found under "corr_eta_Ncn_i_n".
     360             :        ! Subtract 2 from the loop size (1st PDF comp. and 2nd PDF comp.).
     361           0 :        tot_zt_loops = tot_zt_loops - 2
     362             :        ! Add 1 for "corr_eta_Ncn_i_n" to the loop size.
     363           0 :        tot_zt_loops = tot_zt_loops + 1
     364             :     endif
     365           0 :     if ( any( vars_zt == "corr_Ncn_hm_i_n" ) ) then
     366             :        ! Correct for number of variables found under "corr_Ncnhm_i_n".
     367             :        ! Subtract 2 from the loop size (1st PDF component and 2nd PDF component)
     368             :        ! for each hydrometeor.
     369           0 :        tot_zt_loops = tot_zt_loops - 2 * hydromet_dim
     370             :        ! Add 1 for "corr_Ncnhm_i_n" to the loop size.
     371           0 :        tot_zt_loops = tot_zt_loops + 1
     372             :     endif
     373           0 :     if ( any( vars_zt == "corr_hmx_hmy_i_n" ) ) then
     374             :        ! Correct for number of variables found under "corr_hmxhmy_i_n".
     375             :        ! Subtract 2 (1st PDF component and 2nd PDF component) multipled by the
     376             :        ! number of normal space correlations of two hydrometeors, which is found
     377             :        ! by:  (1/2) * hydromet_dim * ( hydromet_dim - 1 );
     378             :        ! from the loop size.
     379           0 :        tot_zt_loops = tot_zt_loops - hydromet_dim * ( hydromet_dim - 1 )
     380             :        ! Add 1 for "corr_hmxhmy_i_n" to the loop size.
     381           0 :        tot_zt_loops = tot_zt_loops + 1
     382             :     endif
     383             : 
     384           0 :     if ( any( vars_zt == "hmp2_zt" ) ) then
     385             :        ! Correct for number of variables found under "hmp2_zt".
     386             :        ! Subtract 1 from the loop size for each hydrometeor.
     387           0 :        tot_zt_loops = tot_zt_loops - hydromet_dim
     388             :        ! Add 1 for "hmp2_zt" to the loop size.
     389           0 :        tot_zt_loops = tot_zt_loops + 1
     390             :     endif
     391             : 
     392           0 :     if ( any( vars_zt == "wp2hmp" ) ) then
     393             :        ! Correct for number of variables found under "wp2hmp".
     394             :        ! Subtract 1 from the loop size for each hydrometeor.
     395           0 :        tot_zt_loops = tot_zt_loops - hydromet_dim
     396             :        ! Add 1 for "wp2hmp" to the loop size.
     397           0 :        tot_zt_loops = tot_zt_loops + 1
     398             :     endif
     399             : 
     400           0 :     if ( any( vars_zt == "sclrm" ) ) then
     401             :        ! Correct for number of variables found under "sclrm".
     402             :        ! Subtract 1 from the loop size for each scalar.
     403           0 :        tot_zt_loops = tot_zt_loops - sclr_dim
     404             : 
     405             :        ! Add 1 for "sclrm" to the loop size.
     406           0 :        tot_zt_loops = tot_zt_loops + 1
     407             :     endif
     408             : 
     409           0 :     if ( any( vars_zt == "sclrm_f" ) ) then
     410             :        ! Correct for number of variables found under "sclrm_f".
     411             :        ! Subtract 1 from the loop size for each scalar.
     412           0 :        tot_zt_loops = tot_zt_loops - sclr_dim
     413             :        ! Add 1 for "sclrm_f" to the loop size.
     414           0 :        tot_zt_loops = tot_zt_loops + 1
     415             :     endif
     416             : 
     417           0 :     if ( any( vars_zt == "edsclrm" ) ) then
     418             :        ! Correct for number of variables found under "edsclrm".
     419             :        ! Subtract 1 from the loop size for each scalar.
     420           0 :        tot_zt_loops = tot_zt_loops - edsclr_dim
     421             :        ! Add 1 for "edsclrm" to the loop size.
     422           0 :        tot_zt_loops = tot_zt_loops + 1
     423             :     endif
     424             : 
     425           0 :     if ( any( vars_zt == "edsclrm_f" ) ) then
     426             :        ! Correct for number of variables found under "edsclrm_f".
     427             :        ! Subtract 1 from the loop size for each scalar.
     428           0 :        tot_zt_loops = tot_zt_loops - edsclr_dim
     429             :        ! Add 1 for "edsclrm_f" to the loop size.
     430           0 :        tot_zt_loops = tot_zt_loops + 1
     431             :     endif
     432             : 
     433           0 :     k = 1
     434             : 
     435           0 :     do i = 1, tot_zt_loops
     436             : 
     437           0 :       select case ( trim( vars_zt(i) ) )
     438             :       case ('thlm')
     439           0 :         stats_metadata%ithlm = k
     440             :         call stat_assign( var_index=stats_metadata%ithlm, var_name="thlm", &
     441             :              var_description="thlm, Liquid water potential temperature (theta_l)", var_units="K", &
     442           0 :              l_silhs=.false., grid_kind=stats_zt )
     443           0 :         k = k + 1
     444             : 
     445             :       case ('T_in_K')
     446           0 :         stats_metadata%iT_in_K = k
     447             :         call stat_assign( var_index=stats_metadata%iT_in_K, var_name="T_in_K", &
     448             :              var_description="T_in_K, Absolute temperature", var_units="K", l_silhs=.false., &
     449           0 :              grid_kind=stats_zt )
     450           0 :         k = k + 1
     451             : 
     452             :       case ('thvm')
     453           0 :         stats_metadata%ithvm = k
     454             :         call stat_assign( var_index=stats_metadata%ithvm, var_name="thvm", &
     455             :              var_description="thvm, Virtual potential temperature", &
     456             :              var_units="K", l_silhs=.false., &
     457           0 :              grid_kind=stats_zt )
     458           0 :         k = k + 1
     459             : 
     460             :       case ('rtm')
     461           0 :         stats_metadata%irtm = k
     462             : 
     463             :         call stat_assign( var_index=stats_metadata%irtm, var_name="rtm", &
     464             :              var_description="rtm, Total (vapor+liquid) water mixing ratio", &
     465           0 :              var_units="kg/kg", l_silhs=.false., grid_kind=stats_zt )
     466             : 
     467           0 :         k = k + 1
     468             : 
     469             :       case ('rcm')
     470           0 :         stats_metadata%ircm = k
     471             :         call stat_assign( var_index=stats_metadata%ircm, var_name="rcm", &
     472             :              var_description="rcm, Cloud water mixing ratio", var_units="kg/kg", &
     473           0 :              l_silhs=.false., grid_kind=stats_zt )
     474           0 :         k = k + 1
     475             : 
     476             :       case ('rfrzm')
     477           0 :         stats_metadata%irfrzm = k
     478             :         call stat_assign( var_index=stats_metadata%irfrzm, var_name="rfrzm", &
     479             :              var_description="rfrzm, Total ice phase water mixing ratio", var_units="kg/kg", &
     480           0 :              l_silhs=.false., grid_kind=stats_zt )
     481           0 :         k = k + 1
     482             : 
     483             :       case ('rvm')
     484           0 :         stats_metadata%irvm = k
     485             :         call stat_assign( var_index=stats_metadata%irvm, var_name="rvm", &
     486             :              var_description="rvm, Vapor water mixing ratio", var_units="kg/kg", &
     487           0 :              l_silhs=.false., grid_kind=stats_zt )
     488           0 :         k = k + 1
     489             :       case ('rel_humidity')
     490           0 :         stats_metadata%irel_humidity = k
     491             :         call stat_assign( var_index=stats_metadata%irel_humidity, var_name="rel_humidity", &
     492             :              var_description="rel_humidity, Relative humidity w.r.t. liquid (between 0 and 1)", &
     493           0 :              var_units="[-]", l_silhs=.false., grid_kind=stats_zt )
     494           0 :         k = k + 1
     495             :       case ('um')
     496           0 :         stats_metadata%ium = k
     497             :         call stat_assign( var_index=stats_metadata%ium, var_name="um", &
     498             :              var_description="u_bar, Grid-mean eastward (u) wind", &
     499             :              var_units="m/s", l_silhs=.false., &
     500           0 :              grid_kind=stats_zt )
     501           0 :         k = k + 1
     502             :       case ('vm')
     503           0 :         stats_metadata%ivm = k
     504             :         call stat_assign( var_index=stats_metadata%ivm, var_name="vm", &
     505             :              var_description="v_bar, Grid-mean northward (v) wind", &
     506             :              var_units="m/s", l_silhs=.false., &
     507           0 :              grid_kind=stats_zt )
     508           0 :         k = k + 1
     509             :       case ('wm_zt')
     510           0 :         stats_metadata%iwm_zt = k
     511             :         call stat_assign( var_index=stats_metadata%iwm_zt, var_name="wm", &
     512             :              var_description="w_bar, Grid-mean upward (w) wind", &
     513             :              var_units="m/s", l_silhs=.false., &
     514           0 :              grid_kind=stats_zt )
     515           0 :         k = k + 1
     516             :       case ('um_ref')
     517           0 :         stats_metadata%ium_ref = k
     518             :         call stat_assign( var_index=stats_metadata%ium_ref, var_name="um_ref", &
     519             :              var_description="um_ref, Reference u wind", var_units="m/s", l_silhs=.false., &
     520           0 :              grid_kind=stats_zt )
     521           0 :         k = k + 1
     522             :       case ('vm_ref')
     523           0 :         stats_metadata%ivm_ref = k
     524             :         call stat_assign( var_index=stats_metadata%ivm_ref, var_name="vm_ref", &
     525             :              var_description="vm_ref, Reference v wind", var_units="m/s", l_silhs=.false., &
     526           0 :              grid_kind=stats_zt )
     527           0 :         k = k + 1
     528             :       case ('ug')
     529           0 :         stats_metadata%iug = k
     530             :         call stat_assign( var_index=stats_metadata%iug, var_name="ug", &
     531             :              var_description="ug, u geostrophic wind", var_units="m/s", l_silhs=.false., &
     532           0 :              grid_kind=stats_zt )
     533           0 :         k = k + 1
     534             :       case ('vg')
     535           0 :         stats_metadata%ivg = k
     536             :         call stat_assign( var_index=stats_metadata%ivg, var_name="vg", &
     537             :              var_description="vg, v geostrophic wind", var_units="m/s", l_silhs=.false., &
     538           0 :              grid_kind=stats_zt )
     539           0 :         k = k + 1
     540             :       case ('cloud_frac')
     541           0 :         stats_metadata%icloud_frac = k
     542             :         call stat_assign( var_index=stats_metadata%icloud_frac, var_name="cloud_frac", &
     543             :              var_description="cloud_frac, Cloud fraction (between 0 and 1)", var_units="-", &
     544           0 :              l_silhs=.false., grid_kind=stats_zt )
     545           0 :         k = k + 1
     546             : 
     547             :       case ('ice_supersat_frac')
     548           0 :         stats_metadata%iice_supersat_frac = k
     549             :         call stat_assign( var_index=stats_metadata%iice_supersat_frac, var_name="ice_supersat_frac", &
     550             :              var_description="ice_supersat_frac, Ice cloud fraction (between 0 and 1)", &
     551             :              var_units="count", &
     552           0 :              l_silhs=.false., grid_kind=stats_zt )
     553           0 :         k = k + 1
     554             : 
     555             :       case ('rcm_in_layer')
     556           0 :         stats_metadata%ircm_in_layer = k
     557             :         call stat_assign( var_index=stats_metadata%ircm_in_layer, var_name="rcm_in_layer", &
     558             :              var_description="rcm_in_layer, rcm in cloud layer", &
     559             :              var_units="kg/kg", l_silhs=.false., &
     560           0 :              grid_kind=stats_zt )
     561           0 :         k = k + 1
     562             : 
     563             :       case ('rcm_in_cloud')
     564           0 :         stats_metadata%ircm_in_cloud = k
     565             :         call stat_assign( var_index=stats_metadata%ircm_in_cloud, var_name="rcm_in_cloud", &
     566             :              var_description="rcm_in_cloud, In-cloud value of rcm (for microphysics)", &
     567           0 :              var_units="kg/kg", l_silhs=.false., grid_kind=stats_zt )
     568           0 :         k = k + 1
     569             : 
     570             :       case ('cloud_cover')
     571           0 :         stats_metadata%icloud_cover = k
     572             :         call stat_assign( var_index=stats_metadata%icloud_cover, var_name="cloud_cover", &
     573             :              var_description="cloud_cover, Cloud cover (between 0 and 1)", var_units="count", &
     574           0 :              l_silhs=.false., grid_kind=stats_zt )
     575           0 :         k = k + 1
     576             :       case ('p_in_Pa')
     577           0 :         stats_metadata%ip_in_Pa = k
     578             :         call stat_assign( var_index=stats_metadata%ip_in_Pa, var_name="p_in_Pa", &
     579             :              var_description="p_in_Pa, Pressure", &
     580           0 :              var_units="Pa", l_silhs=.false., grid_kind=stats_zt )
     581           0 :         k = k + 1
     582             :       case ('exner')
     583           0 :         stats_metadata%iexner = k
     584             :         call stat_assign( var_index=stats_metadata%iexner, var_name="exner", &
     585             :              var_description="exner, Exner function = (p/p0)**(rd/cp)", var_units="count", &
     586           0 :              l_silhs=.false., grid_kind=stats_zt )
     587           0 :         k = k + 1
     588             :       case ('rho_ds_zt')
     589           0 :         stats_metadata%irho_ds_zt = k
     590             :         call stat_assign( var_index=stats_metadata%irho_ds_zt, var_name="rho_ds_zt", &
     591             :              var_description="rho_ds_zt, Dry static base-state density", var_units="kg m^{-3}", &
     592           0 :              l_silhs=.false., grid_kind=stats_zt )
     593           0 :         k = k + 1
     594             :       case ('thv_ds_zt')
     595           0 :         stats_metadata%ithv_ds_zt = k
     596             :         call stat_assign( var_index=stats_metadata%ithv_ds_zt, var_name="thv_ds_zt", &
     597             :              var_description="thv_ds_zt, Dry base-state theta_v", &
     598             :              var_units="K", l_silhs=.false., &
     599           0 :              grid_kind=stats_zt )
     600           0 :         k = k + 1
     601             :       case ('Lscale')
     602           0 :         stats_metadata%iLscale = k
     603             :         call stat_assign( var_index=stats_metadata%iLscale, var_name="Lscale", &
     604             :           var_description="L, Turbulent mixing length", &
     605           0 :           var_units="m", l_silhs=.false., grid_kind=stats_zt )
     606           0 :         k = k + 1
     607             :       case ('thlm_forcing')
     608           0 :         stats_metadata%ithlm_forcing = k
     609             :         call stat_assign( var_index=stats_metadata%ithlm_forcing, var_name="thlm_forcing", &
     610             :              var_description="thlm_forcing, thlm budget: thetal forcing " &
     611             :              // "(includes thlm_mc and radht)",&
     612           0 :              var_units="K s^{-1}", l_silhs=.false., grid_kind=stats_zt )
     613           0 :         k = k + 1
     614             :       case ('thlm_mc')
     615           0 :         stats_metadata%ithlm_mc = k
     616             :         call stat_assign( var_index=stats_metadata%ithlm_mc, var_name="thlm_mc", &
     617             :              var_description="thlm_mc, Change in thlm due to microphysics (not in budget)", &
     618           0 :              var_units="K s^{-1}", l_silhs=.false., grid_kind=stats_zt )
     619           0 :         k = k + 1
     620             :       case ('rtm_forcing')
     621           0 :         stats_metadata%irtm_forcing = k
     622             :         call stat_assign( var_index=stats_metadata%irtm_forcing, var_name="rtm_forcing", &
     623             :              var_description="rtm_forcing, rtm budget: rt forcing (includes rtm_mc)", &
     624           0 :              var_units="kg kg^{-1} s^{-1}", l_silhs=.false., grid_kind=stats_zt )
     625           0 :         k = k + 1
     626             : 
     627             :       case ('rtm_mc')
     628           0 :         stats_metadata%irtm_mc = k
     629             :         call stat_assign( var_index=stats_metadata%irtm_mc, var_name="rtm_mc", &
     630             :              var_description="rtm_mc, Change in rt due to microphysics (not in budget)", &
     631           0 :              var_units="kg kg^{-1} s^{-1}", l_silhs=.false., grid_kind=stats_zt )
     632           0 :         k = k + 1
     633             : 
     634             :       case ('rvm_mc')
     635           0 :         stats_metadata%irvm_mc = k
     636             :         call stat_assign( var_index=stats_metadata%irvm_mc, var_name="rvm_mc", &
     637             :              var_description="rvm_mc, Time tendency of vapor mixing ratio due to microphysics", &
     638           0 :              var_units="kg/(kg s)", l_silhs=.false., grid_kind=stats_zt )
     639           0 :         k = k + 1
     640             : 
     641             :       case ('rcm_mc')
     642           0 :         stats_metadata%ircm_mc = k
     643             :         call stat_assign( var_index=stats_metadata%ircm_mc, var_name="rcm_mc", &
     644             :              var_description="rcm_mc, Time tendency of liquid water mixing ratio " &
     645             :              // "due microphysics",&
     646           0 :              var_units="kg/kg/s", l_silhs=.false., grid_kind=stats_zt )
     647           0 :         k = k + 1
     648             : 
     649             :       case ('rcm_sd_mg_morr')
     650           0 :         stats_metadata%ircm_sd_mg_morr = k
     651             :         call stat_assign( var_index=stats_metadata%ircm_sd_mg_morr, var_name="rcm_sd_mg_morr", &
     652             :              var_description="rcm_sd_mg_morr, rcm sedimentation when using morrision or MG " &
     653             :              // "microphysics (not in budget, included in rcm_mc)", &
     654           0 :              var_units="kg kg^{-1} s^{-1}", l_silhs=.true., grid_kind=stats_zt )
     655           0 :         k = k + 1
     656             : 
     657             :       case ('thlm_mfl_min')
     658           0 :         stats_metadata%ithlm_mfl_min = k
     659             :         call stat_assign( var_index=stats_metadata%ithlm_mfl_min, var_name="thlm_mfl_min", &
     660             :              var_description="thlm_mfl_min, Minimum allowable thlm", var_units="K", &
     661             :              l_silhs=.false., &
     662           0 :              grid_kind=stats_zt )
     663           0 :         k = k + 1
     664             : 
     665             :       case ('thlm_mfl_max')
     666           0 :         stats_metadata%ithlm_mfl_max = k
     667             :         call stat_assign( var_index=stats_metadata%ithlm_mfl_max, var_name="thlm_mfl_max", &
     668             :              var_description="thlm_mfl_max, Maximum allowable thlm", var_units="K", &
     669             :              l_silhs=.false., &
     670           0 :              grid_kind=stats_zt )
     671           0 :         k = k + 1
     672             : 
     673             :       case ('thlm_enter_mfl')
     674           0 :         stats_metadata%ithlm_enter_mfl = k
     675             :         call stat_assign( var_index=stats_metadata%ithlm_enter_mfl, var_name="thlm_enter_mfl", &
     676             :              var_description="thlm_enter_mfl, Thlm before flux-limiter", var_units="K", &
     677             :              l_silhs=.false., &
     678           0 :              grid_kind=stats_zt )
     679           0 :         k = k + 1
     680             : 
     681             :       case ('thlm_exit_mfl')
     682           0 :         stats_metadata%ithlm_exit_mfl = k
     683             :         call stat_assign( var_index=stats_metadata%ithlm_exit_mfl, var_name="thlm_exit_mfl", &
     684             :              var_description="thlm_exit_mfl, Thlm exiting flux-limiter", var_units="K", &
     685             :              l_silhs=.false., &
     686           0 :              grid_kind=stats_zt )
     687           0 :         k = k + 1
     688             : 
     689             :       case ('thlm_old')
     690           0 :         stats_metadata%ithlm_old = k
     691             :         call stat_assign( var_index=stats_metadata%ithlm_old, var_name="thlm_old", &
     692             :              var_description="thlm_old, Thlm at previous timestep", var_units="K", &
     693             :              l_silhs=.false., &
     694           0 :              grid_kind=stats_zt )
     695           0 :         k = k + 1
     696             : 
     697             :       case ('thlm_without_ta')
     698           0 :         stats_metadata%ithlm_without_ta = k
     699             :         call stat_assign( var_index=stats_metadata%ithlm_without_ta, var_name="thlm_without_ta", &
     700             :              var_description="thlm_without_ta, Thlm without turbulent advection contribution", &
     701             :              var_units="K", &
     702           0 :              l_silhs=.false., grid_kind=stats_zt )
     703           0 :         k = k + 1
     704             : 
     705             :       case ('rtm_mfl_min')
     706           0 :         stats_metadata%irtm_mfl_min = k
     707             :         call stat_assign( var_index=stats_metadata%irtm_mfl_min, var_name="rtm_mfl_min", &
     708             :              var_description="rtm_mfl_min, Minimum allowable rtm", var_units="kg/kg", &
     709           0 :              l_silhs=.false., grid_kind=stats_zt )
     710           0 :         k = k + 1
     711             : 
     712             :       case ('rtm_mfl_max')
     713           0 :         stats_metadata%irtm_mfl_max = k
     714             :         call stat_assign( var_index=stats_metadata%irtm_mfl_max, var_name="rtm_mfl_max", &
     715             :              var_description="rtm_mfl_max, Maximum allowable rtm", var_units="kg/kg", &
     716           0 :              l_silhs=.false., grid_kind=stats_zt )
     717           0 :         k = k + 1
     718             : 
     719             :       case ('rtm_enter_mfl')
     720           0 :         stats_metadata%irtm_enter_mfl = k
     721             :         call stat_assign( var_index=stats_metadata%irtm_enter_mfl, var_name="rtm_enter_mfl", &
     722             :              var_description="rtm_enter_mfl, Rtm before flux-limiter", var_units="kg/kg", &
     723           0 :              l_silhs=.false., grid_kind=stats_zt )
     724           0 :         k = k + 1
     725             : 
     726             :       case ('rtm_exit_mfl')
     727           0 :         stats_metadata%irtm_exit_mfl = k
     728             :         call stat_assign( var_index=stats_metadata%irtm_exit_mfl, var_name="rtm_exit_mfl", &
     729             :              var_description="rtm_exit_mfl, Rtm exiting flux-limiter", var_units="kg/kg", &
     730           0 :              l_silhs=.false., grid_kind=stats_zt )
     731           0 :         k = k + 1
     732             : 
     733             :       case ('rtm_old')
     734           0 :         stats_metadata%irtm_old = k
     735             :         call stat_assign( var_index=stats_metadata%irtm_old, var_name="rtm_old", &
     736             :              var_description="rtm_old, Rtm at previous timestep", var_units="kg/kg", &
     737           0 :              l_silhs=.false., grid_kind=stats_zt )
     738           0 :         k = k + 1
     739             : 
     740             :       case ('rtm_without_ta')
     741           0 :         stats_metadata%irtm_without_ta = k
     742             :         call stat_assign( var_index=stats_metadata%irtm_without_ta, var_name="rtm_without_ta", &
     743             :              var_description="rtm_without_ta, Rtm without turbulent advection contribution", &
     744           0 :              var_units="kg/kg", l_silhs=.false., grid_kind=stats_zt )
     745           0 :         k = k + 1
     746             : 
     747             :       case ('wp3')
     748           0 :         stats_metadata%iwp3 = k
     749             :         call stat_assign( var_index=stats_metadata%iwp3, var_name="wp3", &
     750             :              var_description="w'^3, Third-order moment of vertical air velocity", &
     751             :              var_units="m^3/s^3", &
     752           0 :              l_silhs=.false., grid_kind=stats_zt )
     753           0 :         k = k + 1
     754             : 
     755             :       case ('wpup2')
     756           0 :         stats_metadata%iwpup2 = k
     757             :         call stat_assign( var_index=stats_metadata%iwpup2, var_name="wpup2", &
     758             :              var_description="w'u'^2, Third-order moment from PDF", &
     759             :              var_units="m^3/s^3", &
     760           0 :              l_silhs=.false., grid_kind=stats_zt )
     761           0 :         k = k + 1
     762             : 
     763             :       case ('wpvp2')
     764           0 :         stats_metadata%iwpvp2 = k
     765             :         call stat_assign( var_index=stats_metadata%iwpvp2, var_name="wpvp2", &
     766             :              var_description="w'v'^2, Third-order moment from PDF", &
     767             :              var_units="m^3/s^3", &
     768           0 :              l_silhs=.false., grid_kind=stats_zt )
     769           0 :         k = k + 1
     770             : 
     771             :       case ('thlp3')
     772           0 :         stats_metadata%ithlp3 = k
     773             :         call stat_assign( var_index=stats_metadata%ithlp3, var_name="thlp3", &
     774             :              var_description="thl'^3, Third-order moment of theta_l", var_units="K^3", &
     775           0 :              l_silhs=.false., grid_kind=stats_zt )
     776           0 :         k = k + 1
     777             : 
     778             :       case ('rtp3')
     779           0 :         stats_metadata%irtp3 = k
     780             :         call stat_assign( var_index=stats_metadata%irtp3, var_name="rtp3", &
     781             :              var_description="rt'^3, Third-order moment of total water, rt", var_units="(kg/kg)^3", &
     782           0 :              l_silhs=.false., grid_kind=stats_zt )
     783           0 :         k = k + 1
     784             : 
     785             :       case ('wpthlp2')
     786           0 :         stats_metadata%iwpthlp2 = k
     787             :         call stat_assign( var_index=stats_metadata%iwpthlp2, var_name="wpthlp2", &
     788             :              var_description="w'theta_l'^2, Vertical turbulent flux of theta_l'^2", &
     789             :              var_units="(m K^2)/s", l_silhs=.false., &
     790           0 :              grid_kind=stats_zt )
     791           0 :         k = k + 1
     792             : 
     793             :       case ('wp2thlp')
     794           0 :         stats_metadata%iwp2thlp = k
     795             :         call stat_assign( var_index=stats_metadata%iwp2thlp, var_name="wp2thlp", &
     796             :              var_description="w'^2theta_l', Vertical turbulent flux of w'theta_l'", &
     797             :              var_units="(m^2 K)/s^2", l_silhs=.false., &
     798           0 :              grid_kind=stats_zt )
     799           0 :         k = k + 1
     800             : 
     801             :       case ('wprtp2')
     802           0 :         stats_metadata%iwprtp2 = k
     803             :         call stat_assign( var_index=stats_metadata%iwprtp2, var_name="wprtp2", &
     804             :              var_description="w'rt'^2, Vertical turbulent flux of rt'^2", &
     805             :              var_units="(m kg)/(s kg)", &
     806           0 :              l_silhs=.false., grid_kind=stats_zt )
     807           0 :         k = k + 1
     808             : 
     809             :       case ('wp2rtp')
     810           0 :         stats_metadata%iwp2rtp = k
     811             :         call stat_assign( var_index=stats_metadata%iwp2rtp, var_name="wp2rtp", &
     812             :              var_description="w'^2rt', Vertical turbulent flux of w'rt'", &
     813             :              var_units="(m^2 kg)/(s^2 kg)", &
     814           0 :              l_silhs=.false., grid_kind=stats_zt )
     815           0 :         k = k + 1
     816             : 
     817             :       case ('Lscale_up')
     818           0 :         stats_metadata%iLscale_up = k
     819             :         call stat_assign( var_index=stats_metadata%iLscale_up, var_name="Lscale_up", &
     820             :              var_description="Lscale_up, Upward mixing length", var_units="m", l_silhs=.false., &
     821           0 :              grid_kind=stats_zt )
     822           0 :         k = k + 1
     823             : 
     824             :       case ('Lscale_down')
     825           0 :         stats_metadata%iLscale_down = k
     826             :         call stat_assign( var_index=stats_metadata%iLscale_down, var_name="Lscale_down", &
     827             :              var_description="Lscale_down, Downward mixing length", var_units="m", &
     828             :              l_silhs=.false.,&
     829           0 :              grid_kind=stats_zt )
     830           0 :         k = k + 1
     831             : 
     832             :       case ('Lscale_pert_1')
     833           0 :         stats_metadata%iLscale_pert_1 = k
     834             :         call stat_assign( var_index=stats_metadata%iLscale_pert_1, var_name="Lscale_pert_1", &
     835             :              var_description="Lscale_pert_1, Mixing length using a perturbed value of rtm/thlm", &
     836           0 :              var_units="m", l_silhs=.false., grid_kind=stats_zt )
     837           0 :         k = k + 1
     838             : 
     839             :       case ('Lscale_pert_2')
     840           0 :         stats_metadata%iLscale_pert_2 = k
     841             :         call stat_assign( var_index=stats_metadata%iLscale_pert_2, var_name="Lscale_pert_2", &
     842             :              var_description="Lscale_pert_2, Mixing length using a perturbed value of rtm/thlm", &
     843           0 :              var_units="m", l_silhs=.false., grid_kind=stats_zt )
     844           0 :         k = k + 1
     845             : 
     846             :       case ('tau_zt')
     847           0 :         stats_metadata%itau_zt = k
     848             :         call stat_assign( var_index=stats_metadata%itau_zt, var_name="tau_zt", &
     849             :              var_description="tau_zt, Dissipation time", var_units="s", l_silhs=.false., &
     850           0 :              grid_kind=stats_zt )
     851           0 :         k = k + 1
     852             : 
     853             :       case ('invrs_tau_zt')
     854           0 :         stats_metadata%iinvrs_tau_zt = k
     855             :         call stat_assign( var_index=stats_metadata%iinvrs_tau_zt, var_name="invrs_tau_zt", &
     856             :              var_description="invrs_tau_zt, Inverse of dissipation time", var_units="s^-1", & 
     857           0 :              l_silhs=.false., grid_kind=stats_zt )
     858           0 :         k = k + 1
     859             : 
     860             :       case ('Kh_zt')
     861           0 :         stats_metadata%iKh_zt = k
     862             :         call stat_assign( var_index=stats_metadata%iKh_zt, var_name="Kh_zt", &
     863             :              var_description="Kh_zt, Eddy diffusivity", var_units="m^2/s", l_silhs=.false., &
     864           0 :              grid_kind=stats_zt )
     865           0 :         k = k + 1
     866             : 
     867             :       case ('wp2thvp')
     868           0 :         stats_metadata%iwp2thvp = k
     869             :         call stat_assign( var_index=stats_metadata%iwp2thvp, var_name="wp2thvp", &
     870             :              var_description="w'^2theta_v', Vertical turbulent flux of w'theta_v'", &
     871             :              var_units="K m^2/s^2", l_silhs=.false., &
     872           0 :              grid_kind=stats_zt )
     873           0 :         k = k + 1
     874             : 
     875             :       case ('wp2rcp')
     876           0 :         stats_metadata%iwp2rcp = k
     877             :         call stat_assign( var_index=stats_metadata%iwp2rcp, var_name="wp2rcp", &
     878             :              var_description="w'^2rc'", var_units="(m^2 kg)/(s^2 kg)", &
     879           0 :              l_silhs=.false., grid_kind=stats_zt )
     880           0 :         k = k + 1
     881             :         
     882             :       case ('w_up_in_cloud')
     883           0 :         stats_metadata%iw_up_in_cloud = k
     884             :         call stat_assign( var_index=stats_metadata%iw_up_in_cloud, var_name="w_up_in_cloud", &
     885             :              var_description="Mean W in saturated updrafts", &
     886           0 :              var_units="m/s", l_silhs=.false., grid_kind=stats_zt )
     887           0 :          k = k + 1
     888             : 
     889             :       case ('w_down_in_cloud')
     890           0 :         stats_metadata%iw_down_in_cloud = k
     891             :         call stat_assign( var_index=stats_metadata%iw_down_in_cloud, var_name="w_down_in_cloud", &
     892             :              var_description="Mean W in saturated downdrafts", &
     893           0 :              var_units="m/s", l_silhs=.false., grid_kind=stats_zt )
     894           0 :          k = k + 1
     895             : 
     896             :       case ('cld_updr_frac')
     897           0 :         stats_metadata%icld_updr_frac = k
     898             :         call stat_assign( var_index=stats_metadata%icld_updr_frac, var_name="cld_updr_frac", &
     899             :              var_description="Cloudy Updraft Fraction", &
     900           0 :              var_units="-", l_silhs=.false., grid_kind=stats_zt )
     901           0 :          k = k + 1
     902             : 
     903             :       case ('cld_downdr_frac')
     904           0 :         stats_metadata%icld_downdr_frac = k
     905             :         call stat_assign( var_index=stats_metadata%icld_downdr_frac, var_name="cld_downdr_frac", &
     906             :              var_description="Cloudy Downdraft Fraction", &
     907           0 :              var_units="-", l_silhs=.false., grid_kind=stats_zt )
     908           0 :          k = k + 1
     909             : 
     910             :       case ('wprtpthlp')
     911           0 :         stats_metadata%iwprtpthlp = k
     912             :         call stat_assign( var_index=stats_metadata%iwprtpthlp, var_name="wprtpthlp", &
     913             :              var_description="w'rt'theta_l', Vertical turbulent flux of rt'theta_l'", &
     914             :              var_units="(m kg K)/(s kg)", &
     915           0 :              l_silhs=.false., grid_kind=stats_zt )
     916           0 :         k = k + 1
     917             : 
     918             :       case ('rc_coef')
     919           0 :         stats_metadata%irc_coef = k
     920             :         call stat_assign( var_index=stats_metadata%irc_coef, var_name="rc_coef", &
     921             :              var_description="rc_coef, Coefficient of X'r_c'", &
     922           0 :              var_units="K/(kg/kg)", l_silhs=.false., grid_kind=stats_zt )
     923           0 :         k = k + 1
     924             : 
     925             :       case ('sigma_sqd_w_zt')
     926           0 :         stats_metadata%isigma_sqd_w_zt = k
     927             :         call stat_assign( var_index=stats_metadata%isigma_sqd_w_zt, var_name="sigma_sqd_w_zt", &
     928             :              var_description="sigma_sqd_w_zt, Nondimensionalized w variance of " &
     929             :              // "Gaussian component",&
     930           0 :              var_units="-", l_silhs=.false., grid_kind=stats_zt )
     931           0 :         k = k + 1
     932             : 
     933             :       case ('rho')
     934           0 :         stats_metadata%irho = k
     935             :         call stat_assign( var_index=stats_metadata%irho, var_name="rho", var_description="rho, Air density", &
     936           0 :              var_units="kg m^{-3}", l_silhs=.false., grid_kind=stats_zt )
     937           0 :         k = k + 1
     938             : 
     939             :       case ('Ncm')           ! Brian
     940           0 :         stats_metadata%iNcm = k
     941             :         call stat_assign( var_index=stats_metadata%iNcm, var_name="Ncm", &
     942             :              var_description="Ncm, Cloud droplet number concentration", var_units="num/kg", &
     943           0 :              l_silhs=.false., grid_kind=stats_zt )
     944           0 :         k = k + 1
     945             : 
     946             :       case ('Nc_in_cloud')
     947           0 :         stats_metadata%iNc_in_cloud = k
     948             : 
     949             :         call stat_assign( var_index=stats_metadata%iNc_in_cloud, var_name="Nc_in_cloud", &
     950             :              var_description="Nc_in_cloud, In cloud droplet concentration", var_units="num/kg", &
     951           0 :              l_silhs=.false., grid_kind=stats_zt )
     952             : 
     953           0 :         k = k + 1
     954             : 
     955             :       case ('Nc_activated')
     956           0 :         stats_metadata%iNc_activated = k
     957             : 
     958             :         call stat_assign( var_index=stats_metadata%iNc_activated, var_name="Nc_activated", &
     959             :              var_description="Nc_activated, Droplets activated by GFDL activation", &
     960           0 :              var_units="num/kg", l_silhs=.false., grid_kind=stats_zt )
     961             : 
     962           0 :         k = k + 1
     963             : 
     964             :       case ('Nccnm')
     965           0 :         stats_metadata%iNccnm = k
     966             :         call stat_assign( var_index=stats_metadata%iNccnm, var_name="Nccnm", &
     967             :              var_description="Nccnm, Cloud condensation nuclei concentration", &
     968           0 :              var_units="num/kg", l_silhs=.false., grid_kind=stats_zt )
     969           0 :         k = k + 1
     970             : 
     971             :       case ('Nim')           ! Brian
     972           0 :         stats_metadata%iNim = k
     973             :         call stat_assign( var_index=stats_metadata%iNim, var_name="Nim", &
     974             :              var_description="Nim, Ice crystal number concentration", var_units="num/kg", &
     975           0 :              l_silhs=.false., grid_kind=stats_zt )
     976           0 :         k = k + 1
     977             : 
     978             :       case ('snowslope')     ! Adam Smith, 22 April 2008
     979           0 :         stats_metadata%isnowslope = k
     980             :         call stat_assign( var_index=stats_metadata%isnowslope, var_name="snowslope", &
     981             :              var_description="snowslope, COAMPS microphysics snow slope parameter", &
     982             :              var_units="1/m", &
     983           0 :              l_silhs=.false., grid_kind=stats_zt )
     984           0 :         k = k + 1
     985             : 
     986             :       case ('Nsm')        ! Adam Smith, 22 April 2008
     987           0 :         stats_metadata%iNsm = k
     988             :         call stat_assign( var_index=stats_metadata%iNsm, var_name="Nsm", &
     989             :              var_description="Nsm, Snow particle number concentration", var_units="num/kg", &
     990           0 :              l_silhs=.false., grid_kind=stats_zt )
     991           0 :         k = k + 1
     992             : 
     993             :       case ('Ngm')
     994           0 :         stats_metadata%iNgm = k
     995             :         call stat_assign( var_index=stats_metadata%iNgm, var_name="Ngm", &
     996             :              var_description="Ngm, Graupel number concentration", var_units="num/kg", &
     997           0 :              l_silhs=.false., grid_kind=stats_zt )
     998           0 :         k = k + 1
     999             : 
    1000             :       case ('sed_rcm')       ! Brian
    1001           0 :         stats_metadata%ised_rcm = k
    1002             :         call stat_assign( var_index=stats_metadata%ised_rcm, var_name="sed_rcm", &
    1003             :              var_description="sed_rcm, d(rcm)/dt due to cloud sedimentation", &
    1004           0 :              var_units="kg / [m^2 s]", l_silhs=.false., grid_kind=stats_zt )
    1005           0 :         k = k + 1
    1006             : 
    1007             :       case ('rsat')           ! Brian
    1008           0 :         stats_metadata%irsat = k
    1009             :         call stat_assign( var_index=stats_metadata%irsat, var_name="rsat", &
    1010             :              var_description="rsat, Saturation mixing ratio over liquid", var_units="kg/kg", &
    1011           0 :              l_silhs=.false., grid_kind=stats_zt )
    1012           0 :         k = k + 1
    1013             : 
    1014             :       case ('rsati')
    1015           0 :         stats_metadata%irsati = k
    1016             :         call stat_assign( var_index=stats_metadata%irsati, var_name="rsati", &
    1017             :              var_description="rsati, Saturation mixing ratio over ice", var_units="kg/kg", &
    1018           0 :              l_silhs=.false., grid_kind=stats_zt )
    1019           0 :         k = k + 1
    1020             : 
    1021             :       case ('rrm')           ! Brian
    1022           0 :         stats_metadata%irrm = k
    1023             :         call stat_assign( var_index=stats_metadata%irrm, var_name="rrm", &
    1024             :              var_description="rrm, Rain water mixing ratio", var_units="kg/kg", &
    1025           0 :              l_silhs=.false., grid_kind=stats_zt )
    1026           0 :         k = k + 1
    1027             : 
    1028             :       case ('rsm')
    1029           0 :         stats_metadata%irsm = k
    1030             :         call stat_assign( var_index=stats_metadata%irsm, var_name="rsm", &
    1031             :              var_description="rsm, Snow water mixing ratio", var_units="kg/kg", &
    1032           0 :              l_silhs=.false., grid_kind=stats_zt )
    1033           0 :         k = k + 1
    1034             : 
    1035             :       case ('rim')
    1036           0 :         stats_metadata%irim = k
    1037             :         call stat_assign( var_index=stats_metadata%irim, var_name="rim", &
    1038             :              var_description="rim, Pristine ice water mixing ratio", var_units="kg/kg", &
    1039           0 :              l_silhs=.false., grid_kind=stats_zt )
    1040           0 :         k = k + 1
    1041             : 
    1042             :       case ('rgm')
    1043           0 :         stats_metadata%irgm = k
    1044             :         call stat_assign( var_index=stats_metadata%irgm, var_name="rgm", &
    1045             :              var_description="rgm, Graupel water mixing ratio", var_units="kg/kg", &
    1046           0 :              l_silhs=.false., grid_kind=stats_zt )
    1047           0 :         k = k + 1
    1048             : 
    1049             :       case ('Nrm')           ! Brian
    1050           0 :         stats_metadata%iNrm = k
    1051             :         call stat_assign( var_index=stats_metadata%iNrm, var_name="Nrm", &
    1052             :              var_description="Nrm, Rain drop number concentration", var_units="num/kg", &
    1053           0 :              l_silhs=.false., grid_kind=stats_zt )
    1054           0 :         k = k + 1
    1055             : 
    1056             :       case ('m_vol_rad_rain')  ! Brian
    1057           0 :         stats_metadata%im_vol_rad_rain = k
    1058             :         call stat_assign( var_index=stats_metadata%im_vol_rad_rain, var_name="mvrr", &
    1059             :              var_description="mvrr, Rain drop mean volume radius", &
    1060             :              var_units="m", l_silhs=.false.,&
    1061           0 :              grid_kind=stats_zt )
    1062           0 :         k = k + 1
    1063             : 
    1064             :       case ('m_vol_rad_cloud')
    1065           0 :         stats_metadata%im_vol_rad_cloud = k
    1066             :         call stat_assign( var_index=stats_metadata%im_vol_rad_cloud, var_name="m_vol_rad_cloud", &
    1067             :              var_description="m_vol_rad_cloud, Cloud drop mean volume radius", var_units="m", &
    1068             :              l_silhs=.false., &
    1069           0 :              grid_kind=stats_zt )
    1070           0 :         k = k + 1
    1071             : 
    1072             :       case ('eff_rad_cloud')
    1073           0 :         stats_metadata%ieff_rad_cloud = k
    1074             :         call stat_assign( var_index=stats_metadata%ieff_rad_cloud, var_name="eff_rad_cloud", &
    1075             :              var_description="eff_rad_cloud, Cloud drop effective volume radius", &
    1076             :              var_units="microns", &
    1077           0 :              l_silhs=.false., grid_kind=stats_zt )
    1078           0 :         k = k + 1
    1079             : 
    1080             :       case ('eff_rad_ice')
    1081           0 :         stats_metadata%ieff_rad_ice = k
    1082             : 
    1083             :         call stat_assign( var_index=stats_metadata%ieff_rad_ice, var_name="eff_rad_ice", &
    1084             :              var_description="eff_rad_ice, Ice effective volume radius", var_units="microns", &
    1085           0 :              l_silhs=.false., grid_kind=stats_zt )
    1086           0 :         k = k + 1
    1087             : 
    1088             :       case ('eff_rad_snow')
    1089           0 :         stats_metadata%ieff_rad_snow = k
    1090             :         call stat_assign( var_index=stats_metadata%ieff_rad_snow, var_name="eff_rad_snow", &
    1091             :              var_description="eff_rad_snow, Snow effective volume radius", &
    1092             :              var_units="microns", &
    1093           0 :              l_silhs=.false., grid_kind=stats_zt )
    1094           0 :         k = k + 1
    1095             : 
    1096             :       case ('eff_rad_rain')
    1097           0 :         stats_metadata%ieff_rad_rain = k
    1098             :         call stat_assign( var_index=stats_metadata%ieff_rad_rain, var_name="eff_rad_rain", &
    1099             :              var_description="eff_rad_rain, Rain drop effective volume radius", &
    1100             :              var_units="microns", &
    1101           0 :              l_silhs=.false., grid_kind=stats_zt )
    1102           0 :         k = k + 1
    1103             : 
    1104             :       case ('eff_rad_graupel')
    1105           0 :         stats_metadata%ieff_rad_graupel = k
    1106             :         call stat_assign( var_index=stats_metadata%ieff_rad_graupel, var_name="eff_rad_graupel", &
    1107             :              var_description="eff_rad_graupel, Graupel effective volume radius", &
    1108             :              var_units="microns", &
    1109           0 :              l_silhs=.false., grid_kind=stats_zt )
    1110           0 :         k = k + 1
    1111             : 
    1112             :       case ('precip_rate_zt')     ! Brian
    1113           0 :         stats_metadata%iprecip_rate_zt = k
    1114             : 
    1115             :         call stat_assign( var_index=stats_metadata%iprecip_rate_zt, var_name="precip_rate_zt", &
    1116             :              var_description="precip_rate_zt, Rain rate", var_units="mm/day", l_silhs=.false., &
    1117           0 :              grid_kind=stats_zt )
    1118           0 :         k = k + 1
    1119             : 
    1120             :       case ('radht')
    1121           0 :         stats_metadata%iradht = k
    1122             : 
    1123             :         call stat_assign( var_index=stats_metadata%iradht, var_name="radht", &
    1124             :              var_description="radht, Total (sw+lw) radiative heating rate", var_units="K/s", &
    1125           0 :              l_silhs=.false., grid_kind=stats_zt )
    1126           0 :         k = k + 1
    1127             : 
    1128             :       case ('radht_LW')
    1129           0 :         stats_metadata%iradht_LW = k
    1130             : 
    1131             :         call stat_assign( var_index=stats_metadata%iradht_LW, var_name="radht_LW", &
    1132             :              var_description="radht_LW, Long-wave radiative heating rate", var_units="K/s", &
    1133           0 :              l_silhs=.false., grid_kind=stats_zt )
    1134             : 
    1135           0 :         k = k + 1
    1136             : 
    1137             :       case ('radht_SW')
    1138           0 :         stats_metadata%iradht_SW = k
    1139             :         call stat_assign( var_index=stats_metadata%iradht_SW, var_name="radht_SW", &
    1140             :              var_description="radht_SW, Short-wave radiative heating rate", var_units="K/s", &
    1141           0 :              l_silhs=.false., grid_kind=stats_zt )
    1142           0 :         k = k + 1
    1143             : 
    1144             :       case ('diam')
    1145           0 :         stats_metadata%idiam = k
    1146             : 
    1147             :         call stat_assign( var_index=stats_metadata%idiam, var_name="diam", &
    1148             :              var_description="diam, Ice crystal diameter", var_units="m", l_silhs=.false., &
    1149           0 :              grid_kind=stats_zt )
    1150           0 :         k = k + 1
    1151             : 
    1152             :       case ('mass_ice_cryst')
    1153           0 :         stats_metadata%imass_ice_cryst = k
    1154             :         call stat_assign( var_index=stats_metadata%imass_ice_cryst, var_name="mass_ice_cryst", &
    1155             :              var_description="mass_ice_cryst, Mass of a single ice crystal", var_units="kg", &
    1156           0 :              l_silhs=.false., grid_kind=stats_zt )
    1157           0 :         k = k + 1
    1158             : 
    1159             :       case ('rcm_icedfs')
    1160           0 :         stats_metadata%ircm_icedfs = k
    1161             :         call stat_assign( var_index=stats_metadata%ircm_icedfs, var_name="rcm_icedfs", &
    1162             :              var_description="rcm_icedfs, Change in liquid due to ice", var_units="kg/kg/s", &
    1163           0 :              l_silhs=.false., grid_kind=stats_zt )
    1164           0 :         k = k + 1
    1165             : 
    1166             :       case ('u_T_cm')
    1167           0 :         stats_metadata%iu_T_cm = k
    1168             :         call stat_assign( var_index=stats_metadata%iu_T_cm, var_name="u_T_cm", &
    1169             :              var_description="u_T_cm, Ice crystal fallspeed", var_units="cm s^{-1}", &
    1170           0 :              l_silhs=.false., grid_kind=stats_zt )
    1171           0 :         k = k + 1
    1172             : 
    1173             :       case ('rtm_bt')
    1174           0 :         stats_metadata%irtm_bt = k
    1175             : 
    1176             :         call stat_assign( var_index=stats_metadata%irtm_bt, var_name="rtm_bt", &
    1177             :              var_description="rtm_bt, rtm budget: rtm time tendency", &
    1178           0 :              var_units="kg kg^{-1} s^{-1}", l_silhs=.false., grid_kind=stats_zt )
    1179           0 :         k = k + 1
    1180             : 
    1181             :       case ('rtm_ma')
    1182           0 :         stats_metadata%irtm_ma = k
    1183             : 
    1184             :         call stat_assign( var_index=stats_metadata%irtm_ma, var_name="rtm_ma", &
    1185             :              var_description="rtm_ma, rtm budget: rtm vertical mean advection", &
    1186           0 :              var_units="kg kg^{-1} s^{-1}", l_silhs=.false., grid_kind=stats_zt )
    1187           0 :         k = k + 1
    1188             : 
    1189             :       case ('rtm_ta')
    1190           0 :         stats_metadata%irtm_ta = k
    1191             : 
    1192             :         call stat_assign( var_index=stats_metadata%irtm_ta, var_name="rtm_ta", &
    1193             :              var_description="rtm_ta, rtm budget: rtm turbulent advection", &
    1194           0 :              var_units="kg kg^{-1} s^{-1}", l_silhs=.false., grid_kind=stats_zt )
    1195           0 :         k = k + 1
    1196             : 
    1197             :       case ('rtm_mfl')
    1198           0 :         stats_metadata%irtm_mfl = k
    1199             : 
    1200             :         call stat_assign( var_index=stats_metadata%irtm_mfl, var_name="rtm_mfl", &
    1201             :          var_description="rtm_mfl, rtm budget: rtm correction due to monotonic flux limiter", &
    1202           0 :          var_units="kg kg^{-1} s^{-1}", l_silhs=.false., grid_kind=stats_zt)
    1203           0 :         k = k + 1
    1204             : 
    1205             :       case ('rtm_tacl')
    1206           0 :         stats_metadata%irtm_tacl = k
    1207             : 
    1208             :         call stat_assign( var_index=stats_metadata%irtm_tacl, var_name="rtm_tacl", &
    1209             :           var_description="rtm_tacl, rtm budget: rtm correction due to ta term" &
    1210             :           // " (wprtp) clipping", &
    1211           0 :           var_units="kg kg^{-1} s^{-1}", l_silhs=.false., grid_kind=stats_zt)
    1212             : 
    1213           0 :         k = k + 1
    1214             : 
    1215             :       case ('rtm_cl')
    1216           0 :         stats_metadata%irtm_cl = k
    1217             : 
    1218             :         call stat_assign( var_index=stats_metadata%irtm_cl, var_name="rtm_cl", &
    1219             :              var_description="rtm_cl, rtm budget: rtm clipping", &
    1220           0 :              var_units="kg kg^{-1} s^{-1}", l_silhs=.false., grid_kind=stats_zt )
    1221             : 
    1222           0 :         k = k + 1
    1223             :       case ('rtm_sdmp')
    1224           0 :         stats_metadata%irtm_sdmp = k
    1225             : 
    1226             :         call stat_assign( var_index=stats_metadata%irtm_sdmp, var_name="rtm_sdmp", &
    1227             :              var_description="rtm_sdmp, rtm budget: rtm correction due to sponge damping", &
    1228           0 :              var_units="kg kg^{-1} s^{-1}", l_silhs=.false., grid_kind=stats_zt )
    1229           0 :         k = k + 1
    1230             : 
    1231             : 
    1232             :       case ('rtm_pd')
    1233           0 :         stats_metadata%irtm_pd = k
    1234             : 
    1235             :         call stat_assign( var_index=stats_metadata%irtm_pd, var_name="rtm_pd", &
    1236             :              var_description="rtm_pd, rtm budget: rtm positive definite adjustment", &
    1237           0 :              var_units="kg kg^{-1} s^{-1}", l_silhs=.false., grid_kind=stats_zt )
    1238             : 
    1239           0 :         k = k + 1
    1240             : 
    1241             :       case ('thlm_bt')
    1242           0 :         stats_metadata%ithlm_bt = k
    1243             : 
    1244             :         call stat_assign( var_index=stats_metadata%ithlm_bt, var_name="thlm_bt", &
    1245             :              var_description="thlm_bt, thlm budget: thlm time tendency", var_units="K s^{-1}", &
    1246           0 :              l_silhs=.false., grid_kind=stats_zt )
    1247           0 :         k = k + 1
    1248             : 
    1249             :       case ('thlm_ma')
    1250           0 :         stats_metadata%ithlm_ma = k
    1251             : 
    1252             :         call stat_assign( var_index=stats_metadata%ithlm_ma, var_name="thlm_ma", &
    1253             :              var_description="thlm_ma, thlm budget: thlm vertical mean advection", &
    1254           0 :              var_units="K s^{-1}", l_silhs=.false., grid_kind=stats_zt )
    1255           0 :         k = k + 1
    1256             : 
    1257             :       case ('thlm_sdmp')
    1258           0 :         stats_metadata%ithlm_sdmp = k
    1259             : 
    1260             :         call stat_assign( var_index=stats_metadata%ithlm_sdmp, var_name="thlm_sdmp", &
    1261             :              var_description="thlm_sdmp, thlm budget: thlm correction due to sponge damping", &
    1262           0 :              var_units="K s^{-1}", l_silhs=.false., grid_kind=stats_zt )
    1263           0 :         k = k + 1
    1264             : 
    1265             : 
    1266             :       case ('thlm_ta')
    1267           0 :         stats_metadata%ithlm_ta = k
    1268             : 
    1269             :         call stat_assign( var_index=stats_metadata%ithlm_ta, var_name="thlm_ta", &
    1270             :              var_description="thlm_ta, thlm budget: thlm turbulent advection", &
    1271           0 :              var_units="K s^{-1}", l_silhs=.false., grid_kind=stats_zt )
    1272           0 :         k = k + 1
    1273             : 
    1274             :       case ('thlm_mfl')
    1275           0 :         stats_metadata%ithlm_mfl = k
    1276             : 
    1277             :         call stat_assign( var_index=stats_metadata%ithlm_mfl, var_name="thlm_mfl", &
    1278             :              var_description="thlm_mfl, thlm budget: thlm correction due to monotonic " &
    1279             :              // "flux limiter", &
    1280           0 :              var_units="K s^{-1}", l_silhs=.false., grid_kind=stats_zt )
    1281           0 :         k = k + 1
    1282             : 
    1283             :       case ('thlm_tacl')
    1284           0 :         stats_metadata%ithlm_tacl = k
    1285             : 
    1286             :         call stat_assign( var_index=stats_metadata%ithlm_tacl, var_name="thlm_tacl", &
    1287             :              var_description="thlm_tacl, thlm budget: thlm correction due to ta term " &
    1288             :              // "(wpthlp) clipping", &
    1289           0 :              var_units="K s^{-1}", l_silhs=.false., grid_kind=stats_zt )
    1290           0 :         k = k + 1
    1291             : 
    1292             :       case ('thlm_cl')
    1293           0 :         stats_metadata%ithlm_cl = k
    1294             : 
    1295             :         call stat_assign( var_index=stats_metadata%ithlm_cl, var_name="thlm_cl", &
    1296             :              var_description="thlm_cl, thlm budget: thlm_cl", var_units="K s^{-1}", &
    1297           0 :              l_silhs=.false., grid_kind=stats_zt )
    1298           0 :         k = k + 1
    1299             : 
    1300             :       case ('wp3_bt')
    1301           0 :         stats_metadata%iwp3_bt = k
    1302             : 
    1303             :         call stat_assign( var_index=stats_metadata%iwp3_bt, var_name="wp3_bt", &
    1304             :              var_description="wp3_bt, wp3 budget: wp3 time tendency", &
    1305           0 :              var_units="m^{3} s^{-4}", l_silhs=.false., grid_kind=stats_zt )
    1306           0 :         k = k + 1
    1307             : 
    1308             :       case ('wp3_ma')
    1309           0 :         stats_metadata%iwp3_ma = k
    1310             : 
    1311             :         call stat_assign( var_index=stats_metadata%iwp3_ma, var_name="wp3_ma", &
    1312             :              var_description="wp3_ma, wp3 budget: wp3 vertical mean advection", &
    1313           0 :              var_units="m^{3} s^{-4}", l_silhs=.false., grid_kind=stats_zt )
    1314           0 :         k = k + 1
    1315             : 
    1316             :       case ('wp3_ta')
    1317           0 :         stats_metadata%iwp3_ta = k
    1318             : 
    1319             :         call stat_assign( var_index=stats_metadata%iwp3_ta, var_name="wp3_ta", &
    1320             :              var_description="wp3_ta, wp3 budget: wp3 turbulent advection", &
    1321           0 :              var_units="m^{3} s^{-4}", l_silhs=.false., grid_kind=stats_zt )
    1322             : 
    1323           0 :         k = k + 1
    1324             : 
    1325             :       case ('wp3_tp')
    1326           0 :         stats_metadata%iwp3_tp = k
    1327             :         call stat_assign( var_index=stats_metadata%iwp3_tp, var_name="wp3_tp", &
    1328             :              var_description="wp3_tp, wp3 budget: wp3 turbulent transport", &
    1329           0 :              var_units="m^{3} s^{-4}", l_silhs=.false., grid_kind=stats_zt )
    1330           0 :         k = k + 1
    1331             : 
    1332             :       case ('wp3_ac')
    1333           0 :         stats_metadata%iwp3_ac = k
    1334             :         call stat_assign( var_index=stats_metadata%iwp3_ac, var_name="wp3_ac", &
    1335             :              var_description="wp3_ac, wp3 budget: wp3 accumulation term", &
    1336           0 :              var_units="m^{3} s^{-4}", l_silhs=.false., grid_kind=stats_zt )
    1337           0 :         k = k + 1
    1338             : 
    1339             :       case ('wp3_bp1')
    1340           0 :         stats_metadata%iwp3_bp1 = k
    1341             :         call stat_assign( var_index=stats_metadata%iwp3_bp1, var_name="wp3_bp1", &
    1342             :              var_description="wp3_bp1, wp3 budget: wp3 buoyancy production", &
    1343           0 :              var_units="m^{3} s^{-4}", l_silhs=.false., grid_kind=stats_zt )
    1344           0 :         k = k + 1
    1345             : 
    1346             :       case ('wp3_pr_tp')
    1347           0 :         stats_metadata%iwp3_pr_tp = k
    1348             :         call stat_assign( var_index=stats_metadata%iwp3_pr_tp, var_name="wp3_pr_tp", &
    1349             :              var_description= &
    1350             :                "wp3_pr_tp, wp3 budget: wp3 pressure damping of turbulent production", &
    1351           0 :              var_units="m^{3} s^{-4}", l_silhs=.false., grid_kind=stats_zt )
    1352           0 :         k = k + 1
    1353             : 
    1354             :       case ('wp3_pr_turb')
    1355           0 :         stats_metadata%iwp3_pr_turb = k
    1356             :         call stat_assign( var_index=stats_metadata%iwp3_pr_turb, var_name="wp3_pr_turb", &
    1357             :              var_description="wp3_pr_turb, wp3 budget: wp3 pressure-turbulence correlation term", &
    1358           0 :              var_units="m^{3} s^{-4}", l_silhs=.false., grid_kind=stats_zt )
    1359           0 :         k = k + 1
    1360             : 
    1361             :       case ('wp3_pr_dfsn')
    1362           0 :         stats_metadata%iwp3_pr_dfsn = k
    1363             :         call stat_assign( var_index=stats_metadata%iwp3_pr_dfsn, var_name="wp3_pr_dfsn", &
    1364             :              var_description="wp3_pr_dfsn, wp3 budget: wp3 pressure diffusion term", &
    1365           0 :              var_units="m^{3} s^{-4}", l_silhs=.false., grid_kind=stats_zt )
    1366           0 :         k = k + 1
    1367             : 
    1368             :       case ('wp3_pr1')
    1369           0 :         stats_metadata%iwp3_pr1 = k
    1370             :         call stat_assign( var_index=stats_metadata%iwp3_pr1, var_name="wp3_pr1", &
    1371             :              var_description="wp3_pr1, wp3 budget: wp3 pressure term 1", &
    1372           0 :              var_units="m^{3} s^{-4}", l_silhs=.false., grid_kind=stats_zt )
    1373           0 :         k = k + 1
    1374             : 
    1375             :       case ('wp3_pr2')
    1376           0 :         stats_metadata%iwp3_pr2 = k
    1377             :         call stat_assign( var_index=stats_metadata%iwp3_pr2, var_name="wp3_pr2", &
    1378             :              var_description="wp3_pr2, wp3 budget: wp3 pressure term 2", &
    1379           0 :              var_units="m^{3} s^{-4}", l_silhs=.false., grid_kind=stats_zt )
    1380             : 
    1381           0 :         k = k + 1
    1382             : 
    1383             :       case ('wp3_pr3')
    1384           0 :         stats_metadata%iwp3_pr3 = k
    1385             :         call stat_assign( var_index=stats_metadata%iwp3_pr3, var_name="wp3_pr3", &
    1386             :              var_description="wp3_pr3, wp3 budget: wp3 pressure term 3", &
    1387           0 :              var_units="m^{3} s^{-4}", l_silhs=.false., grid_kind=stats_zt )
    1388             : 
    1389           0 :         k = k + 1
    1390             : 
    1391             :       case ('wp3_dp1')
    1392           0 :         stats_metadata%iwp3_dp1 = k
    1393             :         call stat_assign( var_index=stats_metadata%iwp3_dp1, var_name="wp3_dp1", &
    1394             :              var_description="wp3_dp1, wp3 budget: wp3 dissipation term 1", &
    1395           0 :              var_units="m^{3} s^{-4}", l_silhs=.false., grid_kind=stats_zt )
    1396           0 :         k = k + 1
    1397             : 
    1398             :       case ('wp3_sdmp')
    1399           0 :         stats_metadata%iwp3_sdmp = k
    1400             :         call stat_assign( var_index=stats_metadata%iwp3_sdmp, var_name="wp3_sdmp", &
    1401             :              var_description="wp3_sdmp, wp3 budget: wp3 sponge damping term", &
    1402           0 :              var_units="m^{3} s^{-4}", l_silhs=.false., grid_kind=stats_zt )
    1403           0 :         k = k + 1
    1404             : 
    1405             :       case ('wp3_cl')
    1406           0 :         stats_metadata%iwp3_cl = k
    1407             :         call stat_assign( var_index=stats_metadata%iwp3_cl, var_name="wp3_cl", &
    1408             :              var_description="wp3_cl, wp3 budget: wp3 clipping term", &
    1409           0 :              var_units="m^{3} s^{-4}", l_silhs=.false., grid_kind=stats_zt )
    1410           0 :         k = k + 1
    1411             : 
    1412             :       case ('wp3_splat')
    1413           0 :         stats_metadata%iwp3_splat = k
    1414             :         call stat_assign( var_index=stats_metadata%iwp3_splat, var_name="wp3_splat", &
    1415             :              var_description="wp3_splat, wp3 budget: wp3 splatting term", &
    1416           0 :              var_units="m^3 s^-4", l_silhs=.false., grid_kind=stats_zt )
    1417           0 :         k = k + 1
    1418             : 
    1419             :       case ('rtp3_bt')
    1420           0 :         stats_metadata%irtp3_bt = k
    1421             : 
    1422             :         call stat_assign( var_index=stats_metadata%irtp3_bt, var_name="rtp3_bt", &
    1423             :              var_description="rtp3_bt, rtp3 budget: rtp3 time tendency" &
    1424             :                              // "[kg^{3} kg^{-3} s^{-1}]", &
    1425             :              var_units="kg^{3} kg^{-3} s^{-1}", l_silhs=.false., &
    1426           0 :              grid_kind=stats_zt )
    1427           0 :         k = k + 1
    1428             : 
    1429             :       case ('rtp3_tp')
    1430           0 :         stats_metadata%irtp3_tp = k
    1431             : 
    1432             :         call stat_assign( var_index=stats_metadata%irtp3_tp, var_name="rtp3_tp", &
    1433             :              var_description="rtp3_tp, rtp3 budget: rtp3 turbulent production" &
    1434             :                              // "[kg^{3} kg^{-3} s^{-1}]", &
    1435             :              var_units="kg^{3} kg^{-3} s^{-1}", l_silhs=.false., &
    1436           0 :              grid_kind=stats_zt )
    1437           0 :         k = k + 1
    1438             : 
    1439             :       case ('rtp3_ac')
    1440           0 :         stats_metadata%irtp3_ac = k
    1441             : 
    1442             :         call stat_assign( var_index=stats_metadata%irtp3_ac, var_name="rtp3_ac", &
    1443             :              var_description="rtp3_ac, rtp3 budget: rtp3 accumulation" &
    1444             :                              // "[kg^{3} kg^{-3} s^{-1}]", &
    1445             :              var_units="kg^{3} kg^{-3} s^{-1}", l_silhs=.false., &
    1446           0 :              grid_kind=stats_zt )
    1447           0 :         k = k + 1
    1448             : 
    1449             :       case ('rtp3_dp')
    1450           0 :         stats_metadata%irtp3_dp = k
    1451             : 
    1452             :         call stat_assign( var_index=stats_metadata%irtp3_dp, var_name="rtp3_dp", &
    1453             :              var_description="rtp3_dp, rtp3 budget: rtp3 dissipation" &
    1454             :                              // "[kg^{3} kg^{-3} s^{-1}]", &
    1455             :              var_units="kg^{3} kg^{-3} s^{-1}", l_silhs=.false., &
    1456           0 :              grid_kind=stats_zt )
    1457           0 :         k = k + 1
    1458             : 
    1459             :       case ('thlp3_bt')
    1460           0 :         stats_metadata%ithlp3_bt = k
    1461             : 
    1462             :         call stat_assign( var_index=stats_metadata%ithlp3_bt, var_name="thlp3_bt", &
    1463             :              var_description="thlp3_bt, thlp3 budget: thlp3 time tendency" &
    1464             :                              // "[K^{3} s^{-1}]", &
    1465           0 :              var_units="K^{3} s^{-1}", l_silhs=.false., grid_kind=stats_zt )
    1466           0 :         k = k + 1
    1467             : 
    1468             :       case ('thlp3_tp')
    1469           0 :         stats_metadata%ithlp3_tp = k
    1470             : 
    1471             :         call stat_assign( var_index=stats_metadata%ithlp3_tp, var_name="thlp3_tp", &
    1472             :              var_description="thlp3_tp, thlp3 budget: thlp3 turbulent production" &
    1473             :                              // "[K^{3} s^{-1}]", &
    1474           0 :              var_units="K^{3} s^{-1}", l_silhs=.false., grid_kind=stats_zt )
    1475           0 :         k = k + 1
    1476             : 
    1477             :       case ('thlp3_ac')
    1478           0 :         stats_metadata%ithlp3_ac = k
    1479             : 
    1480             :         call stat_assign( var_index=stats_metadata%ithlp3_ac, var_name="thlp3_ac", &
    1481             :              var_description="thlp3_ac, thlp3 budget: thlp3 accumulation" &
    1482             :                              // "[K^{3} s^{-1}]", &
    1483           0 :              var_units="K^{3} s^{-1}", l_silhs=.false., grid_kind=stats_zt )
    1484           0 :         k = k + 1
    1485             : 
    1486             :       case ('thlp3_dp')
    1487           0 :         stats_metadata%ithlp3_dp = k
    1488             : 
    1489             :         call stat_assign( var_index=stats_metadata%ithlp3_dp, var_name="thlp3_dp", &
    1490             :              var_description="thlp3_dp, thlp3 budget: thlp3 dissipation", &
    1491           0 :              var_units="K^{3} s^{-1}", l_silhs=.false., grid_kind=stats_zt )
    1492           0 :         k = k + 1
    1493             : 
    1494             :       case ('rrm_bt')
    1495           0 :         stats_metadata%irrm_bt = k
    1496             :         call stat_assign( var_index=stats_metadata%irrm_bt, var_name="rrm_bt", &
    1497             :              var_description="rrm_bt, rrm budget: rrm time tendency", &
    1498           0 :              var_units="kg kg^{-1} s^{-1}", l_silhs=.false., grid_kind=stats_zt )
    1499           0 :         k = k + 1
    1500             : 
    1501             :       case ('rrm_ma')
    1502           0 :         stats_metadata%irrm_ma = k
    1503             : 
    1504             :         call stat_assign( var_index=stats_metadata%irrm_ma, var_name="rrm_ma", &
    1505             :              var_description="rrm_ma, rrm budget: rrm vertical mean advection", &
    1506           0 :              var_units="kg kg^{-1} s^{-1}", l_silhs=.false., grid_kind=stats_zt )
    1507           0 :         k = k + 1
    1508             : 
    1509             :       case ('rrm_sd')
    1510           0 :         stats_metadata%irrm_sd = k
    1511             : 
    1512             :         call stat_assign( var_index=stats_metadata%irrm_sd, var_name="rrm_sd", &
    1513             :              var_description="rrm_sd, rrm budget: rrm sedimentation", &
    1514           0 :              var_units="kg kg^{-1} s^{-1}", l_silhs=.false., grid_kind=stats_zt )
    1515           0 :         k = k + 1
    1516             : 
    1517             :       case ('rrm_ts')
    1518           0 :         stats_metadata%irrm_ts = k
    1519             : 
    1520             :         call stat_assign( var_index=stats_metadata%irrm_ts, var_name="rrm_ts", &
    1521             :              var_description="rrm_ts, rrm budget: rrm turbulent sedimentation", &
    1522           0 :              var_units="kg kg^{-1} s^{-1}", l_silhs=.false., grid_kind=stats_zt )
    1523           0 :         k = k + 1
    1524             : 
    1525             :       case ('rrm_sd_morr')
    1526           0 :         stats_metadata%irrm_sd_morr = k
    1527             : 
    1528             :         call stat_assign( var_index=stats_metadata%irrm_sd_morr, var_name="rrm_sd_morr", &
    1529             :              var_description="rrm_sd_morr, rrm sedimentation when using morrision microphysics &
    1530             :              &(not in budget, included in rrm_mc)", &
    1531           0 :              var_units="kg kg^{-1} s^{-1}", l_silhs=.true., grid_kind=stats_zt )
    1532           0 :         k = k + 1
    1533             : 
    1534             :       case ('rrm_ta')
    1535           0 :         stats_metadata%irrm_ta = k
    1536             : 
    1537             :         call stat_assign( var_index=stats_metadata%irrm_ta, var_name="rrm_ta", &
    1538             :              var_description="rrm_ta, rrm budget: rrm turbulent advection", &
    1539           0 :              var_units="kg kg^{-1} s^{-1}", l_silhs=.false., grid_kind=stats_zt )
    1540           0 :         k = k + 1
    1541             : 
    1542             :       case ('rrm_evap')
    1543           0 :         stats_metadata%irrm_evap = k
    1544             : 
    1545             :         call stat_assign( var_index=stats_metadata%irrm_evap, var_name="rrm_evap", &
    1546             :              var_description="rrm_evap, rrm evaporation rate", &
    1547           0 :              var_units="kg kg^{-1} s^{-1}", l_silhs=.false., grid_kind=stats_zt )
    1548           0 :         k = k + 1
    1549             : 
    1550             :       case ('rrm_auto')
    1551           0 :         stats_metadata%irrm_auto = k
    1552             : 
    1553             :         call stat_assign( var_index=stats_metadata%irrm_auto, var_name="rrm_auto", &
    1554             :              var_description="rrm_auto, rrm autoconversion rate", &
    1555           0 :              var_units="kg kg^{-1} s^{-1}", l_silhs=.false., grid_kind=stats_zt )
    1556           0 :         k = k + 1
    1557             : 
    1558             :       case ('rrm_accr')
    1559           0 :         stats_metadata%irrm_accr = k
    1560             :         call stat_assign( var_index=stats_metadata%irrm_accr, var_name="rrm_accr", &
    1561             :              var_description="rrm_accr, rrm accretion rate", &
    1562           0 :              var_units="kg kg^{-1} s^{-1}", l_silhs=.false., grid_kind=stats_zt )
    1563           0 :         k = k + 1
    1564             : 
    1565             :       case ('rrm_evap_adj')
    1566           0 :         stats_metadata%irrm_evap_adj = k
    1567             : 
    1568             :         call stat_assign( var_index=stats_metadata%irrm_evap_adj, var_name="rrm_evap_adj", &
    1569             :              var_description="rrm_evap_adj, rrm evaporation adjustment due to over-evaporation", &
    1570           0 :              var_units="kg kg^{-1} s^{-1}", l_silhs=.false., grid_kind=stats_zt )
    1571           0 :         k = k + 1
    1572             : 
    1573             :       case ('rrm_src_adj')
    1574           0 :         stats_metadata%irrm_src_adj = k
    1575             : 
    1576             :         call stat_assign( var_index=stats_metadata%irrm_src_adj, var_name="rrm_src_adj", &
    1577             :              var_description="rrm_src_adj, rrm source term adjustment due to over-depletion", &
    1578           0 :              var_units="kg kg^{-1} s^{-1}", l_silhs=.false., grid_kind=stats_zt )
    1579           0 :         k = k + 1
    1580             : 
    1581             :       case ('rrm_mc_nonadj')
    1582           0 :         stats_metadata%irrm_mc_nonadj = k
    1583             : 
    1584             :         call stat_assign( var_index=stats_metadata%irrm_mc_nonadj, var_name="rrm_mc_nonadj", &
    1585             :              var_description="rrm_mc_nonadj, Value of rrm_mc tendency before adjustment", &
    1586           0 :              var_units="kg kg^{-1} s^{-1}", l_silhs=.false., grid_kind=stats_zt )
    1587           0 :         k = k + 1
    1588             : 
    1589             :       case ('rrm_hf')
    1590           0 :         stats_metadata%irrm_hf = k
    1591             :         call stat_assign( var_index=stats_metadata%irrm_hf, var_name="rrm_hf", &
    1592             :              var_description="rrm_hf, rrm budget: rrm hole-filling term", &
    1593           0 :              var_units="kg kg^{-1} s^{-1}", l_silhs=.false., grid_kind=stats_zt )
    1594           0 :         k = k + 1
    1595             : 
    1596             :       case ('rrm_wvhf')
    1597           0 :         stats_metadata%irrm_wvhf = k
    1598             :         call stat_assign( var_index=stats_metadata%irrm_wvhf, var_name="rrm_wvhf", &
    1599             :              var_description="rrm_wvhf, rrm budget: rrm water vapor hole-filling term", &
    1600           0 :              var_units="kg kg^{-1} s^{-1}", l_silhs=.false., grid_kind=stats_zt )
    1601           0 :         k = k + 1
    1602             : 
    1603             :       case ('rrm_cl')
    1604           0 :         stats_metadata%irrm_cl = k
    1605             :         call stat_assign( var_index=stats_metadata%irrm_cl, var_name="rrm_cl", &
    1606             :              var_description="rrm_cl, rrm budget: rrm clipping term", &
    1607           0 :              var_units="kg kg^{-1} s^{-1}", l_silhs=.false., grid_kind=stats_zt )
    1608           0 :         k = k + 1
    1609             : 
    1610             :       case ('rrm_mc')
    1611           0 :         stats_metadata%irrm_mc = k
    1612             : 
    1613             :         call stat_assign( var_index=stats_metadata%irrm_mc, var_name="rrm_mc", &
    1614             :              var_description="rrm_mc, rrm budget: Change in rrm due to microphysics", &
    1615           0 :              var_units="kg kg^{-1} s^{-1}", l_silhs=.false., grid_kind=stats_zt )
    1616           0 :         k = k + 1
    1617             : 
    1618             :       case ('Nrm_bt')
    1619           0 :         stats_metadata%iNrm_bt = k
    1620             :         call stat_assign( var_index=stats_metadata%iNrm_bt, var_name="Nrm_bt", &
    1621             :              var_description="Nrm_bt, Nrm budget: Nrm time tendency", &
    1622           0 :              var_units="(num/kg)/s", l_silhs=.false., grid_kind=stats_zt )
    1623             : 
    1624           0 :         k = k + 1
    1625             : 
    1626             :       case ('Nrm_ma')
    1627           0 :         stats_metadata%iNrm_ma = k
    1628             : 
    1629             :         call stat_assign( var_index=stats_metadata%iNrm_ma, var_name="Nrm_ma", &
    1630             :              var_description="Nrm_ma, Nrm budget: Nrm vertical mean advection", &
    1631           0 :              var_units="(num/kg)/s", l_silhs=.false., grid_kind=stats_zt )
    1632           0 :         k = k + 1
    1633             : 
    1634             :       case ('Nrm_sd')
    1635           0 :         stats_metadata%iNrm_sd = k
    1636             : 
    1637             :         call stat_assign( var_index=stats_metadata%iNrm_sd, var_name="Nrm_sd", &
    1638             :              var_description="Nrm_sd, Nrm budget: Nrm sedimentation", &
    1639           0 :              var_units="(num/kg)/s", l_silhs=.false., grid_kind=stats_zt )
    1640             : 
    1641           0 :         k = k + 1
    1642             : 
    1643             :       case ('Nrm_ts')
    1644           0 :         stats_metadata%iNrm_ts = k
    1645             : 
    1646             :         call stat_assign( var_index=stats_metadata%iNrm_ts, var_name="Nrm_ts", &
    1647             :              var_description="Nrm_ts, Nrm budget: Nrm turbulent sedimentation", &
    1648           0 :              var_units="(num/kg)/s", l_silhs=.false., grid_kind=stats_zt )
    1649           0 :         k = k + 1
    1650             : 
    1651             :       case ('Nrm_ta')
    1652           0 :         stats_metadata%iNrm_ta = k
    1653             :         call stat_assign( var_index=stats_metadata%iNrm_ta, var_name="Nrm_ta", &
    1654             :              var_description="Nrm_ta, Nrm budget: Nrm turbulent advection", &
    1655           0 :              var_units="(num/kg)/s", l_silhs=.false., grid_kind=stats_zt )
    1656             : 
    1657           0 :         k = k + 1
    1658             : 
    1659             :       case ('Nrm_evap')
    1660           0 :         stats_metadata%iNrm_evap = k
    1661             : 
    1662             :         call stat_assign( var_index=stats_metadata%iNrm_evap, var_name="Nrm_evap", &
    1663             :              var_description="Nrm_evap, Nrm evaporation rate", var_units="(num/kg)/s", &
    1664           0 :              l_silhs=.false., grid_kind=stats_zt )
    1665           0 :         k = k + 1
    1666             : 
    1667             :       case ('Nrm_auto')
    1668           0 :         stats_metadata%iNrm_auto = k
    1669             : 
    1670             :         call stat_assign( var_index=stats_metadata%iNrm_auto, var_name="Nrm_auto", &
    1671             :              var_description="Nrm_auto, Nrm autoconversion rate", var_units="(num/kg)/s", &
    1672           0 :              l_silhs=.false., grid_kind=stats_zt )
    1673             : 
    1674           0 :         k = k + 1
    1675             : 
    1676             :       case ('Nrm_evap_adj')
    1677           0 :         stats_metadata%iNrm_evap_adj = k
    1678             : 
    1679             :         call stat_assign( var_index=stats_metadata%iNrm_evap_adj, var_name="Nrm_evap_adj", &
    1680             :              var_description="Nrm_evap_adj, Nrm evaporation adjustment due to over-evaporation", &
    1681           0 :              var_units="(num/kg)/s", l_silhs=.false., grid_kind=stats_zt )
    1682           0 :         k = k + 1
    1683             : 
    1684             :       case ('Nrm_src_adj')
    1685           0 :         stats_metadata%iNrm_src_adj = k
    1686             : 
    1687             :         call stat_assign( var_index=stats_metadata%iNrm_src_adj, var_name="Nrm_src_adj", &
    1688             :              var_description="Nrm_src_adj, Nrm source term adjustment due to over-depletion", &
    1689           0 :              var_units="(num/kg)/s", l_silhs=.false., grid_kind=stats_zt )
    1690           0 :         k = k + 1
    1691             : 
    1692             :       case ('Nrm_cl')
    1693           0 :         stats_metadata%iNrm_cl = k
    1694             :         call stat_assign( var_index=stats_metadata%iNrm_cl, var_name="Nrm_cl", &
    1695             :              var_description="Nrm_cl, Nrm budget: Nrm clipping term", &
    1696           0 :              var_units="(num/kg)/s", l_silhs=.false., grid_kind=stats_zt )
    1697           0 :         k = k + 1
    1698             : 
    1699             :       case ('Nrm_mc')
    1700           0 :         stats_metadata%iNrm_mc = k
    1701             :         call stat_assign( var_index=stats_metadata%iNrm_mc, var_name="Nrm_mc", &
    1702             :              var_description="Nrm_mc, Nrm budget: Change in Nrm due to microphysics " &
    1703             :              // "(Not in budget)", &
    1704           0 :              var_units="(num/kg)/s", l_silhs=.false., grid_kind=stats_zt )
    1705           0 :         k = k + 1
    1706             : 
    1707             :       case ('rsm_bt')
    1708           0 :         stats_metadata%irsm_bt = k
    1709             :         call stat_assign( var_index=stats_metadata%irsm_bt, var_name="rsm_bt", &
    1710             :              var_description="rsm_bt, rsm budget: rsm time tendency", &
    1711           0 :              var_units="(kg/kg)/s", l_silhs=.false., grid_kind=stats_zt )
    1712             : 
    1713           0 :         k = k + 1
    1714             : 
    1715             :       case ('rsm_ma')
    1716           0 :         stats_metadata%irsm_ma = k
    1717             : 
    1718             :         call stat_assign( var_index=stats_metadata%irsm_ma, var_name="rsm_ma", &
    1719             :              var_description="rsm_ma, rsm budget: rsm vertical mean advection", &
    1720           0 :              var_units="(kg/kg)/s", l_silhs=.false., grid_kind=stats_zt )
    1721           0 :         k = k + 1
    1722             : 
    1723             :       case ('rsm_sd')
    1724           0 :         stats_metadata%irsm_sd = k
    1725             :         call stat_assign( var_index=stats_metadata%irsm_sd, var_name="rsm_sd", &
    1726             :              var_description="rsm_sd, rsm budget: rsm sedimentation", &
    1727           0 :              var_units="(kg/kg)/s", l_silhs=.false., grid_kind=stats_zt )
    1728           0 :         k = k + 1
    1729             : 
    1730             :       case ('rsm_sd_morr')
    1731           0 :         stats_metadata%irsm_sd_morr = k
    1732             :         call stat_assign( var_index=stats_metadata%irsm_sd_morr, var_name="rsm_sd_morr", &
    1733             :              var_description="rsm_sd_morr, rsm sedimentation when using morrison microphysics &
    1734             :              &(Not in budget, included in rsm_mc)", &
    1735           0 :              var_units="(kg/kg)/s", l_silhs=.true., grid_kind=stats_zt )
    1736           0 :         k = k + 1
    1737             : 
    1738             :       case ('rsm_ta')
    1739           0 :         stats_metadata%irsm_ta = k
    1740             : 
    1741             :         call stat_assign( var_index=stats_metadata%irsm_ta, var_name="rsm_ta", &
    1742             :              var_description="rsm_ta, rsm budget: rsm turbulent advection", &
    1743           0 :              var_units="(kg/kg)/s", l_silhs=.false., grid_kind=stats_zt )
    1744           0 :         k = k + 1
    1745             : 
    1746             :       case ('rsm_mc')
    1747           0 :         stats_metadata%irsm_mc = k
    1748             : 
    1749             :         call stat_assign( var_index=stats_metadata%irsm_mc, var_name="rsm_mc", &
    1750             :              var_description="rsm_mc, rsm budget: Change in rsm due to microphysics", &
    1751           0 :              var_units="(kg/kg)/s", l_silhs=.false., grid_kind=stats_zt )
    1752           0 :         k = k + 1
    1753             : 
    1754             :       case ('rsm_hf')
    1755           0 :         stats_metadata%irsm_hf = k
    1756             : 
    1757             :         call stat_assign( var_index=stats_metadata%irsm_hf, var_name="rsm_hf", &
    1758             :              var_description="rsm_hf, rsm budget: rsm hole-filling term", &
    1759           0 :              var_units="(kg/kg)/s", l_silhs=.false., grid_kind=stats_zt )
    1760           0 :         k = k + 1
    1761             : 
    1762             :       case ('rsm_wvhf')
    1763           0 :         stats_metadata%irsm_wvhf = k
    1764             : 
    1765             :         call stat_assign( var_index=stats_metadata%irsm_wvhf, var_name="rsm_wvhf", &
    1766             :              var_description="rsm_wvhf, rsm budget: rsm water vapor hole-filling term", &
    1767           0 :              var_units="(kg/kg)/s", l_silhs=.false., grid_kind=stats_zt )
    1768           0 :         k = k + 1
    1769             : 
    1770             :       case ('rsm_cl')
    1771           0 :         stats_metadata%irsm_cl = k
    1772             : 
    1773             :         call stat_assign( var_index=stats_metadata%irsm_cl, var_name="rsm_cl", &
    1774             :              var_description="rsm_cl, rsm budget: rsm clipping term", &
    1775           0 :              var_units="(kg/kg)/s", l_silhs=.false., grid_kind=stats_zt )
    1776           0 :         k = k + 1
    1777             : 
    1778             :       case ('Nsm_bt')
    1779           0 :         stats_metadata%iNsm_bt = k
    1780             :         call stat_assign( var_index=stats_metadata%iNsm_bt, var_name="Nsm_bt", &
    1781             :              var_description="Nsm_bt, Nsm budget", var_units="(num/kg)/s", &
    1782           0 :              l_silhs=.false., grid_kind=stats_zt )
    1783             : 
    1784           0 :         k = k + 1
    1785             : 
    1786             :       case ('Nsm_ma')
    1787           0 :         stats_metadata%iNsm_ma = k
    1788             : 
    1789             :         call stat_assign( var_index=stats_metadata%iNsm_ma, var_name="Nsm_ma", &
    1790             :              var_description="Nsm_ma, Nsm budget: Nsm mean advection", &
    1791           0 :              var_units="(num/kg)/s", l_silhs=.false., grid_kind=stats_zt )
    1792           0 :         k = k + 1
    1793             : 
    1794             :       case ('Nsm_sd')
    1795           0 :         stats_metadata%iNsm_sd = k
    1796             : 
    1797             :         call stat_assign( var_index=stats_metadata%iNsm_sd, var_name="Nsm_sd", &
    1798             :              var_description="Nsm_sd, Nsm budget: Nsm sedimentation", &
    1799           0 :              var_units="(num/kg)/s", l_silhs=.false., grid_kind=stats_zt )
    1800             : 
    1801           0 :         k = k + 1
    1802             : 
    1803             :       case ('Nsm_ta')
    1804           0 :         stats_metadata%iNsm_ta = k
    1805             :         call stat_assign( var_index=stats_metadata%iNsm_ta, var_name="Nsm_ta", &
    1806             :              var_description="Nsm_ta, Nsm budget: Nsm turbulent advection", &
    1807           0 :              var_units="(num/kg)/s", l_silhs=.false., grid_kind=stats_zt )
    1808             : 
    1809           0 :         k = k + 1
    1810             : 
    1811             :       case ('Nsm_mc')
    1812           0 :         stats_metadata%iNsm_mc = k
    1813             :         call stat_assign( var_index=stats_metadata%iNsm_mc, var_name="Nsm_mc", &
    1814             :              var_description="Nsm_mc, Nsm budget: Nsm microphysics", &
    1815           0 :              var_units="(num/kg)/s", l_silhs=.false., grid_kind=stats_zt )
    1816             : 
    1817           0 :         k = k + 1
    1818             : 
    1819             :       case ('Nsm_cl')
    1820           0 :         stats_metadata%iNsm_cl = k
    1821             : 
    1822             :         call stat_assign( var_index=stats_metadata%iNsm_cl, var_name="Nsm_cl", &
    1823             :              var_description="Nsm_cl, Nsm budget: Nsm clipping term", &
    1824           0 :              var_units="(num/kg)/s", l_silhs=.false., grid_kind=stats_zt )
    1825           0 :         k = k + 1
    1826             : 
    1827             :       case ('rim_bt')
    1828           0 :         stats_metadata%irim_bt = k
    1829             : 
    1830             :         call stat_assign( var_index=stats_metadata%irim_bt, var_name="rim_bt", &
    1831             :              var_description="rim_bt, rim budget: rim time tendency", &
    1832           0 :              var_units="(kg/kg)/s", l_silhs=.false., grid_kind=stats_zt )
    1833             : 
    1834           0 :         k = k + 1
    1835             : 
    1836             :       case ('rim_ma')
    1837           0 :         stats_metadata%irim_ma = k
    1838             : 
    1839             :         call stat_assign( var_index=stats_metadata%irim_ma, var_name="rim_ma", &
    1840             :              var_description="rim_ma, rim budget: rim vertical mean advection", &
    1841           0 :              var_units="(kg/kg)/s", l_silhs=.false., grid_kind=stats_zt )
    1842           0 :         k = k + 1
    1843             : 
    1844             :       case ('rim_sd')
    1845           0 :         stats_metadata%irim_sd = k
    1846             : 
    1847             :         call stat_assign( var_index=stats_metadata%irim_sd, var_name="rim_sd", &
    1848             :              var_description="rim_sd, rim budget: rim sedimentation", &
    1849           0 :              var_units="(kg/kg)/s", l_silhs=.false., grid_kind=stats_zt )
    1850           0 :         k = k + 1
    1851             : 
    1852             :       case ('rim_sd_mg_morr')
    1853           0 :         stats_metadata%irim_sd_mg_morr = k
    1854             : 
    1855             :         call stat_assign( var_index=stats_metadata%irim_sd_mg_morr, var_name="rim_sd_mg_morr", &
    1856             :              var_description="rim_sd_mg_morr, rim sedimentation when using morrison or MG " &
    1857             :              // "microphysics" &
    1858             :              // "(not in budget, included in rim_mc)", &
    1859           0 :              var_units="(kg/kg)/s", l_silhs=.true., grid_kind=stats_zt )
    1860           0 :         k = k + 1
    1861             : 
    1862             :       case ('rim_ta')
    1863           0 :         stats_metadata%irim_ta = k
    1864             : 
    1865             :         call stat_assign( var_index=stats_metadata%irim_ta, var_name="rim_ta", &
    1866             :              var_description="rim_ta, rim budget: rim turbulent advection", &
    1867           0 :              var_units="(kg/kg)/s", l_silhs=.false., grid_kind=stats_zt )
    1868           0 :         k = k + 1
    1869             : 
    1870             :       case ('rim_mc')
    1871           0 :         stats_metadata%irim_mc = k
    1872             : 
    1873             :         call stat_assign( var_index=stats_metadata%irim_mc, var_name="rim_mc", &
    1874             :              var_description="rim_mc, rim budget: Change in rim due to microphysics", &
    1875           0 :              var_units="(kg/kg)/s", l_silhs=.false., grid_kind=stats_zt )
    1876           0 :         k = k + 1
    1877             : 
    1878             :       case ('rim_hf')
    1879           0 :         stats_metadata%irim_hf = k
    1880             : 
    1881             :         call stat_assign( var_index=stats_metadata%irim_hf, var_name="rim_hf", &
    1882             :              var_description="rim_hf, rim budget: rim hole-filling term", &
    1883           0 :              var_units="(kg/kg)/s", l_silhs=.false., grid_kind=stats_zt )
    1884           0 :         k = k + 1
    1885             : 
    1886             :       case ('rim_wvhf')
    1887           0 :         stats_metadata%irim_wvhf = k
    1888             : 
    1889             :         call stat_assign( var_index=stats_metadata%irim_wvhf, var_name="rim_wvhf", &
    1890             :              var_description="rim_wvhf, rim budget: rim water vapor hole-filling term", &
    1891           0 :              var_units="(kg/kg)/s", l_silhs=.false., grid_kind=stats_zt )
    1892           0 :         k = k + 1
    1893             : 
    1894             :       case ('rim_cl')
    1895           0 :         stats_metadata%irim_cl = k
    1896             : 
    1897             :         call stat_assign( var_index=stats_metadata%irim_cl, var_name="rim_cl", &
    1898             :              var_description="rim_cl, rim budget: rim clipping term", &
    1899           0 :              var_units="(kg/kg)/s", l_silhs=.false., grid_kind=stats_zt )
    1900           0 :         k = k + 1
    1901             : 
    1902             :       case ('rgm_bt')
    1903           0 :         stats_metadata%irgm_bt = k
    1904             : 
    1905             :         call stat_assign( var_index=stats_metadata%irgm_bt, var_name="rgm_bt", &
    1906             :              var_description="rgm_bt, rgm budget: rgm time tendency", &
    1907           0 :              var_units="(kg/kg)/s", l_silhs=.false., grid_kind=stats_zt )
    1908           0 :         k = k + 1
    1909             : 
    1910             :       case ('rgm_ma')
    1911           0 :         stats_metadata%irgm_ma = k
    1912             : 
    1913             :         call stat_assign( var_index=stats_metadata%irgm_ma, var_name="rgm_ma", &
    1914             :              var_description="rgm_ma, rgm budget: rgm vertical mean advection", &
    1915           0 :              var_units="(kg/kg)/s", l_silhs=.false., grid_kind=stats_zt )
    1916           0 :         k = k + 1
    1917             : 
    1918             :       case ('rgm_sd')
    1919           0 :         stats_metadata%irgm_sd = k
    1920             : 
    1921             :         call stat_assign( var_index=stats_metadata%irgm_sd, var_name="rgm_sd", &
    1922             :              var_description="rgm_sd, rgm budget: rgm sedimentation", &
    1923           0 :              var_units="(kg/kg)/s", l_silhs=.false., grid_kind=stats_zt )
    1924           0 :         k = k + 1
    1925             : 
    1926             :       case ('rgm_sd_morr')
    1927           0 :         stats_metadata%irgm_sd_morr = k
    1928             : 
    1929             :         call stat_assign( var_index=stats_metadata%irgm_sd_morr, var_name="rgm_sd_morr", &
    1930             :              var_description="rgm_sd_morr, rgm sedimentation when using morrison microphysics &
    1931             :              &(not in budget, included in rgm_mc)", &
    1932           0 :              var_units="(kg/kg)/s", l_silhs=.true., grid_kind=stats_zt )
    1933           0 :         k = k + 1
    1934             : 
    1935             :       case ('rgm_ta')
    1936           0 :         stats_metadata%irgm_ta = k
    1937             : 
    1938             :         call stat_assign( var_index=stats_metadata%irgm_ta, var_name="rgm_ta", &
    1939             :              var_description="rgm_ta, rgm budget: rgm turbulent advection", &
    1940           0 :              var_units="(kg/kg)/s", l_silhs=.false., grid_kind=stats_zt )
    1941           0 :         k = k + 1
    1942             : 
    1943             :       case ('rgm_mc')
    1944           0 :         stats_metadata%irgm_mc = k
    1945             : 
    1946             :         call stat_assign( var_index=stats_metadata%irgm_mc, var_name="rgm_mc", &
    1947             :              var_description="rgm_mc, rgm budget: Change in rgm due to microphysics", &
    1948           0 :              var_units="(kg/kg)/s", l_silhs=.false., grid_kind=stats_zt )
    1949           0 :         k = k + 1
    1950             : 
    1951             :       case ('rgm_hf')
    1952           0 :         stats_metadata%irgm_hf = k
    1953             : 
    1954             :         call stat_assign( var_index=stats_metadata%irgm_hf, var_name="rgm_hf", &
    1955             :              var_description="rgm_hf, rgm budget: rgm hole-filling term", &
    1956           0 :              var_units="(kg/kg)/s", l_silhs=.false., grid_kind=stats_zt )
    1957           0 :         k = k + 1
    1958             : 
    1959             :       case ('rgm_wvhf')
    1960           0 :         stats_metadata%irgm_wvhf = k
    1961             : 
    1962             :         call stat_assign( var_index=stats_metadata%irgm_wvhf, var_name="rgm_wvhf", &
    1963             :              var_description="rgm_wvhf, rgm budget: rgm water vapor hole-filling term", &
    1964           0 :              var_units="(kg/kg)/s", l_silhs=.false., grid_kind=stats_zt )
    1965           0 :         k = k + 1
    1966             : 
    1967             :       case ('rgm_cl')
    1968           0 :         stats_metadata%irgm_cl = k
    1969             : 
    1970             :         call stat_assign( var_index=stats_metadata%irgm_cl, var_name="rgm_cl", &
    1971             :              var_description="rgm_cl, rgm budget: rgm clipping term", &
    1972           0 :              var_units="(kg/kg)/s", l_silhs=.false., grid_kind=stats_zt )
    1973           0 :         k = k + 1
    1974             : 
    1975             :       case ('Ngm_bt')
    1976           0 :         stats_metadata%iNgm_bt = k
    1977             :         call stat_assign( var_index=stats_metadata%iNgm_bt, var_name="Ngm_bt", &
    1978             :              var_description="Ngm_bt, Ngm budget:", var_units="(num/kg)/s", &
    1979           0 :              l_silhs=.false., grid_kind=stats_zt )
    1980             : 
    1981           0 :         k = k + 1
    1982             : 
    1983             :       case ('Ngm_ma')
    1984           0 :         stats_metadata%iNgm_ma = k
    1985             : 
    1986             :         call stat_assign( var_index=stats_metadata%iNgm_ma, var_name="Ngm_ma", &
    1987             :              var_description="Ngm_ma, Ngm budget: Ngm mean advection", &
    1988           0 :              var_units="(num/kg)/s", l_silhs=.false., grid_kind=stats_zt )
    1989           0 :         k = k + 1
    1990             : 
    1991             :       case ('Ngm_sd')
    1992           0 :         stats_metadata%iNgm_sd = k
    1993             : 
    1994             :         call stat_assign( var_index=stats_metadata%iNgm_sd, var_name="Ngm_sd", &
    1995             :              var_description="Ngm_sd, Ngm budget: Ngm sedimentation", &
    1996           0 :              var_units="(num/kg)/s", l_silhs=.false., grid_kind=stats_zt )
    1997             : 
    1998           0 :         k = k + 1
    1999             : 
    2000             :       case ('Ngm_ta')
    2001           0 :         stats_metadata%iNgm_ta = k
    2002             :         call stat_assign( var_index=stats_metadata%iNgm_ta, var_name="Ngm_ta", &
    2003             :              var_description="Ngm_ta, Ngm budget: Ngm turbulent advection", &
    2004           0 :              var_units="(num/kg)/s", l_silhs=.false., grid_kind=stats_zt )
    2005             : 
    2006           0 :         k = k + 1
    2007             : 
    2008             :       case ('Ngm_mc')
    2009           0 :         stats_metadata%iNgm_mc = k
    2010             : 
    2011             :         call stat_assign( var_index=stats_metadata%iNgm_mc, var_name="Ngm_mc", &
    2012             :              var_description="Ngm_mc, Ngm budget: Ngm microphysics term", &
    2013           0 :              var_units="(num/kg)/s", l_silhs=.false., grid_kind=stats_zt )
    2014           0 :         k = k + 1
    2015             : 
    2016             :       case ('Ngm_cl')
    2017           0 :         stats_metadata%iNgm_cl = k
    2018             : 
    2019             :         call stat_assign( var_index=stats_metadata%iNgm_cl, var_name="Ngm_cl", &
    2020             :              var_description="Ngm_cl, Ngm budget: Ngm clipping term", &
    2021           0 :              var_units="(num/kg)/s", l_silhs=.false., grid_kind=stats_zt )
    2022           0 :         k = k + 1
    2023             : 
    2024             :       case ('Nim_bt')
    2025           0 :         stats_metadata%iNim_bt = k
    2026             :         call stat_assign( var_index=stats_metadata%iNim_bt, var_name="Nim_bt", &
    2027             :              var_description="Nim_bt, Nim budget", var_units="(num/kg)/s", l_silhs=.false., &
    2028           0 :              grid_kind=stats_zt )
    2029             : 
    2030           0 :         k = k + 1
    2031             : 
    2032             :       case ('Nim_ma')
    2033           0 :         stats_metadata%iNim_ma = k
    2034             : 
    2035             :         call stat_assign( var_index=stats_metadata%iNim_ma, var_name="Nim_ma", &
    2036             :              var_description="Nim_ma, Nim budget: Nim mean advection", &
    2037           0 :              var_units="(num/kg)/s", l_silhs=.false., grid_kind=stats_zt )
    2038           0 :         k = k + 1
    2039             : 
    2040             :       case ('Nim_sd')
    2041           0 :         stats_metadata%iNim_sd = k
    2042             : 
    2043             :         call stat_assign( var_index=stats_metadata%iNim_sd, var_name="Nim_sd", &
    2044             :              var_description="Nim_sd, Nim budget: Nim sedimentation", &
    2045           0 :              var_units="(num/kg)/s", l_silhs=.false., grid_kind=stats_zt )
    2046             : 
    2047           0 :         k = k + 1
    2048             : 
    2049             :       case ('Nim_ta')
    2050           0 :         stats_metadata%iNim_ta = k
    2051             :         call stat_assign( var_index=stats_metadata%iNim_ta, var_name="Nim_ta", &
    2052             :              var_description="Nim_ta, Nim budget: Nim turbulent advection", &
    2053           0 :              var_units="(num/kg)/s", l_silhs=.false., grid_kind=stats_zt )
    2054             : 
    2055           0 :         k = k + 1
    2056             : 
    2057             :       case ('Nim_mc')
    2058           0 :         stats_metadata%iNim_mc = k
    2059             : 
    2060             :         call stat_assign( var_index=stats_metadata%iNim_mc, var_name="Nim_mc", &
    2061             :              var_description="Nim_mc, Nim budget: Nim microphysics term", &
    2062           0 :              var_units="(num/kg)/s", l_silhs=.false., grid_kind=stats_zt )
    2063           0 :         k = k + 1
    2064             : 
    2065             :       case ('Nim_cl')
    2066           0 :         stats_metadata%iNim_cl = k
    2067             : 
    2068             :         call stat_assign( var_index=stats_metadata%iNim_cl, var_name="Nim_cl", &
    2069             :              var_description="Nim_cl, Nim budget: Nim clipping term", &
    2070           0 :              var_units="(num/kg)/s", l_silhs=.false., grid_kind=stats_zt )
    2071           0 :         k = k + 1
    2072             : 
    2073             :       case ('Ncm_bt')
    2074           0 :         stats_metadata%iNcm_bt = k
    2075             :         call stat_assign( var_index=stats_metadata%iNcm_bt, var_name="Ncm_bt", &
    2076             :              var_description="Ncm_bt, Ncm budget: Cloud droplet number concentration budget", &
    2077           0 :              var_units="(num/kg)/s", l_silhs=.false., grid_kind=stats_zt )
    2078             : 
    2079           0 :         k = k + 1
    2080             : 
    2081             :       case ('Ncm_ma')
    2082           0 :         stats_metadata%iNcm_ma = k
    2083             : 
    2084             :         call stat_assign( var_index=stats_metadata%iNcm_ma, var_name="Ncm_ma", &
    2085             :              var_description="Ncm_ma, Ncm budget: Ncm vertical mean advection", &
    2086           0 :              var_units="(num/kg)/s", l_silhs=.false., grid_kind=stats_zt )
    2087           0 :         k = k + 1
    2088             : 
    2089             :       case ('Ncm_act')
    2090           0 :         stats_metadata%iNcm_act = k
    2091             : 
    2092             :         call stat_assign( var_index=stats_metadata%iNcm_act, var_name="Ncm_act", &
    2093             :              var_description="Ncm_act, Ncm budget: Change in Ncm due to activation", &
    2094           0 :              var_units="(num/kg)/s", l_silhs=.false., grid_kind=stats_zt )
    2095             : 
    2096           0 :         k = k + 1
    2097             : 
    2098             :       case ('Ncm_ta')
    2099           0 :         stats_metadata%iNcm_ta = k
    2100             :         call stat_assign( var_index=stats_metadata%iNcm_ta, var_name="Ncm_ta", &
    2101             :              var_description="Ncm_ta, Ncm budget: Ncm turbulent advection", &
    2102           0 :              var_units="(num/kg)/s", l_silhs=.false., grid_kind=stats_zt )
    2103             : 
    2104           0 :         k = k + 1
    2105             : 
    2106             :       case ('Ncm_mc')
    2107           0 :         stats_metadata%iNcm_mc = k
    2108             : 
    2109             :         call stat_assign( var_index=stats_metadata%iNcm_mc, var_name="Ncm_mc", &
    2110             :              var_description="Ncm_mc, Ncm budget: Change in Ncm due to microphysics", &
    2111           0 :              var_units="(num/kg)/s", l_silhs=.false., grid_kind=stats_zt )
    2112           0 :         k = k + 1
    2113             : 
    2114             :       case ('Ncm_cl')
    2115           0 :         stats_metadata%iNcm_cl = k
    2116             : 
    2117             :         call stat_assign( var_index=stats_metadata%iNcm_cl, var_name="Ncm_cl", &
    2118             :              var_description="Ncm_cl, Ncm budget: Ncm clipping term", &
    2119           0 :              var_units="(num/kg)/s", l_silhs=.false., grid_kind=stats_zt )
    2120           0 :         k = k + 1
    2121             : 
    2122             :       case ('PSMLT')
    2123           0 :         stats_metadata%iPSMLT = k
    2124             : 
    2125             :         call stat_assign( var_index=stats_metadata%iPSMLT, var_name="PSMLT", &
    2126             :              var_description="PSMLT, Freezing of rain to form snow, +rsm, -rrm", &
    2127           0 :              var_units="(kg/kg)/s", l_silhs=.true., grid_kind=stats_zt )
    2128           0 :         k = k + 1
    2129             : 
    2130             :       case ('EVPMS')
    2131           0 :         stats_metadata%iEVPMS = k
    2132             : 
    2133             :         call stat_assign( var_index=stats_metadata%iEVPMS, var_name="EVPMS", &
    2134             :              var_description="EVPMS, Evaporation of melted snow, +rsm, -rvm", &
    2135           0 :              var_units="(kg/kg)/s", l_silhs=.true., grid_kind=stats_zt )
    2136           0 :         k = k + 1
    2137             : 
    2138             :       case ('PRACS')
    2139           0 :         stats_metadata%iPRACS = k
    2140             : 
    2141             :         call stat_assign( var_index=stats_metadata%iPRACS, var_name="PRACS", &
    2142             :              var_description="PRACS, Collection of rain by snow, +rsm, -rrm", &
    2143           0 :              var_units="(kg/kg)/s", l_silhs=.true., grid_kind=stats_zt )
    2144           0 :         k = k + 1
    2145             : 
    2146             :       case ('EVPMG')
    2147           0 :         stats_metadata%iEVPMG = k
    2148             : 
    2149             :         call stat_assign( var_index=stats_metadata%iEVPMG, var_name="EVPMG", &
    2150             :              var_description="EVPMG, Evaporation of melted graupel, +rgm, -rvm", &
    2151           0 :              var_units="(kg/kg)/s", l_silhs=.true., grid_kind=stats_zt )
    2152           0 :         k = k + 1
    2153             : 
    2154             :       case ('PRACG')
    2155           0 :         stats_metadata%iPRACG = k
    2156             : 
    2157             :         call stat_assign( var_index=stats_metadata%iPRACG, var_name="PRACG", &
    2158             :              var_description="PRACG, Negative of collection of rain by graupel, +rrm, -rgm", &
    2159           0 :              var_units="(kg/kg)/s", l_silhs=.true., grid_kind=stats_zt )
    2160           0 :         k = k + 1
    2161             : 
    2162             :       case ('PGMLT')
    2163           0 :         stats_metadata%iPGMLT = k
    2164             : 
    2165             :         call stat_assign( var_index=stats_metadata%iPGMLT, var_name="PGMLT", &
    2166             :              var_description="PGMLT, Negative of melting of graupel, +rgm, -rrm", &
    2167           0 :              var_units="(kg/kg)/s", l_silhs=.true., grid_kind=stats_zt )
    2168           0 :         k = k + 1
    2169             : 
    2170             :       case ('MNUCCC')
    2171           0 :         stats_metadata%iMNUCCC = k
    2172             : 
    2173             :         call stat_assign( var_index=stats_metadata%iMNUCCC, var_name="MNUCCC", &
    2174             :              var_description="MNUCCC, Contact freezing of cloud droplets, +rim, -rcm", &
    2175           0 :              var_units="(kg/kg)/s", l_silhs=.true., grid_kind=stats_zt )
    2176           0 :         k = k + 1
    2177             : 
    2178             :       case ('PSACWS')
    2179           0 :         stats_metadata%iPSACWS = k
    2180             : 
    2181             :         call stat_assign( var_index=stats_metadata%iPSACWS, var_name="PSACWS", &
    2182             :              var_description="PSACWS, Collection of cloud water by snow, +rsm, -rcm", &
    2183           0 :              var_units="(kg/kg)/s", l_silhs=.true., grid_kind=stats_zt )
    2184           0 :         k = k + 1
    2185             : 
    2186             :       case ('PSACWI')
    2187           0 :         stats_metadata%iPSACWI = k
    2188             : 
    2189             :         call stat_assign( var_index=stats_metadata%iPSACWI, var_name="PSACWI", &
    2190             :              var_description="PSACWI, Collection of cloud water by cloud ice, +rim, -rcm", &
    2191           0 :              var_units="(kg/kg)/s", l_silhs=.true., grid_kind=stats_zt )
    2192           0 :         k = k + 1
    2193             : 
    2194             :       case ('QMULTS')
    2195           0 :         stats_metadata%iQMULTS = k
    2196             : 
    2197             :         call stat_assign( var_index=stats_metadata%iQMULTS, var_name="QMULTS", &
    2198             :              var_description="QMULTS, Splintering from cloud droplets accreted onto snow, " &
    2199             :              // "+rim, -rcm", &
    2200           0 :              var_units="(kg/kg)/s", l_silhs=.true., grid_kind=stats_zt )
    2201           0 :         k = k + 1
    2202             : 
    2203             :       case ('QMULTG')
    2204           0 :         stats_metadata%iQMULTG = k
    2205             : 
    2206             :         call stat_assign( var_index=stats_metadata%iQMULTG, var_name="QMULTG", &
    2207             :              var_description="QMULTG, Splintering from droplets accreted onto graupel, " &
    2208             :              // "+rim, -rcm", &
    2209           0 :              var_units="(kg/kg)/s", l_silhs=.true., grid_kind=stats_zt )
    2210           0 :         k = k + 1
    2211             : 
    2212             :       case ('PSACWG')
    2213           0 :         stats_metadata%iPSACWG = k
    2214             : 
    2215             :         call stat_assign( var_index=stats_metadata%iPSACWG, var_name="PSACWG", &
    2216             :              var_description="PSACWG, Collection of cloud water by graupel, +rgm, -rcm", &
    2217           0 :              var_units="(kg/kg)/s", l_silhs=.true., grid_kind=stats_zt )
    2218           0 :         k = k + 1
    2219             : 
    2220             :       case ('PGSACW')
    2221           0 :         stats_metadata%iPGSACW = k
    2222             : 
    2223             :         call stat_assign( var_index=stats_metadata%iPGSACW, var_name="PGSACW", &
    2224             :              var_description="PGSACW, Reclassification of rimed snow as graupel, +rgm, -rcm", &
    2225           0 :              var_units="(kg/kg)/s", l_silhs=.true., grid_kind=stats_zt )
    2226           0 :         k = k + 1
    2227             : 
    2228             :       case ('PRD')
    2229           0 :         stats_metadata%iPRD = k
    2230             : 
    2231             :         call stat_assign( var_index=stats_metadata%iPRD, var_name="PRD", &
    2232             :              var_description="PRD, Depositional growth of cloud ice, +rim, -rvm", &
    2233           0 :              var_units="(kg/kg)/s", l_silhs=.true., grid_kind=stats_zt )
    2234           0 :         k = k + 1
    2235             : 
    2236             :       case ('PRCI')
    2237           0 :         stats_metadata%iPRCI = k
    2238             : 
    2239             :         call stat_assign( var_index=stats_metadata%iPRCI, var_name="PRCI", &
    2240             :              var_description="PRCI, Autoconversion of cloud ice to snow, +rsm, -rim", &
    2241           0 :              var_units="(kg/kg)/s", l_silhs=.true., grid_kind=stats_zt )
    2242           0 :         k = k + 1
    2243             : 
    2244             :       case ('PRAI')
    2245           0 :         stats_metadata%iPRAI = k
    2246             : 
    2247             :         call stat_assign( var_index=stats_metadata%iPRAI, var_name="PRAI", &
    2248             :              var_description="PRAI, Collection of cloud ice by snow, +rsm, -rim", &
    2249           0 :              var_units="(kg/kg)/s", l_silhs=.true., grid_kind=stats_zt )
    2250           0 :         k = k + 1
    2251             : 
    2252             :       case ('QMULTR')
    2253           0 :         stats_metadata%iQMULTR = k
    2254             : 
    2255             :         call stat_assign( var_index=stats_metadata%iQMULTR, var_name="QMULTR", &
    2256             :              var_description="QMULTR, Splintering from rain droplets accreted onto snow, " &
    2257             :              // "+rim, -rrm", &
    2258           0 :              var_units="(kg/kg)/s", l_silhs=.true., grid_kind=stats_zt )
    2259           0 :         k = k + 1
    2260             : 
    2261             :       case ('QMULTRG')
    2262           0 :         stats_metadata%iQMULTRG = k
    2263             : 
    2264             :         call stat_assign( var_index=stats_metadata%iQMULTRG, var_name="QMULTRG", &
    2265             :              var_description="QMULTRG, Splintering from rain droplets accreted onto graupel, " &
    2266             :              // "+rim, -rrm", &
    2267           0 :              var_units="(kg/kg)/s", l_silhs=.true., grid_kind=stats_zt )
    2268           0 :         k = k + 1
    2269             : 
    2270             :       case ('MNUCCD')
    2271           0 :         stats_metadata%iMNUCCD = k
    2272             : 
    2273             :         call stat_assign( var_index=stats_metadata%iMNUCCD, var_name="MNUCCD", &
    2274             :              var_description="MNUCCD, Freezing of aerosol, +rim, -rvm", &
    2275           0 :              var_units="(kg/kg)/s", l_silhs=.true., grid_kind=stats_zt )
    2276           0 :         k = k + 1
    2277             : 
    2278             :       case ('PRACI')
    2279           0 :         stats_metadata%iPRACI = k
    2280             : 
    2281             :         call stat_assign( var_index=stats_metadata%iPRACI, var_name="PRACI", &
    2282             :              var_description="PRACI, Collection of cloud ice by rain, +rgm, -rim", &
    2283           0 :              var_units="(kg/kg)/s", l_silhs=.true., grid_kind=stats_zt )
    2284           0 :         k = k + 1
    2285             : 
    2286             :       case ('PRACIS')
    2287           0 :         stats_metadata%iPRACIS = k
    2288             : 
    2289             :         call stat_assign( var_index=stats_metadata%iPRACIS, var_name="PRACIS", &
    2290             :              var_description="PRACIS, Collection of cloud ice by rain, +rsm, -rim", &
    2291           0 :              var_units="(kg/kg)/s", l_silhs=.true., grid_kind=stats_zt )
    2292           0 :         k = k + 1
    2293             : 
    2294             :       case ('EPRD')
    2295           0 :         stats_metadata%iEPRD = k
    2296             : 
    2297             :         call stat_assign( var_index=stats_metadata%iEPRD, var_name="EPRD", &
    2298             :              var_description="EPRD, Negative of sublimation of cloud ice, +rim, -rvm", &
    2299           0 :              var_units="(kg/kg)/s", l_silhs=.true., grid_kind=stats_zt )
    2300           0 :         k = k + 1
    2301             : 
    2302             :       case ('MNUCCR')
    2303           0 :         stats_metadata%iMNUCCR = k
    2304             : 
    2305             :         call stat_assign( var_index=stats_metadata%iMNUCCR, var_name="MNUCCR", &
    2306             :              var_description="MNUCCR, Contact freezing of rain droplets, +rgm, -rrm", &
    2307           0 :              var_units="(kg/kg)/s", l_silhs=.true., grid_kind=stats_zt )
    2308           0 :         k = k + 1
    2309             : 
    2310             :       case ('PIACR')
    2311           0 :         stats_metadata%iPIACR = k
    2312             : 
    2313             :         call stat_assign( var_index=stats_metadata%iPIACR, var_name="PIACR", &
    2314             :              var_description="PIACR, Collection of cloud ice by rain, +rgm, -rrm", &
    2315           0 :              var_units="(kg/kg)/s", l_silhs=.true., grid_kind=stats_zt )
    2316           0 :         k = k + 1
    2317             : 
    2318             :       case ('PIACRS')
    2319           0 :         stats_metadata%iPIACRS = k
    2320             : 
    2321             :         call stat_assign( var_index=stats_metadata%iPIACRS, var_name="PIACRS", &
    2322             :              var_description="PIACRS, Collection of cloud ice by rain, +rsm, -rrm", &
    2323           0 :              var_units="(kg/kg)/s", l_silhs=.true., grid_kind=stats_zt )
    2324           0 :         k = k + 1
    2325             : 
    2326             :       case ('PGRACS')
    2327           0 :         stats_metadata%iPGRACS = k
    2328             : 
    2329             :         call stat_assign( var_index=stats_metadata%iPGRACS, var_name="PGRACS", &
    2330             :              var_description="PGRACS, Collection of rain by snow, +rgm, -rrm", &
    2331           0 :              var_units="(kg/kg)/s", l_silhs=.true., grid_kind=stats_zt )
    2332           0 :         k = k + 1
    2333             : 
    2334             :       case ('PRDS')
    2335           0 :         stats_metadata%iPRDS = k
    2336             : 
    2337             :         call stat_assign( var_index=stats_metadata%iPRDS, var_name="PRDS", &
    2338             :              var_description="PRDS, Depositional growth of snow, +rsm, -rvm", &
    2339           0 :              var_units="(kg/kg)/s", l_silhs=.true., grid_kind=stats_zt )
    2340           0 :         k = k + 1
    2341             : 
    2342             :       case ('EPRDS')
    2343           0 :         stats_metadata%iEPRDS = k
    2344             : 
    2345             :         call stat_assign( var_index=stats_metadata%iEPRDS, var_name="EPRDS", &
    2346             :              var_description="EPRDS, Negative of sublimation of snow, +rsm, -rvm", &
    2347           0 :              var_units="(kg/kg)/s", l_silhs=.true., grid_kind=stats_zt )
    2348           0 :         k = k + 1
    2349             : 
    2350             :       case ('PSACR')
    2351           0 :         stats_metadata%iPSACR = k
    2352             : 
    2353             :         call stat_assign( var_index=stats_metadata%iPSACR, var_name="PSACR", &
    2354             :              var_description="PSACR, Collection of snow by rain, +rgm, -rsm", &
    2355           0 :              var_units="(kg/kg)/s", l_silhs=.true., grid_kind=stats_zt )
    2356           0 :         k = k + 1
    2357             : 
    2358             :       case ('PRDG')
    2359           0 :         stats_metadata%iPRDG = k
    2360             : 
    2361             :         call stat_assign( var_index=stats_metadata%iPRDG, var_name="PRDG", &
    2362             :              var_description="PRDG, Depositional growth of graupel, +rgm, -rvm", &
    2363           0 :              var_units="(kg/kg)/s", l_silhs=.true., grid_kind=stats_zt )
    2364           0 :         k = k + 1
    2365             : 
    2366             :       case ('EPRDG')
    2367           0 :         stats_metadata%iEPRDG = k
    2368             : 
    2369             :         call stat_assign( var_index=stats_metadata%iEPRDG, var_name="EPRDG", &
    2370             :              var_description="EPRDG, Negative of sublimation of graupel, +rgm, -rvm", &
    2371           0 :              var_units="(kg/kg)/s", l_silhs=.true., grid_kind=stats_zt )
    2372           0 :         k = k + 1
    2373             : 
    2374             :       case ('NGSTEN')
    2375           0 :         stats_metadata%iNGSTEN = k
    2376             : 
    2377             :         call stat_assign( var_index=stats_metadata%iNGSTEN, var_name="NGSTEN", &
    2378             :              var_description="NGSTEN, Graupel sedimentation tendency", var_units="(#/kg/s)", &
    2379           0 :              l_silhs=.true., grid_kind=stats_zt )
    2380           0 :         k = k + 1
    2381             : 
    2382             :       case ('NRSTEN')
    2383           0 :         stats_metadata%iNRSTEN = k
    2384             : 
    2385             :         call stat_assign( var_index=stats_metadata%iNRSTEN, var_name="NRSTEN", &
    2386             :              var_description="NRSTEN, Rain sedimentation tendency", var_units="(#/kg/s)", &
    2387           0 :              l_silhs=.true., grid_kind=stats_zt )
    2388           0 :         k = k + 1
    2389             : 
    2390             :       case ('NISTEN')
    2391           0 :         stats_metadata%iNISTEN = k
    2392             : 
    2393             :         call stat_assign( var_index=stats_metadata%iNISTEN, var_name="NISTEN", &
    2394             :              var_description="NISTEN, Cloud ice sedimentation tendency", var_units="(#/kg/s)", &
    2395           0 :              l_silhs=.true., grid_kind=stats_zt )
    2396           0 :         k = k + 1
    2397             : 
    2398             :       case ('NSSTEN')
    2399           0 :         stats_metadata%iNSSTEN = k
    2400             : 
    2401             :         call stat_assign( var_index=stats_metadata%iNSSTEN, var_name="NSSTEN", &
    2402             :              var_description="NSSTEN, Snow sedimentation tendency", var_units="(#/kg/s)", &
    2403           0 :              l_silhs=.true., grid_kind=stats_zt )
    2404           0 :         k = k + 1
    2405             : 
    2406             :       case ('NCSTEN')
    2407           0 :         stats_metadata%iNCSTEN = k
    2408             : 
    2409             :         call stat_assign( var_index=stats_metadata%iNCSTEN, var_name="NCSTEN", &
    2410             :              var_description="NCSTEN, Cloud water sedimentation tendency", &
    2411           0 :              var_units="(#/kg/s)", l_silhs=.true., grid_kind=stats_zt )
    2412           0 :         k = k + 1
    2413             : 
    2414             :       case ('NPRC1')
    2415           0 :         stats_metadata%iNPRC1 = k
    2416             : 
    2417             :         call stat_assign( var_index=stats_metadata%iNPRC1, var_name="NPRC1", &
    2418             :              var_description="NPRC1, Change in Nrm due to autoconversion of droplets, +Nrm", &
    2419           0 :              var_units="(#/kg/s)", l_silhs=.true., grid_kind=stats_zt )
    2420           0 :         k = k + 1
    2421             : 
    2422             :       case ('NRAGG')
    2423           0 :         stats_metadata%iNRAGG = k
    2424             : 
    2425             :         call stat_assign( var_index=stats_metadata%iNRAGG, var_name="NRAGG", &
    2426             :              var_description="NRAGG, Change in Nrm due to self-collection of raindrops, +Nrm", &
    2427           0 :              var_units="(#/kg/s)", l_silhs=.true., grid_kind=stats_zt )
    2428           0 :         k = k + 1
    2429             : 
    2430             :       case ('NPRACG')
    2431           0 :         stats_metadata%iNPRACG = k
    2432             : 
    2433             :         call stat_assign( var_index=stats_metadata%iNPRACG, var_name="NPRACG", &
    2434             :              var_description="NPRACG, Collection of rainwater by graupel, -Nrm", &
    2435           0 :              var_units="(#/kg/s)", l_silhs=.true., grid_kind=stats_zt )
    2436           0 :         k = k + 1
    2437             : 
    2438             :       case ('NSUBR')
    2439           0 :         stats_metadata%iNSUBR = k
    2440             : 
    2441             :         call stat_assign( var_index=stats_metadata%iNSUBR, var_name="NSUBR", &
    2442             :              var_description="NSUBR, Loss of Nrm by evaporation, +Nrm", var_units="(#/kg/s)", &
    2443           0 :              l_silhs=.true., grid_kind=stats_zt )
    2444           0 :         k = k + 1
    2445             : 
    2446             :       case ('NSMLTR')
    2447           0 :         stats_metadata%iNSMLTR = k
    2448             : 
    2449             :         call stat_assign( var_index=stats_metadata%iNSMLTR, var_name="NSMLTR", &
    2450             :              var_description="NSMLTR, Melting of snow to form rain, -Nrm", &
    2451           0 :              var_units="(#/kg/s)", l_silhs=.true., grid_kind=stats_zt )
    2452           0 :         k = k + 1
    2453             : 
    2454             :       case ('NGMLTR')
    2455           0 :         stats_metadata%iNGMLTR = k
    2456             : 
    2457             :         call stat_assign( var_index=stats_metadata%iNGMLTR, var_name="NGMLTR", &
    2458             :              var_description="NGMLTR, Melting of graupel to form rain, -Nrm", &
    2459           0 :              var_units="(#/kg/s)", l_silhs=.true., grid_kind=stats_zt )
    2460           0 :         k = k + 1
    2461             : 
    2462             :       case ('NPRACS')
    2463           0 :         stats_metadata%iNPRACS = k
    2464             : 
    2465             :         call stat_assign( var_index=stats_metadata%iNPRACS, var_name="NPRACS", &
    2466             :              var_description="NPRACS, Collection of rainwater by snow, -Nrm", &
    2467           0 :              var_units="(#/kg/s)", l_silhs=.true., grid_kind=stats_zt )
    2468           0 :         k = k + 1
    2469             : 
    2470             :       case ('NNUCCR')
    2471           0 :         stats_metadata%iNNUCCR = k
    2472             : 
    2473             :         call stat_assign( var_index=stats_metadata%iNNUCCR, var_name="NNUCCR", &
    2474             :              var_description="NNUCCR, Contact freezing of rain, +Ngm, -Nrm", &
    2475           0 :              var_units="(#/kg/s)", l_silhs=.true., grid_kind=stats_zt )
    2476           0 :         k = k + 1
    2477             : 
    2478             :       case ('NIACR')
    2479           0 :         stats_metadata%iNIACR = k
    2480             : 
    2481             :         call stat_assign( var_index=stats_metadata%iNIACR, var_name="NIACR", &
    2482             :              var_description="NIACR, Collection of cloud ice by rain, +Ngm, -Nrm, -Nim", &
    2483           0 :              var_units="(#/kg/s)", l_silhs=.true., grid_kind=stats_zt )
    2484           0 :         k = k + 1
    2485             : 
    2486             :       case ('NIACRS')
    2487           0 :         stats_metadata%iNIACRS = k
    2488             : 
    2489             :         call stat_assign( var_index=stats_metadata%iNIACRS, var_name="NIACRS", &
    2490             :              var_description="NIACRS, Collection of cloud ice by rain, +Nsm, -Nrm, -Nim", &
    2491           0 :              var_units="(#/kg/s)", l_silhs=.true., grid_kind=stats_zt )
    2492           0 :         k = k + 1
    2493             : 
    2494             :       case ('NGRACS')
    2495           0 :         stats_metadata%iNGRACS = k
    2496             : 
    2497             :         call stat_assign( var_index=stats_metadata%iNGRACS, var_name="NGRACS", &
    2498             :              var_description="NGRACS, Collection of rain by snow, +Ngm, -Nrm, -Nsm", &
    2499           0 :              var_units="(#/kg/s)", l_silhs=.true., grid_kind=stats_zt )
    2500           0 :         k = k + 1
    2501             : 
    2502             :       case ('NSMLTS')
    2503           0 :         stats_metadata%iNSMLTS= k
    2504             : 
    2505             :         call stat_assign( var_index=stats_metadata%iNSMLTS, var_name="NSMLTS", &
    2506             :              var_description="NSMLTS, Melting  of snow, +Nsm", var_units="(#/kg/s)", &
    2507           0 :              l_silhs=.true., grid_kind=stats_zt )
    2508           0 :         k = k + 1
    2509             : 
    2510             :       case ('NSAGG')
    2511           0 :         stats_metadata%iNSAGG= k
    2512             : 
    2513             :         call stat_assign( var_index=stats_metadata%iNSAGG, var_name="NSAGG", &
    2514             :              var_description="NSAGG, Self collection of snow, +Nsm", var_units="(#/kg/s)", &
    2515           0 :              l_silhs=.true., grid_kind=stats_zt )
    2516             : 
    2517           0 :         k = k + 1
    2518             : 
    2519             :       case ('NPRCI')
    2520           0 :         stats_metadata%iNPRCI= k
    2521             : 
    2522             :         call stat_assign( var_index=stats_metadata%iNPRCI, var_name="NPRCI", &
    2523             :              var_description="NPRCI, Autoconversion of cloud ice to snow, -Nim, +Nsm", &
    2524           0 :              var_units="(#/kg/s)", l_silhs=.true., grid_kind=stats_zt )
    2525           0 :         k = k + 1
    2526             : 
    2527             :       case ('NSCNG')
    2528           0 :         stats_metadata%iNSCNG= k
    2529             : 
    2530             :         call stat_assign( var_index=stats_metadata%iNSCNG, var_name="NSCNG", &
    2531             :              var_description="NSCNG, Conversion of snow to graupel, +Ngm, -Nsm", &
    2532           0 :              var_units="(#/kg/s)", l_silhs=.true., grid_kind=stats_zt )
    2533           0 :         k = k + 1
    2534             : 
    2535             :       case ('NSUBS')
    2536           0 :         stats_metadata%iNSUBS= k
    2537             : 
    2538             :         call stat_assign( var_index=stats_metadata%iNSUBS, var_name="NSUBS", &
    2539             :              var_description="NSUBS, Loss of snow due to sublimation, +Nsm", &
    2540           0 :              var_units="(#/kg/s)", l_silhs=.true., grid_kind=stats_zt )
    2541           0 :         k = k + 1
    2542             : 
    2543             :       case ('PRC')
    2544           0 :         stats_metadata%iPRC= k
    2545             : 
    2546             :         call stat_assign( var_index=stats_metadata%iPRC, var_name="PRC", &
    2547             :              var_description="PRC, Autoconversion +rrm -rcm", var_units="(kg/kg/s)", &
    2548           0 :              l_silhs=.true., grid_kind=stats_zt )
    2549           0 :         k = k + 1
    2550             : 
    2551             :       case ('PRA')
    2552           0 :         stats_metadata%iPRA= k
    2553             : 
    2554             :         call stat_assign( var_index=stats_metadata%iPRA, var_name="PRA", &
    2555             :              var_description="PRA, Accretion +rrm -rcm", var_units="(kg/kg/s)", &
    2556           0 :              l_silhs=.true., grid_kind=stats_zt )
    2557           0 :         k = k + 1
    2558             : 
    2559             :       case ('PRE')
    2560           0 :         stats_metadata%iPRE= k
    2561             : 
    2562             :         call stat_assign( var_index=stats_metadata%iPRE, var_name="PRE", &
    2563             :              var_description="PRE, Evaporation of rain -rrm", var_units="(kg/kg/s)", &
    2564           0 :              l_silhs=.true., grid_kind=stats_zt )
    2565           0 :         k = k + 1
    2566             : 
    2567             :       case ('PCC')
    2568           0 :         stats_metadata%iPCC= k
    2569             : 
    2570             :         call stat_assign( var_index=stats_metadata%iPCC, var_name="PCC", &
    2571             :              var_description="PCC, Satuation adjustment -rvm +rcm", var_units="(kg/kg/s)", &
    2572           0 :              l_silhs=.true., grid_kind=stats_zt )
    2573           0 :         k = k + 1
    2574             : 
    2575             :       case ('NNUCCC')
    2576           0 :         stats_metadata%iNNUCCC= k
    2577             : 
    2578             :         call stat_assign( var_index=stats_metadata%iNNUCCC, var_name="NNUCCC", &
    2579             :              var_description="NNUCCC, Contact freezing of drops, -Ncm + Nim", &
    2580           0 :              var_units="(#/kg/s)", l_silhs=.true., grid_kind=stats_zt )
    2581           0 :         k = k + 1
    2582             : 
    2583             :       case ('NPSACWS')
    2584           0 :         stats_metadata%iNPSACWS= k
    2585             : 
    2586             :         call stat_assign( var_index=stats_metadata%iNPSACWS, var_name="NPSACWS", &
    2587             :              var_description="NPSACWS, Droplet accretion by snow, -Ncm", var_units="(#/kg/s)", &
    2588           0 :              l_silhs=.true., grid_kind=stats_zt )
    2589           0 :         k = k + 1
    2590             : 
    2591             :       case ('NPRA')
    2592           0 :         stats_metadata%iNPRA= k
    2593             : 
    2594             :         call stat_assign( var_index=stats_metadata%iNPRA, var_name="NPRA", &
    2595             :              var_description="NPRA, Droplet accretion by rain, -Ncm", var_units="(#/kg/s)", &
    2596           0 :              l_silhs=.true., grid_kind=stats_zt )
    2597           0 :         k = k + 1
    2598             : 
    2599             :       case ('NPRC')
    2600           0 :         stats_metadata%iNPRC= k
    2601             : 
    2602             :         call stat_assign( var_index=stats_metadata%iNPRC, var_name="NPRC", &
    2603             :              var_description="NPRC, Autoconversion of cloud drops, -Ncm", &
    2604           0 :              var_units="(#/kg/s)", l_silhs=.true., grid_kind=stats_zt )
    2605           0 :         k = k + 1
    2606             : 
    2607             :       case ('NPSACWI')
    2608           0 :         stats_metadata%iNPSACWI= k
    2609             : 
    2610             :         call stat_assign( var_index=stats_metadata%iNPSACWI, var_name="NPSACWI", &
    2611             :              var_description="NPSACWI, Droplet accretion by cloud ice, -Ncm", &
    2612           0 :              var_units="(#/kg/s)", l_silhs=.true., grid_kind=stats_zt )
    2613           0 :         k = k + 1
    2614             : 
    2615             :       case ('NPSACWG')
    2616           0 :         stats_metadata%iNPSACWG= k
    2617             : 
    2618             :         call stat_assign( var_index=stats_metadata%iNPSACWG, var_name="NPSACWG", &
    2619             :              var_description="NPSACWG, Collection of cloud droplets by graupel, -Ncm", &
    2620           0 :              var_units="(#/kg/s)", l_silhs=.true., grid_kind=stats_zt )
    2621           0 :         k = k + 1
    2622             : 
    2623             :       case ('NPRAI')
    2624           0 :         stats_metadata%iNPRAI= k
    2625             : 
    2626             :         call stat_assign( var_index=stats_metadata%iNPRAI, var_name="NPRAI", &
    2627             :              var_description="NPRAI, Accretion of cloud ice by snow, -Nim", &
    2628           0 :              var_units="(#/kg/s)", l_silhs=.true., grid_kind=stats_zt )
    2629           0 :         k = k + 1
    2630             : 
    2631             :       case ('NMULTS')
    2632           0 :         stats_metadata%iNMULTS= k
    2633             : 
    2634             :         call stat_assign( var_index=stats_metadata%iNMULTS, var_name="NMULTS", &
    2635             :              var_description="NMULTS, Ice multiplication due to riming of cloud droplets " &
    2636             :              // "by snow, +Nim", &
    2637           0 :              var_units="(#/kg/s)", l_silhs=.true., grid_kind=stats_zt )
    2638           0 :         k = k + 1
    2639             : 
    2640             :       case ('NMULTG')
    2641           0 :         stats_metadata%iNMULTG= k
    2642             : 
    2643             :         call stat_assign( var_index=stats_metadata%iNMULTG, var_name="NMULTG", &
    2644             :              var_description="NMULTG, Ice multiplication due to accretion of droplets " &
    2645             :              // "by graupel, +Nim", &
    2646           0 :              var_units="(#/kg/s)", l_silhs=.true., grid_kind=stats_zt )
    2647           0 :         k = k + 1
    2648             : 
    2649             :       case ('NMULTR')
    2650           0 :         stats_metadata%iNMULTR= k
    2651             : 
    2652             :         call stat_assign( var_index=stats_metadata%iNMULTR, var_name="NMULTR", &
    2653             :              var_description="Ice multiplication due to riming of rain by snow, +Nim", &
    2654           0 :              var_units="(#/kg/s)", l_silhs=.true., grid_kind=stats_zt )
    2655           0 :         k = k + 1
    2656             : 
    2657             :       case ('NMULTRG')
    2658           0 :         stats_metadata%iNMULTRG= k
    2659             : 
    2660             :         call stat_assign( var_index=stats_metadata%iNMULTRG, var_name="NMULTRG", &
    2661             :              var_description="NMULTR, Ice multiplication due to accretion of rain by " &
    2662             :              // "graupel, +Nim", &
    2663           0 :              var_units="(#/kg/s)", l_silhs=.true., grid_kind=stats_zt )
    2664           0 :         k = k + 1
    2665             : 
    2666             :       case ('NNUCCD')
    2667           0 :         stats_metadata%iNNUCCD= k
    2668             : 
    2669             :         call stat_assign( var_index=stats_metadata%iNNUCCD, var_name="NNUCCD", &
    2670             :              var_description="NNUCCD, Primary ice nucleation, freezing of aerosol, +Nim", &
    2671           0 :              var_units="(#/kg/s)", l_silhs=.true., grid_kind=stats_zt )
    2672           0 :         k = k + 1
    2673             : 
    2674             :       case ('NSUBI')
    2675           0 :         stats_metadata%iNSUBI= k
    2676             : 
    2677             :         call stat_assign( var_index=stats_metadata%iNSUBI, var_name="NSUBI", &
    2678             :              var_description="NSUBI, Loss of ice due to sublimation, -Nim", &
    2679           0 :              var_units="(#/kg/s)", l_silhs=.true., grid_kind=stats_zt )
    2680           0 :         k = k + 1
    2681             : 
    2682             :       case ('NGMLTG')
    2683           0 :         stats_metadata%iNGMLTG= k
    2684             : 
    2685             :         call stat_assign( var_index=stats_metadata%iNGMLTG, var_name="NGMLTG", &
    2686             :              var_description="NGMLTG, Loss of graupel due to melting, -Ngm", &
    2687           0 :              var_units="(#/kg/s)", l_silhs=.true., grid_kind=stats_zt )
    2688           0 :         k = k + 1
    2689             : 
    2690             :       case ('NSUBG')
    2691           0 :         stats_metadata%iNSUBG= k
    2692             : 
    2693             :         call stat_assign( var_index=stats_metadata%iNSUBG, var_name="NSUBG", &
    2694             :              var_description="NSUBG, Loss of graupel due to sublimation, -Ngm", &
    2695           0 :              var_units="(#/kg/s)", l_silhs=.true., grid_kind=stats_zt )
    2696           0 :         k = k + 1
    2697             : 
    2698             :       case ('NACT')
    2699           0 :         stats_metadata%iNACT= k
    2700             : 
    2701             :         call stat_assign( var_index=stats_metadata%iNACT, var_name="NACT", &
    2702             :              var_description="NACT, Cloud drop formation by aerosol activation, +Ncm", &
    2703           0 :              var_units="(#/kg/s)", l_silhs=.true., grid_kind=stats_zt )
    2704           0 :         k = k + 1
    2705             : 
    2706             :       case ('SIZEFIX_NR')
    2707           0 :         stats_metadata%iSIZEFIX_NR= k
    2708             : 
    2709             :         call stat_assign( var_index=stats_metadata%iSIZEFIX_NR, var_name="SIZEFIX_NR", &
    2710             :              var_description="SIZEFIX_NR, Adjust rain # conc. for large/small drops, +Nrm", &
    2711           0 :              var_units="(#/kg/s)", l_silhs=.true., grid_kind=stats_zt )
    2712           0 :         k = k + 1
    2713             : 
    2714             :       case ('SIZEFIX_NC')
    2715           0 :         stats_metadata%iSIZEFIX_NC= k
    2716             : 
    2717             :         call stat_assign( var_index=stats_metadata%iSIZEFIX_NC, var_name="SIZEFIX_NC", &
    2718             :              var_description="SIZEFIX_NC, Adjust cloud # conc. for large/small drops, +Ncm", &
    2719           0 :              var_units="(#/kg/s)", l_silhs=.true., grid_kind=stats_zt )
    2720           0 :         k = k + 1
    2721             : 
    2722             :       case ('SIZEFIX_NI')
    2723           0 :         stats_metadata%iSIZEFIX_NI= k
    2724             : 
    2725             :         call stat_assign( var_index=stats_metadata%iSIZEFIX_NI, var_name="SIZEFIX_NI", &
    2726             :              var_description="SIZEFIX_NI, Adjust ice # conc. for large/small drops, +Nim", &
    2727           0 :              var_units="(#/kg/s)", l_silhs=.true., grid_kind=stats_zt )
    2728           0 :         k = k + 1
    2729             : 
    2730             :       case ('SIZEFIX_NS')
    2731           0 :         stats_metadata%iSIZEFIX_NS= k
    2732             : 
    2733             :         call stat_assign( var_index=stats_metadata%iSIZEFIX_NS, var_name="SIZEFIX_NS", &
    2734             :              var_description="SIZEFIX_NS, Adjust snow # conc. for large/small drops, +Nsm", &
    2735           0 :              var_units="(#/kg/s)", l_silhs=.true., grid_kind=stats_zt )
    2736           0 :         k = k + 1
    2737             : 
    2738             :       case ('SIZEFIX_NG')
    2739           0 :         stats_metadata%iSIZEFIX_NG= k
    2740             : 
    2741             :         call stat_assign( var_index=stats_metadata%iSIZEFIX_NG, var_name="SIZEFIX_NG", &
    2742             :              var_description="SIZEFIX_NG, Adjust graupel # conc. for large/small drops,+Ngm",&
    2743           0 :              var_units="(#/kg/s)", l_silhs=.true., grid_kind=stats_zt )
    2744           0 :         k = k + 1
    2745             : 
    2746             :       case ('NEGFIX_NR')
    2747           0 :         stats_metadata%iNEGFIX_NR= k
    2748             : 
    2749             :         call stat_assign( var_index=stats_metadata%iNEGFIX_NR, var_name="NEGFIX_NR", &
    2750             :              var_description="NEGFIX_NR, Removal of negative rain drop number conc., -Nrm", &
    2751           0 :              var_units="(#/kg/s)", l_silhs=.true., grid_kind=stats_zt )
    2752           0 :         k = k + 1
    2753             : 
    2754             :       case ('NEGFIX_NC')
    2755           0 :         stats_metadata%iNEGFIX_NC= k
    2756             : 
    2757             :         call stat_assign( var_index=stats_metadata%iNEGFIX_NC, var_name="NEGFIX_NC", &
    2758             :              var_description="NEGFIX_NC, Removal of negative cloud drop number conc., -Ncm", &
    2759           0 :              var_units="(#/kg/s)", l_silhs=.true., grid_kind=stats_zt )
    2760           0 :         k = k + 1
    2761             : 
    2762             :       case ('NEGFIX_NI')
    2763           0 :         stats_metadata%iNEGFIX_NI= k
    2764             : 
    2765             :         call stat_assign( var_index=stats_metadata%iNEGFIX_NI, var_name="NEGFIX_NI", &
    2766             :              var_description="NEGFIX_NI, Removal of negative ice number conc., -Nim", &
    2767           0 :              var_units="(#/kg/s)", l_silhs=.true., grid_kind=stats_zt )
    2768           0 :         k = k + 1
    2769             : 
    2770             :       case ('NEGFIX_NS')
    2771           0 :         stats_metadata%iNEGFIX_NS= k
    2772             : 
    2773             :         call stat_assign( var_index=stats_metadata%iNEGFIX_NS, var_name="NEGFIX_NS", &
    2774             :              var_description="NEGFIX_NS, Removal of negative snow number conc, -Nsm", &
    2775           0 :              var_units="(#/kg/s)", l_silhs=.true., grid_kind=stats_zt )
    2776           0 :         k = k + 1
    2777             : 
    2778             :       case ('NEGFIX_NG')
    2779           0 :         stats_metadata%iNEGFIX_NG= k
    2780             : 
    2781             :         call stat_assign( var_index=stats_metadata%iNEGFIX_NG, var_name="NEGFIX_NG", &
    2782             :              var_description="NEGFIX_NG, Removal of negative graupel number conc., -Ngm", &
    2783           0 :              var_units="(#/kg/s)", l_silhs=.true., grid_kind=stats_zt )
    2784           0 :         k = k + 1
    2785             : 
    2786             :       case ('NIM_MORR_CL')
    2787           0 :         stats_metadata%iNIM_MORR_CL= k
    2788             : 
    2789             :         call stat_assign( var_index=stats_metadata%iNIM_MORR_CL, var_name="NIM_MORR_CL", &
    2790             :              var_description="NIM_MORR_CL, Clipping of large ice concentrations, -Nim", &
    2791           0 :              var_units="(#/kg/s)", l_silhs=.true., grid_kind=stats_zt )
    2792           0 :         k = k + 1
    2793             : 
    2794             :       case ('QC_INST')
    2795           0 :         stats_metadata%iQC_INST= k
    2796             : 
    2797             :         call stat_assign( var_index=stats_metadata%iQC_INST, var_name="QC_INST", &
    2798             :              var_description="QC_INST, Change in mixing ratio due to instantaneous " &
    2799             :              // "processes +rcm", &
    2800           0 :              var_units="(kg/kg/s)", l_silhs=.true., grid_kind=stats_zt )
    2801           0 :         k = k + 1
    2802             : 
    2803             :       case ('QR_INST')
    2804           0 :         stats_metadata%iQR_INST= k
    2805             : 
    2806             :         call stat_assign( var_index=stats_metadata%iQR_INST, var_name="QR_INST", &
    2807             :              var_description="QR_INST, Change in mixing ratio from instantaneous processes, +rrm",&
    2808           0 :              var_units="(kg/kg/s)", l_silhs=.true., grid_kind=stats_zt )
    2809           0 :         k = k + 1
    2810             : 
    2811             :       case ('QI_INST')
    2812           0 :         stats_metadata%iQI_INST= k
    2813             : 
    2814             :         call stat_assign( var_index=stats_metadata%iQI_INST, var_name="QI_INST", &
    2815             :              var_description="QI_INST, Change in mixing ratio from instantaneous processes +rim",&
    2816           0 :              var_units="(kg/kg/s)", l_silhs=.true., grid_kind=stats_zt )
    2817           0 :         k = k + 1
    2818             : 
    2819             :       case ('QS_INST')
    2820           0 :         stats_metadata%iQS_INST= k
    2821             : 
    2822             :         call stat_assign( var_index=stats_metadata%iQS_INST, var_name="QS_INST", &
    2823             :              var_description="QS_INST, Change in mixing ratio from instantaneous processes +rsm",&
    2824           0 :              var_units="(kg/kg/s)", l_silhs=.true., grid_kind=stats_zt )
    2825           0 :         k = k + 1
    2826             : 
    2827             :       case ('QG_INST')
    2828           0 :         stats_metadata%iQG_INST= k
    2829             : 
    2830             :         call stat_assign( var_index=stats_metadata%iQG_INST, var_name="QG_INST", &
    2831             :              var_description="QG_INST, Change in mixing ratio from instantaneous processes +rgm",&
    2832           0 :              var_units="(kg/kg/s)", l_silhs=.true., grid_kind=stats_zt )
    2833           0 :         k = k + 1
    2834             : 
    2835             :       case ('NC_INST')
    2836           0 :         stats_metadata%iNC_INST= k
    2837             : 
    2838             :         call stat_assign( var_index=stats_metadata%iNC_INST, var_name="NC_INST", &
    2839             :              var_description="NC_INST, Change in # conc. from instantaneous processes +Ncm", &
    2840           0 :              var_units="(#/kg/s)", l_silhs=.true., grid_kind=stats_zt )
    2841           0 :         k = k + 1
    2842             : 
    2843             :       case ('NR_INST')
    2844           0 :         stats_metadata%iNR_INST= k
    2845             : 
    2846             :         call stat_assign( var_index=stats_metadata%iNR_INST, var_name="NR_INST", &
    2847             :              var_description="NR_INST, Change in # conc. from instantaneous processes +Nrm", &
    2848           0 :              var_units="(#/kg/s)", l_silhs=.true., grid_kind=stats_zt )
    2849           0 :         k = k + 1
    2850             : 
    2851             :       case ('NI_INST')
    2852           0 :         stats_metadata%iNI_INST= k
    2853             : 
    2854             :         call stat_assign( var_index=stats_metadata%iNI_INST, var_name="NI_INST", &
    2855             :              var_description="NI_INST, Change in # conc. from instantaneous processes +Nim", &
    2856           0 :              var_units="(#/kg/s)", l_silhs=.true., grid_kind=stats_zt )
    2857           0 :         k = k + 1
    2858             : 
    2859             :       case ('NS_INST')
    2860           0 :         stats_metadata%iNS_INST= k
    2861             : 
    2862             :         call stat_assign( var_index=stats_metadata%iNS_INST, var_name="NS_INST", &
    2863             :              var_description="NS_INST, Change in # conc. from instantaneous processes +Nsm", &
    2864           0 :              var_units="(#/kg/s)", l_silhs=.true., grid_kind=stats_zt )
    2865           0 :         k = k + 1
    2866             : 
    2867             :       case ('NG_INST')
    2868           0 :         stats_metadata%iNG_INST= k
    2869             : 
    2870             :         call stat_assign( var_index=stats_metadata%iNG_INST, var_name="NG_INST", &
    2871             :              var_description="NG_INST, Change in # conc. from instantaneous processes +Ngm", &
    2872           0 :              var_units="(#/kg/s)", l_silhs=.true., grid_kind=stats_zt )
    2873           0 :         k = k + 1
    2874             : 
    2875             : 
    2876             :       case ('T_in_K_mc')
    2877           0 :         stats_metadata%iT_in_K_mc= k
    2878             : 
    2879             :         call stat_assign( var_index=stats_metadata%iT_in_K_mc, var_name="T_in_K_mc", &
    2880             :              var_description="T_in_K_mc, Temperature tendency from Morrison microphysics", &
    2881           0 :              var_units="(K/s)", l_silhs=.true., grid_kind=stats_zt )
    2882           0 :         k = k + 1
    2883             : 
    2884             :       case ('w_KK_evap_covar_zt')
    2885           0 :         stats_metadata%iw_KK_evap_covar_zt = k
    2886             : 
    2887             :         call stat_assign( var_index=stats_metadata%iw_KK_evap_covar_zt, var_name="w_KK_evap_covar_zt", &
    2888             :              var_description="w_KK_evap_covar_zt, Covariance of w and KK evaporation rate", &
    2889           0 :              var_units="m*(kg/kg)/s^2", l_silhs=.false., grid_kind=stats_zt )
    2890           0 :        k = k + 1
    2891             : 
    2892             :       case ('rt_KK_evap_covar_zt')
    2893           0 :         stats_metadata%irt_KK_evap_covar_zt = k
    2894             : 
    2895             :         call stat_assign( var_index=stats_metadata%irt_KK_evap_covar_zt, var_name="rt_KK_evap_covar_zt", &
    2896             :              var_description="rt_KK_evap_covar_zt, Covariance of r_t and KK evaporation rate", &
    2897           0 :              var_units="(kg/kg)^2/s", l_silhs=.false., grid_kind=stats_zt )
    2898           0 :        k = k + 1
    2899             : 
    2900             :       case ('thl_KK_evap_covar_zt')
    2901           0 :         stats_metadata%ithl_KK_evap_covar_zt = k
    2902             : 
    2903             :         call stat_assign( var_index=stats_metadata%ithl_KK_evap_covar_zt, var_name="thl_KK_evap_covar_zt", &
    2904             :              var_description="thl_KK_evap_covar_zt, Covariance of theta_l and KK " &
    2905             :              // "evaporation rate", &
    2906           0 :              var_units="K*(kg/kg)/s", l_silhs=.false., grid_kind=stats_zt )
    2907           0 :        k = k + 1
    2908             : 
    2909             :       case ('w_KK_auto_covar_zt')
    2910           0 :         stats_metadata%iw_KK_auto_covar_zt = k
    2911             : 
    2912             :         call stat_assign( var_index=stats_metadata%iw_KK_auto_covar_zt, var_name="w_KK_auto_covar_zt", &
    2913             :              var_description="w_KK_auto_covar_zt, Covariance of w and KK autoconversion rate", &
    2914           0 :              var_units="m*(kg/kg)/s^2", l_silhs=.false., grid_kind=stats_zt )
    2915           0 :        k = k + 1
    2916             : 
    2917             :       case ('rt_KK_auto_covar_zt')
    2918           0 :         stats_metadata%irt_KK_auto_covar_zt = k
    2919             : 
    2920             :         call stat_assign( var_index=stats_metadata%irt_KK_auto_covar_zt, var_name="rt_KK_auto_covar_zt", &
    2921             :              var_description="rt_KK_auto_covar_zt, Covariance of r_t and KK autoconversion rate",&
    2922           0 :              var_units="(kg/kg)^2/s", l_silhs=.false., grid_kind=stats_zt )
    2923           0 :        k = k + 1
    2924             : 
    2925             :       case ('thl_KK_auto_covar_zt')
    2926           0 :         stats_metadata%ithl_KK_auto_covar_zt = k
    2927             : 
    2928             :         call stat_assign( var_index=stats_metadata%ithl_KK_auto_covar_zt, var_name="thl_KK_auto_covar_zt", &
    2929             :              var_description="thl_KK_auto_covar_zt, Covariance of theta_l and " &
    2930             :              // "KK autoconversion rate", &
    2931           0 :              var_units="K*(kg/kg)/s", l_silhs=.false., grid_kind=stats_zt )
    2932           0 :        k = k + 1
    2933             : 
    2934             :       case ('w_KK_accr_covar_zt')
    2935           0 :         stats_metadata%iw_KK_accr_covar_zt = k
    2936             : 
    2937             :         call stat_assign( var_index=stats_metadata%iw_KK_accr_covar_zt, var_name="w_KK_accr_covar_zt", &
    2938             :              var_description="w_KK_accr_covar_zt, Covariance of w and KK accretion rate", &
    2939             :              var_units="m*(kg/kg)/s^2", &
    2940           0 :              l_silhs=.false., grid_kind=stats_zt )
    2941           0 :        k = k + 1
    2942             : 
    2943             :       case ('rt_KK_accr_covar_zt')
    2944           0 :         stats_metadata%irt_KK_accr_covar_zt = k
    2945             : 
    2946             :         call stat_assign( var_index=stats_metadata%irt_KK_accr_covar_zt, var_name="rt_KK_accr_covar_zt", &
    2947             :              var_description="rt_KK_accr_covar_zt, Covariance of r_t and KK accretion rate", &
    2948             :              var_units="(kg/kg)^2/s", &
    2949           0 :              l_silhs=.false., grid_kind=stats_zt )
    2950           0 :        k = k + 1
    2951             : 
    2952             :       case ('thl_KK_accr_covar_zt')
    2953           0 :         stats_metadata%ithl_KK_accr_covar_zt = k
    2954             : 
    2955             :         call stat_assign( var_index=stats_metadata%ithl_KK_accr_covar_zt, var_name="thl_KK_accr_covar_zt", &
    2956             :              var_description="thl_KK_accr_covar_zt, Covariance of theta_l and KK accretion rate",&
    2957           0 :              var_units="K*(kg/kg)/s", l_silhs=.false., grid_kind=stats_zt )
    2958           0 :        k = k + 1
    2959             : 
    2960             :       case ('rr_KK_mvr_covar_zt')
    2961           0 :         stats_metadata%irr_KK_mvr_covar_zt = k
    2962             : 
    2963             :         call stat_assign( var_index=stats_metadata%irr_KK_mvr_covar_zt, var_name="rr_KK_mvr_covar_zt", &
    2964             :              var_description="rr_KK_mvr_covar_zt, Covariance of r_r and KK rain drop mean " &
    2965             :              // "volume radius", &
    2966           0 :              var_units="(kg/kg)m", l_silhs=.false., grid_kind=stats_zt )
    2967           0 :        k = k + 1
    2968             : 
    2969             :       case ('Nr_KK_mvr_covar_zt')
    2970           0 :         stats_metadata%iNr_KK_mvr_covar_zt = k
    2971             : 
    2972             :         call stat_assign( var_index=stats_metadata%iNr_KK_mvr_covar_zt, var_name="Nr_KK_mvr_covar_zt", &
    2973             :              var_description="Nr_KK_mvr_covar_zt, Covariance of N_r and KK rain drop mean " &
    2974             :              // "volume radius", &
    2975           0 :              var_units="(num/kg)m", l_silhs=.false., grid_kind=stats_zt )
    2976           0 :        k = k + 1
    2977             : 
    2978             :       case ('KK_mvr_variance_zt')
    2979           0 :         stats_metadata%iKK_mvr_variance_zt = k
    2980             : 
    2981             :         call stat_assign( var_index=stats_metadata%iKK_mvr_variance_zt, var_name="KK_mvr_variance_zt", &
    2982             :              var_description="KK_mvr_variance_zt, Variance of KK rain drop mean volume radius", &
    2983           0 :              var_units="m^2", l_silhs=.false., grid_kind=stats_zt )
    2984           0 :        k = k + 1
    2985             : 
    2986             :       case ('vm_bt')
    2987           0 :         stats_metadata%ivm_bt = k
    2988             : 
    2989             :         call stat_assign( var_index=stats_metadata%ivm_bt, var_name="vm_bt", &
    2990             :              var_description="vm_bt, vm budget: vm time tendency", var_units="m s^{-2}", &
    2991           0 :              l_silhs=.false., grid_kind=stats_zt )
    2992           0 :         k = k + 1
    2993             : 
    2994             :       case ('vm_ma')
    2995           0 :         stats_metadata%ivm_ma = k
    2996             :         call stat_assign( var_index=stats_metadata%ivm_ma, var_name="vm_ma", &
    2997             :              var_description="vm_ma, vm budget: vm vertical mean advection", &
    2998           0 :              var_units="m s^{-2}", l_silhs=.false., grid_kind=stats_zt )
    2999           0 :         k = k + 1
    3000             : 
    3001             :       case ('vm_gf')
    3002           0 :         stats_metadata%ivm_gf = k
    3003             : 
    3004             :         call stat_assign( var_index=stats_metadata%ivm_gf, var_name="vm_gf", &
    3005             :              var_description="vm_gf, vm budget: vm geostrophic forcing", &
    3006           0 :              var_units="m s^{-2}", l_silhs=.false., grid_kind=stats_zt )
    3007           0 :         k = k + 1
    3008             : 
    3009             :       case ('vm_cf')
    3010           0 :         stats_metadata%ivm_cf = k
    3011             : 
    3012             :         call stat_assign( var_index=stats_metadata%ivm_cf, var_name="vm_cf", &
    3013             :              var_description="vm_cf, vm budget: vm coriolis forcing", var_units="m s^{-2}", &
    3014           0 :              l_silhs=.false., grid_kind=stats_zt )
    3015           0 :         k = k + 1
    3016             : 
    3017             :       case ('vm_ta')
    3018           0 :         stats_metadata%ivm_ta = k
    3019             : 
    3020             :         call stat_assign( var_index=stats_metadata%ivm_ta, var_name="vm_ta", &
    3021             :              var_description="vm_ta, vm budget: vm turbulent transport", &
    3022           0 :              var_units="m s^{-2}", l_silhs=.false., grid_kind=stats_zt )
    3023           0 :         k = k + 1
    3024             : 
    3025             :       case ('vm_f')
    3026           0 :         stats_metadata%ivm_f = k
    3027             :         call stat_assign( var_index=stats_metadata%ivm_f, var_name="vm_f", &
    3028             :              var_description="vm_f, vm budget: vm forcing", var_units="m s^{-2}", &
    3029           0 :              l_silhs=.false., grid_kind=stats_zt )
    3030           0 :         k = k + 1
    3031             : 
    3032             :       case ('vm_sdmp')
    3033           0 :         stats_metadata%ivm_sdmp = k
    3034             :         call stat_assign( var_index=stats_metadata%ivm_sdmp, var_name="vm_sdmp", &
    3035             :              var_description="vm_sdmp, vm budget: vm sponge damping", var_units="m s^{-2}", &
    3036           0 :              l_silhs=.false., grid_kind=stats_zt )
    3037           0 :         k = k + 1
    3038             : 
    3039             :       case ('vm_ndg')
    3040           0 :         stats_metadata%ivm_ndg = k
    3041             :         call stat_assign( var_index=stats_metadata%ivm_ndg, var_name="vm_ndg", &
    3042             :              var_description="vm_ndg, vm budget: vm nudging", var_units="m s^{-2}", &
    3043           0 :              l_silhs=.false., grid_kind=stats_zt )
    3044           0 :         k = k + 1
    3045             : 
    3046             :       case ('vm_mfl')
    3047           0 :         stats_metadata%ivm_mfl = k
    3048             :         call stat_assign( var_index=stats_metadata%ivm_mfl, var_name="vm_mfl", &
    3049             :              var_description="vm_mfl, vm budget: vm monotonic flux limiter", &
    3050             :              var_units="m s^{-2}", &
    3051           0 :              l_silhs=.false., grid_kind=stats_zt )
    3052           0 :         k = k + 1
    3053             : 
    3054             :       case ('um_bt')
    3055           0 :         stats_metadata%ium_bt = k
    3056             : 
    3057             :         call stat_assign( var_index=stats_metadata%ium_bt, var_name="um_bt", &
    3058             :              var_description="um_bt, um budget: um time tendency", var_units="m s^{-2}", &
    3059           0 :              l_silhs=.false., grid_kind=stats_zt )
    3060           0 :         k = k + 1
    3061             : 
    3062             :       case ('um_ma')
    3063           0 :         stats_metadata%ium_ma = k
    3064             : 
    3065             :         call stat_assign( var_index=stats_metadata%ium_ma, var_name="um_ma", &
    3066             :              var_description="um_ma, um budget: um vertical mean advection", &
    3067           0 :              var_units="m s^{-2}", l_silhs=.false., grid_kind=stats_zt )
    3068           0 :         k = k + 1
    3069             : 
    3070             :       case ('um_gf')
    3071           0 :         stats_metadata%ium_gf = k
    3072             :         call stat_assign( var_index=stats_metadata%ium_gf, var_name="um_gf", &
    3073             :              var_description="um_gf, um budget: um geostrophic forcing", &
    3074           0 :              var_units="m s^{-2}", l_silhs=.false., grid_kind=stats_zt )
    3075           0 :         k = k + 1
    3076             : 
    3077             :       case ('um_cf')
    3078           0 :         stats_metadata%ium_cf = k
    3079             :         call stat_assign( var_index=stats_metadata%ium_cf, var_name="um_cf", &
    3080             :              var_description="um_cf, um budget: um coriolis forcing", var_units="m s^{-2}", &
    3081           0 :              l_silhs=.false., grid_kind=stats_zt )
    3082           0 :         k = k + 1
    3083             : 
    3084             :       case ('um_ta')
    3085           0 :         stats_metadata%ium_ta = k
    3086             :         call stat_assign( var_index=stats_metadata%ium_ta, var_name="um_ta", &
    3087             :              var_description="um_ta, um budget: um turbulent advection", &
    3088           0 :              var_units="m s^{-2}", l_silhs=.false., grid_kind=stats_zt )
    3089           0 :         k = k + 1
    3090             : 
    3091             :       case ('um_f')
    3092           0 :         stats_metadata%ium_f = k
    3093             :         call stat_assign( var_index=stats_metadata%ium_f, var_name="um_f", &
    3094             :              var_description="um_f, um budget: um forcing", var_units="m s^{-2}", &
    3095           0 :              l_silhs=.false., grid_kind=stats_zt )
    3096           0 :         k = k + 1
    3097             : 
    3098             :       case ('um_sdmp')
    3099           0 :         stats_metadata%ium_sdmp = k
    3100             :         call stat_assign( var_index=stats_metadata%ium_sdmp, var_name="um_sdmp", &
    3101             :              var_description="um_sdmp, um budget: um sponge damping", var_units="m s^{-2}", &
    3102           0 :              l_silhs=.false., grid_kind=stats_zt )
    3103           0 :         k = k + 1
    3104             : 
    3105             :       case ('um_ndg')
    3106           0 :         stats_metadata%ium_ndg = k
    3107             :         call stat_assign( var_index=stats_metadata%ium_ndg, var_name="um_ndg", &
    3108             :              var_description="um_ndg, um budget: um nudging", var_units="m s^{-2}", &
    3109           0 :              l_silhs=.false., grid_kind=stats_zt )
    3110           0 :         k = k + 1
    3111             : 
    3112             :       case ('um_mfl')
    3113           0 :         stats_metadata%ium_mfl = k
    3114             :         call stat_assign( var_index=stats_metadata%ium_mfl, var_name="um_mfl", &
    3115             :              var_description="um_mfl, um budget: um monotonic flux limiter", &
    3116             :              var_units="m s^{-2}",&
    3117           0 :              l_silhs=.false., grid_kind=stats_zt )
    3118           0 :         k = k + 1
    3119             : 
    3120             :       case ('mixt_frac')
    3121           0 :         stats_metadata%imixt_frac = k
    3122             :         call stat_assign( var_index=stats_metadata%imixt_frac, var_name="mixt_frac", &
    3123             :              var_description="mixt_frac, pdf parameter: mixture fraction", var_units="count", &
    3124           0 :              l_silhs=.false., grid_kind=stats_zt )
    3125           0 :         k = k + 1
    3126             : 
    3127             :       case ('w_1')
    3128           0 :         stats_metadata%iw_1 = k
    3129             :         call stat_assign( var_index=stats_metadata%iw_1, var_name="w_1", &
    3130             :              var_description="w_1, pdf parameter: mean w of component 1", var_units="m/s", &
    3131           0 :              l_silhs=.false., grid_kind=stats_zt )
    3132             : 
    3133           0 :         k = k + 1
    3134             : 
    3135             :       case ('w_2')
    3136           0 :         stats_metadata%iw_2 = k
    3137             : 
    3138             :         call stat_assign( var_index=stats_metadata%iw_2, var_name="w_2", &
    3139             :              var_description="w_2, pdf paramete: mean w of component 2", var_units="m/s", &
    3140           0 :              l_silhs=.false., grid_kind=stats_zt )
    3141           0 :         k = k + 1
    3142             : 
    3143             :       case ('varnce_w_1')
    3144           0 :         stats_metadata%ivarnce_w_1 = k
    3145             :         call stat_assign( var_index=stats_metadata%ivarnce_w_1, var_name="varnce_w_1", &
    3146             :              var_description="varnce_w_1, pdf parameter: w variance of component 1", &
    3147           0 :              var_units="m^2/s^2", l_silhs=.false., grid_kind=stats_zt )
    3148             : 
    3149           0 :         k = k + 1
    3150             : 
    3151             :       case ('varnce_w_2')
    3152           0 :         stats_metadata%ivarnce_w_2 = k
    3153             : 
    3154             :         call stat_assign( var_index=stats_metadata%ivarnce_w_2, var_name="varnce_w_2", &
    3155             :              var_description="varnce_w_2, pdf parameter: w variance of component 2", &
    3156           0 :              var_units="m^2/s^2", l_silhs=.false., grid_kind=stats_zt )
    3157           0 :         k = k + 1
    3158             : 
    3159             :       case ('thl_1')
    3160           0 :         stats_metadata%ithl_1 = k
    3161             : 
    3162             :         call stat_assign( var_index=stats_metadata%ithl_1, var_name="thl_1", &
    3163             :              var_description="thl_1, pdf parameter: mean thl of component 1", var_units="K", &
    3164           0 :              l_silhs=.false., grid_kind=stats_zt )
    3165             : 
    3166           0 :         k = k + 1
    3167             : 
    3168             :       case ('thl_2')
    3169           0 :         stats_metadata%ithl_2 = k
    3170             : 
    3171             :         call stat_assign( var_index=stats_metadata%ithl_2, var_name="thl_2", &
    3172             :              var_description="thl_2, pdf parameter: mean thl of component 2", var_units="K", &
    3173           0 :              l_silhs=.false., grid_kind=stats_zt )
    3174           0 :         k = k + 1
    3175             : 
    3176             :       case ('varnce_thl_1')
    3177           0 :         stats_metadata%ivarnce_thl_1 = k
    3178             : 
    3179             :         call stat_assign( var_index=stats_metadata%ivarnce_thl_1, var_name="varnce_thl_1", &
    3180             :              var_description="varnce_thl_1, pdf parameter: thl variance of component 1", &
    3181             :              var_units="K^2", &
    3182           0 :              l_silhs=.false., grid_kind=stats_zt )
    3183             : 
    3184           0 :         k = k + 1
    3185             : 
    3186             :       case ('varnce_thl_2')
    3187           0 :         stats_metadata%ivarnce_thl_2 = k
    3188             :         call stat_assign( var_index=stats_metadata%ivarnce_thl_2, var_name="varnce_thl_2", &
    3189             :              var_description="varnce_thl_2, pdf parameter: thl variance of component 2", &
    3190             :              var_units="K^2", &
    3191           0 :              l_silhs=.false., grid_kind=stats_zt )
    3192             : 
    3193           0 :         k = k + 1
    3194             : 
    3195             :       case ('rt_1')
    3196           0 :         stats_metadata%irt_1 = k
    3197             :         call stat_assign( var_index=stats_metadata%irt_1, var_name="rt_1", &
    3198             :              var_description="rt_1, pdf parameter: mean rt of component 1", var_units="kg/kg", &
    3199           0 :              l_silhs=.false., grid_kind=stats_zt )
    3200             : 
    3201           0 :         k = k + 1
    3202             : 
    3203             :       case ('rt_2')
    3204           0 :         stats_metadata%irt_2 = k
    3205             : 
    3206             :         call stat_assign( var_index=stats_metadata%irt_2, var_name="rt_2", &
    3207             :              var_description="rt_2, pdf parameter: mean rt of component 2", var_units="kg/kg", &
    3208           0 :              l_silhs=.false., grid_kind=stats_zt )
    3209           0 :         k = k + 1
    3210             : 
    3211             :       case ('varnce_rt_1')
    3212           0 :         stats_metadata%ivarnce_rt_1 = k
    3213             :         call stat_assign( var_index=stats_metadata%ivarnce_rt_1, var_name="varnce_rt_1", &
    3214             :              var_description="varnce_rt_1, pdf parameter: rt variance of component 1", &
    3215           0 :              var_units="(kg^2)/(kg^2)", l_silhs=.false., grid_kind=stats_zt )
    3216           0 :         k = k + 1
    3217             : 
    3218             :       case ('varnce_rt_2')
    3219           0 :         stats_metadata%ivarnce_rt_2 = k
    3220             : 
    3221             :         call stat_assign( var_index=stats_metadata%ivarnce_rt_2, var_name="varnce_rt_2", &
    3222             :              var_description="varnce_rt_2, pdf parameter: rt variance of component 2", &
    3223           0 :              var_units="(kg^2)/(kg^2)", l_silhs=.false., grid_kind=stats_zt )
    3224           0 :         k = k + 1
    3225             : 
    3226             :       case ('rc_1')
    3227           0 :         stats_metadata%irc_1 = k
    3228             : 
    3229             :         call stat_assign( var_index=stats_metadata%irc_1, var_name="rc_1", &
    3230             :              var_description="rc_1, pdf parameter: mean rc of component 1", var_units="kg/kg", &
    3231           0 :              l_silhs=.false., grid_kind=stats_zt )
    3232           0 :         k = k + 1
    3233             : 
    3234             :       case ('rc_2')
    3235           0 :         stats_metadata%irc_2 = k
    3236             : 
    3237             :         call stat_assign( var_index=stats_metadata%irc_2, var_name="rc_2", &
    3238             :              var_description="rc_2, pdf parameter: mean rc of component 2", var_units="kg/kg", &
    3239           0 :              l_silhs=.false., grid_kind=stats_zt )
    3240           0 :         k = k + 1
    3241             : 
    3242             :       case ('rsatl_1')
    3243           0 :         stats_metadata%irsatl_1 = k
    3244             : 
    3245             :         call stat_assign( var_index=stats_metadata%irsatl_1, var_name="rsatl_1", &
    3246             :              var_description="rsatl_1, pdf parameter: sat mix rat based on tl1", &
    3247           0 :              var_units="kg/kg", l_silhs=.false., grid_kind=stats_zt )
    3248           0 :         k = k + 1
    3249             : 
    3250             :       case ('rsatl_2')
    3251           0 :         stats_metadata%irsatl_2 = k
    3252             : 
    3253             :         call stat_assign( var_index=stats_metadata%irsatl_2, var_name="rsatl_2", &
    3254             :              var_description="rsatl_2, pdf parameter: sat mix rat based on tl2", &
    3255           0 :              var_units="kg/kg", l_silhs=.false., grid_kind=stats_zt )
    3256           0 :         k = k + 1
    3257             : 
    3258             :       case ('cloud_frac_1')
    3259           0 :         stats_metadata%icloud_frac_1 = k
    3260             :         call stat_assign( var_index=stats_metadata%icloud_frac_1, var_name="cloud_frac_1", &
    3261             :              var_description="cloud_frac_1, pdf parameter cloud_frac_1", var_units="-", &
    3262           0 :              l_silhs=.false., grid_kind=stats_zt )
    3263           0 :         k = k + 1
    3264             : 
    3265             :       case ('cloud_frac_2')
    3266           0 :         stats_metadata%icloud_frac_2 = k
    3267             : 
    3268             :         call stat_assign( var_index=stats_metadata%icloud_frac_2, var_name="cloud_frac_2", &
    3269             :              var_description="cloud_frac_2, pdf parameter cloud_frac_2", var_units="-", &
    3270           0 :              l_silhs=.false., grid_kind=stats_zt )
    3271           0 :         k = k + 1
    3272             : 
    3273             :       case ('chi_1')
    3274           0 :         stats_metadata%ichi_1 = k
    3275             : 
    3276             :         call stat_assign( var_index=stats_metadata%ichi_1, var_name="chi_1", &
    3277             :              var_description="chi_1, pdf parameter: Mellor's s (extended liq) for component 1", &
    3278           0 :              var_units="kg/kg", l_silhs=.false., grid_kind=stats_zt )
    3279           0 :         k = k + 1
    3280             : 
    3281             :       case ('chi_2')
    3282           0 :         stats_metadata%ichi_2 = k
    3283             : 
    3284             :         call stat_assign( var_index=stats_metadata%ichi_2, var_name="chi_2", &
    3285             :              var_description="chi_2, pdf parameter: Mellor's s (extended liq) for component 2", &
    3286           0 :              var_units="kg/kg", l_silhs=.false., grid_kind=stats_zt )
    3287           0 :         k = k + 1
    3288             : 
    3289             :       case ('stdev_chi_1')
    3290           0 :         stats_metadata%istdev_chi_1 = k
    3291             : 
    3292             :         call stat_assign( var_index=stats_metadata%istdev_chi_1, var_name="stdev_chi_1", &
    3293             :              var_description="stdev_chi_1, pdf parameter: Std dev of chi_1", var_units="kg/kg", &
    3294           0 :              l_silhs=.false., grid_kind=stats_zt )
    3295           0 :         k = k + 1
    3296             : 
    3297             :       case ('stdev_chi_2')
    3298           0 :         stats_metadata%istdev_chi_2 = k
    3299             : 
    3300             :         call stat_assign( var_index=stats_metadata%istdev_chi_2, var_name="stdev_chi_2", &
    3301             :              var_description="stdev_chi_2, pdf parameter: Std dev of chi_2", var_units="kg/kg", &
    3302           0 :              l_silhs=.false., grid_kind=stats_zt )
    3303           0 :         k = k + 1
    3304             : 
    3305             :       case ('chip2')
    3306           0 :         stats_metadata%ichip2 = k
    3307             :         call stat_assign( var_index=stats_metadata%ichip2, var_name="chip2", &
    3308             :              var_description="chip2, Variance of chi(s) (overall)", var_units="(kg/kg)^2", &
    3309           0 :              l_silhs=.false., grid_kind=stats_zt )
    3310           0 :         k = k + 1
    3311             : 
    3312             :       case ('stdev_eta_1')
    3313           0 :         stats_metadata%istdev_eta_1 = k
    3314             : 
    3315             :         call stat_assign( var_index=stats_metadata%istdev_eta_1, var_name="stdev_eta_1", &
    3316             :              var_description="stdev_eta_1, Standard dev. of eta(t) (1st PDF component)", &
    3317           0 :              var_units="kg/kg", l_silhs=.false., grid_kind=stats_zt )
    3318           0 :         k = k + 1
    3319             : 
    3320             :       case ('stdev_eta_2')
    3321           0 :         stats_metadata%istdev_eta_2 = k
    3322             : 
    3323             :         call stat_assign( var_index=stats_metadata%istdev_eta_2, var_name="stdev_eta_2", &
    3324             :              var_description="stdev_eta_2, Standard dev. of eta(t) (2nd PDF component)", &
    3325           0 :              var_units="kg/kg", l_silhs=.false., grid_kind=stats_zt )
    3326           0 :         k = k + 1
    3327             : 
    3328             :       case ('covar_chi_eta_1')
    3329           0 :         stats_metadata%icovar_chi_eta_1 = k
    3330             : 
    3331             :         call stat_assign( var_index=stats_metadata%icovar_chi_eta_1, var_name="covar_chi_eta_1", &
    3332             :              var_description="covar_chi_eta_1, Covariance of chi(s) and eta(t) " &
    3333             :              // "(1st PDF component)", &
    3334           0 :              var_units="kg^2/kg^2", l_silhs=.false., grid_kind=stats_zt )
    3335           0 :         k = k + 1
    3336             : 
    3337             :       case ('covar_chi_eta_2')
    3338           0 :         stats_metadata%icovar_chi_eta_2 = k
    3339             : 
    3340             :         call stat_assign( var_index=stats_metadata%icovar_chi_eta_2, var_name="covar_chi_eta_2", &
    3341             :              var_description="covar_chi_eta_2, Covariance of chi(s) and eta(t) " &
    3342             :              // "(2nd PDF component)", &
    3343           0 :              var_units="kg^2/kg^2", l_silhs=.false., grid_kind=stats_zt )
    3344           0 :         k = k + 1
    3345             : 
    3346             :       case ('corr_w_chi_1')
    3347           0 :         stats_metadata%icorr_w_chi_1 = k
    3348             : 
    3349             :         call stat_assign( var_index=stats_metadata%icorr_w_chi_1, var_name="corr_w_chi_1", &
    3350             :                           var_description="corr_w_chi_1, Correlation of w and chi (s)" &
    3351             :                           // " (1st PDF component)", var_units="-", &
    3352           0 :                           l_silhs=.false., grid_kind=stats_zt )
    3353           0 :         k = k + 1
    3354             : 
    3355             :       case ('corr_w_chi_2')
    3356           0 :         stats_metadata%icorr_w_chi_2 = k
    3357             : 
    3358             :         call stat_assign( var_index=stats_metadata%icorr_w_chi_2, var_name="corr_w_chi_2", &
    3359             :                           var_description="corr_w_chi_2, Correlation of w and chi (s)" &
    3360             :                           // " (2nd PDF component)", var_units="-", &
    3361           0 :                           l_silhs=.false., grid_kind=stats_zt )
    3362           0 :         k = k + 1
    3363             : 
    3364             :       case ('corr_w_eta_1')
    3365           0 :         stats_metadata%icorr_w_eta_1 = k
    3366             : 
    3367             :         call stat_assign( var_index=stats_metadata%icorr_w_eta_1, var_name="corr_w_eta_1", &
    3368             :                           var_description="corr_w_eta_1, Correlation of w and eta (t)" &
    3369             :                           // " (1st PDF component)", var_units="-", &
    3370           0 :                           l_silhs=.false., grid_kind=stats_zt )
    3371           0 :         k = k + 1
    3372             : 
    3373             :       case ('corr_w_eta_2')
    3374           0 :         stats_metadata%icorr_w_eta_2 = k
    3375             : 
    3376             :         call stat_assign( var_index=stats_metadata%icorr_w_eta_2, var_name="corr_w_eta_2", &
    3377             :                           var_description="corr_w_eta_2, Correlation of w and eta (t)" &
    3378             :                           // " (2nd PDF component)", var_units="-", &
    3379           0 :                           l_silhs=.false., grid_kind=stats_zt )
    3380           0 :         k = k + 1
    3381             : 
    3382             :       case ('corr_chi_eta_1')
    3383           0 :         stats_metadata%icorr_chi_eta_1 = k
    3384             : 
    3385             :         call stat_assign( var_index=stats_metadata%icorr_chi_eta_1, &
    3386             :                           var_name="corr_chi_eta_1", &
    3387             :                           var_description="corr_chi_eta_1, Correlation of chi (s) and" &
    3388             :                           // " eta (t) (1st PDF component)", &
    3389             :                           var_units="-", &
    3390           0 :                           l_silhs=.false., grid_kind=stats_zt )
    3391           0 :         k = k + 1
    3392             : 
    3393             :       case ('corr_chi_eta_2')
    3394           0 :         stats_metadata%icorr_chi_eta_2 = k
    3395             : 
    3396             :         call stat_assign( var_index=stats_metadata%icorr_chi_eta_2, &
    3397             :                           var_name="corr_chi_eta_2", &
    3398             :                           var_description="corr_chi_eta_2, Correlation of chi (s) and" &
    3399             :                           // " eta (t) (2nd PDF component)", &
    3400             :                           var_units="-", &
    3401           0 :                           l_silhs=.false., grid_kind=stats_zt )
    3402           0 :         k = k + 1
    3403             : 
    3404             :       case ('corr_w_rt_1')
    3405           0 :         stats_metadata%icorr_w_rt_1 = k
    3406             : 
    3407             :         call stat_assign( var_index=stats_metadata%icorr_w_rt_1, var_name="corr_w_rt_1", &
    3408             :                           var_description="corr_w_rt_1, Correlation of w and rt" &
    3409             :                           // " (1st PDF component)", var_units="-", &
    3410           0 :                           l_silhs=.false., grid_kind=stats_zt )
    3411           0 :         k = k + 1
    3412             : 
    3413             :       case ('corr_w_rt_2')
    3414           0 :         stats_metadata%icorr_w_rt_2 = k
    3415             : 
    3416             :         call stat_assign( var_index=stats_metadata%icorr_w_rt_2, var_name="corr_w_rt_2", &
    3417             :                           var_description="corr_w_rt_2, Correlation of w and rt" &
    3418             :                           // " (2nd PDF component)", var_units="-", &
    3419           0 :                           l_silhs=.false., grid_kind=stats_zt )
    3420           0 :         k = k + 1
    3421             : 
    3422             :       case ('corr_w_thl_1')
    3423           0 :         stats_metadata%icorr_w_thl_1 = k
    3424             : 
    3425             :         call stat_assign( var_index=stats_metadata%icorr_w_thl_1, var_name="corr_w_thl_1", &
    3426             :                           var_description="corr_w_thl_1, Correlation of w and thl" &
    3427             :                           // " (1st PDF component)", var_units="-", &
    3428           0 :                           l_silhs=.false., grid_kind=stats_zt )
    3429           0 :         k = k + 1
    3430             : 
    3431             :       case ('corr_w_thl_2')
    3432           0 :         stats_metadata%icorr_w_thl_2 = k
    3433             : 
    3434             :         call stat_assign( var_index=stats_metadata%icorr_w_thl_2, var_name="corr_w_thl_2", &
    3435             :                           var_description="corr_w_thl_2, Correlation of w and thl" &
    3436             :                           // " (2nd PDF component)", var_units="-", &
    3437           0 :                           l_silhs=.false., grid_kind=stats_zt )
    3438           0 :         k = k + 1
    3439             : 
    3440             :       case ('corr_rt_thl_1')
    3441           0 :         stats_metadata%icorr_rt_thl_1 = k
    3442             : 
    3443             :         call stat_assign( var_index=stats_metadata%icorr_rt_thl_1, var_name="corr_rt_thl_1", &
    3444             :                           var_description="corr_rt_thl_1, Correlation of rt and thl" &
    3445             :                           // " (1st PDF component)", var_units="-", &
    3446           0 :                           l_silhs=.false., grid_kind=stats_zt )
    3447           0 :         k = k + 1
    3448             : 
    3449             :       case ('corr_rt_thl_2')
    3450           0 :         stats_metadata%icorr_rt_thl_2 = k
    3451             : 
    3452             :         call stat_assign( var_index=stats_metadata%icorr_rt_thl_2, var_name="corr_rt_thl_2", &
    3453             :                           var_description="corr_rt_thl_2, Correlation of rt and thl" &
    3454             :                           // " (2nd PDF component)", var_units="-", &
    3455           0 :                           l_silhs=.false., grid_kind=stats_zt )
    3456           0 :         k = k + 1
    3457             : 
    3458             :       case ('crt_1')
    3459           0 :         stats_metadata%icrt_1 = k
    3460             : 
    3461             :         call stat_assign( var_index=stats_metadata%icrt_1, var_name="crt_1", &
    3462             :                           var_description="crt_1, Coefficient on rt in chi/eta" &
    3463             :                           // " equations (1st PDF comp.)", &
    3464           0 :                           var_units="-", l_silhs=.false., grid_kind=stats_zt )
    3465           0 :         k = k + 1
    3466             : 
    3467             :       case ('crt_2')
    3468           0 :         stats_metadata%icrt_2 = k
    3469             : 
    3470             :         call stat_assign( var_index=stats_metadata%icrt_2, var_name="crt_2", &
    3471             :                           var_description="crt_2, Coefficient on rt in chi/eta" &
    3472             :                           // " equations (2nd PDF comp.)", &
    3473           0 :                           var_units="-", l_silhs=.false., grid_kind=stats_zt )
    3474           0 :         k = k + 1
    3475             : 
    3476             :       case ('cthl_1')
    3477           0 :         stats_metadata%icthl_1 = k
    3478             : 
    3479             :         call stat_assign( var_index=stats_metadata%icthl_1, var_name="cthl_1", &
    3480             :                           var_description="cthl_1, Coefficient on theta-l in chi/eta" &
    3481             :                           // " equations (1st PDF comp.)", &
    3482           0 :                           var_units="kg/kg/K", l_silhs=.false., grid_kind=stats_zt )
    3483           0 :         k = k + 1
    3484             : 
    3485             :       case ('cthl_2')
    3486           0 :         stats_metadata%icthl_2 = k
    3487             : 
    3488             :         call stat_assign( var_index=stats_metadata%icthl_2, var_name="cthl_2", &
    3489             :                           var_description="cthl_2, Coefficient on theta-l in chi/eta" &
    3490             :                           // " equations (2nd PDF comp.)", &
    3491           0 :                           var_units="kg/kg/K", l_silhs=.false., grid_kind=stats_zt )
    3492           0 :         k = k + 1
    3493             : 
    3494             :       case('F_w')
    3495           0 :         stats_metadata%iF_w = k
    3496             : 
    3497             :         call stat_assign( var_index=stats_metadata%iF_w, var_name="F_w", &
    3498             :                           var_description="F_w, Parameter for the spread of the" &
    3499             :                           // " PDF component means of w (new PDF)", &
    3500           0 :                           var_units="-", l_silhs=.false., grid_kind=stats_zt )
    3501           0 :         k = k + 1
    3502             : 
    3503             :       case('F_rt')
    3504           0 :         stats_metadata%iF_rt = k
    3505             : 
    3506             :         call stat_assign( var_index=stats_metadata%iF_rt, var_name="F_rt", &
    3507             :                           var_description="F_rt, Parameter for the spread of the" &
    3508             :                           // " PDF component means of rt (new PDF)", &
    3509           0 :                           var_units="-", l_silhs=.false., grid_kind=stats_zt )
    3510           0 :         k = k + 1
    3511             : 
    3512             :       case('F_thl')
    3513           0 :         stats_metadata%iF_thl = k
    3514             : 
    3515             :         call stat_assign( var_index=stats_metadata%iF_thl, var_name="F_thl", &
    3516             :                           var_description="F_thl, Parameter for the spread of the" &
    3517             :                           // " PDF component means of thl (new PDF)", &
    3518           0 :                           var_units="-", l_silhs=.false., grid_kind=stats_zt )
    3519           0 :         k = k + 1
    3520             : 
    3521             :       case('min_F_w')
    3522           0 :         stats_metadata%imin_F_w = k
    3523             : 
    3524             :         call stat_assign( var_index=stats_metadata%imin_F_w, var_name="min_F_w", &
    3525             :                           var_description="min_F_w, Minimum allowable value of the" &
    3526             :                           // " parameter F_w (new PDF)", &
    3527           0 :                           var_units="-", l_silhs=.false., grid_kind=stats_zt )
    3528           0 :         k = k + 1
    3529             : 
    3530             :       case('max_F_w')
    3531           0 :         stats_metadata%imax_F_w = k
    3532             : 
    3533             :         call stat_assign( var_index=stats_metadata%imax_F_w, var_name="max_F_w", &
    3534             :                           var_description="max_F_w, Maximum allowable value of the" &
    3535             :                           // " parameter F_w (new PDF)", &
    3536           0 :                           var_units="-", l_silhs=.false., grid_kind=stats_zt )
    3537           0 :         k = k + 1
    3538             : 
    3539             :       case('min_F_rt')
    3540           0 :         stats_metadata%imin_F_rt = k
    3541             : 
    3542             :         call stat_assign( var_index=stats_metadata%imin_F_rt, var_name="min_F_rt", &
    3543             :                           var_description="min_F_rt, Minimum allowable value of the" &
    3544             :                           // " parameter F_rt (new PDF)", &
    3545           0 :                           var_units="-", l_silhs=.false., grid_kind=stats_zt )
    3546           0 :         k = k + 1
    3547             : 
    3548             :       case('max_F_rt')
    3549           0 :         stats_metadata%imax_F_rt = k
    3550             : 
    3551             :         call stat_assign( var_index=stats_metadata%imax_F_rt, var_name="max_F_rt", &
    3552             :                           var_description="max_F_rt, Maximum allowable value of the" &
    3553             :                           // " parameter F_rt (new PDF)", &
    3554           0 :                           var_units="-", l_silhs=.false., grid_kind=stats_zt )
    3555           0 :         k = k + 1
    3556             : 
    3557             :       case('min_F_thl')
    3558           0 :         stats_metadata%imin_F_thl = k
    3559             : 
    3560             :         call stat_assign( var_index=stats_metadata%imin_F_thl, var_name="min_F_thl", &
    3561             :                           var_description="min_F_thl, Minimum allowable value of the" &
    3562             :                           // " parameter F_thl (new PDF)", &
    3563           0 :                           var_units="-", l_silhs=.false., grid_kind=stats_zt )
    3564           0 :         k = k + 1
    3565             : 
    3566             :       case('max_F_thl')
    3567           0 :         stats_metadata%imax_F_thl = k
    3568             : 
    3569             :         call stat_assign( var_index=stats_metadata%imax_F_thl, var_name="max_F_thl", &
    3570             :                           var_description="max_F_thl, Maximum allowable value of the" &
    3571             :                           // " parameter F_thl (new PDF)", &
    3572           0 :                           var_units="-", l_silhs=.false., grid_kind=stats_zt )
    3573           0 :         k = k + 1
    3574             : 
    3575             :       case ( 'coef_wprtp2_implicit' )
    3576           0 :         stats_metadata%icoef_wprtp2_implicit = k
    3577             :         call stat_assign( var_index=stats_metadata%icoef_wprtp2_implicit, &
    3578             :                           var_name="coef_wprtp2_implicit", &
    3579             :                           var_description="coef_wprtp2_implicit, wprtp2" &
    3580             :                                           // " = coef_wprtp2_implicit" &
    3581             :                                           // " * rtp2" &
    3582             :                                           // " + term_wprtp2_explicit", &
    3583           0 :                           var_units="m/s", l_silhs=.false., grid_kind=stats_zt )
    3584           0 :         k = k + 1
    3585             : 
    3586             :       case ( 'term_wprtp2_explicit' )
    3587           0 :         stats_metadata%iterm_wprtp2_explicit = k
    3588             :         call stat_assign( var_index=stats_metadata%iterm_wprtp2_explicit, &
    3589             :                           var_name="term_wprtp2_explicit", &
    3590             :                           var_description="term_wprtp2_explicit, wprtp2" &
    3591             :                                           // " = coef_wprtp2_implicit" &
    3592             :                                           // " * rtp2" &
    3593             :                                           // " + term_wprtp2_explicit", &
    3594             :                           var_units="m/s kg^2/kg^2", l_silhs=.false., &
    3595           0 :                           grid_kind=stats_zt )
    3596           0 :         k = k + 1
    3597             : 
    3598             :       case ( 'coef_wpthlp2_implicit' )
    3599           0 :         stats_metadata%icoef_wpthlp2_implicit = k
    3600             :         call stat_assign( var_index=stats_metadata%icoef_wpthlp2_implicit, &
    3601             :                           var_name="coef_wpthlp2_implicit", &
    3602             :                           var_description="coef_wpthlp2_implicit, wpthlp2" &
    3603             :                                           // " = coef_wpthlp2_implicit" &
    3604             :                                           // " * thlp2" &
    3605             :                                           // " + term_wpthlp2_explicit", &
    3606           0 :                           var_units="m/s", l_silhs=.false., grid_kind=stats_zt )
    3607           0 :         k = k + 1
    3608             : 
    3609             :       case ( 'term_wpthlp2_explicit' )
    3610           0 :         stats_metadata%iterm_wpthlp2_explicit = k
    3611             :         call stat_assign( var_index=stats_metadata%iterm_wpthlp2_explicit, &
    3612             :                           var_name="term_wpthlp2_explicit", &
    3613             :                           var_description="term_wpthlp2_explicit, wpthlp2" &
    3614             :                                           // " = coef_wpthlp2_implicit" &
    3615             :                                           // " * thlp2" &
    3616             :                                           // " + term_wpthlp2_explicit", &
    3617             :                           var_units="m/s K^2", l_silhs=.false., &
    3618           0 :                           grid_kind=stats_zt )
    3619           0 :         k = k + 1
    3620             : 
    3621             :       case ( 'coef_wprtpthlp_implicit' )
    3622           0 :         stats_metadata%icoef_wprtpthlp_implicit = k
    3623             :         call stat_assign( var_index=stats_metadata%icoef_wprtpthlp_implicit, &
    3624             :                           var_name="coef_wprtpthlp_implicit", &
    3625             :                           var_description="coef_wprtpthlp_implicit, wprtpthlp" &
    3626             :                                           // " = coef_wprtpthlp_implicit" &
    3627             :                                           // " * rtpthlp" &
    3628             :                                           // " + term_wprtpthlp_explicit", &
    3629           0 :                           var_units="m/s", l_silhs=.false., grid_kind=stats_zt )
    3630           0 :         k = k + 1
    3631             : 
    3632             :       case ( 'term_wprtpthlp_explicit' )
    3633           0 :         stats_metadata%iterm_wprtpthlp_explicit = k
    3634             :         call stat_assign( var_index=stats_metadata%iterm_wprtpthlp_explicit, &
    3635             :                           var_name="term_wprtpthlp_explicit", &
    3636             :                           var_description="term_wprtpthlp_explicit, wprtpthlp" &
    3637             :                                           // " = coef_wprtpthlp_implicit" &
    3638             :                                           // " * rtpthlp" &
    3639             :                                           // " + term_wprtpthlp_explicit]", &
    3640             :                           var_units="m/s (kg/kg) K", l_silhs=.false., &
    3641           0 :                           grid_kind=stats_zt )
    3642           0 :         k = k + 1
    3643             : 
    3644             :       case ( 'coef_wp2rtp_implicit' )
    3645           0 :         stats_metadata%icoef_wp2rtp_implicit = k
    3646             :         call stat_assign( var_index=stats_metadata%icoef_wp2rtp_implicit, &
    3647             :                           var_name="coef_wp2rtp_implicit", &
    3648             :                           var_description="coef_wp2rtp_implicit, wp2rtp" &
    3649             :                                           // " = coef_wp2rtp_implicit" &
    3650             :                                           // " * wprtp" &
    3651             :                                           // " + term_wp2rtp_explicit", &
    3652           0 :                           var_units="m/s", l_silhs=.false., grid_kind=stats_zt )
    3653           0 :         k = k + 1
    3654             : 
    3655             :       case ( 'term_wp2rtp_explicit' )
    3656           0 :         stats_metadata%iterm_wp2rtp_explicit = k
    3657             :         call stat_assign( var_index=stats_metadata%iterm_wp2rtp_explicit, &
    3658             :                           var_name="term_wp2rtp_explicit", &
    3659             :                           var_description="term_wp2rtp_explicit, wp2rtp" &
    3660             :                                           // " = coef_wp2rtp_implicit" &
    3661             :                                           // " * wprtp" &
    3662             :                                           // " + term_wp2rtp_explicit", &
    3663             :                           var_units="m^2/s^2 kg/kg", l_silhs=.false., &
    3664           0 :                           grid_kind=stats_zt )
    3665           0 :         k = k + 1
    3666             : 
    3667             :       case ( 'coef_wp2thlp_implicit' )
    3668           0 :         stats_metadata%icoef_wp2thlp_implicit = k
    3669             :         call stat_assign( var_index=stats_metadata%icoef_wp2thlp_implicit, &
    3670             :                           var_name="coef_wp2thlp_implicit", &
    3671             :                           var_description="coef_wp2thlp_implicit, wp2thlp" &
    3672             :                                           // " = coef_wp2thlp_implicit" &
    3673             :                                           // " * wpthlp" &
    3674             :                                           // " + term_wp2thlp_explicit", &
    3675           0 :                           var_units="m/s", l_silhs=.false., grid_kind=stats_zt )
    3676           0 :         k = k + 1
    3677             : 
    3678             :       case ( 'term_wp2thlp_explicit' )
    3679           0 :         stats_metadata%iterm_wp2thlp_explicit = k
    3680             :         call stat_assign( var_index=stats_metadata%iterm_wp2thlp_explicit, &
    3681             :                           var_name="term_wp2thlp_explicit", &
    3682             :                           var_description="term_wp2thlp_explicit, wp2thlp" &
    3683             :                                           // " = coef_wp2thlp_implicit" &
    3684             :                                           // " * wpthlp" &
    3685             :                                           // " + term_wp2thlp_explicit", &
    3686             :                           var_units="m^2/s^2 K", l_silhs=.false., &
    3687           0 :                           grid_kind=stats_zt )
    3688           0 :         k = k + 1
    3689             : 
    3690             :       case('wp2_zt')
    3691           0 :         stats_metadata%iwp2_zt = k
    3692             : 
    3693             :         call stat_assign( var_index=stats_metadata%iwp2_zt, var_name="wp2_zt", &
    3694             :              var_description="wp2_zt, w'^2 interpolated to thermodynamic levels", &
    3695           0 :              var_units="m^2/s^2", l_silhs=.false., grid_kind=stats_zt )
    3696           0 :         k = k + 1
    3697             : 
    3698             :       case('thlp2_zt')
    3699           0 :         stats_metadata%ithlp2_zt = k
    3700             : 
    3701             :         call stat_assign( var_index=stats_metadata%ithlp2_zt, var_name="thlp2_zt", &
    3702             :              var_description="thlp2_zt, thl'^2 interpolated to thermodynamic levels", &
    3703           0 :              var_units="K^2", l_silhs=.false., grid_kind=stats_zt )
    3704           0 :         k = k + 1
    3705             : 
    3706             :       case('wpthlp_zt')
    3707           0 :         stats_metadata%iwpthlp_zt = k
    3708             : 
    3709             :         call stat_assign( var_index=stats_metadata%iwpthlp_zt, var_name="wpthlp_zt", &
    3710             :              var_description="wpthlp_zt, w'thl' interpolated to thermodynamic levels", &
    3711           0 :              var_units="(m K)/s", l_silhs=.false., grid_kind=stats_zt )
    3712           0 :         k = k + 1
    3713             : 
    3714             :       case('wprtp_zt')
    3715           0 :         stats_metadata%iwprtp_zt = k
    3716             : 
    3717             :         call stat_assign( var_index=stats_metadata%iwprtp_zt, var_name="wprtp_zt", &
    3718             :              var_description="wprtp_zt, w'rt' interpolated to thermodynamic levels", &
    3719           0 :              var_units="(m kg)/(s kg)", l_silhs=.false., grid_kind=stats_zt )
    3720           0 :         k = k + 1
    3721             : 
    3722             :       case('rtp2_zt')
    3723           0 :         stats_metadata%irtp2_zt = k
    3724             : 
    3725             :         call stat_assign( var_index=stats_metadata%irtp2_zt, var_name="rtp2_zt", &
    3726             :              var_description="rtp2_zt, rt'^2 interpolated to thermodynamic levels", &
    3727           0 :              var_units="(kg/kg)^2", l_silhs=.false., grid_kind=stats_zt )
    3728           0 :         k = k + 1
    3729             : 
    3730             :       case('rtpthlp_zt')
    3731           0 :         stats_metadata%irtpthlp_zt = k
    3732             : 
    3733             :         call stat_assign( var_index=stats_metadata%irtpthlp_zt, var_name="rtpthlp_zt", &
    3734             :              var_description="rtpthlp_zt, rt'thl' interpolated to thermodynamic levels", &
    3735           0 :              var_units="(kg K)/kg", l_silhs=.false., grid_kind=stats_zt )
    3736           0 :         k = k + 1
    3737             : 
    3738             :       case ('up2_zt')
    3739           0 :         stats_metadata%iup2_zt = k
    3740             :         call stat_assign( var_index=stats_metadata%iup2_zt, var_name="up2_zt", &
    3741             :              var_description="up2_zt, u'^2 interpolated to thermodynamic levels", &
    3742           0 :              var_units="m^2/s^2", l_silhs=.false., grid_kind=stats_zt )
    3743           0 :         k = k + 1
    3744             : 
    3745             :       case ('vp2_zt')
    3746           0 :         stats_metadata%ivp2_zt = k
    3747             :         call stat_assign( var_index=stats_metadata%ivp2_zt, var_name="vp2_zt", &
    3748             :              var_description="vp2_zt, v'^2 interpolated to thermodynamic levels", &
    3749           0 :              var_units="m^2/s^2", l_silhs=.false., grid_kind=stats_zt )
    3750           0 :         k = k + 1
    3751             : 
    3752             :       case ('upwp_zt')
    3753           0 :         stats_metadata%iupwp_zt = k
    3754             :         call stat_assign( var_index=stats_metadata%iupwp_zt, var_name="upwp_zt", &
    3755             :              var_description="upwp_zt, u'w' interpolated to thermodynamic levels", &
    3756           0 :              var_units="m^2/s^2", l_silhs=.false., grid_kind=stats_zt )
    3757           0 :         k = k + 1
    3758             : 
    3759             :       case ('vpwp_zt')
    3760           0 :         stats_metadata%ivpwp_zt = k
    3761             :         call stat_assign( var_index=stats_metadata%ivpwp_zt, var_name="vpwp_zt", &
    3762             :              var_description="vpwp_zt, v'w' interpolated to thermodynamic levels", &
    3763           0 :              var_units="m^2/s^2", l_silhs=.false., grid_kind=stats_zt )
    3764           0 :         k = k + 1
    3765             : 
    3766             :       case ('Skw_zt')
    3767           0 :         stats_metadata%iSkw_zt = k
    3768             :         call stat_assign( var_index=stats_metadata%iSkw_zt, var_name="Skw_zt", &
    3769             :              var_description="Skw_zt, Skewness of w on thermodynamic levels", &
    3770           0 :              var_units="-", l_silhs=.false., grid_kind=stats_zt )
    3771           0 :         k = k + 1
    3772             : 
    3773             :       case ('Skthl_zt')
    3774           0 :         stats_metadata%iSkthl_zt = k
    3775             :         call stat_assign( var_index=stats_metadata%iSkthl_zt, var_name="Skthl_zt", &
    3776             :              var_description="Skthl_zt, Skewness of thl on thermodynamic levels", &
    3777           0 :              var_units="-", l_silhs=.false., grid_kind=stats_zt )
    3778           0 :         k = k + 1
    3779             : 
    3780             :       case ('Skrt_zt')
    3781           0 :         stats_metadata%iSkrt_zt = k
    3782             :         call stat_assign( var_index=stats_metadata%iSkrt_zt, var_name="Skrt_zt", &
    3783             :              var_description="Skrt_zt, Skewness of rt on thermodynamic levels", &
    3784           0 :              var_units="-", l_silhs=.false., grid_kind=stats_zt )
    3785           0 :         k = k + 1
    3786             : 
    3787             :       case ('rcm_supersat_adj')
    3788           0 :         stats_metadata%ircm_supersat_adj = k
    3789             :         call stat_assign( var_index=stats_metadata%ircm_supersat_adj, var_name="rcm_supersat_adj", &
    3790             :              var_description="rcm_supersat_adj, rcm adjustment due to spurious supersaturation", &
    3791           0 :              var_units="kg/kg", l_silhs=.false., grid_kind=stats_zt )
    3792           0 :         k = k + 1
    3793             : 
    3794             :       ! Hydrometeor overall variances for each hydrometeor type.
    3795             :       case('hmp2_zt')
    3796             : 
    3797           0 :          do hm_idx = 1, hydromet_dim, 1
    3798             : 
    3799           0 :             hm_type = hydromet_list(hm_idx)
    3800             : 
    3801             :             ! The overall variance of the hydrometeor.
    3802           0 :             stats_metadata%ihmp2_zt(hm_idx) = k
    3803             : 
    3804           0 :             if ( l_mix_rat_hm(hm_idx) ) then
    3805             : 
    3806           0 :                call stat_assign( var_index=stats_metadata%ihmp2_zt(hm_idx), &
    3807             :                                  var_name=trim( hm_type(1:2) )//"p2_zt", &
    3808             :                                  var_description="<" &
    3809             :                                  // hm_type(1:1)//"_"//trim( hm_type(2:2) ) &
    3810             :                                  // "'^2> on thermodynamic levels (from " &
    3811             :                                  // "integration over PDF) [(kg/kg)^2]", &
    3812             :                                  var_units="(kg/kg)^2", &
    3813           0 :                                  l_silhs=.false., grid_kind=stats_zt )
    3814             : 
    3815             :             else ! Concentration
    3816             : 
    3817           0 :                call stat_assign( var_index=stats_metadata%ihmp2_zt(hm_idx), &
    3818             :                                  var_name=trim( hm_type(1:2) )//"p2_zt", &
    3819             :                                  var_description="<" &
    3820             :                                  // hm_type(1:1)//"_"//trim( hm_type(2:2) ) &
    3821             :                                  // "'^2> on thermodynamic levels (from " &
    3822             :                                  // "integration over PDF) [(num/kg)^2]", &
    3823             :                                  var_units="(num/kg)^2", &
    3824           0 :                                  l_silhs=.false., grid_kind=stats_zt )
    3825             : 
    3826             :             endif ! l_mix_rat_hm(hm_idx)
    3827             : 
    3828           0 :             k = k + 1
    3829             : 
    3830             :          enddo ! hm_idx = 1, hydromet_dim, 1
    3831             : 
    3832             :       case ('C11_Skw_fnc')
    3833           0 :         stats_metadata%iC11_Skw_fnc = k
    3834             : 
    3835             :         call stat_assign( var_index=stats_metadata%iC11_Skw_fnc, var_name="C11_Skw_fnc", &
    3836             :              var_description="C11_Skw_fnc, C_11 parameter with Sk_w applied", var_units="count", &
    3837           0 :              l_silhs=.false., grid_kind=stats_zt )
    3838           0 :         k = k + 1
    3839             : 
    3840             :       case ('chi')
    3841           0 :         stats_metadata%ichi = k
    3842             : 
    3843             :         call stat_assign( var_index=stats_metadata%ichi, var_name="chi", &
    3844             :              var_description="chi, Mellor's s (extended liq)", var_units="kg/kg", &
    3845           0 :              l_silhs=.false., grid_kind=stats_zt )
    3846           0 :         k = k + 1
    3847             : 
    3848             :       case ( 'a3_coef_zt' )
    3849           0 :         stats_metadata%ia3_coef_zt = k
    3850             :         call stat_assign( var_index=stats_metadata%ia3_coef_zt, var_name="a3_coef_zt", &
    3851             :              var_description="a3_coef_zt, The a3 coefficient interpolated the the zt grid", &
    3852           0 :              var_units="count", l_silhs=.false., grid_kind=stats_zt )
    3853           0 :         k = k + 1
    3854             : 
    3855             :       case ( 'wp3_on_wp2_zt' )
    3856           0 :         stats_metadata%iwp3_on_wp2_zt = k
    3857             :         call stat_assign( var_index=stats_metadata%iwp3_on_wp2_zt, var_name="wp3_on_wp2_zt", &
    3858             :              var_description="wp3_on_wp2_zt, Smoothed version of wp3 / wp2", var_units="m/s", &
    3859           0 :              l_silhs=.false., grid_kind=stats_zt )
    3860           0 :         k = k + 1
    3861             : 
    3862             :       ! Hydrometeor component mean values for each PDF component and hydrometeor
    3863             :       ! type.
    3864             :       case ( "hm_i" )
    3865             : 
    3866           0 :          do hm_idx = 1, hydromet_dim, 1
    3867             : 
    3868           0 :             hm_type = hydromet_list(hm_idx)
    3869             : 
    3870             :             ! The mean of the hydrometeor in the 1st PDF component.
    3871           0 :             stats_metadata%ihm_1(hm_idx) = k
    3872             : 
    3873           0 :             if ( l_mix_rat_hm(hm_idx) ) then
    3874             : 
    3875           0 :                call stat_assign( var_index=stats_metadata%ihm_1(hm_idx), &
    3876             :                                  var_name=trim( hm_type(1:2) )//"_1", &
    3877             :                                  var_description="Mean of " &
    3878             :                                  // hm_type(1:1)//"_"//trim( hm_type(2:2) ) &
    3879             :                                  // " (1st PDF component) [kg/kg]", &
    3880             :                                  var_units="kg/kg", &
    3881           0 :                                  l_silhs=.false., grid_kind=stats_zt )
    3882             : 
    3883             :             else ! Concentration
    3884             : 
    3885           0 :                call stat_assign( var_index=stats_metadata%ihm_1(hm_idx), &
    3886             :                                  var_name=trim( hm_type(1:2) )//"_1", &
    3887             :                                  var_description="Mean of " &
    3888             :                                  // hm_type(1:1)//"_"//trim( hm_type(2:2) ) &
    3889             :                                  // " (1st PDF component) [num/kg]", &
    3890             :                                  var_units="num/kg", &
    3891           0 :                                  l_silhs=.false., grid_kind=stats_zt )
    3892             : 
    3893             :             endif ! l_mix_rat_hm(hm_idx)
    3894             : 
    3895           0 :             k = k + 1
    3896             : 
    3897             :             ! The mean of the hydrometeor in the 2nd PDF component.
    3898           0 :             stats_metadata%ihm_2(hm_idx) = k
    3899             : 
    3900           0 :             if ( l_mix_rat_hm(hm_idx) ) then
    3901             : 
    3902           0 :                call stat_assign( var_index=stats_metadata%ihm_2(hm_idx), &
    3903             :                                  var_name=trim( hm_type(1:2) )//"_2", &
    3904             :                                  var_description="Mean of " &
    3905             :                                  // hm_type(1:1)//"_"//trim( hm_type(2:2) ) &
    3906             :                                  // " (2nd PDF component) [kg/kg]", &
    3907             :                                  var_units="kg/kg", &
    3908           0 :                                  l_silhs=.false., grid_kind=stats_zt )
    3909             : 
    3910             :             else ! Concentration
    3911             : 
    3912           0 :                call stat_assign( var_index=stats_metadata%ihm_2(hm_idx), &
    3913             :                                  var_name=trim( hm_type(1:2) )//"_2", &
    3914             :                                  var_description="Mean of " &
    3915             :                                  // hm_type(1:1)//"_"//trim( hm_type(2:2) ) &
    3916             :                                  // " (2nd PDF component) [num/kg]", &
    3917             :                                  var_units="num/kg", &
    3918           0 :                                  l_silhs=.false., grid_kind=stats_zt )
    3919             : 
    3920             :             endif ! l_mix_rat_hm(hm_idx)
    3921             : 
    3922           0 :             k = k + 1
    3923             : 
    3924             :          enddo ! hm_idx = 1, hydromet_dim, 1
    3925             : 
    3926             :       case ( 'precip_frac' )
    3927           0 :         stats_metadata%iprecip_frac = k
    3928             :         call stat_assign( var_index=stats_metadata%iprecip_frac, var_name="precip_frac", &
    3929             :              var_description="precip_frac, Precipitation Fraction", var_units="-", &
    3930           0 :              l_silhs=.false., grid_kind=stats_zt )
    3931           0 :         k = k + 1
    3932             : 
    3933             :       case ( 'precip_frac_1' )
    3934           0 :         stats_metadata%iprecip_frac_1 = k
    3935             :         call stat_assign( var_index=stats_metadata%iprecip_frac_1, var_name="precip_frac_1", &
    3936             :              var_description="precip_frac_1, Precipitation Fraction (1st PDF component)", &
    3937           0 :              var_units="-", l_silhs=.false., grid_kind=stats_zt )
    3938           0 :         k = k + 1
    3939             : 
    3940             :       case ( 'precip_frac_2' )
    3941           0 :         stats_metadata%iprecip_frac_2 = k
    3942             :         call stat_assign( var_index=stats_metadata%iprecip_frac_2, var_name="precip_frac_2", &
    3943             :              var_description="precip_frac_2, Precipitation Fraction (2nd PDF component)", &
    3944           0 :              var_units="-", l_silhs=.false., grid_kind=stats_zt )
    3945           0 :         k = k + 1
    3946             : 
    3947             :       case ( 'Ncnm' )
    3948           0 :         stats_metadata%iNcnm = k
    3949             :         call stat_assign( var_index=stats_metadata%iNcnm, var_name="Ncnm", &
    3950             :              var_description="Ncnm, Cloud nuclei concentration (PDF)", &
    3951           0 :              var_units="num/kg", l_silhs=.false., grid_kind=stats_zt )
    3952           0 :         k = k + 1
    3953             : 
    3954             :       ! Hydrometeor component mean values (in-precip) for each PDF component and
    3955             :       ! hydrometeor type.
    3956             :       case ( 'mu_hm_i' )
    3957             : 
    3958           0 :          do hm_idx = 1, hydromet_dim, 1
    3959             : 
    3960           0 :             hm_type = hydromet_list(hm_idx)
    3961             : 
    3962             :             ! The in-precip mean of the hydrometeor in the 1st PDF component.
    3963           0 :             stats_metadata%imu_hm_1(hm_idx) = k
    3964             : 
    3965           0 :             if ( l_mix_rat_hm(hm_idx) ) then
    3966             : 
    3967           0 :                call stat_assign( var_index=stats_metadata%imu_hm_1(hm_idx), &
    3968             :                                  var_name="mu_"//trim( hm_type(1:2) )//"_1", &
    3969             :                                  var_description="Mean (in-precip) of " &
    3970             :                                  // hm_type(1:1)//"_"//trim( hm_type(2:2) ) &
    3971             :                                  // " (1st PDF component) [kg/kg]", &
    3972             :                                  var_units="kg/kg", &
    3973           0 :                                  l_silhs=.false., grid_kind=stats_zt )
    3974             : 
    3975             :             else ! Concentration
    3976             : 
    3977           0 :                call stat_assign( var_index=stats_metadata%imu_hm_1(hm_idx), &
    3978             :                                  var_name="mu_"//trim( hm_type(1:2) )//"_1", &
    3979             :                                  var_description="Mean (in-precip) of " &
    3980             :                                  // hm_type(1:1)//"_"//trim( hm_type(2:2) ) &
    3981             :                                  // " (1st PDF component) [num/kg]", &
    3982             :                                  var_units="num/kg", &
    3983           0 :                                  l_silhs=.false., grid_kind=stats_zt )
    3984             : 
    3985             :             endif ! l_mix_rat_hm(hm_idx)
    3986             : 
    3987           0 :             k = k + 1
    3988             : 
    3989             :             ! The in-precip mean of the hydrometeor in the 2nd PDF component.
    3990           0 :             stats_metadata%imu_hm_2(hm_idx) = k
    3991             : 
    3992           0 :             if ( l_mix_rat_hm(hm_idx) ) then
    3993             : 
    3994           0 :                call stat_assign( var_index=stats_metadata%imu_hm_2(hm_idx), &
    3995             :                                  var_name="mu_"//trim( hm_type(1:2) )//"_2", &
    3996             :                                  var_description="Mean (in-precip) of " &
    3997             :                                  // hm_type(1:1)//"_"//trim( hm_type(2:2) ) &
    3998             :                                  // " (2nd PDF component) [kg/kg]", &
    3999             :                                  var_units="kg/kg", &
    4000           0 :                                  l_silhs=.false., grid_kind=stats_zt )
    4001             : 
    4002             :             else ! Concentration
    4003             : 
    4004           0 :                call stat_assign( var_index=stats_metadata%imu_hm_2(hm_idx), &
    4005             :                                  var_name="mu_"//trim( hm_type(1:2) )//"_2", &
    4006             :                                  var_description="Mean (in-precip) of " &
    4007             :                                  // hm_type(1:1)//"_"//trim( hm_type(2:2) ) &
    4008             :                                  // " (2nd PDF component) [num/kg]", &
    4009             :                                  var_units="num/kg", &
    4010           0 :                                  l_silhs=.false., grid_kind=stats_zt )
    4011             : 
    4012             :             endif ! l_mix_rat_hm(hm_idx)
    4013             : 
    4014           0 :             k = k + 1
    4015             : 
    4016             :          enddo ! hm_idx = 1, hydromet_dim, 1
    4017             : 
    4018             :       case ( 'mu_Ncn_i' )
    4019           0 :         stats_metadata%imu_Ncn_1 = k
    4020             : 
    4021             :          call stat_assign( var_index=stats_metadata%imu_Ncn_1, &
    4022             :                            var_name="mu_Ncn_1", &
    4023             :                            var_description="mu_Ncn_1, Mean of N_cn (1st PDF component) " &
    4024             :                            // "[num/kg]", var_units="num/kg", &
    4025           0 :                            l_silhs=.false., grid_kind=stats_zt )
    4026             : 
    4027           0 :          k = k + 1
    4028             : 
    4029           0 :          stats_metadata%imu_Ncn_2 = k
    4030             : 
    4031             :          call stat_assign( var_index=stats_metadata%imu_Ncn_2, &
    4032             :                            var_name="mu_Ncn_2", &
    4033             :                            var_description="mu_Ncn_2, Mean of N_cn (2nd PDF component)", &
    4034             :                            var_units="num/kg", &
    4035           0 :                            l_silhs=.false., grid_kind=stats_zt )
    4036             : 
    4037           0 :          k = k + 1
    4038             : 
    4039             :       ! Hydrometeor component mean values (in-precip) for ln hm for each PDF
    4040             :       ! component and hydrometeor type.
    4041             :       case ( 'mu_hm_i_n' )
    4042             : 
    4043           0 :          do hm_idx = 1, hydromet_dim, 1
    4044             : 
    4045           0 :             hm_type = hydromet_list(hm_idx)
    4046             : 
    4047             :             ! The in-precip mean of ln hm in the 1st PDF component.
    4048           0 :             stats_metadata%imu_hm_1_n(hm_idx) = k
    4049             : 
    4050           0 :             if ( l_mix_rat_hm(hm_idx) ) then
    4051             : 
    4052           0 :                call stat_assign( var_index=stats_metadata%imu_hm_1_n(hm_idx), &
    4053             :                                  var_name="mu_"//trim( hm_type(1:2) )//"_1_n", &
    4054             :                                  var_description="Mean (in-precip) of ln " &
    4055             :                                  // hm_type(1:1)//"_"//trim( hm_type(2:2) ) &
    4056             :                                  // " (1st PDF component) [ln(kg/kg)]", &
    4057             :                                  var_units="ln(kg/kg)", &
    4058           0 :                                  l_silhs=.false., grid_kind=stats_zt )
    4059             : 
    4060             :             else ! Concentration
    4061             : 
    4062           0 :                call stat_assign( var_index=stats_metadata%imu_hm_1_n(hm_idx), &
    4063             :                                  var_name="mu_"//trim( hm_type(1:2) )//"_1_n", &
    4064             :                                  var_description="Mean (in-precip) of ln " &
    4065             :                                  // hm_type(1:1)//"_"//trim( hm_type(2:2) ) &
    4066             :                                  // " (1st PDF component) [ln(num/kg)]", &
    4067             :                                  var_units="ln(num/kg)", &
    4068           0 :                                  l_silhs=.false., grid_kind=stats_zt )
    4069             : 
    4070             :             endif ! l_mix_rat_hm(hm_idx)
    4071             : 
    4072           0 :             k = k + 1
    4073             : 
    4074             :             ! The in-precip mean of ln hm in the 2nd PDF component.
    4075           0 :             stats_metadata%imu_hm_2_n(hm_idx) = k
    4076             : 
    4077           0 :             if ( l_mix_rat_hm(hm_idx) ) then
    4078             : 
    4079           0 :                call stat_assign( var_index=stats_metadata%imu_hm_2_n(hm_idx), &
    4080             :                                  var_name="mu_"//trim( hm_type(1:2) )//"_2_n", &
    4081             :                                  var_description="Mean (in-precip) of ln " &
    4082             :                                  // hm_type(1:1)//"_"//trim( hm_type(2:2) ) &
    4083             :                                  // " (2nd PDF component) [ln(kg/kg)]", &
    4084             :                                  var_units="ln(kg/kg)", &
    4085           0 :                                  l_silhs=.false., grid_kind=stats_zt )
    4086             : 
    4087             :             else ! Concentration
    4088             : 
    4089           0 :                call stat_assign( var_index=stats_metadata%imu_hm_2_n(hm_idx), &
    4090             :                                  var_name="mu_"//trim( hm_type(1:2) )//"_2_n", &
    4091             :                                  var_description="Mean (in-precip) of ln " &
    4092             :                                  // hm_type(1:1)//"_"//trim( hm_type(2:2) ) &
    4093             :                                  // " (2nd PDF component) [ln(num/kg)]", &
    4094             :                                  var_units="ln(num/kg)", &
    4095           0 :                                  l_silhs=.false., grid_kind=stats_zt )
    4096             : 
    4097             :             endif ! l_mix_rat_hm(hm_idx)
    4098             : 
    4099           0 :             k = k + 1
    4100             : 
    4101             :          enddo ! hm_idx = 1, hydromet_dim, 1
    4102             : 
    4103             :       case ( 'mu_Ncn_i_n' )
    4104             : 
    4105           0 :          stats_metadata%imu_Ncn_1_n = k
    4106             : 
    4107             :          call stat_assign( var_index=stats_metadata%imu_Ncn_1_n, &
    4108             :                            var_name="mu_Ncn_1_n", &
    4109             :                            var_description="mu_Ncn_1_n, Mean of ln N_cn " &
    4110             :                            // "(1st PDF component)", &
    4111             :                            var_units="ln(num/kg)", &
    4112           0 :                            l_silhs=.false., grid_kind=stats_zt )
    4113             : 
    4114           0 :          k = k + 1
    4115             : 
    4116           0 :          stats_metadata%imu_Ncn_2_n = k
    4117             : 
    4118             :          call stat_assign( var_index=stats_metadata%imu_Ncn_2_n, &
    4119             :                            var_name="mu_Ncn_2_n", &
    4120             :                            var_description="mu_Ncn_2_n, Mean of ln N_cn " &
    4121             :                            // "(2nd PDF component)", &
    4122             :                            var_units="ln(num/kg)", &
    4123           0 :                            l_silhs=.false., grid_kind=stats_zt )
    4124             : 
    4125           0 :          k = k + 1
    4126             : 
    4127             :       ! Hydrometeor component standard deviations (in-precip) for each PDF
    4128             :       ! component and hydrometeor type.
    4129             :       case ( 'sigma_hm_i' )
    4130             : 
    4131           0 :          do hm_idx = 1, hydromet_dim, 1
    4132             : 
    4133           0 :             hm_type = hydromet_list(hm_idx)
    4134             : 
    4135             :             ! The in-precip standard deviation of the hydrometeor in the 1st PDF
    4136             :             ! component.
    4137           0 :             stats_metadata%isigma_hm_1(hm_idx) = k
    4138             : 
    4139           0 :             if ( l_mix_rat_hm(hm_idx) ) then
    4140             : 
    4141           0 :                call stat_assign( var_index=stats_metadata%isigma_hm_1(hm_idx), &
    4142             :                                  var_name="sigma_" &
    4143             :                                  // trim( hm_type(1:2) )//"_1", &
    4144             :                                  var_description="Standard deviation " &
    4145             :                                  // "(in-precip) of " &
    4146             :                                  // hm_type(1:1)//"_"//trim( hm_type(2:2) ) &
    4147             :                                  // " (1st PDF component) [kg/kg]", &
    4148             :                                  var_units="kg/kg", &
    4149           0 :                                  l_silhs=.false., grid_kind=stats_zt )
    4150             : 
    4151             :             else ! Concentration
    4152             : 
    4153           0 :                call stat_assign( var_index=stats_metadata%isigma_hm_1(hm_idx), &
    4154             :                                  var_name="sigma_" &
    4155             :                                  // trim( hm_type(1:2) )//"_1", &
    4156             :                                  var_description="Standard deviation " &
    4157             :                                  // "(in-precip) of " &
    4158             :                                  // hm_type(1:1)//"_"//trim( hm_type(2:2) ) &
    4159             :                                  // " (1st PDF component) [num/kg]", &
    4160             :                                  var_units="num/kg", &
    4161           0 :                                  l_silhs=.false., grid_kind=stats_zt )
    4162             : 
    4163             :             endif ! l_mix_rat_hm(hm_idx)
    4164             : 
    4165           0 :             k = k + 1
    4166             : 
    4167             :             ! The in-precip standard deviation of the hydrometeor in the 2nd PDF
    4168             :             ! component.
    4169           0 :             stats_metadata%isigma_hm_2(hm_idx) = k
    4170             : 
    4171           0 :             if ( l_mix_rat_hm(hm_idx) ) then
    4172             : 
    4173           0 :                call stat_assign( var_index=stats_metadata%isigma_hm_2(hm_idx), &
    4174             :                                  var_name="sigma_" &
    4175             :                                  // trim( hm_type(1:2) )//"_2", &
    4176             :                                  var_description="Standard deviation " &
    4177             :                                  // "(in-precip) of " &
    4178             :                                  // hm_type(1:1)//"_"//trim( hm_type(2:2) ) &
    4179             :                                  // " (2nd PDF component) [kg/kg]", &
    4180             :                                  var_units="kg/kg", &
    4181           0 :                                  l_silhs=.false., grid_kind=stats_zt )
    4182             : 
    4183             :             else ! Concentration
    4184             : 
    4185           0 :                call stat_assign( var_index=stats_metadata%isigma_hm_2(hm_idx), &
    4186             :                                  var_name="sigma_" &
    4187             :                                  // trim( hm_type(1:2) )//"_2", &
    4188             :                                  var_description="Standard deviation " &
    4189             :                                  // "(in-precip) of " &
    4190             :                                  // hm_type(1:1)//"_"//trim( hm_type(2:2) ) &
    4191             :                                  // " (2nd PDF component) [num/kg]", &
    4192             :                                  var_units="num/kg", &
    4193           0 :                                  l_silhs=.false., grid_kind=stats_zt )
    4194             : 
    4195             :             endif ! l_mix_rat_hm(hm_idx)
    4196             : 
    4197           0 :             k = k + 1
    4198             : 
    4199             :          enddo ! hm_idx = 1, hydromet_dim, 1
    4200             : 
    4201             :       case ( 'sigma_Ncn_i' )
    4202             : 
    4203           0 :          stats_metadata%isigma_Ncn_1 = k
    4204             : 
    4205             :          call stat_assign( var_index=stats_metadata%isigma_Ncn_1, &
    4206             :                            var_name="sigma_Ncn_1", &
    4207             :                            var_description="sigma_Ncn_1, Standard deviation of N_cn " &
    4208             :                            // "(1st PDF component)", &
    4209           0 :                            var_units="num/kg", l_silhs=.false., grid_kind=stats_zt )
    4210             : 
    4211           0 :          k = k + 1
    4212             : 
    4213           0 :          stats_metadata%isigma_Ncn_2 = k
    4214             : 
    4215             :          call stat_assign( var_index=stats_metadata%isigma_Ncn_2, &
    4216             :                            var_name="sigma_Ncn_2", &
    4217             :                            var_description="sigma_Ncn_2, Standard deviation of N_cn " &
    4218             :                            // "(2nd PDF component)", &
    4219           0 :                            var_units="num/kg", l_silhs=.false., grid_kind=stats_zt )
    4220             : 
    4221           0 :          k = k + 1
    4222             : 
    4223             :       ! Hydrometeor component standard deviations (in-precip) for ln hm for each
    4224             :       ! PDF component and hydrometeor type.
    4225             :       case ( 'sigma_hm_i_n' )
    4226             : 
    4227           0 :          do hm_idx = 1, hydromet_dim, 1
    4228             : 
    4229           0 :             hm_type = hydromet_list(hm_idx)
    4230             : 
    4231             :             ! The in-precip standard deviation of ln hm in the 1st PDF
    4232             :             ! component.
    4233           0 :             stats_metadata%isigma_hm_1_n(hm_idx) = k
    4234             : 
    4235           0 :             call stat_assign( var_index=stats_metadata%isigma_hm_1_n(hm_idx), &
    4236             :                               var_name="sigma_" &
    4237             :                               // trim( hm_type(1:2) )//"_1_n", &
    4238             :                               var_description="Standard deviation " &
    4239             :                               // "(in-precip) of ln " &
    4240             :                               // hm_type(1:1)//"_"//trim( hm_type(2:2) ) &
    4241             :                               // " (1st PDF component) [-]", &
    4242             :                               var_units="-", &
    4243           0 :                               l_silhs=.false., grid_kind=stats_zt )
    4244             : 
    4245           0 :             k = k + 1
    4246             : 
    4247             :             ! The in-precip standard deviation of ln hm in the 2nd PDF
    4248             :             ! component.
    4249           0 :             stats_metadata%isigma_hm_2_n(hm_idx) = k
    4250             : 
    4251           0 :             call stat_assign( var_index=stats_metadata%isigma_hm_2_n(hm_idx), &
    4252             :                               var_name="sigma_" &
    4253             :                               // trim( hm_type(1:2) )//"_2_n", &
    4254             :                               var_description="Standard deviation " &
    4255             :                               // "(in-precip) of ln " &
    4256             :                               // hm_type(1:1)//"_"//trim( hm_type(2:2) ) &
    4257             :                               // " (2nd PDF component) [-]", &
    4258             :                               var_units="-", &
    4259           0 :                               l_silhs=.false., grid_kind=stats_zt )
    4260             : 
    4261           0 :             k = k + 1
    4262             : 
    4263             :          enddo ! hm_idx = 1, hydromet_dim, 1
    4264             : 
    4265             :       case ( 'sigma_Ncn_i_n' )
    4266           0 :         stats_metadata%isigma_Ncn_1_n = k
    4267             : 
    4268             :          call stat_assign( var_index=stats_metadata%isigma_Ncn_1_n, &
    4269             :                            var_name="sigma_Ncn_1_n", &
    4270             :                            var_description="sigma_Ncn_1_n, Standard deviation of ln N_cn " &
    4271             :                            // "(1st PDF component)", &
    4272           0 :                            var_units="-", l_silhs=.false., grid_kind=stats_zt )
    4273             : 
    4274           0 :          k = k + 1
    4275             : 
    4276           0 :          stats_metadata%isigma_Ncn_2_n = k
    4277             : 
    4278             :          call stat_assign( var_index=stats_metadata%isigma_Ncn_2_n, &
    4279             :                            var_name="sigma_Ncn_2_n", &
    4280             :                            var_description="sigma_Ncn_2_n, Standard deviation of ln N_cn " &
    4281             :                            // "(2nd PDF component)", &
    4282           0 :                            var_units="-", l_silhs=.false., grid_kind=stats_zt )
    4283             : 
    4284           0 :          k = k + 1
    4285             : 
    4286             :       case ('corr_w_chi_1_ca')
    4287           0 :         stats_metadata%icorr_w_chi_1_ca = k
    4288             : 
    4289             :         call stat_assign( var_index=stats_metadata%icorr_w_chi_1_ca, &
    4290             :                           var_name="corr_w_chi_1_ca", &
    4291             :                           var_description="corr_w_chi_1_ca, Correlation of w and chi" &
    4292             :                           // " (1st PDF component) found in the correlation" &
    4293             :                           // " array", var_units="-", &
    4294           0 :                           l_silhs=.false., grid_kind=stats_zt )
    4295           0 :         k = k + 1
    4296             : 
    4297             :       case ('corr_w_chi_2_ca')
    4298           0 :         stats_metadata%icorr_w_chi_2_ca = k
    4299             : 
    4300             :         call stat_assign( var_index=stats_metadata%icorr_w_chi_2_ca, &
    4301             :                           var_name="corr_w_chi_2_ca", &
    4302             :                           var_description="corr_w_chi_2_ca, Correlation of w and chi" &
    4303             :                           // " (2nd PDF component) found in the correlation" &
    4304             :                           // " array", var_units="-", &
    4305           0 :                           l_silhs=.false., grid_kind=stats_zt )
    4306           0 :         k = k + 1
    4307             : 
    4308             :       case ('corr_w_eta_1_ca')
    4309           0 :         stats_metadata%icorr_w_eta_1_ca = k
    4310             : 
    4311             :         call stat_assign( var_index=stats_metadata%icorr_w_eta_1_ca, &
    4312             :                           var_name="corr_w_eta_1_ca", &
    4313             :                           var_description="corr_w_eta_1_ca, Correlation of w and eta" &
    4314             :                           // " (1st PDF component) found in the correlation" &
    4315             :                           // " array", var_units="-", &
    4316           0 :                           l_silhs=.false., grid_kind=stats_zt )
    4317           0 :         k = k + 1
    4318             : 
    4319             :       case ('corr_w_eta_2_ca')
    4320           0 :         stats_metadata%icorr_w_eta_2_ca = k
    4321             : 
    4322             :         call stat_assign( var_index=stats_metadata%icorr_w_eta_2_ca, &
    4323             :                           var_name="corr_w_eta_2_ca", &
    4324             :                           var_description="corr_w_eta_2_ca, Correlation of w and eta" &
    4325             :                           // " (2nd PDF component) found in the correlation" &
    4326             :                           // " array", var_units="-", &
    4327           0 :                           l_silhs=.false., grid_kind=stats_zt )
    4328           0 :         k = k + 1
    4329             : 
    4330             :       ! Correlation of w and a hydrometeor (in-precip) for each PDF
    4331             :       ! component and hydrometeor type.
    4332             :       case ( 'corr_w_hm_i' )
    4333             : 
    4334           0 :          do hm_idx = 1, hydromet_dim, 1
    4335             : 
    4336           0 :             hm_type = hydromet_list(hm_idx)
    4337             : 
    4338             :             ! The in-precip correlation of w and the hydrometeor in the
    4339             :             ! 1st PDF component.
    4340           0 :             stats_metadata%icorr_w_hm_1(hm_idx) = k
    4341             : 
    4342           0 :             call stat_assign( var_index=stats_metadata%icorr_w_hm_1(hm_idx), &
    4343             :                               var_name="corr_w_"//trim( hm_type(1:2) )//"_1", &
    4344             :                               var_description="Correlation (in-precip) " &
    4345             :                               // "of w and " &
    4346             :                               // hm_type(1:1)//"_"//trim( hm_type(2:2) ) &
    4347             :                               // " (1st PDF component) [-]", &
    4348           0 :                               var_units="-", l_silhs=.false., grid_kind=stats_zt )
    4349             : 
    4350           0 :             k = k + 1
    4351             : 
    4352             :             ! The in-precip correlation of w and the hydrometeor in the
    4353             :             ! 2nd PDF component.
    4354           0 :             stats_metadata%icorr_w_hm_2(hm_idx) = k
    4355             : 
    4356           0 :             call stat_assign( var_index=stats_metadata%icorr_w_hm_2(hm_idx), &
    4357             :                               var_name="corr_w_"//trim( hm_type(1:2) )//"_2", &
    4358             :                               var_description="Correlation (in-precip) " &
    4359             :                               // "of w and " &
    4360             :                               // hm_type(1:1)//"_"//trim( hm_type(2:2) ) &
    4361             :                               // " (2nd PDF component) [-]", &
    4362           0 :                               var_units="-", l_silhs=.false., grid_kind=stats_zt )
    4363             : 
    4364           0 :             k = k + 1
    4365             : 
    4366             :          enddo ! hm_idx = 1, hydromet_dim, 1
    4367             : 
    4368             :       case ( 'corr_w_Ncn_i' )
    4369           0 :         stats_metadata%icorr_w_Ncn_1 = k
    4370             : 
    4371             :          call stat_assign( var_index=stats_metadata%icorr_w_Ncn_1, &
    4372             :                            var_name="corr_w_Ncn_1", &
    4373             :                            var_description="corr_w_Ncn_1, Correlation of w and N_cn " &
    4374             :                            // "(1st PDF component)", &
    4375           0 :                            var_units="-", l_silhs=.false., grid_kind=stats_zt )
    4376             : 
    4377           0 :          k = k + 1
    4378             : 
    4379           0 :          stats_metadata%icorr_w_Ncn_2 = k
    4380             : 
    4381             :          call stat_assign( var_index=stats_metadata%icorr_w_Ncn_2, &
    4382             :                            var_name="corr_w_Ncn_2", &
    4383             :                            var_description="corr_w_Ncn_2, Correlation of w and N_cn " &
    4384             :                            // "(2nd PDF component)", &
    4385           0 :                            var_units="-", l_silhs=.false., grid_kind=stats_zt )
    4386             : 
    4387           0 :          k = k + 1
    4388             : 
    4389             :       case ('corr_chi_eta_1_ca')
    4390           0 :         stats_metadata%icorr_chi_eta_1_ca = k
    4391             : 
    4392             :         call stat_assign( var_index=stats_metadata%icorr_chi_eta_1_ca, &
    4393             :                           var_name="corr_chi_eta_1_ca", &
    4394             :                           var_description="corr_chi_eta_1_ca, Correlation of chi (s) and" &
    4395             :                           // " eta (t) (1st PDF component) found in the" &
    4396             :                           // " correlation array", var_units="-", &
    4397           0 :                           l_silhs=.false., grid_kind=stats_zt )
    4398           0 :         k = k + 1
    4399             : 
    4400             :       case ('corr_chi_eta_2_ca')
    4401           0 :         stats_metadata%icorr_chi_eta_2_ca = k
    4402             : 
    4403             :         call stat_assign( var_index=stats_metadata%icorr_chi_eta_2_ca, &
    4404             :                           var_name="corr_chi_eta_2_ca", &
    4405             :                           var_description="corr_chi_eta_2_ca, Correlation of chi (s) and" &
    4406             :                           // " eta (t) (2nd PDF component) found in the" &
    4407             :                           // " correlation array", var_units="-", &
    4408           0 :                           l_silhs=.false., grid_kind=stats_zt )
    4409           0 :         k = k + 1
    4410             : 
    4411             :       ! Correlation of chi(s) and a hydrometeor (in-precip) for each PDF
    4412             :       ! component and hydrometeor type.
    4413             :       case ( 'corr_chi_hm_i' )
    4414             : 
    4415           0 :          do hm_idx = 1, hydromet_dim, 1
    4416             : 
    4417           0 :             hm_type = hydromet_list(hm_idx)
    4418             : 
    4419             :             ! The in-precip correlation of chi and the hydrometeor in the
    4420             :             ! 1st PDF component.
    4421           0 :             stats_metadata%icorr_chi_hm_1(hm_idx) = k
    4422             : 
    4423           0 :             call stat_assign( var_index=stats_metadata%icorr_chi_hm_1(hm_idx), &
    4424             :                               var_name="corr_chi_"//trim(hm_type(1:2))//"_1", &
    4425             :                               var_description="Correlation (in-precip) " &
    4426             :                               // "of chi (s) and " &
    4427             :                               // hm_type(1:1)//"_"//trim( hm_type(2:2) ) &
    4428             :                               // " (1st PDF component) [-]", &
    4429           0 :                               var_units="-", l_silhs=.false., grid_kind=stats_zt )
    4430             : 
    4431           0 :             k = k + 1
    4432             : 
    4433             :             ! The in-precip correlation of chi and the hydrometeor in the
    4434             :             ! 2nd PDF component.
    4435           0 :             stats_metadata%icorr_chi_hm_2(hm_idx) = k
    4436             : 
    4437           0 :             call stat_assign( var_index=stats_metadata%icorr_chi_hm_2(hm_idx), &
    4438             :                               var_name="corr_chi_"//trim(hm_type(1:2))//"_2", &
    4439             :                               var_description="Correlation (in-precip) " &
    4440             :                               // "of chi (s) and " &
    4441             :                               // hm_type(1:1)//"_"//trim( hm_type(2:2) ) &
    4442             :                               // " (2nd PDF component) [-]", &
    4443           0 :                               var_units="-", l_silhs=.false., grid_kind=stats_zt )
    4444             : 
    4445           0 :             k = k + 1
    4446             : 
    4447             :          enddo ! hm_idx = 1, hydromet_dim, 1
    4448             : 
    4449             :       case ( 'corr_chi_Ncn_i' )
    4450           0 :         stats_metadata%icorr_chi_Ncn_1 = k
    4451             : 
    4452             :          call stat_assign( var_index=stats_metadata%icorr_chi_Ncn_1, &
    4453             :                            var_name="corr_chi_Ncn_1", &
    4454             :                            var_description="corr_chi_Ncn_1, Correlation of chi and N_cn " &
    4455             :                            // "(1st PDF component)", &
    4456           0 :                            var_units="-", l_silhs=.false., grid_kind=stats_zt )
    4457             : 
    4458           0 :          k = k + 1
    4459             : 
    4460           0 :          stats_metadata%icorr_chi_Ncn_2 = k
    4461             : 
    4462             :          call stat_assign( var_index=stats_metadata%icorr_chi_Ncn_2, &
    4463             :                            var_name="corr_chi_Ncn_2", &
    4464             :                            var_description="corr_chi_Ncn_2, Correlation of chi and N_cn " &
    4465             :                            // "(2nd PDF component)", &
    4466           0 :                            var_units="-", l_silhs=.false., grid_kind=stats_zt )
    4467             : 
    4468           0 :          k = k + 1
    4469             : 
    4470             :       ! Correlation of eta(t) and a hydrometeor (in-precip) for each PDF
    4471             :       ! component and hydrometeor type.
    4472             :       case ( 'corr_eta_hm_i' )
    4473             : 
    4474           0 :          do hm_idx = 1, hydromet_dim, 1
    4475             : 
    4476           0 :             hm_type = hydromet_list(hm_idx)
    4477             : 
    4478             :             ! The in-precip correlation of eta and the hydrometeor in the
    4479             :             ! 1st PDF component.
    4480           0 :             stats_metadata%icorr_eta_hm_1(hm_idx) = k
    4481             : 
    4482           0 :             call stat_assign( var_index=stats_metadata%icorr_eta_hm_1(hm_idx), &
    4483             :                               var_name="corr_eta_"//trim(hm_type(1:2))//"_1", &
    4484             :                               var_description="Correlation (in-precip) " &
    4485             :                               // "of eta (t) and " &
    4486             :                               // hm_type(1:1)//"_"//trim( hm_type(2:2) ) &
    4487             :                               // " (1st PDF component) [-]", &
    4488           0 :                               var_units="-", l_silhs=.false., grid_kind=stats_zt )
    4489             : 
    4490           0 :             k = k + 1
    4491             : 
    4492             :             ! The in-precip correlation of eta and the hydrometeor in the
    4493             :             ! 2nd PDF component.
    4494           0 :             stats_metadata%icorr_eta_hm_2(hm_idx) = k
    4495             : 
    4496           0 :             call stat_assign( var_index=stats_metadata%icorr_eta_hm_2(hm_idx), &
    4497             :                               var_name="corr_eta_"//trim(hm_type(1:2))//"_2", &
    4498             :                               var_description="Correlation (in-precip) " &
    4499             :                               // "of eta (t) and " &
    4500             :                               // hm_type(1:1)//"_"//trim( hm_type(2:2) ) &
    4501             :                               // " (2nd PDF component) [-]", &
    4502           0 :                               var_units="-", l_silhs=.false., grid_kind=stats_zt )
    4503             : 
    4504           0 :             k = k + 1
    4505             : 
    4506             :          enddo ! hm_idx = 1, hydromet_dim, 1
    4507             : 
    4508             :       case ( 'corr_eta_Ncn_i' )
    4509             : 
    4510           0 :          stats_metadata%icorr_eta_Ncn_1 = k
    4511             : 
    4512             :          call stat_assign( var_index=stats_metadata%icorr_eta_Ncn_1, &
    4513             :                            var_name="corr_eta_Ncn_1", &
    4514             :                            var_description="corr_eta_Ncn_1, Correlation of eta and N_cn " &
    4515             :                            // "(1st PDF component)", &
    4516           0 :                            var_units="-", l_silhs=.false., grid_kind=stats_zt )
    4517             : 
    4518           0 :          k = k + 1
    4519             : 
    4520           0 :          stats_metadata%icorr_eta_Ncn_2 = k
    4521             : 
    4522             :          call stat_assign( var_index=stats_metadata%icorr_eta_Ncn_2, &
    4523             :                            var_name="corr_eta_Ncn_2", &
    4524             :                            var_description="corr_eta_Ncn_2, Correlation of eta and N_cn " &
    4525             :                            // "(2nd PDF component)", &
    4526           0 :                            var_units="-", l_silhs=.false., grid_kind=stats_zt )
    4527             : 
    4528           0 :          k = k + 1
    4529             : 
    4530             :       ! Correlation of Ncn and a hydrometeor (in-precip) for each PDF
    4531             :       ! component and hydrometeor type.
    4532             :       case ( 'corr_Ncn_hm_i' )
    4533             : 
    4534           0 :          do hm_idx = 1, hydromet_dim, 1
    4535             : 
    4536           0 :             hm_type = hydromet_list(hm_idx)
    4537             : 
    4538             :             ! The in-precip correlation of Ncn and the hydrometeor in the
    4539             :             ! 1st PDF component.
    4540           0 :             stats_metadata%icorr_Ncn_hm_1(hm_idx) = k
    4541             : 
    4542           0 :             call stat_assign( var_index=stats_metadata%icorr_Ncn_hm_1(hm_idx), &
    4543             :                               var_name="corr_Ncn_"//trim(hm_type(1:2))//"_1", &
    4544             :                               var_description="Correlation (in-precip) " &
    4545             :                               // "of N_cn and " &
    4546             :                               // hm_type(1:1)//"_"//trim( hm_type(2:2) ) &
    4547             :                               // " (1st PDF component) [-]", &
    4548           0 :                               var_units="-", l_silhs=.false., grid_kind=stats_zt )
    4549             : 
    4550           0 :             k = k + 1
    4551             : 
    4552             :             ! The in-precip correlation of Ncn and the hydrometeor in the
    4553             :             ! 2nd PDF component.
    4554           0 :             stats_metadata%icorr_Ncn_hm_2(hm_idx) = k
    4555             : 
    4556           0 :             call stat_assign( var_index=stats_metadata%icorr_Ncn_hm_2(hm_idx), &
    4557             :                               var_name="corr_Ncn_"//trim(hm_type(1:2))//"_2", &
    4558             :                               var_description="Correlation (in-precip) " &
    4559             :                               // "of N_cn and " &
    4560             :                               // hm_type(1:1)//"_"//trim( hm_type(2:2) ) &
    4561             :                               // " (2nd PDF component) [-]", &
    4562           0 :                               var_units="-", l_silhs=.false., grid_kind=stats_zt )
    4563             : 
    4564           0 :             k = k + 1
    4565             : 
    4566             :          enddo ! hm_idx = 1, hydromet_dim, 1
    4567             : 
    4568             :       ! Correlation (in-precip) of two different hydrometeors (hmx and hmy)
    4569             :       ! for each PDF component and hydrometeor type.
    4570             :       case ( 'corr_hmx_hmy_i' )
    4571             : 
    4572           0 :          do hmx_idx = 1, hydromet_dim, 1
    4573             : 
    4574           0 :             hmx_type = hydromet_list(hmx_idx)
    4575             : 
    4576           0 :             do hmy_idx = hmx_idx+1, hydromet_dim, 1
    4577             : 
    4578           0 :                hmy_type = hydromet_list(hmy_idx)
    4579             : 
    4580             :                ! The in-precip correlation of hmx and hmy in the 1st PDF
    4581             :                ! component.
    4582           0 :                stats_metadata%icorr_hmx_hmy_1(hmy_idx,hmx_idx) = k
    4583             : 
    4584           0 :                call stat_assign( var_index=stats_metadata%icorr_hmx_hmy_1(hmy_idx,hmx_idx), &
    4585             :                                  var_name="corr_"//trim( hmx_type(1:2) )//"_" &
    4586             :                                  // trim( hmy_type(1:2) )//"_1", &
    4587             :                                  var_description="Correlation (in-precip) " &
    4588             :                                  // "of " &
    4589             :                                  // hmx_type(1:1)//"_"//trim( hmx_type(2:2) ) &
    4590             :                                  // " and " &
    4591             :                                  // hmy_type(1:1)//"_"//trim( hmy_type(2:2) ) &
    4592             :                                  // " (1st PDF component) [-]", &
    4593           0 :                                  var_units="-", l_silhs=.false., grid_kind=stats_zt )
    4594             : 
    4595           0 :                k = k + 1
    4596             : 
    4597             :                ! The in-precip correlation of hmx and hmy in the 2nd PDF
    4598             :                ! component.
    4599           0 :                stats_metadata%icorr_hmx_hmy_2(hmy_idx,hmx_idx) = k
    4600             : 
    4601           0 :                call stat_assign( var_index=stats_metadata%icorr_hmx_hmy_2(hmy_idx,hmx_idx), &
    4602             :                                  var_name="corr_"//trim( hmx_type(1:2) )//"_" &
    4603             :                                  // trim( hmy_type(1:2) )//"_2", &
    4604             :                                  var_description="Correlation (in-precip) " &
    4605             :                                  // "of " &
    4606             :                                  // hmx_type(1:1)//"_"//trim( hmx_type(2:2) ) &
    4607             :                                  // " and " &
    4608             :                                  // hmy_type(1:1)//"_"//trim( hmy_type(2:2) ) &
    4609             :                                  // " (2nd PDF component) [-]", &
    4610           0 :                                  var_units="-", l_silhs=.false., grid_kind=stats_zt )
    4611             : 
    4612           0 :                k = k + 1
    4613             : 
    4614             :             enddo ! hmy_idx = hmx_idx+1, hydromet_dim, 1
    4615             : 
    4616             :          enddo ! hmx_idx = 1, hydromet_dim, 1
    4617             : 
    4618             :       ! Correlation (in-precip) of w and ln hm for each PDF component and
    4619             :       ! hydrometeor type.
    4620             :       case ( 'corr_w_hm_i_n' )
    4621             : 
    4622           0 :          do hm_idx = 1, hydromet_dim, 1
    4623             : 
    4624           0 :             hm_type = hydromet_list(hm_idx)
    4625             : 
    4626             :             ! The in-precip correlation of w and ln hm in the 1st PDF
    4627             :             ! component.
    4628           0 :             stats_metadata%icorr_w_hm_1_n(hm_idx) = k
    4629             : 
    4630           0 :             call stat_assign( var_index=stats_metadata%icorr_w_hm_1_n(hm_idx), &
    4631             :                               var_name="corr_w_"//trim(hm_type(1:2))//"_1_n", &
    4632             :                               var_description="Correlation (in-precip) " &
    4633             :                               // "of w and ln " &
    4634             :                               // hm_type(1:1)//"_"//trim( hm_type(2:2) ) &
    4635             :                               // " (1st PDF component) [-]", &
    4636           0 :                               var_units="-", l_silhs=.false., grid_kind=stats_zt )
    4637             : 
    4638           0 :             k = k + 1
    4639             : 
    4640             :             ! The in-precip correlation of w and ln hm in the 2nd PDF
    4641             :             ! component.
    4642           0 :             stats_metadata%icorr_w_hm_2_n(hm_idx) = k
    4643             : 
    4644           0 :             call stat_assign( var_index=stats_metadata%icorr_w_hm_2_n(hm_idx), &
    4645             :                               var_name="corr_w_"//trim(hm_type(1:2))//"_2_n", &
    4646             :                               var_description="Correlation (in-precip) " &
    4647             :                               // "of w and ln " &
    4648             :                               // hm_type(1:1)//"_"//trim( hm_type(2:2) ) &
    4649             :                               // " (2nd PDF component) [-]", &
    4650           0 :                               var_units="-", l_silhs=.false., grid_kind=stats_zt )
    4651             : 
    4652           0 :             k = k + 1
    4653             : 
    4654             :          enddo ! hm_idx = 1, hydromet_dim, 1
    4655             : 
    4656             :       case ( 'corr_w_Ncn_i_n' )
    4657             : 
    4658           0 :          stats_metadata%icorr_w_Ncn_1_n = k
    4659             : 
    4660             :          call stat_assign( var_index=stats_metadata%icorr_w_Ncn_1_n, &
    4661             :                            var_name="corr_w_Ncn_1_n", &
    4662             :                            var_description="corr_w_Ncn_1_n, Correlation of w and " &
    4663             :                            // "ln N_cn (1st PDF component)", &
    4664           0 :                            var_units="-", l_silhs=.false., grid_kind=stats_zt )
    4665             : 
    4666           0 :          k = k + 1
    4667             : 
    4668           0 :          stats_metadata%icorr_w_Ncn_2_n = k
    4669             : 
    4670             :          call stat_assign( var_index=stats_metadata%icorr_w_Ncn_2_n, &
    4671             :                            var_name="corr_w_Ncn_2_n", &
    4672             :                            var_description="corr_w_Ncn_2_n, Correlation of w and " &
    4673             :                            // "ln N_cn (2nd PDF component)", &
    4674           0 :                            var_units="-", l_silhs=.false., grid_kind=stats_zt )
    4675             : 
    4676           0 :          k = k + 1
    4677             : 
    4678             :       ! Correlation (in-precip) of chi and ln hm for each PDF component and
    4679             :       ! hydrometeor type.
    4680             :       case ( 'corr_chi_hm_i_n' )
    4681             : 
    4682           0 :          do hm_idx = 1, hydromet_dim, 1
    4683             : 
    4684           0 :             hm_type = hydromet_list(hm_idx)
    4685             : 
    4686             :             ! The in-precip correlation of chi and ln hm in the 1st PDF
    4687             :             ! component.
    4688           0 :             stats_metadata%icorr_chi_hm_1_n(hm_idx) = k
    4689             : 
    4690           0 :             call stat_assign( var_index=stats_metadata%icorr_chi_hm_1_n(hm_idx), &
    4691             :                               var_name="corr_chi_"//trim(hm_type(1:2)) &
    4692             :                               // "_1_n", &
    4693             :                               var_description="Correlation (in-precip) " &
    4694             :                               // "of chi (s) and ln " &
    4695             :                               // hm_type(1:1)//"_"//trim( hm_type(2:2) ) &
    4696             :                               // " (1st PDF component) [-]", &
    4697           0 :                               var_units="-", l_silhs=.false., grid_kind=stats_zt )
    4698             : 
    4699           0 :             k = k + 1
    4700             : 
    4701             :             ! The in-precip correlation of chi(s) and ln hm in the 2nd PDF
    4702             :             ! component.
    4703           0 :             stats_metadata%icorr_chi_hm_2_n(hm_idx) = k
    4704             : 
    4705           0 :             call stat_assign( var_index=stats_metadata%icorr_chi_hm_2_n(hm_idx), &
    4706             :                               var_name="corr_chi_"//trim(hm_type(1:2)) &
    4707             :                               // "_2_n", &
    4708             :                               var_description="Correlation (in-precip) " &
    4709             :                               // "of chi (s) and ln " &
    4710             :                               // hm_type(1:1)//"_"//trim( hm_type(2:2) ) &
    4711             :                               // " (2nd PDF component) [-]", &
    4712           0 :                               var_units="-", l_silhs=.false., grid_kind=stats_zt )
    4713             : 
    4714           0 :             k = k + 1
    4715             : 
    4716             :          enddo ! hm_idx = 1, hydromet_dim, 1
    4717             : 
    4718             :       case ( 'corr_chi_Ncn_i_n' )
    4719             : 
    4720           0 :          stats_metadata%icorr_chi_Ncn_1_n = k
    4721             : 
    4722             :         call stat_assign( var_index=stats_metadata%icorr_chi_Ncn_1_n, &
    4723             :                            var_name="corr_chi_Ncn_1_n", &
    4724             :                            var_description="corr_chi_Ncn_1_n, Correlation of chi (s) and " &
    4725             :                            // "ln N_cn (1st PDF component)", &
    4726           0 :                            var_units="-", l_silhs=.false., grid_kind=stats_zt )
    4727             : 
    4728           0 :          k = k + 1
    4729             : 
    4730           0 :          stats_metadata%icorr_chi_Ncn_2_n = k
    4731             : 
    4732             :          call stat_assign( var_index=stats_metadata%icorr_chi_Ncn_2_n, &
    4733             :                            var_name="corr_chi_Ncn_2_n", &
    4734             :                            var_description="corr_chi_Ncn_2_n, Correlation of chi (s) and " &
    4735             :                            // "ln N_cn (2nd PDF component)", &
    4736           0 :                            var_units="-", l_silhs=.false., grid_kind=stats_zt )
    4737             : 
    4738           0 :          k = k + 1
    4739             : 
    4740             :       ! Correlation (in-precip) of eta and ln hm for each PDF component and
    4741             :       ! hydrometeor type.
    4742             :       case ( 'corr_eta_hm_i_n' )
    4743             : 
    4744           0 :          do hm_idx = 1, hydromet_dim, 1
    4745             : 
    4746           0 :             hm_type = hydromet_list(hm_idx)
    4747             : 
    4748             :             ! The in-precip correlation of eta and ln hm in the 1st PDF
    4749             :             ! component.
    4750           0 :             stats_metadata%icorr_eta_hm_1_n(hm_idx) = k
    4751             : 
    4752           0 :             call stat_assign( var_index=stats_metadata%icorr_eta_hm_1_n(hm_idx), &
    4753             :                               var_name="corr_eta_"//trim( hm_type(1:2) ) &
    4754             :                               // "_1_n", &
    4755             :                               var_description="Correlation (in-precip) " &
    4756             :                               // "of eta (t) and ln " &
    4757             :                               // hm_type(1:1)//"_"//trim( hm_type(2:2) ) &
    4758             :                               // " (1st PDF component) [-]", &
    4759           0 :                               var_units="-", l_silhs=.false., grid_kind=stats_zt )
    4760             : 
    4761           0 :             k = k + 1
    4762             : 
    4763             :             ! The in-precip correlation of eta and ln hm in the 2nd PDF
    4764             :             ! component.
    4765           0 :             stats_metadata%icorr_eta_hm_2_n(hm_idx) = k
    4766             : 
    4767           0 :             call stat_assign( var_index=stats_metadata%icorr_eta_hm_2_n(hm_idx), &
    4768             :                               var_name="corr_eta_"//trim( hm_type(1:2) ) &
    4769             :                               // "_2_n", &
    4770             :                               var_description="Correlation (in-precip) " &
    4771             :                               // "of eta(t) and ln " &
    4772             :                               // hm_type(1:1)//"_"//trim( hm_type(2:2) ) &
    4773             :                               // " (2nd PDF component) [-]", &
    4774           0 :                               var_units="-", l_silhs=.false., grid_kind=stats_zt )
    4775             : 
    4776           0 :             k = k + 1
    4777             : 
    4778             :          enddo ! hm_idx = 1, hydromet_dim, 1
    4779             : 
    4780             :       case ( 'corr_eta_Ncn_i_n' )
    4781             : 
    4782           0 :          stats_metadata%icorr_eta_Ncn_1_n = k
    4783             : 
    4784             :          call stat_assign( var_index=stats_metadata%icorr_eta_Ncn_1_n, &
    4785             :                            var_name="corr_eta_Ncn_1_n", &
    4786             :                            var_description="corr_eta_Ncn_1_n, Correlation of eta (t) and " &
    4787             :                            // "ln N_cn (1st PDF component)", &
    4788           0 :                            var_units="-", l_silhs=.false., grid_kind=stats_zt )
    4789             : 
    4790           0 :          k = k + 1
    4791             : 
    4792           0 :          stats_metadata%icorr_eta_Ncn_2_n = k
    4793             : 
    4794             :          call stat_assign( var_index=stats_metadata%icorr_eta_Ncn_2_n, &
    4795             :                            var_name="corr_eta_Ncn_2_n", &
    4796             :                            var_description="corr_eta_Ncn_2_n, Correlation of eta (t) and " &
    4797             :                            // "ln N_cn (2nd PDF component)", &
    4798           0 :                            var_units="-", l_silhs=.false., grid_kind=stats_zt )
    4799             : 
    4800           0 :          k = k + 1
    4801             : 
    4802             :       ! Correlation (in-precip) of ln Ncn and ln hm for each PDF component
    4803             :       ! and hydrometeor type.
    4804             :       case ( 'corr_Ncn_hm_i_n' )
    4805             : 
    4806           0 :          do hm_idx = 1, hydromet_dim, 1
    4807             : 
    4808           0 :             hm_type = hydromet_list(hm_idx)
    4809             : 
    4810             :             ! The in-precip correlation of ln Ncn and ln hm in the 1st PDF
    4811             :             ! component.
    4812           0 :             stats_metadata%icorr_Ncn_hm_1_n(hm_idx) = k
    4813             : 
    4814           0 :             call stat_assign( var_index=stats_metadata%icorr_Ncn_hm_1_n(hm_idx), &
    4815             :                               var_name="corr_Ncn_"//trim(hm_type(1:2)) &
    4816             :                               // "_1_n", &
    4817             :                               var_description="Correlation (in-precip) " &
    4818             :                               // "of ln N_cn and ln " &
    4819             :                               // hm_type(1:1)//"_"//trim( hm_type(2:2) ) &
    4820             :                               // " (1st PDF component) [-]", &
    4821           0 :                               var_units="-", l_silhs=.false., grid_kind=stats_zt )
    4822             : 
    4823           0 :             k = k + 1
    4824             : 
    4825             :             ! The in-precip correlation of ln Ncn and ln hm in the 2nd PDF
    4826             :             ! component.
    4827           0 :             stats_metadata%icorr_Ncn_hm_2_n(hm_idx) = k
    4828             : 
    4829           0 :             call stat_assign( var_index=stats_metadata%icorr_Ncn_hm_2_n(hm_idx), &
    4830             :                               var_name="corr_Ncn_"//trim(hm_type(1:2)) &
    4831             :                               // "_2_n", &
    4832             :                               var_description="Correlation (in-precip) " &
    4833             :                               // "of ln N_cn and ln " &
    4834             :                               // hm_type(1:1)//"_"//trim( hm_type(2:2) ) &
    4835             :                               // " (2nd PDF component) [-]", &
    4836           0 :                               var_units="-", l_silhs=.false., grid_kind=stats_zt )
    4837             : 
    4838           0 :             k = k + 1
    4839             : 
    4840             :          enddo ! hm_idx = 1, hydromet_dim, 1
    4841             : 
    4842             :       ! Correlation (in-precip) of ln hmx and ln hmy (hmx and hmy are two
    4843             :       ! different hydrometeors) for each PDF component and hydrometeor type.
    4844             :       case ( 'corr_hmx_hmy_i_n' )
    4845             : 
    4846           0 :          do hmx_idx = 1, hydromet_dim, 1
    4847             : 
    4848           0 :             hmx_type = hydromet_list(hmx_idx)
    4849             : 
    4850           0 :             do hmy_idx = hmx_idx+1, hydromet_dim, 1
    4851             : 
    4852           0 :                hmy_type = hydromet_list(hmy_idx)
    4853             : 
    4854             :                ! The in-precip correlation of ln hmx and ln hmy in the 1st
    4855             :                ! PDF component.
    4856           0 :                stats_metadata%icorr_hmx_hmy_1_n(hmy_idx,hmx_idx) = k
    4857             : 
    4858           0 :                call stat_assign( var_index=stats_metadata%icorr_hmx_hmy_1_n(hmy_idx,hmx_idx), &
    4859             :                                  var_name="corr_"//trim( hmx_type(1:2) )//"_" &
    4860             :                                  // trim( hmy_type(1:2) )//"_1_n", &
    4861             :                                  var_description="Correlation (in-precip) " &
    4862             :                                  // "of ln " &
    4863             :                                  // hmx_type(1:1)//"_"//trim( hmx_type(2:2) ) &
    4864             :                                  // " and ln " &
    4865             :                                  // hmy_type(1:1)//"_"//trim( hmy_type(2:2) ) &
    4866             :                                  // " (1st PDF component) [-]", &
    4867           0 :                                  var_units="-", l_silhs=.false., grid_kind=stats_zt )
    4868             : 
    4869           0 :                k = k + 1
    4870             : 
    4871             :                ! The in-precip correlation of ln hmx and ln hmy in the 2nd
    4872             :                ! PDF component.
    4873           0 :                stats_metadata%icorr_hmx_hmy_2_n(hmy_idx,hmx_idx) = k
    4874             : 
    4875           0 :                call stat_assign( var_index=stats_metadata%icorr_hmx_hmy_2_n(hmy_idx,hmx_idx), &
    4876             :                                  var_name="corr_"//trim( hmx_type(1:2) )//"_" &
    4877             :                                  // trim( hmy_type(1:2) )//"_2_n", &
    4878             :                                  var_description="Correlation (in-precip) " &
    4879             :                                  // "of ln " &
    4880             :                                  // hmx_type(1:1)//"_"//trim( hmx_type(2:2) ) &
    4881             :                                  // " and ln " &
    4882             :                                  // hmy_type(1:1)//"_"//trim( hmy_type(2:2) ) &
    4883             :                                  // " (2nd PDF component) [-]", &
    4884           0 :                                  var_units="-", l_silhs=.false., grid_kind=stats_zt )
    4885             : 
    4886           0 :                k = k + 1
    4887             : 
    4888             :             enddo ! hmy_idx = hmx_idx+1, hydromet_dim, 1
    4889             : 
    4890             :          enddo ! hmx_idx = 1, hydromet_dim, 1
    4891             : 
    4892             :       ! Third-order mixed moment < w'^2 hm' >, where hm is a hydrometeor.
    4893             :       case ('wp2hmp')
    4894             : 
    4895           0 :          do hm_idx = 1, hydromet_dim, 1
    4896             : 
    4897           0 :             hm_type = hydromet_list(hm_idx)
    4898             : 
    4899           0 :             stats_metadata%iwp2hmp(hm_idx) = k
    4900             : 
    4901           0 :             if ( l_mix_rat_hm(hm_idx) ) then
    4902             : 
    4903           0 :                call stat_assign( var_index=stats_metadata%iwp2hmp(hm_idx), &
    4904             :                                  var_name="wp2"//trim( hm_type(1:2) )//"p", &
    4905             :                                  var_description="Third-order moment < w'^2 " &
    4906             :                                  // hm_type(1:1)//"_"//trim( hm_type(2:2) ) &
    4907             :                                  // "' > [(m/s)^2 kg/kg]", &
    4908             :                                  var_units="(m/s)^2 kg/kg", &
    4909           0 :                                  l_silhs=.false., grid_kind=stats_zt )
    4910             : 
    4911             :             else ! Concentration
    4912             : 
    4913           0 :                call stat_assign( var_index=stats_metadata%iwp2hmp(hm_idx), &
    4914             :                                  var_name="wp2"//trim( hm_type(1:2) )//"p", &
    4915             :                                  var_description="Third-order moment < w'^2 " &
    4916             :                                  // hm_type(1:1)//"_"//trim( hm_type(2:2) ) &
    4917             :                                  // "' > [(m/s)^2 num/kg]", &
    4918             :                                  var_units="(m/s)^2 num/kg", &
    4919           0 :                                  l_silhs=.false., grid_kind=stats_zt )
    4920             : 
    4921             :             endif ! l_mix_rat_hm(hm_idx)
    4922             : 
    4923           0 :             k = k + 1
    4924             : 
    4925             :          enddo ! hm_idx = 1, hydromet_dim, 1
    4926             : 
    4927             :       case ('cloud_frac_refined')
    4928           0 :         stats_metadata%icloud_frac_refined = k
    4929             :         call stat_assign( var_index=stats_metadata%icloud_frac_refined, var_name="cloud_frac_refined", &
    4930             :                           var_description="cloud_frac_refined, Cloud fraction computed on " &
    4931             :                           // "refined grid", &
    4932           0 :                           var_units="-", l_silhs=.false., grid_kind=stats_zt )
    4933           0 :         k = k + 1
    4934             : 
    4935             :       case ('rcm_refined')
    4936           0 :         stats_metadata%ircm_refined = k
    4937             :         call stat_assign( var_index=stats_metadata%ircm_refined, var_name="rcm_refined", &
    4938             :                           var_description="rcm_refined, Cloud water mixing ratio computed on " &
    4939             :                           // "refined grid &
    4940           0 :                           &[kg/kg]", var_units="kg/kg", l_silhs=.false., grid_kind=stats_zt)
    4941           0 :         k = k + 1
    4942             : 
    4943             :       case ('hl_on_Cp_residual')
    4944           0 :         stats_metadata%ihl_on_Cp_residual = k
    4945             :         call stat_assign( var_index=stats_metadata%ihl_on_Cp_residual, var_name="hl_on_Cp_residual", &
    4946             :                           var_description="hl_on_Cp_residual, Residual change in HL/Cp from " &
    4947             :                           // "Morrison microphysics &
    4948             :                           &not due to sedimentation", &
    4949           0 :                           var_units="K", l_silhs=.true., grid_kind=stats_zt)
    4950           0 :         k = k + 1
    4951             : 
    4952             :       case ('qto_residual')
    4953           0 :         stats_metadata%iqto_residual = k
    4954             :         call stat_assign( var_index=stats_metadata%iqto_residual, var_name="qto_residual", &
    4955             :                           var_description="qto_residual, Residual change in total water " &
    4956             :                           // "from Morrison &
    4957             :                           &microphysics not due to sedimentation", &
    4958           0 :                           var_units="kg/kg", l_silhs=.true., grid_kind=stats_zt)
    4959           0 :         k = k + 1
    4960             : 
    4961             :       case ( 'sclrm' )
    4962           0 :         do j = 1, sclr_dim, 1
    4963           0 :           write(sclr_idx, * ) j
    4964           0 :           sclr_idx = adjustl(sclr_idx)
    4965           0 :         stats_metadata%isclrm(j) = k
    4966           0 :           call stat_assign( var_index=stats_metadata%isclrm(j), var_name="sclr"//trim(sclr_idx)//"m", &
    4967             :             var_description="passive scalar "//trim(sclr_idx), var_units="unknown", &
    4968           0 :             l_silhs=.false., grid_kind=stats_zt )
    4969           0 :           k = k + 1
    4970             :         end do
    4971             : 
    4972             :       case ( 'sclrm_f' )
    4973           0 :         do j = 1, sclr_dim, 1
    4974           0 :           write(sclr_idx, * ) j
    4975           0 :           sclr_idx = adjustl(sclr_idx)
    4976           0 :         stats_metadata%isclrm_f(j) = k
    4977           0 :           call stat_assign( var_index=stats_metadata%isclrm_f(j), var_name="sclr"//trim(sclr_idx)//"m_f", &
    4978             :             var_description="passive scalar forcing "//trim(sclr_idx), var_units="unknown", &
    4979           0 :             l_silhs=.false., grid_kind=stats_zt )
    4980           0 :           k = k + 1
    4981             :         end do
    4982             : 
    4983             :       case ( 'edsclrm' )
    4984           0 :         do j = 1, edsclr_dim, 1
    4985           0 :           write(sclr_idx, * ) j
    4986           0 :           sclr_idx = adjustl(sclr_idx)
    4987           0 :         stats_metadata%iedsclrm(j) = k
    4988           0 :           call stat_assign( var_index=stats_metadata%iedsclrm(j), var_name="edsclr"//trim(sclr_idx)//"m", &
    4989             :             var_description="passive scalar "//trim(sclr_idx), var_units="unknown", &
    4990           0 :             l_silhs=.false., grid_kind=stats_zt )
    4991           0 :           k = k + 1
    4992             :         end do
    4993             : 
    4994             :       case ( 'edsclrm_f' )
    4995           0 :         do j = 1, edsclr_dim, 1
    4996           0 :           write(sclr_idx, * ) j
    4997           0 :           sclr_idx = adjustl(sclr_idx)
    4998           0 :         stats_metadata%iedsclrm_f(j) = k
    4999           0 :           call stat_assign( var_index=stats_metadata%iedsclrm_f(j), var_name="edsclr"//trim(sclr_idx)//"m_f", &
    5000             :             var_description="passive scalar forcing "//trim(sclr_idx), var_units="unknown", &
    5001           0 :             l_silhs=.false., grid_kind=stats_zt )
    5002           0 :           k = k + 1
    5003             :         end do
    5004             : 
    5005             :       case default
    5006             : 
    5007           0 :         write(fstderr,*) 'Error:  unrecognized variable in vars_zt:  ', trim( vars_zt(i) )
    5008           0 :         l_error = .true.  ! This will stop the run.
    5009             : 
    5010             :       end select ! trim( vars_zt )
    5011             : 
    5012             : 
    5013             :     end do ! i=1,stats_zt%num_output_fields
    5014             : 
    5015             : 
    5016           0 :     return
    5017             : 
    5018             :   end subroutine stats_init_zt
    5019             : 
    5020             : !===============================================================================
    5021             : 
    5022             : end module stats_zt_module

Generated by: LCOV version 1.14