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

Output variables #485

Open
Sougata18 opened this issue Jun 17, 2023 · 11 comments
Open

Output variables #485

Sougata18 opened this issue Jun 17, 2023 · 11 comments

Comments

@Sougata18
Copy link

I did a 4000 years of spin up run of the 4 deg setup. I have few questions regarding VEROS output veriables.

  1. Some output variables (such as 'u' , 'v' , 'temp' , 'salt' etc.) are available in both 'averages' and 'snapshot' files. What is the difference ?
  2. The 'overturning' file contains variables all having attribute 'meridional transport' , what are the differences ?
  3. The time coordinate is shown in negative integers. What does that mean ?
@dionhaefner
Copy link
Collaborator

dionhaefner commented Jun 19, 2023

  1. Snapshots are instantaneous values and averages are time averages, based on the chosen sampling_frequency of the averages diagnostic.
  • vsf_iso: Vertical streamfunction (zonally averaged) in isopycnal coordinates
  • vsf_depth: Vertical streamfunction (zonally averages) in depth coordinates
  • bolus_iso / bolus_depth: Same, but only for eddy-driven velocities
  1. That should not be the case (time is in days). What are you using to analyze the output?

@Sougata18
Copy link
Author

Sougata18 commented Jun 19, 2023

  1. I am using xarray for the analysis purpose. The time array goes like this -

array([-8960024073709551616, -8928920073709551616, -8897816073709551616, ..., -3062696515966861312, -3031592515966861312, -3000488515966861312], dtype='timedelta64[ns]')

  1. I want to get the meridional transport zonally averaged for the Atlantic basin. Based on what you told about the sampling frequency of the averages diagonstics, I am little confused about how to calculate the transport. Cause the usual way of integrating the u or v component is not giving me the correct values for the transport.
  2. Also the time origin is given as 01-JAN-1900 00:00:00 , is it based on the initial conditions ?

@dionhaefner
Copy link
Collaborator

dionhaefner commented Jun 20, 2023

  1. I am using xarray for the analysis purpose. The time array goes like this -

array([-8960024073709551616, -8928920073709551616, -8897816073709551616, ..., -3062696515966861312, -3031592515966861312, -3000488515966861312], dtype='timedelta64[ns]')

That looks like a bug, perhaps something overflowed. I'll see if I can reproduce it.

  1. I want to get the meridional transport zonally averaged for the Atlantic basin. Based on what you told about the sampling frequency of the averages diagonstics, I am little confused about how to calculate the transport. Cause the usual way of integrating the u or v component is not giving me the correct values for the transport.

Can you show what you tried? How are the values wrong?

  1. Also the time origin is given as 01-JAN-1900 00:00:00 , is it based on the initial conditions ?

No, this is just an arbitrary "year 0" for the model. All times are encoded as "seconds since time origin".

@dionhaefner
Copy link
Collaborator

dionhaefner commented Jun 20, 2023

Indeed, the timedelta64[ns] data type xarray uses can only represent dates up to the year 2262. You can either install cftime or use xr.open_dataset(..., decode_times=False) to solve the problem.

@Sougata18
Copy link
Author

  1. I want to get the meridional transport zonally averaged for the Atlantic basin. Based on what you told about the sampling frequency of the averages diagonstics, I am little confused about how to calculate the transport. Cause the usual way of integrating the u or v component is not giving me the correct values for the transport.

Can you show what you tried? How are the values wrong?

So to calculate the streamfunction for meridional transport I need to integrate 'v' zonally and wrt depth , which should give me values in the range of $10^{06}$ but after the integration (for a single meridional) it gives values like -
array([[-94.94058593], [-94.95589481], [-94.97078953], [-94.9851467 ], [-94.99834973], [-95.01052151], [-95.02236012], [-95.03303989], [-95.04495352], [-95.05687063], [-95.06745418], [-95.07858525], [-95.08779227], [-95.09413547], [-95.09822458], [-95.10236002], [-95.10936345], [-95.11939067], [-95.13169373], [-95.14572238], ... [-96.36318112], [-96.36753048], [-96.37126962], [-96.37563124], [-96.37943745], [-96.38374498], [-96.38759197], [-96.39191286], [-96.39574721], [-96.39999575], [-96.40396971], [-96.40814764], [-96.41229912], [-96.41638589], [-96.42036418], [-96.4245432 ], [-96.4286091 ], [-96.43267466], [-96.43669264], [-96.44058458]])

Here for integration I followed xr.integrate ,
v=da.v[:,:,:,69:89] dv = v.fillna(0) int=dv.integrate(['xt','zt'])

I also noticed that the psi values are in correct order, but they are not a function of depth(psi (Time, yu, xu)). Can psi be calculated as a function of depth also during model integration ?

@dionhaefner
Copy link
Collaborator

xt is in degrees, not meters. Correcting for this should give you the correct order of magnitude.

@Sougata18
Copy link
Author

Sougata18 commented Jun 20, 2023

But the unit of xt shouldn't have any effect on the values of u and v component. I tried to convert the degrees to meters but that doesn't change the order of the values.

and what about this...

I also noticed that the psi values are in correct order, but they are not a function of depth(psi (Time, yu, xu)). Can psi be calculated as a function of depth also during model integration ?

@dionhaefner
Copy link
Collaborator

But the unit of xt shouldn't have any effect on the values of u and v component. I tried to convert the degrees to meters but that doesn't change the order of the values.

It does change the value of the integral: u dx depends on the units of x.

I also noticed that the psi values are in correct order, but they are not a function of depth(psi (Time, yu, xu)). Can psi be calculated as a function of depth also during model integration ?

No, that is not implemented.

@Sougata18
Copy link
Author

Sougata18 commented Jun 20, 2023

It does change the value of the integral: u dx depends on the units of x.

So I changed the degrees to meters and then performed integration,
xt_m=(da.xt)*(111.32 * 1000)
yu_m=(da.yu)*(111.32 * 1000)
da2=da.swap_dims({'xt': 'xt_m','yu':'yu_m'})
v=da2.v[:,:,24:25,69:89].fillna(0)
int=v.integrate(['xt_m','zt'])

But the values retunred are -
array([[-23.73514648], [-23.7389737 ], [-23.74269738], [-23.74628668], [-23.74958743], [-23.75263038], [-23.75559003], [-23.75825997], [-23.76123838], [-23.76421766], [-23.76686355], [-23.76964631], [-23.77194807], [-23.77353387], [-23.77455615], [-23.77559 ], [-23.77734086], [-23.77984767], [-23.78292343], [-23.7864306 ], ... [-24.09079528], [-24.09188262], [-24.0928174 ], [-24.09390781], [-24.09485936], [-24.09593624], [-24.09689799], [-24.09797821], [-24.0989368 ], [-24.09999894], [-24.10099243], [-24.10203691], [-24.10307478], [-24.10409647], [-24.10509105], [-24.1061358 ], [-24.10715227], [-24.10816867], [-24.10917316], [-24.11014614]])

@dionhaefner
Copy link
Collaborator

I'm not an expert in xarray, so I suggest you look for help in a dedicated community if you want to do it this way. All I know is that your original estimate is too small by a factor of about 1.1e5, which gives you the correct order of magnitude.

@Sougata18
Copy link
Author

Okay! anyway thanks for the help!

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