Skip to content

Commit

Permalink
Add scale output depend on the result enum
Browse files Browse the repository at this point in the history
  • Loading branch information
enigne committed Apr 12, 2024
1 parent 193fc68 commit b565ad8
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions src/core/modules.jl
Original file line number Diff line number Diff line change
Expand Up @@ -153,13 +153,15 @@ function OutputResultsx(femmodel::FemModel, md::model, solutionkey::Symbol)# {{{
for i in 1:length(femmodel.results)
result = femmodel.results[i]
step = femmodel.results[i].step
(output[step])[EnumToString(result.enum)] = result.value
scale = OutputEnumToScale(md, result.enum)
(output[step])[EnumToString(result.enum)] = result.value .* scale
end
else
output = Dict()
for i in 1:length(femmodel.results)
result = femmodel.results[i]
output[EnumToString(result.enum)] = result.value
scale = OutputEnumToScale(md, result.enum)
output[EnumToString(result.enum)] = result.value .* scale
end
end

Expand Down Expand Up @@ -421,3 +423,14 @@ function GetMaskOfIceVerticesLSMx0(femmodel::FemModel) #{{{

return nothing
end#}}}
function OutputEnumToScale(md::model, result::IssmEnum) #{{{
if (result == VxEnum) scale = md.constants.yts
elseif (result == VyEnum) scale = md.constants.yts
elseif (result == VzEnum) scale = md.constants.yts
elseif (result == VelEnum) scale = md.constants.yts
elseif (result == CalvingCalvingrateEnum) scale = md.constants.yts
else scale = 1.0
end

return scale
end#}}}

0 comments on commit b565ad8

Please sign in to comment.