Skip to content

Commit

Permalink
Different allocation for offline and coupled
Browse files Browse the repository at this point in the history
  • Loading branch information
ccarouge committed Jan 20, 2025
1 parent 1b44cd0 commit 2de130b
Showing 1 changed file with 65 additions and 29 deletions.
94 changes: 65 additions & 29 deletions src/util/cable_climate_type_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -158,42 +158,78 @@ SUBROUTINE alloc_climate_type(climate, mp)
USE grid_constants_mod_cbl, ONLY: mf ! # leaves (sunlit/shaded)
USE grid_constants_mod_cbl, ONLY: nsl ! # soil layers
USE grid_constants_mod_cbl, ONLY: niter ! number of iterations for za/L
USE cable_common_module, ONLY: cable_runtime

IMPLICIT NONE

TYPE(climate_data_type), INTENT(INOUT) :: climate
INTEGER, INTENT(IN) :: mp
!! Number of tiles/patches in the CABLE simulation

ALLOCATE( climate% chilldays (1) )
ALLOCATE( climate% iveg (1) )
ALLOCATE( climate% biome (1) )
ALLOCATE( climate% dtemp (1) )
ALLOCATE( climate% dmoist (1) )
ALLOCATE( climate% mtemp (1) )
ALLOCATE( climate% qtemp (1) )
ALLOCATE( climate% mmoist (1) )
ALLOCATE( climate% mtemp_min (1) )
ALLOCATE( climate% mtemp_max (1) )
ALLOCATE( climate% qtemp_max (1) )
ALLOCATE( climate% mtemp_min20 (1) )
ALLOCATE( climate% mtemp_max20 (1) )
ALLOCATE( climate% atemp_mean (1) )
ALLOCATE( climate% AGDD5 (1) )
ALLOCATE( climate% GDD5 (1) )
ALLOCATE( climate% AGDD0 (1) )
ALLOCATE( climate% GDD0 (1) )
ALLOCATE( climate% alpha_PT (1) )
ALLOCATE( climate% evap_PT (1) )
ALLOCATE( climate% aevap (1) )
ALLOCATE( climate% alpha_PT20 (1) )
ALLOCATE( climate% qtemp_max_last_year (1) )
ALLOCATE( climate% mtemp_min_20 (1,1) )
ALLOCATE( climate% mtemp_max_20 (1,1) )
ALLOCATE( climate% dtemp_31 (1,1) )
ALLOCATE( climate% dmoist_31 (1,1) )
ALLOCATE( climate% alpha_PT_20 (1,1) )
ALLOCATE( climate% dtemp_91 (1,1) )
IF ( cable_runtime%um ) THEN
ALLOCATE( climate% chilldays (1) )
ALLOCATE( climate% iveg (1) )
ALLOCATE( climate% biome (1) )
ALLOCATE( climate% dtemp (1) )
ALLOCATE( climate% dmoist (1) )
ALLOCATE( climate% mtemp (1) )
ALLOCATE( climate% qtemp (1) )
ALLOCATE( climate% mmoist (1) )
ALLOCATE( climate% mtemp_min (1) )
ALLOCATE( climate% mtemp_max (1) )
ALLOCATE( climate% qtemp_max (1) )
ALLOCATE( climate% mtemp_min20 (1) )
ALLOCATE( climate% mtemp_max20 (1) )
ALLOCATE( climate% atemp_mean (1) )
ALLOCATE( climate% AGDD5 (1) )
ALLOCATE( climate% GDD5 (1) )
ALLOCATE( climate% AGDD0 (1) )
ALLOCATE( climate% GDD0 (1) )
ALLOCATE( climate% alpha_PT (1) )
ALLOCATE( climate% evap_PT (1) )
ALLOCATE( climate% aevap (1) )
ALLOCATE( climate% alpha_PT20 (1) )
ALLOCATE( climate% qtemp_max_last_year (1) )
ALLOCATE( climate% mtemp_min_20 (1,1) )
ALLOCATE( climate% mtemp_max_20 (1,1) )
ALLOCATE( climate% dtemp_31 (1,1) )
ALLOCATE( climate% dmoist_31 (1,1) )
ALLOCATE( climate% alpha_PT_20 (1,1) )
ALLOCATE( climate% dtemp_91 (1,1) )

ELSE

ALLOCATE( climate% chilldays (mp) )
ALLOCATE( climate% iveg (mp) )
ALLOCATE( climate% biome (mp) )
ALLOCATE( climate% dtemp (mp) )
ALLOCATE( climate% dmoist (mp) )
ALLOCATE( climate% mtemp (mp) )
ALLOCATE( climate% qtemp (mp) )
ALLOCATE( climate% mmoist (mp) )
ALLOCATE( climate% mtemp_min (mp) )
ALLOCATE( climate% mtemp_max (mp) )
ALLOCATE( climate% qtemp_max (mp) )
ALLOCATE( climate% mtemp_min20 (mp) )
ALLOCATE( climate% mtemp_max20 (mp) )
ALLOCATE( climate% atemp_mean (mp) )
ALLOCATE( climate% AGDD5 (mp) )
ALLOCATE( climate% GDD5 (mp) )
ALLOCATE( climate% AGDD0 (mp) )
ALLOCATE( climate% GDD0 (mp) )
ALLOCATE( climate% alpha_PT (mp) )
ALLOCATE( climate% evap_PT (mp) )
ALLOCATE( climate% aevap (mp) )
ALLOCATE( climate% alpha_PT20 (mp) )
ALLOCATE( climate% qtemp_max_last_year (mp) )
ALLOCATE( climate% mtemp_min_20 (mp,ny) )
ALLOCATE( climate% mtemp_max_20 (mp,ny) )
ALLOCATE( climate% dtemp_31 (mp,nd) )
ALLOCATE( climate% dmoist_31 (mp,nd) )
ALLOCATE( climate% alpha_PT_20 (mp,ny) )
ALLOCATE( climate% dtemp_91 (mp,ns) )

END IF

climate% chilldays (:) = 0.0
climate% iveg (:) = 0.0
Expand Down

0 comments on commit 2de130b

Please sign in to comment.