Changeset 23799


Ignore:
Timestamp:
03/14/19 15:58:58 (6 years ago)
Author:
tpelle
Message:

NEW: Add NR test for ISMIP6 basal melt rate parameteriztion. Made slight modifications to code to remove memory leaks for this parameterization

Location:
issm/trunk-jpl
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/c/modules/FloatingiceMeltingRatex/FloatingiceMeltingRatex.cpp

    r23797 r23799  
    8888        IssmDouble* areas_summed_cpu    = xNewZeroInit<IssmDouble>(num_basins);
    8989
    90         /*TEST: Set tf=2 for all ice shelf elements*/
     90        /*Get TF at each ice shelf point - linearly intepolate in depth and time*/
    9191        for(int i=0;i<femmodel->elements->Size();i++){
    9292                Element* element     = xDynamicCast<Element*>(femmodel->elements->GetObjectByOffset(i));
     
    130130                        }
    131131                        else {
    132                                 /*get values between two times [offset:offset+1[, Interpolate linearly*/
     132                                /*get values between two times [offset:offset+1], Interpolate linearly*/
    133133                                _assert_(depth>=tf_depths[offset] && depth<tf_depths[offset+1]);
    134134                                IssmDouble deltaz=tf_depths[offset+1]-tf_depths[offset];
     
    145145                xDelete<IssmDouble>(tf_test);
    146146                xDelete<IssmDouble>(depth_vertices);
     147                delete gauss;
    147148        }
    148149
  • issm/trunk-jpl/src/c/modules/ModelProcessorx/CreateParameters.cpp

    r23795 r23799  
    228228                        parameters->AddObject(iomodel->CopyConstantObject("md.basalforcings.num_basins",BasalforcingsIsmp6NumBasinsEnum));
    229229                        parameters->AddObject(iomodel->CopyConstantObject("md.basalforcings.gamma_0",BasalforcingsIsmp6Gamma0Enum));
    230                         iomodel->FindConstant(&temp_n,"md.basalforcings.num_basins");
    231                         iomodel->FetchData(&transparam,NULL,&M,"md.basalforcings.delta_t");
    232                         parameters->AddObject(new DoubleVecParam(BasalforcingsIsmp6DeltaTEnum,transparam,temp_n));
    233                         xDelete<IssmDouble>(transparam);
    234                         iomodel->FetchData(&transparam,NULL,NULL,"md.basalforcings.tf_depths");
    235                         parameters->AddObject(new DoubleVecParam(BasalforcingsIsmp6TfDepthsEnum,transparam,3));
     230                        iomodel->FetchData(&transparam,&M,&N,"md.basalforcings.delta_t");
     231                        parameters->AddObject(new DoubleVecParam(BasalforcingsIsmp6DeltaTEnum,transparam,N));
     232                        xDelete<IssmDouble>(transparam);
     233                        iomodel->FetchData(&transparam,&M,&N,"md.basalforcings.tf_depths");
     234                        parameters->AddObject(new DoubleVecParam(BasalforcingsIsmp6TfDepthsEnum,transparam,N));
    236235                        xDelete<IssmDouble>(transparam);
    237236                        break;
  • issm/trunk-jpl/src/m/classes/basalforcingsismip6.m

    r23781 r23799  
    8383                        WriteData(fid,prefix,'object',self,'fieldname','num_basins','format','Integer');
    8484                        WriteData(fid,prefix,'object',self,'fieldname','basin_id','data',self.basin_id-1,'name','md.basalforcings.basin_id','format','IntMat','mattype',2);   %0-indexed
    85                         WriteData(fid,prefix,'object',self,'fieldname','gamma_0','format','Double');
     85                        WriteData(fid,prefix,'object',self,'fieldname','gamma_0','format','Double','scale',1./yts);
    8686                        WriteData(fid,prefix,'object',self,'fieldname','tf_depths','format','DoubleMat','name','md.basalforcings.tf_depths');
    8787                        WriteData(fid,prefix,'object',self,'fieldname','tf','format','MatArray','name','md.basalforcings.tf','timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
Note: See TracChangeset for help on using the changeset viewer.