forked from NCAR/ccpp-physics
-
Notifications
You must be signed in to change notification settings - Fork 54
Small change to CMake for MPAS + Initial MPAS interstitial scheme. #301
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
dustinswales
merged 5 commits into
ufs-community:ufs/dev
from
dustinswales:feature/mpas_nuopc_init
Aug 29, 2025
Merged
Changes from 4 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
ff95d68
Initial commit for MPAS interstitials.
dustinswales 8cd11b0
Merge branch 'ufs/dev' of https://github.com/ufs-community/ccpp-physi…
dustinswales 9f54c41
Merge branch 'ufs/dev' of https://github.com/ufs-community/ccpp-physi…
dustinswales b15920d
Merge branch 'ufs/dev' of https://github.com/ufs-community/ccpp-physi…
dustinswales 1dfc855
Merge branch 'ufs/dev' of https://github.com/ufs-community/ccpp-physi…
dustinswales 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
72 changes: 72 additions & 0 deletions
72
physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rad_time_vary.mpas.F90
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,72 @@ | ||
| !>\file GFS_rad_time_vary.mpas.F90 | ||
| !! Contains code related to GFS radiation suite setup (radiation part of time_vary_step) | ||
| module GFS_rad_time_vary | ||
| implicit none | ||
|
|
||
| private | ||
|
|
||
| public GFS_rad_time_vary_timestep_init | ||
|
|
||
| contains | ||
|
|
||
| !> This module contains code related to GFS radiation setup. | ||
|
|
||
| !> \section arg_table_GFS_rad_time_vary_timestep_init Argument Table | ||
| !! \htmlinclude GFS_rad_time_vary_timestep_init.html | ||
| !! | ||
| subroutine GFS_rad_time_vary_timestep_init (lrseeds, rseeds, lslwr, lsswr, isubc_lw, & | ||
| isubc_sw, icsdsw, icsdlw, sec, kdt, ipsd0, ipsdlim, errmsg, errflg) | ||
| use mersenne_twister, only: random_setseed, random_index, random_stat | ||
| use machine, only: kind_phys | ||
| use radcons, only: con_100 | ||
| implicit none | ||
|
|
||
| ! Interface variables | ||
| logical, intent(in) :: lrseeds | ||
| integer, intent(in), optional :: rseeds(:,:) | ||
| integer, intent(in) :: isubc_lw, isubc_sw, kdt | ||
| integer, intent(in) :: ipsd0, ipsdlim | ||
| logical, intent(in) :: lslwr, lsswr | ||
| integer, intent(inout), optional :: icsdsw(:), icsdlw(:) | ||
| real(kind_phys), intent(in) :: sec | ||
| character(len=*), intent(out) :: errmsg | ||
| integer, intent(out) :: errflg | ||
|
|
||
| ! Local variables | ||
| type (random_stat) :: stat | ||
| integer :: ix, j, i, ipseed, ixx | ||
| integer, allocatable, dimension(:) :: numrdm | ||
|
|
||
| ! Initialize CCPP error handling variables | ||
| errmsg = '' | ||
| errflg = 0 | ||
|
|
||
| if (lsswr .or. lslwr) then | ||
| !--- set up random seed index in a reproducible way for entire cubed-sphere face (lat-lon grid) | ||
| if ((isubc_lw==2) .or. (isubc_sw==2)) then | ||
| !NRL If random seeds supplied by NEPTUNE | ||
| if(lrseeds) then | ||
| do ix=1,size(icsdsw) | ||
| icsdsw(ix) = rseeds(ix,1) | ||
| icsdlw(ix) = rseeds(ix,2) | ||
| enddo | ||
| else | ||
| allocate(numrdm(size(icsdlw)*2)) | ||
| ipseed = mod(nint(con_100*sqrt(sec)), ipsdlim) + 1 + ipsd0 | ||
| call random_setseed (ipseed, stat) | ||
| call random_index (ipsdlim, numrdm, stat) | ||
|
|
||
| ixx = 1 | ||
| do ix=1,size(icsdsw)*2,2 | ||
| icsdsw(ixx) = numrdm(ix) | ||
| icsdlw(ixx) = numrdm(ix+1) | ||
| ixx = ixx + 1 | ||
| enddo | ||
| deallocate(numrdm) | ||
| end if ! lrseeds | ||
| endif ! isubc_lw and isubc_sw | ||
| endif ! lsswr or lslwr | ||
|
|
||
| end subroutine GFS_rad_time_vary_timestep_init | ||
|
|
||
| end module GFS_rad_time_vary |
114 changes: 114 additions & 0 deletions
114
physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rad_time_vary.mpas.meta
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,114 @@ | ||
| [ccpp-table-properties] | ||
| name = GFS_rad_time_vary | ||
| type = scheme | ||
| relative_path = ../../ | ||
| dependencies = hooks/machine.F,Radiation/mersenne_twister.f,Radiation/RRTMG/radcons.f90 | ||
|
|
||
| ######################################################################## | ||
| [ccpp-arg-table] | ||
| name = GFS_rad_time_vary_timestep_init | ||
| type = scheme | ||
| [lrseeds] | ||
| standard_name = do_host_provided_random_seeds | ||
| long_name = flag to use host-provided random seeds | ||
| units = flag | ||
| dimensions = () | ||
| type = logical | ||
| intent = in | ||
| [rseeds] | ||
| standard_name = random_number_seeds_from_host | ||
| long_name = random number seeds from host | ||
| units = none | ||
| dimensions = (horizontal_dimension, number_of_host_provided_random_number_streams) | ||
| type = integer | ||
| intent = in | ||
| optional = True | ||
| [lslwr] | ||
| standard_name = flag_for_calling_longwave_radiation | ||
| long_name = logical flags for lw radiation calls | ||
| units = flag | ||
| dimensions = () | ||
| type = logical | ||
| intent = in | ||
| [lsswr] | ||
| standard_name = flag_for_calling_shortwave_radiation | ||
| long_name = logical flags for sw radiation calls | ||
| units = flag | ||
| dimensions = () | ||
| type = logical | ||
| intent = in | ||
| [isubc_lw] | ||
| standard_name = flag_for_lw_clouds_sub_grid_approximation | ||
| long_name = flag for lw clouds sub-grid approximation | ||
| units = flag | ||
| dimensions = () | ||
| type = integer | ||
| intent = in | ||
| [isubc_sw] | ||
| standard_name = flag_for_sw_clouds_grid_approximation | ||
| long_name = flag for sw clouds sub-grid approximation | ||
| units = flag | ||
| dimensions = () | ||
| type = integer | ||
| intent = in | ||
| [icsdsw] | ||
| standard_name = random_number_seed_for_mcica_shortwave | ||
| long_name = random seeds for sub-column cloud generators sw | ||
| units = none | ||
| dimensions = (horizontal_dimension) | ||
| type = integer | ||
| intent = inout | ||
| optional = True | ||
| [icsdlw] | ||
| standard_name = random_number_seed_for_mcica_longwave | ||
| long_name = random seeds for sub-column cloud generators lw | ||
| units = none | ||
| dimensions = (horizontal_dimension) | ||
| type = integer | ||
| intent = inout | ||
| optional = True | ||
| [sec] | ||
| standard_name = forecast_time_in_seconds | ||
| long_name = seconds elapsed since model initialization | ||
| units = s | ||
| dimensions = () | ||
| type = real | ||
| kind = kind_phys | ||
| intent = in | ||
| [kdt] | ||
| standard_name = index_of_timestep | ||
| long_name = current forecast iteration | ||
| units = index | ||
| dimensions = () | ||
| type = integer | ||
| intent = in | ||
| [ipsd0] | ||
| standard_name = initial_seed_for_mcica | ||
| long_name = initial permutaion seed for mcica radiation | ||
| units = 1 | ||
| dimensions = () | ||
| type = integer | ||
| intent = in | ||
| [ipsdlim] | ||
| standard_name = limit_for_initial_seed_for_mcica | ||
| long_name = limit for initial permutaion seed for mcica radiation | ||
|
Collaborator
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. same here |
||
| units = 1 | ||
| dimensions = () | ||
| type = integer | ||
| intent = in | ||
| [errmsg] | ||
| standard_name = ccpp_error_message | ||
| long_name = error message for error handling in CCPP | ||
| units = none | ||
| dimensions = () | ||
| type = character | ||
| kind = len=* | ||
| intent = out | ||
| [errflg] | ||
| standard_name = ccpp_error_code | ||
| long_name = error code for error handling in CCPP | ||
| units = 1 | ||
| dimensions = () | ||
| type = integer | ||
| intent = out | ||
|
|
||
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.
permutation, not permutaion
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.
@rhaesung Good catch. It appears that this typo is common throughout the radiation (copy and paste for the win!)
./Radiation/RRTMGP/rrtmgp_sw_main.F90: elseif (isubc_sw == 2) then ! use input array of permutaion seeds
./Radiation/RRTMGP/rrtmgp_lw_main.F90: elseif (isubc_lw == 2) then ! use input array of permutaion seeds
./Radiation/RRTMG/radlw_main.F90: elseif ( isubclw == 2 ) then ! use input array of permutaion seeds
./Radiation/RRTMG/radlw_main.F90: & 'with a prescribed sequence of permutaion seeds'
./Radiation/RRTMG/radsw_main.F90: elseif ( isubcsw == 2 ) then ! use input array of permutaion seeds
./Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmg_setup.meta: long_name = initial permutaion seed for mcica radiation
./Interstitials/UFS_SCM_NEPTUNE/GFS_rad_time_vary.mpas.meta: long_name = initial permutaion seed for mcica radiation
./Interstitials/UFS_SCM_NEPTUNE/GFS_rad_time_vary.mpas.meta: long_name = limit for initial permutaion seed for mcica radiation
./Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmgp_setup.meta: long_name = initial permutaion seed for mcica radiation
./Interstitials/UFS_SCM_NEPTUNE/GFS_rad_time_vary.scm.meta: long_name = initial permutaion seed for mcica radiation
./Interstitials/UFS_SCM_NEPTUNE/GFS_rad_time_vary.scm.meta: long_name = limit for initial permutaion seed for mcica radiation
./Interstitials/UFS_SCM_NEPTUNE/GFS_rad_time_vary.fv3.meta: long_name = initial permutaion seed for mcica radiation
./Interstitials/UFS_SCM_NEPTUNE/GFS_rad_time_vary.fv3.meta: long_name = limit for initial permutaion seed for mcica radiation
To keep this PR lean anf focused on MPAS in the UWM, would it be okay if I fix this typo into #305? (This one is all radiation anyways.)
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.
@dustinswales Sounds good to me. I'm okay with holding off on the typo fix here—thanks for keeping this one clean and focused.