Ignore:
Timestamp:
Oct 18, 2015, 8:38:58 AM (9 years ago)
Author:
Ehouarn Millour
Message:

Fix in the computation of the date; the convention is that it corresponds to the time at the end of the current dynamics or physics step (except when in backward Matsuno step where it remains unchanged as it was correctly updated during the forward part of the step).
Note that the relationship between itau and date is a bit tricky as itau is incremented between Matsuno forward and backward steps (and from a leapfrog step to the next) but unchanged from Matsuno bacward step to leapfrog step.
Because of change in date when calling physics, bench results will change with this revision.
EM

File:
1 edited

Legend:

Unmodified
Added
Removed
  • LMDZ5/trunk/libf/dyn3d/leapfrog.F

    r2302 r2375  
    228228   1  CONTINUE ! Matsuno Forward step begins here
    229229
     230c   date: (NB: date remains unchanged for Backward step)
     231c   -----
     232
    230233      jD_cur = jD_ref + day_ini - day_ref +                             &
    231      &          itau/day_step
     234     &          (itau+1)/day_step
    232235      jH_cur = jH_ref + start_time +                                    &
    233      &          mod(itau,day_step)/float(day_step)
     236     &          mod(itau+1,day_step)/float(day_step)
    234237      jD_cur = jD_cur + int(jH_cur)
    235238      jH_cur = jH_cur - int(jH_cur)
     
    277280c-----------------------------------------------------------------------
    278281
    279 c   date:
     282c   date: (NB: only leapfrog step requires recomputing date)
    280283c   -----
     284
     285      IF (leapf) THEN
     286        jD_cur = jD_ref + day_ini - day_ref +
     287     &            (itau+1)/day_step
     288        jH_cur = jH_ref + start_time +
     289     &            mod(itau+1,day_step)/float(day_step)
     290        jD_cur = jD_cur + int(jH_cur)
     291        jH_cur = jH_cur - int(jH_cur)
     292      ENDIF
    281293
    282294
     
    416428!     &              (itau * dtvr / daysec - int(itau * dtvr / daysec))
    417429           jD_cur = jD_ref + day_ini - day_ref +                        &
    418      &          itau/day_step
     430     &          (itau+1)/day_step
    419431
    420432           IF (planet_type .eq."generic") THEN
     
    424436
    425437           jH_cur = jH_ref + start_time +                               &
    426      &              mod(itau,day_step)/float(day_step)
     438     &              mod(itau+1,day_step)/float(day_step)
    427439           jD_cur = jD_cur + int(jH_cur)
    428440           jH_cur = jH_cur - int(jH_cur)
Note: See TracChangeset for help on using the changeset viewer.