From d81a8b509c8c734ceaf4aa44f120c80452c38706 Mon Sep 17 00:00:00 2001 From: Rahul Mahajan Date: Mon, 15 Aug 2022 16:49:10 -0400 Subject: [PATCH 1/3] use a robust Findwgrib2.cmake to find wgrib2 built w/ native wgrib2 build (#970) --- sorc/cmake/Findwgrib2.cmake | 98 +++++++++++++++++++++++++++++++++ sorc/reg2grb2.fd/CMakeLists.txt | 2 +- 2 files changed, 99 insertions(+), 1 deletion(-) create mode 100644 sorc/cmake/Findwgrib2.cmake diff --git a/sorc/cmake/Findwgrib2.cmake b/sorc/cmake/Findwgrib2.cmake new file mode 100644 index 0000000000..ecede0d21f --- /dev/null +++ b/sorc/cmake/Findwgrib2.cmake @@ -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() + diff --git a/sorc/reg2grb2.fd/CMakeLists.txt b/sorc/reg2grb2.fd/CMakeLists.txt index 4157c315bf..c866ca515f 100644 --- a/sorc/reg2grb2.fd/CMakeLists.txt +++ b/sorc/reg2grb2.fd/CMakeLists.txt @@ -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) From cfcc21f9f96106b17bba9fd194cd360dda1fffb8 Mon Sep 17 00:00:00 2001 From: Jessica Meixner Date: Thu, 18 Aug 2022 07:10:44 +0000 Subject: [PATCH 2/3] Update diag table to remove wav-ocn coupling fields (#979) Removes the wavocn output which is used to evaluate wav->ocean coupling. These were only needed for prototype diagnostics and when these variables are output without wave coupling, it can lead to failures. Fixes #977 --- jobs/rocoto/arch.sh | 2 +- parm/parm_fv3diag/diag_table_cpl | 18 ------------------ ush/forecast_postdet.sh | 4 ---- ush/hpssarch_gen.sh | 3 --- 4 files changed, 1 insertion(+), 26 deletions(-) diff --git a/jobs/rocoto/arch.sh b/jobs/rocoto/arch.sh index c9441b5a75..05eb34e1ad 100755 --- a/jobs/rocoto/arch.sh +++ b/jobs/rocoto/arch.sh @@ -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 diff --git a/parm/parm_fv3diag/diag_table_cpl b/parm/parm_fv3diag/diag_table_cpl index 3a5bb4a5bc..6974dafac3 100644 --- a/parm/parm_fv3diag/diag_table_cpl +++ b/parm/parm_fv3diag/diag_table_cpl @@ -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 @@ -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 diff --git a/ush/forecast_postdet.sh b/ush/forecast_postdet.sh index 089ff7dd5b..eeae89c11b 100755 --- a/ush/forecast_postdet.sh +++ b/ush/forecast_postdet.sh @@ -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 diff --git a/ush/hpssarch_gen.sh b/ush/hpssarch_gen.sh index 9785de98ac..245a402692 100755 --- a/ush/hpssarch_gen.sh +++ b/ush/hpssarch_gen.sh @@ -233,7 +233,6 @@ 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 @@ -241,13 +240,11 @@ if [ $type = "gfs" ]; then 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 From 8a62c3a9e2dcc5de05ca974be8852736d423de76 Mon Sep 17 00:00:00 2001 From: Cory Martin Date: Fri, 19 Aug 2022 14:09:07 -0400 Subject: [PATCH 3/3] Add initial config files for global aerosol DA (#986) Add new config files for aerosol da --- env/HERA.env | 11 +++++++++ env/ORION.env | 11 +++++++++ parm/config/config.aeroanl | 17 +++++++++++++ parm/config/config.aeroanlfinal | 10 ++++++++ parm/config/config.aeroanlinit | 10 ++++++++ parm/config/config.aeroanlrun | 14 +++++++++++ parm/config/config.resources | 42 +++++++++++++++++++++++++++++++++ 7 files changed, 115 insertions(+) create mode 100755 parm/config/config.aeroanl create mode 100755 parm/config/config.aeroanlfinal create mode 100755 parm/config/config.aeroanlinit create mode 100755 parm/config/config.aeroanlrun diff --git a/env/HERA.env b/env/HERA.env index 124b3e8b9a..51a7c85a33 100755 --- a/env/HERA.env +++ b/env/HERA.env @@ -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" @@ -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 diff --git a/env/ORION.env b/env/ORION.env index bef0661f47..8dc267631f 100755 --- a/env/ORION.env +++ b/env/ORION.env @@ -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" @@ -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 diff --git a/parm/config/config.aeroanl b/parm/config/config.aeroanl new file mode 100755 index 0000000000..d1c28a3e10 --- /dev/null +++ b/parm/config/config.aeroanl @@ -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" diff --git a/parm/config/config.aeroanlfinal b/parm/config/config.aeroanlfinal new file mode 100755 index 0000000000..230ec5205a --- /dev/null +++ b/parm/config/config.aeroanlfinal @@ -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" diff --git a/parm/config/config.aeroanlinit b/parm/config/config.aeroanlinit new file mode 100755 index 0000000000..72175b8d0c --- /dev/null +++ b/parm/config/config.aeroanlinit @@ -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" diff --git a/parm/config/config.aeroanlrun b/parm/config/config.aeroanlrun new file mode 100755 index 0000000000..537f33081f --- /dev/null +++ b/parm/config/config.aeroanlrun @@ -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" diff --git a/parm/config/config.resources b/parm/config/config.resources index b2390970ae..b69e87b800 100755 --- a/parm/config/config.resources +++ b/parm/config/config.resources @@ -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" @@ -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"