Changeset 1577


Ignore:
Timestamp:
Oct 20, 2011, 5:06:47 PM (13 years ago)
Author:
Laurent Fairhead
Message:

Modifications au code qui permettent de commencer une simulation à n'importe
quelle heure de la journée. On fait toujours un nombre entier de jours de
simulation.
On spécifie cette heure de départ dans la variable starttime du run.def (la
valeur est en jour et elle est à zéro par défaut).
La valeur est sauvegardée dans le fichier restart.nc. Les valeurs lues dans
le fichier start et le run.def sont comparées en début de simulation. La
simulation s'arrête si elles ne sont pas égales sauf si une remise à zéro de
la date a été demandée.
Par ailleurs, la fréquence de lecture des conditions aux limites a été modifiée
pour qu'à chaque changement de jour, celles-ci soient mises à jour (jusqu'à
maintenant elles étaient mises à jour à une fréquence donnée qui, en cas de
départ de simulation à une heure différente de minuit, ne correspondait pas
forcèment à un changement dans la date).
Validation effectuée en traçant le flux solaire descendant au sommet de
l'atmosphère à différentes heures de la journée, après un redémarrage, en
s'assurant que le maximum est bien là où il est sensé être.


Modifications to the code to enable it to be started at any time of the day.
The code still runs for an integer number of days.
The start time is specified using variable starttime in the run.def file (the
value is in days and is zero by default).
The start time is saved in the restart.nc file at the end of the simulation.
The values read in from the start.nc file and the run.def file are compared
at the start of the simulation. If they differ, the simulation is aborted
unless the raz_date variable has been set.
Furthermore, the frequency at which boundary conditions are read in has been
modified so that they are updated everyday at midnight (until now, they were
updated at a certain frequency that, in case of a simulation starting at a time
other than midnight, did not ensure that those conditions would be updated each
day at midnight)
The modifications were validated by plotting the downward solaf flux at TOA at
different times of the day (and after having restarted the simulation) and
ensuring that the maximum of flux was at the right place according to local
time.

Location:
LMDZ5/trunk/libf
Files:
29 edited

Legend:

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

    r1563 r1577  
    155155      nday = 10
    156156      CALL getin('nday',nday)
     157
     158!Config  Key  = starttime
     159!Config  Desc = Heure de depart de la simulation
     160!Config  Def  = 0
     161!Config  Help = Heure de depart de la simulation
     162!Config         en jour
     163      starttime = 0
     164      CALL getin('starttime',starttime)
    157165
    158166!Config  Key  = day_step
  • LMDZ5/trunk/libf/dyn3d/control_mod.F90

    r1502 r1577  
    1010  IMPLICIT NONE
    1111
    12   REAL    :: periodav
     12  REAL    :: periodav, starttime
    1313  INTEGER :: nday,day_step,iperiod,iapp_tracvl,nsplit_phys
    1414  INTEGER :: iconser,iecri,dissip_period,iphysiq,iecrimoy
  • LMDZ5/trunk/libf/dyn3d/dynetat0.F

    r1421 r1577  
    119119      day_ini = tab_cntrl(30)
    120120      itau_dyn = tab_cntrl(31)
     121      start_time = tab_cntrl(32)
    121122c   .................................................................
    122123c
  • LMDZ5/trunk/libf/dyn3d/dynredem.F

    r1563 r1577  
    120120       tab_cntrl(30) = REAL(iday_end)
    121121       tab_cntrl(31) = REAL(itau_dyn + itaufin)
     122c start_time: start_time of simulation (not necessarily 0.)
     123       tab_cntrl(32) = start_time
    122124c
    123125c    .........................................................
  • LMDZ5/trunk/libf/dyn3d/gcm.F

    r1563 r1577  
    305305C on remet le calendrier à zero si demande
    306306c
     307      IF (start_time /= starttime) then
     308        WRITE(lunout,*)' GCM: Attention l''heure de depart lue dans le'
     309     &,' fichier restart ne correspond pas à celle lue dans le run.def'
     310        IF (raz_date == 1) then
     311          WRITE(lunout,*)'Je prends l''heure lue dans run.def'
     312          start_time = starttime
     313        ELSE
     314          WRITE(lunout,*)'Je m''arrete'
     315          CALL abort
     316        ENDIF
     317      ENDIF
    307318      IF (raz_date == 1) THEN
    308319        annee_ref = anneeref
  • LMDZ5/trunk/libf/dyn3d/leapfrog.F

    r1529 r1577  
    224224   1  CONTINUE
    225225
    226       jD_cur = jD_ref + day_ini - day_ref + int (itau * dtvr / daysec)
    227       jH_cur = jH_ref +                                                 &
     226      jD_cur = jD_ref + day_ini - day_ref +                             &
     227     &          int (itau * dtvr / daysec)
     228      jH_cur = jH_ref + start_time +                                    &
    228229     &          (itau * dtvr / daysec - int(itau * dtvr / daysec))
     230      jD_cur = jD_cur + int(jH_cur)
     231      jH_cur = jH_cur - int(jH_cur)
    229232
    230233
     
    372375!           rdaym_ini  = itau * dtvr / daysec
    373376!           rdayvrai   = rdaym_ini  + day_ini
    374            jD_cur = jD_ref + day_ini - day_ref
    375      $        + int (itau * dtvr / daysec)
    376            jH_cur = jH_ref +                                            &
    377      &              (itau * dtvr / daysec - int(itau * dtvr / daysec))
     377!           jD_cur = jD_ref + day_ini - day_ref
     378!     $        + int (itau * dtvr / daysec)
     379!           jH_cur = jH_ref +                                            &
     380!     &              (itau * dtvr / daysec - int(itau * dtvr / daysec))
     381           jD_cur = jD_ref + day_ini - day_ref +                        &
     382     &          int (itau * dtvr / daysec)
     383           jH_cur = jH_ref + start_time +                               &
     384     &          (itau * dtvr / daysec - int(itau * dtvr / daysec))
     385           jD_cur = jD_cur + int(jH_cur)
     386           jH_cur = jH_cur - int(jH_cur)
    378387!         write(lunout,*)'itau, jD_cur = ', itau, jD_cur, jH_cur
    379388!         call ju2ymds(jD_cur+jH_cur, an, mois, jour, secondes)
     
    652661!              if (planet_type.eq."earth") then
    653662! Write an Earth-format restart file
    654                 CALL dynredem1("restart.nc",0.0,
     663                CALL dynredem1("restart.nc",start_time,
    655664     &                         vcov,ucov,teta,q,masse,ps)
    656665!              endif ! of if (planet_type.eq."earth")
     
    763772              IF(itau.EQ.itaufin) THEN
    764773!                if (planet_type.eq."earth") then
    765                   CALL dynredem1("restart.nc",0.0,
     774                  CALL dynredem1("restart.nc",start_time,
    766775     &                           vcov,ucov,teta,q,masse,ps)
    767776!                endif ! of if (planet_type.eq."earth")
  • LMDZ5/trunk/libf/dyn3d/temps.h

    r1279 r1577  
    1414
    1515      COMMON/temps/itaufin, dt, day_ini, day_end, annee_ref, day_ref,   &
    16      &             itau_dyn, itau_phy, jD_ref, jH_ref, calend
     16     &             itau_dyn, itau_phy, jD_ref, jH_ref, calend,          &
     17     &             start_time
     18
    1719
    1820      INTEGER   itaufin
    1921      INTEGER itau_dyn, itau_phy
    2022      INTEGER day_ini, day_end, annee_ref, day_ref
    21       REAL      dt, jD_ref, jH_ref
     23      REAL      dt, jD_ref, jH_ref, start_time
    2224      CHARACTER (len=10) :: calend
    2325
  • LMDZ5/trunk/libf/dyn3dpar/conf_gcm.F

    r1575 r1577  
    167167      nday = 10
    168168      CALL getin('nday',nday)
     169
     170!Config  Key  = starttime
     171!Config  Desc = Heure de depart de la simulation
     172!Config  Def  = 0
     173!Config  Help = Heure de depart de la simulation
     174!Config         en jour
     175      starttime = 0
     176      CALL getin('starttime',starttime)
    169177
    170178!Config  Key  = day_step
  • LMDZ5/trunk/libf/dyn3dpar/control_mod.F90

    r1502 r1577  
    1010  IMPLICIT NONE
    1111
    12   REAL    :: periodav
     12  REAL    :: periodav, starttime
    1313  INTEGER :: nday,day_step,iperiod,iapp_tracvl,nsplit_phys
    1414  INTEGER :: iconser,iecri,dissip_period,iphysiq,iecrimoy
  • LMDZ5/trunk/libf/dyn3dpar/dynetat0.F

    r1421 r1577  
    119119      day_ini = tab_cntrl(30)
    120120      itau_dyn = tab_cntrl(31)
     121      start_time = tab_cntrl(32)
    121122c   .................................................................
    122123c
  • LMDZ5/trunk/libf/dyn3dpar/dynredem.F

    r1563 r1577  
    120120       tab_cntrl(30) = REAL(iday_end)
    121121       tab_cntrl(31) = REAL(itau_dyn + itaufin)
     122c start_time: start_time of simulation (not necessarily 0.)
     123       tab_cntrl(32) = start_time
    122124c
    123125c    .........................................................
  • LMDZ5/trunk/libf/dyn3dpar/dynredem_p.F

    r1563 r1577  
    120120       tab_cntrl(30) =  REAL(iday_end)
    121121       tab_cntrl(31) =  REAL(itau_dyn + itaufin)
     122c start_time: start_time of simulation (not necessarily 0.)
     123       tab_cntrl(32) = start_time
    122124c
    123125c    .........................................................
  • LMDZ5/trunk/libf/dyn3dpar/gcm.F

    r1563 r1577  
    323323C on remet le calendrier à zero si demande
    324324c
     325      IF (start_time /= starttime) then
     326        WRITE(lunout,*)' GCM: Attention l''heure de depart lue dans le'
     327     &,' fichier restart ne correspond pas à celle lue dans le run.def'
     328        IF (raz_date == 1) then
     329          WRITE(lunout,*)'Je prends l''heure lue dans run.def'
     330          start_time = starttime
     331        ELSE
     332          WRITE(lunout,*)'Je m''arrete'
     333          CALL abort
     334        ENDIF
     335      ENDIF
    325336      IF (raz_date == 1) THEN
    326337        annee_ref = anneeref
  • LMDZ5/trunk/libf/dyn3dpar/leapfrog_p.F

    r1575 r1577  
    247247   1  CONTINUE
    248248
    249       jD_cur = jD_ref + day_ini - day_ref + int (itau * dtvr / daysec)
    250       jH_cur = jH_ref +                                                 &
     249      jD_cur = jD_ref + day_ini - day_ref +                             &
     250     &          int (itau * dtvr / daysec)
     251      jH_cur = jH_ref + start_time +                                    &
    251252     &          (itau * dtvr / daysec - int(itau * dtvr / daysec))
     253      if (jH_cur > 1.0 ) then
     254        jD_cur = jD_cur +1.
     255        jH_cur = jH_cur -1.
     256      endif
    252257
    253258
     
    701706           jD_cur = jD_ref + day_ini - day_ref
    702707     $        + int (itau * dtvr / daysec)
    703            jH_cur = jH_ref +                                            &
     708           jH_cur = jH_ref + start_time +                                &
    704709     &              (itau * dtvr / daysec - int(itau * dtvr / daysec))
    705710!         call ju2ymds(jD_cur+jH_cur, an, mois, jour, secondes)
     711           if (jH_cur > 1.0 ) then
     712             jD_cur = jD_cur +1.
     713             jH_cur = jH_cur -1.
     714           endif
    706715
    707716c rajout debug
  • LMDZ5/trunk/libf/dyn3dpar/temps.h

    r1279 r1577  
    1414
    1515      COMMON/temps/itaufin, dt, day_ini, day_end, annee_ref, day_ref,   &
    16      &             itau_dyn, itau_phy, jD_ref, jH_ref, calend
     16     &             itau_dyn, itau_phy, jD_ref, jH_ref, calend,          &
     17     &             start_time
     18
    1719
    1820      INTEGER   itaufin
    1921      INTEGER itau_dyn, itau_phy
    2022      INTEGER day_ini, day_end, annee_ref, day_ref
    21       REAL      dt, jD_ref, jH_ref
     23      REAL      dt, jD_ref, jH_ref, start_time
    2224      CHARACTER (len=10) :: calend
    2325
  • LMDZ5/trunk/libf/phylmd/cpl_mod.F90

    r1454 r1577  
    345345       IF (is_sequential) THEN
    346346          ndexcs(:) = 0
    347           itau_w = itau_phy + itime
     347          itau_w = itau_phy + itime + start_time * day_step / iphysiq
    348348          DO i = 1, maxrecv
    349349            IF (inforecv(i)%action) THEN
     
    12321232    IF (is_sequential) THEN
    12331233       ndexct(:) = 0
    1234        itau_w = itau_phy + itime
     1234       itau_w = itau_phy + itime + start_time * day_step / iphysiq
    12351235       CALL histwrite(nidct,'tauxe',itau_w,tmp_taux,iim*(jjm+1),ndexct)
    12361236       CALL histwrite(nidct,'tauyn',itau_w,tmp_tauy,iim*(jjm+1),ndexct)
  • LMDZ5/trunk/libf/phylmd/limit_read_mod.F90

    r1001 r1577  
    150150   
    151151    INCLUDE "indicesol.h"
     152    INCLUDE "iniprint.h"
    152153
    153154! In- and ouput arguments
     
    165166!$OMP THREADPRIVATE(lmt_pas)
    166167    LOGICAL, SAVE                             :: first_call=.TRUE.
    167 !$OMP THREADPRIVATE(first_call)   
     168!$OMP THREADPRIVATE(first_call) 
     169    INTEGER, SAVE                             :: jour_lu = -1
     170!$OMP THREADPRIVATE(jour_lu) 
    168171! Locals variables
    169172!****************************************************************************************
     
    209212
    210213    is_modified = .FALSE.
    211     IF (MOD(itime-1, lmt_pas) == 0) THEN   ! time to read
     214    IF (MOD(itime-1, lmt_pas) == 0 .OR. jour_lu /= jour ) THEN   ! time to read
     215       jour_lu = jour
    212216       is_modified = .TRUE.
    213217!$OMP MASTER  ! Only master thread
  • LMDZ5/trunk/libf/phylmd/phys_output_write.h

    r1562 r1577  
    1       itau_w = itau_phy + itap
     1      itau_w = itau_phy + itap + start_time * day_step / iphysiq
    22
    33      DO iff=1,nfiles
  • LMDZ5/trunk/libf/phylmd/write_bilKP_ave.h

    r776 r1577  
    99c Champs 2D:
    1010c
    11       itau_w = itau_phy + itap
     11      itau_w = itau_phy + itap + start_time * day_step / iphysiq
    1212c
    1313cym      CALL gr_fi_ecrit(klev, klon,iim,jjmp1, ue_lay,zx_tmp_3d)
  • LMDZ5/trunk/libf/phylmd/write_bilKP_ins.h

    r776 r1577  
    77      ndex3d = 0
    88c
    9       itau_w = itau_phy + itap
     9      itau_w = itau_phy + itap + start_time * day_step / iphysiq
    1010c
    1111c Champs 3D:
  • LMDZ5/trunk/libf/phylmd/write_histISCCP.h

    r1403 r1577  
    99       ndex3d = 0
    1010c
    11        itau_w = itau_phy + itap
     11       itau_w = itau_phy + itap + start_time * day_step / iphysiq
    1212c
    1313       IF(type_run.EQ."ENSP".OR.type_run.EQ."CLIM") THEN
  • LMDZ5/trunk/libf/phylmd/write_histREGDYN.h

    r776 r1577  
    88
    99      ndex3d = 0
    10       itau_w = itau_phy + itap
     10      itau_w = itau_phy + itap + start_time * day_step / iphysiq
    1111c
    1212       CALL histwrite(nid_regdyn,"hw1",itau_w,histoW(:,:,:,1),
  • LMDZ5/trunk/libf/phylmd/write_histdayNMC.h

    r1539 r1577  
    55c
    66       ndex3d = 0
    7        itau_w = itau_phy + itap
     7       itau_w = itau_phy + itap + start_time * day_step / iphysiq
    88ccc
    99c  Champs interpolles sur des niveaux de pression du NMC
  • LMDZ5/trunk/libf/phylmd/write_histday_seri.h

    r996 r1577  
    77c
    88      ndex2d = 0
    9       itau_w = itau_phy + itap
     9      itau_w = itau_phy + itap + start_time * day_step / iphysiq
    1010c
    1111c Champs 2D:
  • LMDZ5/trunk/libf/phylmd/write_histhf3d.h

    r776 r1577  
    77      ndex3d = 0
    88c
    9       itau_w = itau_phy + itap
     9      itau_w = itau_phy + itap + start_time * day_step / iphysiq
    1010c
    1111c Champs 3D:
  • LMDZ5/trunk/libf/phylmd/write_histhfNMC.h

    r1539 r1577  
    55c
    66       ndex3d = 0
    7        itau_w = itau_phy + itap
     7       itau_w = itau_phy + itap + start_time * day_step / iphysiq
    88ccc
    99c  Champs interpolles sur des niveaux de pression du NMC
  • LMDZ5/trunk/libf/phylmd/write_histmthNMC.h

    r1539 r1577  
    55c
    66       ndex3d = 0
    7        itau_w = itau_phy + itap
     7       itau_w = itau_phy + itap + start_time * day_step / iphysiq
    88ccc
    99c  Champs interpolles sur des niveaux de pression du NMC
  • LMDZ5/trunk/libf/phylmd/write_histrac.h

    r1570 r1577  
    55  IF (ecrit_tra > 0.) THEN
    66     
    7      itau_w = itau_phy + nstep
     7     itau_w = itau_phy + nstep + start_time * day_step / iphysiq
    88     
    99     CALL histwrite_phy(nid_tra,.FALSE.,"phis",itau_w,pphis)
  • LMDZ5/trunk/libf/phylmd/write_paramLMDZ_phy.h

    r1538 r1577  
    2727c
    2828      ndex2d = 0
    29       itau_w = itau_phy + itap
     29      itau_w = itau_phy + itap + start_time * day_step / iphysiq
    3030c
    3131c Variables globales
Note: See TracChangeset for help on using the changeset viewer.