Changeset 26736


Ignore:
Timestamp:
12/14/21 13:28:09 (3 years ago)
Author:
Mathieu Morlighem
Message:

CHG: adding GL migration

Location:
issm/trunk-jpl/src/jl/core
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/jl/core/analyses/masstransportanalysis.jl

    r26731 r26736  
    3636        FetchDataToInput(md,inputs,elements,md.geometry.surface,SurfaceEnum)
    3737        FetchDataToInput(md,inputs,elements,md.geometry.base,BaseEnum)
     38        FetchDataToInput(md,inputs,elements,md.geometry.bed,BedEnum)
    3839        FetchDataToInput(md,inputs,elements,md.basalforcings.groundedice_melting_rate./md.constants.yts,BasalforcingsGroundediceMeltingRateEnum)
    3940        FetchDataToInput(md,inputs,elements,md.basalforcings.floatingice_melting_rate./md.constants.yts,BasalforcingsFloatingiceMeltingRateEnum)
     
    238239        oldsurface   = Vector{Float64}(undef,3)
    239240        phi          = Vector{Float64}(undef,3)
     241        bed          = Vector{Float64}(undef,3)
    240242        GetInputListOnVertices!(element, newthickness, ThicknessEnum)
    241243   GetInputListOnVertices!(element, oldthickness, ThicknessOldEnum)
     
    243245   GetInputListOnVertices!(element, oldsurface, SurfaceOldEnum)
    244246   GetInputListOnVertices!(element, phi, MaskOceanLevelsetEnum)
     247        GetInputListOnVertices!(element, bed, BedEnum)
    245248   sealevel = zeros(3)
    246249        newsurface = Vector{Float64}(undef,3)
     
    250253      if(phi[i]>0.)
    251254         #this is grounded ice: just add thickness to base.
    252          newsurface[i] = bed[i]+newthickness[i]; #surface = bed + newthickness
    253          newbase[i]    = bed[i];                 #new base at new bed
     255         newsurface[i] = bed[i]+newthickness[i] #surface = bed + newthickness
     256         newbase[i]    = bed[i]                 #new base at new bed
    254257      else
    255258         #this is an ice shelf: hydrostatic equilibrium
  • issm/trunk-jpl/src/jl/core/analyses/transientanalysis.jl

    r26731 r26736  
    3333      if(isstressbalance) Core(StressbalanceAnalysis(), femmodel) end
    3434      if(ismasstransport) Core(MasstransportAnalysis(), femmodel) end
     35                MigrateGroundinglinex(femmodel)
    3536
    3637                step+=1
  • issm/trunk-jpl/src/jl/core/elements.jl

    r26731 r26736  
    257257        return sqrt(2*GetArea(element))
    258258end#}}}
     259function MigrateGroundingLine(element::Tria) #{{{
     260
     261        h = Vector{Float64}(undef,3)
     262        s = Vector{Float64}(undef,3)
     263        b = Vector{Float64}(undef,3)
     264        r = Vector{Float64}(undef,3)
     265        phi = Vector{Float64}(undef,3)
     266        sl = zeros(3)
     267        GetInputListOnVertices!(element, h, ThicknessEnum)
     268        GetInputListOnVertices!(element, s, SurfaceEnum)
     269        GetInputListOnVertices!(element, b, BaseEnum)
     270        GetInputListOnVertices!(element, r, BedEnum)
     271        #GetInputListOnVertices(element, sl, SealevelEnum)
     272        GetInputListOnVertices!(element, phi, MaskOceanLevelsetEnum)
     273
     274
     275        rho_water   = FindParam(element, MaterialsRhoSeawaterEnum)
     276        rho_ice     = FindParam(element, MaterialsRhoIceEnum)
     277        density     = rho_ice/rho_water
     278
     279        for i in 1:3
     280
     281                if(phi[i]<=0)
     282                        #reground if base is below bed
     283                        if(b[i]<=r[i])
     284                                b[i] = r[i]
     285                                s[i] = b[i]+h[i]
     286                        end
     287                else
     288                        bed_hydro=-density*h[i]+sl[i];
     289                        if (bed_hydro>r[i])
     290                                #Unground only if the element is connected to the ice shelf
     291                                s[i] = (1-density)*h[i]+sl[i]
     292                                b[i] = -density*h[i]+sl[i]
     293                        end
     294                end
     295
     296                #recalculate phi
     297                phi[i]=h[i]+(r[i]-sl[i])/density
     298        end
     299
     300        #Update inputs
     301        AddInput(element,MaskOceanLevelsetEnum,phi,P1Enum)
     302        AddInput(element,SurfaceEnum,s,P1Enum)
     303        AddInput(element,BaseEnum,b,P1Enum)
     304
     305end#}}}
    259306
    260307#Finite Element stuff
  • issm/trunk-jpl/src/jl/core/modules.jl

    r26731 r26736  
    313313        end
    314314end# }}}
     315function MigrateGroundinglinex(femmodel::FemModel)# {{{
     316
     317        for i=1:length(femmodel.elements)
     318                MigrateGroundingLine(femmodel.elements[i])
     319        end
     320
     321end# }}}
Note: See TracChangeset for help on using the changeset viewer.