Re: [AMBER] Reading NetCDF file

From: Uday Midya <umidya.iitkgp.gmail.com>
Date: Sat, 5 Oct 2013 11:03:12 +0530

Hi,
I use the following f77 code to read the NAMD generated DCD file

      integer dummyi,natom
      real dummyr,x(*),y(*),z(*)
      double precision bx,bx1,by,by1,bz1,bz

      open(10,file='file.dcd',status='old',form='unformatted')
      read(10)dummyc,nframes,(dummyi,i=1,8),dummyr,(dummyi,i=1,9)
      read(10)dummyi,dummyr
      read(10)natom
      do 1000 ii=1,nframes
      read(inunit)bx,bx1,by,by1,bz1,bz
      read(inunit)(x(j),j=1,natom)
      read(inunit)(y(j),j=1,natom)
      read(inunit)(z(j),j=1,natom)
      1000 continue

the code is compiled with
f77 -m32 code.f -o code

But for the ptraj/cpptraj DCD file with box information generated from the
amber12 binary mdcrd file following error appears during the exicution

start: end of file
apparent state: unit 10 named file.dcd
last format: list io
lately reading sequential unformatted external IO
Aborted


Is there such 10-12 line fortran code to read binary mdcrd file (NetCDF).

Thanks

Uday
On Fri, Oct 4, 2013 at 7:35 PM, Daniel Roe <daniel.r.roe.gmail.com> wrote:

> Hi,
>
> On Fri, Oct 4, 2013 at 6:46 AM, Uday Midya <umidya.iitkgp.gmail.com>
> wrote:
> > I have tried to read a dcd file generated from the mdcrd file by ptraj
> > module. The code that I used works fine with the NAMD generated dcd file.
> > But it fails to read the ptraj generated one.
>
> Can you describe how it fails in a little more detail (coordinates are
> garbled, box information is wrong etc)? If you can give more specific
> details we may be able to help more. Also, do DCD files generated with
> cpptraj have the same issues for you?
>
> > Can any one give me a fortran code or some tips for the reading of
> amber12
> > binary trajectory file or the ptraj generated dcd file with/without box
> > information.
>
> As far as I know there is no Fortran code in Amber that reads/writes
> DCD files. For examples in C/C++ you can see what happens under the
> hood in ptraj in trajectory.c (functions readCharmmTrajectory() and
> dumpCharmmTrajectory()) or in cpptraj in Traj_CharmmDcd.cpp.
>
> -Dan
>
> --
> -------------------------
> Daniel R. Roe, PhD
> Department of Medicinal Chemistry
> University of Utah
> 30 South 2000 East, Room 201
> Salt Lake City, UT 84112-5820
> http://home.chpc.utah.edu/~cheatham/
> (801) 587-9652
> (801) 585-6208 (Fax)
>
> _______________________________________________
> AMBER mailing list
> AMBER.ambermd.org
> http://lists.ambermd.org/mailman/listinfo/amber
>



-- 
Uday Sankar Midya
IIT Kharagpur
West Bengal
On Fri, Oct 4, 2013 at 7:35 PM, Daniel Roe <daniel.r.roe.gmail.com> wrote:
> Hi,
>
> On Fri, Oct 4, 2013 at 6:46 AM, Uday Midya <umidya.iitkgp.gmail.com>
> wrote:
> > I have tried to read a dcd file generated from the mdcrd file by ptraj
> > module. The code that I used works fine with the NAMD generated dcd file.
> > But it fails to read the ptraj generated one.
>
> Can you describe how it fails in a little more detail (coordinates are
> garbled, box information is wrong etc)? If you can give more specific
> details we may be able to help more. Also, do DCD files generated with
> cpptraj have the same issues for you?
>
> > Can any one give me a fortran code or some tips for the reading of
> amber12
> > binary trajectory file or the ptraj generated dcd file with/without box
> > information.
>
> As far as I know there is no Fortran code in Amber that reads/writes
> DCD files. For examples in C/C++ you can see what happens under the
> hood in ptraj in trajectory.c (functions readCharmmTrajectory() and
> dumpCharmmTrajectory()) or in cpptraj in Traj_CharmmDcd.cpp.
>
> -Dan
>
> --
> -------------------------
> Daniel R. Roe, PhD
> Department of Medicinal Chemistry
> University of Utah
> 30 South 2000 East, Room 201
> Salt Lake City, UT 84112-5820
> http://home.chpc.utah.edu/~cheatham/
> (801) 587-9652
> (801) 585-6208 (Fax)
>
> _______________________________________________
> AMBER mailing list
> AMBER.ambermd.org
> http://lists.ambermd.org/mailman/listinfo/amber
>
-- 
Uday Sankar Midya
IIT Kharagpur
West Bengal
On Fri, Oct 4, 2013 at 7:35 PM, Daniel Roe <daniel.r.roe.gmail.com> wrote:
> Hi,
>
> On Fri, Oct 4, 2013 at 6:46 AM, Uday Midya <umidya.iitkgp.gmail.com>
> wrote:
> > I have tried to read a dcd file generated from the mdcrd file by ptraj
> > module. The code that I used works fine with the NAMD generated dcd file.
> > But it fails to read the ptraj generated one.
>
> Can you describe how it fails in a little more detail (coordinates are
> garbled, box information is wrong etc)? If you can give more specific
> details we may be able to help more. Also, do DCD files generated with
> cpptraj have the same issues for you?
>
> > Can any one give me a fortran code or some tips for the reading of
> amber12
> > binary trajectory file or the ptraj generated dcd file with/without box
> > information.
>
> As far as I know there is no Fortran code in Amber that reads/writes
> DCD files. For examples in C/C++ you can see what happens under the
> hood in ptraj in trajectory.c (functions readCharmmTrajectory() and
> dumpCharmmTrajectory()) or in cpptraj in Traj_CharmmDcd.cpp.
>
> -Dan
>
> --
> -------------------------
> Daniel R. Roe, PhD
> Department of Medicinal Chemistry
> University of Utah
> 30 South 2000 East, Room 201
> Salt Lake City, UT 84112-5820
> http://home.chpc.utah.edu/~cheatham/
> (801) 587-9652
> (801) 585-6208 (Fax)
>
> _______________________________________________
> AMBER mailing list
> AMBER.ambermd.org
> http://lists.ambermd.org/mailman/listinfo/amber
>
-- 
Uday Sankar Midya
IIT Kharagpur
West Bengal
_______________________________________________
AMBER mailing list
AMBER.ambermd.org
http://lists.ambermd.org/mailman/listinfo/amber
Received on Fri Oct 04 2013 - 23:00:03 PDT
Custom Search