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

Merge b4b-dev 2024-05-02 #2513

Merged
merged 231 commits into from
May 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
231 commits
Select commit Hold shift + click to select a range
0ccf855
a first draft of implementing xarray mesh
negin513 Apr 28, 2022
c3d981d
subset_mesh capabilities
negin513 May 3, 2022
66f46c3
a few changes
negin513 Jun 3, 2022
29ed6fa
clean ups
negin513 Jun 8, 2022
9155ec8
adding write shell commands
negin513 Jun 8, 2022
18c9ca7
clean ups
negin513 Jun 8, 2022
b8c9115
adding bound checks
negin513 Jun 29, 2022
7682185
adding w/e s/n instead of start/end to help
negin513 Jun 30, 2022
60b232f
lnd for land_domain_mesh
negin513 Jun 30, 2022
6aef680
saving progress for old debugging
negin513 Oct 27, 2022
88ed680
working mesh type class
negin513 Oct 29, 2022
8e88f66
mesh_maker
negin513 Oct 29, 2022
dd7f5b8
mesh_maker
negin513 Nov 1, 2022
1a31153
update subset_data to use the new mesh type
negin513 Nov 2, 2022
d315d2b
clean ups...
negin513 Nov 3, 2022
527cdc0
update namelist
negin513 Nov 3, 2022
947b768
fixing a few issues
negin513 Nov 3, 2022
c0c6aa9
updates
negin513 Nov 3, 2022
3f47819
black-ify the code
negin513 Nov 3, 2022
ca2d2da
final edits
negin513 Nov 3, 2022
9ec631b
updates
negin513 Nov 3, 2022
d9acef0
updates
negin513 Nov 3, 2022
07270a9
updates to subset_data
negin513 Nov 3, 2022
734854a
updating readme.
negin513 Nov 3, 2022
b35d76b
update README
negin513 Nov 3, 2022
56cdbae
updates to mesh file type to plot
negin513 Nov 3, 2022
075e6c0
updating mesh_type -- working...
negin513 Nov 3, 2022
a3199f1
plotting capabilities
negin513 Nov 7, 2022
8ef1a08
adding high res as default
negin513 Nov 7, 2022
e7826c2
high res as default
negin513 Nov 7, 2022
129492f
blackify
negin513 Nov 7, 2022
8c8279b
extra comments
negin513 Nov 7, 2022
2816f95
quick updates
negin513 Nov 7, 2022
f614b60
efficient plotting for regions
negin513 Nov 8, 2022
796bdea
quick clean ups
negin513 Nov 8, 2022
fcb3405
pylint
negin513 Nov 8, 2022
0b6dc1d
pylint issues
negin513 Nov 8, 2022
ae82c84
pylint complaints
negin513 Nov 8, 2022
05e8fac
pylint valid names such as ax
negin513 Nov 8, 2022
3588342
pylint complaints
negin513 Nov 8, 2022
24d3446
Merge branch 'master' into subset_mesh_dask
negin513 Nov 8, 2022
38352a8
formatting
negin513 Nov 8, 2022
543e424
fix bug with CLM_USRDAT_DIR
negin513 Nov 12, 2022
ded39a6
Merge tag 'ctsm5.1.dev115' into subset_mesh_dask
ekluzek Dec 6, 2022
260ecb6
Add dask, cartopy, and matplotlib to the list of packages for conda, …
ekluzek Dec 6, 2022
2d41803
Merge tag 'ctsm5.1.dev116' into subset_mesh_dask
ekluzek Jan 26, 2023
304c83e
Update needed to get unit tests to work due to update
ekluzek Jan 26, 2023
8a510c2
Change needed for update
ekluzek Jan 26, 2023
13d1c99
Add a test that create-user-mods requires create_mesh for regional cases
ekluzek Jan 26, 2023
fc262d4
Get test for create_user_mods without create_mesh working correctly, …
ekluzek Jan 27, 2023
8918db2
for region test turn mesh on and user-mods
ekluzek Jan 27, 2023
3ee9f05
Add a single point test that is working for mesh_maker.py
ekluzek Jan 29, 2023
3a31fd2
Correct area
ekluzek Jan 29, 2023
2608097
Move the guts of mesh_maker to the python directory
ekluzek Jan 30, 2023
c10a689
Run through black
ekluzek Jan 30, 2023
7f69e00
Add a basic unit test for mesh_maker
ekluzek Jan 30, 2023
050a87b
Add a failing test for outdir and outfile at the same time
ekluzek Jan 30, 2023
e5e7c66
Get test to work, but moving it up earlier
ekluzek Jan 30, 2023
3b41bdb
Add test for overwrite that fails
ekluzek Jan 30, 2023
82df585
Fix the overwrite test
ekluzek Jan 30, 2023
2023c14
Run through black and get unit tests working again
ekluzek Jan 30, 2023
0647e76
Some important changes moved over from subset_data that allow mesh_ma…
ekluzek Jan 30, 2023
ad8ce53
Update subset_data regions and tests
ekluzek Feb 1, 2023
6592810
Change name of one of the regional tests
ekluzek Feb 1, 2023
4ff8e7d
Fix some mesh_maker pylint issues
ekluzek Feb 2, 2023
98a6994
Use ctsm_logging and add a non working option to turn off plots
ekluzek Feb 2, 2023
96ef2fd
Add check_args for mesh_maker to shorten length of main and fix more …
ekluzek Feb 2, 2023
7fbdb0c
Add a check that arguments get changed as expected
ekluzek Feb 2, 2023
013954b
Change name of subroutine
ekluzek Feb 2, 2023
1baf7c5
Start adding a system test for mesh_maker to check file data
ekluzek Feb 2, 2023
991082e
Merge tag 'ctsm5.1.dev117' into subset_mesh_dask
ekluzek Feb 2, 2023
d4f9f4c
Merge tag 'ctsm5.1.dev118' into subset_mesh_dask
ekluzek Feb 9, 2023
9426cab
Merge remote-tracking branch 'escomp/master' into subset_mesh_dask
ekluzek Feb 9, 2023
9dc6759
Bunch of work at starting to use conda-lock to save actual running en…
ekluzek Feb 15, 2023
ddfd18d
If condalock doesn't exist and you are reading the lock file, install…
ekluzek Feb 15, 2023
79d587e
Add a bit about installing the conda environment for condalock for cg…
ekluzek Feb 15, 2023
a6c1c63
Correct a bit about the condalock environment
ekluzek Feb 16, 2023
661ce46
Specifying each version seems to give a stable conda environment that…
ekluzek Feb 20, 2023
f119fee
Split into conda environment into multiple files to accomidate CGD vs…
ekluzek Feb 23, 2023
a3d8d09
Update the note about the time it takes to run and the read-spec option
ekluzek Feb 23, 2023
ede71a9
Add some comments about running without adding dask
ekluzek Feb 23, 2023
dbfed73
Remove all the conda-lock handling stuff for the py_env_create
ekluzek Feb 25, 2023
9b7c468
bring in comment about dask
ekluzek Feb 25, 2023
60080a3
Add a read-latest option so that the experiemental latest environment…
ekluzek Feb 26, 2023
cde8ea9
Add a message that if the --read-spec option fails to try it without it
ekluzek Feb 26, 2023
874c846
Change so the dask option is NOT on by default and comes with warning…
ekluzek Feb 27, 2023
a77df59
Remove the possibility of turning the dask option with the latest opt…
ekluzek Feb 27, 2023
3e283a0
Remove dask and plotting from the latest requirements file, and updat…
ekluzek Feb 27, 2023
8a2bf5c
Change the name of the conda environment if you are going to build wi…
ekluzek Feb 27, 2023
ac7f231
dask ProgressBar was not being used
ekluzek Feb 27, 2023
ac70d06
Make the language stronger about dask being experimental
ekluzek Feb 27, 2023
a559d94
Add some black only reformatter commits
ekluzek Feb 28, 2023
f46bfcd
Add more black commits to the git-blame-ignore-revs file
ekluzek Feb 28, 2023
8879806
Add workflow to run conda environments
ekluzek Feb 28, 2023
c2fc9d1
Add documentation about requirements for python packaages
ekluzek Feb 28, 2023
ca4bca8
Add python testing action
ekluzek Feb 28, 2023
676207e
Add load of conda environments before each make step
ekluzek Feb 28, 2023
00804ca
Update python testing workflow
ekluzek Mar 1, 2023
9dc7818
More on activating the conda environment in the github action
ekluzek Mar 1, 2023
6b579d6
Change trigger to close of a PR for conda environments, because these…
ekluzek Mar 1, 2023
cf1a789
Fix conda environment file to use for python testing
ekluzek Mar 1, 2023
726709c
Use the conda base environment for the action
ekluzek Mar 1, 2023
42bc386
Correct event type
ekluzek Mar 1, 2023
6ec7609
Add -l option to shell for action
ekluzek Mar 2, 2023
b85f3be
Add stuff for git lfs
ekluzek Mar 2, 2023
11e35c0
More messing with github actions
ekluzek Mar 2, 2023
cddd07a
Fix yaml syntax
ekluzek Mar 2, 2023
03624da
Change workflow to use dask conda environment so that test will work …
ekluzek Mar 2, 2023
d89eeaf
Correct env name
ekluzek Mar 2, 2023
c4cb1fb
Set some needed cime variables for python testing, and attempt to cre…
ekluzek Mar 2, 2023
d0d6385
Remove the attempt at creating inputdata directory
ekluzek Mar 2, 2023
f8de262
Add a github action to run python testing on the latest package pytho…
ekluzek Mar 2, 2023
83443db
Add a test for trying out the mask and area option -- currently fails
ekluzek Mar 2, 2023
4e30039
Add a mkdir with sudo on the runner
ekluzek Mar 3, 2023
47b3224
Fix the area and mask options, needed a dask conversion and save only…
ekluzek Mar 4, 2023
e59cb89
Run in black and add test for non existant file
ekluzek Mar 5, 2023
08df74b
Add a test for bad names for latitude and longitude and get them working
ekluzek Mar 5, 2023
ba49e3e
Add a failing test for bad names for area and mask
ekluzek Mar 5, 2023
44d356d
Check if area and mask variable name exists so now sys tests pass
ekluzek Mar 5, 2023
822eec4
Add a failing tests for bad units of the area variable the user gives…
ekluzek Mar 5, 2023
015aa7d
Get area units fail test working with new error, now the area test fa…
ekluzek Mar 8, 2023
8cc3ac0
Add a regional test that fails because of the use of the 2D LATIXY, L…
ekluzek Mar 8, 2023
60a0079
Get the region test working, so now LATIXY and LONGXY can be used for…
ekluzek Mar 8, 2023
23f8823
Add a test for area with domain 5x5 file, and add a change to get are…
ekluzek Mar 9, 2023
76a43a6
Add a test for a domain regional file and compare it to the baseline …
ekluzek Mar 9, 2023
8dcd6ca
After working with @adrifoster I was able to an initial removal of da…
ekluzek Mar 23, 2023
6d96575
Add some more checks so can tell what is different in the mesh file
ekluzek Mar 27, 2023
72c16af
Make the file comparison it's own subroutine so could be called more …
ekluzek Mar 27, 2023
84b1537
Add back the drop_duplicates and setting of both clon, clats as in th…
ekluzek Mar 27, 2023
584fe5c
Run through black
ekluzek Mar 27, 2023
36f7287
Add black commit to git-blame list
ekluzek Mar 28, 2023
26654e2
Merge tag 'ctsm5.1.dev120' into subset_mesh_dask
ekluzek Mar 28, 2023
accd4d7
Add advanced tests for the advanced conda environment ctsm_pylib_wdask
ekluzek Mar 29, 2023
3c348b2
Add advanced tests for the advanced conda environment ctsm_pylib_wdask
ekluzek Mar 29, 2023
4dec1ba
Seperate mesh plotting capability into a type that extends the base m…
ekluzek Mar 31, 2023
3b92cd1
Fix some pylint issues
ekluzek Mar 31, 2023
cc0b6b3
Disable a pylint warning since it's really in the base cartopy code a…
ekluzek Mar 31, 2023
c898b3b
Clear up a bunch of pylint issues
ekluzek Apr 1, 2023
4992ab2
Check for plot files in the test
ekluzek Apr 2, 2023
c1c4e74
Check that plot files were created
ekluzek Apr 2, 2023
10e07cd
Get the no-plot option working by moving the plot creation to the end…
ekluzek Apr 2, 2023
1e8f485
Move some of the checking into it's own subroutine, allow more init s…
ekluzek Apr 2, 2023
87291aa
Set input file to real file so it doesn't die early in test
ekluzek Apr 2, 2023
44de6e5
Move plot into a subroutine that can be used for both the regional an…
ekluzek Apr 2, 2023
3ca9293
Add tools/site_and_regional/subset_data_single_point directory to the…
ekluzek Apr 3, 2023
7eadb64
Add mesh plot files to list of git ignore
ekluzek Apr 4, 2023
f7ea704
Make line size and marker size smaller for meshes with lots of points
ekluzek Apr 4, 2023
53b886a
Update tests to use regional file, and add a test that expects single…
ekluzek Apr 4, 2023
d04d7fc
Add a test for missing units for area
ekluzek Apr 4, 2023
0c36a80
Get tests working
ekluzek Apr 4, 2023
974e7a5
Add mesh test for f09 resolution
ekluzek Apr 5, 2023
6278717
Remove the single point mesh test
ekluzek Apr 5, 2023
172a149
Start adding a test that reads in a mesh and then outputs it to make …
ekluzek Apr 5, 2023
349e779
Add a method to check if data is set and die when it's not
ekluzek Apr 5, 2023
6d5026f
Start adding checking to the read_file to ensure can properly read th…
ekluzek Apr 5, 2023
8d7d69c
Add a unit test for mesh_type
ekluzek Apr 5, 2023
e079deb
More work on new mesh_type unit test
ekluzek Apr 5, 2023
37ca37a
Add check for bad list of variables
ekluzek Apr 5, 2023
c0281e6
Start getting data, when writing, check if optional data should be ou…
ekluzek Apr 5, 2023
787c1ab
Get the read_file method working, test still fails because origGridRa…
ekluzek Apr 6, 2023
d7b146f
All tests working remove some unneeded prints
ekluzek Apr 6, 2023
b8ae289
Move area to earlier so can be gotten from read_file as well as from …
ekluzek Apr 6, 2023
98e5bcc
Spin off plotting into it's own script, start moving things around fo…
ekluzek Apr 6, 2023
143766f
Get all python tests working including adv_test
ekluzek Apr 7, 2023
683df02
Get make all working with the ctsm_pylib environment, don't require c…
ekluzek Apr 7, 2023
01d7ac5
Remove plotting
ekluzek Apr 7, 2023
56662fa
Remove test with dask, and add some to make sure it exits with an error
ekluzek Apr 7, 2023
c2c1af4
Adjust testing so on a schedule that will be weekly for advanced test…
ekluzek Apr 7, 2023
b61dea2
Add a test that fails for converting the f10 domain file to a mesh
ekluzek Apr 22, 2023
f551027
Abort if you try to run for a global grid, change the test for this
ekluzek Apr 24, 2023
7ed54ef
remove global mesh since can't work for this case
ekluzek Apr 24, 2023
75d687c
Make sure subset_data regional tests have both create-domain and crea…
ekluzek May 19, 2023
eadde43
Merge tag 'ctsm5.1.dev125' into subset_mesh_dask
ekluzek May 22, 2023
d63c4b7
Add a test for South America region which has ocean and land in it
ekluzek May 22, 2023
6f2b9f0
Compare the S America region mesh file and make sure it agrees with t…
ekluzek May 22, 2023
3ef7c55
Get the South America region working for the mesh file using the surf…
ekluzek May 23, 2023
c8b8114
Verbose is required for the testing to recognize that the test was su…
ekluzek May 23, 2023
3d47d65
Add user mod directory for the PanBoreal case that Jackie used to run…
ekluzek May 23, 2023
19d835d
Add test for regional grid created with subset_data
ekluzek May 23, 2023
3ecddf3
Run through black
ekluzek May 23, 2023
5b10fe1
Add unit test that fails that makes sure create-mesh is used with cre…
ekluzek May 24, 2023
01cb5cd
Get test to work by making sure create_mesh also has create_domain on
ekluzek May 24, 2023
812b308
Have PanBoreal not go all the way up to the North pole, but just a gr…
ekluzek May 24, 2023
f23df5f
Make sure corners for a mesh don't go beyond the bounds of the globe …
ekluzek May 24, 2023
716f1dd
Remove logic about global grid, it's now handled by limiting the grid…
ekluzek May 24, 2023
711e76f
Move create_mesh to inside the create_domain, and make sure mask is set
ekluzek May 24, 2023
7840517
Update domain file position variable names
ekluzek May 24, 2023
39c75c2
Change mesh filename to be based on domain filename
ekluzek May 24, 2023
e284f34
Have longitudes for corners stay within 0 to 360
ekluzek May 25, 2023
9d8f42f
Correct name of grid size for regional test grid
ekluzek May 25, 2023
a399cf1
Fix size for PanBoreal
ekluzek Jun 2, 2023
ec92580
Abort if corners have longitudes greater than 360, and give warning f…
ekluzek Jun 6, 2023
1d002f0
Start adding for a new argument for subset_data to give the year of t…
ekluzek Jun 7, 2023
5c70da4
Add a test to confirm you can't create a domain file for a single poi…
ekluzek Jun 7, 2023
3f685e2
Remove create_domain as an option for single point, remove test for i…
ekluzek Jun 7, 2023
ebb180e
Get all tests working
ekluzek Jun 8, 2023
c5b1de0
Add failing tests that --create-landuse option requires --create-surf…
ekluzek Jun 8, 2023
0be506d
Get tests to work
ekluzek Jun 10, 2023
88bcc05
Instead of using conda activate use conda run as discovered by @samrabin
ekluzek Jun 27, 2023
5136c31
Merge tag 'ctsm5.1.dev129' into subset_mesh_dask
ekluzek Jun 28, 2023
b7d3780
remove some git workflow things; also dask
adrifoster Mar 13, 2024
ccaec33
add plotting; remove other conda env files
adrifoster Mar 13, 2024
95a35d6
Merge branch 'master' into subset_mesh
adrifoster Mar 13, 2024
6c138bd
fix comment typos
Mar 13, 2024
e36dc8b
add ny/nx
adrifoster Apr 11, 2024
a1f77a5
Merge branch 'master' into subset_mesh
adrifoster Apr 22, 2024
3cdcf8f
move create-domain back into single point for now
adrifoster Apr 22, 2024
4b32a31
black updates
adrifoster Apr 22, 2024
f582829
more black updates
adrifoster Apr 22, 2024
82b4961
Merge tag 'ctsm5.2.001' into merge-master-20240422
ekluzek Apr 22, 2024
4aa703e
Merge pull request #2483 from ekluzek/merge-master-20240422
ekluzek Apr 22, 2024
2091051
update tests
adrifoster Apr 23, 2024
7711245
merge in master
adrifoster Apr 23, 2024
0ab92ee
Merge branch 'b4b-dev' into subset_mesh_dask
adrifoster Apr 23, 2024
5f19b53
building md too
negin513 Apr 25, 2024
8c8d02c
adding instructions
negin513 Apr 25, 2024
43fb1d5
remove extra argument
adrifoster Apr 25, 2024
3638bbd
remove argument definitions
adrifoster Apr 25, 2024
c2fc18f
Merge pull request #1892 from negin513/subset_mesh_dask
adrifoster Apr 25, 2024
11e28a5
Add line about documentation in PR template.
samsrabin Apr 25, 2024
c20368f
Add line about docs to ChangeLog template
samsrabin Apr 25, 2024
c46c21f
Merge branch 'b4b-dev' into ask-docs-in-pr-template
samsrabin Apr 25, 2024
67c0cc2
Merge pull request #2488 from samsrabin/ask-docs-in-pr-template
samsrabin Apr 25, 2024
385b25c
CTSM5.2 2000 fsurdat T42 64x128 file
slevis-lmwg Apr 26, 2024
3de3fdf
Merge branch 'b4b-dev' into t42_updates
slevis-lmwg Apr 26, 2024
008edcd
Merge pull request #2495 from slevis-lmwg/t42_updates
slevis-lmwg Apr 26, 2024
9724557
plumber scripts move, ran black & pylint
TeaganKing May 1, 2024
938be5f
remove the old files that were moved to a new directory
TeaganKing May 1, 2024
40b6a3c
Merge pull request #2505 from TeaganKing/move_plumber_scripts
slevis-lmwg May 2, 2024
b368096
Merge tag 'ctsm5.2.002' into merge-b4bdev-20240502
samsrabin May 2, 2024
37a5c60
Update ChangeLog and ChangeSum.
samsrabin May 2, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
b429b63824e09f82e95d2982f14311cbbd8e4a37
d229b5c6689efc4c2a6cef077515c4ccd5c18ff6
4cd83cb3ee6d85eb909403487abf5eeaf4d98911
d229b5c6689efc4c2a6cef077515c4ccd5c18ff6
0aa2957c1f8603c63fa30b11295c06cfddff44a5
2cdb380febb274478e84cd90945aee93f29fa2e6
e44dc469439e02e9ee582dab274d890ebdfab104
Expand Down
2 changes: 2 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ Are answers expected to change (and if so in what way)?

Any User Interface Changes (namelist or namelist defaults changes)?

Does this create a need to change or add documentation? Did you do so?

Testing performed, if any:
(List what testing you did to show your changes worked as expected)
(This can be manual testing or running of the different test suites)
Expand Down
2 changes: 2 additions & 0 deletions bld/namelist_files/namelist_defaults_ctsm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1395,6 +1395,8 @@ lnd/clm2/surfdata_esmf/ctsm5.2.0/surfdata_ne16np4.pg3_hist_2000_78pfts_c240216.n
<fsurdat hgrid="0.125nldas2" sim_year="2000">
lnd/clm2/surfdata_esmf/ctsm5.2.0/surfdata_0.125nldas2_hist_2000_78pfts_c240216.nc</fsurdat>

<fsurdat hgrid="64x128" sim_year="2000">
lnd/clm2/surfdata_esmf/ctsm5.2.0/surfdata_T42_hist_2000_78pfts_c240425.nc</fsurdat>
<fsurdat hgrid="360x720cru" sim_year="2000">
lnd/clm2/surfdata_esmf/ctsm5.2.0/surfdata_360x720cru_hist_2000_78pfts_c240216.nc</fsurdat>
<fsurdat hgrid="C96" sim_year="2000">
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@

# Change below line if you move the subset data directory

./xmlchange CLM_USRDAT_DIR='$DIN_LOC_ROOT/lnd/clm2/regional_datasets/f09_38x288pt_PanBoreal'

./xmlchange ATM_DOMAIN_MESH='$CLM_USRDAT_DIR/domain.lnd.fv0.9x1.25_gx1v7_f09_38x288pt_PanBoreal_c230524_ESMF_UNSTRUCTURED_MESH.nc'
./xmlchange LND_DOMAIN_MESH='$CLM_USRDAT_DIR/domain.lnd.fv0.9x1.25_gx1v7_f09_38x288pt_PanBoreal_c230524_ESMF_UNSTRUCTURED_MESH.nc'
./xmlchange MASK_MESH='$CLM_USRDAT_DIR/domain.lnd.fv0.9x1.25_gx1v7_f09_38x288pt_PanBoreal_c230524_ESMF_UNSTRUCTURED_MESH.nc'
22 changes: 22 additions & 0 deletions cime_config/usermods_dirs/f09_37x288pt_PanBoreal/user_nl_clm
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
!----------------------------------------------------------------------------------
! Users should add all user specific namelist changes below in the form of
! namelist_var = new_namelist_value
!
! EXCEPTIONS:
! Set use_cndv by the compset you use and the CLM_BLDNML_OPTS -dynamic_vegetation setting
! Set use_vichydro by the compset you use and the CLM_BLDNML_OPTS -vichydro setting
! Set use_cn by the compset you use and CLM_BLDNML_OPTS -bgc setting
! Set use_crop by the compset you use and CLM_BLDNML_OPTS -crop setting
! Set spinup_state by the CLM_BLDNML_OPTS -bgc_spinup setting
! Set co2_ppmv with CCSM_CO2_PPMV option
! Set fatmlndfrc with LND_DOMAIN_PATH/LND_DOMAIN_FILE options
! Set finidat with RUN_REFCASE/RUN_REFDATE/RUN_REFTOD options for hybrid or branch cases
! (includes $inst_string for multi-ensemble cases)
! or with CLM_FORCE_COLDSTART to do a cold start
! or set it with an explicit filename here.
! Set maxpatch_glc with GLC_NEC option
! Set glc_do_dynglacier with GLC_TWO_WAY_COUPLING env variable
!----------------------------------------------------------------------------------


fsurdat = '$CLM_USRDAT_DIR/surfdata_f09_38x288pt_PanBoreal_hist_16pfts_Irrig_CMIP6_simyr2000_c230523.nc'
2 changes: 2 additions & 0 deletions doc/.ChangeLog_template
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ Changes made to namelist defaults (e.g., changed parameter values):

Changes to the datasets (e.g., parameter, surface or initial files):

Changes to documentation:

Substantial timing or memory changes:
[e.g., check PFS test in the test suite and look at timings, if you
expect possible significant timing changes]
Expand Down
81 changes: 81 additions & 0 deletions doc/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,4 +1,85 @@
===============================================================
Tag name: ctsm5.2.003
Originator(s): samrabin (Sam Rabin, UCAR/TSS, samrabin@ucar.edu)
Date: Thu May 2 14:06:54 MDT 2024
One-line Summary: Merge b4b-dev

Purpose and description of changes
----------------------------------

Brings in 4 PRs from b4b-dev to master:
- Regional CTSM Simulations and Capability of Creating Mesh Files (ESCOMP/CTSM#1892; Negin Sobhani and Adrianna Foster)
- Add line about documentation in PR template (ESCOMP/CTSM#2488; Sam Rabin)
- CTSM5.2 2000 fsurdat T42 64x128 file (ESCOMP/CTSM#2495; Sam Levis)
- Move plumber2 scripts to python directory (ESCOMP/CTSM#2505; Teagan King)


Significant changes to scientifically-supported configurations
--------------------------------------------------------------

Does this tag change answers significantly for any of the following physics configurations?
(Details of any changes will be given in the "Answer changes" section below.)

[Put an [X] in the box for any configuration with significant answer changes.]

[ ] clm6_0

[ ] clm5_1

[ ] clm5_0

[ ] ctsm5_0-nwp

[ ] clm4_5


Bugs fixed
----------

List of CTSM issues fixed (include CTSM Issue # and description):
- Resolves ESCOMP/CTSM#1513: Need a process to subset ESMF mesh files from global ones for regional grids
- Resolves ESCOMP/CTSM#1773: High resolution regional simulations
- Resolves ESCOMP/CTSM#2187: Move new PLUMBER2 scripts to python directory to enable python testing
- Resolves ESCOMP/CTSM#2486: Temporarily add back a T42 dataset for CAM


Notes of particular relevance for users
---------------------------------------

Changes to documentation:
- Adds documentation for making mesh files


Notes of particular relevance for developers:
---------------------------------------------

Changes to tests or testing:
- Adds testing for mesh-making Python scripts
- Adds testing for plumber2_surf_wrapper


Testing summary:
----------------

regular tests (aux_clm: https://github.com/ESCOMP/CTSM/wiki/System-Testing-Guide#pre-merge-system-testing):

derecho ----- OK
izumi ------- OK


Other details
-------------

Pull Requests that document the changes (include PR ids):
- ESCOMP/CTSM#2513: Merge b4b-dev 2024-05-02
- Constituent PRs:
- ESCOMP/CTSM#1892: Regional CTSM Simulations and Capability of Creating Mesh Files (https://github.com/ESCOMP/CTSM/pull/1892)
- ESCOMP/CTSM#2488: Add line about documentation in PR template (https://github.com/ESCOMP/CTSM/pull/2488)
- ESCOMP/CTSM#2495: CTSM5.2 2000 fsurdat T42 64x128 file (https://github.com/ESCOMP/CTSM/pull/2495)
- ESCOMP/CTSM#2505: Move plumber2 scripts to python directory (https://github.com/ESCOMP/CTSM/pull/2505)

===============================================================
===============================================================
Tag name: ctsm5.2.002
Originator(s): glemieux (Gregory Lemieux, LBNL, glemieux@lbl.gov)
Date: Fri 26 Apr 2024 11:13:46 AM MDT
Expand Down
1 change: 1 addition & 0 deletions doc/ChangeSum
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
Tag Who Date Summary
============================================================================================================================
ctsm5.2.003 samrabin 05/02/2024 Merge b4b-dev
ctsm5.2.002 glemieux 04/26/2024 FATES default allometry parameter file update
ctsm5.2.001 erik 04/22/2024 Merge b4b-dev
ctsm5.2.0 many 04/20/2024 New mksurfdata_esmf tool to create new surface datasets that are in place
Expand Down
7 changes: 7 additions & 0 deletions doc/design/python_script_user_interface.rst
Original file line number Diff line number Diff line change
Expand Up @@ -81,3 +81,10 @@ More verbose output should go in ``logger.info`` or ``logger.debug`` statements
* e.g. You might want to output a ``logging.debug`` statement for every variable in a file you are editing.

Near the top of each python module where logging is used, there should be a line, ``logger = logging.getLogger(__name__)``. Then logging statements should be done using statements like ``logger.info(...)``, *not* ``logging.info(...)``: this allows more contextual information in logging output.

====================================================
Considerations on inclusion of python packages
====================================================

Since, this is somewhat an implementation detail the discussion for this is in ``../../python/README.python_pkgs.rst``. The python
packages used is somewhat both an important part of the user interface, the tool design, and an implementation detail.
4 changes: 2 additions & 2 deletions doc/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@
# The suffix(es) of source filenames.
# You can specify multiple suffix as a list of string:
#
# source_suffix = ['.rst', '.md']
source_suffix = '.rst'
source_suffix = ['.rst', '.md']
#source_suffix = '.rst'

# The master toctree document.
master_doc = 'index'
Expand Down
98 changes: 98 additions & 0 deletions doc/source/how-to-make-mesh.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
# Creating an ESMF mesh file from a netCDF file

This gist includes instructions for creating and visualizing a mesh file from a netcdf file with valid 1D or 2D lats and lons coordinates.

* **ESMF Mesh file** aka **Unstructured Grid File Format** is a netcdf file (format) that includes the information about the grids coordinates and their connectivity to each other.

Additional information about ESMF mesh files are available [here](https://earthsystemmodeling.org/docs/release/ESMF_8_0_1/ESMF_refdoc/node3.html#SECTION03028200000000000000).

------

In this example, we will use `./mesh_maker.py` which uses `mesh_type.py` to create a mesh file and visualize it.

1- First clone my fork and branch that includes these capabilities:
``` Shell
git clone https://github.com/negin513/ctsm.git ctsm_mesh
cd ctsm_mesh

git checkout subset_mesh_dask
```

2- Next run mesh_maker.py for a netcdf file:

```
cd tools/site_and_regional
```
Check all the avaialble options:

```
./mesh_maker.py --help
```

The output shows all available options for this script:
```
|------------------------------------------------------------------|
|--------------------- Instructions -----------------------------|
|------------------------------------------------------------------|
This script creates ESMF unstructured GRID (mesh file) from a netcdf
file with valid lats and lons. Provided lats and lons can be 1D or 2D.
For example for running WRF-CTSM cases, the user can create a mesh
file for their domain :
./mesh_maker.py --input wrfinput_d01 --output my_region
--lat XLAT --lon XLONG --verbose
optional arguments:
-h, --help show this help message and exit
--input INPUT Netcdf input file for creating ESMF mesh.
--output OUTPUT Name of the ESMF mesh created.
--outdir OUT_DIR Output directory (only if name of output mesh is not
defined)
--lat LAT_NAME Name of latitude varibale on netcdf input file. If none
given, looks to find variables that include 'lat'.
--lon LON_NAME Name of latitude varibale on netcdf input file. If none
given, looks to find variables that include 'lon'.
--mask MASK_NAME Name of mask varibale on netcdf input file. If none given,
create a fake mask with values of 1.
--area AREA_NAME Name of area variable on netcdf input file. If none given,
ESMF calculates element areas automatically.
--overwrite If meshfile exists, overwrite the meshfile.
-v, --verbose Increase output verbosity
```

Let's create a mesh file from a netcdf file with 1D lats and lons. On the sample files provided 1D lat and long coordinates are saved on `lsmlat` and `lsmlon` variables.

```
./mesh_maker.py --input /glade/scratch/negins/example_files/surfdata_4x5_hist_78pfts_CMIP6_simyr1850_275.0-330.0_-40-15_c220705.nc --output test_mesh_1d.nc --lat lsmlat --lon lsmlon --overwrite
```
`--verbose` option also provide additional information for debugging.

This script will create regional and global mesh plots. For example for the above files, the plos are:
test_mesh_1d_regional.png
![image](https://user-images.githubusercontent.com/17344536/200441736-972a8136-5c05-4bc9-9bca-b498d972914a.png)


test_mesh_1d_global.png

![image](https://user-images.githubusercontent.com/17344536/200441753-d06e95d1-d85b-4216-9c23-d11ba89a31e4.png)



------
## Creating Mesh files for a WRF domain:
For running WRF-CTSM cases, we need to create ESMF mesh files for the WRF domain. We can create mesh file from wrfinput (wrf initial condition files). wrfinput has 2D coordinate information on `XLAT` and `XLONG` variable.

For example, let's create a mesh file from a WRF input file for WRF-CTSM run.
```
./mesh_maker.py --input /glade/scratch/negins/example_files/wrfinput_d01 --output test_mesh_wrf.nc --lat XLAT --lon XLONG --overwrite
```

This produce mesh files for running for our WRF domain.

Here is how the regional plot looks like for this mesh file:

![image](https://user-images.githubusercontent.com/17344536/200442002-1ee5595c-9252-4934-a07c-2f6ad86aff1b.png)



29 changes: 23 additions & 6 deletions py_env_create
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ if [ $error != 0 ]; then
echo "For notes on installing on a user system see: https://docs.conda.io/projects/conda/en/latest/user-guide/install/index.html"
echo "Error code was $error"
cat condahelp.txt
rm condahelp.txt
exit -1
fi
rm condahelp.txt
Expand All @@ -44,7 +45,7 @@ usage() {
echo "[-v|--verbose] "
echo " Run with verbose mode for the install so you see the progress bar"
echo "[-f|--file <file>] "
echo " Conda environment file to use (can be a text format or YAML format)"
echo " Conda environment requirements text file to use (text format) in addition to the others"
echo " Assumed to be under the directory: $condadir"
echo " Default is: $condafile"
echo "[--option <option>] "
Expand Down Expand Up @@ -80,6 +81,9 @@ while [ $# -gt 0 ]; do
shift
done

#
# Error checking options and setup
#
if [ ! -f $condadir/$condafile ]; then
echo "$condadir/$condafile does NOT exist"
echo "Use the --file option with a valid filename"
Expand All @@ -89,11 +93,13 @@ fi
echo "Use conda to install the python environment needed to run the CTSM python tools in the conda environment: $ctsm_python"
echo "Using the file: $condadir/$condafile"

#
# Check if the environment already exists, if it does continue, if not create it
#
conda list -n $ctsm_python >& /dev/null
if [ $? != 0 ]; then
echo "Create $ctsm_python"
cmd="conda create --force -n $ctsm_python -q"
cmd="conda create --force --name $ctsm_python --quiet"
echo "$cmd"
$cmd
if [ $? != 0 ]; then
Expand All @@ -103,12 +109,20 @@ if [ $? != 0 ]; then
else
echo "$ctsm_python environment already exists"
fi
echo "Install $ctsm_python this can take a long time, be patient...."
verbosity="-q"
#
# Install the environemnt
#
echo "Install $ctsm_python this can take a long time (12 to 20 minutes is expected), be patient...."
echo " ...."
echo " ...."
echo " ...."
verbosity="--quiet"
loglevel="ERROR"
if [ "$verbose" == "Yes" ]; then
verbosity="-v"
verbosity="--verbose"
loglevel="INFO"
fi
cmd="conda install --yes $verbosity -c conda-forge -n $ctsm_python --file $condadir/$condafile $option"
cmd="conda install --yes $verbosity --channel conda-forge --name $ctsm_python $condadir/$condafile $option"
echo "$cmd"
$cmd
if [ $? != 0 ]; then
Expand All @@ -117,6 +131,9 @@ if [ $? != 0 ]; then
echo "Change the file and try again"
exit -2
fi
#
# Report on success
#
echo "Successfully installed the $ctsm_python python environment"
echo
echo "activate the environment by doing the following..."
Expand Down
33 changes: 33 additions & 0 deletions python/README.python_pkgs.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
.. sectnum::

.. contents::

=====================================================================================
Requirements to consider for python packages to be included for CTSM python tools
=====================================================================================

Requirements for CTSM python tools:

Any added dependencies should be discussed and approved by the CTSM-software team. Criteria for evaluation of third-party packages
include:
- How much value does this package provide to us beyond what we could get without it?
- How difficult it is to install this package (including: how much does this complicate / slow down the creation of the conda
environment)?
- How stable is this package?
- How well maintained is this package?
- Are there other packages that are more stable or better maintained that would provide nearly the same level of value?
- Tools that require extra packages should be done in a "contrib" type area out of the main part of tools (this would apply for
advanced plotting capability for example)
- We need to be able to reproduce working conda environments minimally on our test machines (currently cheyenne and izumi), but also
on any machine that we run CTSM on. If there is a machine that we can run CTSM on that we can't build the conda environments or run
the tools on -- that needs to be fixed.
- We need to tell the user how long to expect the conda environment to load, and give them options if the conda load is taking too
long
- Conda environments need to build robustly even for users who don't have ctsm_pylib loaded in their conda environment
- Currently dask will NOT be something we require for any of the main CTSM tools
- Currently we won't use conda-lock
- We specify the black version exactly so that black will function identically for all users
- We specify the pylint version exactly because pylint is finicky with version and we need it to work identically for all developers
- We might remove the need for python packages that aren't providing enough utility
Packages where specific versions seem to be required will have the version requirements in a least the >= form if not an exact
version
2 changes: 2 additions & 0 deletions python/conda_env_ctsm_py.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,5 @@ xesmf
numba=0.55.2 # Avoid 0.56 until numpy>=1.20. This is the minimum for xesmf
pylint=2.8.3
black=22.3.0 # NOTE: The version here needs to be coordinated with the black github action under ../.github/workflows
cartopy=0.20.2
matplotlib=3.3.2
Loading
Loading