From 1adfe472159921d7a57601b6ed39d682768171c0 Mon Sep 17 00:00:00 2001 From: AntonMFernando Date: Thu, 16 Jan 2025 17:12:34 -0500 Subject: [PATCH] modified extractvars files --- jobs/JGLOBAL_EXTRACTVARS | 5 ++ parm/archive/gefs_extracted_atmos.yaml.j2 | 86 ----------------------- parm/archive/gefs_extracted_ice.yaml.j2 | 33 --------- parm/archive/gefs_extracted_ocean.yaml.j2 | 40 ----------- parm/archive/gefs_extracted_wave.yaml.j2 | 52 -------------- ush/wave_extractvars.sh | 7 +- 6 files changed, 11 insertions(+), 212 deletions(-) delete mode 100644 parm/archive/gefs_extracted_atmos.yaml.j2 delete mode 100644 parm/archive/gefs_extracted_ice.yaml.j2 delete mode 100644 parm/archive/gefs_extracted_ocean.yaml.j2 delete mode 100644 parm/archive/gefs_extracted_wave.yaml.j2 diff --git a/jobs/JGLOBAL_EXTRACTVARS b/jobs/JGLOBAL_EXTRACTVARS index 3478ca3976..1c1a763a03 100755 --- a/jobs/JGLOBAL_EXTRACTVARS +++ b/jobs/JGLOBAL_EXTRACTVARS @@ -2,6 +2,7 @@ source "${HOMEgfs}/ush/preamble.sh" source "${HOMEgfs}/ush/jjob_header.sh" -e "extractvars" -c "base extractvars" +source "${USHgfs}/wave_domain_grid.sh" # Set COM Paths for grid in '0p25' '0p50' '1p00'; do @@ -19,6 +20,10 @@ YMD="${PDY}" HH="${cyc}" declare_from_tmpl -rx \ "COMIN_ICE_NETCDF:COM_ICE_NETCDF_TMPL" \ "COMIN_WAVE_GRID:COM_WAVE_GRID_TMPL" +process_grdID "${waveGRD}" +YMD=${PDY} HH=${cyc} GRDRESNAME=${grdNAME} declare_from_tmpl -rx \ + "COMIN_WAVE_GRID_${GRDREGION}_${GRDRES}:COM_WAVE_GRID_RES_TMPL" + if [[ "${DO_ATM}" == "YES" ]]; then if [[ ! -d "${ARC_RFCST_PROD_ATMOS_F2D}" ]]; then mkdir -p "${ARC_RFCST_PROD_ATMOS_F2D}"; fi if [[ ! -d "${ARC_RFCST_PROD_ATMOS_F3D}" ]]; then mkdir -p "${ARC_RFCST_PROD_ATMOS_F3D}"; fi diff --git a/parm/archive/gefs_extracted_atmos.yaml.j2 b/parm/archive/gefs_extracted_atmos.yaml.j2 deleted file mode 100644 index 7ceba551bf..0000000000 --- a/parm/archive/gefs_extracted_atmos.yaml.j2 +++ /dev/null @@ -1,86 +0,0 @@ -{% set cycle_HH = current_cycle | strftime("%H") %} -{% set cycle_YMD = current_cycle | to_YMD %} -{% set cycle_YMDH = current_cycle | to_YMDH %} -{% set head = RUN + ".t" + cycle_HH + "z." %} - -gefs_atmos: - name: "GEFS_ATMOS" - target: "{{ ATARDIR }}/{{ cycle_YMDH }}/gefs_atmos.tar" - required: -#select mem%03d and ensstat files required -{% set members = ["ensstat"] %} -{% for mem_nm in range(0, NMEM_ENS + 1) %} - {% do members.append("mem" ~ '%03d' % mem_nm ) %} -{% endfor %} - -{% if REPLAY_ICS %} - {% set ofst_hr = OFFSET_START_HOUR %} -{% else %} - {% set ofst_hr = FHMIN_GFS %} -{% endif %} - -{% for mem in members %} - {% for res in ['0p25', '0p50', '1p00'] %} - {% set tmpl_dict = ({ '${ROTDIR}':ROTDIR, - '${RUN}':RUN, - '${YMD}':cycle_YMD, - '${HH}':cycle_HH, - '${GRID}':res, - '${MEMDIR}':mem }) %} - - {% set COMIN_ATMOS_GRIB = COM_ATMOS_GRIB_GRID_TMPL | replace_tmpl(tmpl_dict) %} - -# Select pgrb and grib files to copy to the atardir - {% if path_exists(COMIN_ATMOS_GRIB) %} - {% if FHMAX_HF_GFS == 0 %} - {% for fhr in range(ofst_hr, FHMAX_GFS + FHOUT_GFS, FHOUT_GFS) %} - {% if mem=="ensstat" %} - {% set file_name = head ~ "mean.pres_." ~ res ~ ".f" ~ '%03d'|format(fhr) ~ ".grib2" %} - {% set file_path = COMIN_ATMOS_GRIB ~ "/" ~ file_name %} - - "{{ file_path | relpath(ROTDIR)}}" - {% else %} - {% set file_name = head ~ "pgrb2." ~ res ~ ".f" ~ '%03d'|format(fhr) %} - {% set file_path = COMIN_ATMOS_GRIB ~ "/" ~ file_name %} - - "{{ file_path | relpath(ROTDIR)}}" - {% set file_name = head ~ "pgrb2b." ~ res ~ ".f" ~ '%03d'|format(fhr) %} - {% set file_path = COMIN_ATMOS_GRIB ~ "/" ~ file_name %} - - "{{ file_path | relpath(ROTDIR)}}" - {% endif %} - {% endfor %} - {% else %} - {% if res == "0p25" %} - {% for fhr in range(ofst_hr, FHMAX_HF_GFS + FHOUT_HF_GFS, FHOUT_HF_GFS) %} - {% if mem=="ensstat" %} - {% set file_name = head ~ "mean.pres_." ~ res ~ ".f" ~ '%03d'|format(fhr) ~ ".grib2" %} - {% set file_path = COMIN_ATMOS_GRIB ~ "/" ~ file_name %} - - "{{ file_path | relpath(ROTDIR)}}" - {% else %} - {% set file_name = head ~ "pgrb2." ~ res ~ ".f" ~ '%03d'|format(fhr) %} - {% set file_path = COMIN_ATMOS_GRIB ~ "/" ~ file_name %} - - "{{ file_path | relpath(ROTDIR)}}" - {% set file_name = head ~ "pgrb2b." ~ res ~ ".f" ~ '%03d'|format(fhr) %} - {% set file_path = COMIN_ATMOS_GRIB ~ "/" ~ file_name %} - - "{{ file_path | relpath(ROTDIR)}}" - {% endif %} - {% endfor %} - {% endif %} - {% if res == "0p50" %} - {% for fhr in range(FHMAX_HF_GFS + FHOUT_GFS, FHMAX_GFS + FHOUT_GFS, FHOUT_GFS) %} - {% if mem=="ensstat" %} - {% set file_name = head ~ "mean.pres_." ~ res ~ ".f" ~ '%03d'|format(fhr) ~ ".grib2" %} - {% set file_path = COMIN_ATMOS_GRIB ~ "/" ~ file_name %} - - "{{ file_path | relpath(ROTDIR)}}" - {% else %} - {% set file_name = head ~ "pgrb2." ~ res ~ ".f" ~ '%03d'|format(fhr) %} - {% set file_path = COMIN_ATMOS_GRIB ~ "/" ~ file_name %} - - "{{ file_path | relpath(ROTDIR)}}" - {% set file_name = head ~ "pgrb2b." ~ res ~ ".f" ~ '%03d'|format(fhr) %} - {% set file_path = COMIN_ATMOS_GRIB ~ "/" ~ file_name %} - - "{{ file_path | relpath(ROTDIR)}}" - {% endif %} - {% endfor %} - {% endif %} - {% endif %} - {% endif %} - {% endfor %} -{% endfor %} diff --git a/parm/archive/gefs_extracted_ice.yaml.j2 b/parm/archive/gefs_extracted_ice.yaml.j2 deleted file mode 100644 index 786d502f23..0000000000 --- a/parm/archive/gefs_extracted_ice.yaml.j2 +++ /dev/null @@ -1,33 +0,0 @@ -{% set cycle_HH = current_cycle | strftime("%H") %} -{% set cycle_YMD = current_cycle | to_YMD %} -{% set cycle_YMDH = current_cycle | to_YMDH %} -{% set head = RUN + ".ice.t" + cycle_HH + "z." %} - -gefs_ice: - name: "GEFS_ICE" - target: "{{ ATARDIR }}/{{ cycle_YMDH }}/gefs_ice.tar" - required: -#select mem%03d and ensstat files required -{% set members = [] %} -{% for mem_nm in range(0, NMEM_ENS + 1) %} - {% do members.append("mem" ~ '%03d' % mem_nm ) %} -{% endfor %} - -{% for mem in members %} - {% set tmpl_dict = ({ '${ROTDIR}':ROTDIR, - '${RUN}':RUN, - '${YMD}':cycle_YMD, - '${HH}':cycle_HH, - '${MEMDIR}':mem }) %} - - {% set COMIN_ICE_HISTORY = COM_ICE_HISTORY_TMPL | replace_tmpl(tmpl_dict) %} - -# Select netcdf files to copy to the atardir - {% if path_exists(COMIN_ICE_HISTORY) %} - {% for fhr in range(FHMIN_GFS + FHOUT_ICE_GFS, FHMAX_GFS + FHOUT_ICE_GFS, FHOUT_ICE_GFS) %} - {% set file_name = head ~ FHOUT_ICE_GFS ~ "hr_avg" ~ ".f" ~ '%03d'|format(fhr) ~ ".nc" %} - {% set file_path = COMIN_ICE_HISTORY ~ "/" ~ file_name %} - - "{{ file_path | relpath(ROTDIR)}}" - {% endfor %} - {% endif %} -{% endfor %} diff --git a/parm/archive/gefs_extracted_ocean.yaml.j2 b/parm/archive/gefs_extracted_ocean.yaml.j2 deleted file mode 100644 index e5e3b36e3b..0000000000 --- a/parm/archive/gefs_extracted_ocean.yaml.j2 +++ /dev/null @@ -1,40 +0,0 @@ -{% set cycle_HH = current_cycle | strftime("%H") %} -{% set cycle_YMD = current_cycle | to_YMD %} -{% set cycle_YMDH = current_cycle | to_YMDH %} -{% set head = RUN + ".ocean.t" + cycle_HH + "z." %} - -gefs_ocean: - name: "GEFS_OCEAN" - target: "{{ ATARDIR }}/{{ cycle_YMDH }}/gefs_ocean.tar" - required: -#select mem%03d and ensstat files required -{% set members = [] %} -{% for mem_nm in range(0, NMEM_ENS + 1) %} - {% do members.append("mem" ~ '%03d' % mem_nm ) %} -{% endfor %} - -{% if OCNRES == "025" %} - {% set res = "1p00" %} -{% else %} - {% set res = (OCNRES|string())[0] ~ "p" ~ (OCNRES|string())[-2:] %} -{% endif %} - -{% for mem in members %} - {% set tmpl_dict = ({ '${ROTDIR}':ROTDIR, - '${RUN}':RUN, - '${YMD}':cycle_YMD, - '${HH}':cycle_HH, - '${MEMDIR}':mem }) %} - - {% set COMIN_OCEAN_NETCDF = COM_OCEAN_NETCDF_TMPL | replace_tmpl(tmpl_dict) %} - - # Select netcdf files to copy to the atardir - {% set netcdf_grid_dir = COMIN_OCEAN_NETCDF ~ "/" ~ res %} - {% if path_exists(netcdf_grid_dir) %} - {% for fhr in range(FHMIN_GFS + FHOUT_OCN_GFS, FHMAX_GFS + FHOUT_OCN_GFS, FHOUT_OCN_GFS) %} - {% set file_name = head ~ res ~ ".f" ~ '%03d'|format(fhr) ~ ".nc" %} - {% set file_path = netcdf_grid_dir ~ "/" ~ file_name %} - - "{{ file_path | relpath(ROTDIR)}}" - {% endfor %} - {% endif %} -{% endfor %} diff --git a/parm/archive/gefs_extracted_wave.yaml.j2 b/parm/archive/gefs_extracted_wave.yaml.j2 deleted file mode 100644 index 969fb525dd..0000000000 --- a/parm/archive/gefs_extracted_wave.yaml.j2 +++ /dev/null @@ -1,52 +0,0 @@ -{% set cycle_HH = current_cycle | strftime("%H") %} -{% set cycle_YMD = current_cycle | to_YMD %} -{% set cycle_YMDH = current_cycle | to_YMDH %} -{% set head = RUN + "wave.t" + cycle_HH + "z." %} - -gefs_wave: - name: "GEFS_WAVE" - target: "{{ ATARDIR }}/{{ cycle_YMDH }}/gefs_wave.tar" - required: -{% if REPLAY_ICS %} - {% set ofst_hr = OFFSET_START_HOUR %} -{% else %} - {% set ofst_hr = FHMIN_GFS %} -{% endif %} - -#select mem%03d and ensstat files required -{% set members = [] %} -{% for mem_nm in range(0, NMEM_ENS + 1) %} - {% do members.append("mem" ~ '%03d' % mem_nm ) %} -{% endfor %} - -{% for mem in members %} - {% set tmpl_dict = ({ '${ROTDIR}':ROTDIR, - '${RUN}':RUN, - '${YMD}':cycle_YMD, - '${HH}':cycle_HH, - '${MEMDIR}':mem }) %} - {% set COMIN_WAVE_STATION = COM_WAVE_STATION_TMPL | replace_tmpl(tmpl_dict) %} - # Select station files to copy to the atardir - {% if path_exists(COMIN_WAVE_STATION) %} - {% set file_path = COMIN_WAVE_STATION ~ "/" ~ RUN ~ "wave.t" ~ cycle_HH ~ "z.spec_tar.gz" %} - - "{{ file_path | relpath(ROTDIR)}}" - {% set file_path = COMIN_WAVE_STATION ~ "/" ~ RUN ~ "wave.t" ~ cycle_HH ~ "z.cbull_tar" %} - - "{{ file_path | relpath(ROTDIR)}}" - {% set file_path = COMIN_WAVE_STATION ~ "/" ~ RUN ~ "wave.t" ~ cycle_HH ~ "z.bull_tar" %} - - "{{ file_path | relpath(ROTDIR)}}" - {% endif %} - - # Select grib2 files to copy to the atardir - {% set WAVE_OUT_GRIDS_list = WAVE_OUT_GRIDS.split(' ') %} - {% for grd in WAVE_OUT_GRIDS_list %} - {% set tmpl_dict = tmpl_dict.update({'${GRDRESNAME}': grd}) %} - {% set file_path = COM_WAVE_GRID_RES_TMPL | replace_tmpl(tmpl_dict) %} - {% if path_exists(file_path) %} - {% for fhr in range(ofst_hr, FHMAX_GFS + FHOUT_WAV, FHOUT_WAV) %} - {% set file_name = head ~ grd ~ ".f" ~ '%03d'|format(fhr) ~ ".grib2" %} - {% set file_path = file_path ~ "/" ~ file_name %} - - "{{ file_path | relpath(ROTDIR)}}" - {% endfor %} - {% endif %} - {% endfor %} -{% endfor %} diff --git a/ush/wave_extractvars.sh b/ush/wave_extractvars.sh index 32ee44986b..3af57ef34c 100755 --- a/ush/wave_extractvars.sh +++ b/ush/wave_extractvars.sh @@ -10,6 +10,11 @@ ####################### source "${USHgfs}/preamble.sh" +source "${USHgfs}/wave_domain_grid.sh" + +process_grdID "${waveGRD}" +com_varname="COMOUT_WAVE_GRID_${GRDREGION}_${GRDRES}" +com_dir=${!com_varname} subdata=${1} @@ -18,7 +23,7 @@ subdata=${1} for (( nh = FHOUT_WAV_EXTRACT; nh <= FHMAX_WAV; nh = nh + FHOUT_WAV_EXTRACT )); do fnh=$(printf "%3.3d" "${nh}") - infile=${COMIN_WAVE_GRID}/${RUN}wave.t${cyc}z.global.${wavres}.f${fnh}.grib2 + infile=${com_dir}/${RUN}wave.t${cyc}z.global.${wavres}.f${fnh}.grib2 outfile=${subdata}/${RUN}wave.t${cyc}z.global.${wavres}.f${fnh}.grib2 rm -f "${outfile}" # Remove outfile if it already exists before extraction