Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Open
Changes from 1 commit
Commits
Show all changes
75 commits
Select commit Hold shift + click to select a range
5162ce5
Adding routine for calculating GlaDS cross GL flux (total from both
RupertGladstone Jan 31, 2024
c26a49d
Renamed "workvar" to human readable names
RupertGladstone Jan 31, 2024
e3ea43f
tidying up "cycelement" decisions
RupertGladstone Jan 31, 2024
53ba4c7
Adding new switches (not active yet)...
RupertGladstone Jan 31, 2024
c9f2a19
New switches implemented for "calving", and masking code moved to fun…
RupertGladstone Feb 5, 2024
9b4e66b
Fixed null pointer to solverparams
RupertGladstone Feb 5, 2024
22e8c7e
Minor bug fixes re indexing
RupertGladstone Feb 19, 2024
a7a789c
Merge branch 'elmerice' into glads_gl
RupertGladstone Mar 26, 2024
db92053
updating grounded melt solver for GlaDS
RupertGladstone Apr 24, 2024
34ebbca
Adding option to not scale As according to effective pressure when co…
RupertGladstone Apr 24, 2024
9815eab
Merge branch 'elmerice' into glads_gl
RupertGladstone Apr 24, 2024
c5aee30
reduce output print in GroundedSolver
chekki2mo May 2, 2024
7119b72
bug fix for nonlinear Budd sliding in SSA
RupertGladstone May 4, 2024
c9d7f45
Add hybrid (between Schoof/Gag and Joughin versions) regularised coul…
RupertGladstone May 8, 2024
f66e2af
Integrated GMvalid with GroundedSolver.
RupertGladstone Jun 5, 2024
186f498
Bug fix 'SSA Friction need N' info statement
RupertGladstone Jun 16, 2024
9289819
updated info message from GroundedSolver
RupertGladstone Jun 17, 2024
ee11e86
Merge branch 'elmerice' into glads_gl
RupertGladstone Jun 17, 2024
0839761
Modifying GlaDS to use specified mask instead of compbined hard coded
RupertGladstone Jun 18, 2024
c3e49a6
Documentation Covariance Utils
fgillet Jun 20, 2024
957e54c
documentation
fgillet Jun 24, 2024
5673efa
add header to solver files
fgillet Jun 24, 2024
677c476
Add test cases for CovarianceVectorMutliply
fgillet Jun 24, 2024
d4e5860
add test BackgroundErrorCostSolver
fgillet Jun 24, 2024
c0c4b80
improve documentation
fgillet Jul 3, 2024
bd1dc91
updating GlaDS masking to optionally use the connectivity mask or gro…
RupertGladstone Jul 3, 2024
c1714a7
A selection of updates to get the calving-hydrology coupled model up-…
Morlocke Jul 3, 2024
9bd1878
Resolve merge conflict - we already get SolverParams before the First…
Morlocke Jul 3, 2024
9a39e40
Update Documentation
fgillet Jul 3, 2024
e5d05db
Update documentation
fgillet Jul 4, 2024
600e768
Further changes to make the calving-hydrology coupling work again - m…
Morlocke Jul 5, 2024
3a7e65e
Add max N to SSA sliding laws
RupertGladstone Jul 5, 2024
6b3d11d
Merge branch 'elmerice' into glads_gl
RupertGladstone Jul 5, 2024
f1bfbe1
tidying glads GL flux calcs
RupertGladstone Jul 15, 2024
77bbe42
Merge branch 'devel' into elmerice
tzwinger Jul 15, 2024
b77bd36
fix a bug in my earlier modifications based on Samuel's "calving" option
RupertGladstone Jul 17, 2024
b101091
GlaDSCoupledSolver: Bug fix to the looping for averaging the contribu…
RupertGladstone Jul 18, 2024
3bfb36c
Merge branch 'elmerice' into glads_gl
RupertGladstone Jul 18, 2024
e6a3590
(attempted to) fix calculation of GlaDS sheet contribution to flow ac…
RupertGladstone Jul 19, 2024
ad89e80
Allow both min and max coupled iterations to be specified for GlaDSCo…
RupertGladstone Jul 26, 2024
ab286f7
Adding connectivity option for grounded mask to remove isolated groun…
RupertGladstone Aug 8, 2024
0516cc9
updating connectivity mask options to allow for removal of isolated
RupertGladstone Aug 9, 2024
203f4e3
Updates to PlumeSolver to fix a case where a plume actually has a co-…
Morlocke Aug 14, 2024
66182aa
Now with all that old code taken out!
Morlocke Aug 14, 2024
c91ae73
Minor tweak to GlaDS and PlumeSolver to allow the plumes to use the n…
Morlocke Aug 16, 2024
e0e220d
Added user option to define mask name for SSA sliding (default still …
RupertGladstone Sep 25, 2024
9a05add
Additional hybrid RC sliding parameterisation for SSA
RupertGladstone Sep 25, 2024
6aa7bc7
Merge branch 'devel' into elmerice
tzwinger Sep 25, 2024
8938d56
Report SSA friction mask name at info level 5
RupertGladstone Sep 26, 2024
613c35d
Merge branch 'elmerice' into glads_gl
RupertGladstone Sep 26, 2024
ee057a9
Allow SSA code to use a different grounded mask by setting
RupertGladstone Oct 4, 2024
b1e79a0
Merge branch 'devel' into elmerice
RupertGladstone Oct 16, 2024
85ff151
Max sheet thickness for GlaDS applied after sheet thickness update.
RupertGladstone Oct 16, 2024
1bd4a7b
Merge branch 'elmerice' into glads_gl
RupertGladstone Oct 16, 2024
d0891c6
Allow 3D velocity for calculting sliding speed in grounded melt solver
RupertGladstone Oct 30, 2024
03c0035
tweaking adaptive timestepping info statements
RupertGladstone Oct 30, 2024
797cae6
reduced info level of adaptivity info from 12 to 7
RupertGladstone Nov 13, 2024
97773a1
Merge branch 'devel' into elmerice
RupertGladstone Nov 13, 2024
d5e3329
Merge branch 'elmerice' into glads_gl
RupertGladstone Nov 13, 2024
1ef1cce
Allow 4D flow solution to be passed to grounded melt solver (ignores …
RupertGladstone Nov 13, 2024
7cd61d8
Committing Yu Wang's option to use regularised Coulomb sliding in SSA…
RupertGladstone Nov 13, 2024
5c94823
Merge branch 'devel' into elmerice
RupertGladstone Dec 23, 2024
522baf2
Merge branch 'elmerice' into glads_gl
RupertGladstone Dec 23, 2024
d5f1b20
resolve minor merge error in GroundedSolver.F90
RupertGladstone Dec 23, 2024
2141fad
Merge branch 'devel' into glads_gl
RupertGladstone Feb 5, 2025
25fff6c
Debug MeshUtils change re InDofs.
RupertGladstone Feb 6, 2025
4190773
Additional optional hydrology-based checks for calculating grounded melt
RupertGladstone Feb 12, 2025
67ce4d8
Merge branch 'devel' into glads_gl
RupertGladstone Feb 18, 2025
5fac6cd
Merge branch 'devel' into glads_gl
RupertGladstone Feb 26, 2025
20a8fc1
Update MeshUtils.F90
Morlocke Mar 4, 2025
250a319
Update SolverUtils.F90
Morlocke Mar 4, 2025
27279f0
Update SolverUtils.F90
Morlocke Mar 5, 2025
f6de99b
Update SolverUtils.F90
Morlocke Mar 5, 2025
7964163
Update SolverUtils.F90
Morlocke Mar 5, 2025
d0c7a38
channels hack for the case of a retreating grounding line
RupertGladstone Jul 16, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
updating grounded melt solver for GlaDS
  • Loading branch information
RupertGladstone committed Apr 24, 2024
commit db9205340332d02f6934ec1e6ee4074413d8d5ca
185 changes: 109 additions & 76 deletions elmerice/Solvers/GlaDSCoupledSolver.F90
Original file line number Diff line number Diff line change
Expand Up @@ -2681,6 +2681,8 @@ SUBROUTINE GlaDS_GLflux( Model,Solver,dt,TransientSimulation )
! Sum nodal values for nodes that exist on multiple partitions
CALL ParallelSumVector(Solver % Matrix, cglfVals)

GLfluxVals = 0.0

DO nn = 1, numNodes
IF (gmPerm(nn).le.0) CYCLE
! IF (gmVals(gmPerm(nn)).eq.0) GLfluxVals(GLfluxPerm(nn)) = volFluxSheet + volFluxChannel
Expand Down Expand Up @@ -2733,26 +2735,21 @@ END SUBROUTINE GlaDS_GLflux
! Weights variable name = String "Friction heating boundary weights"
!
!
! Notes when using this with a 2D SSA setup:
!
! Assuming we don't have nodal heat, we can calculate a friction heat if we
! know about the sliding law and the relevant parameters
!
! Grounded Melt = Variable ssavelocity 1, ssavelocity 2, beta
! Real lua "((tx[0]^2.0+tx[1]^2.0)*10.0^tx[2])/(rhoi*Lf)"
!
! SSA Mean Density = Real #rhoi
!
!
! Which law are we using (linear, weertman , coulomb or regularised coulomb)
! SSA Friction Law = String "coulomb"
! SSA Friction Parameter = Variable "Coulomb As"
! Real Lua "tx[0]^(-1/3)"
! SSA Friction Maximum Value = Equals "Coulomb C"
! SSA Friction Post-Peak = Real 1.0
! SSA Friction Exponent = Real #1.0/n


! Heat is Mega Joules per year.
! We multiply by 10^6 to convert from Mega Joules to Joules.
!

! Different modes of operation.
! "heat" - a variable providing nodal heat (e.g. could be residual from temperate ice solver) is used
! to calculate the melt rate. Weights (based on area) are also needed in this case.
!
! MeltRate = Heat / (area * density * latent_heat)
!
! "friction" - a sliding velocity variable is provided and used by this routine to calculate basal shear
! stress, which is then used (along with the effective linear sliding coefficient ("ceff",
! see SSASolver.F90), to calculate melt based on friction heat.
!
RECURSIVE SUBROUTINE GroundedMelt( Model,Solver,Timestep,TransientSimulation )

USE DefUtils
Expand All @@ -2769,82 +2766,118 @@ RECURSIVE SUBROUTINE GroundedMelt( Model,Solver,Timestep,TransientSimulation )
!------------------------------------------------------------------------------
! Local variables
!------------------------------------------------------------------------------
TYPE(ValueList_t), POINTER :: SolverParams
TYPE(Variable_t), POINTER :: MeltVar, WeightsVar, HeatVar, GHFVar
TYPE(ValueList_t), POINTER :: SolverParams, Material
TYPE(Variable_t), POINTER :: MeltVar, WeightsVar, HeatVar, GHFVar, Ceffvar, UbVar
LOGICAL, SAVE :: FirstTime = .TRUE., UseGHF = .FALSE.
LOGICAL :: Found
CHARACTER(LEN=MAX_NAME_LEN) :: MyName = 'GroundedMelt solver', HeatVarName, WeightsVarName, GHFvarName
REAL(KIND=dp),PARAMETER :: rho = 1000.0_dp ! density of pure water
CHARACTER(LEN=MAX_NAME_LEN) :: MyName = 'Grounded Melt solver', HeatVarName, WeightsVarName, GHFvarName
CHARACTER(LEN=MAX_NAME_LEN) :: MeltMode, CeffVarName, UbVarName
REAL(KIND=dp) :: rho_fw ! density of fresh water
REAL(KIND=dp),PARAMETER :: threshold = 0.001_dp ! threshold friction melt rate for including GHF in melt calc
REAL(KIND=dp), POINTER :: WtVals(:), HeatVals(:), MeltVals(:), GHFVals(:)
REAL(KIND=dp) :: LatHeat, GHFscaleFactor
INTEGER, POINTER :: WtPerm(:), HeatPerm(:), MeltPerm(:), GHFPerm(:)
REAL(KIND=dp), POINTER :: WtVals(:), HeatVals(:), MeltVals(:), GHFVals(:), Ceffvals(:), UbVals(:)
REAL(KIND=dp) :: LatHeat, GHFscaleFactor, Ub(1)
INTEGER, POINTER :: WtPerm(:), HeatPerm(:), MeltPerm(:), GHFPerm(:), Ceffperm(:), UbPerm(:)
INTEGER :: nn

! IF (FirstTime) THEN
! CALL CalculateNodalWeights(Solver, .FALSE., VarName='Weights')
! CALL CalculateNodalWeights(Solver, .FALSE.)
! CALL CalculateNodalWeights(Solver, .TRUE.)
! FirstTime = .FALSE.
! END IF


rho_fw = ListGetConstReal( Model % Constants, 'Fresh Water Density', Found )
IF (.NOT.Found) CALL FATAL(MyName, 'Constant >Fresh Water Density< not found')
LatHeat = ListGetConstReal( Model % Constants, 'Latent Heat', Found)
IF (.NOT.Found) CALL Fatal(MyName, '>Latent Heat< not found in constants')

MeltVar => Solver%Variable
MeltVals => MeltVar%Values
MeltPerm => MeltVar%Perm

SolverParams => GetSolverParams()

MeltMode = GetString(SolverParams,'Melt mode', Found)
IF(.NOT.Found) CALL Fatal(MyName, '>Melt mode< not found in solver params')

SELECT CASE (MeltMode)

CASE ("heat")
HeatVarName = GetString(SolverParams,'heat variable name', Found)
IF(.NOT.Found) CALL Fatal(MyName, '>Heat variable name< not found in solver params')
WeightsVarName = GetString(SolverParams,'Weights variable name', Found)
IF(.NOT.Found) CALL Fatal(MyName, '>Weights variable name< not found in solver params')

HeatVar => VariableGet(Model % Variables, HeatVarName, ThisOnly = .TRUE., UnfoundFatal = .TRUE.)
HeatVals => HeatVar%Values
HeatPerm => HeatVar%Perm

WeightsVar => VariableGet(Model % Variables, WeightsVarName, ThisOnly = .TRUE., UnfoundFatal = .TRUE.)
WtVals => WeightsVar%Values
WtPerm => WeightsVar%Perm

CASE ("friction")
UbVarName = GetString(SolverParams,'Ub variable name', Found)
IF (.NOT.Found) UbVarName = "SSAVelocity"
CeffVarName = GetString(SolverParams,'Ceff variable name', Found)
IF (.NOT.Found) CeffVarName = "Ceff"

CeffVar => VariableGet(Model % Variables, CeffVarName, ThisOnly = .TRUE., UnfoundFatal = .TRUE.)
CeffVals => CeffVar%Values
CeffPerm => CeffVar%Perm

UbVar => VariableGet(Model % Variables, UbVarName, ThisOnly = .TRUE., UnfoundFatal = .TRUE.)
UbVals => UbVar%Values
UbPerm => UbVar%Perm

IF (UbVar % DOFS .NE. 2) THEN
CALL Fatal(MyName, 'Expecting Ub variable to be 2D')
END IF
! Material => GetMaterial() ! get sliding velocity from material

CASE DEFAULT
CALL Fatal(MyName, 'MeltMode not recognised')

END SELECT

GHFvarName = GetString(SolverParams,'GHF variable name', Found)
IF (Found) THEN
UseGHF = .TRUE.
GHFscaleFactor = GetConstReal( Model % Constants, 'GHF scale factor', Found)
IF(.NOT.Found) GHFscaleFactor = 1.0
UseGHF = .TRUE.
GHFscaleFactor = GetConstReal( Model % Constants, 'GHF scale factor', Found)
IF(.NOT.Found) GHFscaleFactor = 1.0
ELSE
UseGHF = .FALSE.
UseGHF = .FALSE.
END IF

LatHeat = GetConstReal( Model % Constants, 'Latent Heat', Found)
IF(.NOT.Found) CALL Fatal(MyName, '>Latent Heat< not found in constants')

HeatVarName = GetString(SolverParams,'heat variable name', Found)
IF(.NOT.Found) CALL Fatal(MyName, '>Heat variable name< not found in solver params')
WeightsVarName = GetString(SolverParams,'Weights variable name', Found)
IF(.NOT.Found) CALL Fatal(MyName, '>Weights variable name< not found in solver params')


IF (UseGHF) THEN
GHFVar => VariableGet(Model % Variables, GHFvarName, ThisOnly = .TRUE., UnfoundFatal = .TRUE.)
GHFVals => GHFVar%Values
GHFPerm => GHFVar%Perm
GHFVar => VariableGet(Model % Variables, GHFvarName, ThisOnly = .TRUE., UnfoundFatal = .TRUE.)
GHFVals => GHFVar%Values
GHFPerm => GHFVar%Perm
END IF

HeatVar => VariableGet(Model % Variables, HeatVarName, ThisOnly = .TRUE., UnfoundFatal = .TRUE.)
HeatVals => HeatVar%Values
HeatPerm => HeatVar%Perm

WeightsVar => VariableGet(Model % Variables, WeightsVarName, ThisOnly = .TRUE., UnfoundFatal = .TRUE.)
WtVals => WeightsVar%Values
WtPerm => WeightsVar%Perm

MeltVar => Solver%Variable
MeltVals => MeltVar%Values
MeltPerm => MeltVar%Perm

LoopAllNodes: DO nn=1,Solver % Mesh % NumberOfNodes

!
! MeltRate = Heat / (area * density * latent_heat)
!
! Heat is Mega Joules per year.
! We multiply by 10^6 to convert from Mega Joules to Joules.
!
IF (MeltPerm(nn).GT.0) THEN
MeltVals(MeltPerm(nn)) = ABS( 1.0e6 * HeatVals(HeatPerm(nn)) ) / ( WtVals(WtPerm(nn)) * rho * LatHeat )
IF (UseGHF) THEN
! Scaled GHF is in Mega Joules per m^2 per year.
MeltVals(MeltPerm(nn)) = MeltVals(MeltPerm(nn)) + &
( GHFVals(GHFPerm(nn))*GHFscaleFactor*1.0e6 ) / ( rho*LatHeat )
END IF
END IF
IF (MeltPerm(nn).GT.0) THEN

SELECT CASE (MeltMode)
CASE ("heat")
MeltVals(MeltPerm(nn)) = ABS( 1.0e6 * HeatVals(HeatPerm(nn)) ) / ( WtVals(WtPerm(nn)) * rho_fw * LatHeat )
CASE ("friction")
Ub = (UbVals(2*(UbPerm(nn)-1)+1)**2 + UbVals(2*(UbPerm(nn)-1)+2)**2)**0.5
! Ub(1:1) = ListGetReal( Material, 'Sliding Velocity', 1, [nn], Found, UnfoundFatal = .TRUE. )
MeltVals(MeltPerm(nn)) = (Ub(1)**2 * CeffVals(CeffPerm(nn)) ) / ( rho_fw * LatHeat )
END SELECT

IF (UseGHF) THEN
! Scaled GHF is in Mega Joules per m^2 per year.
MeltVals(MeltPerm(nn)) = MeltVals(MeltPerm(nn)) + &
( GHFVals(GHFPerm(nn))*GHFscaleFactor*1.0e6 ) / ( rho_fw*LatHeat )
END IF
END IF

END DO LoopAllNodes

NULLIFY(HeatVar, HeatVals, HeatPerm, WeightsVar, WtVals, WtPerm, MeltVar, MeltVals, MeltPerm)
SELECT CASE(MeltMode)
CASE("heat")
NULLIFY(HeatVar, HeatVals, HeatPerm, WeightsVar, WtVals, WtPerm)
CASE("friction")
NULLIFY(CeffVar, CeffVals, CeffPerm)
END SELECT
NULLIFY(MeltVar, MeltVals, MeltPerm)
IF (UseGHF) THEN
NULLIFY(GHFVar, GHFVals, GHFPerm)
END IF
Expand Down