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

Running the NPZD with BuoyancyTracer() #241

Open
iuryt opened this issue Jan 14, 2025 · 4 comments
Open

Running the NPZD with BuoyancyTracer() #241

iuryt opened this issue Jan 14, 2025 · 4 comments

Comments

@iuryt
Copy link
Collaborator

iuryt commented Jan 14, 2025

The current documentation mention that the temperature sensitivity in the list of equations that are solved for NPZD model. Therefore, the model does not run without :T.

Returning:

ArgumentError: The biogeochemical model you have selected requires (:N, :P, :Z, :D, :T).
You have specified some but not all of these as tracers so may be attempting
to use them for a different purpose. Please either specify all of the required
fields, or none and allow them to be automatically added.

On the code:

@inline Q₁₀(T) = 1.88 ^ (T / 10) # T in °C

Can we do a straightforward implementation for NPZD with constant temperature or no temperature sensitivity?
Maybe something like NutrientPhytoplanktonZooplanktonDetritus(; grid, T=10)

There are reasons why we should be able to run the simulation on buoyancy only, especially for expensive process model simulations. A workaround could be to run with the temperature only and use SeawaterBuoyancy(constant_salinity = true).

What do you all think?

Edit: I was previously saying that the docs were not mentioning it, but I just realized it is mentioning, but it is not explicit that there is no way to set a constant temperature or run with BuoyancyTracer()

@jagoosw
Copy link
Collaborator

jagoosw commented Jan 14, 2025

A way you could do it with a buoyancy tracer is to manually set the tracers like tracers=(:N, :P, :Z, :D, :b) and add T as an auxiliary field like auxiliary_fields = (; T = ConstantField(10))

@jagoosw
Copy link
Collaborator

jagoosw commented Jan 14, 2025

I guess we could also make T an optional dependency but it might not be the most straightforward.

If we changed the model to be discrete form we could just add a parameter like temperature_sensetivity then whenever we need Q_10 write:

Q_10 = compute_temperature_sensetivity(bgc, fields)

and dispatch like

compute_temperature_sensetivity(::NPZD{Nothing}, fields) = 1

@iuryt
Copy link
Collaborator Author

iuryt commented Jan 14, 2025

A way you could do it with a buoyancy tracer is to manually set the tracers like tracers=(:N, :P, :Z, :D, :b) and add T as an auxiliary field like auxiliary_fields = (; T = ConstantField(10))

I tried that and it still returns the same error probably because of this line?

required_biogeochemical_tracers(::NPZD) = (:N, :P, :Z, :D, :T)

Example:

#--------------- Instantiate Model
forcing = (;
    u=mom_sponge, v=mom_sponge, w=mom_sponge,
)


#eventually, try different buoyancy
model = NonhydrostaticModel(grid = grid, 
                            biogeochemistry=biogeochemistry,
                            advection = WENO(; grid),
                            coriolis = coriolis,
                            closure = (horizontal_closure,vertical_closure),
                            tracers = (:b, :N, :P, :Z, :D),
                            buoyancy = BuoyancyTracer(),
                            forcing = forcing,
                            boundary_conditions = (u=u_bcs, v=v_bcs),
                            auxiliary_fields = (; T = ConstantField(10)))

@iuryt
Copy link
Collaborator Author

iuryt commented Jan 14, 2025

@jagoosw
I think that we could add the option that if T is not in the tracers, it should be in the auxiliary_fields, but I can see that it might not be a straightforward implementation.

required_biogeochemical_tracers(::NPZD) = (:N, :P, :Z, :D, :T)
required_biogeochemical_auxiliary_fields(::NPZD) = (:PAR, )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants