Problem reading atmospheric forcing file

Report or discuss software problems and other woes

Moderators: arango, robertson

Post Reply
Message
Author
Diego
Posts: 36
Joined: Mon Dec 03, 2007 3:30 pm
Location: Dalhousie University - Dept. of Oceanography

Problem reading atmospheric forcing file

#1 Unread post by Diego »

Hello all,

I spend most of my day trying to add atmospheric forcing to my application... and I haven't been successful... now, with a headache and a slight desire to shoot my screen... I decided it is time to ask for help.

1) I compiled ROMS using BULK_FLUXES

2) I created a forcing file (myapp_frc.nc) in matlab using more or less this:
NOTE: To facilitate debugging... I made sure that first and last number in the series were NOT zero.

Code: Select all


time = [0:1800:31536000]';

nc = netcdf('myapp_frc.nc','clobber');

nc('time') = length(time);

dims                  = { 'time'};
nc{ 'data_time'}      = ncdouble(dims);
nc{ 'data_time'}(:)   = time;

dims                  = { 'time'};
nc{ 'Qair'}           = ncdouble(dims);
nc{ 'Qair'}(:)        = Qair;
nc{ 'Qair'}.time      = 'data_time' ;
%----------------------------------------

dims                  = { 'time'};
nc{ 'Pair'}           = ncdouble(dims);
nc{ 'Pair'}(:)        = Pair;
nc{ 'Pair'}.time      = 'data_time' ;
%-----------------------------------------

dims                  = { 'time'};
nc{ 'Tair'}           = ncdouble(dims);
nc{ 'Tair'}(:)        = Tair;
nc{ 'Tair'}.time      = 'data_time' ;
%-----------------------------------------

...etc

3) I have in my ocean.in file the following time-stamping

Code: Select all

  DSTART =  0.0d0
   TIDE_START =  0.0d0
     TIME_REF =  0.0d0
4) I called the forcing file from the ocean.in file:

Code: Select all

FRCNAME == ../myapp_frc.nc  


RESULT:

ROMS reads the forcing file ... but all variables are ZEROS.

Code: Select all

NL ROMS/TOMS: started time-stepping: (Grid: 01 TimeSteps: 00000001 - 00120000)
    GET_2DFLD   - surface u-wind component,                  t =     0 00:29:59
                   (Rec=0002, Index=2, File: myapp_frc.nc)
                   (Tmin=          0.0000 Tmax=        364.9833)
                   (Min =  0.00000000E+00 Max =  0.00000000E+00)
    GET_2DFLD   - surface v-wind component,                  t =     0 00:29:59
                   (Rec=0002, Index=2, File: myapp_frc.nc)
                   (Tmin=          0.0000 Tmax=        364.9833)
                   (Min =  0.00000000E+00 Max =  0.00000000E+00)
    GET_2DFLD   - cloud fraction,                            t =     0 00:29:59
                   (Rec=0002, Index=2, File: myapp_frc.nc)
                   (Tmin=          0.0000 Tmax=        364.9833)
                   (Min =  0.00000000E+00 Max =  0.00000000E+00)
    GET_2DFLD   - solar shortwave radiation flux,            t =     0 00:29:59
                   (Rec=0002, Index=2, File: myapp_frc.nc)
                   (Tmin=          0.0000 Tmax=        364.9833)
                   (Min =  0.00000000E+00 Max =  0.00000000E+00)
    GET_2DFLD   - surface air pressure,                      t =     0 00:29:59
                   (Rec=0002, Index=2, File: myapp_frc.nc)
                   (Tmin=          0.0000 Tmax=        364.9833)
                   (Min =  0.00000000E+00 Max =  0.00000000E+00)
    GET_2DFLD   - surface air temperature,                   t =     0 00:29:59
                   (Rec=0002, Index=2, File: myapp_frc.nc)
                   (Tmin=          0.0000 Tmax=        364.9833)
                   (Min =  0.00000000E+00 Max =  0.00000000E+00)
    GET_2DFLD   - surface air relative humidity,             t =     0 00:29:59
                   (Rec=0002, Index=2, File: myapp_frc.nc)
                   (Tmin=          0.0000 Tmax=        364.9833)
                   (Min =  0.00000000E+00 Max =  0.00000000E+00)
    GET_2DFLD   - rain fall rate,                            t =     0 00:29:59
                   (Rec=0002, Index=2, File: myapp_frc.nc)
                   (Tmin=          0.0000 Tmax=        364.9833)
                   (Min =  0.00000000E+00 Max =  0.00000000E+00)
    GET_NGFLD   - free-surface eastern boundary condition,   t =     0 00:29:10
                   (Rec=0002, Index=1, File: sessile_toy_bry.nc)
                   (Tmin=          0.0000 Tmax=         29.9971)
                   (Min =  2.06691772E-03 Max =  2.32506194E-03)
    GET_NGFLD   - 2D u-momentum eastern boundary condition,  t =     0 00:29:10
                   (Rec=0002, Index=1, File: sessile_toy_bry.nc)
                   (Tmin=          0.0000 Tmax=         29.9971)
                   (Min =  1.45433019E-04 Max =  4.58126160E-04)
    GET_NGFLD   - 2D v-momentum eastern boundary condition,  t =     0 00:29:10
                   (Rec=0002, Index=1, File: sessile_toy_bry.nc)
                   (Tmin=          0.0000 Tmax=         29.9971)
                   (Min =  1.80534989E-04 Max =  1.35378519E-03)
    GET_NGFLD   - 3D u-momentum eastern boundary condition,  t =     0 00:29:10
                   (Rec=0002, Index=1, File: sessile_toy_bry.nc)
                   (Tmin=          0.0000 Tmax=         29.9971)
                   (Min =  1.34837115E-04 Max =  4.78165835E-04)
    GET_NGFLD   - 3D v-momentum eastern boundary condition,  t =     0 00:29:10
                   (Rec=0002, Index=1, File: sessile_toy_bry.nc)
                   (Tmin=          0.0000 Tmax=         29.9971)
                   (Min =  1.74097040E-04 Max =  1.51734304E-03)
    GET_NGFLD   - temperature eastern boundary condition,    t =     0 00:29:10
                   (Rec=0002, Index=1, File: sessile_toy_bry.nc)
                   (Tmin=          0.0000 Tmax=         29.9971)
                   (Min =  8.90690041E+00 Max =  9.00000000E+00)
    GET_NGFLD   - salinity eastern boundary condition,       t =     0 00:29:10
                   (Rec=0002, Index=1, File: sessile_toy_bry.nc)
                   (Tmin=          0.0000 Tmax=         29.9971)
                   (Min =  3.00000000E+01 Max =  3.00008259E+01)
    GET_NGFLD   - nitrate eastern boundary condition,        t =     0 00:29:10
                   (Rec=0002, Index=1, File: sessile_toy_bry.nc)
                   (Tmin=          0.0000 Tmax=         29.9971)
                   (Min =  5.00000000E-01 Max =  5.00000000E-01)
    GET_NGFLD   - ammonium eastern boundary condition,       t =     0 00:29:10
                   (Rec=0002, Index=1, File: sessile_toy_bry.nc)
                   (Tmin=          0.0000 Tmax=         29.9971)
                   (Min =  1.00000001E-01 Max =  1.00000001E-01)
    GET_NGFLD   - chlorophyll eastern boundary condition,    t =     0 00:29:10
                   (Rec=0002, Index=1, File: sessile_toy_bry.nc)
                   (Tmin=          0.0000 Tmax=         29.9971)
                   (Min =  1.00000000E+00 Max =  1.00000000E+00)
    GET_NGFLD   - phytoplankton eastern boundary condition,  t =     0 00:29:10
                   (Rec=0002, Index=1, File: sessile_toy_bry.nc)
                   (Tmin=          0.0000 Tmax=         29.9971)
                   (Min =  1.00000000E+00 Max =  1.00000000E+00)
    GET_NGFLD   - zooplankton eastern boundary condition,    t =     0 00:29:10
                   (Rec=0002, Index=1, File: sessile_toy_bry.nc)
                   (Tmin=          0.0000 Tmax=         29.9971)
                   (Min =  2.00000003E-01 Max =  2.00000003E-01)
    GET_NGFLD   - large fraction nitrogen detritus eastern bot =     0 00:29:10
                   (Rec=0002, Index=1, File: sessile_toy_bry.nc)
                   (Tmin=          0.0000 Tmax=         29.9971)
                   (Min =  1.00000001E-01 Max =  1.00000001E-01)
    GET_NGFLD   - small fraction nitrogen detritus eastern bot =     0 00:29:10
                   (Rec=0002, Index=1, File: sessile_toy_bry.nc)
                   (Tmin=          0.0000 Tmax=         29.9971)
                   (Min =  5.00000000E-01 Max =  5.00000000E-01)

I triple checked... and the forcing file definitely contains the correct (i.e. non-zero) data.

Also note that the boundary forcing from a different file (sessile_toy_bry.nc ... which I created using a similar procedure) is read just fine.




I am puzzled. :?

I am probably missing something simple... maybe new eyes (and fresh minds) would pick my mistake easily. Any help will be greatly appreciated.

Thank you,

Diego

Diego
Posts: 36
Joined: Mon Dec 03, 2007 3:30 pm
Location: Dalhousie University - Dept. of Oceanography

Re: Problem reading atmospheric forcing file

#2 Unread post by Diego »

Hello all,

I've been working on this "zero wind" issue for a week...

So far, I think I found why ROMS outputs zeros on the screen... if found a difference between the version I am running (301 2009-01-22) and the older version where ROMS last read winds ok

In get_2dflg.F ...I added:
Fmin = Fval
Fmax = Fval


...as shown below:

Code: Select all

              CALL netcdf_get_fvar (ng, model, ncfile, Vname(1,ifield), &
     &                              Fval,                               &
     &                              ncid = ncid,                        &
     &                              start = (/Trec/),                   &
     &                              total = (/1/))
              Fpoint(Tindex,ifield,ng)=Fval*Fscale(ifield,ng)
              Fmin = Fval
              Fmax = Fval
            END IF
            IF (exit_flag.ne.NoError) THEN
              IF (Master) WRITE (stdout,40) TRIM(Vname(1,ifield)), Trec
              RETURN
            END IF
            Finfo(8,ifield,ng)=Fmin
            Finfo(9,ifield,ng)=Fmax

I know Laura was also having troubles with "zeros on the output screen". I think this should fix that.

However... I am still getting U and V velocities that are consistent with only tidal forcing and "no winds" ... which means that I am still not done fixing my problem.

I'll keep you updated.

Cheers

Diego

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

Re: Problem reading atmospheric forcing file

#3 Unread post by arango »

Yes, good catch. Thank you. The local variables Fmin and Fmax were not initialized when processing point data. I updated the repository, check the following :arrow: ticket.

I will recommend you to write out surface wind stress (sustr, svstr) into output NetCDF files to check if indeed the wind stress forcing is zero.

anna.morgante
Posts: 1
Joined: Mon Oct 12, 2009 5:34 pm
Location: NOAA

Re: Problem reading atmospheric forcing file

#4 Unread post by anna.morgante »

Hi Diego. I have been working on implementing my first test case with winds from a netcdf file. However I'm running into a similar problem that you mentioned. The log file shows a non zero value for my v surface momentum stress (u stress is purposefully set to zero), however, my results show no sign of any wind stress. Did you solve your problem? Could you tell me how?
Thank you,
Anna

Diego
Posts: 36
Joined: Mon Dec 03, 2007 3:30 pm
Location: Dalhousie University - Dept. of Oceanography

Re: Problem reading atmospheric forcing file

#5 Unread post by Diego »

My problem was only with "zeros on the output screen"... which should be solved by upgrading to the newest ROMS.

I figured that wind was actually working fine... by generating a file with rather large wind... that way the effect was evident.

Hope this helps.

Diego

Post Reply