[ccm-users] Bug in CCSM2

Dave Pierce dpierce@ucsd.edu
Mon, 8 Jul 2002 09:29:04 -0700 (PDT)


Hi folks,

there seems to be a bug in ccsm's file
models/atm/cam/src/control/ccsm_msg.F90, around line 1485.  Right now the
code looks like this:

#if (defined SPMD)
    do n=1,nrcv
       do lat=1,plat
          arget_buf(:,n,lat) = arget(:,lat,n)
       end do
    end do

Problem is, arget_buf is only allocated for the master processor.  You
might expect this would cause strange errors on some platforms, with
rather hard to trace and non-reproducable results.  I think it should
instead be:

#if (defined SPMD)
    if ( masterproc ) then
        do n=1,nrcv
           do lat=1,plat
              arget_buf(:,n,lat) = arget(:,lat,n)
           end do
        end do
    endif

Perhaps one of the model coders could verify this conjecture.

Also, in file models/ice/csim4/src/source/ice_itd.F, around line 163, the
original code is like this:

      if (my_task.eq.master_task) then
        write (6,*) ''
        write (6,*) 'hin_max(nc-1) < Cat nc < hin_max(nc)'

For some reason (probably compiler bug) this causes a failure on the PGI
compilers version 3.2-4 (haven't tried the version 4 compilers yet).  What
happens is that the ice model halts with an I/O (permission denied) error
to the output file.  It works if you instead have:

      if (my_task.eq.master_task) then
        write (6,*) ' '
        write (6,*) 'hin_max(nc-1) < Cat nc < hin_max(nc)'

Note that the difference is writing a single space to the output file in
the second line, rather than a null string.

Regards,

--Dave

---------------------------------------------------------------
David W. Pierce                     / Climate Research Division
Scripps Institution of Oceanography / (858) 534-8276 (voice)
dpierce@ucsd.edu                    / (858) 534-8561 (fax)
---------------------------------------------------------------