-
Notifications
You must be signed in to change notification settings - Fork 394
Fix bugs that cause model crash when CAM radiation is activated #1391
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
smileMchen
wants to merge
1
commit into
MPAS-Dev:develop
Choose a base branch
from
smileMchen:camrad
base: develop
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.
+36
−20
Open
Changes from all commits
Commits
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -459,9 +459,6 @@ subroutine radiation_sw_from_MPAS(configs,mesh,state,time_lev,diag_physics,atm_i | |
| swupbc_p(i,j) = 0.0_RKIND | ||
| swupt_p(i,j) = 0.0_RKIND | ||
| swuptc_p(i,j) = 0.0_RKIND | ||
| swddir_p(i,j) = 0.0_RKIND | ||
| swddni_p(i,j) = 0.0_RKIND | ||
| swddif_p(i,j) = 0.0_RKIND | ||
| enddo | ||
|
|
||
| do k = kts,kte | ||
|
|
@@ -472,21 +469,28 @@ subroutine radiation_sw_from_MPAS(configs,mesh,state,time_lev,diag_physics,atm_i | |
| enddo | ||
|
|
||
| aer_opt = 0 | ||
| do n = 1,nbndsw | ||
| do j = jts,jte | ||
| do k = kts,kte | ||
| do i = its,ite | ||
| tauaer_p(i,k,j,n) = 0._RKIND | ||
| ssaaer_p(i,k,j,n) = 1._RKIND | ||
| asyaer_p(i,k,j,n) = 0._RKIND | ||
| enddo | ||
| enddo | ||
| enddo | ||
| enddo | ||
|
|
||
| radiation_sw_select: select case (trim(radt_sw_scheme)) | ||
|
|
||
| case("rrtmg_sw") | ||
| do j = jts,jte | ||
| do i = its,ite | ||
| swddir_p(i,j) = 0.0_RKIND | ||
| swddni_p(i,j) = 0.0_RKIND | ||
| swddif_p(i,j) = 0.0_RKIND | ||
| enddo | ||
| enddo | ||
| do n = 1,nbndsw | ||
| do j = jts,jte | ||
| do k = kts,kte | ||
| do i = its,ite | ||
| tauaer_p(i,k,j,n) = 0._RKIND | ||
| ssaaer_p(i,k,j,n) = 1._RKIND | ||
| asyaer_p(i,k,j,n) = 0._RKIND | ||
| enddo | ||
| enddo | ||
| enddo | ||
| enddo | ||
| microp_select: select case(microp_scheme) | ||
| case("mp_thompson","mp_thompson_aerosols","mp_wsm6") | ||
| if(config_microp_re) then | ||
|
|
@@ -705,12 +709,15 @@ subroutine radiation_sw_from_MPAS(configs,mesh,state,time_lev,diag_physics,atm_i | |
| end subroutine radiation_sw_from_MPAS | ||
|
|
||
| !================================================================================================================= | ||
| subroutine radiation_sw_to_MPAS(diag_physics,tend_physics,its,ite) | ||
| subroutine radiation_sw_to_MPAS(configs,diag_physics,tend_physics,its,ite) | ||
| !================================================================================================================= | ||
|
|
||
| !input arguments: | ||
| type(mpas_pool_type),intent(inout):: diag_physics | ||
| type(mpas_pool_type),intent(inout):: tend_physics | ||
| type(mpas_pool_type),intent(in):: configs | ||
| !local pointers: | ||
| character(len=StrKIND),pointer:: radt_sw_scheme | ||
|
|
||
| integer,intent(in):: its,ite | ||
|
|
||
|
|
@@ -743,8 +750,9 @@ subroutine radiation_sw_to_MPAS(diag_physics,tend_physics,its,ite) | |
| call mpas_pool_get_array(diag_physics,'swddif' ,swddif ) | ||
| call mpas_pool_get_array(tend_physics,'rthratensw',rthratensw) | ||
|
|
||
| do j = jts,jte | ||
| call mpas_pool_get_config(configs,'config_radt_sw_scheme',radt_sw_scheme) | ||
|
|
||
| do j = jts,jte | ||
| do i = its,ite | ||
| coszr(i) = coszr_p(i,j) | ||
| gsw(i) = gsw_p(i,j) | ||
|
|
@@ -757,11 +765,18 @@ subroutine radiation_sw_to_MPAS(diag_physics,tend_physics,its,ite) | |
| swupbc(i) = swupbc_p(i,j) | ||
| swupt(i) = swupt_p(i,j) | ||
| swuptc(i) = swuptc_p(i,j) | ||
| swddir(i) = swddir_p(i,j) | ||
| swddni(i) = swddni_p(i,j) | ||
| swddif(i) = swddif_p(i,j) | ||
| enddo | ||
|
|
||
| radiation_sw_select: select case (trim(radt_sw_scheme)) | ||
| case("rrtmg_sw") | ||
| do i = its,ite | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just for consistency, should we indent this block using three spaces? |
||
| swddir(i) = swddir_p(i,j) | ||
| swddni(i) = swddni_p(i,j) | ||
| swddif(i) = swddif_p(i,j) | ||
| enddo | ||
| case default | ||
| end select radiation_sw_select | ||
|
|
||
| do k = kts,kte | ||
| do i = its,ite | ||
| rthratensw(k,i) = rthratensw_p(i,k,j) | ||
|
|
@@ -981,7 +996,8 @@ subroutine driver_radiation_sw(itimestep,configs,mesh,state,time_lev,diag_physic | |
| end select radiation_sw_select | ||
|
|
||
| !copy local arrays to MPAS grid: | ||
| call radiation_sw_to_MPAS(diag_physics,tend_physics,its,ite) | ||
| !mchen call radiation_sw_to_MPAS(diag_physics,tend_physics,its,ite) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think it would be fine to just remove this commented-out line. |
||
| call radiation_sw_to_MPAS(configs,diag_physics,tend_physics,its,ite) | ||
|
|
||
| !call mpas_log_write('--- end subroutine driver_radiation_sw.') | ||
|
|
||
|
|
||
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.
Should we indent the body of these loops by three spaces for consistency?