For clubb:ticket:792, I added a new stats output, `rcm_supersat_adj`, to record the degree of rcm adjustment. It is not output by default. This changeset does not change output. (details)
For clubb:ticket:788, I added a threadprivate entry for `iwp3_pr3`, which will hopefully resolve the failure of the OpenMP test (build:16010). (details)
I added some parameter value checking in subroutine setup_parameters. (details)
I finally have a standalone version of the new subroutine, generate_pdf_params, (details)
Some code within advance_clubb_core that is found within CAM_CLUBB preprocessor (details)
The perturbation Lscale code requires rtm_frz, thlm_frz, and pdf_params_frz to (details)
I added a missing intent(out) statement. (details)
I have interfaced the new subroutine containing all of the PDF closure-related (details)
I got rid of some variables that were brought into advance_clubb_core by use statements (details)
I cleaned up more compiler warnings for unused variables. The warnings came from g95. (details)
I have added a second call to subroutine generate_pdf_params. This one occurs (details)
I moved the setting of qclvar and thlprcp_out to after the second call to (details)
I have declared the l_use_ice_latent option and the l_call_pdf_closure_twice (details)
I added a local cslculation of sigma_sqd_w near the top of subroutine (details)
I am changing the inputs and outputs of subroutine advance_clubb_core so that (details)
I added code so that stats that are internal to subroutine generate_pdf_params (details)
I have updated subroutine advance_clubb_core so that pdf_params_zm is now passed (details)
Ticket #799 -- Moved iiPDF_... module variables from module corr_varnce_module to module array_index -- The results of the priority cases are bin-diff identical (details)
Ticket #798 -- Renamed d_variables to pdf_dim -- The results of the priority cases are bin-diff identical (details)
I updated the call to the new PDF so that Skrt and Skthl are intent INOUT (details)
Removed many eqaulity comparison warnings in precipitation_fraction.F90 clubb:ticket:803 (details)
I am adding a new function, calc_wpxpyp_pdf, to pdf_closure_module.F90. This (details)
I finished adding the units to the variable descriptions in (details)
The calculation of higher-order scalar terms <w'^2^ sclr'>, <w'sclr'^2^>, (details)
I added the tunable or adjustable parameters for the new PDF to CLUBB's list (details)
Fixed various warnings. Mainly by removing unused variables and commenting out unused procedures. See clubb:ticket:803 (details)
I am committing a line of code that limits the adjusted correlation of rt and (details)
I implemented a new method to handle cumulus momentum fluxes. (details)
Switched from using the erf function defined by anl_erf to the intristic erf function. This should be BIT_CHANGING see clubb:ticket:804 (details)
Removed file anl_erf.F90, it is no longer used (details)
I am altering the solution to the wp3 predictive equation to calculate the (details)
I fixed the problem with the wp3 budgets as a result of r8584. The budgets in (details)
I altered the names of the turbulent advection functions that are closed by (details)
I added a couple comments about how the discretization of the turbulent (details)
I added the function that sets up the implicit calculation of the wp3 turbulent (details)
I added a function that calculates the explicit form of the wp3 turbulent (details)
I am adding a function to calculate the turbulent advection of wpxp explicitly. (details)
I am adding a function to calculate the turbulent advection of xp2 and xpyp (details)
I interfaced the wp3 explicit turbulent advection code with CLUBB. It is (details)
I am interfacing the wpxp explicit turbulent advection option with the rest of (details)
I fixed a small bug with the explicit turbulent advection option for wpxp. (details)
I am interfacing the xp2/xpyp explicit turbulent advection term with CLUBB code. (details)
I added the l_explicit_turbulent_adv_* family of flags to the new PDF, for some (details)
I am packing up the implicit coefficients and explicit terms calculated by the (details)
Made epss variable based on its use by adding flag l_high_accuracy_parab_cyl_fnc. Low accuracy for runs (epss=1e-4) and high accuracy for tests (epss=1e-15), see clubb:ticket:804 (details)
I made a slight change to function calc_coef_wpxp2_implicit in new_pdf.F90. (details)
I have completed interfacing the implicit form of the wp3 turbulent advection (details)
When the l_explicit_turbulent_adv_wp3 flag is enabled, the turbulent advection (details)
I cleaned up the Skx_module and added an additional function, (details)
I fixed a bug in the calculation of scalar skewness. It was being set to 0, (details)
I moved the location of the LG 2005 ansatz to calculate xp3 because it would be (details)
I reverted clubb:r8611 because (1) having the code in the other location (details)
I have added a new function, term_ta_new_pdf_lhs, to (details)
I have linked the implicit turbulent advection code for rtp2 and thlp2 to the (details)
I have added a new file that has two options for handling the xp3 term for (details)
I have interface the new xp3 code to the rest of CLUBB. It can be turned on (details)
I added a driver level subroutine for the new advance xp3 code. This will make (details)
I added budget stats for rtp3 and thlp3 to CLUBB. (details)
I am adding code that allows the turbulent advection of wpxp to be treated (details)
Redesigned error code system. Errors are now treated as strictly fatal, meaning they are only thrown by procedures which cannot continue or has detected something that will crash the code. When the error occurs the procedure which detected it should immediately report it and either return to its calling procedure or stop the program, this is to avoid a cascade of error reports due to a single error. Other problems are now reported at level 1 and 2 debugging and only write the error out rather than set a code. (details)
Various small comment removals and returned some functionality to api interface clubb:ticket:800 (details)
A variable found to be less than zero now only gives a warning rather than setting an error code. Some fatal error checks also changed from debug level 2 to 0 clubb:ticket:800 (details)
This is the first part of a two-part change. I am updating plotgen plots so (details)
In part 2 of this two part commit, I have added rc_coef to the list of (details)
Various debug checks added/improved. Negative value checks changed back to throw fatal errors. Parameterization check changes to disclude thermodynamic variables at grid level 1 clubb:ticket:800 (details)
Check negative no longer assumes array sizes are gr%nz, this should fix the SAM-CLUBB-SILHS error in the nightly tests clubb:ticket:800 (details)
I'm pretty sure this will fix the check negative issues this time, fortran has some lacking features when it comes to arrays clubb:ticket:800 (details)
Changed calls to parameterization check to work with the new check negative implementation clubb:ticket:800 (details)
Removed rtm(5) = -1 line, it was a test accidentally left in and caused many nightly tests to fail clubb:ticket:800 (details)
Changed error checking if statements to check for equality to clubb_fatal_error rather than inequality to clubb_no_error, makes them more readable clubb:ticket:800 (details)
Fixed unused variable warnings related to error code changes (details)
I am generalizing the wprcp, wp2rcp, rtprcp, and thlprcp equations to account (details)
Added error header functionality. Using the err_header character array from error_code in a write statment will print out either the thread number or process ID along with CLUBB -- ERROR: . This is mainly to keep track of error messages is multithreaded scenarios clubb:ticket:800 (details)
In r8659, I accidentally overwrote some code. This commit restores the prior (details)
Removed failure_test cases from input/case_setups, they neither work properly nor are needed anymore. Added test_fatal_error_handling.bash script which tests for various errors defined by an identifier in the code, more description available in the bash file. Also added more descriptive error output to some parts of code. This change focuses only on output and comments and is BIT IDENTICAL clubb:ticket:800 (details)
Removed reference to run_type 'failure_test' as it no longer exists. Added more description to fatal errors produced by calls to xm_wpxp_solve. This change is BIT IDENTICAL clubb:ticket:800 (details)
I am fixing a bug with the CLUBB tuner. Variables that were allocated at the (details)
Completed the list of variables that get reported from errors within advance_wp2_wp3 and advance_xm_wpxp. Also added a check that outputs an error message when T_in_K is less than 200K in the lowest 10 grid levels, this check is done in subroutine parameterization_check. clubb:ticket:800 (details)
Made all debug levels produce the same output, see clubb:ticket:823 (details)
I am moving type variable implicit_coefs_terms from new_pdf_main.F90 to (details)
Modified many aspects of the tuner, mostly within esa_driver. Also added check to ensure that C7 and C11 have valid values before the run is tried, this should stop the fire tuning nightly test from crashing. See clubb:ticket:802 (details)
Added checks in subroutine setup_parameters() to ensure that C7b and C11b are within [0:1] see clubb:ticket:802 (details)
This should fix the thlm out of bounds error on clubb:ticket:828 (details)
I changed the name of type variable new_pdf_implct_coefs_terms to (details)
Changed T_in_K check within subroutine parameterization_check to instead check thlm, see clubb:ticket:800 and clubb:ticket:828 (details)
I added a flag option to clip the (large, negative) effects of microphysics on (details)
I added a flag option to calculate the minimum threshold for xp2 (rtp2 and (details)
I added a special max magnitude correlation for fluxes wprtp and wpthlp. This (details)
Made better esa_driver, made tuner_test to test the driver, added variable range checks. Tried to make the tuner in better in general, but that whole bunch of code needs nothing short of replacement. This commit is bit identical execpt for tuning results, see clubb:ticket:802 for a bunch more information (details)
This commit sets C8b=0.02, changes the non-linear damping on wp3 (details)
Added a flag and moved Skw_max_mag from constants to parameters, this allows the changes made in commit clubb:r8719 to be reverted by modifying the configuration flags and the tunable parameters list, see clubb:ticket:829 (details)
I am adding a general purpose function for the turbulent advection of CLUBB's (details)
I added/changed a couple comments for the rhs portion of the generalized (details)
The turbulent advection file that handles turbulent advection for predictive (details)
I added a function to turbulent_adv_pdf.F90, called sgn_turbulent_velocity, that (details)
Whoops, I forgot to make wpxpyp_zm and xpyp intent (in). (details)
Added functionality to make the hydrometeor variances depend on the horizontal grid spacing, see clubb:ticket:830 (details)
I am updating the code that advances predictive variances and covariances in (details)
Renamed init_pdf_hydromet_arrays to init_pdf_hydromet_arrays_api since it is meant to be used by host models, clubb:ticket:830 (details)
I am updating the code that advances predictive scalar fluxes (<w'x'>) in (details)
As a first step toward having code that can clip mean values of hydrometeor (details)
init_pdf_hydromet_arrays_api now sets the value of hydromet_dim as well, this should fix the wrf tests, but doesn't seem to fix cam. clubb:ticket:830 other:ticket:562 (details)
I have now interfaced the subroutine that I made out of the code that clips (details)
I added new code that clips the overall correlation of w and rt or the overall (details)
I added stats for term_wprtp2_explicit and term_wpthlp2_explicit, which are (details)
Made clubb_fatal_error public so host model code can detect fatal errors. clubb:ticket:800 (details)
Reverted advance_windm_edsclrm_module.F90, accidentally committed test code, clubb:ticket:800 (details)
I have added code to allow C2 to be adjusted by multiplying by the greater of (details)
I moved the location of the declaration and setting of new model flags to (details)
Improved computational speed of windm_edsclrm_rhs and added subroutine. This commit should be BIT_CHANGING as it does calculations in different orders. Only the most sensitive cases have any noticable plot differences. See clubb:ticket:834 (details)
Fixed nightly uninitialized variables test. Renamed diffusion_zt_lhs_inner to diffusion_zt_lhs_all, it is now also capable of calculating all values including boundaries now, it's beneficial to calculate the upper boundary value in this case and I imagine other may need the lower boundary calculated as well. Cleaned up windm_edsclrm_rhs A LOT, it's more readable and has clearly ordered steps now. clubb:ticket:834 (details)
Actually fixed nightly tests now (hopefully). A loop variable was being used outside a loop, which is an error that passes all the compiler tests. Also the intel compiler config file does not cause errors running if a index variable has not been initialized either, which resulted in correct seeming plots, timing, and output. I'm going to have to be stricter with the testing during these changes as loop variables and such will be often modified, I'll be sure to do a run after compiling with each compiler on top of confirming the output and running the uninitialized variable test manually. Because the last commit fixed the 2nd value of the rhs array the change will be BIT_CHANGING, but the plot output is identical for all but the most sensitive cases. clubb:ticket:834 (details)
Optimized the array setup procedures within advance_xp2_xpyp. Added more functions which handle entire arrays at a time rather than single terms to calculate the turbulence, mean advection, and diffusion terms. Because these changes reordered some calculations the results are BIT_CHANGING, but the plots are the same for all but the most sensitive cases. clubb:ticket:834 (details)
This should fix the nightly budget test. We may want to look into reducing the redone calculations for the stats code in the future, this lhs/rhs improving endeavour is definitely helping with that but more could be done. clubb:ticket:834 clubb:ticket:837 (details)
Impoved the computational efficiency of xm_wpxp_rhs and xm_wpxp_lhs, see clubb:ticket:834 (details)
This commit implements the effects of splatting on wp3. (details)
I am making the first step toward committing code that allows for the option (details)
I added code to allow the option of predicting upwp and vpwp by using the (details)
I took the liberty of upgrading CLUBB's PDF closure and related code to a vector (details)
I updated the monotonic flux limiter to account for vector variables u and v. (details)
I am adding two new budget stats, um_mfl and vm_mfl, to CLUBB's zt stats output. (details)
In r8775, I forgot to add the new um_mfl and vm_mfl stats to the monotonic flux (details)
I am turning on the l_predict_upwp_vpwp code! (details)
Improved the computational efficiency of the LHS and RHS setup procedures in advance_wp2_wp3_module. This involved changing the order of calculations which casues this commit to be BIT_CHANGING for only the most sensitive cases. See clubb:ticket:834 (details)
Improved computational efficiency of windm_edsclr_lhs. See clubb:ticket:834 (details)
Changed the name of _turb to _ta, and _advm to _ma to keep with the current naming conventions. Also fixed line length warnings. clubb:ticket:834 (details)
Added grid_class to the dependency lists of the pdf files that were changed in commit 8773 (details)
I am changing the default setting of flags l_min_wp2_from_corr_wx and (details)
Modified compute_Cx_fnc_Richardson. Made it a subroutine, modified the algorithm slightly, removed use of allocates and deallocates from it, removed verical_avg call to avoid redoing calculations and precalculated some divides. This saved clubb_core about 8% runtime overall. see clubb:issues:834 (details)
Removed print line. Also this commit is BIT_CHANGING since it reorders some calculations, but the difference only affects the most sensitive cases. (details)
Changed the way that init_pdf_params zeros out values as well as a spot in pdf_closure which does the same type of thing. Also changed the debug level for pdf_closure_check to 2. This all saved about 3% overall. see clubb issue 834 (details)
I am adding source code for the introduction of budgets for predictive upwp (details)
Improved computational speed of compute mixing length by modiying the algorithm slightly, avoiding unnecessary divides, and precalculating values. This saves about 6.5% overall. #834 (details)
Improved computational efficiency of band_solve by reworking the way that the lulhs matrix is set up. #834 (details)
Modified flatau equation which calculates saturation vapor pressure. This was done by modifying the form of the polynomial to allow the cpu to take advantage of out-of-order computations. The new coefficients were obtainted from matlab by finding the roots and multiplying/adding them where I needed to removed the complex numbers. The differences in any values are negligible, and the plots are only affected in the most sensitive cases, but this is BIT_CHANGING. #834 (details)
Copied code from linear_interp_factor to linear_interpolated_azt/_azm. This allows those sections of code to become vectorized. Also reversed the calculation order of linear_interpolated_azt allowing for contiguous memory access. This saves about 3% overall and there are no visible differences in the plots when compared to last commit. #834 (details)
Changed vertical_avg and vertical_intergral to use dz rather than the inverse, they were dividing by an inverse and divisions are expensive. Also modified vertical_avg algorithm to no longer use vertical_integral, this saves some calculations. #834 (details)
Improved efficiency of clip_covar. The only change is saving the result of max_mag_corr * sqrt( xp2(k) * yp2(k) ) rather than calculating it three times. #834 (details)
I made the surface splatting terms conservative. That is, I subtracted from wp2_sfc (details)
I added clipping on up2 and vp2 that prevents these fields from exceeding 1000 m^2/s^2. (details)
This commit turns on splatting of thermals (i.e., C_wp2_splat is nonzero). Hence it is BIT_CHANGING. (details)
Added functionality to allow cloud_frac to be better estimated at extreme values which produce either 0 or 1 when computed. The amount of estimation is controlled by the variable max_num_stdevs, indicating the number of standard deviations away from the mean of a pdf a value can be before being considered statistically insignificant. This speeds up the code but reducing the calculations required in calc_cloud_frac_component and calc_xprcp_component, and avoiding underflow errors when computing exponentials with too small of a number. By comparing plots and mathematical evaluation (erf(5)~=0), it seems the best value for max_num_stdevs is 5. This increases computational efficiency by about 10% #834 (details)
I clipped sigma_sqd_w to prevent interpolated values of it (details)
I added a new option to diagnose the dissipation time scale, tau, first (details)
I found a new way to diagnose upthvp. Instead of using a bound on correlations, it relies (details)
introducing error into clubb core for testing larson-group/sys_admin#533 (details)
reverting error that was introduced larson-group/sys_admin#533 (details)
I am briefly changing some of the flag and parameter settings in CLUBB (details)
Revert "I am briefly changing some of the flag and parameter settings in CLUBB" (details)
I added a couple of comments reminding users to change the conditions in (details)
Revert "Revert "I am briefly changing some of the flag and parameter settings in CLUBB"" (details)
Revert "Revert "Revert "I am briefly changing some of the flag and parameter settings in CLUBB""" (details)
I committed a subroutine, diagnose_upxp, that calculates (details)
Improved the computational efficiency of pdf_closure. This speed the code up by about 6% overall. Because it changed the order of some calculations it is BIT_CHANGING but does not change plots. clubb issue #834 (details)
I am modifying one part of setup_clubb_pdf_params.F90 to be taken out of a large (details)
I am updating the code within setup_clubb_pdf_parameters.F90 in order to take (details)
To diagnose uprcp using CLUBB's PDF machinery, (details)
Continuing with diagnosis of uprcp using CLUBB's PDF, (details)
More code to diagnose uprcp using CLUBB's PDF. (details)
Correction for the last uprcp-related commit: (details)
I am correcting the code so that the Nightly Uninitialized Variables Test (details)
I am continuing to pull parts of setup_pdf_parameters outside of a large "do" (details)
I am pulling statistical output subroutine pdf_param_ln_hm_stats outside (details)
Changing the range of the correlation values determined in calc_comp_corrs_binormal from [ -1.0, 1.0 ] to [ -0.99, 0.99 ] (based on value of max_mag_correlation = .99). This is the subroutine that calculates corr_rt_thl_x and should fix the issue with the WRF WPS Katrina bitten test as discussed in the commets of commit ad0ee5b9b3c253329df1208560b46d1dc4fca1c2. I suspect that it will fix the WRF-CLUBB-SILHS Restart Test as well, but I am basing that mostly off hope. (details)
commenting out threadprivate command to test openmp bitten test larson-group/sys_admin#566 (details)
I have changed the structure of setup_pdf_parameters so that the subroutine that (details)
Returned max check to the calculation of rcm. This should fix the PGI Compiler Nightly Test and could be BIT_CHANGING. (details)
I am turning on the new calculation of uprcp that uses CLUBB's PDF. (details)
I modified the code in setup_clubb_pdf_params.F90 to use only one call to (details)
I am updating CLUBB_core and SILHS in the clubb_E3SM_silhs branch to (details)
I am setting model flags and tunable parameters in the clubb_E3SM_silhs branch (details)
I temporarily set l_clip_extreme_chi_sample_pts back to false in the (details)
Revert "I temporarily set l_clip_extreme_chi_sample_pts back to false in the" (details)
I improved the error messages when LU decomp. fails within (details)
Improved error message prints in advance_xm_wpxp. (details)
I added improved LHS and RHS print statements when a LU decomp. error occurs (details)
I added params_list to the list of variables that are accessible through (details)
I am making the first step for updating the code that calculates sigma_sqd_w. (details)
I added a log-law height dependence to the code that diagnoses (details)
I added fill_holes_hydromet_api to clubb_api_module.F90. (details)
I added a new python script, check_for_missing_threadprivate.py, (details)
Modifying clubb's pdf_parameter type. It's now a type containing arrays, whereas before it was a type containing scalars, but used everywhere as an array of these types. This new way allows the elements of pdf_parameter to exist in contiguous memory sections, which improves computational efficiency when accessing a given parameter over all vertical levels. clubb issue #834 (details)
Fixed dycoms restart run failure. The pdf_parameter variables are accessed via a use statement in the section of code where the restart run attempts to set their values, but since they are allocatable they do not retain their allocated status once out of scope. Adding the save attribute to pdf_params and pdf_params_zm fixes the problem. These pdf_parameter variables used in clubb standalone are not used by host models, yet they are still allocated during host model runs, something that has been noted before and will be changed. clubb issue #834 (details)
Adding conditional statement around compute_Cx_Fnc_Richardson, see clubb issue #855. This change is bit identical. (details)
Optimizing procedures within Skx_module. The reduction in runtime is greatly dependent on system and compiler option. See clubb issue #855 and comment by Gunther on 7-1-19 for explanation. This is BIT_CHANGING but the plots only differ in the sensitive cases. (details)
ticket #842 we added 4 tunable parameters for tau, they are Coefficient of inverse tau term contributed by background constant value, Coefficient of inverse tau term contributed by surface log law, Coefficient of inverse tau term contributed by vertical wind shear and Coefficient of inverse tau term contributed by Brunt Vaisala frequency (details)
Modifying ADG1_ADG2_responder_params for efficiency reasons. It changes the way varnce_x_(1/2) is set when wp2 > w_tol_sqd and xp2 <= x_tol. Previously in that case it set the variances to 0, but now it sets them to xp2 since xp2 ~= 0 in that case anyway. This allows the where statement to have only two cases, and less cases is more efficient. This is BIT_CHANGING, but only affect the sensitive cases and passes the G unit tests. larson-group/clubb#855 (details)
Replacing the local variables used in pdf_closure_module with references to the variables in pdf_params which they are meant to be stored in. This removes the need to copy the local variables into the pdf_params structure at the end, saving about 3% runtime. This is not bit changing, but does make the code a little uglier. larson-group/clubb#855 (details)
Making procedure calls consistent with procedure definitions. Required updating after previous pdf_parameter related commit. larson-group/clubb#855 (details)
I have added a new file, calc_pressure.F90, which contains code for initializing (details)
I updated CLUBB so that pressure is updated after mean fields have been (details)
Removing gmres code. The files gmres_wrap.F90, gmres_cache.F90, and csr_matrix_module.F90 have been removed, and any sections of code which refer to or are needed only for gmres have been removed as well. larson-group/clubb#855 (details)
Forgot to run previous commit with --all, so the gmres files were not removed. larson-group/clubb#855 (details)
We added two new tunuable parameters: C_invrs_tau_N2_xp2 and C_invrs_tau_N2_wp2. e.g. invrs_tau_wp2_zm = invrs_tau_zm_simp + C_invrs_tau_N2_wp2 * sqrt( max( zero_threshold,zt2zm( zm2zt( brunt_vaisala_freq_sqd ) ) - 1e-4_core_rknd) ). Correspondingly, invrs_tau_wp2_zm and invrs_tau_xp2_zm are used in advance_wp2_wp3 and advance_xp2_xpyp respectively. (details)
We added two new tunuable parameters: C_invrs_tau_N2_xp2 and C_invrs_tau_N2_wp2. e.g. invrs_tau_wp2_zm = invrs_tau_zm_simp + C_invrs_tau_N2_wp2 * sqrt( max( zero_threshold,zt2zm( zm2zt( brunt_vaisala_freq_sqd ) ) - 1e-4_core_rknd) ). Correspondingly, invrs_tau_wp2_zm and invrs_tau_xp2_zm are used in advance_wp2_wp3 and advance_xp2_xpyp respectively. (details)
We added two new tunuable parameters: C_invrs_tau_N2_xp2 and C_invrs_tau_N2_wp2. e.g. invrs_tau_wp2_zm = invrs_tau_zm_simp + C_invrs_tau_N2_wp2 * sqrt( max( zero_threshold,zt2zm( zm2zt( brunt_vaisala_freq_sqd ) ) - 1e-4_core_rknd) ). Correspondingly, invrs_tau_wp2_zm and invrs_tau_xp2_zm are used in advance_wp2_wp3 and advance_xp2_xpyp respectively. (details)
We added two new tunuable parameters: C_invrs_tau_N2_xp2 and C_invrs_tau_N2_wp2. e.g. invrs_tau_wp2_zm = invrs_tau_zm_simp + C_invrs_tau_N2_wp2 * sqrt( max( zero_threshold,zt2zm( zm2zt( brunt_vaisala_freq_sqd ) ) - 1e-4_core_rknd) ). Correspondingly, invrs_tau_wp2_zm and invrs_tau_xp2_zm are used in advance_wp2_wp3 and advance_xp2_xpyp respectively. 1. Some typos are corrected. 2. New tunuable parameters are added in files named errer_$casename.in (issue #842) (details)
We added two new tunuable parameters: C_invrs_tau_N2_xp2 and C_invrs_tau_N2_wp2. e.g. invrs_tau_wp2_zm = invrs_tau_zm_simp + C_invrs_tau_N2_wp2 * sqrt( max( zero_threshold,zt2zm( zm2zt( brunt_vaisala_freq_sqd ) ) - 1e-4_core_rknd) ). Correspondingly, invrs_tau_wp2_zm and invrs_tau_xp2_zm are used in advance_wp2_wp3 and advance_xp2_xpyp respectively. 1. Some typos are corrected. 2. New tunuable parameters are added in files named errer_$casename.in (issue #842) (details)
We added two new tunuable parameters: C_invrs_tau_N2_xp2 and C_invrs_tau_N2_wp2. e.g. invrs_tau_wp2_zm = invrs_tau_zm_simp + C_invrs_tau_N2_wp2 * sqrt( max( zero_threshold,zt2zm( zm2zt( brunt_vaisala_freq_sqd ) ) - 1e-4_core_rknd) ). Correspondingly, invrs_tau_wp2_zm and invrs_tau_xp2_zm are used in advance_wp2_wp3 and advance_xp2_xpyp respectively. 1. Some typos are corrected. 2. New tunuable parameters are added in files named errer_$casename.in (issue #842) (details)
We put Lscale's calculation into mixing_length.F90 (subroutine calc_Lscale_directly) (details)
We put Lscale's calculation into mixing_length.F90 (subroutine calc_Lscale_directly) (details)
Efficiency improvements to calc_turb_adv_range, more specifically the parts which split w into upward and downward components. This adds a case to zero out upward and downward components for values of w that are too small to matter, and now utilizes mkl_vml math functions to improve vectorization. These mkl_vml functions are only used when compiled with MKL, specified by adding -DMKL to compiler configuration files. This is BIT_CHANGING, plots only differ in the usual sensitive cases, and the budgets, G_unit_tests and time step tests all pass. larson-group/clubb#855 (details)
This should fix the uninitialized variables test. mean_vert_vel_up_down was using the upper and lower grid levels, but calc_mean_w_up_down_component was not setting them. These levels aren't actually used by the algorithm in calc_turb_adv_range, but I made calc_mean_w_up_down_component set them to zero anyway since it seems like the simplest and safest solution. larson-group/clubb#855 (details)
An additional damping is added to the invrs_tau term in the C8 equation. ticket #842 (details)
An additional damping is added to the invrs_tau term in the C8 equation. ticket #842 (details)
Adding comment because commit 561fa037e7c3c326bc4bd71b6fc486e5d2a46065 was BIT_CHANGING, but missing the commit message specifying that. It was bit changing because the upper and lower levels of mean_w_up and mean_w_down are being output to stats as of commit 0b3ec0d5fc4b89b4a6f34964af3cfda8cb89b9f7, so changing the upper and lower level values changed the stats output, even though those values are not used in any calculations. (details)
We use zt2zm(ice_supersat_frac) replace ice_supersat_frac_zm in the additional damping of C8. (details)
We use zt2zm(ice_supersat_frac) replace ice_supersat_frac_zm in the additional damping of C8. (details)
Changing ADG1_ADG2_responder_params to use a do loop with ifs instead of a where statement. This is about 1.5% faster and is bit identical. larson-group/clubb#855 (details)
Pulling the calculation of p_in_Pa(_zm) out of the vertical loop in update_pressure, and precalculates one/kappa. This improved vectorization capabilities of the calculation of exponents, which is slow so that's important. Also added the option to use MKL_VML functions if -DMKL is specified, which is slightly more efficient. This saves about 1.5-2.5% and is bit identical if not using MKL. larson-group/clubb#855 (details)
Renaming width_factor to width_factor_1 to indicate that it is intended for use with the first pdf component, (two-width_factor_1) is the value for the second component. larson-group/clubb#855 (details)
Efficiency improvements to transform_pdf_chi_eta_component. Moving the where statement to if statement inside loop to avoid sqrt operations. Reducing number of divide operations, and putting some code in a loop which reduces cache misses. This is BIT_CHANGING, but not answer changing, plots only differ slightly in the most sensitive cases. larson-group/clubb#855. (details)
Modifying calc_cloud_frac_component to optionally use mkl_vml functions. Added a different version of the procedure to handle the liquid cloud fraction specifically, so the ice_supersat_frac could remain as is. The structure of the procedure when using the MKL functions is based on the changes to calc_turb_adv_range in commit 0b3ec0d5fc4b89b4a6f34964af3cfda8cb89b9f7, since I've already tested that well and it seems to make sense to keep the code similar if it does similar things. This reduces runtime by about 2% when using MKL functions and about 0.5% otherwise. The procedures also use precalculated inverses where possible, so the results are BIT_CHANGING, but not answer changing. larson-group/clubb#855 (details)
Refactoring the lhs and rhs setup procedures for xm_wpxp. There are a number of lhs terms that are very general, and used by all the lhs matricies. The code now calculates these terms in a new procedure calc_xm_wpxp_lhs_terms and passes those terms into the lhs setup. The same sort of thing is done with the first pressure terms and turbulent advection terms, those terms are shared between pairs of lhs/rhs calls. This is BIT_CHANGING, but is not answer changing. See comment on Jul 3 on ticket larson-group/clubb#855 (details)
I switched on direct diagnosis of tau rather than Lscale. (details)
I switched on direct diagnosis of tau rather than Lscale. (details)
I switched on direct diagnosis of tau rather than Lscale. (details)
I updated the pressure initialization for cases that use sounding that is given (details)
I changed the function calculate_thvm from a pre-defined vector of size nz to (details)
I updated the calculation of thvm in advance_clubb_core to use the (details)
Adding SAVE attribute to some stats variables, as it was causing compiler errors when using the newest version of the gfortran compiler. Also commenting out Lapack library dependency from gfortran config file, this required additional Lapack source files be added. Now, no Lapack library files are required to compile CLUBB, whereas before, the source was being compiled, but the missing dependencies we're being added from libraries. This is BIT_CHANGING in all cases when using the gfortran compiler, but only in some cases when using the ifort compiler. Some plots, such as rico, are noticably different when compiled with gfortran, but are bit identical when compiled with ifort. The intel implementation of Lapack used by the ifort compiler must be more similar to the source Lapack than was the Lapack library that was being used for the gfortran compiler. (details)
Adding a subroutine in advance_xp2_xpyp to calculate the turbulent advection terms and modying the rhs and lhs setup procedures to accept these turbulent advection terms as inputs. Before, the turbulent advection terms were calcualted within the rhs and lhs setup procedures, but this resulted in expensive redundant calculations. larson-group/clubb#855 (details)
Changing where statement that was causing floating point errors to a do with if's. This should allow code compiled with the newest version of gfortran to run to completion for microphysics enabled cases. This is BIT_CHANING in microphysics cases, but the values of the output arrays of the only changed subroutine only differ starting around roughly the 13th decimal place. larson-group/clubb#859 larson-group/sys_admin#626 (details)
I am committing a test where I changed subroutine ADG1_w_closure (details)
Changing determination of threshold used to clip large values of rtp2. Before it was possible that this large value clipping introduced a value before tolerance, if rtm was too small. Causing addition problems and potentially crashes. This is BIT_CHANGING. larson-group/clubb#862 (details)
Finally fixing line length error in pdf_closure (details)
Adding more Lapack source files, and a new file to interface with Lapack routines in general. This allows us to call a general interface procedure that can handle single or double precision routines. This should fix the ifort bug we've been seeing, and should be a more robust way to handle this double/single precision situation in general. Works with all compilers, and in single or double precision, producing bit identical results. See larson-group/clubb#861 (details)
Adding blunt clipping to below ground level of xm variables, keeping their value at least tolerance. This prevents the crashing of mc3e caused by rtm being < 0. This is BIT_CHANGING, but only for mc3e, and the plots are very similar. Which must mean that mc3e is our only case where rtm becomes too small. larson-group/clubb#862 (details)
This commit is BIT_CHANGING. It is mainly because 1) We changed the equation of tau_xp2_zm, producing a better agreement with LES. 2) Many parameters have been retuned. We reduce nu2 and c_k2, because they bring us stronger scalar variances,especially for RFO1. We set C1=1, because it helps to reduce wp2 near cloud top. We also set C6=2 to generate stronger fluxes etc. (details)
This commit is BIT_CHANGING. It is mainly because 1) We changed the equation of tau_xp2_zm, producing a better agreement with LES. 2) Many parameters have been retuned. We reduce nu2 and c_k2, because they bring us stronger scalar variances,especially for RFO1. We set C1=1, because it helps to reduce wp2 near cloud top. We also set C6=2 to generate stronger fluxes etc. (details)
This commit is BIT_CHANGING. It is mainly because 1) We changed the equation of tau_xp2_zm, producing a better agreement with LES. 2) Many parameters have been retuned. We reduce nu2 and c_k2, because they bring us stronger scalar variances,especially for RFO1. We set C1=1, because it helps to reduce wp2 near cloud top. We also set C6=2 to generate stronger fluxes etc. (details)
Adding C_invrs_tau_N2_wpxp to the initmax namelist. This should fix the fire tuning crashes. larson-group/sys_admin#626 (details)
I am adding a file for the new hybrid PDF, which combines the w equation set (details)
I updated the function to calculate the implicit coefficient for the wp4 term, (details)
I made some changes to new_hybrid_pdf.F90 so that it would compile in its (details)
I edited that subroutine that calculates the implicit coefficient and explicit (details)
I updated the subroutine that calculates the implicit coefficient and explicit (details)
Replaced rrm_cond with rrm_evap and Nrm_cond with Nrm_evap because they described the same quantity. This is BIT_CHANGING just because the output now contains the N/rrm_evap instead of N/rrm_cond variable name. No changes were made to the values themselves. (details)
Replaced rrm_cond with rrm_evap and Nrm_cond with Nrm_evap because they described the same quantity. This is BIT_CHANGING just because the output now contains the N/rrm_evap instead of N/rrm_cond variable name. No changes were made to the values themselves. (details)
I am adding a new file, new_hybrid_pdf_main.F90, as a driver file for the new (details)
I worked more the functions for the new hybrid PDF. (details)
Refactoring advance_xp2_xpyp to have the capability to perform only one combined solve when the lhs matricies are equivalent. larson-group/clubb#855 (details)
I changed all the PDF utility functions in pdf_utilities.F90 to elemental (details)
I forgot a "then" to go with an "elseif". (details)
Adding intent(in) attribute to rhs_ta terms and making scalar forcings local variables, since that is what they were supposed to be. larson-group/clubb#855 (details)
Adding case to and modifying xp2_xpyp_solve to remove the need for xp2_xpyp_solve_multiple. larson-group/clubb#855 (details)
Refactoring advance_xm_wpxp to clean up code. Now subroutines solve_xm_wpxp_with_multiple_lhs and solve_xm_wpxp_with_single_lhs are called, rather than having huge chunks of similar code. Also changing the way calc_xm_wpxp_ta_terms works, it uses other input variables rather than coef_ and term_ arguements and instead calculates those locally to abstract functionality. This is BIT_CHANGING for some cases, but idenetical for some with some compilers. There are no visible differences in plots when tested with a number of different flags, and gabls2 (which uses scalars) are also the same. larson-group/clubb#855 (details)
I am continuing to build the driver subroutine for the new hybrid PDF. (details)
I am continuing to work on the driver file for the new hybrid PDF. (details)
I have completed the main parts of the driver subroutine for the new hybrid PDF. (details)
The code for the new hybrid PDF now compiles. (details)
I added an entry for the new hybrid PDF. (details)
I have added the new hybrid PDF to the G unit tests. (details)
Mathematically, sigma_x_1_sqd and sigma_x_2_sqd cannot be less than 0. (details)
I added code to interface the call to the new hybrid PDF with pdf_closure (details)
I interfaced the implicit coefficients and explicit terms used in the turbulent (details)
I fixed a small error. The code compiles again now. (details)
Updated the larson-group.com urls to http://carson.math.uwm.edu/larson-group (details)
I have added code that allows CLUBB to run interactively using the new hybrid (details)
I am updating the subroutine that calculates PDF component means and standard (details)
I placed proper thresholding on interpolated up2 and interpolated vp2 (details)
I added a limiter to keep the maximum magnitude of the correlations of (details)
I upgraded Nc_Ncn_eqns.F90 to use elemental functions. (details)
The new hybrid PDF also uses this bit of code that sets the correlation (details)
I made modifications to the new hybrid PDF so that that calculation of F_w (details)
I added the ability to handle scalars interactively to the new hybrid PDF. (details)
I found a couple of spots in the new hybrid PDF where I needed to add (details)
I added init_pdf_implicit_coefs_terms_api to clubb_api_module.F90. (details)
I am setting the zeta variance ratio to 1 (symmetric design) by (details)
The variable type implicit_coefs_terms needs to be made public (details)
I changed the value of the coefficient in the F_w equation to 0.45 (details)
I am updating the code to pass up3, vp3, and sclrp3 out of advance_clubb_core (details)
I have started the process of adding the coding infrastructure (details)
I have completed the addition of the ability to use different up2 (details)
I have added 'l_use_precip_frac', 'l_do_expldiff_rtm_thlm', 'l_use_C11_Richardson' and 'l_prescribed_avg_deltaz' to the 'configurable_clubb_flags_nl' namelist. The latter was moved from 'model_setting' namelist. #856 (details)
I have added 'l_use_precip_frac', 'l_do_expldiff_rtm_thlm', 'l_use_C11_Richardson' and 'l_prescribed_avg_deltaz' to the 'configurable_clubb_flags_nl' namelist. The latter was moved from 'model_setting' namelist. #856 (details)
I made the l_calc_w_corr code (turned off by default) run again by (details)
I added a few more flags to the 'configurable_clubb_flags_nl' namelist. Also I gave 'l_use_wp3_pr3' the parameter attribute. (details)
I added a few more flags to the 'configurable_clubb_flags_nl' namelist. Also I gave 'l_use_wp3_pr3' the parameter attribute. (details)
I have started altering argument lists to feed clubb configurable flags through them. This commit has 'l_use_precip_frac', (details)
I continued to alter argument lists. This commit covers 'l_C2_cloud_frac', 'l_diffuse_rtm_and_thlm', 'l_stability_correct_Kh_N2_zm', (details)
I continued to alter argument lists. This commit covers ' l_vert_avg_closure', 'l_trapezoidal_rule_zt', 'l_trapezoidal_rule_zm', (details)
I continued to alter argument lists. This commit covers the last flags in the namelist 'configurable_clubb_flags_nl', namely 'l_predict_upwp_vpwp', (details)
Finished altering argument lists. This commit covers the final seven flags, which are in different namelists. (details)
I introduced the 'clubb_config_flags_type'. Furthermore, I have created subroutines to set default values, to initialize the derived type and to print the derived type. (details)
I enabled the use of the 'clubb_config_flags_type'. I changed 'clubb_standalone', 'clubb_tuner' and the G_unit_tests so that they now use it. The results are bit-for-bit identical. #856 (details)
I fed pdf_params_frz into subroutine advance_clubb_core (details)
Adding error code to arguement list of non-api routines where it was included in the api version. (details)
Moving location of error messages that were in advance_clubb_core. Adding error code setting to those spots as well, they should be fatal. (details)
Added use statement for pdf_params_frz in src/CLUBB_core/clubb_api_module.f90 and made it public. (details)
I have fixed the warnings for lines exceeding 100 characters. (details)
Passing individual flags into setup_clubb_core, rather than the type container for them. This is done for code clarity. (details)
Trivial update to test if cams autoupdate works (details)
Revert "I am setting model flags and tunable parameters in the clubb_E3SM_silhs branch" (details)
I placed E3SM preprocessor commands around E3SM-specific code in (details)
Restoring assertion check for the vertical correlation calculation. larson-group/clubb#869 (details)
Changing the error treshold in assert_correct_cloud_normal to use the previously defined single precision threshold. This should fix occasional errors. larson-group/clubb#869 (details)
I added E3SM's clubb_ parameters that can be read in from the (details)
I added the remainder the clubb_ terms that were added previously to (details)
Changing error threshold in assert_correct_cloud_normal and fixing bug where we weren't passing the correct array section. This should fix the WRF parallel test and the PGI test. larson-group/clubb#869 (details)
Small updates to acc kernel statments for general performance improvement. This is bit-for-bit. larson-group/clubb#869 (details)
Redoing some data directives to only copy data that we need off the device. Data that is needed by assertion checks and stats will be updated conditionally. This will make the code faster when no stats/assertion checks are being done, but slower when it is. This is all bit-for-bit. larson-group/clubb#869 (details)
Adding space because commit a8e61923fa19887baef220aa1a7c8be0f773770f was BIT_CHANGING. larson-group/clubb#869 (details)
Simple performance improvement refactoring. Merging loops and creating tmp variable to use to help reduce memory usage. This changes the order of operations so this is BIT_CHANGING. larson-group/clubb#869 (details)
Small performance improvement. Almost reverting the loops to their previous form using the unbounded_point variable. This is all bit-for-bit. larson-group/clubb#869 (details)
Removing lh_clipped_vars and replacing functionality with arrays. larson-group/clubb#869 (details)
Removed a comma that I missed while removing unused imports (#878) (details)
I am adding l_partial_upwind_wp3 to the list of clubb_config_flags. (details)
I am adding l_partial_upwind_wp3 to the list of clubb_config_flags. (details)
Deprecating use of l_Lscale_vert_avg in SILHS. This is causing problems with the GPUization efforts, described in larson-group/cam#129 (details)
Adding clubb case files that were missed from last commit larson-group/cam#129 (details)
I started the process of paring 2 subprograms back down to 1 in (details)
I pared two more sets of equivalent subprograms down to 1 (each). (details)
Paring down 2 equivalent subprograms to 1 again. (details)
I condensed two more sets of doubled subprograms down to 1 (each) (details)
Reduced two more sets of "doubled" subprograms down. (details)
Updating silhs to prepare the column loop commit. This is being committed seperately because it is BIT_CHANGING, due to the way we are initializing the random number generator on CPUs. larson-group/cam#129 (details)
Adding column loop index to silhs, and pushing loops down to allow parallelization over the column index. This requries changing the api, but it is bit-for-bit running on both gpus and cpus. larson-group/cam#129 (details)
Adding interface in silhs_api to distinguish single vs multiple comulmn calls. This seems to be a better solution than the previous attempt that broke the nightly tests. When calling silhs a single column at a time, the api will copy the single column data into arrays with a grid column index, allowing us to leave the host models the same. larson-group/cam#129 (details)
Removed styleguide violations from my code (details)
Fixed a backwards epsilon comparison from 8e8e71e (details)
Removed the "doubling" of the remainder of the subprograms from (details)
Changing epsilon used in equality comparison. The previous epsilon seems to be too large, and was causing failures in runs. larson-group/clubb#878 (details)
Small changes to generate_all_uniform_samples. I was encountering a gpu problem with this code when run in cam. I'm not certain why this is an issue, but this changes fixes it and is bit-for-bit on both cpus and gpus. larson-group/cam#129 (details)
Changed the length of solve_type_str to 20 [-Wcharacter-trucation] (details)
Adding functionality to pass in a seed for the random number generator. This allows CPU restart runs to function correctly. Because this also changes the seed, this is BIT_CHANGING. larson-group/cam#129 (details)
Removed import without only as it was unused (details)
Adds mpishorthand back with only, it appears to be used somewhere (details)
I have pared two subprograms down to one again, this time for the (details)
I pared down subprogram pairs again, this time for mean advection. (details)
I added altitude_threshold to the list of CLUBB's tunable parameters. (details)
I added altitude_threshold to the list of CLUBB's tunable parameters. (details)
Updating clubb variables to output their var_description in the form '[variable name using sci notation], [Textual descirption]' in an effort to provide more standardized titles for pyplotgenplots. (details)
Updating previous commit to not have lines over 100 characters. This commit shouldn't be BIT_CHANGING, but the previous commit was (and was supposed to be). (details)
Changes length of units variable in stat_file_module from 20 to 25 (details)
This commit resolves issue #885 and gets the 2D output working, if the relevant flags are set to true. A duplicated allocate statement is eliminated, and to ensure that the 2D output occurs at the right intervals (every stats_tout seconds) I have also added approrpiate if statements at the beginning of the 2D output subroutines. (details)
Adding API subroutines for latin_hypercube_2D_output and latin_hypercube_2D_close. This will aid in implementing the SILHS 2D output subroutines in host models. The new API subroutines necessitated some minor changes in clubb_driver.F90 as well. Mainly relevant to https://github.com/larson-group/wrf/issues/110 (WRF repo), but see also #885 (CLUBB repo). (details)
I updated the stats code in setup_clubb_pdf_params.F90 and in (details)
I updated the stats code in setup_clubb_pdf_params.F90 and in (details)
This commit primarily overhauls the way the 2D SILHS samples are output to netCDF. Now, instead of being output along the latitude dimension in a 4d netCDF file, the SILHS samples are output along the "lh_sample_number" dimension of a 5d netCDF file. Furthermore the lat/lon dimensions of the 2D SILHS sample files are now output with the correct lat/lon information. (details)
This commit primarily overhauls the way the 2D SILHS samples are output to netCDF. Now, instead of being output along the latitude dimension in a 4d netCDF file, the SILHS samples are output along the "lh_sample_number" dimension of a 5d netCDF file. Furthermore the lat/lon dimensions of the 2D SILHS sample files are now output with the correct lat/lon information. (details)
Undoing accidental find and replace. larson-group/cam#129 (details)
Updated titles listed for change here: https://github.com/larson-group/sys_admin/issues/542#issuecomment-685963832 (details)
Fix super serious 1 character bug that broke all of the things (details)
I am committing Zhun's changes to the CLUBB portion of his (details)
I am committing Zhun's changes to the CLUBB portion of his (details)
I modified tunable_parameters.in to use some of the parameter values that (details)
I added Cx_min, Cx_max, Richardson_num_min, and Richardson_num_max (details)
I added Cx_min, Cx_max, Richardson_num_min, and Richardson_num_max (details)
I connected the new tunable parameters to advance_helper_module.F90. (details)
I added l_use_shear_Richardson to CLUBB's configurable model flags. (details)
I added l_use_shear_Richardson to CLUBB's configurable model flags. (details)
Adding linear multistep method (LMM) stepping flag (l_lmm_stepping) to provide capability of overstepping-and-then-averaging results from advance_wp2_wp3, advance_xm_xpwp, and advance_xp2_xpyp. This is intended to help smooth high-frequency oscillations. Flag is set to false by default so has no impact on standard runs. (details)
Adding linear multistep method (LMM) stepping flag (l_lmm_stepping) to provide capability of overstepping-and-then-averaging results from advance_wp2_wp3, advance_xm_xpwp, and advance_xp2_xpyp. This is intended to help smooth high-frequency oscillations. Flag is set to false by default so has no impact on standard runs. (details)
I forgot to add rtp2_clip_coef to tunable_parameters.in (this doesn't affect (details)
In order to prevent dycoms2_rf02_so from crashing, (details)
I updated the recording of the budget terms for upwp_pr4 and vpwp_pr4. (details)
Adding the smooth_min and smooth_max functions to the repo. These are not yet implemented in CLUBB but are now available for use and testing. See issue #894. (details)
Adding some comments describing zm and zt for the new interface functions, and fixing a problem in the "array_sclr" versions of the functions. See issue #894. (details)
Modifying some array dimensions to speed up multiply_Cholesky. This cuts the cost of multiply_Cholesky by about 60% in cam but only about 15% in clubb_standalone. larson-group/cam#129 (details)
This commit replaces division by tau with multiplication by inverse tau in most cases. It is BIT_CHANGING, not only because the results change (only very slightly in some cases, but more significantly in sensitive cases like ARM_97, RICO, etc.) but also because some of the old tau_*_zm or tau_*_zt output variables are replaced with invrs_tau_* variables, hence the netcdf files will differ and there are minor changes to stats input files. Spurious source test also needed to be slightly modified to accommodate a new variable fed into the advance_xm_wpxp subroutine. (details)
This commit replaces division by tau with multiplication by inverse tau in most cases. It is BIT_CHANGING, not only because the results change (only very slightly in some cases, but more significantly in sensitive cases like ARM_97, RICO, etc.) but also because some of the old tau_*_zm or tau_*_zt output variables are replaced with invrs_tau_* variables, hence the netcdf files will differ and there are minor changes to stats input files. Spurious source test also needed to be slightly modified to accommodate a new variable fed into the advance_xm_wpxp subroutine. (details)
I am committing a bug fix to the invrs_tau_zm equation that was (details)
This commit introduces a new flag, l_e3sm_config, which enables the user to switch on or off some of the changes introduced in connection with the E3SM merge (see commit https://github.com/larson-group/clubb/commit/cf5b2e4b80d8bd3ca411b9b5e6d5a2afece04795). It also introduces two new tunable parameters, C_invrs_tau_wpxp_Ri and C_invrs_tau_wpxp_N2_thresh, to replace two "magic numbers" in the code. The primary code changes are in advance_clubb_core_module.F90. (details)
This commit introduces a new flag, l_e3sm_config, which enables the user to switch on or off some of the changes introduced in connection with the E3SM merge (see commit https://github.com/larson-group/clubb/commit/cf5b2e4b80d8bd3ca411b9b5e6d5a2afece04795). It also introduces two new tunable parameters, C_invrs_tau_wpxp_Ri and C_invrs_tau_wpxp_N2_thresh, to replace two "magic numbers" in the code. The primary code changes are in advance_clubb_core_module.F90. (details)
Setting parameters and flags to be consistent with the CLUBB repo prior to the October 8 commit merging some E3SM code (https://github.com/larson-group/clubb/commit/cf5b2e4b80d8bd3ca411b9b5e6d5a2afece04795). This should help to basically recover the plots from before the merge, which is useful for single-column model testing. (details)
Adding new flag that allows the user to implement the TKE formulation of the wp3 C15 term (known currently as bp2, but ultimately will be called pr3). See issue #884. (details)
Adding new flag that allows the user to implement the TKE formulation of the wp3 C15 term (known currently as bp2, but ultimately will be called pr3). See issue #884. (details)
Separating out the parameter C5 into C_uu_shr and C_uu_buoy, consistent with the formalism of Mironov and Machulskaya 2017. C5 has been effectively renamed C_uu_shr, and a new parameter C_uu_buoy has been introduced. See https://github.com/larson-group/clubb/issues/901. (details)
Separating out the parameter C5 into C_uu_shr and C_uu_buoy, consistent with the formalism of Mironov and Machulskaya 2017. C5 has been effectively renamed C_uu_shr, and a new parameter C_uu_buoy has been introduced. See https://github.com/larson-group/clubb/issues/901. (details)
I am now passing vert_decorr_coef into SILHS instead of involving (details)
This commits further updates related to splitting the parameter C5 into C_uu_shr and C_uu_buoy (see this commit: https://github.com/larson-group/clubb/commit/3f75a27dd94673a2b8603c24b989da106e759b39). Changes include correcting one instance where C_uu_shr was passed to a function when C_uu_buoy should've been passed, and also now applying the changes to up2 and vp2, which was overlooked before. I've also updated the comments to remove, where appropriate, references to "C_5" that were missed before (in a few places I have left the C_5 in place but included a note indicating that it has now been broken up). (details)
Adding a test to make sure new C_uu_buoy parameter is within the valid range. See #901. (details)
This commit renames the wp3 budget term from "bp2" to "pr_turb", and renames the related parameter "C15" to "C_wp3_turb". The majority of files changed are supplemental files such as postprocessing files for plotgen and pyplotgen and tuner files and input files. (details)
This commit renames the wp3 budget term from "bp2" to "pr_turb", and renames the related parameter "C15" to "C_wp3_turb". The majority of files changed are supplemental files such as postprocessing files for plotgen and pyplotgen and tuner files and input files. (details)
This commit renames the wp3 budget term from "bp2" to "pr_turb", and renames the related parameter "C15" to "C_wp3_turb". The majority of files changed are supplemental files such as postprocessing files for plotgen and pyplotgen and tuner files and input files. (details)
This will allow for a better interface of SILHS parameter (details)
Revert "This will allow for a better interface of SILHS parameter" (details)
I updated silhs_api_module so that vert_decorr_coef is publically available (details)
Incorporating Shixuan Zhang's and Chris Vogl's "l_godunov_upwind_wpxp_ta" flag and related code. The flag is set to false by default so results are unaffected. See #902. (details)
Incorporating Shixuan Zhang's and Chris Vogl's "l_godunov_upwind_wpxp_ta" flag and related code. The flag is set to false by default so results are unaffected. See #902. (details)
Updating advance_xm_wpxp_module so that the upwp_pr4 term uses the parameter C_uu_shr instead of the hard-coded value 0.7. Also updating the value of C_uu_shr from 0.3 to 0.4 after testing priority-cases with the new upwp_pr4 term. (details)
Updating advance_xm_wpxp_module so that the upwp_pr4 term uses the parameter C_uu_shr instead of the hard-coded value 0.7. Also updating the value of C_uu_shr from 0.3 to 0.4 after testing priority-cases with the new upwp_pr4 term. (details)
Moving the acc update host directive to after the wait directives in silhs. Since silhs runs with asyncronous kernel calls the update was occasionally happening before some clipping was finished, causing problems in assert_correct_cloud_normal. This is only a problem when compiling with OpenACC enabled, so it should be bit identical for all our tests. larson-group/cam#129 (details)
Reording vertical and subcolumn dimensions in SILHS. This is BIT_CHANING in some cases, seemly due to an outputting error for the precip_rate field, but plotted results are identical. larson-group/cam#129 (details)
Changing dimension order of rand_pool to make consistent with previous reorderings. This is BIT_CHANGING for silhs cases since it changes the order in which random numbers are used. larson-group/cam#129 (details)
Changes non-success `stop` statements to `error stop` (details)
Changes non-success `stop` statements to `error stop` (details)
I changed the tuner's configuration of three cloud cases (details)
Adding Shixuan's godunov_xpyp_ta updates here in case we want to merge them into our master branch. See #902. (details)
Adding Shixuan's godunov_xpyp_ta updates here in case we want to merge them into our master branch. See #902. (details)
Changed the variable up2_vp2_factor to up2_sfc_coef in all files (details)
Changed the variable up2_vp2_factor to up2_sfc_coef in all files (details)
I added an option to improve dry, convecting boundary layers. (details)
This commit switches the names, but not the values, of the dp1 and pr1 variables for up2 and vp2. In other words, up2_dp1 <---> up2_pr1 and vp2_dp1 <---> vp2_pr1. This makes the terms in these equations more consistent with the terms in the wp2 equation. I believe this commit is BIT_CHANGING since it will affect the values of these variables even though the nightly plot profiles should not change (but the budget plots would have these lines swapped). (details)
Changed surface to sfc in all instances where requested (details)
Undid sfc change in stats_sfc_module.F90 (details)
Pushing grid column loop into setup_pdf_params. Adding iterface too, allowing us to call it with single or multiple columns so that the host models don't need updating to work with this change. This is bit-for-bit, tested with clubb_standalone and cam coarse res run. larson-group/cam#129 (details)
Broke up column loop inside setup_pdf_params. This is all bit-for-bit. larson-group/cam#129 (details)
More loop pushing, all bit-for-bit. larson-group/cam#129 (details)
Adding one_half to use statement. This was a bug preventing compilation when using the ifort compiler with the MKL functions. (details)
Moving use statement for one_half inside ifdef, since it is only needed if compilation with MKL functions is enabled. (details)
Reducing the number of calls to Cholesky_factor. This is bit-for-bit for all standalone cases and our coarse res version of cam. larson-group/cam#129 (details)
Reordering dimensions of mu, sigma, corr_arrays, and cholesky matrices. This makes the dimension ordering more consistent with similar arrays and should help to reduce computational cost by reducing array slicing. This is all bit-for-bit. larson-group/cam#129 (details)
Reordering dimensions of mu, sigma, corr_arrays, and cholesky matrices. This makes the dimension ordering more consistent with similar arrays and should help to reduce computational cost by reducing array slicing. This is all bit-for-bit. larson-group/cam#129 (details)
Performance improvements from chaning loop orderings and redundant operation reduction. All bit-for-bit. larson-group/cam#129 (details)
Reordering dimensions on some arrays. This is bit-for-bit. larson-group/cam#129 (details)
Reducing operations. All bit-for-bit. larson-group/cam#129 (details)
Adding 2D subroutine versions of some functions to improve performance. This is all bit-for-bit. larson-group/cam#129 (details)
Some small cleanup, all just formatting. larson-group/cam#129 (details)
Changed ustar from an array to a scalar issue #909 (details)
Renamed Ri_zm to sqrt_Ri_zm and iRi_zm to isqrt_Ri_zm #909 (details)
Created new subroutine and ensured it's BFB. All cases run sucessfully #909 (details)
added in missing flag which was causing memory errors #909 (details)
confirmed BFB with e3sam flag set to false and true, no other issues detected in mixing_length #909 (details)
Adding dummy dimensions to calls to procedures that operate over 2 dimensions now, and remove 1D versions of those procedures. larson-group/cam#129 (details)
Separating precip fractions from hyrdromet_pdf_params and creating a type of it's own for it. This is bit-for-bit. larson-group/cam#129 (details)
Separating precip fractions from hyrdromet_pdf_params and creating a type of it's own for it. This is bit-for-bit. larson-group/cam#129 (details)
Formatting and condensing if statements. All bit-for-bit. larson-group/cam#129 (details)
Making hydromet_pdf_params optional in setup_pdf_parameters. larson-group/cam#129 (details)
Reformatted mixing length to be more compliant with the coding standard #909 (details)
added a reference to new subroutine #909 (details)
Adding second dimension to allocatable arrays in pdf_parameter type. This also requires lots of dummy dimensions in clubb where pdf_params is used, since clubb only works over a single column, but silhs does not need such a dummy dimension. larson-group/cam#129 (details)
Adding second dimension to allocatable arrays in pdf_parameter type. This also requires lots of dummy dimensions in clubb where pdf_params is used, since clubb only works over a single column, but silhs does not need such a dummy dimension. larson-group/cam#129 (details)
Fixing lines that exceed 100 characters. (details)
Fixing lines that exceed 100 characters. (details)
Pushing loops related to pdf_params down. larson-group/cam#129 (details)
Added in sqrt_Ri_zm to all_stats.in #909 (details)
clubb warnings introduced from merge have been removed #909 (details)
moved sqrt_Ri_zm from vars_zt to vars_zm in all_stats.in #909 (details)
Changed safeguard threshold in sigma_sqd_w. (details)
Adding some new code that puts the diffusion term d(wp2*em)/dz into a new function, creates a new wp3 budget term (wp3_pr_dfsn), and adds that new budget term to pyplotgen. (details)
Adding new coefficient to control the wp3 pressure diffusion term. (details)
Some minor updates to advance_wp2_wp3 relevant to the pr_turb and pr_dfsn terms. (details)
Converting em*d(em)/dz to d(em^2)/dz in the wp3_pr_turb term and fixing a typo. (details)
Renaming C_wp3_turb --> C_wp3_pr_turb (BIT_CHANGING due to name change in netcdf output). (details)
These changes add the new fourth-order moment variables wp2up2 and wp2vp2 to the CLUBB code. This requires a new function in pdf_closure_module since they must be calculated separately with a new formula, and they are fed through into advance_wp2_wp3 for use with the pr_dfsn subroutine. They are also added to the standard stats file and will be output to netcdf, hence this commit is BIT_CHANGING. (details)
Adding new coefficient to control the wp3 pressure diffusion term. (details)
Adding some new code that puts the diffusion term d(wp2*em)/dz into a new function, creates a new wp3 budget term (wp3_pr_dfsn), and adds that new budget term to pyplotgen. (details)
Putting the wp3_pr_turb formulation back to its d(rho*wp2*em)/dz form. This would be a BIT_CHANGING commit since it would change the answers for the pr_turb term. However once this branch is merged into the master branch, results should be bit-for-bit since this term was only modified in the alternate branch. (details)
These changes add the new fourth-order moment variables wp2up2 and wp2vp2 to the CLUBB code. This requires a new function in pdf_closure_module since they must be calculated separately with a new formula, and they are fed through into advance_wp2_wp3 for use with the pr_dfsn subroutine. They are also added to the standard stats file and will be output to netcdf, hence this commit is BIT_CHANGING. (details)
These changes add the new fourth-order moment variables wp2up2 and wp2vp2 to the CLUBB code. This requires a new function in pdf_closure_module since they must be calculated separately with a new formula, and they are fed through into advance_wp2_wp3 for use with the pr_dfsn subroutine. They are also added to the standard stats file and will be output to netcdf, hence this commit is BIT_CHANGING. (details)
Added intent comments for the following files: (details)
Setting l_update_pressure = .false. since it was causing a problem with the MC3E test and is turned off in all host models anyway. (details)
Removing "if" statement around calculation of wp4 in pdf_closure_module.F90 and the same "if" statement around some further manipulation of wp4 in advance_clubb_core. Results are bit-for-bit with this change, since normally all cases calculate wp4 anyway since the "if" condition was always satisfied in normal runs (but not, for example, in some tuning runs). This was done because the new wp3_pr_dfsn term needs wp4 in its current formulation so it needs to always be calculated. (details)
Removing "if" statement around calculation of wp4 in pdf_closure_module.F90 and the same "if" statement around some further manipulation of wp4 in advance_clubb_core. Results are bit-for-bit with this change, since normally all cases calculate wp4 anyway since the "if" condition was always satisfied in normal runs (but not, for example, in some tuning runs). This was done because the new wp3_pr_dfsn term needs wp4 in its current formulation so it needs to always be calculated. (details)
Removing some "use" statement variables from advance_clubb_core, since they are no longer used here but are now used in mixing_length.F90. (details)
Added intent comments for advance_xp2_xpyp_module.F90. (details)
Makes surface clipping of wp3 consistent with clipping aloft, per #921. This is BIT_CHANGING since it affects how clipping is applied near the surface. (details)
Deleting comments around the old "magic number" for the near-surface clipping. (details)
Fixing fortran standards violation causing compiler errors with nvfortran. See larson-group/clubb#900 and larson-group/clubb#928. (details)
Changed some elements of clubb to allow for better script execution (details)
Fixed file_functions indentation being off (details)
Fixed indentation on operations being wrong (details)
Reverted incorrect changes to new_pdf and new_hybrid_pdf (details)
Fixed spacing issue when adding in gr. BFB identical. For #886. (details)
Fixed spacing issue when adding in gr. BFB identical. For #886. (details)
Removing gr as a module variable from grid_class. (details)
Removing gr as a module variable from grid_class. (details)
Fixing typo in stats_zm_module.F90. Background: Since this commit https://github.com/larson-group/clubb/commit/466c5383fa5c0cc85316c6d117826974a5e2e0a3# in August 2020 the upwp budget lines in Pyplotgen have not appeared to be balanced for any cases. It turns out the reason is that a comma and space were added to the upwp_tp variable name in stats_zm_module.F90 in the August 2020 commit. This unusual naming causes pyplotgen not to recognize this variable, so it doesn't get plotted and the lines appear unbalanced. However, since the budget balance test still found the variable, it kept passing successfully. This commit will fix the issue with the pyplotgen plotting by reverting the name to the standard format. (details)
Feeding gr through arg list for functions outside of CLUBB_core. (details)
Feeding gr through arg list for functions outside of CLUBB_core. (details)
Moving 'gr' from front of arg list when being used as intent(inout) to conform to standard. #886. BFB. (details)
The purpose of this commit is to see whether or not causing changes in sam's version of clubb will cause errors when the master branch of clubb gets merged intosam. Please ignore this commit unless everything breaks, in which case this is the reason why everything is broken. (details)
Code changes to introduce wp2_pr_dfsn, the wp2 pressure diffusion term, consistent with Lumley 1978. Related to #920. (details)
Code changes to introduce wp2_pr_dfsn, the wp2 pressure diffusion term, consistent with Lumley 1978. Related to #920. (details)
Correcting a typo bug and adding some descriptive comments to two new variables. This is a BIT_CHANGING commit becuase it will affect the newly calculated variables and descriptions in the output files, but it won't affect any plotted results. Related to #920. (details)
Moving the stats variables to module variables of clubb_driver. (details)
Moving the stats variables to module variables of clubb_driver. (details)
Fixing coding standard viloation of lines exceeding 100 characters. (details)
Fixing coding standard viloation of lines exceeding 100 characters. (details)
Adding wp3_pr_tp (aka "negative nose" term) to wp3 equation. Related to #920. (details)
Changing the way the new wp3_pr_tp term works, by generalizing the wp3_terp_pr_lhs subroutine. Also cleaning up comments and changing the description of the wp3_pr_tp variable in the netcdf output files, hence this commit is BIT_CHANGING, although it will not affect numerical results since the wp3_pr_tp coefficient (C_wp3_pr_tp) is set to zero. (details)
Adding wp3_pr_tp (aka "negative nose" term) to wp3 equation. Related to #920. (details)
Adding wp3_pr_tp (aka "negative nose" term) to wp3 equation. Related to #920. (details)
Removing l_interp_prescribed_params from setup_clubb_pdf_params. (details)
Adding comments labeling subroutine calls with intent. (details)
Adding intent labels for subroutines throughout clubb. (details)
Removing unnecessary constant from use statement (details)
Eliminating l_nu_grid_dependent as requested. (details)
Updates to include all invrs_tau_* variables in the output stats files, and pyplotgen updates to plot all of the invrs_tau_* variables on two separate plots along with the other "base" variables. (details)
Eliminating l_refine_grid_in_cloud and l_interactive_refined. (details)
Eliminating l_use_experimental_term_pr2 and l_use_vert_avg_winds (details)
The new file calc_roots.F90 contains functions that solve for the roots of a cubic polynomial (function cubic_solve), the roots of a quadratic polynomial (function quadratic_solve), as well as cube root (function cube_root, which is called by the function that solves the cubic polynomial).
These are general purpose functions which can aid in many solutions.
I tweaked the precipitation fraction code so that the weighted ith PDF component preciptation fractions (mixt_frac_i * precip_frac_i) remain proportional to each other when overall precipitation fraction is not equal to the sum of the two weighted component precipitation fractions (e.g. while there can be some slight discrepancies in a standalone run, but this will have the greatest effect when precipitation fraction is supplied by the LES).
I updated pdf_closure_module.F90 by integrating changes I made in the Brian_special_input_fields_r7565 branch. The changes are formatting, variable names, and some small improvements to the 3-D Luhar closure. This does not effect the default ADG1 closure.
The results in GrADS output files from the this revision are an exact match to the results in GrADS output files from the previous revision for all cases.
I dug up some old timing code from an obsolete CLUBB branch and found that it gives accurate results. Therefore, I am committing it to the trunk of CLUBB, inside the `CLUBB_core` directory. It is not used right now; it is simply designed to be a utility for code analysis.
I cleaned up the code and added comments to make it suitable for the "official" CLUBB.
I am updating default CLUBB to use the same hydrometeor PDF parameters that are used in the Brian_special_input_fields_r7465 branch as well as in the paper on Hydrometeor PDF shapes.
There are small changes to all cases that use analytic microphysics or SILHS.
I added some fool-proofing to the code that stops the run with an error if the user sets `l_Lscale_plume_centered = .true.` and `l_avg_Lscale = .false.`.
I moved `l_stability_correct_tau_zm` to `model_flags.F90`, and made it a variable instead of a compile-time constant. This should be the only change we need to make to CLUBB to do away with the branch.
CLUBB standalone output is bin-diff identical for a fine selection of CLUBB cases.
I merged in NCAR's changes to `advance_clubb_core_module.F90` and `interpolation.F90`. This is probably at least half the battle.
I added some flags to `model_flags.F90`. They are set to the values that preserve answers in CLUBB standalone. Output is bin-diff identical for a comprehensive selection of test cases.
I completed merging in NCAR's changes. The changes include a LOT of missing `!$omp threadprivate` directives. I wonder how they manage to find these. Maybe they have a script?
I also eliminated all CAM preprocessors from `parameters_tunable.F90`!!
Output is bin-diff identical for a selection of cases.
I replaced `pointer` with `allocatable` in (almost) the entirety of `CLUBB_core`.
All compilers in `compiler_tests.bash` can compile this version of CLUBB and none emit any warnings related to these changes. Further, with `gfortran`, output is bin-diff identical for all cases.
I am attempting to fix two related problems in CLUBB: 1. We need to make sure CLUBB is completely cleaned up before exiting `run_clubb`, otherwise we have memory leaks and potential errors. 2. We should make sure variables are allocated before we attempt to deallocate them.
For (1), I refactored CLUBB's cleanup code into a single subroutine and am calling it in some places that a "return" statement appears. For (2), I attempted to add some appropriate conditions to look for before deallocating variables.
I made the SILHS parameters namelist optional, so that a warning message is simply printed if the namelist is not found. I'm not particularly fond of this solution, but the difficult alternative is to track down the places in the tuner where the SILHS namelist needs to be placed. Maybe some other day.
I also deallocated a variable in SILHS that wasn't deallocated before.
While looking through plots, I noticed that for some reason, CLUBB output files list `cloud_frac` as having units of "count", which in fact it is a fraction between 0 and 1. I have changed the units to be "-", as is done elsewhere.
Note that this commit is BIT_CHANGING, but only because of the metadata change. Numerical values of all variables should be identical.
I added an option to compute `C7_Skw_fnc` based on the Richardson number. This change is wrapped in a flag, `l_use_C7_Richardson`, which is false by default.
Output is bin-diff identical in the default configuration.
I am adding an option to use a different formulation of `brunt_vaisala_frequency_sqd` in saturated air. This formula comes from Durran and Klemp (1982).
As always, the change is wrapped in a flag, and output is bin-diff identical in the default configuration.
I added functionality to vertically average Richardson number based on Lscale. The option is turned off by default, so output should be bin-diff identical by default.
While reading through the code, I found an important bug in the moist Brunt-Vaisala code. Inside a `where` statement, I had calls to functions that take in an entire profile as input, such as `zt2zm` and `ddzt`. But the arguments to these functions where themselves initialized in the `where` statement! Therefore, much of the input profiles to these functions were likely uninitialized. Not good.
This change affects only the case where `l_brunt_vaisala_freq_moist = T`, which is not the default.
I set `Richardson_num_max` to five, and enabled by default code that vertically averages `C7_Skw_fnc` over a distance of `Lscale_zm`, as this seems to be closer to what we want.
This only affects results when `l_use_C7_Richardson = T`, which is not the default.
Refactoring: Virtual levels!!! I am refactoring the code to make use of "virtual levels". This lays the framework to allow below-ground levels to affect the vertical averaging.
I merged NCAR's tag, !^/tags/ncar_tags/clubb_cK10_tags/clubb_cK10_n05_r8096, into the trunk. This commit mainly adds a new tuning parameter, `c_K10h`, which is related to `c_K10` but `c_K10h` is for thermodynamic levels. Keeping `c_K10 = c_K10h = 1.0` maintains current results.
This commit is BIT_CHANGING, but only because a new tuning parameter was added, and apparently we are in the habit of outputting all tunable parameters in our NetCDF files. Numerically, NetCDF results should be identical. GrADS results are bin-diff identical for all (priority) cases.
I am bringing in the latest and greatest features from the `diag` branch back into the trunk. The changes are enhancements to the case where `l_use_C7_Richardson = T` (not default).
Output is bin-diff identical in the default configuration.
I reintroduced the ability to use `turb_freq_sqd` in the denominator of `Richardson_num` as a option set to false. I suppose this is better than commented out code.
These changes augment clubb:r8099. I confined the declaration of `RHpostPDF` in a `CLUBB_CAM` preprocessor directive to resolve a compiler warning. I also added `c_K10h` to some error_*.in files for the tuner. This resolves the failure of the nightly FIRE tuner test last night.
I am committing parameter changes to the `l_use_C7_Richardson = T` code: * `Richardson_num_max = 200` * Vertical averaging of `Richardson_num` is enabled. * `Richardson_num` below ground is `0.5 * Richardson_num_max`.
Output should be bin-diff identical in the default configuration.
For cam:ticket:59, I fixed bugs in the `l_use_C7_Richardson=T` vertical averaging code:
1. The averaging levels should be within 0.5*Lscale, not Lscale. 2. The equation for the number of "below ground" levels was totally wrong. I must have been half asleep when I wrote that equation.
I am adding support for "pressure term 3" (pr3) in wp3's equation set. `wp3_pr3` will be included in the equation only if `l_use_wp3_pr3 = T` (default false).
The magnitude of `wp3_pr3` is dependent on `C16_fnc`. Currently, `C16_fnc` is hardcoded to be 0.5. In the near future, `wp3_pr3` will instead be based on `Richardson_num`, analogously to `C7_Skw_fnc`.
Output is bin-diff identical in the default configuration.
After a long battle, I finally got successful statistics outputting of the `wp3_pr3` term!!!
Tests run: 1. Output is bin-diff if `l_use_wp3_pr3 = F` (default). 2. Output is bin-diff if `l_use_wp3_pr3 = T` and `C16_fnc(:) = 0.0`. 3. If `C16_fnc(:) = 1.0`, then the `wp3_pr3` term exactly opposes the sum of the `wp3_ta` and `wp3_tp` terms when overplotted. Furthermore, after adding `wp3_pr3` into the `wp3_residual` equation, `wp3_residual` is zero! (That is, the bu dget balances.)
That code in `advance_wp2_wp3_module.F90` is pretty intricate, eh?
Refactoring: I renamed `compute_C7_Skw_fnc_Richardson` to `compute_Cx_fnc_Richardson`. I pulled out the computation of `Cx_fnc_Richardson` to `advance_clubb_core_module` and passed `Cx_fnc_Richardson` to `advance_xm_wpxp`, where it is used to set `C7_Skw_fnc`.
Damage control: I am adding lines that clip `C7_Skw_fnc` (which should now be renamed to `Cx_fnc_Richardson` in this context) to be within the range [0,1]. Apparently, on at least Intel (see build:15667), roundoff error can leave `C7_Skw_fnc` slightly outside this range.
I made sure `wp3_pr3_rhs` was initialized when `l_use_wp3_pr3 = F`, so that zero is output to stats, rather than an uninitialized variable. This should resolve the failures of the Nightly Uninitialized Variables Test (build:15959) and the Nightly OpenMP Test (build:15953) last night.
This commit is BIT_CHANGING because a variable which was output as uninitialized (usually NaN) before is now output as zero. However, answers remain unchanged as long as `l_use_wp3_pr3 = F`.
It is worth noting that clubb:r8198 also caused the Nightly Bin Diff Regression Test (build:15948) to fail because it added a stats output and was not marked with a BIT_CHANGING tag. Including the tag in this commit will resolve that failure, and we should see a lovely shade of spring green tomorrow morning.
I initialized some variables that were before uninitialized when `l_vert_avg_closure = F`. These uninitialized variables were used only for stats.
This commit is BIT_CHANGING in the "_zm" output file because some variables, such as `cloud_frac_zm`, that were output as undefined before are now output as zero. However, the simulation result does not change as a result of this commit.
When l_avg_Lscale is turned on but the plume-centered calculation is disabled, I changed the "sample points" chosen to pick the theta-l point associated with the rt point based on the sign of rtpthlp.
Since the l_avg_Lscale flag is turned off my default, the results found in GrADS output files from this revision are an exact match to the results found in GrADS output files from the previous revision for all cases.
I removed the `CLUBB_CAM` preprocessor directive surrounding the RH_postPDF fix, and instead added a new flag, `l_rcm_supersat_adj`, set to false by default.
This changeset produces bin-diff identical output.
For clubb:ticket:792, I added a new stats output, `rcm_supersat_adj`, to record the degree of rcm adjustment. It is not output by default. This changeset does not change output.
To facilitate committing tuning changes to CAM, I added a new tuning parameter, `up2_vp2_factor`, and a new flag, `l_use_C11_Richardson`. I made various other changes.
I am beginning to generalize the sponge damping code so that it can be applied to fields such as wp2, up2, and vp2.
As part of this change, I am reverting the interpolation of sponge damping time scale, tau_sponge_damp, from linear interpolation to the kind of interpolation that is used in SAM LES.
Since the CGILS cases use sponge damping for mean fields toward the top of the domain, the results of this change will be BIT_CHANGING. However, the effect is minor.
I have added all the coding infrastructure to perform sponge damping (and record its effects on the budgets) for wp2, wp3, up2, and vp2. This code is turned off by default. Additionally, I haven't added the stats to stats.in files yet.
As a result, the results found in GrADS output files from this revision are an exact match to the results found in GrADS output files from the previous revision for all cases.
Larson Group Internal Trac System Reference: papers:ticket:14.
I added comments about the two sets of indices in CLUBB, the ii indices and the iiPDF indices. These are used to index the hydrometeors and PDF variates, respectively.
I added the sum and the average of the sample point weights to the lh surface output. The variables are called lh_sample_weights_sum and lh_sample_weights_avg and will be written with the standard_stats output configuration.
I added some parameter value checking in subroutine setup_parameters.
When l_clip_semi_implicit is set to .false. (which it is by default), the new code enforces C6rt = C6thl, C6rtb = C6thlb, C6rtc = C6thlc, and C6rt_Lscale0 = C6thl_Lscale0. This will prevent an inconsistent calculation of wpthlp_pr1 in this scenario, while preventing the user from thinking that the C6thl set of parameters do anything in this scenario.
Larson Group Internal Trac System Reference: clubb:ticket:794.
I finally have a standalone version of the new subroutine, generate_pdf_params, that compiles. It is not currently called from any point in the code. Just getting this ready has been an accomplishment.
Larson Group Internal Trac System Reference: cam:ticket:87.
The perturbation Lscale code requires rtm_frz, thlm_frz, and pdf_params_frz to be output from generate_pdf_params, and the stats_accumulate code requires that rcm_supersat_adj is output as well.
I have interfaced the new subroutine containing all of the PDF closure-related stuff with the code. When the subroutine call is made from the location of the code it is replacing, the results in GrADS output files from the new revision are an exact match to the results in GrADS output files from the previous revision for all cases using CLUBB's default configuration.
Larson Group Internal Trac System Reference: cam:ticket:87.
I got rid of some variables that were brought into advance_clubb_core by use statements that are no longer necessary. This eliminates new compiler warnings.
Larson Group Internal Trac System Reference: cam:ticket:87.
I have added a second call to subroutine generate_pdf_params. This one occurs after predictive fields have been advanced.
I have also added code to call generate_pdf_params at its original location, at the new location, or at both locations. The appropriate anti-idiot code is currently located in advance_clubb_core, but will be moved in the future.
Larson Group Internal Trac System Reference: cam:ticket:87.
I moved the setting of qclvar and thlprcp_out to after the second call to subroutine generate_pdf_params. This way, rcp2_zt and thlprcp don't need to be passed in and out of subroutine advance_clubb_core.
Larson Group Internal Trac System Reference: cam:ticket:87.
I have declared the l_use_ice_latent option and the l_call_pdf_closure_twice option to be imcompatible with the ipdf_post_advance_fields option. This prevents seldom-used variables, such as rtm_frz, thlm_prz, pdf_params_frz, and pdf_params_zm, from having to be passed in and out of subroutine advance_clubb_core when the PDF is only called after predictive fields have been advanced.
Larson Group Internal Trac System Reference: cam:ticket:87.
I added a local cslculation of sigma_sqd_w near the top of subroutine advance_clubb_core in a scenario when the PDF is not called until after the advancement of the predictive fields (in other words, when ipdf_post_advance_fields is selected).
Larson Group Internal Trac System Reference: cam:ticket:87.
I am changing the inputs and outputs of subroutine advance_clubb_core so that rcm, cloud_frac, wpthvp, wp2thvp, rtpthvp, thlpthvp, sclrpthvp, and pdf_params are all passed through as intent(inout) variables.
This change allows for CLUBB's PDF to be called after the predictive fields are advanced when the appropriate option is set.
The results in GrADS output files from this revision are an exact match to the results in GrADS output files from the previous revision for all cases. The default option is still to call CLUBB's PDF in its historical location, which is prior to the advancement of the predictive fields.
Larson Group Internal Trac System Reference: cam:ticket:87.
I added code so that stats that are internal to subroutine generate_pdf_params are only called once every model timestep when the ipdf_pre_post_advance_fields option, which calls the aforementioned subroutine twice, is called.
I have updated subroutine advance_clubb_core so that pdf_params_zm is now passed into and out of it as an intent(inout) variables. This enables it to be preserved from timestep to timestep. This also removes the flag l_call_pdf_closure_twice from being blacklisted when ipdf_post_advance_fields is used as the ipdf_call_placement option.
The results in GrADS output files from this revision are an exact match to the results in GrADS output files from the previous revision of this branch for all cases (with the default configuration of ipdf_call_placement = ipdf_pre_advance_fields).
Larson Group Internal Trac System Reference: cam:ticket:87.
Ticket #799 -- Moved iiPDF_... module variables from module corr_varnce_module to module array_index -- The results of the priority cases are bin-diff identical
I renamed the subroutine pack_pdf_params found in setup_clubb_pdf_params.F90 as subroutine pack_hydromet_pdf_params.
I took out the ifdef CLUBB_CAM preprocessor flags around some declarations and subroutines in pdf_parameter_module.F90 because they are also going to be called by WRF-CLUBB (and possibly SAM-CLUBB).
The results in GrADS output files from this revision is an exact match to the results in GrADS output files from the previous revision for all cases.
I removed the CAM_CLUBB preprocessor directives from pack_pdf_params_api, unpack_pdf_params_api, and num_pdf_params so that they can be accessed from WRF-CLUBB.
The results in GrADS output files from this revision are an exact match to the results in GrADS output files from the previous revision for all cases.
I updated CLUBB stats so that wpthvp, wp2thvp, rtpthvp, and thlpthvp are passed into subroutine stats_accumulate rather than be brought in by USE statements. This will allow these variables to be output correctly in the CLUBB stats grid column in WRF-CLUBB runs.
The results in GrADS output files from this revision are an exact match to the results in GrADS output files from the previous revision for all cases.
I have added the coding infrastructure to output additional statistics w_1_zm, w_2_zm, varnce_w_1_zm, varnce_w_2_zm, and mixt_frac_zm. These are necessary for CLUBB restarts if the ipdf_call_placement flag is set to ipdf_post_advance_fields and the l_call_pdf_closure_twice flag is turned on.
Additionally, I have added all the necessary CLUBB fields to input fields and to CLUBB restarts so that restarts should be successful if the ipdf_call_placement flag is set to ipdf_post_advance_fields.
I have not added the new stats to the stats.in files yet. With that, the results in GrADS output files from this revision are an exact match to the results in GrADS output files from the previous revision for all cases.
Larson Group Internal Trac System Reference: cam:ticket:87.
This is a bug fix for the Sun compiler. The variables pdf_params_zm and pdf_params_frz, which aren't used with CLUBB's current default settings, are intent(out) of subroutine generate_pdf_params. While they are initialized in CLUBB, they were not initialized in subroutine generate_pdf_params, and since they weren't being used by default, NaN values were being passed out of generate_pdf_params, overwriting the 0 values that they had been initialized to. This bug fix initializes pdf_params_zm and pdf_params_frz locally within subroutine generate_pdf_params.
I am updating the hydrometeor PDF code to set mu_hm_1 and mu_hm_2 based on mu_thl_1 and mu_thl_2. This will help improve the increase of thlp2 from evaporation of rain near ground in cases that use analytic microphysics or SILHS.
The results of this change are BIT_CHANGING for all cases that use any type of microphysics.
Larson Group Internal Trac System Reference: papers:ticket:14.
I have added corr_rt_thl_2 to the code to go along with corr_rt_thl_2.
Since an additional stat has been added to output, this particular change is BIT_CHANGING. However, this is only for GrADS _zt output files. Results in GrADS _zm and _sfc output files remain the same.
I have added some code to add corr_w_rt_1, corr_w_rt_2, corr_w_thl_1, and corr_w_thl_2 to the pdf_parameter derived data type. The value of these variables is simply set to 0 for the ADG1 PDF. They have not yet been output to stats.
The results in GrADS output files from this revision are an exact match to the results in GrADS output files from the previous revision for all cases.
I added new statistics to the CLUBB _zt output files, specifically corr_w_rt_1, corr_w_rt_2, corr_w_thl_1, and corr_w_thl_2.
The results in GrADS _zt output files change, owing to additional statistics. This commit is BIT_CHANGING. Otherwise, all the other GrADS output files stay exactly the same.
I am updating the equations for wp2rtp, wp2thlp, wprtp2, and wpthlp2 to include within-component correlations of w and rt or w and theta-l.
I am also replacing the hardwired settng of corr_w_rt_1, corr_w_rt_2, corr_w_thl_1, and corr_w_thl_2 to 0 (for ADG1) with the equations that solve for these correlations. For the ADG1, the result of the equation is within-component correlations that have a value of 0 --- well, within numerical roundoff error of 0 (such as 1.0e-14).
Since this code change technically changes results, this commit is BIT_CHANGING. However, plotgen shows profiles exactly overlap for almost all cases. The ultra-sensitive ARM 97 case is the most notable exception.
I am adding a special function to calculate the within-component correlation of eta and variable x (such as w), which depends, in part, on the within-component correlaton of rt and x and the within-component correlation of theta-l and x.
I added variables corr_w_chi_1, corr_w_chi_2, corr_w_eta_1, and corr_w_eta_2 to subroutine pdf_closure. They calculate the within-component correlations by calling utility functions in PDF utilities.
Now that the PDF component correlations of w and chi, as well as w and eta, will be allowed to be something other than 0 when a new PDF is used, stats needs to account for that.
Already in the code, corr_chi_eta_1 is the value calculated in PDF closure, while corr_chi_eta_1_ca is the actual value used in the correlation array. This depends on whether the calculated value or a prescribed value is used in the array. This code is now being mimicked for corr_w_chi_1, corr_w_chi_2, corr_w_eta_1, and corr_w_eta_2.
The first step is change the current stats output corr_w_chi_1 to corr_w_chi_1_ca, etc.
The results in GrADS *.dat output files from this revision are an exact match to the results in GrADS *.dat output files from the previous revision for all cases. The GrADS *.ctl files differ because the stat names have changed.
I am adding statistical output for corr_w_chi_1, corr_w_chi_2, corr_w_eta_1, and corr_w_eta_2.
The results in GrADS output files differ because of the additional statistics, so this revision is BIT_CHANGING. However, this is only for the *_zt output files. The results in GrADS *_zm and *_sfc output files from this revision are and exact match to the results in GrADS *_zm and *_sfc files from the previous revision for all cases.
I am changing the name of the flag l_fix_chi_eta_correlations to l_fix_w_chi_eta_correlations. This is because code will need to be introduced to fix the PDF component correlations of w and chi and w and eta for SILHS.
The results in GrADS output files from this revision are an exact match to the results in GrADS output files from the previous revision for all cases.
The two component normal (double Gaussian) PDF used by CLUBB will now be selected by an integer index, rather than multiple logical flags. The PDF type used by CLUBB is called iiPDF_type. The value of iiPDF_type can be set to one of the following:
iiPDF_ADG1 = 1: ADG1 PDF (default) iiPDF_ADG2 = 2: ADG2 PDF (can only be used with input fields) iiPDF_3D_Luhar = 3: 3D Luhar PDF (can only be used with input fields).
Additional PDF types will be added in the near future.
The results in GrADS output files from this revision are an exact match to the results in GrADS output files from the previous revision for all cases.
I moved the checking of the options for the PDF call placement to subroutine setup_clubb_core, which is the same place where the options for the PDF type are checked.
I am altering setup PDF parameters to be able to read in the values of corr_w_chi_1, corr_w_chi_2, corr_w_eta_1, and corr_w_eta_2 calculated by CLUBB's PDF closure when l_fix_w_chi_eta_correlations is turned off.
Since RICO and RICO SILHS have l_fix_w_chi_eta_correlations turned off by default, and since the values of corr_w_chi_1 are within numerical roundoff of 0, but are not exactly 0 (since they aren't hardwired to 0 anymore in this situation), the GrADS output results for the RICO cases are technically BIT_CHANGING. However, for all other cases, the results in GrADS output files from this revison are an exact match to the results in GrADS output files from the previous revison.
I am adding a large amount of code to the new PDF. I have filled in the driver subroutine, and I have added functions and subroutines for mixture fraction, the PDF component means and standard deviations for the "setter" variable, and the PDF component means and standard deviations for the "responder" variables.
I made a couple changes to (1) initialize two variables that aren't used by the new PDF (alpha_rt and alpha_thl) to default values in order to avoid them being set to NaN and causing a runtime error, and (2) calculate skewness from thlp3 and thlp2 (or rtp3 and rtp2) for the new PDF.
I added a conditional to the subroutine that sets the responder parameters. When both Skx and F_x are exactly 0 (and the only Skx that can be represented when F_x is 0 is a Skx of 0), a couple of equations end up with an undefined 0/0. In this scenario, the PDF is converging to a single Gaussian. When both Skx and F_x have a value of 0, the PDF of responder variable x is now defined to be a single Gaussian (which is the shape it was converging to).
I have added the beginnings of a new unit test for the PDF parameters. Currently, it tests the new PDF, but only the "setter" variable. It checks based on a variety of input values and loops over many different tunable parameter values. Once mu_w_1, mu_w_2, sigma_w_1, sigma_w_2, and mixt_frac have been calculated, the values of wm, wp2, wp3, and Skw are recalculated using PDF parameters and compared to their original values. Additionally, the test also checks that sigma_w_1 >= 0, sigma_w_2 >= 0, and 0 < mixt_frac < 1.
I have added a feature to the PDF parameter unit tests which allows the user to declare which PDF is being tested.
With this, I have added some code to test the "setter" variable for ADG1 (which is always w). The test loops over incremental values of sigma_sqd_w for each of the PDF input parameter sets, calculates the PDF component means, component variances, and mixture fraction, and then recalculates wm, wp2, wp3, and Skw.
I still have to add code to test the full PDF for ADG1.
In the setter variable description and subprograms, I made a name change from mu_w_1, etc., to mu_x_1, etc. This was done because other variables besides w might be used as the setter variable.
I have updated the method of calculating the setter variable so that mu_x_1 and mu_x_2 are set based on the sign of <w'x'>. This is described in the back pages of the derivation of the method for the setting variable. In a nutshell, sqrt(F_x) is replaced by sqrt(F_x) * sgn( <w'x'> ) in the entire equation set. Most equations use F_x (or an integer power of F_x). Even after the replacement, F_x remains F_x (because the square, etc., of sgn( <w'x'> ) is always 1). The only equations that are altered are the equations for mu_x_1 and mu_x_2. When the sign of <w'x'> is positive, mu_x_1 >= mu_x_2. Otherwise, when the sign of <w'x'> is negative, mu_x_1 <= mu_x_2. When variable x is w, the sign of wp2 is always postive, and mu_w_1 >= mu_w_2, following previous conventions. This change allows for things such as mu_thl_1 <= mu_thl_2 when <w'thl'> < 0 in the event that theta-l is the setting variable.
I got rid of some of the expressions that a script might try to flag as "magic numbers" by doing something that I started a while ago --- declaring those numbers as constant parameters in the code.
I added much more documentation about the responder variable. Specifically, much of the new documentation is about how the limits of F_x are calculated.
I am adding the new file, original_pdf.F90, as the new home for the ADG1, ADG2, and 3D Luhar PDF closures. As of right now, the original code still remains in PDF closure, and this code is not currently interface with any part of CLUBB.
I have now switched the PDF closure code over to calling the code that had been moved to original_pdf.F90 in r8450. The code that remained in PDF closure has now been deleted.
I have also moved the code to calculate the PDF parameters for passive scalars to inside the driver subroutines for ADG1 and ADG2.
The results in GrADS output files from this revision are an exact match to the results in GrADS output files from the previous revision for all cases.
I updated the documentation in the code comments for the setter method and generalized the mixture fraction code so that any variable, x, can be used as the setter variable, not just w.
I added a new function, calc_comp_corrs_binormal, to pdf_utilities.F90. This function calculates the PDF component correlations of two variables that are both distributed as part of a two component normal distribution. The code is a copy of code that was previously found in subroutine pdf_closure. Now, pdf_closure calls this function multiple times over, rather than repeating the same code multiple times in a row.
The results in GrADS output files from this revision are an exact match to the results in GrADS output files from the previous revision for all cases.
I updated the code so that coef_sigma_x_1_sqd and coef_sigma_x_2_sqd are passed out of the subroutine that calculates the PDF parameters for the setter variable.
I moved the calculations of wp2xp (wp2rtp and wp2thlp), wp4, and wpxp2 (wprtp2 and wpthlp2) into their own functions.
At most timesteps, results are exactly the same. On occassion, very, very small discrepancies between the previous version and the new revision show up. The calculations occur with everything in the exact same order as they were performed in previously. They only thing different is passing code out of functions and back to the main program. This odd behavior makes this code technically BIT_CHANGING.
Back in clubb:r8409, the PDF component correlations of w and rt and w and theta-l were calculated rather than assumed to be 0. For ADG1 and ADG2, the resulting values of the correlations were within numerical roundoff error of 0 (for example, 1.0e-14). However, in the interest of trying to keep results in-line as much as possible with historical results, this commitment introduces code to simply set these PDF component correlations to 0 (and avoid the calculation) when the chosen PDF is ADG1 or ADG2. Otherwise, when other PDFs are used, the correlations will be calculated. This commitment is BIT_CHANGING.
I added statistical output for F_w, F_rt, F_thl, min_F_w, max_F_w, min_F_rt, max_F_rt, min_F_thl, and max_F_thl.
The results in GrADS output files from this revision are an exact match to the results in GrADS output files from the previous revision for all cases for all output files besides the *_zt.dat output files. Owing to the new stats, the *_zt.dat output files make this revision BIT_CHANGING.
I split the new PDF into two files. I added a new file that currently houses the driver. The core functions and subroutines of the new PDF remain in the original file.
The Happy Birthday to me CLUBB Trac ticket reference: clubb:ticket:777.
I clipped temperature within the Goff-Gratch functions for saturation over liquid and ice. The goal was to avoid the creation of NaNs that caused CAM to crash over the Himalayas. The result of applying a minimal threshold on temperature is to set saturation to the same small value in all cold areas.
To test the code change, I ran the priority cases and determined that the new code produces bin-diff identical results for these cases. That just means that these cases are not cold. However, the code change might increase saturation in cold areas in CAM, thereby diminishing condensation in the upper atmosphere. It would be prudent to check a WACCM simulation for degradation. If there is degradation, the minimum temperatures could be set to smaller values.
I added code to allow the variable (of w, rt, or theta-l) with the greatest magnitude of skewness be the setter variable (the variable that sets the mixture fraction).
I changed coef_wp2xp_explicit (coef_wp2rtp_explicit and coef_wp2thlp_explicit) to term_wp2xp_explicit (term_wp2rtp_explicit and term_wp2thlp_explicit) because "term" is a more accurate description here than "coef".
I am adding a new file for the new trivariate skewness-dependent analaytic double Gaussian (TSDADG) PDF. I have added an interface in the unit tests, although the standard tests aren't conducted yet.
In order for the TSDADG PDF to work correctly, when Skx * sgn( <w'x'> ) >= 0, l_x_1 > 2/3 and 0 < l_x_2 < 1. However, when Skx * sgn( <w'x'> ) < 0, the limits need to be reversed.
In order to clarify coding in CLUBB, I am moving a block of code that is specific to ADG1 and ADG2 to inside their driver subroutines, rather than keep it outside the driver subroutines, in subroutine pdf_closure, where it is more confusing to someone trying to understand the flow of the code.
I also added the full PDF unit test for ADG1.
The results in GrADS output files from this revision are an exact match to the results in GrADS output files from the previous revision for all cases.
I am fixing a bug where rtp2 and thlp2 (and sclrp2) were not preserved when wp2 became very small. This bug is being fixed by treating the rtp2, thlp2, and sclrp2 distributions as single Gaussians in this limit.
When ADG1 or ADG2 are not used, we have to set alpha_rt, alpha_thl, and alpha_sclr to values (their default values) in order to avoid a runtime error from the Oracle compiler. Previous, we had been adding statements after the call to every non-ADG1-or-ADG2 PDF. I am changing that to do it in one spot, similar to the setting of the F_w, etc. output when the new PDF is used.
I have set the tunable parameters F_x and zeta_x to skewness functions for the new PDF. Coefficients are currently declared in the driver subroutine and then passed into subroutines and functions.
I changed the URL references to the CLUBB-SILHS overview document. Instead of pointing to the larson-group.com webpage, they now point to arxiv.org. The shorter URL forestalls error messages from the CLUBB standards script.
I have added the Lewellen and Yoh (1993) PDF to CLUBB for testing and comparison purposes. It has also been interfaced to CLUBB's unit testing and passes all unit tests.
I added an option to incorporate the buoyancy term into CLUBB's eddy diffusivity for momentum. This option is controlled by the flag l_use_buoy_mod_Km_zm, but that flag is set to false, and so this commit should leave the answers bit for bit identical.
I multiplied the eddy diffusivity for momentum by a skewness-dependent factor that is intended to reduce momentum flux in cumulus layers. The idea is that the cumuli contribute an upgradient flux that is not taken into account by our prior downgradient formulation.
However, the results should be bit-for-bit identical since the flag that implements this, l_use_buoy_mod_Km_zm, is set to false.
I changed the way that F_rt and F_thl are set in the new PDF. They are now set as a constant interpolation between min_F_x and max_F_x (where x is rt or thl), and the F_rt value can be reduced (toward min_F_rt) by exp_factor_rt, which is dependent on the adjusted (overall) correlation of rt and thl.
The adjusted (overall) correlation of rt and thl is:
I updated the call to the new PDF so that Skrt and Skthl are intent INOUT variables. In the scenario that either one (or both) of these skewnesses are clipped in the new PDF, the updated values of Skrt and Skthl are passed out. This is necessary for the PDF parameter unit tests to work properly.
I am adding a new function, calc_wpxpyp_pdf, to pdf_closure_module.F90. This function calculates the <w'x'y'> term that I derived by integrating over the PDF. This function is used to calculate <w'rt'thl'>. Shortly, it will also be used to calculate <w'sclr'rt'> and <w'sclr'thl'>. This new calculation of <w'x'y'> allows for the PDF component correlations involving w to have a value other than 0. This generalizes the calculation for a PDF other than ADG1 or ADG2.
CLUBB's calculation of wprtpthlp in pdf_closure is currently just used for statistical output. For ADG1, the old form and the new form of wprtpthlp produce the same result mathematically. However, owing to numerical roundoff, the results of the wprtpthlp in the new revision are BIT_CHANGING compared to the old revision. Otherwise, the results in GrADS output files for all other outputs from this revision are an exact match to the results in GrADS output files from the previous revision for all cases.
CLUBB Trac ticket reference: clubb:ticket:777 and clubb:ticket:806.
The calculation of higher-order scalar terms <w'^2^ sclr'>, <w'sclr'^2^>, <w'sclr'rt'>, and <w'sclr'thl'> are now generalzed for any PDF type.
For ADG1, the old form and the new form of these scalar terms produce the same results mathematically. However, owing to numerical roundoff, the results of the calculations in the new revision are altered compared to the old revision.
Since scalar calculations aren't output to standard stats, the results in GrADS output files from this revision are an exact match to the results in GrADS output files from the previous revision for all cases.
I implemented a new method to handle cumulus momentum fluxes. It approximates upthvp in terms of dthlm/dz. The old method, based on Skw, has been commented out.
This should not change answers because l_use_buoy_mod_Km_zm = .false.
I am altering the solution to the wp3 predictive equation to calculate the turbulent advection term and the turbulent production term independently.
Mathematically, the code is still the same, but numerically, there will be round-off level differences between the old version and the new version. This revision is BIT_CHANGING. However, plotgen shows that lines for the old version and the new version overlap. The only cases that show any differences are the cases that are traditionally extremely sensitive.
I fixed the problem with the wp3 budgets as a result of r8584. The budgets in the new revision now match (lines overlap) the budgets from r8583.
I also added the l_use_explicit_turbulent_adv flag, which will be used to allow an explicit treatment of the turbulent advection term (for those equations where the turbulent advection term is calculated by integrating over the PDF).
I altered the names of the turbulent advection functions that are closed by the PDF (from integration over the PDF). The current functions have been altered to include ADG1 in their names, because the closure is done by assuming ADG1 is the PDF used.
The results of this revision are an exact match to the results from the previous revision for all cases. However, yesterday's clubb:r8587 changed results without including BIT_CHANGING in the commit message, so that is being added here to reset the appropriate Bitten test.
I added the function that sets up the implicit calculation of the wp3 turbulent advection term for the new PDF. This has not yet been interfaced with the code.
I added a function that calculates the explicit form of the wp3 turbulent advection term to advance_wp2_wp3_module.F90. This option works for any PDF type.
I added the l_explicit_turbulent_adv_* family of flags to the new PDF, for some calculations don't need to be made when turbulent advection is being treated explicitly.
I am packing up the implicit coefficients and explicit terms calculated by the new PDF into a derived type variable. That variable is passed back to advance_clubb_core so it can be used for such things as implicit turbulent advection of wp3, etc. This variable is also passed into the PDF parameter unit tests. There, in the future, it will be used for such things as double checking such things as: wp4 = coef_wp4_implicit * wp2^2^, etc.
Made epss variable based on its use by adding flag l_high_accuracy_parab_cyl_fnc. Low accuracy for runs (epss=1e-4) and high accuracy for tests (epss=1e-15), see clubb:ticket:804
When the l_explicit_turbulent_adv_wp3 flag is enabled, the turbulent advection of wp3 at thermodynamic level 2 is based on wp4 at momentum levels 1 and 2. The value of wp4 at momentum level 1 is calculated by interpolating the values of wp4_zt that is calculated by integrating over the PDF at thermodynamic levels 1 and 2. However, the values that come from the call to pdf_closure at thermodynamic level 1 (the "below ground" level) are unreliable because the inputs are unreliable at that particular level.
The best solution is to simply set wp4 at momentum level 1 to 0. This also matches the value of wp4 at the upper boundary.
By default, CLUBB does not use explicit turbulent advection. However, the results are technically BIT_CHANGING because wp4 is still output to statistics.
I fixed a bug in the calculation of scalar skewness. It was being set to 0, causing problems with the new PDF. I corrected the bug and I also made the scalar skewness code a little more user friendly. It is now controlled by a flag, l_use_xp3_LG_2005_ansatz, which is set to true by default.
In the default ADG1 code, the LG 2005 ansatz is not used interactively. It only outputs to stats. This commit is BIT_CHANGING only because statistics change.
I moved the location of the LG 2005 ansatz to calculate xp3 because it would be more helpful for testing purposes before the first call to pdf_closure_driver (which is the call we use). In default CLUBB, this affects only statistics. However, this change is technically BIT_CHANGING.
I reverted clubb:r8611 because (1) having the code in the other location introduced a bug, and (2) upon further review, it just makes more sense in this location, and is more consistent with the rest of the code.
I have added a new function, term_ta_new_pdf_lhs, to advance_xp2_xpyp_module.F90. This function will handle the implicit turbulent advection for xp2 and the implicit portion of the semi-implicit turbulent advection for xpyp for the new PDF. This code has not yet been interfaced with the rest of CLUBB.
The previous commit, r8614, changed statistical results, but I forgot to put a BIT_CHANGING in the log message, so here it is.
I have added a new file that has two options for handling the xp3 term for scalars (thlp3, rtp3, and sclrp3). Both options are based on the d(xp3)/dt equation. One option predicts xp3 with the turbulent production, accumulation, and turbulent dissipation terms. The other option uses a steady-state approximation (dxp3/dt = 0) and calculates xp3 from the same three terms, since xp3 is found in the turbulent dissipation term.
This has not yet been interfaced with the rest of the CLUBB code. When it is, this code will be one option for calculating xp3, with the other option being the ansatz.
I have interface the new xp3 code to the rest of CLUBB. It can be turned on with the l_advance_xp3 flag in model_flags.F90. It is turned off by default, which means that default CLUBB still continues to use the ansatz to calculate xp3. The results in GrADS output files from this revision are and exact match to the results in GrADS output files from the previous revision for all cases.
Since this commit adds statistics, it is technically BIT_CHANGING. However, the results in GrADS zm, sfc, etc. output files from this revision are an exact match to the results in the same GrADS output files from the previous revision for all cases.
I am adding code that allows the turbulent advection of wpxp to be treated semi-implicitly for the new PDF.
The wpxp code was already split into two sections based on an "if" statement. One section uses a single left-hand side, and the other section uses three left-hand sides (for wprtp, wpthlp, and wpsclrp). The new code has been added to the section with three left-hand sides. For the section with a single left-hand side, dummy variables are passed instead.
The default is to call the single left-hand side, and it will remain that way. When the single left-hand side is called, the new PDF must use explicit turbulent advection. However, since the code was already there for the section with three left-hand sides, it made sense to enter the semi-implicit code in that section. This way, for the new PDF, the semi-implicit turbulent advection can be compared to the explicit turbulent advection to see if there is any downgrade in results. For ADG1, the implicit turbulent advection and the explicit turbulent advection produce very similar results.
Redesigned error code system. Errors are now treated as strictly fatal, meaning they are only thrown by procedures which cannot continue or has detected something that will crash the code. When the error occurs the procedure which detected it should immediately report it and either return to its calling procedure or stop the program, this is to avoid a cascade of error reports due to a single error. Other problems are now reported at level 1 and 2 debugging and only write the error out rather than set a code.
A variable found to be less than zero now only gives a warning rather than setting an error code. Some fatal error checks also changed from debug level 2 to 0 clubb:ticket:800
This is the first part of a two-part change. I am updating plotgen plots so that they contain wpthvp followed by the contribution of cloud water to wpthvp, wp2thvp followed by the contribution of cloud water to wp2thvp, thlpthvp followed by the contribution of cloud water to thlpthvp, and rtpthvp followed by the contribution of cloud water to rtpthvp.
In order to plot the contribution of cloud water, a variable named rc_coef is needed. Previously, this had been output on momentum levels so that it could be used to calculate the contribution of cloud water to wpthvp, thlpthvp, and rtpthvp. However, wp2thvp (and wp2rcp) are thermodynamic-level variables, so the contribution of cloud water to wp2thvp couldn't be plotted because plotgen can't handle variables from two different files (zm and zt) in the same equation.
In order to plot everything, rc_coef needs to be output on both momentum levels and thermodynamic levels. As a first step, I have renamed the previous rc_coef as rc_coef_zm. The variable rc_coef is calculated based mainly on constants. However, the does contain exner, which is a thermodynamic-level variable. Additionally, it is calculated as part of pdf_closure, which is called on thermodynamic levels.
The results in GrADS output files from this revision are an exact match to the results in GrADS output files from the previous revision for all cases. The variable name rc_coef has been changed to rc_coef_zm in all GrADS _zm *.ctl files.
In part 2 of this two part commit, I have added rc_coef to the list of statistical output variables on thermodynamic levels. This will allow plots of the contribution of cloud water to wp2thvp. Since this adds new statistics, this commit is BIT_CHANGING.
Various debug checks added/improved. Negative value checks changed back to throw fatal errors. Parameterization check changes to disclude thermodynamic variables at grid level 1 clubb:ticket:800
Changed error checking if statements to check for equality to clubb_fatal_error rather than inequality to clubb_no_error, makes them more readable clubb:ticket:800
I am generalizing the wprcp, wp2rcp, rtprcp, and thlprcp equations to account for the PDF component correlation of w and rt and the PDF component correlation of w and theta-l. In regards to the PDF transformation, this accounts for the PDF component correlation of w and chi and the PDF component correlation of w and eta.
For the default ADG1 code, the plotgen results overlap for all cases except for the most sensitive ones -- ARM 97, TWP-ICE, and MC3E. For ADG1, the calculations are mathematically the same, but numerical roundoff errors account for any changes, making this commit BIT_CHANGING.
CLUBB Trac ticket references: clubb:ticket:777 and clubb:ticket:806.
Added error header functionality. Using the err_header character array from error_code in a write statment will print out either the thread number or process ID along with CLUBB -- ERROR: . This is mainly to keep track of error messages is multithreaded scenarios clubb:ticket:800
I am adding the semi-implicit formulation of wprtpthlp, which is the turbulent advection term in the rtpthlp predictive equation. This form is specific to the new PDF.
I am adding output statistics for the implicit and semi-implicit coefficients and terms that are used for wp4, wprtp2, wpthlp2, wp2rtp, wp2thlp, and wprtpthlp in the CLUBB predictive equation set.
When the ADG1 PDF is used or when turbulent advection is handled explicitly, a value of 0 is simply output for these fields. However, new fields are now added to the *_zt and *_zm statistical output files, making this change BIT_CHANGING.
Removed failure_test cases from input/case_setups, they neither work properly nor are needed anymore. Added test_fatal_error_handling.bash script which tests for various errors defined by an identifier in the code, more description available in the bash file. Also added more descriptive error output to some parts of code. This change focuses only on output and comments and is BIT IDENTICAL clubb:ticket:800
Removed reference to run_type 'failure_test' as it no longer exists. Added more description to fatal errors produced by calls to xm_wpxp_solve. This change is BIT IDENTICAL clubb:ticket:800
I am fixing a bug with the CLUBB tuner. Variables that were allocated at the start of each CLUBB run were not being deallocated, causing the tuner to crash. I also made some of the code a little bit more easily readable.
Completed the list of variables that get reported from errors within advance_wp2_wp3 and advance_xm_wpxp. Also added a check that outputs an error message when T_in_K is less than 200K in the lowest 10 grid levels, this check is done in subroutine parameterization_check. clubb:ticket:800
I am moving type variable implicit_coefs_terms from new_pdf_main.F90 to pdf_parameter_module.F90. The goal is to use this type variable for all PDF types, not just for the new PDF.
Modified many aspects of the tuner, mostly within esa_driver. Also added check to ensure that C7 and C11 have valid values before the run is tried, this should stop the fire tuning nightly test from crashing. See clubb:ticket:802
I changed the name of type variable new_pdf_implct_coefs_terms to pdf_implicit_coefs_terms in order to help generalize this variable for use with any type of PDF.
I added a flag option to clip the (large, negative) effects of microphysics on rtp2 and thlp2. Right now, this flag is turned off by default, so the results remain the same.
I added a flag option to calculate the minimum threshold for xp2 (rtp2 and thlp2) based on maintaining an overall correlation of w and x that falls between -max_mag_correlation and max_mag_correlation. Right now, this flag is turned off by default, so the results remain the same.
I added a special max magnitude correlation for fluxes wprtp and wpthlp. This variable is called max_mag_correlation_flux and it is set to 0.99 by default (the same value as max_mag_correlation) so results remain the same for now.
Made better esa_driver, made tuner_test to test the driver, added variable range checks. Tried to make the tuner in better in general, but that whole bunch of code needs nothing short of replacement. This commit is bit identical execpt for tuning results, see clubb:ticket:802 for a bunch more information
This commit sets C8b=0.02, changes the non-linear damping on wp3 from Skw^4 to Skw^2, sets C11b=C11, and relaxes Skw_max_mag to 10. These changes are designed to reduce the clipping on wp3 (although the clipping is not eliminated), and to allow greater skewness in cumulus cases without altering the stratocumulus cases. This offers opportunities to increase the contrast between shallow cumulus and stratocumulus in global simulations. This commit is BIT_CHANGING.
Added a flag and moved Skw_max_mag from constants to parameters, this allows the changes made in commit clubb:r8719 to be reverted by modifying the configuration flags and the tunable parameters list, see clubb:ticket:829
I am adding a general purpose function for the turbulent advection of CLUBB's predictive variances and covariances. This is for the momentum-level predictive fields that handle turbulent advection by integrating over the PDF.
Regardless of PDF type, all of these turbulent advection terms can be written in the following form:
This allows for one set of turbulent advection functions that can be reused for multiple variables, for any PDF type, and even for the explicit turbulent advection option. This allows for a much simpler flow of coding, and also has the perk of expanding the "upwind" turbulent advection option to other PDF types (besides ADG1), without adding a whole bunch of specialty functions.
The turbulent advection file that handles turbulent advection for predictive variances and covariances (where turbulent advection is handled by integrating over the PDF) is now set! Functions that handled the LHS (implicit component) and RHS (explicit component) of the turbulent advection term are ready to go!
I added a function to turbulent_adv_pdf.F90, called sgn_turbulent_velocity, that calculates the turbulent velocity for a predictive variance or covariance for use with the "upwind" turbulent advection option.
I am updating the code that advances predictive variances and covariances in advance_xp2_xpyp_module.F90 to use one set of turbulent advection functions for all turbulent advection options (explicit or implicit/semi-implicit based on PDF type, as well as centered or "upwind" discretization").
Along the way, I discovered that the current ADG1 implementation, which is supposed to be using "upwind" discretization, is only using "upwind" discretization for the implicit component of the turbulent advection term, while using centered discretization for the explicit (RHS) component of the turbulent advection term. An "upwind" discretization for the explicit component was never added to the code. I assumed this was an oversight, and an "upwind" discretization for the explicit component of the turbulent advection term was added as part of the new code for this project (in a prior commit). Both implicit and explicit components now use either centered discretization or "upwind" discretization consistently.
Owing to the RHS discretization correct, as well owing to a different order of calculations, this commit is BIT_CHANGING. However, plots of all cases show that the previous revision and the current revision overlap for most cases.
I am updating the code that advances predictive scalar fluxes (<w'x'>) in advance_xm_wpxp_module.F90 to use one set of turbulent advection functions for all turbulent advection options (explicit or implicit/semi-implicit based on PDF type, as well as centered or "upwind" discretization).
For the default ADG1 PDF, the calculations are mathematically the same. However, they occur in a different order in the new code. This makes this revision BIT_CHANGING. However, plots of all cases show that the previous revision and the current revision overlap for most cases. Only the most sensitive cases show differences on the plots.
As a first step toward having code that can clip mean values of hydrometeor concentrations or SILHS sample point values of hydrometeor concentrations, I have made a new subroutine out of the code that clips hydrometeor concentrations. It is not yet interfaced and I haven't deleted the old code yet.
init_pdf_hydromet_arrays_api now sets the value of hydromet_dim as well, this should fix the wrf tests, but doesn't seem to fix cam. clubb:ticket:830 other:ticket:562
I have now interfaced the subroutine that I made out of the code that clips hydrometeor concentrations with the rest of CLUBB, in place of the old code. The results in GrADS output files from this revision are an exact match to the results in GrADS output files from the previous revision for all cases.
I added new code that clips the overall correlation of w and rt or the overall correlation of w and theta-l by increasing wp2 (after advancing wp2) when one of the aforementioned correlations is outside of the range that they're supposed to be in. This code is controlled by a flag, which is turned off by default. The results in GrADS files from this revision are an exact match to the results in GrADS output files from the previous revision for all cases.
I added stats for term_wprtp2_explicit and term_wpthlp2_explicit, which are part of the semi-implicit turbulent advection term for rtp2 and thlp2, respectively. This is used for ADG1 and for the explicit turbulent advection option.
Since new stats are being added, this revision is BIT_CHANGING. However, this is only for *_zt stats files.
I have added code to allow C2 to be adjusted by multiplying by the greater of cloud fraction or a small constant. This code is turned off by default. The results in GrADS output files from this revision are an exact match to the results in GrADS output files from the previous revision for all cases.
I moved the location of the declaration and setting of new model flags to model_flags.F90 so that they could be read in through the configurable model flags namelist.
CLUBB Trac ticket references: clubb:ticket:835 and clubb:ticket:836.
Improved computational speed of windm_edsclrm_rhs and added subroutine. This commit should be BIT_CHANGING as it does calculations in different orders. Only the most sensitive cases have any noticable plot differences. See clubb:ticket:834
Fixed nightly uninitialized variables test. Renamed diffusion_zt_lhs_inner to diffusion_zt_lhs_all, it is now also capable of calculating all values including boundaries now, it's beneficial to calculate the upper boundary value in this case and I imagine other may need the lower boundary calculated as well. Cleaned up windm_edsclrm_rhs A LOT, it's more readable and has clearly ordered steps now. clubb:ticket:834
Actually fixed nightly tests now (hopefully). A loop variable was being used outside a loop, which is an error that passes all the compiler tests. Also the intel compiler config file does not cause errors running if a index variable has not been initialized either, which resulted in correct seeming plots, timing, and output. I'm going to have to be stricter with the testing during these changes as loop variables and such will be often modified, I'll be sure to do a run after compiling with each compiler on top of confirming the output and running the uninitialized variable test manually. Because the last commit fixed the 2nd value of the rhs array the change will be BIT_CHANGING, but the plot output is identical for all but the most sensitive cases. clubb:ticket:834
Optimized the array setup procedures within advance_xp2_xpyp. Added more functions which handle entire arrays at a time rather than single terms to calculate the turbulence, mean advection, and diffusion terms. Because these changes reordered some calculations the results are BIT_CHANGING, but the plots are the same for all but the most sensitive cases. clubb:ticket:834
This should fix the nightly budget test. We may want to look into reducing the redone calculations for the stats code in the future, this lhs/rhs improving endeavour is definitely helping with that but more could be done. clubb:ticket:834 clubb:ticket:837
This commit adds splatting terms to the wp2, up2, and vp2 equations. A tuning parameter, C_wp2_splat, has been added, as well as budget term stats. However, C_wp2_splat still needs to be added to the error.in files. In addition, no splatting effect has been added to the wp3 equation yet.
This commit is BIT_CHANGING, but only because new budget terms have been added to the zm stats. The results are identical because the value of the tuning parameter C_wp2_splat has been set to zero. I spot checked the output from arm_zt.nc, and it was identical to the prior revision except for the inclusion of C_wp2_splat in the new .nc file. Also, the plots looked identical for the priority cases, even the sensitive cases like arm_97.
This commit implements the effects of splatting on wp3. Splatting diminishes wp3 by reducing both vertical motions and skewness near inversions and the ground surface.
This commit adds a new term to the wp3 budget, wp3_splat, and hence is BIT_CHANGING. However, otherwise, the results appear to be bit-for-bit identical; at least, they are for the arm_zt.nc file.
I am making the first step toward committing code that allows for the option of advancing um/upwp and vm/vpwp along with xm/wpxp variables. I have added the l_predict_upwp_vpwp flag and I have modified subroutine advance_windm_edsclrm appropriately. Results in GrADS output files from this revision are an exact match to results in GrADS output files from the previous revision for all cases.
I added code to allow the option of predicting upwp and vpwp by using the advance_xm_wpxp code to predict um and upwp, as well as vm and vpwp, alongside the advancement of other xm and wpxp variables. The option to do this is controlled by the l_predict_upwp_vpwp flag. When the flag is turned off (which it currently is), the traditional code in advance_windm_edsclrm is used for um, vm, upwp, and vpwp.
The results in GrADS output files from this revision are an exact match to the results in GrADS output files from the previous revision for all cases.
I took the liberty of upgrading CLUBB's PDF closure and related code to a vector array rather than a loop over PDF closure over all vertical levels. The majority of the changes were simply promoting single-value variables to vector array variables and changing vertical-level-dependent "if" statements to "where" statements. Otherwise, var_1 = C * var_2 * var_3 works for both single-value variables and vector array variables.
The results in GrADS output files from the current revision were an exact match to the results in GRADS output files from the previous revision for all cases when optimization (for gfortran) was set to -O0 for both the previous revision and the current revision. Likewise, the results in GrADS output files from the current revision were an exact match to the results in GrADS output files from the previous revision for all cases when optimization (for gfortran) was set to -O1 for both the previous revision and the current revision.
However, when optimization (for gfortran) was set to the default value of -O2, the results are not an exact match between the previous and current versions. Some property of vectorizing the code must cause differences when optimization is set higher (-O2 or -O3). This makes this revision BIT_CHANGING.
I updated the monotonic flux limiter to account for vector variables u and v. The monotonic flux limiter can now be used with um/upwp and vm/vpwp. Compared to previous results with l_predict_upwp_vpwp turned on and the call to the monotonic flux limiter omitted for um/upwp and vm/vpwp, the results are an exact match for all cases except ATEX, CGILS S6, CGILS S11, CGILS S12, and MC3E.
The l_predict_upwp_vpwp flag is still turned off, so default CLUBB results remain the same as the previous version.
I am adding two new budget stats, um_mfl and vm_mfl, to CLUBB's zt stats output. I also made small corrections to the upwp and vpwp clipping numbers and I introduced error checking so that l_predict_upwp_vpwp can only currently be used with ADG1 and with implicit turbulent advection.
Since new stats have been added to the zt file, this revision is BIT_CHANGING. However, only the zt stats output files are changed. The remaining stats output files from this revision are an exact match to the previous revision for all cases.
Improved the computational efficiency of the LHS and RHS setup procedures in advance_wp2_wp3_module. This involved changing the order of calculations which casues this commit to be BIT_CHANGING for only the most sensitive cases. See clubb:ticket:834
I am changing the default setting of flags l_min_wp2_from_corr_wx and l_min_xp2_from_corr_wx to true to match what is found in configurable_model_flags.in. This is for #835 in CLUBB GIT Issues.
Modified compute_Cx_fnc_Richardson. Made it a subroutine, modified the algorithm slightly, removed use of allocates and deallocates from it, removed verical_avg call to avoid redoing calculations and precalculated some divides. This saved clubb_core about 8% runtime overall. see clubb:issues:834
Changed the way that init_pdf_params zeros out values as well as a spot in pdf_closure which does the same type of thing. Also changed the debug level for pdf_closure_check to 2. This all saved about 3% overall. see clubb issue 834
Improved computational speed of compute mixing length by modiying the algorithm slightly, avoiding unnecessary divides, and precalculating values. This saves about 6.5% overall. #834
Modified flatau equation which calculates saturation vapor pressure. This was done by modifying the form of the polynomial to allow the cpu to take advantage of out-of-order computations. The new coefficients were obtainted from matlab by finding the roots and multiplying/adding them where I needed to removed the complex numbers. The differences in any values are negligible, and the plots are only affected in the most sensitive cases, but this is BIT_CHANGING. #834
Copied code from linear_interp_factor to linear_interpolated_azt/_azm. This allows those sections of code to become vectorized. Also reversed the calculation order of linear_interpolated_azt allowing for contiguous memory access. This saves about 3% overall and there are no visible differences in the plots when compared to last commit. #834
Changed vertical_avg and vertical_intergral to use dz rather than the inverse, they were dividing by an inverse and divisions are expensive. Also modified vertical_avg algorithm to no longer use vertical_integral, this saves some calculations. #834
Improved efficiency of clip_covar. The only change is saving the result of max_mag_corr * sqrt( xp2(k) * yp2(k) ) rather than calculating it three times. #834
I made the surface splatting terms conservative. That is, I subtracted from wp2_sfc when splatting adds to up2_sfc and vp2_sfc, in such a way that the sum is unchanged. To avoid temporal noise, I needed to preserve the realizability of wpthlp_sfc and wprtp_sfc, rather than allowing wp2_sfc to be clipped all the way down to w_tol_sqd.
Because I added clipping on thlp2_sfc and rtp2_sfc, this commit is BIT_CHANGING, but only for the most sensitive cases.
I added clipping on up2 and vp2 that prevents these fields from exceeding 1000 m^2/s^2. The same sort of clipping already exists for wp2. With the splatting terms active, I found a configuration of twp_ice where the clipping on up2 and vp2 is useful.
However, in the standard configuration, none of the priority cases changes answers because none have up2 and vp2 > 1000.
This commit turns on splatting of thermals (i.e., C_wp2_splat is nonzero). Hence it is BIT_CHANGING.
To prevent noise in the vertical profiles, the splatting terms needed to be clipped. Unfortunately, this will introduce some undesired dependence on time step. At some point, we may wish to treat the splatting terms in a semi-implicit way.
To make the splatting terms more effective, the return-to-isotropy coefficient (C4) has been reduced. This puts it more in accord with standard values, and it allows CLUBB to be more anisotropic. Other coefficients were also retuned.
Along the way, I broke up some comment lines to avoid a warning about line length. Also, I commented out the check on the presence of the Id tag. That tag is no longer useful because CLUBB has moved from svn to git.
Added functionality to allow cloud_frac to be better estimated at extreme values which produce either 0 or 1 when computed. The amount of estimation is controlled by the variable max_num_stdevs, indicating the number of standard deviations away from the mean of a pdf a value can be before being considered statistically insignificant. This speeds up the code but reducing the calculations required in calc_cloud_frac_component and calc_xprcp_component, and avoiding underflow errors when computing exponentials with too small of a number. By comparing plots and mathematical evaluation (erf(5)~=0), it seems the best value for max_num_stdevs is 5. This increases computational efficiency by about 10% #834
I clipped sigma_sqd_w to prevent interpolated values of it from going negative. This avoids crashes in the lba, twp_ice, and mc3e cases when l_call_pdf_closure_twice = .true. Small negative values in sigma_sqd_w were causing small negative values of varnce_w_1 and varnce_w_2 at the lowest grid level, which then caused floating point exceptions in the pdf closure. l_call_pdf_closure_twice = .true. is not the default setting, but it is the setting in CAM6. Hopefully this code change will help allow the new version of CLUBB to be backwards-compatible with the CAM6 version.
A few numbers in the output did change in the last digit or two in the arm_97 case. Maybe it was only sigma_sqd_w itself that was changing, and that value wasn't used anywhere? Anyway, technically, this commit is BIT_CHANGING.
I added a new option to diagnose the dissipation time scale, tau, first and then use it to diagnose the mixing length, Lscale, as Lscale = tau * tke. The purpose is twofold: 1) reduce computational expense of computing Lscale; and 2) increase tau near the ocean surface, in the hopes of improving hurricane surface winds.
The option is currently turned off with the flag l_diag_Lscale_from_tau, and so the results are an exact match to those produced by the prior code.
I found a new way to diagnose upthvp. Instead of using a bound on correlations, it relies on the formula upthvp = upthlp + 200 K uprtp + 2000 K uprcp. upthlp and uprtp are then diagnosed based on a budget equation from Andre et al. The new formula produces more upthvp aloft, where upwp is small. The budget of upwp for the BOMEX case looks plausible.
I also discovered that when upthvp is better diagnosed, then the upwp_pr4 term is unnecessary. So I zeroed it out for now.
I am briefly changing some of the flag and parameter settings in CLUBB to match what is currently used by CAM. This change will be undone with the next trunk (master) commit.
I added a couple of comments reminding users to change the conditions in the SILHS check if the conditions change in the calculation of cloud fraction in PDF closure.
Revert "Revert "I am briefly changing some of the flag and parameter settings in CLUBB""
This reverts commit 7e8b4f7f20f25bccdbcaca0fccb970d793518133.
I am briefly re-setting the CAM-specific flag and parameter settings for CLUBB for use in CAM-CLUBB. I am going to make (another) tag of this revision, and then again revert this revision.
I committed a subroutine, diagnose_upxp, that calculates upthlp, uprtp, vpthlp, vprtp using a simple diagnostic version of Eqn. 7 of Andre et al. (1978). Ultimately, CLUBB will use this in order to compute the buoyancy terms in the upwp and vpwp budgets.
The results match the prior repo results bit for bit if, in the prior code, I pull tau_C6_zm inside the parentheses in the prior calculation of upthlp and uprtp: upthvp = - 0.3_core_rknd * tau_C6_zm * ( upwp * ddzt( thlm ) + wpthlp * ddzt( um ) & + 200.0_core_rknd * ( upwp * ddzt( rtm ) + wprtp * ddzt( um ) ) ) & This is needed to avoid a change in the order of operations, which changes the results in IEEE arithmetic. I also need to set C6=1 and C7=0 in subroutine diagnose_upxp.
However, what I am committing includes C6 and C7 in subroutine diagnose_upxp. It doesn't change the results much, but nevertheless the results are BIT_CHANGING. In addition, four new stats are added to all_stats.in and standard_stats.in: upthlp, uprtp, vpthlp, and vprtp.
Improved the computational efficiency of pdf_closure. This speed the code up by about 6% overall. Because it changed the order of some calculations it is BIT_CHANGING but does not change plots. clubb issue #834
I am modifying one part of setup_clubb_pdf_params.F90 to be taken out of a large outer "do" loop over all vertical level, and instead, promote single-level variable declarations to arrays and use where...elsewhere statements rather than else...elseif statments. The part of setup_clubb_pdf_params.F90 that is being modified is the part of the code that calculates the PDF component (in-precip) means and (in-precip) standard deviations of hydrometeor species for the hydrometeor portion of the PDF. This is being done in an effort to speed up CLUBB. This does not pertain to CLUBB core, but it does pertain to analytic KK or SILHS cases.
When the gfortan optimization level is decreased to -O0 or -O1, the results in GrADS output files from this revision are an exact match to the results in GrADS output files from the previous revision for all cases. When the gfortran optimization level is left at the current default of -O2, the results remain an exact match for many cases, including some that use upscaled KK or SILHS, but results change for ARM 97, DYCOMS-II RF02 DO, ASTEX A209, TWP-ICE, and MC3E, which tecnically makes this revision BIT_CHANGING.
I am updating the code within setup_clubb_pdf_parameters.F90 in order to take more code out of the outer loop over all vertical levels and internally promote scalars to vectors. This is designed to speed up the code for analytic KK or SILHS runs.
The results in GrADS output files from this revision is an exact match to the results in GrADS output files from the previous revision for all cases.
To diagnose uprcp using CLUBB's PDF machinery, I fed some variables related to horizontal wind through some argument lists. The code change is incomplete at this point. The results do not change because the variables are declared locally in subroutine pdf_closure, and nothing is done with the output, uprcp. The wind variables are not even initialized at this point. Nonetheless, the results of the arm case are bit-for-bit identical with the prior results. The units tests still pass.
Continuing with diagnosis of uprcp using CLUBB's PDF, I fed the arguments through subroutine pdf_closure. I have yet to feed them through pdf_closure_driver. For the arm case, the results are bit-for-bit identical.
More code to diagnose uprcp using CLUBB's PDF. I fed the relevant arguments through pdf_closure_driver and advance_xm_wpxp. The results are still bit-for-bit identical because uprcp does not (yet) interact with the rest of the code. I put some idiot-proofing in setup_clubb_core because the arguments have not yet been fed through advance_clubb_core and preserved from time step to time step. The unit tests passed.
Correction for the last uprcp-related commit: uprcp_zt is now interpolated to the zm levels in the case in which the pdf closure is called only once. The answers are still bit-for-bit identical.
I am correcting the code so that the Nightly Uninitialized Variables Test (Oracle Fortran) works correctly again.
I've noticed that FORTRAN's where statement doesn't always prevent a certain part of a where ... elsewhere block from being entered in the same way that it prevents a certain part of an if ... elseif block from being entered. Code that is not supposed to be entered under certain conditions gets entered and then the mask is applied later, throwing away the results. However, if the intrusion causes a floating point exception for whatever reason, the run stops.
I remember overhearing talk between Gunther and Vince about the where statement "guessing" wrong sometimes. Is there a way to stop it from "guessing" wrong or at least reduce the number of wrong "guesses"?
I am continuing to pull parts of setup_pdf_parameters outside of a large "do" loop over all vertical levels and promote subroutines that are called from setup_pdf_parameters to cover the whole array of vertical levels, rather than just one level at a time. This code change is simply for a statistical output subroutine (pdf_param_hm_stats) within setup_pdf_parameters. This all is in an effort to speed up the code.
This revision outputs stats at thermodynamic level 1 (which is below the model surface), whereas the subroutine wasn't previously called at level 1. This makes the results BIT_CHANGING, but only for the stats that are output at level 1 of the zt output files. The results in other GrADS output files (zm, sfc, etc.) from this revision are an exact match to the results in the same GrADS output files from the previous revision for all cases.
I am pulling statistical output subroutine pdf_param_ln_hm_stats outside of the large "do" loop in setup_pdf_parameters. This is part of a larger code speed-up effort.
The results in GrADS output files from this revision are an exact match to the results in GrADS output files from the previous revision for all cases.
Changing the range of the correlation values determined in calc_comp_corrs_binormal from [ -1.0, 1.0 ] to [ -0.99, 0.99 ] (based on value of max_mag_correlation = .99). This is the subroutine that calculates corr_rt_thl_x and should fix the issue with the WRF WPS Katrina bitten test as discussed in the commets of commit ad0ee5b9b3c253329df1208560b46d1dc4fca1c2. I suspect that it will fix the WRF-CLUBB-SILHS Restart Test as well, but I am basing that mostly off hope.
I have changed the structure of setup_pdf_parameters so that the subroutine that packs up the hydrometeor PDF parameters, subroutine pack_hydromet_pdf_params, is called from outside the loop over all vertical levels. Within pack_hydromet_pdf_params, variables have been promoted to arrays over all vertical levels. This leaves the reamining outer loops over all vertical levels to include only a few subroutines (diagnosing correlations and the Cholesky stuff).
The results in GrADS output files from this revision are an exact match to the results in GrADS output files from the previous revision for all cases.
I am turning on the new calculation of uprcp that uses CLUBB's PDF. Also, I am re-introducing the pressure term upwp_pr4, because it is a useful preconditioner for producing an upgradient flux in upwp. This commit is BIT_CHANGING both because the answers change and because new outputs (uprcp, upthvp, ...) are written to disk. The gabls3_night case is degraded, but the other cases look comparable or better than before.
I modified the code in setup_clubb_pdf_params.F90 to use only one call to function pdf2hydromet_idx or function hydromet2pdf_idx within a loop, instead of multiple calls within array indices for different variables. This cuts down on excessive calls and also makes the code a little more nicely readable.
The results in GrADS output files from this revision are an exact match to the results in GrADS output files from the previous revision for all cases.
I am updating CLUBB_core and SILHS in the clubb_E3SM_silhs branch to match the clubb and silhs directories in the bmg929/atm/clubb_silhs_v2 branch of E3SM. This commit can be considered a list of modifications that were done to the CLUBB code in the clubb_silhs branch of E3SM.
It should be noted that the version of CLUBB used in the clubb-silhs branches of E3SM is r8220.
This commit provides a base to marge up CLUBB and SILHS to more current versions for use in E3SM CLUBB-SILHS.
I am setting model flags and tunable parameters in the clubb_E3SM_silhs branch in a backwards-compatible fashion to r8220, which was the version of CLUBB and SILHS that was previously used in E3SM-CLUBB-SILHS.
I temporarily set l_clip_extreme_chi_sample_pts back to false in the clubb_E3SM_silhs branch. This is being done to test for backwards compatibility while upgrading E3SM-CLUBB-SILHS. The goal is to produce a version of SILHS that is similar in all ways to the version of SILHS that was found in r8220.
Once the merger is complete, this flag will likely be reset back to true.
I am making the first step for updating the code that calculates sigma_sqd_w. I have included upwp^2/(up2*wp2) and vpwp^2/(vp2*wp2) in the calculation of the maximum squared correlation for the limit of sigma_sqd_w when the l_predict_upwp_vpwp flag is enabled.
When the l_predict_upwp_vpwp flag is turned off, the results in GrADS output files from this revision are an exact match to the results in GrADS output files from the previous revision for all cases.
When the l_predict_upwp_vpwp flag in enabled (which it is by default), this revision is BIT_CHANGING. However, only a couple of cases show visible changes on the plots.
I added a log-law height dependence to the code that diagnoses tau directly, rather than diagnosing the mixing length, Lscale (l_diag_Lscale_from_tau = .true.). However, that option is set to .false. by default, and hence the nightly test results should be unchanged.
I added a new python script, check_for_missing_threadprivate.py, which checks whether a module variable in CLUBB or SILHS has been declared but not designated as a threadprivate. In such a case, the variables are not thread safe and different threads may store a variable in the same memory location, causing errors. In particular, such an omission may cause CAM-CLUBB-SILHS to produce different results when different numbers of openmp threads are selected.
I then added some threadprivate statements in order to make the test pass.
Modifying clubb's pdf_parameter type. It's now a type containing arrays, whereas before it was a type containing scalars, but used everywhere as an array of these types. This new way allows the elements of pdf_parameter to exist in contiguous memory sections, which improves computational efficiency when accessing a given parameter over all vertical levels. clubb issue #834
Fixed dycoms restart run failure. The pdf_parameter variables are accessed via a use statement in the section of code where the restart run attempts to set their values, but since they are allocatable they do not retain their allocated status once out of scope. Adding the save attribute to pdf_params and pdf_params_zm fixes the problem. These pdf_parameter variables used in clubb standalone are not used by host models, yet they are still allocated during host model runs, something that has been noted before and will be changed. clubb issue #834
Optimizing procedures within Skx_module. The reduction in runtime is greatly dependent on system and compiler option. See clubb issue #855 and comment by Gunther on 7-1-19 for explanation. This is BIT_CHANGING but the plots only differ in the sensitive cases.
ticket #842 we added 4 tunable parameters for tau, they are Coefficient of inverse tau term contributed by background constant value, Coefficient of inverse tau term contributed by surface log law, Coefficient of inverse tau term contributed by vertical wind shear and Coefficient of inverse tau term contributed by Brunt Vaisala frequency
Modifying ADG1_ADG2_responder_params for efficiency reasons. It changes the way varnce_x_(1/2) is set when wp2 > w_tol_sqd and xp2 <= x_tol. Previously in that case it set the variances to 0, but now it sets them to xp2 since xp2 ~= 0 in that case anyway. This allows the where statement to have only two cases, and less cases is more efficient. This is BIT_CHANGING, but only affect the sensitive cases and passes the G unit tests. larson-group/clubb#855
Replacing the local variables used in pdf_closure_module with references to the variables in pdf_params which they are meant to be stored in. This removes the need to copy the local variables into the pdf_params structure at the end, saving about 3% runtime. This is not bit changing, but does make the code a little uglier. larson-group/clubb#855
Removing gmres code. The files gmres_wrap.F90, gmres_cache.F90, and csr_matrix_module.F90 have been removed, and any sections of code which refer to or are needed only for gmres have been removed as well. larson-group/clubb#855
issue #842 We added two new tunuable parameters: C_invrs_tau_N2_xp2 and C_invrs_tau_N2_wp2. e.g. invrs_tau_wp2_zm = invrs_tau_zm_simp + C_invrs_tau_N2_wp2 * sqrt( max( zero_threshold,zt2zm( zm2zt( brunt_vaisala_freq_sqd ) ) - 1e-4_core_rknd) ). Correspondingly, invrs_tau_wp2_zm and invrs_tau_xp2_zm are used in advance_wp2_wp3 and advance_xp2_xpyp respectively. Also, tau_wp2_zm and tau_xp2_zm are added in output list.
We added two new tunuable parameters: C_invrs_tau_N2_xp2 and C_invrs_tau_N2_wp2. e.g. invrs_tau_wp2_zm = invrs_tau_zm_simp + C_invrs_tau_N2_wp2 * sqrt( max( zero_threshold,zt2zm( zm2zt( brunt_vaisala_freq_sqd ) ) - 1e-4_core_rknd) ). Correspondingly, invrs_tau_wp2_zm and invrs_tau_xp2_zm are used in advance_wp2_wp3 and advance_xp2_xpyp respectively. Also, tau_wp2_zm and tau_xp2_zm are added in output list. issue #842
We added two new tunuable parameters: C_invrs_tau_N2_xp2 and C_invrs_tau_N2_wp2. e.g. invrs_tau_wp2_zm = invrs_tau_zm_simp + C_invrs_tau_N2_wp2 * sqrt( max( zero_threshold,zt2zm( zm2zt( brunt_vaisala_freq_sqd ) ) - 1e-4_core_rknd) ). Correspondingly, invrs_tau_wp2_zm and invrs_tau_xp2_zm are used in advance_wp2_wp3 and advance_xp2_xpyp respectively. Also, tau_wp2_zm and tau_xp2_zm are added in output list. issue #842
We added two new tunuable parameters: C_invrs_tau_N2_xp2 and C_invrs_tau_N2_wp2. e.g. invrs_tau_wp2_zm = invrs_tau_zm_simp + C_invrs_tau_N2_wp2 * sqrt( max( zero_threshold,zt2zm( zm2zt( brunt_vaisala_freq_sqd ) ) - 1e-4_core_rknd) ). Correspondingly, invrs_tau_wp2_zm and invrs_tau_xp2_zm are used in advance_wp2_wp3 and advance_xp2_xpyp respectively. Also, tau_wp2_zm and tau_xp2_zm are added in output list. issue #842
We added two new tunuable parameters: C_invrs_tau_N2_xp2 and C_invrs_tau_N2_wp2. e.g. invrs_tau_wp2_zm = invrs_tau_zm_simp + C_invrs_tau_N2_wp2 * sqrt( max( zero_threshold,zt2zm( zm2zt( brunt_vaisala_freq_sqd ) ) - 1e-4_core_rknd) ). Correspondingly, invrs_tau_wp2_zm and invrs_tau_xp2_zm are used in advance_wp2_wp3 and advance_xp2_xpyp respectively. 1. Some typos are corrected. 2. New tunuable parameters are added in files named errer_$casename.in (issue #842)
We added two new tunuable parameters: C_invrs_tau_N2_xp2 and C_invrs_tau_N2_wp2. e.g. invrs_tau_wp2_zm = invrs_tau_zm_simp + C_invrs_tau_N2_wp2 * sqrt( max( zero_threshold,zt2zm( zm2zt( brunt_vaisala_freq_sqd ) ) - 1e-4_core_rknd) ). Correspondingly, invrs_tau_wp2_zm and invrs_tau_xp2_zm are used in advance_wp2_wp3 and advance_xp2_xpyp respectively. 1. Some typos are corrected. 2. New tunuable parameters are added in files named errer_$casename.in (issue #842)
We added two new tunuable parameters: C_invrs_tau_N2_xp2 and C_invrs_tau_N2_wp2. e.g. invrs_tau_wp2_zm = invrs_tau_zm_simp + C_invrs_tau_N2_wp2 * sqrt( max( zero_threshold,zt2zm( zm2zt( brunt_vaisala_freq_sqd ) ) - 1e-4_core_rknd) ). Correspondingly, invrs_tau_wp2_zm and invrs_tau_xp2_zm are used in advance_wp2_wp3 and advance_xp2_xpyp respectively. 1. Some typos are corrected. 2. New tunuable parameters are added in files named errer_$casename.in (issue #842)
Efficiency improvements to calc_turb_adv_range, more specifically the parts which split w into upward and downward components. This adds a case to zero out upward and downward components for values of w that are too small to matter, and now utilizes mkl_vml math functions to improve vectorization. These mkl_vml functions are only used when compiled with MKL, specified by adding -DMKL to compiler configuration files. This is BIT_CHANGING, plots only differ in the usual sensitive cases, and the budgets, G_unit_tests and time step tests all pass. larson-group/clubb#855
This should fix the uninitialized variables test. mean_vert_vel_up_down was using the upper and lower grid levels, but calc_mean_w_up_down_component was not setting them. These levels aren't actually used by the algorithm in calc_turb_adv_range, but I made calc_mean_w_up_down_component set them to zero anyway since it seems like the simplest and safest solution. larson-group/clubb#855
Adding comment because commit 561fa037e7c3c326bc4bd71b6fc486e5d2a46065 was BIT_CHANGING, but missing the commit message specifying that. It was bit changing because the upper and lower levels of mean_w_up and mean_w_down are being output to stats as of commit 0b3ec0d5fc4b89b4a6f34964af3cfda8cb89b9f7, so changing the upper and lower level values changed the stats output, even though those values are not used in any calculations.
Changing ADG1_ADG2_responder_params to use a do loop with ifs instead of a where statement. This is about 1.5% faster and is bit identical. larson-group/clubb#855
Pulling the calculation of p_in_Pa(_zm) out of the vertical loop in update_pressure, and precalculates one/kappa. This improved vectorization capabilities of the calculation of exponents, which is slow so that's important. Also added the option to use MKL_VML functions if -DMKL is specified, which is slightly more efficient. This saves about 1.5-2.5% and is bit identical if not using MKL. larson-group/clubb#855
Renaming width_factor to width_factor_1 to indicate that it is intended for use with the first pdf component, (two-width_factor_1) is the value for the second component. larson-group/clubb#855
Efficiency improvements to transform_pdf_chi_eta_component. Moving the where statement to if statement inside loop to avoid sqrt operations. Reducing number of divide operations, and putting some code in a loop which reduces cache misses. This is BIT_CHANGING, but not answer changing, plots only differ slightly in the most sensitive cases. larson-group/clubb#855.
Modifying calc_cloud_frac_component to optionally use mkl_vml functions. Added a different version of the procedure to handle the liquid cloud fraction specifically, so the ice_supersat_frac could remain as is. The structure of the procedure when using the MKL functions is based on the changes to calc_turb_adv_range in commit 0b3ec0d5fc4b89b4a6f34964af3cfda8cb89b9f7, since I've already tested that well and it seems to make sense to keep the code similar if it does similar things. This reduces runtime by about 2% when using MKL functions and about 0.5% otherwise. The procedures also use precalculated inverses where possible, so the results are BIT_CHANGING, but not answer changing. larson-group/clubb#855
Refactoring the lhs and rhs setup procedures for xm_wpxp. There are a number of lhs terms that are very general, and used by all the lhs matricies. The code now calculates these terms in a new procedure calc_xm_wpxp_lhs_terms and passes those terms into the lhs setup. The same sort of thing is done with the first pressure terms and turbulent advection terms, those terms are shared between pairs of lhs/rhs calls. This is BIT_CHANGING, but is not answer changing. See comment on Jul 3 on ticket larson-group/clubb#855
I switched on direct diagnosis of tau rather than Lscale. That is, I set l_diag_Lscale_from_tau = .true. Thus, this commit is BIT_CHANGING.
Because diagnosing tau changes answers, I retuned CLUBB, taking the opportunity to add some features seem better justified. For instance, we now damp wp2 using tke (l_damp_wp2_using_em = .true.) because doing so is more standard in turbulence modeling and because it may help reduce damping on Sc clouds. C7 is allowed to become larger in statically stable layers (l_use_C7_Richardson = .true.) because that is what the LES of Heinze show, and because doing so might help limit gravity waves above cloud.
Many parameters have been retuned. I set C2rtthl = C2rt = C2thl because it seems more justifiable and because doing so produces the correct sign of wprtp_bp in Cu layers. Also, the "b" parameters have been set equal to the non-"b" parameters in order to reduce the number of tunable parameters. The "b" parameters were based on skewness, which is hard to control and tune. Instead, with this revised version, the tuning parameters are based mostly on thlm, which is more robust. I set C15=0 because this term is complex and hard to justify. c_K8 was increased because it smooths the solutions without dominating the wp3 budget. beta was reduced in order to make wp2xp larger and wpxp2 smaller.
I included a bug fix to Cx_fnc_Richardson, which prevents C7 and C11 from exceeding the maximum set by Cx_max.
The brunt vaisala frequency is reduced for slightly stable layers in order to allow Sc layers to remain well mixed.
Further tuning is needed to reduce oscillations and temporal noise. Also, the momentum fields --- upwp, vpwp, up2, and vp2 --- need to be retuned. Otherwise, the results are comparable to the prior default.
We're expecting a speed-up of 10% to 15% because computing CLUBB's mixing length directly is so costly.
I switched on direct diagnosis of tau rather than Lscale. That is, I set l_diag_Lscale_from_tau = .true. Thus, this commit is BIT_CHANGING.
Because diagnosing tau changes answers, I retuned CLUBB, taking the opportunity to add some features seem better justified. For instance, we now damp wp2 using tke (l_damp_wp2_using_em = .true.) because doing so is more standard in turbulence modeling and because it may help reduce damping on Sc clouds. C7 is allowed to become larger in statically stable layers (l_use_C7_Richardson = .true.) because that is what the LES of Heinze show, and because doing so might help limit gravity waves above cloud.
Many parameters have been retuned. I set C2rtthl = C2rt = C2thl because it seems more justifiable and because doing so produces the correct sign of wprtp_bp in Cu layers. Also, the "b" parameters have been set equal to the non-"b" parameters in order to reduce the number of tunable parameters. The "b" parameters were based on skewness, which is hard to control and tune. Instead, with this revised version, the tuning parameters are based mostly on thlm, which is more robust. I set C15=0 because this term is complex and hard to justify. c_K8 was increased because it smooths the solutions without dominating the wp3 budget. beta was reduced in order to make wp2xp larger and wpxp2 smaller.
I included a bug fix to Cx_fnc_Richardson, which prevents C7 and C11 from exceeding the maximum set by Cx_max.
The brunt vaisala frequency is reduced for slightly stable layers in order to allow Sc layers to remain well mixed.
Further tuning is needed to reduce oscillations and temporal noise. Also, the momentum fields --- upwp, vpwp, up2, and vp2 --- need to be retuned. Otherwise, the results are comparable to the prior default.
We're expecting a speed-up of 10% to 15% because computing CLUBB's mixing length directly is so costly.
I switched on direct diagnosis of tau rather than Lscale. That is, I set l_diag_Lscale_from_tau = .true. Thus, this commit is BIT_CHANGING.
Because diagnosing tau changes answers, I retuned CLUBB, taking the opportunity to add some features seem better justified. For instance, we now damp wp2 using tke (l_damp_wp2_using_em = .true.) because doing so is more standard in turbulence modeling and because it may help reduce damping on Sc clouds. C7 is allowed to become larger in statically stable layers (l_use_C7_Richardson = .true.) because that is what the LES of Heinze show, and because doing so might help limit gravity waves above cloud.
Many parameters have been retuned. I set C2rtthl = C2rt = C2thl because it seems more justifiable and because doing so produces the correct sign of wprtp_bp in Cu layers. Also, the "b" parameters have been set equal to the non-"b" parameters in order to reduce the number of tunable parameters. The "b" parameters were based on skewness, which is hard to control and tune. Instead, with this revised version, the tuning parameters are based mostly on thlm, which is more robust. I set C15=0 because this term is complex and hard to justify. c_K8 was increased because it smooths the solutions without dominating the wp3 budget. beta was reduced in order to make wp2xp larger and wpxp2 smaller.
I included a bug fix to Cx_fnc_Richardson, which prevents C7 and C11 from exceeding the maximum set by Cx_max.
The brunt vaisala frequency is reduced for slightly stable layers in order to allow Sc layers to remain well mixed.
Further tuning is needed to reduce oscillations and temporal noise. Also, the momentum fields --- upwp, vpwp, up2, and vp2 --- need to be retuned. Otherwise, the results are comparable to the prior default.
We're expecting a speed-up of 10% to 15% because computing CLUBB's mixing length directly is so costly.
I updated the pressure initialization for cases that use sounding that is given in terms of pressure coordinates so that the initial profile of pressure is consistent with the pressure update code. This code is BIT_CHANGING for cases that use pressure coordinates in their soundings (MC3E, TWP-ICE, and the CGILS cases).
I changed the function calculate_thvm from a pre-defined vector of size nz to an elemental function. The results in GrADS output files from this revision are an exact match to the result in GrADS output files from the previous revision for all cases.
A quick test of running BOMEX 5 times both before and after the changes showed a 1.16% speed increase for the new version with the elemental function.
I updated the calculation of thvm in advance_clubb_core to use the calculate_thvm function. The results in GrADS output files from this revision are an exact match to the results in GrADS output files from the previous revision for all cases.
Adding SAVE attribute to some stats variables, as it was causing compiler errors when using the newest version of the gfortran compiler. Also commenting out Lapack library dependency from gfortran config file, this required additional Lapack source files be added. Now, no Lapack library files are required to compile CLUBB, whereas before, the source was being compiled, but the missing dependencies we're being added from libraries. This is BIT_CHANGING in all cases when using the gfortran compiler, but only in some cases when using the ifort compiler. Some plots, such as rico, are noticably different when compiled with gfortran, but are bit identical when compiled with ifort. The intel implementation of Lapack used by the ifort compiler must be more similar to the source Lapack than was the Lapack library that was being used for the gfortran compiler.
Adding a subroutine in advance_xp2_xpyp to calculate the turbulent advection terms and modying the rhs and lhs setup procedures to accept these turbulent advection terms as inputs. Before, the turbulent advection terms were calcualted within the rhs and lhs setup procedures, but this resulted in expensive redundant calculations. larson-group/clubb#855
Changing where statement that was causing floating point errors to a do with if's. This should allow code compiled with the newest version of gfortran to run to completion for microphysics enabled cases. This is BIT_CHANING in microphysics cases, but the values of the output arrays of the only changed subroutine only differ starting around roughly the 13th decimal place. larson-group/clubb#859 larson-group/sys_admin#626
I am committing a test where I changed subroutine ADG1_w_closure from using nested where statements to using if statements within the context of an elemental subroutine. My notes are below:
says that using FORTRAN ELEMENTAL subroutines and functions is just as fast as using FORTRAN serial loops with -O3 optimization (which is what we've been doing for optimization).
The use of elemental subprograms contains many advantages:
1) The subprogram becomes much more versatile, because it can be used for scalars as well as arrays of varying sizes and dimensions.
2) In our case, the changesets become easier to follow, as they are basically a change from where statements to if ... then statements. There are no additional do loops and loop indices needed. These additional statements and indices can be confusing when comparing code differences and they clutter-up (a.k.a. uglify) subprograms.
3) The article states that this method should be just as fast for vectors of size 1000 and less. For CLUBB, this would be the number of height levels, which don't normally exceed 128. I tested the old version (where statements) and the new version for multiple runs of BOMEX and ARM, and the timings were equivalent.
4) This avoids the problem of code entering the portion of a "where" statement that it shouldn't be and crashing when floating point trapping is enabled.
The use of elemental subprograms has the following limitations:
1) All input and output variables must be of the same size and dimension.
In other words, whatever code is calling the elemental subroutine must feed it, as well as take as output, either all scalar values, or all vectors of size nz, or all 2-D arrays of size nx by ny, etc.
2) Elemental subprograms are also pure subprograms, so they have all the restrictions of pure subprograms (no print statements, etc.).
Changing determination of threshold used to clip large values of rtp2. Before it was possible that this large value clipping introduced a value before tolerance, if rtm was too small. Causing addition problems and potentially crashes. This is BIT_CHANGING. larson-group/clubb#862
Adding more Lapack source files, and a new file to interface with Lapack routines in general. This allows us to call a general interface procedure that can handle single or double precision routines. This should fix the ifort bug we've been seeing, and should be a more robust way to handle this double/single precision situation in general. Works with all compilers, and in single or double precision, producing bit identical results. See larson-group/clubb#861
Adding blunt clipping to below ground level of xm variables, keeping their value at least tolerance. This prevents the crashing of mc3e caused by rtm being < 0. This is BIT_CHANGING, but only for mc3e, and the plots are very similar. Which must mean that mc3e is our only case where rtm becomes too small. larson-group/clubb#862
This commit is BIT_CHANGING. It is mainly because 1) We changed the equation of tau_xp2_zm, producing a better agreement with LES. 2) Many parameters have been retuned. We reduce nu2 and c_k2, because they bring us stronger scalar variances,especially for RFO1. We set C1=1, because it helps to reduce wp2 near cloud top. We also set C6=2 to generate stronger fluxes etc. Some other changes were made in this commit. They are 1) we modified subroutine calc_brunt_vaisala_freq_sqd by adding brunt_vaisala_freq_sqd_mixed, although brunt_vaisala_freq_sqd_dry is still used as default. 2) cloud fracting was considered in brunt_vaisala_freq_sqd as well as compute_Cx_Fnc_Richardson. 3) C_invrs_tau_N2_wpxp was added as a new parameter.
This commit is BIT_CHANGING. It is mainly because 1) We changed the equation of tau_xp2_zm, producing a better agreement with LES. 2) Many parameters have been retuned. We reduce nu2 and c_k2, because they bring us stronger scalar variances,especially for RFO1. We set C1=1, because it helps to reduce wp2 near cloud top. We also set C6=2 to generate stronger fluxes etc. Some other changes were made in this commit. They are 1) we modified subroutine calc_brunt_vaisala_freq_sqd by adding brunt_vaisala_freq_sqd_mixed, although brunt_vaisala_freq_sqd_dry is still used as default. 2) cloud fracting was considered in brunt_vaisala_freq_sqd as well as compute_Cx_Fnc_Richardson. 3) C_invrs_tau_N2_wpxp was added as a new parameter.
This commit is BIT_CHANGING. It is mainly because 1) We changed the equation of tau_xp2_zm, producing a better agreement with LES. 2) Many parameters have been retuned. We reduce nu2 and c_k2, because they bring us stronger scalar variances,especially for RFO1. We set C1=1, because it helps to reduce wp2 near cloud top. We also set C6=2 to generate stronger fluxes etc. Some other changes were made in this commit. They are 1) we modified subroutine calc_brunt_vaisala_freq_sqd by adding brunt_vaisala_freq_sqd_mixed, although brunt_vaisala_freq_sqd_dry is still used as default. 2) cloud fracting was considered in brunt_vaisala_freq_sqd as well as compute_Cx_Fnc_Richardson. 3) C_invrs_tau_N2_wpxp was added as a new parameter.
I am adding a file for the new hybrid PDF, which combines the w equation set from the new PDF (setter variable) and an equation set for the responder variables similar to what is used for ADG1.
I updated the function to calculate the implicit coefficient for the wp4 term, as well as added the function to calculate the implicit coefficient for the wp2xp terms for the new hybrid PDF.
I updated the subroutine that calculates the implicit coefficient and explicit term for the wpxpyp term in the xpyp predictive equation for the new hybrid PDF.
Replaced rrm_cond with rrm_evap and Nrm_cond with Nrm_evap because they described the same quantity. This is BIT_CHANGING just because the output now contains the N/rrm_evap instead of N/rrm_cond variable name. No changes were made to the values themselves. see #867
Replaced rrm_cond with rrm_evap and Nrm_cond with Nrm_evap because they described the same quantity. This is BIT_CHANGING just because the output now contains the N/rrm_evap instead of N/rrm_cond variable name. No changes were made to the values themselves. see #867
Adding intent(in) attribute to rhs_ta terms and making scalar forcings local variables, since that is what they were supposed to be. larson-group/clubb#855
Refactoring advance_xm_wpxp to clean up code. Now subroutines solve_xm_wpxp_with_multiple_lhs and solve_xm_wpxp_with_single_lhs are called, rather than having huge chunks of similar code. Also changing the way calc_xm_wpxp_ta_terms works, it uses other input variables rather than coef_ and term_ arguements and instead calculates those locally to abstract functionality. This is BIT_CHANGING for some cases, but idenetical for some with some compilers. There are no visible differences in plots when tested with a number of different flags, and gabls2 (which uses scalars) are also the same. larson-group/clubb#855
Mathematically, sigma_x_1_sqd and sigma_x_2_sqd cannot be less than 0. Numerically, this can happen when numerical round-off error causes epsilon-sized negative values. When this happens, reset the PDF component variance to 0.
I interfaced the implicit coefficients and explicit terms used in the turbulent advection code for the new hybrid PDF. The PDF can now be run interactively for wp3, all wpxp (wprtp, wpthlp, upwp, vpwp, and wpsclrp), rtp2, thlp2, and rtpthlp.
I am updating the subroutine that calculates PDF component means and standard deviations for hydrometeors. I am restoring it to its former glory (before where statements or pushed down loops), but I am turning it into an elemental subroutine.
The results in GrADS output files from this revision are an exact match to the results in GrADS output files from the previous revision for all cases.
I added a limiter to keep the maximum magnitude of the correlations of fluxes to have a upper limit of max_mag_correlation_flux (which is the limit these correlations should have anyway).
The new hybrid PDF also uses this bit of code that sets the correlation of w and chi, as well as the correlation of w and eta, to 0 for use in the correlation arrays to obey PDF standards.
I made modifications to the new hybrid PDF so that that calculation of F_w temporarily becomes more ADG1/sigma_sqd_w-like. I also set sigma_sqd_w to 1 - F_w when the new hybrid PDF is used so that the calculation of skewness of responder variables becomes more consistent with F_w and the new hybrid PDF.
I changed the value of the coefficient in the F_w equation to 0.45 because it produces a result that is more similar to ADG1 results for most cases. This is a better spot to start testing, development, and tuning from.
I am updating the code to pass up3, vp3, and sclrp3 out of advance_clubb_core and then back in again. They were temporarily being stored through use statements within advance_clubb_core.
This does not change results of standalone CLUBB. However, prior to this change, these variables weren't being allocated for host model runs. This was causing a segmentation fault.
I have started the process of adding the coding infrastructure for having different up2 and vp2 LHS for the new hybrid PDF. The default ADG1 code remains unchanged.
I have completed the addition of the ability to use different up2 and vp2 LHS for the new hybrid PDF. The default ADG1 PDF remains unaffected by these changes.
I have added 'l_use_precip_frac', 'l_do_expldiff_rtm_thlm', 'l_use_C11_Richardson' and 'l_prescribed_avg_deltaz' to the 'configurable_clubb_flags_nl' namelist. The latter was moved from 'model_setting' namelist. #856
I have added 'l_use_precip_frac', 'l_do_expldiff_rtm_thlm', 'l_use_C11_Richardson' and 'l_prescribed_avg_deltaz' to the 'configurable_clubb_flags_nl' namelist. The latter was moved from 'model_setting' namelist. #856
I made the l_calc_w_corr code (turned off by default) run again by changing subroutine calc_corr_w_hm_n to an elemental subroutine. Previously, runtime exceptions were found within the "where" statements.
I added a few more flags to the 'configurable_clubb_flags_nl' namelist. Also I gave 'l_use_wp3_pr3' the parameter attribute. This is done in preparation for the introduction of the 'clubb_config_flags_type'. #856
I added a few more flags to the 'configurable_clubb_flags_nl' namelist. Also I gave 'l_use_wp3_pr3' the parameter attribute. This is done in preparation for the introduction of the 'clubb_config_flags_type'. #856
I have started altering argument lists to feed clubb configurable flags through them. This commit has 'l_use_precip_frac', 'l_min_wp2_from_corr_wx', and 'l_min_xp2_from_corr_wx' covered. #856
I continued to alter argument lists. This commit covers 'l_C2_cloud_frac', 'l_diffuse_rtm_and_thlm', 'l_stability_correct_Kh_N2_zm', 'l_upwind_wpxp_ta', 'l_upwind_xpyp_ta', 'l_upwind_xm_ma'. #856
I continued to alter argument lists. This commit covers ' l_vert_avg_closure', 'l_trapezoidal_rule_zt', 'l_trapezoidal_rule_zm', 'l_call_pdf_closure_twice', 'l_use_cloud_cover', 'l_stability_correct_tau_zm', 'l_damp_wp2_using_em', 'l_do_expldiff_rtm_thlm', 'l_Lscale_plume_centered', 'l_diag_Lscale_from_tau', 'l_use_ice_latent', 'l_use_C7_Richardson', 'l_use_C11_Richardson', 'l_rcm_supersat_adj', 'l_damp_wp3_Skw_squared', and 'l_prescribed_avg_deltaz'. #856
I continued to alter argument lists. This commit covers the last flags in the namelist 'configurable_clubb_flags_nl', namely 'l_predict_upwp_vpwp', 'l_tke_aniso', 'l_standard_term_ta', 'l_brunt_vaisala_freq_moist', 'l_use_thvm_in_bv_freq', and 'l_single_C2_Skw'. #856
Finished altering argument lists. This commit covers the final seven flags, which are in different namelists. This includes 'l_calc_thlp2_rad', 'l_uv_nudge', 'l_rtm_nudge', 'l_diagnose_correlations', 'l_calc_w_corr', 'l_const_Nc_in_cloud', and 'l_fix_w_chi_eta_correlations'. #856
I introduced the 'clubb_config_flags_type'. Furthermore, I have created subroutines to set default values, to initialize the derived type and to print the derived type. However it is not used by now. #856
I enabled the use of the 'clubb_config_flags_type'. I changed 'clubb_standalone', 'clubb_tuner' and the G_unit_tests so that they now use it. The results are bit-for-bit identical. #856
I fed pdf_params_frz into subroutine advance_clubb_core via a use statement. Doing so avoids a seg fault with l_use_ice_latent = .true. Results are BFB for arm_97.
Added use statement for pdf_params_frz in src/CLUBB_core/clubb_api_module.f90 and made it public. This was done to be able to use the variable in SAM's SGS_CLUBB package.
Revert "I am setting model flags and tunable parameters in the clubb_E3SM_silhs branch"
I am reverting commit da00f00. In that commit, I set some tunable parameters and flags to be consistent with an old version of E3SM-CLUBB-SILHS. However, results from those old cases are hopelessly lost anyway, and we should keep flags and parameters consistent with today's CLUBB. Secondly, the code change in da00f00 is blocking a merge of the modern CLUBB master into this branch.
This reverts commit da00f00f1bd353a7e413a738e1424ddddd751a2b.
Changing the error treshold in assert_correct_cloud_normal to use the previously defined single precision threshold. This should fix occasional errors. larson-group/clubb#869
I added E3SM's clubb_ parameters that can be read in from the E3SM clubb_param_nl namelist that are now found on E3SM's master branch (and weren't previously). This is within the #ifdef E3SM preprocessor directive and won't affect CLUBB except in the context of E3SM.
I added the remainder the clubb_ terms that were added previously to the zhun/atm/clubb_silhs_v2 branch of the UWM E3SM repository. This only affects code in the #ifdef E3SM preprocessor flag.
Changing error threshold in assert_correct_cloud_normal and fixing bug where we weren't passing the correct array section. This should fix the WRF parallel test and the PGI test. larson-group/clubb#869
Redoing some data directives to only copy data that we need off the device. Data that is needed by assertion checks and stats will be updated conditionally. This will make the code faster when no stats/assertion checks are being done, but slower when it is. This is all bit-for-bit. larson-group/clubb#869
Simple performance improvement refactoring. Merging loops and creating tmp variable to use to help reduce memory usage. This changes the order of operations so this is BIT_CHANGING. larson-group/clubb#869
Small performance improvement. Almost reverting the loops to their previous form using the unbounded_point variable. This is all bit-for-bit. larson-group/clubb#869
I added the new l_update_pressure configurable flag to clubb_config_flags. When this flag is enabled (which it is by default), CLUBB updates pressure and exner every timestep. This new flags allows this feature to easily be turned off within the context of host models, such as CAM and E3SM.
The results in GrADS output files from this revision are an exact match to the results in GrADS output files from the previous revision for all cases.
I added the new l_update_pressure configurable flag to clubb_config_flags. When this flag is enabled (which it is by default), CLUBB updates pressure and exner every timestep. This new flags allows this feature to easily be turned off within the context of host models, such as CAM and E3SM.
The results in GrADS output files from this revision are an exact match to the results in GrADS output files from the previous revision for all cases.
I added some code I used in the special input fields branch to make the PDF of w symmetric, so that the PDF at a value of positive skewness of w (for example, +2) looks like a mirror image of the PDF at the opposite value of negative skewness (for example, -2).
I got rid of the "allocatable", "allocate", and "deallocate" statements in regards to pdf_params and pdf_params_frz because NCAR could not get CAM to run using the NAG compiler. As it turns out, the code can run on group computers without these statements.
I placed an ifndef CLUBB_CAM preprocessor flag around the code in error_code.F90 that uses the FORTRAN intrinsic call to getpid(). This causes problems for NCAR when they try to compile CAM using the NAG compiler.
I reduced the minimum possible value of lmin from 4.0 to 1.0.
This is because Mark Taylor found that for the E3SM model, reducing lmin from 4 to 1 prevents excessive cooling at the surface near Greenland. For more information about this "Tlay" error, see [here](https://acme-climate.atlassian.net/wiki/spaces/NGDNA/pages/1296793934/CLUBB+lmin+coeff+sensitivity?focusedCommentId=1296892065#comment-1296892065) and [here](https://acme-climate.atlassian.net/wiki/spaces/NGDNA/pages/1235255422/Tlay+Error+in+ne256pg2+Runs+cold+temperature+plots).
I am replacing the "use" statements that referenced variables_diagnostic_module from advance_clubb_core and replacing them with local declarations. This requires that some additional variables are passed into and out of advance_clubb_core.
Additionally, Lscale is now recalculated outside of advance_clubb_core using TKE and Kh for use in SILHS code. This makes this commit BIT_CHANGING.
Results were changed yesterday for some cases because thlprcp was no longer being output from advance_clubb_core for use in the calculate_thlp2_rad. This was previously accomplished through a "use" statement. The variable thlprcp is now output through the argument list of advance_clubb_core.
I have resolved all the issues surrounding recent CLUBB commits that remove "use" statements from the code. The commit 068a7b2 (April 8, 2020) was the commit before these refactorings started. When Lscale, Skw_zm, and thvm are passed out of CLUBB core, the code returns to a bit-for-bit match to commit 068a7b2. However, rather than pass these variables out of advance_clubb_core, it is more convenient to recalculate them locally in clubb_driver. This changes results for (a) SILHS cases, owing to the change to Lscale, and (b) all cases that advance microphysics, owing to the change to Skw_zm. The net result is that this commit is BIT_CHANGING. For cases that advance microphysics and/or use SILHS, the net result is BIT_CHANGING when compared to 068a7b2. For all other cases (BOMEX, etc.), the results are an exact match.
It is important to note that host models that use CLUBB (without SILHS) will not be affected by these changes. Host models that use SILHS will only be affected by the change to Lscale. However, this code has already been applied to CAM and E3SM, so the only changes will to SILHS code in SAM and WRF.
I set `l_diag_Lscale_from_tau = .true.` in source code
in order to match the value in configurable_model_flags.in. I did so to avoid confusion, but also to check whether doing so will allow the WRF-CLUBB lines nightly plots to better match the CLUBB standalone lines.
I removed the reference to use variables_diagnostic_module for Kh_zm found in setup_clubb_pdf_params.F90. The variable Kh_zm can easily be passed in instead.
I have completed the project of removing variables_prognostic_module and variables_diagnostic_module from the CLUBB code.
The results in GrADS output files from this revision are an exact match to the results found in GrADS output files from the previous revision for all cases.
I have taken the code from wp2_term_ta_all and placed it in the subroutine wp2_term_ta. This combines the former, verbose description with the new optimized code. This also eliminates an unused function and gets rid of a compiler warning.
I am updating wp3_term_ta_new_pdf_lhs to use the optimized code from wp3_term_ta_new_pdf_lhs_all, and then I am removing wp3_term_ta_new_pdf_lhs_all from the code. This eliminates a compiler error.
I am making the change of using tau_wp2_zm to damp up2 and vp2, rather than tau_xp2_zm, when l_diag_Lscale_from_tau is enabled. The previous code was causing up2 and vp2 to become large and unstable.
Additionally, I placed a limiter on tau based on Lscale_max in the CLUBB code for the situation where l_diag_Lscale_from_tau is enabled. This will help constrict tau, and thereby the magnitudes of turbulent fields, in a host model as grid spacing starts to become arbitrarily small and resolved features take over.
I have added the integer flags iiPDF_type and ipdf_call_placement to the clubb_config_flags type. They have also been added to configurable_model_flags.in.
The results in GrADS output files from this revision are an exact match to the result in GrADS output files from the previous revision for all cases.
I have added the integer flags iiPDF_type and ipdf_call_placement to the clubb_config_flags type. They have also been added to configurable_model_flags.in.
The results in GrADS output files from this revision are an exact match to the result in GrADS output files from the previous revision for all cases.
I am updating the clubb_ list of namelist parameters used in E3SM to include every parameter that E3SM has customized in CLUBB. The goal is to make it so E3SM does not need to customize the CLUBB side of E3SM-CLUBB at all, making future upgrades easier.
I am changing the new hybrid PDF's calculation of F_w to use tunable parameter gamma (technically, the gamma_Skw_fnc).
In the ADG1 PDF, when gamma_Skw_fnc goes to 0, the standard deviations of w in each PDF component both go to 0, and the spread between the PDF component means of w is at its maximum. When gamma_Skw_fnc goes to 1, the standard deviations of w in each PDF component become large, and the spread between the PDF component means of w becomes small.
The new hybrid PDF is based on the same concept, except that I had been using a hard-wired 0.75 in the place of gamma or the gamma_Skw_fnc. Re-using the tunable parameters for gamma here makes sense, since it's the same concept and this makes tuning easier.
I updated the xp3 calculation for PDF types other than ADG1.
ADG1 is stuck into using the LG 2005 ansatz, exactly as written.
Other PDF types are not stuck using this. Rather than re-invent the wheel, these other PDF types can still use the LG 2005 ansatz equation, but sigma_sqd_w_zt (specific to ADG1) has been replaced with a tunable function relavant to other PDF types. This tunable function is called xp3_coef_fnc.
The results in GrADS output files from the previous revision are an exact match to the results in GrADS output files from the current revision for all cases for the default ADG1 PDF.
I have combined the wp3_term_ta_ADG1_lhs and wp3_term_ta_ADG1_lhs_all routines into one subroutine. This is done to remove a compiler warning, simplify the code, and prep the code for the wp3 partial upwinding.
The results in GrADS output files from this revision are an exact match to the results in GrADS output files from the previous revision for all cases.
Updating silhs to prepare the column loop commit. This is being committed seperately because it is BIT_CHANGING, due to the way we are initializing the random number generator on CPUs. larson-group/cam#129
Adding column loop index to silhs, and pushing loops down to allow parallelization over the column index. This requries changing the api, but it is bit-for-bit running on both gpus and cpus. larson-group/cam#129
Adding interface in silhs_api to distinguish single vs multiple comulmn calls. This seems to be a better solution than the previous attempt that broke the nightly tests. When calling silhs a single column at a time, the api will copy the single column data into arrays with a grid column index, allowing us to leave the host models the same. larson-group/cam#129
Small changes to generate_all_uniform_samples. I was encountering a gpu problem with this code when run in cam. I'm not certain why this is an issue, but this changes fixes it and is bit-for-bit on both cpus and gpus. larson-group/cam#129
The removed lines were commented out, opposed to deleted An if statement with continue was added to remove the warning without changing the method signature (clubb_driver.F90)
The removed lines were commented out, opposed to deleted An if statement with continue was added to remove the warning without changing the method signature (clubb_driver.F90)
Adding functionality to pass in a seed for the random number generator. This allows CPU restart runs to function correctly. Because this also changes the seed, this is BIT_CHANGING. larson-group/cam#129
I have pared two subprograms down to one again, this time for the subprograms found in module diffusion.
As part of this, the calls to diffusion (for turbulent advection) in advance_microphys_module.F90 needed to be upgraded to use the fully optimized version of the code. As a result, this revision is BIT_CHANGING, but only for cases that use microphysics. A print out of the LHS array from the call to diffusion shows that numbers are in agreement until you reach the point of numerical roundoff.
I added altitude_threshold to the list of CLUBB's tunable parameters.
The results in GrADS output files from this revision are an exact match to the results in GrADS output files from the previous revision for all cases.
However, NetCDF output files are not an exact match, owing to the presence of the new tunable parameter listed in the output files. That technically makes this revision BIT_CHANGING.
I added altitude_threshold to the list of CLUBB's tunable parameters.
The results in GrADS output files from this revision are an exact match to the results in GrADS output files from the previous revision for all cases.
However, NetCDF output files are not an exact match, owing to the presence of the new tunable parameter listed in the output files. That technically makes this revision BIT_CHANGING.
Updating clubb variables to output their var_description in the form '[variable name using sci notation], [Textual descirption]' in an effort to provide more standardized titles for pyplotgenplots.
Updating previous commit to not have lines over 100 characters. This commit shouldn't be BIT_CHANGING, but the previous commit was (and was supposed to be).
Changes length of units variable in stat_file_module from 20 to 25 BIT_CHANGING
The previous length of 20 was cutting off the last character for the unit `kg^{3} kg^{-3} s^{-1}`, which was causing checkBudget.py to fail. I upped it to 25 because that is a nice number.
This commit resolves issue #885 and gets the 2D output working, if the relevant flags are set to true. A duplicated allocate statement is eliminated, and to ensure that the 2D output occurs at the right intervals (every stats_tout seconds) I have also added approrpiate if statements at the beginning of the 2D output subroutines.
Adding API subroutines for latin_hypercube_2D_output and latin_hypercube_2D_close. This will aid in implementing the SILHS 2D output subroutines in host models. The new API subroutines necessitated some minor changes in clubb_driver.F90 as well. Mainly relevant to https://github.com/larson-group/wrf/issues/110 (WRF repo), but see also #885 (CLUBB repo).
I updated the stats code in setup_clubb_pdf_params.F90 and in latin_hypercube_driver_module.F90 to loop over stat_update_var_pt up to level nz, rather than call stat_update_var. This is done to allow E3SM-CLUBB-SILHS to run without issue. In that code base, SILHS and CLUBB have differing numbers of vertical levels.
The results in output files from this revision are an exact match to the results in output files from the previous revision for all cases.
I updated the stats code in setup_clubb_pdf_params.F90 and in latin_hypercube_driver_module.F90 to loop over stat_update_var_pt up to level nz, rather than call stat_update_var. This is done to allow E3SM-CLUBB-SILHS to run without issue. In that code base, SILHS and CLUBB have differing numbers of vertical levels.
The results in output files from this revision are an exact match to the results in output files from the previous revision for all cases.
This commit primarily overhauls the way the 2D SILHS samples are output to netCDF. Now, instead of being output along the latitude dimension in a 4d netCDF file, the SILHS samples are output along the "lh_sample_number" dimension of a 5d netCDF file. Furthermore the lat/lon dimensions of the 2D SILHS sample files are now output with the correct lat/lon information.
Also, "rlat" and "rlon" are changed to "lat_vals" and "lon_vals" throughout the CLUBB repo for clarity. Most of the files changes are because of this. (Some host models, e.g. WRF, may still use "rlat" and "rlon" in the code where they interface with CLUBB.)
This commit primarily overhauls the way the 2D SILHS samples are output to netCDF. Now, instead of being output along the latitude dimension in a 4d netCDF file, the SILHS samples are output along the "lh_sample_number" dimension of a 5d netCDF file. Furthermore the lat/lon dimensions of the 2D SILHS sample files are now output with the correct lat/lon information.
Also, "rlat" and "rlon" are changed to "lat_vals" and "lon_vals" throughout the CLUBB repo for clarity. Most of the files changes are because of this. (Some host models, e.g. WRF, may still use "rlat" and "rlon" in the code where they interface with CLUBB.)
Updated titles listed for change here: https://github.com/larson-group/sys_admin/issues/542#issuecomment-685963832 Moved wp2thvp just after the Cloud water contribution to wp2thvp panel
I am committing Zhun's changes to the CLUBB portion of his E3SM-CLUBB-SILHS branch to the clubb_E3SM_SILHS_branch_merge branch of CLUBB. The goal is for this code to eventually be merged into the CLUBB master.
I am committing Zhun's changes to the CLUBB portion of his E3SM-CLUBB-SILHS branch to the clubb_E3SM_SILHS_branch_merge branch of CLUBB. The goal is for this code to eventually be merged into the CLUBB master.
I modified tunable_parameters.in to use some of the parameter values that are in the E3SM-CLUBB-SILHS branch. The only parameters changed are the ones that are found in the namelists for both CAM (master) and E3SM (master).
Adding linear multistep method (LMM) stepping flag (l_lmm_stepping) to provide capability of overstepping-and-then-averaging results from advance_wp2_wp3, advance_xm_xpwp, and advance_xp2_xpyp. This is intended to help smooth high-frequency oscillations. Flag is set to false by default so has no impact on standard runs.
Adding linear multistep method (LMM) stepping flag (l_lmm_stepping) to provide capability of overstepping-and-then-averaging results from advance_wp2_wp3, advance_xm_xpwp, and advance_xp2_xpyp. This is intended to help smooth high-frequency oscillations. Flag is set to false by default so has no impact on standard runs.
In order to prevent dycoms2_rf02_so from crashing, I replaced C7_Skw_fnc by 0.7 in upwp_pr4 and vpwp_pr4. This prevents an excessive wind gradient (dum/dz) from forming near the lower surface.
This commit is BIT_CHANGING. For larson-group/e3sm#30.
I updated the recording of the budget terms for upwp_pr4 and vpwp_pr4. The simulation should be BFB, but because the budget term is updated consistently now, this commit is BIT_CHANGING. For larson-group/e3sm#30.
Adding the smooth_min and smooth_max functions to the repo. These are not yet implemented in CLUBB but are now available for use and testing. See issue #894.
Adding some comments describing zm and zt for the new interface functions, and fixing a problem in the "array_sclr" versions of the functions. See issue #894.
Modifying some array dimensions to speed up multiply_Cholesky. This cuts the cost of multiply_Cholesky by about 60% in cam but only about 15% in clubb_standalone. larson-group/cam#129
This commit replaces division by tau with multiplication by inverse tau in most cases. It is BIT_CHANGING, not only because the results change (only very slightly in some cases, but more significantly in sensitive cases like ARM_97, RICO, etc.) but also because some of the old tau_*_zm or tau_*_zt output variables are replaced with invrs_tau_* variables, hence the netcdf files will differ and there are minor changes to stats input files. Spurious source test also needed to be slightly modified to accommodate a new variable fed into the advance_xm_wpxp subroutine.
This commit replaces division by tau with multiplication by inverse tau in most cases. It is BIT_CHANGING, not only because the results change (only very slightly in some cases, but more significantly in sensitive cases like ARM_97, RICO, etc.) but also because some of the old tau_*_zm or tau_*_zt output variables are replaced with invrs_tau_* variables, hence the netcdf files will differ and there are minor changes to stats input files. Spurious source test also needed to be slightly modified to accommodate a new variable fed into the advance_xm_wpxp subroutine.
I am committing a bug fix to the invrs_tau_zm equation that was introduced with the code merge from E3SM. I am also adding some changes to the clubb_api_module that should have been brought over at that time. This commit is BIT_CHANGING with the bug fix.
1. Putting smoothing on thlm before the Brunt-Vaisala frequency calculation. We find this helps smooth oscillations in that variable, see issue #894. Also fixing spelling mistake in stats_zm_module.F90, and adding bv_freq_sqd to nightly_stats.in. For all these reasons this commit is BIT_CHANGING, but only the thlm smoothing will change the physical results.
2. Pyplotgen: I moved Brunt-Vaisala to VariableGroupBase.py so it should show up in the nightly plots, I got rid of VariableGroupTaus from the default Case definitions, and made a couple other minor changes including making the solid line thicker for standard CLUBB plots.
1. Putting smoothing on thlm before the Brunt-Vaisala frequency calculation. We find this helps smooth oscillations in that variable, see issue #894. Also fixing spelling mistake in stats_zm_module.F90, and adding bv_freq_sqd to nightly_stats.in. For all these reasons this commit is BIT_CHANGING, but only the thlm smoothing will change the physical results.
2. Pyplotgen: I moved Brunt-Vaisala to VariableGroupBase.py so it should show up in the nightly plots, I got rid of VariableGroupTaus from the default Case definitions, and made a couple other minor changes including making the solid line thicker for standard CLUBB plots.
I fixed the LMM stepping bug that was affecting E3SM (because l_predict_upwp_vpwp is false over there) in advance_xm_wpxp_module.F90. I also added it to all predictive fields.
The results in NetCDF output files from this revision is an exact match to the results in NetCDF output files from the previous revision for all cases because LMM stepping is turned off by default.
This commit introduces a new flag, l_e3sm_config, which enables the user to switch on or off some of the changes introduced in connection with the E3SM merge (see commit https://github.com/larson-group/clubb/commit/cf5b2e4b80d8bd3ca411b9b5e6d5a2afece04795). It also introduces two new tunable parameters, C_invrs_tau_wpxp_Ri and C_invrs_tau_wpxp_N2_thresh, to replace two "magic numbers" in the code. The primary code changes are in advance_clubb_core_module.F90.
This is a BIT_CHANGING commit due to the new parameters affecting the netcdf output but the physical results should remain the same for now.
This commit introduces a new flag, l_e3sm_config, which enables the user to switch on or off some of the changes introduced in connection with the E3SM merge (see commit https://github.com/larson-group/clubb/commit/cf5b2e4b80d8bd3ca411b9b5e6d5a2afece04795). It also introduces two new tunable parameters, C_invrs_tau_wpxp_Ri and C_invrs_tau_wpxp_N2_thresh, to replace two "magic numbers" in the code. The primary code changes are in advance_clubb_core_module.F90.
This is a BIT_CHANGING commit due to the new parameters affecting the netcdf output but the physical results should remain the same for now.
Switching the order of two variables. Was causing the values of these parameters to be reversed in some output files (but no effect on physical results).
Setting parameters and flags to be consistent with the CLUBB repo prior to the October 8 commit merging some E3SM code (https://github.com/larson-group/clubb/commit/cf5b2e4b80d8bd3ca411b9b5e6d5a2afece04795). This should help to basically recover the plots from before the merge, which is useful for single-column model testing.
The parameters and flags for the E3SM results can be found in the input/tunable_parameters_e3sm/ folder.
Setting l_use_shear_Richardson to false in model_flags.in to be consistent with the default configurable_model_flags.in file. This will ensure consistency with other nightly tests (eg WRF and SAM) that do not read configureable_model_flags.in.
Adding new flag that allows the user to implement the TKE formulation of the wp3 C15 term (known currently as bp2, but ultimately will be called pr3). See issue #884.
Adding new flag that allows the user to implement the TKE formulation of the wp3 C15 term (known currently as bp2, but ultimately will be called pr3). See issue #884.
Separating out the parameter C5 into C_uu_shr and C_uu_buoy, consistent with the formalism of Mironov and Machulskaya 2017. C5 has been effectively renamed C_uu_shr, and a new parameter C_uu_buoy has been introduced. See https://github.com/larson-group/clubb/issues/901.
This commit is BIT_CHANGING, both because it will change the names of parameters output to netcdf, and because it changes the results of the more sensitive CLUBB test cases (like ARM_97), since there is an order-of-operations change involved in the subroutine "wp2_term_pr3_rhs" in advance_wp2_wp3_module.F90.
Separating out the parameter C5 into C_uu_shr and C_uu_buoy, consistent with the formalism of Mironov and Machulskaya 2017. C5 has been effectively renamed C_uu_shr, and a new parameter C_uu_buoy has been introduced. See https://github.com/larson-group/clubb/issues/901.
This commit is BIT_CHANGING, both because it will change the names of parameters output to netcdf, and because it changes the results of the more sensitive CLUBB test cases (like ARM_97), since there is an order-of-operations change involved in the subroutine "wp2_term_pr3_rhs" in advance_wp2_wp3_module.F90.
This commits further updates related to splitting the parameter C5 into C_uu_shr and C_uu_buoy (see this commit: https://github.com/larson-group/clubb/commit/3f75a27dd94673a2b8603c24b989da106e759b39). Changes include correcting one instance where C_uu_shr was passed to a function when C_uu_buoy should've been passed, and also now applying the changes to up2 and vp2, which was overlooked before. I've also updated the comments to remove, where appropriate, references to "C_5" that were missed before (in a few places I have left the C_5 in place but included a note indicating that it has now been broken up).
This commit is BIT_CHANGING, similar to the previous commit, because of the order-of-operations change in the pr2 term for up2 and vp2. This leaves more stable cases like BOMEX bit-for-bit identical, but changes outcomes for more senstive cases like ARM_97.
This commit renames the wp3 budget term from "bp2" to "pr_turb", and renames the related parameter "C15" to "C_wp3_turb". The majority of files changed are supplemental files such as postprocessing files for plotgen and pyplotgen and tuner files and input files.
This commit is BIT_CHANGING, but only because it renames a variable and a parameter. Results should be bit-for-bit with previous results.
This commit renames the wp3 budget term from "bp2" to "pr_turb", and renames the related parameter "C15" to "C_wp3_turb". The majority of files changed are supplemental files such as postprocessing files for plotgen and pyplotgen and tuner files and input files.
This commit is BIT_CHANGING, but only because it renames a variable and a parameter. Results should be bit-for-bit with previous results.
This commit renames the wp3 budget term from "bp2" to "pr_turb", and renames the related parameter "C15" to "C_wp3_turb". The majority of files changed are supplemental files such as postprocessing files for plotgen and pyplotgen and tuner files and input files.
This commit is BIT_CHANGING, but only because it renames a variable and a parameter. Results should be bit-for-bit with previous results.
Incorporating Shixuan Zhang's and Chris Vogl's "l_godunov_upwind_wpxp_ta" flag and related code. The flag is set to false by default so results are unaffected. See #902.
Incorporating Shixuan Zhang's and Chris Vogl's "l_godunov_upwind_wpxp_ta" flag and related code. The flag is set to false by default so results are unaffected. See #902.
Updating advance_xm_wpxp_module so that the upwp_pr4 term uses the parameter C_uu_shr instead of the hard-coded value 0.7. Also updating the value of C_uu_shr from 0.3 to 0.4 after testing priority-cases with the new upwp_pr4 term.
Updating advance_xm_wpxp_module so that the upwp_pr4 term uses the parameter C_uu_shr instead of the hard-coded value 0.7. Also updating the value of C_uu_shr from 0.3 to 0.4 after testing priority-cases with the new upwp_pr4 term.
Moving the acc update host directive to after the wait directives in silhs. Since silhs runs with asyncronous kernel calls the update was occasionally happening before some clipping was finished, causing problems in assert_correct_cloud_normal. This is only a problem when compiling with OpenACC enabled, so it should be bit identical for all our tests. larson-group/cam#129
Reording vertical and subcolumn dimensions in SILHS. This is BIT_CHANING in some cases, seemly due to an outputting error for the precip_rate field, but plotted results are identical. larson-group/cam#129
Changing dimension order of rand_pool to make consistent with previous reorderings. This is BIT_CHANGING for silhs cases since it changes the order in which random numbers are used. larson-group/cam#129
I changed the tuner's configuration of three cloud cases in order to reduce the number of tuning iterations. The cases are lba, dycoms2_rf01, and arm_97. For instance, I reduced f_tol so that the convergence criterion was relaxed. I set the annealing schedule so that the simulations start at a cooler "temperature" and finish at a warmer temperature. I reduced the maximum number of iterations.
Also, I matched more LES fields at more time intervals in order to constrain the tuner to more realistic solutions.
I added an option to improve dry, convecting boundary layers. The new option is triggered by setting l_vary_convect_depth=.true. The option reduces the spurious surface spike in thlp2 in Wangara.
The option calculates the Deardorff convective velocity using a variable estimate of layer depth based on the depth over which wpthlp is positive near the ground. thlp2_sfc is then diagnosed by assuming maximal correlation between thl and vertical velocity, w.
Currently, l_vary_convect_depth is set to false, and hence the answers remain BFB.
This commit switches the names, but not the values, of the dp1 and pr1 variables for up2 and vp2. In other words, up2_dp1 <---> up2_pr1 and vp2_dp1 <---> vp2_pr1. This makes the terms in these equations more consistent with the terms in the wp2 equation. I believe this commit is BIT_CHANGING since it will affect the values of these variables even though the nightly plot profiles should not change (but the budget plots would have these lines swapped).
Pushing grid column loop into setup_pdf_params. Adding iterface too, allowing us to call it with single or multiple columns so that the host models don't need updating to work with this change. This is bit-for-bit, tested with clubb_standalone and cam coarse res run. larson-group/cam#129
Reordering dimensions of mu, sigma, corr_arrays, and cholesky matrices. This makes the dimension ordering more consistent with similar arrays and should help to reduce computational cost by reducing array slicing. This is all bit-for-bit. larson-group/cam#129
Reordering dimensions of mu, sigma, corr_arrays, and cholesky matrices. This makes the dimension ordering more consistent with similar arrays and should help to reduce computational cost by reducing array slicing. This is all bit-for-bit. larson-group/cam#129
Adding second dimension to allocatable arrays in pdf_parameter type. This also requires lots of dummy dimensions in clubb where pdf_params is used, since clubb only works over a single column, but silhs does not need such a dummy dimension. larson-group/cam#129
Adding second dimension to allocatable arrays in pdf_parameter type. This also requires lots of dummy dimensions in clubb where pdf_params is used, since clubb only works over a single column, but silhs does not need such a dummy dimension. larson-group/cam#129
Adding some new code that puts the diffusion term d(wp2*em)/dz into a new function, creates a new wp3 budget term (wp3_pr_dfsn), and adds that new budget term to pyplotgen.
These changes add the new fourth-order moment variables wp2up2 and wp2vp2 to the CLUBB code. This requires a new function in pdf_closure_module since they must be calculated separately with a new formula, and they are fed through into advance_wp2_wp3 for use with the pr_dfsn subroutine. They are also added to the standard stats file and will be output to netcdf, hence this commit is BIT_CHANGING.
The new variables are also added to pyplotgen as part of VariableGroupWs.py where wp4 is found.
Adding some new code that puts the diffusion term d(wp2*em)/dz into a new function, creates a new wp3 budget term (wp3_pr_dfsn), and adds that new budget term to pyplotgen.
Putting the wp3_pr_turb formulation back to its d(rho*wp2*em)/dz form. This would be a BIT_CHANGING commit since it would change the answers for the pr_turb term. However once this branch is merged into the master branch, results should be bit-for-bit since this term was only modified in the alternate branch.
These changes add the new fourth-order moment variables wp2up2 and wp2vp2 to the CLUBB code. This requires a new function in pdf_closure_module since they must be calculated separately with a new formula, and they are fed through into advance_wp2_wp3 for use with the pr_dfsn subroutine. They are also added to the standard stats file and will be output to netcdf, hence this commit is BIT_CHANGING.
The new variables are also added to pyplotgen as part of VariableGroupWs.py where wp4 is found.
These changes add the new fourth-order moment variables wp2up2 and wp2vp2 to the CLUBB code. This requires a new function in pdf_closure_module since they must be calculated separately with a new formula, and they are fed through into advance_wp2_wp3 for use with the pr_dfsn subroutine. They are also added to the standard stats file and will be output to netcdf, hence this commit is BIT_CHANGING.
The new variables are also added to pyplotgen as part of VariableGroupWs.py where wp4 is found.
Added intent comments for the following files: advance_clubb_core_module, advance_helper_module, and advance_windm_edsclrm_module. These changes are BFB. For ticket #924.
Removing "if" statement around calculation of wp4 in pdf_closure_module.F90 and the same "if" statement around some further manipulation of wp4 in advance_clubb_core. Results are bit-for-bit with this change, since normally all cases calculate wp4 anyway since the "if" condition was always satisfied in normal runs (but not, for example, in some tuning runs). This was done because the new wp3_pr_dfsn term needs wp4 in its current formulation so it needs to always be calculated.
Removing "if" statement around calculation of wp4 in pdf_closure_module.F90 and the same "if" statement around some further manipulation of wp4 in advance_clubb_core. Results are bit-for-bit with this change, since normally all cases calculate wp4 anyway since the "if" condition was always satisfied in normal runs (but not, for example, in some tuning runs). This was done because the new wp3_pr_dfsn term needs wp4 in its current formulation so it needs to always be calculated.
Added intent comments. For the file advance_xm_wpxp_module.F90. I also changed the order of arguments in certain arugment lists to conform to the coding standard. Changes confirmed to be BFB. For ticket #924.
Added intent comments for advance_xp2_xpyp_module.F90. Additionally, I made changes to certain argument lists to better reflect the coding standard. Changed confirmed to be BFB. For ticket #924.
Makes surface clipping of wp3 consistent with clipping aloft, per #921. This is BIT_CHANGING since it affects how clipping is applied near the surface.
Feeding gr through the arg list where need only in the CLUBB_core dir. Note, that since some of the functions/subroutines in CLUBB_core are used elsewhere throughout clubb, other parts of clubb such as a file in SILHS, and a few in the outer layer of the source folder needed to be updated in order to reflect the changes. However, everything outside of the CLUBB_core directory still uses use statements in order to use gr from grid class. For ticket #886. All changes are confirmed BFB identical.
Feeding gr through the arg list where need only in the CLUBB_core dir. Note, that since some of the functions/subroutines in CLUBB_core are used elsewhere throughout clubb, other parts of clubb such as a file in SILHS, and a few in the outer layer of the source folder needed to be updated in order to reflect the changes. However, everything outside of the CLUBB_core directory still uses use statements in order to use gr from grid class. For ticket #886. All changes are confirmed BFB identical.
Replacing use gr statements with feeding gr throught the arg list. This commit is for slight improvement to the script in order to better adhere to the coding standard. For ticket #886. Results confirmed to be BFB identical.
Adding proper indentation to needed files. The purpose of this commit is to make the indentation uniform across clubb in order to make script execution easier for replacing gr occurances across clubb. Related to ticket #886. Results are BFB identical.
Removing gr as a module variable from grid_class. gr is now a module variable in clubb_api_module. This was done in order to not break host models. Additonally, gr is now being fed through the arg list of all functions and subroutines that use gr within grid_class. Results are BFB identical. For ticket #886.
Removing gr as a module variable from grid_class. gr is now a module variable in clubb_api_module. This was done in order to not break host models. Additonally, gr is now being fed through the arg list of all functions and subroutines that use gr within grid_class. Results are BFB identical. For ticket #886.
Fixing typo in stats_zm_module.F90. Background: Since this commit https://github.com/larson-group/clubb/commit/466c5383fa5c0cc85316c6d117826974a5e2e0a3# in August 2020 the upwp budget lines in Pyplotgen have not appeared to be balanced for any cases. It turns out the reason is that a comma and space were added to the upwp_tp variable name in stats_zm_module.F90 in the August 2020 commit. This unusual naming causes pyplotgen not to recognize this variable, so it doesn't get plotted and the lines appear unbalanced. However, since the budget balance test still found the variable, it kept passing successfully. This commit will fix the issue with the pyplotgen plotting by reverting the name to the standard format.
This is BIT_CHANGING since it will affect the name of the upwp_tp variable in the X_zm.nc netcdf file, but it will not change results.
See comments in this other commit where a similar typo was fixed: https://github.com/larson-group/clubb/commit/a4f5f736cb16168f40fdc01e454930ffa05fbb4d.
Feeding gr through arg list for functions outside of CLUBB_core. Gr has been removed as a moduler variable from clubb_api_module and has been moved to clubb_driver as the top level moduler variable. There is only one instance where a use clubb_driver gr statement is used and that is within clubb_tuner. Results are BFB identical. For ticket #886.
Feeding gr through arg list for functions outside of CLUBB_core. Gr has been removed as a moduler variable from clubb_api_module and has been moved to clubb_driver as the top level moduler variable. There is only one instance where a use clubb_driver gr statement is used and that is within clubb_tuner. Results are BFB identical. For ticket #886.
The purpose of this commit is to see whether or not causing changes in sam's version of clubb will cause errors when the master branch of clubb gets merged intosam. Please ignore this commit unless everything breaks, in which case this is the reason why everything is broken.
Fixing the ordering of gr in the clubb_api arg list for affected subroutines. Additionally, this commit removes the clubb code standard violation of exceeding more the 100 characters per line. Lastly, the grid typing is being added to clubb_api_module as a public variable so that the host models have access to the type without having to bypass the api For ticket #886.
Feeding stats variables through the argument lists of needed subroutines. The purpose of this commit is to prep clubb for having all stats variables be fed through the argument list in the entirety of clubb and host models where needed. This is for ticket #733. Results have been confirmed to be BFB identical.
Fixing spacing issues along with placing the stats varibales on their own lines. Additionally, this commit relabels arg list intent along with the intent of stats vars. Stats variables are still not in the correct spot in the arg list as per the standard, however, they are on their own line where they are correctly labeled. For ticket #733. Results are confirmed BFB identical.
Changing more subroutines to include stats vars in their arg lists. There were a few subroutines that were not detected on the first script for subroutines that would need to be changed. This commit picks up on those subroutines and correctly makes the change. Additionally, this commit also makes the stats vars show up in the same spot consistantly throughout all affected subroutines. For ticket #733. Results are confirmed BFB identical.
Code changes to introduce wp2_pr_dfsn, the wp2 pressure diffusion term, consistent with Lumley 1978. Related to #920.
This is BIT_CHANGING, but only because it will introduce some new output variables in the netcdf files. It will not affect results currently since the pressure diffusion coefficient is set to zero.
Code changes to introduce wp2_pr_dfsn, the wp2 pressure diffusion term, consistent with Lumley 1978. Related to #920.
This is BIT_CHANGING, but only because it will introduce some new output variables in the netcdf files. It will not affect results currently since the pressure diffusion coefficient is set to zero.
Code changes to introduce wp2_pr_dfsn, the wp2 pressure diffusion term, consistent with Lumley 1978. Related to #920.
This is BIT_CHANGING, but only because it will introduce some new output variables in the netcdf files. It will not affect results currently since the pressure diffusion coefficient is set to zero.
Correcting a typo bug and adding some descriptive comments to two new variables. This is a BIT_CHANGING commit becuase it will affect the newly calculated variables and descriptions in the output files, but it won't affect any plotted results. Related to #920.
Moving the stats variables to module variables of clubb_driver. This change means I had to modify clubb_api_module's arg list along with other arg lists throughout clubb. Everything compiles and results remain BFB identical. For ticket #733.
Moving the stats variables to module variables of clubb_driver. This change means I had to modify clubb_api_module's arg list along with other arg lists throughout clubb. Everything compiles and results remain BFB identical. For ticket #733.
Fixing coding standard viloation of lines exceeding 100 characters. Violations were introduced as a result of changes made by ticket #733, this commit resolves the coding standard violations. Results BFB identical.
Fixing coding standard viloation of lines exceeding 100 characters. Violations were introduced as a result of changes made by ticket #733, this commit resolves the coding standard violations. Results BFB identical.
Adding wp3_pr_tp (aka "negative nose" term) to wp3 equation. Related to #920.
This is not set up to change results currently, since the coefficient of the new term is zero, but it is BIT_CHANGING since it will include new output in the netcdf files.
Also includes updates to pyplotgen to accommodate the new term.
Changing the way the new wp3_pr_tp term works, by generalizing the wp3_terp_pr_lhs subroutine. Also cleaning up comments and changing the description of the wp3_pr_tp variable in the netcdf output files, hence this commit is BIT_CHANGING, although it will not affect numerical results since the wp3_pr_tp coefficient (C_wp3_pr_tp) is set to zero.
Adding wp3_pr_tp (aka "negative nose" term) to wp3 equation. Related to #920.
This is not set up to change results currently, since the coefficient of the new term is zero, but it is BIT_CHANGING since it will include new output in the netcdf files.
Also includes updates to pyplotgen to accommodate the new term.
Adding wp3_pr_tp (aka "negative nose" term) to wp3 equation. Related to #920.
This is not set up to change results currently, since the coefficient of the new term is zero, but it is BIT_CHANGING since it will include new output in the netcdf files.
Also includes updates to pyplotgen to accommodate the new term.
Removing l_interp_prescribed_params from setup_clubb_pdf_params. The flag has been removed and so has any code underneat a logic statement involving this statement unless it has multiple flags. The else statement in the if block involving this flag has been set to execute without an if block. For ticket #916 Results are BFB identical. Additionally, complex logic statements with the use of more flags had those flags adjusted and BFB results were also confirmed with these changes.
Adding intent labels for subroutines throughout clubb. All calls to subroutines now have intent comments next to them all the way up through stats_sfc_module. Results are BFB identical. For ticket #942.
Updates to include all invrs_tau_* variables in the output stats files, and pyplotgen updates to plot all of the invrs_tau_* variables on two separate plots along with the other "base" variables.
Eliminating l_clip_semi_implicit flag. For ticket #926. This commit is BIT_CHANGING due to how the flag needed to be removed. More details on why this commit is bit changing can be seen on the ticket page.
Adding intent labels for subroutines throughout clubb. Remaining files now have intent comments for subroutines. Additionally, all lines are now less than 100 characters. For ticket #942. Results are BFB identical.
Eliminating l_single_C2_Skw flag. Additionally, this commit also eliminates C2, C2b, and C2c. Since the flag along with the other variables are output to the .nc files, this commit will be BIT_CHANGING since these variables no longer exist. This is for ticket #926.
Eliminating l_single_C2_Skw flag. Additionally, this commit also eliminates C2, C2b, and C2c. Since the flag along with the other variables are output to the .nc files, this commit will be BIT_CHANGING since these variables no longer exist. This is for ticket #926.
Eliminating l_single_C2_Skw flag. Additionally, this commit also eliminates C2, C2b, and C2c. Since the flag along with the other variables are output to the .nc files, this commit will be BIT_CHANGING since these variables no longer exist. This is for ticket #926.