Saturday, December 10, 2016

fix for running CAM3 on TACC supercomputer facility

CAM3 won't run at TACC out of the box,. It will fail to read the namelist file, as the nodes can't read from stdin. This may apply to other HPC setups as well.

Here's my fix.

Copy the following text to a file called patchCAM


diff -ru cam1/models/atm/cam/src/control/runtime_opts.F90 ../CAM3/cam1/models/atm/cam/src/control/runtime_opts.F90
--- cam1/models/atm/cam/src/control/runtime_opts.F90 2005-03-08 11:06:36.000000000 -0600
+++ ../CAM3/cam1/models/atm/cam/src/control/runtime_opts.F90 2012-02-15 17:57:05.000000000 -0600
@@ -1065,7 +1065,15 @@
!
! Read in the camexp namelist from standard input
!
- read (5,camexp,iostat=ierr)
+! read (5,camexp,iostat=ierr)
+
+
+ open(16,file='namelist',iostat = ierr)
+ write(6,*) 'READING NAMELIST'
+ read(16, camexp)
+ write(6,*) 'FINISHED READING NAMELIST'
+
+
if (ierr /= 0) then
write(6,*)'READ_NAMELIST: Namelist read returns ',ierr
call endrun
diff -ru cam1/models/lnd/clm2/src/main/controlMod.F90 ../CAM3/cam1/models/lnd/clm2/src/main/controlMod.F90
--- cam1/models/lnd/clm2/src/main/controlMod.F90 2005-04-08 13:27:10.000000000 -0500
+++ ../CAM3/cam1/models/lnd/clm2/src/main/controlMod.F90 2012-02-16 15:26:58.000000000 -0600
@@ -369,7 +369,14 @@
fsurdat=lsmsurffile
finidat=lsminifile
#else
- read(5, clmexp, iostat=ierr)
+ ! read (5,camexp,iostat=ierr)
+
+
+ ! open(16,file='namelist',iostat = ierr)
+ write(6,*) 'READING NAMELIST 2'
+ read(16, clmexp, iostat = ierr)
+ write(6,*) 'FINISHED READING NAMELIST 2'
+
if (ierr /= 0) then
if (masterproc) then
write(6,*)'error: namelist input resulted in error code ',ierr


Go to the directory above cam1 where you unpacked the source and issue


patch -p0 < patchCAM