Changeset 2795


Ignore:
Timestamp:
Feb 22, 2017, 9:29:30 AM (7 years ago)
Author:
Laurent Fairhead
Message:

Upgrading time counter in the physics to a count of seconds from the start of the run.
The old counter made the model diverge when runs made in 4 months chunks were compared
to runs made in 1 month chunks

Location:
LMDZ5/trunk/libf/phylmd
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • LMDZ5/trunk/libf/phylmd/physiq_mod.F90

    r2794 r2795  
    17351735    !
    17361736    itap   = itap + 1
    1737     IF (is_mpi_root .AND. is_omp_root) THEN
     1737    IF (is_master .OR. prt_level > 9) THEN
    17381738      IF (prt_level > 5 .or. MOD(itap,5) == 0) THEN
    1739          WRITE(LUNOUT,*)'Entering physics current time = ', current_time
    1740          WRITE(LUNOUT,*)'Date = ',year_cur,'/',mth_cur,'/',day_cur,':',hour/3600
     1739         WRITE(LUNOUT,*)'Entering physics elapsed seconds since start ', current_time
     1740         WRITE(LUNOUT,100)year_cur,mth_cur,day_cur,hour/3600.
     1741 100     FORMAT('Date = ',i4.4,' / ',i2.2, ' / ',i2.2,' : ',f20.17)
    17411742      ENDIF
    17421743    ENDIF
  • LMDZ5/trunk/libf/phylmd/time_phylmdz_mod.F90

    • Property svn:keywords set to Id
    r2552 r2795  
    11!
    2 ! $Id: $
     2! $Id$
    33!
    44MODULE time_phylmdz_mod
     
    2828    INTEGER,SAVE :: itaufin_phy      ! final iteration (in itau_phy steps)
    2929!$OMP THREADPRIVATE(itaufin_phy)
    30     REAL,SAVE    :: current_time ! current elapsed time (fraction of day) from the begining of the run
     30    REAL,SAVE    :: current_time ! current elapsed time in seconds from the begining of the run
    3131!$OMP THREADPRIVATE(current_time)
    3232   
     
    8484  IMPLICIT NONE
    8585  INCLUDE 'YOMCST.h'
    86     REAL,INTENT(IN) :: pdtphys_
    87     REAL            :: julian_date
    88    
     86  REAL,INTENT(IN) :: pdtphys_
     87  REAL            :: julian_date
     88  INTEGER         :: cur_day
     89  REAL            :: cur_sec
     90
    8991    ! Check if the physics timestep has changed
    9092    IF ( ABS( (pdtphys-pdtphys_) / ((pdtphys+pdtphys_)/2))> 10.*EPSILON(pdtphys_)) THEN
     
    9597   
    9698    ! Update elapsed time since begining of run:
    97     current_time=current_time+pdtphys/rday
     99    current_time = current_time + pdtphys
     100    cur_day = int(current_time/rday) + day_ini
     101    cur_sec = current_time - (cur_day * rday) + (start_time * rday)
    98102
    99103    ! Compute corresponding Julian date and update calendar
    100     CALL ymds2ju(annee_ref,1,day_ini,(start_time+current_time)*rday,julian_date)
     104    CALL ymds2ju(annee_ref,1, cur_day, cur_sec, julian_date)
    101105    CALL phys_cal_update(julian_date)
    102106   
Note: See TracChangeset for help on using the changeset viewer.