Index: branches/eam_branches/relphot.20210521/src/args.c
===================================================================
--- branches/eam_branches/relphot.20210521/src/args.c	(revision 41603)
+++ branches/eam_branches/relphot.20210521/src/args.c	(revision 41615)
@@ -382,4 +382,5 @@
   // GRID_ZEROPT is not valid for all cases, probably should be its own mode...
   GRID_ZEROPT = FALSE;
+  GRID_MEANFILE = NULL; // this is set by GridCorrectionSave()
   if ((N = get_argument (argc, argv, "-grid"))) {
     remove_argument (N, &argc, argv);
@@ -602,4 +603,5 @@
   FREE (REGION_FILE);
   FREE (SYNTH_ZERO_POINTS);
+  FREE (GRID_MEANFILE);
   FREE (IMAGE_TABLE);
   FREE (CATDIR);
@@ -858,4 +860,14 @@
   }
 
+  // load the GridCorrection file
+  GRID_ZEROPT = FALSE;
+  GRID_MEANFILE = NULL;
+  if ((N = get_argument (argc, argv, "-grid"))) {
+    GRID_ZEROPT = TRUE;
+    remove_argument (N, &argc, argv);
+    GRID_MEANFILE = strcreate (argv[N]);
+    remove_argument (N, &argc, argv);
+  }
+
   ImagSelect = FALSE;
   if ((N = get_argument (argc, argv, "-instmag"))) {
@@ -916,4 +928,5 @@
 
   FREE (SYNTH_ZERO_POINTS);
+  FREE (GRID_MEANFILE);
   FREE (BOUNDARY_TREE);
   FREE (UPDATE_CATFORMAT);
