Changeset 3241
- Timestamp:
- Mar 6, 2018, 10:46:13 AM (7 years ago)
- Location:
- LMDZ6/trunk/libf/phylmd/cosp
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
LMDZ6/trunk/libf/phylmd/cosp/cosp_output_mod.F90
r2955 r3241 12 12 numMODISReffLiqBins, reffLIQ_binCenters 13 13 14 IMPLICIT NONE 14 15 ! cosp_output_mod 15 16 INTEGER, PRIVATE :: i -
LMDZ6/trunk/libf/phylmd/cosp/cosp_output_write_mod.F90
r3192 r3241 6 6 USE cosp_output_mod 7 7 8 IMPLICIT NONE 9 8 10 INTEGER, SAVE :: itau_iocosp 9 11 !$OMP THREADPRIVATE(itau_iocosp) … … 29 31 USE xios, only: xios_update_calendar, xios_field_is_active 30 32 #endif 31 33 IMPLICIT NONE 32 34 !!! Variables d'entree 33 35 integer :: itap, Nlevlmdz, Ncolumns, Npoints … … 45 47 46 48 !!! Variables locales 47 integer :: icl 49 integer :: icl,k,ip 48 50 logical :: ok_sync 49 51 integer :: itau_wcosp … … 78 80 ! On n'ecrit pas quand itap=1 (cosp) 79 81 80 if (prt_level >= 10) then81 WRITE(lunout,*)'DO iinit=1, iinitend ',iinitend82 endif82 ! if (prt_level >= 10) then 83 ! WRITE(lunout,*)'DO iinit=1, iinitend ',iinitend 84 ! endif 83 85 84 86 !!#ifdef CPP_XIOS … … 97 99 !!!! Sorties Calipso 98 100 if (cfg%Llidar_sim) then 99 ! Pb des valeurs indefinies, on les met a 0100 ! A refaire proprement101 ! do k = 1,Nlevout102 ! do ip = 1,Npoints103 ! if(stlidar%lidarcld(ip,k).eq.R_UNDEF)then104 ! stlidar%lidarcld(ip,k)=missing_val105 ! endif106 ! if(stlidar%proftemp(ip,k).eq.R_UNDEF)then !TIBO107 ! stlidar%proftemp(ip,k)=missing_val !TIBO108 ! endif !TIBO109 ! enddo110 111 ! do ii= 1,Ncolumns !TIBO112 ! do ip = 1,Npoints !TIBO113 !! if(stlidar%profSR(ip,ii,k).eq.R_UNDEF)then !TIBO114 !! stlidar%profSR(ip,ii,k)=missing_val !TIBO115 ! if(stlidar%profSR(ip,k,ii).eq.R_UNDEF)then !TIBO2116 ! stlidar%profSR(ip,k,ii)=missing_val !TIBO2117 ! endif !TIBO118 ! enddo !TIBO119 ! enddo !TIBO120 ! enddo121 122 ! do ip = 1,Npoints123 ! do k = 1,Nlevlmdz124 ! if(sglidar%beta_mol(ip,k).eq.R_UNDEF)then125 ! sglidar%beta_mol(ip,k)=missing_val126 ! endif127 128 ! do ii= 1,Ncolumns129 ! if(sglidar%beta_tot(ip,ii,k).eq.R_UNDEF)then130 ! sglidar%beta_tot(ip,ii,k)=missing_val131 ! endif132 ! enddo133 134 ! enddo !k = 1,Nlevlmdz135 ! enddo !ip = 1,Npoints136 137 ! do k = 1,LIDAR_NCAT138 ! do ip = 1,Npoints139 ! if(stlidar%cldlayer(ip,k).eq.R_UNDEF)then140 ! stlidar%cldlayer(ip,k)=missing_val141 ! endif142 ! enddo143 ! enddo144 145 ! do k = 1,LIDAR_NTYPE !OPAQ146 ! do ip = 1,Npoints !OPAQ147 ! if(stlidar%cldtype(ip,k).eq.R_UNDEF)then !OPAQ148 ! stlidar%cldtype(ip,k)=missing_val !OPAQ149 ! endif !OPAQ150 ! enddo !OPAQ151 ! enddo !OPAQ152 153 101 !!! AI 02 2018 154 102 ! Traitement missing_val … … 278 226 !!! Sorties Isccp 279 227 if (cfg%Lisccp_sim) then 280 ! Traitement des valeurs indefinies281 ! do ip = 1,Npoints282 ! if(isccp%totalcldarea(ip).eq.R_UNDEF)then283 ! isccp%totalcldarea(ip)=missing_val284 ! endif285 ! if(isccp%meanptop(ip).eq.R_UNDEF)then286 ! isccp%meanptop(ip)=missing_val287 ! endif288 ! if(isccp%meantaucld(ip).eq.R_UNDEF)then289 ! isccp%meantaucld(ip)=missing_val290 ! endif291 ! if(isccp%meanalbedocld(ip).eq.R_UNDEF)then292 ! isccp%meanalbedocld(ip)=missing_val293 ! endif294 ! if(isccp%meantb(ip).eq.R_UNDEF)then295 ! isccp%meantb(ip)=missing_val296 ! endif297 ! if(isccp%meantbclr(ip).eq.R_UNDEF)then298 ! isccp%meantbclr(ip)=missing_val299 ! endif300 301 ! do k=1,7302 ! do ii=1,7303 ! if(isccp%fq_isccp(ip,ii,k).eq.R_UNDEF)then304 ! isccp%fq_isccp(ip,ii,k)=missing_val305 ! endif306 ! enddo307 ! enddo308 309 ! do ii=1,Ncolumns310 ! if(isccp%boxtau(ip,ii).eq.R_UNDEF)then311 ! isccp%boxtau(ip,ii)=missing_val312 ! endif313 ! enddo314 315 ! do ii=1,Ncolumns316 ! if(isccp%boxptop(ip,ii).eq.R_UNDEF)then317 ! isccp%boxptop(ip,ii)=missing_val318 ! endif319 ! enddo320 ! enddo321 228 where(isccp%totalcldarea == R_UNDEF) isccp%totalcldarea = missing_val 322 229 where(isccp%meanptop == R_UNDEF) isccp%meanptop = missing_val … … 349 256 !!! MISR simulator 350 257 if (cfg%Lmisr_sim) then 351 ! do ip=1,Npoints352 ! do ii=1,7353 ! do k=1,MISR_N_CTH354 ! if(misr%fq_MISR(ip,ii,k).eq.R_UNDEF)then355 ! misr%fq_MISR(ip,ii,k)=missing_val356 ! endif357 ! enddo358 ! enddo359 ! enddo360 258 where(misr%fq_MISR == R_UNDEF) misr%fq_MISR = missing_val 361 259 … … 400 298 modis%Ice_Water_Path_Mean = missing_val 401 299 402 ! de ip=1,Npoints403 ! if(modis%Cloud_Fraction_Low_Mean(ip).eq.R_UNDEF)then404 ! modis%Cloud_Fraction_Low_Mean(ip)=missing_val405 ! endif406 ! if(modis%Cloud_Fraction_High_Mean(ip).eq.R_UNDEF)then407 ! modis%Cloud_Fraction_High_Mean(ip)=missing_val408 ! endif409 ! if(modis%Cloud_Fraction_Mid_Mean(ip).eq.R_UNDEF)then410 ! modis%Cloud_Fraction_Mid_Mean(ip)=missing_val411 ! endif412 ! if(modis%Cloud_Fraction_Total_Mean(ip).eq.R_UNDEF)then413 ! modis%Cloud_Fraction_Total_Mean(ip)=missing_val414 ! endif415 ! if(modis%Cloud_Fraction_Water_Mean(ip).eq.R_UNDEF)then416 ! modis%Cloud_Fraction_Water_Mean(ip)=missing_val417 ! endif418 ! if(modis%Cloud_Fraction_Ice_Mean(ip).eq.R_UNDEF)then419 ! modis%Cloud_Fraction_Ice_Mean(ip)=missing_val420 ! endif421 ! if(modis%Optical_Thickness_Total_Mean(ip).eq.R_UNDEF)then422 ! modis%Optical_Thickness_Total_Mean(ip)=missing_val423 ! endif424 ! if(modis%Optical_Thickness_Water_Mean(ip).eq.R_UNDEF)then425 ! modis%Optical_Thickness_Water_Mean(ip)=missing_val426 ! endif427 ! if(modis%Optical_Thickness_Ice_Mean(ip).eq.R_UNDEF)then428 ! modis%Optical_Thickness_Ice_Mean(ip)=missing_val429 ! endif430 ! if(modis%Cloud_Particle_Size_Water_Mean(ip).eq.R_UNDEF)then431 ! modis%Cloud_Particle_Size_Water_Mean(ip)=missing_val432 ! endif433 ! if(modis%Cloud_Particle_Size_Ice_Mean(ip).eq.R_UNDEF)then434 ! modis%Cloud_Particle_Size_Ice_Mean(ip)=missing_val435 ! endif436 ! if(modis%Cloud_Top_Pressure_Total_Mean(ip).eq.R_UNDEF)then437 ! modis%Cloud_Top_Pressure_Total_Mean(ip)=missing_val438 ! endif439 ! if(modis%Liquid_Water_Path_Mean(ip).eq.R_UNDEF)then440 ! modis%Liquid_Water_Path_Mean(ip)=missing_val441 ! endif442 ! if(modis%Ice_Water_Path_Mean(ip).eq.R_UNDEF)then443 ! modis%Ice_Water_Path_Mean(ip)=missing_val444 ! endif445 ! enddo446 447 300 where(modis%Optical_Thickness_Total_LogMean == R_UNDEF) & 448 301 modis%Optical_Thickness_Total_LogMean = missing_val … … 472 325 CALL histwrite2d_cosp(o_iwpmodis,modis%Ice_Water_Path_Mean) 473 326 474 ! do ip=1,Npoints475 ! do ii=1,7476 ! do k=1,7477 ! if(modis%Optical_Thickness_vs_Cloud_Top_Pressure(ip,ii,k).eq.R_UNDEF)then478 ! modis%Optical_Thickness_vs_Cloud_Top_Pressure(ip,ii,k)=missing_val479 ! endif480 ! enddo481 ! enddo482 ! enddo483 327 where(modis%Optical_Thickness_vs_Cloud_Top_Pressure == R_UNDEF) & 484 328 modis%Optical_Thickness_vs_Cloud_Top_Pressure = missing_val -
LMDZ6/trunk/libf/phylmd/cosp/lidar_simulator.F90
r2428 r3241 121 121 !--------------------------------------------------------------------------------- 122 122 123 USE MOD_COSP_CONSTANTS, only : ok_debug_cosp 123 124 IMPLICIT NONE 124 125 REAL :: SRsat … … 201 202 REAL pnorm_perp_liq(npoints,nlev) ! perpendicular lidar backscattered signal power for liq 202 203 204 REAL :: seuil 205 203 206 ! Output variable 204 207 REAL pnorm_perp_tot (npoints,nlev) ! perpendicular lidar backscattered signal power … … 235 238 Gamma = 0.009 236 239 240 if (ok_debug_cosp) then 241 seuil=1.e-15 242 else 243 seuil=0.0 244 endif 237 245 !------------------------------------------------------------ 238 246 !---- 1. Preliminary definitions and calculations : … … 494 502 495 503 DO k= nlev, 1, -1 496 497 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 498 506 ENDDO 499 507 … … 523 531 tautot_lay_liq(:) = tautot_liq(:,k)-tautot_liq(:,k+1) 524 532 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(:))) 527 535 528 536 ELSEWHERE -
LMDZ6/trunk/libf/phylmd/cosp/m_mrgrnk.F90
r3233 r3241 1 1 Module m_mrgrnk 2 IMPLICIT NONE 2 3 Integer, Parameter :: kdp = selected_real_kind(15) 3 4 public :: mrgrnk -
LMDZ6/trunk/libf/phylmd/cosp/mod_cosp_constants.F90
r3233 r3241 38 38 39 39 character(len=32) :: COSP_VERSION='COSP v1.4' 40 41 ! Mode debug ou prod (AI 0302018) 42 logical :: ok_debug_cosp = .false. 40 43 41 44 ! Indices to address arrays of LS and CONV hydrometeors -
LMDZ6/trunk/libf/phylmd/cosp/mod_cosp_utils.F90
r3233 r3241 61 61 integer :: i,j,k 62 62 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 64 71 mxratio = 0.0 65 72 … … 80 87 mxratio(i,j,k)=mxratio(i,j,k)/rho 81 88 ! 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 83 91 lambda_x = (a_x*c_x*((rho0/rho)**g_x)*n_ax*gamma1/flux(i,k))**(1./delta) 84 92 reff(i,j,k) = gamma_4_3_2/lambda_x -
LMDZ6/trunk/libf/phylmd/cosp/mod_modis_sim.F90
r3233 r3241 52 52 ! 53 53 module mod_modis_sim 54 USE MOD_COSP_TYPES, only: R_UNDEF 54 USE MOD_COSP_TYPES, only: R_UNDEF, ok_debug_cosp 55 55 implicit none 56 56 ! ------------------------------ … … 384 384 liquid_opticalThickness, ice_opticalThickness, tauLiquidFraction 385 385 386 real :: seuil 386 387 ! --------------------------------------------------- 387 388 389 if (ok_debug_cosp) then 390 seuil=1.e-9 391 else 392 seuil=0.0 393 endif 394 388 395 where(cloudIce(:, :) <= 0.) 389 396 tauLiquidFraction(:, :) = 1. … … 395 402 ! Geometic optics limit - tau as LWP/re (proportional to LWC/re) 396 403 ! 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)) ) 399 408 end where 400 409 end where … … 502 511 ! Compute mean optical thickness. 503 512 ! ######################################################################################## 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 511 532 ! ######################################################################################## 512 533 ! We take the absolute value of optical thickness here to satisfy compilers that complains … … 514 535 ! the sum. 515 536 ! ######################################################################################## 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 533 585 ! ######################################################################################## 534 586 ! Normalize pixel counts to fraction. … … 544 596 ! Set clear-scenes to undefined 545 597 ! ######################################################################################## 546 where (Cloud_Fraction_Total_Mean == 0)547 Optical_Thickness_Total_Mean = R_UNDEF548 Optical_Thickness_Total_MeanLog10 = R_UNDEF549 Cloud_Top_Pressure_Total_Mean = R_UNDEF550 endwhere551 where (Cloud_Fraction_Water_Mean == 0)552 Optical_Thickness_Water_Mean = R_UNDEF553 Optical_Thickness_Water_MeanLog10 = R_UNDEF554 Cloud_Particle_Size_Water_Mean = R_UNDEF555 Liquid_Water_Path_Mean = R_UNDEF556 endwhere557 where (Cloud_Fraction_Ice_Mean == 0)558 Optical_Thickness_Ice_Mean = R_UNDEF559 Optical_Thickness_Ice_MeanLog10 = R_UNDEF560 Cloud_Particle_Size_Ice_Mean = R_UNDEF561 Ice_Water_Path_Mean = R_UNDEF562 endwhere563 598 where (Cloud_Fraction_High_Mean == 0) Cloud_Fraction_High_Mean = R_UNDEF 564 599 where (Cloud_Fraction_Mid_Mean == 0) Cloud_Fraction_Mid_Mean = R_UNDEF -
LMDZ6/trunk/libf/phylmd/cosp/radar_simulator_types.F90
r2428 r3241 4 4 ! Part of QuickBeam v1.03 by John Haynes 5 5 ! Updated by Roj Marchand June 2010 6 6 implicit none 7 7 integer, parameter :: & 8 8 maxhclass = 20 ,& ! max number of hydrometeor classes -
LMDZ6/trunk/libf/phylmd/cosp/read_cosp_output_nl.F90
r3233 r3241 10 10 USE xios, ONLY: xios_field_is_active 11 11 #endif 12 12 implicit none 13 13 character(len=*),intent(in) :: cosp_nl 14 14 type(cosp_config),intent(out) :: cfg
Note: See TracChangeset
for help on using the changeset viewer.