ROMS/TOMS Developers

Algorithms Update Web Log
« Previous Page

kate - August 29, 2006 @ 18:24
Forcing field interpolation option- Comments (2)

I’m trying this option for the first time and came across a little bug: the horizontal grid for the global CCSM CORE files have more points than my little ROMS grid. In nf_fread2d.F, wrk is dimensioned:

real(r8), dimension(2+(Lm(ng)+2)*(Mm(ng)+2)) :: wrk

This isn’t big enough in my case. Why not make it allocatable?

Also, I would dearly love to see the winds handled in the same way as all the other fields. I know it would get tricky if we wanted to say use WRF on it’s rotated grid to drive ROMS on another rotated grid, but CCSM should be simple enough. I’ll look into it.


kate - August 9, 2006 @ 14:07
Initialization and I/O- Comments (1)

Two of my biological ROMS associates came to me with a problem. We tracked it down to mod_average.F, which should have this code:

        DO itrc=1,NT(ng)
          DO k=1,N(ng)
            DO i=Imin,Imax
              AVERAGE(ng) % avgt(i,j,k,itrc) = IniVal
            END DO
            END DO
          END DO
        END DO
#  ifdef AVERAGES_QUADRATIC
        DO itrc=1,NAT
          DO k=1,N(ng)
            DO i=Imin,Imax
              AVERAGE(ng) % avgTT(i,j,k,itrc) = IniVal
              AVERAGE(ng) % avgUT(i,j,k,itrc) = IniVal
              AVERAGE(ng) % avgVT(i,j,k,itrc) = IniVal
            END DO 
          END DO
        END DO
#  endif

It was failing in the NetCDF write of avgt(:,:.:,3) (Nitrate). When ROMS dies in this situation, it says it has trouble in the write from wrt_avg of Nitrate, but it doesn’t give the NetCDF error message. I would like to see us not only check for errors, but print out the NetCDF error from the error code. I have a f90 code which uses this function:

  subroutine check(status)
    integer, intent(in) :: status
    if (status /= nf90_noerr) then
      print *, nf90_strerror(status)
      call exit(1)
    endif
  end subroutine check

It is used like this:

   call check(nf90_inq_varid(fileID, 'vals_nod_var', varid))
   call check(nf90_put_var(fileID, varid, size, &
          start = (/ 1, 1, 1 /), count = (/ nnodes, 1, 1 /) ))