Skip to content
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

Add a yaml for snow DA testing. #2199

Merged
merged 16 commits into from
Jan 26, 2024
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ci/cases/pr/C48_ATM.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ arguments:
expdir: {{ 'RUNTESTS' | getenv }}/EXPDIR
idate: 2021032312
edate: 2021032312
yaml: {{ HOMEgfs }}/ci/platforms/gfs_defaults_ci.yaml
yaml: {{ HOMEgfs }}/ci/cases/yamls/gfs_defaults_ci.yaml
2 changes: 1 addition & 1 deletion ci/cases/pr/C48_S2SW.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ arguments:
expdir: {{ 'RUNTESTS' | getenv }}/EXPDIR
idate: 2021032312
edate: 2021032312
yaml: {{ HOMEgfs }}/ci/platforms/gfs_defaults_ci.yaml
yaml: {{ HOMEgfs }}/ci/cases/yamls/gfs_defaults_ci.yaml
2 changes: 1 addition & 1 deletion ci/cases/pr/C48_S2SWA_gefs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ arguments:
expdir: {{ 'RUNTESTS' | getenv }}/EXPDIR
idate: 2021032312
edate: 2021032312
yaml: {{ HOMEgfs }}/ci/platforms/gefs_ci_defaults.yaml
yaml: {{ HOMEgfs }}/ci/cases/yamls/gefs_ci_defaults.yaml
2 changes: 1 addition & 1 deletion ci/cases/pr/C96C48_hybatmDA.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ arguments:
nens: 2
gfs_cyc: 1
start: cold
yaml: {{ HOMEgfs }}/ci/platforms/gfs_defaults_ci.yaml
yaml: {{ HOMEgfs }}/ci/cases/yamls/gfs_defaults_ci.yaml
4 changes: 2 additions & 2 deletions ci/cases/pr/C96_atm3DVar.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ arguments:
resdet: 96
comrot: {{ 'RUNTESTS' | getenv }}/COMROT
expdir: {{ 'RUNTESTS' | getenv }}/EXPDIR
icsdir: ${ICSDIR_ROOT}/C96C48
icsdir: {{ 'ICSDIR_ROOT' | getenv }}/C96C48
idate: 2021122018
edate: 2021122106
nens: 0
gfs_cyc: 1
start: cold
yaml: {{ HOMEgfs }}/ci/platforms/gfs_defaults_ci.yaml
yaml: {{ HOMEgfs }}/ci/cases/yamls/gfs_defaults_ci.yaml
20 changes: 20 additions & 0 deletions ci/cases/pr/C96_atmsnowDA.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
experiment:
system: gfs
mode: cycled

arguments:
pslot: {{ 'pslot' | getenv }}
app: ATM
resdet: 96
comrot: {{ 'RUNTESTS' | getenv }}/COMROT
expdir: {{ 'RUNTESTS' | getenv }}/EXPDIR
icsdir: {{ 'ICSDIR_ROOT' | getenv }}/C96C48
idate: 2021122012
edate: 2021122100
nens: 0
gfs_cyc: 0
aerorahul marked this conversation as resolved.
Show resolved Hide resolved
start: cold
yaml: {{ HOMEgfs }}/ci/cases/yamls/atmsnowDA_defaults_ci.yaml

skip_ci_on_hosts:
- hercules
2 changes: 1 addition & 1 deletion ci/cases/weekly/C384C192_hybatmda.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ arguments:
nens: 2
gfs_cyc: 1
start: cold
yaml: {{ HOMEgfs }}/ci/platforms/gfs_defaults_ci.yaml
yaml: {{ HOMEgfs }}/ci/cases/yamls/gfs_defaults_ci.yaml
2 changes: 1 addition & 1 deletion ci/cases/weekly/C384_S2SWA.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ arguments:
expdir: {{ 'RUNTESTS' | getenv }}/EXPDIR
idate: 2016070100
edate: 2016070100
yaml: {{ HOMEgfs }}/ci/platforms/gfs_defaults_ci.yaml
yaml: {{ HOMEgfs }}/ci/cases/yamls/gfs_defaults_ci.yaml
2 changes: 1 addition & 1 deletion ci/cases/weekly/C384_atm3DVar.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ arguments:
nens: 0
gfs_cyc: 1
start: cold
yaml: {{ HOMEgfs }}/ci/platforms/gfs_defaults_ci.yaml
yaml: {{ HOMEgfs }}/ci/cases/yamls/gfs_defaults_ci.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
defaults:
!INC {{ HOMEgfs }}/parm/config/gfs/yaml/defaults.yaml
base:
ACCOUNT: ${SLURM_ACCOUNT}
DOIAU: "NO"
DO_JEDILANDDA: "YES"
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
defaults:
!INC {{ HOMEgfs }}/parm/config/gefs/yaml/defaults.yaml
base:
ACCOUNT: ${SLURM_ACCOUNT}
ACCOUNT: {{ 'SLURM_ACCOUNT' | getenv }}
4 changes: 4 additions & 0 deletions ci/cases/yamls/gfs_defaults_ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
defaults:
!INC {{ HOMEgfs }}/parm/config/gfs/yaml/defaults.yaml
base:
ACCOUNT: {{ 'SLURM_ACCOUNT' | getenv }}
7 changes: 6 additions & 1 deletion workflow/create_experiment.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,9 @@ def input_args():
formatter_class=ArgumentDefaultsHelpFormatter)

parser.add_argument(
'--yaml', help='full path to yaml file describing the experiment configuration', type=Path, required=True)
'-y', '--yaml', help='full path to yaml file describing the experiment configuration', type=Path, required=True)
parser.add_argument(
'-o', '--overwrite', help='overwrite previously created experiment', action="store_true", required=False)

return parser.parse_args()

Expand All @@ -89,6 +91,9 @@ def input_args():
setup_expt_args.append(f"--{kk}")
setup_expt_args.append(str(vv))

if user_inputs.overwrite:
setup_expt_args.append("--overwrite")

logger.info(f"Call: setup_expt.main()")
logger.debug(f"setup_expt.py {' '.join(setup_expt_args)}")
setup_expt.main(setup_expt_args)
Expand Down
23 changes: 16 additions & 7 deletions workflow/setup_expt.py
Original file line number Diff line number Diff line change
Expand Up @@ -396,6 +396,8 @@ def _common_args(parser):
parser.add_argument('--idate', help='starting date of experiment, initial conditions must exist!',
required=True, type=lambda dd: to_datetime(dd))
parser.add_argument('--edate', help='end date experiment', required=True, type=lambda dd: to_datetime(dd))
parser.add_argument('--overwrite', help='overwrite previously created experiment (if it exists)',
action='store_true', required=False)
return parser

def _gfs_args(parser):
Expand Down Expand Up @@ -490,17 +492,19 @@ def _gefs_args(parser):
return parser.parse_args(list(*argv) if len(argv) else None)


def query_and_clean(dirname):
def query_and_clean(dirname, force_clean=False):
"""
Method to query if a directory exists and gather user input for further action
"""

create_dir = True
if os.path.exists(dirname):
print()
print(f'directory already exists in {dirname}')
print()
overwrite = input('Do you wish to over-write [y/N]: ')
print(f'\ndirectory already exists in {dirname}')
if force_clean:
overwrite = True
print(f'removing directory ........ {dirname}\n')
else:
overwrite = input('Do you wish to over-write [y/N]: ')
create_dir = True if overwrite in [
'y', 'yes', 'Y', 'YES'] else False
if create_dir:
Expand Down Expand Up @@ -531,8 +535,8 @@ def main(*argv):
comrot = os.path.join(user_inputs.comrot, user_inputs.pslot)
expdir = os.path.join(user_inputs.expdir, user_inputs.pslot)

create_comrot = query_and_clean(comrot)
create_expdir = query_and_clean(expdir)
create_comrot = query_and_clean(comrot, force_clean=user_inputs.overwrite)
create_expdir = query_and_clean(expdir, force_clean=user_inputs.overwrite)

if create_comrot:
makedirs_if_missing(comrot)
Expand All @@ -543,6 +547,11 @@ def main(*argv):
fill_EXPDIR(user_inputs)
update_configs(host, user_inputs)

print(f"*" * 100)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

neat, I didn't know this trick.

print(f'EXPDIR: {expdir}')
print(f'COMROT: {comrot}')
print(f"*" * 100)


if __name__ == '__main__':

Expand Down