FESOM / fesom2

Multi-resolution ocean general circulation model.
http://fesom.de/
GNU General Public License v3.0
49 stars 49 forks source link

Output U and V in unrotated way #172

Open koldunovn opened 3 years ago

koldunovn commented 3 years ago

Having them rotated does not make any sense except maybe for some very obscure computations, so maybe make everyone's life easier (except for people who do the post processing :)) and unrotate them :)

trackow commented 3 years ago

Cannot agree more, this has led to difficulties in the DYAMOND/nextGEMS project where externals want to have a look at our velocities.

patrickscholz commented 3 years ago

@koldunovn Its all about inherited tradition !!! You should praise it not change it !!! ;-D

No joke aside! It ok we can do it like that, but i guess it would be nice if we than maybe have an attribute that says rotated or unrotated for the vectors. Because that will give some conflict with old users and their routines and some confusion.

koldunovn commented 3 years ago

@patrickscholz I love tradition, but ... That's actually quite expensive operation :)

The attribute would help a lot! I think we can just add it to default output. One can also have attribute for #173

Also summon @pgierz for opinion :)

patrickscholz commented 3 years ago

You mean expensive for the postprocessing, right ? But that means we have to rotated them in the model, will this not slow down our output, i guess we would need to rotated them back at each time step and accumulated them in the stream. This might be not an issue for small setups but could be maybe for bigger ones.

koldunovn commented 3 years ago

Rotating every time step would be expensive, yes. Is it not possible to convert only before the output? Would require additional logic in the output module where it does not really belong?

trackow commented 3 years ago

What is the method for rotating the scalar fields? Is that so much more expensive for the velocities? FESOM2 is writing all other output anyway in geographic frame?

patrickscholz commented 3 years ago

There is no rotation of scalar fields, they are written out like they are, since only the underlying grid needs to be rotated

patrickscholz commented 3 years ago

If we rotated u and v means that also you want to rotated all other vector quantities as well (uv ice, stress, t(u,v), s(u,v) )... especially for the energy diagnostic where you have all this first moments that could be quite much ?

trackow commented 3 years ago

Yes, and the grid rotation is done once I guess and then used for all? I just thought that computing all the local rotation matrices once (2x2 or not?) and then applying it to the vectors before writing the output should be OK. If the output is async this might not really make a huge difference? In any case, we could still discuss what the default setting for vectors should be, but giving the option I think is needed :)

pgierz commented 3 years ago

As someone who builds analysis tools for a living: please unrotated. It is one less thing to think about, and one less thing that will accidentally be messed up by a student or an external partner.

To clarify: I have accidentally re-rotated already rotated things on several occasions. It's simply a headache. If the output is as standardized as we can make it, I can try to make sure any analysis tools do whatever rotation needs to be performed

pgierz commented 3 years ago

Plus, as with the mesh, put the info clearly in the metadata, then we can program around it (see the other discussion on pyfesom for that one)