From a02d63ddcfb1aa8cc0bb493c0e88bbf440becc92 Mon Sep 17 00:00:00 2001 From: Matthew Thompson Date: Fri, 21 Feb 2025 15:32:18 -0500 Subject: [PATCH] v12: Fix lazy sed for RRTMGP --- gcm_forecast.tmpl | 2 +- gcm_regress.j | 2 +- gcm_run.j | 2 +- gcm_run.j-new_rst_approach | 8 ++++---- gcm_run_benchmark.j | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/gcm_forecast.tmpl b/gcm_forecast.tmpl index eb4d56d6..ad25aa66 100755 --- a/gcm_forecast.tmpl +++ b/gcm_forecast.tmpl @@ -667,7 +667,7 @@ endif set instance_files = `/bin/ls -1 *_instance*.rc` foreach instance ($instance_files) /bin/mv $instance $instance.tmp - cat $instance.tmp | sed -e '/RRTMG/ s#RRTMG#RRTMGP#' > $instance + cat $instance.tmp | sed -e '/\bRRTMG\b/ s#RRTMG#RRTMGP#' > $instance /bin/rm $instance.tmp end diff --git a/gcm_regress.j b/gcm_regress.j index 0591d6e6..7e8d1bb3 100755 --- a/gcm_regress.j +++ b/gcm_regress.j @@ -399,7 +399,7 @@ endif set instance_files = `/bin/ls -1 *_instance*.rc` foreach instance ($instance_files) /bin/mv $instance $instance.tmp - cat $instance.tmp | sed -e '/RRTMG/ s#RRTMG#RRTMGP#' > $instance + cat $instance.tmp | sed -e '/\bRRTMG\b/ s#RRTMG#RRTMGP#' > $instance /bin/rm $instance.tmp end diff --git a/gcm_run.j b/gcm_run.j index 8a2c916b..5ca09794 100755 --- a/gcm_run.j +++ b/gcm_run.j @@ -854,7 +854,7 @@ endif set instance_files = `/bin/ls -1 *_instance*.rc` foreach instance ($instance_files) /bin/mv $instance $instance.tmp - cat $instance.tmp | sed -e '/RRTMG/ s#RRTMG#RRTMGP#' > $instance + cat $instance.tmp | sed -e '/\bRRTMG\b/ s#RRTMG#RRTMGP#' > $instance /bin/rm $instance.tmp end diff --git a/gcm_run.j-new_rst_approach b/gcm_run.j-new_rst_approach index 574d5448..5ae1513f 100755 --- a/gcm_run.j-new_rst_approach +++ b/gcm_run.j-new_rst_approach @@ -589,7 +589,7 @@ if($numrs == 0) then set ext = bin else set ext = nc4 - endif + endif if( -e $rst & ! -e ${EXPDIR}/restarts/$EXPID.${rst}.${edate}.${GCMVER}.${BCTAG}_${BCRSLV}.$ext ) then cp $rst ${EXPDIR}/restarts/$EXPID.${rst}.${edate}.${GCMVER}.${BCTAG}_${BCRSLV}.$ext & endif @@ -851,7 +851,7 @@ endif set instance_files = `/bin/ls -1 *_instance*.rc` foreach instance ($instance_files) /bin/mv $instance $instance.tmp - cat $instance.tmp | sed -e '/RRTMG/ s#RRTMG#RRTMGP#' > $instance + cat $instance.tmp | sed -e '/\bRRTMG\b/ s#RRTMG#RRTMGP#' > $instance /bin/rm $instance.tmp end @@ -1098,7 +1098,7 @@ endif echo OMP_NUM_THREADS $OMP_NUM_THREADS ~/bin/strip GWD_GridComp.rc -if (${OMP_NUM_THREADS} > 1) then +if (${OMP_NUM_THREADS} > 1) then sed -i -e "s|FALSE|TRUE|g" GWD_GridComp.rc endif @@ -1228,7 +1228,7 @@ echo "RH_WEIGHTS_DIR: $RH_WEIGHTS_DIR" if (! -e $RH_WEIGHTS_DIR ) mkdir -p $RH_WEIGHTS_DIR set rh_files = `/bin/ls -1 *rh_*method*` foreach rh_file ($rh_files) - if (! -e $RH_WEIGHTS_DIR/$rh_file) /bin/mv $rh_file $RH_WEIGHTS_DIR/$rh_file + if (! -e $RH_WEIGHTS_DIR/$rh_file) /bin/mv $rh_file $RH_WEIGHTS_DIR/$rh_file end ####################################################################### diff --git a/gcm_run_benchmark.j b/gcm_run_benchmark.j index dde9ce9f..a739348a 100755 --- a/gcm_run_benchmark.j +++ b/gcm_run_benchmark.j @@ -702,7 +702,7 @@ endif set instance_files = `/bin/ls -1 *_instance*.rc` foreach instance ($instance_files) /bin/mv $instance $instance.tmp - cat $instance.tmp | sed -e '/RRTMG/ s#RRTMG#RRTMGP#' > $instance + cat $instance.tmp | sed -e '/\bRRTMG\b/ s#RRTMG#RRTMGP#' > $instance /bin/rm $instance.tmp end