From 90ce1b5bcf38817e8ded55b0f85fea98eeb79638 Mon Sep 17 00:00:00 2001 From: "Srbinovsky, Jhan (O&A, Aspendale)" Date: Thu, 23 Oct 2025 08:56:17 +1100 Subject: [PATCH 1/4] pass ONLY iter-th iteration of zetar --- src/science/canopy/cable_canopy.F90 | 6 +++--- src/science/canopy/cbl_friction_vel.F90 | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/science/canopy/cable_canopy.F90 b/src/science/canopy/cable_canopy.F90 index 96073e6dc..cccf13365 100644 --- a/src/science/canopy/cable_canopy.F90 +++ b/src/science/canopy/cable_canopy.F90 @@ -260,9 +260,9 @@ SUBROUTINE define_canopy(bal,rad,rough,air,met,dels,ssnow,soil,veg, canopy,clima ! AERODYNAMIC PROPERTIES: friction velocity us, thence turbulent ! resistances rt0, rt1 (elements of dispersion matrix): ! See CSIRO SCAM, Raupach et al 1997, eq. 3.46: - CALL comp_friction_vel(canopy%us, iter, mp, CVONK, CUMIN, CPI_C, & - canopy%zetar, rough%zref_uv, rough%zref_tq, & - rough%z0m, met%ua ) + CALL comp_friction_vel( canopy%us, mp, CVONK, CUMIN, CPI_C, & + canopy%zetar(:,iter), rough%zref_uv, & + rough%zref_tq, rough%z0m, met%ua ) ! E.Kowalczyk 2014 IF (cable_user%l_new_roughness_soil) & diff --git a/src/science/canopy/cbl_friction_vel.F90 b/src/science/canopy/cbl_friction_vel.F90 index 164391a31..837882aab 100644 --- a/src/science/canopy/cbl_friction_vel.F90 +++ b/src/science/canopy/cbl_friction_vel.F90 @@ -76,7 +76,7 @@ SUBROUTINE comp_friction_vel(friction_vel, iter, mp, CVONK, CUMIN, CPI_C, & ! maths & other constants REAL, INTENT(IN) :: CPI_C !! \(\pi\) (-) -REAL, INTENT(IN) :: zetar(mp,iter) !! stability parameter - see [[update_zetar]] `canopy%zetar` (-) +REAL, INTENT(IN) :: zetar(mp) !! stability parameter - see [[update_zetar]] `canopy%zetar` (-) REAL, INTENT(IN) :: zref_uv(mp) !! reference height for wind `rough%zref_uv` (m) REAL, INTENT(IN) :: zref_tq(mp) !! reference height for temperature and humidity `rough%zref_tq` (m) REAL, INTENT(IN) :: z0m(mp) !! roughness length `rough%z0m` (m) @@ -91,13 +91,13 @@ SUBROUTINE comp_friction_vel(friction_vel, iter, mp, CVONK, CUMIN, CPI_C, & ! but zetar based on rough%zref_tq - changes to ensure consistency !NB no RSL incorporated here -psim_1 = psim( zetar(:,iter) * zref_uv/zref_tq, mp, CPI_C ) +psim_1 = psim( zetar(:) * zref_uv/zref_tq, mp, CPI_C ) !rescale = CVONK * MAX( ua, SPREAD(CUMIN,1,mp ) ) rescale = CVONK * MAX( ua, CUMIN ) z_eff = zref_uv / z0m -psim_arg = zetar(:,iter) * z0m / zref_tq +psim_arg = zetar(:) * z0m / zref_tq psim_2 = psim( psim_arg, mp, CPI_C ) lower_limit = rescale / ( LOG(z_eff) - psim_1 + psim_2 ) From 0909b43e419b6335b478bc3aaf8b3d8e1e1e3730 Mon Sep 17 00:00:00 2001 From: "Srbinovsky, Jhan (O&A, Aspendale)" Date: Thu, 23 Oct 2025 08:58:16 +1100 Subject: [PATCH 2/4] rm iter in friction_vel() --- src/science/canopy/cbl_friction_vel.F90 | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/science/canopy/cbl_friction_vel.F90 b/src/science/canopy/cbl_friction_vel.F90 index 837882aab..60103021a 100644 --- a/src/science/canopy/cbl_friction_vel.F90 +++ b/src/science/canopy/cbl_friction_vel.F90 @@ -16,7 +16,7 @@ MODULE cbl_friction_vel_module CONTAINS -SUBROUTINE comp_friction_vel(friction_vel, iter, mp, CVONK, CUMIN, CPI_C, & +SUBROUTINE comp_friction_vel(friction_vel, mp, CVONK, CUMIN, CPI_C, & zetar, zref_uv, zref_tq, z0m, ua ) !*## Purpose ! @@ -69,7 +69,6 @@ SUBROUTINE comp_friction_vel(friction_vel, iter, mp, CVONK, CUMIN, CPI_C, & INTEGER, INTENT(IN) :: mp !! size of cable vector of land points (-) REAL, INTENT(OUT) :: friction_vel(mp) !! friction velocity (ms\(^{-1}\)) -INTEGER, INTENT(IN) :: iter !! MO iteration counter (-) ! physical constants REAL, INTENT(IN) :: CVONK !! von Karman constant (-) REAL, INTENT(IN):: CUMIN !! minimum value of wind speed (ms\(^{-1}\)) From f9d0a80b3a8c6dbe0aa40485f66fda92edb022c1 Mon Sep 17 00:00:00 2001 From: "Srbinovsky, Jhan (O&A, Aspendale)" Date: Fri, 24 Oct 2025 11:31:13 +1100 Subject: [PATCH 3/4] rm esm15 dependence --- src/science/casa-cnp/biogeochem_casa.F90 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/science/casa-cnp/biogeochem_casa.F90 b/src/science/casa-cnp/biogeochem_casa.F90 index ab0f4ebb1..0997d4b9c 100644 --- a/src/science/casa-cnp/biogeochem_casa.F90 +++ b/src/science/casa-cnp/biogeochem_casa.F90 @@ -10,7 +10,7 @@ SUBROUTINE biogeochem(ktau,dels,idoY,LALLOC,veg,soil,casabiome,casapool,casaflux nleaf2met,nleaf2str,nroot2met,nroot2str,nwood2cwd, & pleaf2met,pleaf2str,proot2met,proot2str,pwood2cwd) USE cable_def_types_mod -USE cable_common_module, ONLY : cable_runtime, cable_user +USE cable_common_module, ONLY : cable_user USE casadimension USE casa_cnp_module USE casa_inout_module, ONLY : casa_cnpflux @@ -52,8 +52,8 @@ SUBROUTINE biogeochem(ktau,dels,idoY,LALLOC,veg,soil,casabiome,casapool,casaflux ! zero annual sums IF (idoy==1) CALL casa_cnpflux(casaflux,casapool,casabal,.TRUE.) -IF (cable_user%PHENOLOGY_SWITCH.EQ.'MODIS' .OR. cable_runtime%esm15 ) THEN - CALL phenology(idoy,veg,phen) +IF (cable_user%PHENOLOGY_SWITCH.EQ.'MODIS' ) THEN + CALL phenology(idoy,veg,phen) ENDIF CALL avgsoil(veg,soil,casamet) From d74286b7cac34aa3c8dc6fa0622b69f64fa676fa Mon Sep 17 00:00:00 2001 From: "Srbinovsky, Jhan (O&A, Aspendale)" Date: Fri, 24 Oct 2025 11:38:33 +1100 Subject: [PATCH 4/4] reverse ci --- src/science/casa-cnp/biogeochem_casa.F90 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/science/casa-cnp/biogeochem_casa.F90 b/src/science/casa-cnp/biogeochem_casa.F90 index 0997d4b9c..ab0f4ebb1 100644 --- a/src/science/casa-cnp/biogeochem_casa.F90 +++ b/src/science/casa-cnp/biogeochem_casa.F90 @@ -10,7 +10,7 @@ SUBROUTINE biogeochem(ktau,dels,idoY,LALLOC,veg,soil,casabiome,casapool,casaflux nleaf2met,nleaf2str,nroot2met,nroot2str,nwood2cwd, & pleaf2met,pleaf2str,proot2met,proot2str,pwood2cwd) USE cable_def_types_mod -USE cable_common_module, ONLY : cable_user +USE cable_common_module, ONLY : cable_runtime, cable_user USE casadimension USE casa_cnp_module USE casa_inout_module, ONLY : casa_cnpflux @@ -52,8 +52,8 @@ SUBROUTINE biogeochem(ktau,dels,idoY,LALLOC,veg,soil,casabiome,casapool,casaflux ! zero annual sums IF (idoy==1) CALL casa_cnpflux(casaflux,casapool,casabal,.TRUE.) -IF (cable_user%PHENOLOGY_SWITCH.EQ.'MODIS' ) THEN - CALL phenology(idoy,veg,phen) +IF (cable_user%PHENOLOGY_SWITCH.EQ.'MODIS' .OR. cable_runtime%esm15 ) THEN + CALL phenology(idoy,veg,phen) ENDIF CALL avgsoil(veg,soil,casamet)