Summary:

Paid-for Retranslocation

This section describes an iterative calculation to determine the degree to which nitrogen (N) retranslocation from leaves is paid for as carbon-to-nitrogen (C:N) ratios and costs increase as N is extracted. The calculation continues until one of three conditions is met:

1. The cost of retranslocation (cost_retrans) exceeds the cost of acquiring N from alternative pathways (N_cost,tot).
2. The C:N ratio of falling leaves (CN_fallingleaf) reaches a maximum level, after which no more extraction is possible (representing unavoidable N loss).
3. There is no more carbon left to pay for extraction.

The key steps in the calculation are:

1. Calculate the cost of extraction (cost_retrans) based on the current leaf C:N ratio.
2. Determine the amount of C needed to be spent to increase the falling leaf C:N ratio by 1.0 (C_retrans_spent,i), limited by the available C (C_avail,retrans,i).
3. Calculate the amount of N retranslocated from the leaf in this iteration (N_retrans,paid,i), ensuring it does not fall below zero.
4. Determine the growth C accounted for by this N extraction (C_retrans,accounted,i), considering the plant C:N ratio and growth respiration.
5. Update the falling leaf N, C:N ratio, and cost_retrans, as well as the available C for the next iteration (C_avail,retrans,i+1).

The iterative process continues until one of the three stopping conditions is met.