Skip to content
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

New soiltex for ctsm5.2.mksurfdata #1732

Merged
merged 38 commits into from
Oct 4, 2022

Conversation

slevis-lmwg
Copy link
Contributor

@slevis-lmwg slevis-lmwg commented Apr 29, 2022

Description of changes

Started from @mvertens branch feature/new_mksurfdata_soiltex
Pushed a few updates directly to that branch:

  • Merge remote-tracking branch 'escomp/ctsm5.2.mksurfdata'
  • Merge branch 'cmake_bld_branch'

From there I started my branch new_soiltex_slevis and opened this PR.

This PR continues @mvertens and @wwieder 's work to replace the old soil texture and organic raw datasets with new.

Specific notes

Contributors other than yourself, if any:
@mvertens @wwieder @dlawrenncar @ekluzek

CTSM Issues Fixed (include github issue #):
Resolves #1303

Are answers expected to change (and if so in what way)?
Yes because new rawdata.

Any User Interface Changes (namelist or namelist defaults changes)?
New soil raw dataset consists of two files: a mapunits file and a lookup file.

Testing performed, if any:
@olyson posted diagnostics from running with the new and the old here and no red flags were raised.

@slevis-lmwg slevis-lmwg self-assigned this Apr 29, 2022
@slevis-lmwg
Copy link
Contributor Author

@mvertens I'm adding the --hires_soitex option to the .py and .xml files, but I don't know this:
Do we have a mesh file for this 30-second grid?

@slevis-lmwg
Copy link
Contributor Author

Do we have a mesh file for this 30-second grid?

@mvertens from this commit
a849f95
I gather that you used the same file to read mapunits and the mesh when working with the 30'' resolution.

@ekluzek and everyone:
I have now renamed and copied the three new files and would like comments/approval before I submit them to the repository with the ./rimport command:

old name new name
soiltex_mapunits_4320x2160_c220329.nc mksrf_soitex_mapunits_5x5min_from_wise_30sec.c220329.nc
wise_30sec_v1_lookup2.nc mksrf_soitex.10level.wise_30sec_lookup.c220329.nc
wise_30sec_v5_grid.nc mksrf_soitex_mapunits_wise_30sec.c220330.nc

I decided to keep the prefix "mksrf_" because it's the only identifier that indicates a CTSM raw dataset. Without the prefix, the file could be anything, while with the prefix the file is clearly intended for use with the mksurfdata tool.

@ekluzek
Copy link
Collaborator

ekluzek commented May 6, 2022

I think these are good names, I only have a couple tweaks to suggest. You can take or leave as you see fit. I'm happy with above, I just wonder about a few things.

Suggest capitalizing WISE since it's an org abbreviation
Maybe change "soitex" to just "soil" -- since we now include more soil characteristics (like PH) and not just strictly soil texture?
5x5min_from_wise_30sec is maybe confusing for the filename? Maybe just say 5x5min_WISE and inside the file you can see the metadata that says it's from the 30 second resolution file.

@slevis-lmwg
Copy link
Contributor Author

slevis-lmwg commented May 6, 2022

Suggest capitalizing WISE since it's an org abbreviation Maybe change "soitex" to just "soil" -- since we now include more soil characteristics (like PH) and not just strictly soil texture? 5x5min_from_wise_30sec is maybe confusing for the filename? Maybe just say 5x5min_WISE and inside the file you can see the metadata that says it's from the 30 second resolution file.

@ekluzek thank you. Here are the file names that I ended up with based on your suggestions:
mksrf_soil_mapunits_30sec_WISE.c220330.nc
mksrf_soil_mapunits_5x5min_WISE.c220329.nc
mksrf_soil_lookup.10level.WISE.c220329.nc Here I also moved "lookup" after "soil" as done with "mapunits" and removed "30sec" because this file has resolution in the vertical but not horizontal.

One final tweak:
I will make all three dates c220330 because it doesn't make sense that the 5x5min was generated from a later 30sec file :-)

@slevis-lmwg
Copy link
Contributor Author

./rimport complete on these three files.

I followed the sand/clay template for organic and values look reasonable
when written to stdout, but values are wrong in the .nc file. I have no
explanation at this time.
end do

! TODO Rm organic before merging PR #1732 UNLESS we opt for OPTION 2
! organic_o OPTION 1: as we plan to calculate organic in the CTSM
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As a test I calculated organic_o in two different ways...

  • Option 1 as we discussed this morning: calculate organic in the CTSM from orgc_o, cfrag_o, and bulk_o (i.e. after the terms have been regridded).
  • Option 2 (a few lines up where orgc_o is also calculated): In this case I regrid organic_i (calculated from orgc_i, cfrag_i, and bulk_i) to organic_o. This may be the more accurate approach. It goes against this morning's idea to keep ORGC the same in fsurdat as in the raw data, but it may be more accurate because it first calculates organic_i and then regrids to organic_o rather than regridding all the terms first and then calculating organic_o.

The fsurdat files from this test are in /glade/work/slevis/git/mksurfdata_toolchain/tools/mksurfdata_esmf:

surfdata_1.9x2.5_hist_78pfts_CMIP6_1850_c220527_OPT1.nc
surfdata_1.9x2.5_hist_78pfts_CMIP6_1850_c220527_OPT2.nc
surfdata_1.9x2.5_hist_78pfts_CMIP6_1850_c220527_OPT2-1.nc (the difference file)

Also, the old fsurdat that I'm comparing against:
/glade/p/cesmdata/inputdata/lnd/clm2/surfdata_map/release-clm5.0.18/surfdata_1.9x2.5_hist_78pfts_CMIP6_simyr1850_c190304.nc
I'm happy to follow up next week. Have a nice holiday weekend!

Copy link
Contributor Author

@slevis-lmwg slevis-lmwg May 29, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Posting the difference in ORGANIC calculated by method 2 vs. 1.
Very little difference, I think because we regrid by most dominant rather than by averaging.

organic2vs1

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When I get a chance, I'm curious to understand this small difference. Meanwhile though I've confirmed what should go without saying, i.e. that ORGC, CFRAG, BULK, PHAQ (and all other fields) are identical between these two fsurdats.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh and old fsurdat shows max organic = 130 as we discussed:

organic_old

@dlawrenncar
Copy link
Contributor

This looks encouraging. In terms of trying to understand what the differences look like between the old fsurdat and the new data, perhaps you could plot with maximum value of 130, so we can see how the two datasets are similar/distinct. There are big difference, for example in the Canadian Archipelago and around Hudson Bay that I can see. No reason for me to think that the new data is wrong, though. I'd also be interested to see how this looks going down into the soil. That is, what do these datasets look like at 20cm, 50cm depth?

@slevis-lmwg
Copy link
Contributor Author

slevis-lmwg commented May 31, 2022

perhaps you could plot with maximum value of 130, so we can see how the two datasets are similar/distinct. There are big difference, for example in the Canadian Archipelago and around Hudson Bay that I can see. No reason for me to think that the new data is wrong, though.

New versus old layer 1, which goes to 1.75 cm:
organic_new_vs_old

[...] what do these datasets look like at 20cm, 50cm depth?

Comparing at 16.6 cm
organic_new_vs_old_16 6cm

Comparing at 28.9 cm
organic_new_vs_old_28 9cm

Comparing at 49.3 cm
organic_new_vs_old_49 3cm
colorbar_0_to_130

To be precise

  • I'm reporting depths at the bottom of the layer being compared
  • For "new" I used "option 1" which is our planned approach

@wwieder
Copy link
Contributor

wwieder commented Sep 8, 2022

There are clear differences between datasets. Maybe the best way to understand the impacts would be to run simulations that compare permafrost extent, soil temperatures, and hydrology / runoff.

…ltex_slevis

Resolved conflicts:
tools/mksurfdata_esmf/README
tools/mksurfdata_esmf/gen_mksurfdata_namelist.py
tools/mksurfdata_esmf/gen_mksurfdata_namelist.xml
@slevis-lmwg
Copy link
Contributor Author

slevis-lmwg commented Sep 15, 2022

At our 2022/9/8 meeting we agreed on a year-2000 1-degree SP simulation with all the new raw datasets.

To generate the fsurdat file for this simulation with the new mksurfdata_esmf:

I have to rimport new files to the repository.

Discussion pending regarding the consistency between PCT_LAKE in the new
2017 lakedepth file used for year-2000 simulations versus in the new
transient lake files.
This string should have gone in with ESCOMP#1853, but I missed it, so the
latest ctsm5.2.mksurfdata branch tag will not work as is right now.
The correction will come in with the next tag.
rimport pending for mksrf_landuse files. Of those, there are:
- "final" ones for 1850-2015 that I don't have permission to link to
- older ones for other periods that I will check with @lawrencepj1
  whether we expect to replace
@slevis-lmwg
Copy link
Contributor Author

As I have now run simulations with fsurdat files coming out of this branch, and we will likely run more,
@ekluzek recommends that I merge this branch to the ctsm5.2.mksurfdata branch and make a tag.

Once I do that, @ekluzek will merge the latest ctsm tag to the ctsm5.2.mksurfdata branch and make a tag.

@slevis-lmwg
Copy link
Contributor Author

But first...
I was reviewing my code changes in this PR and found that we had been comparing two methods of obtaining ORGANIC. The preferred method was "option 1" rather than "option 2", which means that I must rerun the new_fsurdat simulation to use option 1. Once I'm satisfied with the results, I will push another commit to this PR and then merge to ctsm5.2.mksurfdata.

@@ -1,7 +1,7 @@
do_transient_lakes = .true.

! This file was created with the following command:
! ncap2 -s 'PCT_LAKE=array(0.0,0.0,PCT_CROP); PCT_LAKE={0.,50.,25.,25.,25.,25.}; HASLAKE=array(1.,1.,AREA); PCT_CROP=array(0.0,0.0,PCT_LAKE); PCT_CROP={0.,25.,12.,12.,12.,12.}' landuse.timeseries_1x1_smallvilleIA_hist_78pfts_simyr1850-1855_c160127.nc landuse.timeseries_1x1_smallvilleIA_hist_78pfts_simyr1850-1855_dynLakes_c200928.nc
! ncap2 -s 'PCT_LAKE=array(0.0,0.0,PCT_CROP); PCT_LAKE={0.,50.,25.,25.,25.,25.}; PCT_LAKE_MAX=array(1.,1.,AREA); PCT_CROP=array(0.0,0.0,PCT_LAKE); PCT_CROP={0.,25.,12.,12.,12.,12.}' landuse.timeseries_1x1_smallvilleIA_hist_78pfts_simyr1850-1855_c160127.nc landuse.timeseries_1x1_smallvilleIA_hist_78pfts_simyr1850-1855_dynLakes_c200928.nc
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@billsacks this is the only change in this commit where I didn't feel confident. Could you confirm? Other than the variable name, would you have also changed the array values for the purposes of this test?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Technically this should be changed so that the value is 50 (the max value of the PCT_LAKE array) rather than 1. I think that could be done by changing array(1.,1.,AREA) to array(50.,0.,AREA) (I think the second value is irrelevant here). However, it shouldn't matter in practice, because a value of 1 will do the same thing as a value of 50 where this is read... it may just cause a bit of confusion. Thanks for taking care of this!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, @billsacks
I will take care of this later since I merged this branch earlier today.
Probably in a PR that will address #1703

@slevis-lmwg slevis-lmwg marked this pull request as ready for review October 4, 2022 20:04
@slevis-lmwg slevis-lmwg merged commit 1f84b84 into ESCOMP:ctsm5.2.mksurfdata Oct 4, 2022
@slevis-lmwg slevis-lmwg deleted the new_soiltex_slevis branch October 4, 2022 20:11
slevis-lmwg added a commit to slevis-lmwg/ctsm that referenced this pull request Oct 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants