-
Notifications
You must be signed in to change notification settings - Fork 217
Use stochastic restart patterns on rerun #3077
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
WalterKolczynski-NOAA
merged 17 commits into
NOAA-EMC:develop
from
WalterKolczynski-NOAA:feature/stoch_restart
Dec 5, 2024
Merged
Changes from 13 commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
8ae6df5
Use stochastic restart patterns on rerun
WalterKolczynski-NOAA 87f5db8
Set stochini to true to use stoch restart patterns
WalterKolczynski-NOAA 4db4b0d
Remove commented out if and unindent
WalterKolczynski-NOAA 3dfcb68
Only copy ca_data restart files when CA is on
WalterKolczynski-NOAA bc92f22
Update stage and archive to conditionally handle ca_data
WalterKolczynski-NOAA 3cdbaa2
Add missing comma in stage ic script
WalterKolczynski-NOAA 03aef32
Restore current CA setting
WalterKolczynski-NOAA 5311b70
Merge branch 'develop' into feature/stoch_restart
WalterKolczynski-NOAA 20705b0
Remove RUN dependence for DO_CA in GFS
WalterKolczynski-NOAA dbc8112
Merge branch 'develop' into feature/stoch_restart
WalterKolczynski-NOAA c38dbcf
Turn off ocean SPPT above 1p00
WalterKolczynski-NOAA 4ba4bd3
Merge branch 'develop' into feature/stoch_restart
WalterKolczynski-NOAA 745f4ad
Fix turning off ocean stoch phys above 1p00
WalterKolczynski-NOAA 4bca477
Merge branch 'develop' into feature/stoch_restart
WalterKolczynski-NOAA 805c164
Merge branch 'develop' into feature/stoch_restart
WalterKolczynski-NOAA 3361541
Add DO_CA to earc keys
WalterKolczynski-NOAA 9ca245e
Fix earc path for ca_data
WalterKolczynski-NOAA 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
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
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
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
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
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
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
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 |
|---|---|---|
|
|
@@ -57,7 +57,10 @@ FV3_restarts(){ | |
| # Create an array of FV3 restart files | ||
| local fv3_restart_files tile_files | ||
| fv3_restart_files=(coupler.res fv_core.res.nc) | ||
| tile_files=(fv_core.res fv_srf_wnd.res fv_tracer.res phy_data sfc_data ca_data) | ||
| tile_files=(fv_core.res fv_srf_wnd.res fv_tracer.res phy_data sfc_data) | ||
| if [[ ${DO_CA:-"NO"} == "YES" ]]; then | ||
| tile_files+=(ca_data) | ||
| fi | ||
| local nn tt | ||
| for (( nn = 1; nn <= ntiles; nn++ )); do | ||
| for tt in "${tile_files[@]}"; do | ||
|
|
@@ -68,6 +71,22 @@ FV3_restarts(){ | |
| IFS=, echo "${fv3_restart_files[*]}" | ||
| } | ||
|
|
||
| stoch_restarts(){ | ||
| # These only get copied for reruns | ||
| local stoch_restart_files | ||
| stoch_restart_files=( ) | ||
|
|
||
| if [[ "${DO_SPPT:-}" == "YES" || "${DO_SKEB:-}" == "YES" || \ | ||
| "${DO_SHUM:-}" == "YES" || "${DO_LAND_PERT:-}" == "YES" ]]; then | ||
| stoch_restart_files+=(atm_stoch.res.nc) | ||
| fi | ||
| if [[ "${DO_OCN:-}" == "YES" && ( "${DO_OCN_SPPT:-}" == "YES" || "${DO_OCN_PERT_EPBL}" == "YES" ) ]]; then | ||
| stoch_restart_files+=(ocn_stoch.res.nc) | ||
| fi | ||
| # Create a comma separated string from array using IFS | ||
| IFS=, echo "${stoch_restart_files[*]}" | ||
| } | ||
|
|
||
| # shellcheck disable=SC2034 | ||
| common_predet(){ | ||
| echo "SUB ${FUNCNAME[0]}: Defining variables for shared through model components" | ||
|
|
@@ -377,41 +396,38 @@ FV3_predet(){ | |
| do_sppt=".false." | ||
| do_ca=".false." | ||
| ISEED=0 | ||
| if (( MEMBER > 0 )); then # these are only applicable for ensemble members | ||
| local imem=${MEMBER#0} | ||
| local base_seed=$((current_cycle*10000 + imem*100)) | ||
|
|
||
| if [[ "${DO_SKEB:-}" == "YES" ]]; then | ||
| do_skeb=".true." | ||
| ISEED_SKEB=$((base_seed + 1)) | ||
| fi | ||
| local imem=${MEMBER#0} | ||
| local base_seed=$((current_cycle*10000 + imem*100)) | ||
|
|
||
| if [[ "${DO_SHUM:-}" == "YES" ]]; then | ||
| do_shum=".true." | ||
| ISEED_SHUM=$((base_seed + 2)) | ||
| fi | ||
| if [[ "${DO_SKEB:-}" == "YES" ]]; then | ||
| do_skeb=".true." | ||
| ISEED_SKEB=$((base_seed + 1)) | ||
| fi | ||
|
|
||
| if [[ "${DO_SPPT:-}" == "YES" ]]; then | ||
| do_sppt=".true." | ||
| ISEED_SPPT=$((base_seed + 3)),$((base_seed + 4)),$((base_seed + 5)),$((base_seed + 6)),$((base_seed + 7)) | ||
| fi | ||
| if [[ "${DO_SHUM:-}" == "YES" ]]; then | ||
| do_shum=".true." | ||
| ISEED_SHUM=$((base_seed + 2)) | ||
| fi | ||
|
|
||
| if [[ "${DO_CA:-}" == "YES" ]]; then | ||
| do_ca=".true." | ||
| ISEED_CA=$(( (base_seed + 18) % 2147483647 )) | ||
| fi | ||
| if [[ "${DO_SPPT:-}" == "YES" ]]; then | ||
| do_sppt=".true." | ||
| ISEED_SPPT=$((base_seed + 3)),$((base_seed + 4)),$((base_seed + 5)),$((base_seed + 6)),$((base_seed + 7)) | ||
| fi | ||
|
|
||
| if [[ "${DO_LAND_PERT:-}" == "YES" ]]; then | ||
| lndp_type=${lndp_type:-2} | ||
| ISEED_LNDP=$(( (base_seed + 5) % 2147483647 )) | ||
| LNDP_TAU=${LNDP_TAU:-21600} | ||
| LNDP_SCALE=${LNDP_SCALE:-500000} | ||
| lndp_var_list=${lndp_var_list:-"'smc', 'vgf',"} | ||
| lndp_prt_list=${lndp_prt_list:-"0.2,0.1"} | ||
| n_var_lndp=$(echo "${lndp_var_list}" | wc -w) | ||
| fi | ||
| if [[ "${DO_CA:-}" == "YES" ]]; then | ||
| do_ca=".true." | ||
| ISEED_CA=$(( (base_seed + 18) % 2147483647 )) | ||
|
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. As CA is being used by both GFS/GEFS, probably we can just use |
||
| fi | ||
|
|
||
| fi # end of ensemble member specific options | ||
| if [[ "${DO_LAND_PERT:-}" == "YES" ]]; then | ||
| lndp_type=${lndp_type:-2} | ||
| ISEED_LNDP=$(( (base_seed + 5) % 2147483647 )) | ||
| LNDP_TAU=${LNDP_TAU:-21600} | ||
| LNDP_SCALE=${LNDP_SCALE:-500000} | ||
| lndp_var_list=${lndp_var_list:-"'smc', 'vgf',"} | ||
| lndp_prt_list=${lndp_prt_list:-"0.2,0.1"} | ||
| n_var_lndp=$(echo "${lndp_var_list}" | wc -w) | ||
| fi | ||
|
|
||
| #-------------------------------------------------------------------------- | ||
|
|
||
|
|
@@ -680,17 +696,15 @@ MOM6_predet(){ | |
|
|
||
| # If using stochastic parameterizations, create a seed that does not exceed the | ||
| # largest signed integer | ||
| if (( MEMBER > 0 )); then # these are only applicable for ensemble members | ||
| local imem=${MEMBER#0} | ||
| local base_seed=$((current_cycle*10000 + imem*100)) | ||
| local imem=${MEMBER#0} | ||
| local base_seed=$((current_cycle*10000 + imem*100)) | ||
|
|
||
| if [[ "${DO_OCN_SPPT:-}" == "YES" ]]; then | ||
| ISEED_OCNSPPT=$((base_seed + 8)),$((base_seed + 9)),$((base_seed + 10)),$((base_seed + 11)),$((base_seed + 12)) | ||
| fi | ||
| if [[ "${DO_OCN_SPPT:-}" == "YES" ]]; then | ||
| ISEED_OCNSPPT=$((base_seed + 8)),$((base_seed + 9)),$((base_seed + 10)),$((base_seed + 11)),$((base_seed + 12)) | ||
| fi | ||
|
|
||
| if [[ "${DO_OCN_PERT_EPBL:-}" == "YES" ]]; then | ||
| ISEED_EPBL=$((base_seed + 13)),$((base_seed + 14)),$((base_seed + 15)),$((base_seed + 16)),$((base_seed + 17)) | ||
| fi | ||
| if [[ "${DO_OCN_PERT_EPBL:-}" == "YES" ]]; then | ||
| ISEED_EPBL=$((base_seed + 13)),$((base_seed + 14)),$((base_seed + 15)),$((base_seed + 16)),$((base_seed + 17)) | ||
| fi | ||
|
|
||
| # Fix files | ||
|
|
||
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
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.
Uh oh!
There was an error while loading. Please reload this page.