Skip to content

Commit f527005

Browse files
Merge branch 'develop' into feature/sfc_climo_gen.frac
Fixes ufs-community#709.
2 parents 300f909 + 7efbe0f commit f527005

File tree

18 files changed

+104
-107
lines changed

18 files changed

+104
-107
lines changed

.github/workflows/Linux_versions.yml

+16-16
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ jobs:
3535
g2_version: [3.4.3]
3636
sp_version: [2.3.3]
3737
ip_version: [3.3.3]
38-
w3nco_version: [2.4.0]
38+
w3emc_version: [2.9.3]
3939
nemsio_version: [2.5.0]
4040
sfcio_version: [1.4.0]
4141
sigio_version: [2.3.0]
@@ -267,28 +267,28 @@ jobs:
267267
make -j2
268268
make install
269269
270-
- name: cache-w3nco
271-
id: cache-w3nco
270+
- name: cache-w3emc
271+
id: cache-w3emc
272272
uses: actions/cache@v2
273273
with:
274-
path: ~/w3nco
275-
key: Linux_versions-w3nco-${{ runner.os }}-${{ matrix.w3nco_version }}
274+
path: ~/w3emc
275+
key: Linux_versions-w3emc-${{ runner.os }}-${{ matrix.w3emc_version }}
276276

277-
- name: checkout-w3nco
278-
if: steps.cache-w3nco.outputs.cache-hit != 'true'
277+
- name: checkout-w3emc
278+
if: steps.cache-w3emc.outputs.cache-hit != 'true'
279279
uses: actions/checkout@v2
280280
with:
281-
repository: NOAA-EMC/NCEPLIBS-w3nco
282-
path: w3nco
283-
ref: v${{ matrix.w3nco_version }}
281+
repository: NOAA-EMC/NCEPLIBS-w3emc
282+
path: w3emc
283+
ref: v${{ matrix.w3emc_version }}
284284

285-
- name: build-w3nco
286-
if: steps.cache-w3nco.outputs.cache-hit != 'true'
285+
- name: build-w3emc
286+
if: steps.cache-w3emc.outputs.cache-hit != 'true'
287287
run: |
288-
cd w3nco
288+
cd w3emc
289289
mkdir build
290290
cd build
291-
cmake .. -DCMAKE_INSTALL_PREFIX=~/w3nco
291+
cmake .. -DCMAKE_INSTALL_PREFIX=~/w3emc -DCMAKE_PREFIX_PATH=~/bacio
292292
make -j2
293293
make install
294294
@@ -313,7 +313,7 @@ jobs:
313313
cd nemsio
314314
mkdir build
315315
cd build
316-
cmake -DCMAKE_INSTALL_PREFIX=~/nemsio -DCMAKE_PREFIX_PATH="~/bacio;~/w3nco" ..
316+
cmake -DCMAKE_INSTALL_PREFIX=~/nemsio -DCMAKE_PREFIX_PATH="~/bacio;~/w3emc" ..
317317
make -j2
318318
make install
319319
@@ -362,7 +362,7 @@ jobs:
362362
mkdir build
363363
cd build
364364
export ESMFMKFILE=~/esmf/lib/esmf.mk
365-
cmake -DTEST_FILE_DIR=/home/runner/data -DCMAKE_PREFIX_PATH="~/jasper;~/g2c;~/bacio;~/g2;~/w3nco;~/sfcio;~/sigio;~/nemsio;~/sp;~/ip" ..
365+
cmake -DTEST_FILE_DIR=/home/runner/data -DCMAKE_PREFIX_PATH="~/jasper;~/g2c;~/bacio;~/g2;~/w3emc;~/sfcio;~/sigio;~/nemsio;~/sp;~/ip" ..
366366
make -j2 VERBOSE=1
367367
368368
- name: test

.github/workflows/Linux_versions_ext.yml

+16-32
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ jobs:
3535
g2_version: [3.4.3]
3636
sp_version: [2.3.3]
3737
ip_version: [3.3.3]
38-
w3nco_version: [2.4.0]
38+
w3emc_version: [2.9.3]
3939
nemsio_version: [2.5.0]
4040
sfcio_version: [1.4.0]
4141
sigio_version: [2.3.0]
@@ -210,22 +210,6 @@ jobs:
210210
make -j2
211211
make install
212212
213-
# - name: checkout-w3emc
214-
# uses: actions/checkout@v2
215-
# with:
216-
# repository: NOAA-EMC/NCEPLIBS-w3emc
217-
# path: w3emc
218-
# ref: develop
219-
220-
# - name: build-w3emc
221-
# run: |
222-
# cd w3emc
223-
# mkdir build
224-
# cd build
225-
# cmake -DCMAKE_PREFIX_PATH=~/bacio -DCMAKE_INSTALL_PREFIX=~/w3emc ..
226-
# make -j2
227-
# make install
228-
229213
# - name: checkout-g2c
230214
# uses: actions/checkout@v2
231215
# with:
@@ -267,28 +251,28 @@ jobs:
267251
make -j2
268252
make install
269253
270-
- name: cache-w3nco
271-
id: cache-w3nco
254+
- name: cache-w3emc
255+
id: cache-w3emc
272256
uses: actions/cache@v2
273257
with:
274-
path: ~/w3nco
275-
key: Linux_versions-w3nco-${{ runner.os }}-${{ matrix.w3nco_version }}
258+
path: ~/w3emc
259+
key: Linux_versions-w3emc-${{ runner.os }}-${{ matrix.w3emc_version }}
276260

277-
- name: checkout-w3nco
278-
if: steps.cache-w3nco.outputs.cache-hit != 'true'
261+
- name: checkout-w3emc
262+
if: steps.cache-w3emc.outputs.cache-hit != 'true'
279263
uses: actions/checkout@v2
280264
with:
281-
repository: NOAA-EMC/NCEPLIBS-w3nco
282-
path: w3nco
283-
ref: v${{ matrix.w3nco_version }}
265+
repository: NOAA-EMC/NCEPLIBS-w3emc
266+
path: w3emc
267+
ref: v${{ matrix.w3emc_version }}
284268

285-
- name: build-w3nco
286-
if: steps.cache-w3nco.outputs.cache-hit != 'true'
269+
- name: build-w3emc
270+
if: steps.cache-w3emc.outputs.cache-hit != 'true'
287271
run: |
288-
cd w3nco
272+
cd w3emc
289273
mkdir build
290274
cd build
291-
cmake .. -DCMAKE_INSTALL_PREFIX=~/w3nco
275+
cmake .. -DCMAKE_INSTALL_PREFIX=~/w3emc -DCMAKE_PREFIX_PATH=~/bacio
292276
make -j2
293277
make install
294278
@@ -313,7 +297,7 @@ jobs:
313297
cd nemsio
314298
mkdir build
315299
cd build
316-
cmake -DCMAKE_INSTALL_PREFIX=~/nemsio -DCMAKE_PREFIX_PATH="~/bacio;~/w3nco" ..
300+
cmake -DCMAKE_INSTALL_PREFIX=~/nemsio -DCMAKE_PREFIX_PATH="~/bacio;~/w3emc" ..
317301
make -j2
318302
make install
319303
@@ -362,7 +346,7 @@ jobs:
362346
mkdir build
363347
cd build
364348
export ESMFMKFILE=~/esmf/lib/esmf.mk
365-
cmake -DTEST_FILE_DIR=/home/runner/data -DCMAKE_PREFIX_PATH="~/jasper;~/g2c;~/bacio;~/g2;~/w3nco;~/sfcio;~/sigio;~/nemsio;~/sp;~/ip" ..
349+
cmake -DTEST_FILE_DIR=/home/runner/data -DCMAKE_PREFIX_PATH="~/jasper;~/g2c;~/bacio;~/g2;~/w3emc;~/sfcio;~/sigio;~/nemsio;~/sp;~/ip" ..
366350
make -j2 VERBOSE=1
367351
368352
- name: test

.github/workflows/developer.yml

+2-27
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ jobs:
194194
with:
195195
repository: NOAA-EMC/NCEPLIBS-w3emc
196196
path: w3emc
197-
ref: v2.9.0
197+
ref: v2.9.3
198198

199199
- name: build-w3emc
200200
run: |
@@ -246,31 +246,6 @@ jobs:
246246
make -j2
247247
make install
248248
249-
- name: cache-w3nco
250-
id: cache-w3nco
251-
uses: actions/cache@v2
252-
with:
253-
path: ~/w3nco
254-
key: developer-w3nco-${{ runner.os }}-2.4.1
255-
256-
- name: checkout-w3nco
257-
if: steps.cache-w3nco.outputs.cache-hit != 'true'
258-
uses: actions/checkout@v2
259-
with:
260-
repository: NOAA-EMC/NCEPLIBS-w3nco
261-
path: w3nco
262-
ref: v2.4.1
263-
264-
- name: build-w3nco
265-
if: steps.cache-w3nco.outputs.cache-hit != 'true'
266-
run: |
267-
cd w3nco
268-
mkdir build
269-
cd build
270-
cmake .. -DCMAKE_INSTALL_PREFIX=~/w3nco
271-
make -j2
272-
make install
273-
274249
- name: cache-nemsio
275250
id: cache-nemsio
276251
uses: actions/cache@v2
@@ -341,7 +316,7 @@ jobs:
341316
doxygen --version
342317
export ESMFMKFILE=~/esmf/lib/esmf.mk
343318
cd build
344-
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 ..
319+
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 ..
345320
make -j2 VERBOSE=1
346321
347322
- name: test

CMakeLists.txt

+3-5
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ endif()
6464
if(CMAKE_Fortran_COMPILER_ID MATCHES "^(Intel)$")
6565
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -g -traceback")
6666
set(CMAKE_Fortran_FLAGS_RELEASE "-O3 -fp-model precise")
67-
set(CMAKE_Fortran_FLAGS_DEBUG "-O0 -check -check noarg_temp_created -check nopointer -fp-stack-check -fstack-protector-all -fpe0 -debug -ftrapuv")
67+
set(CMAKE_Fortran_FLAGS_DEBUG "-O0 -check all -ftrapuv")
6868
if(APPLE)
6969
# The linker on macOS does not include `common symbols` by default.
7070
# Passing the -c flag includes them and fixes an error with undefined symbols.
@@ -77,9 +77,7 @@ elseif(CMAKE_Fortran_COMPILER_ID MATCHES "^(GNU)$")
7777
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fallow-argument-mismatch -fallow-invalid-boz")
7878
endif()
7979
set(CMAKE_Fortran_FLAGS_RELEASE "-O3")
80-
# set(CMAKE_Fortran_FLAGS_DEBUG "-ggdb -Wall")
81-
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")
82-
# 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")
80+
set(CMAKE_Fortran_FLAGS_DEBUG "-O0 -ggdb -Wall -fcheck=all")
8381
endif()
8482

8583
if(CMAKE_C_COMPILER_ID MATCHES "^(Intel)$")
@@ -98,7 +96,7 @@ if(OPENMP)
9896
endif()
9997

10098
find_package(sfcio 1.4.0 REQUIRED)
101-
find_package(w3nco 2.4.0 REQUIRED)
99+
find_package(w3emc 2.9.0 REQUIRED)
102100
find_package(bacio 2.4.0 REQUIRED)
103101
find_package(nemsio 2.5.0 REQUIRED)
104102
find_package(sigio 2.3.0 REQUIRED)

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ UFS_UTILS Code managers: George Gayno, Jeff Beck, Larissa Reames
3535

3636
This package uses the [hpc-stack](https://github.com/NOAA-EMC/hpc-stack) for the following NCEPLIBS packages:
3737
- [NCEPLIBS-sfcio](https://github.com/NOAA-EMC/NCEPLIBS-sfcio)
38-
- [NCEPLIBS-w3nco](https://github.com/NOAA-EMC/NCEPLIBS-w3nco)
38+
- [NCEPLIBS-w3emc](https://github.com/NOAA-EMC/NCEPLIBS-w3emc)
3939
- [NCEPLIBS-bacio](https://github.com/NOAA-EMC/NCEPLIBS-bacio)
4040
- [NCEPLIBS-nemsio](https://github.com/NOAA-EMC/NCEPLIBS-nemsio)
4141
- [NCEPLIBS-sigio](https://github.com/NOAA-EMC/NCEPLIBS-sigio)
@@ -91,7 +91,7 @@ are called from driver scripts.
9191

9292
The `util` directory contains utility scripts.
9393

94-
The `parm` directory contains variable mapping parameter tables used by
94+
The `parm` directory contains parameter files used by
9595
the chgres_cube program.
9696

9797
The `driver_scripts` directory contains high-level driver scripts to

docs/source/chgres_cube.rst

+38
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,25 @@ Initializing global domains with GRIB2 data - some caveats
141141
* 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.
142142
* 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).
143143
* 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.
144+
* 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:
145+
* ``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:
146+
147+
.. code-block:: console
148+
149+
----------------------- unique.pl ------------------------
150+
#!/usr/bin/perl -w
151+
# print only lines where fields 3..N are different
152+
#
153+
while (<STDIN>) {
154+
chomp;
155+
$line = $_;
156+
$_ =~ s/^[0-9.]*:[0-9]*://;
157+
if (! defined $inv{$_}) {
158+
$inv{$_} = 1;
159+
print "$line\n";
160+
}
161+
}
162+
--------------------- end unique.pl ----------------------
144163
145164
Near Sea Surface Temperature (NSST) data and GRIB2 initialization
146165
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -304,6 +323,25 @@ Keep these things in mind when using FV3GFS GRIB2 data for model initialization:
304323
* 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.
305324
* 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).
306325
* 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.
326+
* 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:
327+
* ``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:
328+
329+
.. code-block:: console
330+
331+
----------------------- unique.pl ------------------------
332+
#!/usr/bin/perl -w
333+
# print only lines where fields 3..N are different
334+
#
335+
while (<STDIN>) {
336+
chomp;
337+
$line = $_;
338+
$_ =~ s/^[0-9.]*:[0-9]*://;
339+
if (! defined $inv{$_}) {
340+
$inv{$_} = 1;
341+
print "$line\n";
342+
}
343+
}
344+
--------------------- end unique.pl ----------------------
307345
308346
Regional chgres_cube namelist options
309347
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

modulefiles/build.hera.gnu.lua

+2-2
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ load(pathJoin("nemsio", nemsio_ver))
4040
sp_ver=os.getenv("sp_ver") or "2.3.3"
4141
load(pathJoin("sp", sp_ver))
4242

43-
w3nco_ver=os.getenv("w3nco_ver") or "2.4.1"
44-
load(pathJoin("w3nco", w3nco_ver))
43+
w3emc_ver=os.getenv("w3emc_ver") or "2.9.2"
44+
load(pathJoin("w3emc", w3emc_ver))
4545

4646
sfcio_ver=os.getenv("sfcio_ver") or "1.4.1"
4747
load(pathJoin("sfcio", sfcio_ver))

modulefiles/build.hera.intel.lua

+2-2
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ load(pathJoin("nemsio", nemsio_ver))
3434
sp_ver=os.getenv("sp_ver") or "2.3.3"
3535
load(pathJoin("sp", sp_ver))
3636

37-
w3nco_ver=os.getenv("w3nco_ver") or "2.4.1"
38-
load(pathJoin("w3nco", w3nco_ver))
37+
w3emc_ver=os.getenv("w3emc_ver") or "2.9.2"
38+
load(pathJoin("w3emc", w3emc_ver))
3939

4040
sfcio_ver=os.getenv("sfcio_ver") or "1.4.1"
4141
load(pathJoin("sfcio", sfcio_ver))

modulefiles/build.jet.intel.lua

+2-2
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ load(pathJoin("nccmp", nccmp_ver))
3131
esmf_ver=os.getenv("esmf_ver") or "8.4.0b08"
3232
load(pathJoin("esmf", esmf_ver))
3333

34-
w3nco_ver=os.getenv("w3nco_ver") or "2.4.1"
35-
load(pathJoin("w3nco", w3nco_ver))
34+
w3emc_ver=os.getenv("w3emc_ver") or "2.9.2"
35+
load(pathJoin("w3emc", w3emc_ver))
3636

3737
sp_ver=os.getenv("sp_ver") or "2.3.3"
3838
load(pathJoin("sp", sp_ver))

modulefiles/build.orion.intel.lua

+2-2
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ load(pathJoin("nemsio", nemsio_ver))
3131
sp_ver=os.getenv("sp_ver") or "2.3.3"
3232
load(pathJoin("sp", sp_ver))
3333

34-
w3nco_ver=os.getenv("w3nco_ver") or "2.4.1"
35-
load(pathJoin("w3nco", w3nco_ver))
34+
w3emc_ver=os.getenv("w3emc_ver") or "2.9.2"
35+
load(pathJoin("w3emc", w3emc_ver))
3636

3737
sfcio_ver=os.getenv("sfcio_ver") or "1.4.1"
3838
load(pathJoin("sfcio", sfcio_ver))

modulefiles/build.wcoss2.intel.lua

+4-6
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ load(pathJoin("bacio", bacio_ver))
3838
sfcio_ver=os.getenv("sfcio_ver") or "1.4.1"
3939
load(pathJoin("sfcio", sfcio_ver))
4040

41-
w3nco_ver=os.getenv("w3nco_ver") or "2.4.1"
42-
load(pathJoin("w3nco", w3nco_ver))
41+
w3emc_ver=os.getenv("w3emc_ver") or "2.9.2"
42+
load(pathJoin("w3emc", w3emc_ver))
4343

4444
nemsio_ver=os.getenv("nemsio_ver") or "2.5.2"
4545
load(pathJoin("nemsio", nemsio_ver))
@@ -69,10 +69,8 @@ load(pathJoin("gsl", gsl_ver))
6969
nco_ver=os.getenv("nco_ver") or "4.9.7"
7070
load(pathJoin("nco", nco_ver))
7171

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

7876
whatis("Description: UFS_UTILS build environment")

sorc/chgres_cube.fd/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ target_link_libraries(
5555
bacio::bacio_4
5656
ip::ip_d
5757
sp::sp_d
58-
w3nco::w3nco_d
58+
w3emc::w3emc_d
5959
esmf
6060
msis2
6161
MPI::MPI_Fortran

sorc/emcsfc_ice_blend.fd/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ target_link_libraries(
1212
${exe_name}
1313
bacio::bacio_4
1414
g2::g2_4
15-
w3nco::w3nco_4)
15+
w3emc::w3emc_4)
1616

1717
install(TARGETS ${exe_name})
1818

0 commit comments

Comments
 (0)