Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cmake/compiler_flags_Intel_Fortran.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ set( CMAKE_Fortran_FLAGS_RELEASE "-O3 -ip -unroll -inline -no-heap-arrays" )
# DEBUG FLAGS
####################################################################

set( CMAKE_Fortran_FLAGS_DEBUG "-O0 -g -check bounds -traceback -warn -heap-arrays -fpe-all=0 -fpe:0 -check all" )
set( CMAKE_Fortran_FLAGS_DEBUG "-O0 -g -check bounds -traceback -warn -heap-arrays -fpe-all=0 -fpe:0 -check all -warn all" )

####################################################################
# BIT REPRODUCIBLE FLAGS
Expand Down
42 changes: 42 additions & 0 deletions cmake/compiler_flags_Intel_LLVM_CXX.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
####################################################################
# FLAGS COMMON TO ALL BUILD TYPES
####################################################################

####################################################################
# RELEASE FLAGS
####################################################################

set( CMAKE_CXX_FLAGS_RELEASE "-O3" )

####################################################################
# DEBUG FLAGS
####################################################################

set( CMAKE_CXX_FLAGS_DEBUG "-O0 -g -ffp-exception-behavior=strict -ftrapping-math -Wall" )

####################################################################
# RELEASE WITH DEBUG INFO (DEFAULT)
####################################################################

set( CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g -DNDEBUG" )

####################################################################
# BIT REPRODUCIBLE FLAGS
####################################################################

set( CMAKE_CXX_FLAGS_BIT "-O2" )

####################################################################
# LINK FLAGS
####################################################################

set( CMAKE_CXX_LINK_FLAGS "" )

####################################################################
# FLAGS FOR AUTOPROFILING
####################################################################

set( CXX_AUTOPROFILING_FLAGS "-finstrument-functions" )

####################################################################

2 changes: 2 additions & 0 deletions cmake/oops_compiler_flags.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ endif()

if( CMAKE_CXX_COMPILER_ID MATCHES "GNU" )
include( compiler_flags_GNU_CXX )
elseif( CMAKE_CXX_COMPILER_ID MATCHES "IntelLLVM" )
include( compiler_flags_Intel_LLVM_CXX )
elseif( CMAKE_CXX_COMPILER_ID MATCHES "Intel" )
include( compiler_flags_Intel_CXX )
elseif( CMAKE_CXX_COMPILER_ID MATCHES "XL" )
Expand Down
3 changes: 2 additions & 1 deletion qg/model/qg_change_var_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ module qg_change_var_mod
use oops_variables_mod

implicit none
external abor1_ftn

private
public :: qg_change_var_registry
Expand Down Expand Up @@ -252,4 +253,4 @@ subroutine qg_change_var_ad(fld,vars)

end subroutine qg_change_var_ad
! ------------------------------------------------------------------------------
end module qg_change_var_mod
end module qg_change_var_mod
1 change: 1 addition & 0 deletions qg/model/qg_error_covariance_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ module qg_error_covariance_mod
use random_mod

implicit none
external abor1_ftn, dsyev, dsymv

private
public :: qg_error_covariance_config
Expand Down
1 change: 1 addition & 0 deletions qg/model/qg_fields_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ module qg_fields_mod
use random_mod

implicit none
external abor1_ftn

private
public :: rseed
Expand Down
1 change: 1 addition & 0 deletions qg/model/qg_geom_iter_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ module qg_geom_iter_mod
use qg_geom_mod

implicit none
external abor1_ftn

private
public :: qg_geom_iter
Expand Down
1 change: 1 addition & 0 deletions qg/model/qg_geom_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ module qg_geom_mod
use qg_projection_mod

implicit none
external abor1_ftn, dgeev, dgetrf, dgetri

private
public :: qg_geom
Expand Down
1 change: 1 addition & 0 deletions qg/model/qg_getvalues_interp_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ module qg_getvalues_interp_mod
use qg_interp_mod

implicit none
external abor1_ftn

private
public :: qg_getvalues_interp, qg_getvalues_interp_ad
Expand Down
2 changes: 2 additions & 0 deletions qg/model/qg_gom_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ module qg_gom_mod
use string_f_c_mod

implicit none
external abor1_ftn

private
public :: qg_gom
public :: qg_gom_registry
Expand Down
1 change: 1 addition & 0 deletions qg/model/qg_interp_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ module qg_interp_mod
use qg_tools_mod

implicit none
external abor1_ftn

private
public :: qg_interp_trilinear, qg_interp_trilinear_ad, qg_interp_bilinear, qg_interp_bilinear_ad, &
Expand Down
1 change: 1 addition & 0 deletions qg/model/qg_model_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ module qg_model_mod
use random_mod

implicit none
external abor1_ftn

private
public :: qg_model_config
Expand Down
1 change: 1 addition & 0 deletions qg/model/qg_obsdb_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ module qg_obsdb_mod
use string_f_c_mod

implicit none
external abor1_ftn

private
public :: qg_obsdb
Expand Down
1 change: 1 addition & 0 deletions qg/model/qg_obsvec_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ module qg_obsvec_mod
use random_mod

implicit none
external abor1_ftn

private
public :: qg_obsvec
Expand Down
1 change: 1 addition & 0 deletions qg/model/qg_projection_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ module qg_projection_mod
use qg_constants_mod

implicit none
external abor1_ftn

private
public :: xy_to_lonlat,lonlat_to_xy
Expand Down
1 change: 1 addition & 0 deletions qg/model/qg_tools_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ module qg_tools_mod
use qg_constants_mod

implicit none
external abor1_ftn

private
public :: genfilename,ncerr,baroclinic_instability,large_vortices
Expand Down
1 change: 1 addition & 0 deletions qg/model/qg_wspeed_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ module qg_wspeed_mod
use oops_variables_mod

implicit none
external abor1_ftn

private
public :: qg_wspeed_equiv,qg_wspeed_equiv_tl,qg_wspeed_equiv_ad, &
Expand Down
4 changes: 2 additions & 2 deletions src/oops/assimilation/CostJbTotal.h
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,8 @@ template<typename MODEL, typename OBS> class CostJbTotal {
const JbState_ & jbState() const {return *jb_;}
const JbModelAux_ & jbModBias() const {return jbModBias_;}
const JbObsAux_ & jbObsBias() const {return *jbObsBias_;}
const util::DateTime & windowBegin() const {return timeWindow_.start();}
const util::DateTime & windowEnd() const {return timeWindow_.end();}
const util::DateTime windowBegin() const {return timeWindow_.start();}
const util::DateTime windowEnd() const {return timeWindow_.end();}
/// continuous DA update
void applyContDaUpdate(const eckit::Configuration &, std::vector<util::DateTime> &);

Expand Down
3 changes: 3 additions & 0 deletions src/oops/assimilation/FtnTriDiagSpectrum.F90
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ subroutine tridiagev(nn, diag, subd, eval, evec) bind(c,name='FtnTriDiagSpectrum
use kinds

implicit none
external dsteqr
external abor1_ftn

integer(c_int), intent(in) :: nn !< Size of matrix
real(c_double), intent(in) :: diag(nn) !< Diagonal elements
real(c_double), intent(in) :: subd(nn-1) !< Sub-diagonal elements
Expand Down
4 changes: 2 additions & 2 deletions src/oops/assimilation/LETKFSolverPert.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ class LETKFSolverPert : public LETKFSolver<MODEL, OBS> {
const Eigen::MatrixXd & Yb, const Eigen::VectorXd & invVarR);

/// Applies weights and adds posterior inflation
virtual void applyWeights(const IncrementEnsemble4D_ &, IncrementEnsemble4D_ &,
const GeometryIterator_ &);
void applyWeights(const IncrementEnsemble4D_ &, IncrementEnsemble4D_ &,
const GeometryIterator_ &) override;

private:
// departure ensemble object of observation perturbations
Expand Down
2 changes: 2 additions & 0 deletions src/oops/assimilation/gletkf_mod.f90
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,8 @@ subroutine letkf_core(nobsl,hxens,hxens_orig,dep,wts_ensmean,wts_ensperts,&
!$$$ end documentation block

implicit none
external dgemm, dsyevd, sgemm, ssyevd, abor1_ftn

integer(i_kind), intent(in) :: nobsl,nanals,neigv
real(r_kind),dimension(nobsl),intent(in ) :: rdiaginv_loc
real(r_kind),dimension(nanals,nobsl),intent(inout) :: hxens
Expand Down
9 changes: 6 additions & 3 deletions src/oops/base/StructuredGridWriter.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,9 @@ void writerForPressures(const atlas::FieldSet & fset,
// NetCDF IDs
int ncid; // file ID
int lat_did, lon_did, lev_did; // dim IDs
int lat_vid, lon_vid, lev_vid, field_vid[vars.size()]; // var IDs
int lat_vid, lon_vid, lev_vid; // var IDs
std::vector<int> field_vid(vars.size()); // var IDs

int ncvartype; // float or double

// NetCDF file path
Expand Down Expand Up @@ -170,8 +172,9 @@ void writerForLevels(const atlas::FieldSet & fset,

// NetCDF IDs
int ncid; // file ID
int lat_did, lon_did, lev_did, sfc_did; // dim IDs
int lat_vid, lon_vid, lev_vid, field_vid[vars.size()]; // var IDs
int lat_did, lon_did, lev_did, sfc_did; // dim IDs
int lat_vid, lon_vid, lev_vid; // var IDs
std::vector<int> field_vid(vars.size()); // var IDs
int ncvartype; // float or double

// NetCDF file path
Expand Down
3 changes: 2 additions & 1 deletion src/oops/generic/fft_multiple_f.F90
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

!--


subroutine fft_gp2spe(ds_mfft, size_mfft, no_seq, no_el_seq) bind(c)

use iso_c_binding
Expand All @@ -18,6 +17,7 @@ subroutine fft_gp2spe(ds_mfft, size_mfft, no_seq, no_el_seq) bind(c)
!--

implicit none
external fft_gpoint2spectral_f

!--

Expand Down Expand Up @@ -52,6 +52,7 @@ subroutine fft_spe2gp(ds_mfft, size_mfft, no_seq, no_el_seq) bind(c)
!--

implicit none
external fft_spectral2gpoint_f

!--

Expand Down
4 changes: 2 additions & 2 deletions src/oops/runs/Test.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,15 @@ int Test::execute(const eckit::Configuration & config) const {

// Generate the argc and argv arguments for unit_test_main(...)
int argc = 1;
char * argv[argc];
std::vector<char*> argv(argc);
char dummy[] = "abcde";
argv[0] = dummy;

// Run the tests
Log::trace() << "Registering the unit tests" << std::endl;
register_tests();
Log::trace() << "Running the unit tests" << std::endl;
int result = eckit::testing::run_tests(argc, argv, false);
int result = eckit::testing::run_tests(argc, argv.data(), false);
Log::trace() << "Finished running the unit tests" << std::endl;
Log::error() << "Finished running the unit tests, result = " << result << std::endl;

Expand Down
16 changes: 10 additions & 6 deletions src/oops/util/FieldSetHelpers.cc
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#include <cmath>
#include <memory>
#include <tuple>
#include <vector>

#include "atlas/array.h"
#include "atlas/util/function/VortexRollup.h"
Expand Down Expand Up @@ -969,7 +970,8 @@ void readFieldSet(const eckit::mpi::Comm & comm,
}

// NetCDF IDs
int ncid, retval, var_id[vars.size()];
int ncid, retval;
std::vector<int> var_id(vars.size());

if (oneFilePerTask) {
// Case 1: one file per MPI task
Expand Down Expand Up @@ -1161,7 +1163,8 @@ void readRank3FieldSet(const atlas::FunctionSpace & fspace,
const std::string & ncfilepath,
const bool & checkDims) {
// Initialize NetCDF return value and IDs
int retval, ncid, dimid, varid[vars.size()];
int retval, ncid, dimid;
std::vector<int> varid(vars.size());
size_t rank3Size;

oops::Log::info() << "Info : Reading file: " << ncfilepath << std::endl;
Expand Down Expand Up @@ -1270,8 +1273,9 @@ void writeFieldSet(const eckit::mpi::Comm & comm,
}

// NetCDF IDs
int retval, ncid, nx_id, ny_id, nb_nodes_id, nz_id[vars.size()],
d1D_id[1], d2D_id[2], d3D_id[3], lon_id, lat_id, var_id[vars.size()];
int retval, ncid, nx_id, ny_id, nb_nodes_id,
d1D_id[1], d2D_id[2], d3D_id[3], lon_id, lat_id;
std::vector<int> var_id(vars.size()), nz_id(vars.size());

if (oneFilePerTask) {
// Case 1: one file per MPI task
Expand Down Expand Up @@ -1629,8 +1633,8 @@ void writeRank3FieldSet(const atlas::FieldSet & fset,
const std::string & ncfilepath,
const double & msvalr) {
// Initialize NetCDF return value and IDs
int retval, ncid, nb_nodes_id, d1D_id[1], d3D_id[3], lon_id, lat_id,
nz_id[vars.size()], nv_id[vars.size()], var_id[vars.size()];
int retval, ncid, nb_nodes_id, d1D_id[1], d3D_id[3], lon_id, lat_id;
std::vector<int> nz_id(vars.size()), nv_id(vars.size()), var_id(vars.size());

// Get number of nodes
size_t nb_nodes = 0;
Expand Down
11 changes: 11 additions & 0 deletions src/oops/util/abor1_ftn.F90
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,14 @@

!> Prints an error message and stops the execution.

!module abor1_mod

!implicit none
!private
!public abor1_ftn

!contains

subroutine abor1_ftn(cderror)
use, intrinsic :: iso_c_binding, only: c_char
use string_f_c_mod
Expand All @@ -36,3 +44,6 @@ end subroutine abor1_cpp
call exit(1) ! just in case!!!

end subroutine abor1_ftn

!end module abor1_mod

3 changes: 3 additions & 0 deletions src/oops/util/datetime_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ module datetime_mod
subroutine datetime_create(fstring, self)
use fckit_log_module, only : fckit_log
implicit none
external abor1_ftn
type(datetime), intent(out) :: self
character(len=*), intent(in) :: fstring
character(kind=c_char,len=1), allocatable :: cstring(:)
Expand All @@ -86,6 +87,7 @@ end subroutine datetime_create

subroutine datetime_delete(self)
implicit none
external abor1_ftn
type(datetime), intent(inout) :: self

if (c_associated(self%ptr)) then
Expand Down Expand Up @@ -314,6 +316,7 @@ end subroutine f_c_push_to_datetime_vector

subroutine datetime_format_string(fstring, self)
implicit none
external abor1_ftn
type(datetime), intent(inout) :: self
character(len=*), intent(inout) :: fstring
character(kind=c_char,len=1), allocatable :: cstring(:)
Expand Down
1 change: 1 addition & 0 deletions src/oops/util/linkedList_c.f
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ subroutine get_(self,key,ptr)
type (LISTED_TYPE), pointer :: ptr

type(node_t), pointer :: next
external abor1_ftn

!note that the list starts from self%head%next
next => self%head
Expand Down
1 change: 1 addition & 0 deletions src/oops/util/netcdf_utils_mod.f90
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ module netcdf_utils_mod
use netcdf

implicit none
external abor1_ftn
private
public nccheck

Expand Down
Loading