Ignore:
Timestamp:
09/07/20 03:12:14 (5 years ago)
Author:
bdef
Message:

CHG:Modifying loop on elements towards for on iterator

File:
1 edited

Legend:

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

    r25508 r25539  
    3030}
    3131/*}}}*/
    32 Radar::Radar(char* in_name, int in_definitionenum){/*{{{*/     
     32Radar::Radar(char* in_name, int in_definitionenum){/*{{{*/
    3333        this->definitionenum=in_definitionenum;
    3434        this->name              = xNew<char>(strlen(in_name)+1);
     
    5959/*}}}*/
    6060void Radar::Marshall(MarshallHandle* marshallhandle){/*{{{*/
    61         _error_("not implemented yet!"); 
    62 } 
     61        _error_("not implemented yet!");
     62}
    6363/*}}}*/
    6464int Radar::ObjectEnum(void){/*{{{*/
     
    7777}
    7878/*}}}*/
    79 IssmDouble Radar::Response(FemModel* femmodel){/*{{{*/ 
    80         int i;
    81         for(i=0;i<femmodel->elements->Size();i++){
    82                 Element* element=(Element*)femmodel->elements->GetObjectByOffset(i);
     79IssmDouble Radar::Response(FemModel* femmodel){/*{{{*/
     80        for(Object* & object : femmodel->elements->objects){
     81                Element* element=xDynamicCast<Element*>(object);
    8382                this->ComputeRadarAttenuation(element);
    84                 this->ComputeRadarPower(element); 
     83                this->ComputeRadarPower(element);
    8584        }
    8685        return 0.;
     
    112111        IssmDouble  E_Cl_W97=3.6800e-20;
    113112        IssmDouble  E_NH=3.6800e-20;
    114         IssmDouble  mol_H_hol=1.6; 
    115         IssmDouble  mol_H_lgp=0.2; 
    116         IssmDouble  mol_Cl_hol=0.4; 
    117         IssmDouble  mol_Cl_lgp=1.8; 
     113        IssmDouble  mol_H_hol=1.6;
     114        IssmDouble  mol_H_lgp=0.2;
     115        IssmDouble  mol_Cl_hol=0.4;
     116        IssmDouble  mol_Cl_lgp=1.8;
    118117        IssmDouble  mol_NH_hol=0.5;
    119         IssmDouble  mol_NH_lgp=0.4; 
     118        IssmDouble  mol_NH_lgp=0.4;
    120119        IssmDouble  mol_H, mol_Cl, mol_NH;
    121120        IssmDouble  attenuation_rate_macgregor[NUMVERTICES];
     
    129128        /*Retrieve all inputs we will be needing: */
    130129        Input* temp_input=element->GetInput(TemperatureEnum); _assert_(temp_input);
    131         Input* ice_period_input=element->GetInput(RadarIcePeriodEnum); _assert_(ice_period_input); 
     130        Input* ice_period_input=element->GetInput(RadarIcePeriodEnum); _assert_(ice_period_input);
    132131
    133132        /* Start looping on the number of vertices: */
     
    136135        for (int iv=0;iv<NUMVERTICES;iv++){
    137136                gauss->GaussVertex(iv);
    138    
     137
    139138                /*Get ice temperature: */
    140139                temp_input->GetInputValue(&temperature,gauss);
    141140                ice_period_input->GetInputValue(&ice_period,gauss);
    142141
    143                 if(ice_period>0){; 
     142                if(ice_period>0){;
    144143                        mol_H=mol_H_hol;
    145144                        mol_Cl=mol_Cl_hol;
    146145                        mol_NH=mol_NH_hol;
    147146                        }
    148                 else{ 
     147                else{
    149148                        mol_H=mol_H_lgp;
    150                         mol_Cl=mol_Cl_lgp; 
     149                        mol_Cl=mol_Cl_lgp;
    151150                        mol_NH=mol_NH_lgp;
    152151                }
     
    209208        IssmDouble  rho_ice, gravity, pressure, pressure_melting_pt, frozen_temp, basal_temp, basal_pmp;
    210209        GaussPenta* gauss=NULL;
    211        
     210
    212211        /* Get node coordinates*/
    213212        element->GetVerticesCoordinates(&xyz_list);
     
    253252                                pressure=rho_ice*gravity*thickness;
    254253                                pressure_melting_pt=t_tp-gamma*(pressure-p_tp);
    255                                
     254
    256255                                if((temperature-pressure_melting_pt)<=-1){
    257256                                        reflectivity=-40;
Note: See TracChangeset for help on using the changeset viewer.