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

              Line data    Source code
           1             : !-----------------------------------------------------------------------
           2             : ! $Id$
           3             : !===============================================================================
           4             :
           5             : module stats_rad_zm_module
           6             :
           7             :   implicit none
           8             :
           9             :   private ! Default Scope
          10             :
          11             :   public :: stats_init_rad_zm
          12             :
          13             : ! Constant parameters
          14             :   integer, parameter, public :: nvarmax_rad_zm = 250 ! Maximum variables allowed
          15             :
          16             :   contains
          17             :
          18             : !-----------------------------------------------------------------------
          19           0 :   subroutine stats_init_rad_zm( vars_rad_zm,                    & ! intent(in)
          20             :                                 l_error,                        & ! intent(in)
          21             :                                 stats_metadata, stats_rad_zm )    ! intent(inout)
          22             :
          23             : !     Description:
          24             : !     Initializes array indices for stats_rad_zm variables
          25             : !-----------------------------------------------------------------------
          26             :
          27             :     use constants_clubb, only:  &
          28             :         fstderr ! Constant(s)
          29             :
          30             :     use stats_type_utilities, only: &
          31             :         stat_assign ! Procedure
          32             :
          33             :     use stats_type, only: &
          34             :         stats ! Type
          35             :
          36             :     use stats_variables, only: &
          37             :         stats_metadata_type
          38             :
          39             :     implicit none
          40             :
          41             :     !------------------------ Input Variable ------------------------
          42             :     character(len= * ), dimension(nvarmax_rad_zm), intent(in) :: vars_rad_zm
          43             :
          44             :     !--------------------- InOut Variables ---------------------
          45             :     type (stats), target, intent(inout) :: &
          46             :       stats_rad_zm
          47             :
          48             :     type (stats_metadata_type), intent(inout) :: &
          49             :       stats_metadata
          50             :
          51             :     logical, intent(inout) :: l_error
          52             :
          53             :     !------------------------ Local Varables ------------------------
          54             :     integer :: i, k
          55             :
          56             :     !------------------------ Begin Code ------------------------
          57             :
          58             :     ! Default initialization for array indices for stats_rad_zm
          59             :
          60           0 :     stats_metadata%iFrad_LW_rad = 0
          61           0 :     stats_metadata%iFrad_SW_rad = 0
          62           0 :     stats_metadata%iFrad_SW_up_rad = 0
          63           0 :     stats_metadata%iFrad_LW_up_rad = 0
          64           0 :     stats_metadata%iFrad_SW_down_rad = 0
          65           0 :     stats_metadata%iFrad_LW_down_rad = 0
          66             :
          67           0 :     stats_metadata%ifulwcl = 0
          68           0 :     stats_metadata%ifdlwcl = 0
          69           0 :     stats_metadata%ifdswcl = 0
          70           0 :     stats_metadata%ifuswcl = 0
          71             :
          72             : !     Assign pointers for statistics variables stats_rad_zm
          73             :
          74           0 :     k = 1
          75           0 :     do i=1,stats_rad_zm%num_output_fields
          76             :
          77           0 :       select case ( trim(vars_rad_zm(i)) )
          78             :
          79             :       case('fulwcl')
          80           0 :         stats_metadata%ifulwcl = k
          81             :         call stat_assign( var_index=stats_metadata%ifulwcl, var_name="fulwcl", & ! intent(in)
          82             :              var_description="Upward clear-sky LW flux [W/m^2]", var_units="W/m^2", & ! intent(in)
          83             :              l_silhs=.false., & ! intent(in)
          84           0 :              grid_kind=stats_rad_zm ) ! intent(inout)
          85           0 :         k = k + 1
          86             :
          87             :       case( 'fdlwcl' )
          88           0 :         stats_metadata%ifdlwcl = k
          89             :         call stat_assign( var_index=stats_metadata%ifdlwcl, var_name="fdlwcl", & ! intent(in)
          90             :              var_description="Downward clear-sky LW flux [W/m^2]", var_units="W/m^2", & !intent(in)
          91             :              l_silhs=.false., & ! intent(in)
          92           0 :              grid_kind=stats_rad_zm ) ! intent(inout)
          93           0 :         k = k + 1
          94             :
          95             :       case( 'fdswcl' )
          96           0 :         stats_metadata%ifdswcl = k
          97             :         call stat_assign( var_index=stats_metadata%ifdswcl, var_name="fdswcl", & ! intent(in)
          98             :              var_description="Downward clear-sky SW flux [W/m^2]", var_units="W/m^2", & !intent(in)
          99             :              l_silhs=.false., & ! intent(in)
         100           0 :              grid_kind=stats_rad_zm ) ! intent(inout)
         101           0 :         k = k + 1
         102             :
         103             :       case( 'fuswcl' )
         104           0 :         stats_metadata%ifuswcl = k
         105             :         call stat_assign( var_index=stats_metadata%ifuswcl, var_name="fuswcl", & ! intent(in)
         106             :              var_description="Upward clear-sky SW flux [W/m^2]", var_units="W/m^2", & ! intent(in)
         107             :              l_silhs=.false., & ! intent(in)
         108           0 :              grid_kind=stats_rad_zm ) ! intent(inout)
         109           0 :         k = k + 1
         110             :
         111             :       case ('Frad_LW_rad')
         112           0 :         stats_metadata%iFrad_LW_rad = k
         113             :
         114             :         call stat_assign( var_index=stats_metadata%iFrad_LW_rad, var_name="Frad_LW_rad", & ! intent(in)
         115             :              var_description="Net long-wave radiative flux [W/m^2]", var_units="W/m^2", & ! In
         116             :              l_silhs=.false., & ! intent(in)
         117           0 :              grid_kind=stats_rad_zm ) ! intent(inout)
         118           0 :         k = k + 1
         119             :
         120             :       case ('Frad_SW_rad')
         121           0 :         stats_metadata%iFrad_SW_rad = k
         122             :
         123             :         call stat_assign( var_index=stats_metadata%iFrad_SW_rad, var_name="Frad_SW_rad", & ! intent(in)
         124             :              var_description="Net short-wave radiative flux [W/m^2]", var_units="W/m^2", & ! In
         125             :              l_silhs=.false., & ! intent(in)
         126           0 :              grid_kind=stats_rad_zm ) ! intent(inout)
         127           0 :         k = k + 1
         128             :
         129             :       case ('Frad_SW_up_rad')
         130           0 :         stats_metadata%iFrad_SW_up_rad = k
         131             :
         132             :         call stat_assign( var_index=stats_metadata%iFrad_SW_up_rad, var_name="Frad_SW_up_rad", & ! intent(in)
         133             :              var_description="Short-wave upwelling radiative flux [W/m^2]", var_units="W/m^2", &!In
         134             :              l_silhs=.false., & ! intent(in)
         135           0 :              grid_kind=stats_rad_zm ) ! intent(inout)
         136           0 :         k = k + 1
         137             :
         138             :       case ('Frad_LW_up_rad')
         139           0 :         stats_metadata%iFrad_LW_up_rad = k
         140             :
         141             :         call stat_assign( var_index=stats_metadata%iFrad_LW_up_rad, var_name="Frad_LW_up_rad", & ! intent(in)
         142             :              var_description="Long-wave upwelling radiative flux [W/m^2]", var_units="W/m^2", &!In
         143             :              l_silhs=.false., & ! intent(in)
         144           0 :              grid_kind=stats_rad_zm ) ! intent(inout)
         145           0 :         k = k + 1
         146             :
         147             :       case ('Frad_SW_down_rad')
         148           0 :         stats_metadata%iFrad_SW_down_rad = k
         149             :
         150             :         call stat_assign( var_index=stats_metadata%iFrad_SW_down_rad, var_name="Frad_SW_down_rad", & ! intent(in)
         151             :              var_description="Short-wave downwelling radiative flux [W/m^2]", & ! intent(in)
         152             :              var_units="W/m^2", & ! intent(in)
         153             :              l_silhs=.false., & ! intent(in)
         154           0 :              grid_kind=stats_rad_zm ) ! intent(inout)
         155           0 :         k = k + 1
         156             :
         157             :       case ('Frad_LW_down_rad')
         158           0 :         stats_metadata%iFrad_LW_down_rad = k
         159             :
         160             :         call stat_assign( var_index=stats_metadata%iFrad_LW_down_rad, var_name="Frad_LW_down_rad", & ! intent(in)
         161             :              var_description="Long-wave downwelling radiative flux [W/m^2]", & ! intent(in)
         162             :              var_units="W/m^2", & ! intent(in)
         163             :              l_silhs=.false., & ! intent(in)
         164           0 :              grid_kind=stats_rad_zm ) ! intent(inout)
         165           0 :         k = k + 1
         166             :
         167             :       case default
         168             :
         169           0 :         write(fstderr,*) 'Error:  unrecognized variable in vars_rad_zm:  ', trim( vars_rad_zm(i) )
         170             :
         171           0 :         l_error = .true.  ! This will stop the run.
         172             :
         173             :
         174             :       end select
         175             :
         176             :     end do
         177             :
         178           0 :     return
         179             :   end subroutine stats_init_rad_zm
         180             :
         181             : end module stats_rad_zm_module

Generated by: LCOV version 1.14