Index: /issm/trunk-jpl/etc/environment.sh
===================================================================
--- /issm/trunk-jpl/etc/environment.sh	(revision 26366)
+++ /issm/trunk-jpl/etc/environment.sh	(revision 26367)
@@ -507,4 +507,5 @@
 if [ -d "${PROJ_ROOT}" ]; then
 	export PROJ_ROOT # Used in installation of GDAL
+	path_append "${PROJ_ROOT}/bin"
 	dyld_library_path_append "${PROJ_ROOT}/lib"
 	ld_library_path_append "${PROJ_ROOT}/lib"
Index: /issm/trunk-jpl/externalpackages/proj/install-8.sh
===================================================================
--- /issm/trunk-jpl/externalpackages/proj/install-8.sh	(revision 26367)
+++ /issm/trunk-jpl/externalpackages/proj/install-8.sh	(revision 26367)
@@ -0,0 +1,44 @@
+#!/bin/bash
+set -eu
+
+
+# Constants
+#
+VER="8.1.0"
+
+PREFIX="${ISSM_DIR}/externalpackages/proj/install" # Set to location where external package should be installed
+
+## Environment
+#
+export CC=mpicc
+export CXX=mpicxx
+
+# Cleanup
+rm -rf ${PREFIX} src
+mkdir -p ${PREFIX} src
+
+# Download source
+$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/proj-${VER}.tar.gz" "proj-${VER}.tar.gz"
+
+# Unpack source
+tar -zxvf proj-${VER}.tar.gz
+
+# Move source into 'src' directory
+mv proj-${VER}/* src
+rm -rf proj-${VER}
+
+# Configure
+cd src
+./configure \
+	--prefix="${PREFIX}" \
+	--disable-dependency-tracking \
+	--enable-fast-install
+
+# Compile and install
+if [ $# -eq 0 ]; then
+	make
+	make install
+else
+	make -j $1
+	make -j $1 install
+fi
Index: /issm/trunk-jpl/src/c/modules/CoordinateSystemTransformx/CoordinateSystemTransformx.cpp
===================================================================
--- /issm/trunk-jpl/src/c/modules/CoordinateSystemTransformx/CoordinateSystemTransformx.cpp	(revision 26366)
+++ /issm/trunk-jpl/src/c/modules/CoordinateSystemTransformx/CoordinateSystemTransformx.cpp	(revision 26367)
@@ -4,15 +4,40 @@
 
 /*Header files*/
+#include <proj.h>
+
 #include "./CoordinateSystemTransformx.h"
 #include "../../shared/shared.h"
 #include "../../toolkits/toolkits.h"
-#define ACCEPT_USE_OF_DEPRECATED_PROJ_API_H
-#include <proj_api.h>
 
 void CoordinateSystemTransformx(double** px_dest,double** py_dest,double* x_src,double* y_src,int size,const char* str_src,const char* str_dst){
 
-#if !defined(_HAVE_PROJ_)
-	_error_("proj not installed");
+/*
+	NOTE:
+	- Compilation of this module is fenced in Makefile.am, so we do not 
+	have to check again if _HAVE_PROJ_ is defined
+	- As of at least PROJ 8, version macros are defined,
+
+		https://proj.org/development/reference/macros.html
+*/
+#if !defined(PROJ_VERSION_MAJOR) || !PROJ_AT_LEAST_VERSION(8, 0, 0)
+	_error_("PROJ major version >= 8 required");
 #else
+	/*
+	Converts an array of longitude (x_src) and array of latitude (y_src) in the 
+	projection described by str_src to the projection described by str_dest.
+
+	NOTE:
+	- API types and calls have been migrated from PROJ 4 to PROJ 6. See SVN 
+	revision history for changes.
+
+	Sources:
+	- https://proj.org/development/migration.html
+	- https://www.gaia-gis.it/fossil/libspatialite/wiki?name=PROJ.6
+
+	TODO:
+	- Because transformations are done in place, we could save memory and time 
+	by simply passing in x_src and y_src and removing the px_dest and py_dest 
+	parameters entirely?
+	*/
 
 	/*Allocate output and initialize values as src*/
@@ -20,4 +45,5 @@
 	double* x_dest = xNew<double>(size);
 	double* y_dest = xNew<double>(size);
+
 	for(int i=0;i<size;i++){
 		x_dest[i] = x_src[i];
@@ -25,13 +51,25 @@
 	}
 
-	/*Create proj.4 projection objects for src and dst*/
-	projPJ pj_src  = pj_init_plus(str_src);
-	projPJ pj_dst  = pj_init_plus(str_dst);
-	if(!pj_src) _error_("Failed to initialize PROJ with source projection \""    <<str_src<<"\"\n");
-	if(!pj_dst) _error_("Failed to initialize PROJ with destination projection\""<<str_dst<<"\"\n");
+	PJ *P;
+	size_t sx = sizeof(double);
+	size_t sy = sizeof(double);
+	size_t nx = size;
+	size_t ny = size;
 
-	/*Perform transformation*/
-	int p = pj_transform(pj_src,pj_dst,size,1,x_dest,y_dest,NULL);
-	if(p!=0) _error_("Reprojection failed, PROJ error code: "<<p<<"\n");
+	P = proj_create_crs_to_crs(PJ_DEFAULT_CTX,str_src,str_dst,NULL);
+
+	if ( 0 == P ) {
+		proj_destroy(P);
+		_error_("failed to initialize CRS transformation object");
+	}
+
+	int p = proj_trans_generic(P, PJ_FWD, x_dest, sx, nx, y_dest, sy, ny, 0, 0, 0, 0, 0, 0);
+
+	if ( 0 == p ){
+		proj_destroy(P);
+		_error_("no successful transformations");
+	}
+
+	proj_destroy(P);
 
 	/*Output : */
Index: /issm/trunk-jpl/src/m/modules/CoordTransform.m
===================================================================
--- /issm/trunk-jpl/src/m/modules/CoordTransform.m	(revision 26366)
+++ /issm/trunk-jpl/src/m/modules/CoordTransform.m	(revision 26367)
@@ -10,8 +10,8 @@
 %
 %   Example of Projections:
-%      
+%
 %   lat/lon = '+init=epsg:4326'
 %   lat/lon = '+proj=longlat +datum=WGS84'
-%   
+%
 %   ll2xy default equivalent (uses with Hugues Ellispoid S)
 %   Greenland = '+proj=stere +lat_0=90 +lat_ts=70 +lon_0=-45 +k=1 +x_0=0 +y_0=0 +a=6378273 +b=6356889.448564109 +units=m +no_defs'
@@ -19,7 +19,9 @@
 %   Bamber Greenland = '+proj=stere +lat_0=90 +lat_ts=71 +lon_0=-39 +k=1 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m +no_defs'
 %
-%   for latitude/longitude, x is longitude and y latitude and the angles are in rad
+%   For latitude/longitude, x is longitude and y latitude and the angles are in 
+%   rad
 %
-%   This function will only work of PROJ has been installed in externalpackages
+%   This function will only work if PROJ has been installed and --with-proj-dir 
+%   option has been set to its location in ISSM configuration
 
 % Check usage
Index: /issm/trunk-jpl/src/wrappers/CoordTransform/CoordTransform.cpp
===================================================================
--- /issm/trunk-jpl/src/wrappers/CoordTransform/CoordTransform.cpp	(revision 26366)
+++ /issm/trunk-jpl/src/wrappers/CoordTransform/CoordTransform.cpp	(revision 26367)
@@ -3,69 +3,109 @@
  */
 
+/*Header files*/
+#include <proj.h>
+
 #include "./CoordTransform.h"
-#define ACCEPT_USE_OF_DEPRECATED_PROJ_API_H
-#include <proj_api.h>
 
-void CoordTransformUsage(void){/*{{{*/
-	_printf_(" type help CoordTransform\n");
-}/*}}}*/
-WRAPPER(CoordTransform_python){
-	
-	/*intermediary: */
-	double *xin     = NULL;
-   double *yin     = NULL;
-   char   *projin  = NULL;
-   char   *projout = NULL;
-   int     M,N;
-   int     test1,test2;
+/*
+	NOTE:
+	- Compilation of this module is fenced in Makefile.am, so we do not 
+	have to check again if _HAVE_PROJ_ is defined
+	- As of at least PROJ 8, version macros are defined,
 
-	printf("%i %i %i %i\n",NLHS,nlhs,NRHS,nrhs);
+		https://proj.org/development/reference/macros.html
+*/
+#if !defined(PROJ_VERSION_MAJOR)
+	_error_("PROJ major version >= 8 required");
+#else
+	/*
+	Converts an array of longitude (x_src) and array of latitude (y_src) in the 
+	projection described by str_src to the projection described by str_dest.
 
-	/*Boot module: */
-	MODULEBOOT();
+	NOTE:
+	- API types and calls have been migrated from PROJ 4 to PROJ 6. See SVN 
+	revision history for changes.
 
-	/*checks on arguments: */
-	CHECKARGUMENTS(NLHS,NRHS,&CoordTransformUsage);
+	Sources:
+	- https://proj.org/development/migration.html
+	- https://www.gaia-gis.it/fossil/libspatialite/wiki?name=PROJ.6
+	*/
 
-	/*Fetch data needed for meshing: */
-	FetchData(&xin,&M,&N,XIN);
-   FetchData(&yin,&test1,&test2,YIN);
-   if(!M*N)     _error_("no coordinate provided");
-   if(test1!=M) _error_("x and y do not have the same size");
-   if(test2!=N) _error_("x and y do not have the same size");
-   FetchData(&projin,PROJIN);
-   FetchData(&projout,PROJOUT);
+	void CoordTransformUsage(void){/*{{{*/
+		_printf_(" type help CoordTransform\n");
+	}/*}}}*/
+	WRAPPER(CoordTransform_python){
+		/*intermediary: */
+		double *xin     = NULL;
+		double *yin     = NULL;
+		char   *projin  = NULL;
+		char   *projout = NULL;
+		int     M,N;
+		int     test1,test2;
 
-	/*Initialize output*/
-	double* xout = xNew<double>(M*N);
-	double* yout = xNew<double>(M*N);
+		/*Boot module: */
+		MODULEBOOT();
 
-	/*Initialize projections*/
-	projPJ pj_src = pj_init_plus(projin);
-	projPJ pj_dst = pj_init_plus(projout);
-	if(!pj_src) _error_("Failed to initialize PROJ with source projection\n");
-	if(!pj_dst) _error_("Failed to initialize PROJ with destination projection\n");
+		/*checks on arguments: */
+		CHECKARGUMENTS(NLHS,NRHS,&CoordTransformUsage);
 
-	/*Transform coordinates*/
-	int p = pj_transform(pj_src,pj_dst,M*N,1,xout,yout,NULL);
-	if(p!=0){
-		_error_("PROJ failed with error code: "<<p);
+		/*Fetch data needed for meshing: */
+		FetchData(&xin,&M,&N,XIN);
+		FetchData(&yin,&test1,&test2,YIN);
+		if(!M*N)     _error_("no coordinate provided");
+		if(test1!=M) _error_("x and y do not have the same size");
+		if(test2!=N) _error_("x and y do not have the same size");
+		FetchData(&projin,PROJIN);
+		FetchData(&projout,PROJOUT);
+
+		/*Calculate size once*/
+		int size = M*N;
+
+		/*Initialize output*/
+		double* xout = xNew<double>(size);
+		double* yout = xNew<double>(size);
+
+		for(int i=0;i<size;i++){
+			xout[i] = xin[i];
+			yout[i] = yin[i];
+		}
+
+		PJ *P;
+		size_t sx = sizeof(double);
+		size_t sy = sizeof(double);
+		size_t nx = size;
+		size_t ny = size;
+
+		P = proj_create_crs_to_crs(PJ_DEFAULT_CTX,projin,projout,NULL);
+
+		if ( 0 == P ) {
+			proj_destroy(P);
+			_error_("failed to initialize CRS transformation object");
+		}
+
+		int p = proj_trans_generic(P, PJ_FWD, xout, sx, nx, yout, sy, ny, 0, 0, 0, 0, 0, 0);
+
+		if ( 0 == p ){
+			proj_destroy(P);
+			_error_("no successful transformations");
+		}
+
+		proj_destroy(P);
+
+		/*write outputs: */
+		WriteData(XOUT,xout,M,N);
+		WriteData(YOUT,yout,M,N);
+
+		/*Clean-up and return*/
+		xDelete<double>(xin);
+		xDelete<double>(yin);
+		xDelete<double>(xout);
+		xDelete<double>(yout);
+		xDelete<char>(projin);
+		xDelete<char>(projout);
+
+		/*end module: */
+		MODULEEND();
 	}
 
-	/*write outputs: */
-	WriteData(XOUT,xout,M,N);
-	WriteData(YOUT,yout,M,N);
-
-	/*Clean-up and return*/
-   mxFree(projin);
-   mxFree(projout);
-	xDelete<double>(xin);
-	xDelete<double>(yin);
-	xDelete<double>(xout);
-	xDelete<double>(yout);
-	xDelete<char>(projin);
-	xDelete<char>(projout);
-
-	/*end module: */
-	MODULEEND();
-}
+#endif
Index: /issm/trunk-jpl/src/wrappers/CoordTransform/CoordTransform.h
===================================================================
--- /issm/trunk-jpl/src/wrappers/CoordTransform/CoordTransform.h	(revision 26366)
+++ /issm/trunk-jpl/src/wrappers/CoordTransform/CoordTransform.h	(revision 26367)
@@ -17,13 +17,9 @@
 #endif
 
-#ifdef _HAVE_JAVASCRIPT_MODULES_
-#undef _DO_NOT_LOAD_GLOBALS_ /*only module where this needs to be undefined, so as to 
-							   not include IssmComm several times in the javascript Modle construct.*/
-#endif
-
 /*Header files: */
 #include "../bindings.h"
+#include "../../c/main/globals.h"
+#include "../../c/modules/modules.h"
 #include "../../c/shared/shared.h"
-#include "../../c/shared/io/io.h"
 
 #undef __FUNCT__ 
