diff --git a/reg_tests/cpld_gridgen/RegressionTests_hera.intel.log b/reg_tests/cpld_gridgen/RegressionTests_hera.intel.log index 494bc2d38..316fa4295 100644 --- a/reg_tests/cpld_gridgen/RegressionTests_hera.intel.log +++ b/reg_tests/cpld_gridgen/RegressionTests_hera.intel.log @@ -1,8 +1,8 @@ -Fri Dec 15 20:03:43 UTC 2023 +Mon Apr 8 19:09:11 UTC 2024 Start Regression test -Working dir = /scratch1/NCEPDEV/stmp4/Denise.Worthen/CPLD_GRIDGEN/rt_148527/025 -Baseline dir = /scratch1/NCEPDEV/stmp4/Denise.Worthen/CPLD_GRIDGEN/BASELINE/025 +Working dir = /scratch1/NCEPDEV/stmp4/Denise.Worthen/CPLD_GRIDGEN/rt_1965110/025 +Baseline dir = /scratch1/NCEPDEV/nems/role.ufsutils/ufs_utils/reg_tests/cpld_gridgen/baseline_data/025 Checking test 025 results .... Comparing Bu.mx025_SCRIP.nc........OK @@ -25,6 +25,7 @@ Comparing rect.0p50_SCRIP.nc........OK Comparing rect.1p00_SCRIP.nc........OK Comparing rect.5p00_SCRIP.nc........OK Comparing tripole.mx025.Bu.to.Ct.bilinear.nc........OK +Comparing tripole.mx025.Ct.to.Bu.bilinear.nc........OK Comparing tripole.mx025.Ct.to.rect.0p25.bilinear.nc........OK Comparing tripole.mx025.Ct.to.rect.0p25.conserve.nc........OK Comparing tripole.mx025.Ct.to.rect.0p50.bilinear.nc........OK @@ -38,8 +39,8 @@ Comparing tripole.mx025.Cv.to.Ct.bilinear.nc........OK Comparing tripole.mx025.nc........OK -Working dir = /scratch1/NCEPDEV/stmp4/Denise.Worthen/CPLD_GRIDGEN/rt_148527/050 -Baseline dir = /scratch1/NCEPDEV/stmp4/Denise.Worthen/CPLD_GRIDGEN/BASELINE/050 +Working dir = /scratch1/NCEPDEV/stmp4/Denise.Worthen/CPLD_GRIDGEN/rt_1965110/050 +Baseline dir = /scratch1/NCEPDEV/nems/role.ufsutils/ufs_utils/reg_tests/cpld_gridgen/baseline_data/050 Checking test 050 results .... Comparing Bu.mx050_SCRIP.nc........OK @@ -61,8 +62,10 @@ Comparing mesh.mx050.nc........OK Comparing rect.0p50_SCRIP.nc........OK Comparing rect.1p00_SCRIP.nc........OK Comparing rect.5p00_SCRIP.nc........OK +Comparing tripole.mx025.Ct.to.mx050.Ct.bilinear.nc........OK Comparing tripole.mx025.Ct.to.mx050.Ct.neareststod.nc........OK Comparing tripole.mx050.Bu.to.Ct.bilinear.nc........OK +Comparing tripole.mx050.Ct.to.Bu.bilinear.nc........OK Comparing tripole.mx050.Ct.to.rect.0p50.bilinear.nc........OK Comparing tripole.mx050.Ct.to.rect.0p50.conserve.nc........OK Comparing tripole.mx050.Ct.to.rect.1p00.bilinear.nc........OK @@ -74,8 +77,8 @@ Comparing tripole.mx050.Cv.to.Ct.bilinear.nc........OK Comparing tripole.mx050.nc........OK -Working dir = /scratch1/NCEPDEV/stmp4/Denise.Worthen/CPLD_GRIDGEN/rt_148527/100 -Baseline dir = /scratch1/NCEPDEV/stmp4/Denise.Worthen/CPLD_GRIDGEN/BASELINE/100 +Working dir = /scratch1/NCEPDEV/stmp4/Denise.Worthen/CPLD_GRIDGEN/rt_1965110/100 +Baseline dir = /scratch1/NCEPDEV/nems/role.ufsutils/ufs_utils/reg_tests/cpld_gridgen/baseline_data/100 Checking test 100 results .... Comparing Bu.mx100_SCRIP.nc........OK @@ -96,8 +99,10 @@ Comparing kmtu_cice_NEMS_mx100.nc........OK Comparing mesh.mx100.nc........OK Comparing rect.1p00_SCRIP.nc........OK Comparing rect.5p00_SCRIP.nc........OK +Comparing tripole.mx025.Ct.to.mx100.Ct.bilinear.nc........OK Comparing tripole.mx025.Ct.to.mx100.Ct.neareststod.nc........OK Comparing tripole.mx100.Bu.to.Ct.bilinear.nc........OK +Comparing tripole.mx100.Ct.to.Bu.bilinear.nc........OK Comparing tripole.mx100.Ct.to.rect.1p00.bilinear.nc........OK Comparing tripole.mx100.Ct.to.rect.1p00.conserve.nc........OK Comparing tripole.mx100.Ct.to.rect.5p00.bilinear.nc........OK @@ -108,8 +113,8 @@ Comparing tripole.mx100.nc........OK Comparing ufs.topo_edits_011818.nc........OK -Working dir = /scratch1/NCEPDEV/stmp4/Denise.Worthen/CPLD_GRIDGEN/rt_148527/500 -Baseline dir = /scratch1/NCEPDEV/stmp4/Denise.Worthen/CPLD_GRIDGEN/BASELINE/500 +Working dir = /scratch1/NCEPDEV/stmp4/Denise.Worthen/CPLD_GRIDGEN/rt_1965110/500 +Baseline dir = /scratch1/NCEPDEV/nems/role.ufsutils/ufs_utils/reg_tests/cpld_gridgen/baseline_data/500 Checking test 500 results .... Comparing Bu.mx500_SCRIP.nc........OK @@ -129,8 +134,10 @@ Comparing grid_cice_NEMS_mx500.nc........OK Comparing kmtu_cice_NEMS_mx500.nc........OK Comparing mesh.mx500.nc........OK Comparing rect.5p00_SCRIP.nc........OK +Comparing tripole.mx025.Ct.to.mx500.Ct.bilinear.nc........OK Comparing tripole.mx025.Ct.to.mx500.Ct.neareststod.nc........OK Comparing tripole.mx500.Bu.to.Ct.bilinear.nc........OK +Comparing tripole.mx500.Ct.to.Bu.bilinear.nc........OK Comparing tripole.mx500.Ct.to.rect.5p00.bilinear.nc........OK Comparing tripole.mx500.Ct.to.rect.5p00.conserve.nc........OK Comparing tripole.mx500.Cu.to.Ct.bilinear.nc........OK @@ -139,5 +146,5 @@ Comparing tripole.mx500.nc........OK REGRESSION TEST WAS SUCCESSFUL -Fri Dec 15 20:29:09 UTC 2023 -Elapsed time: 00h:25m:28s. Have a nice day! +Mon Apr 8 19:31:41 UTC 2024 +Elapsed time: 00h:23m:55s. Have a nice day! diff --git a/reg_tests/cpld_gridgen/RegressionTests_hercules.intel.log b/reg_tests/cpld_gridgen/RegressionTests_hercules.intel.log new file mode 100644 index 000000000..d92854007 --- /dev/null +++ b/reg_tests/cpld_gridgen/RegressionTests_hercules.intel.log @@ -0,0 +1,150 @@ +Tue Apr 9 06:44:10 CDT 2024 +Start Regression test + +Working dir = /work/noaa/stmp/dworthen/CPLD_GRIDGEN/rt_1693683/025 +Baseline dir = /work/noaa/nems/role-nems/ufs_utils.hercules/reg_tests/cpld_gridgen/baseline_data/025 + +Checking test 025 results .... +Comparing Bu.mx025_SCRIP.nc........OK +Comparing C384.mx025.tile1.nc........OK +Comparing C384.mx025.tile2.nc........OK +Comparing C384.mx025.tile3.nc........OK +Comparing C384.mx025.tile4.nc........OK +Comparing C384.mx025.tile5.nc........OK +Comparing C384.mx025.tile6.nc........OK +Comparing Ct.mx025.to.C384.nc........OK +Comparing Ct.mx025_SCRIP.nc........OK +Comparing Ct.mx025_SCRIP_land.nc........OK +Comparing Cu.mx025_SCRIP.nc........OK +Comparing Cv.mx025_SCRIP.nc........OK +Comparing grid_cice_NEMS_mx025.nc........OK +Comparing kmtu_cice_NEMS_mx025.nc........OK +Comparing mesh.mx025.nc........OK +Comparing rect.0p25_SCRIP.nc........OK +Comparing rect.0p50_SCRIP.nc........OK +Comparing rect.1p00_SCRIP.nc........OK +Comparing rect.5p00_SCRIP.nc........OK +Comparing tripole.mx025.Bu.to.Ct.bilinear.nc........OK +Comparing tripole.mx025.Ct.to.Bu.bilinear.nc........OK +Comparing tripole.mx025.Ct.to.rect.0p25.bilinear.nc........OK +Comparing tripole.mx025.Ct.to.rect.0p25.conserve.nc........OK +Comparing tripole.mx025.Ct.to.rect.0p50.bilinear.nc........OK +Comparing tripole.mx025.Ct.to.rect.0p50.conserve.nc........OK +Comparing tripole.mx025.Ct.to.rect.1p00.bilinear.nc........OK +Comparing tripole.mx025.Ct.to.rect.1p00.conserve.nc........OK +Comparing tripole.mx025.Ct.to.rect.5p00.bilinear.nc........OK +Comparing tripole.mx025.Ct.to.rect.5p00.conserve.nc........OK +Comparing tripole.mx025.Cu.to.Ct.bilinear.nc........OK +Comparing tripole.mx025.Cv.to.Ct.bilinear.nc........OK +Comparing tripole.mx025.nc........OK + + +Working dir = /work/noaa/stmp/dworthen/CPLD_GRIDGEN/rt_1693683/050 +Baseline dir = /work/noaa/nems/role-nems/ufs_utils.hercules/reg_tests/cpld_gridgen/baseline_data/050 + +Checking test 050 results .... +Comparing Bu.mx050_SCRIP.nc........OK +Comparing C192.mx050.tile1.nc........OK +Comparing C192.mx050.tile2.nc........OK +Comparing C192.mx050.tile3.nc........OK +Comparing C192.mx050.tile4.nc........OK +Comparing C192.mx050.tile5.nc........OK +Comparing C192.mx050.tile6.nc........OK +Comparing Ct.mx025_SCRIP.nc........OK +Comparing Ct.mx050.to.C192.nc........OK +Comparing Ct.mx050_SCRIP.nc........OK +Comparing Ct.mx050_SCRIP_land.nc........OK +Comparing Cu.mx050_SCRIP.nc........OK +Comparing Cv.mx050_SCRIP.nc........OK +Comparing grid_cice_NEMS_mx050.nc........OK +Comparing kmtu_cice_NEMS_mx050.nc........OK +Comparing mesh.mx050.nc........OK +Comparing rect.0p50_SCRIP.nc........OK +Comparing rect.1p00_SCRIP.nc........OK +Comparing rect.5p00_SCRIP.nc........OK +Comparing tripole.mx025.Ct.to.mx050.Ct.bilinear.nc........OK +Comparing tripole.mx025.Ct.to.mx050.Ct.neareststod.nc........OK +Comparing tripole.mx050.Bu.to.Ct.bilinear.nc........OK +Comparing tripole.mx050.Ct.to.Bu.bilinear.nc........OK +Comparing tripole.mx050.Ct.to.rect.0p50.bilinear.nc........OK +Comparing tripole.mx050.Ct.to.rect.0p50.conserve.nc........OK +Comparing tripole.mx050.Ct.to.rect.1p00.bilinear.nc........OK +Comparing tripole.mx050.Ct.to.rect.1p00.conserve.nc........OK +Comparing tripole.mx050.Ct.to.rect.5p00.bilinear.nc........OK +Comparing tripole.mx050.Ct.to.rect.5p00.conserve.nc........OK +Comparing tripole.mx050.Cu.to.Ct.bilinear.nc........OK +Comparing tripole.mx050.Cv.to.Ct.bilinear.nc........OK +Comparing tripole.mx050.nc........OK + + +Working dir = /work/noaa/stmp/dworthen/CPLD_GRIDGEN/rt_1693683/100 +Baseline dir = /work/noaa/nems/role-nems/ufs_utils.hercules/reg_tests/cpld_gridgen/baseline_data/100 + +Checking test 100 results .... +Comparing Bu.mx100_SCRIP.nc........OK +Comparing C96.mx100.tile1.nc........OK +Comparing C96.mx100.tile2.nc........OK +Comparing C96.mx100.tile3.nc........OK +Comparing C96.mx100.tile4.nc........OK +Comparing C96.mx100.tile5.nc........OK +Comparing C96.mx100.tile6.nc........OK +Comparing Ct.mx025_SCRIP.nc........OK +Comparing Ct.mx100.to.C96.nc........OK +Comparing Ct.mx100_SCRIP.nc........OK +Comparing Ct.mx100_SCRIP_land.nc........OK +Comparing Cu.mx100_SCRIP.nc........OK +Comparing Cv.mx100_SCRIP.nc........OK +Comparing grid_cice_NEMS_mx100.nc........OK +Comparing kmtu_cice_NEMS_mx100.nc........OK +Comparing mesh.mx100.nc........OK +Comparing rect.1p00_SCRIP.nc........OK +Comparing rect.5p00_SCRIP.nc........OK +Comparing tripole.mx025.Ct.to.mx100.Ct.bilinear.nc........OK +Comparing tripole.mx025.Ct.to.mx100.Ct.neareststod.nc........OK +Comparing tripole.mx100.Bu.to.Ct.bilinear.nc........OK +Comparing tripole.mx100.Ct.to.Bu.bilinear.nc........OK +Comparing tripole.mx100.Ct.to.rect.1p00.bilinear.nc........OK +Comparing tripole.mx100.Ct.to.rect.1p00.conserve.nc........OK +Comparing tripole.mx100.Ct.to.rect.5p00.bilinear.nc........OK +Comparing tripole.mx100.Ct.to.rect.5p00.conserve.nc........OK +Comparing tripole.mx100.Cu.to.Ct.bilinear.nc........OK +Comparing tripole.mx100.Cv.to.Ct.bilinear.nc........OK +Comparing tripole.mx100.nc........OK +Comparing ufs.topo_edits_011818.nc........OK + + +Working dir = /work/noaa/stmp/dworthen/CPLD_GRIDGEN/rt_1693683/500 +Baseline dir = /work/noaa/nems/role-nems/ufs_utils.hercules/reg_tests/cpld_gridgen/baseline_data/500 + +Checking test 500 results .... +Comparing Bu.mx500_SCRIP.nc........OK +Comparing C48.mx500.tile1.nc........OK +Comparing C48.mx500.tile2.nc........OK +Comparing C48.mx500.tile3.nc........OK +Comparing C48.mx500.tile4.nc........OK +Comparing C48.mx500.tile5.nc........OK +Comparing C48.mx500.tile6.nc........OK +Comparing Ct.mx025_SCRIP.nc........OK +Comparing Ct.mx500.to.C48.nc........OK +Comparing Ct.mx500_SCRIP.nc........OK +Comparing Ct.mx500_SCRIP_land.nc........OK +Comparing Cu.mx500_SCRIP.nc........OK +Comparing Cv.mx500_SCRIP.nc........OK +Comparing grid_cice_NEMS_mx500.nc........OK +Comparing kmtu_cice_NEMS_mx500.nc........OK +Comparing mesh.mx500.nc........OK +Comparing rect.5p00_SCRIP.nc........OK +Comparing tripole.mx025.Ct.to.mx500.Ct.bilinear.nc........OK +Comparing tripole.mx025.Ct.to.mx500.Ct.neareststod.nc........OK +Comparing tripole.mx500.Bu.to.Ct.bilinear.nc........OK +Comparing tripole.mx500.Ct.to.Bu.bilinear.nc........OK +Comparing tripole.mx500.Ct.to.rect.5p00.bilinear.nc........OK +Comparing tripole.mx500.Ct.to.rect.5p00.conserve.nc........OK +Comparing tripole.mx500.Cu.to.Ct.bilinear.nc........OK +Comparing tripole.mx500.Cv.to.Ct.bilinear.nc........OK +Comparing tripole.mx500.nc........OK + + +REGRESSION TEST WAS SUCCESSFUL +Tue Apr 9 07:04:50 CDT 2024 +Elapsed time: 00h:21m:53s. Have a nice day! diff --git a/reg_tests/cpld_gridgen/RegressionTests_jet.intel.log b/reg_tests/cpld_gridgen/RegressionTests_jet.intel.log index dab42d567..350d3e3c8 100644 --- a/reg_tests/cpld_gridgen/RegressionTests_jet.intel.log +++ b/reg_tests/cpld_gridgen/RegressionTests_jet.intel.log @@ -1,8 +1,8 @@ -Sat Dec 16 18:41:27 UTC 2023 +Mon Apr 8 19:07:01 UTC 2024 Start Regression test -Working dir = /lfs4/HFIP/h-nems/Denise.Worthen/CPLD_GRIDGEN/rt_97163/025 -Baseline dir = /lfs4/HFIP/h-nems/Denise.Worthen/CPLD_GRIDGEN/BASELINE/025 +Working dir = /lfs4/HFIP/h-nems/Denise.Worthen/CPLD_GRIDGEN/rt_2966831/025 +Baseline dir = /lfs4/HFIP/hfv3gfs/emc.nemspara/role.ufsutils/ufs_utils/reg_tests/cpld_gridgen/baseline_data/025 Checking test 025 results .... Comparing Bu.mx025_SCRIP.nc........OK @@ -12,9 +12,9 @@ Comparing C384.mx025.tile3.nc........OK Comparing C384.mx025.tile4.nc........OK Comparing C384.mx025.tile5.nc........OK Comparing C384.mx025.tile6.nc........OK -Comparing Ct.mx025.to.C384.nc........OK -Comparing Ct.mx025_SCRIP.nc........OK Comparing Ct.mx025_SCRIP_land.nc........OK +Comparing Ct.mx025_SCRIP.nc........OK +Comparing Ct.mx025.to.C384.nc........OK Comparing Cu.mx025_SCRIP.nc........OK Comparing Cv.mx025_SCRIP.nc........OK Comparing grid_cice_NEMS_mx025.nc........OK @@ -25,6 +25,7 @@ Comparing rect.0p50_SCRIP.nc........OK Comparing rect.1p00_SCRIP.nc........OK Comparing rect.5p00_SCRIP.nc........OK Comparing tripole.mx025.Bu.to.Ct.bilinear.nc........OK +Comparing tripole.mx025.Ct.to.Bu.bilinear.nc........OK Comparing tripole.mx025.Ct.to.rect.0p25.bilinear.nc........OK Comparing tripole.mx025.Ct.to.rect.0p25.conserve.nc........OK Comparing tripole.mx025.Ct.to.rect.0p50.bilinear.nc........OK @@ -38,8 +39,8 @@ Comparing tripole.mx025.Cv.to.Ct.bilinear.nc........OK Comparing tripole.mx025.nc........OK -Working dir = /lfs4/HFIP/h-nems/Denise.Worthen/CPLD_GRIDGEN/rt_97163/050 -Baseline dir = /lfs4/HFIP/h-nems/Denise.Worthen/CPLD_GRIDGEN/BASELINE/050 +Working dir = /lfs4/HFIP/h-nems/Denise.Worthen/CPLD_GRIDGEN/rt_2966831/050 +Baseline dir = /lfs4/HFIP/hfv3gfs/emc.nemspara/role.ufsutils/ufs_utils/reg_tests/cpld_gridgen/baseline_data/050 Checking test 050 results .... Comparing Bu.mx050_SCRIP.nc........OK @@ -50,9 +51,9 @@ Comparing C192.mx050.tile4.nc........OK Comparing C192.mx050.tile5.nc........OK Comparing C192.mx050.tile6.nc........OK Comparing Ct.mx025_SCRIP.nc........OK -Comparing Ct.mx050.to.C192.nc........OK -Comparing Ct.mx050_SCRIP.nc........OK Comparing Ct.mx050_SCRIP_land.nc........OK +Comparing Ct.mx050_SCRIP.nc........OK +Comparing Ct.mx050.to.C192.nc........OK Comparing Cu.mx050_SCRIP.nc........OK Comparing Cv.mx050_SCRIP.nc........OK Comparing grid_cice_NEMS_mx050.nc........OK @@ -61,8 +62,10 @@ Comparing mesh.mx050.nc........OK Comparing rect.0p50_SCRIP.nc........OK Comparing rect.1p00_SCRIP.nc........OK Comparing rect.5p00_SCRIP.nc........OK +Comparing tripole.mx025.Ct.to.mx050.Ct.bilinear.nc........OK Comparing tripole.mx025.Ct.to.mx050.Ct.neareststod.nc........OK Comparing tripole.mx050.Bu.to.Ct.bilinear.nc........OK +Comparing tripole.mx050.Ct.to.Bu.bilinear.nc........OK Comparing tripole.mx050.Ct.to.rect.0p50.bilinear.nc........OK Comparing tripole.mx050.Ct.to.rect.0p50.conserve.nc........OK Comparing tripole.mx050.Ct.to.rect.1p00.bilinear.nc........OK @@ -74,8 +77,8 @@ Comparing tripole.mx050.Cv.to.Ct.bilinear.nc........OK Comparing tripole.mx050.nc........OK -Working dir = /lfs4/HFIP/h-nems/Denise.Worthen/CPLD_GRIDGEN/rt_97163/100 -Baseline dir = /lfs4/HFIP/h-nems/Denise.Worthen/CPLD_GRIDGEN/BASELINE/100 +Working dir = /lfs4/HFIP/h-nems/Denise.Worthen/CPLD_GRIDGEN/rt_2966831/100 +Baseline dir = /lfs4/HFIP/hfv3gfs/emc.nemspara/role.ufsutils/ufs_utils/reg_tests/cpld_gridgen/baseline_data/100 Checking test 100 results .... Comparing Bu.mx100_SCRIP.nc........OK @@ -86,9 +89,9 @@ Comparing C96.mx100.tile4.nc........OK Comparing C96.mx100.tile5.nc........OK Comparing C96.mx100.tile6.nc........OK Comparing Ct.mx025_SCRIP.nc........OK -Comparing Ct.mx100.to.C96.nc........OK -Comparing Ct.mx100_SCRIP.nc........OK Comparing Ct.mx100_SCRIP_land.nc........OK +Comparing Ct.mx100_SCRIP.nc........OK +Comparing Ct.mx100.to.C96.nc........OK Comparing Cu.mx100_SCRIP.nc........OK Comparing Cv.mx100_SCRIP.nc........OK Comparing grid_cice_NEMS_mx100.nc........OK @@ -96,8 +99,10 @@ Comparing kmtu_cice_NEMS_mx100.nc........OK Comparing mesh.mx100.nc........OK Comparing rect.1p00_SCRIP.nc........OK Comparing rect.5p00_SCRIP.nc........OK +Comparing tripole.mx025.Ct.to.mx100.Ct.bilinear.nc........OK Comparing tripole.mx025.Ct.to.mx100.Ct.neareststod.nc........OK Comparing tripole.mx100.Bu.to.Ct.bilinear.nc........OK +Comparing tripole.mx100.Ct.to.Bu.bilinear.nc........OK Comparing tripole.mx100.Ct.to.rect.1p00.bilinear.nc........OK Comparing tripole.mx100.Ct.to.rect.1p00.conserve.nc........OK Comparing tripole.mx100.Ct.to.rect.5p00.bilinear.nc........OK @@ -108,8 +113,8 @@ Comparing tripole.mx100.nc........OK Comparing ufs.topo_edits_011818.nc........OK -Working dir = /lfs4/HFIP/h-nems/Denise.Worthen/CPLD_GRIDGEN/rt_97163/500 -Baseline dir = /lfs4/HFIP/h-nems/Denise.Worthen/CPLD_GRIDGEN/BASELINE/500 +Working dir = /lfs4/HFIP/h-nems/Denise.Worthen/CPLD_GRIDGEN/rt_2966831/500 +Baseline dir = /lfs4/HFIP/hfv3gfs/emc.nemspara/role.ufsutils/ufs_utils/reg_tests/cpld_gridgen/baseline_data/500 Checking test 500 results .... Comparing Bu.mx500_SCRIP.nc........OK @@ -120,17 +125,19 @@ Comparing C48.mx500.tile4.nc........OK Comparing C48.mx500.tile5.nc........OK Comparing C48.mx500.tile6.nc........OK Comparing Ct.mx025_SCRIP.nc........OK -Comparing Ct.mx500.to.C48.nc........OK -Comparing Ct.mx500_SCRIP.nc........OK Comparing Ct.mx500_SCRIP_land.nc........OK +Comparing Ct.mx500_SCRIP.nc........OK +Comparing Ct.mx500.to.C48.nc........OK Comparing Cu.mx500_SCRIP.nc........OK Comparing Cv.mx500_SCRIP.nc........OK Comparing grid_cice_NEMS_mx500.nc........OK Comparing kmtu_cice_NEMS_mx500.nc........OK Comparing mesh.mx500.nc........OK Comparing rect.5p00_SCRIP.nc........OK +Comparing tripole.mx025.Ct.to.mx500.Ct.bilinear.nc........OK Comparing tripole.mx025.Ct.to.mx500.Ct.neareststod.nc........OK Comparing tripole.mx500.Bu.to.Ct.bilinear.nc........OK +Comparing tripole.mx500.Ct.to.Bu.bilinear.nc........OK Comparing tripole.mx500.Ct.to.rect.5p00.bilinear.nc........OK Comparing tripole.mx500.Ct.to.rect.5p00.conserve.nc........OK Comparing tripole.mx500.Cu.to.Ct.bilinear.nc........OK @@ -139,5 +146,5 @@ Comparing tripole.mx500.nc........OK REGRESSION TEST WAS SUCCESSFUL -Sat Dec 16 19:13:08 UTC 2023 -Elapsed time: 00h:31m:44s. Have a nice day! +Mon Apr 8 19:38:29 UTC 2024 +Elapsed time: 00h:33m:11s. Have a nice day! diff --git a/reg_tests/cpld_gridgen/RegressionTests_orion.intel.log b/reg_tests/cpld_gridgen/RegressionTests_orion.intel.log index 34f40612f..4dde38fb8 100644 --- a/reg_tests/cpld_gridgen/RegressionTests_orion.intel.log +++ b/reg_tests/cpld_gridgen/RegressionTests_orion.intel.log @@ -1,8 +1,8 @@ -Fri Dec 15 11:10:53 CST 2023 +Mon Apr 8 18:04:38 CDT 2024 Start Regression test -Working dir = /work/noaa/stmp/dworthen/CPLD_GRIDGEN/rt_408740/025 -Baseline dir = /work/noaa/stmp/dworthen/CPLD_GRIDGEN/BASELINE/025 +Working dir = /work/noaa/stmp/dworthen/CPLD_GRIDGEN/rt_325586/025 +Baseline dir = /work/noaa/nems/role-nems/ufs_utils/reg_tests/cpld_gridgen/baseline_data/025 Checking test 025 results .... Comparing Bu.mx025_SCRIP.nc........OK @@ -25,6 +25,7 @@ Comparing rect.0p50_SCRIP.nc........OK Comparing rect.1p00_SCRIP.nc........OK Comparing rect.5p00_SCRIP.nc........OK Comparing tripole.mx025.Bu.to.Ct.bilinear.nc........OK +Comparing tripole.mx025.Ct.to.Bu.bilinear.nc........OK Comparing tripole.mx025.Ct.to.rect.0p25.bilinear.nc........OK Comparing tripole.mx025.Ct.to.rect.0p25.conserve.nc........OK Comparing tripole.mx025.Ct.to.rect.0p50.bilinear.nc........OK @@ -38,8 +39,8 @@ Comparing tripole.mx025.Cv.to.Ct.bilinear.nc........OK Comparing tripole.mx025.nc........OK -Working dir = /work/noaa/stmp/dworthen/CPLD_GRIDGEN/rt_408740/050 -Baseline dir = /work/noaa/stmp/dworthen/CPLD_GRIDGEN/BASELINE/050 +Working dir = /work/noaa/stmp/dworthen/CPLD_GRIDGEN/rt_325586/050 +Baseline dir = /work/noaa/nems/role-nems/ufs_utils/reg_tests/cpld_gridgen/baseline_data/050 Checking test 050 results .... Comparing Bu.mx050_SCRIP.nc........OK @@ -61,8 +62,10 @@ Comparing mesh.mx050.nc........OK Comparing rect.0p50_SCRIP.nc........OK Comparing rect.1p00_SCRIP.nc........OK Comparing rect.5p00_SCRIP.nc........OK +Comparing tripole.mx025.Ct.to.mx050.Ct.bilinear.nc........OK Comparing tripole.mx025.Ct.to.mx050.Ct.neareststod.nc........OK Comparing tripole.mx050.Bu.to.Ct.bilinear.nc........OK +Comparing tripole.mx050.Ct.to.Bu.bilinear.nc........OK Comparing tripole.mx050.Ct.to.rect.0p50.bilinear.nc........OK Comparing tripole.mx050.Ct.to.rect.0p50.conserve.nc........OK Comparing tripole.mx050.Ct.to.rect.1p00.bilinear.nc........OK @@ -74,8 +77,8 @@ Comparing tripole.mx050.Cv.to.Ct.bilinear.nc........OK Comparing tripole.mx050.nc........OK -Working dir = /work/noaa/stmp/dworthen/CPLD_GRIDGEN/rt_408740/100 -Baseline dir = /work/noaa/stmp/dworthen/CPLD_GRIDGEN/BASELINE/100 +Working dir = /work/noaa/stmp/dworthen/CPLD_GRIDGEN/rt_325586/100 +Baseline dir = /work/noaa/nems/role-nems/ufs_utils/reg_tests/cpld_gridgen/baseline_data/100 Checking test 100 results .... Comparing Bu.mx100_SCRIP.nc........OK @@ -96,8 +99,10 @@ Comparing kmtu_cice_NEMS_mx100.nc........OK Comparing mesh.mx100.nc........OK Comparing rect.1p00_SCRIP.nc........OK Comparing rect.5p00_SCRIP.nc........OK +Comparing tripole.mx025.Ct.to.mx100.Ct.bilinear.nc........OK Comparing tripole.mx025.Ct.to.mx100.Ct.neareststod.nc........OK Comparing tripole.mx100.Bu.to.Ct.bilinear.nc........OK +Comparing tripole.mx100.Ct.to.Bu.bilinear.nc........OK Comparing tripole.mx100.Ct.to.rect.1p00.bilinear.nc........OK Comparing tripole.mx100.Ct.to.rect.1p00.conserve.nc........OK Comparing tripole.mx100.Ct.to.rect.5p00.bilinear.nc........OK @@ -108,8 +113,8 @@ Comparing tripole.mx100.nc........OK Comparing ufs.topo_edits_011818.nc........OK -Working dir = /work/noaa/stmp/dworthen/CPLD_GRIDGEN/rt_408740/500 -Baseline dir = /work/noaa/stmp/dworthen/CPLD_GRIDGEN/BASELINE/500 +Working dir = /work/noaa/stmp/dworthen/CPLD_GRIDGEN/rt_325586/500 +Baseline dir = /work/noaa/nems/role-nems/ufs_utils/reg_tests/cpld_gridgen/baseline_data/500 Checking test 500 results .... Comparing Bu.mx500_SCRIP.nc........OK @@ -129,8 +134,10 @@ Comparing grid_cice_NEMS_mx500.nc........OK Comparing kmtu_cice_NEMS_mx500.nc........OK Comparing mesh.mx500.nc........OK Comparing rect.5p00_SCRIP.nc........OK +Comparing tripole.mx025.Ct.to.mx500.Ct.bilinear.nc........OK Comparing tripole.mx025.Ct.to.mx500.Ct.neareststod.nc........OK Comparing tripole.mx500.Bu.to.Ct.bilinear.nc........OK +Comparing tripole.mx500.Ct.to.Bu.bilinear.nc........OK Comparing tripole.mx500.Ct.to.rect.5p00.bilinear.nc........OK Comparing tripole.mx500.Ct.to.rect.5p00.conserve.nc........OK Comparing tripole.mx500.Cu.to.Ct.bilinear.nc........OK @@ -139,5 +146,5 @@ Comparing tripole.mx500.nc........OK REGRESSION TEST WAS SUCCESSFUL -Fri Dec 15 11:33:32 CST 2023 -Elapsed time: 00h:22m:41s. Have a nice day! +Mon Apr 8 18:29:13 CDT 2024 +Elapsed time: 00h:26m:29s. Have a nice day! diff --git a/reg_tests/cpld_gridgen/RegressionTests_wcoss2.intel.log b/reg_tests/cpld_gridgen/RegressionTests_wcoss2.intel.log index a7fa76fd6..6d17bf427 100644 --- a/reg_tests/cpld_gridgen/RegressionTests_wcoss2.intel.log +++ b/reg_tests/cpld_gridgen/RegressionTests_wcoss2.intel.log @@ -1,8 +1,8 @@ -Sat Dec 16 15:19:48 UTC 2023 +Mon Apr 8 20:57:57 UTC 2024 Start Regression test -Working dir = /lfs/h2/emc/stmp/denise.worthen/CPLD_GRIDGEN/rt_194650/025 -Baseline dir = /lfs/h2/emc/stmp/denise.worthen/CPLD_GRIDGEN/BASELINE/025 +Working dir = /lfs/h2/emc/stmp/denise.worthen/CPLD_GRIDGEN/rt_15449/025 +Baseline dir = /lfs/h2/emc/nems/noscrub/emc.nems/UFS_UTILS/reg_tests/cpld_gridgen/baseline_data/025 Checking test 025 results .... Comparing Bu.mx025_SCRIP.nc........OK @@ -25,6 +25,7 @@ Comparing rect.0p50_SCRIP.nc........OK Comparing rect.1p00_SCRIP.nc........OK Comparing rect.5p00_SCRIP.nc........OK Comparing tripole.mx025.Bu.to.Ct.bilinear.nc........OK +Comparing tripole.mx025.Ct.to.Bu.bilinear.nc........OK Comparing tripole.mx025.Ct.to.rect.0p25.bilinear.nc........OK Comparing tripole.mx025.Ct.to.rect.0p25.conserve.nc........OK Comparing tripole.mx025.Ct.to.rect.0p50.bilinear.nc........OK @@ -38,8 +39,8 @@ Comparing tripole.mx025.Cv.to.Ct.bilinear.nc........OK Comparing tripole.mx025.nc........OK -Working dir = /lfs/h2/emc/stmp/denise.worthen/CPLD_GRIDGEN/rt_194650/050 -Baseline dir = /lfs/h2/emc/stmp/denise.worthen/CPLD_GRIDGEN/BASELINE/050 +Working dir = /lfs/h2/emc/stmp/denise.worthen/CPLD_GRIDGEN/rt_15449/050 +Baseline dir = /lfs/h2/emc/nems/noscrub/emc.nems/UFS_UTILS/reg_tests/cpld_gridgen/baseline_data/050 Checking test 050 results .... Comparing Bu.mx050_SCRIP.nc........OK @@ -61,8 +62,10 @@ Comparing mesh.mx050.nc........OK Comparing rect.0p50_SCRIP.nc........OK Comparing rect.1p00_SCRIP.nc........OK Comparing rect.5p00_SCRIP.nc........OK +Comparing tripole.mx025.Ct.to.mx050.Ct.bilinear.nc........OK Comparing tripole.mx025.Ct.to.mx050.Ct.neareststod.nc........OK Comparing tripole.mx050.Bu.to.Ct.bilinear.nc........OK +Comparing tripole.mx050.Ct.to.Bu.bilinear.nc........OK Comparing tripole.mx050.Ct.to.rect.0p50.bilinear.nc........OK Comparing tripole.mx050.Ct.to.rect.0p50.conserve.nc........OK Comparing tripole.mx050.Ct.to.rect.1p00.bilinear.nc........OK @@ -74,8 +77,8 @@ Comparing tripole.mx050.Cv.to.Ct.bilinear.nc........OK Comparing tripole.mx050.nc........OK -Working dir = /lfs/h2/emc/stmp/denise.worthen/CPLD_GRIDGEN/rt_194650/100 -Baseline dir = /lfs/h2/emc/stmp/denise.worthen/CPLD_GRIDGEN/BASELINE/100 +Working dir = /lfs/h2/emc/stmp/denise.worthen/CPLD_GRIDGEN/rt_15449/100 +Baseline dir = /lfs/h2/emc/nems/noscrub/emc.nems/UFS_UTILS/reg_tests/cpld_gridgen/baseline_data/100 Checking test 100 results .... Comparing Bu.mx100_SCRIP.nc........OK @@ -96,8 +99,10 @@ Comparing kmtu_cice_NEMS_mx100.nc........OK Comparing mesh.mx100.nc........OK Comparing rect.1p00_SCRIP.nc........OK Comparing rect.5p00_SCRIP.nc........OK +Comparing tripole.mx025.Ct.to.mx100.Ct.bilinear.nc........OK Comparing tripole.mx025.Ct.to.mx100.Ct.neareststod.nc........OK Comparing tripole.mx100.Bu.to.Ct.bilinear.nc........OK +Comparing tripole.mx100.Ct.to.Bu.bilinear.nc........OK Comparing tripole.mx100.Ct.to.rect.1p00.bilinear.nc........OK Comparing tripole.mx100.Ct.to.rect.1p00.conserve.nc........OK Comparing tripole.mx100.Ct.to.rect.5p00.bilinear.nc........OK @@ -108,8 +113,8 @@ Comparing tripole.mx100.nc........OK Comparing ufs.topo_edits_011818.nc........OK -Working dir = /lfs/h2/emc/stmp/denise.worthen/CPLD_GRIDGEN/rt_194650/500 -Baseline dir = /lfs/h2/emc/stmp/denise.worthen/CPLD_GRIDGEN/BASELINE/500 +Working dir = /lfs/h2/emc/stmp/denise.worthen/CPLD_GRIDGEN/rt_15449/500 +Baseline dir = /lfs/h2/emc/nems/noscrub/emc.nems/UFS_UTILS/reg_tests/cpld_gridgen/baseline_data/500 Checking test 500 results .... Comparing Bu.mx500_SCRIP.nc........OK @@ -129,8 +134,10 @@ Comparing grid_cice_NEMS_mx500.nc........OK Comparing kmtu_cice_NEMS_mx500.nc........OK Comparing mesh.mx500.nc........OK Comparing rect.5p00_SCRIP.nc........OK +Comparing tripole.mx025.Ct.to.mx500.Ct.bilinear.nc........OK Comparing tripole.mx025.Ct.to.mx500.Ct.neareststod.nc........OK Comparing tripole.mx500.Bu.to.Ct.bilinear.nc........OK +Comparing tripole.mx500.Ct.to.Bu.bilinear.nc........OK Comparing tripole.mx500.Ct.to.rect.5p00.bilinear.nc........OK Comparing tripole.mx500.Ct.to.rect.5p00.conserve.nc........OK Comparing tripole.mx500.Cu.to.Ct.bilinear.nc........OK @@ -139,5 +146,5 @@ Comparing tripole.mx500.nc........OK REGRESSION TEST WAS SUCCESSFUL -Sat Dec 16 15:39:10 UTC 2023 -Elapsed time: 00h:19m:23s. Have a nice day! +Mon Apr 8 21:22:18 UTC 2024 +Elapsed time: 00h:25m:33s. Have a nice day! diff --git a/reg_tests/cpld_gridgen/parm/grid.nml.IN b/reg_tests/cpld_gridgen/parm/grid.nml.IN index 8776b58c8..05f1ac04f 100644 --- a/reg_tests/cpld_gridgen/parm/grid.nml.IN +++ b/reg_tests/cpld_gridgen/parm/grid.nml.IN @@ -4,10 +4,10 @@ nj=NJ_GLB dirsrc='FIXDIR' dirout='OUTDIR' fv3dir='MOSAICDIR' -topofile=TOPOGFILE -editsfile=EDITSFILE +topofile='TOPOGFILE' +editsfile='EDITSFILE' res=RESNAME -atmres=MOSAICRES +atmres='MOSAICRES' npx=NPX editmask=DO_MASKEDIT debug=DO_DEBUG diff --git a/reg_tests/cpld_gridgen/rt.sh b/reg_tests/cpld_gridgen/rt.sh index 70d11c048..bfdf4795a 100755 --- a/reg_tests/cpld_gridgen/rt.sh +++ b/reg_tests/cpld_gridgen/rt.sh @@ -108,9 +108,9 @@ TESTS_FILE="$PATHRT/rt.conf" export TEST_NAME= # for C3072 on hera, use WLCLK=60 and MEM="--exclusive" -WLCLK_dflt=20 +WLCLK_dflt=35 export WLCLK=$WLCLK_dflt -MEM_dflt="--mem=12g" +MEM_dflt="--mem=16g" export MEM=$MEM_dflt cd $PATHRT @@ -170,7 +170,6 @@ elif [[ $target = jet ]]; then NCCMP=nccmp PARTITION=xjet ulimit -s unlimited - WLCLK=25 SBATCH_COMMAND="./cpld_gridgen.sh" fi NEW_BASELINE_ROOT=$STMP/CPLD_GRIDGEN/BASELINE diff --git a/sorc/cpld_gridgen.fd/angles.F90 b/sorc/cpld_gridgen.fd/angles.F90 index 31ac0bbcb..54af32bbb 100644 --- a/sorc/cpld_gridgen.fd/angles.F90 +++ b/sorc/cpld_gridgen.fd/angles.F90 @@ -10,125 +10,130 @@ module angles use gengrid_kinds, only : dbl_kind, int_kind - use grdvars, only : ni,nj,nx,ny - use grdvars, only : x,y,xsgp1,ysgp1,sg_maxlat - use grdvars, only : latBu,lonBu,lonCt - use grdvars, only : angq,anglet use grdvars, only : debug implicit none contains - !> Find the rotation angle on corner grid (Bu) points using the full MOM6 supergrid + !> Find the rotation angle on center (Bu) grid points !! + !! @param[in] iind the start/end index in the i-dimension of the grid + !! @param[in] jind the start/end index in the j-dimension of the grid + !! @param[in] xangCt the angle across the tripole seam + !! @param[in] anglet the rotation angle on Ct points + !! @param[out] angle the rotation angle on Bu points !! @author Denise.Worthen@noaa.gov - subroutine find_angq - ! local variables - integer :: i,j,i1,i2,m,n + subroutine find_angq(iind,jind,xangCt,anglet,angle) - ! pole locations on SG - integer(int_kind) :: ipolesg(2) + integer , intent(in) :: iind(2),jind(2) + real(dbl_kind), intent(in) :: xangCt(:) + real(dbl_kind), intent(in) :: anglet(:,:) + real(dbl_kind), intent(out) :: angle(:,:) - ! from geolonB fix in MOM6 - real(dbl_kind) :: len_lon ! The periodic range of longitudes, usually 360 degrees. - real(dbl_kind) :: pi_720deg ! One quarter the conversion factor from degrees to radians. - real(dbl_kind) :: lonB(2,2) ! The longitude of a point, shifted to have about the same value. - real(dbl_kind) :: lon_scale = 0.0 + ! local variables + integer :: i,j + + real(dbl_kind) :: angle_0, angle_w, angle_s, angle_sw + real(dbl_kind) :: p25 = 0.25 !--------------------------------------------------------------------- - ! to find angleq on seam, replicate supergrid values across seam + ! find the angle on corners using the same relationship CICE uses + ! internally to calculate angles on Ct using angles on Bu + ! + ! w-----------------0 Ct(i+1,j+1) + ! | | + ! ----------Bu(i,j)---------- Bu lies on seam at j=nj + ! | | + ! Ct(i,j) sw----------------s + ! !--------------------------------------------------------------------- - angq = 0.0 - xsgp1 = 0.0; ysgp1 = 0.0 - !pole on supergrid - ipolesg = -1 - j = ny - do i = 1,nx/2 - if(y(i,j) .eq. sg_maxlat)ipolesg(1) = i - enddo - do i = nx/2+1,nx - if(y(i,j) .eq. sg_maxlat)ipolesg(2) = i + angle = 0.0 + do j = jind(1)+1,jind(2) + do i = iind(1),iind(2)-1 + if (j .lt. jind(2)) then + angle_0 = anglet(i+1,j+1) + angle_w = anglet(i, j+1) + angle_s = anglet(i+1,j ) + angle_sw = anglet(i ,j ) + else + angle_0 = xangCt(i+1 ) + angle_w = xangCt(i ) + angle_s = anglet(i+1,j) + angle_sw = anglet(i, j) + end if + angle(i,j) = atan2(p25*(sin(angle_0) + sin(angle_w) + sin(angle_s) + sin(angle_sw)), & + p25*(cos(angle_0) + cos(angle_w) + cos(angle_s) + cos(angle_sw))) + + if (abs(angle(i,j)) .le. 1.0e-10)angle(i,j) = 0.0 + enddo enddo - if(debug)print *,'poles found at ',ipolesg - xsgp1(:,0:ny) = x(:,0:ny) - ysgp1(:,0:ny) = y(:,0:ny) + end subroutine find_angq - !check - do i = ipolesg(1)-5,ipolesg(1)+5 - i2 = ipolesg(2)+(ipolesg(1)-i)+1 - if(debug)print *,i,i2 - enddo - print * - do i = ipolesg(2)-5,ipolesg(2)+5 - i2 = ipolesg(2)+(ipolesg(1)-i)+1 - if(debug)print *,i,i2 - enddo + !> Verify the rotation angle on center (Ct) grid points using angle on corner + !! (Bu) grid points + !! + !! @param[in] iind the start/end index in the i-dimension of the grid + !! @param[in] jind the start/end index in the j-dimension of the grid + !! @param[in] angle the rotation angle on Bu points + !! @param[out] angchk the rotation angle on Ct points + !! @author Denise.Worthen@noaa.gov + subroutine find_angchk(iind,jind,angle,angchk) - !replicate supergrid across pole - do i = 1,nx - i2 = ipolesg(2)+(ipolesg(1)-i) - xsgp1(i,ny+1) = xsgp1(i2,ny) - ysgp1(i,ny+1) = ysgp1(i2,ny) - enddo + integer , intent(in) :: iind(2),jind(2) + real(dbl_kind), intent(in) :: angle(:,:) + real(dbl_kind), intent(out) :: angchk(:,:) - !check - j = ny+1 - i1 = ipolesg(1); i2 = ipolesg(2)-(ipolesg(1)-i1) - print *,'replicate X across seam on SG' - print *,xsgp1(i1-2,j),xsgp1(i2+2,j) - print *,xsgp1(i1-1,j),xsgp1(i2+1,j) - print *,xsgp1(i1, j),xsgp1(i2, j) - print *,xsgp1(i1+1,j),xsgp1(i2-1,j) - print *,xsgp1(i1+2,j),xsgp1(i2-2,j) - - print *,'replicate Y across seam on SG' - print *,ysgp1(i1-2,j),ysgp1(i2+2,j) - print *,ysgp1(i1-1,j),ysgp1(i2+1,j) - print *,ysgp1(i1, j),ysgp1(i2, j) - print *,ysgp1(i1+1,j),ysgp1(i2-1,j) - print *,ysgp1(i1+2,j),ysgp1(i2-2,j) + ! local variables + integer :: i,j + real(dbl_kind) :: angle_0, angle_w, angle_s, angle_sw + real(dbl_kind) :: p25 = 0.25 !--------------------------------------------------------------------- - ! rotation angle on supergrid vertices - ! lonB: x(i-1,j-1) has same relationship to x(i,j) on SG as - ! geolonT(i,j) has to geolonBu(i,j) on the reduced grid + ! check: calculate anglet from angle on corners as CICE does internally. + ! since angle changes sign between CICE and MOM6, (-1)*angchk ~ anglet + ! + ! w-----------------0 Bu(i,j) + ! | | + ! | Ct(i,j) | + ! | | + ! Bu(i-1,j-1) sw----------------s + ! !--------------------------------------------------------------------- - ! constants as defined in MOM - pi_720deg = atan(1.0) / 180.0 - len_lon = 360.0 - do j=1,ny ; do i=1,nx-1 - do n=1,2 ; do m=1,2 - lonB(m,n) = modulo_around_point(xsgp1(I+m-2,J+n-2), xsgp1(i-1,j-1), len_lon) - enddo; enddo - lon_scale = cos(pi_720deg*(ysgp1(i-1,j-1) + ysgp1(i+1,j-1) + & - ysgp1(i-1,j+1) + ysgp1(i+1,j+1)) ) - angq(i,j) = atan2(lon_scale*((lonB(1,2) - lonB(2,1)) + (lonB(2,2) - lonB(1,1))), & - ysgp1(i-1,j+1) + ysgp1(i+1,j+1) - & - ysgp1(i-1,j-1) - ysgp1(i+1,j-1) ) - enddo; enddo - - !check - if(debug) then - j = ny - i1 = ipolesg(1); i2 = ipolesg(2)-(ipolesg(1)-i1) - print *,'angq along seam on SG' - print *,angq(i1-2,j),angq(i2+2,j) - print *,angq(i1-1,j),angq(i2+1,j) - print *,angq(i1, j),angq(i2, j) - print *,angq(i1+1,j),angq(i2-1,j) - print *,angq(i1+2,j),angq(i2-2,j) - end if + angchk = 0.0 + do j = jind(1)+1,jind(2) + do i = iind(1)+1,iind(2) + angle_0 = angle(i ,j ) + angle_w = angle(i-1,j ) + angle_s = angle(i, j-1) + angle_sw = angle(i-1,j-1) + angchk(i,j) = atan2(p25*(sin(angle_0) + sin(angle_w) + sin(angle_s) + sin(angle_sw)), & + p25*(cos(angle_0) + cos(angle_w) + cos(angle_s) + cos(angle_sw))) + enddo + enddo - end subroutine find_angq + end subroutine find_angchk !> Find the rotation angle on center (Ct) grid points !! + !! @param[in] iind the start/end index in the i-dimension of the grid + !! @param[in] jind the start/end index in the j-dimension of the grid + !! @param[in] lonBu the longitudes of the corner grid points + !! @param[in] latBu the latitudes of the corner grid points + !! @param[in] lonCt the longitudes of the center grid points + !! @param[out] anglet the rotation angle on Ct points !! @author Denise.Worthen@noaa.gov - subroutine find_ang + + subroutine find_ang(iind,jind,lonBu,latBu,lonCt,anglet) + + integer , intent(in) :: iind(2),jind(2) + real(dbl_kind), intent(in) :: lonBu(:,:) + real(dbl_kind), intent(in) :: latBu(:,:) + real(dbl_kind), intent(in) :: lonCt(:,:) + real(dbl_kind), intent(out) :: anglet(:,:) ! local variables integer :: i,j,m,n @@ -151,17 +156,17 @@ subroutine find_ang anglet = 0.0 pi_720deg = atan(1.0) / 180.0 len_lon = 360.0 - do j=1,nj; do i = 1,ni + do j=jind(1),jind(2); do i = iind(1),iind(2) do n=1,2 ; do m=1,2 jj = J+n-2; ii = I+m-2 if(jj .eq. 0)jj = 1 - if(ii .eq. 0)ii = ni + if(ii .eq. 0)ii = iind(2) lonB(m,n) = modulo_around_point(LonBu(ii,jj), LonCt(i,j), len_lon) ! lonB(m,n) = modulo_around_point(LonBu(I+m-2,J+n-2), LonCt(i,j), len_lon) enddo; enddo jj = j-1; ii = i-1 if(jj .eq. 0)jj = 1 - if(ii .eq. 0)ii = ni + if(ii .eq. 0)ii = iind(2) lon_scale = cos(pi_720deg*((LatBu(ii,jj) + LatBu(I,J)) + & (LatBu(I,jj) + LatBu(ii,J)) ) ) anglet(i,j) = atan2(lon_scale*((lonB(1,2) - lonB(2,1)) + (lonB(2,2) - lonB(1,1))), & diff --git a/sorc/cpld_gridgen.fd/docs/cpld_gridgen.md b/sorc/cpld_gridgen.fd/docs/cpld_gridgen.md index 9e34d1ccf..e0572adee 100644 --- a/sorc/cpld_gridgen.fd/docs/cpld_gridgen.md +++ b/sorc/cpld_gridgen.fd/docs/cpld_gridgen.md @@ -20,7 +20,10 @@ For the UFS coupled model application S2S or S2SW, the following fix files are r - The mapped ocean mask on the FV3 tiles -- The ESMF regridding weights required to create the CICE6 IC from CPC (SIS2) reanalysis. +- The ESMF regridding weights required to create the CICE6 IC from CPC (SIS2) reanalysis or to map a 1/4 deg MOM6 or CICE6 tripole restart file +to a lower tripole resolution. + +- The latitude,longitude,depth and mask arrays required by WW3 to create a mod_def file. - The ESMF regridding weights required to remap the CICE6 or MOM6 output from tripole grid to a rectilinear grid (optional). @@ -30,7 +33,7 @@ Since MOM6 creates the model grid at runtime (including adjusting the land mask, ### MOM6 grids -The MOM6 supergrid contains a MOM6 grid at twice the desired resolution. The indexing of the supergrid vs the reduced grid is: +The MOM6 supergrid contains a MOM6 grid at twice the desired resolution. The indexing of the supergrid vs the reduced grid is: Super Grid Reduced Grid @@ -62,7 +65,7 @@ MOM6 uses an Arakawa C grid. Within cpld_gridgen, these are referred to as "stag ### Rotation angles -For the tripole grid, a rotation angle is defined to translate vectors to/from the grid (i-j) orientation from/to true E-W. The rotation angle is calculated at run-time in MOM6 (src/initialization/MOM_shared_initialization.F90). However, CICE6 requires a rotation at the corner (``Bu``) grid points, which for points along the tripole seam requires values on the other side of the tripole fold. In cpld_gridgen, these values are found by "flipping over" the values on the last row of the MOM6 super-grid. If ``ipL`` and ``ipR`` are the i-indices of the poles along the last j-row: +For the tripole grid, a rotation angle is defined to translate vectors to/from the grid (i-j) orientation from/to true E-W. The rotation angle on ``Ct`` grid points is calculated at run-time in MOM6 (src/initialization/MOM_shared_initialization.F90). However, CICE6 requires a rotation at the corner (``Bu``) grid points. To find these angles, the rotation angle on ``Ct`` points on the opposite side of the tripole fold are used. In cpld_gridgen, these values are found by "flipping over" and changing the sign of the values on the last row of the MOM6 grid. If ``ipL`` and ``ipR`` are the i-indices of the poles along the last j-row: ipL-1 ipL ipL+1 ipR-1 ipR ipR+1 @@ -77,14 +80,14 @@ then after folding along the tripole seam, ``ipL`` and ``ipR`` must align: x-------x-------x -Using the folded seam, the values required for calculating the rotation angle on the ``Bu`` grid points are available and can be calculated in the same way as MOM6 calculates rotation angles for the ``Ct`` grid points. +Using the folded seam, the values of the rotation on ``Ct`` points across the seam are known. The same procedure that CICE uses internally to calculate the ``Ct`` angles from the ``Bu`` angles can be used to instead calculate the ``Bu`` angles knowing the ``Ct`` angles. ### SCRIP format files -For calculating interpolation weights using ESMF, a SCRIP file needs to be provided. A SCIP file contains the both the grid locations of any stagger grid location (e.g. ``Ct``) and the associated grid vertices for that point. As seen from the above diagram, for the ``Ct`` points, those grid vertices are given by the ``Bu`` grid locations. +For calculating interpolation weights using ESMF, a SCRIP file needs to be provided. A SCIP file contains the both the grid locations of any stagger grid location (e.g. ``Ct``) and the associated grid vertices for that point. As seen from the above diagram, for the ``Ct`` points, those grid vertices are given by the ``Bu`` grid locations. SCRIP requires that the vertices be ordered counter-clockwise so that the center grid point is always to the left of the vertex. In cpld_gridgen, vertices are defined counter-clockwise from upper right. ``Ct`` vertices are located on the ``Bu`` grid (as shown above), ``Cu`` vertices on the ``Cv`` grid, ``Cv`` vertices on the ``Cu`` grid and ``Bu`` vertices on the ``Ct`` grid. For example, for the ``Ct`` grid, the vertices are: - + Vertex #2 Vertex #1 Bu(i-1,j) Bu(i,j) Ct(i,j) @@ -96,7 +99,7 @@ so that the vertices for the ``Ct`` grid are found as off-sets of the i,j index iVertCt(4) = (/0, -1, -1, 0/) jVertCt(4) = (/0, 0, -1, -1/) - + Careful examination of the remaining stagger locations lead to similar definitions for the i,j offsets required to extract the vertices, all of which can be defined in terms of the ``iVertCt`` and ``jVertCt`` values. Special treatment is require at the bottom of the grid, where the vertices of the ``Ct`` and ``Cu`` grid must be set manually (note, these points are on land.) The top of the grid also requires special treatment because the required vertices are located across the tripole seam. This is accomplished by creating 1-d arrays which hold the ``Ct`` and ``Cu`` grid point locations across the matched seam. @@ -111,7 +114,7 @@ The cpld_gridgen program and associated script related functions perform the fol 3. create the CICE6 grid variables and writes the required CICE6 grid file 4. create a SCRIP file for the center stagger (``Ct``) grid points and a second SCRIP file also containing the land mask 5. create the ESMF conservative regridding weights to map the ocean mask to the FV3 tiles and write the mapped mask to 6 tile files -6. create the ESMF regridding weights to map the 1/4 CICE6 restart file to a lower resolution tripole grid +6. create the ESMF regridding weights to map a 1/4 deg ice or ocean restart file to a lower resolution tripole grid 7. optionally call a routine to generate ESMF regridding weights to map the tripole grid to a set of rectilinear grids 8. use the command line command *ESMF_Scrip2Unstruct* to generate the ocean mesh from the SCRIP file containing the land mask (item 4) 9. use an NCO command line command to generate the CICE6 land mask file from the CICE6 grid file @@ -134,11 +137,11 @@ The exact list of files produced by the *cpld_gridgen.sh* script will vary depen mesh.mx025.nc the ocean and ice mesh file used at runtime by CICE6, MOM6, and CMEPS C384.mx025.tile[1-6].nc the mapped ocean mask on the ATM tiles used to create ATM ICs consistent with the
fractional grid - +
- -* If the optional post-weights are generated, the following files will be produced in the output location: - + +* If the optional post-weights are generated, the following files will be produced in the output location: + @@ -147,27 +150,29 @@ The exact list of files produced by the *cpld_gridgen.sh* script will vary depen same tripole grid using bilinear mapping
Optional post-weights files for 1/4deg
tripole.mx025.Ct.to.rect.[destination resolution].[bilinear][conserve].nc the ESMF weights for mapping variables
on the center (Ct) stagger location on
the tripole grid to a rectilinear grid
with [destination resolution] using
either bilinear or conservative mapping
- +
-* If a resolution other than 1/4 degree is used in *cpld_gridgen.sh*, the following file will be produced in the output location: - - +* The following file will be produced in the output location to map 1/4 degree tripole values to a tripole grid of lower resolution. + - +
Output files for CICE6 IC creation at tripole destination resolutionOutput files for down-sampled IC creation at tripole destination resolution
File name Function -
tripole.mx025.Ct.to.mx[destination resolution].Ct.neareststod.nc the ESMF weights for mapping the 1/4 CICE ICs to
- a tripole [destination resolution] using nearest
source-to-destination mapping +
tripole.mx025.Ct.to.mx[destination resolution].Ct.neareststod.nc the ESMF weights for mapping 1/4 deg tripole ICs to
+ a lower tripole destination resolution using nearest
source-to-destination mapping +
tripole.mx025.Ct.to.mx[destination resolution].Ct.bilinear.nc the ESMF weights for mapping 1/4 deg tripole ICs to
+ a lower tripole destination resolution using
bilinear mapping +
tripole.[destination resolution].Ct.to.[Cu][Cv][Bu].bilinear.nc the ESMF weights for mapping downscaled IC values on a
+ tripole grid from Ct locations to the native stagger locations
- +
- + * If run-time land mask changes for MOM6 are requested, the following file will be produced in the output location: - - + +
Output files for run-time modification of MOM6 land mask
File name Function
ufs.[Default filename].nc Topo-edits required for UFS application. These are appended to the existing default topo
edits file and implemented at run time with the parameter flag
``ALLOW_LANDMASK_CHANGES=true``. All files produced by the *cpld_gridgen.sh* will be
consistent with this run-time land mask.
- diff --git a/sorc/cpld_gridgen.fd/gen_fixgrid.F90 b/sorc/cpld_gridgen.fd/gen_fixgrid.F90 index 36f118eed..f2fe0dc88 100644 --- a/sorc/cpld_gridgen.fd/gen_fixgrid.F90 +++ b/sorc/cpld_gridgen.fd/gen_fixgrid.F90 @@ -20,7 +20,7 @@ program gen_fixgrid use grdvars use inputnml use gengrid_kinds, only: CL, CS, dbl_kind, real_kind, int_kind - use angles, only: find_angq, find_ang + use angles, only: find_ang, find_angq, find_angchk use vertices, only: fill_vertices, fill_bottom, fill_top use mapped_mask, only: make_frac_land use postwgts, only: make_postwgts @@ -49,7 +49,7 @@ program gen_fixgrid integer :: rc,ncid,id,xtype integer :: i,j,k,i2,j2 - integer :: ii,jj + integer :: ii integer :: localPet, nPet logical :: fexist = .false. @@ -147,9 +147,6 @@ program gen_fixgrid if(xtype.eq. 6)wet4 = real(wet8,4) - !print *,minval(wet8),maxval(wet8) - !print *,minval(wet4),maxval(wet4) - !--------------------------------------------------------------------- ! read the MOM6 depth file !--------------------------------------------------------------------- @@ -201,17 +198,17 @@ program gen_fixgrid ! this modified topoedits file !--------------------------------------------------------------------- - fsrc = trim(dirsrc)//'/'//trim(editsfile) - if(editmask)fsrc = trim(dirout)//'/'//'ufs.'//trim(editsfile) - - if (trim(editsfile) /= 'none') then - inquire(file=trim(fsrc),exist=fexist) - if (.not. fexist) then - print '(a)', 'Required topoedits file '//trim(fsrc)//' is missing ' - call abort() - end if + fsrc = trim(dirsrc)//'/'//trim(editsfile) + if(editmask)fsrc = trim(dirout)//'/'//'ufs.'//trim(editsfile) + + if (trim(editsfile) /= 'none') then + inquire(file=trim(fsrc),exist=fexist) + if (.not. fexist) then + print '(a)', 'Required topoedits file '//trim(fsrc)//' is missing ' + call abort() end if - call apply_topoedits(fsrc) + end if + call apply_topoedits(fsrc) !--------------------------------------------------------------------- ! read MOM6 supergrid file @@ -236,15 +233,9 @@ program gen_fixgrid rc = nf90_get_var(ncid, id, dy) rc = nf90_close(ncid) - !print *,'super grid size ',size(y,1),size(y,2) - !print *,'max lat in super grid ',maxval(y) sg_maxlat = maxval(y) - - !--------------------------------------------------------------------- - ! find the angle on corners---this requires the supergrid - !--------------------------------------------------------------------- - - call find_angq + write(logmsg,'(a,f12.2)')'max lat in super grid ',maxval(y) + print '(a)',trim(logmsg) !--------------------------------------------------------------------- ! fill grid variables @@ -256,8 +247,6 @@ program gen_fixgrid !deg->rad ulon(i,j) = x(i2,j2)*deg2rad ulat(i,j) = y(i2,j2)*deg2rad - !in rad already - angle(i,j) = -angq(i2,j2) !m->cm htn(i,j) = (dx(i2-1,j2) + dx(i2,j2))*100._dbl_kind hte(i,j) = (dy(i2,j2-1) + dy(i2,j2))*100._dbl_kind @@ -280,12 +269,63 @@ program gen_fixgrid enddo !--------------------------------------------------------------------- - ! find the angle on centers---this does not requires the supergrid + ! locate the ith index of the two poles on j=nj + ! the corner points must lie on the pole + !--------------------------------------------------------------------- + + ipole = -1 + j = nj + do i = 1,ni/2 + if(latBu(i,j) .eq. sg_maxlat)ipole(1) = i + enddo + do i = ni/2+1,ni + if(latBu(i,j) .eq. sg_maxlat)ipole(2) = i + enddo + write(logmsg,'(a,2i6,2f12.2)')'poles found at i = ',ipole, latBu(ipole(1),nj), & + latBu(ipole(2),nj) + print '(a)',trim(logmsg) + + !--------------------------------------------------------------------- + ! find the angle on centers using the same procedure as MOM6 !--------------------------------------------------------------------- - call find_ang - print *,'ANGLET ',minval(anglet),maxval(anglet) - print *,'ANGLE ',minval(angle),maxval(angle) + call find_ang((/1,ni/),(/1,nj/),lonBu,latBu,lonCt,anglet) + write(logmsg,'(a,2f12.2)')'ANGLET min,max: ',minval(anglet),maxval(anglet) + print '(a)',trim(logmsg) + write(logmsg,'(a,2f12.2)')'ANGLET edges i=1,i=ni: ',anglet(1,nj),anglet(ni,nj) + print '(a)',trim(logmsg) + + xangCt(:) = 0.0 + do i = 1,ni + i2 = ipole(2)+(ipole(1)-i)+1 + xangCt(i) = -anglet(i2,nj) ! angle changes sign across seam + end do + + !--------------------------------------------------------------------- + ! find the angle on corners using the same procedure as CICE6 + !--------------------------------------------------------------------- + + call find_angq((/1,ni/),(/1,nj/),xangCt,anglet,angle) + angle(ni,:) = -angle(1,:) + ! reverse angle for CICE + angle = -angle + write(logmsg,'(a,2f12.2)')'ANGLE min,max: ',minval(angle),maxval(angle) + print '(a)',trim(logmsg) + write(logmsg,'(a,2f12.2)')'ANGLE edges i=1,i=ni: ',angle(1,nj),angle(ni,nj) + print '(a)',trim(logmsg) + + !--------------------------------------------------------------------- + ! check the Bu angle + !--------------------------------------------------------------------- + + call find_angchk((/1,ni/),(/1,nj/),angle,angchk) + angchk(1,:) = -angchk(ni,:) + ! reverse angle for MOM6 + angchk = -angchk + write(logmsg,'(a,2f12.2)')'ANGCHK min,max: ',minval(angchk),maxval(angchk) + print '(a)',trim(logmsg) + write(logmsg,'(a,2f12.2)')'ANGCHK edges i=1,i=ni: ',angchk(1,nj),angchk(ni,nj) + print '(a)',trim(logmsg) !--------------------------------------------------------------------- ! For the 1/4deg grid, hte at j=720 and j = 1440 is identically=0.0 for @@ -295,8 +335,7 @@ program gen_fixgrid ! hte < 1.0 !--------------------------------------------------------------------- - write(logmsg,'(a,2e12.5)')'min vals of hte at folds ', & - minval(hte(ni/2,:)),minval(hte(ni,:)) + write(logmsg,'(a,2e12.5)')'min vals of hte at folds ', minval(hte(ni/2,:)),minval(hte(ni,:)) print '(a)',trim(logmsg) do j = 1,nj ii = ni/2 @@ -304,37 +343,13 @@ program gen_fixgrid ii = ni if(hte(ii,j) .le. 1.0)hte(ii,j) = 0.5*(hte(ii-1,j) + hte( 1,j)) enddo - write(logmsg,'(a,2e12.5)')'min vals of hte at folds ', & - minval(hte(ni/2,:)),minval(hte(ni,:)) + write(logmsg,'(a,2e12.5)')'min vals of hte at folds ', minval(hte(ni/2,:)),minval(hte(ni,:)) print '(a)',trim(logmsg) !--------------------------------------------------------------------- - ! + ! find required extended values for setting all vertices !--------------------------------------------------------------------- - where(lonCt .lt. 0.0)lonCt = lonCt + 360._dbl_kind - where(lonCu .lt. 0.0)lonCu = lonCu + 360._dbl_kind - where(lonCv .lt. 0.0)lonCv = lonCv + 360._dbl_kind - where(lonBu .lt. 0.0)lonBu = lonBu + 360._dbl_kind - - !--------------------------------------------------------------------- - ! some basic error checking - ! find the i-th index of the poles at j= nj - ! the corner points must lie on the pole - !--------------------------------------------------------------------- - - ipole = -1 - j = nj - do i = 1,ni/2 - if(latBu(i,j) .eq. sg_maxlat)ipole(1) = i - enddo - do i = ni/2+1,ni - if(latBu(i,j) .eq. sg_maxlat)ipole(2) = i - enddo - write(logmsg,'(a,2i6,2f12.2)')'poles found at i = ',ipole,latBu(ipole(1),nj), & - latBu(ipole(2),nj) - print '(a)',trim(logmsg) - if(debug)call checkseam do i = 1,ni @@ -435,7 +450,7 @@ program gen_fixgrid write(form1,'(a)')'('//trim(cnx)//'f14.8)' write(form2,'(a)')'('//trim(cnx)//'i2)' - allocate(ww3mask(1:ni,1:nj)); ww3mask = wet4 + allocate(ww3mask(1:ni,1:nj)); ww3mask = int(wet4) allocate(ww3dpth(1:ni,1:nj)); ww3dpth = dp4 where(latCt .ge. maximum_lat)ww3mask = 3 @@ -504,7 +519,17 @@ program gen_fixgrid fwgt = trim(dirout)//'/'//'tripole.mx025.Ct.to.mx'//trim(res)//'.Ct.neareststod.nc' logmsg = 'creating weight file '//trim(fwgt) print '(a)',trim(logmsg) + call ESMF_RegridWeightGen(srcFile=trim(fsrc),dstFile=trim(fdst), & + weightFile=trim(fwgt), regridmethod=method, & + ignoreDegenerate=.true., unmappedaction=ESMF_UNMAPPEDACTION_IGNORE, rc=rc) + if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, & + line=__LINE__, file=__FILE__)) call ESMF_Finalize(endflag=ESMF_END_ABORT) + method=ESMF_REGRIDMETHOD_BILINEAR + fdst = trim(dirout)//'/'//'Ct.mx'//trim(res)//'_SCRIP.nc' + fwgt = trim(dirout)//'/'//'tripole.mx025.Ct.to.mx'//trim(res)//'.Ct.bilinear.nc' + logmsg = 'creating weight file '//trim(fwgt) + print '(a)',trim(logmsg) call ESMF_RegridWeightGen(srcFile=trim(fsrc),dstFile=trim(fdst), & weightFile=trim(fwgt), regridmethod=method, & ignoreDegenerate=.true., unmappedaction=ESMF_UNMAPPEDACTION_IGNORE, rc=rc) @@ -517,6 +542,19 @@ program gen_fixgrid end if end if + ! tripole Ct->tripole Bu for CICE are only for CICE IC creation + fsrc = trim(dirout)//'/'//'Ct.mx'//trim(res)//'_SCRIP.nc' + fdst = trim(dirout)//'/'//'Bu.mx'//trim(res)//'_SCRIP.nc' + fwgt = trim(dirout)//'/'//'tripole.mx'//trim(res)//'.Ct.to.Bu.bilinear.nc' + logmsg = 'creating weight file '//trim(fwgt) + print '(a)',trim(logmsg) + + call ESMF_RegridWeightGen(srcFile=trim(fsrc),dstFile=trim(fdst), & + weightFile=trim(fwgt), regridmethod=method, & + ignoreDegenerate=.true., unmappedaction=ESMF_UNMAPPEDACTION_IGNORE, rc=rc) + if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, & + line=__LINE__, file=__FILE__)) call ESMF_Finalize(endflag=ESMF_END_ABORT) + !--------------------------------------------------------------------- ! !--------------------------------------------------------------------- @@ -527,8 +565,8 @@ program gen_fixgrid ! clean up !--------------------------------------------------------------------- - deallocate(x,y, angq, dx, dy, xsgp1, ysgp1) - deallocate(areaCt, anglet, angle) + deallocate(x, y, dx, dy) + deallocate(areaCt, anglet, angle, angchk) deallocate(latCt, lonCt) deallocate(latCv, lonCv) deallocate(latCu, lonCu) diff --git a/sorc/cpld_gridgen.fd/grdvars.F90 b/sorc/cpld_gridgen.fd/grdvars.F90 index 578ac269a..9c549a494 100644 --- a/sorc/cpld_gridgen.fd/grdvars.F90 +++ b/sorc/cpld_gridgen.fd/grdvars.F90 @@ -68,17 +68,10 @@ module grdvars ! Super-grid source grid variables real(dbl_kind), allocatable, dimension(:,:) :: x !< The longitudes of the MOM6 supergrid real(dbl_kind), allocatable, dimension(:,:) :: y !< The latitudes of the MOM6 supergrid - real(dbl_kind), allocatable, dimension(:,:) :: angq !< The grid rotation angle at the Bu (or corner) - !! grid points of the super grid - real(dbl_kind), allocatable, dimension(:,:) :: dx !< The grid cell width in meters of the supergrid !! in the x-direction (i-dimension) real(dbl_kind), allocatable, dimension(:,:) :: dy !< The grid cell width in meters of the supergrid !! in the y-direction (j-dimension) - real(dbl_kind), allocatable, dimension(:,:) :: xsgp1 !< The longitudes of the super-grid replicated - !! across the tripole seam - real(dbl_kind), allocatable, dimension(:,:) :: ysgp1 !< The latitudes of the super-grid replicated - !! across the tripole seam ! Output grid variables real(dbl_kind), allocatable, dimension(:,:) :: latCt !< The latitude of the center (tracer) grid points @@ -103,6 +96,8 @@ module grdvars real(dbl_kind), allocatable, dimension(:,:) :: anglet !< The rotation angle on Ct points (opposite sense !! from angle) real(dbl_kind), allocatable, dimension(:,:) :: angle !< The rotation angle on Bu points + real(dbl_kind), allocatable, dimension(:,:) :: angchk !< The rotation angle on Ct points, as calculated by + !! CICE internally using angle on Bu real(dbl_kind), allocatable, dimension(:,:,:) :: latCt_vert !< The latitudes of the 4 vertices of each Ct grid !! point @@ -129,6 +124,9 @@ module grdvars !! opposite side of the tripole seam real(dbl_kind), allocatable, dimension(:) :: xlatCt !< The latitude of the Ct grid points on the !! opposite side of the tripole seam + real(dbl_kind), allocatable, dimension(:) :: xangCt !< The rotation angle on the Ct grid points on the + !! opposite side of the tripole seam + real(dbl_kind), allocatable, dimension(:) :: xlonCu !< The longitude of the Cu grid points on the !! opposite side of the tripole seam real(dbl_kind), allocatable, dimension(:) :: xlatCu !< The latitude of the Cu grid points on the @@ -172,24 +170,22 @@ module grdvars subroutine allocate_all - allocate( x(0:nx,0:ny), y(0:nx,0:ny), angq(0:nx,0:ny) ) + allocate( x(0:nx,0:ny), y(0:nx,0:ny) ) allocate( dx(nx,0:ny), dy(0:nx,ny) ) - allocate( xsgp1(0:nx,0:ny+1), ysgp1(0:nx,0:ny+1) ) - allocate( latCt(ni,nj), lonCt(ni,nj) ) allocate( latCv(ni,nj), lonCv(ni,nj) ) allocate( latCu(ni,nj), lonCu(ni,nj) ) allocate( latBu(ni,nj), lonBu(ni,nj) ) - allocate( areaCt(ni,nj), anglet(ni,nj), angle(ni,nj) ) + allocate( areaCt(ni,nj), anglet(ni,nj), angle(ni,nj), angchk(ni,nj)) allocate( latCt_vert(ni,nj,nv), lonCt_vert(ni,nj,nv) ) allocate( latCv_vert(ni,nj,nv), lonCv_vert(ni,nj,nv) ) allocate( latCu_vert(ni,nj,nv), lonCu_vert(ni,nj,nv) ) allocate( latBu_vert(ni,nj,nv), lonBu_vert(ni,nj,nv) ) - allocate( xlonCt(ni), xlatCt(ni) ) + allocate( xlonCt(ni), xlatCt(ni), xangCt(ni) ) allocate( xlonCu(ni), xlatCu(ni) ) allocate( dlatBu(ni), dlatCv(ni) ) diff --git a/sorc/cpld_gridgen.fd/inputnml.F90 b/sorc/cpld_gridgen.fd/inputnml.F90 index 6e363657b..96d86f4c3 100644 --- a/sorc/cpld_gridgen.fd/inputnml.F90 +++ b/sorc/cpld_gridgen.fd/inputnml.F90 @@ -26,7 +26,8 @@ subroutine read_inputnml(fname) character(len=*), intent(in) :: fname ! local variables - integer :: stderr, iounit, rc + integer :: iounit, rc + character(len=200) :: tmpstr namelist /grid_nml/ ni, nj, dirsrc, dirout, fv3dir, topofile, editsfile, & res, atmres, npx, editmask, debug, & @@ -34,24 +35,25 @@ subroutine read_inputnml(fname) ! Check whether file exists. inquire (file=trim(fname), iostat=rc) - if (rc /= 0) then - write (stderr, '(3a)') 'Error: input file "', trim(fname), '" does not exist.' - return + write (0, '(3a)') 'Error: input file "', trim(fname), '" does not exist.' + stop 1 end if ! Open and read Namelist file. open (action='read', file=trim(fname), iostat=rc, newunit=iounit) read (nml=grid_nml, iostat=rc, unit=iounit) + if (rc /= 0) then + backspace(iounit) + read(iounit,'(a)')tmpstr + write (6, '(a)') 'Error: invalid Namelist format '//trim(tmpstr) + stop 1 + end if + close(iounit) ! set supergrid dimensions nx = ni*2 ny = nj*2 - if (rc /= 0) then - write (stderr, '(a)') 'Error: invalid Namelist format.' - end if - - close (iounit) end subroutine read_inputnml end module inputnml diff --git a/sorc/cpld_gridgen.fd/topoedits.F90 b/sorc/cpld_gridgen.fd/topoedits.F90 index 6e1889474..e0b617b01 100644 --- a/sorc/cpld_gridgen.fd/topoedits.F90 +++ b/sorc/cpld_gridgen.fd/topoedits.F90 @@ -52,8 +52,8 @@ subroutine add_topoedits(fsrc,fdst) ! return the existing values allocate(ieds1(cnt1)); ieds1 = 0 - allocate(jeds1(cnt1)); jeds2 = 0 - allocate(zeds1(cnt1)); zeds2 = 0.0 + allocate(jeds1(cnt1)); jeds1 = 0 + allocate(zeds1(cnt1)); zeds1 = 0.0 rc = nf90_open(fsrc, nf90_nowrite, ncid) rc = nf90_inq_varid(ncid, 'iEdit', id) diff --git a/sorc/cpld_gridgen.fd/tripolegrid.F90 b/sorc/cpld_gridgen.fd/tripolegrid.F90 index feb287101..c707833ca 100644 --- a/sorc/cpld_gridgen.fd/tripolegrid.F90 +++ b/sorc/cpld_gridgen.fd/tripolegrid.F90 @@ -13,7 +13,7 @@ module tripolegrid use grdvars, only: lonCu,latCu,lonCu_vert,latCu_vert use grdvars, only: lonCv,latCv,lonCv_vert,latCv_vert use grdvars, only: lonBu,latBu,lonBu_vert,latBu_vert - use grdvars, only: wet4,areaCt,angleT,dp4 + use grdvars, only: wet4,areaCt,angleT,dp4,angle,angchk use charstrings, only: logmsg,history use vartypedefs, only: maxvars, fixvars, fixvars_typedefine use netcdf @@ -67,6 +67,12 @@ subroutine write_tripolegrid(fname) !angleT rc = nf90_def_var(ncid, 'anglet', nf90_double, dim2, id) rc = nf90_put_att(ncid, id, 'units', 'radians') + !angle (angBu) + rc = nf90_def_var(ncid, 'angle', nf90_double, dim2, id) + rc = nf90_put_att(ncid, id, 'units', 'radians') + !angchk + rc = nf90_def_var(ncid, 'angchk', nf90_double, dim2, id) + rc = nf90_put_att(ncid, id, 'units', 'radians') !bathymetry rc = nf90_def_var(ncid, 'depth', nf90_float, dim2, id) rc = nf90_put_att(ncid, id, 'units', 'm') @@ -102,6 +108,12 @@ subroutine write_tripolegrid(fname) rc = nf90_inq_varid(ncid,'anglet', id) rc = nf90_put_var(ncid, id, anglet) + rc = nf90_inq_varid(ncid, 'angle', id) + rc = nf90_put_var(ncid, id, angle) + + rc = nf90_inq_varid(ncid,'angchk', id) + rc = nf90_put_var(ncid, id, angchk) + rc = nf90_inq_varid(ncid, 'depth', id) rc = nf90_put_var(ncid, id, dp4) diff --git a/tests/cpld_gridgen/ftst_find_angq.F90 b/tests/cpld_gridgen/ftst_find_angq.F90 index bcddfb8eb..b24c6965e 100644 --- a/tests/cpld_gridgen/ftst_find_angq.F90 +++ b/tests/cpld_gridgen/ftst_find_angq.F90 @@ -1,108 +1,335 @@ -! Unit test for cpld_gridgen routine "find_angq". -! -! Reads a sample MOM6 supergrid and calculates the -! rotation angle on corner points -! -! Author Denise Worthen 2/08/2022 +!> @file +!! @brief unit test for angles +!! @author Denise.Worthen@noaa.gov +!! +!! Given a 5x5 block of coords, calculate the angle, anglet and angchk +!! and compare against values from MOM6 and CICE6 history output. The +!! 3 5x5 blocks are for the 1deg tripole grid. The first two blocks contain +!! the two polar points. The final block is located in the lower right quad +!! of the tripole region (i=300:304,j=306:310). Because the angle calculations +!! involve points outside of the 5x5 blocks (eg, i+1), not all 5x5 points are +!! checked. +!! +!! @author Denise.Worthen@noaa.gov program ftst_find_angq - - use netcdf - use grdvars, only : ni,nj,nx,ny - use grdvars, only : x,y,xsgp1,ysgp1,sg_maxlat - use grdvars, only : angq - use angles, only : find_angq - - implicit none - - integer :: i,j,i1, i2 - integer :: rc, ncid, id - - logical :: mastertask = .false. - logical :: debug = .false. - - ! pole locations on SG - integer :: ipolesg(2) - ! unit test values - real(kind=8) :: puny = 1.0e-12 - real(kind=8) :: delta(15) - real(kind=8) :: sumdelta - - print *,"Starting test of cpld_gridgen routine find_angq" - - ! 1deg MOM6 dimensions - ni = 360 - nj = 320 - ! super grid dimensions - nx = 2*ni - ny = 2*nj - - ! supergrid x,y and angles on corners - allocate (x(0:nx,0:ny), y(0:nx,0:ny), angq(0:nx,0:ny)) - ! supergrid "plus 1" arrays - allocate (xsgp1(0:nx,0:ny+1), ysgp1(0:nx,0:ny+1)) - - !open the supergrid file and read the x,y coords - rc = nf90_open('./data/ocean_hgrid.nc', nf90_nowrite, ncid) - rc = nf90_inq_varid(ncid, 'x', id) !lon - rc = nf90_get_var(ncid, id, x) - - rc = nf90_inq_varid(ncid, 'y', id) !lat - rc = nf90_get_var(ncid, id, y) - rc = nf90_close(ncid) - - ! max lat on supergrid - sg_maxlat = maxval(y) - - !pole index on supergrid - ipolesg = -1 - j = ny - do i = 1,nx/2 - if(y(i,j) .eq. sg_maxlat)ipolesg(1) = i - enddo - do i = nx/2+1,nx - if(y(i,j) .eq. sg_maxlat)ipolesg(2) = i - enddo - - ! test angleq calculation - call find_angq - - ! required for checking longitudes across seam - where(xsgp1 .lt. 0.0)xsgp1 = xsgp1 + 360.0 - - j = ny+1 - i1 = ipolesg(1); i2 = ipolesg(2)-(ipolesg(1)-i1) - delta = 0.0 - ! check lons match across seam - delta( 1) = xsgp1(i1-2,j)-xsgp1(i2+2,j) - delta( 2) = xsgp1(i1-1,j)-xsgp1(i2+1,j) - delta( 3) = xsgp1(i1, j)-xsgp1(i2, j) - delta( 4) = xsgp1(i1+1,j)-xsgp1(i2-1,j) - delta( 5) = xsgp1(i1+2,j)-xsgp1(i2-2,j) - ! check lats match across seam - delta( 6) = ysgp1(i1-2,j)-ysgp1(i2+2,j) - delta( 7) = ysgp1(i1-1,j)-ysgp1(i2+1,j) - delta( 8) = ysgp1(i1, j)-ysgp1(i2, j) - delta( 9) = ysgp1(i1+1,j)-ysgp1(i2-1,j) - delta(10) = ysgp1(i1+2,j)-ysgp1(i2-2,j) - ! check angq match across seam - j = ny - delta(11)=angq(i1-2,j)-angq(i2-2,j) - delta(12)=angq(i1-1,j)-angq(i2-1,j) - delta(13)=angq(i1, j)-angq(i2, j) - delta(14)=angq(i1+1,j)-angq(i2+1,j) - delta(15)=angq(i1+2,j)-angq(i2+2,j) - - sumdelta = 0.0 - sumdelta = sum(delta) - - if (sumdelta >= puny) then - print *,'OK' - print *,'SUCCESS!' - deallocate(x,y,xsgp1,ysgp1,angq) - else - print *,'ftst_find_angq failed' - stop 1 - endif - - end program ftst_find_angq + + use gengrid_kinds, only : dbl_kind, real_kind + use angles , only : find_angq, find_ang, find_angchk + + implicit none + + integer , parameter :: ni = 5, nj = 5, nblocks=3 + + ! verification values from model history files, mx100 + ! blocks 1 and 2 center on the left and right tripole + ! block 3 is in lower right quad of the arctic at (300:304,306:310) + real(dbl_kind), dimension(ni,nj,nblocks) :: cice6_angle + real(dbl_kind), dimension(ni,nj,nblocks) :: cice6_anglet + real(dbl_kind), dimension(ni,nj,nblocks) :: mom6_sinrot + + ! block grid point values + real(dbl_kind), dimension(ni,nj,nblocks) :: lonct, lonbu, latbu + + ! test values + real(dbl_kind), dimension(ni,nj,nblocks) :: anglet, angle, angchk + real(dbl_kind), dimension(ni,nblocks) :: xangCt + + real(dbl_kind) :: dmax, diff + character(len=1) :: ck + + integer :: i,i2,j,k + integer :: ipole(nblocks) + logical :: debug = .false. + + !CICE6 + data ((cice6_angle(i,j,1), i=1,ni), j=1,nj) / & + 0.55923, 0.29966, 0.00000, -0.29966, -0.55923, & + 0.70064, 0.38859, 0.00000, -0.38859, -0.70064, & + 0.90943, 0.53371, 0.00000, -0.53371, -0.90943, & + 1.20822, 0.75580, 0.00000, -0.75580, -1.20822, & + 1.38117, 0.89328, 0.00000, -0.89328, -1.38117/ + data ((cice6_angle(i,j,2), i=1,ni), j=1,nj) / & + 0.55923, 0.29966, 0.00000, -0.29966, -0.55923, & + 0.70064, 0.38859, 0.00000, -0.38859, -0.70064, & + 0.90943, 0.53371, 0.00000, -0.53371, -0.90943, & + 1.20822, 0.75580, 0.00000, -0.75580, -1.20822, & + 1.38117, 0.89328, 0.00000, -0.89328, -1.38117/ + data ((cice6_angle(i,j,3), i=1,ni), j=1,nj) / & + -1.14949, -1.16044, -1.17076, -1.18049, -1.18968, & + -1.18188, -1.19217, -1.20185, -1.21097, -1.21957, & + -1.21425, -1.22383, -1.23284, -1.24131, -1.24930, & + -1.24649, -1.25534, -1.26364, -1.27145, -1.27880, & + -1.27854, -1.28661, -1.29419, -1.30130, -1.30799 / + + data ((cice6_anglet(i,j,1), i=1,ni), j=1,nj) / & + 0.60483, 0.38996, 0.13521, -0.13521, -0.38996, & + 0.73204, 0.48692, 0.17198, -0.17198, -0.48692, & + 0.90492, 0.63285, 0.23026, -0.23026, -0.63285, & + 1.13597, 0.85126, 0.32134, -0.32134, -0.85126, & + 1.34026, 1.05945, 0.41175, -0.41175, -1.05945/ + data ((cice6_anglet(i,j,2), i=1,ni), j=1,nj) / & + 0.60483, 0.38996, 0.13521, -0.13521, -0.38996, & + 0.73204, 0.48692, 0.17198, -0.17198, -0.48692, & + 0.90492, 0.63285, 0.23026, -0.23026, -0.63285, & + 1.13597, 0.85126, 0.32134, -0.32134, -0.85126, & + 1.34026, 1.05945, 0.41175, -0.41175, -1.05945/ + data ((cice6_anglet(i,j,3), i=1,ni), j=1,nj) / & + -1.12735, -1.13895, -1.14989, -1.16020, -1.16995, & + -1.16004, -1.17100, -1.18130, -1.19102, -1.20018, & + -1.19278, -1.20303, -1.21267, -1.22174, -1.23029, & + -1.22546, -1.23498, -1.24391, -1.25231, -1.26021, & + -1.25800, -1.26675, -1.27495, -1.28264, -1.28988 / + + ! MOM6 sin_rot + data ((mom6_sinrot(i,j,1), i=1,ni), j=1,nj) / & + -0.57231, -0.38355, -0.13608, 0.13608, 0.38355, & + -0.67404, -0.47460, -0.17342, 0.17342, 0.47460, & + -0.79354, -0.60678, -0.23239, 0.23239, 0.60678, & + -0.91250, -0.79512, -0.32692, 0.32692, 0.79512, & + -0.98949, -0.97272, -0.43486, 0.43486, 0.97272/ + data ((mom6_sinrot(i,j,2), i=1,ni), j=1,nj) / & + -0.57231, -0.38355, -0.13608, 0.13608, 0.38355, & + -0.67404, -0.47460, -0.17342, 0.17342, 0.47460, & + -0.79354, -0.60678, -0.23239, 0.23239, 0.60678, & + -0.91250, -0.79512, -0.32692, 0.32692, 0.79512, & + -0.98949, -0.97272, -0.43486, 0.43486, 0.97272/ + data ((mom6_sinrot(i,j,3), i=1,ni), j=1,nj) / & + 0.90334, 0.90826, 0.91278, 0.91694, 0.92079, & + 0.91689, 0.92120, 0.92516, 0.92881, 0.93216, & + 0.92946, 0.93320, 0.93662, 0.93976, 0.94264, & + 0.94103, 0.94420, 0.94711, 0.94977, 0.95221, & + 0.95154, 0.95419, 0.95661, 0.95882, 0.96085 / + + ! lon Ct,Bu and latBu + data ((lonct(i,j,1), i=1,ni), j=1,nj) / & + -245.26937, -232.98519, -218.04609, -201.95391, -187.01481, & + -252.74561, -239.00064, -220.46665, -199.53335, -180.99936, & + -262.76769, -248.28139, -224.73626, -195.26374, -171.71861, & + -275.86250, -263.23478, -234.03925, -185.96075, -156.76522, & + -291.65329, -286.25383, -263.72015, -156.27985, -133.74617 / + data ((lonbu(i,j,1), i=1,ni), j=1,nj) / & + -242.68153, -227.77943, -210.00000, -192.22057, -177.31847, & + -251.01234, -233.49458, -210.00000, -186.50542, -168.98766, & + -262.99894, -243.55611, -210.00000, -176.44389, -157.00106, & + -279.68531, -263.47519, -210.00000, -156.52481, -140.31469, & + -300.00000, -300.00000, -210.00000, -120.00000, -120.00000 / + data ((latbu(i,j,1), i=1,ni), j=1,nj) / & + 88.99001, 89.10706, 89.14964, 89.10706, 88.99001, & + 89.16921, 89.31628, 89.37292, 89.31628, 89.16921, & + 89.31750, 89.50699, 89.58912, 89.50699, 89.31750, & + 89.41886, 89.66093, 89.79818, 89.66093, 89.41886, & + 89.45503, 89.72754, 90.00000, 89.72754, 89.45503 / + + data ((lonct(i,j,2), i=1,ni), j=1,nj) / & + -65.26937, -52.98519, -38.04609, -21.95391, -7.01481, & + -72.74561, -59.00064, -40.46665, -19.53335, -0.99936, & + -82.76769, -68.28139, -44.73626, -15.26374, 8.28139, & + -95.86250, -83.23478, -54.03925, -5.96075, 23.23478, & + -111.65329, -106.25383, -83.72015, 23.72015, 46.25383 / + data ((lonbu(i,j,2), i=1,ni), j=1,nj) / & + -62.68153, -47.77943, -30.00000, -12.22057, 2.68153, & + -71.01234, -53.49458, -30.00000, -6.50542, 11.01234, & + -82.99894, -63.55611, -30.00000, 3.55611, 22.99894, & + -99.68531, -83.47519, -30.00000, 23.47519, 39.68531, & + -120.00000, -120.00000, -30.00000, 60.00000, 60.00000 / + data ((latbu(i,j,2), i=1,ni), j=1,nj) / & + 88.99001, 89.10706, 89.14964, 89.10706, 88.99001, & + 89.16921, 89.31628, 89.37292, 89.31628, 89.16921, & + 89.31750, 89.50699, 89.58912, 89.50699, 89.31750, & + 89.41886, 89.66093, 89.79818, 89.66093, 89.41886, & + 89.45503, 89.72754, 90.00000, 89.72754, 89.45503 / + + data ((lonct(i,j,3), i=1,ni), j=1,nj) / & + 38.08144, 38.86965, 39.62025, 40.33605, 41.01961, & + 39.67340, 40.41426, 41.11877, 41.78975, 42.42974, & + 41.27339, 41.96446, 42.62075, 43.24505, 43.83985, & + 42.87655, 43.51566, 44.12188, 44.69789, 45.24611, & + 44.47789, 45.06321, 45.61778, 46.14417, 46.64470 / + data ((lonbu(i,j,3), i=1,ni), j=1,nj) / & + 39.26336, 40.00933, 40.71974, 41.39725, 42.04431, & + 40.83545, 41.53354, 42.19746, 42.82988, 43.43321, & + 42.41197, 43.06002, 43.67560, 44.26131, 44.81949, & + 43.98813, 44.58428, 45.14993, 45.68757, 46.19946, & + 45.55910, 46.10182, 46.61624, 47.10473, 47.56942 / + data ((latbu(i,j,3), i=1,ni), j=1,nj) / & + 80.97195, 80.70286, 80.43134, 80.15742, 79.88114, & + 81.07710, 80.80479, 80.53019, 80.25334, 79.97425, & + 81.17218, 80.89690, 80.61947, 80.33992, 80.05826, & + 81.25741, 80.97942, 80.69942, 80.41741, 80.13341, & + 81.33309, 81.05265, 80.77032, 80.48610, 80.19999 / + + print *,"Starting test of cpld_gridgen routine find_angq" + + angle = 0.0 + anglet = 0.0 + angchk = 0.0 + ipole = 0 + + j = nj + do i = 1,ni + if(latBu(i,j,1) .eq. 90.00)ipole(1) = i + if(latBu(i,j,2) .eq. 90.00)ipole(2) = i + enddo + + !------------------------------------------ + ! find anglet and test against mom6 values + !------------------------------------------ + + call find_ang((/2,5/),(/2,5/),lonBu(:,:,1),latBu(:,:,1),lonCt(:,:,1),anglet(:,:,1)) + call find_ang((/2,5/),(/2,5/),lonBu(:,:,2),latBu(:,:,2),lonCt(:,:,2),anglet(:,:,2)) + call find_ang((/2,5/),(/2,5/),lonBu(:,:,3),latBu(:,:,3),lonCt(:,:,3),anglet(:,:,3)) + + do k = 1,nblocks + write(ck,'(i1.1)')k + dmax = 1.0e-30 + do j = 1,nj + do i = 1,ni + if (abs(anglet(i,j,k)) .gt. 0.0)then + diff = abs(anglet(i,j,k) - asin(mom6_sinrot(i,j,k))) + dmax = max(diff,dmax) + end if + end do + end do + call passfail(dmax, 1.0e-4, 'MOM6 anglet, block '//trim(ck)) + end do + + if (debug) then + print *,'anglet ' + print *,'left' + do j = 1,nj + print '(5f15.6)',(anglet(i,j,1), i = 1,ni) + end do + print *,'right' + do j = 1,nj + print '(5f15.6)',(anglet(i,j,2), i = 1,ni) + end do + print *,'quad' + do j = 1,nj + print '(5f15.6)',(anglet(i,j,3), i = 1,ni) + end do + end if + + !-------------------------------------------------------- + ! + !--------------------------------------------------------- + + xangCt = 0.0 + do i = 2,ni + i2 = ipole(2)+(ipole(1)-i)+1 + xangCt(i,1) = -anglet(i2,nj,1) ! angle changes sign across seam + xangCt(i,2) = -anglet(i2,nj,2) + xangCt(i,3) = anglet(i,nj,3) + end do + + !------------------------------------------- + ! find angle and test against cice6 values + !------------------------------------------- + + call find_angq((/2,5/),(/2,5/),xangCt(:,1),anglet(:,:,1),angle(:,:,1)) + call find_angq((/2,5/),(/2,5/),xangCt(:,2),anglet(:,:,2),angle(:,:,2)) + call find_angq((/2,5/),(/2,4/),xangCt(:,3),anglet(:,:,3),angle(:,:,3)) + ! reverse angle for CICE + angle = -angle + + do k = 1,nblocks + write(ck,'(i1.1)')k + dmax = 1.0e-30 + do j = 1,nj + do i = 1,ni + if (abs(angle(i,j,k)) .gt. 0.0) then + diff = abs(angle(i,j,k) - cice6_angle(i,j,k)) + dmax = max(diff,dmax) + end if + end do + end do + call passfail(dmax, 1.0e-4, 'CICE6 angle, block '//trim(ck)) + end do + + if (debug) then + print *,'angle' + print *,'left' + do j = 1,nj + print '(5f15.6)',(angle(i,j,1), i = 1,ni) + end do + print *,'right' + do j = 1,nj + print '(5f15.6)',(angle(i,j,2), i = 1,ni) + end do + print *,'quad' + do j = 1,nj + print '(5f15.6)',(angle(i,j,3), i = 1,ni) + end do + end if + + !----------------------------------------------------------------------- + ! find anglet calculated by CICE and test against cice6 and mom6 values + !----------------------------------------------------------------------- + call find_angchk((/2,4/),(/3,4/),angle(:,:,1),angchk(:,:,1)) + call find_angchk((/2,4/),(/3,4/),angle(:,:,2),angchk(:,:,2)) + call find_angchk((/2,4/),(/3,4/),angle(:,:,3),angchk(:,:,3)) + ! reverse angle for MOM6 + angchk = -angchk + + do k = 1,nblocks + write(ck,'(i1.1)')k + dmax = 1.0e-30 + do j = 1,nj + do i = 1,ni + if (abs(angchk(i,j,k)) .gt. 0.0) then + diff = abs(-angchk(i,j,k) - cice6_anglet(i,j,k)) + dmax = max(diff,dmax) + end if + end do + end do + call passfail(dmax, 1.0e-4, 'angchk vs CICE6 anglet, block '//trim(ck)) + end do + + do k = 1,nblocks + write(ck,'(i1.1)')k + dmax = 1.0e-30 + do j = 1,nj + do i = 1,ni + if (abs(angchk(i,j,k)) .gt. 0.0) then + diff = abs(angchk(i,j,k) - asin(mom6_sinrot(i,j,k))) + dmax = max(diff,dmax) + end if + end do + end do + call passfail(dmax, 1.2e-2, 'angchk vs MOM6 anglet, block '//trim(ck)) + end do + + if (debug) then + print *,'angchk' + print *,'left' + do j = 1,nj + print '(5f15.6)',(angchk(i,j,1), i = 1,ni) + end do + print *,'right' + do j = 1,nj + print '(5f15.6)',(angchk(i,j,2), i = 1,ni) + end do + print *,'quad' + do j = 1,nj + print '(5f15.6)',(angchk(i,j,3), i = 1,ni) + end do + end if + end program + + subroutine passfail(dmax,tolerance,msg) + + use gengrid_kinds, only : dbl_kind + + implicit none + + real(dbl_kind), intent(in) :: dmax + real(dbl_kind), intent(in) :: tolerance + character(len=*), intent(in) :: msg + + if (dmax .le. tolerance) then + print '(a,2f12.8)','SUCCESS! '//trim(msg)//' ',dmax,tolerance + else + print '(a,2f12.8)','FAIL! '//trim(msg)//' ',dmax,tolerance + stop 1 + endif + end subroutine passfail