      void get_variable_pos(const char *variable_name, unsigned int &pos, unsigned int &rpos) {
        char c1, c2, c3, c4;
        pos = rpos = ~0U;
        if (!variable_name || !*variable_name) return;

        unsigned int rp = variable_name[1]?~0U:*variable_name; // One-char variable
        if (variable_name[1] && !variable_name[2]) { // Two-chars variable
          c1 = variable_name[0];
          c2 = variable_name[1];
          if (c1=='w' && c2=='h') rp = 0; // wh
          else if (c1=='p' && c2=='i') rp = 3; // pi
          else if (c1=='i') {
            if (c2>='0' && c2<='9') rp = 20 + c2 - '0'; // i0...i9
            else if (c2=='m') rp = 4; // im
            else if (c2=='M') rp = 5; // iM
            else if (c2=='a') rp = 6; // ia
            else if (c2=='v') rp = 7; // iv
            else if (c2=='s') rp = 8; // is
            else if (c2=='p') rp = 9; // ip
            else if (c2=='c') rp = 10; // ic
            else if (c2=='n') rp = 11; // in
          } else if (c2=='m') {
            if (c1=='x') rp = 12; // xm
            else if (c1=='y') rp = 13; // ym
            else if (c1=='z') rp = 14; // zm
            else if (c1=='c') rp = 15; // cm
          } else if (c2=='M') {
            if (c1=='x') rp = 16; // xM
            else if (c1=='y') rp = 17; // yM
            else if (c1=='z') rp = 18; // zM
            else if (c1=='c') rp = 19; // cM
          }
        } else if (variable_name[1] && variable_name[2] && !variable_name[3]) { // Three-chars variable
          c1 = variable_name[0];
          c2 = variable_name[1];
          c3 = variable_name[2];
          if (c1=='w' && c2=='h' && c3=='d') rp = 1; // whd
        } else if (variable_name[1] && variable_name[2] && variable_name[3] &&
                   !variable_name[4]) { // Four-chars variable
          c1 = variable_name[0];
          c2 = variable_name[1];
          c3 = variable_name[2];
          c4 = variable_name[3];
          if (c1=='w' && c2=='h' && c3=='d' && c4=='s') rp = 2; // whds
        } else if (!std::strcmp(variable_name,"interpolation")) rp = 30; // interpolation
        else if (!std::strcmp(variable_name,"boundary")) rp = 31; // boundary

        if (rp!=~0U) { rpos = rp; return; } // One of the reserved labels

        // Multi-char variable name : check for existing variable with same name
        cimglist_for(variable_def,i)
          if (!std::strcmp(variable_name,variable_def[i])) { pos = i; break; }
      }
      void get_variable_pos(const char *variable_name, unsigned int &pos, unsigned int &rpos) {
        char c1, c2, c3, c4;
        pos = rpos = ~0U;
        if (!variable_name || !*variable_name) return;

        unsigned int rp = variable_name[1]?~0U:*variable_name;  
        if (variable_name[1] && !variable_name[2]) {  
          c1 = variable_name[0];
          c2 = variable_name[1];
          if (c1=='w' && c2=='h') rp = 0;  
          else if (c1=='p' && c2=='i') rp = 3;  
          else if (c1=='i') {
            if (c2>='0' && c2<='9') rp = 20 + c2 - '0';  
            else if (c2=='m') rp = 4;  
            else if (c2=='M') rp = 5;  
            else if (c2=='a') rp = 6;  
            else if (c2=='v') rp = 7;  
            else if (c2=='s') rp = 8;  
            else if (c2=='p') rp = 9;  
            else if (c2=='c') rp = 10;  
            else if (c2=='n') rp = 11;  
          } else if (c2=='m') {
            if (c1=='x') rp = 12;  
            else if (c1=='y') rp = 13;  
            else if (c1=='z') rp = 14;  
            else if (c1=='c') rp = 15;  
          } else if (c2=='M') {
            if (c1=='x') rp = 16;  
            else if (c1=='y') rp = 17;  
            else if (c1=='z') rp = 18;  
            else if (c1=='c') rp = 19;  
          }
        } else if (variable_name[1] && variable_name[2] && !variable_name[3]) {  
          c1 = variable_name[0];
          c2 = variable_name[1];
          c3 = variable_name[2];
          if (c1=='w' && c2=='h' && c3=='d') rp = 1;  
        } else if (variable_name[1] && variable_name[2] && variable_name[3] &&
                   !variable_name[4]) {  
          c1 = variable_name[0];
          c2 = variable_name[1];
          c3 = variable_name[2];
          c4 = variable_name[3];
          if (c1=='w' && c2=='h' && c3=='d' && c4=='s') rp = 2;  
        } else if (!std::strcmp(variable_name,"interpolation")) rp = 30;  
        else if (!std::strcmp(variable_name,"boundary")) rp = 31;  

        if (rp!=~0U) { rpos = rp; return; }  

         
        cimglist_for(variable_def,i)
          if (!std::strcmp(variable_name,variable_def[i])) { pos = i; break; }
      }