Changeset 22822


Ignore:
Timestamp:
05/31/18 10:44:24 (7 years ago)
Author:
Mathieu Morlighem
Message:

merged trunk-jpl and trunk for revision 22820

Location:
issm/trunk
Files:
35 edited
6 copied

Legend:

Unmodified
Added
Removed
  • issm/trunk

  • issm/trunk/README

    r19105 r22822  
    1616
    1717
    18 Copyright (c) 2002-2014, California Institute of Technology.
     18Copyright (c) 2002-2018, California Institute of Technology.
    1919All rights reserved.  Based on Government Sponsored Research under contracts
    2020NAS7-1407 and/or NAS7-03001.
  • issm/trunk/configure.ac

    r22758 r22822  
    22
    33#AUTOCONF
    4 AC_INIT([Ice Sheet System Model (ISSM)],[4.13],[issm@jpl.nasa.gov],[issm],[http://issm.jpl.nasa.gov]) #Initializing configure
     4AC_INIT([Ice Sheet System Model (ISSM)],[4.14],[issm@jpl.nasa.gov],[issm],[http://issm.jpl.nasa.gov]) #Initializing configure
    55AC_CONFIG_AUX_DIR([./aux-config])         #Put config files in aux-config
    66AC_CONFIG_MACRO_DIR([m4])                 #m4 macros are located in m4
  • issm/trunk/jenkins/jenkins.sh

    r22758 r22822  
    296296        cd $ISSM_DIR/test/NightlyRun
    297297        if [ "$OS" = "win" ]; then
    298                 $MATLAB_PATH/bin/matlab -nodisplay -nojvm -nosplash -nodesktop -r "addpath $ISSM_DIR_WIN/src/m/dev; devpath; addpath $ISSM_DIR_WIN/nightlylog/; matlab_run$i" -logfile $ISSM_DIR_WIN/nightlylog/matlab_log$i.log &
    299         else
    300                 $MATLAB_PATH/bin/matlab -nodisplay -nojvm -nosplash -nodesktop -r "addpath $ISSM_DIR/src/m/dev; devpath; addpath $ISSM_DIR/nightlylog/; matlab_run$i" -logfile $ISSM_DIR/nightlylog/matlab_log$i.log &
     298                $MATLAB_PATH/bin/matlab -nodisplay -nosplash -r "addpath $ISSM_DIR_WIN/src/m/dev; devpath; addpath $ISSM_DIR_WIN/nightlylog/; matlab_run$i" -logfile $ISSM_DIR_WIN/nightlylog/matlab_log$i.log &
     299        else
     300                $MATLAB_PATH/bin/matlab -nodisplay -nosplash -r "addpath $ISSM_DIR/src/m/dev; devpath; addpath $ISSM_DIR/nightlylog/; matlab_run$i" -logfile $ISSM_DIR/nightlylog/matlab_log$i.log &
    301301        fi
    302302done
     
    470470                                echo 'end' >> $FILE
    471471
    472                                 $MATLAB_PATH/bin/matlab -nodisplay -nojvm -nosplash -nodesktop -r "addpath $ISSM_DIR/src/m/dev; devpath; addpath $ISSM_DIR/nightlylog/; runme" -logfile $ISSM_DIR/nightlylog/$LOG_FILE
     472                                $MATLAB_PATH/bin/matlab -nodisplay -nosplash -r "addpath $ISSM_DIR/src/m/dev; devpath; addpath $ISSM_DIR/nightlylog/; runme" -logfile $ISSM_DIR/nightlylog/$LOG_FILE
    473473                                echo "starting: $(basename $dir)" >> $ISSM_DIR/nightlylog/matlab_log_examples.log
    474474                                cat $ISSM_DIR/nightlylog/$LOG_FILE >> $ISSM_DIR/nightlylog/matlab_log_examples.log
  • issm/trunk/src

  • issm/trunk/src/c/analyses/MasstransportAnalysis.cpp

    r22758 r22822  
    179179        }
    180180
    181         if(isoceancoupling){
    182                 iomodel->FetchDataToInput(elements,"md.mesh.lat",MeshLatEnum);
    183                 iomodel->FetchDataToInput(elements,"md.mesh.long",MeshLongEnum);
    184         }
    185181        if(!issmb){
    186182                iomodel->FetchDataToInput(elements,"md.smb.mass_balance",SmbMassBalanceEnum);
  • issm/trunk/src/c/classes/Elements/Element.cpp

    r22758 r22822  
    14001400                parameters->FindParam(&N,NULL,ControlInputSizeNEnum);
    14011401                parameters->FindParam(&M,NULL,ControlInputSizeMEnum);
    1402                 if(control_index>0) for(int n=0;n<control_index-1;n++) start+=N[n]*M[n];
     1402                if(control_index>0) {
     1403                        for(int n=0;n<control_index;n++){
     1404                                start+=N[n]*M[n];
     1405                        }
     1406                }
    14031407
    14041408                for(int n=0;n<N[control_index];n++){
     
    16621666            for(int t=0;t<N;t++) times[t] = vector[(M-1)*N+t];
    16631667                                /*Create the three transient inputs for the control input*/
    1664             TransientInput* values_input=new TransientInput(ControlInputValuesEnum,times,N);
     1668            TransientInput* values_input=new TransientInput(input_enum,times,N);
    16651669                                TransientInput* mins_input = new TransientInput(ControlInputMinsEnum,times,N);
    16661670                                TransientInput* maxs_input = new TransientInput(ControlInputMaxsEnum,times,N);
     
    16711675                                                values_min[i] = min_vector[N*(vertexids[i]-1)+t];
    16721676                                                values_max[i] = max_vector[N*(vertexids[i]-1)+t];
    1673                                          } 
     1677                                         }
    16741678                                        switch(this->ObjectEnum()){
    16751679                    case TriaEnum:
    1676                                                                         values_input->AddTimeInput(new TriaInput(ControlInputValuesEnum,values,P1Enum));
     1680                                                                        values_input->AddTimeInput(new TriaInput(input_enum,values,P1Enum));
    16771681                                                                        mins_input->AddTimeInput(new TriaInput(ControlInputMinsEnum,values_min,P1Enum));
    16781682                                                                        maxs_input->AddTimeInput(new TriaInput(ControlInputMaxsEnum,values_max,P1Enum));
    16791683                                                                break;
    16801684                    case PentaEnum:
    1681                                                                         values_input->AddTimeInput(new PentaInput(ControlInputValuesEnum,values,P1Enum));
     1685                                                                        values_input->AddTimeInput(new PentaInput(input_enum,values,P1Enum));
    16821686                                                                        mins_input->AddTimeInput(new PentaInput(ControlInputMinsEnum,values_min,P1Enum));
    16831687                                                                        maxs_input->AddTimeInput(new PentaInput(ControlInputMaxsEnum,values_max,P1Enum));
    16841688                                                                        break;
    16851689                    case TetraEnum:
    1686                                                                         values_input->AddTimeInput(new TetraInput(ControlInputValuesEnum,values,P1Enum));
     1690                                                                        values_input->AddTimeInput(new TetraInput(input_enum,values,P1Enum));
    16871691                                                                        mins_input->AddTimeInput(new TetraInput(ControlInputMinsEnum,values_min,P1Enum));
    16881692                                                                        maxs_input->AddTimeInput(new TetraInput(ControlInputMaxsEnum,values_max,P1Enum));
  • issm/trunk/src/c/classes/Elements/Tria.cpp

    r22758 r22822  
    20822082
    20832083        /*Control Inputs*/
    2084         if (control_analysis){
     2084        if (control_analysis && !ad_analysis){
    20852085                if(!ad_analysis)iomodel->FindConstant(&controls,NULL,"md.inversion.control_parameters");
    20862086                if(ad_analysis)iomodel->FindConstant(&controls,NULL,"md.autodiff.independent_object_names");
  • issm/trunk/src/c/classes/ExternalResults/GenericExternalResult.h

    r22758 r22822  
    179179
    180180} /*}}}*/
     181void  Transpose(void){ /*{{{*/
     182        _error_("not implemented yet");
     183} /*}}}*/
    181184char* GetResultName(void){ /*{{{*/
    182185                char* name = xNew<char>(strlen(this->result_name)+1);
     
    594597
    595598}  /*}}}*/
    596 
    597 /*Specific instantiations for IssmDouble*: */
     599template <> inline void GenericExternalResult<IssmPDouble*>::Transpose(void){/*{{{*/
     600
     601
     602        /*Perform transpose only if we have a matrix*/
     603        if(M>1 && N>1){
     604                IssmPDouble* temp=xNew<IssmPDouble>(M*N);
     605                for(int i=0;i<M;i++){
     606                        for(int j=0;j<N;j++){
     607                                temp[j*M+i] = value[i*N+j];
     608                        }
     609                }
     610                xDelete<IssmPDouble>(this->value);
     611                this->value = temp;
     612        }
     613
     614        /*Switch dimensions*/
     615        int temp2 = this->N;
     616        this->N = this->M;
     617        this->M = temp2;
     618
     619
     620
     621} /*}}}*/
     622
     623        /*Specific instantiations for IssmDouble*: */
    598624#if defined(_HAVE_ADOLC_) && !defined(_WRAPPERS_)  //We hook off this specific specialization when not running ADOLC, otherwise we get a redeclaration with the next specialization.
    599 template <> inline void GenericExternalResult<IssmDouble*>::WriteData(FILE* fid,bool io_gather){ /*{{{*/
    600 
    601         int     i;
    602         int     my_rank;
    603         int     type;
    604         int     rows,cols;
    605         char   *name    = NULL;
    606         IssmPDouble passiveDouble;
    607         IssmPDouble* passiveDoubles;
    608 
    609         /*recover my_rank:*/
    610         my_rank=IssmComm::GetRank();
    611 
    612         if(io_gather){
    613                 /*we are gathering the data on cpu 0, don't write on other cpus: */
    614                 if(my_rank) return;
    615         }
    616 
    617         /*First write enum: */
    618         int length=(strlen(this->result_name)+1)*sizeof(char);
    619         fwrite(&length,sizeof(int),1,fid);
    620         fwrite(this->result_name,length,1,fid);
    621 
    622         /*Now write time and step: */
    623         passiveDouble=reCast<IssmPDouble>(time);
    624         fwrite(&passiveDouble,sizeof(IssmPDouble),1,fid);
    625         fwrite(&step,sizeof(int),1,fid);
    626 
    627         /*writing a IssmDouble array, type is 3:*/
    628         type=3;
    629         fwrite(&type,sizeof(int),1,fid);
    630         rows=this->M;
    631         fwrite(&rows,sizeof(int),1,fid);
    632         cols=this->N;
    633         fwrite(&cols,sizeof(int),1,fid);
    634 
    635         passiveDoubles=xNew<IssmPDouble>(this->M*this->N);
    636         for (i=0;i<this->M*this->N;i++)passiveDoubles[i]=reCast<IssmPDouble>(value[i]);
    637         fwrite(passiveDoubles,cols*rows*sizeof(IssmPDouble),1,fid);
    638         xDelete<IssmPDouble>(passiveDoubles);
    639 
    640 }
    641 /*}}}*/
    642 #endif
    643 
    644 /*Specifics instantiations for Vector*/
    645 template <> inline GenericExternalResult<Vector<IssmPDouble>*>::GenericExternalResult(int in_id, int in_enum_type,Vector<IssmPDouble>* in_values, int in_M,int in_N,int in_step,IssmDouble in_time){/*{{{*/
    646         _error_("instanciation not correct");
    647 }
    648 /*}}}*/
    649 template <> inline GenericExternalResult<Vector<IssmPDouble>*>::GenericExternalResult(int in_id, int in_enum_type,Vector<IssmPDouble>* in_value,int in_step, IssmDouble in_time){ /*{{{*/
    650         id = in_id;
    651         M  = 0;
    652         N  = 0;
    653 
    654         /*Convert enum to name*/
    655         EnumToStringx(&this->result_name,in_enum_type);
    656 
    657         step = in_step;
    658         time = in_time;
    659 
    660         value = in_value;
    661 } /*}}}*/
    662 template <> inline GenericExternalResult<Vector<IssmPDouble>*>::~GenericExternalResult(){ /*{{{*/
    663         xDelete<char>(this->result_name);
    664         delete value;
    665 } /*}}}*/
    666 template <> inline void GenericExternalResult<Vector<IssmPDouble>*>::Echo(void){ /*{{{*/
    667 
    668         _printf_("GenericExternalResult<Vector<IssmPDouble>*>:\n");
    669         this->GenericEcho();
    670         this->value->Echo();
    671 
    672 } /*}}}*/
    673 template <> inline void GenericExternalResult<Vector<IssmPDouble>*>::DeepEcho(void){ /*{{{*/
    674 
    675         this->Echo();
    676 
    677 } /*}}}*/
    678 template <> inline Object* GenericExternalResult<Vector<IssmPDouble>*>::copy(void){ /*{{{*/
    679         return new GenericExternalResult<Vector<IssmPDouble>*>(this->id,StringToEnumx(this->result_name),this->value,this->step,this->time);
    680 } /*}}}*/
    681 #if defined(_HAVE_ADOLC_) && !defined(_WRAPPERS_)  //We hook off this specific specialization when not running ADOLC, otherwise we get a redeclaration with the next specialization.
    682 template <> inline void GenericExternalResult<Vector<IssmPDouble>*>::WriteData(FILE* fid,bool io_gather){ /*{{{*/
    683 
    684         char *name   = NULL;
    685         int   length,rows,cols=1;
    686 
    687         if(!io_gather){
    688                 _error_("not supported yet");
    689         }
    690 
    691         /*Serialize vector*/
    692         IssmPDouble* serialvalues = this->value->ToMPISerial();
    693         this->value->GetSize(&rows);
    694 
    695         if(IssmComm::GetRank()==0){
    696                 /*First write name: */
    697                 length=(strlen(this->result_name)+1)*sizeof(char);
     625        template <> inline void GenericExternalResult<IssmDouble*>::WriteData(FILE* fid,bool io_gather){ /*{{{*/
     626
     627                int     i;
     628                int     my_rank;
     629                int     type;
     630                int     rows,cols;
     631                char   *name    = NULL;
     632                IssmPDouble passiveDouble;
     633                IssmPDouble* passiveDoubles;
     634
     635                /*recover my_rank:*/
     636                my_rank=IssmComm::GetRank();
     637
     638                if(io_gather){
     639                        /*we are gathering the data on cpu 0, don't write on other cpus: */
     640                        if(my_rank) return;
     641                }
     642
     643                /*First write enum: */
     644                int length=(strlen(this->result_name)+1)*sizeof(char);
    698645                fwrite(&length,sizeof(int),1,fid);
    699646                fwrite(this->result_name,length,1,fid);
    700647
    701648                /*Now write time and step: */
    702                 IssmPDouble passiveDouble=reCast<IssmPDouble>(time);
     649                passiveDouble=reCast<IssmPDouble>(time);
    703650                fwrite(&passiveDouble,sizeof(IssmPDouble),1,fid);
    704651                fwrite(&step,sizeof(int),1,fid);
    705652
    706653                /*writing a IssmDouble array, type is 3:*/
    707                 int type=3;
     654                type=3;
    708655                fwrite(&type,sizeof(int),1,fid);
     656                rows=this->M;
    709657                fwrite(&rows,sizeof(int),1,fid);
     658                cols=this->N;
    710659                fwrite(&cols,sizeof(int),1,fid);
    711                 fwrite(serialvalues,cols*rows*sizeof(IssmPDouble),1,fid);
    712         }
    713 
    714         /*Clean up*/
    715         xDelete<IssmPDouble>(serialvalues);
    716 
    717 }
    718 /*}}}*/
     660
     661                passiveDoubles=xNew<IssmPDouble>(this->M*this->N);
     662                for (i=0;i<this->M*this->N;i++)passiveDoubles[i]=reCast<IssmPDouble>(value[i]);
     663                fwrite(passiveDoubles,cols*rows*sizeof(IssmPDouble),1,fid);
     664                xDelete<IssmPDouble>(passiveDoubles);
     665
     666        }
     667        /*}}}*/
    719668#endif
    720 template <> inline int GenericExternalResult<Vector<IssmPDouble>*>::ObjectEnum(void){ /*{{{*/
    721         return NoneEnum;
    722         /*???? FIXME*/
    723 } /*}}}*/
    724 
    725 /*Specifics instantiations for Vector<IssmDouble>*/
    726 template <> inline void GenericExternalResult<Vector<IssmDouble>*>::WriteData(FILE* fid,bool io_gather){ /*{{{*/
    727 
    728         int i;
    729         char *name   = NULL;
    730         int   length,rows,cols=1;
    731         IssmDouble*  serialvalues = NULL;
    732         IssmPDouble* pserialvalues = NULL;
    733 
    734         if(!io_gather){
    735                 _error_("not supported yet");
    736         }
    737 
    738         /*Serialize vector*/
    739         serialvalues = this->value->ToMPISerial();
    740         this->value->GetSize(&rows);
    741        
    742         pserialvalues=xNew<IssmPDouble>(rows);
    743         for(i=0;i<rows;i++)pserialvalues[i]=reCast<IssmPDouble>(serialvalues[i]);
    744 
    745         if(IssmComm::GetRank()==0){
    746                 /*First write name: */
    747                 length=(strlen(this->result_name)+1)*sizeof(char);
    748                 fwrite(&length,sizeof(int),1,fid);
    749                 fwrite(this->result_name,length,1,fid);
    750 
    751                 /*Now write time and step: */
    752                 IssmPDouble passiveDouble=reCast<IssmPDouble>(time);
    753                 fwrite(&passiveDouble,sizeof(IssmPDouble),1,fid);
    754                 fwrite(&step,sizeof(int),1,fid);
    755 
    756                 /*writing a IssmDouble array, type is 3:*/
    757                 int type=3;
    758                 fwrite(&type,sizeof(int),1,fid);
    759                 fwrite(&rows,sizeof(int),1,fid);
    760                 fwrite(&cols,sizeof(int),1,fid);
    761                 fwrite(pserialvalues,cols*rows*sizeof(IssmPDouble),1,fid);
    762         }
    763 
    764         /*Clean up*/
    765         xDelete<IssmPDouble>(pserialvalues);
    766         xDelete<IssmDouble>(serialvalues);
    767 
    768 }
    769 /*}}}*/
    770 template <> inline void GenericExternalResult<Vector<IssmDouble>*>::Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){/*{{{*/
    771 
    772         _error_("GenericExternalResult instantiated for type Vector<IssmDouble>* called " << result_name << " not implemented yet");
    773 
    774 }  /*}}}*/
     669
     670        /*Specifics instantiations for Vector*/
     671        template <> inline GenericExternalResult<Vector<IssmPDouble>*>::GenericExternalResult(int in_id, int in_enum_type,Vector<IssmPDouble>* in_values, int in_M,int in_N,int in_step,IssmDouble in_time){/*{{{*/
     672                _error_("instanciation not correct");
     673        }
     674        /*}}}*/
     675        template <> inline GenericExternalResult<Vector<IssmPDouble>*>::GenericExternalResult(int in_id, int in_enum_type,Vector<IssmPDouble>* in_value,int in_step, IssmDouble in_time){ /*{{{*/
     676                id = in_id;
     677                M  = 0;
     678                N  = 0;
     679
     680                /*Convert enum to name*/
     681                EnumToStringx(&this->result_name,in_enum_type);
     682
     683                step = in_step;
     684                time = in_time;
     685
     686                value = in_value;
     687        } /*}}}*/
     688        template <> inline GenericExternalResult<Vector<IssmPDouble>*>::~GenericExternalResult(){ /*{{{*/
     689                xDelete<char>(this->result_name);
     690                delete value;
     691        } /*}}}*/
     692        template <> inline void GenericExternalResult<Vector<IssmPDouble>*>::Echo(void){ /*{{{*/
     693
     694                _printf_("GenericExternalResult<Vector<IssmPDouble>*>:\n");
     695                this->GenericEcho();
     696                this->value->Echo();
     697
     698        } /*}}}*/
     699        template <> inline void GenericExternalResult<Vector<IssmPDouble>*>::DeepEcho(void){ /*{{{*/
     700
     701                this->Echo();
     702
     703        } /*}}}*/
     704        template <> inline Object* GenericExternalResult<Vector<IssmPDouble>*>::copy(void){ /*{{{*/
     705                return new GenericExternalResult<Vector<IssmPDouble>*>(this->id,StringToEnumx(this->result_name),this->value,this->step,this->time);
     706        } /*}}}*/
     707#if defined(_HAVE_ADOLC_) && !defined(_WRAPPERS_)  //We hook off this specific specialization when not running ADOLC, otherwise we get a redeclaration with the next specialization.
     708        template <> inline void GenericExternalResult<Vector<IssmPDouble>*>::WriteData(FILE* fid,bool io_gather){ /*{{{*/
     709
     710                char *name   = NULL;
     711                int   length,rows,cols=1;
     712
     713                if(!io_gather){
     714                        _error_("not supported yet");
     715                }
     716
     717                /*Serialize vector*/
     718                IssmPDouble* serialvalues = this->value->ToMPISerial();
     719                this->value->GetSize(&rows);
     720
     721                if(IssmComm::GetRank()==0){
     722                        /*First write name: */
     723                        length=(strlen(this->result_name)+1)*sizeof(char);
     724                        fwrite(&length,sizeof(int),1,fid);
     725                        fwrite(this->result_name,length,1,fid);
     726
     727                        /*Now write time and step: */
     728                        IssmPDouble passiveDouble=reCast<IssmPDouble>(time);
     729                        fwrite(&passiveDouble,sizeof(IssmPDouble),1,fid);
     730                        fwrite(&step,sizeof(int),1,fid);
     731
     732                        /*writing a IssmDouble array, type is 3:*/
     733                        int type=3;
     734                        fwrite(&type,sizeof(int),1,fid);
     735                        fwrite(&rows,sizeof(int),1,fid);
     736                        fwrite(&cols,sizeof(int),1,fid);
     737                        fwrite(serialvalues,cols*rows*sizeof(IssmPDouble),1,fid);
     738                }
     739
     740                /*Clean up*/
     741                xDelete<IssmPDouble>(serialvalues);
     742
     743        }
     744        /*}}}*/
     745#endif
     746        template <> inline int GenericExternalResult<Vector<IssmPDouble>*>::ObjectEnum(void){ /*{{{*/
     747                return NoneEnum;
     748                /*???? FIXME*/
     749        } /*}}}*/
     750
     751        /*Specifics instantiations for Vector<IssmDouble>*/
     752        template <> inline void GenericExternalResult<Vector<IssmDouble>*>::WriteData(FILE* fid,bool io_gather){ /*{{{*/
     753
     754                int i;
     755                char *name   = NULL;
     756                int   length,rows,cols=1;
     757                IssmDouble*  serialvalues = NULL;
     758                IssmPDouble* pserialvalues = NULL;
     759
     760                if(!io_gather){
     761                        _error_("not supported yet");
     762                }
     763
     764                /*Serialize vector*/
     765                serialvalues = this->value->ToMPISerial();
     766                this->value->GetSize(&rows);
     767
     768                pserialvalues=xNew<IssmPDouble>(rows);
     769                for(i=0;i<rows;i++)pserialvalues[i]=reCast<IssmPDouble>(serialvalues[i]);
     770
     771                if(IssmComm::GetRank()==0){
     772                        /*First write name: */
     773                        length=(strlen(this->result_name)+1)*sizeof(char);
     774                        fwrite(&length,sizeof(int),1,fid);
     775                        fwrite(this->result_name,length,1,fid);
     776
     777                        /*Now write time and step: */
     778                        IssmPDouble passiveDouble=reCast<IssmPDouble>(time);
     779                        fwrite(&passiveDouble,sizeof(IssmPDouble),1,fid);
     780                        fwrite(&step,sizeof(int),1,fid);
     781
     782                        /*writing a IssmDouble array, type is 3:*/
     783                        int type=3;
     784                        fwrite(&type,sizeof(int),1,fid);
     785                        fwrite(&rows,sizeof(int),1,fid);
     786                        fwrite(&cols,sizeof(int),1,fid);
     787                        fwrite(pserialvalues,cols*rows*sizeof(IssmPDouble),1,fid);
     788                }
     789
     790                /*Clean up*/
     791                xDelete<IssmPDouble>(pserialvalues);
     792                xDelete<IssmDouble>(serialvalues);
     793
     794        }
     795        /*}}}*/
     796        template <> inline void GenericExternalResult<Vector<IssmDouble>*>::Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){/*{{{*/
     797
     798                _error_("GenericExternalResult instantiated for type Vector<IssmDouble>* called " << result_name << " not implemented yet");
     799
     800        }  /*}}}*/
    775801
    776802#endif  /* _EXTERNAL_RESULTOBJECT_H */
  • issm/trunk/src/c/classes/Inputs/ControlInput.cpp

    r22758 r22822  
    330330        TransientInput* transient_input = xDynamicCast<TransientInput*>(input);
    331331        IssmDouble time = transient_input->GetTimeByOffset(timeoffset);
    332         TransientInput* new_trans_input = new TransientInput(ControlInputValuesEnum);
     332        TransientInput* new_trans_input = new TransientInput(this->enum_type);
    333333        for(int i=0;i<transient_input->numtimesteps;i++){
    334334                if(transient_input->timesteps[i]==time) new_trans_input->AddTimeInput(xDynamicCast<TriaInput*>(in_input),time);
  • issm/trunk/src/c/classes/Vertex.cpp

    r21341 r22822  
    3232        this->domaintype     = iomodel->domaintype;
    3333
     34        if(iomodel->Data("md.mesh.lat") && iomodel->Data("md.mesh.long")){
     35                this->latitute     = iomodel->Data("md.mesh.lat")[i];
     36                this->longitude    = iomodel->Data("md.mesh.long")[i];
     37        }
     38
    3439        switch(iomodel->domaintype){
    3540                case Domain3DEnum:
     
    3843                        break;
    3944                case Domain3DsurfaceEnum:
     45                        _assert_(iomodel->Data("md.mesh.lat") && iomodel->Data("md.mesh.long") && iomodel->Data("md.mesh.r"));
    4046                        this->latitute     = iomodel->Data("md.mesh.lat")[i];
    4147                        this->longitude    = iomodel->Data("md.mesh.long")[i];
     
    195201/*}}}*/
    196202int        Vertex::Sid(void){ return sid; }/*{{{*/
    197 /*}}}*/
    198 void       Vertex::ToXYZ(Matrix<IssmDouble>* matrix){/*{{{*/
    199 
    200         IssmDouble xyz[3];
    201         int        indices[3];
    202 
    203         if (this->clone==true) return;
    204 
    205         xyz[0]=x;
    206         xyz[1]=y;
    207         xyz[2]=z;
    208         indices[0]=0;
    209         indices[1]=1;
    210         indices[2]=2;
    211 
    212         matrix->SetValues(1,&sid,3,&indices[0],&xyz[0],INS_VAL);
    213 }
    214203/*}}}*/
    215204void       Vertex::UpdateClonePids(int* alltruepids){/*{{{*/
  • issm/trunk/src/c/classes/Vertex.h

    r21341 r22822  
    6262                void       ShowTruePids(int* borderpids);
    6363                int        Sid(void);
    64                 void       ToXYZ(Matrix<IssmDouble>* matrix);
    6564                void       UpdateClonePids(int* allborderpids);
    6665                void       UpdatePosition(Vector<IssmDouble>* vx,Vector<IssmDouble>* vy,Vector<IssmDouble>* vz,Parameters* parameters,IssmDouble* thickness,IssmDouble* bed);
  • issm/trunk/src/c/classes/Vertices.cpp

    r22758 r22822  
    180180}
    181181/*}}}*/
    182 IssmDouble* Vertices::ToXYZ(void){/*{{{*/
    183 
    184         /*intermediary: */
    185         int i;
    186         int my_rank;
    187         int num_vertices;
     182void Vertices::LatLonList(IssmDouble** plat,IssmDouble** plon){/*{{{*/
    188183
    189184        /*output: */
    190         Matrix<IssmDouble>* xyz = NULL;
    191185        IssmDouble* xyz_serial=NULL;
    192186
    193187        /*recover my_rank:*/
    194         my_rank=IssmComm::GetRank();
     188        int my_rank=IssmComm::GetRank();
    195189
    196190        /*First, figure out number of vertices: */
    197         num_vertices=this->NumberOfVertices();
    198 
    199         /*Now, allocate matrix to hold all the vertices x,y and z values: */
    200         xyz= new Matrix<IssmDouble>(num_vertices,3);
     191        int num_vertices=this->NumberOfVertices();
     192
     193        /*Now, allocate vectors*/
     194        Vector<IssmDouble>* lat = new Vector<IssmDouble>(num_vertices);
     195        Vector<IssmDouble>* lon = new Vector<IssmDouble>(num_vertices);
    201196
    202197        /*Go through vertices, and for each vertex, object, report it cpu: */
    203         for(i=0;i<this->Size();i++){
    204 
    205                 /*let vertex fill matrix: */
    206                 Vertex* vertex=xDynamicCast<Vertex*>(this->GetObjectByOffset(i));
    207                 vertex->ToXYZ(xyz);
     198        for(int i=0;i<this->Size();i++){
     199                Vertex* vertex=xDynamicCast<Vertex*>(this->GetObjectByOffset(i));
     200                lat->SetValue(vertex->sid,vertex->GetLatitude() ,INS_VAL);
     201                lon->SetValue(vertex->sid,vertex->GetLongitude(),INS_VAL);
    208202        }
    209203
    210204        /*Assemble:*/
    211         xyz->Assemble();
     205        lat->Assemble();
     206        lon->Assemble();
    212207
    213208        /*gather on cpu 0: */
    214         xyz_serial=xyz->ToSerial();
     209        IssmDouble* lat_serial=lat->ToMPISerial();
     210        IssmDouble* lon_serial=lon->ToMPISerial();
    215211
    216212        /*free ressources: */
    217         delete xyz;
    218         if(my_rank!=0)delete xyz_serial;
    219 
    220         /*return matrix: */
    221         return xyz_serial;
    222 }
    223 /*}}}*/
     213        *plat = lat_serial;
     214        *plon = lon_serial;
     215        delete lat;
     216        delete lon;
     217}
     218/*}}}*/
  • issm/trunk/src/c/classes/Vertices.h

    r15396 r22822  
    2525                int   NumberOfVertices(void);
    2626                void  Ranks(int* ranks);
    27                 IssmDouble* ToXYZ(void);
     27                void LatLonList(IssmDouble** lat,IssmDouble** lon);
    2828};
    2929
  • issm/trunk/src/c/cores/controladm1qn3_core.cpp

    r22758 r22822  
    7171        int* N = NULL;
    7272        int N_add = 0;
     73        int* control_enum = NULL;
    7374
    7475        if (solution_type == TransientSolutionEnum){
     
    8889        femmodel->parameters->FindParam(&scaling_factors,NULL,InversionControlScalingFactorsEnum);
    8990        femmodel->parameters->FindParam(&N,NULL,ControlInputSizeNEnum);
     91        femmodel->parameters->FindParam(&control_enum,NULL,InversionControlParametersEnum);
    9092        numberofvertices=femmodel->vertices->NumberOfVertices();
    9193
     
    104106                        if(X[index]<XL[index]) X[index]=XL[index];
    105107                }
     108                N_add+=N[c];
    106109        }
    107110
     
    318321                        Gnorm += G[index]*G[index];
    319322                }
     323                N_add+=N[c];
    320324        }
    321325        Gnorm = sqrt(Gnorm);
     
    348352        int offset = 0;
    349353        int N_add;
     354        int* control_enum;
    350355
    351356        /*Recover some parameters*/
     
    358363        femmodel->parameters->FindParamAndMakePassive(&gttol,InversionGttolEnum);
    359364        femmodel->parameters->FindParam(&scaling_factors,NULL,InversionControlScalingFactorsEnum);
     365        femmodel->parameters->FindParam(&control_enum,NULL,InversionControlParametersEnum);
    360366        femmodel->parameters->SetParam(false,SaveResultsEnum);
    361367        femmodel->parameters->FindParam(&N,NULL,ControlInputSizeNEnum);
     
    478484                int step = 1;
    479485                femmodel->parameters->SetParam(step,StepEnum);
    480                 femmodel->OutputControlsx(&femmodel->results);
    481486                femmodel->results->AddObject(new GenericExternalResult<IssmPDouble*>(femmodel->results->Size()+1,JEnum,mystruct.Jlist,(*mystruct.i),mystruct.N,1,0));
    482                 femmodel->results->AddObject(new GenericExternalResult<IssmPDouble*>(femmodel->results->Size()+1,Gradient1Enum,G,numberofvertices,intn/numberofvertices,1,0));
    483                 femmodel->results->AddObject(new GenericExternalResult<IssmPDouble*>(femmodel->results->Size()+1,InversionControlParametersEnum,X,numberofvertices,intn/numberofvertices,1,0));
     487
     488                int offset = 0;
     489                for(int i=0;i<num_controls;i++){
     490
     491                        /*Disect results*/
     492                        GenericExternalResult<IssmPDouble*>* G_output = new GenericExternalResult<IssmPDouble*>(femmodel->results->Size()+1,Gradient1Enum+i,&G[offset],N[i],numberofvertices,1,0.);
     493                        GenericExternalResult<IssmPDouble*>* X_output = new GenericExternalResult<IssmPDouble*>(femmodel->results->Size()+1,control_enum[i],&X[offset],N[i],numberofvertices,1,0.);
     494
     495                        /*transpose for consistency with MATLAB's formating*/
     496                        G_output->Transpose();
     497                        X_output->Transpose();
     498
     499                        /*Add to results*/
     500                        femmodel->results->AddObject(G_output);
     501                        femmodel->results->AddObject(X_output);
     502
     503                        offset += N[i]*numberofvertices;
     504                }
    484505        }
    485506        else{
  • issm/trunk/src/c/cores/sealevelrise_core.cpp

    r22758 r22822  
    1515        Vector<IssmDouble> *Sg_absolute  = NULL;
    1616        Vector<IssmDouble> *Sg_eustatic  = NULL;
     17        Vector<IssmDouble> *slr_initial  = NULL;
    1718        Vector<IssmDouble> *steric_rate_g  = NULL;
    1819        Vector<IssmDouble> *U_radial  = NULL;
     
    8081        if(isslr){
    8182                Sg_eustatic=sealevelrise_core_eustatic(femmodel); //generalized eustatic (Farrel and Clark, Eq 4, 1st, 3rd and 4rd terms on the RHS.
     83       
     84                /* The following is for reproducing Farrell&Clark1976 Fig. 1, and aimed for the workshop!
     85                 * md.slr.sealevel is considered as the "initial sea-level" where 1 m slr is distributed uniformly over the ocean
     86                 * similar strategy may work for computin SAL due to "internal mass distribution" associated with ocean dynamics
     87                 * if it breaks the code, it will be reverted. And, we will strategize how we want to accomodate */
     88                GetVectorFromInputsx(&slr_initial,femmodel,SealevelEnum,VertexSIdEnum);
     89                Sg_eustatic->AXPY(slr_initial,1);
    8290
    8391                Sg=sealevelrise_core_noneustatic(femmodel,Sg_eustatic); //ocean loading tems  (2nd and 5th terms on the RHS of Farrel and Clark)
  • issm/trunk/src/c/cores/transient_core.cpp

    r22758 r22822  
    2121        /*parameters: */
    2222        IssmDouble finaltime,dt,yts,starttime;
    23         bool       isstressbalance,ismasstransport,issmb,isFS,isthermal,isgroundingline,isgia,isslr,iscoupler,ismovingfront,isdamageevolution,ishydrology,isoceancoupling,iscontrol,isautodiff;
     23        bool       isstressbalance,ismasstransport,issmb,isFS,isthermal,isgroundingline,isgia,isesa,isslr,iscoupler,ismovingfront,isdamageevolution,ishydrology,isoceancoupling,iscontrol,isautodiff;
    2424        bool       save_results,dakota_analysis;
    2525        int        timestepping;
     
    5454        femmodel->parameters->FindParam(&isthermal,TransientIsthermalEnum);
    5555        femmodel->parameters->FindParam(&isgia,TransientIsgiaEnum);
     56        femmodel->parameters->FindParam(&isesa,TransientIsesaEnum);
    5657        femmodel->parameters->FindParam(&isslr,TransientIsslrEnum);
    5758        femmodel->parameters->FindParam(&iscoupler,TransientIscouplerEnum);
     
    9394                tomitgcmcomm=parcom->GetParameterValue();
    9495                if(my_rank==0){
     96                        /*Recover fixed parameters and store them*/
    9597                        ISSM_MPI_Send(&coupling_time,1,ISSM_MPI_DOUBLE,0,10001000,tomitgcmcomm);
    9698                        ISSM_MPI_Recv(&oceangridnxsize,1,ISSM_MPI_INT,0,10001003,tomitgcmcomm,&status);
     
    102104                        oceangridy = xNew<IssmDouble>(oceangridnxsize*oceangridnysize);
    103105                        ISSM_MPI_Recv(oceangridy,oceangridnxsize*oceangridnysize,ISSM_MPI_DOUBLE,0,10001006,tomitgcmcomm,&status);
    104 
     106                        femmodel->parameters->SetParam(oceangridx,oceangridnxsize*oceangridnysize,OceanGridXEnum);
     107                        femmodel->parameters->SetParam(oceangridy,oceangridnxsize*oceangridnysize,OceanGridYEnum);
     108
     109                        /*Exchange varying parameters for the initialization*/
    105110                        ISSM_MPI_Send(&time,1,ISSM_MPI_DOUBLE,0,10001001,tomitgcmcomm);
    106111                        ISSM_MPI_Recv(&oceantime,1,ISSM_MPI_DOUBLE,0,10001002,tomitgcmcomm,&status);
     
    162167                femmodel->parameters->SetParam(save_results,SaveResultsEnum);
    163168
    164                 if(isoceancoupling){ {{{
     169                if(isoceancoupling){ /*{{{*/
     170                        #ifndef _HAVE_ADOLC_
    165171                        if(VerboseSolution()) _printf0_("   ocean coupling: exchanging information\n");
    166172                        int my_rank;
    167                         int oceangridnxsize,oceangridnysize;
    168                         IssmDouble *oceanmelt;
    169                         IssmDouble *icebase;
    170                         IssmDouble oceantime;
    171173                        ISSM_MPI_Comm tomitgcmcomm;
    172174                        ISSM_MPI_Status status;
     
    177179                        tomitgcmcomm=parcom->GetParameterValue();
    178180                        if(my_rank==0){
     181                                int ngrids_ocean, nels_ocean;
     182                                IssmDouble oceantime;
     183                                IssmDouble rho_ice;
     184                                IssmDouble *oceanmelt;
     185                                IssmDouble *base_oceangrid;
     186                                IssmDouble *oceangridx;
     187                                IssmDouble *oceangridy;
     188                                IssmDouble* x_ice = NULL;
     189                                IssmDouble* y_ice = NULL;
     190                                IssmDouble* lat_ice = NULL;
     191                                IssmDouble* lon_ice = NULL;
     192                                IssmDouble* z_ice = NULL;
     193                                IssmDouble* icebase= NULL;
     194                                IssmDouble* melt_mesh = NULL;
     195                                int*        index_ice= NULL;
     196                                int*        index_ocean = NULL;
     197                                int         ngrids_ice=femmodel->vertices->NumberOfVertices();
     198                                int         nels_ice=femmodel->elements->NumberOfElements();
     199                               
     200                                /*Recover mesh and inputs needed*/
     201                                femmodel->parameters->FindParam(&rho_ice,MaterialsRhoIceEnum);
     202                                femmodel->GetMesh(femmodel->vertices,femmodel->elements,&x_ice,&y_ice,&z_ice,&index_ice);
     203                                femmodel->parameters->FindParam(&oceangridx,&ngrids_ocean,OceanGridXEnum);
     204                                femmodel->parameters->FindParam(&oceangridy,&ngrids_ocean,OceanGridYEnum);
     205                                BamgTriangulatex(&index_ocean,&nels_ocean,oceangridx,oceangridy,ngrids_ocean);
     206
     207                                femmodel->vertices->LatLonList(&lat_ice,&lon_ice);
     208
     209                                /*Interpolate ice base onto ocean grid*/
     210                                GetVectorFromInputsx(&icebase,femmodel,BaseEnum,VertexSIdEnum);
     211                                InterpFromMeshToMesh2dx(&base_oceangrid,index_ice,lon_ice,lat_ice,ngrids_ice,nels_ice,
     212                                                        icebase,ngrids_ice,1,
     213                                                        oceangridx,oceangridy,ngrids_ocean,NULL);   
     214                               
     215                                /*Send and receive data*/
    179216                                ISSM_MPI_Send(&time,1,ISSM_MPI_DOUBLE,0,10001001,tomitgcmcomm);
     217                                oceanmelt = xNew<IssmDouble>(ngrids_ocean);
    180218                                ISSM_MPI_Recv(&oceantime,1,ISSM_MPI_DOUBLE,0,10001002,tomitgcmcomm,&status);
    181219                                if((oceantime - time > 0.1*yts) & (oceantime - time < -0.1*yts)) _error_("Ocean and ice time are starting to diverge");
    182                                 femmodel->parameters->FindParam(&oceangridnxsize,OceanGridNxEnum);
    183                                 femmodel->parameters->FindParam(&oceangridnysize,OceanGridNyEnum);
    184                                 oceanmelt = xNew<IssmDouble>(oceangridnxsize*oceangridnysize);
    185                                 ISSM_MPI_Recv(oceanmelt,oceangridnxsize*oceangridnysize,ISSM_MPI_DOUBLE,0,10001007,tomitgcmcomm,&status);
    186                                 icebase = xNew<IssmDouble>(oceangridnxsize*oceangridnysize);
    187                                 for(int i=0;i<oceangridnxsize;i++){
    188                                         for(int j=0;j<oceangridnysize;j++){
    189                                                 icebase[i*oceangridnysize+j]=9999.;
    190                                         }
    191                                 }
    192                                 ISSM_MPI_Send(icebase,oceangridnxsize*oceangridnysize,ISSM_MPI_DOUBLE,0,10001008,tomitgcmcomm);
     220                                ISSM_MPI_Recv(oceanmelt,ngrids_ocean,ISSM_MPI_DOUBLE,0,10001007,tomitgcmcomm,&status);
     221                                for(int i=0;i<ngrids_ice;i++) base_oceangrid[i]=0;
     222                                ISSM_MPI_Send(base_oceangrid,ngrids_ocean,ISSM_MPI_DOUBLE,0,10001008,tomitgcmcomm);
     223
     224                                /*Interp melt onto ice grid*/
     225                                InterpFromMeshToMesh2dx(&melt_mesh,index_ocean,oceangridx,oceangridy,ngrids_ocean,nels_ocean,
     226                                                        oceanmelt,ngrids_ocean,1,
     227                                                        lon_ice,lat_ice,ngrids_ice,NULL);   
     228
     229                                for(int i=0;i<ngrids_ice;i++) melt_mesh[i]=-melt_mesh[i]/rho_ice; //heat flux provided by ocean is in kg/m^2/s
     230                                InputUpdateFromVectorx(femmodel,melt_mesh,BasalforcingsFloatingiceMeltingRateEnum,VertexSIdEnum);
     231
     232                                /*Delete*/
     233                                xDelete<int>(index_ice);
     234                                xDelete<int>(index_ocean);
     235                                xDelete<IssmDouble>(lat_ice);
     236                                xDelete<IssmDouble>(lon_ice);
     237                                xDelete<IssmDouble>(x_ice);
     238                                xDelete<IssmDouble>(y_ice);
     239                                xDelete<IssmDouble>(z_ice);
     240                                xDelete<IssmDouble>(melt_mesh);
     241                                xDelete<IssmDouble>(oceangridx);
     242                                xDelete<IssmDouble>(oceangridy);
    193243                                xDelete<IssmDouble>(oceanmelt);
    194244                                xDelete<IssmDouble>(icebase);
    195                         }
    196                 }
    197                 }}}
     245                                xDelete<IssmDouble>(base_oceangrid);
     246                        }
     247                        #else
     248                        _error_("not supported");
     249                        #endif
     250                }
     251                /*}}}*/
    198252
    199253                if(isthermal && domaintype==Domain3DEnum){
     
    258312                }
    259313
     314                /*esa: */
     315                if(isesa) esa_core(femmodel);
     316               
    260317                /*Sea level rise: */
    261318                if(isslr || iscoupler) sealevelrise_core(femmodel);
  • issm/trunk/src/c/modules/ModelProcessorx/CreateElementsVerticesAndMaterials.cpp

    r22758 r22822  
    1616        bool dakota_analysis;
    1717        bool adolc_analysis;
     18        bool isoceancoupling;
    1819        int nnat,dummy;
    1920        int* nature=NULL;
     
    2425        iomodel->FindConstant(&materials_type,"md.materials.type");
    2526        iomodel->FindConstant(&adolc_analysis,"md.autodiff.isautodiff");
     27        iomodel->FindConstant(&isoceancoupling,"md.transient.isoceancoupling");
    2628
    2729        /*Did we already create the elements? : */
     
    232234        if (iomodel->domaintype == Domain3DsurfaceEnum) iomodel->FetchData(3,"md.mesh.lat","md.mesh.long","md.mesh.r");
    233235        else iomodel->FetchDataToInput(elements,"md.mesh.scale_factor",MeshScaleFactorEnum,1.);
     236        if (isoceancoupling) iomodel->FetchData(2,"md.mesh.lat","md.mesh.long");
    234237       
    235238        CreateNumberNodeToElementConnectivity(iomodel,solution_type);
     
    242245        iomodel->DeleteData(6,"md.mesh.x","md.mesh.y","md.mesh.z","md.geometry.base","md.geometry.thickness","md.mask.ice_levelset");
    243246        if (iomodel->domaintype == Domain3DsurfaceEnum) iomodel->DeleteData(3,"md.mesh.lat","md.mesh.long","md.mesh.r");
     247        if (isoceancoupling) iomodel->DeleteData(2,"md.mesh.lat","md.mesh.long");
    244248}
  • issm/trunk/src/c/modules/ModelProcessorx/CreateOutputDefinitions.cpp

    r22758 r22822  
    341341                                iomodel->FetchMultipleData(&cfsurfacelogvel_vyobs_string,&num_cfsurfacelogvels,                                          "md.cfsurfacelogvel.vyobs_string");                    iomodel->FetchMultipleData(&cfsurfacelogvel_weights,&cfsurfacelogvel_weights_M,&cfsurfacelogvel_weights_N,&num_cfsurfacelogvels,             "md.cfsurfacelogvel.weights");
    342342                                iomodel->FetchMultipleData(&cfsurfacelogvel_weightstring,&num_cfsurfacelogvels,                                              "md.cfsurfacelogvel.weights_string");
    343                                 _printf_("Num with weight string: "<<num_cfsurfacelogvels<<"\n");
    344343                                iomodel->FetchMultipleData(&cfsurfacelogvel_datatime,&num_cfsurfacelogvels,                                                                                                                                      "md.cfsurfacelogvel.datatime");
    345344
  • issm/trunk/src/c/modules/ModelProcessorx/CreateParameters.cpp

    r22758 r22822  
    291291
    292292        iomodel->FindConstant(&materialtype,"md.materials.type");
     293        if(materialtype==MatdamageiceEnum || materialtype==MaticeEnum || materialtype==MatenhancediceEnum){
     294                parameters->AddObject(iomodel->CopyConstantObject("md.materials.rho_ice",MaterialsRhoIceEnum));
     295        }
    293296        if(materialtype==MatdamageiceEnum){
    294297                iomodel->FindConstant(&requestedoutputs,&numoutputs,"md.damage.requested_outputs");
  • issm/trunk/src/c/shared/Enum/EnumDefinitions.h

    r22758 r22822  
    200200        MasstransportRequestedOutputsEnum,
    201201        MasstransportStabilizationEnum,
     202        MaterialsRhoIceEnum,
    202203        MeltingOffsetEnum,
    203204        MeshAverageVertexConnectivityEnum,
     
    834835        MaterialsRheologyLawEnum,
    835836        MaterialsRhoFreshwaterEnum,
    836         MaterialsRhoIceEnum,
    837837        MaterialsRhoSeawaterEnum,
    838838        MaterialsTemperateiceconductivityEnum,
     
    855855        MeltingAnalysisEnum,
    856856        MeshElementsEnum,
    857         MeshLatEnum,
    858         MeshLongEnum,
    859857        MeshXEnum,
    860858        MeshYEnum,
  • issm/trunk/src/c/shared/Enum/EnumToStringx.cpp

    r22758 r22822  
    208208                case MasstransportRequestedOutputsEnum : return "MasstransportRequestedOutputs";
    209209                case MasstransportStabilizationEnum : return "MasstransportStabilization";
     210                case MaterialsRhoIceEnum : return "MaterialsRhoIce";
    210211                case MeltingOffsetEnum : return "MeltingOffset";
    211212                case MeshAverageVertexConnectivityEnum : return "MeshAverageVertexConnectivity";
     
    838839                case MaterialsRheologyLawEnum : return "MaterialsRheologyLaw";
    839840                case MaterialsRhoFreshwaterEnum : return "MaterialsRhoFreshwater";
    840                 case MaterialsRhoIceEnum : return "MaterialsRhoIce";
    841841                case MaterialsRhoSeawaterEnum : return "MaterialsRhoSeawater";
    842842                case MaterialsTemperateiceconductivityEnum : return "MaterialsTemperateiceconductivity";
     
    859859                case MeltingAnalysisEnum : return "MeltingAnalysis";
    860860                case MeshElementsEnum : return "MeshElements";
    861                 case MeshLatEnum : return "MeshLat";
    862                 case MeshLongEnum : return "MeshLong";
    863861                case MeshXEnum : return "MeshX";
    864862                case MeshYEnum : return "MeshY";
  • issm/trunk/src/c/shared/Enum/StringToEnumx.cpp

    r22758 r22822  
    211211              else if (strcmp(name,"MasstransportRequestedOutputs")==0) return MasstransportRequestedOutputsEnum;
    212212              else if (strcmp(name,"MasstransportStabilization")==0) return MasstransportStabilizationEnum;
     213              else if (strcmp(name,"MaterialsRhoIce")==0) return MaterialsRhoIceEnum;
    213214              else if (strcmp(name,"MeltingOffset")==0) return MeltingOffsetEnum;
    214215              else if (strcmp(name,"MeshAverageVertexConnectivity")==0) return MeshAverageVertexConnectivityEnum;
     
    259260              else if (strcmp(name,"SealevelriseTidalLoveK")==0) return SealevelriseTidalLoveKEnum;
    260261              else if (strcmp(name,"SealevelriseTransitions")==0) return SealevelriseTransitionsEnum;
    261               else if (strcmp(name,"SealevelriseUElastic")==0) return SealevelriseUElasticEnum;
    262262         else stage=3;
    263263   }
    264264   if(stage==3){
    265               if (strcmp(name,"SettingsIoGather")==0) return SettingsIoGatherEnum;
     265              if (strcmp(name,"SealevelriseUElastic")==0) return SealevelriseUElasticEnum;
     266              else if (strcmp(name,"SettingsIoGather")==0) return SettingsIoGatherEnum;
    266267              else if (strcmp(name,"SettingsOutputFrequency")==0) return SettingsOutputFrequencyEnum;
    267268              else if (strcmp(name,"SettingsRecordingFrequency")==0) return SettingsRecordingFrequencyEnum;
     
    382383              else if (strcmp(name,"BasalforcingsPicoBasinId")==0) return BasalforcingsPicoBasinIdEnum;
    383384              else if (strcmp(name,"BasalforcingsPicoBoxId")==0) return BasalforcingsPicoBoxIdEnum;
    384               else if (strcmp(name,"BasalforcingsPicoSubShelfOceanOverturning")==0) return BasalforcingsPicoSubShelfOceanOverturningEnum;
    385385         else stage=4;
    386386   }
    387387   if(stage==4){
    388               if (strcmp(name,"BasalforcingsPicoSubShelfOceanSalinity")==0) return BasalforcingsPicoSubShelfOceanSalinityEnum;
     388              if (strcmp(name,"BasalforcingsPicoSubShelfOceanOverturning")==0) return BasalforcingsPicoSubShelfOceanOverturningEnum;
     389              else if (strcmp(name,"BasalforcingsPicoSubShelfOceanSalinity")==0) return BasalforcingsPicoSubShelfOceanSalinityEnum;
    389390              else if (strcmp(name,"BasalforcingsPicoSubShelfOceanTemp")==0) return BasalforcingsPicoSubShelfOceanTempEnum;
    390391              else if (strcmp(name,"Base")==0) return BaseEnum;
     
    505506              else if (strcmp(name,"Sealevel")==0) return SealevelEnum;
    506507              else if (strcmp(name,"SealevelriseDeltathickness")==0) return SealevelriseDeltathicknessEnum;
    507               else if (strcmp(name,"SedimentHead")==0) return SedimentHeadEnum;
    508508         else stage=5;
    509509   }
    510510   if(stage==5){
    511               if (strcmp(name,"SedimentHeadOld")==0) return SedimentHeadOldEnum;
     511              if (strcmp(name,"SedimentHead")==0) return SedimentHeadEnum;
     512              else if (strcmp(name,"SedimentHeadOld")==0) return SedimentHeadOldEnum;
    512513              else if (strcmp(name,"SedimentHeadResidual")==0) return SedimentHeadResidualEnum;
    513514              else if (strcmp(name,"SigmaNN")==0) return SigmaNNEnum;
     
    628629              else if (strcmp(name,"WaterfractionDrainageIntegrated")==0) return WaterfractionDrainageIntegratedEnum;
    629630              else if (strcmp(name,"Waterfraction")==0) return WaterfractionEnum;
    630               else if (strcmp(name,"Waterheight")==0) return WaterheightEnum;
    631631         else stage=6;
    632632   }
    633633   if(stage==6){
    634               if (strcmp(name,"WeightsSurfaceObservation")==0) return WeightsSurfaceObservationEnum;
     634              if (strcmp(name,"Waterheight")==0) return WaterheightEnum;
     635              else if (strcmp(name,"WeightsSurfaceObservation")==0) return WeightsSurfaceObservationEnum;
    635636              else if (strcmp(name,"InputsEND")==0) return InputsENDEnum;
    636637              else if (strcmp(name,"Absolute")==0) return AbsoluteEnum;
     
    751752              else if (strcmp(name,"GaussTetra")==0) return GaussTetraEnum;
    752753              else if (strcmp(name,"GaussTria")==0) return GaussTriaEnum;
    753               else if (strcmp(name,"GenericOption")==0) return GenericOptionEnum;
    754754         else stage=7;
    755755   }
    756756   if(stage==7){
    757               if (strcmp(name,"GenericParam")==0) return GenericParamEnum;
     757              if (strcmp(name,"GenericOption")==0) return GenericOptionEnum;
     758              else if (strcmp(name,"GenericParam")==0) return GenericParamEnum;
    758759              else if (strcmp(name,"GiadWdt")==0) return GiadWdtEnum;
    759760              else if (strcmp(name,"GiaIvinsAnalysis")==0) return GiaIvinsAnalysisEnum;
     
    856857              else if (strcmp(name,"MaterialsRheologyLaw")==0) return MaterialsRheologyLawEnum;
    857858              else if (strcmp(name,"MaterialsRhoFreshwater")==0) return MaterialsRhoFreshwaterEnum;
    858               else if (strcmp(name,"MaterialsRhoIce")==0) return MaterialsRhoIceEnum;
    859859              else if (strcmp(name,"MaterialsRhoSeawater")==0) return MaterialsRhoSeawaterEnum;
    860860              else if (strcmp(name,"MaterialsTemperateiceconductivity")==0) return MaterialsTemperateiceconductivityEnum;
     
    880880              if (strcmp(name,"MeltingAnalysis")==0) return MeltingAnalysisEnum;
    881881              else if (strcmp(name,"MeshElements")==0) return MeshElementsEnum;
    882               else if (strcmp(name,"MeshLat")==0) return MeshLatEnum;
    883               else if (strcmp(name,"MeshLong")==0) return MeshLongEnum;
    884882              else if (strcmp(name,"MeshX")==0) return MeshXEnum;
    885883              else if (strcmp(name,"MeshY")==0) return MeshYEnum;
     
    998996              else if (strcmp(name,"Outputdefinition90")==0) return Outputdefinition90Enum;
    999997              else if (strcmp(name,"Outputdefinition91")==0) return Outputdefinition91Enum;
     998              else if (strcmp(name,"Outputdefinition92")==0) return Outputdefinition92Enum;
     999              else if (strcmp(name,"Outputdefinition93")==0) return Outputdefinition93Enum;
    10001000         else stage=9;
    10011001   }
    10021002   if(stage==9){
    1003               if (strcmp(name,"Outputdefinition92")==0) return Outputdefinition92Enum;
    1004               else if (strcmp(name,"Outputdefinition93")==0) return Outputdefinition93Enum;
    1005               else if (strcmp(name,"Outputdefinition94")==0) return Outputdefinition94Enum;
     1003              if (strcmp(name,"Outputdefinition94")==0) return Outputdefinition94Enum;
    10061004              else if (strcmp(name,"Outputdefinition95")==0) return Outputdefinition95Enum;
    10071005              else if (strcmp(name,"Outputdefinition96")==0) return Outputdefinition96Enum;
     
    11211119              else if (strcmp(name,"TransientParam")==0) return TransientParamEnum;
    11221120              else if (strcmp(name,"TransientSolution")==0) return TransientSolutionEnum;
     1121              else if (strcmp(name,"Tria")==0) return TriaEnum;
     1122              else if (strcmp(name,"TriaInput")==0) return TriaInputEnum;
    11231123         else stage=10;
    11241124   }
    11251125   if(stage==10){
    1126               if (strcmp(name,"Tria")==0) return TriaEnum;
    1127               else if (strcmp(name,"TriaInput")==0) return TriaInputEnum;
    1128               else if (strcmp(name,"UzawaPressureAnalysis")==0) return UzawaPressureAnalysisEnum;
     1126              if (strcmp(name,"UzawaPressureAnalysis")==0) return UzawaPressureAnalysisEnum;
    11291127              else if (strcmp(name,"VectorParam")==0) return VectorParamEnum;
    11301128              else if (strcmp(name,"Vertex")==0) return VertexEnum;
  • issm/trunk/src/c/shared/io/Marshalling/IoCodeConversions.cpp

    r22758 r22822  
    1616                const char* field = "md.geometry.thickness";
    1717                input_enum        = ThicknessEnum;
     18                fieldname=xNew<char>((strlen(field)+1)); xMemCpy<char>(fieldname,field,(strlen(field)+1));
     19        }
     20        else if(strcmp(string_in,"MaterialsRheologyBbar")==0){
     21                const char* field = "md.materials.rheology_B";
     22                input_enum        = MaterialsRheologyBbarEnum;
    1823                fieldname=xNew<char>((strlen(field)+1)); xMemCpy<char>(fieldname,field,(strlen(field)+1));
    1924        }
     
    141146                const char* field = "md.calving.stress_threshold_groundedice";
    142147                input_enum        = CalvingStressThresholdGroundediceEnum;
     148                fieldname=xNew<char>((strlen(field)+1)); xMemCpy<char>(fieldname,field,(strlen(field)+1));
     149        }
     150        else if(strcmp(string_in,"DamageDbar")==0){
     151                const char* field = "md.damage.D";
     152                input_enum        = DamageDbarEnum;
    143153                fieldname=xNew<char>((strlen(field)+1)); xMemCpy<char>(fieldname,field,(strlen(field)+1));
    144154        }
  • issm/trunk/src/m/classes/clusters/generic.m

    r22758 r22822  
    219219                        fid=fopen([modelname '.queue'],'w');
    220220                        fprintf(fid,'#!%s\n',cluster.shell);
    221                         fprintf(fid,'mpiexec -np %i %s/%s %s %s %s : -np %i ./mitgcmuv\n',cluster.np,cluster.codepath,executable,solution,cluster.executionpath,modelname,cluster.npocean);
     221                        if ~isvalgrind,
     222                                fprintf(fid,'mpiexec -np %i %s/%s %s %s %s : -np %i ./mitgcmuv\n',cluster.np,cluster.codepath,executable,solution,cluster.executionpath,modelname,cluster.npocean);
     223
     224                        else
     225                                fprintf(fid,'mpiexec -np %i %s --leak-check=full --error-limit=no --dsymutil=yes --suppressions=%s  %s/%s %s %s %s : -np %i ./mitgcmuv\n',...
     226                                        cluster.np,cluster.valgrind,cluster.valgrindsup,cluster.codepath,executable,solution,cluster.executionpath,modelname,cluster.npocean);
     227                        end
    222228                        fclose(fid);
    223229
  • issm/trunk/src/m/classes/geometry.js

    r21341 r22822  
    3737                                checkfield(md,'fieldname','geometry.thickness','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices, 1],'>',0);
    3838                                for(var i=0;i<md.mesh.numberofvertices;i++){
    39                                         if (Math.abs(md.geometry.thickness.thickness-md.geometry.surface+md.geometry.base)>Math.pow(10,9)){
     39                                        if (Math.abs(md.geometry.thickness[i]-md.geometry.surface[i]+md.geometry.base[i])>Math.pow(10,9)){
    4040                                                md = checkmessage(md,'equality thickness=surface-base violated');
    4141                                                break;
  • issm/trunk/src/m/classes/slr.js

    r22758 r22822  
    8888                        console.log(sprintf('   Sealevelrise solution parameters:'));
    8989
    90                         fielddisplay(this,'deltathickness','thickness change (main loading of the slr solution core [m]');
     90                        fielddisplay(this,'deltathickness','thickness change: ice height equivalent [m]');
    9191                        fielddisplay(this,'sealevel','current sea level (prior to computation) [m]');
    9292                        fielddisplay(this,'reltol','sea level rise relative convergence criterion, (NaN: not applied)');
    93                         fielddisplay(this,'abstol','sea level rise absolute convergence criterion, (default, NaN: not applied');
     93                        fielddisplay(this,'abstol','sea level rise absolute convergence criterion, (default, NaN: not applied)');
    9494                        fielddisplay(this,'maxiter','maximum number of nonlinear iterations');
    9595                        fielddisplay(this,'love_h','load Love number for radial displacement');
     
    105105                        fielddisplay(this,'elastic','elastic earth graviational potential perturbation');
    106106                        fielddisplay(this,'rotation','rotational earth potential perturbation');
    107                         fielddisplay(this,'ocean_area_scaling','correction for model representation of ocean area [default: No correction]');
    108                         fielddisplay(this,'steric_rate','rate of steric ocean expansion (in mm/yr)');
     107                        fielddisplay(this,'ocean_area_scaling','correction for model representation of ocean area (default: No correction)');
     108                        fielddisplay(this,'steric_rate','rate of steric ocean expansion [mm/yr]');
    109109                        fielddisplay(this,'degacc',"accuracy (default .01 deg) for numerical discretization of the Green's functions");
    110110                        fielddisplay(this,'transitions','indices into parts of the mesh that will be icecaps');
  • issm/trunk/src/m/classes/slr.m

    r22758 r22822  
    122122                        disp(sprintf('   slr parameters:'));
    123123
    124                         fielddisplay(self,'deltathickness','thickness change (main loading of the slr solution core [m]');
     124                        fielddisplay(self,'deltathickness','thickness change: ice height equivalent [m]');
    125125                        fielddisplay(self,'sealevel','current sea level (prior to computation) [m]');
    126126                        fielddisplay(self,'reltol','sea level rise relative convergence criterion, (NaN: not applied)');
    127                         fielddisplay(self,'abstol','sea level rise absolute convergence criterion, (default, NaN: not applied');
     127                        fielddisplay(self,'abstol','sea level rise absolute convergence criterion, (default, NaN: not applied)');
    128128                        fielddisplay(self,'maxiter','maximum number of nonlinear iterations');
    129129                        fielddisplay(self,'love_h','load Love number for radial displacement');
     
    139139                        fielddisplay(self,'elastic','elastic earth graviational potential perturbation');
    140140                        fielddisplay(self,'rotation','earth rotational potential perturbation');
    141                         fielddisplay(self,'ocean_area_scaling','correction for model representation of ocean area [default: No correction]');
    142                         fielddisplay(self,'steric_rate','rate of steric ocean expansion (in mm/yr)');
     141                        fielddisplay(self,'ocean_area_scaling','correction for model representation of ocean area (default: No correction)');
     142                        fielddisplay(self,'steric_rate','rate of steric ocean expansion [mm/yr]');
    143143                        fielddisplay(self,'degacc','accuracy (default .01 deg) for numerical discretization of the Green''s functions');
    144144                        fielddisplay(self,'transitions','indices into parts of the mesh that will be icecaps');
  • issm/trunk/src/m/classes/slr.py

    r22758 r22822  
    4343        def __repr__(self): # {{{
    4444                        string='   slr parameters:'
    45                         string="%s\n%s"%(string,fielddisplay(self,'deltathickness','thickness change (main loading of the slr solution core [m]'))
     45                        string="%s\n%s"%(string,fielddisplay(self,'deltathickness','thickness change: ice height equivalent [m]'))
    4646                        string="%s\n%s"%(string,fielddisplay(self,'sealevel','current sea level (prior to computation) [m]'))
    4747                        string="%s\n%s"%(string,fielddisplay(self,'reltol','sea level rise relative convergence criterion, (NaN: not applied)'))
    48                         string="%s\n%s"%(string,fielddisplay(self,'abstol','sea level rise absolute convergence criterion, (default, NaN: not applied'))
     48                        string="%s\n%s"%(string,fielddisplay(self,'abstol','sea level rise absolute convergence criterion, (default, NaN: not applied)'))
    4949                        string="%s\n%s"%(string,fielddisplay(self,'maxiter','maximum number of nonlinear iterations'))
    5050                        string="%s\n%s"%(string,fielddisplay(self,'love_h','load Love number for radial displacement'))
     
    6060                        string="%s\n%s"%(string,fielddisplay(self,'elastic','elastic earth graviational potential perturbation'))
    6161                        string="%s\n%s"%(string,fielddisplay(self,'rotation','earth rotational potential perturbation'))
    62                         string="%s\n%s"%(string,fielddisplay(self,'ocean_area_scaling','correction for model representation of ocean area [default: No correction]'))
    63                         string="%s\n%s"%(string,fielddisplay(self,'steric_rate','rate of steric ocean expansion (in mm/yr)'))
     62                        string="%s\n%s"%(string,fielddisplay(self,'ocean_area_scaling','correction for model representation of ocean area (default: No correction)'))
     63                        string="%s\n%s"%(string,fielddisplay(self,'steric_rate','rate of steric ocean expansion [mm/yr]'))
    6464                        string="%s\n%s"%(string,fielddisplay(self,'degacc','accuracy (default .01 deg) for numerical discretization of the Green''s functions'))
    6565                        string="%s\n%s"%(string,fielddisplay(self,'transitions','indices into parts of the mesh that will be icecaps'))
  • issm/trunk/src/m/dev/issmversion.m

    r21729 r22822  
    1717disp(['Compiled on ' IssmConfig('HOST_VENDOR') ' ' IssmConfig('HOST_OS') ' ' IssmConfig('HOST_ARCH') ' by ' IssmConfig('USER_NAME')]);
    1818disp([' ']);
    19 disp(['Copyright (c) 2009-2017 California Institute of Technology']);
     19disp(['Copyright (c) 2009-2018 California Institute of Technology']);
    2020disp([' ']);
    2121disp(['    to get started type: issmdoc']);
  • issm/trunk/src/m/dev/issmversion.py

    r21729 r22822  
    1515print ' '
    1616print 'Build date: '+IssmConfig('PACKAGE_BUILD_DATE')[0]
    17 print 'Copyright (c) 2009-2017 California Institute of Technology'
     17print 'Copyright (c) 2009-2018 California Institute of Technology'
    1818print ' '
    1919print '    to get started type: issmdoc'
  • issm/trunk/src/m/mesh/planet/gmsh/gmshplanet.m

    r22790 r22822  
    5858        fprintf(fid,'Circle(12) = {6,1,2};\n');
    5959        fprintf(fid,'Line Loop(13) = {2,8,-10};\n');
    60         fprintf(fid,'Ruled Surface(14) = {13};\n');
     60        fprintf(fid,'Surface(14) = {13};\n');
    6161        fprintf(fid,'Line Loop(15) = {10,3,7};\n');
    62         fprintf(fid,'Ruled Surface(16) = {15};\n');
     62        fprintf(fid,'Surface(16) = {15};\n');
    6363        fprintf(fid,'Line Loop(17) = {-8,-9,1};\n');
    64         fprintf(fid,'Ruled Surface(18) = {17};\n');
     64        fprintf(fid,'Surface(18) = {17};\n');
    6565        fprintf(fid,'Line Loop(19) = {-11,-2,5};\n');
    66         fprintf(fid,'Ruled Surface(20) = {19};\n');
     66        fprintf(fid,'Surface(20) = {19};\n');
    6767        fprintf(fid,'Line Loop(21) = {-5,-12,-1};\n');
    68         fprintf(fid,'Ruled Surface(22) = {21};\n');
     68        fprintf(fid,'Surface(22) = {21};\n');
    6969        fprintf(fid,'Line Loop(23) = {-3,11,6};\n');
    70         fprintf(fid,'Ruled Surface(24) = {23};\n');
     70        fprintf(fid,'Surface(24) = {23};\n');
    7171        fprintf(fid,'Line Loop(25) = {-7,4,9};\n');
    72         fprintf(fid,'Ruled Surface(26) = {25};\n');
     72        fprintf(fid,'Surface(26) = {25};\n');
    7373        fprintf(fid,'Line Loop(27) = {-4,12,-6};\n');
    74         fprintf(fid,'Ruled Surface(28) = {27};\n');
     74        fprintf(fid,'Surface(28) = {27};\n');
    7575        fprintf(fid,'Surface Loop(29) = {28,26,16,14,20,24,22,18};\n');
    7676        fprintf(fid,'Volume(30) = {29};\n');
     
    107107        for i=paths
    108108                if exist(i{1},'file'),
    109                         gmshpath = i{1}
    110                         break;
     109                        gmshpath = i{1};
    111110                end
    112111        end
  • issm/trunk/src/m/mesh/planet/gmsh/gmshplanet.py

    r21729 r22822  
    6464        fid.write('Circle(12) = {6,1,2};\n')
    6565        fid.write('Line Loop(13) = {2,8,-10};\n')
    66         fid.write('Ruled Surface(14) = {13};\n')
     66        fid.write('Surface(14) = {13};\n')
    6767        fid.write('Line Loop(15) = {10,3,7};\n')
    68         fid.write('Ruled Surface(16) = {15};\n')
     68        fid.write('Surface(16) = {15};\n')
    6969        fid.write('Line Loop(17) = {-8,-9,1};\n')
    70         fid.write('Ruled Surface(18) = {17};\n')
     70        fid.write('Surface(18) = {17};\n')
    7171        fid.write('Line Loop(19) = {-11,-2,5};\n')
    72         fid.write('Ruled Surface(20) = {19};\n')
     72        fid.write('Surface(20) = {19};\n')
    7373        fid.write('Line Loop(21) = {-5,-12,-1};\n')
    74         fid.write('Ruled Surface(22) = {21};\n')
     74        fid.write('Surface(22) = {21};\n')
    7575        fid.write('Line Loop(23) = {-3,11,6};\n')
    76         fid.write('Ruled Surface(24) = {23};\n')
     76        fid.write('Surface(24) = {23};\n')
    7777        fid.write('Line Loop(25) = {-7,4,9};\n')
    78         fid.write('Ruled Surface(26) = {25};\n')
     78        fid.write('Surface(26) = {25};\n')
    7979        fid.write('Line Loop(27) = {-4,12,-6};\n')
    80         fid.write('Ruled Surface(28) = {27};\n')
     80        fid.write('Surface(28) = {27};\n')
    8181        fid.write('Surface Loop(29) = {28,26,16,14,20,24,22,18};\n')
    8282        fid.write('Volume(30) = {29};\n')
  • issm/trunk/test

  • issm/trunk/test/MITgcm/code/cpl_issm.F

    r22758 r22822  
    159159               DO j=1,sNy
    160160                  DO i=1,sNx
    161                      local(i,j,bi,bj) = shelficeHeatFlux(i,j,bi,bj)
     161                     local(i,j,bi,bj)=shelficeFreshWaterFlux(i,j,bi,bj)
    162162                  ENDDO
    163163               ENDDO
     
    175175         ENDIF
    176176         CALL BAR2( myThid )
    177          print*,'Done Sending shelficeHeatFlux array.'
     177         print*,'Done Sending shelficeFreshWaterFlux array.'
    178178         
    179179      ENDIF
Note: See TracChangeset for help on using the changeset viewer.