Changeset 23782


Ignore:
Timestamp:
03/08/19 13:34:43 (6 years ago)
Author:
Mathieu Morlighem
Message:

NEW: working on ISMIP6 forcings

Location:
issm/trunk-jpl/src/c
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/c/analyses/MasstransportAnalysis.cpp

    r23723 r23782  
    178178                case BasalforcingsPicoEnum:
    179179                        iomodel->FetchDataToInput(elements,"md.basalforcings.basin_id",BasalforcingsPicoBasinIdEnum);
     180                        break;
     181                case BasalforcingsIsmip6Enum:{
     182                        //iomodel->FetchDataToInput(elements,"md.basalforcings.tf",BasalforcingsIsmp6TfEnum);
     183                        IssmDouble** array3d = NULL;
     184                        int* Ms = NULL;
     185                        int* Ns = NULL;
     186                        int K;
     187                        iomodel->FetchData(&array3d,&Ms,&Ns,&K,"md.basalforcings.tf");
     188                        if(!array3d) _error_("md.basalforcings.tf not found in binary file");
     189                        for(int i=0;i<elements->Size();i++){
     190                                Element* element=xDynamicCast<Element*>(elements->GetObjectByOffset(i));
     191                                for(int kk=0;kk<K;kk++){
     192                                        element->DatasetInputAdd(BasalforcingsIsmp6TfEnum,array3d[kk],iomodel,Ms[kk],Ns[kk],1,BasalforcingsIsmp6TfEnum,7,BasalforcingsIsmp6TfEnum);
     193                                }
     194                        }
     195                        xDelete<int>(Ms);
     196                        xDelete<int>(Ns);
     197                        for(int i=0;i<K;i++) xDelete<IssmDouble>(array3d[i]);
     198                        xDelete<IssmDouble*>(array3d);
     199                        }
    180200                        break;
    181201                default:
  • issm/trunk-jpl/src/c/modules/FloatingiceMeltingRatex/FloatingiceMeltingRatex.cpp

    r23066 r23782  
    3737                        FloatingiceMeltingRatePicox(femmodel);
    3838                        break;
     39                case BasalforcingsIsmip6Enum:
     40                        if(VerboseSolution())_printf0_(" call ISMIP 6 Floating melting rate module\n");
     41                        FloatingiceMeltingRateIsmip6x(femmodel);
     42                        break;
    3943                default:
    4044                        _error_("Basal forcing model "<<EnumToStringx(basalforcing_model)<<" not supported yet");
     
    6771}
    6872/*}}}*/
     73void FloatingiceMeltingRateIsmip6x(FemModel* femmodel){/*{{{*/
     74
     75        for(int i=0;i<femmodel->elements->Size();i++){
     76                Element* element=xDynamicCast<Element*>(femmodel->elements->GetObjectByOffset(i));
     77                Input* temp = element->GetInput(BasalforcingsIsmp6TfEnum);
     78                _assert_(temp);
     79                temp->Echo();
     80                _error_("not implemented yet");
     81                //element->MismipFloatingiceMeltingRate();
     82        }
     83}
     84/*}}}*/
  • issm/trunk-jpl/src/c/modules/FloatingiceMeltingRatex/FloatingiceMeltingRatex.h

    r22953 r23782  
    1414void SpatialLinearFloatingiceMeltingRatex(FemModel* femmodel);
    1515void MismipFloatingiceMeltingRatex(FemModel* femmodel);
     16void FloatingiceMeltingRateIsmip6x(FemModel* femmodel);
    1617
    1718#endif  /* _FloatingiceMeltingRatex_H*/
  • issm/trunk-jpl/src/c/modules/ModelProcessorx/CreateParameters.cpp

    r23758 r23782  
    224224                                parameters->AddObject(new TransientArrayParam(BasalforcingsPicoFarOceansalinityEnum,transparam,&transparam[N*(M-1)],interp,N,M));
    225225                                xDelete<IssmDouble>(transparam);
     226                case BasalforcingsIsmip6Enum:
     227                                iomodel->FindConstant(&interp,"md.timestepping.interp_forcings");
     228                                printf("-------------- file: CreateParameters.cpp line: %i\n",__LINE__);
     229                                printf("== WARNING: needs to be implemented\n");
    226230                        break;
    227231                default:
  • issm/trunk-jpl/src/c/shared/Enum/EnumDefinitions.h

    r23758 r23782  
    436436        BasalforcingsGeothermalfluxEnum,
    437437        BasalforcingsGroundediceMeltingRateEnum,
     438        BasalforcingsIsmp6TfEnum,
    438439        BasalforcingsPicoBasinIdEnum,
    439440        BasalforcingsPicoBoxIdEnum,
     
    752753        BalancevelocitySolutionEnum,
    753754        BasalCrevasseEnum,
     755        BasalforcingsIsmip6Enum,
    754756        BasalforcingsPicoEnum,
    755757        BedSlopeSolutionEnum,
  • issm/trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp

    r23758 r23782  
    442442                case BasalforcingsGeothermalfluxEnum : return "BasalforcingsGeothermalflux";
    443443                case BasalforcingsGroundediceMeltingRateEnum : return "BasalforcingsGroundediceMeltingRate";
     444                case BasalforcingsIsmp6TfEnum : return "BasalforcingsIsmp6Tf";
    444445                case BasalforcingsPicoBasinIdEnum : return "BasalforcingsPicoBasinId";
    445446                case BasalforcingsPicoBoxIdEnum : return "BasalforcingsPicoBoxId";
     
    756757                case BalancevelocitySolutionEnum : return "BalancevelocitySolution";
    757758                case BasalCrevasseEnum : return "BasalCrevasse";
     759                case BasalforcingsIsmip6Enum : return "BasalforcingsIsmip6";
    758760                case BasalforcingsPicoEnum : return "BasalforcingsPico";
    759761                case BedSlopeSolutionEnum : return "BedSlopeSolution";
  • issm/trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp

    r23758 r23782  
    451451              else if (strcmp(name,"BasalforcingsGeothermalflux")==0) return BasalforcingsGeothermalfluxEnum;
    452452              else if (strcmp(name,"BasalforcingsGroundediceMeltingRate")==0) return BasalforcingsGroundediceMeltingRateEnum;
     453              else if (strcmp(name,"BasalforcingsIsmp6Tf")==0) return BasalforcingsIsmp6TfEnum;
    453454              else if (strcmp(name,"BasalforcingsPicoBasinId")==0) return BasalforcingsPicoBasinIdEnum;
    454455              else if (strcmp(name,"BasalforcingsPicoBoxId")==0) return BasalforcingsPicoBoxIdEnum;
     
    505506              else if (strcmp(name,"EsaYmotion")==0) return EsaYmotionEnum;
    506507              else if (strcmp(name,"EtaDiff")==0) return EtaDiffEnum;
    507               else if (strcmp(name,"FrictionAs")==0) return FrictionAsEnum;
    508508         else stage=5;
    509509   }
    510510   if(stage==5){
    511               if (strcmp(name,"FrictionC")==0) return FrictionCEnum;
     511              if (strcmp(name,"FrictionAs")==0) return FrictionAsEnum;
     512              else if (strcmp(name,"FrictionC")==0) return FrictionCEnum;
    512513              else if (strcmp(name,"FrictionCoefficientcoulomb")==0) return FrictionCoefficientcoulombEnum;
    513514              else if (strcmp(name,"FrictionCoefficient")==0) return FrictionCoefficientEnum;
     
    628629              else if (strcmp(name,"SmbDailyairhumidity")==0) return SmbDailyairhumidityEnum;
    629630              else if (strcmp(name,"SmbDailytemperature")==0) return SmbDailytemperatureEnum;
    630               else if (strcmp(name,"SmbD")==0) return SmbDEnum;
    631631         else stage=6;
    632632   }
    633633   if(stage==6){
    634               if (strcmp(name,"SmbDini")==0) return SmbDiniEnum;
     634              if (strcmp(name,"SmbD")==0) return SmbDEnum;
     635              else if (strcmp(name,"SmbDini")==0) return SmbDiniEnum;
    635636              else if (strcmp(name,"SmbDlwrf")==0) return SmbDlwrfEnum;
    636637              else if (strcmp(name,"SmbDswrf")==0) return SmbDswrfEnum;
     
    751752              else if (strcmp(name,"AdaptiveTimestepping")==0) return AdaptiveTimesteppingEnum;
    752753              else if (strcmp(name,"AdjointBalancethickness2Analysis")==0) return AdjointBalancethickness2AnalysisEnum;
    753               else if (strcmp(name,"AdjointBalancethicknessAnalysis")==0) return AdjointBalancethicknessAnalysisEnum;
    754754         else stage=7;
    755755   }
    756756   if(stage==7){
    757               if (strcmp(name,"AdjointHorizAnalysis")==0) return AdjointHorizAnalysisEnum;
     757              if (strcmp(name,"AdjointBalancethicknessAnalysis")==0) return AdjointBalancethicknessAnalysisEnum;
     758              else if (strcmp(name,"AdjointHorizAnalysis")==0) return AdjointHorizAnalysisEnum;
    758759              else if (strcmp(name,"Adjointp")==0) return AdjointpEnum;
    759760              else if (strcmp(name,"AggressiveMigration")==0) return AggressiveMigrationEnum;
     
    774775              else if (strcmp(name,"BalancevelocitySolution")==0) return BalancevelocitySolutionEnum;
    775776              else if (strcmp(name,"BasalCrevasse")==0) return BasalCrevasseEnum;
     777              else if (strcmp(name,"BasalforcingsIsmip6")==0) return BasalforcingsIsmip6Enum;
    776778              else if (strcmp(name,"BasalforcingsPico")==0) return BasalforcingsPicoEnum;
    777779              else if (strcmp(name,"BedSlopeSolution")==0) return BedSlopeSolutionEnum;
     
    873875              else if (strcmp(name,"Gradient1")==0) return Gradient1Enum;
    874876              else if (strcmp(name,"Gradient2")==0) return Gradient2Enum;
    875               else if (strcmp(name,"Gradient3")==0) return Gradient3Enum;
    876               else if (strcmp(name,"GroundedArea")==0) return GroundedAreaEnum;
    877877         else stage=8;
    878878   }
    879879   if(stage==8){
    880               if (strcmp(name,"GroundedAreaScaled")==0) return GroundedAreaScaledEnum;
     880              if (strcmp(name,"Gradient3")==0) return Gradient3Enum;
     881              else if (strcmp(name,"GroundedArea")==0) return GroundedAreaEnum;
     882              else if (strcmp(name,"GroundedAreaScaled")==0) return GroundedAreaScaledEnum;
    881883              else if (strcmp(name,"GroundingOnly")==0) return GroundingOnlyEnum;
    882884              else if (strcmp(name,"Gset")==0) return GsetEnum;
     
    996998              else if (strcmp(name,"Outputdefinition10")==0) return Outputdefinition10Enum;
    997999              else if (strcmp(name,"Outputdefinition11")==0) return Outputdefinition11Enum;
    998               else if (strcmp(name,"Outputdefinition12")==0) return Outputdefinition12Enum;
    999               else if (strcmp(name,"Outputdefinition13")==0) return Outputdefinition13Enum;
    10001000         else stage=9;
    10011001   }
    10021002   if(stage==9){
    1003               if (strcmp(name,"Outputdefinition14")==0) return Outputdefinition14Enum;
     1003              if (strcmp(name,"Outputdefinition12")==0) return Outputdefinition12Enum;
     1004              else if (strcmp(name,"Outputdefinition13")==0) return Outputdefinition13Enum;
     1005              else if (strcmp(name,"Outputdefinition14")==0) return Outputdefinition14Enum;
    10041006              else if (strcmp(name,"Outputdefinition15")==0) return Outputdefinition15Enum;
    10051007              else if (strcmp(name,"Outputdefinition16")==0) return Outputdefinition16Enum;
     
    11191121              else if (strcmp(name,"ProfilingCurrentMem")==0) return ProfilingCurrentMemEnum;
    11201122              else if (strcmp(name,"ProfilingSolutionTime")==0) return ProfilingSolutionTimeEnum;
    1121               else if (strcmp(name,"Regionaloutput")==0) return RegionaloutputEnum;
    1122               else if (strcmp(name,"Regular")==0) return RegularEnum;
    11231123         else stage=10;
    11241124   }
    11251125   if(stage==10){
    1126               if (strcmp(name,"Riftfront")==0) return RiftfrontEnum;
     1126              if (strcmp(name,"Regionaloutput")==0) return RegionaloutputEnum;
     1127              else if (strcmp(name,"Regular")==0) return RegularEnum;
     1128              else if (strcmp(name,"Riftfront")==0) return RiftfrontEnum;
    11271129              else if (strcmp(name,"Scaled")==0) return ScaledEnum;
    11281130              else if (strcmp(name,"SealevelAbsolute")==0) return SealevelAbsoluteEnum;
  • issm/trunk-jpl/src/c/shared/io/Marshalling/IoCodeConversions.cpp

    r23657 r23782  
    197197                case 5: return BasalforcingsPicoEnum;
    198198                case 6: return SpatialLinearFloatingMeltRateEnum;
     199                case 7: return BasalforcingsIsmip6Enum;
    199200                default: _error_("Marshalled Basal Forcings code \""<<enum_in<<"\" not supported yet");
    200201        }
Note: See TracChangeset for help on using the changeset viewer.