-
Notifications
You must be signed in to change notification settings - Fork 152
Add zero_gradient and linear_extrap boundary conditions #1094
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
Merged
Merged
Changes from 5 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
5d9b9ee
Add dirichlet and neumann boundary conditions
apcraig 9fb737d
Update new boundary conditions, inline loops with if statements, clean
apcraig 74815f5
Fix typo in comment
apcraig 0e59535
Clean up trailing blanks
apcraig 7daa1eb
Update initialization of uvmCD, caused some compiler to fail in debug…
apcraig 6aa2364
Update documentation
apcraig File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
80 changes: 80 additions & 0 deletions
80
cicecore/cicedyn/infrastructure/comm/mpi/README.generate_haloupdates
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,80 @@ | ||
|
|
||
| How to Generate the ice_HaloUpdate subroutines quickly | ||
|
|
||
| generate_haloUpdates.sh is a script that can generate the multiple | ||
| ice_HaloUpdate calls in ice_boundary.F90 to keep them all self-consistent. | ||
| The script uses a template to generate the various haloUpdate subroutines | ||
| depending on dimension and data type. It is implemented so it can be | ||
| used in both the mpi and serial directories. | ||
|
|
||
| generate_haloUpdates.sh creates a file for each subroutine with a | ||
| name like HaloUpdate2DR8.subr. Those files are catted into HaloUpdate_all.subr | ||
| in the order those subroutines appear in ice_boundary.F90. The main | ||
| template in generate_haloUpdates.sh creates all the subroutines except | ||
| the 2DL1 subroutine. That subroutine is generated directly via a cat | ||
| near the bottom of the script because the 2DL1 implementation is unique. | ||
| It converts the logicals to integers, calls 2DI4, and then converts the | ||
| integers back to logicals. | ||
|
|
||
| Remember that there are mpi and serial version of the ice_boundary.F90 | ||
| file and both should be updated and synchronized at the same time. | ||
|
|
||
| The recommended usage is described below. | ||
|
|
||
| 1. Compare mpi and serial versions | ||
|
|
||
| cd cicecore/cicedyn/infrastructure/comm/mpi | ||
| diff ../serial/ice_boundary.F90 ./ice_boundary.F90 | ||
|
|
||
| ! The only difference should be a #define at the top of the file. | ||
| ! If there are other differences, it suggests someone updated one | ||
| ! file and not the other. Try to reconcile this first. | ||
|
|
||
| 2. Verify the current version of generate_haloUpdates.sh | ||
|
|
||
| cd cicecore/cicedyn/infrastructure/comm/mpi | ||
| sed -n '/subroutine ice_HaloUpdate2DR8/,/end subroutine ice_HaloUpdate4DI4/p' ice_boundary.F90 >! HaloUpdate_all.current | ||
| ./generate_haloUpdates.sh | ||
| diff HaloUpdate_all.current HaloUpdate_all.subr | ||
|
|
||
| ! Verify generate_haloUpdates.sh produces code that matches the current implementation in | ||
| ! ice_boundary.F90. If it doesn't, it suggests someone made manual changes to the subroutines | ||
| ! in ice_boundary.F90. Try to reconcile those differences and update generate_haloUpdates.sh first | ||
|
|
||
| 3. Update generate_haloUpdates.sh and generate new subroutines | ||
|
|
||
| ! Modify generate_haloUpdates.sh to generate updated code then run | ||
|
|
||
| ./generate_haloUpdates.sh | ||
| diff haloUpdate_all.current haloUpdate_all.subr | ||
|
|
||
| ! Review diffences with the current code (HaloUpdate_all.current) | ||
|
|
||
| 4. Update ice_boundary.F90 | ||
|
|
||
| ! When the changes are reasonable and as expected, edit ice_boundary.F90, cut out the code | ||
| ! between "subroutine ice_HaloUpdate2DR8" and "end subroutine ice_HaloUpdate4DI4" and replace | ||
| ! that code with the latest HaloUpdate_all.subr file. You can do it manually or try | ||
|
|
||
| sed -e '/subroutine ice_HaloUpdate2DR8/,/end subroutine ice_HaloUpdate4DI4/c REPLACEHERE' ice_boundary.F90 >! tmpfile | ||
| sed -e '/REPLACEHERE/r HaloUpdate_all.subr' -e '/REPLACEHERE/d' tmpfile >! ice_boundary.F90.new | ||
| rm tmpfile | ||
| diff ice_boundary.F90 ice_boundary.F90.new | ||
|
|
||
| ! There may be some extra blank lines or subroutine separators that need to be cleaned up at the | ||
| ! start or end of the replacement code, but then | ||
|
|
||
| mv ice_boundary.F90.new ice_boundary.F90 | ||
|
|
||
| 5. Update serial version of ice_boundary.F90 | ||
|
|
||
| ! Copy mpi/ice_boundary.F90 to serial/ice_boundary.F90 and add | ||
|
|
||
| #define SERIAL_REMOVE_MPI | ||
|
|
||
| ! to the top of the serial/ice_boundary.F90 code to turn off MPI in that version | ||
|
|
||
| 6. Test and test again | ||
|
|
||
| ! Run both single and multi processor tests and iterate until done. | ||
|
|
||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not for this PR, but does it now make sense to combine the MPI and serial codes into a single, multi-purpose code?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is the long term goal, getting there slowly. Even in the interim, there are large advantages to having the codes basically be the same. As I slowly synced up the serial and mpi versions, I noticed several cases where features were added to one and not the other. In some ways, that was a large motivator to fully sync up the code.