Changeset 24889
- Timestamp:
- 05/22/20 10:13:54 (5 years ago)
- Location:
- issm/trunk-jpl
- Files:
-
- 3 deleted
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/c/analyses/SealevelriseAnalysis.cpp
r24861 r24889 37 37 iomodel->FetchDataToInput(inputs2,elements,"md.mask.ocean_levelset",MaskOceanLevelsetEnum); 38 38 iomodel->FetchDataToInput(inputs2,elements,"md.mask.ice_levelset",MaskIceLevelsetEnum); 39 //those only if we have requested geodetic computations:40 39 iomodel->FetchData(&geodetic,"md.slr.geodetic"); 41 if (geodetic){42 char* masktype=NULL;43 iomodel->FetchData(&masktype,"md.mask.type");44 if (strcmp(masktype,"maskpsl")==0){45 iomodel->FetchDataToInput(inputs2,elements,"md.mask.ocean_levelset",MaskOceanLevelsetEnum);46 iomodel->FetchDataToInput(inputs2,elements,"md.mask.land_levelset",MaskLandLevelsetEnum);47 }48 xDelete<char>(masktype);49 }50 40 iomodel->FetchDataToInput(inputs2,elements,"md.slr.deltathickness",SealevelriseDeltathicknessEnum); 51 41 iomodel->FetchDataToInput(inputs2,elements,"md.slr.spcthickness",SealevelriseSpcthicknessEnum); -
issm/trunk-jpl/src/c/classes/Elements/Element.cpp
r24861 r24889 2025 2025 /*}}}*/ 2026 2026 bool Element::IsLandInElement(){/*{{{*/ 2027 Input2* input=this->GetInput2(Mask LandLevelsetEnum); _assert_(input);2027 Input2* input=this->GetInput2(MaskOceanLevelsetEnum); _assert_(input); 2028 2028 return (input->GetInputMax()>0.); 2029 2029 } … … 2031 2031 bool Element::IsOceanInElement(){/*{{{*/ 2032 2032 Input2* input=this->GetInput2(MaskOceanLevelsetEnum); _assert_(input); 2033 return (input->GetInputM ax()>0.);2033 return (input->GetInputMin()<0.); 2034 2034 } 2035 2035 /*}}}*/ … … 2099 2099 2100 2100 }/*}}}*/ 2101 bool Element::IsWaterInElement(){/*{{{*/2102 Input2* input=this->GetInput2(MaskOceanLevelsetEnum); _assert_(input);2103 return (input->GetInputMax()>0.);2104 }2105 /*}}}*/2106 2101 void Element::LinearFloatingiceMeltingRate(){/*{{{*/ 2107 2102 -
issm/trunk-jpl/src/c/classes/Elements/Element.h
r24790 r24889 141 141 bool IsIceInElement(); 142 142 bool IsIceOnlyInElement(); 143 bool IsOceanInElement(); 143 144 bool IsLandInElement(); 144 bool IsOceanInElement();145 145 void Ismip6FloatingiceMeltingRate(); 146 bool IsWaterInElement();147 146 void LinearFloatingiceMeltingRate(); 148 147 void SpatialLinearFloatingiceMeltingRate(); -
issm/trunk-jpl/src/c/classes/Elements/Tria.cpp
r24861 r24889 5449 5449 IssmDouble Tria::OceanArea(void){ /*{{{*/ 5450 5450 5451 if(Is WaterInElement()) return GetAreaSpherical();5451 if(IsOceanInElement()) return GetAreaSpherical(); 5452 5452 else return 0; 5453 5453 … … 5456 5456 IssmDouble Tria::OceanAverage(IssmDouble* Sg){ /*{{{*/ 5457 5457 5458 if(Is WaterInElement()){5458 if(IsOceanInElement()){ 5459 5459 5460 5460 IssmDouble area; … … 5475 5475 void Tria::SealevelriseMomentOfInertia(IssmDouble* dI_list,IssmDouble* Sg_old,IssmDouble eartharea){/*{{{*/ 5476 5476 /*early return if we are not on an ice cap OR ocean:*/ 5477 if(!IsIceOnlyInElement() && !Is WaterInElement()){5477 if(!IsIceOnlyInElement() && !IsOceanInElement()){ 5478 5478 dI_list[0] = 0.0; // this is important!!! 5479 5479 dI_list[1] = 0.0; // this is important!!! … … 5528 5528 re=(llr_list[0][2]+llr_list[1][2]+llr_list[2][2])/3.0; 5529 5529 5530 if(Is WaterInElement()){5530 if(IsOceanInElement()){ 5531 5531 IssmDouble rho_water, S; 5532 5532 … … 5973 5973 5974 5974 /*early return if we are not on the ocean:*/ 5975 if (!Is WaterInElement()){5975 if (!IsOceanInElement()){ 5976 5976 constant=0; this->AddInput2(SealevelEustaticOceanMaskEnum,&constant,P0Enum); 5977 5977 return; … … 6126 6126 6127 6127 /*early return if we are not on the ocean or on an ice cap:*/ 6128 if(!IsIceOnlyInElement() && !Is WaterInElement()) return;6128 if(!IsIceOnlyInElement() && !IsOceanInElement()) return; 6129 6129 6130 6130 /*early return if we are fully floating: */ … … 6268 6268 } 6269 6269 } 6270 else if(Is WaterInElement()) {6270 else if(IsOceanInElement()) { 6271 6271 U_values[i]+=3*rho_water/rho_earth*area/eartharea*S*U_elastic[i]; 6272 6272 if(horiz){ -
issm/trunk-jpl/src/c/shared/Enum/Enum.vim
r24861 r24889 627 627 syn keyword cConstant MaskOceanLevelsetEnum 628 628 syn keyword cConstant MaskIceLevelsetEnum 629 syn keyword cConstant MaskLandLevelsetEnum630 629 syn keyword cConstant MasstransportSpcthicknessEnum 631 630 syn keyword cConstant MaterialsRheologyBEnum … … 1342 1341 syn keyword cType Cfsurfacesquare 1343 1342 syn keyword cType Channel 1344 syn keyword cType classes1345 1343 syn keyword cType Constraint 1346 1344 syn keyword cType Constraints … … 1349 1347 syn keyword cType ControlInput2 1350 1348 syn keyword cType Covertree 1349 syn keyword cType DataSetParam 1351 1350 syn keyword cType DatasetInput2 1352 syn keyword cType DataSetParam1353 1351 syn keyword cType Definition 1354 1352 syn keyword cType DependentObject … … 1362 1360 syn keyword cType ElementInput2 1363 1361 syn keyword cType ElementMatrix 1362 syn keyword cType ElementVector 1364 1363 syn keyword cType Elements 1365 syn keyword cType ElementVector1366 1364 syn keyword cType ExponentialVariogram 1367 1365 syn keyword cType ExternalResult … … 1370 1368 syn keyword cType Friction 1371 1369 syn keyword cType Gauss 1372 syn keyword cType GaussianVariogram1373 syn keyword cType gaussobjects1374 1370 syn keyword cType GaussPenta 1375 1371 syn keyword cType GaussSeg 1376 1372 syn keyword cType GaussTetra 1377 1373 syn keyword cType GaussTria 1374 syn keyword cType GaussianVariogram 1378 1375 syn keyword cType GenericExternalResult 1379 1376 syn keyword cType GenericOption … … 1390 1387 syn keyword cType IssmDirectApplicInterface 1391 1388 syn keyword cType IssmParallelDirectApplicInterface 1392 syn keyword cType krigingobjects1393 1389 syn keyword cType Load 1394 1390 syn keyword cType Loads … … 1401 1397 syn keyword cType Matice 1402 1398 syn keyword cType Matlitho 1403 syn keyword cType matrixobjects1404 1399 syn keyword cType MatrixParam 1405 1400 syn keyword cType Misfit … … 1414 1409 syn keyword cType Observations 1415 1410 syn keyword cType Option 1411 syn keyword cType OptionUtilities 1416 1412 syn keyword cType Options 1417 syn keyword cType OptionUtilities1418 1413 syn keyword cType Param 1419 1414 syn keyword cType Parameters … … 1429 1424 syn keyword cType Regionaloutput 1430 1425 syn keyword cType Results 1426 syn keyword cType RiftStruct 1431 1427 syn keyword cType Riftfront 1432 syn keyword cType RiftStruct1433 1428 syn keyword cType Seg 1434 1429 syn keyword cType SegInput2 1430 syn keyword cType SegRef 1435 1431 syn keyword cType Segment 1436 syn keyword cType SegRef1437 1432 syn keyword cType SpcDynamic 1438 1433 syn keyword cType SpcStatic … … 1453 1448 syn keyword cType Vertex 1454 1449 syn keyword cType Vertices 1450 syn keyword cType classes 1451 syn keyword cType gaussobjects 1452 syn keyword cType krigingobjects 1453 syn keyword cType matrixobjects 1455 1454 syn keyword cType AdjointBalancethickness2Analysis 1456 1455 syn keyword cType AdjointBalancethicknessAnalysis … … 1471 1470 syn keyword cType FreeSurfaceBaseAnalysis 1472 1471 syn keyword cType FreeSurfaceTopAnalysis 1472 syn keyword cType GLheightadvectionAnalysis 1473 1473 syn keyword cType GiaIvinsAnalysis 1474 syn keyword cType GLheightadvectionAnalysis1475 1474 syn keyword cType HydrologyDCEfficientAnalysis 1476 1475 syn keyword cType HydrologyDCInefficientAnalysis -
issm/trunk-jpl/src/c/shared/Enum/EnumDefinitions.h
r24861 r24889 624 624 MaskOceanLevelsetEnum, 625 625 MaskIceLevelsetEnum, 626 MaskLandLevelsetEnum,627 626 MasstransportSpcthicknessEnum, 628 627 MaterialsRheologyBEnum, -
issm/trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp
r24861 r24889 629 629 case MaskOceanLevelsetEnum : return "MaskOceanLevelset"; 630 630 case MaskIceLevelsetEnum : return "MaskIceLevelset"; 631 case MaskLandLevelsetEnum : return "MaskLandLevelset";632 631 case MasstransportSpcthicknessEnum : return "MasstransportSpcthickness"; 633 632 case MaterialsRheologyBEnum : return "MaterialsRheologyB"; -
issm/trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp
r24861 r24889 644 644 else if (strcmp(name,"MaskOceanLevelset")==0) return MaskOceanLevelsetEnum; 645 645 else if (strcmp(name,"MaskIceLevelset")==0) return MaskIceLevelsetEnum; 646 else if (strcmp(name,"MaskLandLevelset")==0) return MaskLandLevelsetEnum;647 646 else if (strcmp(name,"MasstransportSpcthickness")==0) return MasstransportSpcthicknessEnum; 648 647 else if (strcmp(name,"MaterialsRheologyB")==0) return MaterialsRheologyBEnum; … … 752 751 else if (strcmp(name,"SmbMassBalance")==0) return SmbMassBalanceEnum; 753 752 else if (strcmp(name,"SmbMassBalanceSubstep")==0) return SmbMassBalanceSubstepEnum; 753 else if (strcmp(name,"SmbMassBalanceTransient")==0) return SmbMassBalanceTransientEnum; 754 754 else stage=7; 755 755 } 756 756 if(stage==7){ 757 if (strcmp(name,"SmbMassBalanceTransient")==0) return SmbMassBalanceTransientEnum; 758 else if (strcmp(name,"SmbMeanLHF")==0) return SmbMeanLHFEnum; 757 if (strcmp(name,"SmbMeanLHF")==0) return SmbMeanLHFEnum; 759 758 else if (strcmp(name,"SmbMeanSHF")==0) return SmbMeanSHFEnum; 760 759 else if (strcmp(name,"SmbMeanULW")==0) return SmbMeanULWEnum; … … 875 874 else if (strcmp(name,"Outputdefinition14")==0) return Outputdefinition14Enum; 876 875 else if (strcmp(name,"Outputdefinition15")==0) return Outputdefinition15Enum; 876 else if (strcmp(name,"Outputdefinition16")==0) return Outputdefinition16Enum; 877 877 else stage=8; 878 878 } 879 879 if(stage==8){ 880 if (strcmp(name,"Outputdefinition16")==0) return Outputdefinition16Enum; 881 else if (strcmp(name,"Outputdefinition17")==0) return Outputdefinition17Enum; 880 if (strcmp(name,"Outputdefinition17")==0) return Outputdefinition17Enum; 882 881 else if (strcmp(name,"Outputdefinition18")==0) return Outputdefinition18Enum; 883 882 else if (strcmp(name,"Outputdefinition19")==0) return Outputdefinition19Enum; … … 998 997 else if (strcmp(name,"BedSlopeSolution")==0) return BedSlopeSolutionEnum; 999 998 else if (strcmp(name,"BoolExternalResult")==0) return BoolExternalResultEnum; 999 else if (strcmp(name,"BoolInput")==0) return BoolInputEnum; 1000 1000 else stage=9; 1001 1001 } 1002 1002 if(stage==9){ 1003 if (strcmp(name,"BoolInput")==0) return BoolInputEnum; 1004 else if (strcmp(name,"BoolInput2")==0) return BoolInput2Enum; 1003 if (strcmp(name,"BoolInput2")==0) return BoolInput2Enum; 1005 1004 else if (strcmp(name,"IntInput2")==0) return IntInput2Enum; 1006 1005 else if (strcmp(name,"BoolParam")==0) return BoolParamEnum; … … 1121 1120 else if (strcmp(name,"IceVolumeAboveFloatationScaled")==0) return IceVolumeAboveFloatationScaledEnum; 1122 1121 else if (strcmp(name,"IceVolume")==0) return IceVolumeEnum; 1122 else if (strcmp(name,"IceVolumeScaled")==0) return IceVolumeScaledEnum; 1123 1123 else stage=10; 1124 1124 } 1125 1125 if(stage==10){ 1126 if (strcmp(name,"IceVolumeScaled")==0) return IceVolumeScaledEnum; 1127 else if (strcmp(name,"IcefrontMassFlux")==0) return IcefrontMassFluxEnum; 1126 if (strcmp(name,"IcefrontMassFlux")==0) return IcefrontMassFluxEnum; 1128 1127 else if (strcmp(name,"IcefrontMassFluxLevelset")==0) return IcefrontMassFluxLevelsetEnum; 1129 1128 else if (strcmp(name,"Incremental")==0) return IncrementalEnum; … … 1244 1243 else if (strcmp(name,"Profiler")==0) return ProfilerEnum; 1245 1244 else if (strcmp(name,"ProfilingCurrentFlops")==0) return ProfilingCurrentFlopsEnum; 1245 else if (strcmp(name,"ProfilingCurrentMem")==0) return ProfilingCurrentMemEnum; 1246 1246 else stage=11; 1247 1247 } 1248 1248 if(stage==11){ 1249 if (strcmp(name,"ProfilingCurrentMem")==0) return ProfilingCurrentMemEnum; 1250 else if (strcmp(name,"ProfilingSolutionTime")==0) return ProfilingSolutionTimeEnum; 1249 if (strcmp(name,"ProfilingSolutionTime")==0) return ProfilingSolutionTimeEnum; 1251 1250 else if (strcmp(name,"Regionaloutput")==0) return RegionaloutputEnum; 1252 1251 else if (strcmp(name,"Regular")==0) return RegularEnum; -
issm/trunk-jpl/src/m/classes/slr.m
r24729 r24889 100 100 if ~ismember('SealevelriseAnalysis',analyses) | (strcmp(solution,'TransientSolution') & md.transient.isslr==0), 101 101 return; 102 end103 104 %check that the mask is a maskpsl class type, otherwise, we won't be able to run very far105 %with the slr solution:106 if ~strcmpi(class(md.mask),'maskpsl'),107 error('slr error message: model mask should be of the ''maskpsl'' class');108 102 end 109 103 -
issm/trunk-jpl/test/NightlyRun/test2002.m
r24862 r24889 29 29 %}}} 30 30 %mask: {{{ 31 md.mask=maskpsl(); % use maskpsl class (instead of mask) to store the ocean function as a ocean_levelset32 31 mask=gmtmask(md.mesh.lat,md.mesh.long); 33 34 32 icemask=ones(md.mesh.numberofvertices,1); 35 33 pos=find(mask==0); icemask(pos)=-1; 36 34 pos=find(sum(mask(md.mesh.elements),2)<3); icemask(md.mesh.elements(pos,:))=-1; 37 35 md.mask.ice_levelset=icemask; 38 md.mask.ocean_levelset=zeros(md.mesh.numberofvertices,1); 39 pos=find(md.mask.ice_levelset==1); md.mask.ocean_levelset(pos)=1; 40 41 %make sure that the ice level set is all inclusive: 42 md.mask.land_levelset=zeros(md.mesh.numberofvertices,1); 43 md.mask.ocean_levelset=-ones(md.mesh.numberofvertices,1); 36 md.mask.ocean_levelset=-icemask; 44 37 45 38 %make sure that the elements that have loads are fully grounded: -
issm/trunk-jpl/test/NightlyRun/test2003.m
r24862 r24889 27 27 %}}} 28 28 %mask: {{{ 29 md.mask=maskpsl(); % use maskpsl class (instead of mask) to store the ocean function as a ocean_levelset30 29 mask=gmtmask(md.mesh.lat,md.mesh.long); 31 32 30 icemask=ones(md.mesh.numberofvertices,1); 33 31 pos=find(mask==0); icemask(pos)=-1; 34 32 pos=find(sum(mask(md.mesh.elements),2)<3); icemask(md.mesh.elements(pos,:))=-1; 35 33 md.mask.ice_levelset=icemask; 36 md.mask.ocean_levelset=zeros(md.mesh.numberofvertices,1); 37 pos=find(md.mask.ice_levelset==1); md.mask.ocean_levelset(pos)=1; 38 39 %make sure that the ice level set is all inclusive: 40 md.mask.land_levelset=zeros(md.mesh.numberofvertices,1); 41 md.mask.ocean_levelset=-ones(md.mesh.numberofvertices,1); 34 md.mask.ocean_levelset=-icemask; 42 35 43 36 %make sure that the elements that have loads are fully grounded: … … 46 39 47 40 %make sure wherever there is an ice load, that the mask is set to ice: 48 pos=find(md.slr.deltathickness); md.mask.ice_levelset(md.mesh.elements(pos,:))=-1; 41 pos=find(md.slr.deltathickness); 42 md.mask.ice_levelset(md.mesh.elements(pos,:))=-1; 49 43 % }}} 50 44 -
issm/trunk-jpl/test/NightlyRun/test2010.m
r24862 r24889 30 30 %}}} 31 31 %mask: {{{ 32 md.mask=maskpsl(); % use maskpsl class (instead of mask) to store the ocean function as a ocean_levelset33 32 mask=gmtmask(md.mesh.lat,md.mesh.long); 34 35 33 icemask=ones(md.mesh.numberofvertices,1); 36 34 pos=find(mask==0); icemask(pos)=-1; 37 35 pos=find(sum(mask(md.mesh.elements),2)<3); icemask(md.mesh.elements(pos,:))=-1; 38 36 md.mask.ice_levelset=icemask; 39 md.mask.ocean_levelset=zeros(md.mesh.numberofvertices,1); 40 pos=find(md.mask.ice_levelset==1); md.mask.ocean_levelset(pos)=1; 41 42 %make sure that the ice level set is all inclusive: 43 md.mask.land_levelset=zeros(md.mesh.numberofvertices,1); 44 md.mask.ocean_levelset=-ones(md.mesh.numberofvertices,1); 37 md.mask.ocean_levelset=-icemask; 45 38 46 39 %make sure that the elements that have loads are fully grounded: … … 53 46 md.mask.ice_levelset(md.mesh.elements(pos,:))=-1; 54 47 % }}} 48 55 49 %geometry {{{ 56 50 di=md.materials.rho_ice/md.materials.rho_water;
Note:
See TracChangeset
for help on using the changeset viewer.