From de78d0f545e2242997fabcf96ddba88c846a8a36 Mon Sep 17 00:00:00 2001 From: "Xianwu.Xue" Date: Wed, 25 Jan 2023 00:17:35 -0500 Subject: [PATCH] Add NewCOM functions for fcst and atmos_prdgen jobs On branch feature/gefs_v13_atmos_prep Changes to be committed: modified: jobs/JGEFS_ATMOS_PRDGEN modified: rocoto/bin/wcoss2/common.sh modified: scripts/exgefs_forecast.sh Refs: #94 & #95 --- jobs/JGEFS_ATMOS_PRDGEN | 9 +++++++-- rocoto/bin/wcoss2/common.sh | 2 +- scripts/exgefs_forecast.sh | 12 ++++++++++-- 3 files changed, 18 insertions(+), 5 deletions(-) diff --git a/jobs/JGEFS_ATMOS_PRDGEN b/jobs/JGEFS_ATMOS_PRDGEN index b2bfec21e..3aa2be0a7 100755 --- a/jobs/JGEFS_ATMOS_PRDGEN +++ b/jobs/JGEFS_ATMOS_PRDGEN @@ -74,8 +74,13 @@ export PARMgefs=${PARMgefs:-$HOMEgefs/parm} ############################################## ver=${ver:-$(echo ${gefs_ver}|cut -c1-5)} export mem=$(echo $RUNMEM|cut -c3-5) -export COMIN=${COMIN:-$(compath.py $envir/com/$NET/${ver})/${RUN}.${PDY}/$cyc}/${mem} -export COMOUT=${COMOUT:-$(compath.py -o $NET/${ver})/${RUN}.${PDY}/$cyc}/${mem} +export COMIN=${COMIN:-$(compath.py $envir/com/$NET/${ver})/${RUN}.${PDY}/$cyc} +export COMOUT=${COMOUT:-$(compath.py -o $NET/${ver})/${RUN}.${PDY}/$cyc} +if [[ ${NewCOM:-"YES"} == "YES" ]]; then + export mem=$(echo $RUNMEM|cut -c3-5) + export COMIN=${COMIN}/${mem} + export COMOUT=${COMOUT}/${mem} +fi ############################# # Source relevant config files diff --git a/rocoto/bin/wcoss2/common.sh b/rocoto/bin/wcoss2/common.sh index 12d18a713..f877c9826 100644 --- a/rocoto/bin/wcoss2/common.sh +++ b/rocoto/bin/wcoss2/common.sh @@ -1,4 +1,4 @@ -#!/bin/ksh -l +#!/usr/bin/env bash RocotoGen=${RocotoGen:-0} diff --git a/scripts/exgefs_forecast.sh b/scripts/exgefs_forecast.sh index 752ca2e26..db4f76c13 100755 --- a/scripts/exgefs_forecast.sh +++ b/scripts/exgefs_forecast.sh @@ -319,7 +319,11 @@ if [[ $err != 0 ]]; then fi if [[ $SENDCOM == "YES" && $WRITE_DOPOST == ".true." ]]; then - mkdir -m 775 -p ${memdir}/misc/post + if [[ ${NewCOM} == "YES" ]]; then + mkdir -m 775 -p ${memdir}/misc/post + else + mkdir -m 775 -p ${memdir}/../misc/post + fi # Convert output settings into an explicit list OUTPUT_FH="" @@ -339,7 +343,11 @@ if [[ $SENDCOM == "YES" && $WRITE_DOPOST == ".true." ]]; then mafile=${memdir}/${CDUMP}.$cycle.master.grb2f${FH3} mifile=${memdir}/${CDUMP}.$cycle.master.grb2if${FH3} - mcfile=${memdir}/misc/post/${CDUMP}.$cycle.master.control.f${FH3} + if [[ ${NewCOM} == "YES" ]]; then + mcfile=${memdir}/misc/post/${CDUMP}.$cycle.master.control.f${FH3} + else + mcfile=${memdir}/../misc/post/${CDUMP}.$cycle.master.control.f${FH3} + fi if [[ ! -s $mcfile ]]; then if [[ -s $mafile ]]; then