Changeset 24014


Ignore:
Timestamp:
06/12/19 15:10:30 (6 years ago)
Author:
jdquinn
Message:

BUG: Changed all array of IssmDouble initializations from IssmDouble <name>[NUM_VERTICES] to IssmDouble* <name> = xNew<IssmDouble>(NUM_VERTICES)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/c/classes/Elements/Element.cpp

    r24013 r24014  
    21782178        int         basinid,num_basins,M,N;
    21792179        IssmDouble  tf,gamma0,base,delta_t_basin,mean_tf_basin,absval;
    2180         IssmDouble  basalmeltrate[NUM_VERTICES];
     2180        IssmDouble* basalmeltrate = xNew<IssmDouble>(NUM_VERTICES);
    21812181        bool        islocal;
    21822182        IssmDouble* delta_t = NULL;
     
    26822682        IssmDouble g1               = area_boxi*gamma_T;
    26832683
    2684         IssmDouble basalmeltrates_shelf[NUM_VERTICES];
    2685         IssmDouble potential_pressure_melting_point[NUM_VERTICES];
    2686         IssmDouble Tocs[NUM_VERTICES];
    2687         IssmDouble Socs[NUM_VERTICES];
     2684        IssmDouble* basalmeltrates_shelf                                = xNew<IssmDouble>(NUM_VERTICES);
     2685        IssmDouble* potential_pressure_melting_point    = xNew<IssmDouble>(NUM_VERTICES);
     2686        IssmDouble* Tocs                                                                = xNew<IssmDouble>(NUM_VERTICES);
     2687        IssmDouble* Socs                                                                = xNew<IssmDouble>(NUM_VERTICES);
    26882688
    26892689        /* First box calculations */
     
    26942694                this->parameters->FindParam(&toc_farocean, basinid, time, BasalforcingsPicoFarOceantemperatureEnum);
    26952695                this->parameters->FindParam(&soc_farocean, basinid, time, BasalforcingsPicoFarOceansalinityEnum);
    2696                 IssmDouble s1 = soc_farocean/(nu*lambda);
    2697                 IssmDouble overturnings[NUM_VERTICES];
     2696                IssmDouble      s1                              = soc_farocean/(nu*lambda);
     2697                IssmDouble* overturnings        = xNew<IssmDouble>(NUM_VERTICES);
    26982698
    26992699                /* Start looping on the number of verticies and calculate ocean vars */
     
    27932793
    27942794        /*Define arrays*/
    2795         IssmDouble basalmeltrates_shelf[NUM_VERTICES]; //Basal melt-rate
     2795        IssmDouble* basalmeltrates_shelf = xNew<IssmDouble>(NUM_VERTICES); //Basal melt-rate
    27962796
    27972797        /*Polynomial coefficients*/
Note: See TracChangeset for help on using the changeset viewer.