Skip to content

Commit 701a965

Browse files
authored
Merge pull request #86 from EcohydrologyTeam/KW_NitrogenTesting
Nitrogen Test
2 parents 190c12a + ca28ae8 commit 701a965

File tree

2 files changed

+1436
-21
lines changed

2 files changed

+1436
-21
lines changed

src/clearwater_modules/nsm1/processes.py

+13-16
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ def rna(
314314
AWn: xr.DataArray,
315315
AWa: xr.DataArray
316316
) -> xr.DataArray:
317-
"""Calculate rna (mg-N/ug-Chla).
317+
"""Calculate rna (mg-N/ug-Chla) using Redfield ratios.
318318
319319
Args:
320320
AWn: Nitrogen Weight (mg)
@@ -328,7 +328,7 @@ def rpa(
328328
AWp: xr.DataArray,
329329
AWa: xr.DataArray
330330
) -> xr.DataArray:
331-
"""Calculate rpa (mg-P/ug-Chla).
331+
"""Calculate rpa (mg-P/ug-Chla) using Redfield ratios.
332332
333333
Args:
334334
AWp: Phosphorus Weight (mg)
@@ -343,7 +343,7 @@ def rca(
343343
AWc: xr.DataArray,
344344
AWa: xr.DataArray
345345
) -> xr.DataArray:
346-
"""Calculate rca (mg-C/ug-Chla).
346+
"""Calculate rca (mg-C/ug-Chla) using Redfield ratios.
347347
348348
Args:
349349
AWc: Carbon Weight (mg)
@@ -357,7 +357,7 @@ def rda(
357357
AWd: xr.DataArray,
358358
AWa: xr.DataArray
359359
) -> xr.DataArray:
360-
"""Calculate rda (mg-D/ug-Chla).
360+
"""Calculate rda (mg-D/ug-Chla) using Redfield ratios.
361361
362362
Args:
363363
AWd: Dry Algal Weight (mg)
@@ -743,7 +743,7 @@ def rnb(
743743
BWn: xr.DataArray,
744744
BWd: xr.DataArray
745745
) -> xr.DataArray:
746-
"""Calculate rnb (mg-N/mg-D).
746+
"""Calculate rnb (mg-N/mg-D) using Redfield ratios.
747747
748748
Args:
749749
BWn: Benthic algae nitrogen (unitless)
@@ -757,7 +757,7 @@ def rpb(
757757
BWp: xr.DataArray,
758758
BWd: xr.DataArray
759759
) -> xr.DataArray:
760-
"""Calculate rpd: Benthic algae phosphorus to dry weight ratio (mg-P/mg-D).
760+
"""Calculate rpd: Benthic algae phosphorus to dry weight ratio (mg-P/mg-D) using Redfield ratios.
761761
762762
Args:
763763
BWp: Benthic algae phosphorus (mg-P)
@@ -771,7 +771,7 @@ def rcb(
771771
BWc: xr.DataArray,
772772
BWd: xr.DataArray
773773
) -> xr.DataArray:
774-
"""Calculate rcb: Benthic algae carbon to dry weight ratio (mg-C/mg-D).
774+
"""Calculate rcb: Benthic algae carbon to dry weight ratio (mg-C/mg-D) using Redfield ratios.
775775
776776
Args:
777777
BWc: Benthic algae carbon (mg-C)
@@ -785,7 +785,7 @@ def rab(
785785
BWa: xr.DataArray,
786786
BWd: xr.DataArray
787787
) -> xr.DataArray:
788-
"""Calculate rab: Benthic algae chlorophyll-a to dry weight ratio (ug-Chla-a/mg-D).
788+
"""Calculate rab: Benthic algae chlorophyll-a to dry weight ratio (ug-Chla-a/mg-D) using Redfield ratios.
789789
790790
Args:
791791
BWa: Benthic algae chlorophyll-a (ug-Chla-a)
@@ -906,7 +906,8 @@ def FNb(
906906

907907
default = FNb_orig
908908
)
909-
909+
910+
910911
return FNb
911912

912913

@@ -1012,7 +1013,7 @@ def mub(
10121013

10131014
default = 0
10141015
)
1015-
1016+
10161017
return mub
10171018

10181019

@@ -1100,7 +1101,7 @@ def Chlb(
11001101
Ab: xr.DataArray,
11011102

11021103
) -> xr.DataArray:
1103-
"""Calculate chlorophyll-a concentration (mg-Chla/m^2)
1104+
"""Calculate chlorophyll-a concentration (mg-Chla/m^2) using Redfield ratios
11041105
11051106
Args:
11061107
rab: Balgae Chla to Dry ratio (mg-D/ug-Chla)
@@ -1434,7 +1435,7 @@ def NH4_Nitrification(
14341435
knit_tc: Nitrification rate ammonia decay NH4 to NO3 temperature correction (1/d).
14351436
NH4: Ammonium concentration (mg-N/L),
14361437
"""
1437-
1438+
print("NH4_Nitrification", NH4_Nitrification)
14381439
return xr.where(use_NH4,NitrificationInhibition * knit_tc * NH4,0)
14391440

14401441

@@ -1484,7 +1485,6 @@ def NH4_ApGrowth(
14841485
ApGrowth: Algal growth rate (ug-Chla/L/d),
14851486
ApUptakeFr_NH4: Fraction of actual xr.DataArraying algal uptake from ammonia pool
14861487
"""
1487-
14881488
return xr.where(use_Algae, ApUptakeFr_NH4 * rna * ApGrowth, 0.0)
14891489

14901490
def NH4_AbRespiration(
@@ -1709,7 +1709,6 @@ def dNO3dt(
17091709
17101710
"""
17111711

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

17151714

@@ -1948,8 +1947,6 @@ def DIPfromBed(
19481947
"""
19491948
return rpo4_tc / depth
19501949

1951-
#TODO calcuate fdp?
1952-
19531950
def TIP_Settling(
19541951
vs: xr.DataArray,
19551952
depth: xr.DataArray,

0 commit comments

Comments
 (0)