Skip to content

Update the scripts that handle NCODA output(s), i.e., increments that are passed to the model. #98

Closed
1 of 1 issue completed

Description

@sanAkel

With the model swap (hycom+cice4 with ufs-datm), the files and/or scripts that:

  • Post process NCODA output (ocean and sea ice)
  • And feed to the ocean and sea ice model(s)

need to be modified.

At the minimum the following scripts need to be modified:

  1. exrtofs_glo_ncoda_inc.sh
  2. exrtofs_glo_incup.sh

See the following

  • Paths for sample files from @zgarraffo:
    /scratch3/NCEPDEV/marine/Zulema.Garraffo/FV3_RT/expt_14.4_hera/rtofs.20250504/INPUT
    /scratch3/NCEPDEV/marine/Zulema.Garraffo/FV3_RT/expt_14.4_hera/rtofs.20250504/RESTART_inc
    /scratch3/NCEPDEV/marine/Zulema.Garraffo/FV3_RT/expt_14.4_hera/ncoda/hycom_var/restart/
    

Use h from: ls /scratch3/NCEPDEV/marine/Zulema.Garraffo/FV3_RT/expt_14.4_hera/ncoda/hycom_var/restart/lyrthk_lyr_1o4500x3297_*_0024_fcstfld

  • And script:
    /scratch3/NCEPDEV/marine/Zulema.Garraffo/FV3_RT/expt_14.4_hera/ush/ncodaz_inc*sh, utility is: ncodaz_inc2mom6nc_lyr.sh

Activity

  1. added theissue type on Dec 30, 2025
  2. zgarraffo commented on Dec 30, 2025

    @zgarraffo
    Collaborator

    Please point me to the script to create the ice coverage nc file, since it is ready

  3. sanAkel commented on Dec 31, 2025

    @sanAkel
    ContributorAuthor

    Please point me to the script to create the ice coverage nc file, since it is ready

    It was added via PR #54

    Let me know if you need an example of how to use on wcoss/ dwood.

  4. zgarraffo commented on Dec 31, 2025

    @zgarraffo
    Collaborator

    Yes, please, point me to the specific script or example.

  5. sanAkel commented on Dec 31, 2025

    @sanAkel
    ContributorAuthor

    Yes, please, point me to the specific script or example.

    @zgarraffo It in our interest to get done properly instead of one-off scripts!
    You'll get it ... when I am done working on it via this branch.

    I do have a driver script at /lfs/h2/emc/stmp/santha.akella/test

    santha.akella@dlogin03:~/my_stmp/test> cat test.sh 
    #!/bin/sh
    
    export DATAROOT=/lfs/h2/emc/stmp/santha.akella/test/
    export jobid=icecov_sic
    export HOMErtofs=/lfs/h2/emc/ptmp/santha.akella/RTOFS_GLO/
    export USHrtofs=${HOMErtofs}/ush/
    export FIXrtofs=${HOMErtofs}/fix/
    export PDY=20251216
    export dtg=20251215
    
    CONMIN=/lfs/h2/emc/couple/noscrub/zulema.garraffo/COMDIR/prod/com/rtofs/v2.5/rtofs.${PDY}/
    IDM=4500
    JDM=3297
    var_name="icecov"
    #var_name="icethk"
    #var_name="icetmp"
    #var_name="mixlyr"
    
    SIZN="${IDM}x${JDM}"
    typec=${var_name}_sfc_1o${SIZN}
    
    cd ${DATAROOT}
    
    # link to topography
    ln -f -s ${FIXrtofs}/depth_GLBb0.08_09m11ob2_mom6.nc depth_GLBb0.08_09m11ob2_mom6.nc
    
    # input file
    ln -sf $CONMIN/ncoda/hycom_var/restart/${typec}_${dtg}00_0000_analfld ./${var_name}_${dtg}_analfld
    
    # run
    $HOMErtofs/ush/rtofs_glo2d_ice.sh depth_GLBb0.08_09m11ob2_mom6.nc ${var_name}_${dtg}_analfld ${var_name} ${DATAROOT}
    err=$? 
    echo " error from ${HOMErtofs}/ush/rtofs_glo2d_ice.sh =" $err
    
  6. sanAkel commented on Jan 2, 2026

    @sanAkel
    ContributorAuthor

    @zgarraffo you can try ⬆️ using code add/modified via branch: issue_99 which is added via this PR.

    Note:
    Once merged into develop, I will delete branch: issue_99 (and you can use develop branch).

  7. sanAkel commented on Jan 3, 2026

    @sanAkel
    ContributorAuthor

    @zgarraffo, @DanIredell-NOAA Can one of you please take upon the other (than sea ice) pieces of incremental update?

  8. zgarraffo commented on Jan 4, 2026

    @zgarraffo
    Collaborator

    creation of ice nc file through exrtofs_glo_ice_update.sh, Santha's python scripts:
    I think there is no renormalization in the scripts. The ncoda icecov file has values between -999 and 100 (ice coverage in percentage) . To input in cice6 (or cice4), the ice coverage has to be renormalized (multiply by 0.01) to to have a maximum of 1 for input in cice, and the -999 numbers over land replaced by another bad number.

    In addition, I found a bug that was always in RTOFS that doesn't affect the result. I also have this bug in my ice conversion script:
    In multiplying by 0.01 to obtain the ice coverage from the ncoda file, the bad value for ncoda should be -999 and not 999.
    The multiplication by 0.01 should be done where values are different from -999, and when they are -999, should be replaced by a bad number, which in hycom is 2^100.

    The result is that values over land in RTOFS v2.5 (production) are -9.99 while for hycom should be 2^100. Since the bug affects values on land, it doesn't affect the results of the run, I am pretty sure. Ocean and ice values are good.

  9. sanAkel commented on Jan 4, 2026

    @sanAkel
    ContributorAuthor

    creation of ice nc file through exrtofs_glo_ice_update.sh, Santha's python scripts: I think there is no renormalization in the scripts.

    False! It is done here.

    The ncoda icecov file has values between -999 and 100 (ice coverage in percentage) . To input in cice6 (or cice4), the ice coverage has to be renormalized (multiply by 0.01) to to have a maximum of 1 for input in cice, and the -999 numbers over land replaced by another bad number.

    Of course, I know that!
    When we meet on Tue, we have to look into why you have the scaling factor not being applied. See my numbers that I posted in the PR. Copy/pasted for your convenience:

    Summary for sic: Min=0.0000, Max=1.0000
    

    And

            float sic(ny, nx) ;
                    sic:_FillValue = -9.99e+33f ;
                    sic:units = "fraction" ;
                    sic:long_name = "Ice Concentration" ;
                    sic:scale_factor_applied = 0.01 ;
    

    In addition, I found a bug that was always in RTOFS that doesn't affect the result. I also have this bug in my ice conversion script: In multiplying by 0.01 to obtain the ice coverage from the ncoda file, the bad value for ncoda should be -999 and not 999. The multiplication by 0.01 should be done where values are different from -999, and when they are -999, should be replaced by a bad number, which in hycom is 2^100.

    The result is that values over land in RTOFS v2.5 (production) are -9.99 while for hycom should be 2^100. Since the bug affects values on land, it doesn't affect the results of the run, I am pretty sure. Ocean and ice values are good.

    In today's world, we call them "Fill_Values", and its also included, see this.

    Again we have to see how you are running the code pulled from branch https://github.com/NOAA-EMC/RTOFS_GLO/blob/issue_99/ since my tests contradict everything ⬆️.

    To be 💯 sure of my ⬆️ assertion, I re-ran the same test case: test.sh as I did for the PR and see below plot: all values are bounded within [0, 1].

    Image
  10. added a commit that references this issue on Jan 4, 2026
  11. sanAkel commented on Jan 4, 2026

    @sanAkel
    ContributorAuthor

    @zgarraffo I re-read:

    creation of ice nc file through exrtofs_glo_ice_update.sh,

    ❓ How that script worked for you! After I saw your usage of it, I added 2 more arguments to it, without them it should throw an error! If you want to try again, please go ahead!

    Anyway, for my test, I used the rtofs_glo2d_ice.sh directrly (see above test.sh) instead of calling via exrtofs_glo_ice_update.sh. In production, exrtofs_glo_ice_update.sh will used, so I'm 😄 your test made me look into it deeper and solidify it.

  12. 25 remaining items

  13. sanAkel commented on Jan 9, 2026

    @sanAkel
    ContributorAuthor

    @zgarraffo Hopefully on/by Tuesday 01/13 you can commit a new script. Let me know if you get stuck somewhere.

  14. changed the issue type fromtoon Jan 9, 2026
  15. zgarraffo commented on Jan 9, 2026

    @zgarraffo
    Collaborator

    I cloned and compiled.

  16. zgarraffo commented on Jan 9, 2026

    @zgarraffo
    Collaborator

    Since it is not decided how the MOM6 restart files will be named and in what directory they will be, I am the present names as in my runs.

  17. sanAkel commented on Jan 10, 2026

    @sanAkel
    ContributorAuthor

    Since it is not decided how the MOM6 restart files will be named and in what directory they will be, I am the present names as in my runs.

    • Please use whatever you got.

    • But make sure the script gives the answer that looks like what you got on Hera/Ursa, if not the same.

  18. zgarraffo commented on Jan 12, 2026

    @zgarraffo
    Collaborator

    In branch ncoda_ufs_cycle
    updated sorc/hycom_tools_for_mom6.fd/ncodaz_inc2mom6nc_glb_lyr.f
    incremental update velocities should be re-staggered (not done)
    added parm/rtofs_glo_ncoda_inc2mom6nc_lyr.input

  19. zgarraffo commented on Jan 12, 2026

    @zgarraffo
    Collaborator

    modified scripts/exrtofs_glo_ncoda_inc.sh
    Not verified by running it.

  20. sanAkel commented on Jan 12, 2026

    @sanAkel
    ContributorAuthor

    Not verified by running it.

    Who will do that?

  21. zgarraffo commented on Jan 13, 2026

    @zgarraffo
    Collaborator

    I can do it tomorrow or so. You asked me to commit in whatever state things are.

  22. sanAkel commented on Jan 13, 2026

    @sanAkel
    ContributorAuthor

    I can do it tomorrow or so. You asked me to commit in whatever state things are.

    👍

    There is no need for manual notification of commits; GitHub does it automatically.

  23. zgarraffo commented on Jan 14, 2026

    @zgarraffo
    Collaborator

    The script for creating the incremental update file in the production environment now works (after talking with Dan)

  24. sanAkel commented on Feb 10, 2026

    @sanAkel
    ContributorAuthor

    Resolved via #107

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

v3-devDevelopment for RTOFS v3

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions