Skip to content
This repository was archived by the owner on Sep 21, 2025. It is now read-only.
This repository was archived by the owner on Sep 21, 2025. It is now read-only.

calculating zostoga #182

@paolap

Description

@paolap

There's few functions involved in this in original app and want to make sure before I convert them to xarray that there's not some function we can import from elsewhere.
From APP4 app_functions.py roughly:

tmp=((1. -
   rho_from_theta(T[t,:],35.00,press)/rho_from_theta(4.00,35.00,press))*dz[t,:]).sum(0)
zostoga[t]=(tmp*areacello).sum(0).sum(0)/areacello.sum()

where T is pot_temp
rho_from_theta() is a function to calculate density from temperature, salinity (constant=35.0), pressure
and pressure itself is calculated from depth and latitude

I should be able to replace these two functions with gsw package functions
gsw.conversions.p_from_z
and
one of the gsw.density.sigma functions from https://teos-10.github.io/GSW-Python/density.html

Not sure how different is conservative temperature form potential temperature in the model and which one of the functions to use!!

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions