diff --git a/scripts/exgdas_global_marine_analysis_ecen.py b/scripts/exgdas_global_marine_analysis_ecen.py new file mode 100755 index 000000000..f023f018b --- /dev/null +++ b/scripts/exgdas_global_marine_analysis_ecen.py @@ -0,0 +1,25 @@ +#!/usr/bin/env python3 +# exgdas_global_marine_analysis_ecen.py +# This script creates an MarineRecenter 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 MarineRecenter +from soca.marine_recenter import MarineRecenter + +# 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 + MarineRecen = MarineRecenter(config) + MarineRecen.initialize() + MarineRecen.run() + MarineRecen.finalize() diff --git a/test/soca/gw/CMakeLists.txt b/test/soca/gw/CMakeLists.txt index 25d290571..5220c7e40 100644 --- a/test/soca/gw/CMakeLists.txt +++ b/test/soca/gw/CMakeLists.txt @@ -45,6 +45,7 @@ set(jjob_list "JGLOBAL_PREP_OCEAN_OBS" "JGDAS_GLOBAL_OCEAN_ANALYSIS_PREP" "JGDAS_GLOBAL_OCEAN_ANALYSIS_BMAT" "JGDAS_GLOBAL_OCEAN_ANALYSIS_RUN" + "JGDAS_GLOBAL_OCEAN_ANALYSIS_ECEN" "JGDAS_GLOBAL_OCEAN_ANALYSIS_CHKPT" "JGDAS_GLOBAL_OCEAN_ANALYSIS_POST" "JGDAS_GLOBAL_OCEAN_ANALYSIS_VRFY") diff --git a/test/soca/gw/run_jjobs.yaml.test b/test/soca/gw/run_jjobs.yaml.test index dbd2fcd2f..c05f9e255 100644 --- a/test/soca/gw/run_jjobs.yaml.test +++ b/test/soca/gw/run_jjobs.yaml.test @@ -35,6 +35,7 @@ gw environement: run scripts: GDASPREPOCNOBSPY: @HOMEgfs@/sorc/gdas.cd/scripts/exglobal_prep_ocean_obs.py + GDASOCNCENPY: @HOMEgfs@/sorc/gdas.cd/scripts/exgdas_global_marine_analysis_ecen.py setup_expt config: base: diff --git a/ush/soca/marine_recenter.py b/ush/soca/marine_recenter.py new file mode 100644 index 000000000..3daa0c231 --- /dev/null +++ b/ush/soca/marine_recenter.py @@ -0,0 +1,46 @@ +#!/usr/bin/env python3 + +import os +from logging import getLogger +from typing import Dict, List, Any +from wxflow import AttrDict, FileHandler, logit, Task + +logger = getLogger(__name__.split('.')[-1]) + + +class MarineRecenter(Task): + + @logit(logger, name="MarineRecenter") + def __init__(self, config): + logger.info("init") + super().__init__(config) + + # Create a local dictionary that is repeatedly used across this class + local_dict = AttrDict( + { + "diags": os.path.join(self.runtime_config['DATA'], 'diags'), # output dir for soca DA obs space + "obs_in": os.path.join(self.runtime_config['DATA'], 'obs') , # input " " + "bkg_dir": os.path.join(self.runtime_config['DATA'], 'bkg'), # ice and ocean backgrounds + "anl_out": os.path.join(self.runtime_config['DATA'], 'Data'), # output dir for soca DA + "static_ens": os.path.join(self.runtime_config['DATA'], 'static_ens') # clim. ens. + } + ) + + # task_config is everything that this task should need + self.task_config = AttrDict(**self.config, **self.runtime_config, **local_dict) + + #_soca_ensb_yaml_temp + print(self.task_config) + + @logit(logger) + def initialize(self): + logger.info("initialize") + + + @logit(logger) + def run(self): + logger.info("run") + + @logit(logger) + def finalize(self): + logger.info("finalize")