Skip to content

Commit d6ca51c

Browse files
[develop] Update description blocks for ush files (NOAA-EMC#4791)
When re-examining issue 299, there were several files in ush that were found to have a missing documentation/descriptor block. This PR adds a description block to several files, and also removes a file that appears to be unused since GFSv15
1 parent f4f3892 commit d6ca51c

18 files changed

Lines changed: 208 additions & 86 deletions

ush/WAM_XML_to_ASCII.pl

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,17 @@
11
#!/usr/bin/env perl
2+
3+
#===============================================================================
4+
#
5+
# FILE: WAM_XML_to_ASCII.pl
6+
#
7+
# DESCRIPTION: Parses space weather data (F10.7 and Kp indices) from an XML
8+
# input file (wam_input2.xsd) and converts it into a formatted
9+
# ASCII text file (wam_input.asc) suitable for downstream processing.
10+
#
11+
# INPUT: wam_input2.xsd (Expected to contain 'issue-date',
12+
# 'f10-81-avg-currentday', and an array of 'data-item' nodes).
13+
# OUTPUT: wam_input.asc (Formatted ASCII table containing 56 records of
14+
# Date_Time, F10, Kp, F10Flag, and KpFlag).
215
use strict;
316
use warnings;
417

ush/atmos_ensstat.sh

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,24 @@
11
#! /usr/bin/env bash
22

3+
#===============================================================================
4+
#
5+
# FILE: atmos_ensstat.sh
6+
#
7+
# DESCRIPTION: This script processes ensemble forecast output for a specific
8+
# grid and forecast hour. It collects atmospheric GRIB2 files
9+
# for all ensemble members, dynamically generates a namelist,
10+
# and executes `ensstat.x` to compute the ensemble mean and
11+
# spread. Finally, it indexes the outputs using wgrib2, moves
12+
# them to the designated COM directory, and issues DBN alerts.
13+
# ARGUMENTS:
14+
# $1 - grid : The grid resolution/identifier (e.g., 0p25, 1p00).
15+
# $2 - fhr3 : The 3-digit forecast hour (e.g., 012, 024).
16+
# $3 - grid_type : (Optional) Grid type identifier (defaults to empty).
17+
#
18+
# OUTPUTS:
19+
# Produces mean and spread GRIB2 files and their corresponding .idx
20+
# inventory files in the configured COMOUT directory.
21+
322
grid=${1}
423
fhr3=${2}
524
grid_type=${3:-''}

ush/forecast_det.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
11
#! /usr/bin/env bash
22

3+
#===============================================================================
4+
#
5+
# FILE: forecast_det.sh
6+
#
7+
# DESCRIPTION: Determines the run type (Cold Start, Warm Start, or Re-run)
8+
# for the Unified Forecast System (UFS). It evaluates the
9+
# availability of required restart files across all coupled model
10+
# components and atmospheric initial conditions. Based on this availability, it sets the
11+
# appropriate logical flags and environment variables to guide downstream model initialization.
12+
313
# Disable variable not used warnings
414
# shellcheck disable=SC2034
515
UFS_det() {

ush/forecast_postdet.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
11
#! /usr/bin/env bash
22

3+
#===============================================================================
4+
#
5+
# FILE: forecast_postdet.sh
6+
#
7+
# DESCRIPTION: A suite of handler functions for managing the data flow and
8+
# configuration of various Unified Forecast System (UFS)
9+
# coupled components. It handles the staging of initial conditions,
10+
# namelist generation, and output/restart file management for:
11+
# FV3 (Atmosphere), WW3 (Waves), MOM6 (Ocean), CICE (Sea Ice),
12+
# GOCART (Aerosols), and CMEPS (Coupler/Mediator)
13+
314
# Disable variable not used warnings
415
# shellcheck disable=SC2034
516
# shellcheck disable=SC2178

ush/forecast_predet.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
11
#! /usr/bin/env bash
22

3+
#===============================================================================
4+
#
5+
# FILE: forecast_predet.sh
6+
#
7+
# DESCRIPTION: A library of utility functions for the Unified Forecast System (UFS).
8+
# This script defines date/time calculation utilities and component-specific setup
9+
# functions. These setup functions initialize environment variables, configure directory
10+
# structures, establish temporal domains (e.g., forecast hours,
11+
# output frequencies), and stage requisite static/fix files
12+
# prior to the run-type determination (warm vs. cold start).
13+
314
to_seconds() {
415
# Function to convert HHMMSS to seconds since 00Z
516
local hhmmss hh mm ss seconds padded_seconds

ush/fv3gfs_remap_weights.sh

Lines changed: 0 additions & 83 deletions
This file was deleted.

ush/getdump.sh

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,21 @@
11
#! /usr/bin/env bash
22

3+
#===============================================================================
4+
#
5+
# FILE: getdump.sh
6+
#
7+
# DESCRIPTION: This script copies observational data dump files from a source
8+
# dump directory to a target runtime directory for a specific
9+
# model run, cycle time, and component. It strictly requires the
10+
# presence of the status file (updated.status.tm00.bufr_d) to
11+
# ensure the dump is complete before initiating the copy process.
12+
# ARGUMENTS:
13+
# $1 - YMD : Date of the cycle in YYYYMMDD format.
14+
# $2 - HH : Hour of the cycle (e.g., 00, 06, 12, 18).
15+
# $3 - RUN : Model run identifier (e.g., gfs, gdas).
16+
# $4 - SOURCE_DIR : (Optional) Override for the source dump directory.
17+
# $5 - TARGET_DIR : (Optional) Override for the target runtime directory.
18+
319
COMPONENT=${COMPONENT:-atmos}
420

521
YMD=${1:-""}

ush/getioda.sh

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,24 @@
11
#! /usr/bin/env bash
22

3+
#===============================================================================
4+
#
5+
# FILE: get_ioda.sh
6+
#
7+
# DESCRIPTION: This script transfers multi-component observational data dumps
8+
# (e.g., IODA files) from a source staging directory to the target
9+
# model runtime directory. It dynamically loops through all
10+
# available component subdirectories (e.g., atmos, ocean, land),
11+
# verifies the presence of a completion status log (*status.log)
12+
# for each component, and copies the relevant cycle-prefixed files.
13+
#
14+
#
15+
# ARGUMENTS:
16+
# $1 - YMD : Date of the cycle in YYYYMMDD format.
17+
# $2 - HH : Hour of the cycle (e.g., 00, 06, 12, 18).
18+
# $3 - RUN : Model run identifier (e.g., gfs, gdas).
19+
# $4 - SOURCE_DIR : (Optional) Override for the source IODA dump directory.
20+
# $5 - TARGET_DIR : (Optional) Override for the target runtime directory.
21+
322
YMD=${1:-""}
423
HH=${2:-""}
524
RUN=${3:-""}

ush/make_tif.sh

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
#! /usr/bin/env bash
2-
2+
#===============================================================================
3+
#
4+
# FILE: make_tif.sh
5+
#
6+
# DESCRIPTION: This script converts an input GIF graphic into a TIF format
7+
# using ImageMagick. If configured, it then prepends a standard
8+
# NOAA Telecommunications (NTC) header (WMO: QTUA11, ORIG: KWBC)
9+
# using a Perl utility. Finally, it copies the formatted file to
10+
# the operational WMO COM directory and issues a DBN alert for
11+
# downstream distribution.
312
cd "${DATA}" || exit 2
413

514
outname=out.tif

ush/module-setup.sh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,16 @@
11
#!/bin/bash
2+
3+
#===============================================================================
4+
#
5+
# FILE: module-setup.sh
6+
#
7+
# DESCRIPTION: This script initializes the environment module system (e.g., Lmod)
8+
# and establishes a clean baseline by purging or resetting currently
9+
# loaded modules. It dynamically adapts to the host machine by
10+
# sourcing a detection script and applying the correct initialization
11+
# paths and default module parameters for various supported HPC
12+
# and cloud platforms.
13+
214
set -u
315

416
source "${HOMEglobal}/ush/detect_machine.sh"

0 commit comments

Comments
 (0)