Skip to content

Conversation

@samsrabin
Copy link
Member

@samsrabin samsrabin commented Jun 25, 2025

Description of changes

Resolves an issue in subset_data where Longitude types were being implicitly converted to string to look like <ctsm.longitude.Longitude object at 0x7f34cb836a90>. Now, implicit string conversion is disallowed—the user must specify the type of longitude they want.

Also adds testing:

  • Python unit tests of implicit and explicit string conversion of Longitude objects
  • Python system tests of string values in names of subset_data output files
  • Python system testing that create_newcase works with subset_data outputs
  • New CIME SystemTest SUBSETDATAPOINT. No; moving to a different PR.

Specific notes

Contributors other than yourself, if any: None

CTSM Issues Fixed:

Are answers expected to change (and if so in what way)? No

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

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

Testing performed, if any: As of 319ea5a (worked at aca0a5d):

  • Python unit tests
  • Python system tests
  • A manual run like so, approximating the setup @katierocci used:
outdir=$PWD/outdir_issue_3279
user_mods_dir=$outdir/user_mods
casedir=~/cases_ctsm/issue_3279

tools/site_and_regional/subset_data point --lat 45.402252 --lon 267.201915 --site ccc3_crujra --create-surface --create-datm --datm-syr 2000 --datm-eyr 2000 --create-user-mods --outdir $outdir --user-mods-dir $user_mods_dir

cime/scripts/create_newcase --case $casedir --res CLM_USRDAT --compset I2000Clm60BgcCrujra --run-unsupported --user-mods-dir $user_mods_dir

cd $casedir
./case.setup
./shell_commands
./preview_namelists
qcmd -- ./case.build && ./case.submit
  • Another manual run like that, but using -92.798085 for the longitude to test whether it works for longitude type 180.
outdir=$PWD/outdir_issue_3279_type180
user_mods_dir=$outdir/user_mods
casedir=~/cases_ctsm/issue_3279_type180

tools/site_and_regional/subset_data point --lat 45.402252 --lon -92.798085 --site ccc3_crujra --create-surface --create-datm --datm-syr 2000 --datm-eyr 2000 --create-user-mods --outdir $outdir --user-mods-dir $user_mods_dir

cime/scripts/create_newcase --case $casedir --res CLM_USRDAT --compset I2000Clm60BgcCrujra --run-unsupported --user-mods-dir $user_mods_dir

cd $casedir
./case.setup
./shell_commands
./preview_namelists
qcmd -- ./case.build && ./case.submit

Also:

  • clm_pymods suite: /glade/derecho/scratch/samrabin/tests_0627-161354de/

  • As of 71f9995: New SystemTest: SUBSETDATAPOINT_Ld5_D_Mmpi-serial.CLM_USRDAT.I2000Clm60BgcCrujra.derecho_intel.clm-default. Completes successfully! Moving to a different PR to keep this one focused.

@samsrabin samsrabin self-assigned this Jun 25, 2025
@samsrabin samsrabin added bug something is working incorrectly bfb bit-for-bit labels Jun 25, 2025
@samsrabin samsrabin force-pushed the more-subset-data-lon-fixes branch from 4817233 to 4b50783 Compare June 26, 2025 21:51
@samsrabin samsrabin changed the title [WIP] subset_data: Fix conversion of Longitude to string subset_data: Fix conversion of Longitude to string Jun 26, 2025
@samsrabin samsrabin added the PR status: awaiting review Work on this PR is paused while waiting for review. label Jun 26, 2025
Copy link
Contributor

@slevis-lmwg slevis-lmwg left a comment

Choose a reason for hiding this comment

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

@samsrabin and I went over this PR in detail today.
@samsrabin already documented a concern that I expressed, by opening issue #3293.

@samsrabin samsrabin merged commit 8026b9d into ESCOMP:b4b-dev Jun 27, 2025
6 checks passed
@samsrabin samsrabin linked an issue Jul 1, 2025 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bfb bit-for-bit bug something is working incorrectly PR status: awaiting review Work on this PR is paused while waiting for review.

Development

Successfully merging this pull request may close these issues.

subset_data still having trouble with Longitude

2 participants