@@ -562,6 +562,7 @@ subroutine compute_Cx_fnc_Richardson( nz, ngrdcol, gr, &
562562 l_use_thvm_in_bv_freq , &
563563 l_use_shear_Richardson , &
564564 l_modify_limiters_for_cnvg_test , &
565+ stats_metadata , &
565566 stats_zm , &
566567 Cx_fnc_Richardson )
567568
@@ -596,8 +597,7 @@ subroutine compute_Cx_fnc_Richardson( nz, ngrdcol, gr, &
596597 ibv_efold
597598
598599 use stats_variables, only: &
599- ishear_sqd, & ! Variable(s)
600- l_stats_samp
600+ stats_metadata_type
601601
602602 use stats_type_utilities, only: &
603603 stat_update_var ! Procedure
@@ -606,7 +606,7 @@ subroutine compute_Cx_fnc_Richardson( nz, ngrdcol, gr, &
606606
607607 implicit none
608608
609- ! ! ------------------------------ Constant Parameters ! ------------------------------
609+ !- ----------------------------- Constant Parameters ------------------------------
610610 real ( kind = core_rknd ), parameter :: &
611611 Richardson_num_divisor_threshold = 1.0e-6_core_rknd , &
612612 Cx_fnc_Richardson_below_ground_value = one
@@ -621,7 +621,7 @@ subroutine compute_Cx_fnc_Richardson( nz, ngrdcol, gr, &
621621 ! https://github.com/larson-group/clubb/issues/965#issuecomment-1119816722
622622 ! for a plot on how output behaves with varying min_max_smth_mag
623623
624- !- ----------------------------- Input ------------------------------
624+ !- ----------------------------- Input Variables ------------------------------
625625 integer , intent (in ) :: &
626626 nz, &
627627 ngrdcol
@@ -658,6 +658,9 @@ subroutine compute_Cx_fnc_Richardson( nz, ngrdcol, gr, &
658658 logical , intent (in ) :: &
659659 l_modify_limiters_for_cnvg_test
660660
661+ type (stats_metadata_type), intent (in ) :: &
662+ stats_metadata
663+
661664 !- ----------------------------- InOut Variable ------------------------------
662665 type (stats), target , dimension (ngrdcol), intent (inout ) :: &
663666 stats_zm
@@ -739,10 +742,10 @@ subroutine compute_Cx_fnc_Richardson( nz, ngrdcol, gr, &
739742 end do
740743 ! $acc end parallel loop
741744
742- if ( l_stats_samp ) then
745+ if ( stats_metadata % l_stats_samp ) then
743746 ! $acc update host(shear_sqd)
744747 do i = 1 , ngrdcol
745- call stat_update_var( ishear_sqd, shear_sqd(i,:), & ! intent(in)
748+ call stat_update_var( stats_metadata % ishear_sqd, shear_sqd(i,:), & ! intent(in)
746749 stats_zm(i) ) ! intent(inout)
747750 end do
748751 end if
0 commit comments