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 S2Sv3 to MOM6 test. Add YAML validator #281

Merged
Show file tree
Hide file tree
Changes from all 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 .github/workflows/changelog-enforcer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
types: [opened, synchronize, reopened, ready_for_review, labeled, unlabeled]

jobs:
# Enforces the update of a changelog file on every pull request
# Enforces the update of a changelog file on every pull request
changelog:
runs-on: ubuntu-latest
steps:
Expand Down
31 changes: 31 additions & 0 deletions .github/workflows/validate_yaml_files.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---

# Based on code from https://github.com/marketplace/actions/yaml-lint

name: Yaml Lint

on:
pull_request:
types: [opened, synchronize, reopened, ready_for_review, labeled, unlabeled]

# This validation is equivalent to running on the command line:
# yamllint -d relaxed --no-warnings
# and is controlled by the .yamllint.yml file
jobs:
validate-YAML:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- id: yaml-lint
name: yaml-lint
uses: ibiqlik/action-yamllint@v3
with:
no_warnings: true
format: colored
config_file: .yamllint.yml

- uses: actions/upload-artifact@v3
if: always()
with:
name: yamllint-logfile
path: ${{ steps.yaml-lint.outputs.logfile }}
29 changes: 29 additions & 0 deletions .yamllint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
---

extends: default

rules:
braces:
level: warning
max-spaces-inside: 1
brackets:
level: warning
max-spaces-inside: 1
colons:
level: warning
commas:
level: warning
comments: disable
comments-indentation: disable
document-start: disable
empty-lines:
level: warning
hyphens:
level: warning
indentation:
level: warning
indent-sequences: consistent
line-length:
level: warning
allow-non-breakable-inline-mappings: true
truthy: disable
11 changes: 9 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,17 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Added

- Add YAML validator

### Changed

- Generated command line to run the program
- changed the location of the temporary folder for remap_restarts MERRA-2 case
- changed the location of the temporary folder for remap_restarts MERRA-2 case
- Added new remap tests
- amip_c180Toc90
- c180Toc360
- c360Toc24
- s2sv3Toc12MOM6

### Fixed

Expand Down Expand Up @@ -47,7 +54,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Added

- Added statsNx.rc for screen level variable fstats
- Added statsNx.rc for screen level variable fstats

### Changed

Expand Down
22 changes: 11 additions & 11 deletions GEOS_Util/post/remap_restart/remap_params.tpl
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
#
# This template file can be filled with questionary or manually
#
#
#
#

input:
air:
drymass: 1
hydrostatic: 0
shared:
MERRA-2: false
agrid:
agrid:
bcs_dir:
expid:
ogrid:
Expand All @@ -20,14 +20,14 @@ input:
wemin:
# it supports three models: catch, catchcnclm40, catchcnclm45
catch_model: null
# if catch_tilefile is null, it searches bcs_dir
# if catch_tilefile is null, it searches bcs_dir
catch_tilefile: null
output:
shared:
agrid:
bcs_dir:
expid:
ogrid:
bcs_dir:
expid:
ogrid:
out_dir:
air:
# remap upper air or not
Expand All @@ -41,14 +41,14 @@ output:
remap_water: true
# remap catch(cn)
remap_catch: true
# if catch_tilefile is null, it searches bcs_dir
# if catch_tilefile is null, it searches bcs_dir
catch_tilefile: null
analysis:
bkg: true
aqua: False
lcv: false

slurm:
account:
qos:
constraint:
account:
qos:
constraint:
6 changes: 3 additions & 3 deletions GEOS_Util/post/remap_restart/remap_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@ def flatten_nested(nested_dict, result=None, prefix=''):

flat_dict = flatten_nested(config)

k = 1
k = 1
for key, value in flat_dict.items():
if isinstance(value, int) or isinstance(value, float) : value = str(value)
if isinstance(value, int) or isinstance(value, float) or isinstance(value, bool) or isinstance(value, type(None)): value = str(value)
if k == 1:
cmd = cmd + 'set FLAT_YAML="' + key+"="+ value+ '"\n'
else:
Expand Down Expand Up @@ -111,7 +111,7 @@ def merra2_expid(config):
config['expid'] = expid

return config

if __name__ == '__main__' :
config = yaml_to_config('c24Toc12.yaml')
print_config(config)
8 changes: 4 additions & 4 deletions GEOS_Util/post/tests/amip_c180Toc90.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#
# This template file can be filled with questionary or manually
#
#
#
#

input:
air:
Expand All @@ -13,7 +13,7 @@ input:
bcs_dir: /discover/nobackup/ltakacs/bcs/Icarus-NLv3/Icarus-NLv3_MERRA-2//CF0180x6C_DE1440xPE0720/
expid: JM_v10.22.2_L072_C180_AMIP
ogrid: 1440X720
rst_dir: /discover/nobackup/projects/gmao/SIteam/Remapping_Test_Cases/amip_c180Toc90/inputs/
rst_dir: /discover/nobackup/projects/gmao/SIteam/Remapping_Test_Cases/amip_c180Toc90/inputs/
yyyymmddhh: '1990062621'
surface:
zoom: '2'
Expand All @@ -27,7 +27,7 @@ output:
bcs_dir: /discover/nobackup/ltakacs/bcs/Icarus-NLv3/Icarus-NLv3_Ostia//CF0090x6C_CF0090x6C/
expid: C90CS_JM_v10.22.2_L072_C180_AMIP
ogrid: C90
out_dir: $NOBACKUP/REMAP_TESTS/amip_c180Toc90/
out_dir: $NOBACKUP/REMAP_TESTS/amip_c180Toc90/
air:
# remap upper air or not
remap: true
Expand Down
6 changes: 3 additions & 3 deletions GEOS_Util/post/tests/c180Toc360.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#
# This template file can be filled with questionary or manually
#
#
#
#

input:
air:
Expand All @@ -13,7 +13,7 @@ input:
bcs_dir: /discover/nobackup/ltakacs/bcs/Icarus-NLv3/Icarus-NLv3_MERRA-2//CF0180x6C_DE1440xPE0720/
expid: Jason-3_4_NL_REAMIP_MERRA2_C180
ogrid: 1440X720
rst_dir: /discover/nobackup/projects/gmao/SIteam/Remapping_Test_Cases/c180Toc360/inputs/
rst_dir: /discover/nobackup/projects/gmao/SIteam/Remapping_Test_Cases/c180Toc360/inputs/
yyyymmddhh: '1985050921'
surface:
zoom: '2'
Expand Down
7 changes: 5 additions & 2 deletions GEOS_Util/post/tests/c24Toc12.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#
# This template file can be filled with questionary or manually
#
#
#
#

input:
air:
Expand Down Expand Up @@ -29,13 +29,16 @@ output:
ogrid: 360X180
out_dir: $NOBACKUP/REMAP_TESTS/c24Toc12/
air:
# remap upper air or not
remap: true
nlevel: '72'
surface:
split_saltwater: true
surflay: 50.0
wemin: '13'
# remap lake, saltwater, landicet
remap_water: true
# remap catch(cn)
remap_catch: true
catch_tilefile: null
analysis:
Expand Down
8 changes: 4 additions & 4 deletions GEOS_Util/post/tests/c360Toc24.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#
# This template file can be filled with questionary or manually
#
#
#
#

input:
air:
Expand All @@ -13,7 +13,7 @@ input:
bcs_dir: /discover/nobackup/projects/gmao/share/gmao_ops/fvInput/g5gcm/bcs/Icarus-NLv3/Icarus-NLv3_Ostia//CF0360x6C_CF0360x6C/
expid: x0046a
ogrid: C360
rst_dir: /discover/nobackup/projects/gmao/SIteam/Remapping_Test_Cases/c360Toc24/inputs
rst_dir: /discover/nobackup/projects/gmao/SIteam/Remapping_Test_Cases/c360Toc24/inputs
yyyymmddhh: '2022010121'
surface:
zoom: '4'
Expand All @@ -27,7 +27,7 @@ output:
bcs_dir: /discover/nobackup/ltakacs/bcs/Icarus-NLv3/Icarus-NLv3_Reynolds//CF0024x6C_DE0360xPE0180/
expid: C24c_x0046a
ogrid: 360X180
out_dir: $NOBACKUP/REMAP_TESTS/c360Toc24/
out_dir: $NOBACKUP/REMAP_TESTS/c360Toc24/
air:
# remap upper air or not
remap: true
Expand Down
6 changes: 3 additions & 3 deletions GEOS_Util/post/tests/f522Toc360.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#
# This template file can be filled with questionary or manually
#
#
#
#

input:
air:
Expand All @@ -13,7 +13,7 @@ input:
bcs_dir: /discover/nobackup/projects/gmao/share/gmao_ops/fvInput/g5gcm/bcs/Icarus_Updated/Icarus_Ostia//CF0720x6C_CF0720x6C/
expid: f522_fp
ogrid: C720
rst_dir: /discover/nobackup/projects/gmao/SIteam/Remapping_Test_Cases/f522Toc360/inputs/
rst_dir: /discover/nobackup/projects/gmao/SIteam/Remapping_Test_Cases/f522Toc360/inputs/
yyyymmddhh: '2019061421'
surface:
zoom: '8'
Expand Down
54 changes: 54 additions & 0 deletions GEOS_Util/post/tests/s2sv3Toc12MOM6.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
#
# This template file can be filled with questionary or manually
#
#

input:
air:
drymass: 1
hydrostatic: 0
shared:
MERRA-2: false
agrid: C180
bcs_dir: /discover/nobackup/projects/gmao/ssd/aogcm/atmosphere_bcs/Icarus/MOM5//CF0180x6C_TM1440xTM1080/
expid: M2OCEAN_S2SV3
ogrid: 1440X1080
rst_dir: /discover/nobackup/projects/gmao/SIteam/Remapping_Test_Cases/s2sv3Toc12MOM6/inputs
yyyymmddhh: '1982010100'
surface:
zoom: '2'
wemin: '26'
# it supports three models: catch, catchcnclm40, catchcnclm45
catch_model: catch
# if catch_tilefile is null, it searches bcs_dir
catch_tilefile:
output:
shared:
agrid: C12
bcs_dir: /discover/nobackup/projects/gmao/ssd/aogcm/atmosphere_bcs/Icarus-NLv3/MOM6//CF0012x6C_TM0072xTM0036/
expid: C12-MOM6-from-S2Sv3
ogrid: 72X36
out_dir: $NOBACKUP/REMAP_TESTS/s2sv3Toc12MOM6/
air:
# remap upper air or not
remap: true
nlevel: '72'
surface:
split_saltwater: true
surflay: 50.0
wemin: '13'
# remap lake, saltwater, landicet
remap_water: true
# remap catch(cn)
remap_catch: true
# if catch_tilefile is null, it searches bcs_dir
catch_tilefile:
analysis:
bkg: false
aqua: true
lcv: false

slurm:
account: g0620
qos: debug
constraint: cas
6 changes: 4 additions & 2 deletions GEOS_Util/post/tests/test_remap_cases.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,13 @@ f522Toc360:
config: 'f522Toc360.yaml'
amip_c180Toc90:
base_line: '/discover/nobackup/projects/gmao/SIteam/Remapping_Test_Cases/amip_c180Toc90/baseline/'
config: 'amip_c180Toc90.yaml'
config: 'amip_c180Toc90.yaml'
c180Toc360:
base_line: '/discover/nobackup/projects/gmao/SIteam/Remapping_Test_Cases/c180Toc360/baseline/'
config: 'c180Toc360.yaml'
c360Toc24:
base_line: '/discover/nobackup/projects/gmao/SIteam/Remapping_Test_Cases/c360Toc24/baseline/'
config: 'c360Toc24.yaml'

s2sv3Toc12MOM6:
base_line: '/discover/nobackup/projects/gmao/SIteam/Remapping_Test_Cases/s2sv3Toc12MOM6/baseline/'
config: 's2sv3Toc12MOM6.yaml'