-
Notifications
You must be signed in to change notification settings - Fork 3
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
Snicar-ad port to Icepack from MPAS-SI #7
Snicar-ad port to Icepack from MPAS-SI #7
Conversation
… standard dEdd config
clean up trailing blanks
Add calls to icepack_init_radiation to icepack driver
Add some SNICAR SSP table checks, aborts, etc
new namelist variables and options. Add new namelist to icepack_in. Add snicar and snicartest options. Minor updates to namelist output
Update snow table implementation and add SNICAR SSP Tables
Update ssp data for dEdd_snicar
…ata for use_snicar
Add additional SNICAR SSP fields for aerosols, BGC
I am changing the snw_ssp_table defaults and also making icepack_warnings_getall public as requested by @akturner at https://acme-climate.atlassian.net/wiki/spaces/ICE/pages/3526492170/Simulation+results+and+comparisons. @apcraig it looks like we have both ICE_SNICARHC and USE_SNICARHC available in the code and/or scripts. I'm guessing that ICE_ is desired in order to avoid potential conflicts with other components in a coupled system, and so I should change the USE_SNICARHC instances to ICE_SNICARHC. Is that right? |
Regarding ICE_SNICARHC and USE_SNICARHC. ICE_SNICARHC is the variable name in cice.settings. USE_SNICARHC is the CPP in the code. So we want to keep both as they are now. ICE_SNICARHC = true/false and that turns on -DUSE_SNICARHC in the Makefile. Hopefully that makes sense? When you say you're changing the snw_ssp_table defaults, does that mean you are changing the default in Icepack to "snicar". That would cause some problems. That would mean ICE_SNICARHC should be default "true" and that means the big snicar table is compiled by default when it's only needed when we use "dEdd_snicar_ad". The reason we have USE_SNICARHC is to avoid building that big table by default. That increases compile time significantly (say from 1 minute to 2 minutes). It may not sound large, but when running a test suite or debugging, it does matter. |
I was responding to your comment above, suggesting to document USE_SNICARHC and correct the snw_ssp_table default value:
ICE_SNICARHC is documented in ug_case_settings (in Icepack, at least), and maybe you could correct/document the other parts so that we'll all know how this is supposed to work? :) |
Actually, I changed snw_ssp_table in icepack_in from 'test' to 'unknown_snw_ssp_table', which should be fine. |
Sorry if I wasn't clear. In the user guide, we should add USE_SNICARHC to the CPP list (section 3.4.1), https://cice-consortium-icepack.readthedocs.io/en/latest/user_guide/ug_case_settings.html#table-of-c-preprocessor-cpp-macros. With regard to the default setting of snw_ssp_table, I think you have it defined as "snicar" in the user guide, it should be "test", see line 268 is ug_case_settings. Finally, it's possible that "unknown_snw_ssp_table" will cause an abort in the implementation, we should check that and fix if it does. Once that works, we should also check that we don't need to modify some of the other test settings. Let me know if I can help with anything. |
To make icepack_warnings_getall truly public, you also have to add
to icepack_intfc.F90. That's how outside codes will get access to it. |
…nts. Also changes in precision for several constants in compute_dEdd_5bd and compute_dEdd_3bd, which might change answers in some configurations. Added new fswthru diagnostics for 5bd (not tested). Flagged rnilyr reciprocal bug and another bug in the 5-band interpolation, to be fixed separately.
…um icepack PR#400; bug fix for 5-band interpolation weights
I haven't thoroughly tested the last 2 commits and might still need to work on the code some more, but I think this PR is getting close. Commit 64ab4a1 is massive -- ignore the whitespace differences and it's still massive -- perhaps it would be better to back off on that for the Icepack merge, but this exercise did reveal some previously undetected bugs. This commit also could cause answer changes due to some precision changes, which I probably should have committed separately. The second commit (9ae618c) fixes the bugs that have been found so far in icepack_shortwave.F90:
The (not-yet-fixed) bugs are flagged with 'BUG' in 64ab4a1. This commit will definitely cause answers to change for some cases, as in CICE-Consortium#400. (There are going to be conflicts regardless, so I didn't try to pull the changes from that PR and instead implemented them directly. Heads up for @apcraig.) @njeffery, the rsnw weights bug might affect the answers in E3SM runs too. |
This looks great to me. I can test for bit-for-bit vs CICE-Consortium main. Are there bugs fixes in this version that need to be implemented in CICE-Consortium (i.e. the nsky=1 bug?). I can add those to CICE-Consortium#400. |
The new bug only affects the 5-band dEdd code, so it’s not in consortium main. Some of the precision changes might be applicable but I don’t think there is a pressing need to fix those yet, unless you just want to. Thanks!
|
@eclare108213 : could you point me to the weights file that had the bug? Thanks |
nr = ceiling(rsnw(ksnow)) - 30 + 1 ! hardwired min radius = 30 | ||
delr = (rsnw(ksnow) - floor(rsnw(ksnow))) & ! hardwired delta radius = 1 in table | ||
/ (ceiling(rsnw(ksnow)) - floor(rsnw(ksnow))) ! denom always = 1? | ||
ks = ext_cff_mss_ice_drc(ns,nr-1)* delr & ! echmod: BUG delr factors opposite 3bd case |
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.
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 @eclare108213 . I'll set up some runs in E3SM to test the impact of this bug.
Testing against our "dEddfix1" branches of CICE+Icepack in CICE-Consortium, the only difference seems to be in the alt04 again. I might try to get them bit-for-bit again. Any chance you can point out the new "precision changes". I'm also fine just leaving things as they are at this point, with alt04 producing different results on the Consortium and E3SM versions for now. |
@apcraig I was afraid you might ask that. The easiest way to find them is to search the diffs for _dbl_kind. I also changed a 0.01 to p01, and there were a couple of places where 1. became c1 (although I think those were not actually precision changes). That should catch all of them, but you could make sure by searching the diff for all of the named constants at the top of the shortwave module (use icepack_constants only: p01, c1, etc). Sorry I didn't separate those into a unique commit - I was fixing things as I came across them. |
@eclare108213, no problem. I'll do some diffs and see if I can apply the changes to the Consortium version. Thanks for pointing out what to look for. |
My initial results were incorrect, too many versions of the code laying around. I believe the latest changes did not change the results for the CICE test suite. So I don't think we need to port any of the new precision changes to the Consortium version. But I may do it anyway and recheck. |
@apcraig, please, can you link to your test results in the main PR template above? |
I updated the test results section in the PR template. |
Thank you! I'll merge this now to keep things moving forward. |
8aef3f7
into
E3SM-Project:cice-consortium/E3SM-icepack-initial-integration
This PR contains snicar-ad changes to dEdd for snow-covered surfaces, including 3 sets of bug fixes.
Code ported from E3SM/MPAS-SI by @eclare108213 and @apcraig
Full test suite with modified CICE run on cheyenne, https://github.com/CICE-Consortium/Test-Results/wiki/cice_by_hash_forks#8fbe45fab39f24fc6f136a57ce1475b7f20c64a6. All results are bit-for-bit with CICE Consortium version with same dEdd bug fixes except dynpicard which is expected.
This (was) a draft PR. Still to be done:
The 5-band snicar-ad additions to dEdd shortwave are being ported from MPAS-SI to Icepack. The 'ad' designation for snicar is included in the user interface (icepack_in) for consistency with the E3SM land component, but this modifier is dropped inside Icepack since it is the only snicar option.
Bug fixes:
The cleanup in commit 64ab4a1 is massive but did reveal some previously undetected bugs. This commit also could cause answer changes due to some precision changes. These bugs were fixed in this PR:
This commit will definitely cause answers to change for some cases relative to the original code, as in CICE-Consortium#400. There are going to be conflicts regardless, so I didn't try to pull the changes from that PR and instead implemented them here directly.
Significant changes:
Other changes: