About read file *.D from NAVGEM

142 views
Skip to first unread message

zoj john

unread,
Jun 12, 2020, 10:45:29 AM6/12/20
to HYCOM.org Forum
Hello, everyone
I got the NAVGEM files (*.D) from HYCOM data server.
What is data format of these files and how to read it.
I do not know the detailed process of forcing  to netCDF converter so  I cannot convert the format according to the process given on the website.
I'd appreciate it if you could help me.
Many thanks to you!!

Michael McDonald

unread,
Jun 12, 2020, 2:08:40 PM6/12/20
to zoj john, HYCOM.org Forum
We added the tool doc for converting NAVGEM .D to Netcdf here,

https://www.hycom.org/dataserver/navgem

Forcing to netCDF Converter
The following code can be used to convert input forcing .D files into
netCDF files that are viewable with ncview or other software.

Did you follow these instructions?
https://www.hycom.org/tools/309-forcing-to-netcdf-converter
--
Michael McDonald
HYCOM.org Administrator

Alan Wallcraft

unread,
Jun 12, 2020, 2:56:14 PM6/12/20
to HYCOM.org Forum, 9574...@qq.com
The nrl2nc.f program is part of HYCOM-tools

It can sometimes be tricky to get HYCOM-tools to compile with netCDF, but nrl2nc is your best bet for converting the files.

The files are fortran unformatted sequential real*4 big-endian (so there is an integer record length before and after each data record).

C 4)  THE INPUT WIND FIELDS ON UNIT 71, ARE ON THE 'NATIVE' LAT-LON
C      GRID, STARTING AT THE POINT 'XFIN' EAST AND 'YFIN' NORTH WITH
C      'YFIN' NORTH WITH GRIDSIZE 'DXIN' BY 'DYIN' DEGREES.  A GAUSSIAN
C      LATITUDINAL GRID IS INDICATED BY SETTING 'DYIN' TO ZERO.  THE
C      INPUT ARRAY SIZE IS 'IWI' BY 'JWI', AND THERE ARE NO REPEATED
C      NODES (EVEN FOR GLOBAL DATA SETS).  THE CONTENTS OF EACH INPUT
C      FILE IS AS FOLLOWS:
C       RECORD 1:   A 40-CHARACTER TITLE
C       RECORD 2:   IWI,JWI,XFIN,YFIN,DXIN,DYIN,NREC,WDAY
C       RECORD 2+N: kPAR RECORD N, N=1...NREC.  NREC.LE.5999 (or 8999).
C
C     NREC IS THE NUMBER OF FLUX RECORDS, WDAY IS A 6000 ELEMENT ARRAY
C      WITH WDAY(N) HOLDING THE DATE OF FLUX RECORD N (FILE RECORD N+2)
C      W.R.T. JAN 1ST 1901.  WDAY(NREC+1) MUST HOLD THE EXPECTED FLUX
C      DATE FOR THE RECORD FOLLOWING THE LAST RECORD IN THE FILE.
C     BY CONVENTION, FLUX DATES BEFORE JAN 1ST 1905 INDICATE A
C      CLIMATOLOGY.  IN SUCH CASES THE CLIMATOLOGY'S LENGTH (PERIOD)
C      IS GIVEN BY  WDAY(NREC+1)-WDAY(1).
C     WDAY CAN NOW CONTAIN EITHER 6000 OR 9000 ELEMENTS, THE LATTER TO
C      ALLOW FOR ONE YEAR OF HOURLY FIELDS.

If you want to try doing your own conversion, there are also simple examples of reading a .D file and printing the range of each field in ~/HYCOM-tools/bin:

gordon01 113> ll wind_stat_range*.f
-rw-r--r-- 1 wallcraf 0375G018 4651 Apr 23  2019 wind_stat_range2.f
-rw-r--r-- 1 wallcraf 0375G018 4651 Apr 23  2019 wind_stat_range4.f
-rw-r--r-- 1 wallcraf 0375G018 4651 Apr 23  2019 wind_stat_range5.f
-rw-r--r-- 1 wallcraf 0375G018 4593 Apr 23  2019 wind_stat_range.f
-rw-r--r-- 1 wallcraf 0375G018 8003 Apr 23  2019 wind_stat_range_nc.f

These don't require netCDF.

Alan.
Reply all
Reply to author
Forward
0 new messages