Skip to content

Commit

Permalink
Merge pull request #602 from NCAR/rttov-clouds
Browse files Browse the repository at this point in the history
RTTOV 13 clouds
  • Loading branch information
hkershaw-brown authored Feb 1, 2024
2 parents 4dadee7 + eae854d commit 82f7e91
Show file tree
Hide file tree
Showing 8 changed files with 148 additions and 384 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/action_on_pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
options: "--cap-add=SYS_PTRACE"
steps:
- name: Checkout repo
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Set checked out repo as a safe git directory
run: git config --global --add safe.directory /__w/${{ github.event.repository.name }}/${{ github.event.repository.name }}
- name: Build and run lorenz_96 with mpi
Expand All @@ -35,7 +35,7 @@ jobs:
options: '--cap-add=SYS_PTRACE'
steps:
- name: Checkout repo
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Set checked out repo as a safe git directory
run: git config --global --add safe.directory /__w/${{ github.event.repository.name }}/${{ github.event.repository.name }}
- name: Build and run lorenz_63 with no mpi
Expand All @@ -53,7 +53,7 @@ jobs:
options: '--cap-add=SYS_PTRACE'
steps:
- name: Checkout repo
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Set checked out repo as a safe git directory
run: git config --global --add safe.directory /__w/${{ github.event.repository.name }}/${{ github.event.repository.name }}
- name: Build and run lorenz_96 with mpif08
Expand Down
11 changes: 11 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,17 @@ individual files.

The changes are now listed with the most recent at the top.

**February 1 2024 :: RTTOV13 cloud bug-fix. Tag v11.0.2**

- Initialize RTTOV13 profile cloud arrays to zero for profiles.
- Updated docs with RTTOV13 namelist info.
- New obs_def_rttov13_mod.f90 namelist option wfetch_value.
- Updated mkmf.templates for RTTOV on Derecho: HDF5 library flags.

GitHub actions changes:

- checkout action updated to v4.

**January 17 2024 :: CLM bug-fixes. Tag v11.0.1**

- CLM5-DART SourceMods path variable correction
Expand Down
25 changes: 7 additions & 18 deletions build_templates/mkmf.template.rttov.gfortran
Original file line number Diff line number Diff line change
Expand Up @@ -59,39 +59,28 @@ MPILD = mpif90
FC = gfortran
LD = gfortran

# DISCUSSION ABOUT RTTOV. DART is designed to work with RTTOV v12.3.
# There have been non-backwards compatible changes throughout the
# life-cycle of RTTOV (and more to be expected), so changing the
# RTTOV version will required additional effort to get running.
# You should install RTTOV 12.3 with HDF support. See
# https://www.nwpsaf.eu/site/software/rttov/
# for more information on installing RTTOV.

# MODIFY THE FOLLOWING VARIABLES FOR YOUR SYSTEM:
# If your NETCDF, HDFEOS5, or RTTOV environment variables are not set,
# If your NETCDF, HDF5, or RTTOV environment variables are not set,
# uncomment the following line and set value to where lib and include
# are found for the netcdf files that match this compiler.
# Since netCDF can be built with HDF5, many systems have the HDF5
# installation in the same place as netCDF.
#
# NETCDF = /usr/lib/x86_64-linux-gnu
# HDFEOS5 = /usr/include/hdf5/serial
# RTTOV = ~/research/satellite/rttov

RTTOV_VERSION = 12

HDFEOS5 = /Users/thoar/gnu/gnu-9.2.0/
# HDF5 = $(NETCDF)
# RTTOV = /glade/campaign/cisl/dares/libraries/rttov132_gfortran/

# You will likely not need to modify below this line
RTTOV_VERSION = 13

RTLIBS = -lrttov$(RTTOV_VERSION)_wrapper -lrttov$(RTTOV_VERSION)_mw_scatt -lrttov$(RTTOV_VERSION)_brdf_atlas \
-lrttov$(RTTOV_VERSION)_emis_atlas -lrttov$(RTTOV_VERSION)_other -lrttov$(RTTOV_VERSION)_parallel \
-lrttov$(RTTOV_VERSION)_coef_io -lrttov$(RTTOV_VERSION)_hdf -lrttov$(RTTOV_VERSION)_main

INCS = -I$(NETCDF)/include -I$(HDFEOS5)/include -I$(RTTOV)/include -I$(RTTOV)/mod
INCS = -I$(NETCDF)/include -I$(HDF5)/include -I$(RTTOV)/include -I$(RTTOV)/mod

# Note some versions of hdf5 need -lhdf5hl_fortran instead of -lhdf5_hl_fortran
LIBS = -L$(NETCDF)/lib -lnetcdff -lnetcdf \
-L$(HDFEOS5)/lib -lhdf5hl_fortran -lhdf5_hl -lhdf5_fortran -lhdf5 \
-L$(HDF5)/lib -lhdf5_hl_fortran -lhdf5_hl -lhdf5_fortran -lhdf5 \
-L$(RTTOV)/lib $(RTLIBS)

FFLAGS = -O2 -ffree-line-length-none $(INCS)
Expand Down
124 changes: 7 additions & 117 deletions build_templates/mkmf.template.rttov.intel
Original file line number Diff line number Diff line change
Expand Up @@ -4,143 +4,33 @@
# by UCAR, "as is", without charge, subject to all terms of use at
# http://www.image.ucar.edu/DAReS/DART/DART_download

# typical use with mkmf
# mkmf -t mkmf.template.xxxx ...
#
# FFLAGS useful for DEBUGGING. NOTE: The intel compiler can provide a lot more
# information if you LEAVE the object and module files intact.
# Do not remove the *.o and *.mod files when debugging code.
#
# -g include debugging information. these are all synonyms.
# -debug full
# -debug all
# -O0 setting -g will make this the default (no optimization).
# it is possible to set -g and then explicitly set -O2 if
# the behavior being debugged depends on optimization changes.
# -ftrapuv traps if a local variable is used before being set
# -C enables all runtime checks. -C and -check all are synonyms.
# -check all
# -check <keywords> enables/disables more specific runtime checks.
# keywords: [arg_temp_created,bounds,overflow,format,pointers,uninit]
# -warn <keywords> the level of warning messages issued.
# keywords: [alignments, argument_checking, declarations,
# errors, fileopt, general, ignore_loc,
# stderrors, truncated_source, uncalled,
# uninitialized, unused, usage, all]
# -fp-stack-check catches conditions where the FP stack is not correct.
# Typically this is when a real function is called as if it were a
# subroutine, OR a subroutine is called as if it were a function (return
# values left of FP stack OR too much data is taken off the FP stack)
# -vec-reportN controls how much diagnostic output is printed about
# loops vectorized by the compiler. N = 0 is silent,
# N can have values up to 5.
# -traceback tells the compiler to generate extra information in the
# object file to provide source file traceback information
# when a severe error occurs at run time
#
# FFLAGS useful for bitwise reproducibility and accuracy control
# (these will slow down performance to various degrees)
# -fp-model precise control how floating point roundoff is done so it is
# reproducible from run to run. in simple tests this
# flag alone was enough to create bitwise reproducible
# code but slowed execution significantly.
# -ftz 'flush to zero' underflows result in zero. set by default if
# any -O other than -O0 set, or if -fpe0 or -fpe1 set.
# -fpeN controls floating point exception handling. -fpe0 rounds underflow
# to zero and traps on any other exception type.
# -pc80 set internal FPU precision to 64 bit significand
# (default is -pc64 with 53 internal bits)
#
# FFLAGS useful for production
# -O2 default. optimize without too much unrepeatable numerical games
# -O3 more aggressive optimizations. check numerical differences
# before using this indiscriminately.
# -O1 if you get compile-time errors about out of memory or unable to
# complete compilation because of complexity, try lowering the
# optimization level on the offending source files.
# -ipo enable optimizations between routines in separate source files
# -heap-arrays 10 allocate large arrays from the heap instead of putting them
# on the stack. the number is the limit in KB for when arrays
# move from the stack to the heap. this can help if you get stack
# overflow errors and cannot increase the stack size more.
# allocating from the stack is faster, but it's usually a smaller
# size than the heap.
# -x, -m, -ax, -mcode, -march all these flags tell the compiler to generate
# processor-specific or vector instructions. either 'man ifort' or
# ifort --help to see what the current list of options are and
# which have priority over the others.
# (for those running on yellowstone, -axavx will enable the advanced
# vector instructions available on the sandy bridge processors.)
# -assume buffered_io allows the runtime library to buffer up individual
# writes before calling the operating system. in particular, we
# write our observation sequence files as a series of many individual
# calls to the write() routine. when debugging you do not want to
# buffer so you can see the last output before the program dies.
# for production, however, you want to batch up writes into larger
# blocks before stopping to do i/o to disk. an alternative at
# runtime is to set FORT_BUFFERED to 'true' in your environment.
# (e.g. csh family: setenv FORT_BUFFERED true or
# ksh family: export FORT_BUFFERED=true).
#
# FFLAGS possibly useful, not normally used by DART
# -fpp run Fortran preprocessor on source files prior to compilation
# -free interpret source as free-format, regardless of file extension
# -r8 specify default real size. note that for DART we use explicit
# types on all our real values so this will not change anything
# inside DART. see DART/common/types_mod.f90 if you must run
# with single precision reals.
# -convert big_endian useful if you're on the wrong architecture.
# however this controls both reading and writing so you can't
# use it as a conversion mechanism unless you write files out
# in ascii format. applies to all unformatted fortran i/o.
# -assume byterecl ... more 'industry-standard' direct-access behavior
# controls what units the RECL (record length) specifier returns.
#
# Runtime environment variables that influence the compiler behavior:
#
# Make output lines for fortran write statements longer without wrapping:
# setenv FORT_FMT_RECL 512 (or any length)
#
# IF YOU HAVE MORE CURRENT COMPILER INFORMATION, PLEASE SHARE IT WITH US.

MPIFC = mpif90
MPILD = mpif90
FC = ifort
LD = ifort

# DISCUSSION ABOUT RTTOV. DART is designed to work with RTTOV v12.3.
# There have been non-backwards compatible changes throughout the
# life-cycle of RTTOV (and more to be expected), so changing the
# RTTOV version will required additional effort to get running.
# You should install RTTOV 12.3 with HDF support. See
# https://www.nwpsaf.eu/site/software/rttov/
# for more information on installing RTTOV.

# MODIFY THE FOLLOWING VARIABLES FOR YOUR SYSTEM:
# If your NETCDF, HDFEOS5, or RTTOV environment variables are not set,
# If your NETCDF, HDF5, or RTTOV environment variables are not set,
# uncomment the following line and set value to where lib and include
# are found for the netcdf files that match this compiler.
# Since netCDF can be built with HDF5, many systems have the HDF5
# installation in the same place as netCDF.
#
# NETCDF = /opt/local
# HDFEOS5 = $(NETCDF)
# RTTOV = ~/research/satellite/rttov

RTTOV_VERSION = 12

HDFEOS5 = /glade/u/apps/ch/opt/hdf-eos5/5.1.16/intel/19.0.5
# HDF5 = $(NETCDF)
# RTTOV = /glade/campaign/cisl/dares/libraries/rttov132_intel/

# You will likely not need to modify below this line
RTTOV_VERSION = 13

RTLIBS = -lrttov$(RTTOV_VERSION)_wrapper -lrttov$(RTTOV_VERSION)_mw_scatt -lrttov$(RTTOV_VERSION)_brdf_atlas \
-lrttov$(RTTOV_VERSION)_emis_atlas -lrttov$(RTTOV_VERSION)_other -lrttov$(RTTOV_VERSION)_parallel \
-lrttov$(RTTOV_VERSION)_coef_io -lrttov$(RTTOV_VERSION)_hdf -lrttov$(RTTOV_VERSION)_main

INCS = -I$(NETCDF)/include -I$(HDFEOS5)/include -I$(RTTOV)/include -I$(RTTOV)/mod
INCS = -I$(NETCDF)/include -I$(HDF5)/include -I$(RTTOV)/include -I$(RTTOV)/mod

# Note some version of hdf5 need -lhdf5hl_fortran instead of -lhdf5_hl_fortran
LIBS = -L$(NETCDF)/lib -lnetcdff -lnetcdf \
-L$(HDFEOS5)/lib -lhdf5hl_fortran -lhdf5_hl -lhdf5_fortran -lhdf5 \
-L$(HDF5)/lib -lhdf5_hl_fortran -lhdf5_hl -lhdf5_fortran -lhdf5 \
-L$(RTTOV)/lib $(RTLIBS)

FFLAGS = -O2 -assume buffered_io $(INCS)
Expand Down
2 changes: 1 addition & 1 deletion conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
author = 'Data Assimilation Research Section'

# The full version, including alpha/beta/rc tags
release = '11.0.1'
release = '11.0.2'
root_doc = 'index'

# -- General configuration ---------------------------------------------------
Expand Down
2 changes: 2 additions & 0 deletions guide/preprocess-program.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
.. _preprocess:

How DART supports different types of observations: the preprocess program
=========================================================================

Expand Down
12 changes: 9 additions & 3 deletions observations/forward_operators/obs_def_rttov13_mod.f90
Original file line number Diff line number Diff line change
Expand Up @@ -592,7 +592,7 @@ module obs_def_rttov_mod
type(rttov_platform_type), pointer :: platforms(:)

! version controlled file description for error handling, do not edit
character(len=*), parameter :: source = 'obs_def_rttov_mod.f90'
character(len=*), parameter :: source = 'obs_def_rttov13_mod.f90'
character(len=*), parameter :: revision = ''
character(len=*), parameter :: revdate = ''

Expand Down Expand Up @@ -629,7 +629,7 @@ module obs_def_rttov_mod
! -----------------------------------------------------------------------------
! DART/RTTOV options in the input.nml namelist.
!
! DART exposes all of the RTTOV 12.3 options available and passes them to
! DART exposes all of the RTTOV 13 options available and passes them to
! RTTOV with little to no additional checking for consistency. The default in
! most cases can be used and need not be specified in the namelist.
!
Expand Down Expand Up @@ -708,6 +708,8 @@ module obs_def_rttov_mod
integer :: htfrtc_n_pc = -1 ! number of PCs to use (HTFRTC only, max 300)
logical :: htfrtc_simple_cloud = .false. ! use simple-cloud scattering (HTFRTC only)
logical :: htfrtc_overcast = .false. ! calculate overcast radiances (HTFRTC only)
real(r8) :: wfetc_value = 100000.0_r8 ! Real wfetc Wind fetch (m) (length of water over which the wind has blown, typical
! value 100000m for open ocean). Used if wfetc not provided by model.

namelist / obs_def_rttov_nml/ rttov_sensor_db_file, &
first_lvl_is_sfc, &
Expand Down Expand Up @@ -779,7 +781,8 @@ module obs_def_rttov_mod
use_htfrtc, &
htfrtc_n_pc, &
htfrtc_simple_cloud, &
htfrtc_overcast
htfrtc_overcast, &
wfetc_value

type(atmos_profile_type) :: atmos
type(trace_gas_profile_type) :: trace_gas
Expand Down Expand Up @@ -2211,6 +2214,7 @@ subroutine do_forward_model(ens_size, nlevels, flavor, location, &
end if

! depending on the vertical velocity and land type, classify clouds the way RTTOV wants
runtime % profiles(imem) % cloud(:,:) = 0.0_jprb
if (.not. is_cumulus) then
! stratus
if (surftype == 0) then
Expand Down Expand Up @@ -2342,6 +2346,8 @@ subroutine do_forward_model(ens_size, nlevels, flavor, location, &
if (allocated(atmos % wfetch)) then
! Wind fetch over the ocean (m)
runtime % profiles(imem) % s2m % wfetc = atmos % wfetch(imem)
else
runtime % profiles(imem) % s2m % wfetc = wfetc_value
end if

! Surface type (0=land, 1=sea, 2=sea-ice)
Expand Down
Loading

0 comments on commit 82f7e91

Please sign in to comment.