There were furhter issues found with the k_lh_start code.
The code would find that sometimes, the maximum location of rcm in cloud would occur at the ghost level, k = 1, and set that level as k_lh_start for SILHS. This is undesirable for two reasons: 1) k_lh_start should be set around a legimate, "within domain" grid level; and 2) Setting k_lh_start to 1 is unachievable for the ghostless branch of the model, making a match between the master and clubb_ghost_exorcism branhes unattainable.
The issue is corrected here by allowing the maxloc function to only search over "in-domain levels" for maximum cloud. The results are BIT_CHANGING.
Ri_zm calc (Part 3) - Moving calculations for Ri_zm out of diagnose_Lscale_from_taus (#1157)
CLUBB tocket #1145 BIT_CHANGING for lscale since Ri_zm was not calculated before.
1. mixing_length.F90: - Removed unused input variables from diagnose_Lscale_from_taus: um, vm, exner, p_in_Pa, rtm, thlm, thvm, rcm, saturation_formula, l_brunt_vaisala_freq_moist, l_use_thvm_in_bv_freq, l_modify_limiters_for_cnvg_test; added ddzt_umvm_sqd as input; changed Ri_zm from out to in - Removed unused brunt_vaisala_freq_sqd variables from diagnose_Lscale_from_tau - Removed calculations for Ri_zm and ddzt_umvm_sqd - Fixed some line length issues
2. advance_helper_module.F90 - Removed unused input variables and imports - Fixed some line length issues
3. advance_clubb_core_module.F90 - Added calculations for ddzt_umvm_sqd and Ri_zm - Adjusted subroutine calls - Fixed some line length issues
In my previous commit, I changed the domain of the maxloc commands in the computation of k_lh_start to check over the arrays from levels 2:nz. However, when that happens, the output will be offset by 1. Consider a situation where the rcm max is at level 2. By being passed 2 through nz only, maxloc will return a value of 1. I needed to add +1 to the output to rectify this issue. The results are BIT_CHANGING.
This commit brings the stats output from the all cases run with the master branch (using the default configuration) in bit-for-bit agreement with the stats output from all cases run with the clubb_ghost_exorcism branch. Of course, this agreement ignores the ghost level output in the zt files run with the master branch. This commit is technically BIT_CHANGING because it alters a few stats for a couple cases, but does not change results.