From fe2ad56d43b93b6822ea7484ed043833cbffe30b Mon Sep 17 00:00:00 2001 From: Gautam Bisht Date: Wed, 26 Apr 2017 16:30:25 -0700 Subject: [PATCH] Fixes land BGC computation for threads more than one When nthreads > 1, the size of local variable (e.g. temp_sminp_to_plant) is not equal to the global variable (e.g. phosphorusflux_vars%sminp_to_plant_col). --- components/clm/src/biogeochem/CNAllocationMod.F90 | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/components/clm/src/biogeochem/CNAllocationMod.F90 b/components/clm/src/biogeochem/CNAllocationMod.F90 index e6711180c0fb..bbb79fb9946b 100755 --- a/components/clm/src/biogeochem/CNAllocationMod.F90 +++ b/components/clm/src/biogeochem/CNAllocationMod.F90 @@ -3883,8 +3883,8 @@ subroutine CNAllocation3_PlantCNPAlloc (bounds , & else ! use_nitrif_denitrif - temp_sminn_to_plant = sminn_to_plant - temp_sminp_to_plant = sminp_to_plant + temp_sminn_to_plant(bounds%begc:bounds%endc) = sminn_to_plant(bounds%begc:bounds%endc) + temp_sminp_to_plant(bounds%begc:bounds%endc) = sminp_to_plant(bounds%begc:bounds%endc) call p2c(bounds,num_soilc,filter_soilc, & sminn_to_npool(bounds%begp:bounds%endp), & @@ -3959,8 +3959,8 @@ subroutine CNAllocation3_PlantCNPAlloc (bounds , & if( .not.cnallocate_carbonphosphorus_only().and. .not.cnallocate_carbonnitrogen_only().and. .not.cnallocate_carbon_only() )then - temp_sminn_to_plant = sminn_to_plant - temp_sminp_to_plant = sminp_to_plant + temp_sminn_to_plant(bounds%begc:bounds%endc) = sminn_to_plant(bounds%begc:bounds%endc) + temp_sminp_to_plant(bounds%begc:bounds%endc) = sminp_to_plant(bounds%begc:bounds%endc) call p2c(bounds,num_soilc,filter_soilc, & sminn_to_npool(bounds%begp:bounds%endp), & @@ -3996,7 +3996,7 @@ subroutine CNAllocation3_PlantCNPAlloc (bounds , & if( cnallocate_carbonnitrogen_only() )then - temp_sminp_to_plant = sminp_to_plant + temp_sminp_to_plant(bounds%begc:bounds%endc) = sminp_to_plant(bounds%begc:bounds%endc) call p2c(bounds,num_soilc,filter_soilc, & sminp_to_ppool(bounds%begp:bounds%endp), &