Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
6a04a44
New calculation for accounting of root distribution on the transpiration
ccarouge Jun 24, 2025
3334097
(#560) - Remove unused, duplicate canopy%evapfbl. ssnow%evapfbl is th…
ccarouge Jun 23, 2025
4eacb1c
(#560) - change ssnow%evapfbl to double precision
ccarouge Jun 24, 2025
fcce19c
(#560) - Function for the calculation of evapfbl
ccarouge Jun 24, 2025
332b272
(#560) - Update fevc from soilsnow
ccarouge Jun 25, 2025
defcb20
(#560) Clean up and a bit more doc
ccarouge Jun 27, 2025
f60d767
(#560) - Use liquid soil water only for transpiration
ccarouge Jun 27, 2025
7bd21f4
(#560) - Use swilt_vec and zse_vec for all applications
ccarouge Jun 27, 2025
43c8ffe
(#560) - Correct initialisation of zse_vec
ccarouge Jun 27, 2025
4d0093f
(#560) - Doc formatting
ccarouge Jun 30, 2025
4c1c924
(#560) - Removed unused variables and arguments
ccarouge Jun 30, 2025
5520024
(#560) - Use remove_trans for GW soil
ccarouge Jul 1, 2025
f097c1e
(#560) - Fix MPI for evapfbl
ccarouge Jul 1, 2025
e752a90
(#560) - Change fwsoil calculations to use wbliq and *_vec soil prope…
ccarouge Jul 1, 2025
71447e5
(#560) - Attribute negative fevc to fevw in all cases
ccarouge Jul 2, 2025
f6b58b3
(#560) - improve comments
ccarouge Jul 2, 2025
24ef042
(#560) - fix broken link in doc. New domain for ACCESS-Hive docs
ccarouge Jul 2, 2025
7e83ba7
(#560) - Remove remove_transGW, unused now.
ccarouge Jul 6, 2025
84ed819
(#560) - Add use statement for remove_trans in gw_hydro.
ccarouge Jul 9, 2025
aa9c084
Update comment for evapfbl to reflect change to r_2.
ccarouge Jul 9, 2025
d6acbe3
(#560) - Add variable definition changes in coupled
ccarouge Jul 10, 2025
5f35294
Done science/soilsnow
ccarouge Jul 29, 2025
d756833
Done with science/canopy
ccarouge Jul 29, 2025
8069df2
Done science/gw_hydro
ccarouge Jul 29, 2025
7ffe3ae
Done src/util
ccarouge Jul 29, 2025
4410fc3
Done src/offline
ccarouge Jul 29, 2025
7d58323
Done src/offline
ccarouge Jul 29, 2025
67f74b3
Changes to compile the library for coupled models
ccarouge Jul 29, 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
57 changes: 38 additions & 19 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@ if(CMAKE_Fortran_COMPILER_ID MATCHES "GNU")
"$<$<CONFIG:Debug>:${CABLE_GNU_Fortran_FLAGS_DEBUG}>"
)
endif()

set(CMAKE_Fortran_MODULE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/include")
if(CABLE_LIBRARY)

add_library(
cable_science
cable
STATIC
src/science/albedo/cbl_albedo.F90
src/science/albedo/cbl_snow_albedo.F90
Expand Down Expand Up @@ -70,18 +70,18 @@ if(CABLE_LIBRARY)
src/science/casa-cnp/casa_rplant.F90
src/science/casa-cnp/casa_sumcflux.F90
src/science/casa-cnp/casa_variable.F90
src/science/gw_hydro/cable_gw_hydro.F90
src/science/gw_hydro/cable_psm.F90
#src/science/gw_hydro/cable_gw_hydro.F90
#src/science/gw_hydro/cable_psm.F90
src/science/landuse/landuse3.F90
src/science/landuse/landuse_constant.F90
src/science/misc/cable_air.F90
src/science/misc/cable_carbon.F90
src/science/misc/cable_climate.F90
src/science/pop/pop_constants.F90
src/science/pop/pop_def.F90
src/science/pop/POP.F90
src/science/pop/pop_io.F90
src/science/pop/POPLUC.F90
#src/science/pop/POP.F90
#src/science/pop/pop_io.F90
#src/science/pop/POPLUC.F90
src/science/pop/pop_types.F90
src/science/radiation/cbl_init_radiation.F90
src/science/radiation/cbl_radiation.F90
Expand All @@ -90,11 +90,11 @@ if(CABLE_LIBRARY)
src/science/radiation/cbl_spitter.F90
src/science/roughness/cable_roughness.F90
src/science/roughness/roughnessHGT_effLAI_cbl.F90
src/science/sli/cable_sli_main.F90
src/science/sli/cable_sli_numbers.F90
src/science/sli/cable_sli_roots.F90
src/science/sli/cable_sli_solve.F90
src/science/sli/cable_sli_utils.F90
#src/science/sli/cable_sli_main.F90
#src/science/sli/cable_sli_numbers.F90
#src/science/sli/cable_sli_roots.F90
#src/science/sli/cable_sli_solve.F90
#src/science/sli/cable_sli_utils.F90
src/science/soilsnow/cbl_conductivity.F90
src/science/soilsnow/cbl_GW.F90
src/science/soilsnow/cbl_hyd_redistrib.F90
Expand Down Expand Up @@ -122,14 +122,33 @@ if(CABLE_LIBRARY)
src/params/cable_maths_constants_mod.F90
src/util/cable_runtime_opts_mod.F90
src/util/cable_common.F90
src/coupled/esm16/casa_offline_inout.F90
src/coupled/esm16/casa_ncdf.F90
src/coupled/esm16/cable_iovars.F90
src/coupled/esm16/cable_surface_types.F90
src/coupled/esm16/cable_define_types.F90
src/coupled/esm16/cable_phenology.F90
src/coupled/esm16/cable_LUC_EXPT.F90
src/coupled/esm/cable_iovars.F90
src/coupled/esm/cable_surface_types.F90
src/coupled/esm/cable_define_types.F90
src/coupled/esm/cable_soil_params_mod.F90
src/coupled/esm/cable_pft_params_mod.F90
src/coupled/esm/casa_landuse.F90
src/coupled/esm/LAI_canopy_height_cbl.F90
#src/shared/casa_offline_inout.F90
#src/shared/casa_ncdf.F90
#src/shared/cable_phenology.F90
#src/shared/cable_LUC_EXPT.F90
src/coupled/shared/cable_canopy_type_mod.F90
src/coupled/shared/cable_soilsnow_type_mod.F90
src/coupled/shared/cable_soil_type_mod.F90
src/coupled/shared/cable_veg_type_mod.F90
src/util/cable_climate_type_mod.F90
src/util/masks_cbl.F90
)
target_compile_definitions(cable PRIVATE UM_CBL)
target_include_directories(cable PUBLIC "$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>")

install(TARGETS cable
EXPORT CABLEFortranTargets
LIBRARY DESTINATION lib
INCLUDES DESTINATION include)

install(DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/ TYPE INCLUDE)

else()

Expand Down
2 changes: 1 addition & 1 deletion build.bash
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ while [ ${#} -gt 0 ]; do
cmake_args+=(-DCABLE_MPI="ON")
;;
-l|--library)
build_args+=(--target cable_science)
build_args+=(--target cable)
cmake_args+=(-DCABLE_LIBRARY="ON")
do_install=0 # Disable installation when only building the science library
;;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,5 @@ To help you find the file corresponding to a page, on the rendered [documentatio
[cheat-sheets]: ../other_resources/cheat_sheets.md
[api-guidelines]: science_doc.md
[doc-pages]: https://cable.readthedocs.io/en/latest
[Hive-contribute]: https://access-hive.org.au/about/contribute/
[Hive-contribute]: https://docs.access-hive.org.au/about/contribute/
[cable-lsm-join]: https://github.com/CABLE-LSM/CABLE/issues/110
7 changes: 0 additions & 7 deletions src/coupled/AM3/control/cable/CM3/cbl_canopy_type.F90
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ MODULE cable_canopy_type_mod
REAL, ALLOCATABLE, PUBLIC :: fwet(:) ! fraction of canopy wet
REAL, ALLOCATABLE, PUBLIC :: fns_cor(:) ! correction to net rad avail to soil (W/m2)
REAL, ALLOCATABLE, PUBLIC :: ga_cor(:) ! correction to ground heat flux (W/m2)
REAL, ALLOCATABLE, PUBLIC :: evapfbl(:,:) !
REAL, ALLOCATABLE, PUBLIC :: gswx(:,:) ! stom cond for water
REAL, ALLOCATABLE, PUBLIC :: zetar(:,:) ! stability parameter (ref height)
REAL, ALLOCATABLE, PUBLIC :: zetash(:,:) ! stability parameter (shear height)
Expand Down Expand Up @@ -144,7 +143,6 @@ MODULE cable_canopy_type_mod
REAL, POINTER, PUBLIC :: fwet(:) ! fraction of canopy wet
REAL, POINTER, PUBLIC :: fns_cor(:) ! correction to net rad avail to soil (W/m2)
REAL, POINTER, PUBLIC :: ga_cor(:) ! correction to ground heat flux (W/m2)
REAL, POINTER, PUBLIC :: evapfbl(:,:) !
REAL, POINTER, PUBLIC :: gswx(:,:) ! stom cond for water
REAL, POINTER, PUBLIC :: zetar(:,:) ! stability parameter (ref height)
REAL, POINTER, PUBLIC :: zetash(:,:) ! stability parameter (shear height)
Expand Down Expand Up @@ -230,7 +228,6 @@ SUBROUTINE alloc_canopy_type(var, mp)
ALLOCATE( var% fwet(mp) )
ALLOCATE( var% fns_cor(mp) ) !REV_CORR variable
ALLOCATE( var% ga_cor(mp) ) !REV_CORR variable
ALLOCATE( var % evapfbl(mp,nsl) )
ALLOCATE( var% epot(mp) )
ALLOCATE( var% fnpp(mp) )
ALLOCATE( var% fevw_pot(mp) )
Expand Down Expand Up @@ -308,7 +305,6 @@ SUBROUTINE alloc_canopy_type(var, mp)
var % fwet(:) = 0.0
var % fns_cor(:) = 0.0
var % ga_cor(:) = 0.0
var % evapfbl(:,:) = 0.0
var % gswx(:,:) = 0.0
var % zetar(:,:) = 0.0
var % zetash(:,:) = 0.0
Expand Down Expand Up @@ -382,7 +378,6 @@ SUBROUTINE dealloc_canopy_type(var)
DEALLOCATE( var% fwet )
DEALLOCATE( var% fns_cor ) !REV_CORR variable
DEALLOCATE( var% ga_cor ) !REV_CORR variable
DEALLOCATE ( var % evapfbl )
DEALLOCATE( var% epot )
DEALLOCATE( var% fnpp )
DEALLOCATE( var% fevw_pot )
Expand Down Expand Up @@ -473,7 +468,6 @@ SUBROUTINE assoc_canopy_type(canopy, canopy_data )
canopy% fwet => canopy_data% fwet
canopy% fns_cor => canopy_data% fns_cor
canopy% ga_cor => canopy_data% ga_cor
canopy% evapfbl => canopy_data% evapfbl
canopy% gswx => canopy_data% gswx
canopy% zetar => canopy_data% zetar
canopy% zetash => canopy_data% zetash
Expand Down Expand Up @@ -557,7 +551,6 @@ SUBROUTINE nullify_canopy_cbl( var )
NULLIFY( var% fwet )
NULLIFY( var% fns_cor ) !REV_CORR variable
NULLIFY( var% ga_cor ) !REV_CORR variable
NULLIFY( var % evapfbl )
NULLIFY( var% epot )
NULLIFY( var% fnpp )
NULLIFY( var% fevw_pot )
Expand Down
4 changes: 2 additions & 2 deletions src/coupled/AM3/control/cable/CM3/ssnow_type.F90
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,11 @@ MODULE cable_soil_snow_type_mod
REAL, ALLOCATABLE :: tggsn (:,:) ! snow temperature in K
REAL, ALLOCATABLE :: dtmlt (:,:) ! water flux to the soil
REAL, ALLOCATABLE :: albsoilsn (:,:) ! soil + snow reflectance
REAL, ALLOCATABLE :: evapfbl (:,:) !
REAL, ALLOCATABLE :: tilefrac (:,:) ! factor for latent heat

REAL(r_2), ALLOCATABLE :: wbtot (:) ! total soil water (mm)

REAL(r_2), ALLOCATABLE :: evapfbl (:,:) !
REAL(r_2), ALLOCATABLE :: gammzz (:,:) ! heat capacity for each soil layer
REAL(r_2), ALLOCATABLE :: wb (:,:) ! volumetric soil moisture (solid+liq)
REAL(r_2), ALLOCATABLE :: wbice (:,:) ! soil ice
Expand Down Expand Up @@ -209,11 +209,11 @@ MODULE cable_soil_snow_type_mod
REAL, POINTER :: tggsn (:,:) ! snow temperature in K
REAL, POINTER :: dtmlt (:,:) ! water flux to the soil
REAL, POINTER :: albsoilsn (:,:) ! soil + snow reflectance
REAL, POINTER :: evapfbl (:,:) !
REAL, POINTER :: tilefrac (:,:) ! factor for latent heat

REAL(r_2), POINTER :: wbtot (:) ! total soil water (mm)

REAL(r_2), POINTER :: evapfbl (:,:) !
REAL(r_2), POINTER :: gammzz (:,:) ! heat capacity for each soil layer
REAL(r_2), POINTER :: wb (:,:) ! volumetric soil moisture (solid+liq)
REAL(r_2), POINTER :: wbice (:,:) ! soil ice
Expand Down
156 changes: 156 additions & 0 deletions src/coupled/esm/LAI_canopy_height_cbl.F90
Original file line number Diff line number Diff line change
@@ -0,0 +1,156 @@
!******************************COPYRIGHT********************************************
! (c) CSIRO 2022.
! All rights reserved.
!
! This routine has been licensed to the other JULES partners for use and
! distribution under the JULES collaboration agreement, subject to the terms and
! conditions set out therein.
!
! [Met Office Ref SC0237]
!******************************COPYRIGHT********************************************
MODULE cbl_LAI_canopy_height_mod

!-----------------------------------------------------------------------------
! Description:
! Restricts the range of canopy height and LAI inherited from JULES/UM
! spatial maps
!
! This MODULE is USEd by:
! cable_land_albedo_mod_cbl.F90
!
! This MODULE contains 1 public Subroutine:
! limit_HGT_LAI
!
! Code Owner: Please refer to ModuleLeaders.txt
! This file belongs in CABLE SCIENCE
!
! Code Description:
! Language: Fortran 90.
! This code is written to JULES coding standards v1.
!-----------------------------------------------------------------------------

IMPLICIT NONE
PUBLIC :: limit_HGT_LAI
PRIVATE

CONTAINS

SUBROUTINE Limit_HGT_LAI( HGT_pft_temp, LAI_pft_cbl, HGT_pft_cbl, mp, land_pts,&
ntiles, npft, tile_pts, tile_index, tile_frac, &
L_tile_pts, LAI_pft, HGT_pft, CLAI_thresh )

!*## Purpose
!
! This SUBROUTINE checks that input values of leaf area and canopy height
! lie between set values (defined by PFT) and overwrites if necessary.
! These limits are needed to ensure that the canopy roughness properties of
! the land point are well behaved (see [[ruff_resist]]).
!
! The mapping from grid cells (land_pts,ntiles) to the (mp) structure
! is also undertaken.
!
! **This SUBROUTINE is active when CABLE is run within a coupled model
! (i.e. ACCESS)**
!
!## Method
!
! The cell-level input (land_pts,ntile) variables for leaf area `LAI_pft` and
! canopy height `HGT_pft` are checked for
!
! - whether the land_pt has a non-zero fraction of that tile (if zero
! fraction then LAI and canopy height are set to zero)
! - whether the LAI lies above a minimum value `CLAI_thresh`
! - whether the canopy height lies above a minimum value (which is PFT dependent)
! - whether non-vegetated tiles have a non-zero canopy height.
!
! Outputs are `LAI_pft_cbl` and `HGT_pft_cbl`
!
! **WARNINGS**
!
! - INTENT statements need to be added to the argument lists
! - hardwired indexing is used throughout. This SUBROUTINE assumes that
! 1. non-vegetated tiles take indexes 14 and onwards
! 2. tall vegetation occupies tile indexes 1-4
! 3. other vegetation (shrubs/grasses/crops/wetlands) occupy tile indexes
! 5-13
! - the limits on canopy height are hardwired
! 1. canopy height for tall vegetation is limited to be greater than 1m
! 2. canopy height for other vegetation is limited to be greater than 0.1m

USE cable_surface_types_mod, ONLY: shrub_cable, evergreen_broadleaf, &
deciduous_broadleaf, aust_temperate, &
aust_tropical

IMPLICIT NONE

INTEGER, INTENT(IN) :: land_pts, ntiles, npft !! # land points here
!! max # of tiles, PFTs
!! CABLE 1-D vector of length "mp" active tiles
INTEGER, INTENT(IN) :: mp !! total number of tiles

!! range limited LAI/ canopy height
REAL, INTENT(OUT) :: HGT_pft_temp(land_pts,ntiles) !! UM dimensions (m)

!! PACKed to CABLE 1-D vector of length mp
REAL, INTENT(OUT) :: LAI_pft_cbl(mp) !! veg%vlai
REAL, INTENT(OUT) :: HGT_pft_cbl(mp) !! veg%hc

!! From UM spatial maps via restart or ancillary.
REAL, INTENT(IN) :: tile_frac(land_pts,ntiles) !! frac. veg/non-veg type
INTEGER, INTENT(IN) :: tile_pts(ntiles) !! # tiles per PFT type
INTEGER, INTENT(IN) :: tile_index(land_pts,ntiles) !! land_pt index per tile
!! updates monthly
REAL, INTENT(IN) :: LAI_pft(land_pts, npft) !! LAI (m\(^2\)m\(^{-2}\))
REAL, INTENT(IN) :: HGT_pft(land_pts, npft) !! canopy height (m)
!! logical mask. TRUE if tilefrac > 0 0 (OR some threshold)
LOGICAL, INTENT(IN) :: L_tile_pts(land_pts,ntiles)

!! scalar constant threshold for "cell" to be considred vegetated
REAL, INTENT(IN) :: Clai_thresh ! minimum LAI threshold

!local vars
INTEGER :: i,j, n
REAL :: LAI_pft_temp(land_pts,ntiles) ! needed to filter spatail map

!Retain init where tile_frac=0
LAI_pft_temp(:,:) = 0.0
HGT_pft_temp(:,:) = 0.0

!Comensurate with restricted ordering of PFTs in UM. Not generically applicable
DO n=1,ntiles
DO j=1,tile_pts(n)

i = tile_index(j,n) ! landpt index

IF( tile_frac(i,n) .GT. 0.0 ) THEN

IF( n < shrub_cable ) THEN ! trees

LAI_pft_temp(i,n) = MAX( 0.99*CLAI_thresh, LAI_pft(i,n) )
HGT_pft_temp(i,n) = MAX( 1.0, HGT_pft(i,n) )

ELSE IF( n >= shrub_cable .AND. n < aust_temperate ) THEN ! shrubs/grass

LAI_pft_temp(i,n) = MAX( 0.99*CLAI_thresh, LAI_pft(i,n) )
HGT_pft_temp(i,n) = MAX( 0.1, HGT_pft(i,n) )

ELSE IF( n == aust_temperate .OR. n == aust_tropical ) THEN ! Aust. trees

LAI_pft_temp(i,n) = MAX( CLAI_thresh, LAI_pft(i,n) )
HGT_pft_temp(i,n) = MAX( 1.0, HGT_pft(i,n) )

ENDIF

ENDIF

ENDDO
ENDDO

!surface_type = PACK(surface_type_temp, um1%L_TILE_PTS)
LAI_pft_cbl = PACK(LAI_pft_temp, l_tile_pts)
HGT_pft_cbl = PACK(HGT_pft_temp, l_tile_pts)

END SUBROUTINE limit_HGT_LAI

END MODULE cbl_LAI_canopy_height_mod

4 changes: 2 additions & 2 deletions src/coupled/esm/cable_surface_types.F90
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ MODULE cable_surface_types_mod
INTEGER, PARAMETER :: c3_cropland = 9
INTEGER, PARAMETER :: c4_cropland = 10
INTEGER, PARAMETER :: wetland = 11
INTEGER, PARAMETER :: empty1 = 12
INTEGER, PARAMETER :: empty2 = 13
INTEGER, PARAMETER :: aust_temperate = 12
INTEGER, PARAMETER :: aust_tropical = 13
INTEGER, PARAMETER :: barren_cable = 14
INTEGER, PARAMETER :: urban_cable = 15
INTEGER, PARAMETER :: lakes_cable = 16
Expand Down
2 changes: 0 additions & 2 deletions src/coupled/shared/cable_canopy_type_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ MODULE cable_canopy_type_mod
ga_cor ! correction to ground heat flux (W/m2)

REAL, DIMENSION(:,:), POINTER :: &
evapfbl, &
gswx, & ! stom cond for water
zetar, & ! stability parameter (ref height)
! vh_js !
Expand Down Expand Up @@ -158,7 +157,6 @@ SUBROUTINE alloc_canopy_type(var, mp)
ALLOCATE( var% fwet(mp) )
ALLOCATE( var% fns_cor(mp) ) !REV_CORR variable
ALLOCATE( var% ga_cor(mp) ) !REV_CORR variable
ALLOCATE ( var % evapfbl(mp,ms) )
ALLOCATE( var% epot(mp) )
ALLOCATE( var% fnpp(mp) )
ALLOCATE( var% fevw_pot(mp) )
Expand Down
2 changes: 1 addition & 1 deletion src/coupled/shared/cable_soilsnow_type_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -72,14 +72,14 @@ MODULE cable_soil_snow_type_mod
tggsn, & ! snow temperature in K
dtmlt, & ! water flux to the soil
albsoilsn, & ! soil + snow reflectance
evapfbl, & !
tilefrac ! factor for latent heat


REAL(r_2), DIMENSION(:), POINTER :: &
wbtot ! total soil water (mm)

REAL(r_2), DIMENSION(:,:), POINTER :: &
evapfbl, & !
gammzz, & ! heat capacity for each soil layer
wb, & ! volumetric soil moisture (solid+liq)
wbice, & ! soil ice
Expand Down
Loading
Loading