Skip to content

Commit

Permalink
Merge pull request #328 from grantfirl/release/public-v6_gjf
Browse files Browse the repository at this point in the history
Last minor tweaks to release code...
  • Loading branch information
grantfirl authored Jun 23, 2022
2 parents ecf7a9f + 3e12330 commit 2497b45
Show file tree
Hide file tree
Showing 21 changed files with 728 additions and 217 deletions.
2 changes: 1 addition & 1 deletion contrib/get_all_static_data.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ for file in "${data_files[@]}"; do
mkdir -p $BASEDIR/scm/data/$file
cd $BASEDIR/scm/data/$file
echo "Retrieving $file"
wget https://github.com/NCAR/ccpp-scm/releases/download/v5.1.0/${file}.tar.gz
wget https://github.com/NCAR/ccpp-scm/releases/download/v6.0.0/${file}.tar.gz
tar -xf ${file}.tar.gz
rm -f ${file}.tar.gz
done
Expand Down
2 changes: 1 addition & 1 deletion contrib/get_mg_inccn_data.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ BASEDIR=$MYDIR/..

# Change to directory containing the physics input data, download and extract archive
cd $BASEDIR/scm/data/physics_input_data/
wget https://github.com/NCAR/ccpp-scm/releases/download/v5.0.0-alpha/MG_INCCN_data.tar
wget https://github.com/NCAR/ccpp-scm/releases/download/v6.0.0/MG_INCCN_data.tar
tar -xvf MG_INCCN_data.tar
rm -f MG_INCCN_data.tar
cd $BASEDIR/
Expand Down
6 changes: 3 additions & 3 deletions contrib/get_thompson_tables.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ BASEDIR=$MYDIR/..

# Change to directory containing the physics input data, download and extract archive
cd $BASEDIR/scm/data/physics_input_data/
wget https://github.com/NCAR/ccpp-scm/releases/download/v5.0.0/thompson_tables2.tar
tar -xvf thompson_tables2.tar
rm -f thompson_tables2.tar
wget https://github.com/NCAR/ccpp-scm/releases/download/v6.0.0/thompson_tables.tar
tar -xvf thompson_tables.tar
rm -f thompson_tables.tar
cd $BASEDIR/

2 changes: 1 addition & 1 deletion scm/doc/TechGuide/acknow.tex
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
\vspace*{1cm}\par
For referencing this document please use:\\
\vspace*{1cm}\par
Firl, G., L. Carson, L. Bernardet, D. Heinzeller, and M. Harrold, 2021. Common Community Physics Package Single Column Model v5.0.0 User and Technical Guide. 39pp. Available at https://dtcenter.org/GMTB/v5.0.0/scm-ccpp-guide-v5.0.0.pdf
Firl, G., D. Swales, L. Carson, L. Bernardet, D. Heinzeller, and M. Harrold, 2021. Common Community Physics Package Single Column Model v6.0.0 User and Technical Guide. 39pp. Available at https://dtcenter.org/GMTB/v6.0.0/scm-ccpp-guide-v6.0.0.pdf

\end{flushleft}
\end{titlepage}
Expand Down
58 changes: 23 additions & 35 deletions scm/doc/TechGuide/chap_cases.tex
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,10 @@ \subsection{Case configuration namelist parameters}
\label{subsection: case config}
The \execout{case\_config} namelist expects the following parameters:
\begin{itemize}
\item \execout{model\_name}
\begin{itemize}
\item This controls which vertical coordinates to use. Valid values are \exec{'FV3'} or \exec{`GFS'}. Here, \exec{`GFS'} refers to vertical coordinates used in the GSM.
\end{itemize}
\item \execout{n\_columns}
\begin{itemize}
\item The code can be used to run a single column or multiple \emph{independent} columns using the same or different physics suites. Specify an integer, \exec{n}. NOTE: As of this release, only \execout{n\_columns} $= 1$ is supported.
\end{itemize}
\item \execout{vert\_coord\_file}
\begin{itemize}
\item File containing FV3 vertical grid coefficients.
\end{itemize}
\item \execout{case\_name}
\begin{itemize}
\item Identifier for which dataset (initialization and forcing) to load. This string must correspond to a dataset included in the directory \execout{ccpp-scm/scm/data/processed\_case\_input/} (without the file extension).
Expand Down Expand Up @@ -44,18 +40,6 @@ \subsection{Case configuration namelist parameters}
\begin{itemize}
\item A string representing the path (relative to the build directory) to which output should be written. (OPTIONAL)
\end{itemize}
\item \execout{output\_file}
\begin{itemize}
\item A string representing the name of the NetCDF output file to be written (no \exec{.nc} extension expected).
\end{itemize}
\item \execout{case\_data\_dir}
\begin{itemize}
\item A string representing the path (relative to the build directory) where case initialization and forcing data files can be found.
\end{itemize}
\item \execout{vert\_coord\_data\_dir}
\begin{itemize}
\item A string representing the path (relative to the build directory) where vertical coordinate data files can be found (for \execout{model\_name}=\exec{`GFS'} only).
\end{itemize}
\item \execout{thermo\_forcing\_type}
\begin{itemize}
\item An integer representing how forcing for temperature and moisture state variables is applied (1 $=$ total advective tendencies, 2 $=$ horizontal advective tendencies with prescribed vertical motion, 3 $=$ relaxation to observed profiles with vertical motion prescribed)
Expand Down Expand Up @@ -112,19 +96,33 @@ \subsection{Case configuration namelist parameters}
\begin{itemize}
\item An integer representing the grid size of the UFS atmosphere initial conditions; the integer represents the number of grid points in each horizontal direction of each cube tile
\end{itemize}
\item \execout{input\_type}
\begin{itemize}
\item 0 => original DTC format, 1 => DEPHY-SCM format.
\end{itemize}
\end{itemize}

\subsection{Case input data file}
\subsection{Case input data file (CCPP-SCM format)}
\label{subsection: case input}

The initialization and forcing data for each case is stored in a NetCDF (version 4) file within the \execout{ccpp-scm/scm/data/processed\_case\_input} directory. Each file has two dimensions (\execout{time} and \execout{levels}) and is organized into 3 groups: scalars, initial, and forcing. Not all fields are required for all cases. For example the fields \execout{sh\_flux\_sfc} and \execout{lh\_flux\_sfc} are only needed if the variable \execout{sfc\_flx\_spec} $=$ \exec{.true.} in the case configuration file and state nudging variables are only required if \execout{thermo\_forcing\_type} $=$ \exec{3} or \execout{mom\_forcing\_type} $=$ \exec{3}. Using an active LSM (Noah, NoahMP, RUC) requires many more variables than are listed here. Example files for using with Noah and NoahMP LSMs are included in \execout{ccpp-scm/scm/data/processed\_case\_input/fv3\_model\_point\_noah[mp].nc}.

\lstinputlisting[
basicstyle=\scriptsize\ttfamily,
label=lst_case_input_netcdf_header,
caption=example NetCDF file header for case initialization and forcing data
caption=example NetCDF file (CCPP-SCM format) header for case initialization and forcing data
]{./arm_case_header.txt}

\subsection{Case input data file (DEPHY format)}
\label{subsection: case input dephy}
The Development and Evaluation of Physics in atmospheric models (DEPHY) format is an internationally adopted data format intended for use by SCM and LESs. The initialization and forcing data for each case is stored in a NetCDF (version 4) file within the \execout{ccpp-scm/scm/data/processed\_case\_input} directory. Each file has four dimensions (\execout{time}, \execout{levels}, \execout{longitude}, \execout{latitude}) and contains the initial conditions and forcing data. Just as when using the CCPP-SCM formatted inputs, \ref{subsection: case input}, not all fields are required for all cases. More information on the DEPHY format requirements can be found at \href{https://github.com/GdR-DEPHY/DEPHY-SCM}{DEPHY}

\lstinputlisting[
basicstyle=\scriptsize\ttfamily,
label=lst_case_input_netcdf_header,
caption=example NetCDF file (DEPHY format) header for case initialization and forcing data
]{./dephy_case_header.txt}

\section{Included Cases}
Several cases are included in the repository to serve as examples for users to create their own and for basic research. All case configuration namelist files for included cases can be found in \execout{ccpp-scm/scm/etc/case\_config} and represent the following observational field campaigns:
\begin{itemize}
Expand All @@ -143,7 +141,7 @@ \section{Included Cases}

\section{How to set up new cases}

Setting up a new case involves preparing the two types of files listed above. For the case initialization and forcing data file, this typically involves writing a custom script or program to parse the data from its original format to the format that the SCM expects, listed above. An example of this type of script written in Python is included in \execout{/ccpp-scm/scm/etc/scripts/twpice\_forcing\_file\_generator.py}. The script reads in the data as supplied from its source, converts any necessary variables, and writes a NetCDF (version 4) file in the format described in subsection \ref{subsection: case input}. For reference, the following formulas are used:
Setting up a new case involves preparing the two types of files listed above. For the case initialization and forcing data file, this typically involves writing a custom script or program to parse the data from its original format to the format that the SCM expects, listed above. An example of this type of script written in Python is included in \execout{/ccpp-scm/scm/etc/scripts/twpice\_forcing\_file\_generator.py}. The script reads in the data as supplied from its source, converts any necessary variables, and writes a NetCDF (version 4) file in the format described in subsections \ref{subsection: case input} and \ref{subsection: case input dephy}. For reference, the following formulas are used:
\begin{equation}
\theta_{il} = \theta - \frac{\theta}{T}\left(\frac{L_v}{c_p}q_l + \frac{L_s}{c_p}q_i\right)
\end{equation}
Expand Down Expand Up @@ -187,7 +185,7 @@ \section{How to set up new cases}

For the case configuration file, it is most efficient to copy an existing file in \execout{ccpp-scm/scm/etc/case\_config} and edit it to suit one's case. Recall from subsection \ref{subsection: case config} that this file is used to configure the SCM framework parameters for a given case. Be sure to check that model timing parameters such as the time step and output frequency are appropriate for the physics suite being used. There is likely some stability criterion that governs the maximum time step based on the chosen parameterizations and number of vertical levels (grid spacing). The \execout{case\_name} parameter should match the name of the case input data file that was configured for the case (without the file extension). The \execout{runtime} parameter should be less than or equal to the length of the forcing data unless the desired behavior of the simulation is to proceed with the last specified forcing values after the length of the forcing data has been surpassed. The initial date and time should fall within the forcing period specified in the case input data file. If the case input data is specified to a lower altitude than the vertical domain, the remainder of the column will be filled in with values from a reference profile. There is a tropical profile and mid-latitude summer profile provided, although one may add more choices by adding a data file to \execout{ccpp-scm/scm/data/processed\_case\_input} and adding a parser section to the subroutine \execout{get\_reference\_profile} in \execout{-scm/scm/src/scm\_input.f90}. Surface fluxes can either be specified in the case input data file or calculated using a surface scheme using surface properties. If surface fluxes are specified from data, set \execout{sfc\_flux\_spec} to \exec{.true.} and specify \execout{sfc\_roughness\_length\_cm} for the surface over which the column resides. Otherwise, specify a \execout{sfc\_type}. In addition, one must specify a \execout{column\_area} for each column.

To control the forcing method, one must choose how the momentum and scalar variable forcing are applied. The three methods of Randall and Cripe (1999, JGR) have been implemented: ``revealed forcing'' where total (horizontal $+$ vertical) advective tendencies are applied (type 1), ``horizontal advective forcing'' where horizontal advective tendencies are applied and vertical advective tendencies are calculated from a prescribed vertical velocity and the calculated (modeled) profiles (type 2), and ``relaxation forcing'' where nudging to observed profiles replaces horizontal advective forcing combined with vertical advective forcing from prescribed vertical velocity (type 3). If relaxation forcing is chosen, a \execout{relaxation\_time} that represents the timescale over which the profile would return to the nudging profiles must be specified.
To control the forcing method, one must choose how the momentum and scalar variable forcing are applied. The three methods of Randall and Cripe (1999, JGR) have been implemented: ``revealed forcing'' where total (horizontal $+$ vertical) advective tendencies are applied (type 1), ``horizontal advective forcing'' where horizontal advective tendencies are applied and vertical advective tendencies are calculated from a prescribed vertical velocity and the calculated (modeled) profiles (type 2), and ``relaxation forcing'' where nudging to observed profiles replaces horizontal advective forcing combined with vertical advective forcing from prescribed vertical velocity (type 3). If relaxation forcing is chosen, a \execout{relax\_time} that represents the timescale over which the profile would return to the nudging profiles must be specified.

\section{Using other LASSO cases}
\label{sec:lasso}
Expand All @@ -208,16 +206,6 @@ \section{Using UFS Initial Conditions}

A script exists in \execout{scm/etc/scripts/UFS\_IC\_generator.py} to read in UFS Atmosphere cold start initial conditions and generate a case input data file that the SCM can use. Note that the script requires a few python packages that may not be found by default in all python installations: \exec{argparse}, \exec{fnmatch}, \exec{logging}, \exec{NetCDF4}, \exec{numpy}, \exec{shapely}, \exec{f90nml}, and \exec{re}.

NOTE: If using NOAA's Hera HPC, the \execout{shapely} python package does not seem to be installed with the version of Anaconda used by the rest of this software package by default so it is installed when users execute \execout{scm/etc/Hera\_setup\_intel.[csh/sh]}.

Users on other systems can test if \execout{shapely} is installed using this command in the shell:
\begin{lstlisting}
python -c "import shapely"
\end{lstlisting}
If \execout{shapely} is installed, this command will succeed silently, otherwise an \execout{ImportError: No module named shapely} will be printed to screen. To install the \execout{shapely} Python module, use the install method preferred for your Python environment (\execout{easy\_install}, \execout{pip}, \execout{conda}, \dots).

The \execout{UFS\_IC\_generator.py} script usage is as follows:

\begin{lstlisting}[language=bash]
./UFS_IC_generator.py [-h] (-l LOCATION LOCATION | -ij INDEX INDEX) -d
DATE -i IN_DIR -g GRID_DIR [-t {1,2,3,4,5,6}]
Expand Down Expand Up @@ -255,5 +243,5 @@ \section{Using UFS Initial Conditions}

Running the model is the same as for observational field campaign cases:
\begin{lstlisting}[language=bash]
./run_scm.py -c fv3_model_point_noah -s SCM_GFS_v15p2
./run_scm.py -c fv3_model_point_noah -s SCM_GFS_v16
\end{lstlisting}
Loading

0 comments on commit 2497b45

Please sign in to comment.