-
Notifications
You must be signed in to change notification settings - Fork 18
Update MPAS dynamical core to version 8.4.0 #495
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
Open
kuanchihwang
wants to merge
11
commits into
ESCOMP:development
Choose a base branch
from
kuanchihwang:staging/mpas-dycore-8.4.0
base: development
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
d59713d
Update MPAS dynamical core to version 8.4.0
kuanchihwang e87d52c
Suppress harmless errors in build logs
kuanchihwang 93d5b89
Add patches to fix crash in MPAS 8.4.0
kuanchihwang 3554b36
Update namelist definition file and script for MPAS dynamical core
kuanchihwang 85af071
Remove deprecated variables that no longer exist
kuanchihwang 353430c
Rework constituent handling in MPAS subdriver to support new LES capa…
kuanchihwang a7ed1d9
Merge branch 'development' into develop/mpas-dycore-8.4.0
kuanchihwang 2c49409
Merge branch 'development' into develop/mpas-dycore-8.4.0
kuanchihwang 9aa07d6
Promote `les_model` logical to component of `mpas_dynamical_core_type`
kuanchihwang 6d63e60
Output `units` elements when generating MPAS namelist definition file
kuanchihwang 4e037fc
Regenerate MPAS namelist definition file
kuanchihwang 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
45 changes: 45 additions & 0 deletions
45
src/dynamics/mpas/assets/0001-Fix-Fortran-standard-violation.patch
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,45 @@ | ||
| From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 | ||
| From: Kuan-Chih Wang <kuanchihw@ucar.edu> | ||
| Date: Tue, 21 Apr 2026 13:50:09 -0600 | ||
| Subject: [PATCH] Fix Fortran standard violation due to pointer argument not | ||
| being associated | ||
|
|
||
| At line 1970, if the `DO_PHYSICS` macro is undefined, the `diag_physics` pointer | ||
| will not be initialized by the call to `mpas_pool_get_subpool`, and therefore | ||
| its pointer association status will remain undefined. | ||
|
|
||
| However, at line 2250, this pointer is used as an argument to call `atm_compute_dyn_tend`, | ||
| which constitutes a Fortran standard violation. | ||
|
|
||
| Quoted from Fortran 2023, | ||
|
|
||
| > 15.5.2.4 Argument association | ||
| > Except in references to intrinsic inquiry functions, a pointer actual argument that | ||
| > corresponds to a nonoptional nonpointer dummy argument shall be pointer associated with | ||
| > a target. | ||
|
|
||
| This bug can lead to a runtime crash for models that use MPAS as a dynamical core | ||
| (e.g., CAM, CAM-SIMA). | ||
|
|
||
| Fix this issue by adding the `pointer` attribute to the `diag_physics` dummy argument | ||
| for the `atm_compute_dyn_tend` subroutine. | ||
| --- | ||
| src/core_atmosphere/dynamics/mpas_atm_time_integration.F | 2 +- | ||
| 1 file changed, 1 insertion(+), 1 deletion(-) | ||
|
|
||
| diff --git a/src/core_atmosphere/dynamics/mpas_atm_time_integration.F b/src/core_atmosphere/dynamics/mpas_atm_time_integration.F | ||
| index 238ca7235..c16072976 100644 | ||
| --- a/src/core_atmosphere/dynamics/mpas_atm_time_integration.F | ||
| +++ b/src/core_atmosphere/dynamics/mpas_atm_time_integration.F | ||
| @@ -5813,7 +5813,7 @@ module atm_time_integration | ||
| type (mpas_pool_type), intent(in) :: state | ||
| type (mpas_pool_type), intent(in) :: diag | ||
| type (mpas_pool_type), intent(in) :: mesh | ||
| - type (mpas_pool_type), intent(in) :: diag_physics | ||
| + type (mpas_pool_type), pointer, intent(in) :: diag_physics | ||
| type (mpas_pool_type), intent(in) :: configs | ||
| integer, intent(in) :: nVertLevels ! for allocating stack variables | ||
| integer, intent(in) :: rk_step, dynamics_substep | ||
| -- | ||
| 2.48.1 | ||
|
|
||
28 changes: 28 additions & 0 deletions
28
src/dynamics/mpas/assets/0002-Add-missing-argument-intent.patch
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,28 @@ | ||
| From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 | ||
| From: Kuan-Chih Wang <kuanchihw@ucar.edu> | ||
| Date: Tue, 21 Apr 2026 14:35:05 -0600 | ||
| Subject: [PATCH] Add missing argument intent | ||
|
|
||
| Throughout the `atm_compute_dyn_tend` subroutine, the `tend_physics` pointer | ||
| never changes its pointer association status. Add the missing `intent(in)` | ||
| attribute for better safety. | ||
| --- | ||
| src/core_atmosphere/dynamics/mpas_atm_time_integration.F | 2 +- | ||
| 1 file changed, 1 insertion(+), 1 deletion(-) | ||
|
|
||
| diff --git a/src/core_atmosphere/dynamics/mpas_atm_time_integration.F b/src/core_atmosphere/dynamics/mpas_atm_time_integration.F | ||
| index c16072976..b6e620fe1 100644 | ||
| --- a/src/core_atmosphere/dynamics/mpas_atm_time_integration.F | ||
| +++ b/src/core_atmosphere/dynamics/mpas_atm_time_integration.F | ||
| @@ -5809,7 +5809,7 @@ module atm_time_integration | ||
| ! Dummy arguments | ||
| ! | ||
| type (mpas_pool_type), intent(inout) :: tend | ||
| - type (mpas_pool_type), pointer :: tend_physics | ||
| + type (mpas_pool_type), pointer, intent(in) :: tend_physics | ||
| type (mpas_pool_type), intent(in) :: state | ||
| type (mpas_pool_type), intent(in) :: diag | ||
| type (mpas_pool_type), intent(in) :: mesh | ||
| -- | ||
| 2.48.1 | ||
|
|
29 changes: 29 additions & 0 deletions
29
src/dynamics/mpas/assets/0003-Avoid-implicit-save-attribute.patch
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,29 @@ | ||
| From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 | ||
| From: Kuan-Chih Wang <kuanchihw@ucar.edu> | ||
| Date: Tue, 21 Apr 2026 14:49:58 -0600 | ||
| Subject: [PATCH] Avoid implicit `save` attribute during variable declaration | ||
|
|
||
| In Fortran, explicit initialization of a variable implies the `save` attribute, | ||
| which may have surprising result and is not thread-safe. | ||
|
|
||
| Avoid doing it to conform to the Fortran best practices. | ||
| --- | ||
| src/core_atmosphere/dynamics/mpas_atm_time_integration.F | 2 +- | ||
| 1 file changed, 1 insertion(+), 1 deletion(-) | ||
|
|
||
| diff --git a/src/core_atmosphere/dynamics/mpas_atm_time_integration.F b/src/core_atmosphere/dynamics/mpas_atm_time_integration.F | ||
| index b6e620fe1..227fbde86 100644 | ||
| --- a/src/core_atmosphere/dynamics/mpas_atm_time_integration.F | ||
| +++ b/src/core_atmosphere/dynamics/mpas_atm_time_integration.F | ||
| @@ -1918,7 +1918,7 @@ module atm_time_integration | ||
| type (mpas_pool_type), pointer :: diag_physics | ||
| type (mpas_pool_type), pointer :: mesh | ||
| type (mpas_pool_type), pointer :: tend | ||
| - type (mpas_pool_type), pointer :: tend_physics => null() | ||
| + type (mpas_pool_type), pointer :: tend_physics | ||
| type (mpas_pool_type), pointer :: lbc ! regional_MPAS addition | ||
|
|
||
| real (kind=RKIND), dimension(:,:), pointer :: w | ||
| -- | ||
| 2.48.1 | ||
|
|
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
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
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.
Just double-checking that these three patch files won't be needed once MPAS PR MPAS-Dev/MPAS-Model#1448 has been merged?
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.
Yes, once that PR is merged and MPAS gets the next tag, we can then update the git submodule in CAM-SIMA and delete those patches.