-
Notifications
You must be signed in to change notification settings - Fork 340
Include abm = 13 values when determining dominant abm in mksurfdata_esmf #3224
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
Include abm = 13 values when determining dominant abm in mksurfdata_esmf #3224
Conversation
|
@slevis-lmwg Hi Sam, you mentioned that abm = 13 is a netcdf Fillvalue in the raw dataset.", I don't recall setting 13 as a FillValue in the abm raw data. If you are sure it is, then simply removing the FillValue setting (or assign another FillValue as you suggested if a FillValue must be specified when making surface data) could solve the dominant value selection issue. For example, if the coarse grid (e.g. 2 deg) has more than half of the 0.5-deg with an abm value of 13, then the dominant method should get abm=13 for the 2-deg grid cell. |
samsrabin
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This unfortunately doesn't solve the problem. Fang's comment here means that a value of 13 actually needs to be ignored during interpolation, because it indicates the gridcell in question has no crop fires in the observations.
Additionally, there's this that I pointed out:
Because "month" is a modulo variable, I don't think anything other than dominant (mode) or nearest-neighbor should be used here. Imagine two gridcells, one with December and the other with February. A naive mean or median interpolation would give July as the result, when in reality it should be January.
|
@lifang0209 I guess your proposed handling of 13 makes sense too—if more than half of the contributing gridcells have no crop fire, then the interpolated gridcell shouldn't either. It would be better, though, if we could scale the fraction of cropland that gets burned based on fraction of contributing gridcells with crop fire. |
|
Ohh, sorry @slevis-lmwg, I misunderstood—it looks like there is already code to get the dominant month, and you're trying to fix it! But then the issue title—'mksurfdata_esmf needs to interpolate "abm" with dominant instead of average'—is confusing. |
samsrabin
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems like this does address the issue. However, it'd be good to have unit testing of this function to make sure it's behaving properly. I will plan to at least start the file structure needed for unit testing, but after @slevis-lmwg adds comments and improves variable names throughout the subroutine so that I know what's what.
samsrabin
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, Sam. I've added a request along with some TODOs where I think commenting or refactoring will be helpful.
Remove broken FTorch submodule
|
Testing on derecho |
|
I made a new branch tag with this merge: |
|
@slevis-lmwg Could you tell me the path of the new 1.9x2.5 surface data file on the derecho generated using your revised code? I’d like to check it and ensure everything looks correct. |
|
@lifang0209 |
|
@slevis-lmwg Thanks, Sam! I checked your 1.9x2.5 NC file, and the results look good. I can now remove the cropland coverage ≥10% condition from [PR #3204]. |
This should be the file that you need: |
|
@slevis-lmwg @samsrabin Using the dominant abm is definitely more reasonable than the earlier approach of averaging abm in regridding. |
|
@lifang0209 Can you share the script you're using to test this? That will help us solve it once and for all. |
|
@lifang0209 let me clarify what the abm regridding algorithm did before and does now and let's try to come up with a solution.
I have two requests that I can think of:
|
|
However, I would be open to using an updated raw dataset. Currently the raw dataset has values from 1 to 13, and the code uses 14 over ocean grid cells. You could update the file to set non-croplands (including oceans) to 14. Then the dominant algorithm would find fewer 13s than it does now, so values from 1 to 12 would increase again. |
|
@slevis-lmwg Changing non-cropland from 13 to 14 in the raw data does not resolve the issue.
As shown in Fig. 1. areas with cropland exceeding 50% at coarse grid resolution are small, and crop fires generally occur in grids where cropland coverage exceeds 10%.
The issue primarily arises in regions with low cropland coverage, and its impact is not small. To get reasonable abm and avoid crop fire simulations sensitive to resolution, the methods I could think of: Please let me know your thoughts or if any part requires further clarification. |
|
In the 0.5 deg raw data, non-croplands (including oceans) are set to 13, so option (2) works if we set the FillValue attribute from value 13 in mksurfdata_esmf and add a condition statement in the fire code. No need to add setting of 14 for oceans in mksurfdata_esmf. Right? |
|
@lifang0209 I shared my calendar with you. I think we will resolve this more easily with a conversation because I (or both of us) may be misunderstanding. Feel free to check my availability and send me an invite. |
|
Also, in your abm plots please show value 13, because it represents "no crop fire" rather than "invalid value" from my understanding and, if so, it is important to see this value's distribution. |
|
@samsrabin has expressed interest in joining our meeting. |
|
@slevis-lmwg Tue, July 1, 5:30–6:30 PM, or Wed, July 2, from 4–5 PM work for me. Which do you prefer? I'm flexible with either Zoom or Google Meet. |
|
I selected July 2nd, 4-5 pm Mountain Time, with Google Meet. |
|
@slevis-lmwg Hi Sam, the raw 0.5° abm plots (with the distribution of 13 shown in gray): In the raw data, both the ocean and areas without crop fires on land are set to 13. Now, with the new raw abm data (/glade/u/home/fangle/mksrf_abm_0.5x0.5_simyr2000.c250701.nc), we can retain the high resolution of abm for 0.5° or 1° simulations, avoid regridding issues in low cropland coverage regions, and resolve crop fire simulation sensitivity to resolution. Remaining tasks: This is the best and simplest solution I could think of. Would it be better if we complete the remaining tasks before our meeting? |
|
Thank you @lifang0209 |
|
It's not reverting to the original—dominant value is used rather than the average. |
|
From meeting with @lifang0209 @samsrabin: |



Description of changes
mksurfdata_esmf interpolates abm (ag. fire peak month) from the raw dataset to fsurdat with a "dominant value" algorithm. However, from what I can tell, the dominant value gets selected only from valid month values (1 through 12) which leads to valid month values appearing in areas of limited crop coverage and crop fires overestimated by approximately 10–20 Mha/year in these regions.
I propose a very simple change in the code. I will not have a chance to try it out before derecho returns to service. My current concern is that abm = 13 is a netcdf Fillvalue in the raw dataset. If that causes trouble, I may need to replace the file's Fillvalue.
Specific notes
Contributors other than yourself, if any:
@lifang0209 @samsrabin
CTSM Issues Fixed (include github issue #):
Resolves #3188
Resolves #2663
Are answers expected to change (and if so in what way)?
Changes fsurdat variable abm
Any User Interface Changes (namelist or namelist defaults changes)?
No
Does this create a need to change or add documentation? Did you do so?
No
Testing TODO: