-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Initial commit of marine letkf stubs (#1090)
Adds stubs and ctest for marine LETKF task. Co-dependent on global-workflow PR NOAA-EMC/global-workflow#2564 Addresses #1091
- Loading branch information
1 parent
706e11a
commit 435eb66
Showing
3 changed files
with
116 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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,25 @@ | ||
#!/usr/bin/env python3 | ||
# exgdas_global_marine_analysis_ecen.py | ||
# This script creates an MarineLETKF class | ||
# and runs the initialize, run, and finalize methods | ||
# which currently are stubs | ||
import os | ||
|
||
from wxflow import Logger, cast_strdict_as_dtypedict | ||
# TODO (AFE): change to from pygfs.task.marine_recenter import MarineLETKF | ||
from soca.marine_recenter import MarineLETKF | ||
|
||
# Initialize root logger | ||
logger = Logger(level='DEBUG', colored_log=True) | ||
|
||
|
||
if __name__ == '__main__': | ||
|
||
# Take configuration from environment and cast it as python dictionary | ||
config = cast_strdict_as_dtypedict(os.environ) | ||
|
||
# Instantiate the aerosol analysis task | ||
MarineLetkf = MarineLETKF(config) | ||
MarineLetkf.initialize() | ||
MarineLetkf.run() | ||
MarineLetkf.finalize() |
This file contains 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 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,90 @@ | ||
#!/usr/bin/env python3 | ||
|
||
from datetime import datetime, timedelta | ||
import f90nml | ||
from logging import getLogger | ||
import os | ||
from soca import bkg_utils | ||
from typing import Dict | ||
import ufsda | ||
from ufsda.stage import soca_fix | ||
from wxflow import (AttrDict, | ||
chdir, | ||
Executable, | ||
FileHandler, | ||
logit, | ||
parse_j2yaml, | ||
Task, | ||
Template, | ||
TemplateConstants, | ||
WorkflowException, | ||
YAMLFile) | ||
|
||
logger = getLogger(__name__.split('.')[-1]) | ||
|
||
|
||
class MarineLETKF(Task): | ||
""" | ||
Class for global ocean analysis recentering task | ||
""" | ||
|
||
@logit(logger, name="MarineLETKF") | ||
def __init__(self, config: Dict) -> None: | ||
"""Constructor for ocean recentering task | ||
Parameters: | ||
------------ | ||
config: Dict | ||
configuration, namely evironment variables | ||
Returns: | ||
-------- | ||
None | ||
""" | ||
|
||
logger.info("init") | ||
super().__init__(config) | ||
|
||
@logit(logger) | ||
def initialize(self): | ||
"""Method initialize for ocean recentering task | ||
Parameters: | ||
------------ | ||
None | ||
Returns: | ||
-------- | ||
None | ||
""" | ||
|
||
logger.info("initialize") | ||
RUN = self.runtime_config.RUN | ||
gcyc = self.runtime_config.gcyc | ||
|
||
@logit(logger) | ||
def run(self): | ||
"""Method run for ocean recentering task | ||
Parameters: | ||
------------ | ||
None | ||
Returns: | ||
-------- | ||
None | ||
""" | ||
|
||
logger.info("run") | ||
|
||
chdir(self.runtime_config.DATA) | ||
|
||
@logit(logger) | ||
def finalize(self): | ||
"""Method finalize for ocean recentering task | ||
Parameters: | ||
------------ | ||
None | ||
Returns: | ||
-------- | ||
None | ||
""" | ||
|
||
logger.info("finalize") | ||
|
||
RUN = self.runtime_config.RUN | ||
cyc = self.runtime_config.cyc |