Changeset 1809 for LMDZ5/trunk/libf


Ignore:
Timestamp:
Jul 22, 2013, 6:08:34 PM (11 years ago)
Author:
Ehouarn Millour
Message:

Correction de bugs lors des définitions.
UG
..........
Bugs corrected in vars definitions.
UG

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

Legend:

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

    r1808 r1809  
    339339    ENDDO !  iff
    340340
    341     !On déclare les sorties avec un premier appel à phys_output_write:
    342 
    343       CALL phys_output_write(1, pdtphys, paprs, pphis,               &
     341    ! ug On déclare les sorties avec un premier appel à phys_output_write:
     342    !    on utilise itap=0 pour signaler à histwrite qu'il s'agit du passage de définition
     343      CALL phys_output_write(0, pdtphys, paprs, pphis,               &
    344344     &                  pplay, lmax_th, aerosol_couple,                 &
    345345     &                  ok_ade, ok_aie, ivap, new_aod, ok_sync,         &
  • LMDZ5/trunk/libf/phylmd/phys_output_write_F90.h

    r1807 r1809  
    1 
     1! ug Si itap ==  0 alors on ne fait pas de calculs, juste des appels à histwrite pour définir les variables de sorties
    22
    33!!! Champs 1D !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    44      CALL histwrite_phy(o_phis, pphis)
    55      CALL histwrite_phy(o_aire, airephy)
     6
     7IF (itap > 0) THEN
    68      DO i=1, klon
    79       zx_tmp_fi2d(i)=pctsrf(i,is_ter)+pctsrf(i,is_lic)
    810      ENDDO
     11ENDIF
     12
    913      CALL histwrite_phy(o_contfracATM, zx_tmp_fi2d)
    1014      CALL histwrite_phy(o_contfracOR, pctsrf(:,is_ter))
     
    1822      CALL histwrite_phy(o_t2m_max, zt2m)
    1923
     24IF (itap > 0) THEN
    2025      DO i=1, klon
    2126       zx_tmp_fi2d(i)=SQRT(zu10m(i)*zu10m(i)+zv10m(i)*zv10m(i))
    2227      ENDDO
     28ENDIF
    2329      CALL histwrite_phy(o_wind10m, zx_tmp_fi2d)
    2430
     31IF (itap > 0) THEN
    2532      DO i=1, klon
    2633       zx_tmp_fi2d(i)=SQRT(zu10m(i)*zu10m(i)+zv10m(i)*zv10m(i))
    2734      ENDDO
     35ENDIF
    2836      CALL histwrite_phy(o_wind10max, zx_tmp_fi2d)
    2937
     38IF (itap > 0) THEN
    3039      DO i = 1, klon
    3140         zx_tmp_fi2d(i) = pctsrf(i,is_sic)
    3241      ENDDO
     42ENDIF
    3343      CALL histwrite_phy(o_sicf, zx_tmp_fi2d)
    3444      CALL histwrite_phy(o_q2m, zq2m)
     
    3646      CALL histwrite_phy(o_u10m, zu10m)
    3747      CALL histwrite_phy(o_v10m, zv10m)
     48
     49IF (itap > 0) THEN
    3850      DO i = 1, klon
    3951         zx_tmp_fi2d(i) = paprs(i,1)
    4052      ENDDO
     53ENDIF
    4154      CALL histwrite_phy(o_psol, zx_tmp_fi2d)
    4255      CALL histwrite_phy(o_mass, zmasse)
    4356      CALL histwrite_phy(o_qsurf, zxqsurf)
    44        if (.not. ok_veget) then
     57
     58IF (.NOT. ok_veget) THEN
    4559      CALL histwrite_phy(o_qsol, qsol)
    46        endif
     60ENDIF
     61
     62IF (itap > 0) THEN
    4763       DO i = 1, klon
    4864         zx_tmp_fi2d(i) = rain_fall(i) + snow_fall(i)
    4965       ENDDO
     66ENDIF
     67
    5068      CALL histwrite_phy(o_precip, zx_tmp_fi2d)
    5169      CALL histwrite_phy(o_ndayrain, nday_rain)
     70
     71IF (itap > 0) THEN
    5272       DO i = 1, klon
    5373         zx_tmp_fi2d(i) = rain_lsc(i) + snow_lsc(i)
    5474       ENDDO
     75ENDIF
    5576      CALL histwrite_phy(o_plul, zx_tmp_fi2d)
     77
     78IF (itap > 0) THEN
    5679      DO i = 1, klon
    5780         zx_tmp_fi2d(i) = rain_con(i) + snow_con(i)
    5881      ENDDO
     82ENDIF
    5983      CALL histwrite_phy(o_pluc, zx_tmp_fi2d)
    6084      CALL histwrite_phy(o_snow, snow_fall)
     
    6690      CALL histwrite_phy(o_topl, toplw)
    6791      CALL histwrite_phy(o_topl0, toplw0)
     92
     93IF (itap > 0) THEN
    6894      zx_tmp_fi2d(1 : klon) = swup ( 1 : klon, klevp1 )
     95ENDIF
    6996      CALL histwrite_phy(o_SWupTOA, zx_tmp_fi2d)
     97
     98IF (itap > 0) THEN
    7099      zx_tmp_fi2d(1 : klon) = swup0 ( 1 : klon, klevp1 )
     100ENDIF
    71101      CALL histwrite_phy(o_SWupTOAclr, zx_tmp_fi2d)
     102
     103IF (itap > 0) THEN
    72104      zx_tmp_fi2d(1 : klon) = swdn ( 1 : klon, klevp1 )
     105ENDIF
    73106      CALL histwrite_phy(o_SWdnTOA, zx_tmp_fi2d)
     107
     108IF (itap > 0) THEN
    74109      zx_tmp_fi2d(1 : klon) = swdn0 ( 1 : klon, klevp1 )
     110ENDIF
    75111      CALL histwrite_phy(o_SWdnTOAclr, zx_tmp_fi2d)
     112
     113IF (itap > 0) THEN
    76114      zx_tmp_fi2d(:) = topsw(:)-toplw(:)
     115ENDIF
    77116      CALL histwrite_phy(o_nettop, zx_tmp_fi2d)
    78117      CALL histwrite_phy(o_SWup200, SWup200)
     
    89128      CALL histwrite_phy(o_radsol, radsol)
    90129      CALL histwrite_phy(o_soll0, sollw0)
     130
     131IF (itap > 0) THEN
    91132      zx_tmp_fi2d(1 : klon) = swup ( 1 : klon, 1 )
     133ENDIF
    92134      CALL histwrite_phy(o_SWupSFC, zx_tmp_fi2d)
     135
     136IF (itap > 0) THEN
    93137      zx_tmp_fi2d(1 : klon) = swup0 ( 1 : klon, 1 )
     138ENDIF
    94139      CALL histwrite_phy(o_SWupSFCclr, zx_tmp_fi2d)
     140
     141IF (itap > 0) THEN
    95142      zx_tmp_fi2d(1 : klon) = swdn ( 1 : klon, 1 )
     143ENDIF
    96144      CALL histwrite_phy(o_SWdnSFC, zx_tmp_fi2d)
     145
     146IF (itap > 0) THEN
    97147      zx_tmp_fi2d(1 : klon) = swdn0 ( 1 : klon, 1 )
     148ENDIF
    98149      CALL histwrite_phy(o_SWdnSFCclr, zx_tmp_fi2d)
     150
     151IF (itap > 0) THEN
    99152      zx_tmp_fi2d(1:klon)=sollwdown(1:klon)-sollw(1:klon)
     153ENDIF
    100154      CALL histwrite_phy(o_LWupSFC, zx_tmp_fi2d)
    101155      CALL histwrite_phy(o_LWdnSFC, sollwdown)
    102156
     157IF (itap > 0) THEN
    103158       sollwdownclr(1:klon) = -1.*lwdn0(1:klon,1)
    104159      zx_tmp_fi2d(1:klon)=sollwdownclr(1:klon)-sollw0(1:klon)
     160ENDIF
    105161      CALL histwrite_phy(o_LWupSFCclr, zx_tmp_fi2d)
    106162      CALL histwrite_phy(o_LWdnSFCclr, sollwdownclr)
     
    113169      CALL histwrite_phy(o_bils_enthalp, bils_enthalp)
    114170
     171IF (itap > 0) THEN
    115172      zx_tmp_fi2d(1:klon)=-1*sens(1:klon)
    116 
     173ENDIF
    117174      CALL histwrite_phy(o_sens, zx_tmp_fi2d)
    118175      CALL histwrite_phy(o_fder, fder)
     
    120177      CALL histwrite_phy(o_fqcalving, zxfqcalving)
    121178      CALL histwrite_phy(o_fqfonte, zxfqfonte)
    122          zx_tmp_fi2d=0.
    123          do nsrf=1,nbsrf
    124           zx_tmp_fi2d(:)=zx_tmp_fi2d(:)+pctsrf(:,nsrf)*fluxu(:,1,nsrf)
    125          enddo
     179IF (itap > 0) THEN
     180      zx_tmp_fi2d=0.
     181      DO nsrf=1,nbsrf
     182        zx_tmp_fi2d(:)=zx_tmp_fi2d(:)+pctsrf(:,nsrf)*fluxu(:,1,nsrf)
     183      ENDDO
     184ENDIF
    126185      CALL histwrite_phy(o_taux, zx_tmp_fi2d)
    127          zx_tmp_fi2d=0.
    128          do nsrf=1,nbsrf
     186
     187IF (itap > 0) THEN
     188      zx_tmp_fi2d=0.
     189      DO nsrf=1,nbsrf
    129190          zx_tmp_fi2d(:)=zx_tmp_fi2d(:)+pctsrf(:,nsrf)*fluxv(:,1,nsrf)
    130          enddo
     191      ENDDO
     192ENDIF
    131193      CALL histwrite_phy(o_tauy, zx_tmp_fi2d)
    132194
    133195
    134196         DO nsrf = 1, nbsrf
    135 !           IF(nsrf.GE.2) THEN
    136             zx_tmp_fi2d(1 : klon) = pctsrf( 1 : klon, nsrf)*100.
     197IF (itap > 0)             zx_tmp_fi2d(1 : klon) = pctsrf( 1 : klon, nsrf)*100.
    137198      CALL histwrite_phy(o_pourc_srf(nsrf), zx_tmp_fi2d)
    138           zx_tmp_fi2d(1 : klon) = pctsrf( 1 : klon, nsrf)
     199IF (itap > 0)           zx_tmp_fi2d(1 : klon) = pctsrf( 1 : klon, nsrf)
    139200      CALL histwrite_phy(o_fract_srf(nsrf), zx_tmp_fi2d)
    140 !         ENDIF !nsrf.GT.2
    141         zx_tmp_fi2d(1 : klon) = fluxu( 1 : klon, 1, nsrf)
     201IF (itap > 0)         zx_tmp_fi2d(1 : klon) = fluxu( 1 : klon, 1, nsrf)
    142202      CALL histwrite_phy(o_taux_srf(nsrf), zx_tmp_fi2d)
    143         zx_tmp_fi2d(1 : klon) = fluxv( 1 : klon, 1, nsrf)
     203IF (itap > 0)         zx_tmp_fi2d(1 : klon) = fluxv( 1 : klon, 1, nsrf)
    144204      CALL histwrite_phy(o_tauy_srf(nsrf), zx_tmp_fi2d)
    145         zx_tmp_fi2d(1 : klon) = ftsol( 1 : klon, nsrf)
     205IF (itap > 0)         zx_tmp_fi2d(1 : klon) = ftsol( 1 : klon, nsrf)
    146206      CALL histwrite_phy(o_tsol_srf(nsrf), zx_tmp_fi2d)
    147         zx_tmp_fi2d(1 : klon) = evap_pot( 1 : klon, nsrf)
     207IF (itap > 0)         zx_tmp_fi2d(1 : klon) = evap_pot( 1 : klon, nsrf)
    148208      CALL histwrite_phy(o_evappot_srf(nsrf), zx_tmp_fi2d)
    149       zx_tmp_fi2d(1 : klon) = ustar(1 : klon, nsrf)
     209IF (itap > 0)       zx_tmp_fi2d(1 : klon) = ustar(1 : klon, nsrf)
    150210      CALL histwrite_phy(o_ustar_srf(nsrf), zx_tmp_fi2d)
    151       zx_tmp_fi2d(1 : klon) = u10m(1 : klon, nsrf)
     211IF (itap > 0)       zx_tmp_fi2d(1 : klon) = u10m(1 : klon, nsrf)
    152212      CALL histwrite_phy(o_u10m_srf(nsrf), zx_tmp_fi2d)
    153       zx_tmp_fi2d(1 : klon) = v10m(1 : klon, nsrf)
     213IF (itap > 0)       zx_tmp_fi2d(1 : klon) = v10m(1 : klon, nsrf)
    154214      CALL histwrite_phy(o_v10m_srf(nsrf), zx_tmp_fi2d)
    155       zx_tmp_fi2d(1 : klon) = t2m(1 : klon, nsrf)
     215IF (itap > 0)       zx_tmp_fi2d(1 : klon) = t2m(1 : klon, nsrf)
    156216      CALL histwrite_phy(o_t2m_srf(nsrf), zx_tmp_fi2d)
    157       zx_tmp_fi2d(1 : klon) = fevap(1 : klon, nsrf)
     217IF (itap > 0)       zx_tmp_fi2d(1 : klon) = fevap(1 : klon, nsrf)
    158218      CALL histwrite_phy(o_evap_srf(nsrf), zx_tmp_fi2d)
    159        zx_tmp_fi2d(1 : klon) = fluxt( 1 : klon, 1, nsrf)
     219IF (itap > 0)        zx_tmp_fi2d(1 : klon) = fluxt( 1 : klon, 1, nsrf)
    160220      CALL histwrite_phy(o_sens_srf(nsrf), zx_tmp_fi2d)
    161         zx_tmp_fi2d(1 : klon) = fluxlat( 1 : klon, nsrf)
     221IF (itap > 0)         zx_tmp_fi2d(1 : klon) = fluxlat( 1 : klon, nsrf)
    162222      CALL histwrite_phy(o_lat_srf(nsrf), zx_tmp_fi2d)
    163         zx_tmp_fi2d(1 : klon) = fsollw( 1 : klon, nsrf)
     223IF (itap > 0)         zx_tmp_fi2d(1 : klon) = fsollw( 1 : klon, nsrf)
    164224      CALL histwrite_phy(o_flw_srf(nsrf), zx_tmp_fi2d)
    165         zx_tmp_fi2d(1 : klon) = fsolsw( 1 : klon, nsrf)
     225IF (itap > 0)         zx_tmp_fi2d(1 : klon) = fsolsw( 1 : klon, nsrf)
    166226      CALL histwrite_phy(o_fsw_srf(nsrf), zx_tmp_fi2d)
    167         zx_tmp_fi2d(1 : klon) = wfbils( 1 : klon, nsrf)
     227IF (itap > 0)         zx_tmp_fi2d(1 : klon) = wfbils( 1 : klon, nsrf)
    168228      CALL histwrite_phy(o_wbils_srf(nsrf), zx_tmp_fi2d)
    169         zx_tmp_fi2d(1 : klon) = wfbilo( 1 : klon, nsrf)
     229IF (itap > 0)         zx_tmp_fi2d(1 : klon) = wfbilo( 1 : klon, nsrf)
    170230      CALL histwrite_phy(o_wbilo_srf(nsrf), zx_tmp_fi2d)
    171231
    172232      IF (iflag_pbl > 1) THEN
    173       CALL histwrite_phy(o_tke_srf(nsrf),  &
    174        pbl_tke(:,1:klev,nsrf))
    175 
    176 
    177       CALL histwrite_phy(o_tke_max_srf(nsrf),  &
    178        pbl_tke(:,1:klev,nsrf))
    179 
     233      CALL histwrite_phy(o_tke_srf(nsrf),  pbl_tke(:,1:klev,nsrf))
     234      CALL histwrite_phy(o_tke_max_srf(nsrf),  pbl_tke(:,1:klev,nsrf))
    180235      ENDIF
    181236
     
    188243      CALL histwrite_phy(o_cldt, cldt)
    189244      CALL histwrite_phy(o_cldq, cldq)
    190       zx_tmp_fi2d(1:klon) = flwp(1:klon)
     245IF (itap > 0)       zx_tmp_fi2d(1:klon) = flwp(1:klon)
    191246      CALL histwrite_phy(o_lwp, zx_tmp_fi2d)
    192       zx_tmp_fi2d(1:klon) = fiwp(1:klon)
     247IF (itap > 0)       zx_tmp_fi2d(1:klon) = fiwp(1:klon)
    193248      CALL histwrite_phy(o_iwp, zx_tmp_fi2d)
    194249      CALL histwrite_phy(o_ue, ue)
     
    213268      CALL histwrite_phy(o_dnwd, dnwd)
    214269      CALL histwrite_phy(o_dnwd0, dnwd0)
    215         zx_tmp_fi2d=float(itau_con)/float(itap)
     270IF (itap > 0)         zx_tmp_fi2d=float(itau_con)/float(itap)
    216271      CALL histwrite_phy(o_ftime_con, zx_tmp_fi2d)
    217         if(iflag_thermals>=1)then
     272IF (itap > 0) THEN
     273      IF(iflag_thermals>=1)THEN
    218274         zx_tmp_fi3d=dnwd+dnwd0+upwd+fm_therm(:,1:klev)
    219         else
     275      ELSE
    220276         zx_tmp_fi3d=dnwd+dnwd0+upwd
    221         endif
     277      ENDIF
     278ENDIF
    222279      CALL histwrite_phy(o_mc, zx_tmp_fi3d)
    223280      ENDIF !iflag_con .GE. 3
     
    281338
    282339
    283 
     340IF (itap > 0) THEN
    284341      DO i=1, klon
    285342       IF (pctsrf(i,is_oce).GT.epsfra.OR. &
     
    292349       ENDIF
    293350      ENDDO
     351ENDIF
    294352      CALL histwrite_phy(o_t_oce_sic, zx_tmp_fi2d)
    295353
     
    315373      CALL histwrite_phy(o_wake_deltaq, wake_deltaq)
    316374      CALL histwrite_phy(o_wake_omg, wake_omg)
    317           zx_tmp_fi3d(1:klon,1:klev)=d_t_wake(1:klon,1:klev) &
     375IF (itap > 0) zx_tmp_fi3d(1:klon,1:klev)=d_t_wake(1:klon,1:klev) &
    318376                                              /pdtphys
    319377      CALL histwrite_phy(o_dtwak, zx_tmp_fi3d)
    320         zx_tmp_fi3d(1:klon,1:klev)=d_q_wake(1:klon,1:klev)/pdtphys
     378IF (itap > 0) zx_tmp_fi3d(1:klon,1:klev)=d_q_wake(1:klon,1:klev)/pdtphys
    321379      CALL histwrite_phy(o_dqwak, zx_tmp_fi3d)
    322380      ENDIF ! iflag_wake>=1
     
    361419      CALL histwrite_phy(o_re, re)
    362420      CALL histwrite_phy(o_fl, fl)
     421IF (itap > 0) THEN
    363422      DO i=1, klon
    364423       zx_tmp_fi2d(i)=MIN(100.,rh2m(i)*100.)
    365424      ENDDO
     425ENDIF
    366426      CALL histwrite_phy(o_rh2m, zx_tmp_fi2d)
    367427
     428IF (itap > 0) THEN
    368429      DO i=1, klon
    369430       zx_tmp_fi2d(i)=MIN(100.,rh2m(i)*100.)
    370431      ENDDO
     432ENDIF
    371433      CALL histwrite_phy(o_rh2m_min, zx_tmp_fi2d)
     434
     435IF (itap > 0) THEN
    372436      DO i=1, klon
    373437       zx_tmp_fi2d(i)=MIN(100.,rh2m(i)*100.)
    374438      ENDDO
     439ENDIF
    375440      CALL histwrite_phy(o_rh2m_max, zx_tmp_fi2d)
    376441
     
    378443      CALL histwrite_phy(o_tpot, tpot)
    379444      CALL histwrite_phy(o_tpote, tpote)
    380       zx_tmp_fi2d(1 : klon) = fsolsw( 1 : klon, is_ter)
     445IF (itap > 0) zx_tmp_fi2d(1 : klon) = fsolsw( 1 : klon, is_ter)
    381446      CALL histwrite_phy(o_SWnetOR,  zx_tmp_fi2d)
    382       zx_tmp_fi2d(1:klon) = solsw(1:klon)/(1.-albsol1(1:klon))
     447IF (itap > 0) zx_tmp_fi2d(1:klon) = solsw(1:klon)/(1.-albsol1(1:klon))
    383448      CALL histwrite_phy(o_SWdownOR,  zx_tmp_fi2d)
    384449      CALL histwrite_phy(o_LWdownOR, sollwdown)
     
    413478      CALL histwrite_phy(o_loaddust, loaddust)
    414479!--STRAT AER
    415           endif
     480          ENDIF
    416481          IF (ok_ade.OR.ok_aie.OR.flag_aerosol_strat) THEN
    417482          DO naero = 1, naero_spc
     
    419484       tausum_aero(:,2,naero) )
    420485          END DO
    421           endif
     486          ENDIF
    422487      ENDIF
    423488       IF (ok_ade) THEN
     
    446511      CALL histwrite_phy(o_swsrfcf_zero,solswcf_aero(:,3))
    447512        endif
    448         endif ! new_aod
     513    endif ! new_aod
    449514!====MS forcing diagnostics
    450515       ENDIF
     
    480545      CALL histwrite_phy(o_pres, pplay)
    481546      CALL histwrite_phy(o_paprs, paprs(:,1:klev))
     547IF (itap > 0) THEN
    482548         DO i=1, klon
    483549          zx_tmp_fi3d1(i,1)= pphis(i)/RG
     
    492558         ENDDO
    493559         ENDDO
     560ENDIF
    494561      CALL histwrite_phy(o_zfull,zx_tmp_fi3d1(:,2:klevp1))
    495562!020611    $o_zfull%name,itau_w,zx_tmp_fi3d)
     563
     564IF (itap > 0)  THEN
    496565         DO i=1, klon
    497566          zx_tmp_fi3d(i,1)= pphis(i)/RG - ( &
     
    506575         ENDDO
    507576         ENDDO
     577ENDIF
    508578      CALL histwrite_phy(o_zhalf, zx_tmp_fi3d)
    509579      CALL histwrite_phy(o_rneb, cldfra)
     
    522592      CALL histwrite_phy(o_dqphy,  d_qx(:,:,ivap))
    523593        DO nsrf=1, nbsrf
    524         zx_tmp_fi2d(1 : klon) = falb1( 1 : klon, nsrf)
     594IF (itap > 0) zx_tmp_fi2d(1 : klon) = falb1( 1 : klon, nsrf)
    525595      CALL histwrite_phy(o_albe_srf(nsrf), zx_tmp_fi2d)
    526         zx_tmp_fi2d(1 : klon) = frugs( 1 : klon, nsrf)
     596IF (itap > 0) zx_tmp_fi2d(1 : klon) = frugs( 1 : klon, nsrf)
    527597      CALL histwrite_phy(o_rugs_srf(nsrf), zx_tmp_fi2d)
    528         zx_tmp_fi2d(1 : klon) = agesno( 1 : klon, nsrf)
     598IF (itap > 0) zx_tmp_fi2d(1 : klon) = agesno( 1 : klon, nsrf)
    529599      CALL histwrite_phy(o_ages_srf(nsrf), zx_tmp_fi2d)
    530600        ENDDO !nsrf=1, nbsrf
     
    534604      if (iflag_pbl>1) then
    535605      zx_tmp_fi3d=0.
     606IF (itap > 0) THEN
    536607      do nsrf=1,nbsrf
    537608         do k=1,klev
     
    540611         enddo
    541612      enddo
     613ENDIF
    542614      CALL histwrite_phy(o_tke, zx_tmp_fi3d)
    543615
     
    554626      CALL histwrite_phy(o_dudyn, d_u_dyn)
    555627      CALL histwrite_phy(o_dvdyn, d_v_dyn)
     628
     629IF (itap > 0) THEN
    556630      zx_tmp_fi3d(1:klon,1:klev)=d_t_con(1:klon,1:klev)/pdtphys
     631ENDIF
    557632      CALL histwrite_phy(o_dtcon, zx_tmp_fi3d)
    558633      if(iflag_thermals.eq.1)then
     634IF (itap > 0) THEN
    559635      zx_tmp_fi3d(1:klon,1:klev)=d_t_con(1:klon,1:klev)/pdtphys + &
    560636                                 d_t_ajsb(1:klon,1:klev)/pdtphys
     637ENDIF
    561638      CALL histwrite_phy(o_tntc, zx_tmp_fi3d)
    562639      else if(iflag_thermals.gt.1.and.iflag_wake.EQ.1)then
     640IF (itap > 0) THEN
    563641      zx_tmp_fi3d(1:klon,1:klev)=d_t_con(1:klon,1:klev)/pdtphys + &
    564642                                 d_t_ajs(1:klon,1:klev)/pdtphys + &
    565643                                 d_t_wake(1:klon,1:klev)/pdtphys
     644ENDIF
    566645      CALL histwrite_phy(o_tntc, zx_tmp_fi3d)
    567646      endif
    568       zx_tmp_fi3d(1:klon,1:klev)=d_u_con(1:klon,1:klev)/pdtphys
     647IF (itap > 0) zx_tmp_fi3d(1:klon,1:klev)=d_u_con(1:klon,1:klev)/pdtphys
    569648      CALL histwrite_phy(o_ducon, zx_tmp_fi3d)
    570       zx_tmp_fi3d(1:klon,1:klev)=d_v_con(1:klon,1:klev)/pdtphys
     649IF (itap > 0) zx_tmp_fi3d(1:klon,1:klev)=d_v_con(1:klon,1:klev)/pdtphys
    571650      CALL histwrite_phy(o_dvcon, zx_tmp_fi3d)
    572       zx_tmp_fi3d(1:klon,1:klev)=d_q_con(1:klon,1:klev)/pdtphys
     651IF (itap > 0) zx_tmp_fi3d(1:klon,1:klev)=d_q_con(1:klon,1:klev)/pdtphys
    573652      CALL histwrite_phy(o_dqcon, zx_tmp_fi3d)
    574653
    575654      IF(iflag_thermals.EQ.1) THEN
    576         zx_tmp_fi3d(1:klon,1:klev)=d_q_con(1:klon,1:klev)/pdtphys
     655IF (itap > 0) zx_tmp_fi3d(1:klon,1:klev)=d_q_con(1:klon,1:klev)/pdtphys
    577656        CALL histwrite_phy(o_tnhusc, zx_tmp_fi3d)
    578657      ELSE IF(iflag_thermals.GT.1.AND.iflag_wake.EQ.1) THEN
     658IF (itap > 0) THEN
    579659         zx_tmp_fi3d(1:klon,1:klev)=d_q_con(1:klon,1:klev)/pdtphys + &
    580660                                     d_q_ajs(1:klon,1:klev)/pdtphys + &
    581661                                     d_q_wake(1:klon,1:klev)/pdtphys
     662ENDIF
    582663         CALL histwrite_phy(o_tnhusc, zx_tmp_fi3d)
    583664      ENDIF
    584665
    585       zx_tmp_fi3d(1:klon,1:klev)=d_t_lsc(1:klon,1:klev)/pdtphys
     666IF (itap > 0) zx_tmp_fi3d(1:klon,1:klev)=d_t_lsc(1:klon,1:klev)/pdtphys
    586667      CALL histwrite_phy(o_dtlsc, zx_tmp_fi3d)
    587       zx_tmp_fi3d(1:klon, 1:klev)=(d_t_lsc(1:klon,1:klev)+ &
     668IF (itap > 0) zx_tmp_fi3d(1:klon, 1:klev)=(d_t_lsc(1:klon,1:klev)+ &
    588669                                 d_t_eva(1:klon,1:klev))/pdtphys
    589670      CALL histwrite_phy(o_dtlschr, zx_tmp_fi3d)
    590       zx_tmp_fi3d(1:klon,1:klev)=d_q_lsc(1:klon,1:klev)/pdtphys
     671IF (itap > 0) zx_tmp_fi3d(1:klon,1:klev)=d_q_lsc(1:klon,1:klev)/pdtphys
    591672      CALL histwrite_phy(o_dqlsc, zx_tmp_fi3d)
    592       zx_tmp_fi3d(1:klon,1:klev)=beta_prec(1:klon,1:klev)
     673IF (itap > 0) zx_tmp_fi3d(1:klon,1:klev)=beta_prec(1:klon,1:klev)
    593674      CALL histwrite_phy(o_beta_prec, zx_tmp_fi3d)
    594675!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    595676! Sorties specifiques a la separation thermiques/non thermiques
    596677       if (iflag_thermals>=1) then
    597       zx_tmp_fi3d(1:klon,1:klev)=d_t_lscth(1:klon,1:klev)/pdtphys
     678IF(itap > 0) zx_tmp_fi3d(1:klon,1:klev)=d_t_lscth(1:klon,1:klev)/pdtphys
    598679      CALL histwrite_phy(o_dtlscth, zx_tmp_fi3d)
    599       zx_tmp_fi3d(1:klon,1:klev)=d_t_lscst(1:klon,1:klev)/pdtphys
     680IF(itap > 0) zx_tmp_fi3d(1:klon,1:klev)=d_t_lscst(1:klon,1:klev)/pdtphys
    600681      CALL histwrite_phy(o_dtlscst, zx_tmp_fi3d)
    601       zx_tmp_fi3d(1:klon,1:klev)=d_q_lscth(1:klon,1:klev)/pdtphys
     682IF(itap > 0) zx_tmp_fi3d(1:klon,1:klev)=d_q_lscth(1:klon,1:klev)/pdtphys
    602683      CALL histwrite_phy(o_dqlscth, zx_tmp_fi3d)
    603       zx_tmp_fi3d(1:klon,1:klev)=d_q_lscst(1:klon,1:klev)/pdtphys
     684IF(itap > 0) zx_tmp_fi3d(1:klon,1:klev)=d_q_lscst(1:klon,1:klev)/pdtphys
    604685      CALL histwrite_phy(o_dqlscst, zx_tmp_fi3d)
    605686      CALL histwrite_phy(o_plulth, plul_th)
    606687      CALL histwrite_phy(o_plulst, plul_st)
     688IF (itap > 0) THEN
    607689      do k=1,klev
    608690      do i=1,klon
     
    614696      enddo
    615697      enddo
     698ENDIF
    616699      CALL histwrite_phy(o_ptconvth, zx_tmp_fi3d)
     700IF (itap > 0) THEN
    617701      do i=1,klon
    618702           zx_tmp_fi2d(1:klon)=lmax_th(:)
    619703      enddo
     704ENDIF
    620705      CALL histwrite_phy(o_lmaxth, zx_tmp_fi2d)
    621706      endif ! iflag_thermals>=1
    622707!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    623       zx_tmp_fi3d(1:klon,1:klev)=d_t_vdf(1:klon,1:klev)/pdtphys
     708IF (itap > 0) zx_tmp_fi3d(1:klon,1:klev)=d_t_vdf(1:klon,1:klev)/pdtphys
    624709      CALL histwrite_phy(o_dtvdf, zx_tmp_fi3d)
    625       zx_tmp_fi3d(1:klon,1:klev)=d_t_diss(1:klon,1:klev)/pdtphys
     710IF(itap > 0) zx_tmp_fi3d(1:klon,1:klev)=d_t_diss(1:klon,1:klev)/pdtphys
    626711      CALL histwrite_phy(o_dtdis, zx_tmp_fi3d)
    627       zx_tmp_fi3d(1:klon,1:klev)=d_q_vdf(1:klon,1:klev)/pdtphys
     712IF (itap > 0) zx_tmp_fi3d(1:klon,1:klev)=d_q_vdf(1:klon,1:klev)/pdtphys
    628713      CALL histwrite_phy(o_dqvdf, zx_tmp_fi3d)
    629       zx_tmp_fi3d(1:klon,1:klev)=d_t_eva(1:klon,1:klev)/pdtphys
     714IF (itap > 0) zx_tmp_fi3d(1:klon,1:klev)=d_t_eva(1:klon,1:klev)/pdtphys
    630715      CALL histwrite_phy(o_dteva, zx_tmp_fi3d)
    631       zx_tmp_fi3d(1:klon,1:klev)=d_q_eva(1:klon,1:klev)/pdtphys
     716IF (itap > 0) zx_tmp_fi3d(1:klon,1:klev)=d_q_eva(1:klon,1:klev)/pdtphys
    632717      CALL histwrite_phy(o_dqeva, zx_tmp_fi3d)
    633718      zpt_conv = 0.
    634       where (ptconv) zpt_conv = 1.
     719      WHERE (ptconv) zpt_conv = 1.
    635720      CALL histwrite_phy(o_ptconv, zpt_conv)
    636721      CALL histwrite_phy(o_ratqs, ratqs)
     722IF (itap > 0) THEN
    637723      zx_tmp_fi3d(1:klon,1:klev)=d_t_ajs(1:klon,1:klev)/pdtphys - &
    638724                                 d_t_ajsb(1:klon,1:klev)/pdtphys
     725ENDIF
    639726      CALL histwrite_phy(o_dtthe, zx_tmp_fi3d)
    640727       IF (iflag_thermals>=1) THEN
     
    650737      CALL histwrite_phy(o_f0_th, f0)
    651738      CALL histwrite_phy(o_zmax_th, zmax_th)
     739IF (itap > 0) THEN
    652740      zx_tmp_fi3d(1:klon,1:klev)=d_q_ajs(1:klon,1:klev)/pdtphys - &
    653741                                 d_q_ajsb(1:klon,1:klev)/pdtphys
     742ENDIF
    654743      CALL histwrite_phy(o_dqthe, zx_tmp_fi3d)
    655744      ENDIF !iflag_thermals
    656       zx_tmp_fi3d(1:klon,1:klev)=d_t_ajsb(1:klon,1:klev)/pdtphys
     745IF(itap > 0) zx_tmp_fi3d(1:klon,1:klev)=d_t_ajsb(1:klon,1:klev)/pdtphys
    657746      CALL histwrite_phy(o_dtajs, zx_tmp_fi3d)
    658       zx_tmp_fi3d(1:klon,1:klev)=d_q_ajsb(1:klon,1:klev)/pdtphys
     747IF(itap > 0) zx_tmp_fi3d(1:klon,1:klev)=d_q_ajsb(1:klon,1:klev)/pdtphys
    659748      CALL histwrite_phy(o_dqajs, zx_tmp_fi3d)
    660       zx_tmp_fi3d(1:klon,1:klev)=heat(1:klon,1:klev)/RDAY
     749IF(itap > 0) zx_tmp_fi3d(1:klon,1:klev)=heat(1:klon,1:klev)/RDAY
    661750      CALL histwrite_phy(o_dtswr, zx_tmp_fi3d)
    662       zx_tmp_fi3d(1:klon,1:klev)=heat0(1:klon,1:klev)/RDAY
     751IF(itap > 0) zx_tmp_fi3d(1:klon,1:klev)=heat0(1:klon,1:klev)/RDAY
    663752      CALL histwrite_phy(o_dtsw0, zx_tmp_fi3d)
    664       zx_tmp_fi3d(1:klon,1:klev)=-1.*cool(1:klon,1:klev)/RDAY
     753IF(itap > 0) zx_tmp_fi3d(1:klon,1:klev)=-1.*cool(1:klon,1:klev)/RDAY
    665754      CALL histwrite_phy(o_dtlwr, zx_tmp_fi3d)
    666       zx_tmp_fi3d(1:klon,1:klev)=-1.*cool0(1:klon,1:klev)/RDAY
     755IF(itap > 0) zx_tmp_fi3d(1:klon,1:klev)=-1.*cool0(1:klon,1:klev)/RDAY
    667756      CALL histwrite_phy(o_dtlw0, zx_tmp_fi3d)
    668       zx_tmp_fi3d(1:klon,1:klev)=d_t_ec(1:klon,1:klev)/pdtphys
     757IF(itap > 0) zx_tmp_fi3d(1:klon,1:klev)=d_t_ec(1:klon,1:klev)/pdtphys
    669758      CALL histwrite_phy(o_dtec, zx_tmp_fi3d)
    670       zx_tmp_fi3d(1:klon,1:klev)=d_u_vdf(1:klon,1:klev)/pdtphys
     759IF(itap > 0) zx_tmp_fi3d(1:klon,1:klev)=d_u_vdf(1:klon,1:klev)/pdtphys
    671760      CALL histwrite_phy(o_duvdf, zx_tmp_fi3d)
    672       zx_tmp_fi3d(1:klon,1:klev)=d_v_vdf(1:klon,1:klev)/pdtphys
     761IF(itap > 0) zx_tmp_fi3d(1:klon,1:klev)=d_v_vdf(1:klon,1:klev)/pdtphys
    673762      CALL histwrite_phy(o_dvvdf, zx_tmp_fi3d)
    674763       IF (ok_orodr) THEN
    675       zx_tmp_fi3d(1:klon,1:klev)=d_u_oro(1:klon,1:klev)/pdtphys
     764IF(itap > 0) zx_tmp_fi3d(1:klon,1:klev)=d_u_oro(1:klon,1:klev)/pdtphys
    676765      CALL histwrite_phy(o_duoro, zx_tmp_fi3d)
    677       zx_tmp_fi3d(1:klon,1:klev)=d_v_oro(1:klon,1:klev)/pdtphys
     766IF(itap > 0) zx_tmp_fi3d(1:klon,1:klev)=d_v_oro(1:klon,1:klev)/pdtphys
    678767      CALL histwrite_phy(o_dvoro, zx_tmp_fi3d)
    679       zx_tmp_fi3d(1:klon,1:klev)=d_t_oro(1:klon,1:klev)/pdtphys
     768IF(itap > 0) zx_tmp_fi3d(1:klon,1:klev)=d_t_oro(1:klon,1:klev)/pdtphys
    680769      CALL histwrite_phy(o_dtoro, zx_tmp_fi3d)
    681770       ENDIF
    682771        IF (ok_orolf) THEN
    683       zx_tmp_fi3d(1:klon,1:klev)=d_u_lif(1:klon,1:klev)/pdtphys
     772IF(itap > 0) zx_tmp_fi3d(1:klon,1:klev)=d_u_lif(1:klon,1:klev)/pdtphys
    684773      CALL histwrite_phy(o_dulif, zx_tmp_fi3d)
    685774       ENDIF
    686       zx_tmp_fi3d(1:klon,1:klev)=d_v_lif(1:klon,1:klev)/pdtphys
     775IF(itap > 0) zx_tmp_fi3d(1:klon,1:klev)=d_v_lif(1:klon,1:klev)/pdtphys
    687776      CALL histwrite_phy(o_dvlif, zx_tmp_fi3d)
    688777
    689       zx_tmp_fi3d(1:klon,1:klev)=d_t_lif(1:klon,1:klev)/pdtphys
     778IF(itap > 0) zx_tmp_fi3d(1:klon,1:klev)=d_t_lif(1:klon,1:klev)/pdtphys
    690779      CALL histwrite_phy(o_dtlif, zx_tmp_fi3d)
    691780
    692781       IF (ok_hines) THEN
    693       zx_tmp_fi3d(1:klon,1:klev)=d_u_hin(1:klon,1:klev)/pdtphys
     782IF(itap > 0) zx_tmp_fi3d(1:klon,1:klev)=d_u_hin(1:klon,1:klev)/pdtphys
    694783      CALL histwrite_phy(o_duhin, zx_tmp_fi3d)
    695       zx_tmp_fi3d(1:klon,1:klev)=d_v_hin(1:klon,1:klev)/pdtphys
     784IF(itap > 0) zx_tmp_fi3d(1:klon,1:klev)=d_v_hin(1:klon,1:klev)/pdtphys
    696785      CALL histwrite_phy(o_dvhin, zx_tmp_fi3d)
    697       zx_tmp_fi3d(1:klon,1:klev)=d_t_hin(1:klon,1:klev)/pdtphys
     786IF(itap > 0) zx_tmp_fi3d(1:klon,1:klev)=d_t_hin(1:klon,1:klev)/pdtphys
    698787      CALL histwrite_phy(o_dthin, zx_tmp_fi3d)
    699788        ENDIF
     
    706795      CALL histwrite_phy(o_rlucs, lwup0)
    707796      CALL histwrite_phy(o_rldcs, lwdn0)
     797IF(itap > 0) THEN
    708798      zx_tmp_fi3d(1:klon,1:klev)=d_t(1:klon,1:klev)+ &
    709799      d_t_dyn(1:klon,1:klev)
     800ENDIF
    710801      CALL histwrite_phy(o_tnt, zx_tmp_fi3d)
     802IF(itap > 0) THEN
    711803      zx_tmp_fi3d(1:klon,1:klev)=heat(1:klon,1:klev)/RDAY - &
    712804      cool(1:klon,1:klev)/RDAY
     805ENDIF
    713806      CALL histwrite_phy(o_tntr, zx_tmp_fi3d)
     807IF(itap > 0) THEN
    714808      zx_tmp_fi3d(1:klon,1:klev)= (d_t_lsc(1:klon,1:klev)+ &
    715809                                   d_t_eva(1:klon,1:klev)+ &
    716810                                   d_t_vdf(1:klon,1:klev))/pdtphys
     811ENDIF
    717812      CALL histwrite_phy(o_tntscpbl, zx_tmp_fi3d)
     813IF(itap > 0) THEN
    718814      zx_tmp_fi3d(1:klon,1:klev)=d_qx(1:klon,1:klev,ivap)+ &
    719815      d_q_dyn(1:klon,1:klev)
     816ENDIF
    720817      CALL histwrite_phy(o_tnhus, zx_tmp_fi3d)
     818IF(itap > 0) THEN
    721819      zx_tmp_fi3d(1:klon,1:klev)=d_q_lsc(1:klon,1:klev)/pdtphys+ &
    722820                                 d_q_eva(1:klon,1:klev)/pdtphys
     821ENDIF
    723822      CALL histwrite_phy(o_tnhusscpbl, zx_tmp_fi3d)
    724823      CALL histwrite_phy(o_evu, coefm(:,:,is_ave))
     824IF(itap > 0) THEN
    725825      zx_tmp_fi3d(1:klon,1:klev)=q_seri(1:klon,1:klev)+ &
    726826                                 ql_seri(1:klon,1:klev)
     827ENDIF
    727828      CALL histwrite_phy(o_h2o, zx_tmp_fi3d)
    728829       if (iflag_con >= 3) then
     830IF(itap > 0) THEN
    729831             zx_tmp_fi3d(1:klon,1:klev)=-1 * (dnwd(1:klon,1:klev)+ &
    730832                  dnwd0(1:klon,1:klev))
     833ENDIF
    731834      CALL histwrite_phy(o_mcd, zx_tmp_fi3d)
     835IF(itap > 0) THEN
    732836             zx_tmp_fi3d(1:klon,1:klev)=upwd(1:klon,1:klev) + &
    733837                  dnwd(1:klon,1:klev)+ dnwd0(1:klon,1:klev)
     838ENDIF
    734839      CALL histwrite_phy(o_dmc, zx_tmp_fi3d)
    735840       else if (iflag_con == 2) then
     
    742847       RN2O_per.NE.RN2O_act.OR.RCFC11_per.NE.RCFC11_act.OR. &
    743848       RCFC12_per.NE.RCFC12_act) THEN
    744       zx_tmp_fi2d(1 : klon) = swupp ( 1 : klon, klevp1 )
     849IF(itap > 0) zx_tmp_fi2d(1 : klon) = swupp ( 1 : klon, klevp1 )
    745850      CALL histwrite_phy(o_rsut4co2, zx_tmp_fi2d)
    746       zx_tmp_fi2d(1 : klon) = lwupp ( 1 : klon, klevp1 )
     851IF(itap > 0) zx_tmp_fi2d(1 : klon) = lwupp ( 1 : klon, klevp1 )
    747852      CALL histwrite_phy(o_rlut4co2, zx_tmp_fi2d)
    748       zx_tmp_fi2d(1 : klon) = swup0p ( 1 : klon, klevp1 )
     853IF(itap > 0) zx_tmp_fi2d(1 : klon) = swup0p ( 1 : klon, klevp1 )
    749854      CALL histwrite_phy(o_rsutcs4co2, zx_tmp_fi2d)
    750       zx_tmp_fi2d(1 : klon) = lwup0p ( 1 : klon, klevp1 )
     855IF(itap > 0) zx_tmp_fi2d(1 : klon) = lwup0p ( 1 : klon, klevp1 )
    751856      CALL histwrite_phy(o_rlutcs4co2, zx_tmp_fi2d)
    752857      CALL histwrite_phy(o_rsu4co2, swupp)
     
    765870         DO iq=3,nqtot
    766871         zx_tmp_fi2d=0.
     872IF(itap > 0) THEN
    767873         DO k=1,klev
    768874            zx_tmp_fi2d(:)=zx_tmp_fi2d(:)+zmasse(:,k)*qx(:,k,iq)
    769875         ENDDO
     876ENDIF
    770877            CALL histwrite_phy(o_trac_cum(iq-2), zx_tmp_fi2d)
    771878         ENDDO
Note: See TracChangeset for help on using the changeset viewer.