Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature 952 blocking files #1023

Merged
merged 11 commits into from
Jul 22, 2021
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,13 @@
# METplus first loads all of the configuration files found in parm/metplus_config,
# then it loads any configuration files passed to METplus via the command line
# i.e. parm/use_cases/model_applications/s2s/UserScript_fcstGFS_obsERA_Blocking.py.
# The file UserScript_fcstGFS_obsERA_Blocking.conf runs the python program, however
# UserScript_fcstGFS_obsERA_Blocking/Blocking_fcstGFS_obsERA.conf sets the variables
# for all steps of the Blocking use case including data paths.
# The file UserScript_fcstGFS_obsERA_Blocking.conf runs the python program, and the
# variables for all steps of the Blocking calculation are given in the [user_env_vars]
# section of the .conf file.
#
# .. highlight:: bash
# .. literalinclude:: ../../../../parm/use_cases/model_applications/s2s/UserScript_fcstGFS_obsERA_Blocking.conf
#

##############################################################################
# MET Configuration
Expand Down Expand Up @@ -159,7 +160,10 @@
# for the steps requested. This may include the regridded data, daily averaged files, running mean files,
# and anomaly files. In addition, output CBL, IBL, and Blocking frequency plots can be generated. The location
# of these output plots can be specified as BLOCKING_PLOT_OUTPUT_DIR. If it is not specified, plots will be sent
# to model_applications/s2s/Blocking/plots (relative to **OUTPUT_BASE**).
# to OUTPUT_BASE/plots. MET format matched pair output will also be generated for IBLs and blocks if a user runs
# these steps on both the model and observation data. The location the matched pair output can be specified as
# BLOCKING_MPR_OUTPUT_DIR. If it is not specified, plots will be sent to OUTPUT_BASE/mpr.
#

##############################################################################
# Keywords
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,15 @@
# Scientific Objective
# --------------------
#
# To compute the Central Blocking Latitude, Instantaneously blocked latitudes,
# Group Instantaneously blocked latitudes, and the frequency of atmospheric
# blocking using the Pelly-Hoskins Method.
# To compute the frequency of blocking using the Pelly-Hoskins method. Specifically
# the blocking calculation consits of computing the Central Blocking Latitude (CBL),
# Instantaneousy blocked latitudes (IBL), Group Instantaneousy blocked latitudes (GIBL),
# and the frequency of atmospheric blocking. The CBL calculation had an option to use an
# observed climatology.
#
# The following reference contains the specific equations and methodology used to compute
# blocking:
#

##############################################################################
# Datasets
Expand Down Expand Up @@ -69,6 +75,7 @@
# steps (CBL, PLOTCBL, IBL, PLOTIBL, GIBL, CALCBLOCKS, PLOTBLOCKS), omitting the regridding,
# time averaging, running mean, and anomaly pre-processing steps. However, the configurations
# for pre-processing are available for user reference.
#

##############################################################################
# METplus Configuration
Expand All @@ -77,12 +84,13 @@
# METplus first loads all of the configuration files found in parm/metplus_config,
# then it loads any configuration files passed to METplus via the command line
# i.e. parm/use_cases/model_applications/s2s/UserScript_obsERA_obsOnly_Blocking.py.
# The file UserScript_obsERA_obsOnly_Blocking.conf runs the python program, however
# UserScript_obsERA_obsOnly_Blocking/Regrid_PCP_obsERA_obsOnly_Blocking.conf sets the
# variables for all steps of the Blocking use case.
# The file UserScript_obsERA_obsOnly_Blocking.conf runs the python program, and the
# variables for all steps of the Blocking use case are set in the [user_env_vars]
# section.
#
# .. highlight:: bash
# .. literalinclude:: ../../../../parm/use_cases/model_applications/s2s/UserScript_obsERA_obsOnly_Blocking.conf
#

##############################################################################
# MET Configuration
Expand All @@ -94,8 +102,8 @@
# See the following files for more information about the environment variables set in this configuration file.
#
# parm/use_cases/met_tool_wrapper/RegridDataPlane/RegridDataPlane.py
# parm/use_cases/met_tool_wrapper/PCPCombine/PCPCOmbine_derive.py
# parm/use_cases/met_tool_wrapper/PCPCombine/PCPCOmbine_subtract.py
# parm/use_cases/met_tool_wrapper/PCPCombine/PCPCombine_derive.py
# parm/use_cases/met_tool_wrapper/PCPCombine/PCPCombine_subtract.py

##############################################################################
# Python Scripts
Expand All @@ -104,9 +112,7 @@
# This use case uses Python scripts to perform the blocking calculation
#
# parm/use_cases/model_applications/s2s/UserScript_obsERA_obsOnly_Blocking/Blocking_driver.py:
# This script calls the requested steps in the blocking analysis for a forecast, observation, or both. The possible
# steps are computing CBLs, plotting CBLs, computing IBLs, plotting IBLs, computing GIBLs, computing blocks, and
# plotting blocks.
# This script calls the requested steps in the blocking analysis for a forecast, observation, or both.
#
# parm/use_cases/model_applications/s2s/UserScript_obsERA_obsOnly_Blocking/Blocking.py:
# This script runs the requested steps, containing the code for computing CBLs, computing IBLs, computing GIBLs,
Expand Down Expand Up @@ -160,7 +166,10 @@
# for the steps requested. This may include the regridded data, daily averaged files, running mean files,
# and anomaly files. In addition, output CBL, IBL, and Blocking frequency plots can be generated. The location
# of these output plots can be specified as BLOCKING_PLOT_OUTPUT_DIR. If it is not specified, plots will be sent
# to model_applications/s2s/Blocking/plots (relative to **OUTPUT_BASE**).
# to OUTPUT_BASE/plots. MET format matched pair output will also be generated for IBLs and blocks if a user runs
# these steps on both the model and observation data. The location the matched pair output can be specified as
# BLOCKING_MPR_OUTPUT_DIR. If it is not specified, plots will be sent to OUTPUT_BASE/mpr.
#

##############################################################################
# Keywords
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,21 @@ LOOP_ORDER = processes
# location of configuration files used by MET applications
CONFIG_DIR={PARM_BASE}/use_cases/model_applications/s2s

OBS_ANOM_INPUT_DIR = {INPUT_BASE}/model_applications/s2s/UserScript_fcstGFS_obsERA_Blocking/ERA/Anomaly
OBS_ANOM_INPUT_TEMPLATE = Z500_anomaly_{valid?fmt=%Y%m%d}_NH.nc
OBS_ANOM_OUTPUT_DIR = {OBS_ANOM_INPUT_DIR}
OBS_ANOM_OUTPUT_TEMPLATE = ERA_anom_files_lead{lead?fmt=%HHH}.txt

OBS_AVE_INPUT_DIR = {INPUT_BASE}/model_applications/s2s/UserScript_fcstGFS_obsERA_Blocking/ERA/Daily
OBS_AVE_INPUT_TEMPLATE = Z500_daily_{valid?fmt=%Y%m%d}_NH.nc
OBS_AVE_OUTPUT_DIR = {OBS_AVE_INPUT_DIR}
OBS_AVE_OUTPUT_TEMPLATE = ERA_daily_files_lead{lead?fmt=%HHH}.txt

FCST_AVE_INPUT_DIR = {INPUT_BASE}/model_applications/s2s/UserScript_fcstGFS_obsERA_Blocking/FV3GFS/Daily
FCST_AVE_INPUT_TEMPLATE = Z500_daily_{init?fmt=%Y%m%d}_{lead?fmt=%HHH}_NH.nc
FCST_AVE_OUTPUT_DIR = {FCST_AVE_INPUT_DIR}
FCST_AVE_OUTPUT_TEMPLATE = GFS_daily_files_lead{lead?fmt=%HHH}.txt


# Forecast Regridding to 1 degree using regrid_data_plane
[regrid_fcst]
Expand Down Expand Up @@ -342,7 +357,6 @@ OBS_PCP_COMBINE_INPUT_TEMPLATE = Z500_daily_{valid?fmt=%Y%m%d}_NH.nc
OBS_PCP_COMBINE_OUTPUT_TEMPLATE = {OBS_ANOM_INPUT_TEMPLATE}


# Get a File list for the Obs CBL files (anomaly files)
# This is run separately since it has different start/end times
[create_cbl_filelist]
# Find the files for each lead time
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -213,9 +213,6 @@ DAYS_PER_SEASON = 90
# Make the OUTPUT_BASE available to the UserScript
SCRIPT_OUTPUT_BASE = {OUTPUT_BASE}

# Boolean indicating whether to keep the above 2 text files or delete them at the end of the run
KEEP_CBL_FILE_LISTING = True

# Variable Name for the Z500 anomaly data to read in to the blocking python code
OBS_BLOCKING_ANOMALY_VAR = Z500_ANA

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#! /usr/bin/env python
georgemccabe marked this conversation as resolved.
Show resolved Hide resolved

import os
import sys

input_file = sys.argv[1]
output_file = sys.argv[2]

filelist = open(output_file,'a+')
if os.path.isfile(input_file):
filelist.write(input_file + '\n')
else:
filelist.write('\n')
filelist.close()
6 changes: 6 additions & 0 deletions system.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[dir]
INPUT_BASE = /glade/scratch/kalb/Blocking/METplus
OUTPUT_BASE = /glade/scratch/kalb/Blocking/METplus/model_applications
STAGING_DIR={OUTPUT_BASE}/stage
MET_INSTALL_DIR = /glade/p/ral/jntp/MET/MET_releases/9.1
TMP_DIR = {OUTPUT_BASE}/tmp