Ignore:
Timestamp:
07/16/23 18:22:25 (20 months ago)
Author:
inwoo
Message:

CHG: add calculation of TotalSmbMelt and TotalSmbRefreeze for SEMIC.

File:
1 edited

Legend:

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

    r27789 r27829  
    43184318                _printf0_("smb core: dt       : " << dt <<"\n");
    43194319        }
    4320         /* loop over vertices and days */ //FIXME account for leap years (365 -> 366)
     4320        /* loop over vertices and days */
    43214321        Gauss* gauss=this->NewGauss();
    43224322        /* Retrieve inputs: */
     
    43474347                enum_qmr        =SmbSemicQmrInitEnum;
    43484348        }
    4349         if(isverbose && this->Sid()==0)_printf0_("smb core: assign temp.\n");
     4349        //if(isverbose && this->Sid()==0)_printf0_("smb core: assign temp.\n");
    43504350        Input* tsurf_input       = this->GetInput(enum_temp); _assert_(tsurf_in);
    4351         if(isverbose && this->Sid()==0)_printf0_("smb core: assign mask.\n");
     4351        //if(isverbose && this->Sid()==0)_printf0_("smb core: assign mask.\n");
    43524352        Input* mask_input        = this->GetInput(SmbMaskEnum); _assert_(mask_input);
    4353         if(isverbose && this->Sid()==0)_printf0_("smb core: assign Tamp.\n");
     4353        //if(isverbose && this->Sid()==0)_printf0_("smb core: assign Tamp.\n");
    43544354        Input* Tamp_input        = this->GetInput(SmbTampEnum); _assert_(Tamp_input);
    4355         if(isverbose && this->Sid()==0)_printf0_("smb core: assign albedo.\n");
     4355        //if(isverbose && this->Sid()==0)_printf0_("smb core: assign albedo.\n");
    43564356        Input* albedo_input      = this->GetInput(enum_albedo); _assert_(albedo_input);
    43574357        Input* albedo_snow_input = this->GetInput(enum_albedo_snow); _assert_(albedo_snow_input);
    43584358        Input* hice_input        = this->GetInput(enum_hice); _assert_(hice_input);
    43594359        Input* hsnow_input       = this->GetInput(enum_hsnow); _assert_(hsnow_input);
    4360         if(isverbose && this->Sid()==0)_printf0_("smb core: assign qmr.\n");
    43614360        Input* qmr_input         = this->GetInput(enum_qmr); _assert_(qmr_input);
    43624361
     
    44384437                 */
    44394438                smb_out[iv]  = smb_out[iv]*yts;  // w.e. m/sec -> m/yr
    4440                 smbi_out[iv] = smbi_out[iv]*rho_water/rho_ice;
     4439                smbi_out[iv] = smbi_out[iv]*rho_water/rho_ice; // w.e. m/sec -> ice m/yr
    44414440                smbs_out[iv] = smbs_out[iv]*yts; // w.e. m/sec -> m/yr
    44424441                saccu_out[iv] = saccu_out[iv]*yts; // w.e. m/sec -> m/yr
    4443         }
    4444         /*
    4445          * unit conversion is not required for smelt and refr_out.
    4446          */
     4442                smelt_out[iv] = smelt_out[iv]*rho_water/rho_ice; // w.e. m/sec -> ice m/yr
     4443                refr_out[iv]  = refr_out[iv]*rho_water/rho_ice; // w.e. m/sec -> ice m/yr
     4444        }
    44474445
    44484446        if(isverbose && this->Sid()==0){
     
    54065404}
    54075405/*}}}*/
     5406IssmDouble Element::TotalSmbMelt(IssmDouble* mask, bool scaled){/*{{{*/
     5407
     5408        /*Retrieve values of the mask defining the element: */
     5409        for(int i=0;i<this->GetNumberOfVertices();i++){
     5410                if(mask[this->vertices[i]->Sid()]<=0.){
     5411                        return 0.;
     5412                }
     5413        }
     5414
     5415        /*Return: */
     5416        return this->TotalSmbMelt(scaled);
     5417}
     5418/*}}}*/
     5419IssmDouble Element::TotalSmbRefreeze(IssmDouble* mask, bool scaled){/*{{{*/
     5420
     5421        /*Retrieve values of the mask defining the element: */
     5422        for(int i=0;i<this->GetNumberOfVertices();i++){
     5423                if(mask[this->vertices[i]->Sid()]<=0.){
     5424                        return 0.;
     5425                }
     5426        }
     5427
     5428        /*Return: */
     5429        return this->TotalSmbRefreeze(scaled);
     5430}
     5431/*}}}*/
    54085432void       Element::TransformInvStiffnessMatrixCoord(ElementMatrix* Ke,int transformenum){/*{{{*/
    54095433
Note: See TracChangeset for help on using the changeset viewer.