set cycle_length attribute when using multiple forcing file

Discussion of how to use ROMS on different regional and basin scale applications.

Moderators: arango, robertson

Post Reply
Message
Author
turuncu
Posts: 128
Joined: Tue Feb 01, 2005 8:21 pm
Location: Istanbul Technical University (ITU)
Contact:

set cycle_length attribute when using multiple forcing file

#1 Unread post by turuncu »

Hi,

I have a problem with the setting cycle_length netcdf attribute for the forcing files. I plan to run the model with perpetual annual forcing until it reach the steady state. My aim is that using the results as an initial condition of the real simulation.

I think that the cycle_length netcdf attribute must be set to use same annual forcing data in a cyclic way. In fact that the forcing files is big and i could not merge all of them. So, i have a separate forcing file for each month and each one of them has attribute like,

cycle_length = 365.25 ;

The problem is that the model only reads the first file (forcing_199601) and uses same data for whole year. Is there any way to define the cycle_length attribute when using multiple forcing file? How can i set up this kind of simulation? May be the value of the cycle_length is wrong and must be number of days for the specified month in each file but i am not sure. Any suggestion?

Regards,

--ufuk

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

Re: set cycle_length attribute when using multiple forcing f

#2 Unread post by arango »

Well, I will not recommend you to do that :!: The new version of ROMS allows splitting the field time records into multiple files. However, I never intended the logic to include cycling of time records with the cycle_length attribute. This is a very tricky logic because of the managing of monotonic internal time clock backwards (ADM) and forward (NLM, TLM, and RPM). I was supposed to put a warning about this in the code but I forgot. Too much stuff in my plate.

In my opinion, it does not make much sense to split cycling forcing data into several NetCDF files per field. This will also complicate the leap year logic. What does really make sense is to split the forcing fields into several annual cycling NetCDF files. If your file is getting too big, you may have instead:

Code: Select all

    NFFILES == 9                          ! number of forcing files

    FRCNAME == my_rivers.nc  \
               my_tides.nc   \
               my_lwrad.nc   \
               my_swrad.nc   \
               my_Uwind.nc   \
               my_Vwind.nc   \
               my_Pair.nc    \
               my_Qair.nc    \
               my_Tair.nc
  
Notice that you can add the cycle_length attribute to any of these files.

This is kind of funny because when I was discussing this with our group, I bet that a User would immediately split the time-cycling data into multiple files. The issue here is not to split the time records but the fields instead. I hope that this makes sense 8)

It is possible to code what you want for a particular application but it is extremely difficult to come up with a generic logic to do this. It will make routine inquire.F and its CALL very complicate...

turuncu
Posts: 128
Joined: Tue Feb 01, 2005 8:21 pm
Location: Istanbul Technical University (ITU)
Contact:

Re: set cycle_length attribute when using multiple forcing f

#3 Unread post by turuncu »

Hi,

It seems that the model works without problem in this solution but when i try to plot the total turbulent kinetic energy (sum over the entire lake volume) vs time (see attached plot), it seems little bit strange after end of the first year simulation. What do you think?

I also check the stdout of the model and after first year,

...
...
GET_2DFLD - downwelling longwave radiation flux, t = 46385 12:00:00
GET_2DFLD - surface air temperature, t = 46385 12:00:00
GET_2DFLD - surface air relative humidity, t = 46385 12:00:00
GET_2DFLD - rain fall rate, t = 46385 12:00:00
GET_2DFLD - surface u-wind component, t = 46385 18:00:00
GET_2DFLD - surface v-wind component, t = 46385 18:00:00
GET_2DFLD - surface air pressure, t = 46385 18:00:00
GET_2DFLD - solar shortwave radiation flux, t = 46385 18:00:00
GET_2DFLD - downwelling longwave radiation flux, t = 46385 18:00:00
GET_2DFLD - surface air temperature, t = 46385 18:00:00
GET_2DFLD - surface air relative humidity, t = 46385 18:00:00
GET_2DFLD - rain fall rate, t = 46385 18:00:00

there is no info line start with GET_2DFLD. This could be related with cycle_lenght attribute but i am not sure.

Image

turuncu
Posts: 128
Joined: Tue Feb 01, 2005 8:21 pm
Location: Istanbul Technical University (ITU)
Contact:

Re: set cycle_length attribute when using multiple forcing f

#4 Unread post by turuncu »

In addition to my previous post,

I also check the surface temperature and it is not increase after first year simulation finish. It seems that model does not use the actual data, it acts like only using first time step data for the rest of the simulation.

There is a movie in the following link but the size of it is little bit large (~120 MB). So, if you interested in just look at it.

http://www.be.itu.edu.tr/~u.utku.turuncoglu/movie.mp4

Regards,

--ufuk

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

Re: set cycle_length attribute when using multiple forcing f

#5 Unread post by kate »

If you use a cycle_length of 365.25 days, you need to have the times in that file be between zero and 365.25 days. Do your forcing files meet this criterion? Times in a typical cyclic file would be something like:

Code: Select all

 bio_time = 15.21875, 45.65625, 76.09375, 106.53125, 136.96875, 167.40625, 
    197.84375, 228.28125, 258.71875, 289.15625, 319.59375, 350.03125 ;

turuncu
Posts: 128
Joined: Tue Feb 01, 2005 8:21 pm
Location: Istanbul Technical University (ITU)
Contact:

Re: set cycle_length attribute when using multiple forcing f

#6 Unread post by turuncu »

It is 6 hourly forcing file and the times are,

Code: Select all

 tair_time = 46020, 46020.25, 46020.5, 46020.75, .... , 46381.25, 46381.5, 
    46381.75, 46382, 46382.25, 46382.5, 46382.75, 46383, 46383.25, 46383.5, 
    46383.75, 46384, 46384.25, 46384.5, 46384.75, 46385, 46385.25, 46385.5, 
    46385.75 ;
and in the configuration file,

Code: Select all

! Time-stamp assigned for model initialization, reference time
! origin for tidal forcing, and model reference time for output
! NetCDF units attribute.

      DSTART =  46020.0d0                  ! days
  TIDE_START =  0.0d0                      ! days
    TIME_REF =  18700101.0d0               ! yyyymmdd.dd
i set the DSTART value.

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

Re: set cycle_length attribute when using multiple forcing f

#7 Unread post by kate »

You need to subtract that DSTART from your tair_time. You should be able to do that with ncap2 from NCO or any other favorite tool for hacking netcdf files.

turuncu
Posts: 128
Joined: Tue Feb 01, 2005 8:21 pm
Location: Istanbul Technical University (ITU)
Contact:

Re: set cycle_length attribute when using multiple forcing f

#8 Unread post by turuncu »

Hi Kate,

I follow your suggestions and correct the value of the time axis. Now the values are,

Code: Select all

0, 0.25, 0.5, 0.75, 1, 1.25, ..., 364.75, 365, 365.25, 365.5, 365.75
after this modification i also set the DSTART as,

Code: Select all

      
      DSTART =  0.0d0                      ! days
  TIDE_START =  0.0d0                      ! days
    TIME_REF =  19600101.0d0               ! yyyymmdd.dd
The attribute of the forcing file is set as,

Code: Select all

dimensions:
	xi_rho = 59 ;
	eta_rho = 119 ;
	xi_u = 58 ;
	eta_u = 119 ;
	xi_v = 59 ;
	eta_v = 118 ;
	wind_time = 1464 ;
	pair_time = 1464 ;
	tair_time = 1464 ;
	qair_time = 1464 ;
	rain_time = 1464 ;
	srf_time = 1464 ;
	lrf_time = 1464 ;
	cloud_time = 1464 ;
variables:
	double Tair(tair_time, eta_rho, xi_rho) ;
		Tair:time = "tair_time" ;
		Tair:units = "Celsius" ;
		Tair:long_name = "surface air temperature" ;
		Tair:cycle_length = 365.75 ;
		Tair:_FillValue = 1.e+20 ;
....
	double tair_time(tair_time) ;
		tair_time:calendar = "standard" ;
		tair_time:field = "tair_time, scalar, series" ;
		tair_time:long_name = "time for tair_time" ;
		tair_time:units = "days since 1996-01-01 00:00:00" ;
....
but the same problem still exist. The model does not read the data after first year simulation finished. The tke plot is similar to previous one

Image

What do you think? Please let me know, if i miss something. Is there any bug in model. Thanks for your help.

PS: I also change the resolution of model to run much more faster. I also set the "cycle_length" as 365.75 because 1996 is a leap year.

--ufuk

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

Re: set cycle_length attribute when using multiple forcing f

#9 Unread post by kate »

I would do a restart during 1997 and watch it in the debugger. Why is it deciding not to read any records?

P.S. You meant cycle_length = 366?

turuncu
Posts: 128
Joined: Tue Feb 01, 2005 8:21 pm
Location: Istanbul Technical University (ITU)
Contact:

Re: set cycle_length attribute when using multiple forcing f

#10 Unread post by turuncu »

I am not sure. The configuration is exactly same that i wrote in my previous post. Just an idea but maybe i can solve the problem using following procedure,

1 - run the model for first year (1996).
2 - modify the time axis of the same forcing files for next year simulation (1997).
3 - restart model from the end of the first run
4 - continue to step 2-3 until model reaches the steady state

it is little bit annoying but i think it will work. May be i could put some extra print statement into ROMS/Utility/get_cycle.F to find the problem.

turuncu
Posts: 128
Joined: Tue Feb 01, 2005 8:21 pm
Location: Istanbul Technical University (ITU)
Contact:

Re: set cycle_length attribute when using multiple forcing f

#11 Unread post by turuncu »

Hi,

I think that i figure out the problem. As i understand from the ROMS/Utility/get_cycle.F file. The problem is mainly related with the "cycle_length" NetCDF attribute. The attribute must be set also in the time variables (or only in time variables, wind_time etc.) but in my case, i set it as a forcing variable attribute (in cloud or Pair). Now the model reads the first time step again after first year finish.

Unfortunately, the model gives the following error,

Code: Select all

 SET_2DFLD  - current model time exceeds ending value for variable: Tair
              TDAYS     =        365.7535
              Data Tmin =          0.0000  Data Tmax =        365.7500
              Data Tstr =        365.0000  Data Tend =        365.2500
              TINTRP1   =        365.7500  TINTRP2   =        365.7500
              FAC1      =         -0.0035  FAC2      =          0.0035
The get_2dfld routine works without problem but set is not. There are two criteria in the set_2dfld routine

Code: Select all

FAC1*FAC2 >= 0.0
FAC1+FAC2 > 0 
and they are related with the actual time step of the model and the time range of the input data. Is it necessary to add a extra record before first time step (the red one). For example,

-0.25, 0, 0.25, 0.5, 0.75, 1, 1.25, ..., 364.75, 365, 365.25, 365.5, 365.75

to fix it? I saw some discussion about that in the following link but i am not sure.

viewtopic.php?t=887

turuncu
Posts: 128
Joined: Tue Feb 01, 2005 8:21 pm
Location: Istanbul Technical University (ITU)
Contact:

Re: set cycle_length attribute when using multiple forcing f

#12 Unread post by turuncu »

Okay. The cycle_length must be defined as 366 for leap years. This is my fault. Sorry. Not it is working without problem. Anyway, thanks for your kindly help. Regards,

Post Reply