Time averaged output during 4dvar

Bug reports, work arounds and fixes

Moderators: arango, robertson

Post Reply
Message
Author
MBendoni
Posts: 5
Joined: Thu Jan 24, 2019 7:16 pm
Location: CNR-ISMAR

Time averaged output during 4dvar

#1 Unread post by MBendoni »

Dear users,

I am running a RBL4DVAR experiment and I need to save hourly-average output for the u and v velocity components from the nonlinear run in daily files.
The assimilation window is 3 days, from 2020-09-29 00:00:00 to 2020-10-01 23:59:60.
Here they are the parameters of the sim:

Code: Select all

! Time-Stepping parameters.

      NTIMES == 2160
          DT == 120.0d0
     NDTFAST == 30

....

! Input/Output parameters.

       NRREC == 0
   LcycleRST == T
        NRST == 720
        NSTA == 1
        NFLT == 1
       NINFO == 1

! Output history, quicksave, average, and diagnostic files parameters.

     LDEFOUT == T
        NHIS == 90
     NDEFHIS == 0
        NQCK == 90
     NDEFQCK == 0
      NTSAVG == 1
        NAVG == 30
     NDEFAVG == 720
      NTSDIA == 1
        NDIA == 0
     NDEFDIA == 0

! Output tangent linear and adjoint models parameters.

   LcycleTLM == F
        NTLM == 90
     NDEFTLM == 0
   LcycleADJ == F
        NADJ == 2160     ! Strong constraint 
     NDEFADJ == 0
        NSFF == 90
        NOBC == 360

However, I noticed that I get ntsAVG = 2160 in the logfile and the roms_avg.nc files contain only zeros.
If I try with NTSAVG == 0 (or 2), then in the logfile ntsAVG = 0 (or 2), but the output roms_avg.nc files have the first time step starting at 01:30:00 instead of 00:30:00. Another tricky aspect is that the last time step of the last roms_avg.nc file is at 2020-10-02 00:30:00 (half a hour beyond the duration of the run)
I also noticed that the ncdump -h of the roms_avg.nc file gives as long name for the u variable: "time-averaged adjoint u-momentum component".

If I use the same output parameters to run an ordinary NLROMS (without any assimilation procedure) I get the roms_avg.nc starting at 00:30:00 and the long name for the u variable: "time-averaged u-momentum component"

I looked for other information on the NTSAVG parameter in the forum but I was not able to find anything that could help me.
In case I am not doing any mistake, is there any way to fix the aspect?

Thank you in advance

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

Re: Time averaged output during 4dvar

#2 Unread post by arango »

Yes, do not mess around with the averages in ROMS 4D-Var because they are used specifically to deal with time-averaged observations operators. If you need NLM time-averaged fields, you need to rerun the nonlinear model with the 4D-Var analysis initial conditions. Did you activate AD_AVERAGES? It may be possible in a posterior analysis phase in the future, but I don't have the time to look at it now. The logic is complicated, and any change can break the data assimilation system. The nonlinear model is run at each outer loop, and it is used to linearize the tangent linear and adjoint kernels in the inner loops.

Anyway, what you want is possible with the multiple executable, split 4D-Var schemes where you control everything with a batch script. See ROMS/Bin/submit_split_r4dvar.sh. It requires some level of expertise to run the ROMS 4D-Var split scheme. It is even more complicated within WRF-ROMS coupled system, as shown for the Hurricane Irene test case.

There are examples in the the test repositories. See IRENE/Coupled_RBL4DVAR or WC13/RBL4DVAR_split.

MBendoni
Posts: 5
Joined: Thu Jan 24, 2019 7:16 pm
Location: CNR-ISMAR

Re: Time averaged output during 4dvar

#3 Unread post by MBendoni »

Thank you for you reply.
In the roms.h I have:

Code: Select all

#ifdef NLM_DRIVER
# define AVERAGES           /* define if writing out time-averaged data */
#endif
even if I did not find any NLM_DRIVER flag in cppdefs.h.

However, I have also

Code: Select all

export      MY_CPP_FLAGS="${MY_CPP_FLAGS} -DAVERAGES"
in the build_roms.sh.

The tricky aspect to rerun the analysis simulation is that I think I have to manipulate some output files to apply adequate boundary conditions and forcings (correction is applied to ini, bry and frc).
Anyway, thank you for the suggestion concerning the solution via the split 4D-Var scheme.

User avatar
jivica
Posts: 169
Joined: Mon May 05, 2003 2:41 pm
Location: The University of Western Australia, Perth, Australia
Contact:

Re: Time averaged output during 4dvar

#4 Unread post by jivica »

Had the same issue:

viewtopic.php?t=5592

and the only way to make it right is to use splitting, which needs more effort and scripting.

Cheers,
ivica

Post Reply