@@ -1553,7 +1553,7 @@ subroutine compute_autotroph_calcification(km, autotroph_local, temperature, car
15531553
15541554 ! P-limitation effect (CaCO2/organicC ratio increases when P limitation term is low)
15551555 ! max out picpoc at one to prevent crashing due to "ballast exceeds POC" error
1556- picpoc = min (1 ., max (0.0_r8 , - 0.48_r8 * Plim(auto_ind,:) + picpoc(:) + 0.48_r8 ))
1556+ picpoc = min (1.0_r8 , max (0.0_r8 , - 0.48_r8 * Plim(auto_ind,:) + picpoc(:) + 0.48_r8 ))
15571557
15581558 ! multiply cocco growth rate by picpoc to get CaCO3 formation
15591559 CaCO3_form(auto_ind,:) = picpoc(:) * photoC(auto_ind,:)
@@ -1709,7 +1709,7 @@ subroutine compute_autotroph_nutrient_uptake(marbl_tracer_indices, autotroph_der
17091709 !- ----------------------------------------------------------------------
17101710 ! local variables
17111711 !- ----------------------------------------------------------------------
1712- integer :: auto_ind
1712+ integer :: auto_ind, k
17131713 !- ----------------------------------------------------------------------
17141714
17151715 associate( &
@@ -1733,21 +1733,23 @@ subroutine compute_autotroph_nutrient_uptake(marbl_tracer_indices, autotroph_der
17331733
17341734 do auto_ind = 1 , autotroph_cnt
17351735
1736- where (VNtot(auto_ind,:) > c0)
1737- NO3_V(auto_ind,:) = (VNO3(auto_ind,:) / VNtot(auto_ind,:)) * photoC(auto_ind,:) * Q
1738- NH4_V(auto_ind,:) = (VNH4(auto_ind,:) / VNtot(auto_ind,:)) * photoC(auto_ind,:) * Q
1739- else where
1740- NO3_V(auto_ind,:) = c0
1741- NH4_V(auto_ind,:) = c0
1742- end where
1736+ do k= 1 ,size (VNtot,2 )
1737+ if (VNtot(auto_ind,k) > c0) then
1738+ NO3_V(auto_ind,k) = (VNO3(auto_ind,k) / VNtot(auto_ind,k)) * photoC(auto_ind,k) * Q
1739+ NH4_V(auto_ind,k) = (VNH4(auto_ind,k) / VNtot(auto_ind,k)) * photoC(auto_ind,k) * Q
1740+ else
1741+ NO3_V(auto_ind,k) = c0
1742+ NH4_V(auto_ind,k) = c0
1743+ end if
17431744
1744- where (VPtot(auto_ind,:) > c0)
1745- PO4_V(auto_ind,:) = (VPO4(auto_ind,:) / VPtot(auto_ind,:)) * photoC(auto_ind,:) * gQp(auto_ind,:)
1746- DOP_V(auto_ind,:) = (VDOP(auto_ind,:) / VPtot(auto_ind,:)) * photoC(auto_ind,:) * gQp(auto_ind,:)
1747- else where
1748- PO4_V(auto_ind,:) = c0
1749- DOP_V(auto_ind,:) = c0
1750- end where
1745+ if (VPtot(auto_ind,k) > c0) then
1746+ PO4_V(auto_ind,k) = (VPO4(auto_ind,k) / VPtot(auto_ind,k)) * photoC(auto_ind,k) * gQp(auto_ind,k)
1747+ DOP_V(auto_ind,k) = (VDOP(auto_ind,k) / VPtot(auto_ind,k)) * photoC(auto_ind,k) * gQp(auto_ind,k)
1748+ else
1749+ PO4_V(auto_ind,k) = c0
1750+ DOP_V(auto_ind,k) = c0
1751+ end if
1752+ end do
17511753
17521754 !- ----------------------------------------------------------------------
17531755 ! Get nutrient uptake by diatoms based on C fixation
0 commit comments