mnlevy1981 / MARBL

Marine Biogeochemistry Library
Other
0 stars 0 forks source link

test_set_interior: why does POP write NaNs for some FLUX_100m fields? #16

Closed mnlevy1981 closed 5 years ago

mnlevy1981 commented 5 years ago

From comparing MARBL and POP output:

POC_FLUX_100m
----
Col 5 (shallow) contains all NaNs
  * pop: nan
  * MARBL 0.0

POP_FLUX_100m
----
Col 5 (shallow) contains all NaNs
  * pop: nan
  * MARBL 0.0

CaCO3_FLUX_100m
----
Col 5 (shallow) contains all NaNs
  * pop: nan
  * MARBL 0.0

SiO2_FLUX_100m
----
Col 5 (shallow) contains all NaNs
  * pop: nan
  * MARBL 0.0

P_iron_FLUX_100m
----
Col 5 (shallow) contains all NaNs
  * pop: nan
  * MARBL 0.0
mnlevy1981 commented 5 years ago

The answer to the "why?" question is "these diagnostics are defined with ref_depth set to 100m so POP is applying that mask to the history file." Col 5 is shallower than 100m, so the POP value is coming from a masked out region while the MARBL version is being initialized to 0 and then never set (because the k loop never gets deep enough to set it).

Solution: only write the MARBL value if zw(num_active_levels) <= ref_depth

mnlevy1981 commented 5 years ago

Fixed in 5c5ae5c