At start of timestep, if time is a multiple of shelficeremeshfrequencey, call shelfice remeshing. Shelfice_Remeshing calls the following subroutines in turn. Subroutines with JJ have been modified, those without are at present unmodified. INI_MASKS_ETC_JJ - Ro_surf set to 0, otherwise causes issues with shelfice_update_masks CALL SHELFICE_UPDATE_MASKS_JJ Set hFacs to 1 or 0. Set h0Facs. Generate masks. Generate ksurfs Mask U and V velocities on ice boundaries resulting from remeshing SHELFICE_UPDATE_MASKS_JJ - Called from within INI_MASKS_JJ Comment out initialising R_shelfice Main Remesh Loop. IF etaN is > SHELFICESplitThreshold, or < SHELFICEMergeThreshold then the following variables are updated etaN, etaH, etaHnm1, R_shelfice, uVel, vVel,gvnm1, gunm1, salt, theta, hFac_surfC, hFac_surfnm1C hFacs of 1 and 0 updated to reflect shelfice extent. OBCS_INIT_FIXED - Corrects MaskIn to allow for Obcs INI_LINEAR_PHISURF -initialise Bo_surf and phisurf INI_CG2D - initialise CG variables CALC_SURF_DR - Calculate hFac_surfs and hFac_surfw from hFac_surfc CALC_SURF_DR - Called 2nd time to update hfac_surfnm1 UPDATE_SURF_DR - update hFacs based on hFac_surfs UPDATE_CG2D - update CG variable based on hFacs UPDATE_SURF_DR - update hFacs based on hFac_surfs INTEGR_CONTINUITY - Generate Wvel based on Uvel and Vvel