Ignore:
Timestamp:
Dec 14, 2015, 11:43:09 AM (9 years ago)
Author:
Laurent Fairhead
Message:

Merged trunk changes r2298:2396 into testing branch

Location:
LMDZ5/branches/testing
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • LMDZ5/branches/testing

  • LMDZ5/branches/testing/libf/phylmd/phys_output_write_mod.F90

    r2298 r2408  
    11!
    2 ! $Id$
     2! $Header$
    33!
    44MODULE phys_output_write_mod
     
    2525
    2626    USE dimphy, only: klon, klev, klevp1, nslay
    27     USE control_mod, only: day_step, iphysiq
     27    USE mod_grid_phy_lmdz, ONLY : nbp_lon, nbp_lat
     28    USE time_phylmdz_mod, only: day_step_phy, start_time, itau_phy
    2829    USE phys_output_ctrlout_mod, only: o_phis, o_aire, is_ter, is_lic, is_oce, &
    2930         is_ave, is_sic, o_contfracATM, o_contfracOR, &
    30          o_aireTER, o_flat, o_slp, o_tsol, &
     31         o_aireTER, o_flat, o_slp, o_ptstar, o_pt0, o_tsol, &
    3132         o_t2m, o_t2m_min, o_t2m_max, &
    3233         o_t2m_min_mon, o_t2m_max_mon, &
     
    7071         o_tSTDlevs, epsfra, o_t_oce_sic, &
    7172         o_ale_bl, o_alp_bl, o_ale_wk, o_alp_wk, &
     73         o_dtvdf_x    , o_dtvdf_w    , o_dqvdf_x    , o_dqvdf_w    , &
     74         o_sens_x     , o_sens_w     , o_flat_x     , o_flat_w     , &
     75         o_delta_tsurf, &
     76         o_cdragh_x   , o_cdragh_w   , o_cdragm_x   , o_cdragm_w   , &
     77         o_kh         , o_kh_x       , o_kh_w       , &
    7278         o_ale, o_alp, o_cin, o_WAPE, o_wake_h, &
    7379         o_wake_s, o_wake_deltat, o_wake_deltaq, &
     
    132138         o_duvdf, o_dvvdf, o_duoro, o_dvoro, &
    133139         o_dtoro, o_dulif, o_dvlif, o_dtlif, &
    134          o_duhin, o_dvhin, o_dthin, o_dqch4, o_rsu, &
     140         o_du_gwd_hines, o_dv_gwd_hines, o_dthin, o_dqch4, o_rsu, &
     141         o_du_gwd_front, o_dv_gwd_front, &
     142         o_east_gwstress, o_west_gwstress, &
    135143         o_rsd, o_rlu, o_rld, o_rsucs, o_rsdcs, &
    136144         o_rlucs, o_rldcs, o_tnt, o_tntr, &
     
    151159         o_dtr_ls, o_dtr_trsp, o_dtr_sscav, &
    152160         o_dtr_sat, o_dtr_uscav, o_trac_cum, o_du_gwd_rando, o_dv_gwd_rando, &
    153          o_vstr_gwd_rando
     161         o_ustr_gwd_hines,o_vstr_gwd_hines,o_ustr_gwd_rando,o_vstr_gwd_rando, &
     162         o_ustr_gwd_front,o_vstr_gwd_front
    154163
    155164    USE phys_state_var_mod, only: pctsrf, paire_ter, rain_fall, snow_fall, &
     
    160169         SWdn200, SWdn200clr, LWup200, LWup200clr, &
    161170         LWdn200, LWdn200clr, solsw, solsw0, sollw, &
    162          radsol, sollw0, sollwdown, sollw, gustiness, &
     171         radsol, swradcorr, sollw0, sollwdown, sollw, gustiness, &
    163172         sollwdownclr, lwdn0, ftsol, ustar, u10m, &
    164173         v10m, pbl_tke, wake_delta_pbl_TKE, &
     174         delta_tsurf, &
    165175         wstar, cape, ema_pcb, ema_pct, &
    166176         ema_cbmf, Ma, fm_therm, ale_bl, alp_bl, ale, &
     
    174184         vqsumSTD, vTsumSTD, O3daysumSTD, wqsumSTD, &
    175185         vphisumSTD, wTsumSTD, u2sumSTD, v2sumSTD, &
    176          T2sumSTD, nlevSTD, du_gwd_rando, dv_gwd_rando, &
     186         T2sumSTD, nlevSTD, du_gwd_rando, du_gwd_front, &
    177187         ulevSTD, vlevSTD, wlevSTD, philevSTD, qlevSTD, tlevSTD, &
    178188         rhlevSTD, O3STD, O3daySTD, uvSTD, vqSTD, vTSTD, wqSTD, &
    179189         vphiSTD, wTSTD, u2STD, v2STD, T2STD, missing_val_nf90
    180190
    181     USE phys_local_var_mod, only: zxfluxlat, slp, zxtsol, zt2m, &
     191    USE phys_local_var_mod, only: zxfluxlat, slp, ptstar, pt0, zxtsol, zt2m, &
    182192         t2m_min_mon, t2m_max_mon, evap, &
    183193         zu10m, zv10m, zq2m, zustar, zxqsurf, &
     
    193203         s_pblh, s_pblt, s_lcl, s_therm, uwriteSTD, &
    194204         vwriteSTD, wwriteSTD, phiwriteSTD, qwriteSTD, &
    195          twriteSTD, ale_wake, alp_wake, wake_h, &
     205         twriteSTD, ale_wake, alp_wake, &
     206         dtvdf_x    ,dtvdf_w    ,dqvdf_x    ,dqvdf_w    , &
     207         sens_x     ,sens_w     ,zxfluxlat_x,zxfluxlat_w, &
     208         cdragh_x   ,cdragh_w   ,cdragm_x   ,cdragm_w   , &
     209         kh         ,kh_x       ,kh_w       , &
     210         wake_h, &
    196211         wake_omg, d_t_wake, d_q_wake, Vprecip, &
    197212         wdtrainA, wdtrainM, n2, s2, proba_notrig, &
     
    230245         zw2, fraca, zmax_th, d_q_ajsb, d_t_ec, d_u_vdf, &
    231246         d_v_vdf, d_u_oro, d_v_oro, d_t_oro, d_u_lif, &
    232          d_v_lif, d_t_lif, d_u_hin, d_v_hin, d_t_hin, &
     247         d_v_lif, d_t_lif, du_gwd_hines, dv_gwd_hines, d_t_hin, &
     248         dv_gwd_rando, dv_gwd_front, &
     249         east_gwstress, west_gwstress, &
    233250         d_q_ch4, pmfd, pmfu, ref_liq, ref_ice, rhwriteSTD
    234251
    235252    USE phys_output_var_mod, only: vars_defined, snow_o, zfra_o, bils_diss, &
    236253         bils_ec,bils_ech, bils_tke, bils_kinetic, bils_latent, bils_enthalp, &
    237          itau_con, nfiles, clef_files, nid_files, zvstr_gwd_rando
     254         itau_con, nfiles, clef_files, nid_files, &
     255         zustr_gwd_hines, zvstr_gwd_hines,zustr_gwd_rando, zvstr_gwd_rando, &
     256         zustr_gwd_front, zvstr_gwd_front                                   
    238257    USE ocean_slab_mod, only: tslab, slab_bils, slab_bilg, tice, seaice
    239258    USE pbl_surface_mod, only: snow
    240259    USE indice_sol_mod, only: nbsrf
    241     USE infotrac, only: nqtot, nqo, type_trac
    242     USE comgeomphy, only: airephy
     260    USE infotrac_phy, only: nqtot, nqo, type_trac
     261    USE geometry_mod, only: cell_area
    243262    USE surface_data, only: type_ocean, version_ocean, ok_veget, ok_snow
    244263!    USE aero_mod, only: naero_spc
     
    247266    USE iophy, only: set_itau_iophy, histwrite_phy
    248267    USE netcdf, only: nf90_fill_real
     268    USE print_control_mod, ONLY: prt_level,lunout
     269
    249270
    250271#ifdef CPP_XIOS
     
    259280
    260281
    261     INCLUDE "temps.h"
    262282    INCLUDE "clesphys.h"
    263283    INCLUDE "thermcell.h"
    264284    INCLUDE "compbl.h"
    265285    INCLUDE "YOMCST.h"
    266     INCLUDE "dimensions.h"
    267     include "iniprint.h"
    268286
    269287    ! Input
     
    280298    REAL, DIMENSION(klon, klev+1) :: paprs
    281299    REAL, DIMENSION(klon,klev,nqtot) :: qx, d_qx
    282     REAL, DIMENSION(klon, llm) :: zmasse
     300    REAL, DIMENSION(klon, klev) :: zmasse
    283301    LOGICAL :: flag_aerosol_strat
    284302    INTEGER :: flag_aerosol
     
    287305
    288306    ! Local
    289     INTEGER, PARAMETER :: jjmp1=jjm+1-1/jjm
    290307    INTEGER :: itau_w
    291308    INTEGER :: i, iinit, iinitend=1, iff, iq, nsrf, k, ll, naero
     
    294311    REAL, DIMENSION (klon,klev+1) :: zx_tmp_fi3d1
    295312    CHARACTER (LEN=4)              :: bb2
    296     INTEGER, DIMENSION(iim*jjmp1)  :: ndex2d
    297     INTEGER, DIMENSION(iim*jjmp1*klev) :: ndex3d
     313    INTEGER, DIMENSION(nbp_lon*nbp_lat)  :: ndex2d
     314    INTEGER, DIMENSION(nbp_lon*nbp_lat*klev) :: ndex3d
    298315    REAL, PARAMETER :: dobson_u = 2.1415e-05 ! Dobson unit, in kg m-2
    299316!   REAL, PARAMETER :: missing_val=nf90_fill_real
     
    304321
    305322    ! On calcul le nouveau tau:
    306     itau_w = itau_phy + itap + start_time * day_step / iphysiq
     323    itau_w = itau_phy + itap + start_time * day_step_phy
    307324    ! On le donne à iophy pour que les histwrite y aient accès:
    308325    CALL set_itau_iophy(itau_w)
     
    331348!!! Champs 1D !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    332349       CALL histwrite_phy(o_phis, pphis)
    333        CALL histwrite_phy(o_aire, airephy)
     350       CALL histwrite_phy(o_aire, cell_area)
    334351
    335352       IF (vars_defined) THEN
     
    344361!!! Champs 2D !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    345362       CALL histwrite_phy(o_flat, zxfluxlat)
     363       CALL histwrite_phy(o_ptstar, ptstar)
     364       CALL histwrite_phy(o_pt0, pt0)
    346365       CALL histwrite_phy(o_slp, slp)
    347366       CALL histwrite_phy(o_tsol, zxtsol)
     
    418437       CALL histwrite_phy(o_fsnow, zfra_o)
    419438       CALL histwrite_phy(o_evap, evap)
    420        CALL histwrite_phy(o_tops, topsw)
    421        CALL histwrite_phy(o_tops0, topsw0)
     439       CALL histwrite_phy(o_tops, topsw*swradcorr)
     440       CALL histwrite_phy(o_tops0, topsw0*swradcorr)
    422441       CALL histwrite_phy(o_topl, toplw)
    423442       CALL histwrite_phy(o_topl0, toplw0)
    424443
    425444       IF (vars_defined) THEN
    426           zx_tmp_fi2d(1 : klon) = swup ( 1 : klon, klevp1 )
     445          zx_tmp_fi2d(:) = swup(:,klevp1)*swradcorr(:)
    427446       ENDIF
    428447       CALL histwrite_phy(o_SWupTOA, zx_tmp_fi2d)
    429448
    430449       IF (vars_defined) THEN
    431           zx_tmp_fi2d(1 : klon) = swup0 ( 1 : klon, klevp1 )
     450          zx_tmp_fi2d(:) = swup0(:,klevp1)*swradcorr(:)
    432451       ENDIF
    433452       CALL histwrite_phy(o_SWupTOAclr, zx_tmp_fi2d)
    434453
    435454       IF (vars_defined) THEN
    436           zx_tmp_fi2d(1 : klon) = swdn ( 1 : klon, klevp1 )
     455          zx_tmp_fi2d(:) = swdn(:,klevp1)*swradcorr(:)
    437456       ENDIF
    438457       CALL histwrite_phy(o_SWdnTOA, zx_tmp_fi2d)
    439458
    440459       IF (vars_defined) THEN
    441           zx_tmp_fi2d(1 : klon) = swdn0 ( 1 : klon, klevp1 )
     460          zx_tmp_fi2d(:) = swdn0(:,klevp1)*swradcorr(:)
    442461       ENDIF
    443462       CALL histwrite_phy(o_SWdnTOAclr, zx_tmp_fi2d)
    444463
    445464       IF (vars_defined) THEN
    446           zx_tmp_fi2d(:) = topsw(:)-toplw(:)
     465          zx_tmp_fi2d(:) = topsw(:)*swradcorr(:)-toplw(:)
    447466       ENDIF
    448467       CALL histwrite_phy(o_nettop, zx_tmp_fi2d)
    449        CALL histwrite_phy(o_SWup200, SWup200)
    450        CALL histwrite_phy(o_SWup200clr, SWup200clr)
    451        CALL histwrite_phy(o_SWdn200, SWdn200)
    452        CALL histwrite_phy(o_SWdn200clr, SWdn200clr)
     468       CALL histwrite_phy(o_SWup200, SWup200*swradcorr)
     469       CALL histwrite_phy(o_SWup200clr, SWup200clr*swradcorr)
     470       CALL histwrite_phy(o_SWdn200, SWdn200*swradcorr)
     471       CALL histwrite_phy(o_SWdn200clr, SWdn200clr*swradcorr)
    453472       CALL histwrite_phy(o_LWup200, LWup200)
    454473       CALL histwrite_phy(o_LWup200clr, LWup200clr)
    455474       CALL histwrite_phy(o_LWdn200, LWdn200)
    456475       CALL histwrite_phy(o_LWdn200clr, LWdn200clr)
    457        CALL histwrite_phy(o_sols, solsw)
    458        CALL histwrite_phy(o_sols0, solsw0)
     476       CALL histwrite_phy(o_sols, solsw*swradcorr)
     477       CALL histwrite_phy(o_sols0, solsw0*swradcorr)
    459478       CALL histwrite_phy(o_soll, sollw)
     479       CALL histwrite_phy(o_soll0, sollw0)
    460480       CALL histwrite_phy(o_radsol, radsol)
    461        CALL histwrite_phy(o_soll0, sollw0)
    462 
    463        IF (vars_defined) THEN
    464           zx_tmp_fi2d(1 : klon) = swup ( 1 : klon, 1 )
     481
     482       IF (vars_defined) THEN
     483          zx_tmp_fi2d(:) = swup(:,1)*swradcorr(:)
    465484       ENDIF
    466485       CALL histwrite_phy(o_SWupSFC, zx_tmp_fi2d)
    467486
    468487       IF (vars_defined) THEN
    469           zx_tmp_fi2d(1 : klon) = swup0 ( 1 : klon, 1 )
     488          zx_tmp_fi2d(:) = swup0(:,1)*swradcorr(:)
    470489       ENDIF
    471490       CALL histwrite_phy(o_SWupSFCclr, zx_tmp_fi2d)
    472491
    473492       IF (vars_defined) THEN
    474           zx_tmp_fi2d(1 : klon) = swdn ( 1 : klon, 1 )
     493          zx_tmp_fi2d(:) = swdn(:,1)*swradcorr(:)
    475494       ENDIF
    476495       CALL histwrite_phy(o_SWdnSFC, zx_tmp_fi2d)
    477496
    478497       IF (vars_defined) THEN
    479           zx_tmp_fi2d(1 : klon) = swdn0 ( 1 : klon, 1 )
     498          zx_tmp_fi2d(:) = swdn0(:,1)*swradcorr(:)
    480499       ENDIF
    481500       CALL histwrite_phy(o_SWdnSFCclr, zx_tmp_fi2d)
    482501
    483502       IF (vars_defined) THEN
    484           zx_tmp_fi2d(1:klon)=sollwdown(1:klon)-sollw(1:klon)
     503          zx_tmp_fi2d(:)=sollwdown(:)-sollw(:)
    485504       ENDIF
    486505       CALL histwrite_phy(o_LWupSFC, zx_tmp_fi2d)
     
    746765             CALL histwrite_phy(o_ale_wk, ale_wake)
    747766             CALL histwrite_phy(o_alp_wk, alp_wake)
     767             IF (iflag_pbl_split>=1) THEN
     768               IF (vars_defined) zx_tmp_fi3d(1:klon,1:klev)=dtvdf_x(1:klon,1:klev)/pdtphys
     769               CALL histwrite_phy(o_dtvdf_x    ,zx_tmp_fi3d)
     770               IF (vars_defined) zx_tmp_fi3d(1:klon,1:klev)=dtvdf_w(1:klon,1:klev)/pdtphys
     771               CALL histwrite_phy(o_dtvdf_w    ,zx_tmp_fi3d)
     772               IF (vars_defined) zx_tmp_fi3d(1:klon,1:klev)=dqvdf_x(1:klon,1:klev)/pdtphys
     773               CALL histwrite_phy(o_dqvdf_x    ,zx_tmp_fi3d)
     774               IF (vars_defined) zx_tmp_fi3d(1:klon,1:klev)=dqvdf_w(1:klon,1:klev)/pdtphys
     775               CALL histwrite_phy(o_dqvdf_w    ,zx_tmp_fi3d)
     776               CALL histwrite_phy(o_sens_x     ,sens_x     )
     777               CALL histwrite_phy(o_sens_w     ,sens_w     )
     778               CALL histwrite_phy(o_flat_x     ,zxfluxlat_x)
     779               CALL histwrite_phy(o_flat_w     ,zxfluxlat_w)
     780               CALL histwrite_phy(o_delta_tsurf,delta_tsurf)
     781               CALL histwrite_phy(o_cdragh_x   ,cdragh_x   )
     782               CALL histwrite_phy(o_cdragh_w   ,cdragh_w   )
     783               CALL histwrite_phy(o_cdragm_x   ,cdragm_x   )
     784               CALL histwrite_phy(o_cdragm_w   ,cdragm_w   )
     785               CALL histwrite_phy(o_kh         ,kh         )
     786               CALL histwrite_phy(o_kh_x       ,kh_x       )
     787               CALL histwrite_phy(o_kh_w       ,kh_w       )
     788             ENDIF   ! (iflag_pbl_split>=1)
    748789             CALL histwrite_phy(o_ale, ale)
    749790             CALL histwrite_phy(o_alp, alp)
     
    895936       ENDIF
    896937       IF (ok_ade) THEN
    897           CALL histwrite_phy(o_topswad, topswad_aero)
    898           CALL histwrite_phy(o_topswad0, topswad0_aero)
    899           CALL histwrite_phy(o_solswad, solswad_aero)
    900           CALL histwrite_phy(o_solswad0, solswad0_aero)
     938          CALL histwrite_phy(o_topswad, topswad_aero*swradcorr)
     939          CALL histwrite_phy(o_topswad0, topswad0_aero*swradcorr)
     940          CALL histwrite_phy(o_solswad, solswad_aero*swradcorr)
     941          CALL histwrite_phy(o_solswad0, solswad0_aero*swradcorr)
    901942          CALL histwrite_phy(o_toplwad, toplwad_aero)
    902943          CALL histwrite_phy(o_toplwad0, toplwad0_aero)
     
    905946          !====MS forcing diagnostics
    906947          if (new_aod) then
    907              CALL histwrite_phy(o_swtoaas_nat, topsw_aero(:,1))
    908              CALL histwrite_phy(o_swsrfas_nat, solsw_aero(:,1))
    909              CALL histwrite_phy(o_swtoacs_nat, topsw0_aero(:,1))
    910              CALL histwrite_phy(o_swsrfcs_nat, solsw0_aero(:,1))
     948             zx_tmp_fi2d(:)=topsw_aero(:,1)*swradcorr(:)
     949             CALL histwrite_phy(o_swtoaas_nat,zx_tmp_fi2d)
     950             zx_tmp_fi2d(:)=solsw_aero(:,1)*swradcorr(:)
     951             CALL histwrite_phy(o_swsrfas_nat,zx_tmp_fi2d)
     952             zx_tmp_fi2d(:)=topsw0_aero(:,1)*swradcorr(:)
     953             CALL histwrite_phy(o_swtoacs_nat,zx_tmp_fi2d)
     954             zx_tmp_fi2d(:)=solsw0_aero(:,1)*swradcorr(:)
     955             CALL histwrite_phy(o_swsrfcs_nat,zx_tmp_fi2d)
    911956             !ant
    912              CALL histwrite_phy(o_swtoaas_ant, topsw_aero(:,2))
    913              CALL histwrite_phy(o_swsrfas_ant, solsw_aero(:,2))
    914              CALL histwrite_phy(o_swtoacs_ant, topsw0_aero(:,2))
    915              CALL histwrite_phy(o_swsrfcs_ant, solsw0_aero(:,2))
     957             zx_tmp_fi2d(:)=topsw_aero(:,2)*swradcorr(:)
     958             CALL histwrite_phy(o_swtoaas_ant,zx_tmp_fi2d)
     959             zx_tmp_fi2d(:)=solsw_aero(:,2)*swradcorr(:)
     960             CALL histwrite_phy(o_swsrfas_ant,zx_tmp_fi2d)
     961             zx_tmp_fi2d(:)=topsw0_aero(:,2)*swradcorr(:)
     962             CALL histwrite_phy(o_swtoacs_ant,zx_tmp_fi2d)
     963             zx_tmp_fi2d(:)=solsw0_aero(:,2)*swradcorr(:)
     964             CALL histwrite_phy(o_swsrfcs_ant,zx_tmp_fi2d)
    916965             !cf
    917966             if (.not. aerosol_couple) then
    918                 CALL histwrite_phy(o_swtoacf_nat, topswcf_aero(:,1))
    919                 CALL histwrite_phy(o_swsrfcf_nat, solswcf_aero(:,1))
    920                 CALL histwrite_phy(o_swtoacf_ant, topswcf_aero(:,2))
    921                 CALL histwrite_phy(o_swsrfcf_ant, solswcf_aero(:,2))
    922                 CALL histwrite_phy(o_swtoacf_zero,topswcf_aero(:,3))
    923                 CALL histwrite_phy(o_swsrfcf_zero,solswcf_aero(:,3))
     967                zx_tmp_fi2d(:)=topswcf_aero(:,1)*swradcorr(:)
     968                CALL histwrite_phy(o_swtoacf_nat,zx_tmp_fi2d)
     969                zx_tmp_fi2d(:)=solswcf_aero(:,1)*swradcorr(:)
     970                CALL histwrite_phy(o_swsrfcf_nat,zx_tmp_fi2d)
     971                zx_tmp_fi2d(:)=topswcf_aero(:,2)*swradcorr(:)
     972                CALL histwrite_phy(o_swtoacf_ant,zx_tmp_fi2d)
     973                zx_tmp_fi2d(:)=solswcf_aero(:,2)*swradcorr(:)
     974                CALL histwrite_phy(o_swsrfcf_ant,zx_tmp_fi2d)
     975                zx_tmp_fi2d(:)=topswcf_aero(:,3)*swradcorr(:)
     976                CALL histwrite_phy(o_swtoacf_zero,zx_tmp_fi2d)
     977                zx_tmp_fi2d(:)=solswcf_aero(:,3)*swradcorr(:)
     978                CALL histwrite_phy(o_swsrfcf_zero,zx_tmp_fi2d)
    924979             endif
    925980          endif ! new_aod
     
    927982       ENDIF
    928983       IF (ok_aie) THEN
    929           CALL histwrite_phy(o_topswai, topswai_aero)
    930           CALL histwrite_phy(o_solswai, solswai_aero)
     984          CALL histwrite_phy(o_topswai, topswai_aero*swradcorr)
     985          CALL histwrite_phy(o_solswai, solswai_aero*swradcorr)
    931986       ENDIF
    932987       IF (flag_aerosol.GT.0.AND.ok_cdnc) THEN
     
    9591014       CALL histwrite_phy(o_pres, pplay)
    9601015       CALL histwrite_phy(o_paprs, paprs(:,1:klev))
    961        IF (vars_defined) THEN
    962           DO i=1, klon
    963              zx_tmp_fi3d1(i,1)= pphis(i)/RG
    964              !020611   zx_tmp_fi3d(i,1)= pphis(i)/RG
    965           ENDDO
    966           DO k=1, klev
    967              !020611        DO k=1, klev-1
    968              DO i=1, klon
    969                 !020611         zx_tmp_fi3d(i,k+1)= zx_tmp_fi3d(i,k) - (t_seri(i,k) *RD *
    970                 zx_tmp_fi3d1(i,k+1)= zx_tmp_fi3d1(i,k) - (t_seri(i,k) *RD *  &
    971                      (paprs(i,k+1) - paprs(i,k))) / ( pplay(i,k) * RG )
    972              ENDDO
    973           ENDDO
    974        ENDIF
    975        CALL histwrite_phy(o_zfull,zx_tmp_fi3d1(:,2:klevp1))
    976        !020611    $o_zfull%name,itau_w,zx_tmp_fi3d)
     1016       CALL histwrite_phy(o_zfull,zphi/RG)
    9771017
    9781018       IF (vars_defined)  THEN
    979           DO i=1, klon
    980              zx_tmp_fi3d(i,1)= pphis(i)/RG - ( &
    981                   (t_seri(i,1)+zxtsol(i))/2. *RD * &
    982                   (pplay(i,1) - paprs(i,1)))/( (paprs(i,1)+pplay(i,1))/2.* RG)
    983           ENDDO
    984           DO k=1, klev-1
    985              DO i=1, klon
    986                 zx_tmp_fi3d(i,k+1)= zx_tmp_fi3d(i,k) - ( &
    987                      (t_seri(i,k)+t_seri(i,k+1))/2. *RD *  &
    988                      (pplay(i,k+1) - pplay(i,k))) / ( paprs(i,k) * RG )
    989              ENDDO
    990           ENDDO
     1019        zx_tmp_fi3d(:,1)= pphis(:)/RG
     1020        DO k = 2, klev
     1021         DO i = 1, klon
     1022            zx_tmp_fi3d(i,k) = zphi(i,k)/RG + &
     1023                          (zphi(i,k)-zphi(i,k-1))/RG * &
     1024                          (paprs(i,k)-pplay(i,k))/(pplay(i,k)-pplay(i,k-1))
     1025         ENDDO
     1026        ENDDO
    9911027       ENDIF
    9921028       CALL histwrite_phy(o_zhalf, zx_tmp_fi3d)
     
    12161252
    12171253       IF (ok_hines) THEN
    1218           IF(vars_defined) zx_tmp_fi3d(1:klon,1:klev)=d_u_hin(1:klon,1:klev)/pdtphys
    1219           CALL histwrite_phy(o_duhin, zx_tmp_fi3d)
    1220           IF(vars_defined) zx_tmp_fi3d(1:klon,1:klev)=d_v_hin(1:klon,1:klev)/pdtphys
    1221           CALL histwrite_phy(o_dvhin, zx_tmp_fi3d)
     1254          CALL histwrite_phy(o_du_gwd_hines, du_gwd_hines/pdtphys)
     1255          CALL histwrite_phy(o_dv_gwd_hines, dv_gwd_hines/pdtphys)
    12221256          IF(vars_defined) zx_tmp_fi3d(1:klon,1:klev)=d_t_hin(1:klon,1:klev)/pdtphys
    12231257          CALL histwrite_phy(o_dthin, zx_tmp_fi3d)
     1258          CALL histwrite_phy(o_ustr_gwd_hines, zustr_gwd_hines)
     1259          CALL histwrite_phy(o_vstr_gwd_hines, zvstr_gwd_hines)
     1260       end IF
     1261
     1262       if (.not. ok_hines .and. ok_gwd_rando) then
     1263          CALL histwrite_phy(o_du_gwd_front, du_gwd_front / pdtphys)
     1264          CALL histwrite_phy(o_dv_gwd_front, dv_gwd_front / pdtphys)
     1265          CALL histwrite_phy(o_ustr_gwd_front, zustr_gwd_front)
     1266          CALL histwrite_phy(o_vstr_gwd_front, zvstr_gwd_front)
    12241267       ENDIF
    12251268
     
    12271270          CALL histwrite_phy(o_du_gwd_rando, du_gwd_rando / pdtphys)
    12281271          CALL histwrite_phy(o_dv_gwd_rando, dv_gwd_rando / pdtphys)
     1272          CALL histwrite_phy(o_ustr_gwd_rando, zustr_gwd_rando)
    12291273          CALL histwrite_phy(o_vstr_gwd_rando, zvstr_gwd_rando)
     1274          CALL histwrite_phy(o_east_gwstress, east_gwstress )
     1275          CALL histwrite_phy(o_west_gwstress, west_gwstress )
    12301276       end IF
    12311277
     
    12341280       ENDIF
    12351281
    1236        CALL histwrite_phy(o_rsu, swup)
    1237        CALL histwrite_phy(o_rsd, swdn)
     1282       DO k=1, klevp1
     1283         zx_tmp_fi3d1(:,k)=swup(:,k)*swradcorr(:)
     1284       ENDDO
     1285       CALL histwrite_phy(o_rsu, zx_tmp_fi3d1)
     1286       DO k=1, klevp1
     1287         zx_tmp_fi3d1(:,k)=swdn(:,k)*swradcorr(:)
     1288       ENDDO
     1289       CALL histwrite_phy(o_rsd, zx_tmp_fi3d1)
     1290       DO k=1, klevp1
     1291         zx_tmp_fi3d1(:,k)=swup0(:,k)*swradcorr(:)
     1292       ENDDO
     1293       CALL histwrite_phy(o_rsucs, zx_tmp_fi3d1)
     1294       DO k=1, klevp1
     1295         zx_tmp_fi3d1(:,k)=swdn0(:,k)*swradcorr(:)
     1296       ENDDO
     1297       CALL histwrite_phy(o_rsdcs, zx_tmp_fi3d1)
     1298
    12381299       CALL histwrite_phy(o_rlu, lwup)
    12391300       CALL histwrite_phy(o_rld, lwdn)
    1240        CALL histwrite_phy(o_rsucs, swup0)
    1241        CALL histwrite_phy(o_rsdcs, swdn0)
    12421301       CALL histwrite_phy(o_rlucs, lwup0)
    12431302       CALL histwrite_phy(o_rldcs, lwdn0)
     1303
    12441304       IF(vars_defined) THEN
    12451305          zx_tmp_fi3d(1:klon,1:klev)=d_t(1:klon,1:klev)+ &
     
    12471307       ENDIF
    12481308       CALL histwrite_phy(o_tnt, zx_tmp_fi3d)
     1309
    12491310       IF(vars_defined) THEN
    12501311          zx_tmp_fi3d(1:klon,1:klev)=d_t_swr(1:klon,1:klev)/pdtphys + &
     
    12941355            RN2O_per.NE.RN2O_act.OR.RCFC11_per.NE.RCFC11_act.OR. &
    12951356            RCFC12_per.NE.RCFC12_act) THEN
    1296           IF(vars_defined) zx_tmp_fi2d(1 : klon) = swupp ( 1 : klon, klevp1 )
     1357          IF(vars_defined) zx_tmp_fi2d(:) = swupp(:,klevp1)*swradcorr(:)
    12971358          CALL histwrite_phy(o_rsut4co2, zx_tmp_fi2d)
    1298           IF(vars_defined) zx_tmp_fi2d(1 : klon) = lwupp ( 1 : klon, klevp1 )
     1359          IF(vars_defined) zx_tmp_fi2d(:) = lwupp(:,klevp1)
    12991360          CALL histwrite_phy(o_rlut4co2, zx_tmp_fi2d)
    1300           IF(vars_defined) zx_tmp_fi2d(1 : klon) = swup0p ( 1 : klon, klevp1 )
     1361          IF(vars_defined) zx_tmp_fi2d(:) = swup0p(:,klevp1)*swradcorr(:)
    13011362          CALL histwrite_phy(o_rsutcs4co2, zx_tmp_fi2d)
    1302           IF(vars_defined) zx_tmp_fi2d(1 : klon) = lwup0p ( 1 : klon, klevp1 )
     1363          IF(vars_defined) zx_tmp_fi2d(:) = lwup0p(:,klevp1)
    13031364          CALL histwrite_phy(o_rlutcs4co2, zx_tmp_fi2d)
    1304           CALL histwrite_phy(o_rsu4co2, swupp)
     1365          DO k=1, klevp1
     1366            zx_tmp_fi3d1(:,k)=swupp(:,k)*swradcorr(:)
     1367          ENDDO
     1368          CALL histwrite_phy(o_rsu4co2, zx_tmp_fi3d1)
     1369          DO k=1, klevp1
     1370            zx_tmp_fi3d1(:,k)=swup0p(:,k)*swradcorr(:)
     1371          ENDDO
     1372          CALL histwrite_phy(o_rsucs4co2, zx_tmp_fi3d1)
     1373          DO k=1, klevp1
     1374            zx_tmp_fi3d1(:,k)=swdnp(:,k)*swradcorr(:)
     1375          ENDDO
     1376          CALL histwrite_phy(o_rsd4co2, zx_tmp_fi3d1)
     1377          DO k=1, klevp1
     1378            zx_tmp_fi3d1(:,k)=swdn0p(:,k)*swradcorr(:)
     1379          ENDDO
     1380          CALL histwrite_phy(o_rsdcs4co2, zx_tmp_fi3d1)
    13051381          CALL histwrite_phy(o_rlu4co2, lwupp)
    1306           CALL histwrite_phy(o_rsucs4co2, swup0p)
    13071382          CALL histwrite_phy(o_rlucs4co2, lwup0p)
    1308           CALL histwrite_phy(o_rsd4co2, swdnp)
    13091383          CALL histwrite_phy(o_rld4co2, lwdnp)
    1310           CALL histwrite_phy(o_rsdcs4co2, swdn0p)
    13111384          CALL histwrite_phy(o_rldcs4co2, lwdn0p)
    13121385       ENDIF
Note: See TracChangeset for help on using the changeset viewer.