Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
2e70c2c
src/offline/cable_output.F90: enable NetCDF4 format in output
SeanBryan51 Nov 18, 2025
82ba3fc
Add modified version of Lachlan's aggregator implementation
SeanBryan51 Nov 6, 2025
8abda2c
Add parallel I/O output module implementation
SeanBryan51 Nov 18, 2025
682a50e
src/offline/cable_output_prototype_v2.F90: fix incorrect shapes for g…
SeanBryan51 Nov 20, 2025
90ffdfa
Remove CABLE_OUTPUT_SHAPE_TYPE_* constants
SeanBryan51 Nov 20, 2025
78c8d3c
src/offline/cable_serial.F90: move output module finalisation outside…
SeanBryan51 Nov 20, 2025
823c594
Move `range_abort` from cable_abort.F90 to cable_checks.F90
SeanBryan51 Nov 24, 2025
1e98b3f
src/util/aggregator.F90: Return concrete aggregator type from new_agg…
SeanBryan51 Nov 25, 2025
8ba77b7
src/offline/cable_define_types.F90: add tscrn_max_daily and tscrn_min…
SeanBryan51 Nov 24, 2025
d9fcfb0
src/offline/cable_serial.F90: update tscrn_max_daily and tscrn_min_da…
SeanBryan51 Nov 24, 2025
a89eee2
Implement output module feedback
SeanBryan51 Nov 25, 2025
a2fbb16
src/offline/cable_output_prototype_v2.F90: mland should be mland_glob…
SeanBryan51 Nov 26, 2025
339a76a
Rename cable_output_utils_mod to cable_grid_reductions_mod
SeanBryan51 Nov 26, 2025
5fb101d
Check if sampling and accumulation frequency is valid
SeanBryan51 Nov 27, 2025
1ca7b3e
Replace grid_cell_averaging logical with reduction_method string
SeanBryan51 Nov 27, 2025
b7ada3b
Remove cable_output_add_aggregator subroutine
SeanBryan51 Nov 27, 2025
93bce35
Only add active output variables to list of output variables in globa…
SeanBryan51 Nov 27, 2025
666a93b
src/util/aggregator_types.F90: sample source_data for point_accumulate
SeanBryan51 Dec 1, 2025
365a754
src/offline/cable_output_prototype_v2.F90: make time_index optional
SeanBryan51 Dec 1, 2025
9e1a41a
Add writing of parameters
SeanBryan51 Dec 1, 2025
3ca423d
src/offline/cable_io_decomp.F90: fix dim specification for 2D patch v…
SeanBryan51 Dec 1, 2025
d37196a
src/offline/cable_output_definitions.F90: Add albsoil test case
SeanBryan51 Dec 1, 2025
fb4febe
src/util/aggregator_types.F90: Add incremental averaging method for c…
SeanBryan51 Dec 2, 2025
676e718
Rename storage to aggregated_data
SeanBryan51 Dec 2, 2025
5708824
Remove normalise procedure
SeanBryan51 Dec 2, 2025
6b923d7
src/offline/cable_output_prototype_v2.F90: store parameters and varia…
SeanBryan51 Dec 4, 2025
ba4669f
Reorganise cable_output_add_variable and cable_output_commit
SeanBryan51 Dec 10, 2025
636acbb
src/util/netcdf/cable_netcdf.F90: add redef
SeanBryan51 Dec 8, 2025
dde58d9
src/util/netcdf/cable_netcdf.F90: make dim_names optional
SeanBryan51 Dec 9, 2025
8947cd6
src/util/netcdf/cable_netcdf.F90: Add iotype and mode arguments
SeanBryan51 Dec 9, 2025
b15c20c
src/offline/cable_output_prototype_v2.F90: specify iotype argument
SeanBryan51 Dec 10, 2025
6a92ce9
src/offline/cable_output_prototype_v2.F90: end define mode in cable_o…
SeanBryan51 Dec 10, 2025
864f14a
src/offline/cable_io_decomp.F90: remove restart specific decompositions
SeanBryan51 Dec 8, 2025
5c36fd1
Add cable_restart_mod and cable_restart_write_mod
SeanBryan51 Dec 10, 2025
9263f1e
src/offline/cable_serial.F90: write restarts via new restart modules
SeanBryan51 Dec 8, 2025
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
8 changes: 8 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -286,10 +286,14 @@ else()
src/offline/cable_mpi.F90
src/offline/cable_namelist_input.F90
src/offline/cable_output.F90
src/offline/cable_output_prototype_v2.F90
src/offline/cable_output_definitions.F90
src/offline/cable_parameters.F90
src/offline/cable_pft_params.F90
src/offline/cable_plume_mip.F90
src/offline/cable_read.F90
src/offline/cable_restart.F90
src/offline/cable_restart_write.F90
src/offline/cable_site.F90
src/offline/cable_serial.F90
src/offline/cable_soil_params.F90
Expand All @@ -299,9 +303,13 @@ else()
src/offline/cbl_model_driver_offline.F90
src/offline/landuse_inout.F90
src/offline/spincasacnp.F90
src/util/aggregator.F90
src/util/aggregator_types.F90
src/util/cable_climate_type_mod.F90
src/util/masks_cbl.F90
src/util/cable_array_utils.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
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, method="max"); CALL var%tscrn_max_daily%init()
var%tscrn_min_daily = new_aggregator(source_data=var%tscrn, method="min"); CALL var%tscrn_min_daily%init()

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