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

Initial script for shuffle DO NOT MERGE #547

Open
wants to merge 16 commits into
base: main
Choose a base branch
from

Conversation

bschroeter
Copy link
Contributor

@bschroeter bschroeter commented Feb 17, 2025

Here is an initial script to facilitate the library shuffle between the two repos.

This PR is just for discussion so that we can hash out the details before we execute and is based on discussions thus far. IT IS NOT MEANT TO BE MERGED INTO THE CODE.

Please add any comments inline to the code so that I can continue to update.


📚 Documentation preview 📚: https://cable--547.org.readthedocs.build/en/547/

@bschroeter bschroeter requested a review from ccarouge February 17, 2025 02:39
@bschroeter bschroeter linked an issue Feb 17, 2025 that may be closed by this pull request
Copy link
Member

@ccarouge ccarouge left a comment

Choose a reason for hiding this comment

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

It's missing a step.
We want to replace "$UM7_DIR/umbase_hg3/src/atmosphere/CABLE/src" with a fresh copy from "$CABLE_dir/src":

  • do a fresh copy from $CABLE_dir/src
  • remove offline/
  • remove coupled/X except for esm/ and shared/.

We will want to remove that "$UM7_DIR/umbase_hg3/src/atmosphere/CABLE/src/" directory completely but we can only do that when we figure out the compilation from the library.

@ccarouge
Copy link
Member

ccarouge commented Feb 20, 2025

This PR is going to change where some of the files go. I'll refresh my memory on both and update here once I know.

Edit: I've added the changes I think we need to the script as code suggestions. I would recommend to wait for PR#60 to be merged in UM7 before doing the reshuffle. The PR#60 is almost done, should be merged in a day or 2.

@har917
Copy link
Collaborator

har917 commented Feb 20, 2025

@bschroeter @ccarouge @JhanSrbinovsky Should we use this reshuffle as the time to remove any ESM1.5 and CM2 code entirely from the CABLE3:MAIN repo? We have copies of those files elsewhere.

@JhanSrbinovsky
Copy link
Collaborator

JhanSrbinovsky commented Feb 20, 2025 via email

shuffle.sh Outdated
cp $UM7_ESM15_DIR/cable_um_init.F90 $UM7_CABLE_DIR/
cp $UM7_ESM15_DIR/cable_um_init_subrs.F90 $UM7_CABLE_DIR/
cp $UM7_ESM15_DIR/cable_um_tech.F90 $UM7_CABLE_DIR/
cp $UM7_ESM15_DIR/allocate_soil_params_cbl.F90 $UM7_CABLE_DIR/
Copy link
Collaborator

Choose a reason for hiding this comment

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

allocate_soil(veg)_params will be wrapped up in single modules that can be shared across apps - but for now you can do this.

@ccarouge
Copy link
Member

I've added a couple of suggestion (a correction of a previous suggestion and a new one). I think I would have to see the result of the script now to know if there are any mistakes.

@JhanSrbinovsky
Copy link
Collaborator

@bschroeter Ive confused myself again. I am presently resolving code differences between CABLE:main and UM7 version of CABLE (which so far have been minimal). An obvious difference is whether or not UM_CBL is defined (or not !). Back in ACCESS1.4 days, to build a library, we just had a script where the first line was just something like:

sed 's/!#define/#define/' $FIILE
then just all the build lines.

We had a single repo for CABLE. There was no CABLE in the UM repo. Keeping the online interface code in there is probably a better idea though.

@ccarouge
Copy link
Member

@JhanSrbinovsky Handling of the pre-processor flag at compile time will come next. For the moment, in the shuffle script there is a comment that we need to set these by hand in the files. This is so we end up with the correct versions of files in both CABLE and UM7 after the shuffle.

@JhanSrbinovsky
Copy link
Collaborator

#551 #552 in CABLE #78 in UM7 and they will be. Except for parts in offline/ vs coupled/. I'll get onto all the "types" files soon-ish.
@ccarouge Can you have a look at the benchcab error I posted. Im kinda stuck. I have both runs setup corresponding to #220 in AM3, but I still have the "sync_ESM16_util" (552) one to sort out first

bschroeter and others added 8 commits February 28, 2025 11:53
Co-authored-by: Claire Carouge <[email protected]>
Co-authored-by: Claire Carouge <[email protected]>
Co-authored-by: Claire Carouge <[email protected]>
Co-authored-by: Claire Carouge <[email protected]>
Co-authored-by: Claire Carouge <[email protected]>
Co-authored-by: Claire Carouge <[email protected]>
@ccarouge ccarouge force-pushed the 538-the-great-library-shuffle branch 2 times, most recently from 9619db3 to 6665c1c Compare February 28, 2025 03:47
@ccarouge ccarouge force-pushed the 538-the-great-library-shuffle branch from cbc0d64 to e885d6a Compare February 28, 2025 04:07
@ccarouge
Copy link
Member

This now also contains a first pass through the script, after a few modifications. I still have to check it is correct, I wanted to warn everyone the script has run through! I'm happy to have other eyes looking at it.

Files shouldn't have been modified, only moved around. There could be new files under CABLE/src/coupled/esm though (or maybe not, as I said I still have to check everything makes sense).

The good news is the build worked. Maybe that's a bad news actually because some files should have moved from src/offline to src/shared and no changes to the Makefile has been done.

@ccarouge ccarouge force-pushed the 538-the-great-library-shuffle branch from 90ae247 to 054f459 Compare February 28, 2025 06:54
@ccarouge
Copy link
Member

ccarouge commented Mar 3, 2025

benchcab results for the shuffle in this branch are good: 2025-03-03 17:27:05,475 - INFO - benchcab.benchcab.py:381 - 0 failed, 168 passed

Waiting on UM side test results.

@JhanSrbinovsky
Copy link
Collaborator

What about in AM3?

@ccarouge
Copy link
Member

ccarouge commented Mar 4, 2025

What about in AM3?

AM3 will be done once the full library workflow will work for ESM1.6. This shuffle should be transparent to AM3 because the files put in src/shared are currently not in AM3 code base.

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.

The Great Library Shuffle
4 participants