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

          Line data    Source code
       1             : !-------------------------------------------------------------------------------
       2             : ! $Id$
       3             : !===============================================================================
       4             : module parameters_model
       5             : 
       6             : ! Description:
       7             : !   Contains model parameters that are determined at run time rather than
       8             : !   compile time.
       9             : !
      10             : ! References:
      11             : !   None
      12             : !-------------------------------------------------------------------------------
      13             : 
      14             :   use clubb_precision, only: &
      15             :     core_rknd
      16             : 
      17             :   implicit none
      18             : 
      19             :   private ! Default scope
      20             : 
      21             :   ! Maximum magnitude of PDF parameter 'mixt_frac'. 
      22             :   real( kind = core_rknd ), public :: &
      23             :     mixt_frac_max_mag
      24             : 
      25             :   ! Model parameters and constraints setup in the namelists
      26             :   real( kind = core_rknd ), public ::  & 
      27             :     T0       = 300._core_rknd, & ! Reference temperature (usually 300)  [K]
      28             :     ts_nudge = 0._core_rknd      ! Timescale of u/v nudging             [s]
      29             : 
      30             :   real( kind = core_rknd), public :: &
      31             :     rtm_min                = epsilon( rtm_min ), & ! Value below which rtm will be nudged [kg/kg]
      32             :     rtm_nudge_max_altitude = 10000._core_rknd      ! Highest altitude at which to nudge rtm [m]
      33             : 
      34             :   public :: setup_parameters_model 
      35             : 
      36             :   contains
      37             : 
      38             : !-------------------------------------------------------------------------------
      39        1536 :   subroutine setup_parameters_model ( T0_in, ts_nudge_in, Skw_max_mag )
      40             : 
      41             : ! Description:
      42             : !   Sets parameters to their initial values
      43             : !
      44             : ! References:
      45             : !   None
      46             : !-------------------------------------------------------------------------------
      47             : 
      48             :     use clubb_precision, only: &
      49             :         core_rknd ! Variable(s)
      50             : 
      51             :     implicit none
      52             : 
      53             :     !------------------------ Input Variables ------------------------
      54             :     real( kind = core_rknd ), intent(in) ::  & 
      55             :       T0_in,       & ! Ref. temperature                         [K]
      56             :       ts_nudge_in, & ! Timescale for u/v nudging                [s]
      57             :       Skw_max_mag    ! Maximum allowable magnitude of Skewness  [-]
      58             : 
      59             :     !------------------------ Begin Code ------------------------
      60             :      
      61             :     ! Formula from subroutine pdf_closure, where sigma_sqd_w = 0.4 and Skw =
      62             :     ! Skw_max_mag in this formula.  Note that this is constant, but can't appear
      63             :     ! with a Fortran parameter attribute, so we define it here. 
      64             :     mixt_frac_max_mag = 1.0_core_rknd &
      65             :       - ( 0.5_core_rknd * ( 1.0_core_rknd - Skw_max_mag / &
      66             :       sqrt( 4.0_core_rknd * ( 1.0_core_rknd - 0.4_core_rknd )**3 &
      67        1536 :       + Skw_max_mag**2 ) ) ) ! Known magic number
      68             : 
      69        1536 :     T0       = T0_in
      70        1536 :     ts_nudge = ts_nudge_in
      71             : 
      72        1536 :     return
      73             :   end subroutine setup_parameters_model
      74             : !-------------------------------------------------------------------------------
      75             : 
      76             : end module parameters_model

Generated by: LCOV version 1.14