From 6ea04537076244c2a996090d8c11832195d75a61 Mon Sep 17 00:00:00 2001 From: henrywinterbottom-wxdev Date: Mon, 30 Oct 2023 11:47:46 -0600 Subject: [PATCH 1/6] Changed path of text files used for HPSS archiving. --- ush/hpssarch_gen.sh | 214 ++++++++++++++++++++++---------------------- 1 file changed, 109 insertions(+), 105 deletions(-) diff --git a/ush/hpssarch_gen.sh b/ush/hpssarch_gen.sh index 138a5ff656..c2866a561e 100755 --- a/ush/hpssarch_gen.sh +++ b/ush/hpssarch_gen.sh @@ -27,30 +27,34 @@ if [[ ${type} = "gfs" ]]; then FHMAX_HF_GFS=${FHMAX_HF_GFS:-120} FHOUT_HF_GFS=${FHOUT_HF_GFS:-1} - rm -f gfsa.txt - rm -f gfsb.txt - rm -f gfs_restarta.txt - touch gfsa.txt - touch gfsb.txt - touch gfs_restarta.txt + # Implemented to prevent edge-case failures. + if [[ ! -d "${DATA}" ]]; then + mkdir -p "${DATA}" + fi + rm -f "${DATA}/gfsa.txt" + rm -f "${DATA}/gfsb.txt" + rm -f "${DATA}/gfs_restarta.txt" + touch "${DATA}/gfsa.txt" + touch "${DATA}/gfsb.txt" + touch "${DATA}/gfs_restarta.txt" if [[ ${ARCH_GAUSSIAN} = "YES" ]]; then - rm -f gfs_pgrb2b.txt - rm -f gfs_netcdfb.txt - rm -f gfs_flux.txt - touch gfs_pgrb2b.txt - touch gfs_netcdfb.txt - touch gfs_flux.txt + rm -f "${DATA}/gfs_pgrb2b.txt" + rm -f "${DATA}/gfs_netcdfb.txt" + rm -f "${DATA}/gfs_flux.txt" + touch "${DATA}/gfs_pgrb2b.txt" + touch "${DATA}/gfs_netcdfb.txt" + touch "${DATA}/gfs_flux.txt" if [[ ${MODE} = "cycled" ]]; then - rm -f gfs_netcdfa.txt - touch gfs_netcdfa.txt + rm -f "${DATA}/gfs_netcdfa.txt" + touch "${DATA}/gfs_netcdfa.txt" fi fi if [[ ${DO_DOWN} = "YES" ]]; then - rm -f gfs_downstream.txt - touch gfs_downstream.txt + rm -f "${DATA}/gfs_downstream.txt" + touch "${DATA}/gfs_downstream.txt" fi head="gfs.t${cyc}z." @@ -61,7 +65,7 @@ if [[ ${type} = "gfs" ]]; then echo "${COM_ATMOS_GRIB_0p25/${ROTDIR}\//}/${head}pgrb2b.0p25.anl.idx" echo "${COM_ATMOS_GRIB_1p00/${ROTDIR}\//}/${head}pgrb2b.1p00.anl" echo "${COM_ATMOS_GRIB_1p00/${ROTDIR}\//}/${head}pgrb2b.1p00.anl.idx" - } >> gfs_pgrb2b.txt + } >> "${DATA}/gfs_pgrb2b.txt" if [[ ${MODE} = "cycled" ]]; then { @@ -73,7 +77,7 @@ if [[ ${type} = "gfs" ]]; then for file in "${gsida_files[@]}"; do [[ -s ${COM_ATMOS_ANALYSIS}/${head}${file} ]] && echo "${COM_ATMOS_ANALYSIS/${ROTDIR}\//}/${head}${file}" done - } >> gfs_netcdfa.txt + } >> "${DATA}/gfs_netcdfa.txt" fi fh=0 @@ -82,7 +86,7 @@ if [[ ${type} = "gfs" ]]; then { echo "${COM_ATMOS_HISTORY/${ROTDIR}\//}/${head}atmf${fhr}.nc" echo "${COM_ATMOS_HISTORY/${ROTDIR}\//}/${head}sfcf${fhr}.nc" - } >> gfs_netcdfb.txt + } >> "${DATA}/gfs_netcdfb.txt" fh=$((fh+ARCH_GAUSSIAN_FHINC)) done fi @@ -130,7 +134,7 @@ if [[ ${type} = "gfs" ]]; then for file in "${genesis_files[@]}"; do [[ -s ${COM_ATMOS_GENESIS}/${file} ]] && echo "${COM_ATMOS_GENESIS/${ROTDIR}\//}/${file}" done - } >> gfsa.txt + } >> "${DATA}/gfsa.txt" { if [[ ${DO_DOWN} = "YES" ]]; then @@ -142,14 +146,14 @@ if [[ ${type} = "gfs" ]]; then echo "${COM_ATMOS_BUFR/${ROTDIR}\//}/gfs.t${cyc}z.bufrsnd.tar.gz" fi fi - } >> gfs_downstream.txt + } >> "${DATA}/gfs_downstream.txt" { echo "${COM_ATMOS_GRIB_0p50/${ROTDIR}\//}/${head}pgrb2.0p50.anl" echo "${COM_ATMOS_GRIB_0p50/${ROTDIR}\//}/${head}pgrb2.0p50.anl.idx" echo "${COM_ATMOS_GRIB_1p00/${ROTDIR}\//}/${head}pgrb2.1p00.anl" echo "${COM_ATMOS_GRIB_1p00/${ROTDIR}\//}/${head}pgrb2.1p00.anl.idx" - } >> gfsb.txt + } >> "${DATA}/gfsb.txt" fh=0 @@ -159,7 +163,7 @@ if [[ ${type} = "gfs" ]]; then { echo "${COM_ATMOS_MASTER/${ROTDIR}\//}/${head}sfluxgrbf${fhr}.grib2" echo "${COM_ATMOS_MASTER/${ROTDIR}\//}/${head}sfluxgrbf${fhr}.grib2.idx" - } >> gfs_flux.txt + } >> "${DATA}/gfs_flux.txt" { echo "${COM_ATMOS_GRIB_0p25/${ROTDIR}\//}/${head}pgrb2b.0p25.f${fhr}" @@ -168,14 +172,14 @@ if [[ ${type} = "gfs" ]]; then echo "${COM_ATMOS_GRIB_1p00/${ROTDIR}\//}/{head}pgrb2b.1p00.f${fhr}" echo "${COM_ATMOS_GRIB_1p00/${ROTDIR}\//}/{head}pgrb2b.1p00.f${fhr}.idx" fi - } >> gfs_pgrb2b.txt + } >> "${DATA}/gfs_pgrb2b.txt" fi { echo "${COM_ATMOS_GRIB_0p25/${ROTDIR}\//}/${head}pgrb2.0p25.f${fhr}" echo "${COM_ATMOS_GRIB_0p25/${ROTDIR}\//}/${head}pgrb2.0p25.f${fhr}.idx" echo "${COM_ATMOS_HISTORY/${ROTDIR}\//}/${head}atm.logf${fhr}.txt" - } >> gfsa.txt + } >> "${DATA}/gfsa.txt" { @@ -187,7 +191,7 @@ if [[ ${type} = "gfs" ]]; then echo "${COM_ATMOS_GRIB_1p00/${ROTDIR}\//}/${head}pgrb2.1p00.f${fhr}" echo "${COM_ATMOS_GRIB_1p00/${ROTDIR}\//}/${head}pgrb2.1p00.f${fhr}.idx" fi - } >> gfsb.txt + } >> "${DATA}/gfsb.txt" inc=${FHOUT_GFS} if (( FHMAX_HF_GFS > 0 && FHOUT_HF_GFS > 0 && fh < FHMAX_HF_GFS )); then @@ -221,14 +225,14 @@ if [[ ${type} = "gfs" ]]; then echo "${COM_ATMOS_INPUT/${ROTDIR}\//}/sfc_data.tile5.nc" echo "${COM_ATMOS_INPUT/${ROTDIR}\//}/sfc_data.tile6.nc" fi - } >> gfs_restarta.txt + } >> "${DATA}/gfs_restarta.txt" #.................. if [[ ${DO_WAVE} = "YES" ]]; then - rm -rf gfswave.txt - touch gfswave.txt + rm -rf "${DATA}/gfswave.txt" + touch "${DATA}/gfswave.txt" head="gfswave.t${cyc}z." @@ -237,60 +241,60 @@ if [[ ${type} = "gfs" ]]; then echo "${COM_WAVE_HISTORY/${ROTDIR}\//}/ww3_multi*" echo "${COM_WAVE_GRID/${ROTDIR}\//}/${head}*" echo "${COM_WAVE_STATION/${ROTDIR}\//}/${head}*" - } >> gfswave.txt + } >> "${DATA}/gfswave.txt" fi if [[ ${DO_OCN} = "YES" ]]; then head="gfs.t${cyc}z." - rm -f gfs_flux_1p00.txt - rm -f ocn_ice_grib2_0p5.txt - rm -f ocn_ice_grib2_0p25.txt - rm -f ocn_2D.txt - rm -f ocn_3D.txt - rm -f ocn_xsect.txt - rm -f ocn_daily.txt - touch gfs_flux_1p00.txt - touch ocn_ice_grib2_0p5.txt - touch ocn_ice_grib2_0p25.txt - touch ocn_2D.txt - touch ocn_3D.txt - touch ocn_xsect.txt - touch ocn_daily.txt - echo "${COM_OCEAN_INPUT/${ROTDIR}\//}/MOM_input" >> ocn_2D.txt - echo "${COM_OCEAN_2D/${ROTDIR}\//}/ocn_2D*" >> ocn_2D.txt - echo "${COM_OCEAN_3D/${ROTDIR}\//}/ocn_3D*" >> ocn_3D.txt - echo "${COM_OCEAN_XSECT/${ROTDIR}\//}/ocn*EQ*" >> ocn_xsect.txt - echo "${COM_OCEAN_HISTORY/${ROTDIR}\//}/ocn_daily*" >> ocn_daily.txt - echo "${COM_OCEAN_GRIB_0p50/${ROTDIR}\//}/ocn_ice*0p5x0p5.grb2" >> ocn_ice_grib2_0p5.txt - echo "${COM_OCEAN_GRIB_0p25/${ROTDIR}\//}/ocn_ice*0p25x0p25.grb2" >> ocn_ice_grib2_0p25.txt + rm -f "${DATA}/gfs_flux_1p00.txt" + rm -f "${DATA}/ocn_ice_grib2_0p5.txt" + rm -f "${DATA}/ocn_ice_grib2_0p25.txt" + rm -f "${DATA}/ocn_2D.txt" + rm -f "${DATA}/ocn_3D.txt" + rm -f "${DATA}/ocn_xsect.txt" + rm -f "${DATA}/ocn_daily.txt" + touch "${DATA}/gfs_flux_1p00.txt" + touch "${DATA}/ocn_ice_grib2_0p5.txt" + touch "${DATA}/ocn_ice_grib2_0p25.txt" + touch "${DATA}/ocn_2D.txt" + touch "${DATA}/ocn_3D.txt" + touch "${DATA}/ocn_xsect.txt" + touch "${DATA}/ocn_daily.txt" + echo "${COM_OCEAN_INPUT/${ROTDIR}\//}/MOM_input" >> "${DATA}/ocn_2D.txt" + echo "${COM_OCEAN_2D/${ROTDIR}\//}/ocn_2D*" >> "${DATA}/ocn_2D.txt" + echo "${COM_OCEAN_3D/${ROTDIR}\//}/ocn_3D*" >> "${DATA}/ocn_3D.txt" + echo "${COM_OCEAN_XSECT/${ROTDIR}\//}/ocn*EQ*" >> "${DATA}/ocn_xsect.txt" + echo "${COM_OCEAN_HISTORY/${ROTDIR}\//}/ocn_daily*" >> "${DATA}/ocn_daily.txt" + echo "${COM_OCEAN_GRIB_0p50/${ROTDIR}\//}/ocn_ice*0p5x0p5.grb2" >> "${DATA}/ocn_ice_grib2_0p5.txt" + echo "${COM_OCEAN_GRIB_0p25/${ROTDIR}\//}/ocn_ice*0p25x0p25.grb2" >> "${DATA}/ocn_ice_grib2_0p25.txt" # Also save fluxes from atmosphere { echo "${COM_ATMOS_GRIB_1p00/${ROTDIR}\//}/${head}flux.1p00.f???" echo "${COM_ATMOS_GRIB_1p00/${ROTDIR}\//}/${head}flux.1p00.f???.idx" - } >> gfs_flux_1p00.txt + } >> "${DATA}/gfs_flux_1p00.txt" fi if [[ ${DO_ICE} = "YES" ]]; then head="gfs.t${cyc}z." - rm -f ice.txt - touch ice.txt + rm -f "${DATA}/ice.txt" + touch "${DATA}/ice.txt" { echo "${COM_ICE_INPUT/${ROTDIR}\//}/ice_in" echo "${COM_ICE_HISTORY/${ROTDIR}\//}/ice*nc" - } >> ice.txt + } >> "${DATA}/ice.txt" fi if [[ ${DO_AERO} = "YES" ]]; then head="gocart" - rm -f chem.txt - touch chem.txt + rm -f "${DATA}/chem.txt" + touch "${DATA}/chem.txt" - echo "${COM_CHEM_HISTORY/${ROTDIR}\//}/${head}*" >> chem.txt + echo "${COM_CHEM_HISTORY/${ROTDIR}\//}/${head}*" >> "${DATA}/chem.txt" fi #----------------------------------------------------- @@ -303,12 +307,12 @@ fi ##end of gfs if [[ ${type} == "gdas" ]]; then #----------------------------------------------------- - rm -f gdas.txt - rm -f gdas_restarta.txt - rm -f gdas_restartb.txt - touch gdas.txt - touch gdas_restarta.txt - touch gdas_restartb.txt + rm -f "${DATA}/gdas.txt" + rm -f "${DATA}/gdas_restarta.txt" + rm -f "${DATA}/gdas_restartb.txt" + touch "${DATA}/gdas.txt" + touch "${DATA}/gdas_restarta.txt" + touch "${DATA}/gdas_restartb.txt" head="gdas.t${cyc}z." @@ -379,14 +383,14 @@ if [[ ${type} == "gdas" ]]; then echo "${file}.idx" fi done - } >> gdas.txt + } >> "${DATA}/gdas.txt" #.................. if [[ -s "${COM_ATMOS_ANALYSIS}/${head}cnvstat" ]]; then - echo "${COM_ATMOS_ANALYSIS/${ROTDIR}\//}/${head}cnvstat" >> gdas_restarta.txt + echo "${COM_ATMOS_ANALYSIS/${ROTDIR}\//}/${head}cnvstat" >> "${DATA}/gdas_restarta.txt" fi if [[ -s "${COM_ATMOS_ANALYSIS}/${head}radstat" ]]; then - echo "${COM_ATMOS_ANALYSIS/${ROTDIR}\//}/${head}radstat" >> gdas_restarta.txt + echo "${COM_ATMOS_ANALYSIS/${ROTDIR}\//}/${head}radstat" >> "${DATA}/gdas_restarta.txt" fi { @@ -422,18 +426,18 @@ if [[ ${type} == "gdas" ]]; then echo "${COM_ATMOS_RESTART/${ROTDIR}\//}/*0000.sfcanl_data.tile4.nc" echo "${COM_ATMOS_RESTART/${ROTDIR}\//}/*0000.sfcanl_data.tile5.nc" echo "${COM_ATMOS_RESTART/${ROTDIR}\//}/*0000.sfcanl_data.tile6.nc" - } >> gdas_restarta.txt + } >> "${DATA}/gdas_restarta.txt" #.................. - echo "${COM_ATMOS_RESTART/${ROTDIR}\//}" >> gdas_restartb.txt + echo "${COM_ATMOS_RESTART/${ROTDIR}\//}" >> "${DATA}/gdas_restartb.txt" #.................. if [[ ${DO_WAVE} = "YES" ]]; then - rm -rf gdaswave.txt - touch gdaswave.txt - rm -rf gdaswave_restart.txt - touch gdaswave_restart.txt + rm -rf "${DATA}/gdaswave.txt" + touch "${DATA}/gdaswave.txt" + rm -rf "${DATA}/gdaswave_restart.txt" + touch "${DATA}/gdaswave_restart.txt" head="gdaswave.t${cyc}z." @@ -441,19 +445,19 @@ if [[ ${type} == "gdas" ]]; then { echo "${COM_WAVE_GRID/${ROTDIR}\//}/${head}*" echo "${COM_WAVE_STATION/${ROTDIR}\//}/${head}*" - } >> gdaswave.txt + } >> "${DATA}/gdaswave.txt" - echo "${COM_WAVE_RESTART/${ROTDIR}\//}/*" >> gdaswave_restart.txt + echo "${COM_WAVE_RESTART/${ROTDIR}\//}/*" >> "${DATA}/gdaswave_restart.txt" fi #.................. if [[ ${DO_OCN} = "YES" ]]; then - rm -rf gdasocean.txt - touch gdasocean.txt - rm -rf gdasocean_restart.txt - touch gdasocean_restart.txt + rm -rf "${DATA}/gdasocean.txt" + touch "${DATA}/gdasocean.txt" + rm -rf "${DATA}/gdasocean_restart.txt" + touch "${DATA}/gdasocean_restart.txt" head="gdas.t${cyc}z." @@ -461,21 +465,21 @@ if [[ ${type} == "gdas" ]]; then { echo "${COM_OCEAN_HISTORY/${ROTDIR}\//}/${head}*" echo "${COM_OCEAN_INPUT/${ROTDIR}\//}" - } >> gdasocean.txt + } >> "${DATA}/gdasocean.txt" { echo "${COM_OCEAN_RESTART/${ROTDIR}\//}/*" echo "${COM_MED_RESTART/${ROTDIR}\//}/*" - } >> gdasocean_restart.txt + } >> "${DATA}/gdasocean_restart.txt" fi if [[ ${DO_ICE} = "YES" ]]; then - rm -rf gdasice.txt - touch gdasice.txt - rm -rf gdasice_restart.txt - touch gdasice_restart.txt + rm -rf "${DATA}/gdasice.txt" + touch "${DATA}/gdasice.txt" + rm -rf "${DATA}/gdasice_restart.txt" + touch "${DATA}/gdasice_restart.txt" head="gdas.t${cyc}z." @@ -483,9 +487,9 @@ if [[ ${type} == "gdas" ]]; then { echo "${COM_ICE_HISTORY/${ROTDIR}\//}/${head}*" echo "${COM_ICE_INPUT/${ROTDIR}\//}/ice_in" - } >> gdasice.txt + } >> "${DATA}/gdasice.txt" - echo "${COM_ICE_RESTART/${ROTDIR}\//}/*" >> gdasice_restart.txt + echo "${COM_ICE_RESTART/${ROTDIR}\//}/*" >> "${DATA}/gdasice_restart.txt" fi @@ -513,8 +517,8 @@ if [[ ${type} == "enkfgdas" || ${type} == "enkfgfs" ]]; then head="${RUN}.t${cyc}z." #.................. - rm -f "${RUN}.txt" - touch "${RUN}.txt" + rm -f "${DATA}/${RUN}.txt" + touch "${DATA}/${RUN}.txt" { gsida_files=("enkfstat" @@ -572,19 +576,19 @@ if [[ ${type} == "enkfgdas" || ${type} == "enkfgfs" ]]; then fi fh=$((fh+3)) done - } >> "${RUN}.txt" + } >> "${DATA}/${RUN}.txt" #........................... n=1 while (( n <= NTARS )); do #........................... - rm -f "${RUN}_grp${n}.txt" - rm -f "${RUN}_restarta_grp${n}.txt" - rm -f "${RUN}_restartb_grp${n}.txt" - touch "${RUN}_grp${n}.txt" - touch "${RUN}_restarta_grp${n}.txt" - touch "${RUN}_restartb_grp${n}.txt" + rm -f "${DATA}/${RUN}_grp${n}.txt" + rm -f "${DATA}/${RUN}_restarta_grp${n}.txt" + rm -f "${DATA}/${RUN}_restartb_grp${n}.txt" + touch "${DATA}/${RUN}_grp${n}.txt" + touch "${DATA}/${RUN}_restarta_grp${n}.txt" + touch "${DATA}/${RUN}_restartb_grp${n}.txt" m=1 while (( m <= NMEM_EARCGRP )); do @@ -609,11 +613,11 @@ if [[ ${type} == "enkfgdas" || ${type} == "enkfgfs" ]]; then echo "${COM_ATMOS_ANALYSIS_MEM/${ROTDIR}\//}/${head}ratminc.nc" fi fi - } >> "${RUN}_grp${n}.txt" + } >> "${DATA}/${RUN}_grp${n}.txt" if [[ -s "${COM_ATMOS_ANALYSIS_MEM}/${head}ratminc.nc" ]] ; then echo "${COM_ATMOS_ANALYSIS_MEM/${ROTDIR}\//}/${head}ratminc.nc" \ - >> "${RUN}_restarta_grp${n}.txt" + >> "${DATA}/${RUN}_restarta_grp${n}.txt" fi else @@ -626,10 +630,10 @@ if [[ ${type} == "enkfgdas" || ${type} == "enkfgfs" ]]; then echo "${COM_ATMOS_ANALYSIS_MEM/${ROTDIR}\//}/${head}ratmi00${FHR}.nc" fi fi - } >> "${RUN}_grp${n}.txt" + } >> "${DATA}/${RUN}_grp${n}.txt" if [[ -s "${COM_ATMOS_ANALYSIS_MEM}/${head}ratmi00${FHR}.nc" ]] ; then echo "${COM_ATMOS_ANALYSIS_MEM/${ROTDIR}\//}/${head}ratmi00${FHR}.nc" \ - >> "${RUN}_restarta_grp${n}.txt" + >> "${DATA}/${RUN}_restarta_grp${n}.txt" fi fi { @@ -637,7 +641,7 @@ if [[ ${type} == "enkfgdas" || ${type} == "enkfgfs" ]]; then if (( FHR == 6 )); then echo "${COM_ATMOS_HISTORY_MEM/${ROTDIR}\//}/${head}sfcf00${FHR}.nc" fi - } >> "${RUN}_grp${n}.txt" + } >> "${DATA}/${RUN}_grp${n}.txt" done # loop over FHR if [[ ${lobsdiag_forenkf} == ".false." ]] ; then @@ -646,7 +650,7 @@ if [[ ${type} == "enkfgdas" || ${type} == "enkfgfs" ]]; then if [[ -s "${COM_ATMOS_RESTART_MEM}/${head}cnvstat" ]] ; then echo "${COM_ATMOS_RESTART_MEM/${ROTDIR}\//}/${head}cnvstat" fi - } >> "${RUN}_grp${n}.txt" + } >> "${DATA}/${RUN}_grp${n}.txt" { if [[ -s "${COM_ATMOS_RESTART_MEM}/${head}radstat" ]]; then @@ -659,7 +663,7 @@ if [[ ${type} == "enkfgdas" || ${type} == "enkfgfs" ]]; then echo "${COM_ATMOS_RESTART_MEM/${ROTDIR}\//}/${head}abias_air" echo "${COM_ATMOS_RESTART_MEM/${ROTDIR}\//}/${head}abias_int" echo "${COM_ATMOS_RESTART_MEM/${ROTDIR}\//}/${head}abias_pc" - } >> "${RUN}_restarta_grp${n}.txt" + } >> "${DATA}/${RUN}_restarta_grp${n}.txt" fi #--- { @@ -669,9 +673,9 @@ if [[ ${type} == "enkfgdas" || ${type} == "enkfgfs" ]]; then echo "${COM_ATMOS_RESTART_MEM/${ROTDIR}\//}/*0000.sfcanl_data.tile4.nc" echo "${COM_ATMOS_RESTART_MEM/${ROTDIR}\//}/*0000.sfcanl_data.tile5.nc" echo "${COM_ATMOS_RESTART_MEM/${ROTDIR}\//}/*0000.sfcanl_data.tile6.nc" - } >> "${RUN}_restarta_grp${n}.txt" + } >> "${DATA}/${RUN}_restarta_grp${n}.txt" #--- - echo "${COM_ATMOS_RESTART_MEM/${ROTDIR}\//}" >> "${RUN}_restartb_grp${n}.txt" + echo "${COM_ATMOS_RESTART_MEM/${ROTDIR}\//}" >> "${DATA}/${RUN}_restartb_grp${n}.txt" m=$((m+1)) done From 1dc3a7c9a490f029ff3a9fd8efe1e41635e1df32 Mon Sep 17 00:00:00 2001 From: henrywinterbottom-wxdev Date: Mon, 30 Oct 2023 11:50:17 -0600 Subject: [PATCH 2/6] Removed edge case check from previous commit. --- ush/hpssarch_gen.sh | 4 ---- 1 file changed, 4 deletions(-) diff --git a/ush/hpssarch_gen.sh b/ush/hpssarch_gen.sh index c2866a561e..d1441568e0 100755 --- a/ush/hpssarch_gen.sh +++ b/ush/hpssarch_gen.sh @@ -27,10 +27,6 @@ if [[ ${type} = "gfs" ]]; then FHMAX_HF_GFS=${FHMAX_HF_GFS:-120} FHOUT_HF_GFS=${FHOUT_HF_GFS:-1} - # Implemented to prevent edge-case failures. - if [[ ! -d "${DATA}" ]]; then - mkdir -p "${DATA}" - fi rm -f "${DATA}/gfsa.txt" rm -f "${DATA}/gfsb.txt" rm -f "${DATA}/gfs_restarta.txt" From 834ba304428d4b42f971ebae718127d79db0c2a2 Mon Sep 17 00:00:00 2001 From: HenryWinterbottom-NOAA Date: Tue, 31 Oct 2023 16:56:21 +0000 Subject: [PATCH 3/6] Cleanup. --- scripts/exglobal_archive.sh | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/scripts/exglobal_archive.sh b/scripts/exglobal_archive.sh index 54323a0dd0..8233ac8aa4 100755 --- a/scripts/exglobal_archive.sh +++ b/scripts/exglobal_archive.sh @@ -155,10 +155,9 @@ if [[ ${HPSSARCH} = "YES" || ${LOCALARCH} = "YES" ]]; then if [[ "${mod}" -eq 0 ]] || [[ "${PDY}${cyc}" -eq "${firstday}" ]]; then SAVEFCSTIC="YES" ; fi - ARCH_LIST="${DATA}/archlist" - [[ -d ${ARCH_LIST} ]] && rm -rf "${ARCH_LIST}" - mkdir -p "${ARCH_LIST}" - cd "${ARCH_LIST}" || exit 2 + [[ -d ${DATA} ]] && rm -rf "${DATA}" + mkdir -p "${DATA}" + cd "${DATA}" || exit 2 "${HOMEgfs}/ush/hpssarch_gen.sh" "${RUN}" status=$? @@ -196,7 +195,7 @@ if [[ ${HPSSARCH} = "YES" || ${LOCALARCH} = "YES" ]]; then if [ "${DO_AERO}" = "YES" ]; then for targrp in chem; do # TODO: Why is this tar being done here instead of being added to the list? - ${TARCMD} -P -cvf "${ATARDIR}/${PDY}${cyc}/${targrp}.tar" $(cat "${ARCH_LIST}/${targrp}.txt") + ${TARCMD} -P -cvf "${ATARDIR}/${PDY}${cyc}/${targrp}.tar" $(cat "${DATA}/${targrp}.txt") status=$? if [[ "${status}" -ne 0 ]] && [[ "${PDY}${cyc}" -ge "${firstday}" ]]; then echo "HTAR ${PDY}${cyc} ${targrp}.tar failed" @@ -276,7 +275,7 @@ if [[ ${HPSSARCH} = "YES" || ${LOCALARCH} = "YES" ]]; then break fi fi - done < "${ARCH_LIST}/${targrp}.txt" + done < "${DATA}/${targrp}.txt" ;; *) ;; @@ -284,7 +283,7 @@ if [[ ${HPSSARCH} = "YES" || ${LOCALARCH} = "YES" ]]; then # Create the tarball tar_fl="${ATARDIR}/${PDY}${cyc}/${targrp}.tar" - ${TARCMD} -P -cvf "${tar_fl}" $(cat "${ARCH_LIST}/${targrp}.txt") + ${TARCMD} -P -cvf "${tar_fl}" $(cat "${DATA}/${targrp}.txt") status=$? # Change group to rstprod if it was found even if htar/tar failed in case of partial creation From 690c59cd1ec35ea2d9f83b13ba86b9c16432fb89 Mon Sep 17 00:00:00 2001 From: HenryWinterbottom-NOAA Date: Tue, 31 Oct 2023 17:11:50 +0000 Subject: [PATCH 4/6] Updated per reviewer request. --- scripts/exglobal_archive.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/scripts/exglobal_archive.sh b/scripts/exglobal_archive.sh index 8bae95cc5c..cac9f64bfc 100755 --- a/scripts/exglobal_archive.sh +++ b/scripts/exglobal_archive.sh @@ -156,7 +156,6 @@ if [[ ${HPSSARCH} = "YES" || ${LOCALARCH} = "YES" ]]; then [[ -d ${DATA} ]] && rm -rf "${DATA}" - mkdir -p "${DATA}" cd "${DATA}" || exit 2 "${HOMEgfs}/ush/hpssarch_gen.sh" "${RUN}" From e2a8f3f9ef8e6fbb52573935552eaded18c89584 Mon Sep 17 00:00:00 2001 From: "Henry R. Winterbottom" <49202169+HenryWinterbottom-NOAA@users.noreply.github.com> Date: Tue, 31 Oct 2023 11:27:47 -0600 Subject: [PATCH 5/6] Update exglobal_archive.sh Removed directory check as per reviewer request. --- scripts/exglobal_archive.sh | 2 -- 1 file changed, 2 deletions(-) diff --git a/scripts/exglobal_archive.sh b/scripts/exglobal_archive.sh index cac9f64bfc..18217f4efc 100755 --- a/scripts/exglobal_archive.sh +++ b/scripts/exglobal_archive.sh @@ -154,8 +154,6 @@ if [[ ${HPSSARCH} = "YES" || ${LOCALARCH} = "YES" ]]; then mod=$((nday % ARCH_FCSTICFREQ)) if [[ "${mod}" -eq 0 ]] || [[ "${PDY}${cyc}" -eq "${firstday}" ]]; then SAVEFCSTIC="YES" ; fi - - [[ -d ${DATA} ]] && rm -rf "${DATA}" cd "${DATA}" || exit 2 "${HOMEgfs}/ush/hpssarch_gen.sh" "${RUN}" From e3ef45c171ecbe70d5313d4195abb93ad6c5f17a Mon Sep 17 00:00:00 2001 From: "Henry R. Winterbottom" <49202169+HenryWinterbottom-NOAA@users.noreply.github.com> Date: Wed, 1 Nov 2023 11:17:51 -0600 Subject: [PATCH 6/6] Update hpssarch_gen.sh Update due to missed change. --- ush/hpssarch_gen.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ush/hpssarch_gen.sh b/ush/hpssarch_gen.sh index ec0695c8d5..8d8ebf4fe9 100755 --- a/ush/hpssarch_gen.sh +++ b/ush/hpssarch_gen.sh @@ -473,7 +473,7 @@ if [[ ${type} == "gdas" ]]; then echo "${COM_OCEAN_ANALYSIS/${ROTDIR}\//}/gdas.t??z.ocngrid.nc" echo "${COM_OCEAN_ANALYSIS/${ROTDIR}\//}/diags" echo "${COM_OCEAN_ANALYSIS/${ROTDIR}\//}/yaml" - } >> gdasocean_analysis.txt + } >> "${DATA}/gdasocean_analysis.txt" fi