Ignore:
Timestamp:
Oct 16, 2012, 2:41:50 PM (12 years ago)
Author:
Laurent Fairhead
Message:

Version testing basée sur la r1668

http://lmdz.lmd.jussieu.fr/utilisateurs/distribution-du-modele/versions-intermediaires


Testing release based on r1668

Location:
LMDZ5/branches/testing
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • LMDZ5/branches/testing

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

    r1665 r1669  
    3333  CHARACTER(len=20), dimension(nfiles), private, save   :: type_ecri
    3434  !$OMP THREADPRIVATE(nhorim, nvertm, zoutm,zdtime,type_ecri)
     35 ! swaero_diag : flag indicates if it is necessary to do calculation for some aerosol diagnostics
     36  logical, save                                :: swaero_diag=.FALSE.
     37
    3538
    3639  !   integer, save                     :: nid_hf3d
     
    260263  type(ctrl_out),save :: o_wape         = ctrl_out((/ 1, 1, 1, 10, 10, 10 /),'wape')
    261264
     265!!! nrlmd le 10/04/2012
     266
     267!-------Spectre de thermiques de type 2 au LCL
     268  type(ctrl_out),save :: o_n2                = ctrl_out((/ 1, 1, 1, 6, 10, 10 /),'n2')
     269  type(ctrl_out),save :: o_s2                = ctrl_out((/ 1, 1, 1, 6, 10, 10 /),'s2')
     270                                                                             
     271!-------Déclenchement stochastique                                           
     272  type(ctrl_out),save :: o_proba_notrig      = ctrl_out((/ 1, 1, 1, 6, 10, 10 /),'proba_notrig')
     273  type(ctrl_out),save :: o_random_notrig     = ctrl_out((/ 1, 1, 1, 6, 10, 10 /),'random_notrig')
     274  type(ctrl_out),save :: o_ale_bl_stat       = ctrl_out((/ 1, 1, 1, 6, 10, 10 /),'ale_bl_stat')
     275  type(ctrl_out),save :: o_ale_bl_trig       = ctrl_out((/ 1, 1, 1, 6, 10, 10 /),'ale_bl_trig')
     276
     277!-------Fermeture statistique
     278  type(ctrl_out),save :: o_alp_bl_det        = ctrl_out((/ 1, 1, 1, 10, 10, 10 /),'alp_bl_det')
     279  type(ctrl_out),save :: o_alp_bl_fluct_m    = ctrl_out((/ 1, 1, 1, 10, 10, 10 /),'alp_bl_fluct_m')
     280  type(ctrl_out),save :: o_alp_bl_fluct_tke  = ctrl_out((/ 1, 1, 1, 10, 10, 10 /),'alp_bl_fluct_tke')
     281  type(ctrl_out),save :: o_alp_bl_conv       = ctrl_out((/ 1, 1, 1, 10, 10, 10 /),'alp_bl_conv')
     282  type(ctrl_out),save :: o_alp_bl_stat       = ctrl_out((/ 1, 1, 1, 10, 10, 10 /),'alp_bl_stat')
     283
     284!!! fin nrlmd le 10/04/2012
    262285
    263286  ! Champs interpolles sur des niveaux de pression ??? a faire correctement
     
    365388
    366389  type(ctrl_out),save :: o_topswad      = ctrl_out((/ 2, 10, 10, 10, 10, 10 /),'topswad')
     390  type(ctrl_out),save :: o_topswad0     = ctrl_out((/ 2, 10, 10, 10, 10, 10 /),'topswad0')
    367391  type(ctrl_out),save :: o_topswai      = ctrl_out((/ 2, 10, 10, 10, 10, 10 /),'topswai')
    368392  type(ctrl_out),save :: o_solswad      = ctrl_out((/ 2, 10, 10, 10, 10, 10 /),'solswad')
     393  type(ctrl_out),save :: o_solswad0     = ctrl_out((/ 2, 10, 10, 10, 10, 10 /),'solswad0')
    369394  type(ctrl_out),save :: o_solswai      = ctrl_out((/ 2, 10, 10, 10, 10, 10 /),'solswai')
    370395
     
    432457  type(ctrl_out),save :: o_ovap         = ctrl_out((/ 2, 3, 4, 10, 10, 10 /),'ovap')
    433458  type(ctrl_out),save :: o_ovapinit     = ctrl_out((/ 2, 10, 10, 10, 10, 10 /),'ovapinit')
     459  type(ctrl_out),save :: o_oliq         = ctrl_out((/ 2, 3, 4, 10, 10, 10 /),'oliq')
    434460  type(ctrl_out),save :: o_wvapp        = ctrl_out((/ 2, 10, 10, 10, 10, 10 /),'wvapp')
    435461  type(ctrl_out),save :: o_geop         = ctrl_out((/ 2, 3, 10, 10, 10, 10 /),'geop')
     
    494520  type(ctrl_out),save :: o_dtcon        = ctrl_out((/ 4, 10, 10, 10, 10, 10 /),'dtcon')
    495521  type(ctrl_out),save :: o_ducon        = ctrl_out((/ 4, 10, 10, 10, 10, 10 /),'ducon')
     522  type(ctrl_out),save :: o_dvcon        = ctrl_out((/ 4, 10, 10, 10, 10, 10 /),'dvcon')
    496523  type(ctrl_out),save :: o_dqcon        = ctrl_out((/ 4, 10, 10, 10, 10, 10 /),'dqcon')
    497524  type(ctrl_out),save :: o_dtwak        = ctrl_out((/ 4, 5, 10, 10, 10, 10 /),'dtwak')
     
    531558  type(ctrl_out),save :: o_e_th         = ctrl_out((/ 4, 10, 10, 10, 10, 10 /),'e_th')
    532559  type(ctrl_out),save :: o_w_th         = ctrl_out((/ 4, 10, 10, 10, 10, 10 /),'w_th')
    533   type(ctrl_out),save :: o_lambda_th    = ctrl_out((/ 10, 10, 10, 10, 10, 10 /),'lambda_th')
    534560  type(ctrl_out),save :: o_ftime_th     = ctrl_out((/ 4, 10, 10, 10, 10, 10 /),'ftime_th')
    535561  type(ctrl_out),save :: o_q_th         = ctrl_out((/ 4, 10, 10, 10, 10, 10 /),'q_th')
     
    537563  type(ctrl_out),save :: o_d_th         = ctrl_out((/ 4, 10, 10, 10, 10, 10 /),'d_th')
    538564  type(ctrl_out),save :: o_f0_th        = ctrl_out((/ 4, 10, 10, 10, 10, 10 /),'f0_th')
    539   type(ctrl_out),save :: o_zmax_th      = ctrl_out((/ 4, 10, 10, 10, 10, 10 /),'zmax_th')
     565  type(ctrl_out),save :: o_zmax_th      = ctrl_out((/ 4,  4,  4,  5, 10, 10 /),'zmax_th')
    540566  type(ctrl_out),save :: o_dqthe        = ctrl_out((/ 4, 10, 10, 10, 10, 10 /),'dqthe')
    541567  type(ctrl_out),save :: o_dtajs        = ctrl_out((/ 4, 10, 10, 10, 10, 10 /),'dtajs')
     
    621647    USE infotrac
    622648    USE ioipsl
     649!    USE phys_cal_mod, only : hour
    623650    USE mod_phys_lmdz_para
    624651    USE aero_mod, only : naero_spc,name_aero
     
    682709    !                 entre [phys_out_lonmin,phys_out_lonmax] et [phys_out_latmin,phys_out_latmax]
    683710
    684     logical, dimension(nfiles), save  :: phys_out_regfkey       = (/ .false., .false., .false., .false., .false., .false. /)
    685     real, dimension(nfiles), save     :: phys_out_lonmin        = (/ -180., -180., -180., -180., -180., -180. /)
    686     real, dimension(nfiles), save     :: phys_out_lonmax        = (/ 180., 180., 180., 180., 180., 180. /)
    687     real, dimension(nfiles), save     :: phys_out_latmin        = (/ -90., -90., -90., -90., -90., -90. /)
    688     real, dimension(nfiles), save     :: phys_out_latmax        = (/ 90., 90., 90., 90., 90., 90. /)
     711    logical, dimension(nfiles), save  :: phys_out_regfkey       = (/ .false., .false., .false.,  .false., .false., .false. /)
     712    real, dimension(nfiles), save     :: phys_out_lonmin        = (/   -180.,   -180.,   -180.,    -180.,   -180.,  -180. /)
     713    real, dimension(nfiles), save     :: phys_out_lonmax        = (/    180.,    180.,    180.,     180.,    180.,    180. /)
     714    real, dimension(nfiles), save     :: phys_out_latmin        = (/    -90.,    -90.,    -90.,     -90.,    -90.,    -90. /)
     715    real, dimension(nfiles), save     :: phys_out_latmax        = (/     90.,     90.,     90.,     90.,     90.,    90. /)
    689716
    690717    write(lunout,*) 'Debut phys_output_mod.F90'
     
    792819    DO iff=1,nfiles
    793820
     821       ! Calculate ecrit_files for all files
     822       if ( chtimestep(iff).eq.'DefFreq' ) then
     823          ! Par defaut ecrit_files = (ecrit_mensuel ecrit_jour ecrit_hf ...)*86400.
     824          ecrit_files(iff)=ecrit_files(iff)*86400.
     825       else
     826          call convers_timesteps(chtimestep(iff),dtime,ecrit_files(iff))
     827       endif
     828       write(lunout,*)'ecrit_files(',iff,')= ',ecrit_files(iff)
     829
     830       zoutm(iff) = ecrit_files(iff) ! Frequence ou l on ecrit en seconde
     831
    794832       IF (clef_files(iff)) THEN
    795833
    796           if ( chtimestep(iff).eq.'DefFreq' ) then
    797              ! Par defaut ecrit_files = (ecrit_mensuel ecrit_jour ecrit_hf ...)*86400.
    798              ecrit_files(iff)=ecrit_files(iff)*86400.
    799           else
    800              call convers_timesteps(chtimestep(iff),dtime,ecrit_files(iff))
    801           endif
    802           write(lunout,*)'ecrit_files(',iff,')= ',ecrit_files(iff)
    803 
    804           zoutm(iff) = ecrit_files(iff) ! Frequence ou l on ecrit en seconde
    805 
    806834          idayref = day_ref
    807           CALL ymds2ju(annee_ref, 1, idayref, 0.0, zjulian)
     835          CALL ymds2ju(annee_ref, 1, idayref, 0.0, zjulian)       
     836! correction pour l heure initiale                               !jyg
     837!                                                                !jyg
     838!      CALL ymds2ju(annee_ref, 1, idayref, hour, zjulian)         !jyg
    808839
    809840!!!!!!!!!!!!!!!!! Traitement dans le cas ou l'on veut stocker sur un domaine limite !!
     
    10991130                  o_topswad%flag,o_topswad%name, "ADE at TOA", "W/m2")
    11001131             CALL histdef2d(iff,clef_stations(iff), &
     1132                  o_topswad0%flag,o_topswad0%name, "ADE clear-sky at TOA", "W/m2")
     1133             CALL histdef2d(iff,clef_stations(iff), &
    11011134                  o_solswad%flag,o_solswad%name, "ADE at SRF", "W/m2")
     1135             CALL histdef2d(iff,clef_stations(iff), &
     1136                  o_solswad0%flag,o_solswad0%name, "ADE clear-sky at SRF", "W/m2")
    11021137
    11031138             CALL histdef2d(iff,clef_stations(iff), &
     
    12161251                     o_wbeff%flag,o_wbeff%name, "Conv. updraft velocity at LFC (<100)", "m/s")
    12171252             end if
    1218              CALL histdef2d(iff,clef_stations(iff), &
    1219                   o_prw%flag,o_prw%name, "Precipitable water", "kg/m2")
    12201253             IF (.NOT.clef_stations(iff)) THEN
    12211254                !
     
    12531286          ENDIF !iflag_con .GE. 3
    12541287
     1288          CALL histdef2d(iff,clef_stations(iff), &
     1289               o_prw%flag,o_prw%name, "Precipitable water", "kg/m2")
    12551290          CALL histdef2d(iff,clef_stations(iff), &
    12561291               o_s_pblh%flag,o_s_pblh%name, "Boundary Layer Height", "m")
     
    13181353          ! Couplage conv-CL
    13191354          IF (iflag_con.GE.3) THEN
     1355             IF (iflag_coupl>=1) THEN
    13201356                CALL histdef2d(iff,clef_stations(iff), &
    13211357                     o_ale_bl%flag,o_ale_bl%name, "ALE BL", "m2/s2")
    13221358                CALL histdef2d(iff,clef_stations(iff), &
    13231359                     o_alp_bl%flag,o_alp_bl%name, "ALP BL", "m2/s2")
     1360             ENDIF
    13241361          ENDIF !(iflag_con.GE.3)
    13251362
     
    13751412          CALL histdef3d(iff,clef_stations(iff),o_theta%flag,o_theta%name, "Potential air temperature", "K" )
    13761413          CALL histdef3d(iff,clef_stations(iff),o_ovap%flag,o_ovap%name, "Specific humidity", "kg/kg" )
     1414          CALL histdef3d(iff,clef_stations(iff),o_oliq%flag,o_oliq%name, "Condensed water", "kg/kg" )
    13771415          CALL histdef3d(iff,clef_stations(iff), &
    13781416               o_ovapinit%flag,o_ovapinit%name, "Specific humidity (begin of timestep)", "kg/kg" )
     
    14801518               o_ducon%flag,o_ducon%name, "Convection du", "m/s2")
    14811519          CALL histdef3d(iff,clef_stations(iff), &
     1520               o_dvcon%flag,o_dvcon%name, "Convection dv", "m/s2")
     1521          CALL histdef3d(iff,clef_stations(iff), &
    14821522               o_dqcon%flag,o_dqcon%name, "Convection dQ", "(kg/kg)/s")
    14831523
     
    14891529                CALL histdef2d(iff,clef_stations(iff), &
    14901530                     o_alp_wk%flag,o_alp_wk%name, "ALP WK", "m2/s2")
     1531                CALL histdef2d(iff,clef_stations(iff), &
     1532                     o_ale%flag,o_ale%name, "ALE", "m2/s2")
     1533                CALL histdef2d(iff,clef_stations(iff), &
     1534                     o_alp%flag,o_alp%name, "ALP", "W/m2")
     1535                CALL histdef2d(iff,clef_stations(iff),o_cin%flag,o_cin%name, "Convective INhibition", "m2/s2")
     1536                CALL histdef2d(iff,clef_stations(iff),o_wape%flag,o_WAPE%name, "WAPE", "m2/s2")
    14911537                CALL histdef2d(iff,clef_stations(iff),o_wake_h%flag,o_wake_h%name, "wake_h", "-")
    14921538                CALL histdef2d(iff,clef_stations(iff),o_wake_s%flag,o_wake_s%name, "wake_s", "-")
     
    14961542                CALL histdef3d(iff,clef_stations(iff),o_wake_deltaq%flag,o_wake_deltaq%name, "wake_deltaq", " ")
    14971543                CALL histdef3d(iff,clef_stations(iff),o_wake_omg%flag,o_wake_omg%name, "wake_omg", " ")
    1498                 CALL histdef2d(iff,clef_stations(iff),o_wape%flag,o_WAPE%name, "WAPE", "m2/s2")
    14991544             ENDIF
    1500              CALL histdef2d(iff,clef_stations(iff), &
    1501                      o_ale%flag,o_ale%name, "ALE", "m2/s2")
    1502              CALL histdef2d(iff,clef_stations(iff), &
    1503                      o_alp%flag,o_alp%name, "ALP", "W/m2")
    1504              CALL histdef2d(iff,clef_stations(iff),o_cin%flag,o_cin%name, "Convective INhibition", "m2/s2")
    15051545             CALL histdef3d(iff,clef_stations(iff),o_Vprecip%flag,o_Vprecip%name, "precipitation vertical profile", "-")
    15061546             CALL histdef3d(iff,clef_stations(iff),o_ftd%flag,o_ftd%name, "tend temp due aux descentes precip", "-")
    15071547             CALL histdef3d(iff,clef_stations(iff),o_fqd%flag,o_fqd%name,"tend vap eau due aux descentes precip", "-")
    15081548          ENDIF !(iflag_con.EQ.3)
     1549
     1550!!! nrlmd le 10/04/2012
     1551
     1552        IF (iflag_trig_bl>=1) THEN
     1553 CALL histdef2d(iff,clef_stations(iff),o_n2%flag,o_n2%name, "Nombre de panaches de type 2", " ")
     1554 CALL histdef2d(iff,clef_stations(iff),o_s2%flag,o_s2%name, "Surface moyenne des panaches de type 2", "m2")
     1555
     1556 CALL histdef2d(iff,clef_stations(iff),o_proba_notrig%flag,o_proba_notrig%name, "Probabilité de non-déclenchement", " ")
     1557 CALL histdef2d(iff,clef_stations(iff),o_random_notrig%flag,o_random_notrig%name, "Tirage aléatoire de non-déclenchement", " ")
     1558 CALL histdef2d(iff,clef_stations(iff),o_ale_bl_trig%flag,o_ale_bl_trig%name, "ALE_BL_STAT + Condition P>Pseuil", "m2/s2")
     1559 CALL histdef2d(iff,clef_stations(iff),o_ale_bl_stat%flag,o_ale_bl_stat%name, "ALE_BL_STAT", "m2/s2")
     1560       ENDIF  !(iflag_trig_bl>=1)
     1561
     1562        IF (iflag_clos_bl>=1) THEN
     1563 CALL histdef2d(iff,clef_stations(iff),o_alp_bl_det%flag,o_alp_bl_det%name, "ALP_BL_DET", "W/m2")
     1564 CALL histdef2d(iff,clef_stations(iff),o_alp_bl_fluct_m%flag,o_alp_bl_fluct_m%name, "ALP_BL_FLUCT_M", "W/m2")
     1565 CALL histdef2d(iff,clef_stations(iff),o_alp_bl_fluct_tke%flag,o_alp_bl_fluct_tke%name, "ALP_BL_FLUCT_TKE", "W/m2")
     1566 CALL histdef2d(iff,clef_stations(iff),o_alp_bl_conv%flag,o_alp_bl_conv%name, "ALP_BL_CONV", "W/m2")
     1567 CALL histdef2d(iff,clef_stations(iff),o_alp_bl_stat%flag,o_alp_bl_stat%name, "ALP_BL_STAT", "W/m2")
     1568       ENDIF  !(iflag_clos_bl>=1)
     1569
     1570!!! fin nrlmd le 10/04/2012
    15091571
    15101572          CALL histdef3d(iff,clef_stations(iff),o_dtlsc%flag,o_dtlsc%name, "Condensation dT", "K/s")
     
    15191581          CALL histdef3d(iff,clef_stations(iff),o_dtthe%flag,o_dtthe%name, "Thermal dT", "K/s")
    15201582
    1521           if(iflag_thermals.gt.1) THEN
     1583          if(iflag_thermals.ge.1) THEN
    15221584             CALL histdef3d(iff,clef_stations(iff),o_dqlscth%flag,o_dqlscth%name, "dQ therm.", "(kg/kg)/s")
    15231585             CALL histdef3d(iff,clef_stations(iff),o_dqlscst%flag,o_dqlscst%name, "dQ strat.", "(kg/kg)/s")
     
    15311593             CALL histdef3d(iff,clef_stations(iff),o_e_th%flag,o_e_th%name,"Thermal plume entrainment","K/s")
    15321594             CALL histdef3d(iff,clef_stations(iff),o_w_th%flag,o_w_th%name,"Thermal plume vertical velocity","m/s")
    1533              CALL histdef3d(iff,clef_stations(iff), &
    1534                   o_lambda_th%flag,o_lambda_th%name,"Thermal plume vertical velocity","m/s")
    15351595             CALL histdef2d(iff,clef_stations(iff), &
    15361596                  o_ftime_th%flag,o_ftime_th%name,"Fraction of time Shallow convection occurs"," ")
     
    15481608             CALL histdef3d(iff,clef_stations(iff), &
    15491609                  o_dqthe%flag,o_dqthe%name, "Thermal dQ", "(kg/kg)/s")
    1550           endif !iflag_thermals.gt.1
     1610          endif !iflag_thermals.ge.1
    15511611          CALL histdef3d(iff,clef_stations(iff), &
    15521612               o_dtajs%flag,o_dtajs%name, "Dry adjust. dT", "K/s")
     
    17081768
    17091769    ENDDO !  iff
     1770
     1771    ! Updated write frequencies due to phys_out_filetimesteps.
     1772    ! Write frequencies are now in seconds. 
     1773    ecrit_mth = ecrit_files(1)
     1774    ecrit_day = ecrit_files(2)
     1775    ecrit_hf  = ecrit_files(3)
     1776    ecrit_ins = ecrit_files(4)
     1777    ecrit_LES = ecrit_files(5)
     1778    ecrit_ins = ecrit_files(6)
     1779
     1780    write(lunout,*)'swaero_diag=',swaero_diag
    17101781    write(lunout,*)'Fin phys_output_mod.F90'
    17111782  end subroutine phys_output_open
     
    17561827       endif
    17571828    endif
     1829
     1830    ! Set swaero_diag=true if at least one of the concerned variables are defined
     1831    if (nomvar=='topswad' .OR. nomvar=='topswai' .OR. nomvar=='solswad' .OR. nomvar=='solswai' ) THEN
     1832       if  ( flag_var(iff)<=lev_files(iff) ) then
     1833          swaero_diag=.TRUE.
     1834       end if
     1835    end if
    17581836  end subroutine histdef2d
    17591837
Note: See TracChangeset for help on using the changeset viewer.