Changeset 2084 for trunk/ICOSA_LMDZ


Ignore:
Timestamp:
Jan 29, 2019, 5:34:29 PM (6 years ago)
Author:
emillour
Message:

Update the Dynamico-Venus interface to ensure that the initial local time for the physics is coherent.
Add the possibility to reset local time (to midnight at longitude 0) using flag raz_date in def file
(raz_date=1 to trigger reset of local time to midnight at longitude 0; default: raz_date=0 to do nothing).
EM

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ICOSA_LMDZ/src/phyvenus/interface_icosa_lmdz.f90

    r2000 r2084  
    209209  INTEGER :: day_ini
    210210  INTEGER :: day_end
     211  INTEGER :: raz_date
    211212
    212213  ! Tracer related information
     
    326327    ! for the rest ptime/timeofday is what matters. To well estimate them,
    327328    ! day_length must be multiple of dt*itau_physics. Error order:1e-4.
    328     day_length=10080000   
     329    day_length=10087000   
    329330    CALL getin('day_length',day_length)
    330331   
    331332    run_length=day_length ! default
    332333    CALL getin('run_length',run_length)
     334   
     335    raz_date=0 ! default: 0: no change in date
     336    CALL getin('raz_date',raz_date)
    333337
    334338    IF (startphy_file) THEN
     
    355359      day_ini=tab_cntrl(13)
    356360      annee_ref=tab_cntrl(14)
    357       ptime=modulo((tab_cntrl(15)*tab_cntrl(1))/day_length,1.0)
     361      ! check if tab_cntrl(1), the stored physics time step
     362      ! is the same as the current physics time step (within roundoff precision)
     363      if (abs(((itau_physics*dt)-tab_cntrl(1))/(itau_physics*dt))<=1.e-8) then
     364        ! Everything OK
     365        ptime=modulo((tab_cntrl(15)*tab_cntrl(1))/day_length,1.0)
     366      else ! unless raz_date == 1 , we have a problem
     367        if (raz_date==1) then
     368          ! we reset date to midnight at lon=0 in the physics
     369          ptime=0.0
     370        else
     371          write(*,*)"Error: physics time step in startphy.nc is different"
     372          write(*,*)"       from what is specified via run_icosa.def"
     373          write(*,*)"       From run_icosa.def:    ",itau_physics*dt
     374          write(*,*)"       From startphy.nc file: ",tab_cntrl(1)
     375          write(*,*)"       You must reset date to midnight at lon=0"
     376          write(*,*)"       by specifying raz_date=1 in your def file"
     377          call abort
     378        endif
     379      endif
    358380
    359381      status=nf90_close(ncid)
Note: See TracChangeset for help on using the changeset viewer.