-
Notifications
You must be signed in to change notification settings - Fork 317
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
Logic for initializing C isotopes and maybe other variables incorrect when using init_interp #67
Comments
Misc notes I have on this issue from my water isotope branch:
Initial patch against clm4_5_16_r249 from the water isotopes branch. |
Here is the patch linked from the above gist, in case it gets deleted: |
It looks like the last work I did on this issue was on this svn branch from r253: https://svn-ccsm-models.cgd.ucar.edu/clm2/branches/andre_restart_metadata/ I believe this has all the infrastructure changes needed to implement this and it was tested on the water isotopes branch. I had a set of incomplete changes on top of this branch applying the infrastructure to the carbon isotopes. I can not find that sandbox, but I believe it was stalled awaiting some changes based an email exchange with @billsacks on 2017-08-24:
|
(Not having looked back at the notes in this issue for a while.) I think that resolving this issue will also set water isotope values correctly when not using init_interp, when they aren't on the finidat_file. If not, we need a separate issue for that. |
I'm adding an error-check to the code that prevents running init_interp from a case without C isotopes to a case with C isotopes. Once we have fixed this issue, search the code for references to "BUG... #67" for things to remove related to this error-check. |
Due to ESCOMP#67, interpolation from a case without carbon isotopes to a case with carbon isotopes yields incorrect initialization values for the carbon isotopes. Now that we're turning carbon isotopes on via some semi-out-of-the-box usermods (for cmip6), it is becoming more important to check to make sure someone doesn't shoot themselves in the foot this way. This commit should be backed out once ESCOMP#67 is resolved
Due to ESCOMP#67, interpolation from a case without carbon isotopes to a case with carbon isotopes yields incorrect initialization values for the carbon isotopes. Now that we're turning carbon isotopes on via some semi-out-of-the-box usermods (for cmip6), it is becoming more important to check to make sure someone doesn't shoot themselves in the foot this way. This commit should be backed out once ESCOMP#67 is resolved
Due to ESCOMP#67, interpolation from a case without carbon isotopes to a case with carbon isotopes yields incorrect initialization values for the carbon isotopes. Now that we're turning carbon isotopes on via some semi-out-of-the-box usermods (for cmip6), it is becoming more important to check to make sure someone doesn't shoot themselves in the foot this way. This commit should be backed out once ESCOMP#67 is resolved
CMIP6 compset modifiers; usermods for output; other output enhancements (1) Support %BGC-CROP-CMIP6DECK and %BGC-CROP-CMIP6WACCMDECK compset modifiers, so that we can turn on the necessary options (output-related and others) via new CMIP6-specific compsets. (2) Turn on carbon isotopes in CMIP6 runs (from Erik Kluzek) (3) Remove setting of CCSM_BGC=CO2A in the cmip6 usermods (4) Add usermods directories for getting typical extra output that's wanted in many cases: output_crop, output_crop_highfreq, output_bgc, output_bgc_highfreq, output_sp, and output_sp_highfreq. These can be enabled by adding something like '--user-mods-dir output_crop' on the create_newcase line (that short-hand works for an I compset; for F or B compsets, you need to provide the full path to the usermod directory). (4) Allow holes in the number of history tapes. Holes are cases where, for example, we have h0, h1 and h3 tapes, but no h2 tape (because there are no fields on the h2 tape). (This is needed for (3).) (5) Fix reading and writing of 1-d logical global arrays. This fixes #24 for real (rather than just preventing an attempt to read/write 1-d logical arrays, as was done in the previous 'fix'). (6) Add C13_NBP and C14_NBP diagnostic fields (from Keith Oleson) (7) Make a bunch of carbon isotope diagnostic fields inactive by default (8) Don't allow interpolation (use_init_interp) from a case without carbon isotopes to a case with carbon isotopes: Due to #67, interpolation from a case without carbon isotopes to a case with carbon isotopes yields incorrect initialization values for the carbon isotopes. Now that we're turning carbon isotopes on via some semi-out-of-the-box usermods (for cmip6), it is becoming more important to check to make sure someone doesn't shoot themselves in the foot this way. (9) Add tests of the new output usermods as well as of the CMIP6 compset modifiers Issues fixed: - Fixes #24 for real (ncd_io_1d_log_glob is broken) - Fixes #529 (Organize usermods_dirs to facilitate running cases with the right output)
Due to ESCOMP#67, interpolation from a case without carbon isotopes to a case with carbon isotopes yields incorrect initialization values for the carbon isotopes. Now that we're turning carbon isotopes on via some semi-out-of-the-box usermods (for cmip6), it is becoming more important to check to make sure someone doesn't shoot themselves in the foot this way. This commit should be backed out once ESCOMP#67 is resolved
From dev014 & dev015: CMIP6 compset modifiers, output usermods & fixes Bring in all changes from ctsm1.0.dev014 and ctsm1.0.dev015: From ctsm1.0.dev015: (1) Support %BGC-CROP-CMIP6DECK and %BGC-CROP-CMIP6WACCMDECK compset modifiers, so that we can turn on the necessary options (output-related and others) via new CMIP6-specific compsets. (2) Turn on carbon isotopes in CMIP6 runs (from Erik Kluzek) (3) Remove setting of CCSM_BGC=CO2A in the cmip6 usermods (4) Add usermods directories for getting typical extra output that's wanted in many cases: output_crop, output_crop_highfreq, output_bgc, output_bgc_highfreq, output_sp, and output_sp_highfreq. These can be enabled by adding something like '--user-mods-dir output_crop' on the create_newcase line (that short-hand works for an I compset; for F or B compsets, you need to provide the full path to the usermod directory). (4) Allow holes in the number of history tapes. Holes are cases where, for example, we have h0, h1 and h3 tapes, but no h2 tape (because there are no fields on the h2 tape). (This is needed for (3).) (5) Fix reading and writing of 1-d logical global arrays. This fixes #24 for real (rather than just preventing an attempt to read/write 1-d logical arrays, as was done in the previous 'fix'). (6) Add C13_NBP and C14_NBP diagnostic fields (from Keith Oleson) (7) Make a bunch of carbon isotope diagnostic fields inactive by default (8) Don't allow interpolation (use_init_interp) from a case without carbon isotopes to a case with carbon isotopes: Due to #67, interpolation from a case without carbon isotopes to a case with carbon isotopes yields incorrect initialization values for the carbon isotopes. Now that we're turning carbon isotopes on via some semi-out-of-the-box usermods (for cmip6), it is becoming more important to check to make sure someone doesn't shoot themselves in the foot this way. (9) Add tests of the new output usermods as well as of the CMIP6 compset modifiers From ctsm1.0.dev014: Four miscellaneous minor, bit-for-bit bug fixes: (1) Py3 pylint check and address cime issue ESMCI/cime#2822 (from Jim Edwards: #526) (2) Change uppercase DEBUG variables to lowercase debug (requested by Jim Edwards to avoid conflicting with the DEBUG CPP token) (Fixes #534) (3) Remove unnecessary line of code in LunaMod.F90 that was causing problems with some compilers due to an uninitialized variable (Fixes #322) (4) Add r8 to 0 constant to fix build issue with XLF compiler (from Jim Edwards: #531)
CMIP6 compset modifiers; usermods for output; other output enhancements (1) Support %BGC-CROP-CMIP6DECK and %BGC-CROP-CMIP6WACCMDECK compset modifiers, so that we can turn on the necessary options (output-related and others) via new CMIP6-specific compsets. (2) Turn on carbon isotopes in CMIP6 runs (from Erik Kluzek) (3) Remove setting of CCSM_BGC=CO2A in the cmip6 usermods (4) Add usermods directories for getting typical extra output that's wanted in many cases: output_crop, output_crop_highfreq, output_bgc, output_bgc_highfreq, output_sp, and output_sp_highfreq. These can be enabled by adding something like '--user-mods-dir output_crop' on the create_newcase line (that short-hand works for an I compset; for F or B compsets, you need to provide the full path to the usermod directory). (4) Allow holes in the number of history tapes. Holes are cases where, for example, we have h0, h1 and h3 tapes, but no h2 tape (because there are no fields on the h2 tape). (This is needed for (3).) (5) Fix reading and writing of 1-d logical global arrays. This fixes ESCOMP#24 for real (rather than just preventing an attempt to read/write 1-d logical arrays, as was done in the previous 'fix'). (6) Add C13_NBP and C14_NBP diagnostic fields (from Keith Oleson) (7) Make a bunch of carbon isotope diagnostic fields inactive by default (8) Don't allow interpolation (use_init_interp) from a case without carbon isotopes to a case with carbon isotopes: Due to ESCOMP#67, interpolation from a case without carbon isotopes to a case with carbon isotopes yields incorrect initialization values for the carbon isotopes. Now that we're turning carbon isotopes on via some semi-out-of-the-box usermods (for cmip6), it is becoming more important to check to make sure someone doesn't shoot themselves in the foot this way. (9) Add tests of the new output usermods as well as of the CMIP6 compset modifiers Conflicts: src/dyn_subgrid/dyncropFileMod.F90 slevis resolved conflicts (as far as I can tell) but cheyenne_intel suite returns two new FAILs: ERP_D_Ld5.f09_g17.I2000Clm50Vic.cheyenne_intel.clm-vrtlay RUN ERS_D_Ld10.f10_f10_musgs.IHistClm50SpG.cheyenne_intel.clm-collapse_pfts_78_to_16_f10 RUN I am committing the merge so as to then look at diffs that may be leading to the FAILs.
Due to ESCOMP#67, interpolation from a case without carbon isotopes to a case with carbon isotopes yields incorrect initialization values for the carbon isotopes. Now that we're turning carbon isotopes on via some semi-out-of-the-box usermods (for cmip6), it is becoming more important to check to make sure someone doesn't shoot themselves in the foot this way. This commit should be backed out once ESCOMP#67 is resolved
CMIP6 compset modifiers; usermods for output; other output enhancements (1) Support %BGC-CROP-CMIP6DECK and %BGC-CROP-CMIP6WACCMDECK compset modifiers, so that we can turn on the necessary options (output-related and others) via new CMIP6-specific compsets. (2) Turn on carbon isotopes in CMIP6 runs (from Erik Kluzek) (3) Remove setting of CCSM_BGC=CO2A in the cmip6 usermods (4) Add usermods directories for getting typical extra output that's wanted in many cases: output_crop, output_crop_highfreq, output_bgc, output_bgc_highfreq, output_sp, and output_sp_highfreq. These can be enabled by adding something like '--user-mods-dir output_crop' on the create_newcase line (that short-hand works for an I compset; for F or B compsets, you need to provide the full path to the usermod directory). (4) Allow holes in the number of history tapes. Holes are cases where, for example, we have h0, h1 and h3 tapes, but no h2 tape (because there are no fields on the h2 tape). (This is needed for (3).) (5) Fix reading and writing of 1-d logical global arrays. This fixes ESCOMP#24 for real (rather than just preventing an attempt to read/write 1-d logical arrays, as was done in the previous 'fix'). (6) Add C13_NBP and C14_NBP diagnostic fields (from Keith Oleson) (7) Make a bunch of carbon isotope diagnostic fields inactive by default (8) Don't allow interpolation (use_init_interp) from a case without carbon isotopes to a case with carbon isotopes: Due to ESCOMP#67, interpolation from a case without carbon isotopes to a case with carbon isotopes yields incorrect initialization values for the carbon isotopes. Now that we're turning carbon isotopes on via some semi-out-of-the-box usermods (for cmip6), it is becoming more important to check to make sure someone doesn't shoot themselves in the foot this way. (9) Add tests of the new output usermods as well as of the CMIP6 compset modifiers Issues fixed: - Fixes ESCOMP#24 for real (ncd_io_1d_log_glob is broken) - Fixes ESCOMP#529 (Organize usermods_dirs to facilitate running cases with the right output)
I'm planning to run some coupled CESM (CAM+CLM) experiments with 13C on, and I'd ideally like to use a finidat file generated from a run where isotopes were off. I'm only going to be looking at 13C GPP, so I don't think it should matter whether 13C is spun up. I am considering bypassing the error check with for_testing_allow_interp_non_ciso_to_ciso = .true. so that I can use the initial conditions file without isotopes and turn on the isotopes when I start running the new simulations. Do you think this workaround will work OK (for 13C GPP only) given this issue? |
I can't remember how this works. We will discuss it at our software
meeting tomorrow and get back to you.
…On Mon, Jan 4, 2021 at 2:22 PM Claire Zarakas ***@***.***> wrote:
I'm planning to run some coupled CESM (CAM+CLM) experiments with 13C on,
and I'd ideally like to use a finidat file generated from a run where
isotopes were off. I'm only going to be looking at 13C GPP, so I don't
think it should matter whether 13C is spun up. I am considering bypassing
the error check with for_testing_allow_interp_non_ciso_to_ciso = .true. so
that I can use the initial conditions file without isotopes and turn on the
isotopes when I start running the new simulations. Do you think this
workaround will work OK (for 13C GPP only) given this issue?
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#67 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AFABYVGGZKFBKVT7MFAWDQDSYIWQBANCNFSM4EIRZDMA>
.
|
@czarakas - From reading back through this issue, and from what I remember about it: This issue only applies if you are doing a run with C isotopes where the finidat file is from a run without C isotopes AND you are using init_interp. So I think a workaround is:
If that doesn't work for some reason, then we think that it should be okay to just bypass this error check if all you care about is GPP - since it shouldn't matter that your C isotope values are nowhere near spunup for the sake of GPP C13. However, we aren't 100% sure about that, which is why I'd suggest first trying the above workaround. |
Thanks @billsacks! That makes sense to me. I'll plan on using the workaround you suggested. |
mml_main cleanup to get past testing errors
There may be more significant issues with going from an initial conditions file without C isotopes to a run with C isotopes, leading to garbage values rather than just starting with cold start C isotope values -- though maybe the former can arise as a result of the latter? See recent discussion in #1358 I guess the important thing is that, once we address the known issue documented here, we should do some careful sanity checks to ensure that it's really working correctly to interpolate from a non-ciso finidat to a ciso case. |
Due to ESCOMP#67, interpolation from a case without carbon isotopes to a case with carbon isotopes yields incorrect initialization values for the carbon isotopes. Now that we're turning carbon isotopes on via some semi-out-of-the-box usermods (for cmip6), it is becoming more important to check to make sure someone doesn't shoot themselves in the foot this way. This commit should be backed out once ESCOMP#67 is resolved
From dev014 & dev015: CMIP6 compset modifiers, output usermods & fixes Bring in all changes from ctsm1.0.dev014 and ctsm1.0.dev015: From ctsm1.0.dev015: (1) Support %BGC-CROP-CMIP6DECK and %BGC-CROP-CMIP6WACCMDECK compset modifiers, so that we can turn on the necessary options (output-related and others) via new CMIP6-specific compsets. (2) Turn on carbon isotopes in CMIP6 runs (from Erik Kluzek) (3) Remove setting of CCSM_BGC=CO2A in the cmip6 usermods (4) Add usermods directories for getting typical extra output that's wanted in many cases: output_crop, output_crop_highfreq, output_bgc, output_bgc_highfreq, output_sp, and output_sp_highfreq. These can be enabled by adding something like '--user-mods-dir output_crop' on the create_newcase line (that short-hand works for an I compset; for F or B compsets, you need to provide the full path to the usermod directory). (4) Allow holes in the number of history tapes. Holes are cases where, for example, we have h0, h1 and h3 tapes, but no h2 tape (because there are no fields on the h2 tape). (This is needed for (3).) (5) Fix reading and writing of 1-d logical global arrays. This fixes ESCOMP#24 for real (rather than just preventing an attempt to read/write 1-d logical arrays, as was done in the previous 'fix'). (6) Add C13_NBP and C14_NBP diagnostic fields (from Keith Oleson) (7) Make a bunch of carbon isotope diagnostic fields inactive by default (8) Don't allow interpolation (use_init_interp) from a case without carbon isotopes to a case with carbon isotopes: Due to ESCOMP#67, interpolation from a case without carbon isotopes to a case with carbon isotopes yields incorrect initialization values for the carbon isotopes. Now that we're turning carbon isotopes on via some semi-out-of-the-box usermods (for cmip6), it is becoming more important to check to make sure someone doesn't shoot themselves in the foot this way. (9) Add tests of the new output usermods as well as of the CMIP6 compset modifiers From ctsm1.0.dev014: Four miscellaneous minor, bit-for-bit bug fixes: (1) Py3 pylint check and address cime issue ESMCI/cime#2822 (from Jim Edwards: ESCOMP#526) (2) Change uppercase DEBUG variables to lowercase debug (requested by Jim Edwards to avoid conflicting with the DEBUG CPP token) (Fixes ESCOMP#534) (3) Remove unnecessary line of code in LunaMod.F90 that was causing problems with some compilers due to an uninitialized variable (Fixes ESCOMP#322) (4) Add r8 to 0 constant to fix build issue with XLF compiler (from Jim Edwards: ESCOMP#531)
Due to ESCOMP#67, interpolation from a case without carbon isotopes to a case with carbon isotopes yields incorrect initialization values for the carbon isotopes. Now that we're turning carbon isotopes on via some semi-out-of-the-box usermods (for cmip6), it is becoming more important to check to make sure someone doesn't shoot themselves in the foot this way. This commit should be backed out once ESCOMP#67 is resolved
From dev014 & dev015: CMIP6 compset modifiers, output usermods & fixes Bring in all changes from ctsm1.0.dev014 and ctsm1.0.dev015: From ctsm1.0.dev015: (1) Support %BGC-CROP-CMIP6DECK and %BGC-CROP-CMIP6WACCMDECK compset modifiers, so that we can turn on the necessary options (output-related and others) via new CMIP6-specific compsets. (2) Turn on carbon isotopes in CMIP6 runs (from Erik Kluzek) (3) Remove setting of CCSM_BGC=CO2A in the cmip6 usermods (4) Add usermods directories for getting typical extra output that's wanted in many cases: output_crop, output_crop_highfreq, output_bgc, output_bgc_highfreq, output_sp, and output_sp_highfreq. These can be enabled by adding something like '--user-mods-dir output_crop' on the create_newcase line (that short-hand works for an I compset; for F or B compsets, you need to provide the full path to the usermod directory). (4) Allow holes in the number of history tapes. Holes are cases where, for example, we have h0, h1 and h3 tapes, but no h2 tape (because there are no fields on the h2 tape). (This is needed for (3).) (5) Fix reading and writing of 1-d logical global arrays. This fixes ESCOMP#24 for real (rather than just preventing an attempt to read/write 1-d logical arrays, as was done in the previous 'fix'). (6) Add C13_NBP and C14_NBP diagnostic fields (from Keith Oleson) (7) Make a bunch of carbon isotope diagnostic fields inactive by default (8) Don't allow interpolation (use_init_interp) from a case without carbon isotopes to a case with carbon isotopes: Due to ESCOMP#67, interpolation from a case without carbon isotopes to a case with carbon isotopes yields incorrect initialization values for the carbon isotopes. Now that we're turning carbon isotopes on via some semi-out-of-the-box usermods (for cmip6), it is becoming more important to check to make sure someone doesn't shoot themselves in the foot this way. (9) Add tests of the new output usermods as well as of the CMIP6 compset modifiers From ctsm1.0.dev014: Four miscellaneous minor, bit-for-bit bug fixes: (1) Py3 pylint check and address cime issue ESMCI/cime#2822 (from Jim Edwards: ESCOMP#526) (2) Change uppercase DEBUG variables to lowercase debug (requested by Jim Edwards to avoid conflicting with the DEBUG CPP token) (Fixes ESCOMP#534) (3) Remove unnecessary line of code in LunaMod.F90 that was causing problems with some compilers due to an uninitialized variable (Fixes ESCOMP#322) (4) Add r8 to 0 constant to fix build issue with XLF compiler (from Jim Edwards: ESCOMP#531)
Bill Sacks < [email protected] > - 2017-07-26 06:34:15 -0600
Bugzilla Id: 2496
Bugzilla CC: [email protected], [email protected], [email protected], [email protected], [email protected],
Ben pointed this problem out with respect to water isotopes, but I realized that the same problem occurs in existing code for carbon isotopes and possibly other variables: For a number of variables, there is code in the Restart routine that says: If the variable isn't found on the restart file, then initialize it based on some other variable that is guaranteed to be on the restart file - e.g., initialize c13 to the bulk C value times some constant. My understanding is that this code is important when you're transitioning from a run without some option (e.g., without ciso) to a run with that option turned on.
This code works fine if use_init_interp = .false., but I'm pretty sure it won't work with use_init_interp = .true.: Imagine you're doing a run with ciso true, pointing to an finidat file that was generated with ciso false, with use_init_interp true. In this case, finidat_interp_dest.nc is written with all of the C isotope fields present, at their cold start values. In init_interp, these fields will be skipped because they're not found on the source finidat file - and thus they will remain present in the finidat_interp_dest file, with values at the cold start values. Then, back in the CLM Restart routines, the code that checks whether the variable is present on the restart file will say, "Yup, it's present", and so the code for newly-initializing the C isotope fields will never be executed.
Ben and I discussed a number of solutions yesterday, none of them completely satisfying. I won't lay those all out here. But I will lay out one more variation that I just thought of, which has the advantage of NOT requiring finding and changing all of the existing code that has patterns like the C isotope code:
When we write a restart file, add a new attribute to every field like "valid_data" (though we may want to come up with a better name). In the restartvar routine, that would be set to 1 (true) everywhere. Then, in initInterp, in the conditional that checks whether a given output variable is absent from the input file (the lines of code around the message, "variable is NOT on input file"): Set this valid_data attribute to 0 (false). (Aside: it's important that the new attribute value take up no more space than the old attribute value, according to what's allowed in netcdf when you have left 'define' mode. So, for example, it would NOT work to set it to 'true' originally and 'false' in init_interp.) Then, back in the restartvar routine, on read: it would check the value of this valid_data attribute; if 0, then it skips reading the data and sets readvar to .false.
Ben, note that, unlike the solutions we were brainstorming yesterday, this solution does NOT involve identifying the relevant variables and giving them a new interpinic_flag behavior; instead, this solution would apply to ALL variables. I believe it's safe to apply this to all variables. i.e., for these variables that aren't present on the finidat source file, the end result should be the same whether or not we read the data in the Restart routine: they should end up at their cold start values in either case. But if we go with this solution, we may want to give this a little more thought to make sure it's safe.
The text was updated successfully, but these errors were encountered: