Skip to content
Draft
Show file tree
Hide file tree
Changes from 12 commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
4cf8d46
src/util/netcdf/cable_netcdf.F90: add redef
SeanBryan51 Dec 8, 2025
6c756eb
src/util/netcdf/cable_netcdf.F90: make dim_names optional
SeanBryan51 Dec 9, 2025
38a9532
src/util/netcdf/cable_netcdf.F90: Add iotype and mode arguments
SeanBryan51 Dec 9, 2025
1fae295
src/util/netcdf/cable_netcdf.F90: Add inq_var_ndims procedure
SeanBryan51 Jan 13, 2026
d7d1dc7
src/offline/cable_parameters.F90: Add comment on init_local_structure…
SeanBryan51 Jan 20, 2026
71af51d
Move `range_abort` from cable_abort.F90 to cable_checks.F90
SeanBryan51 Nov 24, 2025
129d746
src/offline/cable_io_decomp.F90: fix dim specification for 2D patch v…
SeanBryan51 Dec 1, 2025
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
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
69 changes: 0 additions & 69 deletions src/offline/cable_abort.F90
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
MODULE cable_abort_module

USE iso_fortran_env, ONLY: error_unit
USE cable_IO_vars_module, ONLY: check, logn
USE cable_mpi_mod, ONLY: mpi_grp_t

IMPLICIT NONE
Expand Down Expand Up @@ -106,72 +105,4 @@ SUBROUTINE nc_abort(ok, message)

END SUBROUTINE nc_abort

!==============================================================================
!
! Name: range_abort
!
! Purpose: Prints an error message and localisation information then stops the
! code
!
! CALLed from: write_output_variable_r1
! write_output_variable_r2
!
! MODULEs used: cable_def_types_mod
! cable_IO_vars_module
!
!==============================================================================

SUBROUTINE range_abort(vname, ktau, met, value, var_range, i, xx, yy)

USE cable_def_types_mod, ONLY: met_type
USE cable_IO_vars_module, ONLY: latitude, longitude, &
landpt, lat_all, lon_all

! Input arguments
CHARACTER(LEN=*), INTENT(IN) :: vname

INTEGER, INTENT(IN) :: &
ktau, & ! time step
i ! tile number along mp

REAL, INTENT(IN) :: &
xx, & ! coordinates of erroneous grid square
yy ! coordinates of erroneous grid square

TYPE(met_type), INTENT(IN) :: met ! met data

REAL(4), INTENT(IN) :: value ! value deemed to be out of range

REAL, INTENT(IN) :: var_range(2) ! appropriate var range

INTEGER :: iunit

IF (check%exit) THEN
iunit = 6
ELSE
iunit = logn ! warning
END IF

WRITE (iunit, *) "in SUBR range_abort: Out of range"
WRITE (iunit, *) "for var ", vname ! error from subroutine

! patch(i)%latitude, patch(i)%longitude
WRITE (iunit, *) 'Site lat, lon:', xx, yy
WRITE (iunit, *) 'Output timestep', ktau, &
', or ', met%hod(i), ' hod, ', &
INT(met%doy(i)), 'doy, ', &
INT(met%year(i))

WRITE (iunit, *) 'Specified acceptable range (cable_checks.f90):', &
var_range(1), 'to', var_range(2)

WRITE (iunit, *) 'Value:', value

IF (check%exit) THEN
STOP
END IF

END SUBROUTINE range_abort

!==============================================================================
END MODULE cable_abort_module
51 changes: 49 additions & 2 deletions src/offline/cable_checks.F90
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,9 @@ MODULE cable_checks_module
! particular sections of the code - largely for diagnostics/fault finding.
! rh_sh - converts relative to sensible humidity if met file units require it
!
USE cable_IO_vars_module, ONLY: patch
USE cable_abort_module, ONLY: range_abort
USE iso_fortran_env, ONLY: error_unit
USE cable_IO_vars_module, ONLY: patch, check, logn
USE cable_abort_module, ONLY: cable_abort
USE cable_def_types_mod
USE cable_common_module, ONLY: cable_user

Expand Down Expand Up @@ -212,6 +213,52 @@ MODULE cable_checks_module

CONTAINS

SUBROUTINE range_abort(vname, ktau, met, value, var_range, i, xx, yy)
!! Prints an error message and localisation information then stops the code

CHARACTER(LEN=*), INTENT(IN) :: vname

INTEGER, INTENT(IN) :: &
ktau, & ! time step
i ! tile number along mp

REAL, INTENT(IN) :: &
xx, & ! coordinates of erroneous grid square
yy ! coordinates of erroneous grid square

TYPE(met_type), INTENT(IN) :: met ! met data

REAL(4), INTENT(IN) :: value ! value deemed to be out of range

REAL, INTENT(IN) :: var_range(2) ! appropriate var range

INTEGER :: iunit

IF (check%exit) THEN
iunit = error_unit
ELSE
iunit = logn ! warning
END IF

WRITE (iunit, *) "in SUBR range_abort: Out of range"
WRITE (iunit, *) "for var ", vname ! error from subroutine

! patch(i)%latitude, patch(i)%longitude
WRITE (iunit, *) 'Site lat, lon:', xx, yy
WRITE (iunit, *) 'Output timestep', ktau, &
', or ', met%hod(i), ' hod, ', &
INT(met%doy(i)), 'doy, ', &
INT(met%year(i))

WRITE (iunit, *) 'Specified acceptable range (cable_checks.f90):', &
var_range(1), 'to', var_range(2)

WRITE (iunit, *) 'Value:', value

IF (check%exit) CALL cable_abort("Aborting...")

END SUBROUTINE range_abort

SUBROUTINE check_range_d1(vname, parameter_r1, parameter_range, ktau, met)

CHARACTER(LEN=*) :: vname
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
Loading