From 1a5e854414f2d31b96f7946bb5fcebfdb5b9e58b Mon Sep 17 00:00:00 2001 From: chrislxj Date: Sun, 4 Aug 2024 10:37:08 +0800 Subject: [PATCH] fix a bug in cloud calculation --- main/MOD_Forcing.F90 | 6 +++++- main/MOD_LeafTemperature.F90 | 2 +- main/MOD_PlantHydraulic.F90 | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/main/MOD_Forcing.F90 b/main/MOD_Forcing.F90 index 729ca6f2..881114d7 100644 --- a/main/MOD_Forcing.F90 +++ b/main/MOD_Forcing.F90 @@ -495,7 +495,11 @@ SUBROUTINE read_forcing (idate, dir_forcing) calday = calendarday(idate) sunang = orb_coszen (calday, gforc%rlon(ilon), gforc%rlat(ilat)) - cloud = (1160.*sunang-a)/(963.*sunang) + IF (sunang .eq. 0)THEN + cloud = 0. + ELSE + cloud = (1160.*sunang-a)/(963.*sunang) + END IF cloud = max(cloud,0.) cloud = min(cloud,1.) cloud = max(0.58,cloud) diff --git a/main/MOD_LeafTemperature.F90 b/main/MOD_LeafTemperature.F90 index 3c534468..0651ce38 100644 --- a/main/MOD_LeafTemperature.F90 +++ b/main/MOD_LeafTemperature.F90 @@ -203,7 +203,7 @@ SUBROUTINE LeafTemperature ( & t_precip, &! snowfall/rainfall temperature [kelvin] qintr_rain, &! rainfall interception (mm h2o/s) qintr_snow, &! snowfall interception (mm h2o/s) - smp (1:nl_soil), &! precipitation sensible heat from canopy + smp (1:nl_soil), &! soil matrix potential rootfr (1:nl_soil), &! root fraction hksati (1:nl_soil), &! hydraulic conductivity at saturation [mm h2o/s] hk (1:nl_soil) ! soil hydraulic conducatance diff --git a/main/MOD_PlantHydraulic.F90 b/main/MOD_PlantHydraulic.F90 index 2cfbe697..420c7c79 100644 --- a/main/MOD_PlantHydraulic.F90 +++ b/main/MOD_PlantHydraulic.F90 @@ -99,7 +99,7 @@ SUBROUTINE PlantHydraulicStress_twoleaf (nl_soil ,nvegwcs ,z_soi ,& cintsha ! scaling up from shaded leaf to canopy real(r8),intent(in), dimension(nl_soil) :: & - smp, &! precipitation sensible heat from canopy + smp, &! soil matrix potential rootfr, &! root fraction hksati, &! hydraulic conductivity at saturation [mm h2o/s] hk ! soil hydraulic conducatance [mm h2o/s]