ROMS/TOMS Developers

Algorithms Update Web Log

kate - November 7, 2006 @ 18:49
Restart question- Comments (4)

This is code from checkvars.F:

   +84  #ifndef ANA_INITIAL
   +85        get_var(idFsur)=.TRUE.
   +86        get_var(idUbar)=.TRUE.
   +87        get_var(idVbar)=.TRUE.
   +88  # ifdef SOLVE3D
   +89        get_var(idUvel)=.TRUE.
   +90        get_var(idVvel)=.TRUE.
   +91        DO itrc=1,NAT
   +92          get_var(idTvar(itrc))=.TRUE.
   +93        END DO
   +94  # endif
   +95  #endif

I am having trouble in the restart where it reads the time from the restart file, but nothing else. I have a case with #define ANA_INITIAL because I want zero initial flow and zeta (2-D tides), but want to spin up the tides, then restart and save more often. I can’t be the only one who ever wants to restart a test problem. If we ever tackle the problems in the restart, a test problem is an ideal situation to be investigating. I’ll get back to you with a fix…

Problems in restart you ask? Yes, I believe there are some, one being the case of changing history files every say ten saves, then restarting after five or fifteen saves. Try it, you’ll like it.

Edit: I’ve found a fix, hope it works.

4 Comments »

  1. I was under the impression that the changes made to the restart logic a year or two ago would let you set up a run with ANA_INITIAL, start from initial conditions the first time, then restart from a file on subsequent runs without having to recompile. It didn’t work that way when I tried it, however, and on reading the code it seems to me that it was never intended to. Setting NRREC to a non-zero value causes the model (I’m only talking about the non-linear form here) to open an initial-conditions file and read the time. But the question of what else to read is determined by ANA_INITIAL, ANA_PASSIVE, ANA_SEDIMENT or ANA_BIOLOGY is set. This way you can choose to take initial dynamic conditions from a restart file but (for example) define passive tracers analytically. Caveat: I’ve never done this.

    I’d like to see your fix: I hope it doesn’t break the functionality I’ve just described.

    Comment by Mark Hadfield — November 8, 2006 @ 14:46 @ 2:46 pm

  2. Well, this is a different test case. In such cases, it is better to provide the initial conditions from a NetCDF file. Otherwise, we will need a CPP option for each model variable during analytical initialization. This will make the initialization/restart logic complicated and it is not what it was intended. We need to deactive ANA_INITIAL during restart since it is incompatible with INI_FILE. Notice that INI_FILE is turned on in globaldefs.h if ANA_INITIAL is not defined. The only combination allowed between restart and analytical fields is for tracers other than temperature and salinity (ANA_BIOLOGY, ANA_PASSIVE, ANA_SEDIMENT). This facilitates initialization of non-dynamical tracers in realistic applications with analytical expressions.

    Comment by arango — November 11, 2006 @ 20:58 @ 8:58 pm

  3. Now I’m completely confused!

    Comment by Mark Hadfield — November 13, 2006 @ 16:41 @ 4:41 pm

  4. I put my patch in as an optional excerpt, but I don’t know how to get to it other than through the edit button:

    Index: checkvars.F
    ===================================================================
    — checkvars.F (revision 22)
    +++ checkvars.F (working copy)
    @@ -81,7 +81,20 @@
    !
    ! Determine state variables to read from input NetCDF file.
    !
    -#ifndef ANA_INITIAL
    +#ifdef ANA_INITIAL
    + IF (nrrec .ne. 0) THEN
    + get_var(idFsur)=.TRUE.
    + get_var(idUbar)=.TRUE.
    + get_var(idVbar)=.TRUE.
    +# ifdef SOLVE3D
    + get_var(idUvel)=.TRUE.
    + get_var(idVvel)=.TRUE.
    + DO itrc=1,NAT
    + get_var(idTvar(itrc))=.TRUE.
    + END DO
    +# endif
    + END IF
    +#else
    get_var(idFsur)=.TRUE.
    get_var(idUbar)=.TRUE.
    get_var(idVbar)=.TRUE.

    Hernan, can you explain the cases you are trying to handle? Is that for tracers not in 1,NAT?

    Comment by kate — November 16, 2006 @ 17:05 @ 5:05 pm

RSS feed for comments on this post.

Leave a comment

You must be logged in to post a comment.