<p><b>mpetersen@lanl.gov</b> 2011-11-02 09:14:37 -0600 (Wed, 02 Nov 2011)</p><p>Add new Makefile sections for three nersc compilers: pgi, pathfinder, and intel.  Needed to make a few small code changes to standard fortran 90 for pathfinder to compile.  These three now compile and run on nersc hopper.<br>
</p><hr noshade><pre><font color="gray">Modified: trunk/mpas/Makefile
===================================================================
--- trunk/mpas/Makefile        2011-11-02 02:36:16 UTC (rev 1162)
+++ trunk/mpas/Makefile        2011-11-02 15:14:37 UTC (rev 1163)
@@ -1,6 +1,7 @@
 #MODEL_FORMULATION = -DNCAR_FORMULATION
 MODEL_FORMULATION = -DLANL_FORMULATION
 
+# This flag must be off for nersc hopper:
 FILE_OFFSET = -DOFFSET64BIT
 
 #########################
@@ -56,6 +57,18 @@
         &quot;CORE = $(CORE)&quot; \
         &quot;CPPFLAGS = -DRKIND=8 $(MODEL_FORMULATION) -D_MPI -DUNDERSCORE $(FILE_OFFSET) $(ZOLTAN_DEFINE)&quot; )
 
+pgi-nersc:
+        ( make all \
+        &quot;FC = ftn&quot; \
+        &quot;CC = cc&quot; \
+        &quot;SFC = ftn&quot; \
+        &quot;SCC = cc&quot; \
+        &quot;FFLAGS = -r8 -O3 -byteswapio -Mfree&quot; \
+        &quot;CFLAGS = -O3&quot; \
+        &quot;LDFLAGS = -O3&quot; \
+        &quot;CORE = $(CORE)&quot; \
+        &quot;CPPFLAGS = -DRKIND=8 $(MODEL_FORMULATION) -D_MPI -DUNDERSCORE $(FILE_OFFSET) $(ZOLTAN_DEFINE)&quot; )
+
 pgi-llnl:
         ( make all \
         &quot;FC = mpipgf90&quot; \
@@ -178,7 +191,42 @@
         &quot;CORE = $(CORE)&quot; \
         &quot;CPPFLAGS = -DRKIND=8 $(MODEL_FORMULATION) -DUNDERSCORE $(FILE_OFFSET) $(ZOLTAN_DEFINE)&quot; )
 
+pathscale-nersc:
+        ( make all \
+        &quot;FC = ftn&quot; \
+        &quot;CC = cc&quot; \
+        &quot;SFC = ftn&quot; \
+        &quot;SCC = cc&quot; \
+        &quot;FFLAGS = -r8 -O3 -freeform -extend-source&quot; \
+        &quot;CFLAGS = -O3&quot; \
+        &quot;LDFLAGS = -O3&quot; \
+        &quot;CORE = $(CORE)&quot; \
+        &quot;CPPFLAGS = -DRKIND=8 $(MODEL_FORMULATION) -D_MPI -DUNDERSCORE $(FILE_OFFSET) $(ZOLTAN_DEFINE)&quot; )
 
+cray-nersc:
+        ( make all \
+        &quot;FC = ftn&quot; \
+        &quot;CC = cc&quot; \
+        &quot;SFC = ftn&quot; \
+        &quot;SCC = cc&quot; \
+        &quot;FFLAGS = -default64 -O3 -f free&quot; \
+        &quot;CFLAGS = -O3&quot; \
+        &quot;LDFLAGS = -O3&quot; \
+        &quot;CORE = $(CORE)&quot; \
+        &quot;CPPFLAGS = -DRKIND=8 $(MODEL_FORMULATION) -D_MPI -DUNDERSCORE $(FILE_OFFSET) $(ZOLTAN_DEFINE)&quot; )
+
+intel-nersc:
+        ( make all \
+        &quot;FC = ftn&quot; \
+        &quot;CC = cc&quot; \
+        &quot;SFC = ftn&quot; \
+        &quot;SCC = cc&quot; \
+        &quot;FFLAGS = -real-size 64 -O3 -FR&quot; \
+        &quot;CFLAGS = -O3&quot; \
+        &quot;LDFLAGS = -O3&quot; \
+        &quot;CORE = $(CORE)&quot; \
+        &quot;CPPFLAGS = -DRKIND=8 $(MODEL_FORMULATION) -D_MPI -DUNDERSCORE $(FILE_OFFSET) $(ZOLTAN_DEFINE)&quot; )
+
 CPPINCLUDES = -I../inc -I$(NETCDF)/include -I$(PAPI)/include
 FCINCLUDES = -I../inc -I$(NETCDF)/include -I$(PAPI)/include
 LIBS = -L$(NETCDF)/lib -lnetcdf $(PAPILIBS)

Modified: trunk/mpas/src/core_ocean/mpas_ocn_mpas_core.F
===================================================================
--- trunk/mpas/src/core_ocean/mpas_ocn_mpas_core.F        2011-11-02 02:36:16 UTC (rev 1162)
+++ trunk/mpas/src/core_ocean/mpas_ocn_mpas_core.F        2011-11-02 15:14:37 UTC (rev 1163)
@@ -79,7 +79,7 @@
       call ocn_equation_of_state_init(err_tmp)
       err = err .or. err_tmp
 
-      if(err) then
+      if(err.eq.1) then
           call mpas_dmpar_abort(dminfo)
       endif
 

Modified: trunk/mpas/src/core_ocean/mpas_ocn_test_cases.F
===================================================================
--- trunk/mpas/src/core_ocean/mpas_ocn_test_cases.F        2011-11-02 02:36:16 UTC (rev 1162)
+++ trunk/mpas/src/core_ocean/mpas_ocn_test_cases.F        2011-11-02 15:14:37 UTC (rev 1163)
@@ -483,7 +483,7 @@
       real (kind=RKIND), intent(in) :: theta
 
       aa = 0.5 * w * (2.0 * omega + w) * cos(theta)**2.0 + &amp;
-          0.25 * K**2.0 * cos(theta)**(2.0*R) * ((R+1.0)*cos(theta)**2.0 + 2.0*R**2.0 - R - 2.0 - 2.0*R**2*cos(theta)**-2.0)
+          0.25 * K**2.0 * cos(theta)**(2.0*R) * ((R+1.0)*cos(theta)**2.0 + 2.0*R**2.0 - R - 2.0 - 2.0*R**2*cos(theta)**(-2.0))
 
    end function aa
 

</font>
</pre>