[MITgcm-support] MDSIO

Ganesh Gopalakrishnan ggopalakrishnan at ucsd.edu
Thu Oct 8 13:53:09 EDT 2009


Hi Matt,
The fname looks fine, like it starts with 'maskCtrlC'

I made the following changes in mdsio_gl.F and mdsio_gl_slice.F (for
both  3D,2D MDS read fields)

-----------------------------------------(same as old code)
C Assume nothing
      globalFile = .FALSE.
      fileIsOpen = .FALSE.
      IL=ILNBLNK( fName )
CMM(
      pIL = ILNBLNK( mdsioLocalDir )
CMM)


------------------------------------
C Assign special directory
      if ( pIL.EQ.0 ) then
       pfName= fName
      else
       write(pfName,'(2a)') mdsioLocalDir(1:pIL), fName(1:IL)
      endif
      pIL=ILNBLNK( pfName )
--------------------------------------
C If we are reading from a tiled MDS file then we open each one here
        if (.NOT. globalFile) then
         iG=bi+(ip-1)*nsx ! Kludge until unstructered tiles
         jG=bj+(jp-1)*nsy ! Kludge until unstructered tiles
         write(dataFname,'(2a,i3.3,a,i3.3,a)')
     &              pfName(1:pIL),'.',iG,'.',jG,'.data'
         inquire( file=dataFname, exist=exst )
C Of course, we only open the file if the tile is "active"
C (This is a place-holder for the active/passive mechanism
         if (exst) then
          if ( debugLevel .GE. debLevA ) then
           write(msgbuf,'(a,a)')
     &      ' MDSREADFIELD_GL: opening file: ',dataFName(1:pIL+13)
           call print_message( msgbuf, standardmessageunit,
     &                        SQUEEZE_RIGHT , mythid)
          endif
          length_of_rec=MDS_RECLEN( filePrec, sNx, mythid )
          open( dUnit, file=dataFName, status='old',
     &        access='direct', recl=length_of_rec )
          fileIsOpen=.TRUE.
CGG(
C         else
C          fileIsOpen=.FALSE.
C          write(msgbuf,'(a,a)')
C     &      ' MDSREADFIELD_GL: filename: ',dataFName(1:pIL+13)
C          call print_message( msgbuf, standardmessageunit,
C     &                        SQUEEZE_RIGHT , mythid)
C          call print_error( msgbuf, mythid )
C          write(msgbuf,'(a)')
C     &      ' MDSREADFIELD_GL: File does not exist'
C          call print_message( msgbuf, standardmessageunit,
C     &                        SQUEEZE_RIGHT , mythid)
C          call print_error( msgbuf, mythid )
C          stop 'ABNORMAL END: S/R MDSREADFIELD_GL'
CGG)
         endif
        endif 

--------------------------------------

with these changes I was able to pack.
But when reading using optim_readdata.f for linesearch, it fails at the
header check
--------------------------------
ce    Add some more checks. ...

      if (.NOT. lheaderonly) then
c--   Read the data.
-------------------------------

Thanks
Ganesh


On Thu, 2009-10-08 at 07:00 -0700, Matthew Mazloff wrote:
> Hi Ganesh,
> 
> Did you print what fname looks like.  Is this still the problem where  
> it has garbage at the end so it looks like, e.g.
> 
> fname =  
> 'xx_theta 
>                                                                                                            iuhdfsd98908 
> '
> 
> and is not properly opened.
> 
> Check to see if the file is properly opened...i.e. fileisopen = .TRUE.
> 
> -Matt
> 
> 
> 
> On Oct 7, 2009, at 10:30 PM, ggopalakrishnan at ucsd.edu wrote:
> 
> > Hi Patrick,
> >
> > The run.out error message is given below.
> >
> > PGFIO-F-219/formatted write/internal file/attempt to read/write past  
> > end
> > of record.
> > In source file mdsio_gl.f, at line number 2400
> >
> > I am using ECCO_CPP options
> > #undef  EXCLUDE_CTRL_PACK
> >
> > It fails when it calls MDSREADFIELD_3D_GL,
> > with the ivartype=1 ( ALLOW_THETA0_CONTROL), and mask maskCtrlC.
> >
> > Thank you
> > Ganesh
> >
> >
> >
> >>
> >> Hi there,
> >>
> >> could you be a bit more specific how it fails
> >> (error msg, in case there is one).
> >> Is it during read (I guess it is), and if so, which field?
> >>
> >> There's a possibility that your specific combination of options
> >> has never been used/tested (although I thought it has...).
> >>
> >> Cheers
> >> -p.
> >>
> >> On Oct 7, 2009, at 11:03 PM, Ganesh Gopalakrishnan wrote:
> >>
> >>> Hi all,
> >>> I am running state estimation, where I am trying to write the files
> >>> into
> >>> local directory by specifying "mdsioLocalDir" in the data file.
> >>>
> >>> I use
> >>> globalFiles=.false.,
> >>> useSingleCpuIO=.false.,
> >>>
> >>> The model fails to pack ecco cost/ctrl files, when I give
> >>> mdsioLocalDir.
> >>> I am curious whether anyone came across similar problem using local
> >>> directory.
> >>>
> >>> Any suggestions will be really helpful I am using MITgcm  
> >>> Checkpoint61T
> >>> version.
> >>>
> >>> Thank you
> >>> Ganesh Gopal
> >>>
> >>> _______________________________________________
> >>> MITgcm-support mailing list
> >>> MITgcm-support at mitgcm.org
> >>> http://mitgcm.org/mailman/listinfo/mitgcm-support
> >>
> >> ---
> >> Patrick Heimbach | heimbach at mit.edu | http://www.mit.edu/~heimbach
> >> MIT | EAPS 54-1518 | 77 Massachusetts Ave | Cambridge MA 02139 USA
> >> FON +1-617-253-5259 | FAX +1-617-253-4464 | SKYPE patrick.heimbach
> >>
> >>
> >> _______________________________________________
> >> MITgcm-support mailing list
> >> MITgcm-support at mitgcm.org
> >> http://mitgcm.org/mailman/listinfo/mitgcm-support
> >>
> >
> > _______________________________________________
> > MITgcm-support mailing list
> > MITgcm-support at mitgcm.org
> > http://mitgcm.org/mailman/listinfo/mitgcm-support
> 
> _______________________________________________
> MITgcm-support mailing list
> MITgcm-support at mitgcm.org
> http://mitgcm.org/mailman/listinfo/mitgcm-support



More information about the MITgcm-support mailing list