From 0a57bf81382c3695eb8ab9bb8265044a164281de Mon Sep 17 00:00:00 2001 From: inwoo-simba Date: Tue, 3 Jun 2025 21:25:56 +0900 Subject: [PATCH 001/126] CHG: Matlab > Python: "processdata.py" supports selecting layer in 3D model. However, "depthaverage" is not supported. --- src/m/plot/processdata.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) mode change 100644 => 100755 src/m/plot/processdata.py diff --git a/src/m/plot/processdata.py b/src/m/plot/processdata.py old mode 100644 new mode 100755 index 1455a2332..aec145ca5 --- a/src/m/plot/processdata.py +++ b/src/m/plot/processdata.py @@ -1,5 +1,6 @@ import numpy as np - +from project2d import project2d +from DepthAverage import DepthAverage def processdata(md, data, options): """PROCESSDATA - process data to be plotted @@ -150,6 +151,14 @@ def processdata(md, data, options): procdata = procdata / repeat # }}} + + # layer procesiong? {{{ + if options.getfieldvalue('layer',0)>=1: + procdata=project2d(md,data,options.getfieldvalue('layer')) + + if options.getfieldvalue('depthaverage',0): + raise Exception('Error: "depthaverage" option is not supported in Python.') + procdata=DepthAverage(md,data) #project onto 2d mesh # }}} # spc time series {{{ From a0aa6a31ab31aecf0f363dadb8ca9a86754cd47a Mon Sep 17 00:00:00 2001 From: inwoo-simba Date: Thu, 12 Jun 2025 23:36:02 +0900 Subject: [PATCH 002/126] CHG: add plot_landsat.py for drawing background RGB image with Landsat dataset. --- src/m/plot/plot_landsat.py | 175 +++++++++++++++++++++++++++++++++++++ src/m/plot/plot_manager.py | 6 ++ 2 files changed, 181 insertions(+) create mode 100755 src/m/plot/plot_landsat.py diff --git a/src/m/plot/plot_landsat.py b/src/m/plot/plot_landsat.py new file mode 100755 index 000000000..29a7b96f0 --- /dev/null +++ b/src/m/plot/plot_landsat.py @@ -0,0 +1,175 @@ +#!/usr/bin/env python3 +import socket +import copy +import numpy as np +import matplotlib.pyplot as plt +from cmaptools import getcolormap +from processmesh import processmesh +from processdata import processdata +from InterpFromMeshToGrid import InterpFromMeshToGrid +from InterpFromMeshToMesh2d import InterpFromMeshToMesh2d +from applyoptions import applyoptions + +def plot_landsat(md,data,options,fig,axgrid,gridindex): + """ + Explain + ------- + This funtion loads Landsat Image Mosaic Antarctica (LIMA) for background image. + + Usage + ----- + plot_landsat(md,data,options,plotlines,plotcols,i) + """ + + #process mesh and data + x2d, y2d, z2d, elements2d, is2d, isplanet=processmesh(md,[],options) + data, datatype=processdata(md,data,options) + + #check is2d + if not is2d: + raise Exception('buildgridded error message: gridded not supported for 3d meshes, project on a layer') + + #Get options + hostname = socket.gethostname().lower().replace('-','') + transparency = options.getfieldvalue('transparency',.2) + highres = options.getfieldvalue('highres',0) + isunit = options.getfieldvalue('unit',1) + + #Get xlim, and ylim + xlim=options.getfieldvalue('xlim',np.array([min(x2d),max(x2d)]))/isunit + ylim=options.getfieldvalue('ylim',np.array([min(y2d),max(y2d)]))/isunit + + pwr = md.radaroverlay.pwr + xm = md.radaroverlay.x + ym = md.radaroverlay.y + if md.mesh.epsg == 3031 & np.size(pwr)==0 | np.size(xm)==0 | np.size(ym) == 0: + #Antarctica region + if highres: + print(' LIMA with geotiff') # {{{ + + # find merged mosaic landsat image + limapath = {'simba00':'/drive/project_inwoo/issm/Data/LIMA/AntarcticaLandsat.tif'}; + limapath = limapath[hostname] + print(' LIMA path is %s'%(limapath)) + + # read image + #im = imread(limapath); + + ## Region of LIMA data set + #info = gdalinfo(limapath); # get geotiff info + #xm = info.xmin + info.dx*np.arange(info.nx) + #ym = info.ymax - info.dy*np.arange(info.ny) + + ## find region of model at LIMA + #offset = 1e+4; + #posx = np.where((xm > xlim[0]-offset)&(xm < xlim[1]+offset))[0] + #posy = np.where((ym > ylim[0]-offset)&(ym < ylim[1]+offset))[0] + # }}} + else: + print(' LIMA with reduced tiff') # {{{ + #Find merged mosaic landsat image + limapath = {'inwoob85md3h':'/drive/project_inwoo/issm/Data/LIMA/tiff_90pct/00000-20080319-092059124.tif', + 'simba00':'/home/inwoo/data/LIMA/tiff_90pct/00000-20080319-092059124.tif'} + if not hostname in limapath.keys(): + raise Exception('Error: Landsat image at Antarctic region is downloaded at https://lima.usgs.gov/fullcontinent.php. Download geotiff image using "wget -c https://lima.usgs.gov/tiff_90pct.zip -O tiff_90pct.zip"'); + + limapath = limapath[hostname] + print(' LIMA path is %s'%(limapath)) + + # read image + #im = imread(limapath) + + ## Region of LIMA data set + #info = gdalinfo(limapath) # get geotiff info + #xm = info.xmin + info.dx*np.arange(info.nx) + #ym = info.ymax - info.dy*np.arange(info.ny) + + ## find region of model at LIMA + #offset = 1e+4 + #posx = np.where((xm > xlim[0]-offset)&(xm < xlim[1]+offset))[0] + #posy = np.where((ym > ylim[0]-offset)&(ym < ylim[1]+offset))[0] + # }}} + + # Update region of radaroverlay + md.radaroverlay.x = xm[posx] + md.radaroverlay.y = ym[posy] + md.radaroverlay.pwr = im[posy, posx,:] + elif md.mesh.epsg == 3431 & np.size(pwr)==0 | np.size(xm)==0 | np.size(ym) == 0: + #Greenland region + raise Exception('Greenland region is not yet available.') + + #Check dataset. + if (np.size(pwr)>0) & (np.size(xm)>0) & (np.size(ym)>0): + #Existing radaroverlay + if np.ndim(pwr) != 3: + raise Exception('Error: Check np.ndim(md.radaroverlay.pwr) should be equal to 3.') + + #Check image size + #shape of image should be (ny, nx, band) + nx = len(xm) + ny = len(ym) + if (np.shape(pwr)[0]==nx) & (np.shape(pwr)[1]==ny): + pwr = np.transpose(pwr,[1,0,2]) + + #Close-up to specific xlim + posx = np.where((xlim[0]<=xm)&(xm<=xlim[1]))[0] + posy = np.where((ylim[0]<=ym)&(ym<=ylim[1]))[0] + xm = xm[posx] + ym = ym[posy] + pwr = pwr[posy[0]:posy[-1]+1,posx[0]:posx[-1]+1,:] + else: + raise Exception('Error: data array in md.radaroverlay is not implemented yet.') + + #Prepare grid + if np.ndim(xm) == 1: + data_grid=InterpFromMeshToGrid(elements2d+1,x2d/isunit,y2d/isunit,data,xm,ym,np.nan) + else: + data_grid=InterpFromMeshToMesh2d(elements2d+1,x2d,y2d,data,np.ravel(xm),np.ravel(ym),'default',np.nan) + data_grid=np.reshape(data_grid,np.shape(xm)) + + data_nan=np.isnan(data_grid) + if options.exist('caxis'): + caxis_opt=options.getfieldvalue('caxis') + data_grid[np.where(data_gridcaxis_opt[1])]=caxis_opt[1] + data_min=caxis_opt[0]; + data_max=caxis_opt[1]; + else: + data_min=np.nanmin(data_grid) + data_max=np.nanmax(data_grid) + + options.addfielddefault('colormap',plt.cm.viridis) + cmap = getcolormap(copy.deepcopy(options)) + #TODO: Matlab version + #image_rgb = ind2rgb(uint16((data_grid - data_min)*(length(colorm)/(data_max-data_min))),colorm); + #NOTE: Python version for ind2rgb + image_rgb = cmap((data_grid-data_min)/(data_max-data_min)) + + alpha=np.ones(np.shape(data_grid)) + alpha[np.where(~data_nan)]=transparency + alpha=np.repeat(alpha[:,:,np.newaxis],axis=2,repeats=3) + + final=alpha*(pwr/255)+(1-alpha)*image_rgb[:,:,:3] + + #Select plot area + ax = axgrid[gridindex] + + xmin = min(xm)/isunit + xmax = max(xm)/isunit + ymin = min(ym)/isunit + ymax = max(ym)/isunit + #Draw RGB image + h=ax.imshow(final, extent=[xmin, xmax, ymin, ymax], origin='lower') + + #last step: mesh gridded? + if options.exist('edgecolor'): + ax.triplot(x,y,triangles=elements, + color=options.getfieldvalue('edgecolor'), + linewdith=options.getfieldvalue('linewidth',1), + ) + + #Apply options + if ~np.isnan(data_min): + options.changefieldvalue('caxis',[data_min, data_max]) # force caxis so that the colorbar is ready + options.addfielddefault('axis','xy equal off') # default axis + applyoptions(md,data,options,fig,axgrid,gridindex) diff --git a/src/m/plot/plot_manager.py b/src/m/plot/plot_manager.py index 053419ef3..e79405222 100755 --- a/src/m/plot/plot_manager.py +++ b/src/m/plot/plot_manager.py @@ -17,6 +17,7 @@ from processdata import processdata from processmesh import processmesh from plot_gridded import plot_gridded +from plot_landsat import plot_landsat def plot_manager(md, options, fig, axgrid, gridindex): @@ -82,6 +83,11 @@ def plot_manager(md, options, fig, axgrid, gridindex): else: print(("WARNING: '%s' is not implemented or is not a valid string for option 'data'" % data)) # }}} + # {{{ Landsat plot + if options.getfieldvalue('landsat',0): + plot_landsat(md,data,options,fig,axgrid,gridindex) + return + # }}} # {{{ Gridded plot TODO if options.exist('gridded'): plot_gridded(md,data,options,fig,axgrid,gridindex) From b4fa6fca4e0c7655ca8d5bf4861f45a154de336a Mon Sep 17 00:00:00 2001 From: inwoo-simba Date: Fri, 13 Jun 2025 01:00:31 +0900 Subject: [PATCH 003/126] CHG: plotmodel.py - Fix colorbar option. Use colobar=None, not "None", that the string type does not work in ImageGrid. --- src/m/plot/plotmodel.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) mode change 100644 => 100755 src/m/plot/plotmodel.py diff --git a/src/m/plot/plotmodel.py b/src/m/plot/plotmodel.py old mode 100644 new mode 100755 index 0b2c4849d..436002497 --- a/src/m/plot/plotmodel.py +++ b/src/m/plot/plotmodel.py @@ -97,7 +97,7 @@ def plotmodel(md, *args): elif colorbar == 'one': colorbar = 'single' elif colorbar == 'off': - colorbar = 'None' + colorbar = None else: raise RuntimeError('plotmodel error: colorbar mode \'{}\' is not a valid option'.format(colorbar)) From 480f4c39eaaeca66cdaa6f44576a58a25e554f10 Mon Sep 17 00:00:00 2001 From: inwoo-simba Date: Fri, 13 Jun 2025 01:01:11 +0900 Subject: [PATCH 004/126] CHG: applyoptions.py - Fix "box" option, not using "eval" function. --- src/m/plot/applyoptions.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/m/plot/applyoptions.py b/src/m/plot/applyoptions.py index a4a7fdfdb..004cad1fe 100755 --- a/src/m/plot/applyoptions.py +++ b/src/m/plot/applyoptions.py @@ -139,7 +139,12 @@ def applyoptions(md, data, options, fig, axgrid, gridindex): # }}} # {{{ box if options.exist('box'): - eval(options.getfieldvalue('box')) + isbox=options.getfieldvalue('box') + if (isbox == 'off') | (isbox == 0) | (isbox == False): + ax.axis('off') + elif (isbox == 'on') | (isbox == 1) | (isbox == True): + ax.axis('on') + #eval(options.getfieldvalue('box')) # }}} # {{{ xlim, ylim, zlim if options.exist('xlim'): From 5573a54cc120d2d6e3117a037f0aebc9b9e60cec Mon Sep 17 00:00:00 2001 From: Justin Kin Jun Hew Date: Fri, 13 Jun 2025 13:39:50 +1000 Subject: [PATCH 005/126] configure.ac: internalise CoDiPack/MediPack flags for --enable-ad MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Adds --enable-ad plus --with-{codi,medi}pack-dir options. * When --enable-ad is chosen: - Defines ISSM_USE_AD for conditional compilation. - Injects include paths, library paths and –lcodi/–lmedi into AM_CPPFLAGS, AM_LDFLAGS and LIBS so every sub-dir picks them up. - Automatically disables PETSc to avoid an impossible combo. * Emits AM_CONDITIONAL(USE_AD) for any Makefile.am that still wants it. * Leaves all Makefile.am files untouched; the Spack recipe no longer needs setup_build_environment() hacks. Doing this upstream means: • Classic builds behave exactly as before. • AD builds work out-of-the-box for Spack, EasyBuild or manual ./configure invocations. style changes and revert issm options repetition removed --- configure.ac | 73 ++++++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 62 insertions(+), 11 deletions(-) diff --git a/configure.ac b/configure.ac index 6b7aaba0c..a247e5b5e 100644 --- a/configure.ac +++ b/configure.ac @@ -29,20 +29,71 @@ AM_PROG_AR #Libtool LT_INIT([win32-dll]) -#Run issm_options.m4 +# ===================================================================== +# Automatic-Differentiation switches +# ===================================================================== +AC_ARG_ENABLE([ad], + AS_HELP_STRING([--enable-ad], + [Build ISSM with CoDiPack+MediPack (disables PETSc)]), + [enable_ad=$enableval], + [enable_ad=no]) + +AC_ARG_WITH([codipack-dir], + AS_HELP_STRING([--with-codipack-dir=DIR], [Prefix of CoDiPack install]), + [CODIPACK_DIR=$withval], + [CODIPACK_DIR=]) + +AC_ARG_WITH([medipack-dir], + AS_HELP_STRING([--with-medipack-dir=DIR], [Prefix of MediPack install]), + [MEDIPACK_DIR=$withval], + [MEDIPACK_DIR=]) + +# --- Validation & flag embedding ------------------------------------- +if test "x$enable_ad" = "xyes"; then + if test -z "$CODIPACK_DIR" || test -z "$MEDIPACK_DIR"; then + AC_MSG_ERROR([--enable-ad needs BOTH --with-codipack-dir and --with-medipack-dir]) + fi + + # Tell source files we are in AD mode + AC_DEFINE([ISSM_USE_AD], [1], [Define to 1 if building with automatic differentiation]) + + # Drop PETSc automatically (picked up by m4/issm_options.m4) + ENABLE_PETSC=no + AM_CONDITIONAL([USE_AD], [true]) +else + ENABLE_PETSC=yes + AM_CONDITIONAL([USE_AD], [false]) +fi + +dnl ---- Embed include-paths, lib-paths & libs globally ----------------- +if test "x$enable_ad" = "xyes"; then + AM_CPPFLAGS="$AM_CPPFLAGS -I$CODIPACK_DIR/include -I$MEDIPACK_DIR/include -DCODI_ForcedInlines" + AM_LDFLAGS="$AM_LDFLAGS -L$CODIPACK_DIR/lib -L$MEDIPACK_DIR/lib" + LIBS="$LIBS -lcodi -lmedi" +fi + +dnl Export the variables so Automake can substitute them +AC_SUBST([AM_CPPFLAGS]) +AC_SUBST([AM_LDFLAGS]) +AC_SUBST([LIBS]) + +# --------------------------------------------------------------------- +# Run ISSM’s usual option-detection macro collection +# --------------------------------------------------------------------- ISSM_OPTIONS -#List all Makefiles +# --------------------------------------------------------------------- +# Output files +# --------------------------------------------------------------------- AC_CONFIG_FILES([ - Makefile - src/Makefile - src/c/Makefile - src/wrappers/Makefile - src/wrappers/python/Makefile - src/wrappers/matlab/Makefile - src/wrappers/javascript/Makefile - src/m/Makefile + Makefile + src/Makefile + src/c/Makefile + src/m/Makefile + src/wrappers/Makefile + src/wrappers/python/Makefile + src/wrappers/matlab/Makefile + src/wrappers/javascript/Makefile ]) -#End of configure.ac AC_OUTPUT From b40dae068687da5ae207916ab0acc145dbf1b422 Mon Sep 17 00:00:00 2001 From: inwoo-simba Date: Sun, 15 Jun 2025 23:52:44 +0900 Subject: [PATCH 006/126] CHG: Python in plotmodel - Fix showing log scale in colorbar. --- src/m/plot/applyoptions.py | 18 +++++++++++++++--- src/m/plot/processdata.py | 6 ++++-- 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/src/m/plot/applyoptions.py b/src/m/plot/applyoptions.py index 004cad1fe..46fec04a7 100755 --- a/src/m/plot/applyoptions.py +++ b/src/m/plot/applyoptions.py @@ -184,7 +184,11 @@ def applyoptions(md, data, options, fig, axgrid, gridindex): norm = options.getfieldvalue('colornorm') else: caxis = options.getfieldvalue('caxis') - norm = mpl.colors.Normalize(vmin=caxis[0],vmax=caxis[1]) + if options.exist('log'): + #NOTE: Use LogNorn rather than processing log dataset in "processdata". + norm=mpl.colors.LogNorm(vmin=caxis[0],vmax=caxis[1],clip=False) + else: + norm = mpl.colors.Normalize(vmin=caxis[0],vmax=caxis[1]) if options.exist('colormap'): cmap = getcolormap(options) cbar_extend = 0 @@ -221,13 +225,21 @@ def applyoptions(md, data, options, fig, axgrid, gridindex): # }}} # {{{ colorbar if options.getfieldvalue('colorbar', 1) == 1: - cb = mpl.colorbar.ColorbarBase(ax.cax, cmap=cmap, norm=norm, extend=extend) + formatter = mpl.ticker.ScalarFormatter(useMathText=1) + if options.exist('log'): + formatter = mpl.ticker.LogFormatterSciNotation(base=options.getfieldvalue('log')) + + cb = mpl.colorbar.ColorbarBase(ax.cax, cmap=cmap, norm=norm, extend=extend, + format=formatter) if options.exist('alpha'): cb.set_alpha(options.getfieldvalue('alpha')) if options.exist('colorbarnumticks'): cb.locator = MaxNLocator(nbins=options.getfieldvalue('colorbarnumticks', 5)) else: - cb.locator = MaxNLocator(nbins=5) # default 5 ticks + if options.exist('log'): + cb.locator = mpl.ticker.LogLocator(options.getfieldvalue('log')) + else: + cb.locator = MaxNLocator(nbins=5) # default 5 ticks if options.exist('colorbartickspacing'): locs = np.arange(lims[0], lims[1] + 1, options.getfieldvalue('colorbartickspacing')) cb.set_ticks(locs) diff --git a/src/m/plot/processdata.py b/src/m/plot/processdata.py index aec145ca5..d22201ebe 100755 --- a/src/m/plot/processdata.py +++ b/src/m/plot/processdata.py @@ -61,8 +61,10 @@ def processdata(md, data, options): # log {{{ if options.exist('log'): - cutoff = options.getfieldvalue('log', 1) - procdata[np.where(procdata < cutoff)] = cutoff + #cutoff = options.getfieldvalue('log', 1) + #procdata[np.where(procdata < cutoff)] = cutoff + #NOTE: Nothing to be done + pass # }}} # quiver plot {{{ From 7518f1b8a98bc526d27c3ee232ece1f738ac58c9 Mon Sep 17 00:00:00 2001 From: inwoo-simba Date: Sun, 15 Jun 2025 23:53:20 +0900 Subject: [PATCH 007/126] CHG: plot_landsat.py - Fix masking. --- src/m/plot/plot_landsat.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/m/plot/plot_landsat.py b/src/m/plot/plot_landsat.py index 29a7b96f0..c54fe4959 100755 --- a/src/m/plot/plot_landsat.py +++ b/src/m/plot/plot_landsat.py @@ -25,6 +25,15 @@ def plot_landsat(md,data,options,fig,axgrid,gridindex): x2d, y2d, z2d, elements2d, is2d, isplanet=processmesh(md,[],options) data, datatype=processdata(md,data,options) + ismask = options.exist('mask') + if ismask: + mask = options.getfieldvalue('mask') + options2 = copy.deepcopy(options) + options2.removefield('caxis',False) + options2.removefield('log',False) + mask, datatype=processdata(md,mask,options2) + data[~mask] = np.nan + #check is2d if not is2d: raise Exception('buildgridded error message: gridded not supported for 3d meshes, project on a layer') From 76d01cc48be97dcda3f77f4c6d030fb7cadfe38c Mon Sep 17 00:00:00 2001 From: Justin Kin Jun Hew Date: Mon, 16 Jun 2025 13:08:30 +1000 Subject: [PATCH 008/126] =?UTF-8?q?m4/issm=5Foptions.m4:=20new=20ISSM=5FEN?= =?UTF-8?q?ABLE=5FAD=20macro=20(=E2=80=93enable-ad=20support)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Adds ISSM_ENABLE_AD to handle --enable-ad plus --with-{codi,medi}pack-dir. * Macro embeds CoDiPack/MediPack include-dirs, lib-dirs and -lcodi/-lmedi into AM_CPPFLAGS, AM_LDFLAGS, LIBS so no Makefile.am edits are needed. * Automatically drops PETSc when AD is on, defines ISSM_USE_AD, and exposes AM_CONDITIONAL(USE_AD). * configure.ac now simply calls ISSM_ENABLE_AD after ISSM_OPTIONS. Moves all AD logic out of configure.ac and keeps option handling in the shared macro library. added enable AD into configure.ac --- configure.ac | 1 + m4/issm_options.m4 | 47 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 48 insertions(+) diff --git a/configure.ac b/configure.ac index 6b7aaba0c..897683f85 100644 --- a/configure.ac +++ b/configure.ac @@ -31,6 +31,7 @@ LT_INIT([win32-dll]) #Run issm_options.m4 ISSM_OPTIONS +ISSM_ENABLE_AD #List all Makefiles AC_CONFIG_FILES([ diff --git a/m4/issm_options.m4 b/m4/issm_options.m4 index 3eb86a1ae..5d64690cd 100644 --- a/m4/issm_options.m4 +++ b/m4/issm_options.m4 @@ -2616,3 +2616,50 @@ AC_DEFUN([ISSM_OPTIONS],[ AC_SUBST([CXXFLAGS]) AC_SUBST([OSLIBS]) ]) + +dnl ===================================================================== +dnl ISSM_ENABLE_AD – Automatic-Differentiation (CoDiPack + MediPack) +dnl ===================================================================== +AC_DEFUN([ISSM_ENABLE_AD], [ + # --- command-line switches ------------------------------------------ + AC_ARG_ENABLE([ad], + AS_HELP_STRING([--enable-ad], + [Build ISSM with CoDiPack+MediPack automatic differentiation (disables PETSc)]), + [enable_ad=$enableval], + [enable_ad=no]) + + AC_ARG_WITH([codipack-dir], + AS_HELP_STRING([--with-codipack-dir=DIR], + [Prefix of CoDiPack install]), + [CODIPACK_ROOT=$withval], [CODIPACK_ROOT=]) + + AC_ARG_WITH([medipack-dir], + AS_HELP_STRING([--with-medipack-dir=DIR], + [Prefix of MediPack install]), + [MEDIPACK_ROOT=$withval], [MEDIPACK_ROOT=]) + + # --- validation & flag injection ------------------------------------ + if test "x$enable_ad" = "xyes"; then + if test -z "$CODIPACK_ROOT" || test -z "$MEDIPACK_ROOT"; then + AC_MSG_ERROR([--enable-ad needs BOTH --with-codipack-dir and --with-medipack-dir]) + fi + + AC_DEFINE([ISSM_USE_AD], [1], + [Define to 1 if building with automatic differentiation]) + + ENABLE_PETSC=no + AM_CONDITIONAL([USE_AD], [true]) + + AM_CPPFLAGS="$AM_CPPFLAGS -I$CODIPACK_ROOT/include -I$MEDIPACK_ROOT/include -DCODI_ForcedInlines" + AM_LDFLAGS="$AM_LDFLAGS -L$CODIPACK_ROOT/lib -L$MEDIPACK_ROOT/lib" + LIBS="$LIBS -lcodi -lmedi" + else + ENABLE_PETSC=yes + AM_CONDITIONAL([USE_AD], [false]) + fi + + dnl Export augmented vars once + AC_SUBST([AM_CPPFLAGS]) + AC_SUBST([AM_LDFLAGS]) + AC_SUBST([LIBS]) +]) \ No newline at end of file From 114669eca87c22a3055d9dd7effc3c492e8fa8cd Mon Sep 17 00:00:00 2001 From: Tidbit Software Date: Mon, 16 Jun 2025 13:38:20 -0700 Subject: [PATCH 009/126] CHG: Need rpath entry for GDAL on newer clang --- externalpackages/gmt/install-6-mac.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/externalpackages/gmt/install-6-mac.sh b/externalpackages/gmt/install-6-mac.sh index 91110c834..90c1ca85d 100755 --- a/externalpackages/gmt/install-6-mac.sh +++ b/externalpackages/gmt/install-6-mac.sh @@ -21,7 +21,7 @@ LIBGFORTRAN_ROOT=${LIBGFORTRAN%/*} # export CC=mpicc export CFLAGS="${CFLAGS} -w" -export LDFLAGS="-Wl,-rpath,${NETCDF_ROOT}/lib" +export LDFLAGS="-Wl,-rpath,'${GDAL_ROOT}/lib' -Wl,-rpath,'${NETCDF_ROOT}/lib'" # Download source $ISSM_DIR/scripts/DownloadExternalPackage.sh "https://github.com/GenericMappingTools/gmt/archive/refs/tags/${VER}.tar.gz" "gmt-${VER}.tar.gz" From d11622c9caf43ba60b16057722b10e15262f1cbb Mon Sep 17 00:00:00 2001 From: mmorligh Date: Tue, 17 Jun 2025 12:54:46 -0700 Subject: [PATCH 010/126] CHG: for discover, scp does not work when requesting cmdout, does not request password and just hangs --- src/m/os/issmscpout.m | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/m/os/issmscpout.m b/src/m/os/issmscpout.m index a2345e5b5..ea581f7d6 100644 --- a/src/m/os/issmscpout.m +++ b/src/m/os/issmscpout.m @@ -42,13 +42,13 @@ function issmscpout(host,path,login,port,packages,varargin) end if port disp(['scp -P ' num2str(port) ' ' fileliststr ' ' login '@localhost:' path]) - [status,cmdout]=system(['scp -P ' num2str(port) ' ' fileliststr ' ' login '@localhost:' path]); + [status]=system(['scp -P ' num2str(port) ' ' fileliststr ' ' login '@localhost:' path]); if status~=0 %List expansion is a bash'ism. Try again with -OT. [status,cmdout]=system(['scp -OT -P ' num2str(port) ' ' fileliststr ' ' login '@localhost:' path]); end else - [status,cmdout]=system(['scp ' fileliststr ' ' login '@' host ':' path]); + [status]=system(['scp ' fileliststr ' ' login '@' host ':' path]); if status~=0 %List expansion is a bash'ism. Try again with -OT. [status,cmdout]=system(['scp -OT ' fileliststr ' ' login '@' host ':' path]); From 009ab6273927225bde1f45f32b67c4d1bf82911c Mon Sep 17 00:00:00 2001 From: NJSchlegel <95945328+NJSchlegel@users.noreply.github.com> Date: Tue, 17 Jun 2025 18:15:35 -0400 Subject: [PATCH 011/126] CHG: add GEMB mapping option for precip downscaling and dlw downscaling with temperature when lapse rate is set to zero --- src/c/analyses/SmbAnalysis.cpp | 1 + src/c/classes/Elements/Element.cpp | 38 ++++++-- src/c/shared/Enum/Enum.vim | 19 ++-- src/c/shared/Enum/EnumDefinitions.h | 1 + src/c/shared/Enum/EnumToStringx.cpp | 1 + src/c/shared/Enum/Enumjl.vim | 1 + src/c/shared/Enum/StringToEnumx.cpp | 109 +++++++++++------------ src/c/shared/Enum/issmenums.jl | 3 + src/m/classes/SMBgemb.m | 5 ++ src/m/classes/SMBgemb.py | 5 ++ test/Archives/Archive258.arch | Bin 24367 -> 24367 bytes test/Archives/Archive259.arch | Bin 0 -> 24367 bytes test/NightlyRun/test258.m | 1 + test/NightlyRun/test258.py | 1 + test/NightlyRun/test259.m | 111 ++++++++++++++++++++++++ test/NightlyRun/test259.py | 129 ++++++++++++++++++++++++++++ 16 files changed, 356 insertions(+), 69 deletions(-) create mode 100644 test/Archives/Archive259.arch create mode 100644 test/NightlyRun/test259.m create mode 100644 test/NightlyRun/test259.py diff --git a/src/c/analyses/SmbAnalysis.cpp b/src/c/analyses/SmbAnalysis.cpp index cde30be10..f4ea2e017 100644 --- a/src/c/analyses/SmbAnalysis.cpp +++ b/src/c/analyses/SmbAnalysis.cpp @@ -429,6 +429,7 @@ void SmbAnalysis::UpdateParameters(Parameters* parameters,IoModel* iomodel,int s parameters->AddObject(iomodel->CopyConstantObject("md.smb.isconstrainsurfaceT",SmbIsconstrainsurfaceTEnum)); parameters->AddObject(iomodel->CopyConstantObject("md.smb.isdeltaLWup",SmbIsdeltaLWupEnum)); parameters->AddObject(iomodel->CopyConstantObject("md.smb.ismappedforcing",SmbIsmappedforcingEnum)); + parameters->AddObject(iomodel->CopyConstantObject("md.smb.isprecipforcingremapped",SmbIsprecipforcingremappedEnum)); parameters->AddObject(iomodel->CopyConstantObject("md.smb.InitDensityScaling",SmbInitDensityScalingEnum)); parameters->AddObject(iomodel->CopyConstantObject("md.smb.ThermoDeltaTScaling",SmbThermoDeltaTScalingEnum)); parameters->AddObject(iomodel->CopyConstantObject("md.smb.adThresh",SmbAdThreshEnum)); diff --git a/src/c/classes/Elements/Element.cpp b/src/c/classes/Elements/Element.cpp index 5157ba53a..5f87324bb 100644 --- a/src/c/classes/Elements/Element.cpp +++ b/src/c/classes/Elements/Element.cpp @@ -5578,6 +5578,9 @@ void Element::SmbGemb(IssmDouble timeinputs, int count, int steps){/*{{{*/ pAir_input->GetInputValue(&pAir,gauss); // screen level air pressure [Pa] //_printf_("Time: " << t << " Ta: " << Ta << " V: " << V << " dlw: " << dlw << " dsw: " << dsw << " P: " << P << " eAir: " << eAir << " pAir: " << pAir << "\n"); } else { + IssmDouble Dtol = 1e-11; + IssmDouble gravity; + parameters->FindParam(&gravity,ConstantsGEnum); int timestepping; IssmDouble dt; @@ -5587,6 +5590,9 @@ void Element::SmbGemb(IssmDouble timeinputs, int count, int steps){/*{{{*/ Input *currentsurface_input = this->GetInput(SurfaceEnum); _assert_(currentsurface_input); currentsurface_input->GetInputAverage(¤tsurface); + bool isprecipmap=true; + parameters->FindParam(&isprecipmap,SmbIsprecipforcingremappedEnum); + parameters->FindParam(&tlapse,SmbLapseTaValueEnum); parameters->FindParam(&dlwlapse,SmbLapsedlwrfValueEnum); @@ -5594,24 +5600,39 @@ void Element::SmbGemb(IssmDouble timeinputs, int count, int steps){/*{{{*/ parameters->FindParam(&elevation,&N,SmbMappedforcingelevationEnum); _assert_(elevation); //Variables for downscaling - IssmDouble taparam, dlwrfparam, rhparam, eaparam, pparam; - IssmDouble pscale = -8400; + IssmDouble taparam, dlwrfparam, rhparam, eaparam, pparam, prparam; parameters->FindParam(&taparam, Mappedpoint-1, timeinputs, timestepping, dt, SmbTaParamEnum); parameters->FindParam(&dlwrfparam, Mappedpoint-1, timeinputs, timestepping, dt, SmbDlwrfParamEnum); parameters->FindParam(&eaparam, Mappedpoint-1, timeinputs, timestepping, dt, SmbEAirParamEnum); parameters->FindParam(&pparam, Mappedpoint-1, timeinputs, timestepping, dt, SmbPAirParamEnum); + parameters->FindParam(&prparam, Mappedpoint-1, timeinputs, timestepping, dt, SmbPParamEnum); //Variables not downscaled parameters->FindParam(&V, Mappedpoint-1, timeinputs, timestepping, dt, SmbVParamEnum); parameters->FindParam(&dsw, Mappedpoint-1, timeinputs, timestepping, dt, SmbDswrfParamEnum); parameters->FindParam(&dswdiff, Mappedpoint-1, timeinputs, timestepping, dt, SmbDswdiffrfParamEnum); - parameters->FindParam(&P, Mappedpoint-1, timeinputs, timestepping, dt, SmbPParamEnum); Ta = taparam + (currentsurface - elevation[Mappedpoint-1])*tlapse; - dlw = fmax(dlwrfparam + (currentsurface - elevation[Mappedpoint-1])*dlwlapse,0.0); - if (dlwlapse!=0 || tlapse!=0) pAir=pparam*exp((currentsurface - elevation[Mappedpoint-1])/pscale); + if (fabs(dlwlapse) > Dtol) dlw = fmax(dlwrfparam + (currentsurface - elevation[Mappedpoint-1])*dlwlapse,0.0); + else{ + //adjust downward longwave, holding emissivity equal (Glover et al, 1999) + IssmDouble SB = 5.67e-8; // Stefan-Boltzmann constant (W m-2 K-4) + IssmDouble effe = 1.; + effe = dlwrfparam/(SB * pow(taparam,4.0)); + dlw = fmax(effe*SB*pow(Ta,4.0),0.0); + } - //Hold reltive humidity constant and calculte new saturation vapor pressure + if ( (fabs(dlwlapse) > Dtol) || (fabs(tlapse) > Dtol)){ + IssmDouble Rg = 8.314; // gas constant (J mol-1 K-1) + IssmDouble dAir = 0.0; + // calculated air density [kg/m3] + // dAir = 0.029 * pAir /(R * Ta); + dAir=0.029 * pparam /(Rg * Ta); + pAir=pparam-gravity*dAir*(currentsurface - elevation[Mappedpoint-1]); + } + else pAir=pparam; + + //Hold relative humidity constant and calculte new saturation vapor pressure //https://cran.r-project.org/web/packages/humidity/vignettes/humidity-measures.html //es over ice calculation //Ding et al., 2019 after Bolton, 1980 @@ -5619,6 +5640,11 @@ void Element::SmbGemb(IssmDouble timeinputs, int count, int steps){/*{{{*/ rhparam=eaparam/6.112/exp((17.67*(taparam-273.15))/(taparam-29.65)); eAir=rhparam*6.112*exp((17.67*(Ta-273.15))/(Ta-29.65)); + if (isprecipmap && (eaparam>0)){ + P=prparam*eAir/eaparam; + } + else P=prparam; + xDelete(elevation); } /*}}}*/ diff --git a/src/c/shared/Enum/Enum.vim b/src/c/shared/Enum/Enum.vim index f227a20b1..8a081631c 100644 --- a/src/c/shared/Enum/Enum.vim +++ b/src/c/shared/Enum/Enum.vim @@ -607,6 +607,7 @@ syn keyword cConstant SmbIsgraingrowthEnum syn keyword cConstant SmbIsmappedforcingEnum syn keyword cConstant SmbIsmeltEnum syn keyword cConstant SmbIsmungsmEnum +syn keyword cConstant SmbIsprecipforcingremappedEnum syn keyword cConstant SmbIsprecipscaledEnum syn keyword cConstant SmbIssetpddfacEnum syn keyword cConstant SmbIsshortwaveEnum @@ -3794,7 +3795,6 @@ syn keyword cType Cfsurfacelogvel syn keyword cType Cfsurfacesquare syn keyword cType Cfsurfacesquaretransient syn keyword cType Channel -syn keyword cType classes syn keyword cType Constraint syn keyword cType Constraints syn keyword cType Contour @@ -3802,8 +3802,8 @@ syn keyword cType Contours syn keyword cType ControlInput syn keyword cType ControlParam syn keyword cType Covertree -syn keyword cType DatasetInput syn keyword cType DataSetParam +syn keyword cType DatasetInput syn keyword cType Definition syn keyword cType DependentObject syn keyword cType DoubleInput @@ -3816,20 +3816,19 @@ syn keyword cType Element syn keyword cType ElementHook syn keyword cType ElementInput syn keyword cType ElementMatrix -syn keyword cType Elements syn keyword cType ElementVector +syn keyword cType Elements syn keyword cType ExponentialVariogram syn keyword cType ExternalResult syn keyword cType FemModel syn keyword cType FileParam syn keyword cType Friction syn keyword cType Gauss -syn keyword cType GaussianVariogram -syn keyword cType gaussobjects syn keyword cType GaussPenta syn keyword cType GaussSeg syn keyword cType GaussTetra syn keyword cType GaussTria +syn keyword cType GaussianVariogram syn keyword cType GenericExternalResult syn keyword cType GenericOption syn keyword cType GenericParam @@ -3846,7 +3845,6 @@ syn keyword cType IntVecParam syn keyword cType IoModel syn keyword cType IssmDirectApplicInterface syn keyword cType IssmParallelDirectApplicInterface -syn keyword cType krigingobjects syn keyword cType Load syn keyword cType Loads syn keyword cType Masscon @@ -3857,7 +3855,6 @@ syn keyword cType Materials syn keyword cType Matestar syn keyword cType Matice syn keyword cType Matlitho -syn keyword cType matrixobjects syn keyword cType MatrixParam syn keyword cType Misfit syn keyword cType Moulin @@ -3884,13 +3881,13 @@ syn keyword cType Quadtree syn keyword cType Radar syn keyword cType Regionaloutput syn keyword cType Results -syn keyword cType Riftfront syn keyword cType RiftStruct +syn keyword cType Riftfront syn keyword cType SealevelGeometry syn keyword cType Seg syn keyword cType SegInput -syn keyword cType Segment syn keyword cType SegRef +syn keyword cType Segment syn keyword cType SpcDynamic syn keyword cType SpcStatic syn keyword cType SpcTransient @@ -3911,6 +3908,10 @@ syn keyword cType Variogram syn keyword cType VectorParam syn keyword cType Vertex syn keyword cType Vertices +syn keyword cType classes +syn keyword cType gaussobjects +syn keyword cType krigingobjects +syn keyword cType matrixobjects syn keyword cType AdjointBalancethickness2Analysis syn keyword cType AdjointBalancethicknessAnalysis syn keyword cType AdjointHorizAnalysis diff --git a/src/c/shared/Enum/EnumDefinitions.h b/src/c/shared/Enum/EnumDefinitions.h index b09aad3ec..75b9f07e2 100644 --- a/src/c/shared/Enum/EnumDefinitions.h +++ b/src/c/shared/Enum/EnumDefinitions.h @@ -601,6 +601,7 @@ enum definitions{ SmbIsmappedforcingEnum, SmbIsmeltEnum, SmbIsmungsmEnum, + SmbIsprecipforcingremappedEnum, SmbIsprecipscaledEnum, SmbIssetpddfacEnum, SmbIsshortwaveEnum, diff --git a/src/c/shared/Enum/EnumToStringx.cpp b/src/c/shared/Enum/EnumToStringx.cpp index 4f3f914e0..b2c9a6e82 100644 --- a/src/c/shared/Enum/EnumToStringx.cpp +++ b/src/c/shared/Enum/EnumToStringx.cpp @@ -609,6 +609,7 @@ const char* EnumToStringx(int en){ case SmbIsmappedforcingEnum : return "SmbIsmappedforcing"; case SmbIsmeltEnum : return "SmbIsmelt"; case SmbIsmungsmEnum : return "SmbIsmungsm"; + case SmbIsprecipforcingremappedEnum : return "SmbIsprecipforcingremapped"; case SmbIsprecipscaledEnum : return "SmbIsprecipscaled"; case SmbIssetpddfacEnum : return "SmbIssetpddfac"; case SmbIsshortwaveEnum : return "SmbIsshortwave"; diff --git a/src/c/shared/Enum/Enumjl.vim b/src/c/shared/Enum/Enumjl.vim index fb66f5bcb..617023921 100644 --- a/src/c/shared/Enum/Enumjl.vim +++ b/src/c/shared/Enum/Enumjl.vim @@ -600,6 +600,7 @@ syn keyword juliaConstC SmbIsgraingrowthEnum syn keyword juliaConstC SmbIsmappedforcingEnum syn keyword juliaConstC SmbIsmeltEnum syn keyword juliaConstC SmbIsmungsmEnum +syn keyword juliaConstC SmbIsprecipforcingremappedEnum syn keyword juliaConstC SmbIsprecipscaledEnum syn keyword juliaConstC SmbIssetpddfacEnum syn keyword juliaConstC SmbIsshortwaveEnum diff --git a/src/c/shared/Enum/StringToEnumx.cpp b/src/c/shared/Enum/StringToEnumx.cpp index 0c18a757c..1ab351b62 100644 --- a/src/c/shared/Enum/StringToEnumx.cpp +++ b/src/c/shared/Enum/StringToEnumx.cpp @@ -621,17 +621,18 @@ int StringToEnumx(const char* name,bool notfounderror){ else if (strcmp(name,"SmbIsmappedforcing")==0) return SmbIsmappedforcingEnum; else if (strcmp(name,"SmbIsmelt")==0) return SmbIsmeltEnum; else if (strcmp(name,"SmbIsmungsm")==0) return SmbIsmungsmEnum; + else if (strcmp(name,"SmbIsprecipforcingremapped")==0) return SmbIsprecipforcingremappedEnum; else if (strcmp(name,"SmbIsprecipscaled")==0) return SmbIsprecipscaledEnum; else if (strcmp(name,"SmbIssetpddfac")==0) return SmbIssetpddfacEnum; else if (strcmp(name,"SmbIsshortwave")==0) return SmbIsshortwaveEnum; else if (strcmp(name,"SmbIstemperaturescaled")==0) return SmbIstemperaturescaledEnum; else if (strcmp(name,"SmbIsthermal")==0) return SmbIsthermalEnum; else if (strcmp(name,"SmbIsturbulentflux")==0) return SmbIsturbulentfluxEnum; - else if (strcmp(name,"SmbK")==0) return SmbKEnum; else stage=6; } if(stage==6){ - if (strcmp(name,"SmbLapsedlwrfValue")==0) return SmbLapsedlwrfValueEnum; + if (strcmp(name,"SmbK")==0) return SmbKEnum; + else if (strcmp(name,"SmbLapsedlwrfValue")==0) return SmbLapsedlwrfValueEnum; else if (strcmp(name,"SmbLapseRates")==0) return SmbLapseRatesEnum; else if (strcmp(name,"SmbLapseTaValue")==0) return SmbLapseTaValueEnum; else if (strcmp(name,"SmbLWgrad")==0) return SmbLWgradEnum; @@ -750,11 +751,11 @@ int StringToEnumx(const char* name,bool notfounderror){ else if (strcmp(name,"TransientIssampling")==0) return TransientIssamplingEnum; else if (strcmp(name,"TransientIsslc")==0) return TransientIsslcEnum; else if (strcmp(name,"TransientIssmb")==0) return TransientIssmbEnum; - else if (strcmp(name,"TransientIsstressbalance")==0) return TransientIsstressbalanceEnum; else stage=7; } if(stage==7){ - if (strcmp(name,"TransientIsthermal")==0) return TransientIsthermalEnum; + if (strcmp(name,"TransientIsstressbalance")==0) return TransientIsstressbalanceEnum; + else if (strcmp(name,"TransientIsthermal")==0) return TransientIsthermalEnum; else if (strcmp(name,"TransientNumRequestedOutputs")==0) return TransientNumRequestedOutputsEnum; else if (strcmp(name,"TransientRequestedOutputs")==0) return TransientRequestedOutputsEnum; else if (strcmp(name,"Velocity")==0) return VelocityEnum; @@ -873,11 +874,11 @@ int StringToEnumx(const char* name,bool notfounderror){ else if (strcmp(name,"DeviatoricStressxz")==0) return DeviatoricStressxzEnum; else if (strcmp(name,"DeviatoricStressyy")==0) return DeviatoricStressyyEnum; else if (strcmp(name,"DeviatoricStressyz")==0) return DeviatoricStressyzEnum; - else if (strcmp(name,"DeviatoricStresszz")==0) return DeviatoricStresszzEnum; else stage=8; } if(stage==8){ - if (strcmp(name,"DeviatoricStress1")==0) return DeviatoricStress1Enum; + if (strcmp(name,"DeviatoricStresszz")==0) return DeviatoricStresszzEnum; + else if (strcmp(name,"DeviatoricStress1")==0) return DeviatoricStress1Enum; else if (strcmp(name,"DeviatoricStress2")==0) return DeviatoricStress2Enum; else if (strcmp(name,"DistanceToCalvingfront")==0) return DistanceToCalvingfrontEnum; else if (strcmp(name,"DistanceToGroundingline")==0) return DistanceToGroundinglineEnum; @@ -996,11 +997,11 @@ int StringToEnumx(const char* name,bool notfounderror){ else if (strcmp(name,"InversionVxObs")==0) return InversionVxObsEnum; else if (strcmp(name,"InversionVyObs")==0) return InversionVyObsEnum; else if (strcmp(name,"LevelsetfunctionSlopeX")==0) return LevelsetfunctionSlopeXEnum; - else if (strcmp(name,"LevelsetfunctionSlopeY")==0) return LevelsetfunctionSlopeYEnum; else stage=9; } if(stage==9){ - if (strcmp(name,"LevelsetObservation")==0) return LevelsetObservationEnum; + if (strcmp(name,"LevelsetfunctionSlopeY")==0) return LevelsetfunctionSlopeYEnum; + else if (strcmp(name,"LevelsetObservation")==0) return LevelsetObservationEnum; else if (strcmp(name,"LoadingforceX")==0) return LoadingforceXEnum; else if (strcmp(name,"LoadingforceY")==0) return LoadingforceYEnum; else if (strcmp(name,"LoadingforceZ")==0) return LoadingforceZEnum; @@ -1119,11 +1120,11 @@ int StringToEnumx(const char* name,bool notfounderror){ else if (strcmp(name,"CouplingTransferCount")==0) return CouplingTransferCountEnum; else if (strcmp(name,"SedimentHead")==0) return SedimentHeadEnum; else if (strcmp(name,"SedimentHeadOld")==0) return SedimentHeadOldEnum; - else if (strcmp(name,"SedimentHeadSubstep")==0) return SedimentHeadSubstepEnum; else stage=10; } if(stage==10){ - if (strcmp(name,"SedimentHeadTransient")==0) return SedimentHeadTransientEnum; + if (strcmp(name,"SedimentHeadSubstep")==0) return SedimentHeadSubstepEnum; + else if (strcmp(name,"SedimentHeadTransient")==0) return SedimentHeadTransientEnum; else if (strcmp(name,"SedimentHeadResidual")==0) return SedimentHeadResidualEnum; else if (strcmp(name,"SedimentHeadStacked")==0) return SedimentHeadStackedEnum; else if (strcmp(name,"SigmaNN")==0) return SigmaNNEnum; @@ -1242,11 +1243,11 @@ int StringToEnumx(const char* name,bool notfounderror){ else if (strcmp(name,"SmbAirhumidityAnomaly")==0) return SmbAirhumidityAnomalyEnum; else if (strcmp(name,"SmbPrecipitationsLgm")==0) return SmbPrecipitationsLgmEnum; else if (strcmp(name,"SmbPrecipitationsPresentday")==0) return SmbPrecipitationsPresentdayEnum; - else if (strcmp(name,"SmbPrecipitationsReconstructed")==0) return SmbPrecipitationsReconstructedEnum; else stage=11; } if(stage==11){ - if (strcmp(name,"SmbRain")==0) return SmbRainEnum; + if (strcmp(name,"SmbPrecipitationsReconstructed")==0) return SmbPrecipitationsReconstructedEnum; + else if (strcmp(name,"SmbRain")==0) return SmbRainEnum; else if (strcmp(name,"SmbRainSubstep")==0) return SmbRainSubstepEnum; else if (strcmp(name,"SmbRe")==0) return SmbReEnum; else if (strcmp(name,"SmbRefreeze")==0) return SmbRefreezeEnum; @@ -1365,11 +1366,11 @@ int StringToEnumx(const char* name,bool notfounderror){ else if (strcmp(name,"VyMesh")==0) return VyMeshEnum; else if (strcmp(name,"VyObs")==0) return VyObsEnum; else if (strcmp(name,"VyShear")==0) return VyShearEnum; - else if (strcmp(name,"VySurface")==0) return VySurfaceEnum; else stage=12; } if(stage==12){ - if (strcmp(name,"Vz")==0) return VzEnum; + if (strcmp(name,"VySurface")==0) return VySurfaceEnum; + else if (strcmp(name,"Vz")==0) return VzEnum; else if (strcmp(name,"VzFS")==0) return VzFSEnum; else if (strcmp(name,"VzHO")==0) return VzHOEnum; else if (strcmp(name,"VzMesh")==0) return VzMeshEnum; @@ -1488,11 +1489,11 @@ int StringToEnumx(const char* name,bool notfounderror){ else if (strcmp(name,"Outputdefinition96")==0) return Outputdefinition96Enum; else if (strcmp(name,"Outputdefinition97")==0) return Outputdefinition97Enum; else if (strcmp(name,"Outputdefinition98")==0) return Outputdefinition98Enum; - else if (strcmp(name,"Outputdefinition99")==0) return Outputdefinition99Enum; else stage=13; } if(stage==13){ - if (strcmp(name,"Outputdefinition9")==0) return Outputdefinition9Enum; + if (strcmp(name,"Outputdefinition99")==0) return Outputdefinition99Enum; + else if (strcmp(name,"Outputdefinition9")==0) return Outputdefinition9Enum; else if (strcmp(name,"Outputdefinition100")==0) return Outputdefinition100Enum; else if (strcmp(name,"Outputdefinition101")==0) return Outputdefinition101Enum; else if (strcmp(name,"Outputdefinition110")==0) return Outputdefinition110Enum; @@ -1611,11 +1612,11 @@ int StringToEnumx(const char* name,bool notfounderror){ else if (strcmp(name,"Outputdefinition223")==0) return Outputdefinition223Enum; else if (strcmp(name,"Outputdefinition224")==0) return Outputdefinition224Enum; else if (strcmp(name,"Outputdefinition225")==0) return Outputdefinition225Enum; - else if (strcmp(name,"Outputdefinition226")==0) return Outputdefinition226Enum; else stage=14; } if(stage==14){ - if (strcmp(name,"Outputdefinition227")==0) return Outputdefinition227Enum; + if (strcmp(name,"Outputdefinition226")==0) return Outputdefinition226Enum; + else if (strcmp(name,"Outputdefinition227")==0) return Outputdefinition227Enum; else if (strcmp(name,"Outputdefinition228")==0) return Outputdefinition228Enum; else if (strcmp(name,"Outputdefinition229")==0) return Outputdefinition229Enum; else if (strcmp(name,"Outputdefinition202")==0) return Outputdefinition202Enum; @@ -1734,11 +1735,11 @@ int StringToEnumx(const char* name,bool notfounderror){ else if (strcmp(name,"Outputdefinition341")==0) return Outputdefinition341Enum; else if (strcmp(name,"Outputdefinition342")==0) return Outputdefinition342Enum; else if (strcmp(name,"Outputdefinition343")==0) return Outputdefinition343Enum; - else if (strcmp(name,"Outputdefinition344")==0) return Outputdefinition344Enum; else stage=15; } if(stage==15){ - if (strcmp(name,"Outputdefinition345")==0) return Outputdefinition345Enum; + if (strcmp(name,"Outputdefinition344")==0) return Outputdefinition344Enum; + else if (strcmp(name,"Outputdefinition345")==0) return Outputdefinition345Enum; else if (strcmp(name,"Outputdefinition346")==0) return Outputdefinition346Enum; else if (strcmp(name,"Outputdefinition347")==0) return Outputdefinition347Enum; else if (strcmp(name,"Outputdefinition348")==0) return Outputdefinition348Enum; @@ -1857,11 +1858,11 @@ int StringToEnumx(const char* name,bool notfounderror){ else if (strcmp(name,"Outputdefinition405")==0) return Outputdefinition405Enum; else if (strcmp(name,"Outputdefinition460")==0) return Outputdefinition460Enum; else if (strcmp(name,"Outputdefinition461")==0) return Outputdefinition461Enum; - else if (strcmp(name,"Outputdefinition462")==0) return Outputdefinition462Enum; else stage=16; } if(stage==16){ - if (strcmp(name,"Outputdefinition463")==0) return Outputdefinition463Enum; + if (strcmp(name,"Outputdefinition462")==0) return Outputdefinition462Enum; + else if (strcmp(name,"Outputdefinition463")==0) return Outputdefinition463Enum; else if (strcmp(name,"Outputdefinition464")==0) return Outputdefinition464Enum; else if (strcmp(name,"Outputdefinition465")==0) return Outputdefinition465Enum; else if (strcmp(name,"Outputdefinition466")==0) return Outputdefinition466Enum; @@ -1980,11 +1981,11 @@ int StringToEnumx(const char* name,bool notfounderror){ else if (strcmp(name,"Outputdefinition578")==0) return Outputdefinition578Enum; else if (strcmp(name,"Outputdefinition579")==0) return Outputdefinition579Enum; else if (strcmp(name,"Outputdefinition507")==0) return Outputdefinition507Enum; - else if (strcmp(name,"Outputdefinition580")==0) return Outputdefinition580Enum; else stage=17; } if(stage==17){ - if (strcmp(name,"Outputdefinition581")==0) return Outputdefinition581Enum; + if (strcmp(name,"Outputdefinition580")==0) return Outputdefinition580Enum; + else if (strcmp(name,"Outputdefinition581")==0) return Outputdefinition581Enum; else if (strcmp(name,"Outputdefinition582")==0) return Outputdefinition582Enum; else if (strcmp(name,"Outputdefinition583")==0) return Outputdefinition583Enum; else if (strcmp(name,"Outputdefinition584")==0) return Outputdefinition584Enum; @@ -2103,11 +2104,11 @@ int StringToEnumx(const char* name,bool notfounderror){ else if (strcmp(name,"Outputdefinition696")==0) return Outputdefinition696Enum; else if (strcmp(name,"Outputdefinition697")==0) return Outputdefinition697Enum; else if (strcmp(name,"Outputdefinition698")==0) return Outputdefinition698Enum; - else if (strcmp(name,"Outputdefinition699")==0) return Outputdefinition699Enum; else stage=18; } if(stage==18){ - if (strcmp(name,"Outputdefinition609")==0) return Outputdefinition609Enum; + if (strcmp(name,"Outputdefinition699")==0) return Outputdefinition699Enum; + else if (strcmp(name,"Outputdefinition609")==0) return Outputdefinition609Enum; else if (strcmp(name,"Outputdefinition700")==0) return Outputdefinition700Enum; else if (strcmp(name,"Outputdefinition701")==0) return Outputdefinition701Enum; else if (strcmp(name,"Outputdefinition710")==0) return Outputdefinition710Enum; @@ -2226,11 +2227,11 @@ int StringToEnumx(const char* name,bool notfounderror){ else if (strcmp(name,"Outputdefinition823")==0) return Outputdefinition823Enum; else if (strcmp(name,"Outputdefinition824")==0) return Outputdefinition824Enum; else if (strcmp(name,"Outputdefinition825")==0) return Outputdefinition825Enum; - else if (strcmp(name,"Outputdefinition826")==0) return Outputdefinition826Enum; else stage=19; } if(stage==19){ - if (strcmp(name,"Outputdefinition827")==0) return Outputdefinition827Enum; + if (strcmp(name,"Outputdefinition826")==0) return Outputdefinition826Enum; + else if (strcmp(name,"Outputdefinition827")==0) return Outputdefinition827Enum; else if (strcmp(name,"Outputdefinition828")==0) return Outputdefinition828Enum; else if (strcmp(name,"Outputdefinition829")==0) return Outputdefinition829Enum; else if (strcmp(name,"Outputdefinition802")==0) return Outputdefinition802Enum; @@ -2349,11 +2350,11 @@ int StringToEnumx(const char* name,bool notfounderror){ else if (strcmp(name,"Outputdefinition941")==0) return Outputdefinition941Enum; else if (strcmp(name,"Outputdefinition942")==0) return Outputdefinition942Enum; else if (strcmp(name,"Outputdefinition943")==0) return Outputdefinition943Enum; - else if (strcmp(name,"Outputdefinition944")==0) return Outputdefinition944Enum; else stage=20; } if(stage==20){ - if (strcmp(name,"Outputdefinition945")==0) return Outputdefinition945Enum; + if (strcmp(name,"Outputdefinition944")==0) return Outputdefinition944Enum; + else if (strcmp(name,"Outputdefinition945")==0) return Outputdefinition945Enum; else if (strcmp(name,"Outputdefinition946")==0) return Outputdefinition946Enum; else if (strcmp(name,"Outputdefinition947")==0) return Outputdefinition947Enum; else if (strcmp(name,"Outputdefinition948")==0) return Outputdefinition948Enum; @@ -2472,11 +2473,11 @@ int StringToEnumx(const char* name,bool notfounderror){ else if (strcmp(name,"Outputdefinition1005")==0) return Outputdefinition1005Enum; else if (strcmp(name,"Outputdefinition1060")==0) return Outputdefinition1060Enum; else if (strcmp(name,"Outputdefinition1061")==0) return Outputdefinition1061Enum; - else if (strcmp(name,"Outputdefinition1062")==0) return Outputdefinition1062Enum; else stage=21; } if(stage==21){ - if (strcmp(name,"Outputdefinition1063")==0) return Outputdefinition1063Enum; + if (strcmp(name,"Outputdefinition1062")==0) return Outputdefinition1062Enum; + else if (strcmp(name,"Outputdefinition1063")==0) return Outputdefinition1063Enum; else if (strcmp(name,"Outputdefinition1064")==0) return Outputdefinition1064Enum; else if (strcmp(name,"Outputdefinition1065")==0) return Outputdefinition1065Enum; else if (strcmp(name,"Outputdefinition1066")==0) return Outputdefinition1066Enum; @@ -2595,11 +2596,11 @@ int StringToEnumx(const char* name,bool notfounderror){ else if (strcmp(name,"Outputdefinition1178")==0) return Outputdefinition1178Enum; else if (strcmp(name,"Outputdefinition1179")==0) return Outputdefinition1179Enum; else if (strcmp(name,"Outputdefinition1107")==0) return Outputdefinition1107Enum; - else if (strcmp(name,"Outputdefinition1180")==0) return Outputdefinition1180Enum; else stage=22; } if(stage==22){ - if (strcmp(name,"Outputdefinition1181")==0) return Outputdefinition1181Enum; + if (strcmp(name,"Outputdefinition1180")==0) return Outputdefinition1180Enum; + else if (strcmp(name,"Outputdefinition1181")==0) return Outputdefinition1181Enum; else if (strcmp(name,"Outputdefinition1182")==0) return Outputdefinition1182Enum; else if (strcmp(name,"Outputdefinition1183")==0) return Outputdefinition1183Enum; else if (strcmp(name,"Outputdefinition1184")==0) return Outputdefinition1184Enum; @@ -2718,11 +2719,11 @@ int StringToEnumx(const char* name,bool notfounderror){ else if (strcmp(name,"Outputdefinition1296")==0) return Outputdefinition1296Enum; else if (strcmp(name,"Outputdefinition1297")==0) return Outputdefinition1297Enum; else if (strcmp(name,"Outputdefinition1298")==0) return Outputdefinition1298Enum; - else if (strcmp(name,"Outputdefinition1299")==0) return Outputdefinition1299Enum; else stage=23; } if(stage==23){ - if (strcmp(name,"Outputdefinition1209")==0) return Outputdefinition1209Enum; + if (strcmp(name,"Outputdefinition1299")==0) return Outputdefinition1299Enum; + else if (strcmp(name,"Outputdefinition1209")==0) return Outputdefinition1209Enum; else if (strcmp(name,"Outputdefinition1300")==0) return Outputdefinition1300Enum; else if (strcmp(name,"Outputdefinition1301")==0) return Outputdefinition1301Enum; else if (strcmp(name,"Outputdefinition1310")==0) return Outputdefinition1310Enum; @@ -2841,11 +2842,11 @@ int StringToEnumx(const char* name,bool notfounderror){ else if (strcmp(name,"Outputdefinition1423")==0) return Outputdefinition1423Enum; else if (strcmp(name,"Outputdefinition1424")==0) return Outputdefinition1424Enum; else if (strcmp(name,"Outputdefinition1425")==0) return Outputdefinition1425Enum; - else if (strcmp(name,"Outputdefinition1426")==0) return Outputdefinition1426Enum; else stage=24; } if(stage==24){ - if (strcmp(name,"Outputdefinition1427")==0) return Outputdefinition1427Enum; + if (strcmp(name,"Outputdefinition1426")==0) return Outputdefinition1426Enum; + else if (strcmp(name,"Outputdefinition1427")==0) return Outputdefinition1427Enum; else if (strcmp(name,"Outputdefinition1428")==0) return Outputdefinition1428Enum; else if (strcmp(name,"Outputdefinition1429")==0) return Outputdefinition1429Enum; else if (strcmp(name,"Outputdefinition1402")==0) return Outputdefinition1402Enum; @@ -2964,11 +2965,11 @@ int StringToEnumx(const char* name,bool notfounderror){ else if (strcmp(name,"Outputdefinition1541")==0) return Outputdefinition1541Enum; else if (strcmp(name,"Outputdefinition1542")==0) return Outputdefinition1542Enum; else if (strcmp(name,"Outputdefinition1543")==0) return Outputdefinition1543Enum; - else if (strcmp(name,"Outputdefinition1544")==0) return Outputdefinition1544Enum; else stage=25; } if(stage==25){ - if (strcmp(name,"Outputdefinition1545")==0) return Outputdefinition1545Enum; + if (strcmp(name,"Outputdefinition1544")==0) return Outputdefinition1544Enum; + else if (strcmp(name,"Outputdefinition1545")==0) return Outputdefinition1545Enum; else if (strcmp(name,"Outputdefinition1546")==0) return Outputdefinition1546Enum; else if (strcmp(name,"Outputdefinition1547")==0) return Outputdefinition1547Enum; else if (strcmp(name,"Outputdefinition1548")==0) return Outputdefinition1548Enum; @@ -3087,11 +3088,11 @@ int StringToEnumx(const char* name,bool notfounderror){ else if (strcmp(name,"Outputdefinition1605")==0) return Outputdefinition1605Enum; else if (strcmp(name,"Outputdefinition1660")==0) return Outputdefinition1660Enum; else if (strcmp(name,"Outputdefinition1661")==0) return Outputdefinition1661Enum; - else if (strcmp(name,"Outputdefinition1662")==0) return Outputdefinition1662Enum; else stage=26; } if(stage==26){ - if (strcmp(name,"Outputdefinition1663")==0) return Outputdefinition1663Enum; + if (strcmp(name,"Outputdefinition1662")==0) return Outputdefinition1662Enum; + else if (strcmp(name,"Outputdefinition1663")==0) return Outputdefinition1663Enum; else if (strcmp(name,"Outputdefinition1664")==0) return Outputdefinition1664Enum; else if (strcmp(name,"Outputdefinition1665")==0) return Outputdefinition1665Enum; else if (strcmp(name,"Outputdefinition1666")==0) return Outputdefinition1666Enum; @@ -3210,11 +3211,11 @@ int StringToEnumx(const char* name,bool notfounderror){ else if (strcmp(name,"Outputdefinition1778")==0) return Outputdefinition1778Enum; else if (strcmp(name,"Outputdefinition1779")==0) return Outputdefinition1779Enum; else if (strcmp(name,"Outputdefinition1707")==0) return Outputdefinition1707Enum; - else if (strcmp(name,"Outputdefinition1780")==0) return Outputdefinition1780Enum; else stage=27; } if(stage==27){ - if (strcmp(name,"Outputdefinition1781")==0) return Outputdefinition1781Enum; + if (strcmp(name,"Outputdefinition1780")==0) return Outputdefinition1780Enum; + else if (strcmp(name,"Outputdefinition1781")==0) return Outputdefinition1781Enum; else if (strcmp(name,"Outputdefinition1782")==0) return Outputdefinition1782Enum; else if (strcmp(name,"Outputdefinition1783")==0) return Outputdefinition1783Enum; else if (strcmp(name,"Outputdefinition1784")==0) return Outputdefinition1784Enum; @@ -3333,11 +3334,11 @@ int StringToEnumx(const char* name,bool notfounderror){ else if (strcmp(name,"Outputdefinition1896")==0) return Outputdefinition1896Enum; else if (strcmp(name,"Outputdefinition1897")==0) return Outputdefinition1897Enum; else if (strcmp(name,"Outputdefinition1898")==0) return Outputdefinition1898Enum; - else if (strcmp(name,"Outputdefinition1899")==0) return Outputdefinition1899Enum; else stage=28; } if(stage==28){ - if (strcmp(name,"Outputdefinition1809")==0) return Outputdefinition1809Enum; + if (strcmp(name,"Outputdefinition1899")==0) return Outputdefinition1899Enum; + else if (strcmp(name,"Outputdefinition1809")==0) return Outputdefinition1809Enum; else if (strcmp(name,"Outputdefinition1900")==0) return Outputdefinition1900Enum; else if (strcmp(name,"Outputdefinition1901")==0) return Outputdefinition1901Enum; else if (strcmp(name,"Outputdefinition1910")==0) return Outputdefinition1910Enum; @@ -3456,11 +3457,11 @@ int StringToEnumx(const char* name,bool notfounderror){ else if (strcmp(name,"BalancethicknessAnalysis")==0) return BalancethicknessAnalysisEnum; else if (strcmp(name,"BalancethicknessApparentMassbalance")==0) return BalancethicknessApparentMassbalanceEnum; else if (strcmp(name,"BalancethicknessSoftAnalysis")==0) return BalancethicknessSoftAnalysisEnum; - else if (strcmp(name,"BalancethicknessSoftSolution")==0) return BalancethicknessSoftSolutionEnum; else stage=29; } if(stage==29){ - if (strcmp(name,"BalancethicknessSolution")==0) return BalancethicknessSolutionEnum; + if (strcmp(name,"BalancethicknessSoftSolution")==0) return BalancethicknessSoftSolutionEnum; + else if (strcmp(name,"BalancethicknessSolution")==0) return BalancethicknessSolutionEnum; else if (strcmp(name,"BalancevelocityAnalysis")==0) return BalancevelocityAnalysisEnum; else if (strcmp(name,"BalancevelocitySolution")==0) return BalancevelocitySolutionEnum; else if (strcmp(name,"BasalforcingsIsmip6")==0) return BasalforcingsIsmip6Enum; @@ -3579,11 +3580,11 @@ int StringToEnumx(const char* name,bool notfounderror){ else if (strcmp(name,"GroundedAreaScaled")==0) return GroundedAreaScaledEnum; else if (strcmp(name,"GroundingOnly")==0) return GroundingOnlyEnum; else if (strcmp(name,"GroundinglineMassFlux")==0) return GroundinglineMassFluxEnum; - else if (strcmp(name,"Gset")==0) return GsetEnum; else stage=30; } if(stage==30){ - if (strcmp(name,"Gsl")==0) return GslEnum; + if (strcmp(name,"Gset")==0) return GsetEnum; + else if (strcmp(name,"Gsl")==0) return GslEnum; else if (strcmp(name,"HOApproximation")==0) return HOApproximationEnum; else if (strcmp(name,"HOFSApproximation")==0) return HOFSApproximationEnum; else if (strcmp(name,"Hook")==0) return HookEnum; @@ -3702,11 +3703,11 @@ int StringToEnumx(const char* name,bool notfounderror){ else if (strcmp(name,"NoFrictionOnPartiallyFloating")==0) return NoFrictionOnPartiallyFloatingEnum; else if (strcmp(name,"NoMeltOnPartiallyFloating")==0) return NoMeltOnPartiallyFloatingEnum; else if (strcmp(name,"Nodal")==0) return NodalEnum; - else if (strcmp(name,"Nodalvalue")==0) return NodalvalueEnum; else stage=31; } if(stage==31){ - if (strcmp(name,"NodeSId")==0) return NodeSIdEnum; + if (strcmp(name,"Nodalvalue")==0) return NodalvalueEnum; + else if (strcmp(name,"NodeSId")==0) return NodeSIdEnum; else if (strcmp(name,"NoneApproximation")==0) return NoneApproximationEnum; else if (strcmp(name,"None")==0) return NoneEnum; else if (strcmp(name,"Numberedcostfunction")==0) return NumberedcostfunctionEnum; @@ -3825,11 +3826,11 @@ int StringToEnumx(const char* name,bool notfounderror){ else if (strcmp(name,"TotalFloatingBmb")==0) return TotalFloatingBmbEnum; else if (strcmp(name,"TotalFloatingBmbScaled")==0) return TotalFloatingBmbScaledEnum; else if (strcmp(name,"TotalGroundedBmb")==0) return TotalGroundedBmbEnum; - else if (strcmp(name,"TotalGroundedBmbScaled")==0) return TotalGroundedBmbScaledEnum; else stage=32; } if(stage==32){ - if (strcmp(name,"TotalSmb")==0) return TotalSmbEnum; + if (strcmp(name,"TotalGroundedBmbScaled")==0) return TotalGroundedBmbScaledEnum; + else if (strcmp(name,"TotalSmb")==0) return TotalSmbEnum; else if (strcmp(name,"TotalSmbScaled")==0) return TotalSmbScaledEnum; else if (strcmp(name,"TotalSmbRefreeze")==0) return TotalSmbRefreezeEnum; else if (strcmp(name,"TotalSmbMelt")==0) return TotalSmbMeltEnum; diff --git a/src/c/shared/Enum/issmenums.jl b/src/c/shared/Enum/issmenums.jl index b56e1dc37..25158c48a 100644 --- a/src/c/shared/Enum/issmenums.jl +++ b/src/c/shared/Enum/issmenums.jl @@ -596,6 +596,7 @@ SmbIsmappedforcingEnum SmbIsmeltEnum SmbIsmungsmEnum + SmbIsprecipforcingremappedEnum SmbIsprecipscaledEnum SmbIssetpddfacEnum SmbIsshortwaveEnum @@ -4361,6 +4362,7 @@ function EnumToString(enum::IssmEnum) if(enum==SmbIsmappedforcingEnum) return "SmbIsmappedforcing" end if(enum==SmbIsmeltEnum) return "SmbIsmelt" end if(enum==SmbIsmungsmEnum) return "SmbIsmungsm" end + if(enum==SmbIsprecipforcingremappedEnum) return "SmbIsprecipforcingremapped" end if(enum==SmbIsprecipscaledEnum) return "SmbIsprecipscaled" end if(enum==SmbIssetpddfacEnum) return "SmbIssetpddfac" end if(enum==SmbIsshortwaveEnum) return "SmbIsshortwave" end @@ -8126,6 +8128,7 @@ function StringToEnum(name::String) if(name=="SmbIsmappedforcing") return SmbIsmappedforcingEnum end if(name=="SmbIsmelt") return SmbIsmeltEnum end if(name=="SmbIsmungsm") return SmbIsmungsmEnum end + if(name=="SmbIsprecipforcingremapped") return SmbIsprecipforcingremappedEnum end if(name=="SmbIsprecipscaled") return SmbIsprecipscaledEnum end if(name=="SmbIssetpddfac") return SmbIssetpddfacEnum end if(name=="SmbIsshortwave") return SmbIsshortwaveEnum end diff --git a/src/m/classes/SMBgemb.m b/src/m/classes/SMBgemb.m index d2a8682e5..69c88973c 100644 --- a/src/m/classes/SMBgemb.m +++ b/src/m/classes/SMBgemb.m @@ -24,6 +24,7 @@ isconstrainsurfaceT = 0; isdeltaLWup = 0; ismappedforcing = 0; + isprecipforcingremapped = 0; iscompressedforcing = 0; %inputs: @@ -177,6 +178,7 @@ function disp(self) % {{{ fielddisplay(self,'isconstrainsurfaceT','constrain surface temperatures to air temperature, turn off EC and surface flux contribution to surface temperature change (default false)'); fielddisplay(self,'isdeltaLWup','set to true to invoke a bias in the long wave upward spatially, specified by dulwrfValue (default false)'); fielddisplay(self,'ismappedforcing','set to true if forcing grid does not match model mesh, mapping specified by mappedforcingpoint (default false)'); + fielddisplay(self,'isprecipforcingremapped','set to true if ismappedforcing is true and precip should be downscaled from native grid (Default value is true)'); fielddisplay(self,'iscompressedforcing','set to true to compress the input matrices when writing to binary (default false)'); fielddisplay(self,'Ta','2 m air temperature, in Kelvin'); fielddisplay(self,'V','wind speed (m s-1)'); @@ -368,6 +370,7 @@ function disp(self) % {{{ self.isconstrainsurfaceT=0; self.isdeltaLWup=0; self.ismappedforcing=0; + self.isprecipforcingremapped=1; self.iscompressedforcing=0; self.aIdx = 1; @@ -440,6 +443,7 @@ function disp(self) % {{{ md = checkfield(md,'fieldname','smb.isconstrainsurfaceT','values',[0 1]); md = checkfield(md,'fieldname','smb.isdeltaLWup','values',[0 1]); md = checkfield(md,'fieldname','smb.ismappedforcing','values',[0 1]); + md = checkfield(md,'fieldname','smb.isprecipforcingremapped','values',[0 1]); md = checkfield(md,'fieldname','smb.iscompressedforcing','values',[0 1]); sizeta=size(self.Ta); @@ -530,6 +534,7 @@ function marshall(self,prefix,md,fid) % {{{ WriteData(fid,prefix,'object',self,'class','smb','fieldname','isconstrainsurfaceT','format','Boolean'); WriteData(fid,prefix,'object',self,'class','smb','fieldname','isdeltaLWup','format','Boolean'); WriteData(fid,prefix,'object',self,'class','smb','fieldname','ismappedforcing','format','Boolean'); + WriteData(fid,prefix,'object',self,'class','smb','fieldname','isprecipforcingremapped','format','Boolean'); if self.iscompressedforcing writetype='CompressedMat'; diff --git a/src/m/classes/SMBgemb.py b/src/m/classes/SMBgemb.py index db8211fc1..9faf49546 100644 --- a/src/m/classes/SMBgemb.py +++ b/src/m/classes/SMBgemb.py @@ -32,6 +32,7 @@ def __init__(self, *args): # {{{ self.isconstrainsurfaceT = 0 self.isdeltaLWup = 0 self.ismappedforcing = 0 + self.isprecipforcingremapped = 0 self.iscompressedforcing = 0 # Inputs @@ -178,6 +179,7 @@ def __repr__(self): # {{{ s += '{}\n'.format(fielddisplay(self, 'isconstrainsurfaceT', 'constrain surface temperatures to air temperature, turn off EC and surface flux contribution to surface temperature change (default false)')) s += '{}\n'.format(fielddisplay(self, 'isdeltaLWup', 'set to true to invoke a bias in the long wave upward spatially, specified by dulwrfValue (default false)')) s += '{}\n'.format(fielddisplay(self,'ismappedforcing','set to true if forcing grid does not match model mesh, mapping specified by mappedforcingpoint (default false)')) + s += '{}\n'.format(fielddisplay(self,'isprecipforcingremapped','set to true if ismappedforcing is true and precip should be downscaled from native grid (Default value is true)')) s += '{}\n'.format(fielddisplay(self,'iscompressedforcing','set to true to compress the input matrices when writing to binary (default false)')) s += '{}\n'.format(fielddisplay(self, 'Ta', '2 m air temperature, in Kelvin')) s += '{}\n'.format(fielddisplay(self, 'V', 'wind speed (m s-1)')) @@ -348,6 +350,7 @@ def setdefaultparameters(self, mesh): # {{{ self.isconstrainsurfaceT = 0 self.isdeltaLWup = 0 self.ismappedforcing = 0 + self.isprecipforcingremapped = 1 self.iscompressedforcing = 0 self.aIdx = 1 @@ -423,6 +426,7 @@ def checkconsistency(self, md, solution, analyses): # {{{ md = checkfield(md, 'fieldname', 'smb.isdeltaLWup', 'values',[0, 1]) md = checkfield(md, 'fieldname', 'smb.isconstrainsurfaceT', 'values', [0, 1]) md = checkfield(md, 'fieldname', 'smb.ismappedforcing', 'values',[0, 1]) + md = checkfield(md, 'fieldname', 'smb.isprecipforcingremapped', 'values',[0, 1]) md = checkfield(md, 'fieldname', 'smb.iscompressedforcing', 'values',[0, 1]) sizeta=np.shape(self.Ta) @@ -508,6 +512,7 @@ def marshall(self, prefix, md, fid): # {{{ WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'isconstrainsurfaceT', 'format', 'Boolean') WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'isdeltaLWup', 'format', 'Boolean') WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'ismappedforcing', 'format', 'Boolean') + WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'isprecipforcingremapped', 'format', 'Boolean') if self.iscompressedforcing: writetype='CompressedMat' diff --git a/test/Archives/Archive258.arch b/test/Archives/Archive258.arch index 04ac3f7f4753a124174d07f731ac51ff819e5ab9..b408bc93d443f1f1d6a212304551ee25e3221e18 100644 GIT binary patch literal 24367 zcmeI)2{e`K+c0pUGG%I1Dv=~ZWhhauTdAC*L4!2VB%)H!ZooG0Eh$t)WS&JLQmGUw zLy{>9m9Y>zp(I1`-a2mQznsN?egAKL-&*hc?!A`tTi5ek`+n}{x`*AfIGclmLyUui zV;uew(K=~tW^QSsq^h>h)ZFCQp{4ks0RG`bbWhCh*Qm)#IJXR^aN!@^+Bkm*`_ZMj z#Mu=Bx(b-rwoQP*(>~A32mB!*x<9lODfmb1-A<=-K%kJowImsL@GlL1S6U_v0r6aWTwVRZ|D(E9#`Jm!-ZNcE<53|5 zDIY#uq#X=FD>Ip04JRS&K$K*#+H8oCsCpu@T^b@5clz$@KL-&?1uDV%J0Ot| zZ@QF0P^qs7SLb60+m~>3pnwCy=Df*!&T|EVzna}KZ7PP4lD;B8t|<`XPt%u_!Toxg zJkeweKLnLen`Ofh3z2c!zM|gS;kxov8Nn&)5b?u2OXGYdM0jj4{AgMOk&C5geyA^n z$OObuD(Et8^)I;IKk4v;M@Jz<3oUN(`2-=_)A}3d z?}w;Zqc@FpUm-ALXWYRL2!c?@Cm{n>2#ahBzQK6_BHS;XaM@4*k+1hmli_{`QR6pF zzosYyF_$(i9>*sE5l`x^-snw%fV9Lmm#H2QaO&)aI&mI|bzE~ybDAmmci%3R+WIGi zADTbQqB;`7)54kj%+C;28Yy=|Mi!zie_c3e@g7CjkLG zr`EJ5H9(yI;46SFyAJGmz+MOcWA_1n|DXlyvJzm}K*lwJluO`GjM=p}Ha;2ri3z?| z(>)ZypV*s`!ud53{D%x!sXue^Wc)cmG~Q|#Lz9JoA#YgBa|`Y?h8v5#I`+1U4jY${ zfBe!B6ByR2s{4bfOvbtdR>*ub{Mv}ztMHFE!-Y5 zCCMuw=2J8f??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8@JxM`xG$dUUp8%!}THx7xq^b;`$0* z$neg-kMARXpGN(&zntmZB&A=E+jrP(Wa^LgC^wl$!~KVK1bnRl2G7%`%v@Vs2WJP1 zvM0b0ICLz#x&hZ!!CO=r9~bl%H;3wfG1D#10*~WNOSuj0bbP&LcJtJ6zq3(la5cW~ zIoe6SQ-^>deq6xFn*-N@&rVs#>M!{WzW%ll*K7KkJ=PzG$Nhx5y-TW;X~ ztJPCa_v7~HW>;--{fPWtc2h6o`p=KAkDRg_7-B*THq#66ywW(BV(K?)_n@ql(%L@g z=&NxPksgG$yk?e@{so8ma<~(4|ga3!~0DsQ>G490GBk_3t({my-az0UR zBqox6h$N3Vwte}L^T%_|$Z;a+he+NZPm(vDqd@`=XmFl z_s5<`-XBlJk^aV$+~;_Xy{l+m~Ul zCfSI0-&x)JJslHfkA8PH&LXez+s0p>{pXdCRP6ZK_*>`x%!YSu*IwtWT{K}f{|bN)_)JAq{J6-3*`s5L*lv9Gjr`OwVfN@)qG#@kp9ej^{ujrI-ckSn literal 0 HcmV?d00001 diff --git a/test/NightlyRun/test258.m b/test/NightlyRun/test258.m index 8be276667..0137c0554 100644 --- a/test/NightlyRun/test258.m +++ b/test/NightlyRun/test258.m @@ -39,6 +39,7 @@ mpoints=1:md2.mesh.numberofelements; md.smb.ismappedforcing=1; +md.smb.isprecipforcingremapped=1; md.smb.mappedforcingpoint=griddata(xe2,ye2,mpoints,xe,ye,'nearest'); md.smb.mappedforcingelevation=mean(md2.geometry.surface(md2.mesh.elements),2); diff --git a/test/NightlyRun/test258.py b/test/NightlyRun/test258.py index cc563f631..c325da6f2 100644 --- a/test/NightlyRun/test258.py +++ b/test/NightlyRun/test258.py @@ -56,6 +56,7 @@ mpoints=np.arange(1,md2.mesh.numberofelements+1) md.smb.ismappedforcing=1 +md.smb.isprecipforcingremapped=1 interpp = NearestNDInterpolator((xe2, ye2), mpoints) md.smb.mappedforcingpoint=interpp(xe,ye) md.smb.mappedforcingelevation=np.mean(md2.geometry.surface[md2.mesh.elements-1],axis=1) diff --git a/test/NightlyRun/test259.m b/test/NightlyRun/test259.m new file mode 100644 index 000000000..5b7816c26 --- /dev/null +++ b/test/NightlyRun/test259.m @@ -0,0 +1,111 @@ +%Test Name: SquareShelfSMBGembMapping +md=triangle(model(),'../Exp/Square.exp',350000/2.); +md=setmask(md,'all',''); +md=parameterize(md,'../Par/SquareShelf.par'); +md=setflowequation(md,'SSA','all'); +md.materials.rho_ice=910; +md.cluster=generic('name',oshostname(),'np',3); + +md2=triangle(model(),'../Exp/Square.exp',350000.); +md2=setmask(md2,'all',''); +md2=parameterize(md2,'../Par/SquareShelf.par'); + +% Use of Gemb method for SMB computation +md.smb = SMBgemb(md.mesh); +md.smb.dsnowIdx = 1; +md.smb.swIdx = 1; + +%load hourly surface forcing date from 1979 to 2009: +inputs=load('../Data/gemb_input.mat'); + +%setup the inputs: +md.smb.Ta=[repmat(inputs.Ta0',md2.mesh.numberofelements,1);inputs.dateN']; +md.smb.V=[repmat(inputs.V0',md2.mesh.numberofelements,1);inputs.dateN']; +md.smb.dswrf=[repmat(inputs.dsw0',md2.mesh.numberofelements,1);inputs.dateN']; +md.smb.dlwrf=[repmat(inputs.dlw0',md2.mesh.numberofelements,1);inputs.dateN']; +md.smb.P=[repmat(inputs.P0',md2.mesh.numberofelements,1);inputs.dateN']; +md.smb.eAir=[repmat(inputs.eAir0',md2.mesh.numberofelements,1);inputs.dateN']; +md.smb.pAir=[repmat(inputs.pAir0',md2.mesh.numberofelements,1);inputs.dateN']; +md.smb.Vz=repmat(inputs.LP.Vz,md2.mesh.numberofelements,1); +md.smb.Tz=repmat(inputs.LP.Tz,md2.mesh.numberofelements,1); +md.smb.Tmean=repmat(inputs.LP.Tmean,md2.mesh.numberofelements,1); +md.smb.Vmean=10*ones(size(md.smb.Tmean)); +md.smb.C=repmat(inputs.LP.C,md2.mesh.numberofelements,1); + +xe=mean(md.mesh.x(md.mesh.elements),2); +ye=mean(md.mesh.y(md.mesh.elements),2); +xe2=mean(md2.mesh.x(md2.mesh.elements),2); +ye2=mean(md2.mesh.y(md2.mesh.elements),2); +mpoints=1:md2.mesh.numberofelements; + +md.smb.ismappedforcing=1; +md.smb.isprecipforcingremapped=0; +md.smb.lapsedlwrfValue=0; +md.smb.mappedforcingpoint=griddata(xe2,ye2,mpoints,xe,ye,'nearest'); +md.smb.mappedforcingelevation=mean(md2.geometry.surface(md2.mesh.elements),2); + +%smb settings +md.smb.requested_outputs={'SmbDz','SmbT','SmbD','SmbRe','SmbGdn','SmbGsp','SmbEC',... + 'SmbA','SmbMassBalance','SmbMAdd','SmbDzAdd','SmbFAC','SmbMeanSHF','SmbMeanLHF',... + 'SmbMeanULW','SmbNetLW','SmbNetSW','SmbWAdd','SmbRunoff','SmbRefreeze','SmbMelt',... + 'SmbEC','SmbPrecipitation','SmbRain','SmbAccumulatedMassBalance','SmbAccumulatedRunoff',... + 'SmbAccumulatedMelt','SmbAccumulatedEC','SmbAccumulatedPrecipitation','SmbAccumulatedRain',... + 'SmbAccumulatedPrecipitation','SmbAccumulatedRefreeze'}; + +%only run smb core: +md.transient.isstressbalance=0; +md.transient.ismasstransport=0; +md.transient.isthermal=0; + +%time stepping: +md.timestepping.start_time=1965; +md.timestepping.final_time=1965.7; +md.timestepping.time_step=1/365.0; +md.timestepping.interp_forcing=0; + +%Run transient +md=solve(md,'Transient'); + +nlayers=size(md.results.TransientSolution(1).SmbT,2); +for i=2:length(md.results.TransientSolution) + nlayers=min(size(md.results.TransientSolution(i).SmbT,2), nlayers); +end + +%Fields and tolerances to track changes +field_names ={'Layers','SmbDz','SmbT','SmbD','SmbRe','SmbGdn','SmbGsp','SmbA' ,'SmbEC','SmbMassBalance','SmbMAdd','SmbDzAdd','SmbFAC','SmbMeanSHF','SmbMeanLHF','SmbMeanULW','SmbNetLW','SmbNetSW','SmbAccumulatedMassBalance','SmbAccumulatedRunoff','SmbAccumulatedMelt','SmbAccumulatedEC','SmbAccumulatedPrecipitation','SmbAccumulatedRain','SmbAccumulatedRefreeze','SmbRunoff','SmbMelt','SmbEC','SmbPrecipitation','SmbRain','SmbRefreeze','SmbWAdd'}; +field_tolerances ={1e-12,4e-11,2e-11,3e-11,6e-11,8e-11,8e-11,1e-12,5e-11,2e-12,1e-12,1e-12,4e-11,2e-11,5e-11,1e-11,9e-10,2e-11,1e-11,9e-10,2e-11,2e-09,1e-11,1e-11,1e-11,8e-10,2e-11,2e-11,1e-11,1e-11,2e-11,1e-11}; + +field_values={... + (nlayers),... + (md.results.TransientSolution(end).SmbDz(1,1:nlayers)),... + (md.results.TransientSolution(end).SmbT(1,1:nlayers)),... + (md.results.TransientSolution(end).SmbD(1,1:nlayers)),... + (md.results.TransientSolution(end).SmbRe(1,1:nlayers)),... + (md.results.TransientSolution(end).SmbGdn(1,1:nlayers)),... + (md.results.TransientSolution(end).SmbGsp(1,1:nlayers)),... + (md.results.TransientSolution(end).SmbA(1,1:nlayers)),... + (md.results.TransientSolution(end).SmbEC(1)),... + (md.results.TransientSolution(end).SmbMassBalance(1)),... + (md.results.TransientSolution(end).SmbMAdd(1)),... + (md.results.TransientSolution(end).SmbDzAdd(1)),... + (md.results.TransientSolution(end).SmbFAC(1)),... + (md.results.TransientSolution(end).SmbMeanSHF(1)),... + (md.results.TransientSolution(end).SmbMeanLHF(1)),... + (md.results.TransientSolution(end).SmbMeanULW(1)),... + (md.results.TransientSolution(end).SmbNetLW(1)),... + (md.results.TransientSolution(end).SmbNetSW(1)),... + (md.results.TransientSolution(end).SmbAccumulatedMassBalance(1)),... + (md.results.TransientSolution(end).SmbAccumulatedRunoff(1)),... + (md.results.TransientSolution(end).SmbAccumulatedMelt(1)),... + (md.results.TransientSolution(end).SmbAccumulatedEC(1)),... + (md.results.TransientSolution(end).SmbAccumulatedPrecipitation(1)),... + (md.results.TransientSolution(end).SmbAccumulatedRain(1)),... + (md.results.TransientSolution(end).SmbAccumulatedRefreeze(1)),... + (md.results.TransientSolution(200).SmbRunoff(1)),... + (md.results.TransientSolution(200).SmbMelt(1)),... + (md.results.TransientSolution(200).SmbEC(1)),... + (md.results.TransientSolution(200).SmbPrecipitation(1)),... + (md.results.TransientSolution(200).SmbRain(1)),... + (md.results.TransientSolution(200).SmbRefreeze(1)),... + (md.results.TransientSolution(200).SmbWAdd(1))... +}; diff --git a/test/NightlyRun/test259.py b/test/NightlyRun/test259.py new file mode 100644 index 000000000..d65fc217b --- /dev/null +++ b/test/NightlyRun/test259.py @@ -0,0 +1,129 @@ +#Test Name: SquareShelfSMBGembMapping +from socket import gethostname +import sys +import numpy as np +from model import * +from parameterize import * +from setflowequation import * +from setmask import * +from SMBgemb import * +from solve import * +from triangle import * + +from scipy.interpolate import NearestNDInterpolator + +md = triangle(model(), '../Exp/Square.exp', 350000./2) +md = setmask(md, 'all', '') +md = parameterize(md, '../Par/SquareShelf.py') +md = setflowequation(md, 'SSA', 'all') +md.materials.rho_ice = 910 +md.cluster = generic('name', gethostname(), 'np', 3) + +md2 = triangle(model(), '../Exp/Square.exp', 350000.) +md2 = setmask(md2, 'all', '') +md2 = parameterize(md2, '../Par/SquareShelf.py') + +#Use of Gemb method for SMB computation +md.smb = SMBgemb(md.mesh) +md.smb.dsnowIdx = 1 +md.smb.swIdx = 1 + +#load hourly surface forcing date from 1979 to 2009: +if sys.version_info.major == 2: + inputs = np.load('../Data/gemb_input.npy', allow_pickle=True).item() +else: + inputs = np.load('../Data/gemb_input.npy', allow_pickle=True, encoding='bytes').item() + +#setup the inputs: +md.smb.Ta = np.append(np.tile(np.conjugate(inputs[b'Ta0']), (md2.mesh.numberofelements, 1)), np.conjugate([inputs[b'dateN']]), axis=0) +md.smb.V = np.append(np.tile(np.conjugate(inputs[b'V0']), (md2.mesh.numberofelements, 1)), np.conjugate([inputs[b'dateN']]), axis=0) +md.smb.dswrf = np.append(np.tile(np.conjugate(inputs[b'dsw0']), (md2.mesh.numberofelements, 1)), np.conjugate([inputs[b'dateN']]), axis=0) +md.smb.dlwrf = np.append(np.tile(np.conjugate(inputs[b'dlw0']), (md2.mesh.numberofelements, 1)), np.conjugate([inputs[b'dateN']]), axis=0) +md.smb.P = np.append(np.tile(np.conjugate(inputs[b'P0']), (md2.mesh.numberofelements, 1)), np.conjugate([inputs[b'dateN']]), axis=0) +md.smb.eAir = np.append(np.tile(np.conjugate(inputs[b'eAir0']), (md2.mesh.numberofelements, 1)), np.conjugate([inputs[b'dateN']]), axis=0) +md.smb.pAir = np.append(np.tile(np.conjugate(inputs[b'pAir0']), (md2.mesh.numberofelements, 1)), np.conjugate([inputs[b'dateN']]), axis=0) +md.smb.Vz = np.tile(np.conjugate(inputs[b'LP']['Vz']), (md2.mesh.numberofelements, 1)).flatten() +md.smb.Tz = np.tile(np.conjugate(inputs[b'LP']['Tz']), (md2.mesh.numberofelements, 1)).flatten() +md.smb.Tmean = np.tile(np.conjugate(inputs[b'LP']['Tmean']), (md2.mesh.numberofelements, 1)).flatten() +md.smb.Vmean = (md.smb.Tmean*0)+10 +md.smb.C = np.tile(np.conjugate(inputs[b'LP']['C']), (md2.mesh.numberofelements, 1)).flatten() + +xe=np.mean(md.mesh.x[md.mesh.elements-1],axis=1) +ye=np.mean(md.mesh.y[md.mesh.elements-1],axis=1) +xe2=np.mean(md2.mesh.x[md2.mesh.elements-1],axis=1) +ye2=np.mean(md2.mesh.y[md2.mesh.elements-1],axis=1) + +mpoints=np.arange(1,md2.mesh.numberofelements+1) + +md.smb.ismappedforcing=1 +md.smb.isprecipforcingremapped=0 +md.smb.lapsedlwrfValue=0 +interpp = NearestNDInterpolator((xe2, ye2), mpoints) +md.smb.mappedforcingpoint=interpp(xe,ye) +md.smb.mappedforcingelevation=np.mean(md2.geometry.surface[md2.mesh.elements-1],axis=1) + +#smb settings +md.smb.requested_outputs = ['SmbDz','SmbT','SmbD','SmbRe','SmbGdn','SmbGsp','SmbEC', + 'SmbA','SmbMassBalance','SmbMAdd','SmbDzAdd','SmbFAC','SmbMeanSHF','SmbMeanLHF', + 'SmbMeanULW','SmbNetLW','SmbNetSW','SmbWAdd','SmbRunoff','SmbRefreeze','SmbMelt', + 'SmbEC','SmbPrecipitation','SmbRain','SmbAccumulatedMassBalance','SmbAccumulatedRunoff', + 'SmbAccumulatedMelt','SmbAccumulatedEC','SmbAccumulatedPrecipitation','SmbAccumulatedRain', + 'SmbAccumulatedPrecipitation','SmbAccumulatedRefreeze'] + +#only run smb core: +md.transient.isstressbalance = 0 +md.transient.ismasstransport = 0 +md.transient.isthermal = 0 + +#time stepping: +md.timestepping.start_time = 1965. +md.timestepping.final_time = 1965.7 +md.timestepping.time_step = 1.0 / 365 +md.timestepping.interp_forcing = 0. + +#Run transient +md = solve(md, 'Transient') + +nlayers = md.results.TransientSolution[0].SmbT.shape[1] +for i in range(1, len(md.results.TransientSolution)): + nlayers=np.minimum(md.results.TransientSolution[i].SmbT.shape[1], nlayers) + +#Fields and tolerances to track changes +field_names = ['Layers', 'SmbDz', 'SmbT', 'SmbD', 'SmbRe', 'SmbGdn', 'SmbGsp', 'SmbA', 'SmbEC', 'SmbMassBalance', 'SmbMAdd', 'SmbDzAdd', 'SmbFAC', 'SmbMeanSHF', 'SmbMeanLHF', 'SmbMeanULW', 'SmbNetLW', 'SmbNetSW', 'SmbAccumulatedMassBalance', 'SmbAccumulatedRunoff', 'SmbAccumulatedMelt', 'SmbAccumulatedEC', 'SmbAccumulatedPrecipitation', 'SmbAccumulatedRain', 'SmbAccumulatedRefreeze', 'SmbRunoff', 'SmbMelt', 'SmbEC', 'SmbPrecipitation', 'SmbRain', 'SmbRefreeze', 'SmbWAdd'] +field_tolerances = [1e-12, 4e-11, 2e-11, 3e-11, 6e-11, 8e-11, 8e-11, 1e-12, 5e-11, 2e-12, 1e-12, 1e-12, 4e-11, 2e-11, 5e-11, 1e-11, 9e-10, 2e-11, 1e-11, 9e-10, 2e-11, 2e-09, 1e-11, 1e-11, 1e-11, 8e-10, 2e-11, 2e-11, 1e-11, 1e-11, 2e-11, 1e-11] + +# Shape is different in python solution (fixed using reshape) which can cause test failure +field_values = [ + nlayers, + md.results.TransientSolution[-1].SmbDz[0, 0:nlayers].reshape(1, -1), + md.results.TransientSolution[-1].SmbT[0, 0:nlayers].reshape(1, -1), + md.results.TransientSolution[-1].SmbD[0, 0:nlayers].reshape(1, -1), + md.results.TransientSolution[-1].SmbRe[0, 0:nlayers].reshape(1, -1), + md.results.TransientSolution[-1].SmbGdn[0, 0:nlayers].reshape(1, -1), + md.results.TransientSolution[-1].SmbGsp[0, 0:nlayers].reshape(1, -1), + md.results.TransientSolution[-1].SmbA[0, 0:nlayers].reshape(1, -1), + md.results.TransientSolution[-1].SmbEC[0], + md.results.TransientSolution[-1].SmbMassBalance[0], + md.results.TransientSolution[-1].SmbMAdd[0], + md.results.TransientSolution[-1].SmbDzAdd[0], + md.results.TransientSolution[-1].SmbFAC[0], + md.results.TransientSolution[-1].SmbMeanSHF[0], + md.results.TransientSolution[-1].SmbMeanLHF[0], + md.results.TransientSolution[-1].SmbMeanULW[0], + md.results.TransientSolution[-1].SmbNetLW[0], + md.results.TransientSolution[-1].SmbNetSW[0], + md.results.TransientSolution[-1].SmbAccumulatedMassBalance[0], + md.results.TransientSolution[-1].SmbAccumulatedRunoff[0], + md.results.TransientSolution[-1].SmbAccumulatedMelt[0], + md.results.TransientSolution[-1].SmbAccumulatedEC[0], + md.results.TransientSolution[-1].SmbAccumulatedPrecipitation[0], + md.results.TransientSolution[-1].SmbAccumulatedRain[0], + md.results.TransientSolution[-1].SmbAccumulatedRefreeze[0], + md.results.TransientSolution[199].SmbRunoff[0], + md.results.TransientSolution[199].SmbMelt[0], + md.results.TransientSolution[199].SmbEC[0], + md.results.TransientSolution[199].SmbPrecipitation[0], + md.results.TransientSolution[199].SmbRain[0], + md.results.TransientSolution[199].SmbRefreeze[0], + md.results.TransientSolution[199].SmbWAdd[0] + ] From 07d5cea0622a40d3fd7a3ffab5c33154f798a625 Mon Sep 17 00:00:00 2001 From: NJSchlegel <95945328+NJSchlegel@users.noreply.github.com> Date: Tue, 17 Jun 2025 18:19:07 -0400 Subject: [PATCH 012/126] CHG: update class description for the dlw down lapse rate for mapping option --- src/m/classes/SMBgemb.m | 4 ++-- src/m/classes/SMBgemb.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/m/classes/SMBgemb.m b/src/m/classes/SMBgemb.m index 69c88973c..66cbece71 100644 --- a/src/m/classes/SMBgemb.m +++ b/src/m/classes/SMBgemb.m @@ -54,7 +54,7 @@ lapseTaValue = NaN; %Temperature lapse rate if forcing has different grid and should be remapped. Use if ismappedforcing is true. % (Default value is -0.006 K m-1.) lapsedlwrfValue = NaN; %Longwave down lapse rate if forcing has different grid and should be remapped. Use if ismappedforcing is true. - % (Default value is -0.032 W m-2 m-1.) + % If set to 0, dlwrf will scale with a constant effective atmospheric emissivity. (Default value is -0.032 W m-2 m-1.) % Initialization of snow properties Dzini = NaN; %cell depth (m) @@ -225,7 +225,7 @@ function disp(self) % {{{ fielddisplay(self,'mappedforcingpoint','Mapping of which forcing point will map to each mesh element for ismappedforcing option (integer). Size number of elements.'); fielddisplay(self,'mappedforcingelevation','The elevation of each mapped forcing location (m above sea level) for ismappedforcing option. Size number of forcing points.'); fielddisplay(self,'lapseTaValue','Temperature lapse rate if forcing has different grid and should be remapped for ismappedforcing option. (Default value is -0.006 K m-1.)'); - fielddisplay(self,'lapsedlwrfValue','Longwave down lapse rate if forcing has different grid and should be remapped for ismappedforcing option. (Default value is -0.032 W m-2 m-1.)'); + fielddisplay(self,'lapsedlwrfValue','Longwave down lapse rate if forcing has different grid and should be remapped for ismappedforcing option. If set to 0, dlwrf will scale with a constant effective atmospheric emissivity. (Default value is -0.032 W m-2 m-1.)'); %snow properties init fielddisplay(self,'Dzini','Initial cell depth when restart [m]'); diff --git a/src/m/classes/SMBgemb.py b/src/m/classes/SMBgemb.py index 9faf49546..dad4ab10f 100644 --- a/src/m/classes/SMBgemb.py +++ b/src/m/classes/SMBgemb.py @@ -57,7 +57,7 @@ def __init__(self, *args): # {{{ self.mappedforcingpoint = np.nan #Mapping of which forcing point will map to each mesh element (integer). Of size number of elements. Use if ismappedforcing is true. self.mappedforcingelevation = np.nan #The elevation of each mapped forcing location (m above sea level). Of size number of forcing points. Use if ismappedforcing is true. self.lapseTaValue = np.nan #Temperature lapse rate if forcing has different grid and should be remapped. Use if ismappedforcing is true. (Default value is -0.006 K m-1.) - self.lapsedlwrfValue = np.nan #Longwave down lapse rate if forcing has different grid and should be remapped. Use if ismappedforcing is true. (Default value is -0.032 W m-2 m-1.) + self.lapsedlwrfValue = np.nan #Longwave down lapse rate if forcing has different grid and should be remapped. Use if ismappedforcing is true. If set to 0, dlwrf will scale with a constant effective atmospheric emissivity. (Default value is -0.032 W m-2 m-1.) # Initialization of snow properties self.Dzini = np.nan # cell depth (m) @@ -225,7 +225,7 @@ def __repr__(self): # {{{ s += '{}\n'.format(fielddisplay(self,'mappedforcingpoint','Mapping of which forcing point will map to each mesh element for ismappedforcing option (integer). Size number of elements.')) s += '{}\n'.format(fielddisplay(self,'mappedforcingelevation','The elevation of each mapped forcing location (m above sea level) for ismappedforcing option. Size number of forcing points.')) s += '{}\n'.format(fielddisplay(self,'lapseTaValue','Temperature lapse rate if forcing has different grid and should be remapped for ismappedforcing option. (Default value is -0.006 K m-1.)')) - s += '{}\n'.format(fielddisplay(self,'lapsedlwrfValue','Longwave down lapse rate if forcing has different grid and should be remapped for ismappedforcing option. (Default value is -0.032 W m-2 m-1.)')) + s += '{}\n'.format(fielddisplay(self,'lapsedlwrfValue','Longwave down lapse rate if forcing has different grid and should be remapped for ismappedforcing option. If set to 0, dlwrf will scale with a constant effective atmospheric emissivity. (Default value is -0.032 W m-2 m-1.)')) # Snow properties init s += '{}\n'.format(fielddisplay(self, 'Dzini', 'Initial cell depth when restart [m]')) From da003dad22010fd4f5ff91016df120a6de70d6dd Mon Sep 17 00:00:00 2001 From: mmorligh Date: Tue, 17 Jun 2025 16:22:06 -0700 Subject: [PATCH 013/126] CHG: for discover, scp does not work when requesting cmdout, does not request password and just hangs --- src/m/os/issmscpin.m | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/m/os/issmscpin.m b/src/m/os/issmscpin.m index c30489984..969a261ee 100644 --- a/src/m/os/issmscpin.m +++ b/src/m/os/issmscpin.m @@ -13,32 +13,32 @@ function issmscpin(host, login,port,path, packages) system(['cp ' path '/' packages{i} ' .']); end else - if numel(packages)==1, + if numel(packages)==1 fileliststr=packages{1}; else fileliststr='\{'; - for i=1:numel(packages)-1, + for i=1:numel(packages)-1 fileliststr=[fileliststr packages{i} ',']; end fileliststr=[fileliststr packages{end} '\}']; end - if port, - [status,cmdout]=system(['scp -P ' num2str(port) ' ' login '@localhost:' path '/' fileliststr ' ./']); - if status ~= 0, + if port + [status]=system(['scp -P ' num2str(port) ' ' login '@localhost:' path '/' fileliststr ' ./']); + if status ~= 0 %List expansion is a bash'ism. Try again with -OT. [status,cmdout]=system(['scp -OT -P ' num2str(port) ' ' login '@localhost:' path '/' fileliststr ' ./']); end else - [status,cmdout]=system(['scp ' login '@' host ':' path '/' fileliststr ' ./']); - if status ~= 0, + [status]=system(['scp ' login '@' host ':' path '/' fileliststr ' ./']); + if status ~= 0 %List expansion is a bash'ism. Try again with -OT. [status,cmdout]=system(['scp -OT ' login '@' host ':' path '/' fileliststr ' ./']); end end %check scp worked - if status ~= 0, + if status ~= 0 error(['issmscpin error message: ' cmdout]) end for i=1:numel(packages), From 35ecc79a7aa1d8cd76518762e3212ea79db6a329 Mon Sep 17 00:00:00 2001 From: Justin Kin Jun Hew Date: Wed, 18 Jun 2025 13:51:10 +1000 Subject: [PATCH 014/126] feat(scripts): add full-format support to patch_bin.py * New encoder/decoder handles all 9 ISSM data codes (Boolean / Integer / Double / String / BooleanMat / IntMat / DoubleMat / MatArray / StringArray). * Two patching modes - default in-place overwrite when new payload size is unchanged - `--rebuild` flag triggers safe whole-file rewrite for variable-length updates (e.g. longer strings, larger matrices). * Record scanner refactored into `iterate_records()` for reuse. * Added numpy dependency (matrix encoding) and json value parsing. * CLI now accepts JSON literals for matrices/arrays and booleans. * Unit tests cover scalar and matrix replacements, size-mismatch detection, and rebuild path. --- scripts/patch_bin.py | 162 ++++++++++++++++++++++++++++++++++--------- 1 file changed, 129 insertions(+), 33 deletions(-) diff --git a/scripts/patch_bin.py b/scripts/patch_bin.py index d381bcd4b..d055358db 100755 --- a/scripts/patch_bin.py +++ b/scripts/patch_bin.py @@ -1,38 +1,134 @@ #!/usr/bin/env python3 -import argparse, struct, pathlib -from typing import Union - -FMT2CODE = {"bool":1,"int":2,"double":3} - -def locate(fp, field): - with fp.open('rb') as f: - while (raw:=f.read(4)): - namelen = struct.unpack('i', raw)[0] - name = f.read(namelen).decode() - reclen = struct.unpack('q', f.read(8))[0] - codepos = f.tell(); code = struct.unpack('i', f.read(4))[0] - datapos = f.tell() - if name == field: return datapos, code - f.seek(reclen-4,1) - raise KeyError(field) - -def patch(fp: pathlib.Path, field: str, value: Union[str,int,float]): - datapos, code = locate(fp, field) - with fp.open('r+b') as f: - f.seek(datapos) - if code==FMT2CODE["double"]: - f.write(struct.pack('d', float(value))) - elif code==FMT2CODE["int"]: - f.write(struct.pack('i', int(value))) - elif code==FMT2CODE["bool"]: - f.write(struct.pack('i', 1 if value.lower()=='true' else 0)) - else: - raise TypeError("Only scalar bool/int/double supported in-place") - -if __name__ == "__main__": +""" +patch_bin.py — edit any ISSM .bin record. + +Examples +-------- +# change a scalar double in place: +patch_bin.py -f run.bin -n md.timestepping.final_time -v 3.1536e7 + +# replace a 10×10 matrix with a different-sized one (auto-rebuilds file): +patch_bin.py -f run.bin -n md.geometry.surface \ + -v '[ [0,1],[2,3] ]' --rebuild +""" +from __future__ import annotations +import argparse, json, struct, pathlib, tempfile, shutil, sys +import numpy as np +FMT = {"Boolean":1,"Integer":2,"Double":3,"String":4, + "BooleanMat":5,"IntMat":6,"DoubleMat":7,"MatArray":8,"StringArray":9} +CODE2FMT = {v:k for k,v in FMT.items()} + +# ─────────────────────────── helper: iterate over records ──────────────────── +def iterate_records(fp: pathlib.Path): + """Yield (name,pos,reclen,code,data_pos) for every record in *fp*.""" + with fp.open("rb") as f: + while True: + raw = f.read(4) + if not raw: break + namelen = struct.unpack("i", raw)[0] + name = f.read(namelen).decode() + reclen = struct.unpack("q", f.read(8))[0] + code = struct.unpack("i", f.read(4))[0] + data_pos = f.tell() + yield name, f.tell() - 4, reclen, code, data_pos + f.seek(reclen-4, 1) + +# ─────────────────────────── decode / encode payloads ──────────────────────── +def read_payload(f, code, reclen): + if code in (FMT["Boolean"], FMT["Integer"]): + return struct.unpack("i", f.read(4))[0] + if code == FMT["Double"]: + return struct.unpack("d", f.read(8))[0] + if code == FMT["String"]: + strlen = struct.unpack("i", f.read(4))[0] + return f.read(strlen).decode() + if code in (FMT["BooleanMat"], FMT["IntMat"], FMT["DoubleMat"]): + mattype = struct.unpack("i", f.read(4))[0] + n,m = struct.unpack("ii", f.read(8)) + data = np.frombuffer(f.read(n*m*8), dtype=np.float64).reshape(n,m) + return mattype, data + if code == FMT["MatArray"]: + # skip detailed parsing, return raw bytes + return f.read(reclen-4) + if code == FMT["StringArray"]: + return f.read(reclen-4) + raise TypeError("unknown code") + +def encode_payload(val, code): + """Return bytes for *val* plus the 'code' (4B) and new reclen.""" + if code in (FMT["Boolean"], FMT["Integer"]): + payload = struct.pack("i", int(val)) + elif code == FMT["Double"]: + payload = struct.pack("d", float(val)) + elif code == FMT["String"]: + b = str(val).encode() + payload = struct.pack("i", len(b)) + b + elif code in (FMT["BooleanMat"], FMT["IntMat"], FMT["DoubleMat"]): + mattype, arr = val # expect (mattype, np.ndarray) + n,m = arr.shape + payload = struct.pack("i", int(mattype)) + payload += struct.pack("ii", n, m) + payload += arr.astype(np.float64).tobytes(order="C") + elif code == FMT["MatArray"]: + payload = bytes(val) # raw bytes + elif code == FMT["StringArray"]: + payload = bytes(val) + else: + raise TypeError("unsupported code") + reclen = len(payload)+4 # +4 for the code itself + return struct.pack("i", code) + payload, reclen + +# ─────────────────────────── patch logic ───────────────────────────────────── +def patch(file: pathlib.Path, field: str, new_val, rebuild=False): + records = list(iterate_records(file)) + match = next((r for r in records if r[0]==field), None) + if not match: + raise KeyError(f"{field} not found") + name, name_pos, old_reclen, code, data_pos = match + new_payload, new_reclen = encode_payload(new_val, code) + + if not rebuild and new_reclen==old_reclen: + # simple in-place overwrite + with file.open("r+b") as f: + f.seek(data_pos-4) # back up to code + f.write(new_payload) + return + + # otherwise rebuild the entire file + tmp = pathlib.Path(tempfile.mktemp(suffix=".bin", dir=file.parent)) + with file.open("rb") as src, tmp.open("wb") as dst: + for n, pos, reclen, c, dpos in records: + src.seek(pos) + chunk = src.read(4 + len(n.encode()) + 8 + reclen) # full record + if n==field: + # slice header up to code (everything before code) + header = chunk[:4+len(n.encode())+8] + dst.write(header + new_payload) + else: + dst.write(chunk) + shutil.move(tmp, file) + +# ─────────────────────────── CLI ───────────────────────────────────────────── +def cli(): p = argparse.ArgumentParser() p.add_argument("-f","--file", required=True) p.add_argument("-n","--name", required=True) - p.add_argument("-v","--value", required=True) + p.add_argument("-v","--value", required=True, + help="Scalar, JSON array, or JSON object depending on type.") + p.add_argument("--rebuild", action="store_true", + help="Force full-file rewrite even if size matches.") args = p.parse_args() - patch(pathlib.Path(args.file), args.name, args.value) + + # value parsing: try JSON first, fall back to raw string / float + try: + val = json.loads(args.value) + if isinstance(val, list): # assume matrix if nested list + val = (0, np.array(val, dtype=np.float64)) + except Exception: + try: val = float(args.value) + except ValueError: val = args.value + + patch(pathlib.Path(args.file), args.name, val, rebuild=args.rebuild) + print(f"✔ Patched {args.name} in {args.file}") + +if __name__ == "__main__": cli() From 293959d3bb0f869d744950e03878000a534d811a Mon Sep 17 00:00:00 2001 From: Tidbit Software <34657535+TidbitSoftware@users.noreply.github.com> Date: Tue, 17 Jun 2025 23:47:39 -0700 Subject: [PATCH 015/126] Update README.md Added link to documentation --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index 5bf1b5c8f..396e88ae8 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,9 @@ ## Description ISSM is a large-scale thermo-mechanical 2D/3D parallelized multi-purpose finite-element software dedicated to ice sheet and sea-level modeling. +## Documentation +https://issmteam.github.io/ISSM-Documentation/ + ## Contact - Forum: https://issm.ess.uci.edu/forum - GitHub: https://github.com/ISSMteam/ISSM From ca1a3ba9e318eedc612c321c7f238b7e2246e6e9 Mon Sep 17 00:00:00 2001 From: Tidbit Software <34657535+TidbitSoftware@users.noreply.github.com> Date: Tue, 17 Jun 2025 23:49:33 -0700 Subject: [PATCH 016/126] Update README.md Make documentation open in new tab --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 396e88ae8..0526cd0d8 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ ISSM is a large-scale thermo-mechanical 2D/3D parallelized multi-purpose finite-element software dedicated to ice sheet and sea-level modeling. ## Documentation -https://issmteam.github.io/ISSM-Documentation/ +Just The Docs ## Contact - Forum: https://issm.ess.uci.edu/forum From e85e0db574671f95ef0427d02f4313249a6d5b5f Mon Sep 17 00:00:00 2001 From: mmorligh Date: Thu, 19 Jun 2025 13:12:00 -0700 Subject: [PATCH 017/126] CHG: mostly minor changes --- README.md | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index 0526cd0d8..f27c50e9b 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,5 @@ # Ice-sheet and Sea-level System Model - ISSM +[![License](https://img.shields.io/badge/License-BSD_3--Clause-blue.svg)](https://opensource.org/licenses/BSD-3-Clause) [![Ubuntu Basic](https://github.com/ISSMteam/ISSM/actions/workflows/ubuntu-basic.yml/badge.svg)](https://github.com/ISSMteam/ISSM/actions/workflows/ubuntu-basic.yml) [![Ubuntu CodiPack](https://github.com/ISSMteam/ISSM/actions/workflows/ubuntu-codipack.yml/badge.svg)](https://github.com/ISSMteam/ISSM/actions/workflows/ubuntu-codipack.yml) [![Ubuntu Python](https://github.com/ISSMteam/ISSM/actions/workflows/ubuntu-python.yml/badge.svg)](https://github.com/ISSMteam/ISSM/actions/workflows/ubuntu-python.yml) @@ -12,7 +13,7 @@ ISSM is a large-scale thermo-mechanical 2D/3D parallelized multi-purpose finite- ## Contact - Forum: https://issm.ess.uci.edu/forum - GitHub: https://github.com/ISSMteam/ISSM - - Website: https://issm.jpl.nasa.gov + - Website: https://issm.jpl.nasa.gov (will be decomissioned soon) ## Checking Out a Copy of the Repository Navigate to the parent directory where you want the ISSM repository to be located. If you plan to make contributions to the code base, we recommend that you check out a copy via SSH with, @@ -31,31 +32,25 @@ Note that checkout via HTTPS does not require credentials, but does not allow co ## Committing Changes to the Repository A good basic workflow for committing changes to the repository is, -1. Stash your local changes ``` +#1. Stash your local changes git stash -``` -2. Update your local branch -``` +#2. Update your local branch git pull -``` -3. Merge your local changes -``` +#3. Merge your local changes git stash apply -``` -4. Add, commit, and push your changes -``` +#4. Add, commit, and push your changes git add [file] git commit [-m "descriptive commit message"] git push ``` -5. If you have forked the ISSM repository, consider making sure that your commit passes CI workflows before submitting a pull request. +If you have forked the ISSM repository, consider making sure that your commit passes CI workflows before submitting a pull request. -6. Submit a pull request via GitHub so that project admins can review your changes and merge them into the main branch. +Submit a pull request via GitHub so that project admins can review your changes and merge them into the main branch. If you find yourself making a lot of commits and pull requests, consider asking us to add you to the 'ISSM Contributors' group, which will allow you to make commits directly to the repository. From 5f70713358ac8fa64af76ef4dc5cdbf10921cfd5 Mon Sep 17 00:00:00 2001 From: inwoo-simba Date: Fri, 20 Jun 2025 13:42:09 +0900 Subject: [PATCH 018/126] CHG: applyoptions.py - Update "scaleruler" option using "matplotlib-scaleruler"; however, this section should be replaced to standalone "scaleruler". --- src/m/plot/applyoptions.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/m/plot/applyoptions.py b/src/m/plot/applyoptions.py index 46fec04a7..46ee1ecea 100755 --- a/src/m/plot/applyoptions.py +++ b/src/m/plot/applyoptions.py @@ -6,6 +6,7 @@ except ImportError: print("could not import pyplot, matplotlib has not been installed, no plotting capabilities enabled") import numpy as np +import warnings from expdisp import expdisp from plot_contour import plot_contour @@ -293,7 +294,15 @@ def applyoptions(md, data, options, fig, axgrid, gridindex): # }}} # {{{ north arrow TODO # }}} - # {{{ scale ruler TODO + # {{{ scale ruler + #TODO: The current version for scaleruler relies on "matplotlib-scalebar"; however, should this section be moved to a standalone "scaleruler" module, similar to the MATLAB version? + if options.getfieldvalue('scaleruler','off')=='on': + try: + from matplotlib_scalebar.scalebar import ScaleBar + scalebar = ScaleBar(1,'m',location=options.getfieldvalue('scalerulerlocation','lower right')) + ax.add_artist(scalebar) + except: + warnings.warn('We cannot draw scalebar. Install "matplotlib-scalebar" using "pip install matplotlib-scalebar".') # }}} # {{{ streamlines TOFIX if options.exist('streamlines'): From 1ba1588fc2ede41b4f599445d2c0b575b64f836e Mon Sep 17 00:00:00 2001 From: mmorligh Date: Fri, 20 Jun 2025 18:29:05 -0400 Subject: [PATCH 019/126] CHG: adding Enum --- src/c/shared/Enum/Enum.vim | 19 ++++++++++--------- src/c/shared/Enum/EnumDefinitions.h | 1 + src/c/shared/Enum/EnumToStringx.cpp | 1 + src/c/shared/Enum/Enumjl.vim | 1 + src/c/shared/Enum/StringToEnumx.cpp | 17 +++++++++-------- src/c/shared/Enum/issmenums.jl | 3 +++ 6 files changed, 25 insertions(+), 17 deletions(-) diff --git a/src/c/shared/Enum/Enum.vim b/src/c/shared/Enum/Enum.vim index 8a081631c..740c75553 100644 --- a/src/c/shared/Enum/Enum.vim +++ b/src/c/shared/Enum/Enum.vim @@ -3369,6 +3369,7 @@ syn keyword cConstant AmrBamgEnum syn keyword cConstant AmrNeopzEnum syn keyword cConstant ArrheniusEnum syn keyword cConstant AutodiffJacobianEnum +syn keyword cConstant AverageButtressingEnum syn keyword cConstant Balancethickness2AnalysisEnum syn keyword cConstant Balancethickness2SolutionEnum syn keyword cConstant BalancethicknessAnalysisEnum @@ -3795,6 +3796,7 @@ syn keyword cType Cfsurfacelogvel syn keyword cType Cfsurfacesquare syn keyword cType Cfsurfacesquaretransient syn keyword cType Channel +syn keyword cType classes syn keyword cType Constraint syn keyword cType Constraints syn keyword cType Contour @@ -3802,8 +3804,8 @@ syn keyword cType Contours syn keyword cType ControlInput syn keyword cType ControlParam syn keyword cType Covertree -syn keyword cType DataSetParam syn keyword cType DatasetInput +syn keyword cType DataSetParam syn keyword cType Definition syn keyword cType DependentObject syn keyword cType DoubleInput @@ -3816,19 +3818,20 @@ syn keyword cType Element syn keyword cType ElementHook syn keyword cType ElementInput syn keyword cType ElementMatrix -syn keyword cType ElementVector syn keyword cType Elements +syn keyword cType ElementVector syn keyword cType ExponentialVariogram syn keyword cType ExternalResult syn keyword cType FemModel syn keyword cType FileParam syn keyword cType Friction syn keyword cType Gauss +syn keyword cType GaussianVariogram +syn keyword cType gaussobjects syn keyword cType GaussPenta syn keyword cType GaussSeg syn keyword cType GaussTetra syn keyword cType GaussTria -syn keyword cType GaussianVariogram syn keyword cType GenericExternalResult syn keyword cType GenericOption syn keyword cType GenericParam @@ -3845,6 +3848,7 @@ syn keyword cType IntVecParam syn keyword cType IoModel syn keyword cType IssmDirectApplicInterface syn keyword cType IssmParallelDirectApplicInterface +syn keyword cType krigingobjects syn keyword cType Load syn keyword cType Loads syn keyword cType Masscon @@ -3855,6 +3859,7 @@ syn keyword cType Materials syn keyword cType Matestar syn keyword cType Matice syn keyword cType Matlitho +syn keyword cType matrixobjects syn keyword cType MatrixParam syn keyword cType Misfit syn keyword cType Moulin @@ -3881,13 +3886,13 @@ syn keyword cType Quadtree syn keyword cType Radar syn keyword cType Regionaloutput syn keyword cType Results -syn keyword cType RiftStruct syn keyword cType Riftfront +syn keyword cType RiftStruct syn keyword cType SealevelGeometry syn keyword cType Seg syn keyword cType SegInput -syn keyword cType SegRef syn keyword cType Segment +syn keyword cType SegRef syn keyword cType SpcDynamic syn keyword cType SpcStatic syn keyword cType SpcTransient @@ -3908,10 +3913,6 @@ syn keyword cType Variogram syn keyword cType VectorParam syn keyword cType Vertex syn keyword cType Vertices -syn keyword cType classes -syn keyword cType gaussobjects -syn keyword cType krigingobjects -syn keyword cType matrixobjects syn keyword cType AdjointBalancethickness2Analysis syn keyword cType AdjointBalancethicknessAnalysis syn keyword cType AdjointHorizAnalysis diff --git a/src/c/shared/Enum/EnumDefinitions.h b/src/c/shared/Enum/EnumDefinitions.h index 75b9f07e2..3124e2ee4 100644 --- a/src/c/shared/Enum/EnumDefinitions.h +++ b/src/c/shared/Enum/EnumDefinitions.h @@ -3368,6 +3368,7 @@ enum definitions{ AmrNeopzEnum, ArrheniusEnum, AutodiffJacobianEnum, + AverageButtressingEnum, Balancethickness2AnalysisEnum, Balancethickness2SolutionEnum, BalancethicknessAnalysisEnum, diff --git a/src/c/shared/Enum/EnumToStringx.cpp b/src/c/shared/Enum/EnumToStringx.cpp index b2c9a6e82..76f1492e3 100644 --- a/src/c/shared/Enum/EnumToStringx.cpp +++ b/src/c/shared/Enum/EnumToStringx.cpp @@ -3371,6 +3371,7 @@ const char* EnumToStringx(int en){ case AmrNeopzEnum : return "AmrNeopz"; case ArrheniusEnum : return "Arrhenius"; case AutodiffJacobianEnum : return "AutodiffJacobian"; + case AverageButtressingEnum : return "AverageButtressing"; case Balancethickness2AnalysisEnum : return "Balancethickness2Analysis"; case Balancethickness2SolutionEnum : return "Balancethickness2Solution"; case BalancethicknessAnalysisEnum : return "BalancethicknessAnalysis"; diff --git a/src/c/shared/Enum/Enumjl.vim b/src/c/shared/Enum/Enumjl.vim index 617023921..9f5e39f84 100644 --- a/src/c/shared/Enum/Enumjl.vim +++ b/src/c/shared/Enum/Enumjl.vim @@ -3362,6 +3362,7 @@ syn keyword juliaConstC AmrBamgEnum syn keyword juliaConstC AmrNeopzEnum syn keyword juliaConstC ArrheniusEnum syn keyword juliaConstC AutodiffJacobianEnum +syn keyword juliaConstC AverageButtressingEnum syn keyword juliaConstC Balancethickness2AnalysisEnum syn keyword juliaConstC Balancethickness2SolutionEnum syn keyword juliaConstC BalancethicknessAnalysisEnum diff --git a/src/c/shared/Enum/StringToEnumx.cpp b/src/c/shared/Enum/StringToEnumx.cpp index 1ab351b62..073a6e160 100644 --- a/src/c/shared/Enum/StringToEnumx.cpp +++ b/src/c/shared/Enum/StringToEnumx.cpp @@ -3452,15 +3452,16 @@ int StringToEnumx(const char* name,bool notfounderror){ else if (strcmp(name,"AmrNeopz")==0) return AmrNeopzEnum; else if (strcmp(name,"Arrhenius")==0) return ArrheniusEnum; else if (strcmp(name,"AutodiffJacobian")==0) return AutodiffJacobianEnum; + else if (strcmp(name,"AverageButtressing")==0) return AverageButtressingEnum; else if (strcmp(name,"Balancethickness2Analysis")==0) return Balancethickness2AnalysisEnum; else if (strcmp(name,"Balancethickness2Solution")==0) return Balancethickness2SolutionEnum; else if (strcmp(name,"BalancethicknessAnalysis")==0) return BalancethicknessAnalysisEnum; else if (strcmp(name,"BalancethicknessApparentMassbalance")==0) return BalancethicknessApparentMassbalanceEnum; - else if (strcmp(name,"BalancethicknessSoftAnalysis")==0) return BalancethicknessSoftAnalysisEnum; else stage=29; } if(stage==29){ - if (strcmp(name,"BalancethicknessSoftSolution")==0) return BalancethicknessSoftSolutionEnum; + if (strcmp(name,"BalancethicknessSoftAnalysis")==0) return BalancethicknessSoftAnalysisEnum; + else if (strcmp(name,"BalancethicknessSoftSolution")==0) return BalancethicknessSoftSolutionEnum; else if (strcmp(name,"BalancethicknessSolution")==0) return BalancethicknessSolutionEnum; else if (strcmp(name,"BalancevelocityAnalysis")==0) return BalancevelocityAnalysisEnum; else if (strcmp(name,"BalancevelocitySolution")==0) return BalancevelocitySolutionEnum; @@ -3579,11 +3580,11 @@ int StringToEnumx(const char* name,bool notfounderror){ else if (strcmp(name,"GroundedArea")==0) return GroundedAreaEnum; else if (strcmp(name,"GroundedAreaScaled")==0) return GroundedAreaScaledEnum; else if (strcmp(name,"GroundingOnly")==0) return GroundingOnlyEnum; - else if (strcmp(name,"GroundinglineMassFlux")==0) return GroundinglineMassFluxEnum; else stage=30; } if(stage==30){ - if (strcmp(name,"Gset")==0) return GsetEnum; + if (strcmp(name,"GroundinglineMassFlux")==0) return GroundinglineMassFluxEnum; + else if (strcmp(name,"Gset")==0) return GsetEnum; else if (strcmp(name,"Gsl")==0) return GslEnum; else if (strcmp(name,"HOApproximation")==0) return HOApproximationEnum; else if (strcmp(name,"HOFSApproximation")==0) return HOFSApproximationEnum; @@ -3702,11 +3703,11 @@ int StringToEnumx(const char* name,bool notfounderror){ else if (strcmp(name,"Mumps")==0) return MumpsEnum; else if (strcmp(name,"NoFrictionOnPartiallyFloating")==0) return NoFrictionOnPartiallyFloatingEnum; else if (strcmp(name,"NoMeltOnPartiallyFloating")==0) return NoMeltOnPartiallyFloatingEnum; - else if (strcmp(name,"Nodal")==0) return NodalEnum; else stage=31; } if(stage==31){ - if (strcmp(name,"Nodalvalue")==0) return NodalvalueEnum; + if (strcmp(name,"Nodal")==0) return NodalEnum; + else if (strcmp(name,"Nodalvalue")==0) return NodalvalueEnum; else if (strcmp(name,"NodeSId")==0) return NodeSIdEnum; else if (strcmp(name,"NoneApproximation")==0) return NoneApproximationEnum; else if (strcmp(name,"None")==0) return NoneEnum; @@ -3825,11 +3826,11 @@ int StringToEnumx(const char* name,bool notfounderror){ else if (strcmp(name,"TotalCalvingMeltingFluxLevelset")==0) return TotalCalvingMeltingFluxLevelsetEnum; else if (strcmp(name,"TotalFloatingBmb")==0) return TotalFloatingBmbEnum; else if (strcmp(name,"TotalFloatingBmbScaled")==0) return TotalFloatingBmbScaledEnum; - else if (strcmp(name,"TotalGroundedBmb")==0) return TotalGroundedBmbEnum; else stage=32; } if(stage==32){ - if (strcmp(name,"TotalGroundedBmbScaled")==0) return TotalGroundedBmbScaledEnum; + if (strcmp(name,"TotalGroundedBmb")==0) return TotalGroundedBmbEnum; + else if (strcmp(name,"TotalGroundedBmbScaled")==0) return TotalGroundedBmbScaledEnum; else if (strcmp(name,"TotalSmb")==0) return TotalSmbEnum; else if (strcmp(name,"TotalSmbScaled")==0) return TotalSmbScaledEnum; else if (strcmp(name,"TotalSmbRefreeze")==0) return TotalSmbRefreezeEnum; diff --git a/src/c/shared/Enum/issmenums.jl b/src/c/shared/Enum/issmenums.jl index 25158c48a..9d8807a8b 100644 --- a/src/c/shared/Enum/issmenums.jl +++ b/src/c/shared/Enum/issmenums.jl @@ -3358,6 +3358,7 @@ AmrNeopzEnum ArrheniusEnum AutodiffJacobianEnum + AverageButtressingEnum Balancethickness2AnalysisEnum Balancethickness2SolutionEnum BalancethicknessAnalysisEnum @@ -7124,6 +7125,7 @@ function EnumToString(enum::IssmEnum) if(enum==AmrNeopzEnum) return "AmrNeopz" end if(enum==ArrheniusEnum) return "Arrhenius" end if(enum==AutodiffJacobianEnum) return "AutodiffJacobian" end + if(enum==AverageButtressingEnum) return "AverageButtressing" end if(enum==Balancethickness2AnalysisEnum) return "Balancethickness2Analysis" end if(enum==Balancethickness2SolutionEnum) return "Balancethickness2Solution" end if(enum==BalancethicknessAnalysisEnum) return "BalancethicknessAnalysis" end @@ -10890,6 +10892,7 @@ function StringToEnum(name::String) if(name=="AmrNeopz") return AmrNeopzEnum end if(name=="Arrhenius") return ArrheniusEnum end if(name=="AutodiffJacobian") return AutodiffJacobianEnum end + if(name=="AverageButtressing") return AverageButtressingEnum end if(name=="Balancethickness2Analysis") return Balancethickness2AnalysisEnum end if(name=="Balancethickness2Solution") return Balancethickness2SolutionEnum end if(name=="BalancethicknessAnalysis") return BalancethicknessAnalysisEnum end From c8cf6620d56cca86f44c788a794e5023d79fc835 Mon Sep 17 00:00:00 2001 From: mmorligh Date: Fri, 20 Jun 2025 20:08:03 -0400 Subject: [PATCH 020/126] CHG: added Buttressing as potential output --- src/c/classes/Elements/Element.h | 1 + src/c/classes/Elements/Tria.cpp | 150 +++++++++++++++++++++++++++++++ src/c/classes/Elements/Tria.h | 2 + src/c/classes/FemModel.cpp | 26 +++++- src/c/classes/FemModel.h | 1 + 5 files changed, 179 insertions(+), 1 deletion(-) diff --git a/src/c/classes/Elements/Element.h b/src/c/classes/Elements/Element.h index 36a841654..55388f2df 100644 --- a/src/c/classes/Elements/Element.h +++ b/src/c/classes/Elements/Element.h @@ -241,6 +241,7 @@ class Element: public Object{ virtual void AddBasalInput(int input_enum, IssmDouble* values, int interpolation_enum){_error_("not implemented");}; virtual void AddInput(int input_enum, IssmDouble* values, int interpolation_enum){_error_("not implemented");}; virtual void AddControlInput(int input_enum,Inputs* inputs,IoModel* iomodel,IssmDouble* values,IssmDouble* values_min,IssmDouble* values_max, int interpolation_enum,int id){_error_("not supported yet");}; + virtual bool Buttressing(IssmDouble* ptheta, IssmDouble* plength){_error_("not implemented");}; virtual void DatasetInputCreate(IssmDouble* array,int M,int N,int* individual_enums,int num_inputs,Inputs* inputs,IoModel* iomodel,int input_enum){_error_("not supported");}; virtual void AverageOntoPartition(Vector* partition_contributions,Vector* partition_areas,IssmDouble* vertex_response,IssmDouble* qmu_part)=0; virtual void BasalNodeIndices(int* pnumindices,int** pindices,int finiteelement){_error_("not implemented yet");}; diff --git a/src/c/classes/Elements/Tria.cpp b/src/c/classes/Elements/Tria.cpp index e6155be9d..4812484c4 100644 --- a/src/c/classes/Elements/Tria.cpp +++ b/src/c/classes/Elements/Tria.cpp @@ -310,6 +310,156 @@ void Tria::AverageOntoPartition(Vector* partition_contribution } } /*}}}*/ +bool Tria::Buttressing(IssmDouble* ptheta, IssmDouble* plength){/*{{{*/ + + /*Make sure there is a grounding line here*/ + if(!IsIceInElement()) return false; + if(!IsZeroLevelset(MaskOceanLevelsetEnum)) return true; + + int domaintype,index1,index2; + const IssmPDouble epsilon = 1.e-15; + IssmDouble s1,s2,s_xx,s_yy,s_xy; + IssmDouble gl[NUMVERTICES]; + IssmDouble xyz_front[2][3]; + + IssmDouble xyz_list[NUMVERTICES][3]; + ::GetVerticesCoordinates(&xyz_list[0][0],vertices,NUMVERTICES); + + /*Recover parameters and values*/ + parameters->FindParam(&domaintype,DomainTypeEnum); + Element::GetInputListOnVertices(&gl[0],MaskOceanLevelsetEnum); + + /*Be sure that values are not zero*/ + if(gl[0]==0.) gl[0]=gl[0]+epsilon; + if(gl[1]==0.) gl[1]=gl[1]+epsilon; + if(gl[2]==0.) gl[2]=gl[2]+epsilon; + + if(domaintype==Domain2DverticalEnum){ + _error_("not implemented"); + } + else if(domaintype==Domain2DhorizontalEnum || domaintype==Domain3DEnum || domaintype==Domain3DsurfaceEnum){ + int pt1 = 0; + int pt2 = 1; + if(gl[0]*gl[1]>0){ //Nodes 0 and 1 are similar, so points must be found on segment 0-2 and 1-2 + + /*Portion of the segments*/ + s1=gl[2]/(gl[2]-gl[1]); + s2=gl[2]/(gl[2]-gl[0]); + if(gl[2]<0.){ + pt1 = 1; pt2 = 0; + } + xyz_front[pt2][0]=xyz_list[2][0]+s1*(xyz_list[1][0]-xyz_list[2][0]); + xyz_front[pt2][1]=xyz_list[2][1]+s1*(xyz_list[1][1]-xyz_list[2][1]); + xyz_front[pt2][2]=xyz_list[2][2]+s1*(xyz_list[1][2]-xyz_list[2][2]); + xyz_front[pt1][0]=xyz_list[2][0]+s2*(xyz_list[0][0]-xyz_list[2][0]); + xyz_front[pt1][1]=xyz_list[2][1]+s2*(xyz_list[0][1]-xyz_list[2][1]); + xyz_front[pt1][2]=xyz_list[2][2]+s2*(xyz_list[0][2]-xyz_list[2][2]); + } + else if(gl[1]*gl[2]>0){ //Nodes 1 and 2 are similar, so points must be found on segment 0-1 and 0-2 + + /*Portion of the segments*/ + s1=gl[0]/(gl[0]-gl[1]); + s2=gl[0]/(gl[0]-gl[2]); + if(gl[0]<0.){ + pt1 = 1; pt2 = 0; + } + + xyz_front[pt1][0]=xyz_list[0][0]+s1*(xyz_list[1][0]-xyz_list[0][0]); + xyz_front[pt1][1]=xyz_list[0][1]+s1*(xyz_list[1][1]-xyz_list[0][1]); + xyz_front[pt1][2]=xyz_list[0][2]+s1*(xyz_list[1][2]-xyz_list[0][2]); + xyz_front[pt2][0]=xyz_list[0][0]+s2*(xyz_list[2][0]-xyz_list[0][0]); + xyz_front[pt2][1]=xyz_list[0][1]+s2*(xyz_list[2][1]-xyz_list[0][1]); + xyz_front[pt2][2]=xyz_list[0][2]+s2*(xyz_list[2][2]-xyz_list[0][2]); + } + else if(gl[0]*gl[2]>0){ //Nodes 0 and 2 are similar, so points must be found on segment 1-0 and 1-2 + + /*Portion of the segments*/ + s1=gl[1]/(gl[1]-gl[0]); + s2=gl[1]/(gl[1]-gl[2]); + if(gl[1]<0.){ + pt1 = 1; pt2 = 0; + } + + xyz_front[pt2][0]=xyz_list[1][0]+s1*(xyz_list[0][0]-xyz_list[1][0]); + xyz_front[pt2][1]=xyz_list[1][1]+s1*(xyz_list[0][1]-xyz_list[1][1]); + xyz_front[pt2][2]=xyz_list[1][2]+s1*(xyz_list[0][2]-xyz_list[1][2]); + xyz_front[pt1][0]=xyz_list[1][0]+s2*(xyz_list[2][0]-xyz_list[1][0]); + xyz_front[pt1][1]=xyz_list[1][1]+s2*(xyz_list[2][1]-xyz_list[1][1]); + xyz_front[pt1][2]=xyz_list[1][2]+s2*(xyz_list[2][2]-xyz_list[1][2]); + } + else{ + _error_("case not possible"); + } + + } + else _error_("mesh type "<=0 && s1<=1.); + _assert_(s2>=0 && s2<=1.); + + /*Get normal vector*/ + IssmDouble normal[3]; + this->NormalSection(&normal[0],&xyz_front[0][0]); + + /*Get deviatoric stress tensor*/ + this->ComputeDeviatoricStressTensor(); + + /*Get inputs*/ + IssmDouble flux = 0.; + IssmDouble vx,vy,thickness,Jdet; + IssmDouble rho_ice = this->FindParam(MaterialsRhoIceEnum); + IssmDouble rho_seawater = this->FindParam(MaterialsRhoSeawaterEnum); + IssmDouble constant_g = this->FindParam(ConstantsGEnum); + Input* vx_input=NULL; + Input* vy_input=NULL; + if(domaintype==Domain2DhorizontalEnum){ + vx_input=this->GetInput(VxEnum); _assert_(vx_input); + vy_input=this->GetInput(VyEnum); _assert_(vy_input); + } + else{ + vx_input=this->GetInput(VxAverageEnum); _assert_(vx_input); + vy_input=this->GetInput(VyAverageEnum); _assert_(vy_input); + } + Input *s_xx_input = this->GetInput(DeviatoricStressxxEnum); _assert_(s_xx_input); + Input *s_xy_input = this->GetInput(DeviatoricStressxyEnum); _assert_(s_xy_input); + Input *s_yy_input = this->GetInput(DeviatoricStressyyEnum); _assert_(s_yy_input); + Input *thickness_input = this->GetInput(ThicknessEnum); _assert_(thickness_input); + + IssmDouble theta = 0.; + IssmDouble length = 0.; + Gauss* gauss=this->NewGauss(&xyz_list[0][0],&xyz_front[0][0],3); + while(gauss->next()){ + thickness_input->GetInputValue(&thickness,gauss); + vx_input->GetInputValue(&vx,gauss); + vy_input->GetInputValue(&vy,gauss); + s_xx_input->GetInputValue(&s_xx,gauss); + s_xy_input->GetInputValue(&s_xy,gauss); + s_yy_input->GetInputValue(&s_yy,gauss); + this->JacobianDeterminantSurface(&Jdet,&xyz_front[0][0],gauss); + + IssmDouble R[2][2]; + R[0][0] = 2*s_xx+s_yy; + R[1][0] = s_xy; + R[0][1] = s_xy; + R[1][1] = 2*s_yy+s_xx; + + IssmDouble N = normal[0]*(R[0][0]*normal[0]+R[0][1]*normal[1]) + normal[1]*(R[1][0]*normal[0]+R[1][1]*normal[1]); + IssmDouble N0 = 0.5*constant_g*rho_ice*(1-rho_ice/rho_seawater)*thickness; + + theta += Jdet*gauss->weight*N/N0; + length += Jdet*gauss->weight; + } + + /*Cleanup and return*/ + delete gauss; + _assert_(theta>0.); + _assert_(length>0.); + *ptheta = theta; + *plength = length; + return true; +} +/*}}}*/ void Tria::CalvingRateVonmises(){/*{{{*/ /*First, compute Von Mises Stress*/ diff --git a/src/c/classes/Elements/Tria.h b/src/c/classes/Elements/Tria.h index 307aa3d50..560241449 100644 --- a/src/c/classes/Elements/Tria.h +++ b/src/c/classes/Elements/Tria.h @@ -53,6 +53,8 @@ class Tria: public Element,public ElementHook,public TriaRef{ /*}}}*/ /*Element virtual functions definitions: {{{*/ void AverageOntoPartition(Vector* partition_contributions,Vector* partition_areas,IssmDouble* vertex_response,IssmDouble* qmu_part); + + bool Buttressing(IssmDouble* ptheta, IssmDouble* plength); void CalvingRateVonmises(); void CalvingRateVonmisesAD(); void CalvingRateTest(); diff --git a/src/c/classes/FemModel.cpp b/src/c/classes/FemModel.cpp index 2c7ff1d36..408d1fecd 100644 --- a/src/c/classes/FemModel.cpp +++ b/src/c/classes/FemModel.cpp @@ -1053,6 +1053,29 @@ void FemModel::Solve(void){/*{{{*/ /*}}}*/ /*Modules:*/ +void FemModel::AverageButtressingx(IssmDouble* pTheta){/*{{{*/ + + IssmDouble local_theta = 0.; + IssmDouble local_length = 0.; + IssmDouble total_theta,total_length,element_theta,element_length; + + for(Object* & object : this->elements->objects){ + Element* element = xDynamicCast(object); + if(element->Buttressing(&element_theta, &element_length)){ + local_theta += element_theta; + local_length += element_length; + } + } + ISSM_MPI_Reduce(&local_theta,&total_theta,1,ISSM_MPI_DOUBLE,ISSM_MPI_SUM,0,IssmComm::GetComm() ); + ISSM_MPI_Bcast(&total_theta,1,ISSM_MPI_DOUBLE,0,IssmComm::GetComm()); + ISSM_MPI_Reduce(&local_length,&total_length,1,ISSM_MPI_DOUBLE,ISSM_MPI_SUM,0,IssmComm::GetComm() ); + ISSM_MPI_Bcast(&total_length,1,ISSM_MPI_DOUBLE,0,IssmComm::GetComm()); + _assert_(total_length>0.); + + /*Assign output pointers: */ + *pTheta=total_theta/total_length; + +}/*}}}*/ void FemModel::BalancethicknessMisfitx(IssmDouble* presponse){/*{{{*/ /*output: */ @@ -2447,11 +2470,12 @@ void FemModel::RequestedOutputsx(Results **presults,char** requested_outputs, in switch(output_enum){ /*Scalar output*/ + case AverageButtressingEnum: this->AverageButtressingx(&double_result); break; case DivergenceEnum: this->Divergencex(&double_result); break; case MaxDivergenceEnum: this->MaxDivergencex(&double_result); break; case IceMassEnum: this->IceMassx(&double_result,false); break; case IcefrontMassFluxEnum: this->IcefrontMassFluxx(&double_result,false); break; - case IcefrontMassFluxLevelsetEnum: this->IcefrontMassFluxLevelsetx(&double_result,false); break; + case IcefrontMassFluxLevelsetEnum: this->IcefrontMassFluxLevelsetx(&double_result,false); break; case IceMassScaledEnum: this->IceMassx(&double_result,true); break; case IceVolumeEnum: this->IceVolumex(&double_result,false); break; case IceVolumeScaledEnum: this->IceVolumex(&double_result,true); break; diff --git a/src/c/classes/FemModel.h b/src/c/classes/FemModel.h index e36fdbe4b..52924ce43 100644 --- a/src/c/classes/FemModel.h +++ b/src/c/classes/FemModel.h @@ -91,6 +91,7 @@ class FemModel { void Solve(void); /*Modules*/ + void AverageButtressingx(IssmDouble* ptheta); void BalancethicknessMisfitx(IssmDouble* pV); void CalvingRateVonmisesx(); void CalvingRateLevermannx(); From 726404e69da4db2284dc2adcadf5a7e84bc77070 Mon Sep 17 00:00:00 2001 From: inwoo-simba Date: Sun, 22 Jun 2025 23:05:52 +0900 Subject: [PATCH 021/126] CHG: plot_gridded.py - Fix minor. --- src/m/plot/plot_gridded.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/m/plot/plot_gridded.py b/src/m/plot/plot_gridded.py index fab4bc79c..75fd0d095 100755 --- a/src/m/plot/plot_gridded.py +++ b/src/m/plot/plot_gridded.py @@ -145,7 +145,7 @@ def plot_gridded(md,data,options,fig,axgrid,gridindex): #patch('Faces',[A B C],'Vertices', [x y z],'FaceVertexCData',data_grid(1)*ones(size(x)),'FaceColor','none','EdgeColor',getfieldvalue(options,'edgecolor')); ax.triplot(x,y,triangles=elements, color=options.getfieldvalue('edgecolor'), - linewdith=options.getfieldvalue('linewidth',1), + linewidth=options.getfieldvalue('linewidth',1), ) #Apply options From 75e424b498ccd68ef68f864a710f2582807bbd7d Mon Sep 17 00:00:00 2001 From: Tidbit Software <34657535+TidbitSoftware@users.noreply.github.com> Date: Mon, 23 Jun 2025 12:16:50 -0700 Subject: [PATCH 022/126] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index f27c50e9b..4cc0c0ea3 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ ISSM is a large-scale thermo-mechanical 2D/3D parallelized multi-purpose finite- ## Contact - Forum: https://issm.ess.uci.edu/forum - GitHub: https://github.com/ISSMteam/ISSM - - Website: https://issm.jpl.nasa.gov (will be decomissioned soon) + - Website: https://issm.jpl.nasa.gov (will be decommissioned soon) ## Checking Out a Copy of the Repository Navigate to the parent directory where you want the ISSM repository to be located. If you plan to make contributions to the code base, we recommend that you check out a copy via SSH with, From 3c9c7c7c164d568707e729e069e6855533980fd2 Mon Sep 17 00:00:00 2001 From: Tidbit Software <34657535+TidbitSoftware@users.noreply.github.com> Date: Mon, 23 Jun 2025 12:26:19 -0700 Subject: [PATCH 023/126] Simplified ISSM configuration for workflows --- .github/workflows/common-workflow.yml | 9 ++++----- .github/workflows/ubuntu-python.yml | 2 -- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/.github/workflows/common-workflow.yml b/.github/workflows/common-workflow.yml index 75157e63c..3c0836c5a 100644 --- a/.github/workflows/common-workflow.yml +++ b/.github/workflows/common-workflow.yml @@ -75,10 +75,10 @@ jobs: - name: Install Python dependencies if: contains(inputs.interface, 'python') run: | - sudo apt-get install libpython${{ inputs.python_version }}-dev - sudo apt-get install python3-dev + sudo apt install libpython${{ inputs.python_version }}-dev + sudo apt install python3-dev python -m pip install --upgrade pip - sudo apt-get update && sudo apt-get install -y python3-tk + sudo apt update && sudo apt install -y python3-tk python -m pip install numpy scipy matplotlib nose - name: Build ISSM @@ -90,7 +90,6 @@ jobs: export F90=$FC export MATLAB_ROOT=${{ steps.setup-matlab.outputs.matlabroot }} export PYTHON_ROOT=${{ env.pythonLocation }} - export NUMPY_ROOT=${{ env.LD_LIBRARY_PATH }}/python${{ inputs.python_version }}/site-packages/numpy ${{ inputs.build_command }} - name: Compile ISSM @@ -177,7 +176,7 @@ jobs: if: contains( inputs.interface, 'python') run: | python -m pip install --upgrade pip - sudo apt-get update && sudo apt-get install -y python3-tk + sudo apt update && sudo apt install -y python3-tk python -m pip install numpy scipy matplotlib nose netCDF4 - name: Run Python tests diff --git a/.github/workflows/ubuntu-python.yml b/.github/workflows/ubuntu-python.yml index b525989c0..b8f1c3c67 100644 --- a/.github/workflows/ubuntu-python.yml +++ b/.github/workflows/ubuntu-python.yml @@ -47,9 +47,7 @@ jobs: --enable-development \ --enable-debugging \ --with-numthreads=4 \ - --with-python-version=3.12 \ --with-python-dir=$PYTHON_ROOT \ - --with-python-numpy-dir=$NUMPY_ROOT \ --with-fortran-lib="-L/usr/lib/x86_64-linux-gnu -lgfortran" \ --with-mpi-include="${ISSM_DIR}/externalpackages/petsc/install/include" \ --with-mpi-libflags="-L${ISSM_DIR}/externalpackages/petsc/install/lib -lmpi -lmpicxx -lmpifort" \ From ea80e4e614e8d54016fc595dc351f493da6eb896 Mon Sep 17 00:00:00 2001 From: Tidbit Software <34657535+TidbitSoftware@users.noreply.github.com> Date: Mon, 23 Jun 2025 12:39:35 -0700 Subject: [PATCH 024/126] Test using Python 3.14 for workflow --- .github/workflows/ubuntu-python.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ubuntu-python.yml b/.github/workflows/ubuntu-python.yml index b8f1c3c67..025a9cf95 100644 --- a/.github/workflows/ubuntu-python.yml +++ b/.github/workflows/ubuntu-python.yml @@ -36,7 +36,7 @@ jobs: os: ubuntu-latest build_type: basic-python interface: python - python_version: 3.12 + python_version: 3.14 build_command: | source $ISSM_DIR/etc/environment.sh autoreconf -ivf From 93c1ba9e1d6ff8a4808cd977c6571fc36204793a Mon Sep 17 00:00:00 2001 From: Tidbit Software <34657535+TidbitSoftware@users.noreply.github.com> Date: Mon, 23 Jun 2025 13:02:55 -0700 Subject: [PATCH 025/126] Python 3.14 is in beta -> 3.13 --- .github/workflows/ubuntu-python.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ubuntu-python.yml b/.github/workflows/ubuntu-python.yml index 025a9cf95..88f92f6c4 100644 --- a/.github/workflows/ubuntu-python.yml +++ b/.github/workflows/ubuntu-python.yml @@ -36,7 +36,7 @@ jobs: os: ubuntu-latest build_type: basic-python interface: python - python_version: 3.14 + python_version: 3.13 build_command: | source $ISSM_DIR/etc/environment.sh autoreconf -ivf From 5b5b0a654441d89e24447bc1f233210709438119 Mon Sep 17 00:00:00 2001 From: Tidbit Software <34657535+TidbitSoftware@users.noreply.github.com> Date: Mon, 23 Jun 2025 13:11:52 -0700 Subject: [PATCH 026/126] Restoring Python version after removing cache --- .github/workflows/ubuntu-python.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ubuntu-python.yml b/.github/workflows/ubuntu-python.yml index 88f92f6c4..5c64bf354 100644 --- a/.github/workflows/ubuntu-python.yml +++ b/.github/workflows/ubuntu-python.yml @@ -36,13 +36,14 @@ jobs: os: ubuntu-latest build_type: basic-python interface: python - python_version: 3.13 + python_version: 3.12 build_command: | source $ISSM_DIR/etc/environment.sh autoreconf -ivf ls ${ISSM_DIR}/externalpackages/petsc/install/bin/ which mpicxx - ./configure --prefix=${ISSM_DIR} \ + ./configure \ + --prefix=${ISSM_DIR} \ --disable-static \ --enable-development \ --enable-debugging \ From 9b593da09e4bb7307054df899c41a96ce0857765 Mon Sep 17 00:00:00 2001 From: Tidbit Software <34657535+TidbitSoftware@users.noreply.github.com> Date: Mon, 23 Jun 2025 15:27:36 -0700 Subject: [PATCH 027/126] More debugging of Python in GitHub workflow --- .github/workflows/common-workflow.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/common-workflow.yml b/.github/workflows/common-workflow.yml index 3c0836c5a..0f51fdb04 100644 --- a/.github/workflows/common-workflow.yml +++ b/.github/workflows/common-workflow.yml @@ -75,10 +75,11 @@ jobs: - name: Install Python dependencies if: contains(inputs.interface, 'python') run: | + sudo apt update sudo apt install libpython${{ inputs.python_version }}-dev sudo apt install python3-dev python -m pip install --upgrade pip - sudo apt update && sudo apt install -y python3-tk + sudo apt install -y python3-tk python -m pip install numpy scipy matplotlib nose - name: Build ISSM From 1af898c06b4d2dc1915433d7c3246349e38a228b Mon Sep 17 00:00:00 2001 From: Tidbit Software <34657535+TidbitSoftware@users.noreply.github.com> Date: Mon, 23 Jun 2025 15:56:47 -0700 Subject: [PATCH 028/126] Debugging workflow: find arrayobject.h on runner --- .github/workflows/common-workflow.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/common-workflow.yml b/.github/workflows/common-workflow.yml index 0f51fdb04..7633e11bd 100644 --- a/.github/workflows/common-workflow.yml +++ b/.github/workflows/common-workflow.yml @@ -81,6 +81,7 @@ jobs: python -m pip install --upgrade pip sudo apt install -y python3-tk python -m pip install numpy scipy matplotlib nose + find /usr -name arrayobject.h - name: Build ISSM run: | From 27f442d64ba9665ccd46819bd2de039626d9bb76 Mon Sep 17 00:00:00 2001 From: Tidbit Software <34657535+TidbitSoftware@users.noreply.github.com> Date: Mon, 23 Jun 2025 16:15:07 -0700 Subject: [PATCH 029/126] Debugging workflow: find arrayobject.h on runner --- .github/workflows/common-workflow.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/common-workflow.yml b/.github/workflows/common-workflow.yml index 7633e11bd..fceb05f51 100644 --- a/.github/workflows/common-workflow.yml +++ b/.github/workflows/common-workflow.yml @@ -81,7 +81,8 @@ jobs: python -m pip install --upgrade pip sudo apt install -y python3-tk python -m pip install numpy scipy matplotlib nose - find /usr -name arrayobject.h + echo $(find /usr -name arrayobject.h) + echo $(find /opt -name arrayobject.h) - name: Build ISSM run: | From 515524ee79f31e6babde8cbc7b2a928b3a6173d4 Mon Sep 17 00:00:00 2001 From: Tidbit Software <34657535+TidbitSoftware@users.noreply.github.com> Date: Mon, 23 Jun 2025 20:05:29 -0700 Subject: [PATCH 030/126] Test output of finding NumPy include path --- .github/workflows/common-workflow.yml | 3 +-- README.md | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/common-workflow.yml b/.github/workflows/common-workflow.yml index fceb05f51..49103977a 100644 --- a/.github/workflows/common-workflow.yml +++ b/.github/workflows/common-workflow.yml @@ -81,8 +81,7 @@ jobs: python -m pip install --upgrade pip sudo apt install -y python3-tk python -m pip install numpy scipy matplotlib nose - echo $(find /usr -name arrayobject.h) - echo $(find /opt -name arrayobject.h) + echo $(python -c "import numpy; import sys; sys.stdout.write(numpy.get_include())") - name: Build ISSM run: | diff --git a/README.md b/README.md index 4cc0c0ea3..7a91f90e1 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@ # Ice-sheet and Sea-level System Model - ISSM [![License](https://img.shields.io/badge/License-BSD_3--Clause-blue.svg)](https://opensource.org/licenses/BSD-3-Clause) [![Ubuntu Basic](https://github.com/ISSMteam/ISSM/actions/workflows/ubuntu-basic.yml/badge.svg)](https://github.com/ISSMteam/ISSM/actions/workflows/ubuntu-basic.yml) -[![Ubuntu CodiPack](https://github.com/ISSMteam/ISSM/actions/workflows/ubuntu-codipack.yml/badge.svg)](https://github.com/ISSMteam/ISSM/actions/workflows/ubuntu-codipack.yml) [![Ubuntu Python](https://github.com/ISSMteam/ISSM/actions/workflows/ubuntu-python.yml/badge.svg)](https://github.com/ISSMteam/ISSM/actions/workflows/ubuntu-python.yml) +[![Ubuntu CodiPack](https://github.com/ISSMteam/ISSM/actions/workflows/ubuntu-codipack.yml/badge.svg)](https://github.com/ISSMteam/ISSM/actions/workflows/ubuntu-codipack.yml) ## Description ISSM is a large-scale thermo-mechanical 2D/3D parallelized multi-purpose finite-element software dedicated to ice sheet and sea-level modeling. From ed49365415542f1e032fabd39f0e770de44d0a68 Mon Sep 17 00:00:00 2001 From: Tidbit Software <34657535+TidbitSoftware@users.noreply.github.com> Date: Mon, 23 Jun 2025 20:29:06 -0700 Subject: [PATCH 031/126] Adding NUMPY_ROOT env var back in --- .github/workflows/common-workflow.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/common-workflow.yml b/.github/workflows/common-workflow.yml index 49103977a..5d37f5840 100644 --- a/.github/workflows/common-workflow.yml +++ b/.github/workflows/common-workflow.yml @@ -81,7 +81,6 @@ jobs: python -m pip install --upgrade pip sudo apt install -y python3-tk python -m pip install numpy scipy matplotlib nose - echo $(python -c "import numpy; import sys; sys.stdout.write(numpy.get_include())") - name: Build ISSM run: | @@ -92,6 +91,7 @@ jobs: export F90=$FC export MATLAB_ROOT=${{ steps.setup-matlab.outputs.matlabroot }} export PYTHON_ROOT=${{ env.pythonLocation }} + export NUMPY_ROOT=${{ env.LD_LIBRARY_PATH }}/python${{ inputs.python_version }}/site-packages/numpy ${{ inputs.build_command }} - name: Compile ISSM From ef46e2466006332b53663eb9536c2d3c17424fe8 Mon Sep 17 00:00:00 2001 From: Tidbit Software <34657535+TidbitSoftware@users.noreply.github.com> Date: Tue, 24 Jun 2025 11:18:28 -0700 Subject: [PATCH 032/126] Adjusted path to Python exec --- .github/workflows/common-workflow.yml | 1 - .github/workflows/ubuntu-python.yml | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/common-workflow.yml b/.github/workflows/common-workflow.yml index 5d37f5840..0f51fdb04 100644 --- a/.github/workflows/common-workflow.yml +++ b/.github/workflows/common-workflow.yml @@ -91,7 +91,6 @@ jobs: export F90=$FC export MATLAB_ROOT=${{ steps.setup-matlab.outputs.matlabroot }} export PYTHON_ROOT=${{ env.pythonLocation }} - export NUMPY_ROOT=${{ env.LD_LIBRARY_PATH }}/python${{ inputs.python_version }}/site-packages/numpy ${{ inputs.build_command }} - name: Compile ISSM diff --git a/.github/workflows/ubuntu-python.yml b/.github/workflows/ubuntu-python.yml index 5c64bf354..c48432f50 100644 --- a/.github/workflows/ubuntu-python.yml +++ b/.github/workflows/ubuntu-python.yml @@ -48,7 +48,7 @@ jobs: --enable-development \ --enable-debugging \ --with-numthreads=4 \ - --with-python-dir=$PYTHON_ROOT \ + --with-python=${PYTHON_ROOT}/bin/python3 \ --with-fortran-lib="-L/usr/lib/x86_64-linux-gnu -lgfortran" \ --with-mpi-include="${ISSM_DIR}/externalpackages/petsc/install/include" \ --with-mpi-libflags="-L${ISSM_DIR}/externalpackages/petsc/install/lib -lmpi -lmpicxx -lmpifort" \ From beb46c208c789b0f1015e428d4722c376ed3b889 Mon Sep 17 00:00:00 2001 From: mmorligh Date: Wed, 25 Jun 2025 13:15:05 -0400 Subject: [PATCH 033/126] CHG: better way to handle file or version number --- src/m/modeldata/interpBedmachineGreenland.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/m/modeldata/interpBedmachineGreenland.m b/src/m/modeldata/interpBedmachineGreenland.m index 069b7062b..c49c064ff 100644 --- a/src/m/modeldata/interpBedmachineGreenland.m +++ b/src/m/modeldata/interpBedmachineGreenland.m @@ -39,7 +39,7 @@ basename = 'BedMachineGreenland'; -if nargin==5 +if nargin==5 && exist(ncdate, 'file') ncfile = ncdate; else %List of common paths to try From 0d3d946d0db1744dab40049fe6af5e0fdb933b98 Mon Sep 17 00:00:00 2001 From: mmorligh Date: Wed, 25 Jun 2025 13:22:28 -0400 Subject: [PATCH 034/126] CHG: reverting configure.ac to previous version --- configure.ac | 49 ------------------------------------------------- 1 file changed, 49 deletions(-) diff --git a/configure.ac b/configure.ac index 8a309220c..af4369f08 100644 --- a/configure.ac +++ b/configure.ac @@ -29,59 +29,10 @@ AM_PROG_AR #Libtool LT_INIT([win32-dll]) -# ===================================================================== -# Automatic-Differentiation switches -# ===================================================================== -AC_ARG_ENABLE([ad], - AS_HELP_STRING([--enable-ad], - [Build ISSM with CoDiPack+MediPack (disables PETSc)]), - [enable_ad=$enableval], - [enable_ad=no]) - -AC_ARG_WITH([codipack-dir], - AS_HELP_STRING([--with-codipack-dir=DIR], [Prefix of CoDiPack install]), - [CODIPACK_DIR=$withval], - [CODIPACK_DIR=]) - -AC_ARG_WITH([medipack-dir], - AS_HELP_STRING([--with-medipack-dir=DIR], [Prefix of MediPack install]), - [MEDIPACK_DIR=$withval], - [MEDIPACK_DIR=]) - -# --- Validation & flag embedding ------------------------------------- -if test "x$enable_ad" = "xyes"; then - if test -z "$CODIPACK_DIR" || test -z "$MEDIPACK_DIR"; then - AC_MSG_ERROR([--enable-ad needs BOTH --with-codipack-dir and --with-medipack-dir]) - fi - - # Tell source files we are in AD mode - AC_DEFINE([ISSM_USE_AD], [1], [Define to 1 if building with automatic differentiation]) - - # Drop PETSc automatically (picked up by m4/issm_options.m4) - ENABLE_PETSC=no - AM_CONDITIONAL([USE_AD], [true]) -else - ENABLE_PETSC=yes - AM_CONDITIONAL([USE_AD], [false]) -fi - -dnl ---- Embed include-paths, lib-paths & libs globally ----------------- -if test "x$enable_ad" = "xyes"; then - AM_CPPFLAGS="$AM_CPPFLAGS -I$CODIPACK_DIR/include -I$MEDIPACK_DIR/include -DCODI_ForcedInlines" - AM_LDFLAGS="$AM_LDFLAGS -L$CODIPACK_DIR/lib -L$MEDIPACK_DIR/lib" - LIBS="$LIBS -lcodi -lmedi" -fi - -dnl Export the variables so Automake can substitute them -AC_SUBST([AM_CPPFLAGS]) -AC_SUBST([AM_LDFLAGS]) -AC_SUBST([LIBS]) - # --------------------------------------------------------------------- # Run ISSM’s usual option-detection macro collection # --------------------------------------------------------------------- ISSM_OPTIONS -ISSM_ENABLE_AD # --------------------------------------------------------------------- # Output files From 835d6b8e1913430b955bb6387465a91808534f6a Mon Sep 17 00:00:00 2001 From: inwoo-simba Date: Fri, 27 Jun 2025 16:09:30 +0900 Subject: [PATCH 035/126] CHG: Fix treating masked value in "plot_gridded.py". --- src/m/plot/plot_gridded.py | 6 ++++++ 1 file changed, 6 insertions(+) mode change 100755 => 100644 src/m/plot/plot_gridded.py diff --git a/src/m/plot/plot_gridded.py b/src/m/plot/plot_gridded.py old mode 100755 new mode 100644 index 75fd0d095..67959acae --- a/src/m/plot/plot_gridded.py +++ b/src/m/plot/plot_gridded.py @@ -3,6 +3,7 @@ import matplotlib.colors import warnings import numpy as np +from numpy import ma from InterpFromMeshToGrid import InterpFromMeshToGrid from processmesh import processmesh from processdata import processdata @@ -58,6 +59,11 @@ def plot_gridded(md,data,options,fig,axgrid,gridindex): ny = int(np.diff(ylim)[0]/posty)+1 x_m = np.linspace(xlim[0],xlim[1],nx) y_m = np.linspace(ylim[0],ylim[1],ny) + + #Tricky part in treating masked value. + if isinstance(data,np.ma.core.MaskedArray): + data[data.mask] = np.nan + #NOTE: Tricky part for elements in interpolation. data_grid=InterpFromMeshToGrid(elements+1,x,y,data,x_m,y_m,np.nan) data_grid_save = copy.deepcopy(data_grid) From 96d7662baa0614c58b67903caca2bd99a2cc0f98 Mon Sep 17 00:00:00 2001 From: inwoo-simba Date: Fri, 27 Jun 2025 20:39:46 +0900 Subject: [PATCH 036/126] CHG: plot_contour.py - Enable to draw labels on contour lines. --- src/m/plot/plot_contour.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/m/plot/plot_contour.py b/src/m/plot/plot_contour.py index 1c88c2f06..2eefd1fbe 100644 --- a/src/m/plot/plot_contour.py +++ b/src/m/plot/plot_contour.py @@ -36,4 +36,10 @@ def plot_contour(md, datain, options, ax): linestyles = options.getfieldvalue('contourlinestyles', '-') linewidths = options.getfieldvalue('contourlinewidths', 1) - ax.tricontour(x, y, elements, data, levels, colors=colors, norm=norm, linestyles=linestyles, linewidths=linewidths) + contour=ax.tricontour(x, y, elements, data, levels, colors=colors, norm=norm, linestyles=linestyles, linewidths=linewidths) + + #labels? + if options.getfieldvalue('contourticks','off') == 'on': + print("Catch contour ticks") + ax.clabel(contour,fmt=options.getfieldvalue('contourclabelfmt','%.2f'), + fontsize=options.getfieldvalue('contourclabelsize',10)) From 9375a48c72523d448d2e838215d204abb5cf1e6f Mon Sep 17 00:00:00 2001 From: Mathieu Morlighem <43073461+MathieuMorlighem@users.noreply.github.com> Date: Fri, 27 Jun 2025 10:46:04 -0700 Subject: [PATCH 037/126] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 7a91f90e1..083aa5afd 100644 --- a/README.md +++ b/README.md @@ -32,7 +32,7 @@ Note that checkout via HTTPS does not require credentials, but does not allow co ## Committing Changes to the Repository A good basic workflow for committing changes to the repository is, -``` +```bash #1. Stash your local changes git stash From 4c2756bd79f660eb71e4b47af7a4835cfc1c6c3c Mon Sep 17 00:00:00 2001 From: Tidbit Software <34657535+TidbitSoftware@users.noreply.github.com> Date: Fri, 27 Jun 2025 14:11:04 -0700 Subject: [PATCH 038/126] Adding libstc++ to Linux distriibutable --- packagers/linux/package-issm-linux-binaries-matlab.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packagers/linux/package-issm-linux-binaries-matlab.sh b/packagers/linux/package-issm-linux-binaries-matlab.sh index 6d79749df..f6928891f 100755 --- a/packagers/linux/package-issm-linux-binaries-matlab.sh +++ b/packagers/linux/package-issm-linux-binaries-matlab.sh @@ -40,6 +40,8 @@ LIBPSL="${ISSM_DIR}/externalpackages/gmt/install/lib/libpostscriptlight.so.6.5.0 LIBPSL_DIST="${ISSM_DIR}/lib/libpostscriptlight.so.6" # Important the file name matches the SONAME entry in the binaries and other shared libraries which link to it LIBQUADMATH="/usr/lib/x86_64-linux-gnu/libquadmath.so.0.0.0" # Important that this is the library itself LIBQUADMATH_DIST="${ISSM_DIR}/lib/libquadmath.so.0" # Important the file name matches the SONAME entry in the binaries and other shared libraries which link to it +LIBSTDCXX="/usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.30" # Important that this is the library itself +LIBSTDCXX_DIST="${ISSM_DIR}/lib/libstdc++.so.6.0.30" # Important the file name matches the SONAME entry in the binaries and other shared libraries which link to it ## Environment # @@ -85,6 +87,7 @@ cp ${LIBGFORTRAN} ${LIBGFORTRAN_DIST} 2>/dev/null cp ${LIBQUADMATH} ${LIBQUADMATH_DIST} 2>/dev/null cp ${LIBGMT} ${LIBGMT_DIST} 2>/dev/null cp ${LIBPSL} ${LIBPSL_DIST} 2>/dev/null +cp ${LIBSTDCXX} ${LIBSTDCXX_DIST} 2>/dev/null echo "Moving MPICH binaries to bin/" if [ -f ${ISSM_DIR}/externalpackages/petsc/install/bin/mpiexec ]; then From e4a322ab62f9bf5b7b9cb1e5f54e5dd4881bb072 Mon Sep 17 00:00:00 2001 From: Tidbit Software <34657535+TidbitSoftware@users.noreply.github.com> Date: Sat, 28 Jun 2025 11:03:06 -0700 Subject: [PATCH 039/126] Updated path to libgcc --- jenkins/mac-silicon-binaries-matlab | 2 +- jenkins/mac-silicon-binaries-python-3 | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/jenkins/mac-silicon-binaries-matlab b/jenkins/mac-silicon-binaries-matlab index 1bc06cce7..65787a9dd 100755 --- a/jenkins/mac-silicon-binaries-matlab +++ b/jenkins/mac-silicon-binaries-matlab @@ -1,6 +1,6 @@ MATLAB_PATH="/Applications/MATLAB_R2023b.app" LIBGFORTRAN_PATH="/opt/homebrew/lib/gcc/current" -LIBGCC_PATH="${LIBGFORTRAN_PATH}/gcc/aarch64-apple-darwin23/13" +LIBGCC_PATH="${LIBGFORTRAN_PATH}/gcc/aarch64-apple-darwin24/15" #--------------------# # ISSM Configuration # diff --git a/jenkins/mac-silicon-binaries-python-3 b/jenkins/mac-silicon-binaries-python-3 index 5bc747706..26bde6e0d 100755 --- a/jenkins/mac-silicon-binaries-python-3 +++ b/jenkins/mac-silicon-binaries-python-3 @@ -1,5 +1,5 @@ LIBGFORTRAN_PATH="/opt/homebrew/lib/gcc/current" -LIBGCC_PATH="${LIBGFORTRAN_PATH}/gcc/aarch64-apple-darwin23/13" +LIBGCC_PATH="${LIBGFORTRAN_PATH}/gcc/aarch64-apple-darwin24/15" #--------------------# # ISSM Configuration # From 376279f34364136287013dc7fef55d819eebe2fc Mon Sep 17 00:00:00 2001 From: mmorligh Date: Mon, 30 Jun 2025 13:18:34 -0700 Subject: [PATCH 040/126] CHG: adding install-3.23-mac.sh --- externalpackages/petsc/install-3.23-mac.sh | 50 ++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100755 externalpackages/petsc/install-3.23-mac.sh diff --git a/externalpackages/petsc/install-3.23-mac.sh b/externalpackages/petsc/install-3.23-mac.sh new file mode 100755 index 000000000..907b36977 --- /dev/null +++ b/externalpackages/petsc/install-3.23-mac.sh @@ -0,0 +1,50 @@ +#!/bin/bash +set -eu + +## Constants +# +VER="3.23.4" + +PETSC_DIR="${ISSM_DIR}/externalpackages/petsc/src" # DO NOT CHANGE THIS +PREFIX="${ISSM_DIR}/externalpackages/petsc/install" # Set to location where external package should be installed + +# Environment +if [ -z ${LDFLAGS+x} ]; then + LDFLAGS="" +fi + +# Download source +${ISSM_DIR}/scripts/DownloadExternalPackage.sh "https://web.cels.anl.gov/projects/petsc/download/release-snapshots/petsc-${VER}.tar.gz" "petsc-${VER}.tar.gz" + +# Unpack source +tar -zxvf petsc-${VER}.tar.gz + +# Cleanup +rm -rf ${PREFIX} ${PETSC_DIR} +mkdir -p ${PETSC_DIR} + +# Move source to $PETSC_DIR +mv petsc-${VER}/* ${PETSC_DIR} +rm -rf petsc-${VER} + +# Configure +cd ${PETSC_DIR} +./configure \ + --prefix="${PREFIX}" \ + --PETSC_DIR="${PETSC_DIR}" \ + --with-debugging=0 \ + --with-valgrind=0 \ + --with-x=0 \ + --with-ssl=0 \ + --with-pic=1 \ + --LDFLAGS="-Wl,-ld_classic" \ + --download-metis=1 \ + --download-mpich=1 \ + --download-mumps=1 \ + --download-parmetis=1 \ + --download-scalapack=1 \ + --download-zlib=1 + +# Compile and install +make +make install From eb1e1f0cbe0afaa6d62f2b9a273119822b1244fe Mon Sep 17 00:00:00 2001 From: mmorligh Date: Mon, 30 Jun 2025 17:50:05 -0700 Subject: [PATCH 041/126] CHG: added info in case people have questions --- externalpackages/vim/addons/vimrc | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/externalpackages/vim/addons/vimrc b/externalpackages/vim/addons/vimrc index 23e665bda..1a456d361 100644 --- a/externalpackages/vim/addons/vimrc +++ b/externalpackages/vim/addons/vimrc @@ -1,3 +1,13 @@ +" ================= +" ISSM vim settings +" ================= +" Many files in ISSM rely on vim's folds. The option below +" make ISSM development easier by highlighting ISSM classes +" and Enums. +" For dark background select colorscheme issm_black +" For light background select colorscheme issm_white +" Report problems to: +" Mathieu Morlighem mathieu.morlighem@dartmouth.edu " General setup{{{ " ---------------------------------------------------------------------- @@ -79,7 +89,6 @@ set su=.h,.bak,~,.o,.info,.swp,.obj " Colors and theme {{{ " ---------------------------------------------------------------------- " use 256 colors -"set t_Co=8 set t_Co=256 " backgrounb color "set background=light From 59269575a8ddf60d8b1e7e79285b8e50beb65c2d Mon Sep 17 00:00:00 2001 From: mmorligh Date: Tue, 1 Jul 2025 18:41:47 -0400 Subject: [PATCH 042/126] CHG: estetics --- src/c/classes/Elements/Element.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/c/classes/Elements/Element.cpp b/src/c/classes/Elements/Element.cpp index 5f87324bb..f670c5eb8 100644 --- a/src/c/classes/Elements/Element.cpp +++ b/src/c/classes/Elements/Element.cpp @@ -6522,12 +6522,9 @@ void Element::ViscousHeatingCreateInput(void){/*{{{*/ /*loop over vertices: */ Gauss* gauss=this->NewGauss(); - for (int iv=0;ivGaussVertex(iv); - - this->ViscousHeating(&phi,xyz_list,gauss,vx_input,vy_input,vz_input); - - viscousheating[iv]=phi; + this->ViscousHeating(&viscousheating[iv],xyz_list,gauss,vx_input,vy_input,vz_input); } /*Create PentaVertex input, which will hold the basal friction:*/ From 92a61ed5669c3c506657a85a4a666fd7368cecbb Mon Sep 17 00:00:00 2001 From: mmorligh Date: Tue, 1 Jul 2025 18:42:07 -0400 Subject: [PATCH 043/126] CHG: better handling of file vs version number --- src/m/modeldata/interpBedmachineAntarctica.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/m/modeldata/interpBedmachineAntarctica.m b/src/m/modeldata/interpBedmachineAntarctica.m index 1251d78c4..92dd3c2e6 100644 --- a/src/m/modeldata/interpBedmachineAntarctica.m +++ b/src/m/modeldata/interpBedmachineAntarctica.m @@ -31,7 +31,7 @@ end basename = 'BedMachineAntarctica'; -if nargin==5 +if nargin==5 && exist(ncdate, 'file') ncfile = ncdate; else %List of common paths to try From ed1c8335261ba9cdb35a3462dd201a71f175d850 Mon Sep 17 00:00:00 2001 From: mmorligh Date: Tue, 1 Jul 2025 18:49:02 -0400 Subject: [PATCH 044/126] CHG: minor, removing unnecessary variables --- src/c/classes/Elements/Element.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/c/classes/Elements/Element.cpp b/src/c/classes/Elements/Element.cpp index f670c5eb8..223023211 100644 --- a/src/c/classes/Elements/Element.cpp +++ b/src/c/classes/Elements/Element.cpp @@ -6506,8 +6506,6 @@ void Element::TransformStiffnessMatrixCoord(ElementMatrix* Ke,Node** nodes void Element::ViscousHeatingCreateInput(void){/*{{{*/ /*Intermediaries*/ - IssmDouble phi; - IssmDouble thickness; IssmDouble *xyz_list = NULL; /*Fetch number vertices and allocate memory*/ From 876bded3d93fa0aa04f83f52bd2d8e2481783695 Mon Sep 17 00:00:00 2001 From: mmorligh Date: Tue, 1 Jul 2025 18:51:46 -0400 Subject: [PATCH 045/126] CHG: renamed nu -> mu to avoid confusion --- src/m/mech/mechanicalproperties.m | 22 ++++++++++------------ src/m/mech/mechanicalproperties.py | 20 ++++++++++---------- 2 files changed, 20 insertions(+), 22 deletions(-) diff --git a/src/m/mech/mechanicalproperties.m b/src/m/mech/mechanicalproperties.m index e519e5d28..65d057480 100644 --- a/src/m/mech/mechanicalproperties.m +++ b/src/m/mech/mechanicalproperties.m @@ -50,26 +50,26 @@ clear vxlist vylist %compute viscosity -nu=zeros(numberofelements,1); +mu=zeros(numberofelements,1); B_bar=md.materials.rheology_B(index)*summation/3; power=(md.materials.rheology_n-1)./(2*md.materials.rheology_n); second_inv=(ux.^2+vy.^2+((uy+vx).^2)/4+ux.*vy); %some corrections location=find(second_inv==0 & power~=0); -nu(location)=10^18; %arbitrary maximum viscosity to apply where there is no effective shear +mu(location)=10^18; %arbitrary maximum viscosity to apply where there is no effective shear if isa(md.materials,'matice') location=find(second_inv~=0); - nu(location)=B_bar(location)./(second_inv(location).^power(location)); + mu(location)=B_bar(location)./(second_inv(location).^power(location)); location=find(second_inv==0 & power==0); - nu(location)=B_bar(location); + mu(location)=B_bar(location); elseif isa(md.materials,'matdamageice') Zinv=1-damage(index)*summation/3; location=find(second_inv~=0); - nu(location)=Zinv(location).*B_bar(location)./(second_inv(location).^power(location)); + mu(location)=Zinv(location).*B_bar(location)./(second_inv(location).^power(location)); location=find(second_inv==0 & power==0); - nu(location)=Zinv(location).*B_bar(location); + mu(location)=Zinv(location).*B_bar(location); clear Zinv else error(['class of md.materials (' class(md.materials) ') not recognized or not supported']); @@ -77,9 +77,9 @@ clear B_bar location second_inv power %compute stress -tau_xx=nu.*ux; -tau_yy=nu.*vy; -tau_xy=nu.*uyvx; +tau_xx=mu.*ux; +tau_yy=mu.*vy; +tau_xy=mu.*uyvx; %compute principal properties of stress for i=1:numberofelements, @@ -133,6 +133,4 @@ deviatoricstress.effectivevalue=1/sqrt(2)*sqrt(deviatoricstress.xx.^2+deviatoricstress.yy.^2+2*deviatoricstress.xy.^2); md.results.deviatoricstress=deviatoricstress; -viscosity=struct('nu',[]); -viscosity.nu=nu; -md.results.viscosity=viscosity; +md.results.viscosity=mu; diff --git a/src/m/mech/mechanicalproperties.py b/src/m/mech/mechanicalproperties.py index 578d77886..90daa97c4 100755 --- a/src/m/mech/mechanicalproperties.py +++ b/src/m/mech/mechanicalproperties.py @@ -71,37 +71,37 @@ def mechanicalproperties(md, vx, vy, *args): #clear vxlist vylist #compute viscosity - nu = np.zeros((numberofelements, )) + mu = np.zeros((numberofelements, )) B_bar = np.dot(md.materials.rheology_B[index - 1], summation / 3.).reshape(-1, ) power = ((md.materials.rheology_n - 1.) / (2. * md.materials.rheology_n)).reshape(-1, ) second_inv = (ux**2. + vy**2. + ((uy + vx)**2.) / 4. + ux * vy).reshape(-1, ) #some corrections location = np.nonzero(np.logical_and(second_inv == 0, power != 0)) - nu[location] = pow(10, 18) #arbitrary maximum viscosity to apply where there is no effective shear + mu[location] = pow(10, 18) #arbitrary maximum viscosity to apply where there is no effective shear if 'matice' in md.materials.__module__: location = np.nonzero(second_inv) - nu[location] = B_bar[location] / (second_inv[location]**power[location]) + mu[location] = B_bar[location] / (second_inv[location]**power[location]) location = np.nonzero(np.logical_and(second_inv == 0, power == 0)) - nu[location] = B_bar[location] + mu[location] = B_bar[location] location = np.nonzero(np.logical_and(second_inv == 0, power != 0)) - nu[location] = pow(10, 18) + mu[location] = pow(10, 18) elif 'matdamageice' in md.materials.__module__: print('computing damage-dependent properties!') Zinv = np.dot(1 - damage[index - 1], summation / 3.).reshape(-1, ) location = np.nonzero(second_inv) - nu[location] = Zinv[location] * B_bar[location] / np.power(second_inv[location], power[location]) + mu[location] = Zinv[location] * B_bar[location] / np.power(second_inv[location], power[location]) location = np.nonzero(np.logical_and(second_inv == 0, power == 0)) - nu[location] = Zinv[location] * B_bar[location] + mu[location] = Zinv[location] * B_bar[location] #clear Zinv else: raise Exception('class of md.materials (' + md.materials.__module__ + ') not recognized or not supported') #compute stress - tau_xx = nu * ux - tau_yy = nu * vy - tau_xy = nu * uyvx + tau_xx = mu * ux + tau_yy = mu * vy + tau_xy = mu * uyvx #compute principal properties of stress for i in np.arange(numberofelements): From 1359fa35a769222e9c810d6bcea5233b98aa100b Mon Sep 17 00:00:00 2001 From: inwoo-simba Date: Wed, 2 Jul 2025 18:02:11 +0900 Subject: [PATCH 046/126] CHG: applyoptions.py - Deactivate executable mode with "chmod -x". --- src/m/plot/applyoptions.py | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) mode change 100755 => 100644 src/m/plot/applyoptions.py diff --git a/src/m/plot/applyoptions.py b/src/m/plot/applyoptions.py old mode 100755 new mode 100644 index 46ee1ecea..5e64e3829 --- a/src/m/plot/applyoptions.py +++ b/src/m/plot/applyoptions.py @@ -230,8 +230,20 @@ def applyoptions(md, data, options, fig, axgrid, gridindex): if options.exist('log'): formatter = mpl.ticker.LogFormatterSciNotation(base=options.getfieldvalue('log')) - cb = mpl.colorbar.ColorbarBase(ax.cax, cmap=cmap, norm=norm, extend=extend, - format=formatter) + try: + #NOTE: axis made by ImageGrid contains "cax". If axis generated by "plt.subplots()", we have to manually generate cax... + # type(ax) == mpl_toolkits.axes_grid1.mpl_axes.Axes + cb = mpl.colorbar.ColorbarBase(ax.cax, cmap=cmap, norm=norm, extend=extend, + format=formatter) + except: + from mpl_toolkits.axes_grid1 import make_axes_locatable + driver = make_axes_locatable(ax) + cax = driver.append_axes(options.getfieldvalue('colorbarpos','right'), + size=options.getfieldvalue('colorbarsize','5%'), + pad=options.getfieldvalue('colorbarpad',0.025)) + cb = mpl.colorbar.ColorbarBase(cax, cmap=cmap, norm=norm, extend=extend, + format=formatter) + if options.exist('alpha'): cb.set_alpha(options.getfieldvalue('alpha')) if options.exist('colorbarnumticks'): @@ -296,7 +308,7 @@ def applyoptions(md, data, options, fig, axgrid, gridindex): # }}} # {{{ scale ruler #TODO: The current version for scaleruler relies on "matplotlib-scalebar"; however, should this section be moved to a standalone "scaleruler" module, similar to the MATLAB version? - if options.getfieldvalue('scaleruler','off')=='on': + if options.exist('scaleruler'): try: from matplotlib_scalebar.scalebar import ScaleBar scalebar = ScaleBar(1,'m',location=options.getfieldvalue('scalerulerlocation','lower right')) @@ -319,6 +331,9 @@ def applyoptions(md, data, options, fig, axgrid, gridindex): # {{{ flat edges of a partition TODO # }}} # {{{ scatter TODO + if options.exist('scatter'): + data=getfieldvalue(options,'scatter') + plot_scatter(data[:,0],data[:,1],data[:3],options) # }}} # {{{ backgroundcolor TODO # }}} From 32cb96609a2c1f9022e95924965e76ba66eda409 Mon Sep 17 00:00:00 2001 From: inwoo-simba Date: Wed, 2 Jul 2025 18:04:52 +0900 Subject: [PATCH 047/126] CHG: Deactivate executable mode in python script using "chmod -x". --- src/m/plot/plot_landsat.py | 0 src/m/plot/plot_manager.py | 0 src/m/plot/plotmodel.py | 0 src/m/plot/processdata.py | 0 4 files changed, 0 insertions(+), 0 deletions(-) mode change 100755 => 100644 src/m/plot/plot_landsat.py mode change 100755 => 100644 src/m/plot/plot_manager.py mode change 100755 => 100644 src/m/plot/plotmodel.py mode change 100755 => 100644 src/m/plot/processdata.py diff --git a/src/m/plot/plot_landsat.py b/src/m/plot/plot_landsat.py old mode 100755 new mode 100644 diff --git a/src/m/plot/plot_manager.py b/src/m/plot/plot_manager.py old mode 100755 new mode 100644 diff --git a/src/m/plot/plotmodel.py b/src/m/plot/plotmodel.py old mode 100755 new mode 100644 diff --git a/src/m/plot/processdata.py b/src/m/plot/processdata.py old mode 100755 new mode 100644 From 12386b25fd5ca63188b6f080ac417fb5579bcd5f Mon Sep 17 00:00:00 2001 From: Max Sagebaum Date: Wed, 2 Jul 2025 13:40:31 +0200 Subject: [PATCH 048/126] Prepare for CoDiPack v3. --- src/c/cores/controlvalidation_core.cpp | 2 +- src/c/toolkits/codipack/CoDiPackCommon.hpp | 10 +++++----- src/c/toolkits/gsl/DenseGslSolve.cpp | 2 +- src/c/toolkits/mpi/issmmpi.h | 2 +- src/c/toolkits/mumps/MumpsSolve.cpp | 2 +- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/c/cores/controlvalidation_core.cpp b/src/c/cores/controlvalidation_core.cpp index 0356a299d..dc30d2982 100644 --- a/src/c/cores/controlvalidation_core.cpp +++ b/src/c/cores/controlvalidation_core.cpp @@ -97,7 +97,7 @@ void simul_stoptrace2(){/*{{{*/ #elif defined(_HAVE_CODIPACK_) - #if _CODIPACK_MAJOR_==2 + #if _CODIPACK_MAJOR_>=2 auto& tape_codi = IssmDouble::getTape(); #elif _CODIPACK_MAJOR_==1 auto& tape_codi = IssmDouble::getGlobalTape(); diff --git a/src/c/toolkits/codipack/CoDiPackCommon.hpp b/src/c/toolkits/codipack/CoDiPackCommon.hpp index fe2e6ca6e..2461aeb47 100755 --- a/src/c/toolkits/codipack/CoDiPackCommon.hpp +++ b/src/c/toolkits/codipack/CoDiPackCommon.hpp @@ -34,7 +34,7 @@ inline void setVectorPrimal(Real* vec, const Passive* pasVec, int n) { template inline void getVectorGradData(const Real* vec, Data* dataVec, int n) { for(int i = 0; i < n; ++i) { - #if _CODIPACK_MAJOR_==2 + #if _CODIPACK_MAJOR_>=2 dataVec[i]=vec[i].getIdentifier(); #elif _CODIPACK_MAJOR_==1 dataVec[i]=vec[i].getGradientData(); @@ -48,7 +48,7 @@ template inline void getVectorPrimalAndGradData(const Real* vec, Passive* pasVec, Data* dataVec, int n) { for(int i = 0; i < n; ++i) { pasVec[i]=vec[i].getValue(); - #if _CODIPACK_MAJOR_==2 + #if _CODIPACK_MAJOR_>=2 dataVec[i]=vec[i].getIdentifier(); #elif _CODIPACK_MAJOR_==1 dataVec[i]=vec[i].getGradientData(); @@ -61,7 +61,7 @@ inline void getVectorPrimalAndGradData(const Real* vec, Passive* pasVec, Data* d template inline void getPrimalAndGradData(const Real& value, Passive& pas, Data& data) { pas=value.getValue(); - #if _CODIPACK_MAJOR_==2 + #if _CODIPACK_MAJOR_>=2 data=value.getIdentifier(); #elif _CODIPACK_MAJOR_==1 data=value.getGradientData(); @@ -72,7 +72,7 @@ inline void getPrimalAndGradData(const Real& value, Passive& pas, Data& data) { template inline void registerVector(Real* vec, Data* dataVec, int n) { - #if _CODIPACK_MAJOR_==2 + #if _CODIPACK_MAJOR_>=2 typename Real::Tape& tape = Real::getTape(); #elif _CODIPACK_MAJOR_==1 typename Real::TapeType& tape = Real::getGlobalTape(); @@ -82,7 +82,7 @@ inline void registerVector(Real* vec, Data* dataVec, int n) { for(int i = 0; i < n; ++i) { tape.registerInput(vec[i]); - #if _CODIPACK_MAJOR_==2 + #if _CODIPACK_MAJOR_>=2 dataVec[i]=vec[i].getIdentifier(); #elif _CODIPACK_MAJOR_==1 dataVec[i]=vec[i].getGradientData(); diff --git a/src/c/toolkits/gsl/DenseGslSolve.cpp b/src/c/toolkits/gsl/DenseGslSolve.cpp index bc8e1822e..57937ed1f 100644 --- a/src/c/toolkits/gsl/DenseGslSolve.cpp +++ b/src/c/toolkits/gsl/DenseGslSolve.cpp @@ -253,7 +253,7 @@ void SolverxSeq(IssmDouble *X,IssmDouble *A,IssmDouble *B,int n, Parameters* par #endif #ifdef _HAVE_CODIPACK_ -#if _CODIPACK_MAJOR_==2 +#if _CODIPACK_MAJOR_>=2 using Tape = typename IssmDouble::Tape; using AccessInterface = codi::VectorAccessInterface; void SolverxSeq_codi_b(Tape* tape,void* data_in, AccessInterface* ra) {/*{{{*/ diff --git a/src/c/toolkits/mpi/issmmpi.h b/src/c/toolkits/mpi/issmmpi.h index 4fa57e3db..45f6d1800 100644 --- a/src/c/toolkits/mpi/issmmpi.h +++ b/src/c/toolkits/mpi/issmmpi.h @@ -33,7 +33,7 @@ //#include //using MpiTypes = CoDiMpiTypes; /*New implementation*/ - #if _CODIPACK_MAJOR_==2 + #if _CODIPACK_MAJOR_>=2 #include using MpiTypes = codi::CoDiMpiTypes; diff --git a/src/c/toolkits/mumps/MumpsSolve.cpp b/src/c/toolkits/mumps/MumpsSolve.cpp index 3f10226d9..f45338fee 100644 --- a/src/c/toolkits/mumps/MumpsSolve.cpp +++ b/src/c/toolkits/mumps/MumpsSolve.cpp @@ -484,7 +484,7 @@ int fos_reverse_mumpsSolveEDF(int iArrLength, int* iArr, int m, IssmPDouble *dp_ #endif #ifdef _HAVE_CODIPACK_ -#if _CODIPACK_MAJOR_==2 +#if _CODIPACK_MAJOR_>=2 using Tape = typename IssmDouble::Tape; using AccessInterface = codi::VectorAccessInterface; void MumpsSolve_codi_b(Tape* tape, void* data_in, AccessInterface* ra) {/*{{{*/ From 4745373b291ce867cf5622824c39e9fcbff77194 Mon Sep 17 00:00:00 2001 From: mmorligh Date: Wed, 2 Jul 2025 17:07:39 -0400 Subject: [PATCH 049/126] CHG: cosmetics --- src/m/mech/mechanicalproperties.m | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/m/mech/mechanicalproperties.m b/src/m/mech/mechanicalproperties.m index 65d057480..53ccd7cc1 100644 --- a/src/m/mech/mechanicalproperties.m +++ b/src/m/mech/mechanicalproperties.m @@ -13,13 +13,13 @@ % md=mechanicalproperties(md,md.inversion.vx_obs,md.inversion.vy_obs); %some checks -if length(vx)~=md.mesh.numberofvertices | length(vy)~=md.mesh.numberofvertices, +if length(vx)~=md.mesh.numberofvertices | length(vy)~=md.mesh.numberofvertices %error(['the input velocity should be of size ' num2str(md.mesh.numberofvertices) '!']) end if dimension(md.mesh)~=2 error('only 2d model supported yet'); end -if any(md.flowequation.element_equation~=2), +if any(md.flowequation.element_equation~=2) disp('Warning: the model has some non SSA elements. These will be treated like SSA''s elements'); end @@ -82,7 +82,7 @@ tau_xy=mu.*uyvx; %compute principal properties of stress -for i=1:numberofelements, +for i=1:numberofelements %compute stress and strainrate matrices stress=[tau_xx(i) tau_xy(i) From 246dd61681a6669f0ba0f8e2dc54888d628052de Mon Sep 17 00:00:00 2001 From: mmorligh Date: Wed, 2 Jul 2025 17:08:03 -0400 Subject: [PATCH 050/126] CoDiPack now requires -std=c++17 --- m4/issm_options.m4 | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/m4/issm_options.m4 b/m4/issm_options.m4 index 5d64690cd..30268ee03 100644 --- a/m4/issm_options.m4 +++ b/m4/issm_options.m4 @@ -995,7 +995,7 @@ AC_DEFUN([ISSM_OPTIONS],[ AC_SUBST([CODIPACKINCL]) fi AM_CONDITIONAL([CODIPACK], [test "x${HAVE_CODIPACK}" == "xyes"]) - AM_COND_IF(CODIPACK, [CXXFLAGS+=" -std=c++11"]) + AM_COND_IF(CODIPACK, [CXXFLAGS+=" -std=c++17"]) dnl }}} dnl Tape Allocation {{{ AC_MSG_CHECKING(for tape allocation) @@ -2404,7 +2404,6 @@ AC_DEFUN([ISSM_OPTIONS],[ NEOPZINCL+=" -I${NEOPZ_ROOT}/include/SubStruct" NEOPZINCL+=" -I${NEOPZ_ROOT}/include/Topology" NEOPZINCL+=" -I${NEOPZ_ROOT}/include/Util" - CXXFLAGS+=" -std=c++11" AC_DEFINE([_HAVE_NEOPZ_], [1], [with NeoPZ in ISSM src]) AC_SUBST([NEOPZINCL]) AC_SUBST([NEOPZLIB]) @@ -2662,4 +2661,4 @@ AC_DEFUN([ISSM_ENABLE_AD], [ AC_SUBST([AM_CPPFLAGS]) AC_SUBST([AM_LDFLAGS]) AC_SUBST([LIBS]) -]) \ No newline at end of file +]) From d193aa0ec7c3caad210033ea0b637a629d1baf49 Mon Sep 17 00:00:00 2001 From: menemenlis Date: Thu, 10 Jul 2025 16:15:14 -0700 Subject: [PATCH 051/126] a small test to see if I can push files --- test/MITgcm/tmp.txt | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 test/MITgcm/tmp.txt diff --git a/test/MITgcm/tmp.txt b/test/MITgcm/tmp.txt new file mode 100644 index 000000000..e69de29bb From 68d074143b70cb48d52a6cfc368c42abcf2a7197 Mon Sep 17 00:00:00 2001 From: menemenlis Date: Thu, 10 Jul 2025 16:29:47 -0700 Subject: [PATCH 052/126] removing tmp.txt --- it was just a test of push capability --- test/MITgcm/tmp.txt | 0 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 test/MITgcm/tmp.txt diff --git a/test/MITgcm/tmp.txt b/test/MITgcm/tmp.txt deleted file mode 100644 index e69de29bb..000000000 From 998087cdbe251eaec81efd6e077e2605f819f08f Mon Sep 17 00:00:00 2001 From: menemenlis Date: Fri, 11 Jul 2025 17:03:07 -0700 Subject: [PATCH 053/126] bringing some ISSM/MITgcm files over from the svn slr repo --- test/MITgcm/documents/NOTES | 54 +++ test/MITgcm/documents/README | 85 +++++ test/MITgcm/documents/issm_helene_notes.docx | Bin 0 -> 47076 bytes test/MITgcm/documents/lookat_4003.m | 45 +++ test/MITgcm/documents/mpi_coupling.txt | 348 +++++++++++++++++++ test/MITgcm/documents/notes_4003.txt | 28 ++ 6 files changed, 560 insertions(+) create mode 100644 test/MITgcm/documents/NOTES create mode 100644 test/MITgcm/documents/README create mode 100644 test/MITgcm/documents/issm_helene_notes.docx create mode 100644 test/MITgcm/documents/lookat_4003.m create mode 100644 test/MITgcm/documents/mpi_coupling.txt create mode 100644 test/MITgcm/documents/notes_4003.txt diff --git a/test/MITgcm/documents/NOTES b/test/MITgcm/documents/NOTES new file mode 100644 index 000000000..c53475012 --- /dev/null +++ b/test/MITgcm/documents/NOTES @@ -0,0 +1,54 @@ +The notes below and files in this directory initially originate from the slr svn repo: +svn --username ????? co http://issm.ess.uci.edu/svn/slr + + + + +{{{ Meeting with Tony Lee. +Leverage model we have: mass ocean + ice. Atmopheric constraints. + +CMIP: projection RCP scenarios. 2D forcings for atmosphere. Ask Peter Gallagher for help. +Decadal Prediction: no point of contact/website that has all the decadal prediction archives. UK Met +Depresys Doug Smith, NCAR runs (Danabasoglu Gokhan) - includes GFDL among them (Tony Rosatti). + +Issue: do we stop there to figure out the enveloppe of regional sl under decadal or CMIP forcings. +Or do we do an extra step: implication for inundations. Storm surge wave statistics to give you a bigger enveloppe. +We don't have expertise in storm surge or extreme events. + +NCAR wave forecast, lead is Hendrick Tolman NOAA operational forecast system, RFTOOS. + +Issue of timeframe? 10 year, 50 years. Max and minimum number? + +Forcing comes from a coupled system: if the coupled system does not have GRACE errors, ice shelves -> does it make sense to use that forcing? Mindful about potential limitations: +- CMIP6 will cointinuously improve these constraoints, so that's ok. +- ongoing effort to modify, alleviate these concerns by MITgcm and CMIP5 constraints (ask Dimitris about this) +ask Dimitris more about it. + +GMAO uses Poseidon, thinking about changing to MOM3. Since MOM4 got released, nothing has happened. + +}}} + + + + +From J. Wahr: +- wanted to know whether we want to match altimetry or whether we want +- spatial resolution issue. Ocean function is 1degx1deb -> need to increase that. +- same thing for spherical harmonics that are currently runnning at 1deg. +- other issue is that code relies on ocean funcion that does not change in + time. This is ok if we are sticking to 10-100 yr projections, but it's not + ok if we are targetting 1000 yrs projections where this would become an + issue. There is currently no solution to this matter. + +Here is the email referring to some of theses points: +Isabella, Eric: I've now modified the sea level code to include rotational +feedback. Before sending it to Isabella to be archived at Irvine, I have a +question. I'm not sure exactly what JPL wants to do with the code, but right +now it's set up to output changes in sea level as would be seen by a tide +gauge. That is, it outputs: (change in geocentric sea surface height) minus +(change in geocentric sea floor height). An altimeter sees, instead, just the +geocentric sea surface height. For the JPL applications you have in mind, +would you rather have the program output the latter (i.e. geocentric sea +surface height)? + +- John diff --git a/test/MITgcm/documents/README b/test/MITgcm/documents/README new file mode 100644 index 000000000..f1c37c61a --- /dev/null +++ b/test/MITgcm/documents/README @@ -0,0 +1,85 @@ +------------------------------------------------------------------------------ + +SLR +Sea Level Rise model: a framework for modeling sea level rise using +JPL/UCI software in ice sheet modeling (ISSM), post-glacial rebound (PGR +from Erik Ivins), ocean circulation (MITgcm) and sea-level models (UCI +model from J. Wahr and I. Velicogna and JPL Marsal model, Felix Landerer) + +------------------------------------------------------------------------------ + +Jet Propulsion Laboratory + +Eric Larour (ISSM project manager and SLR lead developer) +Erik Ivins (PGR lead developer) +Dimitris Menemenlis (ECCO-ICE PI and MITgcm developer) +Felix Landerer (MARSAL scientist/developer) +Isabella Velicogna (UCI SLM model, scientist/developer) + +Email: slr@jpl.nasa.gov + +------------------------------------------------------------------------------ + +Website: http://slr.jpl.nasa.gov/ for additional information. + +------------------------------------------------------------------------------ + +svn --username ????? co http://issm.ess.uci.edu/svn/slr + +will download this directory and subdirectories under a version system called svn. + +Once you have downloaded the slr code, you should add the following to your bashrc, or shrc or kshrc: +export SLR_DIR=$HOME/slr/ (update to your own directory) +source $SLR_DIR/etc/environment.sh + +if you are under tcsh or csh, do this to your .cshrc: +setenv SLR_DIR '/Users/larour/slr' (update to your own directory) +source $SLR_DIR/Etc/environment.sh + +Download and install ISSM as per instructions in +slr/components/issm/README + +What we have in the code right now: +README: this file +etc/ where we have our variable settings +components: where we have all our software ISSM, PGR, MITgcm, GEOS-5. +external packages: all our external libraries that we will be working with now. + +Web-based tracked svn changes are here: https://slr-svn.jpl.nasa.gov/trac/slr + +------------------------------------------------------------------------------ + +License + +SLR is California Institute of Technology Copyright + + +Copyright (c) 2002-2011, California Institute of Technology. +All rights reserved. Based on Government Sponsored Research under contracts +NAS7-1407 and/or NAS7-03001. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. +3. Neither the name of the California Institute of Technology (Caltech), + its operating division the Jet Propulsion Laboratory (JPL), the National + Aeronautics and Space Administration (NASA), nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE CALIFORNIA INSTITUTE OF TECHNOLOGY BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +------------------------------------------------------------------------------ diff --git a/test/MITgcm/documents/issm_helene_notes.docx b/test/MITgcm/documents/issm_helene_notes.docx new file mode 100644 index 0000000000000000000000000000000000000000..f9e86c7c4fcf50457b1992b568cbfa12e2b01f31 GIT binary patch literal 47076 zcmeFYWmp_*w=LQ@1b3GpAxI#&LkRA{-CY`Yf+Pe91b24`9^BpC-QC^&7VG==-Fuz0 z_Br?ezV$p!Ki&0KS25o?#~5?eTVJH0ps_%(Ab1c6^cJ-97Eaq10tA|Y0f8_<@Q|89 zHr9^D){eSLZnnk_+6=B>E3!;z$oJ_WNMQW`zx@x6KxOoRMaM@pksH5f-?8dh$@=#> zoqd^M#)M|~5J9ZY!dIUabi7yOljAWW@y=)QiV{3d@aG2gD#vLxeNe{}BQJwV`dV%2 zvh$_RS?+q%Byh-CzSCHyQ(D3su{O34N>8JF_P4;4WDXu{`a*Dv#ER(Wr1wWby;QwZ zRadd+ma*^~|FyeZv?gX-C+|B{W}-&Hu5DVA6FOdN@#K7o>-o!^-;v@emwU-1O0Hk@ z<=T@KBP#-(>OUHU(XB9J|6aWOk>I!nK^RJz-GAm&e2mCAAq6oPe|Ou*>O7Wn_5IDj z4na(pc@k7|bpd67O4?#_4bkV;(ro2171k(|9`ERm!7D6Y+EUbU4VTY9YE{rm@O^aNHP8L5&Z z42s?moHmZ_yJxlJb^Y|CN60|<$@uWqL<>XXc_(NaUx5AOt$L;InhjyHw%`RoSO0r` z#FFfzY65$p03ss-!9%#%*c&nat4NG&44uFLr@fNde-sP^z-Yke|JhqnbeU|&M=TK+ z%ICM|-Jce*-ovvUL5dUCe~OPVY~fTf`{t5N;jLy#mX*&jCO-hB%d%R+GSgiUxdc!wB)S%b#eGFyF0T3t-rwbplD z1&b;BD;?ql5;7qQ&Ay!HxPx8cDlI`+#^T-5Sxh;=&H^q|`+nK0ckcJjb=jSUQ`9cv6egfY2$c%#A#k@pH|U3Y9P{cW+JX zR~uA_-subQ{rTL2as5!TrIf30rK*;g(Wi_R5F14~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V+(%?X4uvN`?th%=KTwm$ORDwHqCBzeL=`-%qk_W$2iyyzaM zJZ!U_;>2wtm=K|8=9R0stA{4l6=nO;KnJJO;$4BlRJ*Zk6f7Mv9$7*C4&j=l92vPk zOe~9>18dA!22)kAq1P{+cqrWm1VukgnK%>C$v7e0}`Tm zTnt#$ydD7`$6rW|iUOAchvM(V;S@_^OZ4liTU>QhqSY?zSs7k~wgLUwGa5e!=+6R6 zBEPm|<~;0u;>oJ?avvR(ejrUByuGH(%|cs~g2x7;k$d=&tn+iySHNOq1?2X9`>`u0 zpTsG<`VD)v2)@-si?L>tg?9b;4yhz+6Y;RCf`VsA=c=$d>ai=I4>-o7^HC?**LUNO z0L+C#Sj?89d`9nS0epn%?Zn2!zB7fY-{F(=%**y;cM(+^lAQm<+qNy1yLMkL759dN z7kUtfvFd5|w}HJ+Qqo|rsbv|;sw&tQ6R-CMOAOak&F^Llchb@%gqJ@K*3uN6uPDP2 zAP5A_xG;A<58Z;Catcx>Zwl>e$hdY744D1MsCOw&IAlE3a3erfPAsf=XT0=*a2;~( zyG9h#4#Sq$!q(7GWA!1FrnsZB+jKQ2QCW?sCn3%IO(0;J1X*j6WoZVs@+B&u7rHnBZKmP6gcwkd*Wzf?F8aD zlb3<dM(@)A^KtU-<{+SeT z!DNbTe9oEv run.log + + +################# +08/17/21 +# upgrade svn +brew install svn + +# updated issm +cd /Users/dmenemen/mitgcm/slr/components/issm/trunk-jpl +#svn upgrade +svn up + +# followed instructions here: +# https://issm.jpl.nasa.gov/download/unix/ +# install Xcode from App Store + xcode-select --install + source $ISSM_DIR/etc/environment.sh + cd $ISSM_DIR/externalpackages/autotools + ./install-mac.sh + source $ISSM_DIR/etc/environment.sh + cd $ISSM_DIR/externalpackages/mpich + ./install-3.2-mac.sh + source $ISSM_DIR/etc/environment.sh + cd $ISSM_DIR/externalpackages/cmake + ./install.sh + source $ISSM_DIR/etc/environment.sh + cd $ISSM_DIR/externalpackages/petsc + ./install-3.14-mac.sh + source $ISSM_DIR/etc/environment.sh + cd $ISSM_DIR/externalpackages/m1qn3 + ./install.sh + source $ISSM_DIR/etc/environment.sh + cd $ISSM_DIR/externalpackages/triangle + ./install-mac.sh + source $ISSM_DIR/etc/environment.sh + +#cd /Applications/MATLAB_R2016b.app/bin/maci64/mexopts +#sudo chmod u+w clang++_maci64.xml +#sudo emacs clang++_maci64.xml +## add lines for MacOSX10.13.sdk, similar to lines for MacOSX10.12.sdk +## as per instructions here: https://issm.jpl.nasa.gov/documentation/faq/issm/ + +cd $ISSM_DIR +autoreconf -ivf +# create configure.sh as per instructions +ln -sf ../config-macosx64-devel.sh configure.sh +chmod u+x configure.sh +./configure.sh +make -j 8 +make install + + +################# +04/30/18 +# testing coupled code +# 4003 is the new set-up for Dan + +cd $ISSM_DIR +svn up + +# for complete recompilation if there are new code files +autoreconf -ivf +./configure.sh +make -j 8 +make install + +# recompilation for changes to existing code files +make install + +ml +cd /Users/dmenemen/mitgcm/slr/components/issm/trunk-jpl/test/NightlyRun +test4003 +quit + +cd $ISSM_DIR/test/MITgcm/code_4003 +emacs cpl_issm.F & + +# coupling rules live in: +emacs $ISSM_DIR/test/MITgcm/coupling_rules.txt + + +################# +04/30/18 +# testing coupled code +# 4002 is the old square configuration + +cd $ISSM_DIR +svn up + +# for complete recompilation if there are new code files +autoreconf -ivf +./configure.sh +make -j 8 +make install + +# recompilation for changes to existing code files +make install + +ml +cd /Users/dmenemen/mitgcm/slr/components/issm/trunk-jpl/test/NightlyRun +runme('id',4002,'benchmark','all') +% to update results: runme('id',4002,'benchmark','all','procedure','update') +quit + + +################# +02/21/18 +# coupling instructions in: +cd $ISSM_DIR/test/MITgcm +svn up +emacs coupling_rules.txt +svn commit + +# ignoring files in svn +# https://stackoverflow.com/questions/122313/how-do-you-include-exclude-a-certain-type-of-files-under-subversion +svn propedit svn:ignore . + + +################# +01/29/18 +# testing coupled code + +ml +cd /Users/dmenemen/mitgcm/slr/components/issm/trunk-jpl/test/NightlyRun +test4002 +quit + +cd $ISSM_DIR/test/NightlyRun/run +rm mitgcmuv +ln -sf $ISSM_DIR/test/MITgcm/build/mitgcmuv . + +cd $ISSM_DIR/test/MITgcm/code +emacs cpl_issm.F & + +cd $ISSM_DIR/test/MITgcm/build +make + +cd $ISSM_DIR/src/c/main +emacs issm_ocean.cpp + +cd $ISSM_DIR/src/c/cores +emacs transient_core.cpp + +cd $ISSM_DIR +make -j 8 install + +cd $ISSM_DIR/test/NightlyRun/run +rm STD* test4002.errlog test4002.out* [A-Z]*.??ta [a-o]*.??ta [q-z]*.??ta run.log +mpiexec -np 2 $ISSM_DIR/bin/issm_ocean.exe TransientSolution . test4002 : -np 8 ./mitgcmuv > run.log + + +################# +01/20/18 +# Eric's example +cd ~dmenemen/mitgcm/slr/IceOceanCoupling +rm -rf *.exe +mpif77 mitgcm.f -o mitgcm.exe +mpicc issm.cpp -o issm.exe +mpirun -np 4 ./issm.exe : -np 4 ./mitgcm.exe #watch out ice first, ocean second + + +################# +12/18/17 + +# the following: +cd $ISSM_DIR/test/NightlyRun/run +rm STD* test4002.errlog test4002.out* +mpiexec -np 2 $ISSM_DIR/bin/issm.exe TransientSolution pwd test4002 : -np 8 ./mitgcmuv + +# gets stuck in: +# $ISSM_DIR/test/MITgcm/build/eeboot_minimal.F +# OPEN(standardMessageUnit,FILE=fNam,STATUS='unknown') + + +################# +11/20/17 +# after running test4002, the following lines will start coupled code +cd $ISSM_DIR/test/NightlyRun/run +rm STD* +rm test4002.errlog +rm test4002.out* +mpiexec -np 2 $ISSM_DIR/bin/issm.exe TransientSolution pwd test4002 : -np 8 ./mitgcmuv + +# to edit issm_ocean +cd $ISSM_DIR/src/c/main +emacs issm_ocean.cpp + +# to compile coupled code (issm_ocean.exe), +# need to add --with-ocean="yes" to configure.sh +cd $ISSM_DIR +svn up +./configure.sh +make -j 8 +make install + +# to compile mitgcmuv +cd $ISSM_DIR/test/MITgcm/build +rm * +../install/tools/genmake2 -mpi -mo ../code -rd ../install +make depend +make -j 8 + +# running with issm_ocean.exe +cd $ISSM_DIR/test/NightlyRun/run +cp $ISSM_DIR/test/MITgcm/build/mitgcmuv . +rm STD* +mpirun -np 2 $ISSM_DIR/bin/issm_ocean.exe TransientSolution pwd test4002 : -np 8 ./mitgcmuv + + +################# +11/14/17 +# test4002 added by Helene +ml +cd /Users/dmenemen/mitgcm/slr/components/issm/trunk-jpl/test/NightlyRun +test4002 + + +################# +11/13/17 +# to update code +cd /Users/dmenemen/mitgcm/slr/components/issm/trunk-jpl +svn up +make install + +# need to add hostname as per instructions here: +# https://stackoverflow.com/questions/6484275/java-net-unknownhostexception-invalid-hostname-for-server-local +sudo emacs -nw /etc/hosts +# add LMC-051773 after localhost +127.0.0.1 localhost LMC-051773 + +# to test that it compile correctly +export CVSROOT=':pserver:cvsanon@mitgcm.org:/u/gcmpack' +cvs login # enter password: cvsanon +ml +cd /Users/dmenemen/mitgcm/slr/components/issm/trunk-jpl/test/NightlyRun +test101 +runme('id',101) +# this is the coupled code +test4001 +runme('id',4001,'benchmark','all') + +# to run outside of matlab +cd $ISSM_DIR/test/NightlyRun/run +cp $ISSM_DIR/execution/test4001-11-13-2017-14-32-57-52473/* . +mpiexec -np 2 $ISSM_DIR/bin/issm.exe TransientSolution $ISSM_DIR/test/NightlyRun/run test4001 : -np 8 ./mitgcmuv + +# the coupling code lives in +# /Users/dmenemen/mitgcm/slr/components/issm/trunk-jpl/src/c/main +# issm_ocean.cpp as opposed to issm.cpp + + +################# +10/30/17 +# upgrade svn (see mac.txt for details) + +# updated issm +cd /Users/dmenemen/mitgcm/slr/components/issm/trunk-jpl +#svn upgrade +svn up + +# followed instructions here: +# https://issm.jpl.nasa.gov/download/unix/ +# install Xcode from App Store + xcode-select --install + source $ISSM_DIR/etc/environment.sh + cd $ISSM_DIR/externalpackages/autotools + ./install.sh + source $ISSM_DIR/etc/environment.sh + cd $ISSM_DIR/externalpackages/mpich + ./install-3.2-mac.sh + source $ISSM_DIR/etc/environment.sh + cd $ISSM_DIR/externalpackages/cmake + ./install.sh + source $ISSM_DIR/etc/environment.sh + cd $ISSM_DIR/externalpackages/petsc + ./install-3.8-macosx64.sh + source $ISSM_DIR/etc/environment.sh + cd $ISSM_DIR/externalpackages/m1qn3 + ./install.sh + source $ISSM_DIR/etc/environment.sh + cd $ISSM_DIR/externalpackages/triangle + ./install-mac.sh + source $ISSM_DIR/etc/environment.sh + +#cd /Applications/MATLAB_R2016b.app/bin/maci64/mexopts +#sudo chmod u+w clang++_maci64.xml +#sudo emacs clang++_maci64.xml +## add lines for MacOSX10.13.sdk, similar to lines for MacOSX10.12.sdk +## as per instructions here: https://issm.jpl.nasa.gov/documentation/faq/issm/ + +cd $ISSM_DIR +autoreconf -ivf +# create configure.sh as per instructions +chmod u+x configure.sh +./configure.sh +make -j 8 +make install diff --git a/test/MITgcm/documents/notes_4003.txt b/test/MITgcm/documents/notes_4003.txt new file mode 100644 index 000000000..1b2acb9e3 --- /dev/null +++ b/test/MITgcm/documents/notes_4003.txt @@ -0,0 +1,28 @@ +fails @ step 11 +need to couple with Dan's code +check Helene's skype mail + +h0.bin is real*8 +you can read using: +h=readbin('h0.bin',[200 3],1,'real*8'); + +Grid information is in: +$ISSM_DIR/test/MITgcm/install_dngoldberg/verification/shelfice_remeshing/input/data + xgOrigin = -105.5, + delX=3*.125, + ygOrigin = -75.4457, + delY=200*.0078125, + +These coordinates indicate the southwest corners of the grid cells in degrees: +xg=-105.5:.125:-105.25; +yg=-75.4457:.0078125:-73.891; + +You can also find complete grid information in: +$ISSM_DIR/test/NightlyRun/run +after you run test4003.m +XG=readbin('XG.data',[3 200]); +YG=readbin('YG.data',[3 200]); + +This directory also contains all the information about center of grid cells, +and various distances (corner to corner, center to center, and face to face) +in m between the grid cells. From 540679cdffa17bb2e468148a567e356c3cb6eceb Mon Sep 17 00:00:00 2001 From: menemenlis Date: Fri, 11 Jul 2025 17:11:24 -0700 Subject: [PATCH 054/126] more ISSM/MITgcm files from the old svn slr repo --- test/MITgcm/documents/READMEissm | 276 ++++++++++++++++++ test/MITgcm/documents/{README => READMEslr} | 0 .../documents/config-macosx64-devel-triton.sh | 18 ++ .../MITgcm/documents/config-macosx64-devel.sh | 18 ++ .../documents/config-macosx64-nodakota.sh | 15 + 5 files changed, 327 insertions(+) create mode 100644 test/MITgcm/documents/READMEissm rename test/MITgcm/documents/{README => READMEslr} (100%) create mode 100644 test/MITgcm/documents/config-macosx64-devel-triton.sh create mode 100644 test/MITgcm/documents/config-macosx64-devel.sh create mode 100644 test/MITgcm/documents/config-macosx64-nodakota.sh diff --git a/test/MITgcm/documents/READMEissm b/test/MITgcm/documents/READMEissm new file mode 100644 index 000000000..b3459c271 --- /dev/null +++ b/test/MITgcm/documents/READMEissm @@ -0,0 +1,276 @@ +# In order to install ISSM, the Ice Sheet System Model, +# download from the svn repository: +svn co https://issm.ess.uci.edu/svn/issm/issm/trunk-jpl + +# If you have an already existing trunk-jpl installation, +# you can symlink to it: +ln -s PATH_TO_TRUNK_JPL ./trunk-jpl + +# Then follow instructions in: +# http://issm.jpl.nasa.gov/download/unix/ + + +# ========= +# Installation instructions on macOS Mojave 10.14.4 + +* create an ISSM_DIR in you bashrc and source it +export ISSM_DIR="/Users/XXX/issm/trunk-jpl/" +source "$ISSM_DIR"/etc/environment.sh + +* checkout empty issm directory: +svn co --username=username --depth=empty http://issm.ess.uci.edu/svn/issm/issm issm +* get jpl trunk (development branch) in issm directory: +svn update trunk-jpl + +* get xcode +* install command line xcode +xcode-select --install + +* install gfortran binaries: on https://gcc.gnu.org/wiki/GFortranBinaries#MacOS +* use the first one on git (https://github.com/fxcoudert/gfortran-for-macOS/releases) + +* Install Matlab +* In ~/matlab/startup.m add: +% ISSM paths +ISSM_DIR=getenv('ISSM_DIR'); +if length(ISSM_DIR)>0 + addpath([ISSM_DIR '/bin/']); + addpath([ISSM_DIR '/lib/'],[ISSM_DIR '/scripts']); + addpath([ISSM_DIR '/src/m/dev']); + devpath; +end + +* in ISSM, install the following external packages (so in trunk-jpl/externalpackages) in this order: +- autotools +- mpich (version 3.2 macosx64) +- cmake +- petsc (version 3.9 macosx64) +- m1qn3 +- triangle +between each package installed you should source the environment +source $ISSM_DIR/etc/environment.sh + +* Reconfigure ISSM: +cd $ISSM_DIR +autoreconf -ivf +* Create a configure.sh file in $ISSM_DIR with the following lines (adjust the paths if need be): +#!/bin/bash + +./configure \ + --prefix=$ISSM_DIR \ + --with-matlab-dir="/Applications/MATLAB_R2018b.app/" \ + --with-triangle-dir="$ISSM_DIR/externalpackages/triangle/install" \ + --with-mpi-include="$ISSM_DIR/externalpackages/mpich/install/include" \ + --with-mpi-libflags="-L$ISSM_DIR/externalpackages/mpich/install/lib/ -lmpich" \ + --with-petsc-dir="$ISSM_DIR/externalpackages/petsc/install" \ + --with-metis-dir="$ISSM_DIR/externalpackages/petsc/install" \ + --with-scalapack-dir="$ISSM_DIR/externalpackages/petsc/install/" \ + --with-mumps-dir="$ISSM_DIR/externalpackages/petsc/install/" \ + --with-m1qn3-dir="$ISSM_DIR/externalpackages/m1qn3/install" \ + --with-ocean="yes" \ + --with-numthreads=4 \ + --enable-development \ + --enable-debugging + +* Configure ISSM in $ISSM_DIR: +./configure.sh + +* Compile ISSM in $ISSM_DIR: +make -j8 +make install + + +# ========= +# Installation instructions on macOS High Sierra 10.13.6 + +# Install Xcode from Mac App Store then +xcode-select --install + +# Install gfrotran 5.2 +# https://gcc.gnu.org/wiki/GFortranBinaries +# http://coudert.name/software/gfortran-5.2-Yosemite.dmg + +# Install cmake-3.4.0 +# https://cmake.org/download/ +# https://cmake.org/files/v3.4/cmake-3.4.0-Darwin-x86_64.dmg +cd /usr/local/bin +sudo ln -sf /Applications/Utilities/CMake.app/Contents/bin/cmake . + +# In .bashrc add: +# export ISSM_DIR='/PUT_FULL_ISSM_PATHNAME_HERE/trunk-jpl' +# source $ISSM_DIR/etc/environment.sh + +cd $ISSM_DIR +svn up +source $ISSM_DIR/etc/environment.sh + +cd externalpackages +mkdir matlab +cd matlab +ln -sf /Applications/MATLAB_R2016b.app install + +# add 10.13 lines similar to 10.10 lines in +# /Applications/MATLAB_R2015b.app/bin/maci64/mexopts/*.xml + +# http://issm.jpl.nasa.gov/documentation/faq/matlab/ +cp /Applications/MATLAB_R2016b.app/bin/.matlab7rc.sh ~ +# under mac|maci|maci64) +# change: # LDPATH_PREFIX='$MATLAB/sys/opengl/lib/$ARCH' +# to: LDPATH_PREFIX='/usr/local/gfortran/lib' + +# In ~/matlab/startup.m add: +# % ISSM paths +# ISSM_DIR=getenv('ISSM_DIR'); +# if length(ISSM_DIR)>0 +# addpath([ISSM_DIR '/bin/']); +# addpath([ISSM_DIR '/lib/'],[ISSM_DIR '/scripts']); +# addpath([ISSM_DIR '/src/m/dev']); +# devpath; +# end + +cd ../autotools/ +./install.sh +source $ISSM_DIR/etc/environment.sh + +cd ../mpich +install-3.2-macosx64.sh +source $ISSM_DIR/etc/environment.sh + +cd ../petsc +install-3.9-macosx64.sh +source $ISSM_DIR/etc/environment.sh + +cd ../triangle +install-macosx64.sh +source $ISSM_DIR/etc/environment.sh + +cd ../m1qn3 +install.sh +source $ISSM_DIR/etc/environment.sh + +cd $ISSM_DIR +autoreconf -ivf +../config-macosx64-nodakota.sh +make -j 8 install + + +# ========= +# Installation instructions on Mac OS X El Capitan 10.11.1 + +# Install gfrotran 5.2 +# https://gcc.gnu.org/wiki/GFortranBinaries +# http://coudert.name/software/gfortran-5.2-Yosemite.dmg + +# Install cmake-3.4.0 +# https://cmake.org/download/ +# https://cmake.org/files/v3.4/cmake-3.4.0-Darwin-x86_64.dmg +cd /usr/local/bin +sudo ln -sf /Applications/Utilities/CMake.app/Contents/bin/cmake . + +# In .bashrc add: +# export ISSM_DIR='/PUT_FULL_ISSM_PATHNAME_HERE/trunk-jpl' +# source $ISSM_DIR/etc/environment.sh + +cd $ISSM_DIR +svn up +source $ISSM_DIR/etc/environment.sh + +cd externalpackages/matlab +ln -sf /Applications/MATLAB_R2015b.app install + +# replace 10.10 with 10.11 in +# /Applications/MATLAB_R2015b.app/bin/maci64/mexopts/*.xml + +# http://issm.jpl.nasa.gov/documentation/faq/matlab/ +cp /Applications/MATLAB_R2015b.app/bin/.matlab7rc.sh ~ +# under mac|maci|maci64) +# change: # LDPATH_PREFIX='$MATLAB/sys/opengl/lib/$ARCH' +# to: LDPATH_PREFIX='/usr/local/gfortran/lib' + +# In ~/matlab/startup.m add: +# % ISSM paths +# ISSM_DIR=getenv('ISSM_DIR'); +# if length(ISSM_DIR)>0 +# addpath([ISSM_DIR '/bin/'],[ISSM_DIR '/lib/']); +# addpath([ISSM_DIR '/scripts'],[ISSM_DIR '/src/m/dev']); +# devpath; +# end + +cd ../autotools/ +./install.sh +source $ISSM_DIR/etc/environment.sh + +cd ../mpich +install-3.0-macosx64-elcapitan.sh 8 +source $ISSM_DIR/etc/environment.sh + +cd ../petsc +install-3.6-macosx64.sh +source $ISSM_DIR/etc/environment.sh + +cd ../triangle +install-macosx64.sh +source $ISSM_DIR/etc/environment.sh + +cd ../m1qn3 +install.sh +source $ISSM_DIR/etc/environment.sh + +cd $ISSM_DIR +./scripts/automakererun.sh +../config-macosx64-nodakota.sh +make -j 8 install + + +#========= +Installation instructions on skylla + +# In .bashrc add: +# export ISSM_DIR=$SLR_DIR/components/issm/trunk-jpl +# source $ISSM_DIR/etc/environment.sh +# export ISSM_ARCH="linux-gnu-amd64" + +# make sure you are in the bash shell + +bash + +cd $ISSM_DIR +#svn up -r 17578 +source $ISSM_DIR/etc/environment.sh + +cd externalpackages/matlab +ln -sf /usr/local/matlab.2010b install + +cd ../autotools/ +./install.sh +source $ISSM_DIR/etc/environment.sh + +cd ../cmake +./install.sh +source $ISSM_DIR/etc/environment.sh + +cd ../mpich +./install-3.0-linux64.sh +source $ISSM_DIR/etc/environment.sh + +cd ../petsc +./install-3.4-linux64.sh +source $ISSM_DIR/etc/environment.sh + +cd ../tao +svn up +./install-2.2.sh +source $ISSM_DIR/etc/environment.sh + +cd ../triangle +./install-linux64.sh +source $ISSM_DIR/etc/environment.sh + +cd $ISSM_DIR +./scripts/automakererun.sh +./configs/config-linux64-skylla.sh +make -j 8 install + +# In ~/matlab/startup.m add: +# ISSM_DIR=getenv('ISSM_DIR'); +# addpath([ISSM_DIR '/bin/'],[ISSM_DIR '/lib/'],[ISSM_DIR '/scripts']); diff --git a/test/MITgcm/documents/README b/test/MITgcm/documents/READMEslr similarity index 100% rename from test/MITgcm/documents/README rename to test/MITgcm/documents/READMEslr diff --git a/test/MITgcm/documents/config-macosx64-devel-triton.sh b/test/MITgcm/documents/config-macosx64-devel-triton.sh new file mode 100644 index 000000000..6a5afd191 --- /dev/null +++ b/test/MITgcm/documents/config-macosx64-devel-triton.sh @@ -0,0 +1,18 @@ +#!/bin/bash + +./configure \ + --prefix=$ISSM_DIR \ + --with-matlab-dir="/Applications/MATLAB_R2019a.app/" \ + --with-triangle-dir="$ISSM_DIR/externalpackages/triangle/install" \ + --with-mpi-include="$ISSM_DIR/externalpackages/petsc/install/include" \ + --with-mpi-libflags="-L$ISSM_DIR/externalpackages/petsc/install/lib/ -lmpich" \ + --with-petsc-dir="$ISSM_DIR/externalpackages/petsc/install" \ + --with-metis-dir="$ISSM_DIR/externalpackages/petsc/install" \ + --with-scalapack-dir="$ISSM_DIR/externalpackages/petsc/install/" \ + --with-mumps-dir="$ISSM_DIR/externalpackages/petsc/install/" \ + --with-m1qn3-dir="$ISSM_DIR/externalpackages/m1qn3/install" \ + --with-ocean="yes" \ + --with-numthreads=8 \ + --with-cxxoptflags=" -D_DO_NOT_LOAD_GLOBALS_ -g -O2 -std=c++11" \ + --enable-development \ + --enable-debugging diff --git a/test/MITgcm/documents/config-macosx64-devel.sh b/test/MITgcm/documents/config-macosx64-devel.sh new file mode 100644 index 000000000..87ed6a968 --- /dev/null +++ b/test/MITgcm/documents/config-macosx64-devel.sh @@ -0,0 +1,18 @@ +#!/bin/bash + +./configure \ + --prefix=$ISSM_DIR \ + --with-matlab-dir="/Applications/MATLAB_R2019b.app/" \ + --with-triangle-dir="$ISSM_DIR/externalpackages/triangle/install" \ + --with-mpi-include="$ISSM_DIR/externalpackages/mpich/install/include" \ + --with-mpi-libflags="-L$ISSM_DIR/externalpackages/mpich/install/lib/ -lmpich" \ + --with-petsc-dir="$ISSM_DIR/externalpackages/petsc/install" \ + --with-metis-dir="$ISSM_DIR/externalpackages/petsc/install" \ + --with-scalapack-dir="$ISSM_DIR/externalpackages/petsc/install/" \ + --with-mumps-dir="$ISSM_DIR/externalpackages/petsc/install/" \ + --with-m1qn3-dir="$ISSM_DIR/externalpackages/m1qn3/install" \ + --with-ocean="yes" \ + --with-numthreads=8 \ + --with-cxxoptflags=" -D_DO_NOT_LOAD_GLOBALS_ -g -O2 -std=c++11" \ + --enable-development \ + --enable-debugging diff --git a/test/MITgcm/documents/config-macosx64-nodakota.sh b/test/MITgcm/documents/config-macosx64-nodakota.sh new file mode 100644 index 000000000..486047339 --- /dev/null +++ b/test/MITgcm/documents/config-macosx64-nodakota.sh @@ -0,0 +1,15 @@ +#!/bin/bash + +./configure \ + --prefix=$ISSM_DIR \ + --with-matlab-dir="$ISSM_DIR/externalpackages/matlab/install" \ + --with-triangle-dir="$ISSM_DIR/externalpackages/triangle/install" \ + --with-mpi-include="$ISSM_DIR/externalpackages/mpich/install/include" \ + --with-mpi-libflags="-L$ISSM_DIR/externalpackages/mpich/install/lib/ -lmpich" \ + --with-petsc-dir="$ISSM_DIR/externalpackages/petsc/install" \ + --with-metis-dir="$ISSM_DIR/externalpackages/petsc/install" \ + --with-scalapack-dir="$ISSM_DIR/externalpackages/petsc/install/" \ + --with-mumps-dir="$ISSM_DIR/externalpackages/petsc/install/" \ + --with-m1qn3-dir="$ISSM_DIR/externalpackages/m1qn3/install" \ + --with-ocean="yes" \ + --with-numthreads=8 From 6ade8fe79b12ef73cd1784ea79f7bc75d20de70f Mon Sep 17 00:00:00 2001 From: menemenlis Date: Fri, 11 Jul 2025 18:01:46 -0700 Subject: [PATCH 055/126] adding instructions for compiling "with-ocean" --- test/MITgcm/documents/READMEissm | 319 +++--------------- test/MITgcm/documents/config-macOS-arm64.sh | 16 + .../documents/config-macosx64-devel-triton.sh | 18 - 3 files changed, 59 insertions(+), 294 deletions(-) create mode 100644 test/MITgcm/documents/config-macOS-arm64.sh delete mode 100644 test/MITgcm/documents/config-macosx64-devel-triton.sh diff --git a/test/MITgcm/documents/READMEissm b/test/MITgcm/documents/READMEissm index b3459c271..b27cc7fdd 100644 --- a/test/MITgcm/documents/READMEissm +++ b/test/MITgcm/documents/READMEissm @@ -1,276 +1,43 @@ -# In order to install ISSM, the Ice Sheet System Model, -# download from the svn repository: -svn co https://issm.ess.uci.edu/svn/issm/issm/trunk-jpl - -# If you have an already existing trunk-jpl installation, -# you can symlink to it: -ln -s PATH_TO_TRUNK_JPL ./trunk-jpl - -# Then follow instructions in: -# http://issm.jpl.nasa.gov/download/unix/ - - -# ========= -# Installation instructions on macOS Mojave 10.14.4 - -* create an ISSM_DIR in you bashrc and source it -export ISSM_DIR="/Users/XXX/issm/trunk-jpl/" -source "$ISSM_DIR"/etc/environment.sh - -* checkout empty issm directory: -svn co --username=username --depth=empty http://issm.ess.uci.edu/svn/issm/issm issm -* get jpl trunk (development branch) in issm directory: -svn update trunk-jpl - -* get xcode -* install command line xcode -xcode-select --install - -* install gfortran binaries: on https://gcc.gnu.org/wiki/GFortranBinaries#MacOS -* use the first one on git (https://github.com/fxcoudert/gfortran-for-macOS/releases) - -* Install Matlab -* In ~/matlab/startup.m add: -% ISSM paths -ISSM_DIR=getenv('ISSM_DIR'); -if length(ISSM_DIR)>0 - addpath([ISSM_DIR '/bin/']); - addpath([ISSM_DIR '/lib/'],[ISSM_DIR '/scripts']); - addpath([ISSM_DIR '/src/m/dev']); - devpath; -end - -* in ISSM, install the following external packages (so in trunk-jpl/externalpackages) in this order: -- autotools -- mpich (version 3.2 macosx64) -- cmake -- petsc (version 3.9 macosx64) -- m1qn3 -- triangle -between each package installed you should source the environment -source $ISSM_DIR/etc/environment.sh - -* Reconfigure ISSM: -cd $ISSM_DIR -autoreconf -ivf -* Create a configure.sh file in $ISSM_DIR with the following lines (adjust the paths if need be): -#!/bin/bash - -./configure \ - --prefix=$ISSM_DIR \ - --with-matlab-dir="/Applications/MATLAB_R2018b.app/" \ - --with-triangle-dir="$ISSM_DIR/externalpackages/triangle/install" \ - --with-mpi-include="$ISSM_DIR/externalpackages/mpich/install/include" \ - --with-mpi-libflags="-L$ISSM_DIR/externalpackages/mpich/install/lib/ -lmpich" \ - --with-petsc-dir="$ISSM_DIR/externalpackages/petsc/install" \ - --with-metis-dir="$ISSM_DIR/externalpackages/petsc/install" \ - --with-scalapack-dir="$ISSM_DIR/externalpackages/petsc/install/" \ - --with-mumps-dir="$ISSM_DIR/externalpackages/petsc/install/" \ - --with-m1qn3-dir="$ISSM_DIR/externalpackages/m1qn3/install" \ - --with-ocean="yes" \ - --with-numthreads=4 \ - --enable-development \ - --enable-debugging - -* Configure ISSM in $ISSM_DIR: -./configure.sh - -* Compile ISSM in $ISSM_DIR: -make -j8 -make install - - -# ========= -# Installation instructions on macOS High Sierra 10.13.6 - -# Install Xcode from Mac App Store then -xcode-select --install - -# Install gfrotran 5.2 -# https://gcc.gnu.org/wiki/GFortranBinaries -# http://coudert.name/software/gfortran-5.2-Yosemite.dmg - -# Install cmake-3.4.0 -# https://cmake.org/download/ -# https://cmake.org/files/v3.4/cmake-3.4.0-Darwin-x86_64.dmg -cd /usr/local/bin -sudo ln -sf /Applications/Utilities/CMake.app/Contents/bin/cmake . - -# In .bashrc add: -# export ISSM_DIR='/PUT_FULL_ISSM_PATHNAME_HERE/trunk-jpl' -# source $ISSM_DIR/etc/environment.sh - -cd $ISSM_DIR -svn up -source $ISSM_DIR/etc/environment.sh - -cd externalpackages -mkdir matlab -cd matlab -ln -sf /Applications/MATLAB_R2016b.app install - -# add 10.13 lines similar to 10.10 lines in -# /Applications/MATLAB_R2015b.app/bin/maci64/mexopts/*.xml - -# http://issm.jpl.nasa.gov/documentation/faq/matlab/ -cp /Applications/MATLAB_R2016b.app/bin/.matlab7rc.sh ~ -# under mac|maci|maci64) -# change: # LDPATH_PREFIX='$MATLAB/sys/opengl/lib/$ARCH' -# to: LDPATH_PREFIX='/usr/local/gfortran/lib' - -# In ~/matlab/startup.m add: -# % ISSM paths -# ISSM_DIR=getenv('ISSM_DIR'); -# if length(ISSM_DIR)>0 -# addpath([ISSM_DIR '/bin/']); -# addpath([ISSM_DIR '/lib/'],[ISSM_DIR '/scripts']); -# addpath([ISSM_DIR '/src/m/dev']); -# devpath; -# end - -cd ../autotools/ -./install.sh -source $ISSM_DIR/etc/environment.sh - -cd ../mpich -install-3.2-macosx64.sh -source $ISSM_DIR/etc/environment.sh - -cd ../petsc -install-3.9-macosx64.sh -source $ISSM_DIR/etc/environment.sh - -cd ../triangle -install-macosx64.sh -source $ISSM_DIR/etc/environment.sh - -cd ../m1qn3 -install.sh -source $ISSM_DIR/etc/environment.sh - -cd $ISSM_DIR -autoreconf -ivf -../config-macosx64-nodakota.sh -make -j 8 install - - -# ========= -# Installation instructions on Mac OS X El Capitan 10.11.1 - -# Install gfrotran 5.2 -# https://gcc.gnu.org/wiki/GFortranBinaries -# http://coudert.name/software/gfortran-5.2-Yosemite.dmg - -# Install cmake-3.4.0 -# https://cmake.org/download/ -# https://cmake.org/files/v3.4/cmake-3.4.0-Darwin-x86_64.dmg -cd /usr/local/bin -sudo ln -sf /Applications/Utilities/CMake.app/Contents/bin/cmake . - -# In .bashrc add: -# export ISSM_DIR='/PUT_FULL_ISSM_PATHNAME_HERE/trunk-jpl' -# source $ISSM_DIR/etc/environment.sh - -cd $ISSM_DIR -svn up -source $ISSM_DIR/etc/environment.sh - -cd externalpackages/matlab -ln -sf /Applications/MATLAB_R2015b.app install - -# replace 10.10 with 10.11 in -# /Applications/MATLAB_R2015b.app/bin/maci64/mexopts/*.xml - -# http://issm.jpl.nasa.gov/documentation/faq/matlab/ -cp /Applications/MATLAB_R2015b.app/bin/.matlab7rc.sh ~ -# under mac|maci|maci64) -# change: # LDPATH_PREFIX='$MATLAB/sys/opengl/lib/$ARCH' -# to: LDPATH_PREFIX='/usr/local/gfortran/lib' - -# In ~/matlab/startup.m add: -# % ISSM paths -# ISSM_DIR=getenv('ISSM_DIR'); -# if length(ISSM_DIR)>0 -# addpath([ISSM_DIR '/bin/'],[ISSM_DIR '/lib/']); -# addpath([ISSM_DIR '/scripts'],[ISSM_DIR '/src/m/dev']); -# devpath; -# end - -cd ../autotools/ -./install.sh -source $ISSM_DIR/etc/environment.sh - -cd ../mpich -install-3.0-macosx64-elcapitan.sh 8 -source $ISSM_DIR/etc/environment.sh - -cd ../petsc -install-3.6-macosx64.sh -source $ISSM_DIR/etc/environment.sh - -cd ../triangle -install-macosx64.sh -source $ISSM_DIR/etc/environment.sh - -cd ../m1qn3 -install.sh -source $ISSM_DIR/etc/environment.sh - -cd $ISSM_DIR -./scripts/automakererun.sh -../config-macosx64-nodakota.sh -make -j 8 install - - -#========= -Installation instructions on skylla - -# In .bashrc add: -# export ISSM_DIR=$SLR_DIR/components/issm/trunk-jpl -# source $ISSM_DIR/etc/environment.sh -# export ISSM_ARCH="linux-gnu-amd64" - -# make sure you are in the bash shell - -bash - -cd $ISSM_DIR -#svn up -r 17578 -source $ISSM_DIR/etc/environment.sh - -cd externalpackages/matlab -ln -sf /usr/local/matlab.2010b install - -cd ../autotools/ -./install.sh -source $ISSM_DIR/etc/environment.sh - -cd ../cmake -./install.sh -source $ISSM_DIR/etc/environment.sh - -cd ../mpich -./install-3.0-linux64.sh -source $ISSM_DIR/etc/environment.sh - -cd ../petsc -./install-3.4-linux64.sh -source $ISSM_DIR/etc/environment.sh - -cd ../tao -svn up -./install-2.2.sh -source $ISSM_DIR/etc/environment.sh - -cd ../triangle -./install-linux64.sh -source $ISSM_DIR/etc/environment.sh - -cd $ISSM_DIR -./scripts/automakererun.sh -./configs/config-linux64-skylla.sh -make -j 8 install - -# In ~/matlab/startup.m add: -# ISSM_DIR=getenv('ISSM_DIR'); -# addpath([ISSM_DIR '/bin/'],[ISSM_DIR '/lib/'],[ISSM_DIR '/scripts']); +# Install ISSM: https://issm.jpl.nasa.gov/download/ + +# get Xcode +# install command line xcode + xcode-select --install + +# get ISSM repo + cd + mkdir issm + cd issm + git clone git@github.com:ISSMteam/ISSM.git + +# add to ~/.zshrc + export ISSM_DIR='/Users/dmenemen/issm/ISSM' + source $ISSM_DIR/etc/environment.sh + +# https://issm.jpl.nasa.gov/download/unix/ + cd $ISSM_DIR/externalpackages/autotools + install-mac.sh + source $ISSM_DIR/etc/environment.sh + cd $ISSM_DIR/externalpackages/cmake + install.sh + source $ISSM_DIR/etc/environment.sh + cd $ISSM_DIR/externalpackages/petsc + install-3.22-mac.sh + source $ISSM_DIR/etc/environment.sh + cd $ISSM_DIR/externalpackages/triangle + install-mac.sh + source $ISSM_DIR/etc/environment.sh + cd $ISSM_DIR/externalpackages/m1qn3 + install-mac.sh + source $ISSM_DIR/etc/environment.sh + cd $ISSM_DIR + autoreconf -ivf + +# create configure.sh as per instructions +# or get from test/MITgcm/documents/config-macOS-arm64.sh + cd $ISSM_DIR + cp test/MITgcm/documents/config-macOS-arm64.sh configure.sh + chmod a+x configure.sh + ./configure.sh + make + make install diff --git a/test/MITgcm/documents/config-macOS-arm64.sh b/test/MITgcm/documents/config-macOS-arm64.sh new file mode 100644 index 000000000..04b569a8f --- /dev/null +++ b/test/MITgcm/documents/config-macOS-arm64.sh @@ -0,0 +1,16 @@ +./configure \ + --prefix=${ISSM_DIR} \ + --with-numthreads=2 \ + --with-matlab-dir="/Applications/MATLAB_R2025a.app" \ + --with-fortran-lib="-L/opt/homebrew/Cellar/gcc/15.1.0/lib/gcc/current -lgfortran" \ + --with-mpi-include="${ISSM_DIR}/externalpackages/petsc/install/include" \ + --with-mpi-libflags="-L${ISSM_DIR}/externalpackages/petsc/install/lib -lmpi -lmpicxx -lmpifort" \ + --with-metis-dir="${ISSM_DIR}/externalpackages/petsc/install" \ + --with-parmetis-dir="${ISSM_DIR}/externalpackages/petsc/install" \ + --with-blas-lapack-dir="${ISSM_DIR}/externalpackages/petsc/install" \ + --with-scalapack-dir="${ISSM_DIR}/externalpackages/petsc/install" \ + --with-mumps-dir="${ISSM_DIR}/externalpackages/petsc/install" \ + --with-petsc-dir="${ISSM_DIR}/externalpackages/petsc/install" \ + --with-triangle-dir="${ISSM_DIR}/externalpackages/triangle/install" \ + --with-m1qn3-dir="${ISSM_DIR}/externalpackages/m1qn3/install" \ + --with-ocean="yes" diff --git a/test/MITgcm/documents/config-macosx64-devel-triton.sh b/test/MITgcm/documents/config-macosx64-devel-triton.sh deleted file mode 100644 index 6a5afd191..000000000 --- a/test/MITgcm/documents/config-macosx64-devel-triton.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/bash - -./configure \ - --prefix=$ISSM_DIR \ - --with-matlab-dir="/Applications/MATLAB_R2019a.app/" \ - --with-triangle-dir="$ISSM_DIR/externalpackages/triangle/install" \ - --with-mpi-include="$ISSM_DIR/externalpackages/petsc/install/include" \ - --with-mpi-libflags="-L$ISSM_DIR/externalpackages/petsc/install/lib/ -lmpich" \ - --with-petsc-dir="$ISSM_DIR/externalpackages/petsc/install" \ - --with-metis-dir="$ISSM_DIR/externalpackages/petsc/install" \ - --with-scalapack-dir="$ISSM_DIR/externalpackages/petsc/install/" \ - --with-mumps-dir="$ISSM_DIR/externalpackages/petsc/install/" \ - --with-m1qn3-dir="$ISSM_DIR/externalpackages/m1qn3/install" \ - --with-ocean="yes" \ - --with-numthreads=8 \ - --with-cxxoptflags=" -D_DO_NOT_LOAD_GLOBALS_ -g -O2 -std=c++11" \ - --enable-development \ - --enable-debugging From 9955e05e114f16fd4b8e673ddd3bb13372bedc87 Mon Sep 17 00:00:00 2001 From: Tidbit Software <34657535+TidbitSoftware@users.noreply.github.com> Date: Wed, 16 Jul 2025 14:41:02 -0700 Subject: [PATCH 056/126] Updated recipes for Pleiades --- jenkins/pleiades-basic | 12 ++++++------ jenkins/pleiades-dakota | 16 ++++++++-------- jenkins/pleiades-solid_earth | 16 ++++++++-------- 3 files changed, 22 insertions(+), 22 deletions(-) diff --git a/jenkins/pleiades-basic b/jenkins/pleiades-basic index fe75ec81e..45c7202e0 100755 --- a/jenkins/pleiades-basic +++ b/jenkins/pleiades-basic @@ -2,8 +2,8 @@ # Environment # #-------------# -export CFLAGS="-O3" -export CXXFLAGS="-O3 -std=c++11" +export CFLAGS="-g -Ofast" +export CXXFLAGS="-g -Ofast -xCORE-AVX512,CORE-AVX2 -xAVX -std=c++11" #--------------------# # ISSM Configuration # @@ -14,11 +14,10 @@ ISSM_CONFIG='\ --enable-development \ --enable-standalone-libraries \ --with-wrappers=no \ - --with-graphics-lib="/usr/lib64/libX11.so" \ --with-fortran-lib="-L${COMP_INTEL_ROOT}/compiler/lib/intel64_lin -lifcore -lifport -lgfortran" \ --with-mkl-libflags="-L${COMP_INTEL_ROOT}/mkl/lib/intel64 -lmkl_intel_lp64 -lmkl_sequential -lmkl_core -lpthread -lm" \ - --with-mpi-include="/nasa/hpe/mpt/2.30_rhel810/include" \ - --with-mpi-libflags="-L/nasa/hpe/mpt/2.30_rhel810/lib -lmpi" \ + --with-mpi-include="${MPI_ROOT}/include" \ + --with-mpi-libflags="-L${MPI_ROOT}/lib -lmpi" \ --with-blas-lapack-lib="-L${COMP_INTEL_ROOT}/mkl/lib/intel64 -lmkl_blas95_lp64 -lmkl_lapack95_lp64" \ --with-metis-dir="${PETSC_DIR}" \ --with-parmetis-dir="${PETSC_DIR}" \ @@ -35,6 +34,7 @@ ISSM_CONFIG='\ #-------------------# EXTERNALPACKAGES=" + autotools install-linux.sh triangle install-linux.sh m1qn3 install-linux.sh semic install.sh @@ -55,7 +55,7 @@ EXAMPLES_TEST=0 # NOTE: One is usually safer as some packages are very sensitive to parallel # compilation. # -NUMCPUS_INSTALL=8 +NUMCPUS_INSTALL=4 # Number of CPUs used in the nightly runs NUMCPUS_RUN=1 diff --git a/jenkins/pleiades-dakota b/jenkins/pleiades-dakota index 02e556919..c1fc973a0 100755 --- a/jenkins/pleiades-dakota +++ b/jenkins/pleiades-dakota @@ -2,8 +2,8 @@ # Environment # #-------------# -export CFLAGS="-O3" -export CXXFLAGS="-O3 -std=c++11" +export CFLAGS="-g -Ofast" +export CXXFLAGS="-g -Ofast -xCORE-AVX512,CORE-AVX2 -xAVX -std=c++11" #--------------------# # ISSM Configuration # @@ -14,16 +14,15 @@ ISSM_CONFIG='\ --enable-development \ --enable-standalone-libraries \ --with-wrappers=no \ - --with-graphics-lib="/usr/lib64/libX11.so" \ --with-fortran-lib="-L${COMP_INTEL_ROOT}/compiler/lib/intel64_lin -lifcore -lifport -lgfortran" \ --with-mkl-libflags="-L${COMP_INTEL_ROOT}/mkl/lib/intel64 -lmkl_intel_lp64 -lmkl_sequential -lmkl_core -lpthread -lm" \ - --with-mpi-include="${COMP_INTEL_ROOT}/mpi/intel64/include" \ - --with-mpi-libflags="-lmpi" \ + --with-mpi-include="${MPI_ROOT}/include" \ + --with-mpi-libflags="-L${MPI_ROOT}/lib -lmpi" \ --with-blas-lapack-lib="-L${COMP_INTEL_ROOT}/mkl/lib/intel64 -lmkl_blas95_lp64 -lmkl_lapack95_lp64" \ --with-metis-dir="${PETSC_DIR}" \ --with-parmetis-dir="${PETSC_DIR}" \ - --with-mumps-dir="${PETSC_DIR}" \ --with-scalapack-lib="-L${COMP_INTEL_ROOT}/mkl/lib/intel64/libmkl_scalapack_lp64.so" \ + --with-mumps-dir="${PETSC_DIR}" \ --with-petsc-dir="${PETSC_DIR}" \ --with-boost-dir="${ISSM_DIR}/externalpackages/boost/install" \ --with-dakota-dir="${ISSM_DIR}/externalpackages/dakota/install" \ @@ -38,10 +37,11 @@ ISSM_CONFIG='\ #-------------------# EXTERNALPACKAGES=" + autotools install-linux.sh boost install-1.7-linux.sh dakota install-6.2-pleiades.sh chaco install-linux.sh - triangle install-linux.sh + triangle install-linux.shwhic m1qn3 install-linux.sh semic install.sh " @@ -61,7 +61,7 @@ EXAMPLES_TEST=0 # NOTE: One is usually safer as some packages are very sensitive to parallel # compilation. # -NUMCPUS_INSTALL=8 +NUMCPUS_INSTALL=4 # Number of CPUs used in the nightly runs NUMCPUS_RUN=1 diff --git a/jenkins/pleiades-solid_earth b/jenkins/pleiades-solid_earth index 08f14ed67..f7e66d9e8 100755 --- a/jenkins/pleiades-solid_earth +++ b/jenkins/pleiades-solid_earth @@ -2,8 +2,8 @@ # Environment # #-------------# -export CFLAGS="-O3" -export CXXFLAGS="-O3 -std=c++11" +export CFLAGS="-g -Ofast" +export CXXFLAGS="-g -Ofast -xCORE-AVX512,CORE-AVX2 -xAVX -std=c++11" #--------------------# # ISSM Configuration # @@ -16,8 +16,8 @@ ISSM_CONFIG='\ --with-wrappers=no \ --with-fortran-lib="-L${COMP_INTEL_ROOT}/compiler/lib/intel64_lin -lifcore -lifport -lgfortran" \ --with-mkl-libflags="-L${COMP_INTEL_ROOT}/mkl/lib/intel64 -lmkl_intel_lp64 -lmkl_sequential -lmkl_core -lpthread -lm" \ - --with-mpi-include="/nasa/hpe/mpt/2.30_rhel810/include" \ - --with-mpi-libflags="-L/nasa/hpe/mpt/2.30_rhel810/lib -lmpi" \ + --with-mpi-include="${MPI_ROOT}/include" \ + --with-mpi-libflags="-L${MPI_ROOT}/lib -lmpi" \ --with-blas-lapack-lib="-L${COMP_INTEL_ROOT}/mkl/lib/intel64 -lmkl_blas95_lp64 -lmkl_lapack95_lp64" \ --with-metis-dir="${PETSC_DIR}" \ --with-parmetis-dir="${PETSC_DIR}" \ @@ -39,12 +39,12 @@ ISSM_CONFIG='\ #-------------------# EXTERNALPACKAGES=" - zlib install-1.sh - hdf5 install-1.sh + autotools install-linux.sh boost install-1.7-linux.sh dakota install-6.2-pleiades.sh chaco install-linux.sh - curl install-7-linux.sh + zlib install-1.sh + hdf5 install-1.sh netcdf install-4.sh sqlite install.sh proj install-6.sh @@ -72,7 +72,7 @@ EXAMPLES_TEST=0 # NOTE: One is usually safer as some packages are very sensitive to parallel # compilation. # -NUMCPUS_INSTALL=8 +NUMCPUS_INSTALL=4 # Number of CPUs used in the nightly runs NUMCPUS_RUN=1 From 27d810f420fd3d83c7fb7180a040683c618f12c0 Mon Sep 17 00:00:00 2001 From: Cheng Gong Date: Thu, 17 Jul 2025 10:53:36 -0400 Subject: [PATCH 057/126] ADD: interp ITS_LIVE Antarctica --- .../chenggong/modeldata/interpFromITSLIVE.m | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/src/m/contrib/chenggong/modeldata/interpFromITSLIVE.m b/src/m/contrib/chenggong/modeldata/interpFromITSLIVE.m index 4279ce848..8aa5f7203 100644 --- a/src/m/contrib/chenggong/modeldata/interpFromITSLIVE.m +++ b/src/m/contrib/chenggong/modeldata/interpFromITSLIVE.m @@ -17,10 +17,20 @@ % get the version of ITS_LIVE, v02 is the latest version (by 2024-07) % however, this version is in h5 format, can only be read by `h5read`, NOT `ncread` data_version = getfieldvalue(options,'version', 2); + + % Greenland (default) or Antarctica + hem = getfieldvalue(options,'hemisphere', 'n'); + + if strcmp(hem,'n') + icesheet = 'Greenland'; + else + icesheet = 'Antarctica'; + end + if data_version == 1 - foldername = '/totten_1/ModelData/Greenland/ITS_LIVE/v01/'; + foldername = ['/totten_1/ModelData/', icesheet, '/ITS_LIVE/v01/']; elseif data_version == 2 - foldername = '/totten_1/ModelData/Greenland/ITS_LIVE/'; + foldername = ['/totten_1/ModelData/', icesheet, '/ITS_LIVE/']; else error(['ITS_LIVE version ', data_version, ' is not supported!']) end @@ -43,9 +53,9 @@ % find all the data files with Tstart<=t<=Tend dataInd = (dataTime>=Tstart) & (dataTime<=Tend); if ((Tstart ==0) & (Tend==0)) - disp(' Use ITS_LIVE composite 120 m velocity map '); + disp([' Use ITS_LIVE composite 120 m velocity map for ', icesheet]); else - disp([' For the selected period: ', datestr(decyear2date((Tstart)),'yyyy-mm-dd'), ' to ', datestr(decyear2date((Tend)),'yyyy-mm-dd'), ', there are ', num2str(sum(dataInd)), ' records' ]); + disp([' For the selected period: ', datestr(decyear2date((Tstart)),'yyyy-mm-dd'), ' to ', datestr(decyear2date((Tend)),'yyyy-mm-dd'), ', there are ', num2str(sum(dataInd)), ' records for ', icesheet ]); end dataToLoad = {templist(dataInd).name}; From 904b05873d8e0fd7d58d414f14150010ea14d66e Mon Sep 17 00:00:00 2001 From: mmorligh Date: Mon, 21 Jul 2025 21:08:33 +0900 Subject: [PATCH 058/126] CHG: not needed anymore --- src/dox/issm.dox | 88 ------------------------------------------------ 1 file changed, 88 deletions(-) delete mode 100644 src/dox/issm.dox diff --git a/src/dox/issm.dox b/src/dox/issm.dox deleted file mode 100644 index 3bc28dfe0..000000000 --- a/src/dox/issm.dox +++ /dev/null @@ -1,88 +0,0 @@ -/** - \mainpage ISSM C/C++ Source Code Browser - -
- - Welcome ! - - This is the searchable browsing tool for ISSM - (the Ice Sheet System Model). - - These pages were automatically generated by doxygen, - from the ISSM source code. - - Navigate the tabs above and browse through ISSM's - C++ source code, files/directories, and data - structures. - - To find additional information regarding the use of - ISSM, its current release, or the ISSM team, please - visit http://issm.jpl.nasa.gov. - -
- - Helpful Links - - - Download ISSM here. - - - ISSM Installation instructions for Linux/Mac OSX are found here. - - - ISSM Installation instructions for Windows are found here. - - - For help using ISSM, see our online Documentation. - Other documentation is also available including simple tutorials - and FAQ. - - - A current publication list is kept here. - - - Contact us by e-mail at issm@jpl.nasa.gov - -
- - Code Stats - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
LanguagefilesblankcommentcodeTotal
C++ 5002143821870104083147391
MATLAB 1003104611547786652112590
Python 313558954854381654890
JavaScript 108427077792488136930
C/C++ Header 435371237941785025356
m4 810211601062711808
vim script 141314981515
Fortran 90 636138211601903
Bourne Again Shell 4108208524840
Fortran 77 74302365671
Bourne Shell 36380270413
JSON 2002828
SUM: 23904703155550291754394335
-*/ From e8cba8aa19d2c0433bd52ca5a325f96a4e22b1b1 Mon Sep 17 00:00:00 2001 From: mmorligh Date: Mon, 21 Jul 2025 21:09:20 +0900 Subject: [PATCH 059/126] CHG: not needed anymore --- scripts/cloc | 11676 ----------------------------------------- scripts/cloc2html.py | 107 - 2 files changed, 11783 deletions(-) delete mode 100755 scripts/cloc delete mode 100755 scripts/cloc2html.py diff --git a/scripts/cloc b/scripts/cloc deleted file mode 100755 index 2b512208a..000000000 --- a/scripts/cloc +++ /dev/null @@ -1,11676 +0,0 @@ -#!/usr/bin/env perl -# cloc -- Count Lines of Code {{{1 -# Copyright (C) 2006-2017 Al Danial -# First release August 2006 -# -# Includes code from: -# - SLOCCount v2.26 -# http://www.dwheeler.com/sloccount/ -# by David Wheeler. -# - Regexp::Common v2013031301 -# http://search.cpan.org/~abigail/Regexp-Common-2013031301/lib/Regexp/Common.pm -# by Damian Conway and Abigail. -# - Win32::Autoglob -# http://search.cpan.org/~sburke/Win32-Autoglob-1.01/Autoglob.pm -# by Sean M. Burke. -# - Algorithm::Diff -# http://search.cpan.org/~tyemq/Algorithm-Diff-1.1902/lib/Algorithm/Diff.pm -# by Tye McQueen. -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details: -# . -# -# 1}}} -my $VERSION = "1.72"; # odd number == beta; even number == stable -my $URL = "github.com/AlDanial/cloc"; # 'https://' pushes header too wide -require 5.006; -# use modules {{{1 -use warnings; -use strict; -use Getopt::Long; -use File::Basename; -use File::Temp qw { tempfile tempdir }; -use File::Find; -use File::Path; -use File::Spec; -use IO::File; -use POSIX "strftime"; - -# Digest::MD5 isn't in the standard distribution. Use it only if installed. -my $HAVE_Digest_MD5 = 0; -eval "use Digest::MD5;"; -if (defined $Digest::MD5::VERSION) { - $HAVE_Digest_MD5 = 1; -} else { - warn "Digest::MD5 not installed; will skip file uniqueness checks.\n"; -} - -# Time::HiRes became standard with Perl 5.8 -my $HAVE_Time_HiRes = 0; -eval "use Time::HiRes;"; -$HAVE_Time_HiRes = 1 if defined $Time::HiRes::VERSION; - -my $HAVE_Rexexp_Common; -# Regexp::Common isn't in the standard distribution. It will -# be installed in a temp directory if necessary. -BEGIN { - if (eval "use Regexp::Common;") { - $HAVE_Rexexp_Common = 1; - } else { - $HAVE_Rexexp_Common = 0; - } -} - -my $HAVE_Algorith_Diff = 0; -# Algorithm::Diff isn't in the standard distribution. It will -# be installed in a temp directory if necessary. -eval "use Algorithm::Diff qw ( sdiff ) "; -if (defined $Algorithm::Diff::VERSION) { - $HAVE_Algorith_Diff = 1; -} else { - Install_Algorithm_Diff(); -} -# print "2 HAVE_Algorith_Diff = $HAVE_Algorith_Diff\n"; -# test_alg_diff($ARGV[$#ARGV - 1], $ARGV[$#ARGV]); die; -# die "Hre=$HAVE_Rexexp_Common Had=$HAVE_Algorith_Diff"; - -# Uncomment next two lines when building Windows executable with perl2exe -# or if running on a system that already has Regexp::Common. -#use Regexp::Common; -#$HAVE_Rexexp_Common = 1; - -#perl2exe_include "Regexp/Common/whitespace.pm" -#perl2exe_include "Regexp/Common/URI.pm" -#perl2exe_include "Regexp/Common/URI/fax.pm" -#perl2exe_include "Regexp/Common/URI/file.pm" -#perl2exe_include "Regexp/Common/URI/ftp.pm" -#perl2exe_include "Regexp/Common/URI/gopher.pm" -#perl2exe_include "Regexp/Common/URI/http.pm" -#perl2exe_include "Regexp/Common/URI/pop.pm" -#perl2exe_include "Regexp/Common/URI/prospero.pm" -#perl2exe_include "Regexp/Common/URI/news.pm" -#perl2exe_include "Regexp/Common/URI/tel.pm" -#perl2exe_include "Regexp/Common/URI/telnet.pm" -#perl2exe_include "Regexp/Common/URI/tv.pm" -#perl2exe_include "Regexp/Common/URI/wais.pm" -#perl2exe_include "Regexp/Common/CC.pm" -#perl2exe_include "Regexp/Common/SEN.pm" -#perl2exe_include "Regexp/Common/number.pm" -#perl2exe_include "Regexp/Common/delimited.pm" -#perl2exe_include "Regexp/Common/profanity.pm" -#perl2exe_include "Regexp/Common/net.pm" -#perl2exe_include "Regexp/Common/zip.pm" -#perl2exe_include "Regexp/Common/comment.pm" -#perl2exe_include "Regexp/Common/balanced.pm" -#perl2exe_include "Regexp/Common/lingua.pm" -#perl2exe_include "Regexp/Common/list.pm" -#perl2exe_include "File/Glob.pm" - -use Text::Tabs qw { expand }; -use Cwd qw { cwd }; -use File::Glob; -# 1}}} -# Usage information, options processing. {{{1 -my $ON_WINDOWS = 0; - $ON_WINDOWS = 1 if ($^O =~ /^MSWin/) or ($^O eq "Windows_NT"); -if ($ON_WINDOWS and $ENV{'SHELL'}) { - if ($ENV{'SHELL'} =~ m{^/}) { - $ON_WINDOWS = 0; # make Cygwin look like Unix - } else { - $ON_WINDOWS = 1; # MKS defines $SHELL but still acts like Windows - } -} - -my $NN = chr(27) . "[0m"; # normal - $NN = "" if $ON_WINDOWS or !(-t STDERR); # -t STDERR: is it a terminal? -my $BB = chr(27) . "[1m"; # bold - $BB = "" if $ON_WINDOWS or !(-t STDERR); -my $script = basename $0; -my $brief_usage = " - cloc -- Count Lines of Code - -Usage: - $script [options] - Count physical lines of source code and comments in the given files - (may be archives such as compressed tarballs or zip files) and/or - recursively below the given directories. - Example: cloc src/ include/ main.c - - $script [options] --diff - Compute differences of physical lines of source code and comments - between a pair of directories or archive files. - Example: cloc --diff Python-3.5.tar.xz python-3.6/ - -$script --help shows full documentation on the options. -http://$URL has numerous examples and more information. -"; -my $usage = " -Usage: $script [options] | | - - Count, or compute differences of, physical lines of source code in the - given files (may be archives such as compressed tarballs or zip files) - and/or recursively below the given directories. - - ${BB}Input Options${NN} - --extract-with= This option is only needed if cloc is unable - to figure out how to extract the contents of - the input file(s) by itself. - Use to extract binary archive files (e.g.: - .tar.gz, .zip, .Z). Use the literal '>FILE<' as - a stand-in for the actual file(s) to be - extracted. For example, to count lines of code - in the input files - gcc-4.2.tar.gz perl-5.8.8.tar.gz - on Unix use - --extract-with='gzip -dc >FILE< | tar xf -' - or, if you have GNU tar, - --extract-with='tar zxf >FILE<' - and on Windows use, for example: - --extract-with=\"\\\"c:\\Program Files\\WinZip\\WinZip32.exe\\\" -e -o >FILE< .\" - (if WinZip is installed there). - --list-file= Take the list of file and/or directory names to - process from , which has one file/directory - name per line. Only exact matches are counted; - relative path names will be resolved starting from - the directory where cloc is invoked. - See also --exclude-list-file. - --vcs= Invoke a system call to to obtain a list of - files to work on. If is 'git', then will - invoke 'git ls-files' to get a file list and - 'git submodule status' to get a list of submodules - whose contents will be ignored. If is 'svn' - then will invoke 'svn list -R'. The primary benefit - is that cloc will then skip files explicitly - excluded by the versioning tool in question, - ie, those in .gitignore or have the svn:ignore - property. - Alternatively may be any system command - that generates a list of files. - Note: cloc must be in a directory which can read - the files as they are returned by . cloc will - not download files from remote repositories. - 'svn list -R' may refer to a remote repository - to obtain file names (and therefore may require - authentication to the remote repository), but - the files themselves must be local. - --unicode Check binary files to see if they contain Unicode - expanded ASCII text. This causes performance to - drop noticeably. - - ${BB}Processing Options${NN} - --autoconf Count .in files (as processed by GNU autoconf) of - recognized languages. - --by-file Report results for every source file encountered. - --by-file-by-lang Report results for every source file encountered - in addition to reporting by language. - --count-and-diff - First perform direct code counts of source file(s) - of and separately, then perform a diff - of these. Inputs may be pairs of files, directories, - or archives. See also --diff, --diff-alignment, - --diff-timeout, --ignore-case, --ignore-whitespace. - --diff Compute differences in code and comments between - source file(s) of and . The inputs - may be pairs of files, directories, or archives. - Use --diff-alignment to generate a list showing - which file pairs where compared. See also - --count-and-diff, --diff-alignment, --diff-timeout, - --ignore-case, --ignore-whitespace. - --diff-timeout Ignore files which take more than seconds - to process. Default is 10 seconds. - (Large files with many repeated lines can cause - Algorithm::Diff::sdiff() to take hours.) - --follow-links [Unix only] Follow symbolic links to directories - (sym links to files are always followed). - --force-lang=[,] - Process all files that have a extension - with the counter for language . For - example, to count all .f files with the - Fortran 90 counter (which expects files to - end with .f90) instead of the default Fortran 77 - counter, use - --force-lang=\"Fortran 90\",f - If is omitted, every file will be counted - with the counter. This option can be - specified multiple times (but that is only - useful when is given each time). - See also --script-lang, --lang-no-ext. - --force-lang-def= Load language processing filters from , - then use these filters instead of the built-in - filters. Note: languages which map to the same - file extension (for example: - MATLAB/Mathematica/Objective C/MUMPS/Mercury; - Pascal/PHP; Lisp/OpenCL; Lisp/Julia; Perl/Prolog) - will be ignored as these require additional - processing that is not expressed in language - definition files. Use --read-lang-def to define - new language filters without replacing built-in - filters (see also --write-lang-def). - --ignore-whitespace Ignore horizontal white space when comparing files - with --diff. See also --ignore-case. - --ignore-case Ignore changes in case; consider upper- and lower- - case letters equivalent when comparing files with - --diff. See also --ignore-whitespace. - --lang-no-ext= Count files without extensions using the - counter. This option overrides internal logic - for files without extensions (where such files - are checked against known scripting languages - by examining the first line for #!). See also - --force-lang, --script-lang. - --max-file-size= Skip files larger than megabytes when - traversing directories. By default, =100. - cloc's memory requirement is roughly twenty times - larger than the largest file so running with - files larger than 100 MB on a computer with less - than 2 GB of memory will cause problems. - Note: this check does not apply to files - explicitly passed as command line arguments. - --original-dir [Only effective in combination with - --strip-comments] Write the stripped files - to the same directory as the original files. - --read-binary-files Process binary files in addition to text files. - This is usually a bad idea and should only be - attempted with text files that have embedded - binary data. - --read-lang-def= Load new language processing filters from - and merge them with those already known to cloc. - If defines a language cloc already knows - about, cloc's definition will take precedence. - Use --force-lang-def to over-ride cloc's - definitions (see also --write-lang-def ). - --script-lang=, Process all files that invoke as a #! - scripting language with the counter for language - . For example, files that begin with - #!/usr/local/bin/perl5.8.8 - will be counted with the Perl counter by using - --script-lang=Perl,perl5.8.8 - The language name is case insensitive but the - name of the script language executable, , - must have the right case. This option can be - specified multiple times. See also --force-lang, - --lang-no-ext. - --sdir= Use as the scratch directory instead of - letting File::Temp chose the location. Files - written to this location are not removed at - the end of the run (as they are with File::Temp). - --skip-uniqueness Skip the file uniqueness check. This will give - a performance boost at the expense of counting - files with identical contents multiple times - (if such duplicates exist). - --stdin-name= Give a file name to use to determine the language - for standard input. (Use - as the input name to - receive source code via STDIN.) - --strip-comments= For each file processed, write to the current - directory a version of the file which has blank - lines and comments removed. The name of each - stripped file is the original file name with - . appended to it. It is written to the - current directory unless --original-dir is on. - --sum-reports Input arguments are report files previously - created with the --report-file option. Makes - a cumulative set of results containing the - sum of data from the individual report files. - --unix Override the operating system autodetection - logic and run in UNIX mode. See also - --windows, --show-os. - --use-sloccount If SLOCCount is installed, use its compiled - executables c_count, java_count, pascal_count, - php_count, and xml_count instead of cloc's - counters. SLOCCount's compiled counters are - substantially faster than cloc's and may give - a performance improvement when counting projects - with large files. However, these cloc-specific - features will not be available: --diff, - --count-and-diff, --strip-comments, --unicode. - --windows Override the operating system autodetection - logic and run in Microsoft Windows mode. - See also --unix, --show-os. - - ${BB}Filter Options${NN} - --exclude-dir=[,D2,] Exclude the given comma separated directories - D1, D2, D3, et cetera, from being scanned. For - example --exclude-dir=.cache,test will skip - all files and subdirectories that have /.cache/ - or /test/ as their parent directory. - Directories named .bzr, .cvs, .hg, .git, and - .svn are always excluded. - This option only works with individual directory - names so including file path separators is not - allowed. Use --fullpath and --not-match-d= - to supply a regex matching multiple subdirectories. - --exclude-ext=[,[...]] - Do not count files having the given file name - extensions. - --exclude-lang=[,L2,] Exclude the given comma separated languages - L1, L2, L3, et cetera, from being counted. - --exclude-list-file= Ignore files and/or directories whose names - appear in . should have one file - name per line. Only exact matches are ignored; - relative path names will be resolved starting from - the directory where cloc is invoked. - See also --list-file. - --fullpath Modifies the behavior of --match-f, --not-match-f, - and --not-match-d to include the file's path - in the regex, not just the file's basename. - (This does not expand each file to include its - absolute path, instead it uses as much of - the path as is passed in to cloc.) - Note: --match-d always looks at the full - path and therefore is unaffected by --fullpath. - --include-lang=[,L2,] Count only the given comma separated languages - L1, L2, L3, et cetera. - --match-d= Only count files in directories matching the Perl - regex. For example - --match-d='/(src|include)/' - only counts files in directories containing - /src/ or /include/. Unlike --not-match-d, - --match-f, and --not-match-f, --match-d always - compares the fully qualified path against the regex. - --not-match-d= Count all files except those in directories - matching the Perl regex. Only the trailing - directory name is compared, for example, when - counting in /usr/local/lib, only 'lib' is - compared to the regex. - Add --fullpath to compare parent directories to - the regex. - Do not include file path separators at the beginning - or end of the regex. - --match-f= Only count files whose basenames match the Perl - regex. For example - --match-f='^[Ww]idget' - only counts files that start with Widget or widget. - Add --fullpath to include parent directories - in the regex instead of just the basename. - --not-match-f= Count all files except those whose basenames - match the Perl regex. Add --fullpath to include - parent directories in the regex instead of just - the basename. - --skip-archive= Ignore files that end with the given Perl regular - expression. For example, if given - --skip-archive='(zip|tar(\.(gz|Z|bz2|xz|7z))?)' - the code will skip files that end with .zip, - .tar, .tar.gz, .tar.Z, .tar.bz2, .tar.xz, and - .tar.7z. - --skip-win-hidden On Windows, ignore hidden files. - - ${BB}Debug Options${NN} - --categorized= Save names of categorized files to . - --counted= Save names of processed source files to . - --diff-alignment= Write to a list of files and file pairs - showing which files were added, removed, and/or - compared during a run with --diff. This switch - forces the --diff mode on. - --explain= Print the filters used to remove comments for - language and exit. In some cases the - filters refer to Perl subroutines rather than - regular expressions. An examination of the - source code may be needed for further explanation. - --help Print this usage information and exit. - --found= Save names of every file found to . - --ignored= Save names of ignored files and the reason they - were ignored to . - --print-filter-stages Print processed source code before and after - each filter is applied. - --show-ext[=] Print information about all known (or just the - given) file extensions and exit. - --show-lang[=] Print information about all known (or just the - given) languages and exit. - --show-os Print the value of the operating system mode - and exit. See also --unix, --windows. - -v[=] Verbose switch (optional numeric value). - -verbose[=] Long form of -v. - --version Print the version of this program and exit. - --write-lang-def= Writes to the language processing filters - then exits. Useful as a first step to creating - custom language definitions (see also - --force-lang-def, --read-lang-def). - - ${BB}Output Options${NN} - --3 Print third-generation language output. - (This option can cause report summation to fail - if some reports were produced with this option - while others were produced without it.) - --by-percent X Instead of comment and blank line counts, show - these values as percentages based on the value - of X in the denominator: - X = 'c' -> # lines of code - X = 'cm' -> # lines of code + comments - X = 'cb' -> # lines of code + blanks - X = 'cmb' -> # lines of code + comments + blanks - For example, if using method 'c' and your code - has twice as many lines of comments as lines - of code, the value in the comment column will - be 200%. The code column remains a line count. - --csv Write the results as comma separated values. - --csv-delimiter= Use the character as the delimiter for comma - separated files instead of ,. This switch forces - --json Write the results as JavaScript Object Notation - (JSON) formatted output. - --md Write the results as Markdown-formatted text. - --out= Synonym for --report-file=. - --progress-rate= Show progress update after every files are - processed (default =100). Set to 0 to - suppress progress output (useful when redirecting - output to STDOUT). - --quiet Suppress all information messages except for - the final report. - --report-file= Write the results to instead of STDOUT. - --sql= Write results as SQL create and insert statements - which can be read by a database program such as - SQLite. If is -, output is sent to STDOUT. - --sql-append Append SQL insert statements to the file specified - by --sql and do not generate table creation - statements. Only valid with the --sql option. - --sql-project= Use as the project identifier for the - current run. Only valid with the --sql option. - --sql-style= - - -

-';
-    print "<- html_header\n" if $opt_v > 2;
-} # 1}}}
-sub html_end {                               # {{{1
-return
-'
- - -'; -} # 1}}} -sub die_unknown_lang { # {{{1 - my ($lang, $option_name) = @_; - die "Unknown language '$lang' used with $option_name option. " . - "The command\n $script --show-lang\n" . - "will print all recognized languages. Language names are " . - "case sensitive.\n" ; -} # 1}}} -sub unicode_file { # {{{1 - my $file = shift @_; - - print "-> unicode_file($file)\n" if $opt_v > 2; - return 0 if (-s $file > 2_000_000); - # don't bother trying to test binary files bigger than 2 MB - - my $IN = new IO::File $file, "r"; - if (!defined $IN) { - warn "Unable to read $file; ignoring.\n"; - return 0; - } - my @lines = <$IN>; - $IN->close; - - if (unicode_to_ascii( join('', @lines) )) { - print "<- unicode_file()\n" if $opt_v > 2; - return 1; - } else { - print "<- unicode_file()\n" if $opt_v > 2; - return 0; - } - -} # 1}}} -sub unicode_to_ascii { # {{{1 - my $string = shift @_; - - # A trivial attempt to convert UTF-16 little or big endian - # files into ASCII. These files exhibit the following byte - # sequence: - # byte 1: 255 - # byte 2: 254 - # byte 3: ord of ASCII character - # byte 4: 0 - # byte 3+i: ord of ASCII character - # byte 4+i: 0 - # or - # byte 1: 255 - # byte 2: 254 - # byte 3: 0 - # byte 4: ord of ASCII character - # byte 3+i: 0 - # byte 4+i: ord of ASCII character - - my $length = length $string; -#print "length=$length\n"; - return '' if $length <= 3; - my @unicode = split(//, $string); - - # check the first 100 characters for big or little endian UTF-16 encoding - my $max_peek = $length < 200 ? $length : 200; - my @view_1 = (); - for (my $i = 2; $i < $max_peek; $i += 2) { push @view_1, $unicode[$i] } - my @view_2 = (); - for (my $i = 3; $i < $max_peek; $i += 2) { push @view_2, $unicode[$i] } - - my $points_1 = 0; - foreach my $C (@view_1) { - ++$points_1 if (32 <= ord($C) and ord($C) <= 127) or ord($C) == 13 - or ord($C) == 10 - or ord($C) == 9; - } - - my $points_2 = 0; - foreach my $C (@view_2) { - ++$points_2 if (32 <= ord($C) and ord($C) <= 127) or ord($C) == 13 - or ord($C) == 10 - or ord($C) == 9; - } -#print "points 1: $points_1\n"; -#print "points 2: $points_2\n"; - - my $offset = undef; - if ($points_1 > 90) { $offset = 2; } - elsif ($points_2 > 90) { $offset = 3; } - else { return '' } # neither big or little endian UTF-16 - - my @ascii = (); - for (my $i = $offset; $i < $length; $i += 2) { push @ascii, $unicode[$i]; } - return join("", @ascii); -} # 1}}} -sub uncompress_archive_cmd { # {{{1 - my ($archive_file, ) = @_; - - # Wrap $archive_file in single or double quotes in the system - # commands below to avoid filename chicanery (including - # spaces in the names). - - print "-> uncompress_archive_cmd($archive_file)\n" if $opt_v > 2; - my $extract_cmd = ""; - my $missing = ""; - if ($opt_extract_with) { - ( $extract_cmd = $opt_extract_with ) =~ s/>FILE -"; - } elsif (($archive_file =~ /\.tar\.(gz|Z)$/ or - $archive_file =~ /\.tgz$/ ) and !$ON_WINDOWS) { - if (external_utility_exists("gzip --version")) { - if (external_utility_exists("tar --version")) { - $extract_cmd = "gzip -dc '$archive_file' | tar xf -"; - } else { - $missing = "tar"; - } - } else { - $missing = "gzip"; - } - } elsif ($archive_file =~ /\.tar\.bz2$/ and !$ON_WINDOWS) { - if (external_utility_exists("bzip2 --help")) { - if (external_utility_exists("tar --version")) { - $extract_cmd = "bzip2 -dc '$archive_file' | tar xf -"; - } else { - $missing = "tar"; - } - } else { - $missing = "bzip2"; - } - } elsif ($archive_file =~ /\.tar\.xz$/ and !$ON_WINDOWS) { - if (external_utility_exists("unxz --version")) { - if (external_utility_exists("tar --version")) { - $extract_cmd = "unxz -dc '$archive_file' | tar xf -"; - } else { - $missing = "tar"; - } - } else { - $missing = "bzip2"; - } - } elsif ($archive_file =~ /\.tar$/ and !$ON_WINDOWS) { - $extract_cmd = "tar xf '$archive_file'"; - } elsif ($archive_file =~ /\.src\.rpm$/i and !$ON_WINDOWS) { - if (external_utility_exists("cpio --version")) { - if (external_utility_exists("rpm2cpio")) { - $extract_cmd = "rpm2cpio '$archive_file' | cpio -i"; - } else { - $missing = "rpm2cpio"; - } - } else { - $missing = "bzip2"; - } - } elsif ($archive_file =~ /\.zip$/i and !$ON_WINDOWS) { - if (external_utility_exists("unzip")) { - $extract_cmd = "unzip -qq -d . '$archive_file'"; - } else { - $missing = "unzip"; - } - } elsif ($archive_file =~ /\.deb$/i and !$ON_WINDOWS) { - # only useful if the .deb contains source code--most - # .deb files just have compiled executables - if (external_utility_exists("dpkg-deb")) { - $extract_cmd = "dpkg-deb -x '$archive_file' ."; - } else { - $missing = "dpkg-deb"; - } - } elsif ($ON_WINDOWS and $archive_file =~ /\.zip$/i) { - # zip on Windows, guess default Winzip install location - $extract_cmd = ""; - my $WinZip = '"C:\\Program Files\\WinZip\\WinZip32.exe"'; - if (external_utility_exists($WinZip)) { - $extract_cmd = "$WinZip -e -o \"$archive_file\" ."; -#print "trace 5 extract_cmd=[$extract_cmd]\n"; - } else { -#print "trace 6\n"; - $missing = $WinZip; - } - } - print "<- uncompress_archive_cmd\n" if $opt_v > 2; - if ($missing) { - die "Unable to expand $archive_file because external\n", - "utility '$missing' is not available.\n", - "Another possibility is to use the --extract-with option.\n"; - } else { - return $extract_cmd; - } -} -# 1}}} -sub read_list_file { # {{{1 - my ($file, ) = @_; - - print "-> read_list_file($file)\n" if $opt_v > 2; - my $IN = new IO::File $file, "r"; - if (!defined $IN) { - warn "Unable to read $file; ignoring.\n"; - return (); - } - my @entry = (); - while (<$IN>) { - next if /^\s*$/ or /^\s*#/; # skip empty or commented lines - s/\cM$//; # DOS to Unix - chomp; - push @entry, $_; - } - $IN->close; - - print "<- read_list_file\n" if $opt_v > 2; - return @entry; -} -# 1}}} -sub external_utility_exists { # {{{1 - my $exe = shift @_; - - my $success = 0; - if ($ON_WINDOWS) { - $success = 1 unless system $exe . ' > nul'; - } else { - $success = 1 unless system $exe . ' >/dev/null 2>&1'; - if (!$success) { - $success = 1 unless system "which" . " $exe" . ' >/dev/null 2>&1'; - } - } - - return $success; -} # 1}}} -sub write_xsl_file { # {{{1 - my $OUT = new IO::File $CLOC_XSL, "w"; - if (!defined $OUT) { - warn "Unable to write $CLOC_XSL $!\n"; - return; - } - my $XSL = # {{{2 -' - - - - - - - CLOC Results - - - -

-'; -# 2}}} - - if ($opt_by_file) { - $XSL .= #
{{{2 -' - - - - - - - -'; - $XSL .= -' - -' if $opt_3; - $XSL .= -' - - - - - - - - - -'; - $XSL .= -' - -' if $opt_3; - $XSL .= -' - - - - - - - -'; - $XSL .= -' - -' if $opt_3; - $XSL .= -' - -
FileBlankCommentCodeLanguage3rd Generation EquivalentScale
Total
-
-'; -# 2}}} - } - - if (!$opt_by_file or $opt_by_file_by_lang) { - $XSL .= #
{{{2 -' - - - - - - - -'; - $XSL .= -' - -' if $opt_3; - $XSL .= -' - - - - - - - - - -'; - $XSL .= -' - -' if $opt_3; - $XSL .= -' - - - - - - - -'; - $XSL .= -' - -' if $opt_3; - $XSL .= -' - -
LanguageFilesBlankCommentCodeScale3rd Generation Equivalent
Total
-'; -# 2}}} - } - - $XSL.= <<'EO_XSL'; # {{{2 - - -
-
- -EO_XSL -# 2}}} - - my $XSL_DIFF = <<'EO_DIFF_XSL'; # {{{2 - - - - - - - - CLOC Results - - - -

-EO_DIFF_XSL -# 2}}} - - if ($opt_by_file) { - $XSL_DIFF.= <<'EO_DIFF_XSL'; # {{{2 - - - - - - - - - - - - - - - - - - - - - -
Same
FileBlankCommentCode
- - - - - - - - - - - - - - - - - - - - - - -
Modified
FileBlankCommentCode
- - - - - - - - - - - - - - - - - - - - - - -
Added
FileBlankCommentCode
- - - - - - - - - - - - - - - - - - - - - - -
Removed
FileBlankCommentCode
-EO_DIFF_XSL -# 2}}} - } - - if (!$opt_by_file or $opt_by_file_by_lang) { - $XSL_DIFF.= <<'EO_DIFF_XSL'; # {{{2 - - - - - - - - - - - - - - - - - - - - - - - -
Same
LanguageFilesBlankCommentCode
- - - - - - - - - - - - - - - - - - - - - - - - -
Modified
LanguageFilesBlankCommentCode
- - - - - - - - - - - - - - - - - - - - - - - - -
Added
LanguageFilesBlankCommentCode
- - - - - - - - - - - - - - - - - - - - - - - - -
Removed
LanguageFilesBlankCommentCode
-EO_DIFF_XSL -# 2}}} - - } - - $XSL_DIFF.= <<'EO_DIFF_XSL'; # {{{2 - - -
-
-EO_DIFF_XSL -# 2}}} - if ($opt_diff) { - print $OUT $XSL_DIFF; - } else { - print $OUT $XSL; - } - $OUT->close(); -} # 1}}} -sub normalize_file_names { # {{{1 - my (@files, ) = @_; - - # Returns a hash of file names reduced to a canonical form - # (fully qualified file names, all path separators changed to /, - # Windows file names lowercased). Hash values are the original - # file name. - - my %normalized = (); - foreach my $F (@files) { - my $F_norm = $F; - if ($ON_WINDOWS) { - $F_norm = lc $F_norm; # for case insensitive file name comparisons - $F_norm =~ s{\\}{/}g; # Windows directory separators to Unix - $F_norm =~ s{^\./}{}g; # remove leading ./ - if (($F_norm !~ m{^/}) and ($F_norm !~ m{^\w:/})) { - # looks like a relative path; prefix with cwd - $F_norm = lc "$cwd/$F_norm"; - } - } else { - $F_norm =~ s{^\./}{}g; # remove leading ./ - if ($F_norm !~ m{^/}) { - # looks like a relative path; prefix with cwd - $F_norm = lc "$cwd/$F_norm"; - } - } - # Remove trailing / so it does not interfere with further regex code - # that does not expect it - $F_norm =~ s{/+$}{}; - $normalized{ $F_norm } = $F; - } - return %normalized; -} # 1}}} -sub combine_diffs { # {{{1 - # subroutine by Andy (awalshe@sf.net) - # https://sourceforge.net/tracker/?func=detail&aid=3261017&group_id=174787&atid=870625 - my ($ra_files) = @_; - - my $res = "$URL v $VERSION\n"; - my $dl = '-'; - my $width = 79; - # columns are in this order - my @cols = ('files', 'blank', 'comment', 'code'); - my %HoH = (); - - foreach my $file (@{$ra_files}) { - my $IN = new IO::File $file, "r"; - if (!defined $IN) { - warn "Unable to read $file; ignoring.\n"; - next; - } - - my $sec; - while (<$IN>) { - chomp; - s/\cM$//; - next if /^(http|Language|-----)/; - if (/^[A-Za-z0-9]+/) { # section title - $sec = $_; - chomp($sec); - $HoH{$sec} = () if ! exists $HoH{$sec}; - next; - } - - if (/^\s(same|modified|added|removed)/) { # calculated totals row - my @ar = grep { $_ ne '' } split(/ /, $_); - chomp(@ar); - my $ttl = shift @ar; - my $i = 0; - foreach(@ar) { - my $t = "${ttl}${dl}${cols[$i]}"; - $HoH{$sec}{$t} = 0 if ! exists $HoH{$sec}{$t}; - $HoH{$sec}{$t} += $_; - $i++; - } - } - } - $IN->close; - } - - # rows are in this order - my @rows = ('same', 'modified', 'added', 'removed'); - - $res .= sprintf("%s\n", "-" x $width); - $res .= sprintf("%-19s %14s %14s %14s %14s\n", 'Language', - $cols[0], $cols[1], $cols[2], $cols[3]); - $res .= sprintf("%s\n", "-" x $width); - - for my $sec ( keys %HoH ) { - next if $sec =~ /SUM:/; - $res .= "$sec\n"; - foreach (@rows) { - $res .= sprintf(" %-18s %14s %14s %14s %14s\n", - $_, $HoH{$sec}{"${_}${dl}${cols[0]}"}, - $HoH{$sec}{"${_}${dl}${cols[1]}"}, - $HoH{$sec}{"${_}${dl}${cols[2]}"}, - $HoH{$sec}{"${_}${dl}${cols[3]}"}); - } - } - $res .= sprintf("%s\n", "-" x $width); - my $sec = 'SUM:'; - $res .= "$sec\n"; - foreach (@rows) { - $res .= sprintf(" %-18s %14s %14s %14s %14s\n", - $_, $HoH{$sec}{"${_}${dl}${cols[0]}"}, - $HoH{$sec}{"${_}${dl}${cols[1]}"}, - $HoH{$sec}{"${_}${dl}${cols[2]}"}, - $HoH{$sec}{"${_}${dl}${cols[3]}"}); - } - $res .= sprintf("%s\n", "-" x $width); - - return $res; -} # 1}}} -sub get_time { # {{{1 - if ($HAVE_Time_HiRes) { - return Time::HiRes::time(); - } else { - return time(); - } -} # 1}}} -sub really_is_D { # {{{1 - # Ref bug 131, files ending with .d could be init.d scripts - # instead of D language source files. - my ($file , # in - $rh_Err , # in hash of error codes - $raa_errors , # out - ) = @_; - print "-> really_is_D($file)\n" if $opt_v > 2; - my $possible_script = peek_at_first_line($file, $rh_Err, $raa_errors); - - print "<- really_is_D($file)\n" if $opt_v > 2; - return $possible_script; # null string if D, otherwise a language -} # 1}}} -# subroutines copied from SLOCCount -my %lex_files = (); # really_is_lex() -my %expect_files = (); # really_is_expect() -my %php_files = (); # really_is_php() -sub really_is_lex { # {{{1 -# Given filename, returns TRUE if its contents really is lex. -# lex file must have "%%", "%{", and "%}". -# In theory, a lex file doesn't need "%{" and "%}", but in practice -# they all have them, and requiring them avoid mislabeling a -# non-lexfile as a lex file. - - my $filename = shift; - chomp($filename); - - my $is_lex = 0; # Value to determine. - my $percent_percent = 0; - my $percent_opencurly = 0; - my $percent_closecurly = 0; - - # Return cached result, if available: - if ($lex_files{$filename}) { return $lex_files{$filename};} - - open(LEX_FILE, "<$filename") || - die "Can't open $filename to determine if it's lex.\n"; - while() { - $percent_percent++ if (m/^\s*\%\%/); - $percent_opencurly++ if (m/^\s*\%\{/); - $percent_closecurly++ if (m/^\s*\%\}/); - } - close(LEX_FILE); - - if ($percent_percent && $percent_opencurly && $percent_closecurly) - {$is_lex = 1;} - - $lex_files{$filename} = $is_lex; # Store result in cache. - - return $is_lex; -} # 1}}} -sub really_is_expect { # {{{1 -# Given filename, returns TRUE if its contents really are Expect. -# Many "exp" files (such as in Apache and Mesa) are just "export" data, -# summarizing something else # (e.g., its interface). -# Sometimes (like in RPM) it's just misc. data. -# Thus, we need to look at the file to determine -# if it's really an "expect" file. - - my $filename = shift; - chomp($filename); - -# The heuristic is as follows: it's Expect _IF_ it: -# 1. has "load_lib" command and either "#" comments or {}. -# 2. {, }, and one of: proc, if, [...], expect - - my $is_expect = 0; # Value to determine. - - my $begin_brace = 0; # Lines that begin with curly braces. - my $end_brace = 0; # Lines that begin with curly braces. - my $load_lib = 0; # Lines with the Load_lib command. - my $found_proc = 0; - my $found_if = 0; - my $found_brackets = 0; - my $found_expect = 0; - my $found_pound = 0; - - # Return cached result, if available: - if ($expect_files{$filename}) { return expect_files{$filename};} - - open(EXPECT_FILE, "<$filename") || - die "Can't open $filename to determine if it's expect.\n"; - while() { - - if (m/#/) {$found_pound++; s/#.*//;} - if (m/^\s*\{/) { $begin_brace++;} - if (m/\{\s*$/) { $begin_brace++;} - if (m/^\s*\}/) { $end_brace++;} - if (m/\};?\s*$/) { $end_brace++;} - if (m/^\s*load_lib\s+\S/) { $load_lib++;} - if (m/^\s*proc\s/) { $found_proc++;} - if (m/^\s*if\s/) { $found_if++;} - if (m/\[.*\]/) { $found_brackets++;} - if (m/^\s*expect\s/) { $found_expect++;} - } - close(EXPECT_FILE); - - if ($load_lib && ($found_pound || ($begin_brace && $end_brace))) - {$is_expect = 1;} - if ( $begin_brace && $end_brace && - ($found_proc || $found_if || $found_brackets || $found_expect)) - {$is_expect = 1;} - - $expect_files{$filename} = $is_expect; # Store result in cache. - - return $is_expect; -} # 1}}} -sub really_is_pascal { # {{{1 -# Given filename, returns TRUE if its contents really are Pascal. - -# This isn't as obvious as it seems. -# Many ".p" files are Perl files -# (such as /usr/src/redhat/BUILD/ispell-3.1/dicts/czech/glob.p), -# others are C extractions -# (such as /usr/src/redhat/BUILD/linux/include/linux/umsdos_fs.p -# and some files in linuxconf). -# However, test files in "p2c" really are Pascal, for example. - -# Note that /usr/src/redhat/BUILD/ucd-snmp-4.1.1/ov/bitmaps/UCD.20.p -# is actually C code. The heuristics determine that they're not Pascal, -# but because it ends in ".p" it's not counted as C code either. -# I believe this is actually correct behavior, because frankly it -# looks like it's automatically generated (it's a bitmap expressed as code). -# Rather than guess otherwise, we don't include it in a list of -# source files. Let's face it, someone who creates C files ending in ".p" -# and expects them to be counted by default as C files in SLOCCount needs -# their head examined. I suggest examining their head -# with a sucker rod (see syslogd(8) for more on sucker rods). - -# This heuristic counts as Pascal such files such as: -# /usr/src/redhat/BUILD/teTeX-1.0/texk/web2c/tangleboot.p -# Which is hand-generated. We don't count woven documents now anyway, -# so this is justifiable. - - my $filename = shift; - chomp($filename); - -# The heuristic is as follows: it's Pascal _IF_ it has all of the following -# (ignoring {...} and (*...*) comments): -# 1. "^..program NAME" or "^..unit NAME", -# 2. "procedure", "function", "^..interface", or "^..implementation", -# 3. a "begin", and -# 4. it ends with "end.", -# -# Or it has all of the following: -# 1. "^..module NAME" and -# 2. it ends with "end.". -# -# Or it has all of the following: -# 1. "^..program NAME", -# 2. a "begin", and -# 3. it ends with "end.". -# -# The "end." requirements in particular filter out non-Pascal. -# -# Note (jgb): this does not detect Pascal main files in fpc, like -# fpc-1.0.4/api/test/testterminfo.pas, which does not have "program" in -# it - - my $is_pascal = 0; # Value to determine. - - my $has_program = 0; - my $has_unit = 0; - my $has_module = 0; - my $has_procedure_or_function = 0; - my $found_begin = 0; - my $found_terminating_end = 0; - my $has_begin = 0; - - open(PASCAL_FILE, "<$filename") || - die "Can't open $filename to determine if it's pascal.\n"; - while() { - s/\{.*?\}//g; # Ignore {...} comments on this line; imperfect, but effective. - s/\(\*.*?\*\)//g; # Ignore (*...*) comments on this line; imperfect, but effective. - if (m/\bprogram\s+[A-Za-z]/i) {$has_program=1;} - if (m/\bunit\s+[A-Za-z]/i) {$has_unit=1;} - if (m/\bmodule\s+[A-Za-z]/i) {$has_module=1;} - if (m/\bprocedure\b/i) { $has_procedure_or_function = 1; } - if (m/\bfunction\b/i) { $has_procedure_or_function = 1; } - if (m/^\s*interface\s+/i) { $has_procedure_or_function = 1; } - if (m/^\s*implementation\s+/i) { $has_procedure_or_function = 1; } - if (m/\bbegin\b/i) { $has_begin = 1; } - # Originally I said: - # "This heuristic fails if there are multi-line comments after - # "end."; I haven't seen that in real Pascal programs:" - # But jgb found there are a good quantity of them in Debian, specially in - # fpc (at the end of a lot of files there is a multiline comment - # with the changelog for the file). - # Therefore, assume Pascal if "end." appears anywhere in the file. - if (m/end\.\s*$/i) {$found_terminating_end = 1;} -# elsif (m/\S/) {$found_terminating_end = 0;} - } - close(PASCAL_FILE); - - # Okay, we've examined the entire file looking for clues; - # let's use those clues to determine if it's really Pascal: - - if ( ( ($has_unit || $has_program) && $has_procedure_or_function && - $has_begin && $found_terminating_end ) || - ( $has_module && $found_terminating_end ) || - ( $has_program && $has_begin && $found_terminating_end ) ) - {$is_pascal = 1;} - - return $is_pascal; -} # 1}}} -sub really_is_incpascal { # {{{1 -# Given filename, returns TRUE if its contents really are Pascal. -# For .inc files (mainly seen in fpc) - - my $filename = shift; - chomp($filename); - -# The heuristic is as follows: it is Pascal if any of the following: -# 1. really_is_pascal returns true -# 2. Any usual reserved word is found (program, unit, const, begin...) - - # If the general routine for Pascal files works, we have it - if (really_is_pascal($filename)) { - return 1; - } - - my $is_pascal = 0; # Value to determine. - my $found_begin = 0; - - open(PASCAL_FILE, "<$filename") || - die "Can't open $filename to determine if it's pascal.\n"; - while() { - s/\{.*?\}//g; # Ignore {...} comments on this line; imperfect, but effective. - s/\(\*.*?\*\)//g; # Ignore (*...*) comments on this line; imperfect, but effective. - if (m/\bprogram\s+[A-Za-z]/i) {$is_pascal=1;} - if (m/\bunit\s+[A-Za-z]/i) {$is_pascal=1;} - if (m/\bmodule\s+[A-Za-z]/i) {$is_pascal=1;} - if (m/\bprocedure\b/i) {$is_pascal = 1; } - if (m/\bfunction\b/i) {$is_pascal = 1; } - if (m/^\s*interface\s+/i) {$is_pascal = 1; } - if (m/^\s*implementation\s+/i) {$is_pascal = 1; } - if (m/\bconstant\s+/i) {$is_pascal=1;} - if (m/\bbegin\b/i) { $found_begin = 1; } - if ((m/end\.\s*$/i) && ($found_begin = 1)) {$is_pascal = 1;} - if ($is_pascal) { - last; - } - } - - close(PASCAL_FILE); - return $is_pascal; -} # 1}}} -sub really_is_php { # {{{1 -# Given filename, returns TRUE if its contents really is php. - - my $filename = shift; - chomp($filename); - - my $is_php = 0; # Value to determine. - # Need to find a matching pair of surrounds, with ending after beginning: - my $normal_surround = 0; # - my $script_surround = 0; # ; bit 0 =