Closed mjs2369 closed 6 months ago
An unrelated question I had with regards to the dart_to_clm code is that the comment below says we are forcing the existing layers to be near zero but not exactly zero:
This is true for h2oice_po and dzsno_po, but h2oliq_po is getting set to exactly zero? https://github.com/NCAR/DART/blob/99ebec56a6efdd243ed026da24b29a1a45bb8cdd/models/clm/dart_to_clm.f90#L614
Hi Marlee, do you have some test input to run this on? general paranoia about integer maths, e.g. this int < real: https://github.com/NCAR/DART/blob/99ebec56a6efdd243ed026da24b29a1a45bb8cdd/models/clm/dart_to_clm.f90#L751
Hi Marlee, do you have some test input to run this on? general paranoia about integer maths, e.g. this int < real:
@hkershaw-brown I mention in the body of the pull request that I do not have input (dart_posterior.nc) to run dart_to_clm with. Do you have one? If not, maybe Brett does
This is a good catch. I think we will want to change this to > 0.0_r8 .and. snlsno(icolumn) < 0) then
regardless of whether it runs correctly, right?
yup I believe so.
An unrelated question I had with regards to the dart_to_clm code is that the comment below says we are forcing the existing layers to be near zero but not exactly zero:
This is true for h2oice_po and dzsno_po, but h2oliq_po is getting set to exactly zero?
I think you are correct to make this consistent with the other values, and make it slightly larger than zero. Additional testing has shown high sensitivity to setting values = 0, which I think we need to avoid. It is important to leave the dynamics of the layers (fission/fusion) to the CLM code snow code. Also, I suspect, other snow albedo properties are calculated from these snow layer values, and having a value of 0 tends to introduce problems.
Hi Marlee, do you have some test input to run this on? general paranoia about integer maths, e.g. this int < real: https://github.com/NCAR/DART/blob/99ebec56a6efdd243ed026da24b29a1a45bb8cdd/models/clm/dart_to_clm.f90#L751
@hkershaw-brown I mention in the body of the pull request that I do not have input (dart_posterior.nc) to run dart_to_clm with. Do you have one? If not, maybe Brett does
This is a good catch. I think we will want to change this to
> 0.0_r8 .and. snlsno(icolumn) < 0) then
regardless of whether it runs correctly, right?
So Xueli has been testing this code and should have a posterior.nc to test. She also ran into another bug where snow layer properties could become negative during the re-parititioning and had to implement some post filter clamping to avoid this. Would be good to bring her in on the review as well.
Hi Marlee, do you have some test input to run this on? general paranoia about integer maths, e.g. this int < real: https://github.com/NCAR/DART/blob/99ebec56a6efdd243ed026da24b29a1a45bb8cdd/models/clm/dart_to_clm.f90#L751
@hkershaw-brown I mention in the body of the pull request that I do not have input (dart_posterior.nc) to run dart_to_clm with. Do you have one? If not, maybe Brett does This is a good catch. I think we will want to change this to
> 0.0_r8 .and. snlsno(icolumn) < 0) then
regardless of whether it runs correctly, right?So Xueli has been testing this code and should have a posterior.nc to test. She also ran into another bug where snow layer properties could become negative during the re-parititioning and had to implement some post filter clamping to avoid this. Would be good to bring her in on the review as well.
Thanks Brett. We can wait for @XueliHuo feedback and hopefully input files to test. Forgot to mention but we will also need a CLM restart file to modify (clm_restart.nc) in addition to posterior.nc
An unrelated question I had with regards to the dart_to_clm code is that the comment below says we are forcing the existing layers to be near zero but not exactly zero: https://github.com/NCAR/DART/blob/99ebec56a6efdd243ed026da24b29a1a45bb8cdd/models/clm/dart_to_clm.f90#L610C1-L612C35 This is true for h2oice_po and dzsno_po, but h2oliq_po is getting set to exactly zero? https://github.com/NCAR/DART/blob/99ebec56a6efdd243ed026da24b29a1a45bb8cdd/models/clm/dart_to_clm.f90#L614
I think you are correct to make this consistent with the other values, and make it slightly larger than zero. Additional testing has shown high sensitivity to setting values = 0, which I think we need to avoid. It is important to leave the dynamics of the layers (fission/fusion) to the CLM code snow code. Also, I suspect, other snow albedo properties are calculated from these snow layer values, and having a value of 0 tends to introduce problems.
@hkershaw-brown would we want to go ahead and make this fix on this PR or does it warrant opening a separate issue?
@mjs2369 just been chatting to Brett about this - Xueli's being running a lot of CLM-DART and has some fixes too. So how about this pull request becomes the fixup dart_to_clm pull request, we get some nice test case(s) to dart_to_clm, and multiple eyes on the code?
@XueliHuo Thanks for the initial review! I made and pushed the changes you suggested. Do you have any test cases for dart_to_clm we could use (clm_restart.nc and posterior.nc)? It would be great if you could also run a test on your end if you have the time.
This looks like all the changes from Xueli have been made. Is this pull request good to go for the next release?
This looks like all the changes from Xueli have been made. Is this pull request good to go for the next release?
All the changes have been made, and the code was compiled. It just hasn't been run since we do not have the necessary input files
@hkershaw-brown, @mjs2369 -- I was off yesterday, but I should be able to look at this today/tomorrow. I want to run it through the tutorial case before including with the next release. @XueliHuo we should also run it through the Western US example case that we were discussing prior to holiday break. There may be some fine tuning we need to do on the science side to get this to work as intended. This PR could included in the next release and we could issue a separate issue for the science stuff... if needed.
Description:
Quickbuild.sh was erroring out and produced multiple warnings for the dart_to_clm build with the cce compiler
The fix changes the arrays for number of snow layers (snlsno and clm_SNLSNO) from real(r8) to integer types.
These arrays being of type int is actually consistent with the description of the variable in this comment: https://github.com/NCAR/DART/blob/99ebec56a6efdd243ed026da24b29a1a45bb8cdd/models/clm/dart_to_clm.f90#L365C1-L367C41
This change allows dart_to_clm to compile successfully and without warnings with cce.
Fixes issue
Fixes #598
Types of changes
Documentation changes needed?
Tests
Compiled dart_to_clm with cce To test the execution of the program, a dart_posterior.nc file is needed.
Also built with gfortran with full debugging flags
Checklist for merging
Checklist for release
Testing Datasets
Again, a dart_posterior.nc file is needed if we want to test the execution of the program.