# Query about need to change in Cgrid\_transformation\_tools.py

**URL:** <https://forum.croco-ocean.org/t/query-about-need-to-change-in-cgrid-transformation-tools-py/7694>\
**Category:** croco tools (pre/post-processing)\
**Tags:** croco\_pytools\
**Created:** [September 26, 2026, 6:38am UTC](https://forum.croco-ocean.org/t/query-about-need-to-change-in-cgrid-transformation-tools-py/7694 "2026-09-26T06:38:11Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![swapnil](https://forum.croco-ocean.org/user_avatar/forum.croco-ocean.org/swapnil/32/855_2.png) [@swapnil](https://forum.croco-ocean.org/u/swapnil)\
**Post date:** [September 26, 2026, 6:38am UTC](https://forum.croco-ocean.org/t/query-about-need-to-change-in-cgrid-transformation-tools-py/7694/1 "2026-09-26T06:38:12Z")

</div>

Hi,  
In mostly python base croco\_pytools have a one file called Cgrid\_transformation\_tools.py inside the prepro/Modules . During reading the code found the Quadratic output shows very suspicious. Its very confused me.  
can you please check:  
line (519-524)

```
    var_rho[iz, :, :] = 0.5625 * (
        var_w[iz + 1, :, :] + var_w[iz, :, :]
    ) - 0.0625 * (var_w[iz + 2 :, :] + var_w[iz - 1, :, :])
var_rho[0, :, :] = (
    -0.125 * var_w[1, :, :] + 0.75 * var_w[1, :, :] + 0.375 * var_w[0, :, :]
)

```

maybe need to change:

```
    var_rho[iz, :, :] = 0.5625 * (
        var_w[iz + 1, :, :] + var_w[iz, :, :]
    ) - 0.0625 * (var_w[iz + 2, :, :] + var_w[iz - 1, :, :])
var_rho[0, :, :] = (
    -0.125 * var_w[2, :, :] + 0.75 * var_w[1, :, :] + 0.375 * var_w[0, :, :]
)

```

I added only one comma (,) and change one 1 to 2 two. you can check it above. Is it correct ?  
can you please check it. then I also change (very confusing for me).  
please let me know if that changes needed or not.

Thank you for your kind understanding and help.  
Best regards.

---

<div class="post-metadata">

**Author:** ![slegac](https://forum.croco-ocean.org/user_avatar/forum.croco-ocean.org/slegac/32/267_2.png) [@slegac](https://forum.croco-ocean.org/u/slegac)\
**Post date:** [September 28, 2026, 6:51am UTC](https://forum.croco-ocean.org/t/query-about-need-to-change-in-cgrid-transformation-tools-py/7694/2 "2026-09-28T06:51:15Z")

</div>

Thanks for the report and for pointing this out.

This issue has already been raised on the CROCO forum here: [Bug in w2rho() loop body / croco\_pytools v2.0.4](https://forum.croco-ocean.org/t/bug-in-w2rho-loop-body-croco-pytools-v2-0-4/7645)

It is currently an open work item in our GitLab repository. It has not been addressed yet, but it is already identified and will be investigated.

Regards,

---

<div class="post-metadata">

**Author:** ![swapnil](https://forum.croco-ocean.org/user_avatar/forum.croco-ocean.org/swapnil/32/855_2.png) [@swapnil](https://forum.croco-ocean.org/u/swapnil)\
**Post date:** [September 28, 2026, 8:08am UTC](https://forum.croco-ocean.org/t/query-about-need-to-change-in-cgrid-transformation-tools-py/7694/3 "2026-09-28T08:08:36Z")

</div>

Thank you for your kind responses  
Best regards
