-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Set non-trivial sunlit flag in example data for better test coverage #36
Conversation
Set half of the columns in the example data to night values for better test coverage. This is accomplished by setting the sunlit flag to 0 for a selection of points, via: ``` ncap2 -O -s 'sunlit(:617) = 0;' cosp_input_um.nc cosp_input_um.nc ```
Change `Npoints` in driver namelist to process all points in the example data. This is necessary to make sure that we process both sunlit and non-sunlit (night) columns, since the previous commit set half of the columns to night and half to day. This also makes the example data look more like a single orbit from a polar orbiter, with half of the points being night and half being day.
Revert previous commit to set the first half of columns to night and instead set the second half to night. This allows these changes to be bit-for-bit if `Npoints = 153` in the namelist (the previous default).
@dustinswales changes to add night columns to the input data. Note that I initially chose to set the first half to night, but on second thought I decided to set the second half to night and leave the first half alone. This means that if you run with 153 points (the old default), you can confirm that there are no non-BFB changes in the code, but if you keep the new default of
but if I set
I thought this might be somewhat more desirable, just because BFB with previous commits could be confirmed, but if you prefer the alternative it's an easy change. |
@brhillman |
@brhillman @dustinswales thanks a lot for this, it looks very neat to me. |
@alejandrobodas doing a little digging, it looks like these are joint Cloudsat/MODIS diagnostics, so it would make sense that these are affected by the sunlit mask. Digging a bit further, it looks like the routine that calculates these (
Since the first check is |
@brhillman @takmichibata Do you agree? Thoughts? |
@dustinswales I think actually initializing to EDIT: actually, that might not work, since
|
@brhillman thanks for looking into this so quickly. |
@alejandrobodas |
Closing this PR. (We have a global snapshot of the UM available for testing day/night masking). Will open up issue for masking issue in cosp_diag_warmrain. |
The warm rain diagnostics did intend to use only daytime cloudy scenes, but actually the current code did not explicitly exclude dark-scene columns from the analysis. To fix this bug, this pull request modifies the treatment of dark-scene columns as suggested by @brhillman and @dustinswales at the previous PR from 2019 (CFMIP#36).
The warm rain diagnostics did intend to use only daytime cloudy scenes, but actually the current code did not explicitly exclude dark-scene columns from the analysis. To fix this bug, this pull request modifies the treatment of dark-scene columns as suggested by @brhillman and @dustinswales at the previous PR from 2019 (CFMIP#36).
Previously the example data that is used for the example
cosp2_test
driver and for the regression tests contained a trivial sunlit flag that designated all columns as daytime columns. This meant that regression tests were not properly testing fields that should be masked for night columns. This PR modifies the existing input data (cosp_input_um.nc
) to set the second half of the columns to night by modifying the sunlit flag viancap2 -s 'sunlit(0:617) = 0;' cosp_input_um.nc cosp_input_um.nc
). In order to include both sunlit and non-sunlit columns, the input namelist is also modified to process all points in the input file (previously it only processed 153 of the 1236 points. Runtime is certainly increased, but the cost is still trivial (1 second total time vs 0.2s total time in my tests on my system). Note that these changes will result in differences from baselines for any field that is affected bysunlit
if the number of points processed includes the night points (which is set by default now in the namelist), but bit-for-bit can be confirmed by settingNpoints
back to 153. Fixes #35