NOAA-GFDL / FRE-NCtools

Tools for manipulating and creating netCDF inputs for FMS managed models
GNU Lesser General Public License v3.0
17 stars 28 forks source link

problem running remap_land #172

Open MJHarrison-GFDL opened 2 years ago

MJHarrison-GFDL commented 2 years ago

I have a C192 mosaic restart file which I am trying to remap to a C384 mosaic with refined coastlines. The remap_land executes successfully for all of the tile types except soil, vegn1 and vegn2. The code is failing here in those cases.

Script is located here (GFDL) : /net2/mjh/ipynb/GLBb0.08_031/INPUT/C384/regrid_land_restart/test.bash

ngs333 commented 2 years ago

@MJHarrison-GFDL I was able to run a slightly modified version of your test.bash script without any errors reported. This is by blindly applying combine-ncc to every file, one at a time, in the restart directory. It is possible that these files were not created the usual FRE way, and test.bash assumes that combine-ncc had been applied (as usual?)?

From Analysis, one can see the script: /work/Miguel.Zuniga/mjh/test.bash

The added lines are the 3rd and following below:

(cd $tmp/src_restart ; tar xf -) < $src
(cd $tmp/src_restart/RESTART
    for f in *.nc; do
    echo "working on $f"
    combine-ncc "-v" "$f" "thefile.nc"
    mv "thefile.nc" "$f"
done
)

Also I manually load the version of FRE/NCtools I want so that part of your original script is edited.

I plan to look at this again on Friday. Thanks to @ceblanton and @bensonr for their input in this.

nikizadehgfdl commented 5 months ago

Sergey ran into this issue today with another set of files. He wrote, " apparently one needs to run combine-ncc on all land files in src_restart directory. I am not sure why that is, since my restart files were already combined, but there it is." This is consistent with Miguel's suggestion above.

It looks like the combine-ncc rearranges/reorders some indices in the already combined land restart files which makes them digestable for the remap_land tool , otherwise the tool would error out with "mismatch of tile_index”.

We don't know why this happens for some restart files. But the above workaround from Miguel should be tried by users who run into such issues.

ceblanton commented 5 months ago

I'm not surprised but I don't understand it either. output.stager runs combine-ncc on non-distributed restart files and non-distributed history files, with the commentary below. It seems counterintuitive to run a combining tool (combine-ncc) on input files that aren't distributed, but that's what FRE does, and I think that partially explains why remap_land wants input files to be run through combine-ncc even if no combining is needed.


      # Land restart files _MUST_ be run through combine-ncc for
      # regression runs to put the indexes in a canonical order, so
      # `nccmp -d` can compare them correctly.  This is only run
      # if the land wrote out non-distributed compressed restart files.
      # Also, non-distributed compressed history files should
      # be run through combine-ncc due to decompress-ncc mysteriously
      # failing on some fields that are all zeros.
underwoo commented 5 months ago

@MJHarrison-GFDL do you have any uncombined land files that we could use to run a few tests on remap_land? I'm curious to see why it fails. (I have a suspicion, but I need to run it and review the NetCDF to verify.)