Ignore:
Timestamp:
Mar 7, 2018, 10:59:04 AM (7 years ago)
Author:
idelkadi
Message:

Nettoyage du code :

  • changement de nomes des routines pour avoir les memes nome des modules
  • corrections
  • dos2unix appliquee aux fichiers
  • Rajouter "implicit none" pour les routines ne le comportant pas
  • Suppression des commentaires unitils

Corrections pour tourner en mode debug :

controle par la cles ok_debug_cosp dans mod_cosp_constants.F90
la valeur par defaut etant .false.

Location:
LMDZ6/branches/IPSLCM6.0.15/libf/phylmd/cosp
Files:
6 edited
16 moved

Legend:

Unmodified
Added
Removed
  • LMDZ6/branches/IPSLCM6.0.15/libf/phylmd/cosp/cosp_output_mod.F90

    r2955 r3242  
    1212                            numMODISReffLiqBins, reffLIQ_binCenters
    1313
     14     IMPLICIT NONE
    1415! cosp_output_mod
    1516      INTEGER, PRIVATE             :: i
  • LMDZ6/branches/IPSLCM6.0.15/libf/phylmd/cosp/cosp_output_write_mod.F90

    r3191 r3242  
    66   USE cosp_output_mod
    77 
     8   IMPLICIT NONE
     9
    810   INTEGER, SAVE  :: itau_iocosp
    911!$OMP THREADPRIVATE(itau_iocosp)
     
    2931    USE xios, only: xios_update_calendar, xios_field_is_active
    3032#endif
    31 
     33  IMPLICIT NONE 
    3234!!! Variables d'entree
    3335  integer               :: itap, Nlevlmdz, Ncolumns, Npoints
     
    4547
    4648!!! Variables locales
    47   integer               :: icl
     49  integer               :: icl,k,ip
    4850  logical               :: ok_sync
    4951  integer               :: itau_wcosp
     
    7880! On n'ecrit pas quand itap=1 (cosp)
    7981
    80    if (prt_level >= 10) then
    81          WRITE(lunout,*)'DO iinit=1, iinitend ',iinitend
    82    endif
     82!   if (prt_level >= 10) then
     83!         WRITE(lunout,*)'DO iinit=1, iinitend ',iinitend
     84!   endif
    8385
    8486!!#ifdef CPP_XIOS
     
    9799!!!! Sorties Calipso
    98100 if (cfg%Llidar_sim) then
    99 ! Pb des valeurs indefinies, on les met a 0
    100 ! A refaire proprement
    101 !  do k = 1,Nlevout
    102 !     do ip = 1,Npoints
    103 !     if(stlidar%lidarcld(ip,k).eq.R_UNDEF)then
    104 !      stlidar%lidarcld(ip,k)=missing_val
    105 !     endif
    106 !     if(stlidar%proftemp(ip,k).eq.R_UNDEF)then !TIBO
    107 !      stlidar%proftemp(ip,k)=missing_val       !TIBO
    108 !     endif                                     !TIBO
    109 !     enddo
    110 
    111 !     do ii= 1,Ncolumns                               !TIBO
    112 !      do ip = 1,Npoints                              !TIBO
    113 !!       if(stlidar%profSR(ip,ii,k).eq.R_UNDEF)then    !TIBO
    114 !!        stlidar%profSR(ip,ii,k)=missing_val          !TIBO
    115 !       if(stlidar%profSR(ip,k,ii).eq.R_UNDEF)then    !TIBO2
    116 !        stlidar%profSR(ip,k,ii)=missing_val          !TIBO2
    117 !       endif                                         !TIBO
    118 !      enddo                                          !TIBO
    119 !     enddo                                           !TIBO
    120 !  enddo
    121 
    122 !  do ip = 1,Npoints
    123 !   do k = 1,Nlevlmdz
    124 !     if(sglidar%beta_mol(ip,k).eq.R_UNDEF)then
    125 !      sglidar%beta_mol(ip,k)=missing_val
    126 !     endif
    127 
    128 !     do ii= 1,Ncolumns
    129 !       if(sglidar%beta_tot(ip,ii,k).eq.R_UNDEF)then
    130 !        sglidar%beta_tot(ip,ii,k)=missing_val
    131 !       endif
    132 !     enddo
    133 
    134 !    enddo    !k = 1,Nlevlmdz
    135 !   enddo     !ip = 1,Npoints
    136 
    137 !   do k = 1,LIDAR_NCAT
    138 !    do ip = 1,Npoints
    139 !     if(stlidar%cldlayer(ip,k).eq.R_UNDEF)then
    140 !       stlidar%cldlayer(ip,k)=missing_val
    141 !     endif
    142 !    enddo
    143 !   enddo
    144 
    145 !   do k = 1,LIDAR_NTYPE                       !OPAQ
    146 !    do ip = 1,Npoints                         !OPAQ
    147 !     if(stlidar%cldtype(ip,k).eq.R_UNDEF)then !OPAQ
    148 !       stlidar%cldtype(ip,k)=missing_val      !OPAQ
    149 !     endif                                    !OPAQ
    150 !    enddo                                     !OPAQ
    151 !   enddo                                      !OPAQ
    152  
    153101!!! AI 02 2018
    154102! Traitement missing_val
     
    278226!!! Sorties Isccp
    279227 if (cfg%Lisccp_sim) then
    280 ! Traitement des valeurs indefinies
    281 !   do ip = 1,Npoints
    282 !    if(isccp%totalcldarea(ip).eq.R_UNDEF)then
    283 !      isccp%totalcldarea(ip)=missing_val
    284 !    endif
    285 !    if(isccp%meanptop(ip).eq.R_UNDEF)then
    286 !      isccp%meanptop(ip)=missing_val
    287 !    endif
    288 !    if(isccp%meantaucld(ip).eq.R_UNDEF)then
    289 !      isccp%meantaucld(ip)=missing_val
    290 !    endif
    291 !    if(isccp%meanalbedocld(ip).eq.R_UNDEF)then
    292 !     isccp%meanalbedocld(ip)=missing_val
    293 !    endif
    294 !    if(isccp%meantb(ip).eq.R_UNDEF)then
    295 !     isccp%meantb(ip)=missing_val
    296 !    endif
    297 !    if(isccp%meantbclr(ip).eq.R_UNDEF)then
    298 !       isccp%meantbclr(ip)=missing_val
    299 !    endif
    300 
    301 !    do k=1,7
    302 !     do ii=1,7
    303 !     if(isccp%fq_isccp(ip,ii,k).eq.R_UNDEF)then
    304 !      isccp%fq_isccp(ip,ii,k)=missing_val
    305 !     endif
    306 !     enddo
    307 !    enddo
    308 
    309 !    do ii=1,Ncolumns
    310 !     if(isccp%boxtau(ip,ii).eq.R_UNDEF)then
    311 !       isccp%boxtau(ip,ii)=missing_val
    312 !     endif
    313 !    enddo
    314 
    315 !    do ii=1,Ncolumns
    316 !     if(isccp%boxptop(ip,ii).eq.R_UNDEF)then
    317 !      isccp%boxptop(ip,ii)=missing_val
    318 !     endif
    319 !    enddo
    320 !   enddo
    321228  where(isccp%totalcldarea == R_UNDEF) isccp%totalcldarea = missing_val
    322229  where(isccp%meanptop == R_UNDEF) isccp%meanptop = missing_val
     
    349256!!! MISR simulator
    350257 if (cfg%Lmisr_sim) then
    351 !   do ip=1,Npoints
    352 !     do ii=1,7
    353 !       do k=1,MISR_N_CTH
    354 !        if(misr%fq_MISR(ip,ii,k).eq.R_UNDEF)then
    355 !            misr%fq_MISR(ip,ii,k)=missing_val
    356 !        endif
    357 !       enddo
    358 !     enddo
    359 !   enddo
    360258   where(misr%fq_MISR == R_UNDEF) misr%fq_MISR = missing_val
    361259
     
    400298        modis%Ice_Water_Path_Mean = missing_val
    401299
    402 !  de ip=1,Npoints
    403 !    if(modis%Cloud_Fraction_Low_Mean(ip).eq.R_UNDEF)then
    404 !      modis%Cloud_Fraction_Low_Mean(ip)=missing_val
    405 !    endif
    406 !    if(modis%Cloud_Fraction_High_Mean(ip).eq.R_UNDEF)then
    407 !       modis%Cloud_Fraction_High_Mean(ip)=missing_val
    408 !    endif
    409 !    if(modis%Cloud_Fraction_Mid_Mean(ip).eq.R_UNDEF)then
    410 !       modis%Cloud_Fraction_Mid_Mean(ip)=missing_val
    411 !    endif
    412 !    if(modis%Cloud_Fraction_Total_Mean(ip).eq.R_UNDEF)then
    413 !       modis%Cloud_Fraction_Total_Mean(ip)=missing_val
    414 !    endif
    415 !    if(modis%Cloud_Fraction_Water_Mean(ip).eq.R_UNDEF)then
    416 !       modis%Cloud_Fraction_Water_Mean(ip)=missing_val
    417 !    endif
    418 !    if(modis%Cloud_Fraction_Ice_Mean(ip).eq.R_UNDEF)then
    419 !       modis%Cloud_Fraction_Ice_Mean(ip)=missing_val
    420 !    endif
    421 !    if(modis%Optical_Thickness_Total_Mean(ip).eq.R_UNDEF)then
    422 !       modis%Optical_Thickness_Total_Mean(ip)=missing_val
    423 !    endif
    424 !    if(modis%Optical_Thickness_Water_Mean(ip).eq.R_UNDEF)then
    425 !       modis%Optical_Thickness_Water_Mean(ip)=missing_val
    426 !    endif
    427 !    if(modis%Optical_Thickness_Ice_Mean(ip).eq.R_UNDEF)then
    428 !       modis%Optical_Thickness_Ice_Mean(ip)=missing_val
    429 !    endif
    430 !    if(modis%Cloud_Particle_Size_Water_Mean(ip).eq.R_UNDEF)then
    431 !       modis%Cloud_Particle_Size_Water_Mean(ip)=missing_val
    432 !    endif
    433 !    if(modis%Cloud_Particle_Size_Ice_Mean(ip).eq.R_UNDEF)then
    434 !       modis%Cloud_Particle_Size_Ice_Mean(ip)=missing_val
    435 !    endif
    436 !    if(modis%Cloud_Top_Pressure_Total_Mean(ip).eq.R_UNDEF)then
    437 !       modis%Cloud_Top_Pressure_Total_Mean(ip)=missing_val
    438 !    endif
    439 !    if(modis%Liquid_Water_Path_Mean(ip).eq.R_UNDEF)then
    440 !       modis%Liquid_Water_Path_Mean(ip)=missing_val
    441 !    endif
    442 !    if(modis%Ice_Water_Path_Mean(ip).eq.R_UNDEF)then
    443 !       modis%Ice_Water_Path_Mean(ip)=missing_val
    444 !    endif
    445 !  enddo
    446 
    447300    where(modis%Optical_Thickness_Total_LogMean == R_UNDEF) &
    448301          modis%Optical_Thickness_Total_LogMean = missing_val
     
    472325   CALL histwrite2d_cosp(o_iwpmodis,modis%Ice_Water_Path_Mean)
    473326
    474 !   do ip=1,Npoints
    475 !     do ii=1,7
    476 !       do k=1,7
    477 !       if(modis%Optical_Thickness_vs_Cloud_Top_Pressure(ip,ii,k).eq.R_UNDEF)then
    478 !          modis%Optical_Thickness_vs_Cloud_Top_Pressure(ip,ii,k)=missing_val
    479 !        endif
    480 !       enddo
    481 !     enddo
    482 !    enddo
    483327    where(modis%Optical_Thickness_vs_Cloud_Top_Pressure == R_UNDEF) &
    484328          modis%Optical_Thickness_vs_Cloud_Top_Pressure = missing_val
  • LMDZ6/branches/IPSLCM6.0.15/libf/phylmd/cosp/lidar_simulator.F90

    r2428 r3242  
    121121!---------------------------------------------------------------------------------
    122122
     123      USE MOD_COSP_CONSTANTS, only : ok_debug_cosp
    123124      IMPLICIT NONE
    124125      REAL :: SRsat
     
    201202      REAL pnorm_perp_liq(npoints,nlev) ! perpendicular lidar backscattered signal power for liq
    202203
     204      REAL :: seuil
     205
    203206! Output variable
    204207      REAL pnorm_perp_tot (npoints,nlev) ! perpendicular lidar backscattered signal power
     
    235238         Gamma = 0.009
    236239
     240  if (ok_debug_cosp) then
     241     seuil=1.e-15
     242  else
     243     seuil=0.0
     244  endif
    237245!------------------------------------------------------------
    238246!---- 1. Preliminary definitions and calculations :
     
    494502
    495503      DO k= nlev, 1, -1
    496               pnorm_perp_ice(:,k) = Alpha * pnorm_ice(:,k) ! Ice particles
    497               pnorm_perp_liq(:,k) = 1000*Beta * pnorm_liq(:,k)**2 + Gamma * pnorm_liq(:,k) ! Liquid particles
     504         pnorm_perp_ice(:,k) = Alpha * pnorm_ice(:,k) ! Ice particles
     505         pnorm_perp_liq(:,k) = 1000*Beta * pnorm_liq(:,k)**2 + Gamma * pnorm_liq(:,k) ! Liquid particles
    498506      ENDDO
    499507
     
    523531          tautot_lay_liq(:) = tautot_liq(:,k)-tautot_liq(:,k+1)
    524532        WHERE (tautot_lay_liq(:).GT.0.)
    525          beta_perp_liq(:,k) = pnorm_perp_liq(:,k)/ EXP(-2.0*tautot_liq(:,k+1)) * (2.*tautot_lay_liq(:)) &
    526             & / (1.-exp(-2.0*tautot_lay_liq(:)))
     533         beta_perp_liq(:,k) = pnorm_perp_liq(:,k)/ max(seuil,EXP(-2.0*tautot_liq(:,k+1))) &
     534            & * (2.*tautot_lay_liq(:)) / (1.-exp(-2.0*tautot_lay_liq(:)))
    527535
    528536        ELSEWHERE
  • LMDZ6/branches/IPSLCM6.0.15/libf/phylmd/cosp/m_mrgrnk.F90

    r3241 r3242  
    11Module m_mrgrnk
     2IMPLICIT NONE
    23Integer, Parameter :: kdp = selected_real_kind(15)
    34public :: mrgrnk
  • LMDZ6/branches/IPSLCM6.0.15/libf/phylmd/cosp/mod_cosp_constants.F90

    r3241 r3242  
    3838
    3939    character(len=32) :: COSP_VERSION='COSP v1.4'
     40
     41    ! Mode debug ou prod (AI 0302018)
     42    logical :: ok_debug_cosp = .false.
    4043
    4144    ! Indices to address arrays of LS and CONV hydrometeors
  • LMDZ6/branches/IPSLCM6.0.15/libf/phylmd/cosp/mod_cosp_utils.F90

    r3241 r3242  
    6161    integer :: i,j,k
    6262    real :: sigma,one_over_xip1,xi,rho0,rho,lambda_x,gamma_4_3_2,delta
    63    
     63    real :: seuil
     64
     65    if (ok_debug_cosp) then
     66       seuil=1.e-15
     67    else
     68       seuil=0.0
     69    endif
     70
    6471    mxratio = 0.0
    6572
     
    8087                        mxratio(i,j,k)=mxratio(i,j,k)/rho
    8188                        ! Compute effective radius
    82                         if ((reff(i,j,k) <= 0.0).and.(flux(i,k) /= 0.0)) then
     89!                        if ((reff(i,j,k) <= 0.0).and.(flux(i,k) /= 0.0)) then
     90                        if ((reff(i,j,k) <= 0.0).and.(flux(i,k) > seuil)) then
    8391                           lambda_x = (a_x*c_x*((rho0/rho)**g_x)*n_ax*gamma1/flux(i,k))**(1./delta)
    8492                           reff(i,j,k) = gamma_4_3_2/lambda_x
  • LMDZ6/branches/IPSLCM6.0.15/libf/phylmd/cosp/mod_modis_sim.F90

    r3241 r3242  
    5252!
    5353module mod_modis_sim
    54   USE MOD_COSP_TYPES, only: R_UNDEF
     54  USE MOD_COSP_TYPES, only: R_UNDEF, ok_debug_cosp
    5555  implicit none
    5656  ! ------------------------------
     
    384384           liquid_opticalThickness, ice_opticalThickness, tauLiquidFraction
    385385   
     386    real :: seuil
    386387    ! ---------------------------------------------------
    387388   
     389    if (ok_debug_cosp) then
     390       seuil=1.e-9
     391    else
     392       seuil=0.0
     393    endif
     394
    388395    where(cloudIce(:, :) <= 0.)
    389396      tauLiquidFraction(:, :) = 1.
     
    395402        ! Geometic optics limit - tau as LWP/re  (proportional to LWC/re)
    396403        !
    397         tauLiquidFraction(:, :) = (cloudWater(:, :)/waterSize(:, :)) / &
    398                                   (cloudWater(:, :)/waterSize(:, :) + cloudIce(:, :)/(ice_density * iceSize(:, :)) )
     404! Modif AI 02 2018
     405        tauLiquidFraction(:, :) = (cloudWater(:, :)/max(waterSize(:, :), seuil) ) / &
     406                                  (cloudWater(:, :)/max(waterSize(:, :), seuil) + &
     407                                   cloudIce(:, :)/(ice_density * max(iceSize(:, :), seuil)) )
    399408      end where
    400409    end where
     
    502511    ! Compute mean optical thickness.
    503512    ! ########################################################################################
    504     Optical_Thickness_Total_Mean(1:nPoints) = sum(optical_thickness, mask = cloudMask,      dim = 2) / &
    505                                               Cloud_Fraction_Total_Mean(1:nPoints)
    506     Optical_Thickness_Water_Mean(1:nPoints) = sum(optical_thickness, mask = waterCloudMask, dim = 2) / &
    507                                               Cloud_Fraction_Water_Mean(1:nPoints)
    508     Optical_Thickness_Ice_Mean(1:nPoints)   = sum(optical_thickness, mask = iceCloudMask,   dim = 2) / &
    509                                               Cloud_Fraction_Ice_Mean(1:nPoints)
    510        
     513    where (Cloud_Fraction_Total_Mean == 0)
     514       Optical_Thickness_Total_Mean      = R_UNDEF
     515    elsewhere
     516       Optical_Thickness_Total_Mean(1:nPoints) = sum(optical_thickness, mask = cloudMask,      dim = 2) / &
     517                                                 Cloud_Fraction_Total_Mean(1:nPoints)
     518    endwhere
     519    where (Cloud_Fraction_Water_Mean == 0)
     520       Optical_Thickness_Water_Mean      = R_UNDEF
     521    elsewhere
     522       Optical_Thickness_Water_Mean(1:nPoints) = sum(optical_thickness, mask = waterCloudMask, dim = 2) / &
     523                                                 Cloud_Fraction_Water_Mean(1:nPoints)
     524    endwhere
     525    where (Cloud_Fraction_Ice_Mean == 0)
     526       Optical_Thickness_Ice_Mean        = R_UNDEF
     527    elsewhere
     528       Optical_Thickness_Ice_Mean(1:nPoints)   = sum(optical_thickness, mask = iceCloudMask,   dim = 2) / &
     529                                                 Cloud_Fraction_Ice_Mean(1:nPoints)
     530    endwhere
     531   
    511532    ! ########################################################################################
    512533    ! We take the absolute value of optical thickness here to satisfy compilers that complains
     
    514535    ! the sum.
    515536    ! ########################################################################################
    516     Optical_Thickness_Total_MeanLog10(1:nPoints) = sum(log10(abs(optical_thickness)), mask = cloudMask, &
    517          dim = 2) / Cloud_Fraction_Total_Mean(1:nPoints)
    518     Optical_Thickness_Water_MeanLog10(1:nPoints) = sum(log10(abs(optical_thickness)), mask = waterCloudMask,&
    519          dim = 2) / Cloud_Fraction_Water_Mean(1:nPoints)
    520     Optical_Thickness_Ice_MeanLog10(1:nPoints) = sum(log10(abs(optical_thickness)), mask = iceCloudMask,&
    521          dim = 2) / Cloud_Fraction_Ice_Mean(1:nPoints)
    522     Cloud_Particle_Size_Water_Mean(1:nPoints) = sum(particle_size, mask = waterCloudMask, dim = 2) / &
    523          Cloud_Fraction_Water_Mean(1:nPoints)
    524     Cloud_Particle_Size_Ice_Mean(1:nPoints) = sum(particle_size, mask = iceCloudMask,   dim = 2) / &
    525          Cloud_Fraction_Ice_Mean(1:nPoints)
    526     Cloud_Top_Pressure_Total_Mean(1:nPoints) = sum(cloud_top_pressure, mask = cloudMask, dim = 2) / &
    527          max(1, count(cloudMask, dim = 2))
    528     Liquid_Water_Path_Mean(1:nPoints) = LWP_conversion*sum(particle_size*optical_thickness, &
    529          mask=waterCloudMask,dim=2)/Cloud_Fraction_Water_Mean(1:nPoints)
    530     Ice_Water_Path_Mean(1:nPoints) = LWP_conversion * ice_density*sum(particle_size*optical_thickness,&
    531          mask=iceCloudMask,dim = 2) /Cloud_Fraction_Ice_Mean(1:nPoints)
    532 
     537    where (Cloud_Fraction_Total_Mean == 0)
     538       Optical_Thickness_Total_MeanLog10 = R_UNDEF
     539    elsewhere
     540       Optical_Thickness_Total_MeanLog10(1:nPoints) = sum(log10(abs(optical_thickness)), mask = cloudMask, &
     541           dim = 2) / Cloud_Fraction_Total_Mean(1:nPoints)
     542    endwhere
     543    where (Cloud_Fraction_Water_Mean == 0)
     544       Optical_Thickness_Water_MeanLog10 = R_UNDEF
     545    elsewhere
     546       Optical_Thickness_Water_MeanLog10(1:nPoints) = sum(log10(abs(optical_thickness)), mask = waterCloudMask,&
     547            dim = 2) / Cloud_Fraction_Water_Mean(1:nPoints)
     548    endwhere
     549    where (Cloud_Fraction_Ice_Mean == 0)
     550       Optical_Thickness_Ice_MeanLog10   = R_UNDEF
     551    elsewhere
     552       Optical_Thickness_Ice_MeanLog10(1:nPoints) = sum(log10(abs(optical_thickness)), mask = iceCloudMask,&
     553            dim = 2) / Cloud_Fraction_Ice_Mean(1:nPoints)
     554    endwhere
     555    where (Cloud_Fraction_Water_Mean == 0)
     556       Cloud_Particle_Size_Water_Mean    = R_UNDEF
     557    elsewhere
     558       Cloud_Particle_Size_Water_Mean(1:nPoints) = sum(particle_size, mask = waterCloudMask, dim = 2) / &
     559            Cloud_Fraction_Water_Mean(1:nPoints)
     560    endwhere
     561    where (Cloud_Fraction_Ice_Mean == 0)
     562       Cloud_Particle_Size_Ice_Mean      = R_UNDEF 
     563    elsewhere
     564       Cloud_Particle_Size_Ice_Mean(1:nPoints) = sum(particle_size, mask = iceCloudMask,   dim = 2) / &
     565            Cloud_Fraction_Ice_Mean(1:nPoints)
     566    endwhere
     567    where (Cloud_Fraction_Total_Mean == 0)
     568       Cloud_Top_Pressure_Total_Mean     = R_UNDEF
     569    elsewhere
     570       Cloud_Top_Pressure_Total_Mean(1:nPoints) = sum(cloud_top_pressure, mask = cloudMask, dim = 2) / &
     571            max(1, count(cloudMask, dim = 2))
     572    endwhere
     573    where (Cloud_Fraction_Water_Mean == 0)
     574       Liquid_Water_Path_Mean            = R_UNDEF
     575    elsewhere
     576       Liquid_Water_Path_Mean(1:nPoints) = LWP_conversion*sum(particle_size*optical_thickness, &
     577            mask=waterCloudMask,dim=2)/Cloud_Fraction_Water_Mean(1:nPoints)
     578    endwhere
     579    where (Cloud_Fraction_Ice_Mean == 0)
     580       Ice_Water_Path_Mean               = R_UNDEF
     581    elsewhere
     582       Ice_Water_Path_Mean(1:nPoints) = LWP_conversion * ice_density*sum(particle_size*optical_thickness,&
     583             mask=iceCloudMask,dim = 2) /Cloud_Fraction_Ice_Mean(1:nPoints)
     584    endwhere
    533585    ! ########################################################################################
    534586    ! Normalize pixel counts to fraction.
     
    544596    ! Set clear-scenes to undefined
    545597    ! ########################################################################################
    546     where (Cloud_Fraction_Total_Mean == 0)
    547        Optical_Thickness_Total_Mean      = R_UNDEF
    548        Optical_Thickness_Total_MeanLog10 = R_UNDEF
    549        Cloud_Top_Pressure_Total_Mean     = R_UNDEF
    550     endwhere
    551     where (Cloud_Fraction_Water_Mean == 0)
    552        Optical_Thickness_Water_Mean      = R_UNDEF
    553        Optical_Thickness_Water_MeanLog10 = R_UNDEF
    554        Cloud_Particle_Size_Water_Mean    = R_UNDEF
    555        Liquid_Water_Path_Mean            = R_UNDEF
    556     endwhere
    557     where (Cloud_Fraction_Ice_Mean == 0)
    558        Optical_Thickness_Ice_Mean        = R_UNDEF
    559        Optical_Thickness_Ice_MeanLog10   = R_UNDEF
    560        Cloud_Particle_Size_Ice_Mean      = R_UNDEF
    561        Ice_Water_Path_Mean               = R_UNDEF
    562     endwhere
    563598    where (Cloud_Fraction_High_Mean == 0)  Cloud_Fraction_High_Mean = R_UNDEF
    564599    where (Cloud_Fraction_Mid_Mean == 0)   Cloud_Fraction_Mid_Mean = R_UNDEF
  • LMDZ6/branches/IPSLCM6.0.15/libf/phylmd/cosp/phys_cosp.F90

    r3173 r3242  
    142142!$OMP THREADPRIVATE(first_write)
    143143
     144  logical, save :: ok_readxiosactive_cosp=.false.
     145!$OMP THREADPRIVATE(ok_readxiosactive_cosp)
    144146!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Input variables from LMDZ-GCM
    145147  integer                         :: overlaplmdz   !  overlap type: 1=max, 2=rand, 3=max/rand ! cosp input (output lmdz)
     
    153155  real                            :: dtime,freq_cosp
    154156  real,dimension(2)               :: time_bnds
     157
     158  double precision                            :: d_dtime
     159  double precision,dimension(2)               :: d_time_bnds
    155160 
    156161   namelist/COSP_INPUT/overlap,isccp_topheight,isccp_topheight_direction, &
     
    192197!!! Ici on modifie les cles logiques selon les champs actives dans les .xml
    193198#ifdef CPP_XIOS
     199 if (ok_readxiosactive_cosp) then
    194200  if ((itap.gt.1).and.(first_write))then
    195 !    call read_xiosfieldactive(cfg)
    196201     call read_cosp_output_nl(itap,cosp_output_nl,cfg)
    197 !       print*,' Dans cosp_write itap first_writ LcfadLidarsr532 =', &
    198 !                     itap, first_write, cfg%LcfadLidarsr532
    199202     first_write=.false.
    200203  endif
    201 !  print*,' Dans cosp_write itap LcfadLidarsr532 =', &
    202 !                     itap, cfg%LcfadLidarsr532
     204 endif
    203205#endif
    204206
     
    206208  time_bnds(1) = dtime-dtime/2.
    207209  time_bnds(2) = dtime+dtime/2.
     210
     211  d_time_bnds=time_bnds
     212  d_dtime=dtime
     213
    208214
    209215!  print*,'Debut phys_cosp itap,dtime,freq_cosp,ecrit_mth,ecrit_day,ecrit_hf ', &
     
    225231        emsfc_lw = 1.
    226232
    227         call construct_cosp_gridbox(dtime,time_bnds,radar_freq,surface_radar,use_mie_tables,use_gas_abs, &
     233        call construct_cosp_gridbox(d_dtime,d_time_bnds,radar_freq,surface_radar,use_mie_tables,use_gas_abs, &
    228234                                    do_ray,melt_lay,k2, &
    229235                                    Npoints,Nlevels,Ncolumns,N_HYDRO,Nprmts_max_hydro,Naero,Nprmts_max_aero,Npoints_it, &
     
    441447  END SUBROUTINE read_cosp_input
    442448
    443   SUBROUTINE read_xiosfieldactive(cfg)
    444 
    445     USE MOD_COSP_TYPES
    446 #ifdef CPP_XIOS
    447     USE xios, ONLY: xios_field_is_active
    448 #endif
    449   type(cosp_config),intent(out) :: cfg
    450 
    451 ! VEREFIER LES CHAMPS DEMANDES DANS .XML
    452 ! 2. Si champs active dans .xml alors mettre la cles de sortie en true
    453  IF (xios_field_is_active("cllcalipso")) cfg%Lcllcalipso=.TRUE.
    454  IF (xios_field_is_active("clmcalipso")) cfg%Lclmcalipso=.TRUE.
    455  IF (xios_field_is_active("clhcalipso")) cfg%Lclhcalipso=.TRUE.
    456  IF (xios_field_is_active("cltcalipso")) cfg%Lcltcalipso=.TRUE.
    457 ! IF (xios_field_is_active("pcllcalipso")) cfg%Lcllcalipso=.TRUE.
    458 ! IF (xios_field_is_active("pclmcalipso")) cfg%Lclmcalipso=.TRUE.
    459 ! IF (xios_field_is_active("pclhcalipso")) cfg%Lclhcalipso=.TRUE.
    460 ! IF (xios_field_is_active("pcltcalipso")) cfg%Lcltcalipso=.TRUE.
    461  IF (xios_field_is_active("cllcalipsoice")) cfg%Lcllcalipsoice=.TRUE.
    462  IF (xios_field_is_active("clmcalipsoice")) cfg%Lclmcalipsoice=.TRUE.
    463  IF (xios_field_is_active("clhcalipsoice")) cfg%Lclhcalipsoice=.TRUE.
    464  IF (xios_field_is_active("cltcalipsoice")) cfg%Lcltcalipsoice=.TRUE.
    465  IF (xios_field_is_active("cllcalipsoliq")) cfg%Lcllcalipsoliq=.TRUE.
    466  IF (xios_field_is_active("clmcalipsoliq")) cfg%Lclmcalipsoliq=.TRUE.
    467  IF (xios_field_is_active("clhcalipsoliq")) cfg%Lclhcalipsoliq=.TRUE.
    468  IF (xios_field_is_active("cltcalipsoliq")) cfg%Lcltcalipsoliq=.TRUE.
    469  IF (xios_field_is_active("cllcalipsoun")) cfg%Lcllcalipsoun=.TRUE.
    470  IF (xios_field_is_active("clmcalipsoun")) cfg%Lclmcalipsoun=.TRUE.
    471  IF (xios_field_is_active("clhcalipsoun")) cfg%Lclhcalipsoun=.TRUE.
    472  IF (xios_field_is_active("cltcalipsoun")) cfg%Lcltcalipsoun=.TRUE.
    473  IF (xios_field_is_active("clcalipso")) cfg%Lclcalipso=.TRUE.
    474 ! IF (xios_field_is_active("pclcalipso")) cfg%Lclcalipso=.TRUE.
    475  IF (xios_field_is_active("clcalipsoice")) cfg%Lclcalipsoice=.TRUE.
    476  IF (xios_field_is_active("clcalipsoliq")) cfg%Lclcalipsoliq=.TRUE.
    477  IF (xios_field_is_active("clcalipsoun")) cfg%Lclcalipsoun=.TRUE.
    478  IF (xios_field_is_active("clcalipsotmp")) cfg%Lclcalipsotmp=.TRUE.
    479  IF (xios_field_is_active("clcalipsotmpice")) cfg%Lclcalipsotmpice=.TRUE.
    480  IF (xios_field_is_active("clcalipsotmpliq")) cfg%Lclcalipsotmpliq=.TRUE.
    481  IF (xios_field_is_active("clcalipsotmpun")) cfg%Lclcalipsotmpun=.TRUE.
    482  IF (xios_field_is_active("parasol_refl")) cfg%LparasolRefl=.TRUE.
    483  IF (xios_field_is_active("parasol_crefl")) cfg%LparasolRefl=.TRUE.
    484  IF (xios_field_is_active("Ncrefl")) cfg%LparasolRefl=.TRUE.
    485  IF (xios_field_is_active("cfad_lidarsr532")) cfg%LcfadLidarsr532=.TRUE.
    486  IF (xios_field_is_active("atb532")) cfg%Latb532=.TRUE.
    487  IF (xios_field_is_active("beta_mol532")) cfg%LlidarBetaMol532=.TRUE.
    488  IF (xios_field_is_active("clopaquecalipso")) cfg%Lclopaquecalipso=.TRUE.
    489  IF (xios_field_is_active("clthincalipso")) cfg%Lclthincalipso=.TRUE.
    490  IF (xios_field_is_active("clzopaquecalipso")) cfg%Lclzopaquecalipso=.TRUE.
    491  IF (xios_field_is_active("clcalipsoopaque")) cfg%Lclcalipsoopaque=.TRUE.
    492  IF (xios_field_is_active("clcalipsothin")) cfg%Lclcalipsothin=.TRUE.
    493  IF (xios_field_is_active("clcalipsozopaque")) cfg%Lclcalipsozopaque=.TRUE.
    494  IF (xios_field_is_active("clcalipsoopacity")) cfg%Lclcalipsoopacity=.TRUE.
    495  IF (xios_field_is_active("proftemp")) cfg%Lproftemp=.TRUE.
    496  IF (xios_field_is_active("profSR")) cfg%LprofSR=.TRUE.
    497 
    498  IF (xios_field_is_active("cfadDbze94")) cfg%LcfadDbze94=.TRUE.
    499  IF (xios_field_is_active("dbze94")) cfg%Ldbze94=.TRUE.
    500  IF (xios_field_is_active("cltlidarradar")) cfg%Lcltlidarradar=.TRUE.
    501  IF (xios_field_is_active("clcalipso2")) cfg%Lclcalipso2=.TRUE.
    502 
    503    IF (xios_field_is_active("clisccp2")) cfg%Lclisccp=.TRUE.
    504  IF (xios_field_is_active("boxtauisccp")) cfg%Lboxtauisccp=.TRUE.
    505  IF (xios_field_is_active("boxptopisccp")) cfg%Lboxptopisccp=.TRUE.
    506  IF (xios_field_is_active("tclisccp")) cfg%Lcltisccp=.TRUE.
    507  IF (xios_field_is_active("ctpisccp")) cfg%Lpctisccp=.TRUE.
    508  IF (xios_field_is_active("tauisccp")) cfg%Ltauisccp=.TRUE.
    509  IF (xios_field_is_active("albisccp")) cfg%Lalbisccp=.TRUE.
    510  IF (xios_field_is_active("meantbisccp")) cfg%Lmeantbisccp=.TRUE.
    511  IF (xios_field_is_active("meantbclrisccp")) cfg%Lmeantbclrisccp=.TRUE.
    512 
    513    IF (xios_field_is_active("clMISR")) cfg%LclMISR=.TRUE.
    514 
    515 IF (xios_field_is_active("cllmodis")) cfg%Lcllmodis=.TRUE.
    516  IF (xios_field_is_active("clmmodis")) cfg%Lclmmodis=.TRUE.
    517  IF (xios_field_is_active("clhmodis")) cfg%Lclhmodis=.TRUE.
    518  IF (xios_field_is_active("cltmodis")) cfg%Lcltmodis=.TRUE.
    519  IF (xios_field_is_active("clwmodis")) cfg%Lclwmodis=.TRUE.
    520  IF (xios_field_is_active("climodis")) cfg%Lclimodis=.TRUE.
    521  IF (xios_field_is_active("tautmodis")) cfg%Ltautmodis=.TRUE.
    522  IF (xios_field_is_active("tauwmodis")) cfg%Ltauwmodis=.TRUE.
    523  IF (xios_field_is_active("tauimodis")) cfg%Ltauimodis=.TRUE.
    524  IF (xios_field_is_active("tautlogmodis")) cfg%Ltautlogmodis=.TRUE.
    525  IF (xios_field_is_active("tauilogmodis")) cfg%Ltauilogmodis=.TRUE.
    526  IF (xios_field_is_active("tauwlogmodis")) cfg%Ltauwlogmodis=.TRUE.
    527  IF (xios_field_is_active("reffclwmodis")) cfg%Lreffclwmodis=.TRUE.
    528  IF (xios_field_is_active("reffclimodis")) cfg%Lreffclimodis=.TRUE.
    529  IF (xios_field_is_active("pctmodis")) cfg%Lpctmodis=.TRUE.
    530  IF (xios_field_is_active("lwpmodis")) cfg%Llwpmodis=.TRUE.
    531  IF (xios_field_is_active("iwpmodis")) cfg%Liwpmodis=.TRUE.
    532  IF (xios_field_is_active("clmodis")) cfg%Lclmodis=.TRUE.
    533  IF (xios_field_is_active("crimodis")) cfg%Lcrimodis=.TRUE.
    534  IF (xios_field_is_active("crlmodis")) cfg%Lcrlmodis=.TRUE.
    535 
    536 ! 2.  si champs demande alors activer le simulateur correspondant
    537    IF (xios_field_is_active("cllcalipso").OR. &
    538        xios_field_is_active("clmcalipso").OR. &
    539        xios_field_is_active("clhcalipso").OR. &
    540        xios_field_is_active("cltcalipso").OR. &
    541 !       xios_field_is_active("pcllcalipso").OR. &
    542 !       xios_field_is_active("pclmcalipso").OR. &
    543 !       xios_field_is_active("pclhcalipso").OR. &
    544 !       xios_field_is_active("pcltcalipso").OR. &
    545        xios_field_is_active("cllcalipsoice").OR. &
    546        xios_field_is_active("clmcalipsoice").OR. &
    547        xios_field_is_active("clhcalipsoice").OR. &
    548        xios_field_is_active("cltcalipsoice").OR. &
    549        xios_field_is_active("cllcalipsoliq").OR. &
    550        xios_field_is_active("clmcalipsoliq").OR. &
    551        xios_field_is_active("clhcalipsoliq").OR. &
    552        xios_field_is_active("cltcalipsoliq").OR. &
    553        xios_field_is_active("cllcalipsoun").OR. &
    554        xios_field_is_active("clmcalipsoun").OR. &
    555        xios_field_is_active("clhcalipsoun").OR. &
    556        xios_field_is_active("cltcalipsoun").OR. &
    557        xios_field_is_active("clcalipso").OR. &
    558 !       xios_field_is_active("pclcalipso").OR. &
    559        xios_field_is_active("clcalipsoice").OR. &
    560        xios_field_is_active("clcalipsoliq").OR. &
    561        xios_field_is_active("clcalipsoun").OR. &
    562        xios_field_is_active("clcalipsotmp").OR. &
    563        xios_field_is_active("clcalipsotmpice").OR. &
    564        xios_field_is_active("clcalipsotmpliq").OR. &
    565        xios_field_is_active("clcalipsotmpun").OR. &
    566        xios_field_is_active("parasol_refl").OR. &
    567        xios_field_is_active("parasol_crefl").OR. &
    568        xios_field_is_active("Ncrefl").OR. &
    569        xios_field_is_active("cfad_lidarsr532").OR. &
    570        xios_field_is_active("atb532").OR. &
    571        xios_field_is_active("beta_mol532").OR. &
    572        xios_field_is_active("clopaquecalipso").OR. &
    573        xios_field_is_active("clthincalipso").OR. &
    574        xios_field_is_active("clzopaquecalipso").OR. &
    575        xios_field_is_active("clcalipsoopaque").OR. &
    576        xios_field_is_active("clcalipsothin").OR. &
    577        xios_field_is_active("clcalipsozopaque").OR. &
    578        xios_field_is_active("clcalipsoopacity").OR. &
    579        xios_field_is_active("proftemp").OR. &
    580        xios_field_is_active("profSR")) cfg%Llidar_sim=.TRUE.
    581 
    582     IF (xios_field_is_active("cfadDbze94").OR. &
    583       xios_field_is_active("dbze94")) &
    584                cfg%Lradar_sim=.TRUE.
    585 
    586     IF (xios_field_is_active("cltlidarradar").OR. &
    587       xios_field_is_active("clcalipso2")) THEN
    588                cfg%Lradar_sim=.TRUE.
    589                cfg%Llidar_sim=.TRUE.
    590     ENDIF
    591 
    592     IF (xios_field_is_active("clisccp2").OR. &
    593        xios_field_is_active("boxtauisccp").OR. &
    594        xios_field_is_active("boxptopisccp").OR. &
    595        xios_field_is_active("tclisccp").OR. &
    596        xios_field_is_active("ctpisccp").OR. &
    597        xios_field_is_active("tauisccp").OR. &
    598        xios_field_is_active("albisccp").OR. &
    599        xios_field_is_active("meantbisccp").OR. &
    600        xios_field_is_active("meantbclrisccp")) cfg%Lisccp_sim=.TRUE.
    601 
    602     IF (xios_field_is_active("clMISR")) cfg%Lmisr_sim=.TRUE.
    603 
    604     IF (xios_field_is_active("cllmodis").OR. &
    605        xios_field_is_active("clmmodis").OR. &
    606        xios_field_is_active("clhmodis").OR. &
    607        xios_field_is_active("cltmodis").OR. &
    608        xios_field_is_active("clwmodis").OR. &
    609        xios_field_is_active("climodis").OR. &
    610        xios_field_is_active("tautmodis").OR. &
    611        xios_field_is_active("tauwmodis").OR. &
    612        xios_field_is_active("tauimodis").OR. &
    613        xios_field_is_active("tautlogmodis").OR. &
    614        xios_field_is_active("tauilogmodis").OR. &
    615        xios_field_is_active("tauwlogmodis").OR. &
    616        xios_field_is_active("reffclwmodis").OR. &
    617        xios_field_is_active("reffclimodis").OR. &
    618        xios_field_is_active("pctmodis").OR. &
    619        xios_field_is_active("lwpmodis").OR. &
    620        xios_field_is_active("iwpmodis").OR. &
    621        xios_field_is_active("clmodis").OR. &
    622        xios_field_is_active("crimodis").OR. &
    623        xios_field_is_active("crlmodis")) cfg%Lmodis_sim=.TRUE.
    624   END SUBROUTINE read_xiosfieldactive
    625 
    626 
    627449end subroutine phys_cosp
  • LMDZ6/branches/IPSLCM6.0.15/libf/phylmd/cosp/radar_simulator_types.F90

    r2428 r3242  
    44! Part of QuickBeam v1.03 by John Haynes
    55! Updated by Roj Marchand June 2010
    6 
     6  implicit none
    77  integer, parameter ::       &
    88  maxhclass = 20         ,& ! max number of hydrometeor classes
  • LMDZ6/branches/IPSLCM6.0.15/libf/phylmd/cosp/read_cosp_output_nl.F90

    r3173 r3242  
    1010    USE xios, ONLY: xios_field_is_active
    1111#endif
    12 
     12  implicit none
    1313  character(len=*),intent(in) :: cosp_nl
    1414  type(cosp_config),intent(out) :: cfg
     
    127127  CALL bcast(Lmeantbisccp)
    128128  CALL bcast(Lmeantbclrisccp)
    129   CALL bcast(Lfrac_out)
     129  CALL bcast(Lfracout)
    130130  CALL bcast(LlidarBetaMol532)
    131131  CALL bcast(Lcltmodis)
     
    239239  if ((.not.Lradar_sim).and.(.not.Llidar_sim).and. &
    240240      (.not.Lisccp_sim).and.(.not.Lmisr_sim)) then
    241     Lfrac_out = .false.
     241    Lfracout = .false.
    242242  endif
    243243 if (.not.Lmodis_sim) then
     
    533533  cfg%Lcrlmodis=Lcrlmodis
    534534 
    535     if (itap.gt.1) then
     535#ifdef CPP_XIOS
     536 if (itap.gt.1) then
    536537
    537538! VEREFIER LES CHAMPS DEMANDES DANS .XML
     
    709710       xios_field_is_active("crlmodis")) cfg%Lmodis_sim=.TRUE.
    710711
    711   endif
    712 
     712 endif
     713#endif
    713714
    714715 END SUBROUTINE READ_COSP_OUTPUT_NL
Note: See TracChangeset for help on using the changeset viewer.