Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nitrogen Test #86

Merged
merged 1 commit into from
Jun 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 13 additions & 16 deletions src/clearwater_modules/nsm1/processes.py
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ def rna(
AWn: xr.DataArray,
AWa: xr.DataArray
) -> xr.DataArray:
"""Calculate rna (mg-N/ug-Chla).
"""Calculate rna (mg-N/ug-Chla) using Redfield ratios.

Args:
AWn: Nitrogen Weight (mg)
Expand All @@ -328,7 +328,7 @@ def rpa(
AWp: xr.DataArray,
AWa: xr.DataArray
) -> xr.DataArray:
"""Calculate rpa (mg-P/ug-Chla).
"""Calculate rpa (mg-P/ug-Chla) using Redfield ratios.

Args:
AWp: Phosphorus Weight (mg)
Expand All @@ -343,7 +343,7 @@ def rca(
AWc: xr.DataArray,
AWa: xr.DataArray
) -> xr.DataArray:
"""Calculate rca (mg-C/ug-Chla).
"""Calculate rca (mg-C/ug-Chla) using Redfield ratios.

Args:
AWc: Carbon Weight (mg)
Expand All @@ -357,7 +357,7 @@ def rda(
AWd: xr.DataArray,
AWa: xr.DataArray
) -> xr.DataArray:
"""Calculate rda (mg-D/ug-Chla).
"""Calculate rda (mg-D/ug-Chla) using Redfield ratios.

Args:
AWd: Dry Algal Weight (mg)
Expand Down Expand Up @@ -743,7 +743,7 @@ def rnb(
BWn: xr.DataArray,
BWd: xr.DataArray
) -> xr.DataArray:
"""Calculate rnb (mg-N/mg-D).
"""Calculate rnb (mg-N/mg-D) using Redfield ratios.

Args:
BWn: Benthic algae nitrogen (unitless)
Expand All @@ -757,7 +757,7 @@ def rpb(
BWp: xr.DataArray,
BWd: xr.DataArray
) -> xr.DataArray:
"""Calculate rpd: Benthic algae phosphorus to dry weight ratio (mg-P/mg-D).
"""Calculate rpd: Benthic algae phosphorus to dry weight ratio (mg-P/mg-D) using Redfield ratios.

Args:
BWp: Benthic algae phosphorus (mg-P)
Expand All @@ -771,7 +771,7 @@ def rcb(
BWc: xr.DataArray,
BWd: xr.DataArray
) -> xr.DataArray:
"""Calculate rcb: Benthic algae carbon to dry weight ratio (mg-C/mg-D).
"""Calculate rcb: Benthic algae carbon to dry weight ratio (mg-C/mg-D) using Redfield ratios.

Args:
BWc: Benthic algae carbon (mg-C)
Expand All @@ -785,7 +785,7 @@ def rab(
BWa: xr.DataArray,
BWd: xr.DataArray
) -> xr.DataArray:
"""Calculate rab: Benthic algae chlorophyll-a to dry weight ratio (ug-Chla-a/mg-D).
"""Calculate rab: Benthic algae chlorophyll-a to dry weight ratio (ug-Chla-a/mg-D) using Redfield ratios.

Args:
BWa: Benthic algae chlorophyll-a (ug-Chla-a)
Expand Down Expand Up @@ -906,7 +906,8 @@ def FNb(

default = FNb_orig
)



return FNb


Expand Down Expand Up @@ -1012,7 +1013,7 @@ def mub(

default = 0
)

return mub


Expand Down Expand Up @@ -1100,7 +1101,7 @@ def Chlb(
Ab: xr.DataArray,

) -> xr.DataArray:
"""Calculate chlorophyll-a concentration (mg-Chla/m^2)
"""Calculate chlorophyll-a concentration (mg-Chla/m^2) using Redfield ratios

Args:
rab: Balgae Chla to Dry ratio (mg-D/ug-Chla)
Expand Down Expand Up @@ -1434,7 +1435,7 @@ def NH4_Nitrification(
knit_tc: Nitrification rate ammonia decay NH4 to NO3 temperature correction (1/d).
NH4: Ammonium concentration (mg-N/L),
"""

print("NH4_Nitrification", NH4_Nitrification)
return xr.where(use_NH4,NitrificationInhibition * knit_tc * NH4,0)


Expand Down Expand Up @@ -1484,7 +1485,6 @@ def NH4_ApGrowth(
ApGrowth: Algal growth rate (ug-Chla/L/d),
ApUptakeFr_NH4: Fraction of actual xr.DataArraying algal uptake from ammonia pool
"""

return xr.where(use_Algae, ApUptakeFr_NH4 * rna * ApGrowth, 0.0)

def NH4_AbRespiration(
Expand Down Expand Up @@ -1709,7 +1709,6 @@ def dNO3dt(

"""


return xr.where(use_NO3, NH4_Nitrification - NO3_Denit - NO3_BedDenit - NO3_ApGrowth - NO3_AbGrowth ,0)


Expand Down Expand Up @@ -1948,8 +1947,6 @@ def DIPfromBed(
"""
return rpo4_tc / depth

#TODO calcuate fdp?

def TIP_Settling(
vs: xr.DataArray,
depth: xr.DataArray,
Expand Down
Loading
Loading