QuadTune: Set plot-type flags in set_up_inputs.py and then feed them into create_nonbootstrap_figs.py. (details)
QuadTune: Move import statements to top of file. Move abbreviateParamsNames to set_up_inputs. Neaten source code a bit. (details)
QuadTune: Create config file where a user can input "namelist" info about his obs and simulations. Also add an example config file so that the user can keep multiple namelists. Do minor refactorings. (details)
QuadTune: Rename "linSoln" to "globTuned" in order to denote the global simulation result after tuning. Add docstrings to more functions. (details)
Hot fix to GPU code. These _init variables need to be copied to the GPU (details)
Second hot fix for more _init variables that need to be copied in. RESOLVED:ed9ae72a5eb28dbc036dd3e14b9312eea840feac (details)
Third hotfix of the day. This last change teased out a sneaky potentially fatal bug for cases using l_cloud_sed=.true., making this a BIT_CHANGING fix. Also need to include BIT_CHANGING:13ad3cfe7872df2fe91250265f4a81baa621a882 because that was a fix to a fatal bug in some cases. Also including some other small fixes that weren't breaking any tests, but might've caused problems in the future. (details)
Fix that causes BFB GPU tests to break. We need to copy these variables to the CPU before outputtin to disk. It's very unclear why the BFB GPU test ever passed without this. (details)
Running CLUBB with l_stability_correct_tau_zm = .true. now requires (details)
These changes were accidentally made during the previous commit. The are (details)
Technically, the following two commits are not BFB (details)
Small bug fix that has somehow gone unfound until recently. RESOLVED:f9d92113871bdf87b5e3147db6740ab654dc0967 (details)
Changing readme to add BIT_CHANGING:71eb9b3c5fd65c33905f17be8476a1dea89a2511 since that commit was a bug fix, so technically it was bit changing. (details)
Removed renaming operators `=>` and wrapper subroutines from silhs_api_module (#1240) (details)
Getting rid of a couple of worthless lines of code. It's possible this changes an output stat, making this commit BIT_CHANGING, but not actually answer changing.
* Added the necessary grid variables to the grid type (they're hardwired for an Ascending Grid for now).
I also made the necessary changes, using those new variables, to advance_wp2_wp3_module.F90.
* Added code to generalize advance_xm_wpxp_module.F90.
* Updated some of the boundary conditions for generalization in grid_class.F90.
* Developing a unit test for CLUBB's grid functions.
* Adding the ability to toggle on or off the reverse direction grid test.
* Updating for development of a unit test comparing the ascending and descending grids.
* I updated the generalized grid unit test to complete testing on all the variables within the grid derived type for both the ascending and descending grid directions.
* I updated the code to work symmetrically for an ascending and descending grid for the zm2zt and zt2zm functions.
This commit, as well as the previous commit, is BIT_CHANGING.
* Updated to improve notes and comments in grid_class.F90 and to enhance the reverse grid unit tests.
* Got rid of the compiler warnings in the new reverse direction grid unit test.
* Updating the reverse grid unit tests so some random perturbations are added to the grid heights when they are declared either on the thermodynamic grid or on the momentum grid.
* Made some changes where the fstdout stream is exclusively used and added some print statements.
* Mean advection has been modified for generalized directional gridding and a test of the calls to mean advection has been added to the reverse direction unit test.
* Updating diffusion so results are bit-for-bit identical between using an ascending grid and using a descending grid at -O0 optimization.
This now works for both standard diffusion and also diffusion with the l_upwind_Kh_dp_term flag turned on.
* I forgot to add the zm diffusion test, but the results are the same -- all pass!
* I have completed the unit tests for the PDF turbulent advection subroutines and modified the appropriate sections of code so that ascending and descending grids produce a bit-for-bit match wiht -O0 optimization.
* Updated code for producing a bit-for-bit match (on -O0 optimization) when comparing ascending grid direction against descending grid direction for advance_wp2_wp3.
* The check for the LHS of advance_xp2_xpyp now passes.
* The ascending vs. descending bit-for-bit test (wiht optimization set to -O0) now passes for advance_xp2_xpyp.
* I have successfully generalized the grid for advance_windm_edscrlm. Ascending and descending runs now produce bit-for-bit results to each other under -O0 optimization with the default flag configuration.
* Fixing the ascending vs. descending grid test for advance_windm_edsclrm for the case where l_imp_sfc_momentum_flux is set to false.
* Only perform check when l_predict_upwp_vpwp is turned off.
* This commit makes an ascending vs. descending test work for all cases for advance_xm_wpxp when the mono flux limiter is turned off.
* The ascending vs. descending grid tests are finally working with the monotonic flux limiter turned on (default settings).
* Removed some commented-out prints that I accidentally added during the last commit.
* Updating positive_definite_module.F90 so that it works for ascending vs. descending grids.
* The ascending vs. descending grid generalization test now works for the Lscale_up portion of mixing length.
* The ascending vs. descending grid generalization now works successfully for Lscale_down.
* Lscale is now generalized for ascending vs. descending gridding.
* Updated for generalizing sfc_varnce_module
* Updating advance_clubb_core_module for grid generalization.
* With this commit, the ascending vs. descending grid tests works by calling advance_clubb_core twice from clubb_driver. They produce bit-for-bit results on -O0 optimization for all intent(inout) and intent(out) variables found in the call to advance_clubb_core. This has only been tested for the default flag configuration.
* I am updating the ascending vs. descending grid test to check both pdf_params and pdf_params_zm.
* I added pdf_implicit_coefs_terms and the sclr and edsclr family of variables to the list of variables that are checked after coming out of the calls to advance_clubb_core in the ascending vs. descending bit-for-bit grid test.
* I added an improved display for the print messages for the ascending vs. descending grid test.
* I moved the generalized grid test to its own file, which is called from run_clubb.
* I removed much of the junk and clutter from the code. It had been added over time for local tests of ascending vs. descending grid types.
* Adding the l_generalized_grid_test flag to the code.
* I needed to alter the monotonic flux limiter that I just merged in from the master branch so that the ascending vs. descending grid generalization test works once again.
* Updated a piece of code in the solve routine for the monotonic flux limiter for the grid generalization test.
* Clarified some comments
* I added a Jenkins file for the new clubb_generalized_vertical_grid_test, which performs a run comparing ascending and descending grids with -O0 optimization and expects bit-for-bit results.
* The l_rev_direction_grid_test (part of the G unit tests) needs to be compiled specially with -O0 optimization. Thus, I will set the flag to run this test to .false. by default. A special Jenkins test will be made to compile with the correct optimization and run only this particular test.
* I updated the generalized vertical grid Jenkins test to turn off sponge damping (thlm and rtm sponge damping) in the case files for the CGILS S6, S11, and S12 cases.
* Caught a stats bug I had previously introduced for the um_ta and vm_ta stats terms when l_predict_upwp_vpwp is turned off.
I changed the variable type within grid function flip from dp to core_rknd. I then needed to make some changes to BUGSrad driver to compensate. The "dp" issue was discovered when WRF-CLUBB wouldn't compile because of it (discrepancy between dp and core_rknd in WRF-CLUBB that caused compilation errors for calls to flip from advance_xm_wpxp, etc.)
Eliminate GOTO statement in stats_clubb_utilities (#1233)
* Eliminate jump in stats_clubb_utilities CLUBB ticket #975
Hard removed end parameter from read call GOTO marker `100` removed since `end` parameter is gone and added output of read error code to help debugging.
Before this change, if the read encountered an EOF error and the jump to marker 100 happened, CLUBB would continue running (err_code=clubb_no_error) but no output files would be created. After this change, err_code will be set to clubb_fatal_error and CLUBB prints an error message and returns.
Fixed logical evaluation at the end of the bash script Commented out the table outputs in the Jenkins file because they don't work and nobody would look at them anyways
I have no idea if it's appropriate to include gr in this statment, but I'm just basically throwing dung at the wall at this point. We'll see what sticks.
Added a special G unit Jenkins test for the Reverse Direction Grid Unit Test. This test is different than the other G unit tests because it requires a special compilation at -O0 optimization.
I accidentally committed G_unit_tests.in as part of my previous commit. I didn't want to do that. This commits reverts the previous commit for only that file.
I discovered that I inadvertently change an $acc statement that is found in the monotonic flux limiter (why is it ALWAYS the monotonic flux limiter?) back in be90159. In this commit, I am setting the $acc statement back to what it is supposed to be.
The generalized grid test should not output a clubb fatal error when it fails. Rather, they should output a unique error code specific to their failure. Otherwise, failures due to numerical instability, etc., will be confused as generalized grid failures in the Jenkins tests.
I added a stripped down version of the run_bindiff_w_flags.py script that simply reads in the JSON file and runs CLUBB with all the different flag setting groups listed. It stores the flag files and the model output in the working directory. It does not do anything fancy like checkout the git repository and compile or compare results.
One of the previous issues with this python script is that it suppressed the output of the bash script it was running (run_scm_all.bash). It is important to see what cases successfully ran and what cases failed. I have altered the script so that it doesn't suppress the output of run_scm_all.bash.
Note: the output from the bash script won't be printed to output until all the cases in run_scm_all.bash have been run to completion.
I am setting the exit_code for the python script to be based on what is passed out from the bash script for the set of run_scm_all.bash commands for each flag grouping. It any flag test fails, the overall exit code from the test will also be set to a fail result.
Changing the generalized vertical grid Jenkins test to use the new run_clubb_w_varying_flags.py python script instead of the traditional run_scm_all.bash.
When the run_clubb_w_varying_flags.py script is running a generalized vertical grid test, use a stats file that has a greatly reduced number of stats. Stats aren't important for this test. We don't want to eat up too much storage space or waste extra time with stats.
QuadTune: Remove dependence of QuadTune code on file analyze_sensitivity_matrix.py. This required copying some functions from analyze_sensitivity_matrix.py to other files.
QuadTune: Create config file where a user can input "namelist" info about his obs and simulations. Also add an example config file so that the user can keep multiple namelists. Do minor refactorings.
* Updated the generalized vertical grid test to use the run_bindiff_w_flags_config_core_flags.json file, which performs 18 overall flag configuration file tests and includes almost every configurable model flag found in CLUBB core.
* Fixed a bug. This was caught by running the new hybrid PDF after compiling with the gfortran debug compiler script.
* The CLUBB code requires l_min_xp2_from_corr_wx and l_enable_relaxed_clipping to always have opposite values.
* Finally fixing the bug where Cx_fnc_Richardson needs to be interpolated to thermodynamic levels in order to be used as C11_Skw_fnc.
* I fixed an issue with the generalized grid when the expldiff of rtm and thlm is enabled.
* The variable gr now needs to be passed into subroutine pvertinterp (which was formerly found in interpolation.F90) in order to generalize the grid. This created a circular dependency, for grid_class references interpolation, and now interpolation needed to reference grid_class in order to use type grid. This road block prevented the model from compiling. I moved subroutine pvertinterp to advance_clubb_core in order to solve the problem.
* Moving the flag required editing the delimiters.
* I fixed a bug in the generalized grid test code that was resulting in pdf_implicit_coefs_terms scalar variables not being read in correctly for the flipped (descending) grid.
* Improved some error handling in clubb_driver.F90
* Fixed an issue where ascending and descending grids were producing results that were not bit-for-bit to each other where centered discretization was used. The issue occurred because 3 or more terms were being added together in opposite orders between ascending and descending grids. This fix ensures terms are added in the same order.
* Commiting changes to keep calculation order the same for additions involving at least 3 terms from different vertical levels between ascending and descending grids.`
* I removed bugs that were causing failures of the bit-for-bit matching test (at -O0 optimization) between ascending and descending grids. This group of fixes related to the code that calls pdf_closure twice and calls the trapezoidal rule code.
* I have fixed the ascending vs. descending grid error for the situation where l_partial_upwind_wp3 is enabled.
* I am removing the flag setting of l_mono_flux_lim_thlm to .false. in flag group 15 of the ascending vs. descending grid tests.
Problem: Removing the constraints on thlm was causing one case (MC3E) to blow up with a floating point exception in Morrison microphysics. The issue was that a spike caused an extremely cold temperature to be found. There is a line of code that takes the difference between freezing/melting point temperature (273.15 K) and the temperature at the grid level or sample point, multiplies it by constant, and then takes EXP to that product. The large difference between temperature and freezing/melting point, owing to the spike, caused a numerical overflow to occur and the case to fail with a FPE.
Solution: There isn't any relevant code found in the monotonic flux limiter that doesn't get tested if l_mono_flux_lim_thlm remains at a setting of .true. The other parts of conditionals are covered by setting l_mono_flux_lim_rtm to .false. The only parts of the code unique to l_mono_flux_lim_thlm are the recording of stats related directly to thlm. Thus, it makes sense to keep l_mono_flux_lim_thlm set to .true. for the stability of the run while turning off the other monotonic flux limiter flags.
* Updated the code to use break or return when clubb fatal error is encountered, which is more consistent with the way CLUBB does business now, then simply Fortran stop in place. This also allows the generalized grid test to finally pass for all cases and all flag sets.
Third hotfix of the day. This last change teased out a sneaky potentially fatal bug for cases using l_cloud_sed=.true., making this a BIT_CHANGING fix. Also need to include BIT_CHANGING:13ad3cfe7872df2fe91250265f4a81baa621a882 because that was a fix to a fatal bug in some cases. Also including some other small fixes that weren't breaking any tests, but might've caused problems in the future.
* I added new subroutine pdf_hydromet_microphys_prep to encompass the code that calls the hydrometeor PDF and then ultimately handles the setup of SILHS sample points when SILHS is in use.
* Placeholder subroutine for SILHS grid generalization test.
* I have now connected the new subroutine to run_clubb. The results for all cases match bit-for-bit to the previous revision.
* Cleaning up from the refactoring of the hydrometeor PDF and SILHS code into a wrapper subroutine.
* I'm moving pdf_hydromet_microphys_prep to its own file to avoid circular dependency once it finally needs to be called from the generalized grid test code soon.
* Added some code to the SILHS generalized grid test.
* Changes to make this a fully functioning grid generalization test for the part of the microphysics code that encompasses setup_pdf_parameters and hydrometeor_mixed_moments.
* I have completed the code for the SILHS generalized grid test.
* I generalized precipitation fraction for ascending vs. descending grid.
* Fixing a bug that I noticed in the precipitation fraction calculation when the component precip frac calculation was set to option 1 (which is currently not the default).
* The code should now be successfully grid-generalized for SILHS. The ascending vs descending grid test should work now for all cases.
* Updating the core flags .json file to change some of the SILHS flags.
* I moved the call to advance_clubb_core_api (the default run option) to the top of the "if" block, ahead of the grid generalization test option that is now in the "else" block.
* Adding a new, hardwired constant flag called l_ascending_grid and setting it to true in clubb_driver.F90.
* Keeping lines under 100 characters in length.
* Making it so the ascending vs. descending grid tests pass for the l_lh_random_start flag.
I updated adj_low_res_nu for use with a generalized grid. It is not called from within advance_clubb_core or from within SILHS. It is not necessary to be generalized for tests within standalone CLUBB. However, it is necessary to generalize this code for use within host models, particularly for CAM and E3SM.
Since the call to adj_low_res_nu is not tested by CLUBB's main ascending vs descending grid test (since it is not called from within advance_clubb_core or from SILHS), I added it to the reverse grid direction G Unit test so that the results from ascending vs. descending grids get checked.
Added err_info type to CLUBB to extend old err_code integer flag CLUBB ticket #975
Created a new err_info type replacing the old err_code integer. It contains MPI rank and (OMP) chunk index so we can identify the specific process that caused an error. It also contains latitude and longitude so a person trying to debug a host model run can pinpoint the column that caused an error. It contains error headers that combine all the info into a string that can be printed when an error happens. And it comes with subroutines that handle initialization, value setting, and cleanup.
Host models will be modified accordingly.
Possible TODO: Implement a subroutine that identifies the index of the column with the error after the fact so we can have more specific info at the higher call levels by applying `where` to the err_code member array.
Fix that causes BFB GPU tests to break. We need to copy these variables to the CPU before outputtin to disk. It's very unclear why the BFB GPU test ever passed without this.
Running CLUBB with l_stability_correct_tau_zm = .true. now requires setting l_damp_wp2_using_em to .false. Thus, these two settings now appear together in flag set 9. Since l_damp_wp2_using_em was already set to .false. for flag set 11, I simply swapped flag sets for l_damp_wp2_using_em = .false. (moved from flag set 11 to set 9) and l_C2_cloud_frac = .true. (moved from flag set 9 to set 11).
Removed renaming operators `=>` and wrapper subroutines from silhs_api_module (#1240)
CLUBB ticket #1223 * Removed renaming operators `=>` from silhs_api_module This just affected latin_hypercube_2D_output_api and stats_accumulate_lh_api.
* Removed definitions of wrapper subroutines from silhs_api_module Removed wrappers est_kessler_microphys_api, lh_microphys_var_covar_driver_api, set_default_silhs_config_flags_api, initialize_silhs_config_flags_type_api, print_silhs_config_flags_api, latin_hypercube_2D_close_api from silhs_api_module.
Fixed error output for run?scm?all.bash, added some missing error checks to CLUBB CLUBB ticket #975
* Fixed error output issues for run_scm_all.bash - Changed tail $TMP_OUT to cat $TMP_OUT so we can see the entire stderr output of CLUBB in the log - Added `if allocated` check to subroutine finalize_t_dependent_forcings in time_dependent_input.F90 to avoid runtime errors - Removed unnecessary write statement in clubb_standalone.F90
* Added missing err_code checks - Added err_code checks so we don't get false negative error messages
I am adding a Jenkinsfile for a new CLUBB generalized vertical grid test that uses flag sets consisting of specialized flag settings that are found in host models of which CLUBB is a part.
I am adding a second set of host flags as part of the generalized vertical grid test for host model flags. Flag set 2 consists of flag settings that are found in the clubb_silhs_devel branch of CAM.
Fixed and equalized NaN checks in lapack_wrap (#1246)
See CAM pull request larson-group/CAM#188
Added debug_level_at_least(0) checks where missing and changed debug_level(1) to 0 in lapack_band_solve, so the new CAM CLUBB error handling test can do what it's supposed to do.
I updated run_bindiff_w_flags_config_host_flags to add flag set 3, which, from what I can tell, contains the default CLUBB flag settings for E3SM in the maint-3.0 branch.
For the long-duration clubb_generalized_vertical_grid_test, I am shortening the duration of the MC3E runs to half their normal number of timesteps in order to cut down on the time it takes to do the run.