Ignore:
Timestamp:
Mar 17, 2015, 10:56:59 AM (9 years ago)
Author:
fhourdin
Message:

Modification de la façon d'arrêter le modèle en cas de plantage physique.
hgardfou n'arrête pas le modèle mais positionne abortphy à 1.
Le modèle ne s'arrête qu'après les écritures physiques.
Ceci permet d'avoir les sorties du dernier pas de temps lors d'un
plantage.
Si abortphy est déjà à 1, les tendances des différents processus
ne sont plus ajoutées jusqu'à la fin du pas de temps.

Changes in case of crash.
hgardfou does not stop the model anymore but rather put abortphy to 1.
The model is stoped after phys_output_write in order to have
the outputs of the final time-step.
If abortphy=1, the tendencies are not added anymore to the variables.

File:
1 edited

Legend:

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

    r2231 r2235  
    291291  SAVE itap                   ! compteur pour la physique
    292292  !$OMP THREADPRIVATE(itap)
     293
     294  INTEGER, SAVE :: abortphy=0   ! Reprere si on doit arreter en fin de phys
     295  !$OMP THREADPRIVATE(abortphy)
    293296  !
    294297  REAL,save ::  solarlong0
     
    16031606  !IM END
    16041607  !
    1605   CALL hgardfou(t_seri,ftsol,'debutphy')
     1608  CALL hgardfou(t_seri,ftsol,'debutphy',abortphy)
     1609  IF (abortphy==1) Print*,'ERROR ABORT hgardfou debutphy'
     1610
    16061611  !
    16071612  !IM BEG
     
    19081913     IF (klon_glo==1) THEN
    19091914        CALL add_pbl_tend &
    1910              (d_u_vdf,d_v_vdf,d_t_vdf+d_t_diss,d_q_vdf,dql0,dqi0,paprs,'vdf')
     1915        (d_u_vdf,d_v_vdf,d_t_vdf+d_t_diss,d_q_vdf,dql0,dqi0,paprs,'vdf',abortphy)
    19111916     ELSE
    19121917        CALL add_phys_tend &
    1913              (d_u_vdf,d_v_vdf,d_t_vdf+d_t_diss,d_q_vdf,dql0,dqi0,paprs,'vdf')
     1918        (d_u_vdf,d_v_vdf,d_t_vdf+d_t_diss,d_q_vdf,dql0,dqi0,paprs,'vdf',abortphy)
    19141919     ENDIF
    19151920     !--------------------------------------------------------------------
     
    23452350
    23462351  CALL add_phys_tend(d_u_con, d_v_con, d_t_con, d_q_con, dql0, dqi0, paprs, &
    2347        'convection')
     2352       'convection',abortphy)
     2353
    23482354  !----------------------------------------------------------------------------
    23492355
     
    25142520     d_t_wake(:,:)=dt_wake(:,:)*dtime
    25152521     d_q_wake(:,:)=dq_wake(:,:)*dtime
    2516      CALL add_phys_tend(du0,dv0,d_t_wake,d_q_wake,dql0,dqi0,paprs,'wake')
     2522     CALL add_phys_tend(du0,dv0,d_t_wake,d_q_wake,dql0,dqi0,paprs,'wake',abortphy)
    25172523     !------------------------------------------------------------------------
    25182524
     
    28252831        !-----------------------------------------------------------------------
    28262832        ! ajout des tendances de l'ajustement sec ou des thermiques
    2827         CALL add_phys_tend(du0,dv0,d_t_ajsb,d_q_ajsb,dql0,dqi0,paprs,'ajsb')
     2833        CALL add_phys_tend(du0,dv0,d_t_ajsb,d_q_ajsb,dql0,dqi0,paprs,'ajsb',abortphy)
    28282834        d_t_ajs(:,:)=d_t_ajs(:,:)+d_t_ajsb(:,:)
    28292835        d_q_ajs(:,:)=d_q_ajs(:,:)+d_q_ajsb(:,:)
     
    28822888  WHERE (snow_lsc < 0) snow_lsc = 0.
    28832889
    2884   CALL add_phys_tend(du0,dv0,d_t_lsc,d_q_lsc,d_ql_lsc,d_qi_lsc,paprs,'lsc')
     2890  CALL add_phys_tend(du0,dv0,d_t_lsc,d_q_lsc,d_ql_lsc,d_qi_lsc,paprs,'lsc',abortphy)
    28852891  !---------------------------------------------------------------------------
    28862892  DO k = 1, klev
     
    35613567  d_t_sw0(:,:)=heat0(:,:)*dtime/RDAY
    35623568  d_t_lw0(:,:)=-cool0(:,:)*dtime/RDAY
    3563   CALL add_phys_tend(du0,dv0,d_t_swr,dq0,dql0,dqi0,paprs,'SW')
    3564   CALL add_phys_tend(du0,dv0,d_t_lwr,dq0,dql0,dqi0,paprs,'LW')
     3569  CALL add_phys_tend(du0,dv0,d_t_swr,dq0,dql0,dqi0,paprs,'SW',abortphy)
     3570  CALL add_phys_tend(du0,dv0,d_t_lwr,dq0,dql0,dqi0,paprs,'LW',abortphy)
    35653571
    35663572  !
     
    36453651     !-----------------------------------------------------------------------------------------
    36463652     ! ajout des tendances de la trainee de l'orographie
    3647      CALL add_phys_tend(d_u_oro,d_v_oro,d_t_oro,dq0,dql0,dqi0,paprs,'oro')
     3653     CALL add_phys_tend(d_u_oro,d_v_oro,d_t_oro,dq0,dql0,dqi0,paprs,'oro',abortphy)
    36483654     !-----------------------------------------------------------------------------------------
    36493655     !
     
    36913697     !-----------------------------------------------------------------------------------------
    36923698     ! ajout des tendances de la portance de l'orographie
    3693      CALL add_phys_tend(d_u_lif,d_v_lif,d_t_lif,dq0,dql0,dqi0,paprs,'lif')
     3699     CALL add_phys_tend(d_u_lif,d_v_lif,d_t_lif,dq0,dql0,dqi0,paprs,'lif',abortphy)
    36943700     !-----------------------------------------------------------------------------------------
    36953701     !
     
    37053711     !
    37063712     !  ajout des tendances
    3707      CALL add_phys_tend(d_u_hin,d_v_hin,d_t_hin,dq0,dql0,dqi0,paprs,'hin')
     3713     CALL add_phys_tend(d_u_hin,d_v_hin,d_t_hin,dq0,dql0,dqi0,paprs,'hin',abortphy)
    37083714
    37093715  ENDIF
     
    37143720          du_gwd_rando, dv_gwd_rando)
    37153721     CALL add_phys_tend(du_gwd_rando, dv_gwd_rando, dt0, dq0, dql0,dqi0,paprs, &
    3716           'flott_gwd_rando')
     3722          'flott_gwd_rando',abortphy)
    37173723  end if
    37183724
     
    37683774     CALL METHOX(1,klon,klon,klev,q_seri,d_q_ch4,pplay)
    37693775  ! ajout de la tendance d'humidite due au methane
    3770      CALL add_phys_tend(du0,dv0,dt0,d_q_ch4*dtime,dql0,'q_ch4')
     3776     CALL add_phys_tend(du0,dv0,dt0,d_q_ch4*dtime,dql0,'q_ch4',abortphy)
    37713777  END IF
    37723778  !
     
    41494155  !On effectue les sorties:
    41504156
    4151   CALL phys_output_write(itap, pdtphys, paprs, pphis,               &
     4157  CALL phys_output_write(itap, pdtphys, paprs, pphis,  &
    41524158       pplay, lmax_th, aerosol_couple,                 &
    41534159       ok_ade, ok_aie, ivap, new_aod, ok_sync,         &
     
    41584164
    41594165
    4160 
    41614166  include "write_histday_seri.h"
    41624167
     
    41644169
    41654170#endif
     4171
     4172
     4173!====================================================================
     4174! Arret du modele apres hgardfou en cas de detection d'un
     4175! plantage par hgardfou
     4176!====================================================================
     4177
     4178    IF (abortphy==1) THEN
     4179       abort_message ='Plantage hgardfou'
     4180       CALL abort_gcm (modname,abort_message,1)
     4181    ENDIF
     4182
    41664183
    41674184  ! 22.03.04 END
Note: See TracChangeset for help on using the changeset viewer.