Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
221 commits
Select commit Hold shift + click to select a range
970fe2e
begin working on upgraded mgbf
TingLei-daprediction Feb 6, 2024
9119765
working on mgbf
TingLei-daprediction Feb 6, 2024
8937bef
Merge branch 'develop' into feature/mgbf_tl
TingLei-daprediction Apr 5, 2024
cefeedc
an initial basic version for mgbf in saber using the stand-alone mgb…
TingLei-daprediction May 1, 2024
9ed9665
Merge branch 'develop' into feature/mgbf_tl
TingLei-daprediction May 3, 2024
fe1b6ad
a version with codes to use interpolator from saber::gsi and using th…
TingLei-daprediction May 13, 2024
5a6c958
Merge branch 'develop' into feature/mgbf_tl_v1_oldcmake
TingLei-daprediction May 14, 2024
03a5532
Merge branch 'develop' into feature/mgbf_tl_v1_oldcmake
TingLei-daprediction May 16, 2024
b69bb5c
mgbf version being debugged
TingLei-daprediction May 25, 2024
4c087bb
a working mgbf version verified by Dirac test with fv3
TingLei-daprediction Jun 4, 2024
e7bf8bf
mgbf being debugged
TingLei-daprediction Jun 14, 2024
92daf7f
under debugging/verfication
TingLei-daprediction Jun 14, 2024
ba9d2da
debugging coding
TingLei-daprediction Jul 2, 2024
941b724
a working version of mgbf for fv3jedi
TingLei-daprediction Jul 16, 2024
bc1f741
Merge branch 'develop' into feature/mgbf_tl_v1_oldcmake
TingLei-daprediction Jul 16, 2024
b845236
continued validation of mgbf
TingLei-daprediction Jul 19, 2024
aff0b04
continued verification of mgbf codes
TingLei-daprediction Jul 21, 2024
a887c15
a version for ensemble localization using mgbf too
TingLei-daprediction Aug 19, 2024
386e998
mgbf ensemble localization dealing with 2d variables
TingLei-daprediction Aug 29, 2024
33bb24e
upgrading for treatment of 2d variables in mgbf ensemble localization…
TingLei-daprediction Sep 25, 2024
9b5bbc8
a fix in the initialization for the line filter
TingLei-daprediction Nov 1, 2024
f394467
added the function to run on reduced vertical levels
TingLei-daprediction Nov 26, 2024
fcbd1c4
added pieices for l_anal_sub_of_filt to work
TingLei-daprediction Dec 17, 2024
f3865f5
some minor changes
TingLei-daprediction Jan 2, 2025
ec989b6
changes for use of mg_timer
TingLei-daprediction Jan 12, 2025
d6c74e8
added more mg_timers
TingLei-daprediction Jan 13, 2025
0d22276
changes for mg_timers to get accumulated time
TingLei-daprediction Jan 17, 2025
a06c580
Merge branch 'develop' into feature/mgbf_new_interpolator
TingLei-daprediction Feb 6, 2025
9ed4e8b
added a basic version of mgbf using inhomogeneous weights
TingLei-daprediction Feb 10, 2025
aa8abca
used normalized adjoint in upsending_normalized for weights
TingLei-daprediction Feb 12, 2025
f016e14
adding safety check in adjoint_normalization
TingLei-daprediction Feb 18, 2025
b6fedda
the adjoint_normalized was right but not accurate enough to propogat…
TingLei-daprediction Feb 25, 2025
5813505
for debugging
TingLei-daprediction Mar 4, 2025
5c7f1b0
Merge branch 'develop' into feature/mgbf_new_interpolator
TingLei-daprediction Mar 4, 2025
44f8f72
enhanced mgbf interface to work with oops:: unstructured interpolator…
TingLei-daprediction Mar 17, 2025
6abf239
Resolved merge conflict between HEAD and develop
TingLei-daprediction Mar 28, 2025
b000a46
adding treatment for halo point inside mgbf interface (c++)
TingLei-daprediction Mar 30, 2025
daf4a4a
adding treatment for halo point inside mgbf interface (c++)
TingLei-daprediction Mar 30, 2025
a956636
update interface for gsi:: interpolator
TingLei-daprediction Mar 30, 2025
8d53c7b
added mgbf ctest in saber
TingLei-daprediction Apr 3, 2025
a7ea45a
add mgbf ctest
TingLei-daprediction May 9, 2025
a3d15fd
merge with develop branch
TingLei-daprediction May 9, 2025
2acd0e6
remove mgbf_grid and mgbf_interpolation
TingLei-daprediction May 9, 2025
7a0320a
fix to remove hard wired enforced zero of a_diff_f (used as the weght…
TingLei-daprediction May 30, 2025
c12e109
commented out some debug print lines
TingLei-daprediction Jun 13, 2025
a09a3bc
The fix for an array index out-of-bounds issue in mg_domain.f90 when…
TingLei-daprediction Jun 22, 2025
59c1453
add Jim's vertical filtering changing codes
TingLei-daprediction Jul 15, 2025
41a9298
initial work for incorporating Jim's codes for vertically varied filt…
TingLei-daprediction Jul 18, 2025
ded7a51
WIP debug the vertically stretched filtering function
TingLei-daprediction Jul 22, 2025
65bbe5a
add *top2bot*fast subs
TingLei-daprediction Jul 29, 2025
5c9c06a
WIP
TingLei-daprediction Jul 29, 2025
e4d35be
an version with Jim's stretched grid function working
TingLei-daprediction Jul 29, 2025
c4a56e2
initial changes in mgbf_covariance_mod.f90 for sdl/vdl
TingLei-daprediction Jul 31, 2025
df7cb4e
WIP : a basic version to be compiled/debugged
TingLei-daprediction Aug 5, 2025
bb0ea98
an initial succesfully built version of MGBF based sdl/vdl
TingLei-daprediction Aug 5, 2025
6af15ca
change misleading index_scale to index_member
TingLei-daprediction Aug 5, 2025
0b93b3c
when non sdl/vdl cases (nscale=nvargp=1), only one mgbf namelist fil…
TingLei-daprediction Aug 8, 2025
050146e
WIP: when non sdl/vdl cases (nscale=nvargp=1), only one mgbf namelis…
TingLei-daprediction Aug 8, 2025
e5d9513
WIP for debugging
TingLei-daprediction Aug 13, 2025
19a1a06
resolve conflict
TingLei-daprediction Aug 13, 2025
5cb4125
WIP:
TingLei-daprediction Aug 13, 2025
7ae26fb
WIP
TingLei-daprediction Aug 13, 2025
ee0437b
WIP
TingLei-daprediction Aug 13, 2025
16fb655
A version of SDL/VDL passing the initial verifications
TingLei-daprediction Aug 14, 2025
e8ed01f
merge with develop
TingLei-daprediction Aug 14, 2025
50c0991
a MGBF/SABER based SDL/VDL passing more verifications and incorporat…
TingLei-daprediction Aug 18, 2025
57e336d
To use GSIbec for regional FV3-JEDI
Masanori-NOAA Aug 19, 2025
fdfaad0
reduced the final multivariabe calculation when nvargrp==1
TingLei-daprediction Aug 21, 2025
326684d
Grid check for regional grids
Masanori-NOAA Aug 21, 2025
8f8f603
Adding optional yaml parameter
Masanori-NOAA Aug 21, 2025
944c592
added the treatment when /ensemble member index/ is not present in fset
TingLei-daprediction Aug 25, 2025
2ff2226
a fix for deallocating un-allocated array mgbf_covariance_mod.f90
TingLei-daprediction Aug 26, 2025
bdfee26
add jedi-ci action (#1090)
eap Aug 28, 2025
307755e
fix for unsafe use of ivargrp
TingLei-daprediction Sep 2, 2025
1393301
Merge branch 'develop' into feature/regional_gsibec_fv3jedi
eap Sep 2, 2025
82017da
some cleaning
TingLei-daprediction Sep 4, 2025
a0ed78b
refactored the use of rnormalization array
TingLei-daprediction Sep 5, 2025
dbf91b3
add l_use_aspt_nml and l_use_aspt_nml_input
TingLei-daprediction Sep 16, 2025
c55f744
fix for vertical layout in transfer when km2!=0 (when 2d variables e…
TingLei-daprediction Sep 20, 2025
7240a1c
Merge branch 'develop' into feature/regional_gsibec_fv3jedi
ncrossette Sep 24, 2025
7b390b6
Merge branch 'develop' into feature/regional_gsibec_fv3jedi
hu5970 Sep 25, 2025
d9e8ba3
use of the normalization coefficients profile and fix for km2!=0 on …
TingLei-daprediction Sep 23, 2025
1b775ed
optimization of the parameters controling the vertical interpolation …
TingLei-daprediction Oct 6, 2025
836fb87
Merge branch 'develop' into feature/regional_gsibec_fv3jedi
Masanori-NOAA Oct 8, 2025
fff2ef5
Update based on PR comments
Masanori-NOAA Oct 8, 2025
7b9b5d5
Remove redundant code
Masanori-NOAA Oct 8, 2025
164df5a
Merge branch 'develop' into feature/regional_gsibec_fv3jedi
danholdaway Oct 10, 2025
2601815
Merge branch 'develop' into feature/regional_gsibec_fv3jedi
ncrossette Oct 14, 2025
58c5933
Merge branch 'regional_gsibec_fv3jedi' into myfork_mgbf_gsibec_combined
TingLei-daprediction Oct 15, 2025
0fd1dc4
change to ignore missing mgbf normalization profile
TingLei-daprediction Oct 16, 2025
2847540
WIP
TingLei-daprediction Oct 27, 2025
5e768a9
WIP
TingLei-daprediction Oct 27, 2025
0dd0364
WIP
TingLei-daprediction Oct 31, 2025
7c36533
WIP
TingLei-daprediction Oct 31, 2025
67ec47a
WIP
TingLei-daprediction Oct 31, 2025
b4a5e0d
WIP
TingLei-daprediction Oct 31, 2025
7d07cc3
WIP
TingLei-daprediction Oct 31, 2025
5060c91
first successfully compiled version for inhomogeneous/anisotropic hor…
TingLei-daprediction Oct 31, 2025
b041553
WIP
TingLei-daprediction Oct 31, 2025
a540f95
WIP
TingLei-daprediction Nov 1, 2025
543a174
WIP
TingLei-daprediction Nov 1, 2025
345481b
add MGBF_GeometryBridge part
TingLei-daprediction Nov 1, 2025
fca9c52
WIP
TingLei-daprediction Nov 1, 2025
a5c012d
WIP
TingLei-daprediction Nov 1, 2025
49f1b64
WIP
TingLei-daprediction Nov 3, 2025
f616af6
WIP
TingLei-daprediction Nov 3, 2025
bf42e5f
WIP
TingLei-daprediction Nov 3, 2025
9bc40de
WIP
TingLei-daprediction Nov 4, 2025
00d3d22
WIP
TingLei-daprediction Nov 4, 2025
a393f3d
WIP
TingLei-daprediction Nov 7, 2025
4edabb9
WIP
TingLei-daprediction Nov 8, 2025
7b752ad
the inhomogeneous function passed a dirac sainity test
TingLei-daprediction Nov 13, 2025
5b5670b
WIP hardwired debug test
TingLei-daprediction Nov 19, 2025
4fe529b
WIP : passed first validation for the inhomogeneous mgbf
TingLei-daprediction Nov 21, 2025
4faf5f2
WIP
TingLei-daprediction Nov 24, 2025
604ca0b
WIP
TingLei-daprediction Nov 21, 2025
9363dca
WIP
TingLei-daprediction Nov 24, 2025
67f43bb
WIP
TingLei-daprediction Nov 26, 2025
b06cad9
WIP
TingLei-daprediction Dec 1, 2025
d0a9ed1
WIP
TingLei-daprediction Dec 3, 2025
ecb0529
WIP
TingLei-daprediction Dec 4, 2025
306e643
WIP validated for l_constant_aspt2=.false.
TingLei-daprediction Dec 11, 2025
d4419f4
WIP: for debugging
TingLei-daprediction Dec 19, 2025
cff4e0a
WIP
TingLei-daprediction Dec 20, 2025
7f8e3a8
mgbf to read in normalization profiles one for each subdomain
TingLei-daprediction Jan 5, 2026
7585a8d
add call of afield%final() in mgbf
TingLei-daprediction Jan 9, 2026
d330644
remove work_mgbf2
TingLei-daprediction Jan 10, 2026
8ca2c30
WIP
TingLei-daprediction Jan 10, 2026
3540bd9
make weig_var local
TingLei-daprediction Jan 10, 2026
9ab6ab2
Normalize line endings to LF
TingLei-daprediction Jan 10, 2026
e1e8685
WIP
TingLei-daprediction Jan 10, 2026
8db2b4a
WIP
TingLei-daprediction Nov 21, 2025
980719b
WIP
Jan 12, 2026
ab2bd11
Normalize line endings to LF
Jan 23, 2026
85b053e
WIP
Jan 24, 2026
b0b5503
Use make_indexview instead of make_view to create spectral functionsp…
benjaminmenetrier Oct 17, 2025
f4e4159
Fix leaks of FFTW allocations (#1120)
fmahebert Oct 21, 2025
3ee3b61
Destruct statics in BifourierTransformStore before underlying Atlas s…
fmahebert Oct 21, 2025
611ee6e
Fix some compile warnings (#1124)
DJDavies2 Oct 22, 2025
1f51788
QUENCH cleaning (#1103)
benjaminmenetrier Oct 22, 2025
5b76c31
Option to run SABER without OpenMP (#1126)
benjaminmenetrier Oct 23, 2025
bd1a557
ProcessPerts with diffusion (#1118)
shlyaeva Oct 24, 2025
0958eeb
Add check for geometry changes in outer blocks (#1133)
benjaminmenetrier Oct 29, 2025
89bc1d5
Remove --fast from NVHPC options (#1135)
DJDavies2 Nov 3, 2025
ee7f360
Hack for NAG linker issue (#1137)
DJDavies2 Nov 4, 2025
853a66c
Fix memory leaks (#1140)
fmahebert Nov 5, 2025
777bf0d
No send/receive for arrays of zero size (#1128)
benjaminmenetrier Nov 5, 2025
76e4fa2
Loosen tols of dirac_ens ctests (#1139)
fmahebert Nov 5, 2025
1b5d1df
Simplification of 2D variables in BUMP (#1049)
benjaminmenetrier Nov 6, 2025
8145397
Remove ktrap option (#1143)
DJDavies2 Nov 10, 2025
34494ef
Add argument (#1147)
benjaminmenetrier Nov 12, 2025
06fb691
Force nearest 3D level from yaml (#1151)
benjaminmenetrier Nov 13, 2025
cdb7934
Prepare for Atlas 0.44.1 (#1149)
mo-joshuacolclough Nov 18, 2025
3847728
New orographic interpolation block (#1052)
benjaminmenetrier Nov 19, 2025
b62bd46
Bifourier block FFT backend and calibration (#1060)
benjaminmenetrier Dec 3, 2025
8dd883a
Fix compiler warnings (#1152)
matthewrmshin Dec 3, 2025
bf4c9e9
Feature/parallel b (#1148)
MarekWlasak Dec 8, 2025
76b8cb5
Add right-inverse outer block for ensemble transform (#1155)
benjaminmenetrier Dec 10, 2025
44784d2
NICAS filter (#1141)
benjaminmenetrier Dec 12, 2025
9d8e74b
[Bugfix] Variance filtering initialization (#1161)
benjaminmenetrier Dec 15, 2025
5d3eaaa
Remove the dual resolution arguments (#1158)
benjaminmenetrier Dec 18, 2025
e8fafaf
Adapt to retirement of Increment/StateEnsemble classes (#1163)
shlyaeva Jan 15, 2026
dab9b6e
Slightly loosen a tolerance for intel ifx builds (#1168)
fmahebert Jan 20, 2026
4a2623c
Remove unused variable (#1167)
matthewrmshin Jan 21, 2026
ab923ff
Simplify ProcessPerts (#1165)
benjaminmenetrier Jan 22, 2026
3c05c33
WIP
TingLei-NOAA Jan 26, 2026
f0286a9
WIP
TingLei-NOAA Jan 26, 2026
babaab7
WIP
TingLei-NOAA Jan 26, 2026
28855e5
WIP : openmp directive for mgbf
TingLei-daprediction Jan 26, 2026
cc8d2e1
WIP
TingLei-daprediction Jan 27, 2026
51293f0
WIP: debug
TingLei-NOAA Jan 28, 2026
904403f
WIP
TingLei-NOAA Jan 28, 2026
041e44a
WIP
TingLei-NOAA Jan 28, 2026
309ec19
WIP
TingLei-NOAA Jan 28, 2026
9ec8ce7
adding fill missing values for state variable inversion
TingLei-daprediction Jan 28, 2026
13d2cb4
a working version for refactoring and openmp enhanced mgbf/saber in …
TingLei-NOAA Jan 29, 2026
587f8d6
debugging fillMisingVluees
TingLei-daprediction Jan 29, 2026
812210b
WIP
TingLei-daprediction Jan 29, 2026
4d989db
WIP
TingLei-daprediction Jan 30, 2026
7eed258
WIP
TingLei-daprediction Jan 30, 2026
1fc39cb
bug fix, a working version of the refactored mgbf_covariance_mod.f90
TingLei-daprediction Feb 6, 2026
349fa1a
WIP
TingLei-daprediction Feb 6, 2026
80c473d
major part of openmp added for mgbf component
TingLei-daprediction Feb 7, 2026
331a710
WIP: optimization
TingLei-daprediction Feb 7, 2026
548429f
WIP
TingLei-daprediction Feb 7, 2026
1947179
WIP
TingLei-daprediction Feb 7, 2026
59421a5
WIP
TingLei-daprediction Feb 7, 2026
3746382
WIP
TingLei-daprediction Feb 7, 2026
5f68edc
WIP
TingLei-daprediction Feb 7, 2026
ca8ca51
WIP
TingLei-daprediction Feb 7, 2026
9a98a3f
WIP
TingLei-daprediction Feb 8, 2026
eefc17b
WIP
TingLei-daprediction Feb 8, 2026
a0f0b73
WIP
TingLei-daprediction Feb 8, 2026
a0ac2d5
WIP
TingLei-daprediction Feb 8, 2026
a4c7ac2
WIP
TingLei-daprediction Feb 8, 2026
6ae7b1a
WIP
TingLei-daprediction Feb 8, 2026
5815b64
wip
TingLei-daprediction Feb 8, 2026
2030e9b
WIP
TingLei-daprediction Feb 8, 2026
c36b1c5
WIP
TingLei-daprediction Feb 8, 2026
6cc99b2
WIP
TingLei-daprediction Feb 8, 2026
7378923
cleaning
TingLei-daprediction Feb 9, 2026
0f13368
WIP merging
TingLei-daprediction Feb 12, 2026
e97395f
Merge branch 'develop' into tomerge
TingLei-daprediction Feb 20, 2026
e0d5dea
added Harray=0 in downsend_all_g2
TingLei-daprediction Feb 24, 2026
bcf2097
more zero initilizaiton
TingLei-daprediction Feb 24, 2026
7e87a65
upgrad mgbf to the current saber
TingLei-NOAA Feb 25, 2026
f86f3fc
WIP
TingLei-daprediction Mar 19, 2026
46c4ac5
Merge branch 'develop' into tomerge
TingLei-daprediction Apr 9, 2026
050d63b
Fix gcov usage for offline code coverage estimation (#1196)
benjaminmenetrier Apr 13, 2026
8ae1ea2
Add a block-diagonal coupled covariance with optional common outer bl…
shlyaeva Apr 15, 2026
311c38e
WIP
TingLei-daprediction Apr 15, 2026
7f260ab
Merge branch 'develop' into tomerge
TingLei-daprediction Apr 16, 2026
232860b
changes according to copilot review in https://github.com/JCSDA-inter…
TingLei-daprediction Apr 21, 2026
fc87a40
WIP
TingLei-daprediction Apr 28, 2026
1da0954
WIP
TingLei-daprediction May 5, 2026
103522b
some cleaning in mgbf
TingLei-daprediction May 6, 2026
640feac
A bug fix in the zero initialization of work1var_mgbf in vdl situations
TingLei-daprediction May 6, 2026
225f683
WIP
TingLei-daprediction May 6, 2026
6e5ddad
add more mgbf timers
TingLei-daprediction May 6, 2026
1f369e5
added scripts to review mg_timer.output
TingLei-daprediction May 8, 2026
39b9c37
WIP
TingLei-daprediction May 8, 2026
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
9 changes: 9 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Default: treat files as text and normalize to LF in the repo
* text=auto eol=lf

# (Optional) common binary types
*.png binary
*.jpg binary
*.pdf binary
*.nc binary

56 changes: 28 additions & 28 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,17 @@ else()
message( STATUS "SABER block SPECTRALB is NOT enabled" )
endif()

if( BUILD_TESTING AND ENABLE_OFFLINE_CODECOV )
## Code coverage
message( STATUS "Offline code coverage is enabled" )
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fprofile-arcs -ftest-coverage")
set( CMAKE_CXX_LINK_FLAGS "${CMAKE_CXX_LINK_FLAGS} -fprofile-arcs -ftest-coverage")
set( CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fprofile-arcs -ftest-coverage")
set( CMAKE_Fortran_LINK_FLAGS "${CMAKE_Fortran_LINK_FLAGS} -fprofile-arcs -ftest-coverage")
else()
message( STATUS "Offline code coverage is not enabled" )
endif()

## Sources
add_subdirectory( src/saber )
add_subdirectory( tools )
Expand All @@ -151,36 +162,25 @@ else()
endif()

if( BUILD_TESTING )
# Test data
find_package( jedi-model-data 1.0.0 QUIET )

## Code coverage
if ( ENABLE_OFFLINE_CODECOV )
message( STATUS "Offline code coverage is enabled" )
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fprofile-arcs -ftest-coverage")
set( CMAKE_CXX_LINK_FLAGS "${CMAKE_CXX_LINK_FLAGS} -fprofile-arcs -ftest-coverage")
set( CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fprofile-arcs -ftest-coverage")
set( CMAKE_Fortran_LINK_FLAGS "${CMAKE_Fortran_LINK_FLAGS} -fprofile-arcs -ftest-coverage")
else()
message( STATUS "Offline code coverage is not enabled" )
endif()

# If test data repo found build the tests
if( jedi-model-data_FOUND )
message( STATUS "jedi-model-data found; building saber tests" )
add_subdirectory( test )
else()
message( STATUS "jedi-model-data not found; skipping saber tests" )
endif()

## Global tests
ecbuild_add_test( TARGET saber_coding_norms_src
TYPE SCRIPT
COMMAND ${CMAKE_BINARY_DIR}/bin/${PROJECT_NAME}_cpplint.py
ARGS --quiet --recursive ${CMAKE_SOURCE_DIR}/${PROJECT_NAME}/src )
# Test data
find_package( jedi-model-data 1.0.0 QUIET )

# If test data repo found build the tests
if( jedi-model-data_FOUND )
message( STATUS "jedi-model-data found; building saber tests" )
add_subdirectory( test )
else()
message( STATUS "jedi-model-data not found; skipping saber tests" )
endif()

## Global tests
ecbuild_add_test( TARGET saber_coding_norms_src
TYPE SCRIPT
COMMAND ${CMAKE_BINARY_DIR}/bin/${PROJECT_NAME}_cpplint.py
ARGS --quiet --recursive ${CMAKE_SOURCE_DIR}/${PROJECT_NAME}/src )
endif()
if( ENABLE_QUENCH )
add_subdirectory( quench )
add_subdirectory( quench )
endif()

## Package Config
Expand Down
41 changes: 41 additions & 0 deletions cmake/compiler_flags_Intel_Fortran.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# (C) Copyright 2019 UCAR
#
# This software is licensed under the terms of the Apache Licence Version 2.0
# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.

####################################################################
# FLAGS COMMON TO ALL BUILD TYPES
####################################################################

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

#cltorg set( CMAKE_Fortran_FLAGS_RELEASE "-O3 -ip -unroll -inline -no-heap-arrays" )
set( CMAKE_Fortran_FLAGS_RELEASE "-O3 -ip -unroll -inline -no-heap-arrays -fpp" )

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

#cltorg 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 -fpp" )

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

set( CMAKE_Fortran_FLAGS_BIT "-O2 -ip -ipo -unroll -inline -no-heap-arrays" )

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

set( CMAKE_Fortran_LINK_FLAGS "" )

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

# Meaning of flags
# ----------------
# todo

54 changes: 54 additions & 0 deletions codex_context.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# codex_context.md

## Scope
- Package: saber (MGBF components)
- Focus: memory usage and filtering paths in mgbf_lib and covariance wrappers.

## Key paths
- MGBF covariance wrapper: src/saber/mgbf/covariance/mgbf_covariance_mod.f90
- MGBF core library: src/saber/mgbf/mgbf_lib/*.f90
- Filtering implementation: src/saber/mgbf/mgbf_lib/mg_filtering.f90
- Parameters: src/saber/mgbf/mgbf_lib/mg_parameter.f90
- Internal state: src/saber/mgbf/mgbf_lib/mg_intstate.f90

## Current configuration assumptions
- l_loc = .false.
- l_vertical_filter = .true.
- l_mgbf_inhomogeneous = .false.
- filtering_fast_bkg(this) is the active filter path
- mgbf_line may be .false. in the fast-bkg flow

## Memory drivers (high-level)
- Large arrays scale with km_all (= km * n_ens), im/jm (plus halo), lm, and count of arrays.
- Additional multiplicative factor when nscale or nvargrp > 1.

## Large allocations (mgbf_lib)
- VALL/HALL: (km_all, im+2*hx, jm+2*hy)
- a_diff_f/a_diff_h/b_diff_f/b_diff_h: (km_all, im+2*hx, jm+2*hy)
- paspx4d/paspy4d and ssx4d/ssy4d: (lm, im+2*hx, jm+2*hy, 2)
- pasp3 (3x3 tensor per grid point): (3,3,im,jm,lm)
- hss3: (im, jm, lm, 6)
- qcols: (0:7, im, jm, lm)
- (localization only) w1_loc..w4_loc
- (setup only; can be scoped) weig_var: (km_all, im+2*hx, jm+2*hy, gm)

## filtering_fast_bkg usage
Used arrays in filtering_fast_bkg:
- paspx4d, paspy4d, ssx4d, ssy4d
- pasp1, ss1 (vertical filter)
- VALL, HALL

Not used by filtering_fast_bkg:
- vpasp2, hss2, dixs, diys
- vpasp3, hss3, qcols, dixs3, diys3, dizs3
- ss3
- pasp2/pasp3 only needed for radial/line paths outside fast-bkg

## Notes on mgbf_covariance_mod multiply
- work_mgbf is a full 3D buffer; work2d_mgbf is a packed 2D buffer.
- work_mgbf2 was removed by user; ensure no leftover deallocate or references.

## Cleanup candidates
- Consider guarding allocation of line-operator arrays when only filtering_fast_bkg is used.
- Consider scoping weig_var allocation to def_mg_weights and deallocating after use.
- Add deallocation of mg_parameter allocatables (ixm/jym/nxy/im0/jm0/Fimax/Fjmax/FimaxL/FjmaxL/zofis/isofz) if reinit happens.
Loading