Skip to content

Commit

Permalink
Merge branch 'develop' into feature/dev-wcoss2
Browse files Browse the repository at this point in the history
* develop:
  Add initial config files for global aerosol DA (#986)
  Update diag table to remove wav-ocn coupling fields (#979)
  use a robust Findwgrib2.cmake to find wgrib2 built w/ native wgrib2 build (#970)
  • Loading branch information
KateFriedman-NOAA committed Aug 22, 2022
2 parents 2b20ea5 + 8a62c3a commit 83254fd
Show file tree
Hide file tree
Showing 13 changed files with 215 additions and 27 deletions.
11 changes: 11 additions & 0 deletions env/HERA.env
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ if [ $# -ne 1 ]; then
echo "Must specify an input argument to set runtime environment variables!"
echo "argument can be any one of the following:"
echo "atmanalrun atmensanalrun"
echo "aeroanlrun"
echo "anal sfcanl fcst post vrfy metp"
echo "eobs eupd ecen efcs epos"
echo "postsnd awips gempak"
Expand Down Expand Up @@ -75,6 +76,16 @@ elif [ $step = "atmensanalrun" ]; then
[[ $NTHREADS_ATMENSANAL -gt $nth_max ]] && export NTHREADS_ATMENSANAL=$nth_max
export APRUN_ATMENSANAL="$launcher -n $npe_atmensanalrun"

elif [ $step = "aeroanlrun" ]; then

export APRUNCFP="$launcher -n \$ncmd --multi-prog"

nth_max=$(($npe_node_max / $npe_node_aeroanlrun))

export NTHREADS_AEROANL=${nth_aeroanlrun:-$nth_max}
[[ $NTHREADS_AEROANL -gt $nth_max ]] && export NTHREADS_AEROANL=$nth_max
export APRUN_AEROANL="$launcher -n $npe_aeroanlrun"

elif [ $step = "anal" ]; then

export MKL_NUM_THREADS=4
Expand Down
11 changes: 11 additions & 0 deletions env/ORION.env
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ if [ $# -ne 1 ]; then
echo "Must specify an input argument to set runtime environment variables!"
echo "argument can be any one of the following:"
echo "atmanalrun atmensanalrun"
echo "aeroanlrun"
echo "anal sfcanl fcst post vrfy metp"
echo "eobs eupd ecen efcs epos"
echo "postsnd awips gempak"
Expand Down Expand Up @@ -74,6 +75,16 @@ elif [ $step = "atmensanalrun" ]; then
[[ $NTHREADS_ATMENSANAL -gt $nth_max ]] && export NTHREADS_ATMENSANAL=$nth_max
export APRUN_ATMENSANAL="$launcher -n $npe_atmensanalrun"

elif [ $step = "aeroanlrun" ]; then

export APRUNCFP="$launcher -n \$ncmd --multi-prog"

nth_max=$(($npe_node_max / $npe_node_aeroanlrun))

export NTHREADS_AEROANL=${nth_aeroanlrun:-$nth_max}
[[ $NTHREADS_AEROANL -gt $nth_max ]] && export NTHREADS_AEROANL=$nth_max
export APRUN_AEROANL="$launcher -n $npe_aeroanlrun"

elif [ $step = "anal" ]; then

export MKL_NUM_THREADS=4
Expand Down
2 changes: 1 addition & 1 deletion jobs/rocoto/arch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ if [ $CDUMP = "gfs" ]; then
fi

if [ $DO_OCN = "YES" ]; then
targrp_list="$targrp_list ocn_ice_grib2_0p5 ocn_ice_grib2_0p25 ocn_2D ocn_3D ocn_xsect ocn_daily wavocn gfs_flux_1p00"
targrp_list="$targrp_list ocn_ice_grib2_0p5 ocn_ice_grib2_0p25 ocn_2D ocn_3D ocn_xsect ocn_daily gfs_flux_1p00"
fi

if [ $DO_ICE = "YES" ]; then
Expand Down
17 changes: 17 additions & 0 deletions parm/config/config.aeroanl
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/bash -x

########## config.aeroanl ##########
# configuration common to all aero analysis tasks

echo "BEGIN: config.aeroanl"

export OBS_YAML_DIR=$HOMEgfs/sorc/gdas.cd/parm/aero/obs/config/
export OBS_LIST=$HOMEgfs/sorc/gdas.cd/parm/aero/obs/lists/aero_prototype.yaml
export AEROVARYAML=$HOMEgfs/sorc/gdas.cd/parm/aero/variational/3dvar_dripcg.yaml
export BERROR_YAML=$HOMEgfs/sorc/gdas.cd/parm/aero/berror/static_bump.yaml
export FV3JEDI_FIX=$HOMEgfs/fix/fix_jedi

export io_layout_x=1
export io_layout_y=1

echo "END: config.aeroanl"
10 changes: 10 additions & 0 deletions parm/config/config.aeroanlfinal
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash -x

########## config.aeroanlfinal ##########
# Post Aero Analysis specific

echo "BEGIN: config.aeroanlfinal"

# Get task specific resources
. $EXPDIR/config.resources aeroanlfinal
echo "END: config.aeroanlfinal"
10 changes: 10 additions & 0 deletions parm/config/config.aeroanlinit
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash -x

########## config.aeroanlinit ##########
# Pre Aero Analysis specific

echo "BEGIN: config.aeroanlinit"

# Get task specific resources
. $EXPDIR/config.resources aeroanlinit
echo "END: config.aeroanlinit"
14 changes: 14 additions & 0 deletions parm/config/config.aeroanlrun
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/bash -x

########## config.aeroanlrun ##########
# Aerosol Analysis specific

echo "BEGIN: config.aeroanlrun"

# Get task specific resources
. $EXPDIR/config.resources aeroanlrun

# Task specific variables
export JEDIVAREXE=$HOMEgfs/exec/fv3jedi_var.x

echo "END: config.aeroanlrun"
42 changes: 42 additions & 0 deletions parm/config/config.resources
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ if [ $# -ne 1 ]; then
echo "getic init coupled_ic aerosol_init"
echo "atmanalprep atmanalrun atmanalpost"
echo "atmensanalprep atmensanalrun atmensanalpost"
echo "aeroanlinit aeroanlrun aeroanlfinal"
echo "anal sfcanl analcalc analdiag gldas fcst post vrfy metp arch echgres"
echo "eobs ediag eomg eupd ecen esfc efcs epos earc"
echo "init_chem mom6ic ocnpost"
Expand Down Expand Up @@ -156,6 +157,47 @@ elif [ $step = "atmanalpost" ]; then
export nth_atmanalpost=1
export npe_node_atmanalpost=$(echo "$npe_node_max / $nth_atmanalpost" | bc)

elif [ $step = "aeroanlinit" ]; then

export wtime_aeroanlinit="00:10:00"
export npe_aeroanlinit=1
export nth_aeroanlinit=1
export npe_node_aeroanlinit=$(echo "$npe_node_max / $nth_aeroanlinit" | bc)
export memory_aeroanlinit="3072M"

elif [ $step = "aeroanlrun" ]; then

case $CASE in
C768)
layout_x=6
layout_y=6
;;
C384)
layout_x=5
layout_y=5
;;
C192 | C96 | C48)
layout_x=3
layout_y=3
;;
esac

export wtime_aeroanlrun="00:30:00"
export npe_aeroanlrun=$(echo "$layout_x * $layout_y * 6" | bc)
export npe_aeroanlrun_gfs=$(echo "$layout_x * $layout_y * 6" | bc)
export nth_aeroanlrun=1
export nth_aeroanlrun_gfs=1
export native_aeroanlrun="--exclusive"
export npe_node_aeroanlrun=$(echo "$npe_node_max / $nth_aeroanlrun" | bc)

elif [ $step = "aeroanlfinal" ]; then

export wtime_aeroanlfinal="00:10:00"
export npe_aeroanlfinal=1
export nth_aeroanlfinal=1
export npe_node_aeroanlfinal=$(echo "$npe_node_max / $nth_aeroanlfinal" | bc)
export memory_aeroanlfinal="3072M"

elif [ $step = "anal" ]; then

export wtime_anal="01:00:00"
Expand Down
18 changes: 0 additions & 18 deletions parm/parm_fv3diag/diag_table_cpl
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
######################
"ocn%4yr%2mo%2dy%2hr", 6, "hours", 1, "hours", "time", 6, "hours", "1901 1 1 0 0 0"
"ocn_daily%4yr%2mo%2dy", 1, "days", 1, "days", "time", 1, "days", "1901 1 1 0 0 0"
"wavocn%4yr%2mo%2dy%2hr", 6, "hours", 1, "hours", "time", 6, "hours", "1901 1 1 0 0 0"
##############################################
# static fields
"ocean_model", "geolon", "geolon", "ocn%4yr%2mo%2dy%2hr", "all", .false., "none", 2
Expand Down Expand Up @@ -81,23 +80,6 @@
"ocean_model", "LwLatSens", "LwLatSens", "ocn%4yr%2mo%2dy%2hr","all",.true.,"none",2
"ocean_model", "Heat_PmE", "Heat_PmE", "ocn%4yr%2mo%2dy%2hr","all",.true.,"none",2

#wave_variables
"ocean_model", "geolon", "geolon", "wavocn%4yr%2mo%2dy%2hr","all", .false., "none", 2
"ocean_model", "geolat", "geolat", "wavocn%4yr%2mo%2dy%2hr","all", .false., "none", 2
"ocean_model", "MSTAR", "MSTAR", "wavocn%4yr%2mo%2dy%2hr","all", .true., "none", 2
"ocean_model", "LA", "LA", "wavocn%4yr%2mo%2dy%2hr","all", .true., "none", 2
"ocean_model", "LA_MOD", "LA_MOD", "wavocn%4yr%2mo%2dy%2hr","all", .true., "none", 2
"ocean_model", "MSTAR_LT", "MSTAR_LT", "wavocn%4yr%2mo%2dy%2hr","all", .true., "none", 2
"ocean_model", "ePBL_h_ML", "ePBL", "wavocn%4yr%2mo%2dy%2hr","all", .true., "none", 2
"ocean_model", "ustar", "ustar", "wavocn%4yr%2mo%2dy%2hr","all", .true., "none", 2
"ocean_model", "ePBL_TKE_wind", "ePBL_TKE_wind", "wavocn%4yr%2mo%2dy%2hr","all", .true., "none", 2
"ocean_model", "ePBL_TKE_MKE", "ePBL_TKE_MKE", "wavocn%4yr%2mo%2dy%2hr","all", .true., "none", 2
"ocean_model", "ePBL_TKE_conv", "ePBL_TKE_conv", "wavocn%4yr%2mo%2dy%2hr","all", .true., "none", 2
"ocean_model", "ePBL_TKE_forcing", "ePBL_TKE_forcing", "wavocn%4yr%2mo%2dy%2hr","all", .true., "none", 2
"ocean_model", "ePBL_TKE_mixing", "ePBL_TKE_mixing", "wavocn%4yr%2mo%2dy%2hr","all", .true., "none", 2
"ocean_model", "ePBL_TKE_mech_decay","ePBL_TKE_mech_decay","wavocn%4yr%2mo%2dy%2hr","all", .true., "none", 2
"ocean_model", "ePBL_TKE_conv_decay","ePBL_TKE_conv_decay","wavocn%4yr%2mo%2dy%2hr","all", .true., "none", 2

#=============================================================================================
"gfs_dyn", "ucomp", "ugrd", "fv3_history", "all", .false., "none", 2
"gfs_dyn", "vcomp", "vgrd", "fv3_history", "all", .false., "none", 2
Expand Down
98 changes: 98 additions & 0 deletions sorc/cmake/Findwgrib2.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
# Find the wgrib2 headers, library and executable
#
# This module defines:
#
# - wgrib2::wgrib2 - library and include directory, all in a single target.
# - WGRIB2_INCLUDE_DIR - include directory
# - WGRIB2_LIBRARIES - wgrib2 library
# - WGRIB2API_LIBRARIES - wgrib2_api library (if using NCEPLibs-wgrib2 cmake build system)
# - WGRIB2_EXE - wgrib2 executable
#
# The following paths will be searched in order:
#
# - WGRIB2_INCLUDE_DIRS - folders containing wgrib2.
# - WGRIB2_LIBRARY_DIRS - folders containing libwgrib2.a
# - wgrib2_ROOT - root of wgrib2 installation
# - wgrib2_PATH - root of wgrib2 installation
#
# TODO
# Remove all instances of WGRIB2API_LIBRARIES when cmake build of wgrib2 is removed from all systems

find_path(
WGRIB2_INCLUDE_DIR
NAMES wgrib2.h wgrib2api.mod
HINTS ${WGRIB2_INCLUDE_DIRS}
${wgrib2_ROOT} $ENV{wgrib2_ROOT}
${wgrib2_PATH} $ENV{wgrib2_PATH}
PATH_SUFFIXES include include/wgrib2
DOC "Path to wgrib2.h, wgrib2api.mod"
)

find_library(
WGRIB2_LIBRARIES
NAMES libwgrib2.a
HINTS ${WGRIB2_LIBRARY_DIRS}
${wgrib2_ROOT} $ENV{wgrib2_ROOT}
${wgrib2_PATH} $ENV{wgrib2_PATH}
PATH_SUFFIXES lib lib64
DOC "Path to libwgrib2.a"
)

find_library(
WGRIB2API_LIBRARIES
NAMES libwgrib2_api.a
HINTS ${WGRIB2_LIBRARY_DIRS}
${wgrib2_ROOT} $ENV{wgrib2_ROOT}
${wgrib2_PATH} $ENV{wgrib2_PATH}
PATH_SUFFIXES lib lib64
DOC "Path to libwgrib2_api.a"
)

find_program(WGRIB2_EXE
NAMES wgrib2
HINTS ${wgrib2_ROOT} $ENV{wgrib2_ROOT}
${wgrib2_PATH} $ENV{wgrib2_PATH}
PATH_SUFFIXES bin
DOC "Path to wgrib2 executable"
)

mark_as_advanced(WGRIB2_INCLUDE_DIR WGRIB2_LIBRARIES WGRIB2API_LIBRARIES WGRIB2_EXE)

message(DEBUG "[Findwgrib2.cmake]: creating target wgrib2::wgrib2")
add_library(wgrib2::wgrib2 UNKNOWN IMPORTED)
set_target_properties(wgrib2::wgrib2 PROPERTIES INTERFACE_INCLUDE_DIRECTORIES ${WGRIB2_INCLUDE_DIR})
if(WGRIB2API_LIBRARIES)
message(DEBUG "[Findwgrib2.cmake]: linking with libwgrib2_api.a and libwgrib2.a")
set_target_properties(wgrib2::wgrib2 PROPERTIES IMPORTED_LOCATION ${WGRIB2API_LIBRARIES})
set_target_properties(wgrib2::wgrib2 PROPERTIES INTERFACE_LINK_LIBRARIES ${WGRIB2_LIBRARIES})
else()
message(DEBUG "[Findwgrib2.cmake]: linking with libwgrib2.a")
set_target_properties(wgrib2::wgrib2 PROPERTIES IMPORTED_LOCATION ${WGRIB2_LIBRARIES})
endif()

# wgrib2 changed how it outputs --version from "v0.x.y.z" to "vx.y.z" starting in wgrib2 3.0
execute_process(COMMAND ${WGRIB2_EXE} --version OUTPUT_VARIABLE version)
if(version MATCHES "^v0.*")
string(SUBSTRING "${version}" 3 5 WGRIB2_VERSION)
else()
string(SUBSTRING "${version}" 1 5 WGRIB2_VERSION)
endif()
unset(version)

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(wgrib2
REQUIRED_VARS WGRIB2_LIBRARIES WGRIB2_INCLUDE_DIR WGRIB2_EXE
VERSION_VAR WGRIB2_VERSION
)

if(wgrib2_FOUND AND NOT wgrib2_FIND_QUIETLY)
message(STATUS "Findwgrib2:")
message(STATUS " - WGRIB2_INCLUDE_DIR: ${WGRIB2_INCLUDE_DIR}")
message(STATUS " - WGRIB2_LIBRARIES: ${WGRIB2_LIBRARIES}")
if(WGRIB2API_LIBRARIES)
message(STATUS " - WGRIB2API_LIBRARIES: ${WGRIB2API_LIBRARIES}")
endif()
message(STATUS " - WGRIB2_EXE: ${WGRIB2_EXE}")
message(STATUS " - WGRIB2_VERSION: ${WGRIB2_VERSION}")
endif()

2 changes: 1 addition & 1 deletion sorc/reg2grb2.fd/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ target_link_libraries(
sp::sp_d
bacio::bacio_4
w3nco::w3nco_4
wgrib2::wgrib2_api
wgrib2::wgrib2
NetCDF::NetCDF_Fortran)

if(OpenMP_Fortran_FOUND)
Expand Down
4 changes: 0 additions & 4 deletions ush/forecast_postdet.sh
Original file line number Diff line number Diff line change
Expand Up @@ -844,10 +844,6 @@ MOM6_postdet() {
dest_file="ocn${VDATE}.${ENSMEM}.${IDATE}.nc"
${NLN} ${COMOUTocean}/${dest_file} ${DATA}/${source_file}

source_file="wavocn_${YYYY_MID}_${MM_MID}_${DD_MID}_${HH_MID}.nc"
dest_file=${source_file}
${NLN} ${COMOUTocean}/${dest_file} ${DATA}/${source_file}

source_file="ocn_daily_${YYYY}_${MM}_${DD}.nc"
dest_file=${source_file}
if [ ! -a "${DATA}/${source_file}" ]; then
Expand Down
3 changes: 0 additions & 3 deletions ush/hpssarch_gen.sh
Original file line number Diff line number Diff line change
Expand Up @@ -233,21 +233,18 @@ if [ $type = "gfs" ]; then
rm -f ocn_3D.txt
rm -f ocn_xsect.txt
rm -f ocn_daily.txt
rm -f wavocn.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
touch wavocn.txt
echo "${dirname}MOM_input " >>ocn_2D.txt
echo "${dirname}ocn_2D* " >>ocn_2D.txt
echo "${dirname}ocn_3D* " >>ocn_3D.txt
echo "${dirname}ocn*EQ* " >>ocn_xsect.txt
echo "${dirname}ocn_daily* " >>ocn_daily.txt
echo "${dirname}wavocn* " >>wavocn.txt
echo "${dirname}ocn_ice*0p5x0p5.grb2 " >>ocn_ice_grib2_0p5.txt
echo "${dirname}ocn_ice*0p25x0p25.grb2 " >>ocn_ice_grib2_0p25.txt

Expand Down

0 comments on commit 83254fd

Please sign in to comment.