Changeset 1760 for trunk/LMDZ.VENUS/libf


Ignore:
Timestamp:
Jul 28, 2017, 12:54:31 PM (7 years ago)
Author:
emillour
Message:

Venus and Generic GCMS:
Corrections for the XIOS calendar; it must first be defined and operations
(e.g. definition of start_date) must come afterwards.
Note that for the Generic model where number of month/year and
number of days per month may vary from one simulation to the next, it
might be better to define the calendar via the XML file than in the code.
EM

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/LMDZ.VENUS/libf/phyvenus/xios_output_mod.F90

    r1682 r1760  
    102102!$OMP MASTER
    103103    ! 3. Declare calendar and time step
    104     if (prt_level>=10) write(lunout,*) "initialize_xios_output: build calendar"
    105     timestep%second=dtphys
    106     ! time origin of the simulation (default: 1st year/1st month/1st day, Ls=0)
    107     time_origin=xios_date(1,1,1,0,0,0)
    108     ! start date of the simulation (i.e time elapsed since last Ls=0)
    109     start_date=xios_date(1,1,1,0,0,nint((day+timeofday)*daysec))
     104    if (prt_level>=10) then
     105     write(lunout,*) "initialize_xios_output: build calendar"
     106    endif
     107    timestep%second=nint(dtphys)
     108    if (nint(dtphys).ne.dtphys) then
     109      write(*,*) "initialize_xios_output: warning physics timestep is not an integer!"
     110    endif
     111    if (nint(daysec).ne.daysec) then
     112      write(*,*) "initialize_xios_output: warning day length is not an integer!"
     113    endif
     114    ! Important: do no operations involving dates and calendars
     115    ! before defining the calendar!
    110116    CALL xios_define_calendar(type="user_defined", &
    111117                              timestep=timestep, &
    112118                              day_length=nint(daysec), &
    113                               start_date=start_date, &
    114                               time_origin=time_origin, &
    115                               month_lengths=[2])
     119                              month_lengths=[2]) ! one month, 2 days long
     120
     121    ! time origin of the simulation (default: 1st year/1st month/1st day, Ls=0)
     122    time_origin=xios_date(1,1,1,0,0,0)
     123    CALL xios_set_time_origin(time_origin=time_origin)
     124    if (prt_level>=10) then
     125     write(lunout,*) "initialize_xios_output: time_origin=",time_origin
     126    endif
     127
     128    ! Now define the start time of this simulation
     129    ! NB: we substract dtphys because we want to set the origin of the time axis
     130    start_date=time_origin+xios_duration(0,0,day,0,0,timeofday*daysec-dtphys)
     131    call xios_set_start_date(start_date=start_date)
     132    if (prt_level>=10) then
     133     write(lunout,*) "initialize_xios_output: start_date=",start_date
     134    endif
    116135   
    117136    ! 4. Finalize the context:
Note: See TracChangeset for help on using the changeset viewer.