diff --git a/parm/soca/variational/3dvarfgat.yaml b/parm/soca/variational/3dvarfgat.yaml index de59a03d8..2e4371586 100644 --- a/parm/soca/variational/3dvarfgat.yaml +++ b/parm/soca/variational/3dvarfgat.yaml @@ -34,7 +34,6 @@ variational: fields metadata: ./fields_metadata.yaml ninner: !ENV ${SOCA_NINNER} gradient norm reduction: 1e-10 - test: on diagnostics: departures: ombg diff --git a/scripts/exgdas_global_marine_analysis_bmat.sh b/scripts/exgdas_global_marine_analysis_bmat.sh index 28dab42cc..757e83a45 100755 --- a/scripts/exgdas_global_marine_analysis_bmat.sh +++ b/scripts/exgdas_global_marine_analysis_bmat.sh @@ -114,11 +114,11 @@ fi ################################################################################ # Compute the ens std. dev, ignore ssh variance # TODO (G): Implement what's below into one single oops application -# 0 - Compute moments of original ensemble, used at the diag of the first +# 0 - Compute moments of original ensemble, used at the diag of the first # component of the hybrid B # 1 - Ensemble perturbations: # o Vertically Interpolate to the deterministic layers -# o Recenter around 0 to create an ensemble of perturbations +# o Recenter around 0 to create an ensemble of perurbations # 2 - Filter members and apply the linear steric height balance to each members # 3 - Copy h from deterministic to unbalanced perturbations # 4 - Compute moments of converted ensemble perturbations @@ -131,6 +131,15 @@ if [ $err -gt 0 ]; then exit $err fi +# Zero out std. dev of ssh to use the balance as a strong constraint +# TODO: Apply the inverse of the balance +clean_yaml soca_clim_ens_moments.yaml +$APRUN_OCNANAL $JEDI_BIN/gdas_incr_handler.x soca_postproc_stddev.yaml +export err=$?; err_chk +if [ $err -gt 0 ]; then + exit $err +fi + # Compute ensemble perturbations, vertically remap to cycle's vertical geometry clean_yaml soca_clim_ens_perts.yaml $APRUN_OCNANAL $JEDI_BIN/soca_ensrecenter.x soca_clim_ens_perts.yaml diff --git a/scripts/exgdas_global_marine_analysis_prep.py b/scripts/exgdas_global_marine_analysis_prep.py index a6bef66bc..a05a97bfb 100755 --- a/scripts/exgdas_global_marine_analysis_prep.py +++ b/scripts/exgdas_global_marine_analysis_prep.py @@ -354,12 +354,18 @@ def find_clim_ens(input_date): # generate YAMLS file for diag of clim. ens. B berror_yaml_dir = os.path.join(gdas_home, 'parm', 'soca', 'berror') -logging.info(f"---------------- generate soca_clim_moments.yaml") +logging.info(f"---------------- generate soca_clim_ens_moments.yaml") berr_yaml = os.path.join(anl_dir, 'soca_clim_ens_moments.yaml') berr_yaml_template = os.path.join(berror_yaml_dir, 'soca_clim_ens_moments.yaml') config = YAMLFile(path=berr_yaml_template) config = Template.substitute_structure(config, TemplateConstants.DOUBLE_CURLY_BRACES, envconfig.get) -config = Template.substitute_structure(config, TemplateConstants.DOLLAR_PARENTHESES, envconfig.get) +config.save(berr_yaml) + +logging.info(f"---------------- generate soca_postproc_stddev.yaml") +berr_yaml = os.path.join(anl_dir, 'soca_postproc_stddev.yaml') +berr_yaml_template = os.path.join(berror_yaml_dir, 'soca_postproc_stddev.yaml') +config = YAMLFile(path=berr_yaml_template) +config = Template.substitute_structure(config, TemplateConstants.DOUBLE_CURLY_BRACES, envconfig.get) config.save(berr_yaml) logging.info(f"---------------- generate soca_clim_ens_perts.yaml") diff --git a/utils/gdas_postprocincr.h b/utils/gdas_postprocincr.h index 25c03e187..868964e49 100644 --- a/utils/gdas_postprocincr.h +++ b/utils/gdas_postprocincr.h @@ -158,11 +158,16 @@ class PostProcIncr { // wait for everybody to be done comm_.barrier(); - // Change soca standard output name to something specidfied in the config + // Change soca standard output name to something specified in the config int result = 0; if ( comm_.rank() == 0 ) { + // get the output directory + std::string dataDir; + outputIncrConfig_.get("datadir", dataDir); + // get the output file name std::string outputFileName; outputIncrConfig_.get("output file", outputFileName); + outputFileName = dataDir + "/" + outputFileName; if (outputIncrConfig_.has("pattern")) { std::string pattern; outputIncrConfig_.get("pattern", pattern); @@ -226,6 +231,8 @@ class PostProcIncr { // Utility functions // ----------------------------------------------------------------------------- // Recreate the soca filename from the configuration + // TODO: Change this in soca? + // TODO: Hard-coded for ocean, implement for seaice as well std::string socaFname() { std::string datadir; outputIncrConfig_.get("datadir", datadir);