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

              Line data    Source code
           1             : !-----------------------------------------------------------------------
           2             : ! $Id$
           3             : !===============================================================================
           4             :
           5             : module stats_rad_zt_module
           6             :
           7             :   implicit none
           8             :
           9             :   private ! Default Scope
          10             :
          11             :   public :: stats_init_rad_zt
          12             :
          13             :   ! Constant parameters
          14             :   integer, parameter, public :: nvarmax_rad_zt = 250 ! Maximum variables allowed
          15             :
          16             :   contains
          17             :
          18             : !-----------------------------------------------------------------------
          19           0 :   subroutine stats_init_rad_zt( vars_rad_zt,                    & ! intent(in)
          20             :                                 l_error,                        & ! intent(inout)
          21             :                                 stats_metadata, stats_rad_zt )    ! intent(inout)
          22             :
          23             : ! Description:
          24             : !   Initializes array indices for stats_zt
          25             : !
          26             : ! References:
          27             : !   None
          28             : !-----------------------------------------------------------------------
          29             :
          30             :     use constants_clubb, only:  &
          31             :         fstderr ! Constant(s)
          32             :
          33             :     use stats_type_utilities, only: &
          34             :         stat_assign ! Procedure
          35             :
          36             :     use stats_type, only: &
          37             :         stats ! Type
          38             :
          39             :     use stats_variables, only: &
          40             :         stats_metadata_type
          41             :
          42             :     implicit none
          43             :
          44             :     !--------------------- Input Variable ---------------------
          45             :     character(len= * ), dimension(nvarmax_rad_zt), intent(in) :: &
          46             :       vars_rad_zt
          47             :
          48             :     !--------------------- InOut Variables ---------------------
          49             :     type (stats_metadata_type), intent(inout) :: &
          50             :       stats_metadata
          51             :
          52             :     type (stats), target, intent(inout) :: &
          53             :       stats_rad_zt
          54             :
          55             :     logical, intent(inout) :: l_error
          56             :
          57             :     !--------------------- Local Varables ---------------------
          58             :     integer :: i, k
          59             :
          60             :     !--------------------- Begin Code ---------------------
          61             :
          62             :     ! Default initialization for array indices for stats_rad_zt
          63             :
          64           0 :     stats_metadata%iT_in_K_rad             = 0
          65           0 :     stats_metadata%ircil_rad               = 0
          66           0 :     stats_metadata%io3l_rad                = 0
          67           0 :     stats_metadata%irsm_rad                = 0
          68           0 :     stats_metadata%ircm_in_cloud_rad       = 0
          69           0 :     stats_metadata%icloud_frac_rad         = 0
          70           0 :     stats_metadata%iice_supersat_frac_rad  = 0
          71           0 :     stats_metadata%iradht_rad              = 0
          72           0 :     stats_metadata%iradht_LW_rad           = 0
          73           0 :     stats_metadata%iradht_SW_rad           = 0
          74           0 :     stats_metadata%ip_in_mb_rad            = 0
          75           0 :     stats_metadata%isp_humidity_rad        = 0
          76             :
          77             :
          78             :     ! Assign pointers for statistics variables stats_rad_zt
          79             :
          80           0 :     k = 1
          81           0 :     do i=1,stats_rad_zt%num_output_fields
          82             :
          83           0 :       select case ( trim(vars_rad_zt(i)) )
          84             :
          85             :       case ('T_in_K_rad')
          86           0 :         stats_metadata%iT_in_K_rad = k
          87             :
          88             :         call stat_assign( var_index=stats_metadata%iT_in_K_rad, var_name="T_in_K_rad", & ! intent(in)
          89             :              var_description="Temperature [K]", var_units="K", l_silhs=.false., & ! intent(in)
          90           0 :                 grid_kind=stats_rad_zt )! intent(inout)
          91           0 :         k = k + 1
          92             :
          93             :       case ('rcil_rad')
          94           0 :         stats_metadata%ircil_rad = k
          95             :
          96             :         call stat_assign( var_index=stats_metadata%ircil_rad, var_name="rcil_rad", & ! intent(in)
          97             :              var_description="Ice mixing ratio [kg/kg]", var_units="kg/kg", & ! intent(in)
          98             :              l_silhs=.false., & ! intent(in)
          99           0 :              grid_kind=stats_rad_zt ) ! intent(inout)
         100           0 :         k = k + 1
         101             :
         102             :       case ('o3l_rad')
         103           0 :         stats_metadata%io3l_rad = k
         104             :
         105             :         call stat_assign( var_index=stats_metadata%io3l_rad, var_name="o3l_rad", & ! intent(in)
         106             :              var_description="Ozone mixing ratio [kg/kg]", var_units="kg/kg", & ! intent(in)
         107             :              l_silhs=.false., & ! intent(in)
         108           0 :              grid_kind=stats_rad_zt ) ! intent(inout)
         109           0 :         k = k + 1
         110             :
         111             :       case ('rsm_rad')
         112           0 :         stats_metadata%irsm_rad = k
         113             :
         114             :         call stat_assign( var_index=stats_metadata%irsm_rad, var_name="rsm_rad", & ! intent(in)
         115             :              var_description="Snow water mixing ratio [kg/kg]", var_units="kg/kg", & ! intent(in)
         116             :              l_silhs=.false., & ! intent(in)
         117           0 :              grid_kind=stats_rad_zt ) ! intent(inout)
         118           0 :         k = k + 1
         119             :
         120             :       case ('rcm_in_cloud_rad')
         121           0 :         stats_metadata%ircm_in_cloud_rad = k
         122             :
         123             :         call stat_assign( var_index=stats_metadata%ircm_in_cloud_rad, var_name="rcm_in_cloud_rad", & ! intent(in)
         124             :              var_description="rcm in cloud layer [kg/kg]", var_units="kg/kg", & ! intent(in)
         125             :              l_silhs=.false., & ! intent(in)
         126           0 :              grid_kind=stats_rad_zt ) ! intent(inout)
         127           0 :         k = k + 1
         128             :
         129             :       case ('cloud_frac_rad')
         130           0 :         stats_metadata%icloud_frac_rad = k
         131             :
         132             :         call stat_assign( var_index=stats_metadata%icloud_frac_rad, var_name="cloud_frac_rad", & ! intent(in)
         133             :              var_description="Cloud fraction (between 0 and 1) [-]", & ! intent(in)
         134             :              var_units="count", & ! intent(in)
         135             :              l_silhs=.false., & ! intent(in)
         136           0 :              grid_kind=stats_rad_zt ) ! intent(inout)
         137           0 :         k = k + 1
         138             :
         139             :       case ('ice_supersat_frac_rad')
         140           0 :         stats_metadata%iice_supersat_frac_rad = k
         141             :
         142             :         call stat_assign( var_index=stats_metadata%iice_supersat_frac_rad, var_name="ice_supersat_frac_rad", & !In
         143             :              var_description="Ice cloud fraction (between 0 and 1) [-]", var_units="count", & ! In
         144             :              l_silhs=.false., & ! intent(in)
         145           0 :              grid_kind=stats_rad_zt ) ! intent(inout)
         146           0 :         k = k + 1
         147             :
         148             :       case ('radht_rad')
         149           0 :         stats_metadata%iradht_rad = k
         150             :
         151             :         call stat_assign( var_index=stats_metadata%iradht_rad, var_name="radht_rad", & ! intent(in)
         152             :              var_description="Total radiative heating rate [K/s]", var_units="K/s", & ! intent(in)
         153             :              l_silhs=.false., & ! intent(in)
         154           0 :              grid_kind=stats_rad_zt ) ! intent(inout)
         155           0 :         k = k + 1
         156             :
         157             :       case ('radht_LW_rad')
         158           0 :         stats_metadata%iradht_LW_rad = k
         159             :
         160             :         call stat_assign( var_index=stats_metadata%iradht_LW_rad, var_name="radht_LW_rad", & ! intent(in)
         161             :              var_description="Long-wave radiative heating rate [K/s]", var_units="K/s", & ! In
         162             :              l_silhs=.false., & ! intent(in)
         163           0 :              grid_kind=stats_rad_zt ) ! intent(inout)
         164           0 :         k = k + 1
         165             :
         166             :       case ('radht_SW_rad')
         167           0 :         stats_metadata%iradht_SW_rad = k
         168             :
         169             :         call stat_assign( var_index=stats_metadata%iradht_SW_rad, var_name="radht_SW_rad", & ! intent(in)
         170             :              var_description="Short-wave radiative heating rate [K/s]", var_units="K/s", & ! In
         171             :              l_silhs=.false., & ! intent(in)
         172           0 :              grid_kind=stats_rad_zt ) ! intent(inout)
         173           0 :         k = k + 1
         174             :
         175             :       case ('p_in_mb_rad')
         176           0 :         stats_metadata%ip_in_mb_rad = k
         177             :
         178             :         call stat_assign( var_index=stats_metadata%ip_in_mb_rad, var_name="p_in_mb_rad", & ! intent(in)
         179             :              var_description="Pressure [hPa]", var_units="hPa", & ! intent(in)
         180             :              l_silhs=.false., & ! intent(in)
         181           0 :              grid_kind=stats_rad_zt ) ! intent(inout)
         182           0 :         k = k + 1
         183             :
         184             :       case ('sp_humidity_rad')
         185           0 :         stats_metadata%isp_humidity_rad = k
         186             :
         187             :         call stat_assign( var_index=stats_metadata%isp_humidity_rad, var_name="sp_humidity_rad", & ! intent(in)
         188             :              var_description="Specific humidity [kg/kg]", var_units="kg/kg", & ! intent(in)
         189             :              l_silhs=.false., & ! intent(in)
         190           0 :              grid_kind=stats_rad_zt ) ! intent(inout)
         191           0 :         k = k + 1
         192             :
         193             :       case default
         194             :
         195           0 :         write(fstderr,*) 'Error:  unrecognized variable in vars_rad_zt:  ', trim( vars_rad_zt(i) )
         196             :
         197           0 :         l_error = .true.  ! This will stop the run.
         198             :
         199             :
         200             :       end select
         201             :
         202             :     end do
         203             :
         204           0 :     return
         205             :   end subroutine stats_init_rad_zt
         206             :
         207             : end module stats_rad_zt_module

Generated by: LCOV version 1.14