Skip to content

Commit

Permalink
Merge branch 'develop' into feature/sfc_climo_gen.frac
Browse files Browse the repository at this point in the history
  • Loading branch information
GeorgeGayno-NOAA committed Apr 5, 2023
2 parents 300f909 + 7efbe0f commit f527005
Show file tree
Hide file tree
Showing 18 changed files with 104 additions and 107 deletions.
32 changes: 16 additions & 16 deletions .github/workflows/Linux_versions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
g2_version: [3.4.3]
sp_version: [2.3.3]
ip_version: [3.3.3]
w3nco_version: [2.4.0]
w3emc_version: [2.9.3]
nemsio_version: [2.5.0]
sfcio_version: [1.4.0]
sigio_version: [2.3.0]
Expand Down Expand Up @@ -267,28 +267,28 @@ jobs:
make -j2
make install
- name: cache-w3nco
id: cache-w3nco
- name: cache-w3emc
id: cache-w3emc
uses: actions/cache@v2
with:
path: ~/w3nco
key: Linux_versions-w3nco-${{ runner.os }}-${{ matrix.w3nco_version }}
path: ~/w3emc
key: Linux_versions-w3emc-${{ runner.os }}-${{ matrix.w3emc_version }}

- name: checkout-w3nco
if: steps.cache-w3nco.outputs.cache-hit != 'true'
- name: checkout-w3emc
if: steps.cache-w3emc.outputs.cache-hit != 'true'
uses: actions/checkout@v2
with:
repository: NOAA-EMC/NCEPLIBS-w3nco
path: w3nco
ref: v${{ matrix.w3nco_version }}
repository: NOAA-EMC/NCEPLIBS-w3emc
path: w3emc
ref: v${{ matrix.w3emc_version }}

- name: build-w3nco
if: steps.cache-w3nco.outputs.cache-hit != 'true'
- name: build-w3emc
if: steps.cache-w3emc.outputs.cache-hit != 'true'
run: |
cd w3nco
cd w3emc
mkdir build
cd build
cmake .. -DCMAKE_INSTALL_PREFIX=~/w3nco
cmake .. -DCMAKE_INSTALL_PREFIX=~/w3emc -DCMAKE_PREFIX_PATH=~/bacio
make -j2
make install
Expand All @@ -313,7 +313,7 @@ jobs:
cd nemsio
mkdir build
cd build
cmake -DCMAKE_INSTALL_PREFIX=~/nemsio -DCMAKE_PREFIX_PATH="~/bacio;~/w3nco" ..
cmake -DCMAKE_INSTALL_PREFIX=~/nemsio -DCMAKE_PREFIX_PATH="~/bacio;~/w3emc" ..
make -j2
make install
Expand Down Expand Up @@ -362,7 +362,7 @@ jobs:
mkdir build
cd build
export ESMFMKFILE=~/esmf/lib/esmf.mk
cmake -DTEST_FILE_DIR=/home/runner/data -DCMAKE_PREFIX_PATH="~/jasper;~/g2c;~/bacio;~/g2;~/w3nco;~/sfcio;~/sigio;~/nemsio;~/sp;~/ip" ..
cmake -DTEST_FILE_DIR=/home/runner/data -DCMAKE_PREFIX_PATH="~/jasper;~/g2c;~/bacio;~/g2;~/w3emc;~/sfcio;~/sigio;~/nemsio;~/sp;~/ip" ..
make -j2 VERBOSE=1
- name: test
Expand Down
48 changes: 16 additions & 32 deletions .github/workflows/Linux_versions_ext.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
g2_version: [3.4.3]
sp_version: [2.3.3]
ip_version: [3.3.3]
w3nco_version: [2.4.0]
w3emc_version: [2.9.3]
nemsio_version: [2.5.0]
sfcio_version: [1.4.0]
sigio_version: [2.3.0]
Expand Down Expand Up @@ -210,22 +210,6 @@ jobs:
make -j2
make install
# - name: checkout-w3emc
# uses: actions/checkout@v2
# with:
# repository: NOAA-EMC/NCEPLIBS-w3emc
# path: w3emc
# ref: develop

# - name: build-w3emc
# run: |
# cd w3emc
# mkdir build
# cd build
# cmake -DCMAKE_PREFIX_PATH=~/bacio -DCMAKE_INSTALL_PREFIX=~/w3emc ..
# make -j2
# make install

# - name: checkout-g2c
# uses: actions/checkout@v2
# with:
Expand Down Expand Up @@ -267,28 +251,28 @@ jobs:
make -j2
make install
- name: cache-w3nco
id: cache-w3nco
- name: cache-w3emc
id: cache-w3emc
uses: actions/cache@v2
with:
path: ~/w3nco
key: Linux_versions-w3nco-${{ runner.os }}-${{ matrix.w3nco_version }}
path: ~/w3emc
key: Linux_versions-w3emc-${{ runner.os }}-${{ matrix.w3emc_version }}

- name: checkout-w3nco
if: steps.cache-w3nco.outputs.cache-hit != 'true'
- name: checkout-w3emc
if: steps.cache-w3emc.outputs.cache-hit != 'true'
uses: actions/checkout@v2
with:
repository: NOAA-EMC/NCEPLIBS-w3nco
path: w3nco
ref: v${{ matrix.w3nco_version }}
repository: NOAA-EMC/NCEPLIBS-w3emc
path: w3emc
ref: v${{ matrix.w3emc_version }}

- name: build-w3nco
if: steps.cache-w3nco.outputs.cache-hit != 'true'
- name: build-w3emc
if: steps.cache-w3emc.outputs.cache-hit != 'true'
run: |
cd w3nco
cd w3emc
mkdir build
cd build
cmake .. -DCMAKE_INSTALL_PREFIX=~/w3nco
cmake .. -DCMAKE_INSTALL_PREFIX=~/w3emc -DCMAKE_PREFIX_PATH=~/bacio
make -j2
make install
Expand All @@ -313,7 +297,7 @@ jobs:
cd nemsio
mkdir build
cd build
cmake -DCMAKE_INSTALL_PREFIX=~/nemsio -DCMAKE_PREFIX_PATH="~/bacio;~/w3nco" ..
cmake -DCMAKE_INSTALL_PREFIX=~/nemsio -DCMAKE_PREFIX_PATH="~/bacio;~/w3emc" ..
make -j2
make install
Expand Down Expand Up @@ -362,7 +346,7 @@ jobs:
mkdir build
cd build
export ESMFMKFILE=~/esmf/lib/esmf.mk
cmake -DTEST_FILE_DIR=/home/runner/data -DCMAKE_PREFIX_PATH="~/jasper;~/g2c;~/bacio;~/g2;~/w3nco;~/sfcio;~/sigio;~/nemsio;~/sp;~/ip" ..
cmake -DTEST_FILE_DIR=/home/runner/data -DCMAKE_PREFIX_PATH="~/jasper;~/g2c;~/bacio;~/g2;~/w3emc;~/sfcio;~/sigio;~/nemsio;~/sp;~/ip" ..
make -j2 VERBOSE=1
- name: test
Expand Down
29 changes: 2 additions & 27 deletions .github/workflows/developer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ jobs:
with:
repository: NOAA-EMC/NCEPLIBS-w3emc
path: w3emc
ref: v2.9.0
ref: v2.9.3

- name: build-w3emc
run: |
Expand Down Expand Up @@ -246,31 +246,6 @@ jobs:
make -j2
make install
- name: cache-w3nco
id: cache-w3nco
uses: actions/cache@v2
with:
path: ~/w3nco
key: developer-w3nco-${{ runner.os }}-2.4.1

- name: checkout-w3nco
if: steps.cache-w3nco.outputs.cache-hit != 'true'
uses: actions/checkout@v2
with:
repository: NOAA-EMC/NCEPLIBS-w3nco
path: w3nco
ref: v2.4.1

- name: build-w3nco
if: steps.cache-w3nco.outputs.cache-hit != 'true'
run: |
cd w3nco
mkdir build
cd build
cmake .. -DCMAKE_INSTALL_PREFIX=~/w3nco
make -j2
make install
- name: cache-nemsio
id: cache-nemsio
uses: actions/cache@v2
Expand Down Expand Up @@ -341,7 +316,7 @@ jobs:
doxygen --version
export ESMFMKFILE=~/esmf/lib/esmf.mk
cd build
cmake -DTEST_FILE_DIR=/home/runner/data -DENABLE_DOCS=On -DCMAKE_PREFIX_PATH="~/jasper;~/g2c;~/bacio;~/g2;~/w3emc;~/w3nco;~/sfcio;~/sigio;~/nemsio;~/sp;~/ip" -DCMAKE_Fortran_FLAGS="-g -fprofile-arcs -ftest-coverage -O0" -DCMAKE_C_FLAGS="-g -fprofile-arcs -ftest-coverage -O0" -DCMAKE_BUILD_TYPE=Debug ..
cmake -DTEST_FILE_DIR=/home/runner/data -DENABLE_DOCS=On -DCMAKE_PREFIX_PATH="~/jasper;~/g2c;~/bacio;~/g2;~/w3emc;~/sfcio;~/sigio;~/nemsio;~/sp;~/ip" -DCMAKE_Fortran_FLAGS="-g -fprofile-arcs -ftest-coverage -O0" -DCMAKE_C_FLAGS="-g -fprofile-arcs -ftest-coverage -O0" -DCMAKE_BUILD_TYPE=Debug ..
make -j2 VERBOSE=1
- name: test
Expand Down
8 changes: 3 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ endif()
if(CMAKE_Fortran_COMPILER_ID MATCHES "^(Intel)$")
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -g -traceback")
set(CMAKE_Fortran_FLAGS_RELEASE "-O3 -fp-model precise")
set(CMAKE_Fortran_FLAGS_DEBUG "-O0 -check -check noarg_temp_created -check nopointer -fp-stack-check -fstack-protector-all -fpe0 -debug -ftrapuv")
set(CMAKE_Fortran_FLAGS_DEBUG "-O0 -check all -ftrapuv")
if(APPLE)
# The linker on macOS does not include `common symbols` by default.
# Passing the -c flag includes them and fixes an error with undefined symbols.
Expand All @@ -77,9 +77,7 @@ elseif(CMAKE_Fortran_COMPILER_ID MATCHES "^(GNU)$")
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fallow-argument-mismatch -fallow-invalid-boz")
endif()
set(CMAKE_Fortran_FLAGS_RELEASE "-O3")
# set(CMAKE_Fortran_FLAGS_DEBUG "-ggdb -Wall")
set(CMAKE_Fortran_FLAGS_DEBUG "-O1 -ggdb -Wall -fno-unsafe-math-optimizations -frounding-math -fsignaling-nans -ffpe-trap=invalid,zero,overflow -fbounds-check -fno-omit-frame-pointer -fno-optimize-sibling-calls")
# set(CMAKE_Fortran_FLAGS_DEBUG "-ggdb -Wall -fno-unsafe-math-optimizations -frounding-math -fsignaling-nans -ffpe-trap=invalid,zero,overflow -fbounds-check -fno-omit-frame-pointer -fno-optimize-sibling-calls")
set(CMAKE_Fortran_FLAGS_DEBUG "-O0 -ggdb -Wall -fcheck=all")
endif()

if(CMAKE_C_COMPILER_ID MATCHES "^(Intel)$")
Expand All @@ -98,7 +96,7 @@ if(OPENMP)
endif()

find_package(sfcio 1.4.0 REQUIRED)
find_package(w3nco 2.4.0 REQUIRED)
find_package(w3emc 2.9.0 REQUIRED)
find_package(bacio 2.4.0 REQUIRED)
find_package(nemsio 2.5.0 REQUIRED)
find_package(sigio 2.3.0 REQUIRED)
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ UFS_UTILS Code managers: George Gayno, Jeff Beck, Larissa Reames

This package uses the [hpc-stack](https://github.com/NOAA-EMC/hpc-stack) for the following NCEPLIBS packages:
- [NCEPLIBS-sfcio](https://github.com/NOAA-EMC/NCEPLIBS-sfcio)
- [NCEPLIBS-w3nco](https://github.com/NOAA-EMC/NCEPLIBS-w3nco)
- [NCEPLIBS-w3emc](https://github.com/NOAA-EMC/NCEPLIBS-w3emc)
- [NCEPLIBS-bacio](https://github.com/NOAA-EMC/NCEPLIBS-bacio)
- [NCEPLIBS-nemsio](https://github.com/NOAA-EMC/NCEPLIBS-nemsio)
- [NCEPLIBS-sigio](https://github.com/NOAA-EMC/NCEPLIBS-sigio)
Expand Down Expand Up @@ -91,7 +91,7 @@ are called from driver scripts.

The `util` directory contains utility scripts.

The `parm` directory contains variable mapping parameter tables used by
The `parm` directory contains parameter files used by
the chgres_cube program.

The `driver_scripts` directory contains high-level driver scripts to
Expand Down
38 changes: 38 additions & 0 deletions docs/source/chgres_cube.rst
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,25 @@ Initializing global domains with GRIB2 data - some caveats
* Soil moisture in the GRIB2 files is created using bilinear interpolation and, therefore, may be a mixture of values from different soil types. Could result in poor latent/sensible heat fluxes.
* Ozone is not available at all isobaric levels. Missing levels are set to a nominal value defined in the variable mapping (VARMAP) file (1E-07).
* Only tested with GRIB2 data from GFS v14 and v15 (from 12z July 19, 2017 to current). May not work with older GFS data. Will not work with GRIB2 data from other models.
* Note that when concatenating grib2 files for use in initialization of global simulations, it is possible to inadvertently introduce duplicate variables and levels into the subsequent grib2 files. Chgres_cube will automatically fail with a warning message indicating that the grib2 file used contains these duplicate entries. Prior to continuing it will be necessary to strip out duplicate entries. Users can remove these entries through use of wgrib2, such as in the following command:
* ``wgrib2 IN.grb -submsg 1 | unique.pl | wgrib2 -i IN.grb -GRIB OUT.grb``, where IN.grb is the original concatenated grib2 file, and OUT.grb is the resulting grib2 file, with duplicates removed. The "unique.pl" Perl script is as follows, taken from the `Tricks for wgrib2 <https://www.ftp.cpc.ncep.noaa.gov/wd51we/wgrib2/tricks.wgrib2>`_ website:

.. code-block:: console
----------------------- unique.pl ------------------------
#!/usr/bin/perl -w
# print only lines where fields 3..N are different
#
while (<STDIN>) {
chomp;
$line = $_;
$_ =~ s/^[0-9.]*:[0-9]*://;
if (! defined $inv{$_}) {
$inv{$_} = 1;
print "$line\n";
}
}
--------------------- end unique.pl ----------------------
Near Sea Surface Temperature (NSST) data and GRIB2 initialization
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Expand Down Expand Up @@ -304,6 +323,25 @@ Keep these things in mind when using FV3GFS GRIB2 data for model initialization:
* For FV3GFS GRIB2 data, soil moisture is created using bilinear interpolation and, therefore, may be a mixture of values from different soil types. Could result in poor latent/sensible heat fluxes.
* Ozone is not available at all isobaric levels. Missing levels are set to a nominal value defined in the variable mapping (VARMAP) file (1E-07).
* Only tested with GRIB2 data from FV3GFS, RAP, NAM, and HRRR data. May not work with GRIB2 data from other models. Use these at your own risk.
* Note that when concatenating grib2 files for use in initialization of regional simulations, it is possible to inadvertently introduce duplicate variables and levels into the subsequent grib2 files. Chgres_cube will automatically fail with a warning message indicating that the grib2 file used contains these duplicate entries. Prior to continuing it will be necessary to strip out duplicate entries. Users can remove these entries through use of wgrib2, such as in the following command:
* ``wgrib2 IN.grb -submsg 1 | unique.pl | wgrib2 -i IN.grb -GRIB OUT.grb``, where IN.grb is the original concatenated grib2 file, and OUT.grb is the resulting grib2 file, with duplicates removed. The "unique.pl" Perl script is as follows, taken from the `Tricks for wgrib2 <https://www.ftp.cpc.ncep.noaa.gov/wd51we/wgrib2/tricks.wgrib2>`_ website:

.. code-block:: console
----------------------- unique.pl ------------------------
#!/usr/bin/perl -w
# print only lines where fields 3..N are different
#
while (<STDIN>) {
chomp;
$line = $_;
$_ =~ s/^[0-9.]*:[0-9]*://;
if (! defined $inv{$_}) {
$inv{$_} = 1;
print "$line\n";
}
}
--------------------- end unique.pl ----------------------
Regional chgres_cube namelist options
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Expand Down
4 changes: 2 additions & 2 deletions modulefiles/build.hera.gnu.lua
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ load(pathJoin("nemsio", nemsio_ver))
sp_ver=os.getenv("sp_ver") or "2.3.3"
load(pathJoin("sp", sp_ver))

w3nco_ver=os.getenv("w3nco_ver") or "2.4.1"
load(pathJoin("w3nco", w3nco_ver))
w3emc_ver=os.getenv("w3emc_ver") or "2.9.2"
load(pathJoin("w3emc", w3emc_ver))

sfcio_ver=os.getenv("sfcio_ver") or "1.4.1"
load(pathJoin("sfcio", sfcio_ver))
Expand Down
4 changes: 2 additions & 2 deletions modulefiles/build.hera.intel.lua
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ load(pathJoin("nemsio", nemsio_ver))
sp_ver=os.getenv("sp_ver") or "2.3.3"
load(pathJoin("sp", sp_ver))

w3nco_ver=os.getenv("w3nco_ver") or "2.4.1"
load(pathJoin("w3nco", w3nco_ver))
w3emc_ver=os.getenv("w3emc_ver") or "2.9.2"
load(pathJoin("w3emc", w3emc_ver))

sfcio_ver=os.getenv("sfcio_ver") or "1.4.1"
load(pathJoin("sfcio", sfcio_ver))
Expand Down
4 changes: 2 additions & 2 deletions modulefiles/build.jet.intel.lua
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ load(pathJoin("nccmp", nccmp_ver))
esmf_ver=os.getenv("esmf_ver") or "8.4.0b08"
load(pathJoin("esmf", esmf_ver))

w3nco_ver=os.getenv("w3nco_ver") or "2.4.1"
load(pathJoin("w3nco", w3nco_ver))
w3emc_ver=os.getenv("w3emc_ver") or "2.9.2"
load(pathJoin("w3emc", w3emc_ver))

sp_ver=os.getenv("sp_ver") or "2.3.3"
load(pathJoin("sp", sp_ver))
Expand Down
4 changes: 2 additions & 2 deletions modulefiles/build.orion.intel.lua
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ load(pathJoin("nemsio", nemsio_ver))
sp_ver=os.getenv("sp_ver") or "2.3.3"
load(pathJoin("sp", sp_ver))

w3nco_ver=os.getenv("w3nco_ver") or "2.4.1"
load(pathJoin("w3nco", w3nco_ver))
w3emc_ver=os.getenv("w3emc_ver") or "2.9.2"
load(pathJoin("w3emc", w3emc_ver))

sfcio_ver=os.getenv("sfcio_ver") or "1.4.1"
load(pathJoin("sfcio", sfcio_ver))
Expand Down
10 changes: 4 additions & 6 deletions modulefiles/build.wcoss2.intel.lua
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ load(pathJoin("bacio", bacio_ver))
sfcio_ver=os.getenv("sfcio_ver") or "1.4.1"
load(pathJoin("sfcio", sfcio_ver))

w3nco_ver=os.getenv("w3nco_ver") or "2.4.1"
load(pathJoin("w3nco", w3nco_ver))
w3emc_ver=os.getenv("w3emc_ver") or "2.9.2"
load(pathJoin("w3emc", w3emc_ver))

nemsio_ver=os.getenv("nemsio_ver") or "2.5.2"
load(pathJoin("nemsio", nemsio_ver))
Expand Down Expand Up @@ -69,10 +69,8 @@ load(pathJoin("gsl", gsl_ver))
nco_ver=os.getenv("nco_ver") or "4.9.7"
load(pathJoin("nco", nco_ver))

setenv("HPC_OPT","/apps/ops/para/libs")
prepend_path("MODULEPATH", "/apps/ops/para/libs/modulefiles/compiler/intel/19.1.3.304")
prepend_path("MODULEPATH", "/apps/ops/para/libs/modulefiles/mpi/intel/19.1.3.304/cray-mpich/8.1.7")
esmf_ver=os.getenv("esmf_ver") or "8.4.0b08"
prepend_path("MODULEPATH", "/apps/dev/lmodules/intel_cray_mpich/19.1.3.304/cray-mpich/8.1.4")
esmf_ver=os.getenv("esmf_ver") or "8.4.1"
load(pathJoin("esmf", esmf_ver))

whatis("Description: UFS_UTILS build environment")
2 changes: 1 addition & 1 deletion sorc/chgres_cube.fd/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ target_link_libraries(
bacio::bacio_4
ip::ip_d
sp::sp_d
w3nco::w3nco_d
w3emc::w3emc_d
esmf
msis2
MPI::MPI_Fortran
Expand Down
2 changes: 1 addition & 1 deletion sorc/emcsfc_ice_blend.fd/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ target_link_libraries(
${exe_name}
bacio::bacio_4
g2::g2_4
w3nco::w3nco_4)
w3emc::w3emc_4)

install(TARGETS ${exe_name})

Expand Down
Loading

0 comments on commit f527005

Please sign in to comment.