@@ -20,6 +20,7 @@ module subcol_SILHS
2020 use clubb_intr, only: &
2121 clubb_config_flags, &
2222 clubb_params, &
23+ stats_metadata, &
2324 stats_zt, stats_zm, stats_sfc, &
2425 pdf_params_chnk
2526
@@ -473,7 +474,7 @@ subroutine subcol_init_SILHS(pbuf2d)
473474 corr_file_path_below = trim ( subcol_SILHS_corr_file_path )// trim ( subcol_SILHS_corr_file_name )// below_file_ext
474475
475476 call setup_corr_varnce_array_api( corr_file_path_cloud, corr_file_path_below, &
476- getnewunit (iunit), &
477+ newunit (iunit), &
477478 clubb_config_flags% l_fix_w_chi_eta_correlations )
478479
479480 !- ------------------------------
@@ -603,8 +604,6 @@ subroutine subcol_gen_SILHS(state, tend, state_sc, tend_sc, pbuf)
603604
604605 setup_pdf_parameters_api, &
605606
606- l_stats_samp, &
607-
608607 hydromet_pdf_parameter, &
609608
610609 zm2zt_api, setup_grid_heights_api, &
@@ -664,7 +663,6 @@ subroutine subcol_gen_SILHS(state, tend, state_sc, tend_sc, pbuf)
664663 real (r8 ), parameter :: qsmall = 1.0e-18_r8 ! Microphysics cut-off for cloud
665664
666665 integer :: i, j, k, ngrdcol, ncol, lchnk, stncol
667- integer :: begin_height, end_height ! Output from setup_grid call
668666 real (r8 ) :: sfc_elevation(state% ngrdcol) ! Surface elevation
669667
670668 real (r8 ), dimension (state% ngrdcol,pverp- top_lev+1 ) :: zt_g, zi_g ! Thermo & Momentum grids for clubb
@@ -957,7 +955,7 @@ subroutine subcol_gen_SILHS(state, tend, state_sc, tend_sc, pbuf)
957955 call setup_grid_api( pverp+1 - top_lev, ncol, sfc_elevation(1 :ncol), l_implemented, & ! intent(in)
958956 grid_type, zi_g(1 :ncol,2 ), zi_g(1 :ncol,1 ), zi_g(1 :ncol,pverp+1 - top_lev), & ! intent(in)
959957 zi_g(1 :ncol,:), zt_g(1 :ncol,:), & ! intent(in)
960- gr, begin_height, end_height )
958+ gr )
961959
962960 ! Calculate the distance between grid levels on the host model grid,
963961 ! using host model grid indices.
@@ -1135,7 +1133,7 @@ subroutine subcol_gen_SILHS(state, tend, state_sc, tend_sc, pbuf)
11351133 Nc_in_cloud, cld_frac_in, khzm, & ! In
11361134 ice_supersat_frac_in, hydromet, wphydrometp, & ! In
11371135 corr_array_n_cloud, corr_array_n_below, & ! In
1138- pdf_params_chnk(lchnk), l_stats_samp, & ! In
1136+ pdf_params_chnk(lchnk), & ! In
11391137 clubb_params, & ! In
11401138 clubb_config_flags% iiPDF_type, & ! In
11411139 clubb_config_flags% l_use_precip_frac, & ! In
@@ -1144,6 +1142,7 @@ subroutine subcol_gen_SILHS(state, tend, state_sc, tend_sc, pbuf)
11441142 clubb_config_flags% l_calc_w_corr, & ! In
11451143 clubb_config_flags% l_const_Nc_in_cloud, & ! In
11461144 clubb_config_flags% l_fix_w_chi_eta_correlations, & ! In
1145+ stats_metadata, & ! In
11471146 stats_zt, stats_zm, stats_sfc, & ! In
11481147 hydrometp2, & ! Inout
11491148 mu_x_1, mu_x_2, & ! Out
@@ -1231,7 +1230,8 @@ subroutine subcol_gen_SILHS(state, tend, state_sc, tend_sc, pbuf)
12311230 clubb_config_flags% l_tke_aniso, & ! In
12321231 clubb_config_flags% l_standard_term_ta, & ! In
12331232 vert_decorr_coef, & ! In
1234- stats_lh_zt, stats_lh_sfc, & ! intent(inout)
1233+ stats_metadata, & ! In
1234+ stats_lh_zt, stats_lh_sfc, & ! InOut
12351235 X_nl_all_levs, X_mixt_comp_all_levs, & ! Out
12361236 lh_sample_point_weights) ! Out
12371237
@@ -4125,12 +4125,12 @@ end subroutine subcol_SILHS_hydromet_conc_tend_lim
41254125 ! small function to get an unused stream identifier to send to setup_corr_varnce_array_api
41264126 ! or any other silhs/clubb functions that require a unit number argument
41274127 ! This comes directly from the Fortran wiki
4128- integer function getnewunit (unit )
4128+ integer function newunit (unit )
41294129 integer , intent (out ), optional :: unit
41304130
41314131 integer , parameter :: LUN_MIN= 10 , LUN_MAX= 1000
41324132 logical :: opened
4133- integer :: lun, newunit
4133+ integer :: lun
41344134
41354135 newunit=- 1
41364136 do lun= LUN_MIN,LUN_MAX
@@ -4141,6 +4141,6 @@ integer function getnewunit(unit)
41414141 end if
41424142 end do
41434143 if (present (unit)) unit= newunit
4144- end function getnewunit
4144+ end function newunit
41454145
41464146end module subcol_SILHS
0 commit comments