Skip to content

Commit

Permalink
Rename FakeLevels and minor cleaning in BUMP (#943)
Browse files Browse the repository at this point in the history
* Rename FakeLevels and minor

* Fix validTime_ usage
  • Loading branch information
benjaminmenetrier authored Sep 26, 2024
1 parent 45150c7 commit 1ca1596
Show file tree
Hide file tree
Showing 28 changed files with 270 additions and 219 deletions.
6 changes: 4 additions & 2 deletions src/saber/blocks/SaberCentralBlockBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class SaberCentralBlockBase : public util::Printable, private boost::noncopyable
public:
explicit SaberCentralBlockBase(const SaberBlockParametersBase & params,
const util::DateTime & validTime)
: blockName_(params.saberBlockName), validTime_(validTime) {}
: validTime_(validTime), blockName_(params.saberBlockName) {}
virtual ~SaberCentralBlockBase() {}

// Application methods
Expand Down Expand Up @@ -133,9 +133,11 @@ class SaberCentralBlockBase : public util::Printable, private boost::noncopyable
const oops::Variables &,
const double &) const;

protected:
const util::DateTime validTime_;

private:
std::string blockName_;
const util::DateTime validTime_;
virtual void print(std::ostream &) const = 0;
};

Expand Down
8 changes: 5 additions & 3 deletions src/saber/blocks/SaberOuterBlockBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ class SaberOuterBlockBase : public util::Printable, private boost::noncopyable {
public:
explicit SaberOuterBlockBase(const SaberBlockParametersBase & params,
const util::DateTime & validTime)
: blockName_(params.saberBlockName), skipInverse_(params.skipInverse),
filterMode_(params.filterMode), validTime_(validTime) {}
: validTime_(validTime), blockName_(params.saberBlockName), skipInverse_(params.skipInverse),
filterMode_(params.filterMode) {}
virtual ~SaberOuterBlockBase() {}

// Accessor
Expand Down Expand Up @@ -174,11 +174,13 @@ class SaberOuterBlockBase : public util::Printable, private boost::noncopyable {
const double &,
const double &) const;

protected:
const util::DateTime validTime_;

private:
const std::string blockName_;
const bool skipInverse_;
const bool filterMode_;
const util::DateTime validTime_;
virtual void print(std::ostream &) const = 0;
};

Expand Down
4 changes: 2 additions & 2 deletions src/saber/bump/BUMP.cc
Original file line number Diff line number Diff line change
Expand Up @@ -388,13 +388,13 @@ void BUMP::addEnsemble(const oops::FieldSets & fsetEns) {
if (dualResolutionGridUid_ == "") {
igeom = 0;
if (fsetEns[jj].getGridUid() != gridUid_) {
oops::Log::info() << "BUMP::iterativeUpdate: wrong grid UID" << std::endl;
oops::Log::info() << "BUMP::addEnsemble: wrong grid UID" << std::endl;
std::abort();
}
} else {
igeom = 1;
if (fsetEns[jj].getGridUid() != dualResolutionGridUid_) {
oops::Log::info() << "BUMP::iterativeUpdate: wrong dual resolution grid UID" << std::endl;
oops::Log::info() << "BUMP::addEnsemble: wrong dual resolution grid UID" << std::endl;
std::abort();
}
}
Expand Down
1 change: 1 addition & 0 deletions src/saber/bump/subr_list.fypp
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,7 @@
#:set subr_list = subr_list + ["linop_alloc"]
#:set subr_list = subr_list + ["linop_dealloc"]
#:set subr_list = subr_list + ["linop_copy"]
#:set subr_list = subr_list + ["linop_trim"]
#:set subr_list = subr_list + ["linop_read"]
#:set subr_list = subr_list + ["linop_write_def"]
#:set subr_list = subr_list + ["linop_write_data"]
Expand Down
6 changes: 3 additions & 3 deletions src/saber/bump/tools_ssrfpack.fypp
Original file line number Diff line number Diff line change
Expand Up @@ -663,8 +663,8 @@ end if
end subroutine ssrfpack_givens

!----------------------------------------------------------------------
! Subroutine: ssrfpack_givens
!> Construct the Givens plane rotation
! Subroutine: ssrfpack_gradl
!> Compute estimated gradients at the nodes
!----------------------------------------------------------------------
subroutine ssrfpack_gradl(mpl,n,k,x,y,z,w,list,lptr,lend,g)

Expand Down Expand Up @@ -794,7 +794,7 @@ end do

! Test the linear portion of the stabilized system for ill-conditioning
dmin = min(abs(a(4,4)),abs(a(5,5)) )
IF (dmin<dtol) call mpl%abort('${subr}$','No unique solution due to collinear nodes')
if (dmin<dtol) call mpl%abort('${subr}$','No unique solution due to collinear nodes')

! Solve the 2 by 2 triangular system for the estimated partial derivatives
12 dy = a(6,5)/a(5,5)
Expand Down
2 changes: 1 addition & 1 deletion src/saber/bump/type_avg_blk.fypp
Original file line number Diff line number Diff line change
Expand Up @@ -753,7 +753,7 @@ type(mom_blk_type),intent(in) :: mom_blk !< Moments

! Local variables
integer :: il0,jl0,jl0r,jc3,jc4,isub,jsub,nc1max,ic1d,ic1u,i,nc1a,nc1a_cor
real(kind_real) :: m2_1,m2_2,norm,den,gen_kurt,mean_cor
real(kind_real) :: m2_1,m2_2,norm,den,gen_kurt
real(kind_real),allocatable :: list_m11(:),list_m11m11(:,:,:),list_m2m2(:,:,:),list_m22(:,:),list_cor(:),list_cor_save(:,:,:,:,:)
logical :: valid

Expand Down
Loading

0 comments on commit 1ca1596

Please sign in to comment.