hour or day

Bug reports, work arounds and fixes

Moderators: arango, robertson

Post Reply
Message
Author
jafar1979
Posts: 37
Joined: Sat Feb 18, 2012 6:51 pm
Location: inioas

hour or day

#1 Unread post by jafar1979 »

Dear Prof.Arango
i guess that time unit of force file which created by d_ecmwf2roms.m should be hours not days :?: . My reason is :created force file have time size equal to 3hourly ecmwf data (both of them have 2920 time steps for one year), Therefore their units should be equal too?is not it?

Code: Select all

S.Variables(4).Attributes(iatt).Value = ['days since ' datestr(mybasedate,31)];
Please if i am on wrong tell me?
Happy New Year :D

jafar

User avatar
arango
Site Admin
Posts: 1367
Joined: Wed Feb 26, 2003 4:41 pm
Location: DMCS, Rutgers University
Contact:

Re: hour or day

#2 Unread post by arango »

Nope. The time variable (sms_time, srf_time, shf_time, or swf_time) in the NetCDF file created by the script d_ecmwf2roms.m is in days :!: The number of time records in a NetCDF file is independent of the units of the time coordinate. In ROMS, the default is to provide the units for the forcing fields as days since a reference time.

You are confusing the units given by the ERA file:

Code: Select all

dimensions:

        time = 2920 ;

variables:

        int time(time) ;
                time:units = "hours since 1900-01-01 00:00:0.0" ;
                time:long_name = "time" ;
In a leap year, you will have 2928 time records. Otherwise, you will get 2920 time records.

You cannot use directly the file generated by ERA into ROMS :!: We need to process the ERA fields to get the correct force for ROMS. Just check the time variable for the ROMS forcing NetCDF files. For example, we can have:

Code: Select all

	double sms_time(sms_time) ;
		sms_time:long_name = "surface momentum stress time" ;
		sms_time:units = "days since 2000-01-01 00:00:00" ;
		sms_time:calendar = "gregorian" ;

...

data:

 sms_time = 0.0625, 0.1875, 0.3125, 0.4375, 0.5625, 0.6875, 0.8125, 0.9375, 
    1.0625, 1.1875, 1.3125, 1.4375, 1.5625, 1.6875, 1.8125, 1.9375, 2.0625, 
    2.1875, 2.3125, 2.4375, 2.5625, 2.6875, 2.8125, 2.9375, 3.0625, 3.1875, 
    3.3125, 3.4375, 3.5625, 3.6875, 3.8125, 3.9375, 4.0625, 4.1875, 4.3125, 
    4.4375, 4.5625, 4.6875, 4.8125, 4.9375, 5.0625, 5.1875, 5.3125, 5.4375, 
...

jafar1979
Posts: 37
Joined: Sat Feb 18, 2012 6:51 pm
Location: inioas

Re: hour or day

#3 Unread post by jafar1979 »

Dear Prof. Arango
many thanks for your complete information.
i know that you are so busy but if it is possible for you would you please tell me what kind of process on the ERA fields to get the correct force for ROMS is needed.
Because i use ERA into ROMS directly.
Cheers
jafar

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

Re: hour or day

#4 Unread post by kate »

This is where some computer hacking comes into play. Hernan might have a script for this in matlab, but you need to gain some skills in dealing with NetCDF files for this sort of pre- and post-processing of ROMS files. Pick a scripting language and get comfortable with it. There are many options: Matlab, Python, Ferret and NCL all have their champions in the ROMS community.

Another option is to hack ROMS so that it accepts a time units attribute in hours and does the right thing.

jafar1979
Posts: 37
Joined: Sat Feb 18, 2012 6:51 pm
Location: inioas

Re: hour or day

#5 Unread post by jafar1979 »

Dear Kate
thanks as usual.
It is possible to sent mentioned Matlab script for me or sent its link . I usually use Matlab as a scripting language.
Thanks
have a nice holiday
jafar

User avatar
arango
Site Admin
Posts: 1367
Joined: Wed Feb 26, 2003 4:41 pm
Location: DMCS, Rutgers University
Contact:

Re: hour or day

#6 Unread post by arango »

What are you talking about?

The Matlab script to process ECMWF ERA data for ROMS is d_ecmwf2roms.m and it is in the Matlab repository :!: Some of ERA surface fluxes are time-averaged cumulative sums. So you have to process them first, before they can be used in ROMS. You cannot use the ERA data directly into ROMS because it will be completely WRONG :!:

Read in the information in d_ecmwf2roms.m. How are you going to use a atmospheric product in ROMS without reading all the information first about such forcing? There is plenty of documentation on the ECMWF website...

Post Reply