Skip to content

Commit

Permalink
Initial commit of marine letkf stubs (#1090)
Browse files Browse the repository at this point in the history
Adds stubs and ctest for marine LETKF task. Co-dependent on
global-workflow PR NOAA-EMC/global-workflow#2564

Addresses #1091
  • Loading branch information
AndrewEichmann-NOAA authored May 3, 2024
1 parent 706e11a commit 435eb66
Show file tree
Hide file tree
Showing 3 changed files with 116 additions and 0 deletions.
25 changes: 25 additions & 0 deletions scripts/exgdas_global_marine_analysis_letkf.py
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()
1 change: 1 addition & 0 deletions test/soca/gw/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ set(jjob_list "JGLOBAL_PREP_OCEAN_OBS"
"JGDAS_GLOBAL_OCEAN_ANALYSIS_BMAT"
"JGDAS_GLOBAL_OCEAN_ANALYSIS_RUN"
"JGDAS_GLOBAL_OCEAN_ANALYSIS_ECEN"
# "JGDAS_GLOBAL_OCEAN_ANALYSIS_LETKF"
"JGDAS_GLOBAL_OCEAN_ANALYSIS_CHKPT"
"JGDAS_GLOBAL_OCEAN_ANALYSIS_POST")
# TODO(WaterPeople) Add back to the list of tested jobs once fixed
Expand Down
90 changes: 90 additions & 0 deletions ush/soca/marine_letkf.py
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

0 comments on commit 435eb66

Please sign in to comment.