Skip to content

Commit

Permalink
Merge pull request #42 from rqthomas/master
Browse files Browse the repository at this point in the history
fixing ice issue
  • Loading branch information
casper-boon authored Mar 22, 2024
2 parents df5754d + 370f82f commit 8d0b250
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/glm_surface.c
Original file line number Diff line number Diff line change
Expand Up @@ -995,6 +995,24 @@ void do_surface_thermodynamics(int jday, int iclock, int LWModel,
Lake[onshoreLayer].Temp += dTemp;
}

/**************************************************************************
* Check if the ice melted in code above
*************************************************************************/
if ((SurfData.delzBlueIce+SurfData.delzWhiteIce) < min_ice_thickness && ice) {
Lake[surfLayer].Height = Lake[surfLayer].Height
+ SurfData.delzBlueIce * (rho_ice_blue/Lake[surfLayer].Density)
+ SurfData.delzWhiteIce * (rho_ice_white/Lake[surfLayer].Density)
+ SurfData.delzSnow * (rho_snow/Lake[surfLayer].Density);

recalc_surface_salt();

ice = FALSE;
SurfData.delzBlueIce = 0.0;
SurfData.delzWhiteIce = 0.0;
SurfData.delzSnow = 0.0;
}


/***************************************************************************
* ICE MELTING & FREEZING @ BOTTOM
* The change in ice thickness at the bottom can now be determined
Expand Down

0 comments on commit 8d0b250

Please sign in to comment.