LCOV - code coverage report
Current view: | top level - physics/clubb/src/CLUBB_core - stats_lh_zt_module.F90 (source / functions) |  |  | Hit | Total | Coverage
Test: | coverage.info |  | Lines: | 0 | 220 | 0.0 %
Date: | 2024-12-17 22:39:59 |  | Functions: | 0 | 1 | 0.0 %

              Line data    Source code
           1             : !-----------------------------------------------------------------------
           2             : ! $Id$
           3             : !===============================================================================
           4             : module stats_lh_zt_module
           5             :
           6             :   implicit none
           7             :
           8             :   private ! Default Scope
           9             :
          10             :   public :: stats_init_lh_zt
          11             :
          12             : ! Constant parameters
          13             :   integer, parameter, public :: nvarmax_lh_zt = 100 ! Maximum variables allowed
          14             :
          15             :   contains
          16             :
          17             : !-----------------------------------------------------------------------
          18           0 :   subroutine stats_init_lh_zt( vars_lh_zt,                    & ! intent(in)
          19             :                                l_error,                       & ! intent(inout)
          20             :                                stats_metadata, stats_lh_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             :     use stats_type_utilities, only: &
          36             :         stat_assign ! Procedure
          37             :
          38             :     use stats_type, only: &
          39             :         stats ! Type
          40             :
          41             :     use stats_variables, only: &
          42             :         stats_metadata_type
          43             :
          44             :     implicit none
          45             :
          46             :     type (stats), target, intent(inout) :: &
          47             :       stats_lh_zt
          48             :
          49             :     ! External
          50             :     intrinsic :: trim
          51             :
          52             :     ! Local Constants
          53             :     integer, parameter :: &
          54             :       silhs_num_importance_categories = 8
          55             :
          56             :     !--------------------- Input Variable ---------------------
          57             :     character(len= * ), dimension(nvarmax_lh_zt), intent(in) :: &
          58             :       vars_lh_zt
          59             :
          60             :     !--------------------- InOut Variables ---------------------
          61             :     type (stats_metadata_type), intent(inout) :: &
          62             :       stats_metadata
          63             :
          64             :     logical, intent(inout) :: l_error
          65             :
          66             :     !--------------------- Local Varables ---------------------
          67             :     integer :: i, k, tot_loops, icategory
          68             :
          69             :     character( len = 1 ) :: category_num_as_string
          70             :
          71             :     !--------------------- Begin Code ---------------------
          72             :
          73             :     ! Default initialization for array indices for stats_lh_zt is zero (see module
          74             :     ! stats_variables)
          75             :
          76             :     ! If any of the index arrays are allocated, then we have called this before
          77             :     ! to set up stats_metadata, so all we want to do is set stats_lh_zt via stats_assign
          78           0 :     if ( .not. allocated(stats_metadata%isilhs_variance_category) ) then
          79           0 :       allocate( stats_metadata%isilhs_variance_category(silhs_num_importance_categories), &
          80           0 :                 stats_metadata%ilh_samp_frac_category(silhs_num_importance_categories) )
          81             :     end if
          82             :
          83           0 :     stats_metadata%isilhs_variance_category(:) = 0
          84           0 :     stats_metadata%ilh_samp_frac_category(:) = 0
          85             :
          86             :     ! Assign pointers for statistics variables stats_zt
          87             :
          88           0 :     tot_loops = stats_lh_zt%num_output_fields
          89             :
          90           0 :     if ( any( vars_lh_zt == "silhs_variance_category" ) ) then
          91             :        ! Correct for number of variables found under "silhs_variance_category".
          92             :        ! Subtract 1 from the loop size for each SILHS importance category.
          93           0 :        tot_loops = tot_loops - silhs_num_importance_categories
          94             :        ! Add 1 for "silhs_variance_category" to the loop size.
          95           0 :        tot_loops = tot_loops + 1
          96             :     end if
          97             :
          98           0 :     if ( any( vars_lh_zt == "lh_samp_frac_category" ) ) then
          99             :        ! Correct for number of variables found under "lh_samp_frac_category".
         100             :        ! Subtract 1 from the loop size for each SILHS importance category.
         101           0 :        tot_loops = tot_loops - silhs_num_importance_categories
         102             :        ! Add 1 for "lh_samp_frac_category" to the loop size.
         103           0 :        tot_loops = tot_loops + 1
         104             :     end if
         105             :
         106           0 :     k = 1
         107           0 :     do i = 1, tot_loops
         108             :
         109           0 :       select case ( trim( vars_lh_zt(i) ) )
         110             :       case ( 'AKm' )           ! Vince Larson 22 May 2005
         111           0 :         stats_metadata%iAKm = k
         112             :         call stat_assign( var_index=stats_metadata%iAKm, var_name="AKm", & ! intent(in)
         113             :              var_description="Analytic Kessler ac [kg/kg]", var_units="kg/kg", & ! intent(in)
         114             :              l_silhs=.true., & ! intent(in)
         115           0 :              grid_kind=stats_lh_zt ) ! intent(inout)
         116           0 :         k = k + 1
         117             :
         118             :       case ( 'lh_AKm' )       ! Vince Larson 22 May 2005
         119           0 :         stats_metadata%ilh_AKm = k
         120             :
         121             :         call stat_assign( var_index=stats_metadata%ilh_AKm, var_name="lh_AKm", & ! intent(in)
         122             :              var_description="LH Kessler estimate  [kg/kg/s]", var_units="kg/kg/s", & ! intent(in)
         123             :              l_silhs=.true., & ! intent(in)
         124           0 :              grid_kind=stats_lh_zt ) ! intent(inout)
         125           0 :         k = k + 1
         126             :
         127             :       case ( 'AKstd' )
         128           0 :         stats_metadata%iAKstd = k
         129             :
         130             :         call stat_assign( var_index=stats_metadata%iAKstd, var_name="AKstd", & ! intent(in)
         131             :              var_description="Exact standard deviation of gba Kessler [kg/kg/s]", & ! intent(in)
         132             :              var_units="kg/kg/s", l_silhs=.true., & ! intent(in)
         133           0 :              grid_kind=stats_lh_zt ) ! intent(inout)
         134           0 :         k = k + 1
         135             :
         136             :       case ( 'AKstd_cld' )
         137           0 :         stats_metadata%iAKstd_cld = k
         138             :
         139             :         call stat_assign( var_index=stats_metadata%iAKstd_cld, var_name="AKstd_cld", & ! intent(in)
         140             :              var_description="Exact w/in cloud std of gba Kessler [kg/kg/s]", & ! intent(in)
         141             :              var_units="kg/kg/s", l_silhs=.true., & ! intent(in)
         142           0 :              grid_kind=stats_lh_zt ) ! intent(inout)
         143           0 :         k = k + 1
         144             :
         145             :       case ( 'AKm_rcm' )
         146           0 :         stats_metadata%iAKm_rcm = k
         147             :
         148             :         call stat_assign( var_index=stats_metadata%iAKm_rcm, var_name="AKm_rcm", & ! intent(in)
         149             :              var_description="Exact local gba auto based on rcm [kg/kg/s]", & ! intent(in)
         150             :              var_units="kg/kg/s", &  ! intent(in)
         151             :              l_silhs=.true., & ! intent(in)
         152           0 :              grid_kind=stats_lh_zt ) ! intent(inout)
         153           0 :         k = k + 1
         154             :
         155             :       case ( 'AKm_rcc' )
         156           0 :         stats_metadata%iAKm_rcc = k
         157             :
         158             :         call stat_assign( var_index=stats_metadata%iAKm_rcc, var_name="AKm_rcc", & ! intent(in)
         159             :              var_description="Exact local gba based on w/in cloud rc [kg/kg/s]", & ! intent(in)
         160             :              var_units="kg/kg/s", l_silhs=.true., & ! intent(in)
         161           0 :              grid_kind=stats_lh_zt ) ! intent(inout)
         162           0 :         k = k + 1
         163             :
         164             :       case ( 'lh_rvm_mc' )
         165           0 :         stats_metadata%ilh_rvm_mc = k
         166             :
         167             :         call stat_assign( var_index=stats_metadata%ilh_rvm_mc, var_name="lh_rvm_mc", & ! intent(in)
         168             :              var_description="Latin hypercube estimate of rvm_mc [kg/kg/s]", & ! intent(in)
         169             :              var_units="kg/kg/s", & ! intent(in)
         170             :              l_silhs=.true., & ! intent(in)
         171           0 :              grid_kind=stats_lh_zt )  ! intent(inout)
         172           0 :         k = k + 1
         173             :
         174             :       case ( 'lh_thlm_mc' )
         175           0 :         stats_metadata%ilh_thlm_mc = k
         176             :
         177             :         call stat_assign( var_index=stats_metadata%ilh_thlm_mc, var_name="lh_thlm_mc", & ! intent(in)
         178             :              var_description="Latin hypercube estimate of thlm_mc [kg/kg/s]", & ! intent(in)
         179             :              var_units="kg/kg/s", l_silhs=.true., & ! intent(in)
         180           0 :              grid_kind=stats_lh_zt ) ! intent(inout)
         181           0 :         k = k + 1
         182             :
         183             :       case ( 'lh_rcm_mc' )
         184           0 :         stats_metadata%ilh_rcm_mc = k
         185             :
         186             :         call stat_assign( var_index=stats_metadata%ilh_rcm_mc, var_name="lh_rcm_mc", & ! intent(in)
         187             :              var_description="Latin hypercube estimate of rcm_mc [kg/kg/s]", & ! intent(in)
         188             :              var_units="kg/kg/s", & ! intent(in)
         189             :              l_silhs=.true., & ! intent(in)
         190           0 :              grid_kind=stats_lh_zt ) ! intent(inout)
         191           0 :         k = k + 1
         192             :
         193             :       case ( 'lh_Ncm_mc' )
         194           0 :         stats_metadata%ilh_Ncm_mc = k
         195             :
         196             :         call stat_assign( var_index=stats_metadata%ilh_Ncm_mc, var_name="lh_Ncm_mc", & ! intent(in)
         197             :              var_description="Latin hypercube estimate of Ncm_mc [kg/kg/s]", & ! intent(in)
         198             :              var_units="kg/kg/s", & ! intent(in)
         199             :              l_silhs=.true., & ! intent(in)
         200           0 :              grid_kind=stats_lh_zt ) ! intent(inout)
         201           0 :         k = k + 1
         202             :
         203             :       case ( 'lh_rrm_mc' )
         204           0 :         stats_metadata%ilh_rrm_mc = k
         205             :
         206             :         call stat_assign( var_index=stats_metadata%ilh_rrm_mc, var_name="lh_rrm_mc", & ! intent(in)
         207             :              var_description="Latin hypercube estimate of rrm_mc [kg/kg/s]", & ! intent(in)
         208             :              var_units="kg/kg/s", & ! intent(in)
         209             :              l_silhs=.true., & ! intent(in)
         210           0 :              grid_kind=stats_lh_zt ) ! intent(inout)
         211           0 :         k = k + 1
         212             :
         213             :       case ( 'lh_Nrm_mc' )
         214           0 :         stats_metadata%ilh_Nrm_mc = k
         215             :
         216             :         call stat_assign( var_index=stats_metadata%ilh_Nrm_mc, var_name="lh_Nrm_mc", & ! intent(in)
         217             :              var_description="Latin hypercube estimate of Nrm_mc [kg/kg/s]", & ! intent(in)
         218             :              var_units="kg/kg/s", & ! intent(in)
         219             :              l_silhs=.true., & ! intent(in)
         220           0 :              grid_kind=stats_lh_zt ) ! intent(inout)
         221           0 :         k = k + 1
         222             :
         223             :       case('lh_rsm_mc')
         224           0 :         stats_metadata%ilh_rsm_mc = k
         225             :
         226             :         call stat_assign( var_index=stats_metadata%ilh_rsm_mc, var_name="lh_rsm_mc", & ! intent(in)
         227             :              var_description="Latin hypercube estimate of rsm_mc [kg/kg/s]", & ! intent(in)
         228             :              var_units="kg/kg/s", & ! intent(in)
         229             :              l_silhs=.true., & ! intent(in)
         230           0 :              grid_kind=stats_lh_zt ) ! intent(inout)
         231           0 :         k = k + 1
         232             :
         233             :       case ( 'lh_Nsm_mc' )
         234           0 :         stats_metadata%ilh_Nsm_mc = k
         235             :
         236             :         call stat_assign( var_index=stats_metadata%ilh_Nsm_mc, var_name="lh_Nsm_mc", & ! intent(in)
         237             :              var_description="Latin hypercube estimate of Nsm_mc [kg/kg/s]", & ! intent(in)
         238             :              var_units="kg/kg/s", & ! intent(in)
         239             :              l_silhs=.true., & ! intent(in)
         240           0 :              grid_kind=stats_lh_zt ) ! intent(inout)
         241           0 :         k = k + 1
         242             :
         243             :       case ( 'lh_rgm_mc' )
         244           0 :         stats_metadata%ilh_rgm_mc = k
         245             :
         246             :         call stat_assign( var_index=stats_metadata%ilh_rgm_mc, var_name="lh_rgm_mc", & ! intent(in)
         247             :              var_description="Latin hypercube estimate of rgm_mc [kg/kg/s]", & ! intent(in)
         248             :              var_units="kg/kg/s", & ! intent(in)
         249             :              l_silhs=.true., & ! intent(in)
         250           0 :              grid_kind=stats_lh_zt )  ! intent(inout)
         251           0 :         k = k + 1
         252             :
         253             :       case ( 'lh_Ngm_mc' )
         254           0 :         stats_metadata%ilh_Ngm_mc = k
         255             :
         256             :         call stat_assign( var_index=stats_metadata%ilh_Ngm_mc, var_name="lh_Ngm_mc", & ! intent(in)
         257             :              var_description="Latin hypercube estimate of Ngm_mc [kg/kg/s]", & ! intent(in)
         258             :              var_units="kg/kg/s", & ! intent(in)
         259             :              l_silhs=.true., & ! intent(in)
         260           0 :              grid_kind=stats_lh_zt ) ! intent(inout)
         261           0 :         k = k + 1
         262             :
         263             :       case ( 'lh_rim_mc' )
         264           0 :         stats_metadata%ilh_rim_mc = k
         265             :
         266             :         call stat_assign( var_index=stats_metadata%ilh_rim_mc, var_name="lh_rim_mc", & ! intent(in)
         267             :              var_description="Latin hypercube estimate of rim_mc [kg/kg/s]", & ! intent(in)
         268             :              var_units="kg/kg/s", & ! intent(in)
         269             :              l_silhs=.true., & ! intent(in)
         270           0 :              grid_kind=stats_lh_zt ) ! intent(inout)
         271           0 :         k = k + 1
         272             :
         273             :       case ( 'lh_Nim_mc' )
         274           0 :         stats_metadata%ilh_Nim_mc = k
         275             :
         276             :         call stat_assign( var_index=stats_metadata%ilh_Nim_mc, var_name="lh_Nim_mc", & ! intent(in)
         277             :              var_description="Latin hypercube estimate of Nim_mc [kg/kg/s]", & ! intent(in)
         278             :              var_units="kg/kg/s", & ! intent(in)
         279             :              l_silhs=.true., & ! intent(in)
         280           0 :              grid_kind=stats_lh_zt ) ! intent(inout)
         281           0 :         k = k + 1
         282             :
         283             :       case ( 'lh_Vrr' )
         284           0 :         stats_metadata%ilh_Vrr = k
         285             :
         286             :         call stat_assign( var_index=stats_metadata%ilh_Vrr, var_name="lh_Vrr", & ! intent(in)
         287             :              var_description="Latin hypercube estimate of rrm sedimentation velocity [m/s]", & !In
         288             :              var_units="m/s", & ! intent(in)
         289             :              l_silhs=.true., & ! intent(in)
         290           0 :              grid_kind=stats_lh_zt ) ! intent(inout)
         291           0 :         k = k + 1
         292             :
         293             :       case ( 'lh_VNr' )
         294           0 :         stats_metadata%ilh_VNr = k
         295             :
         296             :         call stat_assign( var_index=stats_metadata%ilh_VNr, var_name="lh_VNr", & ! intent(in)
         297             :              var_description="Latin hypercube estimate of Nrm sedimentation velocity [m/s]", & ! In
         298             :              var_units="m/s", & ! intent(in)
         299             :              l_silhs=.true., & ! intent(in)
         300           0 :              grid_kind=stats_lh_zt ) ! intent(inout)
         301           0 :         k = k + 1
         302             :
         303             :       case ( 'lh_rcm_avg' )
         304           0 :         stats_metadata%ilh_rcm_avg = k
         305             :
         306             :         call stat_assign( var_index=stats_metadata%ilh_rcm_avg, var_name="lh_rcm_avg", & ! intent(in)
         307             :              var_description="Latin hypercube average estimate of rcm [kg/kg]", & ! intent(in)
         308             :              var_units="kg/kg", & ! intent(in)
         309             :              l_silhs=.true., & ! intent(in)
         310           0 :              grid_kind=stats_lh_zt ) ! intent(inout)
         311             :
         312           0 :         k = k + 1
         313             :
         314             :       case ( 'lh_rrm' )
         315           0 :         stats_metadata%ilh_rrm = k
         316             :
         317             :         call stat_assign( var_index=stats_metadata%ilh_rrm, var_name="lh_rrm", & ! intent(in)
         318             :              var_description="Latin hypercube estimate of rrm [kg/kg]", & ! intent(in)
         319             :              var_units="kg/kg", & ! intent(in)
         320             :              l_silhs=.true., &  ! intent(in)
         321           0 :              grid_kind=stats_lh_zt ) ! intent(inout)
         322           0 :         k = k + 1
         323             :
         324             :       case ( 'lh_Nrm' )
         325           0 :         stats_metadata%ilh_Nrm = k
         326             :
         327             :         call stat_assign( var_index=stats_metadata%ilh_Nrm, var_name="lh_Nrm", & ! intent(in)
         328             :              var_description="Latin hypercube estimate of Nrm [count/kg]", & ! intent(in)
         329             :              var_units="count/kg", & ! intent(in)
         330             :              l_silhs=.true., & ! intent(in)
         331           0 :              grid_kind=stats_lh_zt ) ! intent(inout)
         332           0 :         k = k + 1
         333             :
         334             :       case ( 'lh_rim' )
         335           0 :         stats_metadata%ilh_rim = k
         336             :
         337             :         call stat_assign( var_index=stats_metadata%ilh_rim, var_name="lh_rim", & ! intent(in)
         338             :              var_description="Latin hypercube estimate of rim [kg/kg]", & ! intent(in)
         339             :              var_units="kg/kg", & ! intent(in)
         340             :              l_silhs=.true., & ! intent(in)
         341           0 :              grid_kind=stats_lh_zt )  ! intent(inout)
         342           0 :         k = k + 1
         343             :
         344             :       case ( 'lh_Nim' )
         345           0 :         stats_metadata%ilh_Nim = k
         346             :
         347             :         call stat_assign( var_index=stats_metadata%ilh_Nim, var_name="lh_Nim", & ! intent(in)
         348             :              var_description="Latin hypercube estimate of Nim [count/kg]", & ! intent(in)
         349             :              var_units="count/kg", & ! intent(in)
         350             :              l_silhs=.true., & ! intent(in)
         351           0 :              grid_kind=stats_lh_zt ) ! intent(inout)
         352           0 :         k = k + 1
         353             :
         354             :       case ( 'lh_rsm' )
         355           0 :         stats_metadata%ilh_rsm = k
         356             :
         357             :         call stat_assign( var_index=stats_metadata%ilh_rsm, var_name="lh_rsm", & ! intent(in)
         358             :              var_description="Latin hypercube estimate of rsm [kg/kg]", & ! intent(in)
         359             :              var_units="kg/kg", & ! intent(in)
         360             :              l_silhs=.true., & ! intent(in)
         361           0 :              grid_kind=stats_lh_zt ) ! intent(inout)
         362           0 :         k = k + 1
         363             :
         364             :       case ( 'lh_Nsm' )
         365           0 :         stats_metadata%ilh_Nsm = k
         366             :
         367             :         call stat_assign( var_index=stats_metadata%ilh_Nsm, var_name="lh_Nsm", & ! intent(in)
         368             :              var_description="Latin hypercube estimate of Nsm [count/kg]", & ! intent(in)
         369             :              var_units="count/kg", & ! intent(in)
         370             :              l_silhs=.true., & ! intent(in)
         371           0 :              grid_kind=stats_lh_zt ) ! intent(inout)
         372           0 :         k = k + 1
         373             :
         374             :
         375             :       case ( 'lh_rgm' )
         376           0 :         stats_metadata%ilh_rgm = k
         377             :
         378             :         call stat_assign( var_index=stats_metadata%ilh_rgm, var_name="lh_rgm", & ! intent(in)
         379             :              var_description="Latin hypercube estimate of rgm [kg/kg]", & ! intent(in)
         380             :              var_units="kg/kg", & ! intent(in)
         381             :              l_silhs=.true., & ! intent(in)
         382           0 :              grid_kind=stats_lh_zt ) ! intent(inout)
         383           0 :         k = k + 1
         384             :
         385             :       case ( 'lh_Ngm' )
         386           0 :         stats_metadata%ilh_Ngm = k
         387             :
         388             :         call stat_assign( var_index=stats_metadata%ilh_Ngm, var_name="lh_Ngm", & ! intent(in)
         389             :              var_description="Latin hypercube estimate of Ngm [kg/kg]", & ! intent(in)
         390             :              var_units="kg/kg", & ! intent(in)
         391             :              l_silhs=.true., & ! intent(in)
         392           0 :              grid_kind=stats_lh_zt ) ! intent(inout)
         393           0 :         k = k + 1
         394             :
         395             :       case ( 'lh_thlm' )
         396           0 :         stats_metadata%ilh_thlm = k
         397             :
         398             :         call stat_assign( var_index=stats_metadata%ilh_thlm, var_name="lh_thlm", & ! intent(in)
         399             :              var_description="Latin hypercube estimate of thlm [K]", var_units="K", & ! intent(in)
         400             :              l_silhs=.true., & ! intent(in)
         401           0 :              grid_kind=stats_lh_zt ) ! intent(inout)
         402           0 :         k = k + 1
         403             :
         404             :       case ( 'lh_rcm' )
         405           0 :         stats_metadata%ilh_rcm = k
         406             :
         407             :         call stat_assign( var_index=stats_metadata%ilh_rcm, var_name="lh_rcm", & ! intent(in)
         408             :              var_description="Latin hypercube estimate of rcm [kg/kg]", & ! intent(in)
         409             :              var_units="kg/kg", & ! intent(in)
         410             :              l_silhs=.true., & ! intent(in)
         411           0 :              grid_kind=stats_lh_zt ) ! intent(inout)
         412           0 :         k = k + 1
         413             :
         414             :       case ( 'lh_Ncm' )
         415           0 :         stats_metadata%ilh_Ncm = k
         416             :
         417             :         call stat_assign( var_index=stats_metadata%ilh_Ncm, var_name="lh_Ncm", & ! intent(in)
         418             :              var_description="Latin hypercube estimate of Ncm [count/kg]", & ! intent(in)
         419             :              var_units="count/kg", & ! intent(in)
         420             :              l_silhs=.true., & ! intent(in)
         421           0 :              grid_kind=stats_lh_zt ) ! intent(inout)
         422           0 :         k = k + 1
         423             :
         424             :       case ( 'lh_Ncnm' )
         425           0 :         stats_metadata%ilh_Ncnm = k
         426             :
         427             :         call stat_assign( var_index=stats_metadata%ilh_Ncnm, var_name="lh_Ncnm", & ! intent(in)
         428             :              var_description="Latin hypercube estimate of Ncnm [count/kg]", & ! intent(in)
         429             :              var_units="count/kg", & ! intent(in)
         430             :              l_silhs=.true., & ! intent(in)
         431           0 :              grid_kind=stats_lh_zt ) ! intent(inout)
         432           0 :         k = k + 1
         433             :
         434             :
         435             :       case ( 'lh_rvm' )
         436           0 :         stats_metadata%ilh_rvm = k
         437             :
         438             :         call stat_assign( var_index=stats_metadata%ilh_rvm, var_name="lh_rvm", & ! intent(in)
         439             :              var_description="Latin hypercube estimate of rvm [kg/kg]", & ! intent(in)
         440             :              var_units="kg/kg", & ! intent(in)
         441             :              l_silhs=.true., & ! intent(in)
         442           0 :              grid_kind=stats_lh_zt ) ! intent(inout)
         443           0 :         k = k + 1
         444             :
         445             :       case ( 'lh_wm' )
         446           0 :         stats_metadata%ilh_wm = k
         447             :
         448             :         call stat_assign( var_index=stats_metadata%ilh_wm, var_name="lh_wm", & ! intent(in)
         449             :              var_description="Latin hypercube estimate of vertical velocity [m/s]", & ! intent(in)
         450             :              var_units="m/s", & ! intent(in)
         451             :              l_silhs=.true., & ! intent(in)
         452           0 :              grid_kind=stats_lh_zt ) ! intent(inout)
         453           0 :         k = k + 1
         454             :
         455             :       case ( 'lh_cloud_frac' )
         456           0 :         stats_metadata%ilh_cloud_frac = k
         457             :
         458             :         ! Note: count is the udunits compatible unit
         459             :         call stat_assign( var_index=stats_metadata%ilh_cloud_frac, var_name="lh_cloud_frac", & ! intent(in)
         460             :              var_description="Latin hypercube estimate of cloud fraction [count]", & ! intent(in)
         461             :              var_units="count", & ! intent(in)
         462             :              l_silhs=.true., & ! intent(in)
         463           0 :              grid_kind=stats_lh_zt ) ! intent(inout)
         464           0 :         k = k + 1
         465             :
         466             :       case ( 'lh_cloud_frac_unweighted' )
         467           0 :         stats_metadata%ilh_cloud_frac_unweighted = k
         468             :
         469             :         call stat_assign( var_index=stats_metadata%ilh_cloud_frac_unweighted, & ! intent(in)
         470             :              var_name="lh_cloud_frac_unweighted", var_description="Unweighted fraction of &
         471             :             &silhs sample points that are in cloud [-]", var_units="-", l_silhs=.false., &
         472           0 :              grid_kind=stats_lh_zt ) ! intent(inout)
         473           0 :         k = k + 1
         474             :
         475             :       case ( 'lh_chi' )
         476           0 :         stats_metadata%ilh_chi = k
         477             :         call stat_assign( var_index=stats_metadata%ilh_chi, var_name="lh_chi", & ! intent(in)
         478             :              var_description="Latin hypercube estimate of Mellor's s (extended liq) [kg/kg]", & !In
         479             :              var_units="kg/kg", & ! intent(in)
         480             :              l_silhs=.true., & ! intent(in)
         481           0 :              grid_kind=stats_lh_zt ) ! intent(inout)
         482           0 :         k = k + 1
         483             :
         484             :       case ( 'lh_eta' )
         485           0 :         stats_metadata%ilh_eta = k
         486             :         call stat_assign( var_index=stats_metadata%ilh_eta, var_name="lh_eta", & ! intent(in)
         487             :              var_description="Latin hypercube estimate of Mellor's t [kg/kg]", & ! intent(in)
         488             :              var_units="kg/kg", & ! intent(in)
         489             :              l_silhs=.true., & ! intent(in)
         490           0 :              grid_kind=stats_lh_zt ) ! intent(inout)
         491           0 :         k = k + 1
         492             :
         493             :       case ( 'lh_chip2' )
         494           0 :         stats_metadata%ilh_chip2 = k
         495             :         call stat_assign( var_index=stats_metadata%ilh_chip2, var_name="lh_chip2", & ! intent(in)
         496             :              var_description="Latin hypercube estimate of variance of chi(s) [kg/kg]", &!intent(in)
         497             :              var_units="kg/kg", & ! intent(in)
         498             :              l_silhs=.true., &  ! intent(in)
         499           0 :              grid_kind=stats_lh_zt ) ! intent(inout)
         500           0 :         k = k + 1
         501             :
         502             :       case ( 'lh_wp2_zt' )
         503           0 :         stats_metadata%ilh_wp2_zt = k
         504             :         call stat_assign( var_index=stats_metadata%ilh_wp2_zt, var_name="lh_wp2_zt", & ! intent(in)
         505             :              var_description="Variance of the latin hypercube estimate of w [m^2/s^2]",&!intent(in)
         506             :              var_units="m^2/s^2", & ! intent(in)
         507             :              l_silhs=.true., & ! intent(in)
         508           0 :              grid_kind=stats_lh_zt ) ! intent(inout)
         509           0 :         k = k + 1
         510             :
         511             :       case ( 'lh_Ncnp2_zt' )
         512           0 :         stats_metadata%ilh_Ncnp2_zt = k
         513             :         call stat_assign( var_index=stats_metadata%ilh_Ncnp2_zt, var_name="lh_Ncnp2_zt", & ! intent(in)
         514             :              var_description="Variance of the latin hypercube estimate of Ncn [count^2/kg^2]", &!In
         515             :              var_units="count^2/kg^2", & ! intent(in)
         516             :              l_silhs=.true., & ! intent(in)
         517           0 :              grid_kind=stats_lh_zt ) ! intent(inout)
         518           0 :         k = k + 1
         519             :
         520             :       case ( 'lh_Ncp2_zt' )
         521           0 :         stats_metadata%ilh_Ncp2_zt = k
         522             :         call stat_assign( var_index=stats_metadata%ilh_Ncp2_zt, var_name="lh_Ncp2_zt", & ! intent(in)
         523             :              var_description="Variance of the latin hypercube estimate of Nc [count^2/kg^2]", & !In
         524             :              var_units="count^2/kg^2", & ! intent(in)
         525             :              l_silhs=.true., & ! intent(in)
         526           0 :              grid_kind=stats_lh_zt ) ! intent(inout)
         527           0 :         k = k + 1
         528             :
         529             :       case ( 'lh_Nrp2_zt' )
         530           0 :         stats_metadata%ilh_Nrp2_zt = k
         531             :         call stat_assign( var_index=stats_metadata%ilh_Nrp2_zt, var_name="lh_Nrp2_zt", & ! intent(in)
         532             :              var_description="Variance of the latin hypercube estimate of Nr [count^2/kg^2]", &!In
         533             :              var_units="count^2/kg^2", & ! intent(in)
         534             :              l_silhs=.true., & ! intent(in)
         535           0 :              grid_kind=stats_lh_zt ) ! intent(inout)
         536           0 :         k = k + 1
         537             :
         538             :       case ( 'lh_rcp2_zt' )
         539           0 :         stats_metadata%ilh_rcp2_zt = k
         540             :         call stat_assign( var_index=stats_metadata%ilh_rcp2_zt, var_name="lh_rcp2_zt", & ! intent(in)
         541             :              var_description="Variance of the latin hypercube estimate of rc [kg^2/kg^2]", & ! In
         542             :              var_units="kg^2/kg^2", & ! intent(in)
         543             :              l_silhs=.true., & ! intent(in)
         544           0 :              grid_kind=stats_lh_zt ) ! intent(inout)
         545           0 :         k = k + 1
         546             :
         547             :       case ( 'lh_rtp2_zt' )
         548           0 :         stats_metadata%ilh_rtp2_zt = k
         549             :         call stat_assign( var_index=stats_metadata%ilh_rtp2_zt, var_name="lh_rtp2_zt", & ! intent(in)
         550             :              var_description="Variance of the latin hypercube estimate of rt [kg^2/kg^2]", & ! In
         551             :              var_units="kg^2/kg^2", & ! intent(in)
         552             :              l_silhs=.true., & ! intent(in)
         553           0 :              grid_kind=stats_lh_zt ) ! intent(inout)
         554           0 :         k = k + 1
         555             :
         556             :       case ( 'lh_thlp2_zt' )
         557           0 :         stats_metadata%ilh_thlp2_zt = k
         558             :         call stat_assign( var_index=stats_metadata%ilh_thlp2_zt, var_name="lh_thlp2_zt", & ! intent(in)
         559             :              var_description="Variance of the latin hypercube estimate of thl [K^2]", & !intent(in)
         560             :              var_units="K^2", & ! intent(in)
         561             :              l_silhs=.true., & ! intent(in)
         562           0 :              grid_kind=stats_lh_zt ) ! intent(inout)
         563           0 :         k = k + 1
         564             :
         565             :       case ( 'lh_rrp2_zt' )
         566           0 :         stats_metadata%ilh_rrp2_zt = k
         567             :         call stat_assign( var_index=stats_metadata%ilh_rrp2_zt, var_name="lh_rrp2_zt", & ! intent(in)
         568             :              var_description="Variance of the latin hypercube estimate of rr [kg^2/kg^2]", & ! In
         569             :              var_units="kg^2/kg^2", & ! intent(in)
         570             :              l_silhs=.true., & ! intent(in)
         571           0 :              grid_kind=stats_lh_zt ) ! intent(inout)
         572           0 :         k = k + 1
         573             :
         574             :       case ( 'lh_rrm_auto' )
         575           0 :         stats_metadata%ilh_rrm_auto = k
         576             :         call stat_assign( var_index=stats_metadata%ilh_rrm_auto, var_name="lh_rrm_auto", & ! intent(in)
         577             :              var_description="Latin hypercube estimate of autoconversion [kg/kg/s]", & ! intent(in)
         578             :              var_units="kg/kg/s", & ! intent(in)
         579             :              l_silhs=.true., & ! intent(in)
         580           0 :              grid_kind=stats_lh_zt ) ! intent(inout)
         581           0 :         k = k + 1
         582             :
         583             :       case ( 'lh_rrm_accr' )
         584           0 :         stats_metadata%ilh_rrm_accr = k
         585             :         call stat_assign( var_index=stats_metadata%ilh_rrm_accr, var_name="lh_rrm_accr", & ! intent(in)
         586             :              var_description="Latin hypercube estimate of accretion [kg/kg/s]", & ! intent(in)
         587             :              var_units="kg/kg/s", l_silhs=.true., & ! intent(in)
         588           0 :              grid_kind=stats_lh_zt ) ! intent(inout)
         589           0 :         k = k + 1
         590             :
         591             :       case ( 'lh_rrm_evap' )
         592           0 :         stats_metadata%ilh_rrm_evap = k
         593             :         call stat_assign( var_index=stats_metadata%ilh_rrm_evap, var_name="lh_rrm_evap", & ! intent(in)
         594             :              var_description="Latin hypercube estimate of evaporation [kg/kg/s]", & ! intent(in)
         595             :              var_units="kg/kg/s", & ! intent(in)
         596             :              l_silhs=.true., & ! intent(in)
         597           0 :              grid_kind=stats_lh_zt ) ! intent(inout)
         598           0 :         k = k + 1
         599             :
         600             :       case ( 'lh_Nrm_auto' )
         601           0 :         stats_metadata%ilh_Nrm_auto = k
         602             :         call stat_assign( var_index=stats_metadata%ilh_Nrm_auto, var_name="lh_Nrm_auto", & ! intent(in)
         603             :              var_description="Latin hypercube estimate of Nrm autoconversion [num/kg/s]", & ! In
         604             :              var_units="num/kg/s", & ! intent(in)
         605             :              l_silhs=.true., & ! intent(in)
         606           0 :              grid_kind=stats_lh_zt ) ! intent(inout)
         607           0 :         k = k + 1
         608             :
         609             :       case ( 'lh_Nrm_evap' )
         610           0 :         stats_metadata%ilh_Nrm_evap = k
         611             :         call stat_assign( var_index=stats_metadata%ilh_Nrm_evap, var_name="lh_Nrm_evap", & ! intent(in)
         612             :              var_description="Latin hypercube estimate of Nrm evaporation [num/kg/s]", & ! In
         613             :              var_units="num/kg/s", & ! intent(in)
         614             :              l_silhs=.true., & ! intent(in)
         615           0 :              grid_kind=stats_lh_zt ) ! intent(inout)
         616           0 :         k = k + 1
         617             :
         618             :       case ( 'lh_rrm_src_adj' )
         619           0 :         stats_metadata%ilh_rrm_src_adj = k
         620             :         call stat_assign( var_index=stats_metadata%ilh_rrm_src_adj, var_name="lh_rrm_src_adj", & ! intent(in)
         621             :              var_description="Latin hypercube estimate of source adjustment (KK only!) [kg/kg/s]",&
         622             :              var_units="kg/kg/s", & ! intent(in)
         623             :              l_silhs=.true., & ! intent(in)
         624           0 :              grid_kind=stats_lh_zt ) ! intent(inout)
         625           0 :         k = k + 1
         626             :
         627             :       case ( 'lh_rrm_evap_adj' )
         628           0 :         stats_metadata%ilh_rrm_evap_adj = k
         629             :         call stat_assign( var_index=stats_metadata%ilh_rrm_evap_adj, var_name="lh_rrm_evap_adj", & ! intent(in)
         630             :              var_description="Latin hypercube estimate of evap adjustment (KK only!) [kg/kg/s]", &
         631             :              var_units="kg/kg/s", & ! intent(in)
         632             :              l_silhs=.true., & ! intent(in)
         633           0 :              grid_kind=stats_lh_zt ) ! intent(inout)
         634           0 :         k = k + 1
         635             :
         636             :       case ( 'lh_Nrm_src_adj' )
         637           0 :         stats_metadata%ilh_Nrm_src_adj = k
         638             :         call stat_assign( var_index=stats_metadata%ilh_Nrm_src_adj, var_name="lh_Nrm_src_adj", & ! intent(in)
         639             :              var_description="Latin hypercube estimate of Nrm source adjustment (KK only!) &
         640             :              &[kg/kg/s]", &
         641             :              var_units="kg/kg/s", & ! intent(in)
         642             :              l_silhs=.true., & ! intent(in)
         643           0 :              grid_kind=stats_lh_zt ) ! intent(inout)
         644           0 :         k = k + 1
         645             :
         646             :       case ( 'lh_Nrm_evap_adj' )
         647           0 :         stats_metadata%ilh_Nrm_evap_adj = k
         648             :         call stat_assign( var_index=stats_metadata%ilh_Nrm_evap_adj, var_name="lh_Nrm_evap_adj", & ! intent(in)
         649             :              var_description="Latin hypercube estimate of Nrm evap adjustment (KK only!) &
         650             :              &[kg/kg/s]", &
         651             :              var_units="kg/kg/s", & ! intent(in)
         652             :              l_silhs=.true., & ! intent(in)
         653           0 :              grid_kind=stats_lh_zt ) ! intent(inout)
         654           0 :         k = k + 1
         655             :
         656             :       case ( 'lh_precip_frac' )
         657           0 :         stats_metadata%ilh_precip_frac = k
         658             :         call stat_assign( var_index=stats_metadata%ilh_precip_frac, var_name="lh_precip_frac", & ! intent(in)
         659             :              var_description="Latin hypercube estimate of precipitation fraction [-]", & ! In
         660             :              var_units="-", & ! intent(in)
         661             :              l_silhs=.true., & ! intent(in)
         662           0 :              grid_kind=stats_lh_zt ) ! intent(inout)
         663           0 :         k = k + 1
         664             :
         665             :       case ( 'lh_precip_frac_unweighted' )
         666           0 :         stats_metadata%ilh_precip_frac_unweighted = k
         667             :         call stat_assign( var_index=stats_metadata%ilh_precip_frac_unweighted, & ! intent(in)
         668             :              var_name="lh_precip_frac_unweighted", & ! intent(in)
         669             :              var_description="Unweighted fraction of sample points in precipitation [-]", & ! In
         670             :              var_units="-", & ! intent(in)
         671             :              l_silhs=.true., & ! intent(in)
         672           0 :              grid_kind=stats_lh_zt ) ! intent(inout)
         673           0 :         k = k + 1
         674             :
         675             :       case ( 'lh_mixt_frac' )
         676           0 :         stats_metadata%ilh_mixt_frac = k
         677             :         call stat_assign( var_index=stats_metadata%ilh_mixt_frac, var_name="lh_mixt_frac", & ! intent(in)
         678             :              var_description="Latin hypercube estimate of mixture fraction (weight of 1st PDF &
         679             :              &component [-]", &
         680             :              var_units="-", & ! intent(in)
         681             :              l_silhs=.true., & ! intent(in)
         682           0 :              grid_kind=stats_lh_zt ) ! intent(inout)
         683           0 :         k = k + 1
         684             :
         685             :       case ( 'lh_mixt_frac_unweighted' )
         686           0 :         stats_metadata%ilh_mixt_frac_unweighted = k
         687             :         call stat_assign( var_index=stats_metadata%ilh_mixt_frac_unweighted, & ! intent(in)
         688             :              var_name="lh_mixt_frac_unweighted", & ! intent(in)
         689             :              var_description="Unweighted fraction of sample points in first PDF component [-]",&!In
         690             :              var_units="-", & ! intent(in)
         691             :              l_silhs=.true., & ! intent(in)
         692           0 :              grid_kind=stats_lh_zt ) ! intent(inout)
         693           0 :         k = k + 1
         694             :
         695             :       case ( 'lh_m_vol_rad_rain' )
         696           0 :         stats_metadata%ilh_m_vol_rad_rain = k
         697             :         call stat_assign( var_index=stats_metadata%ilh_m_vol_rad_rain, var_name="lh_m_vol_rad_rain", & !intent(in)
         698             :              var_description="SILHS est. of rain radius", var_units="m", & ! intent(in)
         699             :              l_silhs=.true., & ! intent(in)
         700           0 :              grid_kind=stats_lh_zt ) ! intent(inout)
         701           0 :         k = k + 1
         702             :
         703             :       case ( 'lh_rrm_mc_nonadj' )
         704           0 :         stats_metadata%ilh_rrm_mc_nonadj = k
         705             :         call stat_assign( var_index=stats_metadata%ilh_rrm_mc_nonadj, var_name="lh_rrm_mc_nonadj", & ! intent(in)
         706             :              var_description="SILHS est. of rrm_mc_nonadj [kg/kg/s]", var_units="kg/kg/s", & ! In
         707             :              l_silhs=.true., & ! intent(in)
         708           0 :              grid_kind=stats_lh_zt ) ! intent(inout)
         709           0 :         k = k + 1
         710             :
         711             :       case ( 'silhs_variance_category' )
         712             :
         713           0 :         do icategory=1, silhs_num_importance_categories
         714             :
         715           0 :           stats_metadata%isilhs_variance_category(icategory) = k
         716           0 :           write(category_num_as_string,'(I1)') icategory
         717           0 :           call stat_assign( var_index=stats_metadata%isilhs_variance_category(icategory), & ! intent(in)
         718             :                var_name="silhs_var_cat_"//category_num_as_string, & ! intent(in)
         719             :                var_description="Variance of SILHS variable in importance category " // &!intent(in)
         720             :                category_num_as_string, var_units="various", & ! intent(in)
         721             :                l_silhs=.false., & ! intent(in)
         722           0 :                grid_kind=stats_lh_zt ) ! intent(inout)
         723           0 :           k = k + 1
         724             :
         725             :         end do
         726             :
         727             :       case ( 'lh_samp_frac_category' )
         728             :
         729           0 :         do icategory=1, silhs_num_importance_categories
         730             :
         731           0 :           stats_metadata%ilh_samp_frac_category(icategory) = k
         732           0 :           write(category_num_as_string,'(I1)') icategory
         733           0 :           call stat_assign( var_index=stats_metadata%ilh_samp_frac_category(icategory), & ! intent(in)
         734             :                var_name="lh_samp_frac_"//category_num_as_string, & ! intent(in)
         735             :                var_description="Number of samples in importance category " // & ! intent(in)
         736             :                category_num_as_string // " [-]", var_units="-", l_silhs=.false., & ! intent(in)
         737           0 :                grid_kind=stats_lh_zt ) ! intent(inout)
         738           0 :           k = k + 1
         739             :
         740             :         end do
         741             :
         742             :       case default
         743             :
         744           0 :         write(fstderr,*) 'Error:  unrecognized variable in vars_lh_zt:  ', trim( vars_lh_zt(i) )
         745             :
         746           0 :         l_error = .true.  ! This will stop the run.
         747             :
         748             :       end select
         749             :
         750             :     end do ! i = 1, stats_lh_zt%num_output_fields
         751             :
         752           0 :     return
         753             :   end subroutine stats_init_lh_zt
         754             :
         755             : end module stats_lh_zt_module

Generated by: LCOV version 1.14