~fluidity-core/fluidity/refactor-netcdf

« back to all changes in this revision

Viewing changes to libspud/python/libspud.c

  • Committer: Jon Hill
  • Date: 2012-08-01 08:38:16 UTC
  • mfrom: (3981.7.18 fluidity)
  • Revision ID: jon.hill@imperial.ac.uk-20120801083816-x5cfnztw5y0rh7wk
MergeĀ fromĀ trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
318
318
        return NULL;
319
319
    }
320
320
    for (j = 0; j < size; j++){
321
 
        PyObject* element = Py_BuildValue("f", val[j]);
 
321
        PyObject* element = Py_BuildValue("d", val[j]);
322
322
        PyList_SetItem(pylist, j, element);
323
323
    }
324
324
 
656
656
 
657
657
    if (type == SPUD_DOUBLE){ //scalar is double
658
658
        double val;
659
 
        PyArg_Parse(pyscalar, "f", &val);
 
659
        PyArg_Parse(pyscalar, "d", &val);
660
660
        outcomeSetOption = spud_set_option(key, key_len, &val, type, rank, shape);
661
661
    }
662
662
    else if (type == SPUD_INT){
684
684
        PyErr_SetString(SpudError,"Error: set_option takes exactly 2 arguments.");
685
685
        return NULL;
686
686
    }
687
 
 
 
687
    
688
688
    firstArg = PyTuple_GetItem(args, 0);
689
689
    secondArg = PyTuple_GetItem(args, 1);
690
690
    PyArg_Parse(firstArg, "s", &key);
694
694
        int outcomeAddOption = spud_add_option(key, key_len);
695
695
        error_checking(outcomeAddOption, "set option");
696
696
    } 
697
 
    
 
697
  
698
698
    if (PyInt_Check(secondArg)){ //just an int
699
699
        type = SPUD_INT;
700
700
        rank = 0;