Skip to content

Commit

Permalink
UWM updates for SILHS
Browse files Browse the repository at this point in the history
  • Loading branch information
Katetc committed Jan 11, 2024
1 parent 466d2a4 commit f0f446d
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions src/physics/cam/subcol_SILHS.F90
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ module subcol_SILHS
use clubb_intr, only: &
clubb_config_flags, &
clubb_params, &
stats_metadata, &
stats_zt, stats_zm, stats_sfc, &
pdf_params_chnk

Expand Down Expand Up @@ -473,7 +474,7 @@ subroutine subcol_init_SILHS(pbuf2d)
corr_file_path_below = trim( subcol_SILHS_corr_file_path )//trim( subcol_SILHS_corr_file_name )//below_file_ext

call setup_corr_varnce_array_api( corr_file_path_cloud, corr_file_path_below, &
getnewunit(iunit), &
newunit(iunit), &
clubb_config_flags%l_fix_w_chi_eta_correlations )

!-------------------------------
Expand Down Expand Up @@ -603,8 +604,6 @@ subroutine subcol_gen_SILHS(state, tend, state_sc, tend_sc, pbuf)

setup_pdf_parameters_api, &

l_stats_samp, &

hydromet_pdf_parameter, &

zm2zt_api, setup_grid_heights_api, &
Expand Down Expand Up @@ -664,7 +663,6 @@ subroutine subcol_gen_SILHS(state, tend, state_sc, tend_sc, pbuf)
real(r8), parameter :: qsmall = 1.0e-18_r8 ! Microphysics cut-off for cloud

integer :: i, j, k, ngrdcol, ncol, lchnk, stncol
integer :: begin_height, end_height ! Output from setup_grid call
real(r8) :: sfc_elevation(state%ngrdcol) ! Surface elevation

real(r8), dimension(state%ngrdcol,pverp-top_lev+1) :: zt_g, zi_g ! Thermo & Momentum grids for clubb
Expand Down Expand Up @@ -957,7 +955,7 @@ subroutine subcol_gen_SILHS(state, tend, state_sc, tend_sc, pbuf)
call setup_grid_api( pverp+1-top_lev, ncol, sfc_elevation(1:ncol), l_implemented, & ! intent(in)
grid_type, zi_g(1:ncol,2), zi_g(1:ncol,1), zi_g(1:ncol,pverp+1-top_lev), & ! intent(in)
zi_g(1:ncol,:), zt_g(1:ncol,:), & ! intent(in)
gr, begin_height, end_height )
gr )

! Calculate the distance between grid levels on the host model grid,
! using host model grid indices.
Expand Down Expand Up @@ -1135,7 +1133,7 @@ subroutine subcol_gen_SILHS(state, tend, state_sc, tend_sc, pbuf)
Nc_in_cloud, cld_frac_in, khzm, & ! In
ice_supersat_frac_in, hydromet, wphydrometp, & ! In
corr_array_n_cloud, corr_array_n_below, & ! In
pdf_params_chnk(lchnk), l_stats_samp, & ! In
pdf_params_chnk(lchnk), & ! In
clubb_params, & ! In
clubb_config_flags%iiPDF_type, & ! In
clubb_config_flags%l_use_precip_frac, & ! In
Expand All @@ -1144,6 +1142,7 @@ subroutine subcol_gen_SILHS(state, tend, state_sc, tend_sc, pbuf)
clubb_config_flags%l_calc_w_corr, & ! In
clubb_config_flags%l_const_Nc_in_cloud, & ! In
clubb_config_flags%l_fix_w_chi_eta_correlations, & ! In
stats_metadata, & ! In
stats_zt, stats_zm, stats_sfc, & ! In
hydrometp2, & ! Inout
mu_x_1, mu_x_2, & ! Out
Expand Down Expand Up @@ -1231,7 +1230,8 @@ subroutine subcol_gen_SILHS(state, tend, state_sc, tend_sc, pbuf)
clubb_config_flags%l_tke_aniso, & ! In
clubb_config_flags%l_standard_term_ta, & ! In
vert_decorr_coef, & ! In
stats_lh_zt, stats_lh_sfc, & ! intent(inout)
stats_metadata, & ! In
stats_lh_zt, stats_lh_sfc, & ! InOut
X_nl_all_levs, X_mixt_comp_all_levs, & ! Out
lh_sample_point_weights) ! Out

Expand Down Expand Up @@ -4125,12 +4125,12 @@ end subroutine subcol_SILHS_hydromet_conc_tend_lim
! small function to get an unused stream identifier to send to setup_corr_varnce_array_api
! or any other silhs/clubb functions that require a unit number argument
! This comes directly from the Fortran wiki
integer function getnewunit(unit)
integer function newunit(unit)
integer, intent(out), optional :: unit

integer, parameter :: LUN_MIN=10, LUN_MAX=1000
logical :: opened
integer :: lun, newunit
integer :: lun

newunit=-1
do lun=LUN_MIN,LUN_MAX
Expand All @@ -4141,6 +4141,6 @@ integer function getnewunit(unit)
end if
end do
if (present(unit)) unit=newunit
end function getnewunit
end function newunit

end module subcol_SILHS

0 comments on commit f0f446d

Please sign in to comment.