Problems reading climatological files

Report or discuss software problems and other woes

Moderators: arango, robertson

Post Reply
Message
Author
elbio
Posts: 10
Joined: Sun Jul 06, 2003 9:16 pm
Location: U National S, Argentina

Problems reading climatological files

#1 Post by elbio » Wed Sep 21, 2011 12:58 pm

Hi:

I am having problems reading the climatological files (generated with
Roms_tools) using ROMS' version svn: $Id: Version 537. After compiling
with options

#define ZCLIMATOLOGY
#define M2CLIMATOLOGY
#define M3CLIMATOLOGY
#define TCLIMATOLOGY
#define ZCLM_NUDGING
#define M2CLM_NUDGING
#define M3CLM_NUDGING
#define TCLM_NUDGING

In run-time I've got:

GET_3DFLD - unable to find requested variable: temp_time
in input NetCDF file: roms_sa_clm_upw_low.nc

and the same for the temporal index variables v2d_time,
v3d_time, etc. It works for zeta_time.

I have checked the climatological file and these variables
are fine. It also works with ROMS older versions.

Has anyone experienced the same problem?.

Best regards,

elbio.

User avatar
susonic
Posts: 160
Joined: Tue Aug 21, 2007 5:44 pm
Location: Jeju National University
Contact:

Re: Problems reading climatological files

#2 Post by susonic » Thu Sep 22, 2011 12:58 am

Hi,

Did you check out the variables in varinfo.dat file whether they matches
with the variables in your climatology file?

elbio
Posts: 10
Joined: Sun Jul 06, 2003 9:16 pm
Location: U National S, Argentina

Re: Problems reading climatological files

#3 Post by elbio » Thu Sep 22, 2011 2:23 pm

Hi,

Thanks for your answer. Yes, I have checked the varinfo.dat
file. They have the same names.

Regards,

elbio.

User avatar
kate
Posts: 3780
Joined: Wed Jul 02, 2003 5:29 pm
Location: CFOS/UAF, USA

Re: Problems reading climatological files

#4 Post by kate » Thu Sep 22, 2011 5:16 pm

If the varinfo value fails, ROMS will also check the time attribute on your fields, such as this:

Code: Select all

        double hice(ocean_time, eta_rho, xi_rho) ;
                hice:_FillValue = -1.e+34 ;
                hice:long_name = "ice thickness climatology" ;
                hice:units = "meter" ;
                hice:field = "hice, scalar, series" ;
                hice:time = "ocean_time" ;
I think I recently had your troubles, which led me to fix a problem I had when setting the time attribute using a C-based code (such as ncatted).

elbio
Posts: 10
Joined: Sun Jul 06, 2003 9:16 pm
Location: U National S, Argentina

Re: Problems reading climatological files

#5 Post by elbio » Thu Sep 22, 2011 9:06 pm

Hi Kate:

I think that I do not understand the comment. I have
checked the climatological file and all time attributes
are well defined. Variables v3d_time, tclm_time, etc
have the same names and attributes as in varinfo.dat.
Do you mean that something could be missing in the climatological
file?. It is strange though, because the older version
reads the same file without problems.

Regards,

elbio.

User avatar
kate
Posts: 3780
Joined: Wed Jul 02, 2003 5:29 pm
Location: CFOS/UAF, USA

Re: Problems reading climatological files

#6 Post by kate » Thu Sep 22, 2011 9:39 pm

ROMS knows what time variable to look for based on:

a) the value in the varinfo.dat file for each variable.

or

b) the variable pointed to by the time attribute for each variable.

Take my hice example. I can have ice_time set in the varinfo.dat file for the ice thickness, but that variable doesn't exist. ROMS will then move on to look for a time attribute on hice. Do you have time attributes on your variables in the CLM file? If not, you can add them with ncatted from the NCO package.

In the past, I would have a problem when adding attributes with ncatted in that it would add a null character that ROMS couldn't handle (it's not in the variable name for ocean_time). I would then have to have my varinfo.dat times all correct. Last week I thought my varinfo.dat was correct, but the read still failed because of the null in my time attribute. That's when I fixed the null thing. Now we need to get Hernan to test the case of not having a time attribute set.

elbio
Posts: 10
Joined: Sun Jul 06, 2003 9:16 pm
Location: U National S, Argentina

Re: Problems reading climatological files

#7 Post by elbio » Thu Sep 22, 2011 11:12 pm

Hi Kate:

You were right. After adding the time attributes to
the variables in the CLM file the problem was solved.

Thanks for your advice.

Best regards,

elbio.

liyizhen837
Posts: 10
Joined: Tue Aug 21, 2007 5:44 pm
Location: North Carolina State University

Re: Problems reading climatological files

#8 Post by liyizhen837 » Tue Oct 18, 2011 6:16 pm

I encountered the same problem when using ncatted. Where is the null value from Kate?

Yizhen

User avatar
kate
Posts: 3780
Joined: Wed Jul 02, 2003 5:29 pm
Location: CFOS/UAF, USA

Re: Problems reading climatological files

#9 Post by kate » Wed Oct 19, 2011 12:46 am

In the C language, strings are always terminated with a null character. The problem is that Fortran doesn't know that and thinks that null is a meaningful part of the string. Where did it come from? ncatted was written in C.

liyizhen837
Posts: 10
Joined: Tue Aug 21, 2007 5:44 pm
Location: North Carolina State University

Re: Problems reading climatological files

#10 Post by liyizhen837 » Wed Oct 19, 2011 12:49 am

kate wrote:In the C language, strings are always terminated with a null character. The problem is that Fortran doesn't know that and thinks that null is a meaningful part of the string. Where did it come from? ncatted was written in C.
Thanks Kate.

Post Reply