-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
488 merge canopy developments from am3 #489
Changes from 27 commits
9d15e92
d342f84
112870c
61138ab
9e97c01
9e7403b
ced4f8b
d17eda7
1332ed0
ec27ffe
cd6cf7d
55adef5
55263c1
0bd6c0f
6d8cf3e
dda93c2
a7292e2
9a4f6e9
a5120e3
74832fc
992dd99
298dd06
a7863fe
7b86584
b3c27ad
e435d97
bcb8346
d1c0e4b
52f2e3a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. AM3 version treatment of conversion (assuming 1e3 corresponds to units)
and cansto |
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. AM3 had neater interface. The explicit REAL typecasting is perhaps unnecessary as it is handled here that was used in AM3 - HOWEVER continued removal of r_2 is advantageous. As argued a million times, REAL(selected_real_kind) does not change CPU hardeware. it's either a 32,64,128 bit machine. All values of selected_real_kind fall into their nearest bin (being either 32,64,128 bit etc). Here r_2 defaults to double. In the UM everything is compiled as -i8, -r8 so r_2 is meaningless and only causes complications in development/refactoring especially when TYPES/kinds dont match up. Additionally the UKMO discouraged us from using r_2, special KINDs. However they have since adopted them themselves. Having many different KINDs on either side of the interface is problematic. Last I spoke with them they were uncertain of what this would all look like with LFRic. At any rate it is easier if we just lay off the r_2 for the moment and re-implement a consistent approach at a later date when we know better what is happening. |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,6 +18,11 @@ SUBROUTINE dryLeaf( dels, rad, rough, air, met, & | |
USE cbl_photosynthesis_module, ONLY : photosynthesis | ||
USE cbl_fwsoil_module, ONLY : fwsoil_calc_std, fwsoil_calc_non_linear, & | ||
fwsoil_calc_Lai_Ktaul, fwsoil_calc_sli | ||
!data | ||
USE cable_surface_types_mod, ONLY: evergreen_broadleaf, deciduous_broadleaf | ||
USE cable_surface_types_mod, ONLY: evergreen_needleleaf, deciduous_needleleaf | ||
USE cable_surface_types_mod, ONLY: c3_grassland, tundra, c3_cropland | ||
|
||
! maths & other constants | ||
USE cable_other_constants_mod, ONLY : CLAI_THRESH => LAI_THRESH | ||
! physical constants | ||
|
@@ -26,6 +31,7 @@ SUBROUTINE dryLeaf( dels, rad, rough, air, met, & | |
USE cable_phys_constants_mod, ONLY : CRGAS => RGAS | ||
USE cable_phys_constants_mod, ONLY : CCAPP => CAPP | ||
USE cable_phys_constants_mod, ONLY : CRMAIR => RMAIR | ||
USE cable_phys_constants_mod, ONLY : density_liq | ||
! photosynthetic constants | ||
USE cable_photo_constants_mod, ONLY : CMAXITER => MAXITER ! only integer here | ||
USE cable_photo_constants_mod, ONLY : CTREFK => TREFK | ||
|
@@ -35,6 +41,8 @@ SUBROUTINE dryLeaf( dels, rad, rough, air, met, & | |
USE cable_photo_constants_mod, ONLY : CRGSWC => RGSWC | ||
USE cable_photo_constants_mod, ONLY : CRGBWC => RGBWC | ||
|
||
IMPLICIT NONE | ||
|
||
TYPE (radiation_type), INTENT(INOUT) :: rad | ||
TYPE (roughness_type), INTENT(INOUT) :: rough | ||
TYPE (air_type), INTENT(INOUT) :: air | ||
|
@@ -145,7 +153,9 @@ SUBROUTINE dryLeaf( dels, rad, rough, air, met, & | |
! END header | ||
|
||
ALLOCATE( gswmin(mp,mf )) | ||
|
||
|
||
gs_coeff(:,:) = 0.0 ! CABLE_ISSUE39 | ||
|
||
! Soil water limitation on stomatal conductance: | ||
IF( iter ==1) THEN | ||
IF ((cable_user%soil_struc=='default').AND.(cable_user%FWSOIL_SWITCH.NE.'Haverd2013')) THEN | ||
|
@@ -319,36 +329,38 @@ SUBROUTINE dryLeaf( dels, rad, rough, air, met, & | |
!1.2877 + (0.0116 × Vcmax,a25) – (0.0334 × TWQ) | ||
!Shrubs: Rdark,a25 = 1.5758 + (0.0116 × Vcmax,a25) – (0.0334 × TWQ) | ||
|
||
IF (veg%iveg(i).EQ.2 .OR. veg%iveg(i).EQ. 4 ) THEN ! broadleaf forest | ||
|
||
rdx(i,1) = 0.60*(1.2818e-6+0.0116*veg%vcmax(i)- & | ||
0.0334*climate%qtemp_max_last_year(i)*1e-6) | ||
rdx(i,2) = rdx(i,1) | ||
|
||
ELSEIF (veg%iveg(i).EQ.1 .OR. veg%iveg(i).EQ. 3 ) THEN ! needleleaf forest | ||
rdx(i,1) = 1.0*(1.2877e-6+0.0116*veg%vcmax(i)- & | ||
0.0334*climate%qtemp_max_last_year(i)*1e-6) | ||
rdx(i,2) = rdx(i,1) | ||
|
||
ELSEIF (veg%iveg(i).EQ.6 .OR. veg%iveg(i).EQ.8 .OR. & | ||
veg%iveg(i).EQ. 9 ) THEN ! C3 grass, tundra, crop | ||
rdx(i,1) = 0.60*(1.6737e-6+0.0116*veg%vcmax(i)- & | ||
0.0334*climate%qtemp_max_last_year(i)*1e-6) | ||
rdx(i,2) = rdx(i,1) | ||
|
||
ELSE ! shrubs and other (C4 grass and crop) | ||
rdx(i,1) = 0.60*(1.5758e-6+0.0116*veg%vcmax(i)- & | ||
0.0334*climate%qtemp_max_last_year(i)*1e-6) | ||
rdx(i,2) = rdx(i,1) | ||
! broadleaf forest | ||
IF ( veg%iveg(i) .EQ. evergreen_broadleaf .OR. & | ||
veg%iveg(i) .EQ. deciduous_broadleaf ) THEN | ||
|
||
rdx(i,:) = 0.60 * ( 1.2818e-6 + 0.0116 * veg%vcmax(i) - & | ||
0.0334 * climate%qtemp_max_last_year(i) * 1.0e-6 ) | ||
|
||
! needleleaf forest | ||
ELSEIF ( veg%iveg(i) .EQ. evergreen_needleleaf .OR. & | ||
veg%iveg(i) .EQ. deciduous_needleleaf ) THEN | ||
|
||
rdx(i,:) = 1.0 * ( 1.2877e-6 + 0.0116 * veg%vcmax(i) - & | ||
0.0334 * climate%qtemp_max_last_year(i) * 1.0e-6 ) | ||
|
||
! C3 grass, tundra , C3 crop | ||
ELSEIF ( veg%iveg(i) .EQ. c3_grassland .OR. & | ||
veg%iveg(i) .EQ. tundra .OR. & | ||
veg%iveg(i) .EQ. c3_cropland ) THEN | ||
|
||
rdx(i,:) = 0.60 * ( 1.6737e-6 + 0.0116 * veg%vcmax(i) - & | ||
0.0334 * climate%qtemp_max_last_year(i) * 1e-6 ) | ||
|
||
! shrub & other (C4 grass and C4 crop) (wetlands, nveg) TBC | ||
ELSE | ||
rdx(i,:) = 0.60 * ( 1.5758e-6 + 0.0116 * veg%vcmax(i) - & | ||
0.0334 * climate%qtemp_max_last_year(i) * 1.0e-6 ) | ||
ENDIF | ||
|
||
|
||
! modify for leaf area and instanteous temperature response (Rd25 -> Rd) | ||
rdx(i,1) = rdx(i,1) * xrdt(tlfx(i)) * rad%scalex(i,1) | ||
rdx(i,2) = rdx(i,2) * xrdt(tlfx(i)) * rad%scalex(i,2) | ||
|
||
|
||
|
||
! reduction of daytime leaf dark-respiration to account for | ||
!photo-inhibition | ||
!Mercado, L. M., Huntingford, C., Gash, J. H. C., Cox, P. M., | ||
|
@@ -369,15 +381,8 @@ SUBROUTINE dryLeaf( dels, rad, rough, air, met, & | |
rdx(i,2) = rdx(i,2) * & | ||
(0.5 - 0.05*LOG(jtomol*1.0e6*rad%qcan(i,1,2))) | ||
|
||
!$ xleuning(i,1) = ( fwsoil(i) / ( csx(i,1) - co2cp3 ) ) & | ||
!$ * ( veg%a1gs(i) / ( 1.0 + dsx(i)/veg%d0gs(i))) | ||
!$ xleuning(i,2) = ( fwsoil(i) / ( csx(i,2) - co2cp3 ) ) & | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This commenting style has lead to issues in some UM builds. Its redundant code anyway |
||
!$ * ( veg%a1gs(i) / ( 1.0 + dsx(i)/veg%d0gs(i))) | ||
|
||
ELSE !cable_user%call_climate | ||
|
||
!$!Vanessa:note there is no xleuning to go into photosynthesis etc anymore | ||
!$ gs_coeff = xleuning | ||
|
||
rdx(i,1) = (veg%cfrd(i)*vcmxt3(i,1) + veg%cfrd(i)*vcmxt4(i,1)) | ||
rdx(i,2) = (veg%cfrd(i)*vcmxt3(i,2) + veg%cfrd(i)*vcmxt4(i,2)) | ||
|
@@ -494,12 +499,12 @@ SUBROUTINE dryLeaf( dels, rad, rough, air, met, & | |
REAL(veg%froot(i,:),r_2),& | ||
soil%ssat_vec(i,:), & | ||
soil%swilt_vec(i,:), & | ||
MAX(REAL(canopy%fevc(i)/air%rlam(i)/1000_r_2,r_2),0.0_r_2), & | ||
MAX(REAL(canopy%fevc(i)/air%rlam(i)/density_liq,r_2),0.0_r_2), & | ||
REAL(veg%gamma(i),r_2), & | ||
REAL(soil%zse,r_2), REAL(dels,r_2), REAL(veg%zr(i),r_2)) | ||
|
||
fwsoil(i) = canopy%fwsoil(i) | ||
ssnow%evapfbl(i,:) = ssnow%rex(i,:)*dels*1000_r_2 ! mm water & | ||
ssnow%evapfbl(i,:) = ssnow%rex(i,:)*dels*density_liq ! mm water & | ||
!(root water extraction) per time step | ||
|
||
ELSE | ||
|
@@ -513,7 +518,7 @@ SUBROUTINE dryLeaf( dels, rad, rough, air, met, & | |
ssnow%evapfbl(i,kk) = MIN( evapfb(i) * veg%froot(i,kk), & | ||
MAX( 0.0, REAL( ssnow%wb(i,kk) ) - & | ||
1.1 * soil%swilt(i) ) * & | ||
soil%zse(kk) * 1000.0 ) | ||
soil%zse(kk) * density_liq ) | ||
|
||
ENDDO | ||
IF (cable_user%soil_struc=='default') THEN | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.