AquaticEcoDynamics / libaed-water

Code for the AED water quality model
GNU General Public License v3.0
6 stars 6 forks source link

new functions for P-adsorp from salinity/temperature #47

Open aed-modeller opened 2 years ago

aed-modeller commented 2 years ago

https://github.com/AquaticEcoDynamics/libaed-water/blob/a27a543d9f53aaf3c5cd7ff68f051fc2b8b11828/src/aed_phosphorus.F90#L308

Below is a new function for the Kpo4p prediction as function of salinity and temperature. This function comes out directly from Zhang and Huang 2011, and is much more accurate and reliable than the previous one.

Note this function calculate the Kpo4p directly, not a scale factor. So in the aed_phosphorus.f90 the line 308 Kpo4p = data%Kpo4p * Kpo4p_fT_fSal(data%theta_Kpo4, data%K_sal, salt, temp)

should be changed to Kpo4p = Kpo4p_fT_fSal(data%Pexch, salt, temp)

The function only requirs one parameter, which is the exchangable phosphate content in the particles (Pexch).

!###############################################################################
PURE AED_REAL FUNCTION Kpo4p_fT_fSal(Pexch, sal, temp)
!-------------------------------------------------------------------------------
! Kpo4P values as interpolated from Eq(9) and Eq(10) of 
!  Zhang and Huang 2011, in Floriday bay
!-------------------------------------------------------------------------------
!ARGUMENTS

AED_REAL,INTENT(in) :: temp
AED_REAL,INTENT(in) :: sal
AED_REAL,INTENT(in) :: Pexch  ! exchangable phosphate content in the particles in unit of umol/g, default = 0.78 for Coorong
AED_REAL :: parA, parB           ! parameters in Eq(9) and Eq(10)
AED_REAL :: EPC0, Ppar          !  PO4 partition in the water and particles

!
!-------------------------------------------------------------------------------
!BEGIN

! the Zhang's experiment and function only valid for temperature range of 15 to 35 degrees
! when temp<15 the function goes funny, so need to assume the the Kpo4p for
!          temperature under 15 is the same to 15
IF (temp<15.0) temp=15.0;

! Eq(9) and Eq(10) from Zhang and Huang 2011      
parA=-140.5 + 1098.2/temp + 30.67*log(temp)+0.0907*salt;
parB=1225.96 - 6880.49/temp - 278.77*log(temp)+0.4561*salt;

! calculate the equilibrium P content in the water as uM
EPC0=A*Pexch + B*(Pexch)**2;

! Equilibrium P content in the particles(100 mg)
Ppar=60-EPC0;      ! initial P is 60 uM
IF (Ppar<0) Ppar=0  ! add a limitation to avoid Ppar goes negative

! calculate the Kpo4p, defined as the ratio of the particulate P concentration
!         to the dissolved P concentration per mg of SS
Kpo4p_fT_fSal = Ppar/EPC0/100;

END FUNCTION Kpo4p_fT_fSal
aed-modeller commented 2 years ago

A plot of Kpo4p values from this function, with Pexch = 0.78 for the Coorong

P_adsorp_Zhang_test

matthipsey commented 2 years ago

Hi Peisheng

I think this is actually a whole new adsorption model, rather than a salinity correction to the existing model

This needs to be added as a new PO4AdsorptionModel https://github.com/AquaticEcoDynamics/libaed-water/blob/a27a543d9f53aaf3c5cd7ff68f051fc2b8b11828/src/aed_phosphorus.F90#L314

The issue is also that the Pexch is changing dynamically and is not a constant at 0.78.