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

Fixes #210. Added adjustable tolerance to the rasterization routine. … #663

Merged
merged 5 commits into from
Nov 29, 2022

Conversation

atrayano
Copy link
Contributor

@atrayano atrayano commented Nov 8, 2022

…Added some heuristic logic in mkMOMAquaRaster.F90 to define a different tolerance (default is 1.0e-12, and under some conditions we change it to 1.0e-5). This fixes the failures with 5 degrees MOM6 rasters. Aslo updated the code and the build for MITgcm rasters

…Added some heuristic logic in mkMOMAquaRaster.F90 to define a different tolerance (default is 1.0e-12, and under some conditions we change it to 1.0e-5). This fixes the failures with 5 degrees MOM6 rasters. Aslo updated the code and the build for MITgcm rasters
@atrayano atrayano added the 0 diff The changes in this pull request have verified to be zero-diff with the target branch. label Nov 8, 2022
@atrayano atrayano requested a review from sanAkel November 8, 2022 22:49
@atrayano atrayano self-assigned this Nov 8, 2022
@atrayano atrayano requested review from a team as code owners November 8, 2022 22:49

! Get source grid directory and destination raster file names
!------------------------------------------------------------

i = command_argument_count()
i = iargc()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@atrayano Can you bring back the Fortran standard command_argument_count and get_command_argument rather than iargc and getarg? I'd like to keep those old extensions from coming back

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mathomp4 Good catch! Done

@sanAkel
Copy link
Collaborator

sanAkel commented Nov 10, 2022

@atrayano, would you please give me and @biljanaorescanin the exact set of commands you use to generate the tile/raster files? I recall you do it all manually i.e., without using make_bcs script. Thank you!

We are unable to reproduce your output.

@atrayano
Copy link
Contributor Author

@sanAkel I just have sent you a long chat message in Teams. In essence, what I did when I manually generated the tile grid for you was to generate 3 rasters (cube, land (i.e. Pfafstetter) and tripolar, but using slightly modified source code. I had hardcoded a different tolerance 1.0e-5 instead of 1.0e-12 in the rasterize.H, the recompiled GEOS, and the 3 rasters were generated with the new binaries. I am nearly 100% sure that the tripolar and the land rasters were generated this way, and I am less certain what I did for the cube - it could have been generated with the 1.0e-12 tolerance. If it is critical, I could check. Then the rasters were combined pretty much the same ways the make_bcs script combines them. In this PR, I decided it is overkill to downgrade the tolerance for the land and the cube, and effectively it set to 1.0e-5 ONLY for the MOM raster and under certain conditions, depending on the MOM resolution and the raster size. Otherwise, the code sets the tolerance to 1.0e-12. I believe this approach is better, but obviously I cannot expect 0 diff with the old result. I could work with you or @biljanaorescanin to reproduce the old result

@sanAkel
Copy link
Collaborator

sanAkel commented Nov 10, 2022

@sanAkel I just have sent you a long chat message in Teams. In essence, what I did when I manually generated the tile grid for you was to generate 3 rasters (cube, land (i.e. Pfafstetter) and tripolar, but using slightly modified source code. I had hardcoded a different tolerance 1.0e-5 instead of 1.0e-12 in the rasterize.H, the recompiled GEOS, and the 3 rasters were generated with the new binaries. I am nearly 100% sure that the tripolar and the land rasters were generated this way, and I am less certain what I did for the cube - it could have been generated with the 1.0e-12 tolerance. If it is critical, I could check. Then the rasters were combined pretty much the same ways the make_bcs script combines them. In this PR, I decided it is overkill to downgrade the tolerance for the land and the cube, and effectively it set to 1.0e-5 ONLY for the MOM raster and under certain conditions, depending on the MOM resolution and the raster size. Otherwise, the code sets the tolerance to 1.0e-12. I believe this approach is better, but obviously I cannot expect 0 diff with the old result. I could work with you or @biljanaorescanin to reproduce the old result

Thank you @atrayano. This info should help us figure it out. If we can't next week, will reach out.

@sanAkel
Copy link
Collaborator

sanAkel commented Nov 11, 2022

@biljanaorescanin when we tag up, best to pull this recent commit from @atrayano and build before we test again. Thanks!

@sdrabenh sdrabenh marked this pull request as draft November 16, 2022 14:47
@sdrabenh
Copy link
Collaborator

All, I have converting this to draft until all issues have been fully resolved. When it is ready for testing, please undraft

@sanAkel sanAkel marked this pull request as ready for review November 24, 2022 02:04
@sanAkel
Copy link
Collaborator

sanAkel commented Nov 24, 2022

Following is my review and reasons for marking it ready to merge. All the steps that I took to test are also provided.

✅ It builds with the develop:
- I cloned GEOSgcm, develop branches for: GEOSgcm_App, GMAO_Shared and this branch for GEOSgcm_GridComp. See below for my mepo status.

✅ For NLv3, c12 and T1MOM6 (72x36) options, make_bcs produced a set of boundary conditions.

  • The make_bcs was modified to be sure that only MAPL_Tripolar.nc is needed ⬅️ Indeed that is the case @biljanaorescanin please make a note of this. (That's why in the following mepo status there is an un-staged, updated to make_bcs). My suggestion is that future versions of make_bcs:
    • Do NOT make these sym links three (3) times:
      ln -s /discover/nobackup/projects/gmao/ssd/aogcm/ocean_bcs/MOM5/360x200 data/MOM5/360x200
      ln -s /discover/nobackup/projects/gmao/ssd/aogcm/ocean_bcs/MOM5/720x410 data/MOM5/720x410
      ln -s /discover/nobackup/projects/gmao/ssd/aogcm/ocean_bcs/MOM5/1440x1080 data/MOM5/1440x1080
      ln -s /discover/nobackup/projects/gmao/ssd/aogcm/ocean_bcs/MOM6/72x36 data/MOM6/72x36
      ln -s /discover/nobackup/projects/gmao/ssd/aogcm/ocean_bcs/MOM6/1440x1080 data/MOM6/1440x1080
      ,
      ln -s /discover/nobackup/projects/gmao/ssd/aogcm/ocean_bcs/MOM5/360x200 data/MOM5/360x200
      ln -s /discover/nobackup/projects/gmao/ssd/aogcm/ocean_bcs/MOM5/720x410 data/MOM5/720x410
      ln -s /discover/nobackup/projects/gmao/ssd/aogcm/ocean_bcs/MOM5/1440x1080 data/MOM5/1440x1080
      ln -s /discover/nobackup/projects/gmao/ssd/aogcm/ocean_bcs/MOM6/72x36 data/MOM6/72x36
      ln -s /discover/nobackup/projects/gmao/ssd/aogcm/ocean_bcs/MOM6/1440x1080 data/MOM6/1440x1080
      ,
      ln -s /discover/nobackup/projects/gmao/ssd/aogcm/ocean_bcs/MOM5/360x200 data/MOM5/360x200
      ln -s /discover/nobackup/projects/gmao/ssd/aogcm/ocean_bcs/MOM5/720x410 data/MOM5/720x410
      ln -s /discover/nobackup/projects/gmao/ssd/aogcm/ocean_bcs/MOM5/1440x1080 data/MOM5/1440x1080
      ln -s /discover/nobackup/projects/gmao/ssd/aogcm/ocean_bcs/MOM6/72x36 data/MOM6/72x36
      ln -s /discover/nobackup/projects/gmao/ssd/aogcm/ocean_bcs/MOM6/1440x1080 data/MOM6/1440x1080
      ➡️ ONLY once (1). And the links only point to location of MAPL_Tripolar.nc. (Cc'ing @sdrabenh , @weiyuan-jiang).
  • The output from make_bcs was written ➡️ /discover/nobackup/sakella/BCS_PACKAGE/NL3_2/CF0012x6C_TM0072xTM0036. Following figure compares of tile points across what we (@mathomp4, @sanAkel, @gmao-cda, ...) use and the ones produced from this PR. Left (right) panel in each subplot is from current (this PR) tile file that is in path: /discover/nobackup/projects/gmao/ssd/aogcm/atmosphere_bcs/Icarus-NLv3/MOM6/CF0012x6C_TM0072xTM0036.
  • NOTE: this current tile file was also generated by @atrayano about an year ago and this PR merges his manual edit into develop branch, but he made a cautious edit, so it is expected that his past answers will not reproduce: @atrayano has detailed the logic of his modifications, see above.

✅ Using the new boundary conditions, I remapped c12 x 5-deg restarts that are kindly provided by @mathomp4 (he calls them TinyBCs) and used them in a free running model simulation. The simulation finished successfully. Results are comparable to those with current tile file. My experiment is at: /discover/nobackup/sakella/low_res_test

  • In the gcm_run.j I made following changes:
setenv ABCSDIR  /discover/nobackup/sakella/BCS_PACKAGE/NL3_2/CF0012x6C_TM0072xTM0036
setenv OBCSDIR  /discover/nobackup/sakella/BCs/test_23Nov2022/MOM6/${OGCM_IM}x${OGCM_JM}

i.e., the set of BCs are now pointing to:
/discover/nobackup/sakella/BCs/test_23Nov2022 ⬅️ @biljanaorescanin you can use the contents in this path to replace those in /discover/nobackup/projects/gmao/bcs_shared/make_bcs_inputs/ocean/MOM6/72x36/; see /discover/nobackup/sakella/BCs/test_23Nov2022/README.md for details on all the files in that path.

mepo status

GEOSgcm                | (b) main
env                    | (t) v4.6.0 (DH)
cmake                  | (t) v3.19.0 (DH)
ecbuild                | (t) geos/v1.2.0 (DH)
NCEP_Shared            | (t) v1.2.1 (DH)
GMAO_Shared            | (b) main
MAPL                   | (t) v2.30.2 (DH)
FMS                    | (t) geos/2019.01.02+noaff.8 (DH)
GEOSgcm_GridComp       | (b) feature/atrayano/#210_adjust_raster_tolerance
   | GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/Raster/make_bcs: modified, not staged
FVdycoreCubed_GridComp | (t) v1.12.1 (DH)
fvdycore               | (t) geos/v1.5.0 (DH)
GEOSchem_GridComp      | (t) v1.10.4 (DH)
HEMCO                  | (t) geos/v2.2.3 (DH)
geos-chem              | (t) geos/v13.0.0-rc1 (DH)
GOCART                 | (t) v2.1.2 (DH)
QuickChem              | (t) v1.0.0 (DH)
GEOS_OceanGridComp     | (t) v1.1.1 (DH)
mom                    | (t) geos/5.1.0+1.2.0 (DH)
mom6                   | (t) geos/v2.0.4 (DH)
cice6                  | (t) geos/v0.0.1 (DH)
sis2                   | (t) geos/v0.0.1 (DH)
GEOSradiation_GridComp | (t) v1.1.0 (DH)
RRTMGP                 | (t) geos/v1.5+1.0.0 (DH)
GEOSgcm_App            | (b) develop
UMD_Etc                | (t) v1.1.0 (DH)
CPLFCST_Etc            | (t) v1.0.1 (DH)

compare_land-tiles
compare_ocean-tiles

compare_landice-tiles

compare_lake-tiles

Copy link
Collaborator

@sanAkel sanAkel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It works! That is, I could obtain a:

  • Set of restarts,
  • A run (1-day) that finished without any problem(s).

@mathomp4 mathomp4 self-requested a review November 29, 2022 18:46
Copy link
Member

@mathomp4 mathomp4 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cmake seems good!

@sdrabenh sdrabenh merged commit 99e3ef8 into develop Nov 29, 2022
@sdrabenh sdrabenh deleted the feature/atrayano/#210_adjust_raster_tolerance branch November 29, 2022 18:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0 diff The changes in this pull request have verified to be zero-diff with the target branch.
Projects
clean up make_bcs
Awaiting triage
Development

Successfully merging this pull request may close these issues.

None yet

5 participants