Skip to content
Closed
Show file tree
Hide file tree
Changes from 5 commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
3726642
Add aggregator implementation
SeanBryan51 Nov 6, 2025
5926337
src/offline/cable_define_types.F90: add tscrn_max_daily and tscrn_min…
SeanBryan51 Nov 24, 2025
81661f9
src/offline/cable_serial.F90: update tscrn_max_daily and tscrn_min_da…
SeanBryan51 Nov 24, 2025
24a4b81
Introduce cable_enum_t for improved type safety for enum data structures
SeanBryan51 Jan 20, 2026
3094a2b
Add parallel I/O output module implementation
SeanBryan51 Nov 18, 2025
10272c1
src/util/cable_timing_utils.F90: Implement case for custom hourly fre…
SeanBryan51 Jan 23, 2026
5463b05
src/offline/cable_mpimaster.F90: Accumulate tscrn aggregators in mast…
SeanBryan51 Jan 23, 2026
c986a41
src/offline/cable_mpimaster.F90: Add output module to MPI master driver
SeanBryan51 Jan 30, 2026
4d59ba7
src/util/io/output/cable_output_core.F90: fix time axis values for 'a…
SeanBryan51 Jan 27, 2026
8610ad4
src/util/io/output/cable_output_utils.F90: remove unused variable
SeanBryan51 Jan 30, 2026
64b3cf4
src/offline/cable_serial.F90: fix guarding if condition for output mo…
SeanBryan51 Jan 30, 2026
7e4e932
src/util/io/output/cable_output_core.F90: fix non-standard array cons…
SeanBryan51 Feb 3, 2026
9f6854d
src/util/io/output/cable_output_utils.F90: fix non-standard array con…
SeanBryan51 Feb 3, 2026
9d27f69
src/util/io/output/cable_output_utils.F90: bug fix in infer_dim_names…
SeanBryan51 Feb 4, 2026
a546402
src/util/io/output/cable_output_utils.F90: bug fix for comparing data…
SeanBryan51 Feb 4, 2026
90433a0
src/util/io/output/cable_output_utils.F90: fix cell_methods attribute
SeanBryan51 Feb 4, 2026
7b30d24
src/util/io/output/cable_output_core.F90: Remove redundant temp_buffe…
SeanBryan51 Feb 5, 2026
8c8ad66
src/util/io/output/cable_output_core.F90: Remove potential for implic…
SeanBryan51 Feb 5, 2026
a294717
Add variable and global attributes list
SeanBryan51 Feb 6, 2026
0e594f5
Split out decomposition and reduction buffer functionality from cable…
SeanBryan51 Feb 9, 2026
bb50434
Remove cable_io_decomp_mod
SeanBryan51 Feb 9, 2026
55f9be4
Clean up sampling frequency check subroutine
SeanBryan51 Feb 9, 2026
07f646e
src/util/io/output/cable_output_definitions.F90: remove restart argument
SeanBryan51 Feb 10, 2026
fa05244
Add carbon molar mass physical constant
SeanBryan51 Feb 20, 2026
f8cf743
Introduce diagnostic variables for CABLE outputs
SeanBryan51 Feb 13, 2026
d0f81c3
Remove duplicate namelist variables
SeanBryan51 Feb 20, 2026
74d2ac9
src/util/cable_timing_utils.F90: Add seconds_per_day constant
SeanBryan51 Feb 20, 2026
0b1c8d1
src/util/aggregator.F90: Add scale and offset procedures
SeanBryan51 Feb 10, 2026
5be0368
src/util/aggregator.F90: Add aggregator_type procedure
SeanBryan51 Feb 12, 2026
632def5
Add all output and restart definitions, bug fixes and other quality o…
SeanBryan51 Feb 20, 2026
78a6da8
Split output variable declarations into multiple modules
SeanBryan51 Feb 25, 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 CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -299,14 +299,23 @@ else()
src/offline/cbl_model_driver_offline.F90
src/offline/landuse_inout.F90
src/offline/spincasacnp.F90
src/util/aggregator.F90
src/util/cable_climate_type_mod.F90
src/util/masks_cbl.F90
src/util/cable_array_utils.F90
src/util/cable_enum.F90
src/util/cable_grid_reductions.F90
src/util/cable_timing_utils.F90
src/util/netcdf/cable_netcdf_decomp_util.F90
src/util/netcdf/cable_netcdf.F90
src/util/netcdf/cable_netcdf_internal.F90
src/util/netcdf/cable_netcdf_stub_types.F90
src/util/netcdf/nf90/cable_netcdf_nf90.F90
src/util/io/output/cable_output_core.F90
src/util/io/output/cable_output_definitions.F90
src/util/io/output/cable_output_types.F90
src/util/io/output/cable_output_utils.F90
src/util/io/output/cable_output.F90
)

target_link_libraries(cable_common PRIVATE PkgConfig::NETCDF)
Expand Down
11 changes: 10 additions & 1 deletion src/offline/cable_define_types.F90
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@
!#define UM_BUILD yes
MODULE cable_def_types_mod

USE cable_climate_type_mod, ONLY: climate_type
USE cable_climate_type_mod, ONLY: climate_type
USE aggregator_mod, ONLY: aggregator_real32_1d_t, new_aggregator

! Contains all variables which are not subroutine-internal

Expand Down Expand Up @@ -531,6 +532,8 @@ MODULE cable_def_types_mod
! vh_js ! !litter thermal conductivity (Wm-2K-1) and vapour diffusivity (m2s-1)
REAL(r_2), DIMENSION(:), POINTER :: kthLitt, DvLitt

type(aggregator_real32_1d_t), allocatable :: tscrn_max_daily
type(aggregator_real32_1d_t), allocatable :: tscrn_min_daily

END TYPE canopy_type

Expand Down Expand Up @@ -1186,6 +1189,9 @@ SUBROUTINE alloc_canopy_type(var, mp)
ALLOCATE (var % kthLitt(mp))
ALLOCATE (var % DvLitt(mp))

var%tscrn_max_daily = new_aggregator(source_data=var%tscrn); CALL var%tscrn_max_daily%init(method="max")
var%tscrn_min_daily = new_aggregator(source_data=var%tscrn); CALL var%tscrn_min_daily%init(method="min")

END SUBROUTINE alloc_canopy_type

! ------------------------------------------------------------------------------
Expand Down Expand Up @@ -1811,6 +1817,9 @@ SUBROUTINE dealloc_canopy_type(var)
DEALLOCATE (var % kthLitt)
DEALLOCATE (var % DvLitt)

DEALLOCATE(var%tscrn_max_daily)
DEALLOCATE(var%tscrn_min_daily)

END SUBROUTINE dealloc_canopy_type

! ------------------------------------------------------------------------------
Expand Down
52 changes: 48 additions & 4 deletions src/offline/cable_serial.F90
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ MODULE cable_serial
patch_type,landpt,&
defaultLAI, sdoy, smoy, syear, timeunits, calendar, &
NO_CHECK
use cable_io_vars_module, only: patch
USE cable_io_decomp_mod, ONLY: io_decomp_t
USE cable_io_decomp_mod, ONLY: cable_io_decomp_init
USE casa_ncdf_module, ONLY: is_casa_time
Expand Down Expand Up @@ -112,6 +113,16 @@ MODULE cable_serial
ncid_wd,ncid_mask
USE cable_output_module, ONLY: create_restart,open_output_file, &
write_output,close_output_file
use cable_output_prototype_v2_mod, only: cable_output_mod_init
use cable_output_prototype_v2_mod, only: cable_output_mod_end
use cable_output_prototype_v2_mod, only: cable_output_register_output_variables
use cable_output_prototype_v2_mod, only: cable_output_profiles_init
use cable_output_prototype_v2_mod, only: cable_output_update
use cable_output_prototype_v2_mod, only: cable_output_write
use cable_output_prototype_v2_mod, only: cable_output_write_parameters
use cable_output_prototype_v2_mod, only: cable_output_write_restart
use cable_output_prototype_v2_mod, only: cable_output_core_outputs
use cable_netcdf_mod, only: cable_netcdf_mod_init, cable_netcdf_mod_end
USE cable_checks_module, ONLY: constant_check_range
USE cable_write_module, ONLY: nullify_write
USE cable_IO_vars_module, ONLY: timeunits,calendar
Expand Down Expand Up @@ -273,10 +284,13 @@ SUBROUTINE serialdrv(NRRRR, dels, koffset, kend, GSWP_MID, PLUME, CRU, site, mpi
real(r_2), dimension(:,:,:), allocatable, save :: patchfrac_new

type(io_decomp_t) :: io_decomp

integer :: start_year
! END header

! INISTUFF

call cable_netcdf_mod_init(mpi_grp)

! outer loop - spinup loop no. ktau_tot :
ktau = 0
Expand Down Expand Up @@ -462,6 +476,12 @@ SUBROUTINE serialdrv(NRRRR, dels, koffset, kend, GSWP_MID, PLUME, CRU, site, mpi

call cable_io_decomp_init(io_decomp)

if (.not. casaonly) then
call cable_output_mod_init(io_decomp)
call cable_output_register_output_variables(cable_output_core_outputs(canopy, soil))
call cable_output_profiles_init()
end if
Comment thread
SeanBryan51 marked this conversation as resolved.
Outdated

ENDIF ! CALL 1

! globally (WRT code) accessible kend through USE cable_common_module
Expand Down Expand Up @@ -572,6 +592,17 @@ SUBROUTINE serialdrv(NRRRR, dels, koffset, kend, GSWP_MID, PLUME, CRU, site, mpi
IF ( CABLE_USER%POPLUC) CALL POPLUC_set_patchfrac(POPLUC,LUC_EXPT)
ENDIF

! TODO(Sean): this is a hack for determining if the current time step
! is the last of the month. Better way to do this?
IF(ktau == 1) THEN
!MC - use met%year(1) instead of CABLE_USER%YearStart for non-GSWP forcing and leap years
IF ( TRIM(cable_user%MetType) .EQ. '' ) THEN
start_year = met%year(1)
ELSE
start_year = CABLE_USER%YearStart
ENDIF
END IF

Comment thread
SeanBryan51 marked this conversation as resolved.
Outdated
IF ( .NOT. CASAONLY ) THEN

! Feedback prognostic vcmax and daily LAI from casaCNP to CABLE
Expand All @@ -581,6 +612,13 @@ SUBROUTINE serialdrv(NRRRR, dels, koffset, kend, GSWP_MID, PLUME, CRU, site, mpi
IF (l_laiFeedbk.AND.icycle>0) veg%vlai(:) = casamet%glai(:)

IF (.NOT. allocated(c1)) ALLOCATE( c1(mp,nrb), rhoch(mp,nrb), xk(mp,nrb) )

if (ktau > kstart .and. mod(ktau - kstart, ktauday) == 0) then
! Reset daily aggregators if previous time step was the end of day
call canopy%tscrn_max_daily%reset()
call canopy%tscrn_min_daily%reset()
end if

! Call land surface scheme for this timestep, all grid points:
CALL cbm( ktau, dels, air, bgc, canopy, met, bal, &
rad, rough, soil, ssnow, sum_flux, veg, climate, xk, c1, rhoch )
Expand All @@ -595,9 +633,8 @@ SUBROUTINE serialdrv(NRRRR, dels, koffset, kend, GSWP_MID, PLUME, CRU, site, mpi
ssnow%rnof2 = ssnow%rnof2*dels
ssnow%runoff = ssnow%runoff*dels




call canopy%tscrn_max_daily%accumulate()
call canopy%tscrn_min_daily%accumulate()

ELSE IF ( IS_CASA_TIME("dread", yyyy, ktau, kstart, &
koffset, kend, ktauday, logn) ) THEN ! CLN READ FROM FILE INSTEAD !
Expand Down Expand Up @@ -722,6 +759,9 @@ SUBROUTINE serialdrv(NRRRR, dels, koffset, kend, GSWP_MID, PLUME, CRU, site, mpi
CALL write_output( dels, ktau, met, canopy, casaflux, casapool, casamet, &
ssnow, rad, bal, air, soil, veg, CSBOLTZ, CEMLEAF, CEMSOIL )
END SELECT
if (ktau == kstart) call cable_output_write_parameters(kstart, patch, landpt, met)
call cable_output_update(ktau, dels, leaps, start_year, met)
call cable_output_write(ktau, dels, leaps, start_year, met, patch, landpt)
ENDIF


Expand Down Expand Up @@ -1004,16 +1044,20 @@ SUBROUTINE serialdrv(NRRRR, dels, koffset, kend, GSWP_MID, PLUME, CRU, site, mpi

IF ( .NOT. CASAONLY.and. .not. l_landuse ) THEN
! Write restart file if requested:
IF(output%restart) &
IF(output%restart) then
CALL create_restart( logn, dels, ktau, soil, veg, ssnow, &
canopy, rough, rad, bgc, bal, met )
call cable_output_write_restart(current_time=ktau * dels)
end if
!mpidiff
IF (cable_user%CALL_climate) &
CALL WRITE_CLIMATE_RESTART_NC ( climate, ktauday )

call cable_output_mod_end()
Comment thread
SeanBryan51 marked this conversation as resolved.
Outdated
!--- LN ------------------------------------------[
ENDIF

call cable_netcdf_mod_end()


IF ( TRIM(cable_user%MetType) .NE. "gswp" .AND. &
Expand Down
Loading