Index: branches/eam_branches/relphot.20210521/src/args.c
===================================================================
--- branches/eam_branches/relphot.20210521/src/args.c	(revision 41620)
+++ branches/eam_branches/relphot.20210521/src/args.c	(revision 41623)
@@ -387,8 +387,14 @@
   GRID_ZEROPT = FALSE;
   GRID_MEANFILE = NULL; // this is set by GridCorrectionSave()
+  GRID_ZPT_MODE = GRID_ZPT_MODE_NONE; // start with grid off
   if ((N = get_argument (argc, argv, "-grid"))) {
     remove_argument (N, &argc, argv);
     GRID_ZEROPT = TRUE;
-    GRID_ZPT_MODE  = GRID_ZPT_MODE_NONE; // start with grid off
+  }
+  if ((N = get_argument (argc, argv, "-grid-meanfile"))) {
+    GRID_ZEROPT = TRUE;
+    remove_argument (N, &argc, argv);
+    GRID_MEANFILE = strcreate (argv[N]); // used by relphot -averages and relphot -apply-offsets
+    remove_argument (N, &argc, argv);
   }
 
@@ -554,4 +560,6 @@
     case SYNTH_PHOT:
     case UPDATE_AVERAGES:
+      // note: initialize sets PhotcodeList to the full set of average photcodes
+      // if the mode is UPDATE_AVERAGES
       if (argc != 1) relphot_usage();
       break;
