- Timestamp:
- Jul 22, 2024, 9:46:57 AM (5 months ago)
- Location:
- LMDZ6/branches/Amaury_dev
- Files:
-
- 1061 added
- 69 edited
Legend:
- Unmodified
- Added
- Removed
-
LMDZ6/branches/Amaury_dev/libf/phylmd/cosp/MISR_simulator.F
r5082 r5095 133 133 134 134 ! define location of "layer top" 135 if(ilev ==1 .or. ilev==nlev) then135 if(ilev.eq.1 .or. ilev.eq.nlev) then 136 136 ztest=zfull(j,ilev) 137 137 else … … 144 144 do loop=2,n_MISR_CTH 145 145 146 if ( ztest >146 if ( ztest .gt. 147 147 & 1000*MISR_CTH_boundaries(loop+1) ) then 148 148 … … 173 173 dtau=0 174 174 175 if (frac_out(j,ibox,ilev) ==1) then175 if (frac_out(j,ibox,ilev).eq.1) then 176 176 dtau = dtau_s(j,ilev) 177 177 endif 178 178 179 if (frac_out(j,ibox,ilev) ==2) then179 if (frac_out(j,ibox,ilev).eq.2) then 180 180 dtau = dtau_c(j,ilev) 181 181 end if … … 186 186 ! NOW for MISR .. 187 187 ! if there a cloud ... start the counter ... store this height 188 if(thres_crossed_MISR == 0 .and. dtau >0.) then188 if(thres_crossed_MISR .eq. 0 .and. dtau .gt. 0.) then 189 189 190 190 ! first encountered a "cloud" … … 193 193 endif 194 194 195 if( thres_crossed_MISR <99 .and.196 & thres_crossed_MISR >0 ) then195 if( thres_crossed_MISR .lt. 99 .and. 196 & thres_crossed_MISR .gt. 0 ) then 197 197 198 if( dtau ==0.) then198 if( dtau .eq. 0.) then 199 199 200 200 ! we have come to the end of the current cloud … … 212 212 ! then MISR will like see a top below the top of the current 213 213 ! layer 214 if( dtau >0 .and. (cloud_dtau-dtau) <1) then215 216 if(dtau < 1 .or. ilev==1 .or. ilev==nlev) then214 if( dtau.gt.0 .and. (cloud_dtau-dtau) .lt. 1) then 215 216 if(dtau .lt. 1 .or. ilev.eq.1 .or. ilev.eq.nlev) then 217 217 218 218 ! MISR will likely penetrate to some point … … 233 233 234 234 ! check for a distinctive water layer 235 if(dtau > 1 .and. at(j,ilev)>273 ) then235 if(dtau .gt. 1 .and. at(j,ilev).gt.273 ) then 236 236 237 237 ! must be a water cloud ... … … 242 242 ! if the total column optical depth is "large" than 243 243 ! MISR can't seen anything else ... set current point as CTH level 244 if(tau(j,ibox) > 5) then244 if(tau(j,ibox) .gt. 5) then 245 245 246 246 thres_crossed_MISR=99 … … 254 254 ! check to see if there was a cloud for which we didn't 255 255 ! set a MISR cloud top boundary 256 if( thres_crossed_MISR ==1) then256 if( thres_crossed_MISR .eq. 1) then 257 257 258 258 ! if the cloud has a total optical depth of greater … … 260 260 ! with a height near the true cloud top 261 261 ! otherwise there should be no CTH 262 if( tau(j,ibox) >0.5) then262 if( tau(j,ibox) .gt. 0.5) then 263 263 264 264 ! keep MISR detected CTH 265 265 266 elseif(tau(j,ibox) >0.2) then266 elseif(tau(j,ibox) .gt. 0.2) then 267 267 268 268 ! MISR may detect but wont likley have a good height … … 294 294 ! This setup assumes the columns represent a about a 1 to 4 km scale 295 295 ! it will need to be modified significantly, otherwise 296 if(ncol ==1) then296 if(ncol.eq.1) then 297 297 298 298 ! adjust based on neightboring points ... i.e. only 2D grid was input 299 299 do j=2,npoints-1 300 300 301 if(box_MISR_ztop(j-1,1) >0 .and.302 & box_MISR_ztop(j+1,1) >0 ) then301 if(box_MISR_ztop(j-1,1).gt.0 .and. 302 & box_MISR_ztop(j+1,1).gt.0 ) then 303 303 304 304 if( abs( box_MISR_ztop(j-1,1) - 305 & box_MISR_ztop(j+1,1) ) < 500305 & box_MISR_ztop(j+1,1) ) .lt. 500 306 306 & .and. 307 & box_MISR_ztop(j,1) <307 & box_MISR_ztop(j,1) .lt. 308 308 & box_MISR_ztop(j+1,1) ) then 309 309 … … 319 319 do ibox=2,ncol-1 320 320 321 if(box_MISR_ztop(1,ibox-1) >0 .and.322 & box_MISR_ztop(1,ibox+1) >0 ) then321 if(box_MISR_ztop(1,ibox-1).gt.0 .and. 322 & box_MISR_ztop(1,ibox+1).gt.0 ) then 323 323 324 324 if( abs( box_MISR_ztop(1,ibox-1) - 325 & box_MISR_ztop(1,ibox+1) ) < 500325 & box_MISR_ztop(1,ibox+1) ) .lt. 500 326 326 & .and. 327 & box_MISR_ztop(1,ibox) <327 & box_MISR_ztop(1,ibox) .lt. 328 328 & box_MISR_ztop(1,ibox+1) ) then 329 329 … … 357 357 do ibox=1,ncol 358 358 359 if (tau(j,ibox) >(tauchk)) then359 if (tau(j,ibox) .gt. (tauchk)) then 360 360 box_cloudy(j,ibox)=.true. 361 361 endif … … 366 366 367 367 !determine optical depth category 368 if (tau(j,ibox) <isccp_taumin) then368 if (tau(j,ibox) .lt. isccp_taumin) then 369 369 itau=1 370 else if (tau(j,ibox) >= isccp_taumin371 & .and. tau(j,ibox) <1.3) then370 else if (tau(j,ibox) .ge. isccp_taumin 371 & .and. tau(j,ibox) .lt. 1.3) then 372 372 itau=2 373 else if (tau(j,ibox) >= 1.3374 & .and. tau(j,ibox) <3.6) then373 else if (tau(j,ibox) .ge. 1.3 374 & .and. tau(j,ibox) .lt. 3.6) then 375 375 itau=3 376 else if (tau(j,ibox) >= 3.6377 & .and. tau(j,ibox) <9.4) then376 else if (tau(j,ibox) .ge. 3.6 377 & .and. tau(j,ibox) .lt. 9.4) then 378 378 itau=4 379 else if (tau(j,ibox) >= 9.4380 & .and. tau(j,ibox) <23.) then379 else if (tau(j,ibox) .ge. 9.4 380 & .and. tau(j,ibox) .lt. 23.) then 381 381 itau=5 382 else if (tau(j,ibox) >= 23.383 & .and. tau(j,ibox) <60.) then382 else if (tau(j,ibox) .ge. 23. 383 & .and. tau(j,ibox) .lt. 60.) then 384 384 itau=6 385 else if (tau(j,ibox) >=60.) then385 else if (tau(j,ibox) .ge. 60.) then 386 386 itau=7 387 387 endif … … 390 390 391 391 ! update MISR histograms and summary metrics - roj 5/2005 392 if (sunlit(j) ==1) then392 if (sunlit(j).eq.1) then 393 393 394 394 !if cloudy added by roj 5/2005 395 if( box_MISR_ztop(j,ibox) ==0) then395 if( box_MISR_ztop(j,ibox).eq.0) then 396 396 397 397 ! no cloud detected 398 398 iMISR_ztop=0 399 399 400 elseif( box_MISR_ztop(j,ibox) ==-1) then400 elseif( box_MISR_ztop(j,ibox).eq.-1) then 401 401 402 402 ! cloud can be detected but too thin to get CTH … … 416 416 do loop=2,n_MISR_CTH 417 417 418 if ( box_MISR_ztop(j,ibox) >418 if ( box_MISR_ztop(j,ibox) .gt. 419 419 & 1000*MISR_CTH_boundaries(loop+1) ) then 420 420 … … 466 466 enddo ! ibox - loop over subcolumns 467 467 468 if( MISR_cldarea(j) >0.) then468 if( MISR_cldarea(j) .gt. 0.) then 469 469 MISR_mean_ztop(j)= MISR_mean_ztop(j) / MISR_cldarea(j) ! roj 5/2006 470 470 endif -
LMDZ6/branches/Amaury_dev/libf/phylmd/cosp/array_lib.F90
r5082 r5095 45 45 46 46 ! ----- INPUTS ----- 47 real (kind=8), dimension(:), intent(in) :: list48 real (kind=8), intent(in) :: val47 real*8, dimension(:), intent(in) :: list 48 real*8, intent(in) :: val 49 49 integer, intent(in), optional :: sort 50 50 51 51 ! ----- OUTPUTS ----- 52 integer (kind=4):: infind53 real (kind=8), intent(out), optional :: dist52 integer*4 :: infind 53 real*8, intent(out), optional :: dist 54 54 55 55 ! ----- INTERNAL ----- 56 real (kind=8), dimension(size(list)) :: lists57 integer (kind=4):: nlist, result, tmp(1), sort_list58 integer (kind=4), dimension(size(list)) :: mask, idx56 real*8, dimension(size(list)) :: lists 57 integer*4 :: nlist, result, tmp(1), sort_list 58 integer*4, dimension(size(list)) :: mask, idx 59 59 60 60 if (present(sort)) then … … 121 121 122 122 ! ----- INPUTS ----- 123 real (kind=8), dimension(:), intent(in) :: yarr, xarr, xxarr124 real (kind=8), intent(in) :: tol123 real*8, dimension(:), intent(in) :: yarr, xarr, xxarr 124 real*8, intent(in) :: tol 125 125 126 126 ! ----- OUTPUTS ----- 127 real (kind=8), dimension(size(xxarr)), intent(out) :: yyarr127 real*8, dimension(size(xxarr)), intent(out) :: yyarr 128 128 129 129 ! ----- INTERNAL ----- 130 real (kind=8), dimension(size(xarr)) :: ysort, xsort131 integer (kind=4), dimension(size(xarr)) :: ist132 integer (kind=4):: nx, nxx, i, iloc133 real (kind=8):: d, m130 real*8, dimension(size(xarr)) :: ysort, xsort 131 integer*4, dimension(size(xarr)) :: ist 132 integer*4 :: nx, nxx, i, iloc 133 real*8 :: d, m 134 134 135 135 nx = size(xarr) -
LMDZ6/branches/Amaury_dev/libf/phylmd/cosp/atmos_lib.F90
r5082 r5095 43 43 44 44 ! ----- OUTPUTS ----- 45 real (kind=8), intent(out), dimension(ndat) :: &45 real*8, intent(out), dimension(ndat) :: & 46 46 hgt, & ! height (m) 47 47 prs, & ! pressure (hPa) -
LMDZ6/branches/Amaury_dev/libf/phylmd/cosp/calc_Re.F90
r5082 r5095 40 40 ! ----- INPUTS ----- 41 41 42 real (kind=8), intent(in) :: Q,Np,rho_a42 real*8, intent(in) :: Q,Np,rho_a 43 43 44 44 integer, intent(in):: dtype 45 real (kind=8), intent(in) :: dmin,dmax,rho_c,p1,p2,p346 47 real (kind=8), intent(inout) :: apm,bpm45 real*8, intent(in) :: dmin,dmax,rho_c,p1,p2,p3 46 47 real*8, intent(inout) :: apm,bpm 48 48 49 49 ! ----- OUTPUTS ----- 50 50 51 real (kind=8), intent(out) :: Re51 real*8, intent(out) :: Re 52 52 53 53 ! ----- INTERNAL ----- 54 54 55 55 integer :: local_dtype 56 real (kind=8):: local_p3,local_Np57 58 real (kind=8):: pi, &56 real*8 :: local_p3,local_Np 57 58 real*8 :: pi, & 59 59 N0,D0,vu,dm,ld, & ! gamma, exponential variables 60 60 rg,log_sigma_g 61 61 62 real (kind=8):: tmp1,tmp262 real*8 :: tmp1,tmp2 63 63 64 64 pi = acos(-1.0) … … 72 72 ! Exponential is same as modified gamma with vu =1 73 73 ! if Np is specified then we will just treat as modified gamma 74 if(dtype ==2 .and. Np>0) then74 if(dtype.eq.2 .and. Np>0) then 75 75 local_dtype=1; 76 76 local_p3=1; … … 119 119 120 120 121 if( Np ==0 .and. p2+1 > 1E-8) then ! use default value for MEAN diameter as first default121 if( Np.eq.0 .and. p2+1 > 1E-8) then ! use default value for MEAN diameter as first default 122 122 123 123 dm = p2 ! by definition, should have units of microns … … 126 126 else ! use value of Np 127 127 128 if(Np ==0) then128 if(Np.eq.0) then 129 129 130 130 if( abs(p1+1) > 1E-8 ) then ! use default number concentration … … 233 233 234 234 ! get rg ... 235 if( Np ==0 .and. (abs(p2+1) > 1E-8) ) then ! use default value of rg235 if( Np.eq.0 .and. (abs(p2+1) > 1E-8) ) then ! use default value of rg 236 236 237 237 rg = p2 -
LMDZ6/branches/Amaury_dev/libf/phylmd/cosp/cosp_output_write_mod.F90
r5093 r5095 185 185 do k=1,PARASOL_NREFL 186 186 do ip=1, Npoints 187 if (stlidar%cldlayer(ip,4) >0.01.and.stlidar%parasolrefl(ip,k)/=missing_val) then187 if (stlidar%cldlayer(ip,4).gt.0.01.and.stlidar%parasolrefl(ip,k).ne.missing_val) then 188 188 parasolcrefl(ip,k)=(stlidar%parasolrefl(ip,k)-0.03*(1.-stlidar%cldlayer(ip,4)))/ & 189 189 stlidar%cldlayer(ip,4) … … 456 456 CHARACTER(LEN=20) :: typeecrit 457 457 458 ! ug On r écupère le type écrit de la structure:459 ! Assez moche, à refaire si meilleure méthode...458 ! ug On récupère le type écrit de la structure: 459 ! Assez moche, Ã| refaire si meilleure méthode... 460 460 IF (INDEX(var%cosp_typeecrit(iff), "once") > 0) THEN 461 461 typeecrit = 'once' … … 523 523 524 524 ! Axe vertical 525 IF (nvertsave ==nvertp(iff)) THEN525 IF (nvertsave.eq.nvertp(iff)) THEN 526 526 klevs=PARASOL_NREFL 527 527 nam_axvert="sza" 528 ELSE IF (nvertsave ==nvertisccp(iff)) THEN528 ELSE IF (nvertsave.eq.nvertisccp(iff)) THEN 529 529 klevs=7 530 530 nam_axvert="pressure2" 531 ELSE IF (nvertsave ==nvertcol(iff)) THEN531 ELSE IF (nvertsave.eq.nvertcol(iff)) THEN 532 532 klevs=Ncolout 533 533 nam_axvert="column" 534 ELSE IF (nvertsave ==nverttemp(iff)) THEN534 ELSE IF (nvertsave.eq.nverttemp(iff)) THEN 535 535 klevs=LIDAR_NTEMP 536 536 nam_axvert="temp" 537 ELSE IF (nvertsave ==nvertmisr(iff)) THEN537 ELSE IF (nvertsave.eq.nvertmisr(iff)) THEN 538 538 klevs=MISR_N_CTH 539 539 nam_axvert="cth16" 540 ELSE IF (nvertsave ==nvertReffIce(iff)) THEN540 ELSE IF (nvertsave.eq.nvertReffIce(iff)) THEN 541 541 klevs= numMODISReffIceBins 542 542 nam_axvert="ReffIce" 543 ELSE IF (nvertsave ==nvertReffLiq(iff)) THEN543 ELSE IF (nvertsave.eq.nvertReffLiq(iff)) THEN 544 544 klevs= numMODISReffLiqBins 545 545 nam_axvert="ReffLiq" … … 558 558 END IF 559 559 560 ! ug On r écupère le type écrit de la structure:561 ! Assez moche, à refaire si meilleure méthode...560 ! ug On récupère le type écrit de la structure: 561 ! Assez moche, Ã| refaire si meilleure méthode... 562 562 IF (INDEX(var%cosp_typeecrit(iff), "once") > 0) THEN 563 563 typeecrit = 'once' … … 628 628 IF (prt_level >= 9) WRITE(lunout,*)'Begin histrwrite2d ',var%name 629 629 630 ! On regarde si on est dans la phase de d éfinition ou d'écriture:630 ! On regarde si on est dans la phase de définition ou d'écriture: 631 631 IF(.NOT.cosp_varsdefined) THEN 632 632 !$OMP MASTER 633 !Si phase de d éfinition.... on définit633 !Si phase de définition.... on définit 634 634 CALL conf_cospoutputs(var%name,var%cles) 635 635 DO iff=1, 3 … … 640 640 !$OMP END MASTER 641 641 ELSE 642 !Et sinon on.... écrit642 !Et sinon on.... écrit 643 643 IF (SIZE(field)/=klon) & 644 644 CALL abort_physic('iophy::histwrite2d_cosp','Field first DIMENSION not equal to klon',1) … … 725 725 nom=var%name 726 726 END IF 727 ! On regarde si on est dans la phase de d éfinition ou d'écriture:727 ! On regarde si on est dans la phase de définition ou d'écriture: 728 728 IF(.NOT.cosp_varsdefined) THEN 729 !Si phase de d éfinition.... on définit729 !Si phase de définition.... on définit 730 730 !$OMP MASTER 731 731 CALL conf_cospoutputs(var%name,var%cles) … … 737 737 !$OMP END MASTER 738 738 ELSE 739 !Et sinon on.... écrit739 !Et sinon on.... écrit 740 740 IF (SIZE(field,1)/=klon) & 741 741 CALL abort_physic('iophy::histwrite3d','Field first DIMENSION not equal to klon',1) … … 809 809 810 810 IF(cosp_varsdefined) THEN 811 !Et sinon on.... écrit811 !Et sinon on.... écrit 812 812 IF (SIZE(field,1)/=klon) & 813 813 CALL abort_physic('iophy::histwrite3d','Field first DIMENSION not equal to klon',1) -
LMDZ6/branches/Amaury_dev/libf/phylmd/cosp/dsd.F90
r5082 r5095 60 60 integer, intent(in) :: nsizes 61 61 integer, intent(in) :: dtype 62 real (kind=8), intent(in) :: Q,Re_,Np,D(nsizes)63 real (kind=8), intent(in) :: rho_a,tk,dmin,dmax,rho_c,p1,p2,p364 65 real (kind=8), intent(inout) :: apm,bpm62 real*8, intent(in) :: Q,Re_,Np,D(nsizes) 63 real*8, intent(in) :: rho_a,tk,dmin,dmax,rho_c,p1,p2,p3 64 65 real*8, intent(inout) :: apm,bpm 66 66 67 67 ! ----- OUTPUTS ----- 68 68 69 real (kind=8), intent(out) :: N(nsizes)69 real*8, intent(out) :: N(nsizes) 70 70 71 71 ! ----- INTERNAL ----- 72 72 73 real (kind=8):: fc(nsizes)74 75 real (kind=8):: &73 real*8 :: fc(nsizes) 74 75 real*8 :: & 76 76 N0,D0,vu,local_np,dm,ld, & ! gamma, exponential variables 77 77 dmin_mm,dmax_mm,ahp,bhp, & ! power law variables … … 79 79 rho_e ! particle density (kg m^-3) 80 80 81 real (kind=8):: tmp1, tmp282 real (kind=8):: pi,rc,tc83 real (kind=8):: Re81 real*8 :: tmp1, tmp2 82 real*8 :: pi,rc,tc 83 real*8 :: Re 84 84 85 85 integer k,lidx,uidx … … 352 352 log_sigma_g = p3 353 353 tmp2 = (bpm*log_sigma_g)**2. 354 if(Re <=0) then354 if(Re.le.0) then 355 355 rg = p2 356 356 else -
LMDZ6/branches/Amaury_dev/libf/phylmd/cosp/format_input.F90
r5082 r5095 40 40 41 41 ! ----- INPUTS ----- 42 real (kind=8), dimension(:,:), intent(in) :: &42 real*8, dimension(:,:), intent(in) :: & 43 43 hgt_matrix,env_hgt_matrix,env_t_matrix,env_p_matrix,env_rh_matrix 44 44 45 45 ! ----- OUTPUTS ----- 46 real (kind=8), dimension(:,:), intent(out) :: &46 real*8, dimension(:,:), intent(out) :: & 47 47 t_matrix,p_matrix,rh_matrix 48 48 … … 97 97 98 98 ! ----- OUTPUTS ----- 99 real (kind=8), dimension(:,:), intent(inout) :: &99 real*8, dimension(:,:), intent(inout) :: & 100 100 hgt_matrix,p_matrix,t_matrix,rh_matrix 101 real (kind=8), dimension(:,:,:), intent(inout) :: &101 real*8, dimension(:,:,:), intent(inout) :: & 102 102 hm_matrix 103 103 logical, intent(out) :: hgt_reversed -
LMDZ6/branches/Amaury_dev/libf/phylmd/cosp/gases.F90
r5082 r5095 27 27 nbands_o2 = 48 ,& 28 28 nbands_h2o = 30 29 real (kind=8), intent(in) :: PRES_mb, T, RH, f30 real (kind=8):: gases, th, e, p, sumo, gm0, a0, ap, term1, term2, term3, &29 real*8, intent(in) :: PRES_mb, T, RH, f 30 real*8 :: gases, th, e, p, sumo, gm0, a0, ap, term1, term2, term3, & 31 31 bf, be, term4, npp 32 real (kind=8), dimension(nbands_o2) :: v0, a1, a2, a3, a4, a5, a633 real (kind=8), dimension(nbands_h2o) :: v1, b1, b2, b334 real (kind=8):: e_th,one_th,pth3,eth35,aux1,aux2,aux3,aux435 real (kind=8):: gm,delt,x,y,gm236 real (kind=8):: fpp_o2,fpp_h2o,s_o2,s_h2o32 real*8, dimension(nbands_o2) :: v0, a1, a2, a3, a4, a5, a6 33 real*8, dimension(nbands_h2o) :: v1, b1, b2, b3 34 real*8 :: e_th,one_th,pth3,eth35,aux1,aux2,aux3,aux4 35 real*8 :: gm,delt,x,y,gm2 36 real*8 :: fpp_o2,fpp_h2o,s_o2,s_h2o 37 37 integer :: i 38 38 -
LMDZ6/branches/Amaury_dev/libf/phylmd/cosp/icarus.F
r5086 r5095 293 293 ncolprint=0 294 294 295 if ( debug /=0 ) then295 if ( debug.ne.0 ) then 296 296 j=1 297 297 write(6,'(a10)') 'j=' … … 347 347 ! ---------------------------------------------------! 348 348 349 if (ncolprint /=0) then349 if (ncolprint.ne.0) then 350 350 do j=1,npoints,1000 351 351 write(6,'(a10)') 'j=' … … 354 354 endif 355 355 356 if (top_height == 1 .or. top_height == 3) then356 if (top_height .eq. 1 .or. top_height .eq. 3) then 357 357 358 358 do j=1,npoints … … 364 364 enddo 365 365 366 do ilev=1,nlev366 do 12 ilev=1,nlev 367 367 do j=1,npoints 368 if (pfull(j,ilev) <40000. .and.369 & pfull(j,ilev) >5000. .and.370 & at(j,ilev) <attropmin(j)) then368 if (pfull(j,ilev) .lt. 40000. .and. 369 & pfull(j,ilev) .gt. 5000. .and. 370 & at(j,ilev) .lt. attropmin(j)) then 371 371 ptrop(j) = pfull(j,ilev) 372 372 attropmin(j) = at(j,ilev) … … 375 375 end if 376 376 enddo 377 END DO 378 379 do ilev=1,nlev377 12 continue 378 379 do 13 ilev=1,nlev 380 380 do j=1,npoints 381 if (at(j,ilev) >atmax(j) .and.382 & ilev >=itrop(j)) atmax(j)=at(j,ilev)383 enddo 384 END DO 381 if (at(j,ilev) .gt. atmax(j) .and. 382 & ilev .ge. itrop(j)) atmax(j)=at(j,ilev) 383 enddo 384 13 continue 385 385 386 386 end if 387 387 388 388 389 if (top_height == 1 .or. top_height ==3) then389 if (top_height .eq. 1 .or. top_height .eq. 3) then 390 390 do j=1,npoints 391 391 meantb(j) = 0. 392 392 meantbclr(j) = 0. 393 END DO393 end do 394 394 else 395 395 do j=1,npoints 396 396 meantb(j) = output_missing_value 397 397 meantbclr(j) = output_missing_value 398 END DO398 end do 399 399 end if 400 400 … … 408 408 rangevec(j)=0 409 409 410 if (cc(j,ilev) < 0. .or. cc(j,ilev) >1.) then410 if (cc(j,ilev) .lt. 0. .or. cc(j,ilev) .gt. 1.) then 411 411 ! error = cloud fraction less than zero 412 412 ! error = cloud fraction greater than 1 … … 414 414 endif 415 415 416 if (conv(j,ilev) < 0. .or. conv(j,ilev) >1.) then416 if (conv(j,ilev) .lt. 0. .or. conv(j,ilev) .gt. 1.) then 417 417 ! ' error = convective cloud fraction less than zero' 418 418 ! ' error = convective cloud fraction greater than 1' … … 420 420 endif 421 421 422 if (dtau_s(j,ilev) <0.) then422 if (dtau_s(j,ilev) .lt. 0.) then 423 423 ! ' error = stratiform cloud opt. depth less than zero' 424 424 rangevec(j)=rangevec(j)+4 425 425 endif 426 426 427 if (dtau_c(j,ilev) <0.) then427 if (dtau_c(j,ilev) .lt. 0.) then 428 428 ! ' error = convective cloud opt. depth less than zero' 429 429 rangevec(j)=rangevec(j)+8 430 430 endif 431 431 432 if (dem_s(j,ilev) < 0. .or. dem_s(j,ilev) >1.) then432 if (dem_s(j,ilev) .lt. 0. .or. dem_s(j,ilev) .gt. 1.) then 433 433 ! ' error = stratiform cloud emissivity less than zero' 434 434 ! ' error = stratiform cloud emissivity greater than 1' … … 436 436 endif 437 437 438 if (dem_c(j,ilev) < 0. .or. dem_c(j,ilev) >1.) then438 if (dem_c(j,ilev) .lt. 0. .or. dem_c(j,ilev) .gt. 1.) then 439 439 ! ' error = convective cloud emissivity less than zero' 440 440 ! ' error = convective cloud emissivity greater than 1' … … 448 448 enddo 449 449 450 if (rangeerror /=0) then450 if (rangeerror.ne.0) then 451 451 write (6,*) 'Input variable out of range' 452 452 write (6,*) 'rangevec:' … … 466 466 467 467 !initialize tau and albedocld to zero 468 do ibox=1,ncol468 do 15 ibox=1,ncol 469 469 do j=1,npoints 470 470 tau(j,ibox)=0. … … 474 474 box_cloudy(j,ibox)=.false. 475 475 enddo 476 END DO 476 15 continue 477 477 478 478 !compute total cloud optical depth for each column … … 481 481 do ibox=1,ncol 482 482 do j=1,npoints 483 if (frac_out(j,ibox,ilev) ==1) then483 if (frac_out(j,ibox,ilev).eq.1) then 484 484 tau(j,ibox)=tau(j,ibox) 485 485 & + dtau_s(j,ilev) 486 486 endif 487 if (frac_out(j,ibox,ilev) ==2) then487 if (frac_out(j,ibox,ilev).eq.2) then 488 488 tau(j,ibox)=tau(j,ibox) 489 489 & + dtau_c(j,ilev) … … 492 492 enddo ! ibox 493 493 enddo ! ilev 494 if (ncolprint /=0) then494 if (ncolprint.ne.0) then 495 495 496 496 do j=1,npoints ,1000 … … 521 521 ! sky versions of these quantities. 522 522 523 if (top_height == 1 .or. top_height ==3) then523 if (top_height .eq. 1 .or. top_height .eq. 3) then 524 524 525 525 … … 539 539 pstd = 1.013250E+06 540 540 t0 = 296. 541 if (ncolprint /= 0)541 if (ncolprint .ne. 0) 542 542 & write(6,*) 'ilev pw (kg/m2) tauwv(j) dem_wv' 543 do ilev=1,nlev543 do 125 ilev=1,nlev 544 544 do j=1,npoints 545 545 !press and dpress are dyne/cm2 = Pascals *10 … … 559 559 dem_wv(j,ilev) = 1. - exp( -1. * tauwv(j)) 560 560 enddo 561 if (ncolprint /=0) then561 if (ncolprint .ne. 0) then 562 562 do j=1,npoints ,1000 563 563 write(6,'(a10)') 'j=' … … 568 568 enddo 569 569 endif 570 END DO 570 125 continue 571 571 572 572 !initialize variables … … 598 598 599 599 enddo 600 if (ncolprint /=0) then600 if (ncolprint.ne.0) then 601 601 do j=1,npoints ,1000 602 602 write(6,'(a10)') 'j=' … … 627 627 enddo 628 628 629 if (ncolprint /=0) then629 if (ncolprint.ne.0) then 630 630 do j=1,npoints ,1000 631 631 write(6,'(a10)') 'j=' … … 649 649 650 650 651 if (ncolprint /=0) then651 if (ncolprint.ne.0) then 652 652 653 653 do j=1,npoints ,1000 … … 683 683 684 684 ! emissivity for point in this layer 685 if (frac_out(j,ibox,ilev) ==1) then685 if (frac_out(j,ibox,ilev).eq.1) then 686 686 dem(j,ibox)= 1. - 687 687 & ( (1. - dem_wv(j,ilev)) * (1. - dem_s(j,ilev)) ) 688 else if (frac_out(j,ibox,ilev) ==2) then688 else if (frac_out(j,ibox,ilev).eq.2) then 689 689 dem(j,ibox)= 1. - 690 690 & ( (1. - dem_wv(j,ilev)) * (1. - dem_c(j,ilev)) ) … … 710 710 enddo ! ibox 711 711 712 if (ncolprint /=0) then712 if (ncolprint.ne.0) then 713 713 do j=1,npoints,1000 714 714 write (6,'(a)') 'ilev:' … … 740 740 bb(j)=1/( exp(1307.27/skt(j)) - 1. ) 741 741 !bb(j)=5.67e-8*skt(j)**4 742 END DO742 end do 743 743 744 744 do ibox=1,ncol … … 751 751 & * trans_layers_above(j,ibox) 752 752 753 END DO754 END DO753 end do 754 end do 755 755 756 756 !calculate mean infrared brightness temperature … … 758 758 do j=1,npoints 759 759 meantb(j) = meantb(j)+1307.27/(log(1.+(1./fluxtop(j,ibox)))) 760 END DO761 END DO760 end do 761 end do 762 762 do j=1, npoints 763 763 meantb(j) = meantb(j) / real(ncol) 764 END DO765 766 if (ncolprint /=0) then764 end do 765 766 if (ncolprint.ne.0) then 767 767 768 768 do j=1,npoints ,1000 … … 784 784 write (6,'(8f7.2)') (meantb(j),ibox=1,ncolprint) 785 785 786 END DO786 end do 787 787 endif 788 788 … … 819 819 enddo 820 820 821 if (top_height ==1) then821 if (top_height .eq. 1) then 822 822 do j=1,npoints 823 if (transmax(j) > 0.001 .and.824 & transmax(j) <=0.9999999) then823 if (transmax(j) .gt. 0.001 .and. 824 & transmax(j) .le. 0.9999999) then 825 825 fluxtopinit(j) = fluxtop(j,ibox) 826 826 tauir(j) = tau(j,ibox) *rec2p13 … … 829 829 do icycle=1,2 830 830 do j=1,npoints 831 if (tau(j,ibox) > (tauchk )) then832 if (transmax(j) > 0.001 .and.833 & transmax(j) <=0.9999999) then831 if (tau(j,ibox) .gt. (tauchk )) then 832 if (transmax(j) .gt. 0.001 .and. 833 & transmax(j) .le. 0.9999999) then 834 834 emcld(j,ibox) = 1. - exp(-1. * tauir(j) ) 835 835 fluxtop(j,ibox) = fluxtopinit(j) - … … 839 839 tb(j,ibox)= 1307.27 840 840 & / (log(1. + (1./fluxtop(j,ibox)))) 841 if (tb(j,ibox) >260.) then841 if (tb(j,ibox) .gt. 260.) then 842 842 tauir(j) = tau(j,ibox) / 2.56 843 843 end if … … 850 850 851 851 do j=1,npoints 852 if (tau(j,ibox) > (tauchk )) then852 if (tau(j,ibox) .gt. (tauchk )) then 853 853 !cloudy box 854 854 !NOTE: tb is the cloud-top temperature not infrared brightness temperature 855 855 !at this point in the code 856 856 tb(j,ibox)= 1307.27/ (log(1. + (1./fluxtop(j,ibox)))) 857 if (top_height ==1.and.tauir(j)<taumin(j)) then857 if (top_height.eq.1.and.tauir(j).lt.taumin(j)) then 858 858 tb(j,ibox) = attrop(j) - 5. 859 859 tau(j,ibox) = 2.13*taumin(j) … … 866 866 enddo ! ibox 867 867 868 if (ncolprint /=0) then868 if (ncolprint.ne.0) then 869 869 870 870 do j=1,npoints,1000 … … 925 925 926 926 !compute cloud top pressure 927 do ibox=1,ncol927 do 30 ibox=1,ncol 928 928 !segregate according to optical thickness 929 if (top_height == 1 .or. top_height == 3) then929 if (top_height .eq. 1 .or. top_height .eq. 3) then 930 930 !find level whose temperature 931 931 !most closely matches brightness temperature … … 933 933 nmatch(j)=0 934 934 enddo 935 do k1=1,nlev-1936 if (top_height_direction ==2) then935 do 29 k1=1,nlev-1 936 if (top_height_direction .eq. 2) then 937 937 ilev = nlev - k1 938 938 else … … 941 941 !cdir nodep 942 942 do j=1,npoints 943 if (ilev >=itrop(j)) then944 if ((at(j,ilev) >= tb(j,ibox) .and.945 & at(j,ilev+1) <=tb(j,ibox)) .or.946 & (at(j,ilev) <= tb(j,ibox) .and.947 & at(j,ilev+1) >= tb(j,ibox))) then943 if (ilev .ge. itrop(j)) then 944 if ((at(j,ilev) .ge. tb(j,ibox) .and. 945 & at(j,ilev+1) .le. tb(j,ibox)) .or. 946 & (at(j,ilev) .le. tb(j,ibox) .and. 947 & at(j,ilev+1) .ge. tb(j,ibox))) then 948 948 nmatch(j)=nmatch(j)+1 949 949 match(j,nmatch(j))=ilev … … 951 951 end if 952 952 enddo 953 END DO 953 29 continue 954 954 955 955 do j=1,npoints 956 if (nmatch(j) >=1) then956 if (nmatch(j) .ge. 1) then 957 957 k1 = match(j,nmatch(j)) 958 958 k2 = k1 + 1 … … 962 962 logp=logp1+(logp2-logp1)*abs(tb(j,ibox)-at(j,k1))/atd 963 963 ptop(j,ibox) = exp(logp) 964 if(abs(pfull(j,k1)-ptop(j,ibox)) <964 if(abs(pfull(j,k1)-ptop(j,ibox)) .lt. 965 965 & abs(pfull(j,k2)-ptop(j,ibox))) then 966 966 levmatch(j,ibox)=k1 … … 969 969 end if 970 970 else 971 if (tb(j,ibox) <=attrop(j)) then971 if (tb(j,ibox) .le. attrop(j)) then 972 972 ptop(j,ibox)=ptrop(j) 973 973 levmatch(j,ibox)=itrop(j) 974 974 end if 975 if (tb(j,ibox) >=atmax(j)) then975 if (tb(j,ibox) .ge. atmax(j)) then 976 976 ptop(j,ibox)=pfull(j,nlev) 977 977 levmatch(j,ibox)=nlev … … 987 987 do ilev=1,nlev 988 988 do j=1,npoints 989 if ((ptop(j,ibox) ==0. )990 & .and.(frac_out(j,ibox,ilev) /=0)) then989 if ((ptop(j,ibox) .eq. 0. ) 990 & .and.(frac_out(j,ibox,ilev) .ne. 0)) then 991 991 ptop(j,ibox)=phalf(j,ilev) 992 992 levmatch(j,ibox)=ilev 993 993 end if 994 END DO995 END DO994 end do 995 end do 996 996 end if 997 997 998 998 do j=1,npoints 999 if (tau(j,ibox) <=(tauchk )) then999 if (tau(j,ibox) .le. (tauchk )) then 1000 1000 ptop(j,ibox)=0. 1001 1001 levmatch(j,ibox)=0 … … 1003 1003 enddo 1004 1004 1005 END DO 1005 30 continue 1006 1006 1007 1007 ! … … 1032 1032 1033 1033 !reset frequencies 1034 do ilev=1,71034 do 38 ilev=1,7 1035 1035 do 38 ilev2=1,7 1036 1036 do j=1,npoints ! 1037 if (sunlit(j) ==1 .or. top_height == 3) then1037 if (sunlit(j).eq.1 .or. top_height .eq. 3) then 1038 1038 fq_isccp(j,ilev,ilev2)= 0. 1039 1039 else … … 1042 1042 enddo 1043 1043 38 continue 1044 END DO1045 1044 1046 1045 !reset variables need for averaging cloud properties 1047 1046 do j=1,npoints 1048 if (sunlit(j) ==1 .or. top_height == 3) then1047 if (sunlit(j).eq.1 .or. top_height .eq. 3) then 1049 1048 totalcldarea(j) = 0. 1050 1049 meanalbedocld(j) = 0. … … 1061 1060 boxarea = 1./real(ncol) 1062 1061 1063 do ibox=1,ncol1062 do 39 ibox=1,ncol 1064 1063 do j=1,npoints 1065 1064 1066 if (tau(j,ibox) >(tauchk )1067 & .and. ptop(j,ibox) >0.) then1065 if (tau(j,ibox) .gt. (tauchk ) 1066 & .and. ptop(j,ibox) .gt. 0.) then 1068 1067 box_cloudy(j,ibox)=.true. 1069 1068 endif … … 1071 1070 if (box_cloudy(j,ibox)) then 1072 1071 1073 if (sunlit(j) ==1 .or. top_height ==3) then1072 if (sunlit(j).eq.1 .or. top_height .eq. 3) then 1074 1073 1075 1074 boxtau(j,ibox) = tau(j,ibox) 1076 1075 1077 if (tau(j,ibox) >=isccp_taumin) then1076 if (tau(j,ibox) .ge. isccp_taumin) then 1078 1077 totalcldarea(j) = totalcldarea(j) + boxarea 1079 1078 … … 1092 1091 endif 1093 1092 1094 if (sunlit(j) ==1 .or. top_height == 3) then1093 if (sunlit(j).eq.1 .or. top_height .eq. 3) then 1095 1094 1096 1095 if (box_cloudy(j,ibox)) then … … 1102 1101 boxptop(j,ibox) = ptop(j,ibox) 1103 1102 1104 if (tau(j,ibox) >=isccp_taumin) then1103 if (tau(j,ibox) .ge. isccp_taumin) then 1105 1104 meanptop(j) = meanptop(j) + ptop(j,ibox)*boxarea 1106 1105 end if … … 1111 1110 1112 1111 !determine optical depth category 1113 if (tau(j,ibox) <isccp_taumin) then1112 if (tau(j,ibox) .lt. isccp_taumin) then 1114 1113 itau(j)=1 1115 else if (tau(j,ibox) >=isccp_taumin1114 else if (tau(j,ibox) .ge. isccp_taumin 1116 1115 & 1117 & .and. tau(j,ibox) <1.3) then1116 & .and. tau(j,ibox) .lt. 1.3) then 1118 1117 itau(j)=2 1119 else if (tau(j,ibox) >= 1.31120 & .and. tau(j,ibox) <3.6) then1118 else if (tau(j,ibox) .ge. 1.3 1119 & .and. tau(j,ibox) .lt. 3.6) then 1121 1120 itau(j)=3 1122 else if (tau(j,ibox) >= 3.61123 & .and. tau(j,ibox) <9.4) then1121 else if (tau(j,ibox) .ge. 3.6 1122 & .and. tau(j,ibox) .lt. 9.4) then 1124 1123 itau(j)=4 1125 else if (tau(j,ibox) >= 9.41126 & .and. tau(j,ibox) <23.) then1124 else if (tau(j,ibox) .ge. 9.4 1125 & .and. tau(j,ibox) .lt. 23.) then 1127 1126 itau(j)=5 1128 else if (tau(j,ibox) >= 23.1129 & .and. tau(j,ibox) <60.) then1127 else if (tau(j,ibox) .ge. 23. 1128 & .and. tau(j,ibox) .lt. 60.) then 1130 1129 itau(j)=6 1131 else if (tau(j,ibox) >=60.) then1130 else if (tau(j,ibox) .ge. 60.) then 1132 1131 itau(j)=7 1133 1132 end if 1134 1133 1135 1134 !determine cloud top pressure category 1136 if ( ptop(j,ibox) > 0.1137 & .and.ptop(j,ibox) <180.) then1135 if ( ptop(j,ibox) .gt. 0. 1136 & .and.ptop(j,ibox) .lt. 180.) then 1138 1137 ipres(j)=1 1139 else if(ptop(j,ibox) >=180.1140 & .and.ptop(j,ibox) <310.) then1138 else if(ptop(j,ibox) .ge. 180. 1139 & .and.ptop(j,ibox) .lt. 310.) then 1141 1140 ipres(j)=2 1142 else if(ptop(j,ibox) >=310.1143 & .and.ptop(j,ibox) <440.) then1141 else if(ptop(j,ibox) .ge. 310. 1142 & .and.ptop(j,ibox) .lt. 440.) then 1144 1143 ipres(j)=3 1145 else if(ptop(j,ibox) >=440.1146 & .and.ptop(j,ibox) <560.) then1144 else if(ptop(j,ibox) .ge. 440. 1145 & .and.ptop(j,ibox) .lt. 560.) then 1147 1146 ipres(j)=4 1148 else if(ptop(j,ibox) >=560.1149 & .and.ptop(j,ibox) <680.) then1147 else if(ptop(j,ibox) .ge. 560. 1148 & .and.ptop(j,ibox) .lt. 680.) then 1150 1149 ipres(j)=5 1151 else if(ptop(j,ibox) >=680.1152 & .and.ptop(j,ibox) <800.) then1150 else if(ptop(j,ibox) .ge. 680. 1151 & .and.ptop(j,ibox) .lt. 800.) then 1153 1152 ipres(j)=6 1154 else if(ptop(j,ibox) >=800.) then1153 else if(ptop(j,ibox) .ge. 800.) then 1155 1154 ipres(j)=7 1156 1155 end if 1157 1156 1158 1157 !update frequencies 1159 if(ipres(j) > 0.and.itau(j) >0) then1158 if(ipres(j) .gt. 0.and.itau(j) .gt. 0) then 1160 1159 fq_isccp(j,itau(j),ipres(j))= 1161 1160 & fq_isccp(j,itau(j),ipres(j))+ boxarea … … 1167 1166 1168 1167 enddo ! j 1169 END DO 1168 39 continue 1170 1169 1171 1170 !compute mean cloud properties 1172 1171 do j=1,npoints 1173 if (totalcldarea(j) >0.) then1172 if (totalcldarea(j) .gt. 0.) then 1174 1173 ! code above guarantees that totalcldarea > 0 1175 1174 ! only if sunlit .eq. 1 .or. top_height = 3 … … 1194 1193 ! OPTIONAL PRINTOUT OF DATA TO CHECK PROGRAM 1195 1194 ! 1196 if (debugcol /=0) then1195 if (debugcol.ne.0) then 1197 1196 ! 1198 1197 do j=1,npoints,debugcol … … 1208 1207 do ibox=1,ncol 1209 1208 acc(ilev,ibox)=frac_out(j,ibox,ilev)*2 1210 if (levmatch(j,ibox) == ilev)1209 if (levmatch(j,ibox) .eq. ilev) 1211 1210 & acc(ilev,ibox)=acc(ilev,ibox)+1 1212 1211 enddo … … 1228 1227 & (cchar_realtops(acc(ilev,ibox)+1),ilev=1,nlev) 1229 1228 & ,(cchar(acc(ilev,ibox)+1),ilev=1,nlev) 1230 END DO1229 end do 1231 1230 close(9) 1232 1231 1233 if (ncolprint /=0) then1232 if (ncolprint.ne.0) then 1234 1233 write(6,'(a1)') ' ' 1235 1234 write(6,'(a2,1X,5(a7,1X),a50)') -
LMDZ6/branches/Amaury_dev/libf/phylmd/cosp/lidar_simulator.F90
r5093 r5095 247 247 !------------------------------------------------------------ 248 248 249 if ( npart /=4 ) then249 if ( npart .ne. 4 ) then 250 250 print *,'Error in lidar_simulator, npart should be 4, not',npart 251 251 stop … … 267 267 polpart(INDX_LSLIQ,5) = 0.0626 268 268 !* LS Ice coefficients: 269 if (ice_type ==0) then269 if (ice_type.eq.0) then 270 270 polpart(INDX_LSICE,1) = -1.0176e-8 271 271 polpart(INDX_LSICE,2) = 1.7615e-6 … … 275 275 endif 276 276 !* LS Ice NS coefficients: 277 if (ice_type ==1) then277 if (ice_type.eq.1) then 278 278 polpart(INDX_LSICE,1) = 1.3615e-8 279 279 polpart(INDX_LSICE,2) = -2.04206e-6 … … 289 289 polpart(INDX_CVLIQ,5) = 0.0626 290 290 !* CONV Ice coefficients: 291 if (ice_type ==0) then291 if (ice_type.eq.0) then 292 292 polpart(INDX_CVICE,1) = -1.0176e-8 293 293 polpart(INDX_CVICE,2) = 1.7615e-6 … … 296 296 polpart(INDX_CVICE,5) = 0.0460 297 297 endif 298 if (ice_type ==1) then298 if (ice_type.eq.1) then 299 299 polpart(INDX_CVICE,1) = 1.3615e-8 300 300 polpart(INDX_CVICE,2) = -2.04206e-6 … … 342 342 ! polynomes kp_lidar derived from Mie theory: 343 343 do i = 1, npart 344 where ( rad_part(:,:,i) >0.0)344 where ( rad_part(:,:,i).gt.0.0) 345 345 kp_part(:,:,i) = & 346 346 polpart(i,1)*(rad_part(:,:,i)*1e6)**4 & … … 362 362 ! alpha of particles in each subcolumn: 363 363 do i = 1, npart 364 where ( rad_part(:,:,i) >0.0)364 where ( rad_part(:,:,i).gt.0.0) 365 365 alpha_part(:,:,i) = 3.0/4.0 * Qscat & 366 366 * rhoair(:,:) * qpart(:,:,i) & … … 378 378 ! opt. thick of each layer 379 379 tau_mol(:,1:nlev) = alpha_mol(:,1:nlev) & 380 *(zheight(:,2:nlev+1)-zheight(:,1:nlev))380 & *(zheight(:,2:nlev+1)-zheight(:,1:nlev)) 381 381 ! opt. thick from TOA 382 382 DO k = nlev-1, 1, -1 … … 390 390 ! opt. thick of each layer 391 391 tau_part(:,:,i) = tau_part(:,:,i) & 392 * (zheight(:,2:nlev+1)-zheight(:,1:nlev) )392 & * (zheight(:,2:nlev+1)-zheight(:,1:nlev) ) 393 393 ! opt. thick from TOA 394 394 DO k = nlev-1, 1, -1 … … 400 400 ! Upper layer 401 401 pmol(:,nlev) = beta_mol(:,nlev) / (2.*tau_mol(:,nlev)) & 402 * (1.-exp(-2.0*tau_mol(:,nlev)))402 & * (1.-exp(-2.0*tau_mol(:,nlev))) 403 403 ! Other layers 404 404 DO k= nlev-1, 1, -1 405 405 tau_mol_lay(:) = tau_mol(:,k)-tau_mol(:,k+1) ! opt. thick. of layer k 406 WHERE (tau_mol_lay(:) >0.)406 WHERE (tau_mol_lay(:).GT.0.) 407 407 pmol(:,k) = beta_mol(:,k) * EXP(-2.0*tau_mol(:,k+1)) / (2.*tau_mol_lay(:)) & 408 * (1.-exp(-2.0*tau_mol_lay(:)))408 & * (1.-exp(-2.0*tau_mol_lay(:))) 409 409 ELSEWHERE 410 410 ! This must never happend, but just in case, to avoid div. by 0 … … 429 429 ! Upper layer 430 430 pnorm(:,nlev) = betatot(:,nlev) / (2.*tautot(:,nlev)) & 431 * (1.-exp(-2.0*tautot(:,nlev)))431 & * (1.-exp(-2.0*tautot(:,nlev))) 432 432 433 433 ! Other layers 434 434 DO k= nlev-1, 1, -1 435 435 tautot_lay(:) = tautot(:,k)-tautot(:,k+1) ! optical thickness of layer k 436 WHERE (tautot_lay(:) >0.)436 WHERE (tautot_lay(:).GT.0.) 437 437 pnorm(:,k) = betatot(:,k) * EXP(-2.0*tautot(:,k+1)) / (2.*tautot_lay(:)) & 438 * (1.-EXP(-2.0*tautot_lay(:)))438 & * (1.-EXP(-2.0*tautot_lay(:))) 439 439 ELSEWHERE 440 440 ! This must never happend, but just in case, to avoid div. by 0 … … 468 468 ! Upper layer 469 469 pnorm_ice(:,nlev) = betatot_ice(:,nlev) / (2.*tautot_ice(:,nlev)) & 470 * (1.-exp(-2.0*tautot_ice(:,nlev)))470 & * (1.-exp(-2.0*tautot_ice(:,nlev))) 471 471 472 472 DO k= nlev-1, 1, -1 473 473 tautot_lay_ice(:) = tautot_ice(:,k)-tautot_ice(:,k+1) 474 WHERE (tautot_lay_ice(:) >0.)474 WHERE (tautot_lay_ice(:).GT.0.) 475 475 pnorm_ice(:,k)=betatot_ice(:,k)*EXP(-2.0*tautot_ice(:,k+1))/(2.*tautot_lay_ice(:)) & 476 * (1.-EXP(-2.0*tautot_lay_ice(:)))476 & * (1.-EXP(-2.0*tautot_lay_ice(:))) 477 477 ELSEWHERE 478 478 pnorm_ice(:,k)=betatot_ice(:,k)*EXP(-2.0*tautot_ice(:,k+1)) … … 483 483 ! Upper layer 484 484 pnorm_liq(:,nlev) = betatot_liq(:,nlev) / (2.*tautot_liq(:,nlev)) & 485 * (1.-exp(-2.0*tautot_liq(:,nlev)))485 & * (1.-exp(-2.0*tautot_liq(:,nlev))) 486 486 487 487 DO k= nlev-1, 1, -1 488 488 tautot_lay_liq(:) = tautot_liq(:,k)-tautot_liq(:,k+1) 489 WHERE (tautot_lay_liq(:) >0.)489 WHERE (tautot_lay_liq(:).GT.0.) 490 490 pnorm_liq(:,k)=betatot_liq(:,k)*EXP(-2.0*tautot_liq(:,k+1))/(2.*tautot_lay_liq(:)) & 491 * (1.-EXP(-2.0*tautot_lay_liq(:)))491 & * (1.-EXP(-2.0*tautot_lay_liq(:))) 492 492 ELSEWHERE 493 493 pnorm_liq(:,k)=betatot_liq(:,k)*EXP(-2.0*tautot_liq(:,k+1)) … … 510 510 ! Upper layer 511 511 beta_perp_ice(:,nlev) = pnorm_perp_ice(:,nlev) * (2.*tautot_ice(:,nlev)) & 512 / (1.-exp(-2.0*tautot_ice(:,nlev)))512 & / (1.-exp(-2.0*tautot_ice(:,nlev))) 513 513 514 514 DO k= nlev-1, 1, -1 515 515 tautot_lay_ice(:) = tautot_ice(:,k)-tautot_ice(:,k+1) 516 WHERE (tautot_lay_ice(:) >0.)516 WHERE (tautot_lay_ice(:).GT.0.) 517 517 beta_perp_ice(:,k) = pnorm_perp_ice(:,k)/ EXP(-2.0*tautot_ice(:,k+1)) * (2.*tautot_lay_ice(:)) & 518 / (1.-exp(-2.0*tautot_lay_ice(:)))518 & / (1.-exp(-2.0*tautot_lay_ice(:))) 519 519 520 520 ELSEWHERE … … 526 526 ! Upper layer 527 527 beta_perp_liq(:,nlev) = pnorm_perp_liq(:,nlev) * (2.*tautot_liq(:,nlev)) & 528 / (1.-exp(-2.0*tautot_liq(:,nlev)))528 & / (1.-exp(-2.0*tautot_liq(:,nlev))) 529 529 530 530 DO k= nlev-1, 1, -1 531 531 tautot_lay_liq(:) = tautot_liq(:,k)-tautot_liq(:,k+1) 532 WHERE (tautot_lay_liq(:) >0.)532 WHERE (tautot_lay_liq(:).GT.0.) 533 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(:)))534 & * (2.*tautot_lay_liq(:)) / (1.-exp(-2.0*tautot_lay_liq(:))) 535 535 536 536 ELSEWHERE … … 547 547 ! Computation of the total perpendicular lidar signal (ATBperp for liq+ice) 548 548 ! Upper layer 549 WHERE(tautot(:,nlev) >0)549 WHERE(tautot(:,nlev).GT.0) 550 550 pnorm_perp_tot(:,nlev) = & 551 551 (beta_perp_ice(:,nlev)+beta_perp_liq(:,nlev)-(beta_mol(:,nlev)/(1+1/0.0284))) / (2.*tautot(:,nlev)) & 552 * (1.-exp(-2.0*tautot(:,nlev)))552 & * (1.-exp(-2.0*tautot(:,nlev))) 553 553 ELSEWHERE 554 554 pnorm_perp_tot(:,nlev) = 0. … … 563 563 ! We remove one contribution using 564 564 ! Betaperp=beta_mol(:,k)/(1+1/0.0284)) [bodhaine et al. 1999] in the following equations: 565 WHERE (pnorm(:,k) ==0)565 WHERE (pnorm(:,k).eq.0) 566 566 pnorm_perp_tot(:,k)=0. 567 567 ELSEWHERE 568 WHERE (tautot_lay(:) >0.)568 WHERE (tautot_lay(:).GT.0.) 569 569 pnorm_perp_tot(:,k) = & 570 570 (beta_perp_ice(:,k)+beta_perp_liq(:,k)-(beta_mol(:,k)/(1+1/0.0284))) * & 571 571 EXP(-2.0*tautot(:,k+1)) / (2.*tautot_lay(:)) & 572 * (1.-EXP(-2.0*tautot_lay(:)))572 & * (1.-EXP(-2.0*tautot_lay(:))) 573 573 ELSEWHERE 574 574 ! This must never happen, but just in case, to avoid div. by 0 … … 690 690 ! Lum_norm=f(tetaS,tau_cloud) derived from adding-doubling calculations 691 691 ! valid ONLY ABOVE OCEAN (albedo_sfce=5%) 692 ! valid only in one viewing direction (theta_v=30 °, phi_s-phi_v=320°)692 ! valid only in one viewing direction (theta_v=30�, phi_s-phi_v=320�) 693 693 ! based on adding-doubling radiative transfer computation 694 694 ! for tau values (0 to 100) and for tetas values (0 to 80) 695 695 ! for 2 scattering phase functions: liquid spherical, ice non spherical 696 696 697 IF ( nrefl >ntetas ) THEN697 IF ( nrefl.GT. ntetas ) THEN 698 698 PRINT *,'Error in lidar_simulator, nrefl should be less then ',ntetas,' not',nrefl 699 699 STOP … … 711 711 ! 712 712 ! relative fraction of the opt. thick due to liquid or ice clouds 713 WHERE (tautot_S(:) >0.)713 WHERE (tautot_S(:) .GT. 0.) 714 714 frac_taucol_liq(:) = tautot_S_liq(:) / tautot_S(:) 715 715 frac_taucol_ice(:) = tautot_S_ice(:) / tautot_S(:) … … 733 733 DO it=1,ntetas 734 734 DO ny=1,nbtau-1 735 WHERE (tautot_S(:) >=tau(ny).AND.tautot_S(:)<=tau(ny+1))735 WHERE (tautot_S(:).GE.tau(ny).AND.tautot_S(:).LE.tau(ny+1)) 736 736 rlumA_mod(:,it) = aA(it,ny)*tautot_S(:) + bA(it,ny) 737 737 rlumB_mod(:,it) = aB(it,ny)*tautot_S(:) + bB(it,ny) -
LMDZ6/branches/Amaury_dev/libf/phylmd/cosp/m_mrgrnk.F90
r5081 r5095 33 33 IRNGT (1) = 1 34 34 Return 35 Case Default 36 Continue 35 37 End Select 36 38 ! … … 231 233 IRNGT (1) = 1 232 234 Return 235 Case Default 236 Continue 233 237 End Select 234 238 ! -
LMDZ6/branches/Amaury_dev/libf/phylmd/cosp/math_lib.F90
r5086 r5095 34 34 35 35 ! ----- INPUTS ----- 36 real (kind=8), intent(in) :: x36 real*8, intent(in) :: x 37 37 38 38 ! ----- OUTPUTS ----- 39 real (kind=8):: gamma39 real*8 :: gamma 40 40 41 41 ! ----- INTERNAL ----- 42 real (kind=8):: pi,ga,z,r,gr43 real (kind=8):: g(26)42 real*8 :: pi,ga,z,r,gr 43 real*8 :: g(26) 44 44 integer :: k,m1,m 45 45 … … 124 124 125 125 ! ----- INPUTS ----- 126 real (kind=8), intent(in), dimension(:) :: f,s126 real*8, intent(in), dimension(:) :: f,s 127 127 integer, intent(in) :: i1, i2 128 128 129 129 ! ---- OUTPUTS ----- 130 real (kind=8) :: path_integral130 real*8 :: path_integral 131 131 132 132 ! ----- INTERNAL ----- 133 real (kind=8):: sumo, deltah, val134 integer (kind=4):: nelm, j135 integer (kind=4), dimension(i2-i1+1) :: idx136 real (kind=8), dimension(i2-i1+1) :: f_rev, s_rev133 real*8 :: sumo, deltah, val 134 integer*4 :: nelm, j 135 integer*4, dimension(i2-i1+1) :: idx 136 real*8, dimension(i2-i1+1) :: f_rev, s_rev 137 137 138 138 nelm = i2-i1+1 … … 273 273 exit 274 274 end if 275 END DO275 end do 276 276 277 277 if (lerror) then … … 316 316 end if 317 317 ilo = ilo + 1 318 END DO318 end do 319 319 320 320 ilo = max ( 2, ilo ) … … 326 326 end if 327 327 ihi = ihi - 1 328 END DO328 end do 329 329 330 330 ihi = min ( ihi, ntab - 1 ) … … 374 374 syl = x2 375 375 376 END DO376 end do 377 377 378 378 result = sum1 & -
LMDZ6/branches/Amaury_dev/libf/phylmd/cosp/mod_cosp.F90
r5082 r5095 179 179 minp = minval(gbx%psfc) 180 180 maxp = maxval(gbx%psfc) 181 if (Npoints >1) seed=int((gbx%psfc-minp)/(maxp-minp)*100000) + 1181 if (Npoints .gt. 1) seed=int((gbx%psfc-minp)/(maxp-minp)*100000) + 1 182 182 ! Below it's how it was done in the original implementation of the ISCCP simulator. 183 183 ! The one above is better for offline data, when you may have packed data … … 414 414 if (sgx%frac_out (j,i,Nlevels+1-k) == I_LSC) frac_ls(j,k)=frac_ls(j,k)+1. 415 415 if (sgx%frac_out (j,i,Nlevels+1-k) == I_CVC) frac_cv(j,k)=frac_cv(j,k)+1. 416 if (sgx%prec_frac(j,i,Nlevels+1-k) ==1) prec_ls(j,k)=prec_ls(j,k)+1.417 if (sgx%prec_frac(j,i,Nlevels+1-k) ==2) prec_cv(j,k)=prec_cv(j,k)+1.418 if (sgx%prec_frac(j,i,Nlevels+1-k) ==3) then416 if (sgx%prec_frac(j,i,Nlevels+1-k) .eq. 1) prec_ls(j,k)=prec_ls(j,k)+1. 417 if (sgx%prec_frac(j,i,Nlevels+1-k) .eq. 2) prec_cv(j,k)=prec_cv(j,k)+1. 418 if (sgx%prec_frac(j,i,Nlevels+1-k) .eq. 3) then 419 419 prec_cv(j,k)=prec_cv(j,k)+1. 420 420 prec_ls(j,k)=prec_ls(j,k)+1. … … 501 501 do j=1,Npoints 502 502 !--------- Clouds ------- 503 if (frac_ls(j,k) /=0.) then503 if (frac_ls(j,k) .ne. 0.) then 504 504 sghydro%mr_hydro(j,:,k,I_LSCLIQ) = sghydro%mr_hydro(j,:,k,I_LSCLIQ)/frac_ls(j,k) 505 505 sghydro%mr_hydro(j,:,k,I_LSCICE) = sghydro%mr_hydro(j,:,k,I_LSCICE)/frac_ls(j,k) 506 506 endif 507 if (frac_cv(j,k) /=0.) then507 if (frac_cv(j,k) .ne. 0.) then 508 508 sghydro%mr_hydro(j,:,k,I_CVCLIQ) = sghydro%mr_hydro(j,:,k,I_CVCLIQ)/frac_cv(j,k) 509 509 sghydro%mr_hydro(j,:,k,I_CVCICE) = sghydro%mr_hydro(j,:,k,I_CVCICE)/frac_cv(j,k) … … 511 511 !--------- Precip ------- 512 512 if (gbx%use_precipitation_fluxes) then 513 if (prec_ls(j,k) /=0.) then513 if (prec_ls(j,k) .ne. 0.) then 514 514 gbx%rain_ls(j,k) = gbx%rain_ls(j,k)/prec_ls(j,k) 515 515 gbx%snow_ls(j,k) = gbx%snow_ls(j,k)/prec_ls(j,k) 516 516 gbx%grpl_ls(j,k) = gbx%grpl_ls(j,k)/prec_ls(j,k) 517 517 endif 518 if (prec_cv(j,k) /=0.) then518 if (prec_cv(j,k) .ne. 0.) then 519 519 gbx%rain_cv(j,k) = gbx%rain_cv(j,k)/prec_cv(j,k) 520 520 gbx%snow_cv(j,k) = gbx%snow_cv(j,k)/prec_cv(j,k) 521 521 endif 522 522 else 523 if (prec_ls(j,k) /=0.) then523 if (prec_ls(j,k) .ne. 0.) then 524 524 sghydro%mr_hydro(j,:,k,I_LSRAIN) = sghydro%mr_hydro(j,:,k,I_LSRAIN)/prec_ls(j,k) 525 525 sghydro%mr_hydro(j,:,k,I_LSSNOW) = sghydro%mr_hydro(j,:,k,I_LSSNOW)/prec_ls(j,k) 526 526 sghydro%mr_hydro(j,:,k,I_LSGRPL) = sghydro%mr_hydro(j,:,k,I_LSGRPL)/prec_ls(j,k) 527 527 endif 528 if (prec_cv(j,k) /=0.) then528 if (prec_cv(j,k) .ne. 0.) then 529 529 sghydro%mr_hydro(j,:,k,I_CVRAIN) = sghydro%mr_hydro(j,:,k,I_CVRAIN)/prec_cv(j,k) 530 530 sghydro%mr_hydro(j,:,k,I_CVSNOW) = sghydro%mr_hydro(j,:,k,I_CVSNOW)/prec_cv(j,k) -
LMDZ6/branches/Amaury_dev/libf/phylmd/cosp/mod_cosp_modis_simulator.F90
r5086 r5095 176 176 opticalThickness(i, j, k) = 0. 177 177 end if 178 END DO179 END DO180 END DO178 end do 179 end do 180 end do 181 181 182 182 ! … … 197 197 do i = 1, nSunlit 198 198 if(subCols%frac_out(sunlit(i), j, k) == I_CVC) opticalThickness(i, j, k) = gridBox%dtau_c(sunlit(i), k) 199 END DO200 END DO201 END DO199 end do 200 end do 201 end do 202 202 203 203 ! … … 220 220 retrievedPhase(i, :), retrievedCloudTopPressure(i, :), & 221 221 retrievedTau(i, :), retrievedSize(i, :)) 222 END DO222 end do 223 223 224 224 ! DJS2015: Call L3 modis simulator used by cospv2.0 -
LMDZ6/branches/Amaury_dev/libf/phylmd/cosp/mod_cosp_radar.F90
r5082 r5095 53 53 54 54 real undef 55 real (kind=8), dimension(nprof,ngate), intent(in) :: hgt_matrix, p_matrix, &55 real*8, dimension(nprof,ngate), intent(in) :: hgt_matrix, p_matrix, & 56 56 t_matrix,rh_matrix 57 real (kind=8), dimension(hp%nhclass,nprof,ngate), intent(in) :: hm_matrix58 real (kind=8), dimension(hp%nhclass,nprof,ngate), intent(inout) :: re_matrix59 real (kind=8), dimension(hp%nhclass,nprof,ngate), intent(inout) :: Np_matrix57 real*8, dimension(hp%nhclass,nprof,ngate), intent(in) :: hm_matrix 58 real*8, dimension(hp%nhclass,nprof,ngate), intent(inout) :: re_matrix 59 real*8, dimension(hp%nhclass,nprof,ngate), intent(inout) :: Np_matrix 60 60 61 61 ! ----- OUTPUTS ----- 62 real (kind=8), dimension(nprof,ngate), intent(out) :: Ze_non,Ze_ray, &62 real*8, dimension(nprof,ngate), intent(out) :: Ze_non,Ze_ray, & 63 63 g_to_vol,dBZe,a_to_vol 64 64 ! ----- OPTIONAL ----- 65 real (kind=8), optional, dimension(nprof,ngate) :: &65 real*8, optional, dimension(nprof,ngate) :: & 66 66 g_to_vol_in,g_to_vol_out 67 67 end subroutine radar_simulator … … 86 86 nsizes ! num of discrete drop sizes 87 87 88 real (kind=8), dimension(:,:), allocatable :: &88 real*8, dimension(:,:), allocatable :: & 89 89 g_to_vol ! integrated atten due to gases, r>v (dB) 90 90 91 real (kind=8), dimension(:,:), allocatable :: &91 real*8, dimension(:,:), allocatable :: & 92 92 Ze_non, & ! radar reflectivity withOUT attenuation (dBZ) 93 93 Ze_ray, & ! Rayleigh reflectivity (dBZ) … … 100 100 rh_matrix !relative humidity (%) 101 101 102 real (kind=8), dimension(:,:,:), allocatable :: &102 real*8, dimension(:,:,:), allocatable :: & 103 103 hm_matrix, & ! hydrometeor mixing ratio (g kg^-1) 104 104 re_matrix, & ! effective radius (microns). Optional. 0 ==> use Np_matrix or defaults -
LMDZ6/branches/Amaury_dev/libf/phylmd/cosp/mod_cosp_types.F90
r5082 r5095 1110 1110 1111 1111 1112 if(y%Nhydro /=N_HYDRO) then1112 if(y%Nhydro.ne.N_HYDRO) then 1113 1113 1114 1114 write(*,*) 'Number of hydrometeor input to subroutine', & -
LMDZ6/branches/Amaury_dev/libf/phylmd/cosp/mod_llnl_stats.F90
r5082 r5095 119 119 do j=Nlevels,1,-1 !top->surf 120 120 sc_ratio = beta_tot(pr,i,j)/beta_mol(pr,j) 121 if ((sc_ratio <= s_att) .and. (flag_sat ==0)) flag_sat = j122 if (Ze_tot(pr,i,j) <-30.) then !radar can't detect cloud123 if ( (sc_ratio > s_cld) .or. (flag_sat ==j) ) then !lidar sense cloud121 if ((sc_ratio .le. s_att) .and. (flag_sat .eq. 0)) flag_sat = j 122 if (Ze_tot(pr,i,j) .lt. -30.) then !radar can't detect cloud 123 if ( (sc_ratio .gt. s_cld) .or. (flag_sat .eq. j) ) then !lidar sense cloud 124 124 lidar_only_freq_cloud(pr,j)=lidar_only_freq_cloud(pr,j)+1. !top->surf 125 125 flag_cld=1 … … 129 129 endif 130 130 enddo !levels 131 if (flag_cld ==1) tcc(pr)=tcc(pr)+1.131 if (flag_cld .eq. 1) tcc(pr)=tcc(pr)+1. 132 132 enddo !columns 133 133 enddo !points -
LMDZ6/branches/Amaury_dev/libf/phylmd/cosp/mod_lmd_ipsl_stats.F90
r5082 r5095 148 148 do ic = 1, ncol 149 149 pnorm_c = pnorm(:,ic,:) 150 where ((pnorm_c <xmax) .and. (pmol<xmax) .and. (pmol>0.0 ))150 where ((pnorm_c.lt.xmax) .and. (pmol.lt.xmax) .and. (pmol.gt. 0.0 )) 151 151 x3d_c = pnorm_c/pmol 152 152 elsewhere … … 247 247 ! c 0- Initializations 248 248 ! c ------------------------------------------------------- 249 if ( Nbins <6) return249 if ( Nbins .lt. 6) return 250 250 251 251 srbval(1) = S_att … … 275 275 do i = 1, Npoints 276 276 if (x(i,k,j) /= undef) then 277 if ((x(i,k,j) >srbval_ext(ib-1)).and.(x(i,k,j)<=srbval_ext(ib))) &277 if ((x(i,k,j).gt.srbval_ext(ib-1)).and.(x(i,k,j).le.srbval_ext(ib))) & 278 278 cfad(i,ib,j) = cfad(i,ib,j) + 1.0 279 279 else … … 285 285 enddo 286 286 287 where (cfad /=undef) cfad = cfad / float(Ncolumns)287 where (cfad .ne. undef) cfad = cfad / float(Ncolumns) 288 288 289 289 ! c ------------------------------------------------------- … … 373 373 ! --------------------------------------------------------------- 374 374 375 if ( Ncat /=4 ) then375 if ( Ncat .ne. 4 ) then 376 376 print *,'Error in lmd_ipsl_stats.cosp_cldfrac, Ncat must be 4, not',Ncat 377 377 stop … … 423 423 424 424 ! cloud detection at subgrid-scale: 425 where ( (x(:,:,k) >S_cld) .and. (x(:,:,k)/=undef) )425 where ( (x(:,:,k).gt.S_cld) .and. (x(:,:,k).ne. undef) ) 426 426 cldy(:,:,k)=1.0 427 427 elsewhere … … 430 430 431 431 ! number of usefull sub-columns: 432 where ( (x(:,:,k) >S_att) .and. (x(:,:,k)/=undef) )432 where ( (x(:,:,k).gt.S_att) .and. (x(:,:,k).ne. undef) ) 433 433 srok(:,:,k)=1.0 434 434 elsewhere … … 513 513 ! Computation of the cloud fraction as a function of the temperature 514 514 ! instead of height, for ice,liquid and all clouds 515 if(srok(ip,ic,k) >0.)then515 if(srok(ip,ic,k).gt.0.)then 516 516 do itemp=1,Ntemp 517 if( (tmp(ip,k) >=tempmod(itemp)).and.(tmp(ip,k)<tempmod(itemp+1)) )then517 if( (tmp(ip,k).ge.tempmod(itemp)).and.(tmp(ip,k).lt.tempmod(itemp+1)) )then 518 518 lidarcldtempind(ip,itemp)=lidarcldtempind(ip,itemp)+1. 519 519 endif … … 521 521 endif 522 522 523 if(cldy(ip,ic,k) ==1.)then523 if(cldy(ip,ic,k).eq.1.)then 524 524 do itemp=1,Ntemp 525 if( (tmp(ip,k) >=tempmod(itemp)).and.(tmp(ip,k)<tempmod(itemp+1)) )then525 if( (tmp(ip,k).ge.tempmod(itemp)).and.(tmp(ip,k).lt.tempmod(itemp+1)) )then 526 526 lidarcldtemp(ip,itemp,1)=lidarcldtemp(ip,itemp,1)+1. 527 527 endif … … 532 532 iz=1 533 533 p1 = pplay(ip,k) 534 if ( p1 >0. .and. p1<(440.*100.)) then ! high clouds534 if ( p1.gt.0. .and. p1.lt.(440.*100.)) then ! high clouds 535 535 iz=3 536 else if(p1 >=(440.*100.) .and. p1<(680.*100.)) then ! mid clouds536 else if(p1.ge.(440.*100.) .and. p1.lt.(680.*100.)) then ! mid clouds 537 537 iz=2 538 538 endif … … 554 554 ! -- grid-box 3D cloud fraction 555 555 556 where ( nsub(:,:) >0.0 )556 where ( nsub(:,:).gt.0.0 ) 557 557 lidarcld(:,:) = lidarcld(:,:)/nsub(:,:) 558 558 elsewhere … … 573 573 enddo 574 574 enddo 575 where ( nsublayer(:,:) >0.0 )575 where ( nsublayer(:,:).gt.0.0 ) 576 576 cldlayer(:,:) = cldlayer(:,:)/nsublayer(:,:) 577 577 elsewhere … … 593 593 594 594 ! Avoid zero values 595 if( (cldy(i,ncol,nlev) ==1.) .and. (ATBperp(i,ncol,nlev)>0.) )then595 if( (cldy(i,ncol,nlev).eq.1.) .and. (ATBperp(i,ncol,nlev).gt.0.) )then 596 596 ! Computation of the ATBperp along the phase discrimination line 597 597 ATBperp_tmp = (ATB(i,ncol,nlev)**5)*alpha50 + (ATB(i,ncol,nlev)**4)*beta50 + & … … 604 604 !____________________________________________________________________________________________________ 605 605 ! 606 if( (ATBperp(i,ncol,nlev)-ATBperp_tmp) >=0. )then ! Ice clouds606 if( (ATBperp(i,ncol,nlev)-ATBperp_tmp).ge.0. )then ! Ice clouds 607 607 ! ICE with temperature above 273,15°K = Liquid (false ice) 608 if(tmp(i,nlev) >273.15)then ! Temperature above 273,15 K608 if(tmp(i,nlev).gt.273.15)then ! Temperature above 273,15 K 609 609 ! Liquid: False ice corrected by the temperature to Liquid 610 610 lidarcldphase(i,nlev,2)=lidarcldphase(i,nlev,2)+1. ! false ice detection ==> added to Liquid … … 613 613 ! to classify the phase cloud 614 614 cldlayphase(i,ncol,4,2) = 1. ! tot cloud 615 if ( p1 >0. .and. p1<(440.*100.)) then ! high cloud615 if ( p1.gt.0. .and. p1.lt.(440.*100.)) then ! high cloud 616 616 cldlayphase(i,ncol,3,2) = 1. 617 else if(p1 >=(440.*100.) .and. p1<(680.*100.)) then ! mid cloud617 else if(p1.ge.(440.*100.) .and. p1.lt.(680.*100.)) then ! mid cloud 618 618 cldlayphase(i,ncol,2,2) = 1. 619 619 else ! low cloud … … 621 621 endif 622 622 cldlayphase(i,ncol,4,5) = 1. ! tot cloud 623 if ( p1 >0. .and. p1<(440.*100.)) then ! high cloud623 if ( p1.gt.0. .and. p1.lt.(440.*100.)) then ! high cloud 624 624 cldlayphase(i,ncol,3,5) = 1. 625 else if(p1 >=(440.*100.) .and. p1<(680.*100.)) then ! mid cloud625 else if(p1.ge.(440.*100.) .and. p1.lt.(680.*100.)) then ! mid cloud 626 626 cldlayphase(i,ncol,2,5) = 1. 627 627 else ! low cloud … … 634 634 tmpi(i,ncol,nlev)=tmp(i,nlev) 635 635 cldlayphase(i,ncol,4,1) = 1. ! tot cloud 636 if ( p1 >0. .and. p1<(440.*100.)) then ! high cloud636 if ( p1.gt.0. .and. p1.lt.(440.*100.)) then ! high cloud 637 637 cldlayphase(i,ncol,3,1) = 1. 638 else if(p1 >=(440.*100.) .and. p1<(680.*100.)) then ! mid cloud638 else if(p1.ge.(440.*100.) .and. p1.lt.(680.*100.)) then ! mid cloud 639 639 cldlayphase(i,ncol,2,1) = 1. 640 640 else ! low cloud … … 651 651 else ! Liquid clouds 652 652 ! Liquid with temperature above 231,15°K 653 if(tmp(i,nlev) >231.15)then653 if(tmp(i,nlev).gt.231.15)then 654 654 lidarcldphase(i,nlev,2)=lidarcldphase(i,nlev,2)+1. 655 655 tmpl(i,ncol,nlev)=tmp(i,nlev) 656 656 cldlayphase(i,ncol,4,2) = 1. ! tot cloud 657 if ( p1 >0. .and. p1<(440.*100.)) then ! high cloud657 if ( p1.gt.0. .and. p1.lt.(440.*100.)) then ! high cloud 658 658 cldlayphase(i,ncol,3,2) = 1. 659 else if(p1 >=(440.*100.) .and. p1<(680.*100.)) then ! mid cloud659 else if(p1.ge.(440.*100.) .and. p1.lt.(680.*100.)) then ! mid cloud 660 660 cldlayphase(i,ncol,2,2) = 1. 661 661 else ! low cloud … … 670 670 ! to classify the phase cloud 671 671 cldlayphase(i,ncol,4,4) = 1. ! tot cloud 672 if ( p1 >0. .and. p1<(440.*100.)) then ! high cloud672 if ( p1.gt.0. .and. p1.lt.(440.*100.)) then ! high cloud 673 673 cldlayphase(i,ncol,3,4) = 1. 674 else if(p1 >=(440.*100.) .and. p1<(680.*100.)) then ! mid cloud674 else if(p1.ge.(440.*100.) .and. p1.lt.(680.*100.)) then ! mid cloud 675 675 cldlayphase(i,ncol,2,4) = 1. 676 676 else ! low cloud … … 678 678 endif 679 679 cldlayphase(i,ncol,4,1) = 1. ! tot cloud 680 if ( p1 >0. .and. p1<(440.*100.)) then ! high cloud680 if ( p1.gt.0. .and. p1.lt.(440.*100.)) then ! high cloud 681 681 cldlayphase(i,ncol,3,1) = 1. 682 else if(p1 >=(440.*100.) .and. p1<(680.*100.)) then ! mid cloud682 else if(p1.ge.(440.*100.) .and. p1.lt.(680.*100.)) then ! mid cloud 683 683 cldlayphase(i,ncol,2,1) = 1. 684 684 else ! low cloud … … 702 702 p1 = pplay(i,nlev) 703 703 704 if( (cldy(i,ncol,nlev) ==1.) .and. (ATBperp(i,ncol,nlev)>0.) )then704 if( (cldy(i,ncol,nlev).eq.1.) .and. (ATBperp(i,ncol,nlev).gt.0.) )then 705 705 ! Phase discrimination line : ATBperp = ATB^5*alpha50 + ATB^4*beta50 + ATB^3*gamma50 + ATB^2*delta50 706 706 ! + ATB*epsilon50 + zeta50 … … 715 715 ! 716 716 ! ICE with temperature above 273,15°K = Liquid (false ice) 717 if( (ATBperp(i,ncol,nlev)-ATBperp_tmp) >=0. )then ! Ice clouds718 if(tmp(i,nlev) >273.15)then717 if( (ATBperp(i,ncol,nlev)-ATBperp_tmp).ge.0. )then ! Ice clouds 718 if(tmp(i,nlev).gt.273.15)then 719 719 lidarcldphase(i,nlev,2)=lidarcldphase(i,nlev,2)+1. ! false ice ==> liq 720 720 tmpl(i,ncol,nlev)=tmp(i,nlev) … … 722 722 723 723 cldlayphase(i,ncol,4,2) = 1. ! tot cloud 724 if ( p1 >0. .and. p1<(440.*100.)) then ! high cloud724 if ( p1.gt.0. .and. p1.lt.(440.*100.)) then ! high cloud 725 725 cldlayphase(i,ncol,3,2) = 1. 726 else if(p1 >=(440.*100.) .and. p1<(680.*100.)) then ! mid cloud726 else if(p1.ge.(440.*100.) .and. p1.lt.(680.*100.)) then ! mid cloud 727 727 cldlayphase(i,ncol,2,2) = 1. 728 728 else ! low cloud … … 731 731 732 732 cldlayphase(i,ncol,4,5) = 1. ! tot cloud 733 if ( p1 >0. .and. p1<(440.*100.)) then ! high cloud733 if ( p1.gt.0. .and. p1.lt.(440.*100.)) then ! high cloud 734 734 cldlayphase(i,ncol,3,5) = 1. 735 else if(p1 >=(440.*100.) .and. p1<(680.*100.)) then ! mid cloud735 else if(p1.ge.(440.*100.) .and. p1.lt.(680.*100.)) then ! mid cloud 736 736 cldlayphase(i,ncol,2,5) = 1. 737 737 else ! low cloud … … 745 745 746 746 cldlayphase(i,ncol,4,1) = 1. ! tot cloud 747 if ( p1 >0. .and. p1<(440.*100.)) then ! high cloud747 if ( p1.gt.0. .and. p1.lt.(440.*100.)) then ! high cloud 748 748 cldlayphase(i,ncol,3,1) = 1. 749 else if(p1 >=(440.*100.) .and. p1<(680.*100.)) then ! mid cloud749 else if(p1.ge.(440.*100.) .and. p1.lt.(680.*100.)) then ! mid cloud 750 750 cldlayphase(i,ncol,2,1) = 1. 751 751 else ! low cloud … … 762 762 else 763 763 ! Liquid with temperature above 231,15°K 764 if(tmp(i,nlev) >231.15)then764 if(tmp(i,nlev).gt.231.15)then 765 765 lidarcldphase(i,nlev,2)=lidarcldphase(i,nlev,2)+1. 766 766 tmpl(i,ncol,nlev)=tmp(i,nlev) 767 767 768 768 cldlayphase(i,ncol,4,2) = 1. ! tot cloud 769 if ( p1 >0. .and. p1<(440.*100.)) then ! high cloud769 if ( p1.gt.0. .and. p1.lt.(440.*100.)) then ! high cloud 770 770 cldlayphase(i,ncol,3,2) = 1. 771 else if(p1 >=(440.*100.) .and. p1<(680.*100.)) then ! mid cloud771 else if(p1.ge.(440.*100.) .and. p1.lt.(680.*100.)) then ! mid cloud 772 772 cldlayphase(i,ncol,2,2) = 1. 773 773 else ! low cloud … … 782 782 783 783 cldlayphase(i,ncol,4,4) = 1. ! tot cloud 784 if ( p1 >0. .and. p1<(440.*100.)) then ! high cloud784 if ( p1.gt.0. .and. p1.lt.(440.*100.)) then ! high cloud 785 785 cldlayphase(i,ncol,3,4) = 1. 786 else if(p1 >=(440.*100.) .and. p1<(680.*100.)) then ! mid cloud786 else if(p1.ge.(440.*100.) .and. p1.lt.(680.*100.)) then ! mid cloud 787 787 cldlayphase(i,ncol,2,4) = 1. 788 788 else ! low cloud … … 791 791 792 792 cldlayphase(i,ncol,4,1) = 1. ! tot cloud 793 if ( p1 >0. .and. p1<(440.*100.)) then ! high cloud793 if ( p1.gt.0. .and. p1.lt.(440.*100.)) then ! high cloud 794 794 cldlayphase(i,ncol,3,1) = 1. 795 else if(p1 >=(440.*100.) .and. p1<(680.*100.)) then ! mid cloud795 else if(p1.ge.(440.*100.) .and. p1.lt.(680.*100.)) then ! mid cloud 796 796 cldlayphase(i,ncol,2,1) = 1. 797 797 else ! low cloud … … 805 805 806 806 ! Find the level of the highest cloud with SR>30 807 if(x(i,ncol,nlev) >S_cld_att)then ! SR > 30.807 if(x(i,ncol,nlev).gt.S_cld_att)then ! SR > 30. 808 808 toplvlsat=nlev-1 809 809 goto 99 … … 821 821 !____________________________________________________________________________________________________ 822 822 ! 823 if(toplvlsat /=0)then823 if(toplvlsat.ne.0)then 824 824 do nlev=toplvlsat,1,-1 825 825 p1 = pplay(i,nlev) 826 if(cldy(i,ncol,nlev) ==1.)then826 if(cldy(i,ncol,nlev).eq.1.)then 827 827 lidarcldphase(i,nlev,3)=lidarcldphase(i,nlev,3)+1. 828 828 tmpu(i,ncol,nlev)=tmp(i,nlev) 829 829 830 830 cldlayphase(i,ncol,4,3) = 1. ! tot cloud 831 if ( p1 >0. .and. p1<(440.*100.)) then ! high cloud831 if ( p1.gt.0. .and. p1.lt.(440.*100.)) then ! high cloud 832 832 cldlayphase(i,ncol,3,3) = 1. 833 else if(p1 >=(440.*100.) .and. p1<(680.*100.)) then ! mid cloud833 else if(p1.ge.(440.*100.) .and. p1.lt.(680.*100.)) then ! mid cloud 834 834 cldlayphase(i,ncol,2,3) = 1. 835 835 else ! low cloud … … 857 857 ! of the occurrences 858 858 lidarcldphasetmp(:,:)=lidarcldphase(:,:,1)+lidarcldphase(:,:,2); 859 WHERE (lidarcldphasetmp(:,:) >0.)859 WHERE (lidarcldphasetmp(:,:).gt. 0.) 860 860 lidarcldphase(:,:,6)=lidarcldphase(:,:,1)/lidarcldphasetmp(:,:) 861 861 ELSEWHERE … … 864 864 865 865 ! Compute Phase 3D Cloud Fraction 866 WHERE ( nsub(:,:) >0.0 )866 WHERE ( nsub(:,:).gt.0.0 ) 867 867 lidarcldphase(:,:,1)=lidarcldphase(:,:,1)/nsub(:,:) 868 868 lidarcldphase(:,:,2)=lidarcldphase(:,:,2)/nsub(:,:) … … 899 899 ! Compute the Ice percentage in cloud = ice/(ice+liq) 900 900 cldlayerphasetmp(:,:)=cldlayerphase(:,:,1)+cldlayerphase(:,:,2) 901 WHERE (cldlayerphasetmp(:,:) >0.)901 WHERE (cldlayerphasetmp(:,:).gt. 0.) 902 902 cldlayerphase(:,:,6)=cldlayerphase(:,:,1)/cldlayerphasetmp(:,:) 903 903 ELSEWHERE … … 906 906 907 907 do i=1,Nphase-1 908 WHERE ( cldlayerphasesum(:,:) >0.0 )908 WHERE ( cldlayerphasesum(:,:).gt.0.0 ) 909 909 cldlayerphase(:,:,i) = (cldlayerphase(:,:,i)/cldlayerphasesum(:,:)) * cldlayer(:,:) 910 910 ENDWHERE … … 917 917 checkcldlayerphase2=0. 918 918 919 if (cldlayerphasesum(i,iz) >0.0 )then919 if (cldlayerphasesum(i,iz).gt.0.0 )then 920 920 do ic=1,Nphase-3 921 921 checkcldlayerphase=checkcldlayerphase+cldlayerphase(i,iz,ic) 922 922 enddo 923 923 checkcldlayerphase2=cldlayer(i,iz)-checkcldlayerphase 924 if( (checkcldlayerphase2 >0.01).or.(checkcldlayerphase2<-0.01) ) print *, checkcldlayerphase,cldlayer(i,iz)924 if( (checkcldlayerphase2.gt.0.01).or.(checkcldlayerphase2.lt.-0.01) ) print *, checkcldlayerphase,cldlayer(i,iz) 925 925 926 926 endif … … 930 930 931 931 do i=1,Nphase-1 932 WHERE ( nsublayer(:,:) ==0.0 )932 WHERE ( nsublayer(:,:).eq.0.0 ) 933 933 cldlayerphase(:,:,i) = undef 934 934 ENDWHERE … … 942 942 do i=1,Npoints 943 943 do itemp=1,Ntemp 944 if(tmpi(i,ncol,nlev) >0.)then945 if( (tmpi(i,ncol,nlev) >=tempmod(itemp)).and.(tmpi(i,ncol,nlev)<tempmod(itemp+1)) )then944 if(tmpi(i,ncol,nlev).gt.0.)then 945 if( (tmpi(i,ncol,nlev).ge.tempmod(itemp)).and.(tmpi(i,ncol,nlev).lt.tempmod(itemp+1)) )then 946 946 lidarcldtemp(i,itemp,2)=lidarcldtemp(i,itemp,2)+1. 947 947 endif 948 elseif(tmpl(i,ncol,nlev) >0.)then949 if( (tmpl(i,ncol,nlev) >=tempmod(itemp)).and.(tmpl(i,ncol,nlev)<tempmod(itemp+1)) )then948 elseif(tmpl(i,ncol,nlev).gt.0.)then 949 if( (tmpl(i,ncol,nlev).ge.tempmod(itemp)).and.(tmpl(i,ncol,nlev).lt.tempmod(itemp+1)) )then 950 950 lidarcldtemp(i,itemp,3)=lidarcldtemp(i,itemp,3)+1. 951 951 endif 952 elseif(tmpu(i,ncol,nlev) >0.)then953 if( (tmpu(i,ncol,nlev) >=tempmod(itemp)).and.(tmpu(i,ncol,nlev)<tempmod(itemp+1)) )then952 elseif(tmpu(i,ncol,nlev).gt.0.)then 953 if( (tmpu(i,ncol,nlev).ge.tempmod(itemp)).and.(tmpu(i,ncol,nlev).lt.tempmod(itemp+1)) )then 954 954 lidarcldtemp(i,itemp,4)=lidarcldtemp(i,itemp,4)+1. 955 955 endif … … 965 965 checktemp=lidarcldtemp(i,itemp,2)+lidarcldtemp(i,itemp,3)+lidarcldtemp(i,itemp,4) 966 966 967 if(checktemp /=lidarcldtemp(i,itemp,1))then967 if(checktemp.NE.lidarcldtemp(i,itemp,1))then 968 968 print *, i,itemp 969 969 print *, lidarcldtemp(i,itemp,1:4) … … 984 984 985 985 do i=1,4 986 WHERE(lidarcldtempind(:,:) >0.)986 WHERE(lidarcldtempind(:,:).gt.0.) 987 987 lidarcldtemp(:,:,i) = lidarcldtemp(:,:,i)/lidarcldtempind(:,:) 988 988 ELSEWHERE … … 1046 1046 do k=1,Nlevels 1047 1047 ! Cloud detection at subgrid-scale: 1048 where ( (x(:,:,k) > S_cld) .and. (x(:,:,k) /=undef) )1048 where ( (x(:,:,k) .gt. S_cld) .and. (x(:,:,k) .ne. undef) ) 1049 1049 cldy(:,:,k)=1.0 1050 1050 elsewhere … … 1052 1052 endwhere 1053 1053 ! Fully attenuated layer detection at subgrid-scale: 1054 where ( (x(:,:,k) > 0.0) .and. (x(:,:,k) < S_att_opaq) .and. (x(:,:,k) /=undef) )1054 where ( (x(:,:,k) .gt. 0.0) .and. (x(:,:,k) .lt. S_att_opaq) .and. (x(:,:,k) .ne. undef) ) 1055 1055 cldyopaq(:,:,k)=1.0 1056 1056 elsewhere … … 1059 1059 1060 1060 ! Number of useful sub-column layers: 1061 where ( (x(:,:,k) > S_att) .and. (x(:,:,k) /=undef) )1061 where ( (x(:,:,k) .gt. S_att) .and. (x(:,:,k) .ne. undef) ) 1062 1062 srok(:,:,k)=1.0 1063 1063 elsewhere … … 1065 1065 endwhere 1066 1066 ! Number of useful sub-columns layers for z_opaque 3D fraction: 1067 where ( (x(:,:,k) > 0.0) .and. (x(:,:,k) /=undef) )1067 where ( (x(:,:,k) .gt. 0.0) .and. (x(:,:,k) .ne. undef) ) 1068 1068 srokopaq(:,:,k)=1.0 1069 1069 elsewhere … … 1098 1098 1099 1099 ! Declaring non-opaque cloudy profiles as thin cloud profiles 1100 if ( (cldlay(ip,ic,4) == 1.0) .and. (cldlay(ip,ic,1) ==0.0) ) then1100 if ( (cldlay(ip,ic,4) .eq. 1.0) .and. (cldlay(ip,ic,1) .eq. 0.0) ) then 1101 1101 cldlay(ip,ic,2) = 1.0 1102 1102 endif … … 1105 1105 1106 1106 ! Opaque cloud profiles 1107 if ( cldlay(ip,ic,1) ==1.0 ) then1107 if ( cldlay(ip,ic,1) .eq. 1.0 ) then 1108 1108 zopac = 0.0 1109 1109 do k=2,Nlevels 1110 1110 ! Declaring opaque cloud fraction and z_opaque altitude for 3D and 2D variables 1111 if ( (cldy(ip,ic,k) == 1.0) .and. (zopac ==0.0) ) then1111 if ( (cldy(ip,ic,k) .eq. 1.0) .and. (zopac .eq. 0.0) ) then 1112 1112 lidarcldtype(ip,k-1,3) = lidarcldtype(ip,k-1,3) + 1.0 1113 1113 cldlay(ip,ic,3) = vgrid_z(k-1) !z_opaque altitude … … 1115 1115 zopac = 1.0 1116 1116 endif 1117 if ( cldy(ip,ic,k) ==1.0 ) then1117 if ( cldy(ip,ic,k) .eq. 1.0 ) then 1118 1118 lidarcldtype(ip,k,1) = lidarcldtype(ip,k,1) + 1.0 1119 1119 endif … … 1122 1122 1123 1123 ! Thin cloud profiles 1124 if ( cldlay(ip,ic,2) ==1.0 ) then1124 if ( cldlay(ip,ic,2) .eq. 1.0 ) then 1125 1125 do k=1,Nlevels 1126 1126 ! Declaring thin cloud fraction for 3D variable 1127 if ( cldy(ip,ic,k) ==1.0 ) then1127 if ( cldy(ip,ic,k) .eq. 1.0 ) then 1128 1128 lidarcldtype(ip,k,2) = lidarcldtype(ip,k,2) + 1.0 1129 1129 endif … … 1135 1135 1136 1136 ! 3D cloud types fraction (opaque=1 and thin=2) 1137 where ( nsub(:,:) >0.0 )1137 where ( nsub(:,:) .gt. 0.0 ) 1138 1138 lidarcldtype(:,:,1) = lidarcldtype(:,:,1)/nsub(:,:) 1139 1139 lidarcldtype(:,:,2) = lidarcldtype(:,:,2)/nsub(:,:) … … 1143 1143 endwhere 1144 1144 ! 3D z_opaque fraction (=3) 1145 where ( nsubopaq(:,:) >0.0 )1145 where ( nsubopaq(:,:) .gt. 0.0 ) 1146 1146 lidarcldtype(:,:,3) = lidarcldtype(:,:,3)/nsubopaq(:,:) 1147 1147 elsewhere … … 1152 1152 do ip = 1, Npoints 1153 1153 do k = Nlevels-1, 1, -1 1154 if ( lidarcldtype(ip,k,3) /=undef ) then1154 if ( lidarcldtype(ip,k,3) .ne. undef ) then 1155 1155 lidarcldtype(ip,k,4) = lidarcldtype(ip,k+1,4) + lidarcldtype(ip,k,3) 1156 1156 endif 1157 1157 enddo 1158 1158 enddo 1159 where ( nsubopaq(:,:) ==0.0 )1159 where ( nsubopaq(:,:) .eq. 0.0 ) 1160 1160 lidarcldtype(:,:,4) = undef 1161 1161 endwhere … … 1169 1169 enddo 1170 1170 enddo 1171 where (nsublayer(:,:) >0.0)1171 where (nsublayer(:,:) .gt. 0.0) 1172 1172 cldtype(:,:) = cldtype(:,:)/nsublayer(:,:) 1173 1173 elsewhere -
LMDZ6/branches/Amaury_dev/libf/phylmd/cosp/mod_modis_sim.F90
r5086 r5095 331 331 retrievedTau(i) = R_UNDEF 332 332 end if 333 END DO333 end do 334 334 where((retrievedSize(:) < 0.).and.(retrievedSize(:) /= R_UNDEF)) retrievedSize(:) = 1.0e-06*re_fill 335 335 … … 666 666 do ij=2,nbin1+1 667 667 do ik=2,nbin2+1 668 jointHist(ij-1,ik-1)=count(var1 >= bin1(ij-1) .and. var1 <bin1(ij) .and. &669 var2 >= bin2(ik-1) .and. var2 < bin2(ik))668 jointHist(ij-1,ik-1)=count(var1 .ge. bin1(ij-1) .and. var1 .lt. bin1(ij) .and. & 669 var2 .ge. bin2(ik-1) .and. var2 .lt. bin2(ik)) 670 670 enddo 671 671 enddo … … 802 802 tauMask(:, :, i) = .false. 803 803 end where 804 END DO804 end do 805 805 806 806 do i = 1, numPressureHistogramBins … … 811 811 pressureMask(:, :, i) = .false. 812 812 end where 813 END DO813 end do 814 814 815 815 do i = 1, numPressureHistogramBins … … 817 817 Optical_Thickness_vs_Cloud_Top_Pressure(:, j, i) = & 818 818 real(count(tauMask(:, :, j) .and. pressureMask(:, :, i), dim = 2)) / real(nSubcols) 819 END DO820 END DO819 end do 820 end do 821 821 822 822 end subroutine modis_L3_simulator … … 851 851 end if 852 852 if(totalTau >= tauLimit) exit 853 END DO853 end do 854 854 cloud_top_pressure = totalProduct/totalTau 855 855 end function cloud_top_pressure … … 877 877 end if 878 878 if(totalTau >= tauLimit) exit 879 END DO879 end do 880 880 weight_by_extinction = totalProduct/totalTau 881 881 end function weight_by_extinction … … 1114 1114 do i = 1, size(cloudIndicies) 1115 1115 call two_stream(tau(cloudIndicies(i)), g(cloudIndicies(i)), w0(cloudIndicies(i)), Refl(i), Trans(i)) 1116 END DO1116 end do 1117 1117 1118 1118 call adding_doubling(Refl(:), Trans(:), Refl_tot, Trans_tot) … … 1292 1292 Refl_cumulative(i) = Refl_cumulative(i-1) + Refl(i)*(Tran_cumulative(i-1)**2)/(1 - Refl_cumulative(i-1) * Refl(i)) 1293 1293 Tran_cumulative(i) = (Tran_cumulative(i-1)*Tran(i)) / (1 - Refl_cumulative(i-1) * Refl(i)) 1294 END DO1294 end do 1295 1295 1296 1296 Refl_tot = Refl_cumulative(size(Refl)) -
LMDZ6/branches/Amaury_dev/libf/phylmd/cosp/optics_lib.F90
r5086 r5095 38 38 39 39 ! ----- INPUTS ----- 40 real (kind=8), intent(in) :: freq,tk40 real*8, intent(in) :: freq,tk 41 41 42 42 ! ----- OUTPUTS ----- 43 real (kind=8), intent(out) :: n_r, n_i43 real*8, intent(out) :: n_r, n_i 44 44 45 45 ! ----- INTERNAL ----- 46 real (kind=8)ld,es,ei,a,ls,sg,tm1,cos1,sin147 real (kind=8)e_r,e_i48 real (kind=8)pi49 real (kind=8)tc50 complex (kind=8)e_comp, sq46 real*8 ld,es,ei,a,ls,sg,tm1,cos1,sin1 47 real*8 e_r,e_i 48 real*8 pi 49 real*8 tc 50 complex*16 e_comp, sq 51 51 52 52 tc = tk - 273.15 … … 102 102 103 103 ! ----- INPUTS ----- 104 real (kind=8), intent(in) :: freq, t104 real*8, intent(in) :: freq, t 105 105 106 106 ! ----- OUTPUTS ----- 107 real (kind=8), intent(out) :: n_r,n_i107 real*8, intent(out) :: n_r,n_i 108 108 109 109 ! Parameters: 110 integer (kind=2):: i,lt1,lt2,nwl,nwlt110 integer*2 :: i,lt1,lt2,nwl,nwlt 111 111 parameter(nwl=468,nwlt=62) 112 112 113 real (kind=8):: alam,cutice,pi,t1,t2,wlmax,wlmin, &113 real*8 :: alam,cutice,pi,t1,t2,wlmax,wlmin, & 114 114 x,x1,x2,y,y1,y2,ylo,yhi,tk 115 115 116 real (kind=8):: &116 real*8 :: & 117 117 tabim(nwl),tabimt(nwlt,4),tabre(nwl),tabret(nwlt,4),temref(4), & 118 118 wl(nwl),wlt(nwlt) … … 519 519 520 520 ! // region from 0.045 microns to 167.0 microns - no temperature depend 521 do i=2,nwl 522 if(alam < wl(i)) continue 523 enddo 521 524 x1=log(wl(i-1)) 522 525 x2=log(wl(i)) … … 536 539 if(tk > temref(1)) tk=temref(1) 537 540 if(tk < temref(4)) tk=temref(4) 538 do i=2,4539 if(tk >=temref(i)) go to 12540 END DO541 do 11 i=2,4 542 if(tk.ge.temref(i)) go to 12 543 11 continue 541 544 12 lt1=i 542 545 lt2=i-1 543 do i=2,nwlt544 if(alam <=wlt(i)) go to 14545 END DO546 do 13 i=2,nwlt 547 if(alam.le.wlt(i)) go to 14 548 13 continue 546 549 14 x1=log(wlt(i-1)) 547 550 x2=log(wlt(i)) … … 583 586 Subroutine MieInt(Dx, SCm, Inp, Dqv, Dqxt, Dqsc, Dbsc, Dg, Xs1, Xs2, DPh, Error) 584 587 585 Integer (kind=2)Imaxx588 Integer * 2 Imaxx 586 589 Parameter (Imaxx = 12000) 587 Real (kind=4)RIMax ! largest real part of refractive index590 Real * 4 RIMax ! largest real part of refractive index 588 591 Parameter (RIMax = 2.5) 589 Real (kind=4)IRIMax ! largest imaginary part of refractive index592 Real * 4 IRIMax ! largest imaginary part of refractive index 590 593 Parameter (IRIMax = -2) 591 Integer (kind=2)Itermax594 Integer * 2 Itermax 592 595 Parameter (Itermax = 12000 * 2.5) 593 596 ! must be large enough to cope with the 594 597 ! largest possible nmx = x * abs(scm) + 15 595 598 ! or nmx = Dx + 4.05*Dx**(1./3.) + 2.0 596 Integer (kind=2)Imaxnp599 Integer * 2 Imaxnp 597 600 Parameter (Imaxnp = 10000) ! Change this as required 598 601 ! INPUT 599 Real (kind=8)Dx600 Complex (kind=8)SCm601 Integer (kind=4)Inp602 Real (kind=8)Dqv(Inp)602 Real * 8 Dx 603 Complex * 16 SCm 604 Integer * 4 Inp 605 Real * 8 Dqv(Inp) 603 606 ! OUTPUT 604 Complex (kind=8)Xs1(InP)605 Complex (kind=8)Xs2(InP)606 Real (kind=8)Dqxt607 Real (kind=8)Dqsc608 Real (kind=8)Dg609 Real (kind=8)Dbsc610 Real (kind=8)DPh(InP)611 Integer (kind=4)Error607 Complex * 16 Xs1(InP) 608 Complex * 16 Xs2(InP) 609 Real * 8 Dqxt 610 Real * 8 Dqsc 611 Real * 8 Dg 612 Real * 8 Dbsc 613 Real * 8 DPh(InP) 614 Integer * 4 Error 612 615 ! LOCAL 613 Integer (kind=2)I614 Integer (kind=2)NStop615 Integer (kind=2)NmX616 Integer (kind=4)N ! N*N > 32767 ie N > 181617 Integer (kind=4)Inp2618 Real (kind=8)Chi,Chi0,Chi1619 Real (kind=8)APsi,APsi0,APsi1620 Real (kind=8)Pi0(Imaxnp)621 Real (kind=8)Pi1(Imaxnp)622 Real (kind=8)Taun(Imaxnp)623 Real (kind=8)Psi,Psi0,Psi1624 Complex (kind=4)Ir625 Complex (kind=8)Cm626 Complex (kind=8)A,ANM1,APB627 Complex (kind=8)B,BNM1,AMB628 Complex (kind=8)D(Itermax)629 Complex (kind=8)Sp(Imaxnp)630 Complex (kind=8)Sm(Imaxnp)631 Complex (kind=8)Xi,Xi0,Xi1632 Complex (kind=8)Y616 Integer * 2 I 617 Integer * 2 NStop 618 Integer * 2 NmX 619 Integer * 4 N ! N*N > 32767 ie N > 181 620 Integer * 4 Inp2 621 Real * 8 Chi,Chi0,Chi1 622 Real * 8 APsi,APsi0,APsi1 623 Real * 8 Pi0(Imaxnp) 624 Real * 8 Pi1(Imaxnp) 625 Real * 8 Taun(Imaxnp) 626 Real * 8 Psi,Psi0,Psi1 627 Complex * 8 Ir 628 Complex * 16 Cm 629 Complex * 16 A,ANM1,APB 630 Complex * 16 B,BNM1,AMB 631 Complex * 16 D(Itermax) 632 Complex * 16 Sp(Imaxnp) 633 Complex * 16 Sm(Imaxnp) 634 Complex * 16 Xi,Xi0,Xi1 635 Complex * 16 Y 633 636 ! ACCELERATOR VARIABLES 634 Integer (kind=2)Tnp1635 Integer (kind=2)Tnm1636 Real (kind=8)Dn637 Real (kind=8)Rnx638 Real (kind=8)S(Imaxnp)639 Real (kind=8)T(Imaxnp)640 Real (kind=8)Turbo641 Real (kind=8)A2642 Complex (kind=8)A1637 Integer * 2 Tnp1 638 Integer * 2 Tnm1 639 Real * 8 Dn 640 Real * 8 Rnx 641 Real * 8 S(Imaxnp) 642 Real * 8 T(Imaxnp) 643 Real * 8 Turbo 644 Real * 8 A2 645 Complex * 16 A1 643 646 644 If ((Dx >Imaxx) .Or. (InP>ImaxNP)) Then647 If ((Dx.Gt.Imaxx) .Or. (InP.Gt.ImaxNP)) Then 645 648 Error = 1 646 649 Return … … 649 652 Ir = 1 / Cm 650 653 Y = Dx * Cm 651 If (Dx <0.02) Then654 If (Dx.Lt.0.02) Then 652 655 NStop = 2 653 656 Else 654 If (Dx <=8.0) Then657 If (Dx.Le.8.0) Then 655 658 NStop = Dx + 4.00*Dx**(1./3.) + 2.0 656 659 Else 657 If (Dx <4200.0) Then660 If (Dx.Lt. 4200.0) Then 658 661 NStop = Dx + 4.05*Dx**(1./3.) + 2.0 659 662 Else … … 663 666 End If 664 667 NmX = Max(Real(NStop),Real(Abs(Y))) + 15. 665 If (Nmx >Itermax) then668 If (Nmx .gt. Itermax) then 666 669 Error = 1 667 670 Return … … 706 709 Dqxt = Tnp1 * Dble(A + B) + Dqxt 707 710 Dqsc = Tnp1 * (A*Conjg(A) + B*Conjg(B)) + Dqsc 708 If (N >1) then711 If (N.Gt.1) then 709 712 Dg = Dg + (dN*dN - 1) * Dble(ANM1*Conjg(A) + BNM1 * Conjg(B)) / dN + TNM1 * Dble(ANM1*Conjg(BNM1)) / (dN*dN - dN) 710 713 End If … … 714 717 AMB = A2 * (A - B) 715 718 Do I = 1,Inp2 716 If (I >Inp) Then719 If (I.GT.Inp) Then 717 720 S(I) = -Pi1(I) 718 721 Else … … 733 736 Xi1 = Dcmplx(APsi1,Chi1) 734 737 End Do 735 If (Dg >0) Dg = 2 * Dg / Dqsc738 If (Dg .GT.0) Dg = 2 * Dg / Dqsc 736 739 Dqsc = 2 * Dqsc / Dx**2 737 740 Dqxt = 2 * Dqxt / Dx**2 -
LMDZ6/branches/Amaury_dev/libf/phylmd/cosp/pf_to_mr.F
r5082 r5095 107 107 mx_rain_cv(j,ibox,ilev)=0. 108 108 mx_snow_cv(j,ibox,ilev)=0. 109 if ((prec_frac(j,ibox,ilev) ==1.) .or.110 & (prec_frac(j,ibox,ilev) == 3.)) then109 if ((prec_frac(j,ibox,ilev) .eq. 1.) .or. 110 & (prec_frac(j,ibox,ilev) .eq. 3.)) then 111 111 mx_rain_ls(j,ibox,ilev)= 112 112 & (term4r_ls**(1./(1.+br/4.)))/rho … … 116 116 & (term4g_ls**(1./(1.+bg/4.)))/rho 117 117 endif 118 if ((prec_frac(j,ibox,ilev) ==2.) .or.119 & (prec_frac(j,ibox,ilev) == 3.)) then118 if ((prec_frac(j,ibox,ilev) .eq. 2.) .or. 119 & (prec_frac(j,ibox,ilev) .eq. 3.)) then 120 120 mx_rain_cv(j,ibox,ilev)= 121 121 & (term4r_cv**(1./(1.+br/4.)))/rho -
LMDZ6/branches/Amaury_dev/libf/phylmd/cosp/phys_cosp.F90
r5082 r5095 193 193 cfg%Lrttov_sim,cfg%Lstats 194 194 195 if (overlaplmdz /=overlap) then195 if (overlaplmdz.ne.overlap) then 196 196 print*,'Attention overlaplmdz different de overlap lu dans namelist ' 197 197 endif … … 201 201 202 202 !!! Ici on modifie les cles logiques pour les outputs selon les champs actives dans les .xml 203 if ((itap >1).and.(first_write))then203 if ((itap.gt.1).and.(first_write))then 204 204 205 205 IF (using_xios) call read_xiosfieldactive(cfg) … … 268 268 269 269 do ip = 1, Npoints 270 if (fracTerLic(ip) >=0.5) then270 if (fracTerLic(ip).ge.0.5) then 271 271 gbx%land(ip) = 1. 272 272 else -
LMDZ6/branches/Amaury_dev/libf/phylmd/cosp/prec_scops.F
r5082 r5095 55 55 56 56 cv_col = 0.05*ncol 57 if (cv_col ==0) cv_col=157 if (cv_col .eq. 0) cv_col=1 58 58 59 59 do ilev=1,nlev … … 72 72 flag_cv=0 73 73 do ilev=1,nlev 74 if (frac_out(j,ibox,ilev) == 1) then74 if (frac_out(j,ibox,ilev) .eq. 1) then 75 75 flag_ls=1 76 76 endif 77 if (frac_out(j,ibox,ilev) == 2) then77 if (frac_out(j,ibox,ilev) .eq. 2) then 78 78 flag_cv=1 79 79 endif 80 80 enddo !loop over nlev 81 if (flag_ls ==1) then81 if (flag_ls .eq. 1) then 82 82 frac_out_ls(j,ibox)=1 83 83 endif 84 if (flag_cv ==1) then84 if (flag_cv .eq. 1) then 85 85 frac_out_cv(j,ibox)=1 86 86 endif … … 93 93 flag_cv=0 94 94 95 if (ls_p_rate(j,1) > 0.) then95 if (ls_p_rate(j,1) .gt. 0.) then 96 96 do ibox=1,ncol ! possibility ONE 97 if (frac_out(j,ibox,1) == 1) then97 if (frac_out(j,ibox,1) .eq. 1) then 98 98 prec_frac(j,ibox,1) = 1 99 99 flag_ls=1 100 100 endif 101 101 enddo ! loop over ncol 102 if (flag_ls ==0) then ! possibility THREE102 if (flag_ls .eq. 0) then ! possibility THREE 103 103 do ibox=1,ncol 104 if (frac_out(j,ibox,2) == 1) then104 if (frac_out(j,ibox,2) .eq. 1) then 105 105 prec_frac(j,ibox,1) = 1 106 106 flag_ls=1 … … 108 108 enddo ! loop over ncol 109 109 endif 110 if (flag_ls ==0) then ! possibility Four111 do ibox=1,ncol 112 if (frac_out_ls(j,ibox) == 1) then110 if (flag_ls .eq. 0) then ! possibility Four 111 do ibox=1,ncol 112 if (frac_out_ls(j,ibox) .eq. 1) then 113 113 prec_frac(j,ibox,1) = 1 114 114 flag_ls=1 … … 116 116 enddo ! loop over ncol 117 117 endif 118 if (flag_ls ==0) then ! possibility Five118 if (flag_ls .eq. 0) then ! possibility Five 119 119 do ibox=1,ncol 120 120 ! prec_frac(j,1:ncol,1) = 1 … … 125 125 ! There is large scale precipitation 126 126 127 if (cv_p_rate(j,1) > 0.) then127 if (cv_p_rate(j,1) .gt. 0.) then 128 128 do ibox=1,ncol ! possibility ONE 129 if (frac_out(j,ibox,1) == 2) then130 if (prec_frac(j,ibox,1) ==0) then129 if (frac_out(j,ibox,1) .eq. 2) then 130 if (prec_frac(j,ibox,1) .eq. 0) then 131 131 prec_frac(j,ibox,1) = 2 132 132 else … … 136 136 endif 137 137 enddo ! loop over ncol 138 if (flag_cv ==0) then ! possibility THREE139 do ibox=1,ncol 140 if (frac_out(j,ibox,2) == 2) then141 if (prec_frac(j,ibox,1) ==0) then138 if (flag_cv .eq. 0) then ! possibility THREE 139 do ibox=1,ncol 140 if (frac_out(j,ibox,2) .eq. 2) then 141 if (prec_frac(j,ibox,1) .eq. 0) then 142 142 prec_frac(j,ibox,1) = 2 143 143 else … … 148 148 enddo ! loop over ncol 149 149 endif 150 if (flag_cv ==0) then ! possibility Four151 do ibox=1,ncol 152 if (frac_out_cv(j,ibox) == 1) then153 if (prec_frac(j,ibox,1) ==0) then150 if (flag_cv .eq. 0) then ! possibility Four 151 do ibox=1,ncol 152 if (frac_out_cv(j,ibox) .eq. 1) then 153 if (prec_frac(j,ibox,1) .eq. 0) then 154 154 prec_frac(j,ibox,1) = 2 155 155 else … … 160 160 enddo ! loop over ncol 161 161 endif 162 if (flag_cv ==0) then ! possibility Five162 if (flag_cv .eq. 0) then ! possibility Five 163 163 do ibox=1,cv_col 164 if (prec_frac(j,ibox,1) ==0) then164 if (prec_frac(j,ibox,1) .eq. 0) then 165 165 prec_frac(j,ibox,1) = 2 166 166 else … … 183 183 flag_cv=0 184 184 185 if (ls_p_rate(j,ilev) > 0.) then185 if (ls_p_rate(j,ilev) .gt. 0.) then 186 186 do ibox=1,ncol ! possibility ONE&TWO 187 if ((frac_out(j,ibox,ilev) == 1) .or.188 & ((prec_frac(j,ibox,ilev-1) == 1)189 & .or. (prec_frac(j,ibox,ilev-1) == 3))) then187 if ((frac_out(j,ibox,ilev) .eq. 1) .or. 188 & ((prec_frac(j,ibox,ilev-1) .eq. 1) 189 & .or. (prec_frac(j,ibox,ilev-1) .eq. 3))) then 190 190 prec_frac(j,ibox,ilev) = 1 191 191 flag_ls=1 192 192 endif 193 193 enddo ! loop over ncol 194 if ((flag_ls == 0) .and. (ilev <nlev)) then ! possibility THREE195 do ibox=1,ncol 196 if (frac_out(j,ibox,ilev+1) == 1) then194 if ((flag_ls .eq. 0) .and. (ilev .lt. nlev)) then ! possibility THREE 195 do ibox=1,ncol 196 if (frac_out(j,ibox,ilev+1) .eq. 1) then 197 197 prec_frac(j,ibox,ilev) = 1 198 198 flag_ls=1 … … 200 200 enddo ! loop over ncol 201 201 endif 202 if (flag_ls ==0) then ! possibility Four203 do ibox=1,ncol 204 if (frac_out_ls(j,ibox) == 1) then202 if (flag_ls .eq. 0) then ! possibility Four 203 do ibox=1,ncol 204 if (frac_out_ls(j,ibox) .eq. 1) then 205 205 prec_frac(j,ibox,ilev) = 1 206 206 flag_ls=1 … … 208 208 enddo ! loop over ncol 209 209 endif 210 if (flag_ls ==0) then ! possibility Five210 if (flag_ls .eq. 0) then ! possibility Five 211 211 do ibox=1,ncol 212 212 ! prec_frac(j,1:ncol,ilev) = 1 … … 216 216 endif ! There is large scale precipitation 217 217 218 if (cv_p_rate(j,ilev) > 0.) then218 if (cv_p_rate(j,ilev) .gt. 0.) then 219 219 do ibox=1,ncol ! possibility ONE&TWO 220 if ((frac_out(j,ibox,ilev) == 2) .or.221 & ((prec_frac(j,ibox,ilev-1) == 2)222 & .or. (prec_frac(j,ibox,ilev-1) == 3))) then223 if (prec_frac(j,ibox,ilev) ==0) then220 if ((frac_out(j,ibox,ilev) .eq. 2) .or. 221 & ((prec_frac(j,ibox,ilev-1) .eq. 2) 222 & .or. (prec_frac(j,ibox,ilev-1) .eq. 3))) then 223 if (prec_frac(j,ibox,ilev) .eq. 0) then 224 224 prec_frac(j,ibox,ilev) = 2 225 225 else … … 229 229 endif 230 230 enddo ! loop over ncol 231 if ((flag_cv == 0) .and. (ilev <nlev)) then ! possibility THREE232 do ibox=1,ncol 233 if (frac_out(j,ibox,ilev+1) == 2) then234 if (prec_frac(j,ibox,ilev) ==0) then231 if ((flag_cv .eq. 0) .and. (ilev .lt. nlev)) then ! possibility THREE 232 do ibox=1,ncol 233 if (frac_out(j,ibox,ilev+1) .eq. 2) then 234 if (prec_frac(j,ibox,ilev) .eq. 0) then 235 235 prec_frac(j,ibox,ilev) = 2 236 236 else … … 241 241 enddo ! loop over ncol 242 242 endif 243 if (flag_cv ==0) then ! possibility Four244 do ibox=1,ncol 245 if (frac_out_cv(j,ibox) == 1) then246 if (prec_frac(j,ibox,ilev) ==0) then243 if (flag_cv .eq. 0) then ! possibility Four 244 do ibox=1,ncol 245 if (frac_out_cv(j,ibox) .eq. 1) then 246 if (prec_frac(j,ibox,ilev) .eq. 0) then 247 247 prec_frac(j,ibox,ilev) = 2 248 248 else … … 253 253 enddo ! loop over ncol 254 254 endif 255 if (flag_cv == 0) then ! possibility Five255 if (flag_cv .eq. 0) then ! possibility Five 256 256 do ibox=1,cv_col 257 if (prec_frac(j,ibox,ilev) ==0) then257 if (prec_frac(j,ibox,ilev) .eq. 0) then 258 258 prec_frac(j,ibox,ilev) = 2 259 259 else -
LMDZ6/branches/Amaury_dev/libf/phylmd/cosp/predict_mom07.F90
r5082 r5095 7 7 implicit none 8 8 9 real (kind=8):: a1,a2,a3,b1,b2,b3,c1,c2,c310 real (kind=8):: m2,tc,n,m,a_,b_,c_,A,B,C,n29 real*8 :: a1,a2,a3,b1,b2,b3,c1,c2,c3 10 real*8 :: m2,tc,n,m,a_,b_,c_,A,B,C,n2 11 11 12 12 a1= 13.6078 … … 30 30 31 31 ! predict m from m2 and tc 32 if(m2 /=-9999) then32 if(m2.ne.-9999) then 33 33 m=A*exp(B*tc)*m2**C 34 34 endif 35 35 ! get m2 if mass-dimension relationship not proportional to D**2 36 if(m2 ==-9999) then36 if(m2.eq.-9999) then 37 37 m2=(m/(A*exp(B*tc)))**(1.0/C) 38 38 endif -
LMDZ6/branches/Amaury_dev/libf/phylmd/cosp/radar_simulator.F90
r5082 r5095 91 91 92 92 real undef 93 real (kind=8), dimension(nprof,ngate), intent(in) :: &93 real*8, dimension(nprof,ngate), intent(in) :: & 94 94 hgt_matrix, p_matrix,t_matrix,rh_matrix 95 95 96 real (kind=8), dimension(hp%nhclass,nprof,ngate), intent(in) :: hm_matrix97 real (kind=8), dimension(hp%nhclass,nprof,ngate), intent(inout) :: re_matrix98 real (kind=8), dimension(hp%nhclass,nprof,ngate), intent(inout) :: Np_matrix96 real*8, dimension(hp%nhclass,nprof,ngate), intent(in) :: hm_matrix 97 real*8, dimension(hp%nhclass,nprof,ngate), intent(inout) :: re_matrix 98 real*8, dimension(hp%nhclass,nprof,ngate), intent(inout) :: Np_matrix 99 99 100 100 ! ----- OUTPUTS ----- 101 real (kind=8), dimension(nprof,ngate), intent(out) :: Ze_non,Ze_ray, &101 real*8, dimension(nprof,ngate), intent(out) :: Ze_non,Ze_ray, & 102 102 g_to_vol,dBZe,a_to_vol 103 103 104 104 ! ----- OPTIONAL ----- 105 real (kind=8), optional, dimension(nprof,ngate) :: &105 real*8, optional, dimension(nprof,ngate) :: & 106 106 g_to_vol_in,g_to_vol_out ! integrated atten due to gases, r>v (dB). This allows to output and then input 107 107 ! the same gaseous absorption in different calls. Optional to allow compatibility … … 112 112 113 113 real, parameter :: one_third = 1.0/3.0 114 real (kind=8):: t_kelvin114 real*8 :: t_kelvin 115 115 integer :: & 116 116 phase, & ! 0=liquid, 1=ice … … 118 118 119 119 logical :: hydro ! true=hydrometeor in vol, false=none 120 real (kind=8):: &120 real*8 :: & 121 121 rho_a, & ! air density (kg m^-3) 122 122 gases ! function: 2-way gas atten (dB/km) 123 123 124 real (kind=8), dimension(:), allocatable :: &124 real*8, dimension(:), allocatable :: & 125 125 Di, Deq, & ! discrete drop sizes (um) 126 126 Ni, & ! discrete concentrations (cm^-3 um^-1) 127 127 rhoi ! discrete densities (kg m^-3) 128 128 129 real (kind=8), dimension(nprof, ngate) :: &129 real*8, dimension(nprof, ngate) :: & 130 130 z_vol, & ! effective reflectivity factor (mm^6/m^3) 131 131 z_ray, & ! reflectivity factor, Rayleigh only (mm^6/m^3) … … 135 135 136 136 integer,parameter :: KR8 = selected_real_kind(15,300) 137 real (kind=8), parameter :: xx = -1.0_KR8138 real (kind=8), dimension(:), allocatable :: xxa139 real (kind=8):: kr, ze, zr, pi, scale_factor, tc, Re, ld, tmp1, ze2, kr2, apm, bpm140 real (kind=8):: half_a_atten_current,half_a_atten_above141 real (kind=8):: half_g_atten_current,half_g_atten_above142 integer (kind=4):: tp, i, j, k, pr, itt, iff143 144 real (kind=8)step,base, Np145 integer (kind=4)iRe_type,n,max_bin137 real*8, parameter :: xx = -1.0_KR8 138 real*8, dimension(:), allocatable :: xxa 139 real*8 :: kr, ze, zr, pi, scale_factor, tc, Re, ld, tmp1, ze2, kr2, apm, bpm 140 real*8 :: half_a_atten_current,half_a_atten_above 141 real*8 :: half_g_atten_current,half_g_atten_above 142 integer*4 :: tp, i, j, k, pr, itt, iff 143 144 real*8 step,base, Np 145 integer*4 iRe_type,n,max_bin 146 146 147 147 integer start_gate,end_gate,d_gate … … 207 207 itt = infind(hp%mt_tti,t_kelvin) 208 208 endif 209 if (re_matrix(tp,pr,k) ==0) then209 if (re_matrix(tp,pr,k).eq.0) then 210 210 call calc_Re(hm_matrix(tp,pr,k),Np_matrix(tp,pr,k),rho_a, & 211 211 hp%dtype(tp),hp%dmin(tp),hp%dmax(tp),hp%apm(tp),hp%bpm(tp), & … … 221 221 222 222 iRe_type=1 223 if(Re >0) then223 if(Re.gt.0) then 224 224 ! determine index in to scale LUT 225 225 ! … … 232 232 base=hp%base_list(n+1) 233 233 iRe_type=Re/step 234 if (iRe_type <1) iRe_type=1234 if (iRe_type.lt.1) iRe_type=1 235 235 236 236 Re=step*(iRe_type+0.5) ! set value of Re to closest value allowed in LUT. … … 238 238 239 239 ! make sure iRe_type is within bounds 240 if (iRe_type >=nRe_types) then240 if (iRe_type.ge.nRe_types) then 241 241 ! write(*,*) 'Warning: size of Re exceed value permitted ', & 242 242 ! 'in Look-Up Table (LUT). Will calculate. ' -
LMDZ6/branches/Amaury_dev/libf/phylmd/cosp/radar_simulator_init.F90
r5082 r5095 74 74 ! ----- INTERNAL ----- 75 75 integer :: i,j 76 real (kind=8):: delt, deltp76 real*8 :: delt, deltp 77 77 78 78 ! -
LMDZ6/branches/Amaury_dev/libf/phylmd/cosp/radar_simulator_types.F90
r5082 r5095 12 12 integer, parameter :: & 13 13 nd = 85 ! number of discrete particles used in construction DSDs 14 real (kind=8), parameter :: &14 real*8, parameter :: & 15 15 dmin = 0.1 ,& ! min size of discrete particle 16 16 dmax = 10000. ! max size of discrete particle … … 36 36 37 37 ! variables used to store hydrometeor "default" properties 38 real (kind=8), dimension(maxhclass) :: p1,p2,p3,dmin,dmax,apm,bpm,rho38 real*8, dimension(maxhclass) :: p1,p2,p3,dmin,dmax,apm,bpm,rho 39 39 integer, dimension(maxhclass) :: dtype,col,cp,phase 40 40 41 41 ! Radar properties 42 real (kind=8):: freq,k242 real*8 :: freq,k2 43 43 integer :: nhclass ! number of hydrometeor classes in use 44 44 integer :: use_gas_abs, do_ray … … 56 56 logical, dimension(maxhclass,nRe_types) :: N_scale_flag 57 57 logical, dimension(maxhclass,mt_ntt,nRe_types) :: Z_scale_flag,Z_scale_added_flag 58 real (kind=8), dimension(maxhclass,mt_ntt,nRe_types) :: Ze_scaled,Zr_scaled,kr_scaled59 real (kind=8), dimension(maxhclass,nd,nRe_types) :: fc, rho_eff58 real*8, dimension(maxhclass,mt_ntt,nRe_types) :: Ze_scaled,Zr_scaled,kr_scaled 59 real*8, dimension(maxhclass,nd,nRe_types) :: fc, rho_eff 60 60 61 61 ! used to determine Re index 62 real (kind=8):: step_list(Re_MAX_BIN),base_list(Re_MAX_BIN)62 real*8 :: step_list(Re_MAX_BIN),base_list(Re_MAX_BIN) 63 63 64 64 ! used to determine temperature index 65 real (kind=8):: &65 real*8 :: & 66 66 mt_ttl(cnt_liq), & ! liquid temperatures (K) 67 67 mt_tti(cnt_ice) ! ice temperatures (K) 68 68 69 real (kind=8):: D(nd) ! set of discrete diameters used to represent DSDs69 real*8 :: D(nd) ! set of discrete diameters used to represent DSDs 70 70 71 71 end type class_param -
LMDZ6/branches/Amaury_dev/libf/phylmd/cosp/scops.F
r5086 r5095 133 133 enddo 134 134 135 if (ncolprint /=0) then135 if (ncolprint.ne.0) then 136 136 write (6,'(a)') 'frac_out_pp_rev:' 137 137 do j=1,npoints,1000 … … 145 145 write (6,'(I3)') ncol 146 146 endif 147 if (ncolprint /=0) then147 if (ncolprint.ne.0) then 148 148 write (6,'(a)') 'last_frac_pp:' 149 149 do j=1,npoints,1000 … … 161 161 162 162 !loop over vertical levels 163 DO ilev = 1,nlev163 DO 200 ilev = 1,nlev 164 164 165 165 ! Initialise threshold 166 166 167 IF (ilev ==1) then167 IF (ilev.eq.1) then 168 168 ! If max overlap 169 IF (overlap ==1) then169 IF (overlap.eq.1) then 170 170 ! select pixels spread evenly 171 171 ! across the gridbox … … 187 187 enddo 188 188 ENDIF 189 IF (ncolprint /=0) then189 IF (ncolprint.ne.0) then 190 190 write (6,'(a)') 'threshold_nsf2:' 191 191 do j=1,npoints,1000 … … 197 197 ENDIF 198 198 199 IF (ncolprint /=0) then199 IF (ncolprint.ne.0) then 200 200 write (6,'(a)') 'ilev:' 201 201 write (6,'(I2)') ilev … … 206 206 ! All versions 207 207 do j=1,npoints 208 if (boxpos(j,ibox) <=conv(j,ilev)) then208 if (boxpos(j,ibox).le.conv(j,ilev)) then 209 209 maxocc(j,ibox) = 1 210 210 else … … 214 214 215 215 ! Max overlap 216 if (overlap ==1) then216 if (overlap.eq.1) then 217 217 do j=1,npoints 218 218 threshold_min(j,ibox)=conv(j,ilev) … … 222 222 223 223 ! Random overlap 224 if (overlap ==2) then224 if (overlap.eq.2) then 225 225 do j=1,npoints 226 226 threshold_min(j,ibox)=conv(j,ilev) … … 230 230 231 231 ! Max/Random overlap 232 if (overlap ==3) then232 if (overlap.eq.3) then 233 233 do j=1,npoints 234 234 threshold_min(j,ibox)=max(conv(j,ilev), 235 235 & min(tca(j,ilev-1),tca(j,ilev))) 236 236 if (threshold(j,ibox) 237 & <min(tca(j,ilev-1),tca(j,ilev))238 & .and.(threshold(j,ibox) >conv(j,ilev))) then237 & .lt.min(tca(j,ilev-1),tca(j,ilev)) 238 & .and.(threshold(j,ibox).gt.conv(j,ilev))) then 239 239 maxosc(j,ibox)= 1 240 240 else … … 276 276 DO ibox=1,ncol 277 277 do j=1,npoints 278 if (tca(j,ilev) >threshold(j,ibox)) then278 if (tca(j,ilev).gt.threshold(j,ibox)) then 279 279 frac_out(j,ibox,ilev)=1 280 280 else … … 289 289 DO ibox=1,ncol 290 290 do j=1,npoints 291 if (threshold(j,ibox) <=conv(j,ilev)) then291 if (threshold(j,ibox).le.conv(j,ilev)) then 292 292 ! = 2 IF threshold le conv(j) 293 293 frac_out(j,ibox,ilev) = 2 … … 302 302 ! from last level next time round 303 303 304 if (ncolprint /=0) then304 if (ncolprint.ne.0) then 305 305 306 306 do j=1,npoints ,1000 … … 331 331 endif 332 332 333 END DO!loop over nlev333 200 CONTINUE !loop over nlev 334 334 335 335 -
LMDZ6/branches/Amaury_dev/libf/phylmd/cosp/zeff.F90
r5086 r5095 35 35 integer, intent(in) :: ice, xr 36 36 integer, intent(in) :: nsizes 37 real (kind=8), intent(in) :: freq,D(nsizes),N(nsizes),tt,qe(nsizes), &37 real*8, intent(in) :: freq,D(nsizes),N(nsizes),tt,qe(nsizes), & 38 38 qs(nsizes), rho_e(nsizes) 39 real (kind=8), intent(inout) :: k239 real*8, intent(inout) :: k2 40 40 41 41 ! ----- OUTPUTS ----- 42 real (kind=8), intent(out) :: z_eff,z_ray,kr42 real*8, intent(out) :: z_eff,z_ray,kr 43 43 44 44 ! ----- INTERNAL ----- 45 45 integer :: & 46 46 correct_for_rho ! correct for density flag 47 real (kind=8), dimension(nsizes) :: &47 real*8, dimension(nsizes) :: & 48 48 D0, & ! D in (m) 49 49 N0, & ! N in m^-3 m^-1 … … 53 53 rho_ice, & ! bulk density ice (kg m^-3) 54 54 f ! ice fraction 55 real (kind=8), dimension(nsizes) :: xtemp56 real (kind=8):: &55 real*8, dimension(nsizes) :: xtemp 56 real*8 :: & 57 57 wl, & ! wavelength (m) 58 58 cr ! kr(dB/km) = cr * kr(1/km) 59 complex (kind=8):: &59 complex*16 :: & 60 60 m ! complex index of refraction of bulk form 61 complex (kind=8), dimension(nsizes) :: &61 complex*16, dimension(nsizes) :: & 62 62 m0 ! complex index of refraction 63 63 64 integer (kind=4):: i,one65 real (kind=8):: pi66 real (kind=8):: eta_sum, eta_mie, const, z0_eff, z0_ray, k_sum, &64 integer*4 :: i,one 65 real*8 :: pi 66 real*8 :: eta_sum, eta_mie, const, z0_eff, z0_ray, k_sum, & 67 67 n_r, n_i, dqv(1), dqsc, dg, dph(1) 68 integer (kind=4):: err69 complex (kind=8):: Xs1(1), Xs2(1)68 integer*4 :: err 69 complex*16 :: Xs1(1), Xs2(1) 70 70 71 71 one=1 … … 113 113 call mieint(sizep(i), m0(i), one, dqv, qext(i), dqsc, qbsca(i), & 114 114 dg, xs1, xs2, dph, err) 115 END DO115 end do 116 116 117 117 else -
LMDZ6/branches/Amaury_dev/libf/phylmd/cosp2/MISR_simulator.F90
r5082 r5095 84 84 do ilev=1,nlev 85 85 ! Define location of "layer top" 86 if(ilev ==1 .or. ilev==nlev) then86 if(ilev.eq.1 .or. ilev.eq.nlev) then 87 87 ztest=zfull(j,ilev) 88 88 else … … 94 94 iMISR_ztop=2 95 95 do loop=2,numMISRHgtBins 96 if ( ztest >1000*misr_histHgt(loop+1) ) then96 if ( ztest .gt. 1000*misr_histHgt(loop+1) ) then 97 97 iMISR_ztop=loop+1 98 98 endif … … 110 110 do ilev=1,nlev 111 111 ! If there a cloud, start the counter and store this height 112 if(thres_crossed_MISR == 0 .and. dtau(j,ibox,ilev) >0.) then112 if(thres_crossed_MISR .eq. 0 .and. dtau(j,ibox,ilev) .gt. 0.) then 113 113 ! First encountered a "cloud" 114 114 thres_crossed_MISR = 1 … … 116 116 endif 117 117 118 if( thres_crossed_MISR < 99 .and. thres_crossed_MISR >0 ) then119 if( dtau(j,ibox,ilev) ==0.) then118 if( thres_crossed_MISR .lt. 99 .and. thres_crossed_MISR .gt. 0 ) then 119 if( dtau(j,ibox,ilev) .eq. 0.) then 120 120 ! We have come to the end of the current cloud layer without yet 121 121 ! selecting a CTH boundary. Restart cloud tau counter … … 129 129 ! current layer cloud top to the current level then MISR will like 130 130 ! see a top below the top of the current layer. 131 if( dtau(j,ibox,ilev) >0 .and. (cloud_dtau-dtau(j,ibox,ilev)) <1) then132 if(dtau(j,ibox,ilev) < 1 .or. ilev==1 .or. ilev==nlev) then131 if( dtau(j,ibox,ilev).gt.0 .and. (cloud_dtau-dtau(j,ibox,ilev)) .lt. 1) then 132 if(dtau(j,ibox,ilev) .lt. 1 .or. ilev.eq.1 .or. ilev.eq.nlev) then 133 133 ! MISR will likely penetrate to some point within this layer ... the middle 134 134 MISR_penetration_height=zfull(j,ilev) … … 142 142 143 143 ! Check for a distinctive water layer 144 if(dtau(j,ibox,ilev) > 1 .and. at(j,ilev) >273 ) then144 if(dtau(j,ibox,ilev) .gt. 1 .and. at(j,ilev) .gt. 273 ) then 145 145 ! Must be a water cloud, take this as CTH level 146 146 thres_crossed_MISR=99 … … 149 149 ! If the total column optical depth is "large" than MISR can't see 150 150 ! anything else. Set current point as CTH level 151 if(sum(dtau(j,ibox,1:ilev)) >5) then151 if(sum(dtau(j,ibox,1:ilev)) .gt. 5) then 152 152 thres_crossed_MISR=99 153 153 endif … … 157 157 ! Check to see if there was a cloud for which we didn't 158 158 ! set a MISR cloud top boundary 159 if( thres_crossed_MISR ==1) then159 if( thres_crossed_MISR .eq. 1) then 160 160 ! If the cloud has a total optical depth of greater 161 161 ! than ~ 0.5 MISR will still likely pick up this cloud 162 162 ! with a height near the true cloud top 163 163 ! otherwise there should be no CTH 164 if(sum(dtau(j,ibox,1:nlev)) >0.5) then164 if(sum(dtau(j,ibox,1:nlev)) .gt. 0.5) then 165 165 ! keep MISR detected CTH 166 elseif(sum(dtau(j,ibox,1:nlev)) >0.2) then166 elseif(sum(dtau(j,ibox,1:nlev)) .gt. 0.2) then 167 167 ! MISR may detect but wont likley have a good height 168 168 box_MISR_ztop(j,ibox)=-1 … … 215 215 ! Fill dark scenes 216 216 do j=1,numMISRHgtBins 217 where(sunlit /=1) dist_model_layertops(1:npoints,j) = R_UNDEF217 where(sunlit .ne. 1) dist_model_layertops(1:npoints,j) = R_UNDEF 218 218 enddo 219 219 … … 257 257 258 258 ! Subcolumns that are cloudy(true) and not(false) 259 box_cloudy(1:ncol) = merge(.true.,.false.,tau(j,1:ncol) >tauchk)259 box_cloudy(1:ncol) = merge(.true.,.false.,tau(j,1:ncol) .gt. tauchk) 260 260 261 261 ! Fill optically thin clouds with fill value 262 262 where(.not. box_cloudy(1:ncol)) tauWRK(j,1:ncol) = -999._wp 263 where(box_MISR_ztopWRK(j,1:ncol) ==0) box_MISR_ztopWRK(j,1:ncol)=-999._wp263 where(box_MISR_ztopWRK(j,1:ncol) .eq. 0) box_MISR_ztopWRK(j,1:ncol)=-999._wp 264 264 265 265 ! Compute joint histogram and column quantities for points that are sunlit and cloudy 266 if (sunlit(j) == 1) then266 if (sunlit(j) .eq. 1) then 267 267 ! Joint histogram 268 268 call hist2D(tauWRK(j,1:ncol),box_MISR_ztopWRK(j,1:ncol),ncol,misr_histTau,numMISRTauBins,& … … 272 272 273 273 ! Column cloud area 274 MISR_cldarea(j)=real(count(box_MISR_ztopWRK(j,1:ncol) /=-999.))/ncol274 MISR_cldarea(j)=real(count(box_MISR_ztopWRK(j,1:ncol) .ne. -999.))/ncol 275 275 276 276 ! Column cloud-top height 277 if ( count(box_MISR_ztopWRK(j,1:ncol) /= -999.) /=0 ) then278 MISR_mean_ztop(j) = sum(box_MISR_ztopWRK(j,1:ncol),box_MISR_ztopWRK(j,1:ncol) /=-999.)/ &279 count(box_MISR_ztopWRK(j,1:ncol) /=-999.)277 if ( count(box_MISR_ztopWRK(j,1:ncol) .ne. -999.) .ne. 0 ) then 278 MISR_mean_ztop(j) = sum(box_MISR_ztopWRK(j,1:ncol),box_MISR_ztopWRK(j,1:ncol) .ne. -999.)/ & 279 count(box_MISR_ztopWRK(j,1:ncol) .ne. -999.) 280 280 else 281 281 MISR_mean_ztop(j) = R_UNDEF -
LMDZ6/branches/Amaury_dev/libf/phylmd/cosp2/cosp.F90
r5086 r5095 402 402 403 403 ! Set flag to deallocate rttov types (only done on final call to simulator) 404 if (size(cospOUT%isccp_meantb) == stop_idx) lrttov_cleanUp = .true.404 if (size(cospOUT%isccp_meantb) .eq. stop_idx) lrttov_cleanUp = .true. 405 405 406 406 ! ISCCP column … … 563 563 modisIN%w0 => cospIN%ss_alb 564 564 modisIN%Nsunlit = count(cospgridIN%sunlit > 0) 565 if (modisIN%Nsunlit >0) then565 if (modisIN%Nsunlit .gt. 0) then 566 566 allocate(modisIN%sunlit(modisIN%Nsunlit),modisIN%pres(modisIN%Nsunlit,cospIN%Nlevels+1)) 567 567 modisIN%sunlit = pack((/ (i, i = 1, Npoints ) /),mask = cospgridIN%sunlit > 0) 568 568 modisIN%pres = cospgridIN%phalf(int(modisIN%sunlit(:)),:) 569 569 endif 570 if (count(cospgridIN%sunlit <= 0) >0) then570 if (count(cospgridIN%sunlit <= 0) .gt. 0) then 571 571 allocate(modisIN%notSunlit(count(cospgridIN%sunlit <= 0))) 572 572 modisIN%notSunlit = pack((/ (i, i = 1, Npoints ) /),mask = .not. cospgridIN%sunlit > 0) … … 731 731 modisRetrievedCloudTopPressure(i,:), & 732 732 modisRetrievedTau(i,:),modisRetrievedSize(i,:)) 733 END DO733 end do 734 734 endif 735 735 endif … … 1450 1450 ! is turned off. 1451 1451 !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 1452 if (any(cospgridIN%sunlit <0)) then1452 if (any(cospgridIN%sunlit .lt. 0)) then 1453 1453 nError=nError+1 1454 1454 errorMessage(nError) = 'ERROR: COSP input variable: cospgridIN%sunlit contains values out of range (0 or 1)' … … 1513 1513 cospOUT%modis_Optical_Thickness_vs_ReffLIQ(:,:,:) = R_UNDEF 1514 1514 endif 1515 if (any(cospgridIN%at < 0)) then1515 if (any(cospgridIN%at .lt. 0)) then 1516 1516 nError=nError+1 1517 1517 errorMessage(nError) = 'ERROR: COSP input variable: cospgridIN%at contains values out of range (at<0), expected units (K)' … … 1549 1549 if (associated(cospOUT%radar_lidar_tcc)) cospOUT%radar_lidar_tcc(:) = R_UNDEF 1550 1550 endif 1551 if (any(cospgridIN%pfull <0)) then1551 if (any(cospgridIN%pfull .lt. 0)) then 1552 1552 nError=nError+1 1553 1553 errorMessage(nError) = 'ERROR: COSP input variable: cospgridIN%pfull contains values out of range' … … 1566 1566 if (associated(cospOUT%isccp_fq)) cospOUT%isccp_fq(:,:,:) = R_UNDEF 1567 1567 endif 1568 if (any(cospgridIN%phalf <0)) then1568 if (any(cospgridIN%phalf .lt. 0)) then 1569 1569 nError=nError+1 1570 1570 errorMessage(nError) = 'ERROR: COSP input variable: cospgridIN%phalf contains values out of range' … … 1632 1632 if (associated(cospOUT%calipso_lidarcldtmp)) cospOUT%calipso_lidarcldtmp(:,:,:) = R_UNDEF 1633 1633 endif 1634 if (any(cospgridIN%qv <0)) then1634 if (any(cospgridIN%qv .lt. 0)) then 1635 1635 nError=nError+1 1636 1636 errorMessage(nError) = 'ERROR: COSP input variable: cospgridIN%qv contains values out of range' … … 1649 1649 if (associated(cospOUT%isccp_fq)) cospOUT%isccp_fq(:,:,:) = R_UNDEF 1650 1650 endif 1651 if (any(cospgridIN%hgt_matrix <-300)) then1651 if (any(cospgridIN%hgt_matrix .lt. -300)) then 1652 1652 nError=nError+1 1653 1653 errorMessage(nError) = 'ERROR: COSP input variable: cospgridIN%hgt_matrix contains values out of range' … … 1674 1674 if (associated(cospOUT%radar_lidar_tcc)) cospOUT%radar_lidar_tcc(:) = R_UNDEF 1675 1675 endif 1676 if (any(cospgridIN%hgt_matrix_half <-300)) then1676 if (any(cospgridIN%hgt_matrix_half .lt. -300)) then 1677 1677 nError=nError+1 1678 1678 errorMessage(nError) = 'ERROR: COSP input variable: cospgridIN%hgt_matrix_half contains values out of range' … … 1693 1693 if (associated(cospOUT%radar_lidar_tcc)) cospOUT%radar_lidar_tcc(:) = R_UNDEF 1694 1694 endif 1695 if (any(cospgridIN%land <0)) then1695 if (any(cospgridIN%land .lt. 0)) then 1696 1696 nError=nError+1 1697 1697 errorMessage(nError) = 'ERROR: COSP input variable: cospgridIN%land contains values out of range' … … 1708 1708 if (associated(cospOUT%parasolGrid_refl)) cospOUT%parasolGrid_refl(:,:) = R_UNDEF 1709 1709 endif 1710 if (any(cospgridIN%skt <0)) then1710 if (any(cospgridIN%skt .lt. 0)) then 1711 1711 nError=nError+1 1712 1712 errorMessage(nError) = 'ERROR: COSP input variable: cospgridIN%skt contains values out of range' … … 1727 1727 1728 1728 ! RTTOV Inputs 1729 if (cospgridIN%zenang < -90. .OR. cospgridIN%zenang >90) then1729 if (cospgridIN%zenang .lt. -90. .OR. cospgridIN%zenang .gt. 90) then 1730 1730 nError=nError+1 1731 1731 errorMessage(nError) = 'ERROR: COSP input variable: cospgridIN%zenang contains values out of range' … … 1733 1733 if (associated(cospOUT%rttov_tbs)) cospOUT%rttov_tbs(:,:) = R_UNDEF 1734 1734 endif 1735 if (cospgridIN%co2 <0) then1735 if (cospgridIN%co2 .lt. 0) then 1736 1736 nError=nError+1 1737 1737 errorMessage(nError) = 'ERROR: COSP input variable: cospgridIN%co2 contains values out of range' … … 1739 1739 if (associated(cospOUT%rttov_tbs)) cospOUT%rttov_tbs(:,:) = R_UNDEF 1740 1740 endif 1741 if (cospgridIN%ch4 <0) then1741 if (cospgridIN%ch4 .lt. 0) then 1742 1742 nError=nError+1 1743 1743 errorMessage(nError) = 'ERROR: COSP input variable: cospgridIN%ch4 contains values out of range' … … 1745 1745 if (associated(cospOUT%rttov_tbs)) cospOUT%rttov_tbs(:,:) = R_UNDEF 1746 1746 endif 1747 if (cospgridIN%n2o <0) then1747 if (cospgridIN%n2o .lt. 0) then 1748 1748 nError=nError+1 1749 1749 errorMessage(nError) = 'ERROR: COSP input variable: cospgridIN%n2o contains values out of range' … … 1751 1751 if (associated(cospOUT%rttov_tbs)) cospOUT%rttov_tbs(:,:) = R_UNDEF 1752 1752 endif 1753 if (cospgridIN%co <0) then1753 if (cospgridIN%co.lt. 0) then 1754 1754 nError=nError+1 1755 1755 errorMessage(nError) = 'ERROR: COSP input variable: cospgridIN%co contains values out of range' … … 1757 1757 if (associated(cospOUT%rttov_tbs)) cospOUT%rttov_tbs(:,:) = R_UNDEF 1758 1758 endif 1759 if (any(cospgridIN%o3 <0)) then1759 if (any(cospgridIN%o3 .lt. 0)) then 1760 1760 nError=nError+1 1761 1761 errorMessage(nError) = 'ERROR: COSP input variable: cospgridIN%o3 contains values out of range' … … 1763 1763 if (associated(cospOUT%rttov_tbs)) cospOUT%rttov_tbs(:,:) = R_UNDEF 1764 1764 endif 1765 if (any(cospgridIN%emis_sfc < 0. .OR. cospgridIN%emis_sfc >1)) then1765 if (any(cospgridIN%emis_sfc .lt. 0. .OR. cospgridIN%emis_sfc .gt. 1)) then 1766 1766 nError=nError+1 1767 1767 errorMessage(nError) = 'ERROR: COSP input variable: cospgridIN%emis_sfc contains values out of range' … … 1769 1769 if (associated(cospOUT%rttov_tbs)) cospOUT%rttov_tbs(:,:) = R_UNDEF 1770 1770 endif 1771 if (any(cospgridIN%u_sfc < -100. .OR. cospgridIN%u_sfc >100.)) then1771 if (any(cospgridIN%u_sfc .lt. -100. .OR. cospgridIN%u_sfc .gt. 100.)) then 1772 1772 nError=nError+1 1773 1773 errorMessage(nError) = 'ERROR: COSP input variable: cospIN%u_sfc contains values out of range' … … 1775 1775 Lrttov_subcolumn = .false. 1776 1776 endif 1777 if (any(cospgridIN%v_sfc < -100. .OR. cospgridIN%v_sfc >100.)) then1777 if (any(cospgridIN%v_sfc .lt. -100. .OR. cospgridIN%v_sfc .gt. 100.)) then 1778 1778 nError=nError+1 1779 1779 errorMessage(nError) = 'ERROR: COSP input variable: cospIN%v_sfc contains values out of range' … … 1781 1781 if (associated(cospOUT%rttov_tbs)) cospOUT%rttov_tbs(:,:) = R_UNDEF 1782 1782 endif 1783 if (any(cospgridIN%lat < -90 .OR. cospgridIN%lat >90)) then1783 if (any(cospgridIN%lat .lt. -90 .OR. cospgridIN%lat .gt. 90)) then 1784 1784 nError=nError+1 1785 1785 errorMessage(nError) = 'ERROR: COSP input variable: cospIN%lat contains values out of range' … … 1789 1789 1790 1790 ! COSP_INPUTS 1791 if (cospIN%emsfc_lw < 0. .OR. cospIN%emsfc_lw >1.) then1791 if (cospIN%emsfc_lw .lt. 0. .OR. cospIN%emsfc_lw .gt. 1.) then 1792 1792 nError=nError+1 1793 1793 errorMessage(nError) = 'ERROR: COSP input variable: cospIN%emsfc_lw contains values out of range' … … 1805 1805 1806 1806 endif 1807 if (any(cospIN%tau_067 <0)) then1807 if (any(cospIN%tau_067 .lt. 0)) then 1808 1808 nError=nError+1 1809 1809 errorMessage(nError) = 'ERROR: COSP input variable: cospIN%tau_067 contains values out of range' … … 1870 1870 1871 1871 endif 1872 if (any(cospIN%emiss_11 < 0. .OR. cospIN%emiss_11 >1)) then1872 if (any(cospIN%emiss_11 .lt. 0. .OR. cospIN%emiss_11 .gt. 1)) then 1873 1873 nError=nError+1 1874 1874 errorMessage(nError) = 'ERROR: COSP input variable: cospIN%emiss_11 contains values out of range' … … 1886 1886 1887 1887 endif 1888 if (any(cospIN%asym < -1. .OR. cospIN%asym >1)) then1888 if (any(cospIN%asym .lt. -1. .OR. cospIN%asym .gt. 1)) then 1889 1889 nError=nError+1 1890 1890 errorMessage(nError) = 'ERROR: COSP input variable: cospIN%asym contains values out of range' … … 1932 1932 cospOUT%modis_Optical_Thickness_vs_ReffLIQ(:,:,:) = R_UNDEF 1933 1933 endif 1934 if (any(cospIN%ss_alb < 0 .OR. cospIN%ss_alb >1)) then1934 if (any(cospIN%ss_alb .lt. 0 .OR. cospIN%ss_alb .gt. 1)) then 1935 1935 nError=nError+1 1936 1936 errorMessage(nError) = 'ERROR: COSP input variable: cospIN%ss_alb contains values out of range' … … 1978 1978 cospOUT%modis_Optical_Thickness_vs_ReffLIQ(:,:,:) = R_UNDEF 1979 1979 endif 1980 if (any(cospIN%betatot <0)) then1980 if (any(cospIN%betatot .lt. 0)) then 1981 1981 nError=nError+1 1982 1982 errorMessage(nError) = 'ERROR: COSP input variable: cospIN%betatot contains values out of range' … … 1991 1991 if (associated(cospOUT%calipso_srbval)) cospOUT%calipso_srbval(:) = R_UNDEF 1992 1992 endif 1993 if (any(cospIN%betatot_liq <0)) then1993 if (any(cospIN%betatot_liq .lt. 0)) then 1994 1994 nError=nError+1 1995 1995 errorMessage(nError) = ('ERROR: COSP input variable: cospIN%betatot_liq contains values out of range') … … 2004 2004 if (associated(cospOUT%calipso_srbval)) cospOUT%calipso_srbval(:) = R_UNDEF 2005 2005 endif 2006 if (any(cospIN%betatot_ice <0)) then2006 if (any(cospIN%betatot_ice .lt. 0)) then 2007 2007 nError=nError+1 2008 2008 errorMessage(nError) = 'ERROR: COSP input variable: cospIN%betatot_ice contains values out of range' … … 2017 2017 if (associated(cospOUT%calipso_srbval)) cospOUT%calipso_srbval(:) = R_UNDEF 2018 2018 endif 2019 if (any(cospIN%beta_mol <0)) then2019 if (any(cospIN%beta_mol .lt. 0)) then 2020 2020 nError=nError+1 2021 2021 errorMessage(nError) = 'ERROR: COSP input variable: cospIN%beta_mol contains values out of range' … … 2036 2036 if (associated(cospOUT%radar_lidar_tcc)) cospOUT%radar_lidar_tcc(:) = R_UNDEF 2037 2037 endif 2038 if (any(cospIN%tautot <0)) then2038 if (any(cospIN%tautot .lt. 0)) then 2039 2039 nError=nError+1 2040 2040 errorMessage(nError) = 'ERROR: COSP input variable: cospIN%tautot contains values out of range' … … 2049 2049 if (associated(cospOUT%calipso_srbval)) cospOUT%calipso_srbval(:) = R_UNDEF 2050 2050 endif 2051 if (any(cospIN%tautot_liq <0)) then2051 if (any(cospIN%tautot_liq .lt. 0)) then 2052 2052 nError=nError+1 2053 2053 errorMessage(nError) = ('ERROR: COSP input variable: cospIN%tautot_liq contains values out of range') … … 2062 2062 if (associated(cospOUT%calipso_srbval)) cospOUT%calipso_srbval(:) = R_UNDEF 2063 2063 endif 2064 if (any(cospIN%tautot_ice <0)) then2064 if (any(cospIN%tautot_ice .lt. 0)) then 2065 2065 nError=nError+1 2066 2066 errorMessage(nError) = 'ERROR: COSP input variable: cospIN%tautot_ice contains values out of range' … … 2075 2075 if (associated(cospOUT%calipso_srbval)) cospOUT%calipso_srbval(:) = R_UNDEF 2076 2076 endif 2077 if (any(cospIN%tau_mol <0)) then2077 if (any(cospIN%tau_mol .lt. 0)) then 2078 2078 nError=nError+1 2079 2079 errorMessage(nError) = 'ERROR: COSP input variable: cospIN%tau_mol contains values out of range' … … 2088 2088 if (associated(cospOUT%calipso_srbval)) cospOUT%calipso_srbval(:) = R_UNDEF 2089 2089 endif 2090 if (any(cospIN%tautot_S_liq <0)) then2090 if (any(cospIN%tautot_S_liq .lt. 0)) then 2091 2091 nError=nError+1 2092 2092 errorMessage(nError) = 'ERROR: COSP input variable: cospIN%tautot_S_liq contains values out of range' … … 2096 2096 if (associated(cospOUT%parasolGrid_refl)) cospOUT%parasolGrid_refl(:,:) = R_UNDEF 2097 2097 endif 2098 if (any(cospIN%tautot_S_ice <0)) then2098 if (any(cospIN%tautot_S_ice .lt. 0)) then 2099 2099 nError=nError+1 2100 2100 errorMessage(nError) = 'ERROR: COSP input variable: cospIN%tautot_S_ice contains values out of range' … … 2104 2104 if (associated(cospOUT%parasolGrid_refl)) cospOUT%parasolGrid_refl(:,:) = R_UNDEF 2105 2105 endif 2106 if (any(cospIN%z_vol_cloudsat <0)) then2106 if (any(cospIN%z_vol_cloudsat .lt. 0)) then 2107 2107 nError=nError+1 2108 2108 errorMessage(nError) = 'ERROR: COSP input variable: cospIN%z_vol_cloudsat contains values out of range' … … 2116 2116 if (associated(cospOUT%radar_lidar_tcc)) cospOUT%radar_lidar_tcc(:) = R_UNDEF 2117 2117 endif 2118 if (any(cospIN%kr_vol_cloudsat <0)) then2118 if (any(cospIN%kr_vol_cloudsat .lt. 0)) then 2119 2119 nError=nError+1 2120 2120 errorMessage(nError) = 'ERROR: COSP input variable: cospIN%kr_vol_cloudsat contains values out of range' … … 2128 2128 if (associated(cospOUT%radar_lidar_tcc)) cospOUT%radar_lidar_tcc(:) = R_UNDEF 2129 2129 endif 2130 if (any(cospIN%g_vol_cloudsat <0)) then2130 if (any(cospIN%g_vol_cloudsat .lt. 0)) then 2131 2131 nError=nError+1 2132 2132 errorMessage(nError) = 'ERROR: COSP input variable: cospIN%g_vol_cloudsat contains values out of range' … … 2145 2145 !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 2146 2146 ! ISCCP 2147 if (size(cospIN%frac_out,1) /=cospIN%Npoints .OR. &2148 size(cospIN%tau_067,1) /=cospIN%Npoints .OR. &2149 size(cospIN%emiss_11,1) /=cospIN%Npoints .OR. &2150 size(cospgridIN%skt) /=cospIN%Npoints .OR. &2151 size(cospgridIN%qv,1) /=cospIN%Npoints .OR. &2152 size(cospgridIN%at,1) /=cospIN%Npoints .OR. &2153 size(cospgridIN%phalf,1) /=cospIN%Npoints .OR. &2154 size(cospgridIN%sunlit) /=cospIN%Npoints .OR. &2155 size(cospgridIN%pfull,1) /=cospIN%Npoints) then2147 if (size(cospIN%frac_out,1) .ne. cospIN%Npoints .OR. & 2148 size(cospIN%tau_067,1) .ne. cospIN%Npoints .OR. & 2149 size(cospIN%emiss_11,1) .ne. cospIN%Npoints .OR. & 2150 size(cospgridIN%skt) .ne. cospIN%Npoints .OR. & 2151 size(cospgridIN%qv,1) .ne. cospIN%Npoints .OR. & 2152 size(cospgridIN%at,1) .ne. cospIN%Npoints .OR. & 2153 size(cospgridIN%phalf,1) .ne. cospIN%Npoints .OR. & 2154 size(cospgridIN%sunlit) .ne. cospIN%Npoints .OR. & 2155 size(cospgridIN%pfull,1) .ne. cospIN%Npoints) then 2156 2156 Lisccp_subcolumn = .false. 2157 2157 Lisccp_column = .false. … … 2159 2159 errorMessage(nError) = 'ERROR(isccp_simulator): The number of points in the input fields are inconsistent' 2160 2160 endif 2161 if (size(cospIN%frac_out,2) /=cospIN%Ncolumns .OR. &2162 size(cospIN%tau_067,2) /=cospIN%Ncolumns .OR. &2163 size(cospIN%emiss_11,2) /=cospIN%Ncolumns) then2161 if (size(cospIN%frac_out,2) .ne. cospIN%Ncolumns .OR. & 2162 size(cospIN%tau_067,2) .ne. cospIN%Ncolumns .OR. & 2163 size(cospIN%emiss_11,2) .ne. cospIN%Ncolumns) then 2164 2164 Lisccp_subcolumn = .false. 2165 2165 Lisccp_column = .false. … … 2167 2167 errorMessage(nError) = 'ERROR(isccp_simulator): The number of sub-columns in the input fields are inconsistent' 2168 2168 endif 2169 if (size(cospIN%frac_out,3) /=cospIN%Nlevels .OR. &2170 size(cospIN%tau_067,3) /=cospIN%Nlevels .OR. &2171 size(cospIN%emiss_11,3) /=cospIN%Nlevels .OR. &2172 size(cospgridIN%qv,2) /=cospIN%Nlevels .OR. &2173 size(cospgridIN%at,2) /=cospIN%Nlevels .OR. &2174 size(cospgridIN%pfull,2) /= cospIN%Nlevels .OR. &2175 size(cospgridIN%phalf,2) /=cospIN%Nlevels+1) then2169 if (size(cospIN%frac_out,3) .ne. cospIN%Nlevels .OR. & 2170 size(cospIN%tau_067,3) .ne. cospIN%Nlevels .OR. & 2171 size(cospIN%emiss_11,3) .ne. cospIN%Nlevels .OR. & 2172 size(cospgridIN%qv,2) .ne. cospIN%Nlevels .OR. & 2173 size(cospgridIN%at,2) .ne. cospIN%Nlevels .OR. & 2174 size(cospgridIN%pfull,2) .ne. cospIN%Nlevels .OR. & 2175 size(cospgridIN%phalf,2) .ne. cospIN%Nlevels+1) then 2176 2176 Lisccp_subcolumn = .false. 2177 2177 Lisccp_column = .false. … … 2181 2181 2182 2182 ! MISR 2183 if (size(cospIN%tau_067,1) /=cospIN%Npoints .OR. &2184 size(cospgridIN%sunlit) /= cospIN%Npoints .OR. &2185 size(cospgridIN%hgt_matrix,1) /=cospIN%Npoints .OR. &2186 size(cospgridIN%at,1) /=cospIN%Npoints) then2183 if (size(cospIN%tau_067,1) .ne. cospIN%Npoints .OR. & 2184 size(cospgridIN%sunlit) .ne. cospIN%Npoints .OR. & 2185 size(cospgridIN%hgt_matrix,1) .ne. cospIN%Npoints .OR. & 2186 size(cospgridIN%at,1) .ne. cospIN%Npoints) then 2187 2187 Lmisr_subcolumn = .false. 2188 2188 Lmisr_column = .false. … … 2190 2190 errorMessage(nError) = 'ERROR(misr_simulator): The number of points in the input fields are inconsistent' 2191 2191 endif 2192 if (size(cospIN%tau_067,2) /=cospIN%Ncolumns) then2192 if (size(cospIN%tau_067,2) .ne. cospIN%Ncolumns) then 2193 2193 Lmisr_subcolumn = .false. 2194 2194 Lmisr_column = .false. … … 2196 2196 errorMessage(nError) = 'ERROR(misr_simulator): The number of sub-columns in the input fields are inconsistent' 2197 2197 endif 2198 if (size(cospIN%tau_067,3) /=cospIN%Nlevels .OR. &2199 size(cospgridIN%hgt_matrix,2) /=cospIN%Nlevels .OR. &2200 size(cospgridIN%at,2) /=cospIN%Nlevels) then2198 if (size(cospIN%tau_067,3) .ne. cospIN%Nlevels .OR. & 2199 size(cospgridIN%hgt_matrix,2) .ne. cospIN%Nlevels .OR. & 2200 size(cospgridIN%at,2) .ne. cospIN%Nlevels) then 2201 2201 Lmisr_subcolumn = .false. 2202 2202 Lmisr_column = .false. … … 2206 2206 2207 2207 ! MODIS 2208 if (size(cospIN%fracLiq,1) /=cospIN%Npoints .OR. &2209 size(cospIN%tau_067,1) /=cospIN%Npoints .OR. &2210 size(cospIN%asym,1) /=cospIN%Npoints .OR. &2211 size(cospIN%ss_alb,1) /=cospIN%Npoints) then2208 if (size(cospIN%fracLiq,1) .ne. cospIN%Npoints .OR. & 2209 size(cospIN%tau_067,1) .ne. cospIN%Npoints .OR. & 2210 size(cospIN%asym,1) .ne. cospIN%Npoints .OR. & 2211 size(cospIN%ss_alb,1) .ne. cospIN%Npoints) then 2212 2212 Lmodis_subcolumn = .false. 2213 2213 Lmodis_column = .false. … … 2215 2215 errorMessage(nError) = 'ERROR(modis_simulator): The number of points in the input fields are inconsistent' 2216 2216 endif 2217 if (size(cospIN%fracLiq,2) /=cospIN%Ncolumns .OR. &2218 size(cospIN%tau_067,2) /=cospIN%Ncolumns .OR. &2219 size(cospIN%asym,2) /=cospIN%Ncolumns .OR. &2220 size(cospIN%ss_alb,2) /=cospIN%Ncolumns) then2217 if (size(cospIN%fracLiq,2) .ne. cospIN%Ncolumns .OR. & 2218 size(cospIN%tau_067,2) .ne. cospIN%Ncolumns .OR. & 2219 size(cospIN%asym,2) .ne. cospIN%Ncolumns .OR. & 2220 size(cospIN%ss_alb,2) .ne. cospIN%Ncolumns) then 2221 2221 Lmodis_subcolumn = .false. 2222 2222 Lmodis_column = .false. … … 2224 2224 errorMessage(nError) = 'ERROR(modis_simulator): The number of sub-columns in the input fields are inconsistent' 2225 2225 endif 2226 if (size(cospIN%fracLiq,3) /=cospIN%Nlevels .OR. &2227 size(cospIN%tau_067,3) /=cospIN%Nlevels .OR. &2228 size(cospIN%asym,3) /=cospIN%Nlevels .OR. &2229 size(cospIN%ss_alb,3) /=cospIN%Nlevels) then2226 if (size(cospIN%fracLiq,3) .ne. cospIN%Nlevels .OR. & 2227 size(cospIN%tau_067,3) .ne. cospIN%Nlevels .OR. & 2228 size(cospIN%asym,3) .ne. cospIN%Nlevels .OR. & 2229 size(cospIN%ss_alb,3) .ne. cospIN%Nlevels) then 2230 2230 Lmodis_subcolumn = .false. 2231 2231 Lmodis_column = .false. … … 2235 2235 2236 2236 ! CLOUDSAT 2237 if (size(cospIN%z_vol_cloudsat,1) /=cospIN%Npoints .OR. &2238 size(cospIN%kr_vol_cloudsat,1) /=cospIN%Npoints .OR. &2239 size(cospIN%g_vol_cloudsat,1) /=cospIN%Npoints .OR. &2240 size(cospgridIN%hgt_matrix,1) /=cospIN%Npoints) then2237 if (size(cospIN%z_vol_cloudsat,1) .ne. cospIN%Npoints .OR. & 2238 size(cospIN%kr_vol_cloudsat,1) .ne. cospIN%Npoints .OR. & 2239 size(cospIN%g_vol_cloudsat,1) .ne. cospIN%Npoints .OR. & 2240 size(cospgridIN%hgt_matrix,1) .ne. cospIN%Npoints) then 2241 2241 Lcloudsat_subcolumn = .false. 2242 2242 Lcloudsat_column = .false. … … 2244 2244 errorMessage(nError) = 'ERROR(cloudsat_simulator): The number of points in the input fields are inconsistent' 2245 2245 endif 2246 if (size(cospIN%z_vol_cloudsat,2) /=cospIN%Ncolumns .OR. &2247 size(cospIN%kr_vol_cloudsat,2) /=cospIN%Ncolumns .OR. &2248 size(cospIN%g_vol_cloudsat,2) /=cospIN%Ncolumns) then2246 if (size(cospIN%z_vol_cloudsat,2) .ne. cospIN%Ncolumns .OR. & 2247 size(cospIN%kr_vol_cloudsat,2) .ne. cospIN%Ncolumns .OR. & 2248 size(cospIN%g_vol_cloudsat,2) .ne. cospIN%Ncolumns) then 2249 2249 Lcloudsat_subcolumn = .false. 2250 2250 Lcloudsat_column = .false. … … 2252 2252 errorMessage(nError) = 'ERROR(cloudsat_simulator): The number of sub-columns in the input fields are inconsistent' 2253 2253 endif 2254 if (size(cospIN%z_vol_cloudsat,3) /=cospIN%Nlevels .OR. &2255 size(cospIN%kr_vol_cloudsat,3) /=cospIN%Nlevels .OR. &2256 size(cospIN%g_vol_cloudsat,3) /=cospIN%Nlevels .OR. &2257 size(cospgridIN%hgt_matrix,2) /=cospIN%Nlevels) then2254 if (size(cospIN%z_vol_cloudsat,3) .ne. cospIN%Nlevels .OR. & 2255 size(cospIN%kr_vol_cloudsat,3) .ne. cospIN%Nlevels .OR. & 2256 size(cospIN%g_vol_cloudsat,3) .ne. cospIN%Nlevels .OR. & 2257 size(cospgridIN%hgt_matrix,2) .ne. cospIN%Nlevels) then 2258 2258 Lcloudsat_subcolumn = .false. 2259 2259 Lcloudsat_column = .false. … … 2263 2263 2264 2264 ! CALIPSO 2265 if (size(cospIN%beta_mol,1) /=cospIN%Npoints .OR. &2266 size(cospIN%betatot,1) /=cospIN%Npoints .OR. &2267 size(cospIN%betatot_liq,1) /=cospIN%Npoints .OR. &2268 size(cospIN%betatot_ice,1) /=cospIN%Npoints .OR. &2269 size(cospIN%tau_mol,1) /=cospIN%Npoints .OR. &2270 size(cospIN%tautot,1) /=cospIN%Npoints .OR. &2271 size(cospIN%tautot_liq,1) /=cospIN%Npoints .OR. &2272 size(cospIN%tautot_ice,1) /=cospIN%Npoints) then2265 if (size(cospIN%beta_mol,1) .ne. cospIN%Npoints .OR. & 2266 size(cospIN%betatot,1) .ne. cospIN%Npoints .OR. & 2267 size(cospIN%betatot_liq,1) .ne. cospIN%Npoints .OR. & 2268 size(cospIN%betatot_ice,1) .ne. cospIN%Npoints .OR. & 2269 size(cospIN%tau_mol,1) .ne. cospIN%Npoints .OR. & 2270 size(cospIN%tautot,1) .ne. cospIN%Npoints .OR. & 2271 size(cospIN%tautot_liq,1) .ne. cospIN%Npoints .OR. & 2272 size(cospIN%tautot_ice,1) .ne. cospIN%Npoints) then 2273 2273 Lcalipso_subcolumn = .false. 2274 2274 Lcalipso_column = .false. … … 2276 2276 errorMessage(nError) = 'ERROR(calipso_simulator): The number of points in the input fields are inconsistent' 2277 2277 endif 2278 if (size(cospIN%betatot,2) /=cospIN%Ncolumns .OR. &2279 size(cospIN%betatot_liq,2) /=cospIN%Ncolumns .OR. &2280 size(cospIN%betatot_ice,2) /=cospIN%Ncolumns .OR. &2281 size(cospIN%tautot,2) /=cospIN%Ncolumns .OR. &2282 size(cospIN%tautot_liq,2) /=cospIN%Ncolumns .OR. &2283 size(cospIN%tautot_ice,2) /=cospIN%Ncolumns) then2278 if (size(cospIN%betatot,2) .ne. cospIN%Ncolumns .OR. & 2279 size(cospIN%betatot_liq,2) .ne. cospIN%Ncolumns .OR. & 2280 size(cospIN%betatot_ice,2) .ne. cospIN%Ncolumns .OR. & 2281 size(cospIN%tautot,2) .ne. cospIN%Ncolumns .OR. & 2282 size(cospIN%tautot_liq,2) .ne. cospIN%Ncolumns .OR. & 2283 size(cospIN%tautot_ice,2) .ne. cospIN%Ncolumns) then 2284 2284 Lcalipso_subcolumn = .false. 2285 2285 Lcalipso_column = .false. … … 2287 2287 errorMessage(nError) = 'ERROR(calipso_simulator): The number of sub-columns in the input fields are inconsistent' 2288 2288 endif 2289 if (size(cospIN%beta_mol,2) /=cospIN%Nlevels .OR. &2290 size(cospIN%betatot,3) /=cospIN%Nlevels .OR. &2291 size(cospIN%betatot_liq,3) /=cospIN%Nlevels .OR. &2292 size(cospIN%betatot_ice,3) /=cospIN%Nlevels .OR. &2293 size(cospIN%tau_mol,2) /=cospIN%Nlevels .OR. &2294 size(cospIN%tautot,3) /=cospIN%Nlevels .OR. &2295 size(cospIN%tautot_liq,3) /=cospIN%Nlevels .OR. &2296 size(cospIN%tautot_ice,3) /=cospIN%Nlevels) then2289 if (size(cospIN%beta_mol,2) .ne. cospIN%Nlevels .OR. & 2290 size(cospIN%betatot,3) .ne. cospIN%Nlevels .OR. & 2291 size(cospIN%betatot_liq,3) .ne. cospIN%Nlevels .OR. & 2292 size(cospIN%betatot_ice,3) .ne. cospIN%Nlevels .OR. & 2293 size(cospIN%tau_mol,2) .ne. cospIN%Nlevels .OR. & 2294 size(cospIN%tautot,3) .ne. cospIN%Nlevels .OR. & 2295 size(cospIN%tautot_liq,3) .ne. cospIN%Nlevels .OR. & 2296 size(cospIN%tautot_ice,3) .ne. cospIN%Nlevels) then 2297 2297 Lcalipso_subcolumn = .false. 2298 2298 Lcalipso_column = .false. … … 2302 2302 2303 2303 ! PARASOL 2304 if (size(cospIN%tautot_S_liq,1) /=cospIN%Npoints .OR. &2305 size(cospIN%tautot_S_ice,1) /=cospIN%Npoints) then2304 if (size(cospIN%tautot_S_liq,1) .ne. cospIN%Npoints .OR. & 2305 size(cospIN%tautot_S_ice,1) .ne. cospIN%Npoints) then 2306 2306 Lparasol_subcolumn = .false. 2307 2307 Lparasol_column = .false. … … 2309 2309 errorMessage(nError) = 'ERROR(parasol_simulator): The number of points in the input fields are inconsistent' 2310 2310 endif 2311 if (size(cospIN%tautot_S_liq,2) /=cospIN%Ncolumns .OR. &2312 size(cospIN%tautot_S_ice,2) /=cospIN%Ncolumns) then2311 if (size(cospIN%tautot_S_liq,2) .ne. cospIN%Ncolumns .OR. & 2312 size(cospIN%tautot_S_ice,2) .ne. cospIN%Ncolumns) then 2313 2313 Lparasol_subcolumn = .false. 2314 2314 Lparasol_column = .false. … … 2318 2318 2319 2319 ! RTTOV 2320 if (size(cospgridIN%pfull,1) /=cospIN%Npoints .OR. &2321 size(cospgridIN%at,1) /=cospIN%Npoints .OR. &2322 size(cospgridIN%qv,1) /=cospIN%Npoints .OR. &2323 size(cospgridIN%hgt_matrix_half,1) /=cospIN%Npoints .OR. &2324 size(cospgridIN%u_sfc) /=cospIN%Npoints .OR. &2325 size(cospgridIN%v_sfc) /=cospIN%Npoints .OR. &2326 size(cospgridIN%skt) /=cospIN%Npoints .OR. &2327 size(cospgridIN%phalf,1) /=cospIN%Npoints .OR. &2328 size(cospgridIN%qv,1) /=cospIN%Npoints .OR. &2329 size(cospgridIN%land) /=cospIN%Npoints .OR. &2330 size(cospgridIN%lat) /=cospIN%Npoints) then2320 if (size(cospgridIN%pfull,1) .ne. cospIN%Npoints .OR. & 2321 size(cospgridIN%at,1) .ne. cospIN%Npoints .OR. & 2322 size(cospgridIN%qv,1) .ne. cospIN%Npoints .OR. & 2323 size(cospgridIN%hgt_matrix_half,1) .ne. cospIN%Npoints .OR. & 2324 size(cospgridIN%u_sfc) .ne. cospIN%Npoints .OR. & 2325 size(cospgridIN%v_sfc) .ne. cospIN%Npoints .OR. & 2326 size(cospgridIN%skt) .ne. cospIN%Npoints .OR. & 2327 size(cospgridIN%phalf,1) .ne. cospIN%Npoints .OR. & 2328 size(cospgridIN%qv,1) .ne. cospIN%Npoints .OR. & 2329 size(cospgridIN%land) .ne. cospIN%Npoints .OR. & 2330 size(cospgridIN%lat) .ne. cospIN%Npoints) then 2331 2331 Lrttov_subcolumn = .false. 2332 2332 Lrttov_column = .false. … … 2334 2334 errorMessage(nError) = 'ERROR(rttov_simulator): The number of points in the input fields are inconsistent' 2335 2335 endif 2336 if (size(cospgridIN%pfull,2) /=cospIN%Nlevels .OR. &2337 size(cospgridIN%at,2) /=cospIN%Nlevels .OR. &2338 size(cospgridIN%qv,2) /=cospIN%Nlevels .OR. &2339 size(cospgridIN%hgt_matrix_half,2) /=cospIN%Nlevels+1 .OR. &2340 size(cospgridIN%phalf,2) /=cospIN%Nlevels+1 .OR. &2341 size(cospgridIN%qv,2) /=cospIN%Nlevels) then2336 if (size(cospgridIN%pfull,2) .ne. cospIN%Nlevels .OR. & 2337 size(cospgridIN%at,2) .ne. cospIN%Nlevels .OR. & 2338 size(cospgridIN%qv,2) .ne. cospIN%Nlevels .OR. & 2339 size(cospgridIN%hgt_matrix_half,2) .ne. cospIN%Nlevels+1 .OR. & 2340 size(cospgridIN%phalf,2) .ne. cospIN%Nlevels+1 .OR. & 2341 size(cospgridIN%qv,2) .ne. cospIN%Nlevels) then 2342 2342 Lrttov_subcolumn = .false. 2343 2343 Lrttov_column = .false. -
LMDZ6/branches/Amaury_dev/libf/phylmd/cosp2/cosp_interface_v1p4.F90
r5082 r5095 684 684 ! Determine indices for "chunking" (again, if necessary) 685 685 !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 686 if (num_chunks ==1) then686 if (num_chunks .eq. 1) then 687 687 start_idx = 1 688 688 end_idx = gbx%Npoints … … 691 691 start_idx = (i-1)*gbx%Npoints_it+1 692 692 end_idx = i*gbx%Npoints_it 693 if (end_idx >gbx%Npoints) end_idx=gbx%Npoints693 if (end_idx .gt. gbx%Npoints) end_idx=gbx%Npoints 694 694 Nptsperit = end_idx-start_idx+1 695 695 endif … … 698 698 ! Allocate space 699 699 !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 700 if (i ==1) then700 if (i .eq. 1) then 701 701 call construct_cospIN(Nptsperit,gbx%ncolumns,gbx%nlevels,cospIN) 702 702 call construct_cospstateIN(Nptsperit,gbx%nlevels,gbx%nchan,cospstateIN) 703 703 endif 704 if (i ==num_chunks) then704 if (i .eq. num_chunks) then 705 705 call destroy_cospIN(cospIN) 706 706 call destroy_cospstateIN(cospstateIN) … … 948 948 cospgridIN%phalf(:,1) = 0._wp 949 949 cospgridIN%phalf(:,2:gbx%Nlevels+1) = gbx%ph(start_idx:end_idx,gbx%Nlevels:1:-1) 950 if (gbx%Ncolumns >1) then950 if (gbx%Ncolumns .gt. 1) then 951 951 952 952 !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% … … 956 956 seed(:)=0 957 957 seed = int(gbx%psfc) ! In case of Npoints=1 958 if (Npoints >1) seed=int((gbx%psfc(start_idx:end_idx)-minval(gbx%psfc(start_idx:end_idx)))/ &958 if (Npoints .gt. 1) seed=int((gbx%psfc(start_idx:end_idx)-minval(gbx%psfc(start_idx:end_idx)))/ & 959 959 (maxval(gbx%psfc(start_idx:end_idx))-minval(gbx%psfc(start_idx:end_idx)))*100000) + 1 960 960 call init_rng(rngs, seed) … … 964 964 !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 965 965 ! Call SCOPS 966 if (gbx%Ncolumns >1) then966 if (gbx%Ncolumns .gt. 1) then 967 967 call scops(npoints,gbx%Nlevels,gbx%Ncolumns,rngs, & 968 968 gbx%tca(start_idx:end_idx,gbx%Nlevels:1:-1), & … … 1018 1018 if (sgx%frac_out(start_idx+j-1,i,gbx%Nlevels+1-k) == I_CVC) & 1019 1019 frac_cv(j,k) = frac_cv(j,k)+1._wp 1020 if (sgx%prec_frac(start_idx+j-1,i,gbx%Nlevels+1-k) ==1) &1020 if (sgx%prec_frac(start_idx+j-1,i,gbx%Nlevels+1-k) .eq. 1) & 1021 1021 prec_ls(j,k) = prec_ls(j,k)+1._wp 1022 if (sgx%prec_frac(start_idx+j-1,i,gbx%Nlevels+1-k) ==2) &1022 if (sgx%prec_frac(start_idx+j-1,i,gbx%Nlevels+1-k) .eq. 2) & 1023 1023 prec_cv(j,k) = prec_cv(j,k)+1._wp 1024 if (sgx%prec_frac(start_idx+j-1,i,gbx%Nlevels+1-k) ==3) &1024 if (sgx%prec_frac(start_idx+j-1,i,gbx%Nlevels+1-k) .eq. 3) & 1025 1025 prec_cv(j,k) = prec_cv(j,k)+1._wp 1026 if (sgx%prec_frac(start_idx+j-1,i,gbx%Nlevels+1-k) ==3) &1026 if (sgx%prec_frac(start_idx+j-1,i,gbx%Nlevels+1-k) .eq. 3) & 1027 1027 prec_ls(j,k) = prec_ls(j,k)+1._wp 1028 1028 enddo … … 1099 1099 do j=1,npoints 1100 1100 ! Clouds 1101 if (frac_ls(j,k) /=0.) then1101 if (frac_ls(j,k) .ne. 0.) then 1102 1102 mr_hydro(j,:,k,I_LSCLIQ) = mr_hydro(j,:,k,I_LSCLIQ)/frac_ls(j,k) 1103 1103 mr_hydro(j,:,k,I_LSCICE) = mr_hydro(j,:,k,I_LSCICE)/frac_ls(j,k) 1104 1104 endif 1105 if (frac_cv(j,k) /=0.) then1105 if (frac_cv(j,k) .ne. 0.) then 1106 1106 mr_hydro(j,:,k,I_CVCLIQ) = mr_hydro(j,:,k,I_CVCLIQ)/frac_cv(j,k) 1107 1107 mr_hydro(j,:,k,I_CVCICE) = mr_hydro(j,:,k,I_CVCICE)/frac_cv(j,k) … … 1109 1109 ! Precipitation 1110 1110 if (gbx%use_precipitation_fluxes) then 1111 if (prec_ls(j,k) /=0.) then1111 if (prec_ls(j,k) .ne. 0.) then 1112 1112 gbx%rain_ls(start_idx+j-1,k) = gbx%rain_ls(start_idx+j-1,k)/prec_ls(j,k) 1113 1113 gbx%snow_ls(start_idx+j-1,k) = gbx%snow_ls(start_idx+j-1,k)/prec_ls(j,k) 1114 1114 gbx%grpl_ls(start_idx+j-1,k) = gbx%grpl_ls(start_idx+j-1,k)/prec_ls(j,k) 1115 1115 endif 1116 if (prec_cv(j,k) /=0.) then1116 if (prec_cv(j,k) .ne. 0.) then 1117 1117 gbx%rain_cv(start_idx+j-1,k) = gbx%rain_cv(start_idx+j-1,k)/prec_cv(j,k) 1118 1118 gbx%snow_cv(start_idx+j-1,k) = gbx%snow_cv(start_idx+j-1,k)/prec_cv(j,k) 1119 1119 endif 1120 1120 else 1121 if (prec_ls(j,k) /=0.) then1121 if (prec_ls(j,k) .ne. 0.) then 1122 1122 mr_hydro(j,:,k,I_LSRAIN) = mr_hydro(j,:,k,I_LSRAIN)/prec_ls(j,k) 1123 1123 mr_hydro(j,:,k,I_LSSNOW) = mr_hydro(j,:,k,I_LSSNOW)/prec_ls(j,k) 1124 1124 mr_hydro(j,:,k,I_LSGRPL) = mr_hydro(j,:,k,I_LSGRPL)/prec_ls(j,k) 1125 1125 endif 1126 if (prec_cv(j,k) /=0.) then1126 if (prec_cv(j,k) .ne. 0.) then 1127 1127 mr_hydro(j,:,k,I_CVRAIN) = mr_hydro(j,:,k,I_CVRAIN)/prec_cv(j,k) 1128 1128 mr_hydro(j,:,k,I_CVSNOW) = mr_hydro(j,:,k,I_CVSNOW)/prec_cv(j,k) … … 1190 1190 Reff(:,1,:,:) = gbx%Reff(start_idx:end_idx,:,:) 1191 1191 Np(:,1,:,:) = gbx%Np(start_idx:end_idx,:,:) 1192 where(gbx%dtau_s(start_idx:end_idx,:) >0)1192 where(gbx%dtau_s(start_idx:end_idx,:) .gt. 0) 1193 1193 sgx%frac_out(start_idx:end_idx,1,:) = 1 1194 1194 endwhere … … 1239 1239 allocate(g_vol(nPoints,gbx%Nlevels)) 1240 1240 do ij=1,gbx%Ncolumns 1241 if (ij ==1) then1241 if (ij .eq. 1) then 1242 1242 cmpGases = .true. 1243 1243 call quickbeam_optics(sd, rcfg_cloudsat,npoints,gbx%Nlevels, R_UNDEF, & -
LMDZ6/branches/Amaury_dev/libf/phylmd/cosp2/cosp_optics.F90
r5087 r5095 70 70 varOUT(1:dim1,1:dim2,1:dim3) = 0._wp 71 71 do j=1,dim2 72 where(flag(:,j,:) ==1)72 where(flag(:,j,:) .eq. 1) 73 73 varOUT(:,j,:) = varIN2 74 74 endwhere 75 where(flag(:,j,:) ==2)75 where(flag(:,j,:) .eq. 2) 76 76 varOUT(:,j,:) = varIN1 77 77 endwhere … … 94 94 95 95 varOUT(1:dim1,1:dim2,1:dim3) = 0._wp 96 where(flag(:,:,:) ==1)96 where(flag(:,:,:) .eq. 1) 97 97 varOUT(:,:,:) = varIN2 98 98 endwhere 99 where(flag(:,:,:) ==2)99 where(flag(:,:,:) .eq. 2) 100 100 varOUT(:,:,:) = varIN1 101 101 endwhere … … 295 295 polpart(INDX_CVLIQ,1:5) = polpartCVLIQ 296 296 ! LS and CONV Ice water coefficients 297 if (ice_type ==0) then297 if (ice_type .eq. 0) then 298 298 polpart(INDX_LSICE,1:5) = polpartLSICE0 299 299 polpart(INDX_CVICE,1:5) = polpartCVICE0 300 300 endif 301 if (ice_type ==1) then301 if (ice_type .eq. 1) then 302 302 polpart(INDX_LSICE,1:5) = polpartLSICE1 303 303 polpart(INDX_CVICE,1:5) = polpartCVICE1 … … 350 350 ! Polynomials kp_lidar derived from Mie theory 351 351 do i = 1, npart 352 where (rad_part(1:npoints,1:nlev,i) >0.0)352 where (rad_part(1:npoints,1:nlev,i) .gt. 0.0) 353 353 kp_part(1:npoints,1:nlev,i) = & 354 354 polpart(i,1)*(rad_part(1:npoints,1:nlev,i)*1e6)**4 & … … 377 377 ! Alpha of particles in each subcolumn: 378 378 do i = 1, npart 379 where (rad_part(1:npoints,1:nlev,i) >0.0)379 where (rad_part(1:npoints,1:nlev,i) .gt. 0.0) 380 380 alpha_part(1:npoints,icol,1:nlev,i) = 3._wp/4._wp * Qscat & 381 381 * rhoair(1:npoints,1:nlev) * qpart(1:npoints,1:nlev,i) & … … 391 391 ! Optical thickness of each layer (particles) 392 392 tau_part(1:npoints,icol,1:nlev,i) = tau_part(1:npoints,icol,1:nlev,i) & 393 * (zheight(1:npoints,1:nlev)-zheight(1:npoints,2:nlev+1) )393 & * (zheight(1:npoints,1:nlev)-zheight(1:npoints,2:nlev+1) ) 394 394 ! Optical thickness from TOA to layer k (particles) 395 395 do k=2,nlev -
LMDZ6/branches/Amaury_dev/libf/phylmd/cosp2/cosp_output_write_mod.F90
r5093 r5095 196 196 do k=1,PARASOL_NREFL 197 197 do ip=1, Npoints 198 if (stlidar%cldlayer(ip,4) >1.and.stlidar%parasolrefl(ip,k)/=missing_val) then198 if (stlidar%cldlayer(ip,4).gt.1.and.stlidar%parasolrefl(ip,k).ne.missing_val) then 199 199 parasolcrefl(ip,k)=(stlidar%parasolrefl(ip,k)-0.03*(1.-stlidar%cldlayer(ip,4)/100.))/ & 200 200 (stlidar%cldlayer(ip,4)/100.) … … 473 473 CHARACTER(LEN=20) :: typeecrit 474 474 475 ! ug On r écupère le type écrit de la structure:476 ! Assez moche, à refaire si meilleure méthode...475 ! ug On récupère le type écrit de la structure: 476 ! Assez moche, Ã| refaire si meilleure méthode... 477 477 IF (INDEX(var%cosp_typeecrit(iff), "once") > 0) THEN 478 478 typeecrit = 'once' … … 540 540 541 541 ! Axe vertical 542 IF (nvertsave ==nvertp(iff)) THEN542 IF (nvertsave.eq.nvertp(iff)) THEN 543 543 klevs=PARASOL_NREFL 544 544 nam_axvert="sza" 545 ELSE IF (nvertsave ==nvertisccp(iff)) THEN545 ELSE IF (nvertsave.eq.nvertisccp(iff)) THEN 546 546 klevs=7 547 547 nam_axvert="pressure2" 548 ELSE IF (nvertsave ==nvertcol(iff)) THEN548 ELSE IF (nvertsave.eq.nvertcol(iff)) THEN 549 549 klevs=Ncolout 550 550 nam_axvert="column" 551 ELSE IF (nvertsave ==nverttemp(iff)) THEN551 ELSE IF (nvertsave.eq.nverttemp(iff)) THEN 552 552 klevs=LIDAR_NTEMP 553 553 nam_axvert="temp" 554 ELSE IF (nvertsave ==nvertmisr(iff)) THEN554 ELSE IF (nvertsave.eq.nvertmisr(iff)) THEN 555 555 klevs=numMISRHgtBins 556 556 nam_axvert="cth16" 557 ELSE IF (nvertsave ==nvertReffIce(iff)) THEN557 ELSE IF (nvertsave.eq.nvertReffIce(iff)) THEN 558 558 klevs= numMODISReffIceBins 559 559 nam_axvert="ReffIce" 560 ELSE IF (nvertsave ==nvertReffLiq(iff)) THEN560 ELSE IF (nvertsave.eq.nvertReffLiq(iff)) THEN 561 561 klevs= numMODISReffLiqBins 562 562 nam_axvert="ReffLiq" … … 575 575 END IF 576 576 577 ! ug On r écupère le type écrit de la structure:578 ! Assez moche, à refaire si meilleure méthode...577 ! ug On récupère le type écrit de la structure: 578 ! Assez moche, Ã| refaire si meilleure méthode... 579 579 IF (INDEX(var%cosp_typeecrit(iff), "once") > 0) THEN 580 580 typeecrit = 'once' … … 645 645 IF (prt_level >= 9) WRITE(lunout,*)'Begin histrwrite2d ',var%name 646 646 647 ! On regarde si on est dans la phase de d éfinition ou d'écriture:647 ! On regarde si on est dans la phase de définition ou d'écriture: 648 648 IF(.NOT.cosp_varsdefined) THEN 649 649 !$OMP MASTER 650 !Si phase de d éfinition.... on définit650 !Si phase de définition.... on définit 651 651 CALL conf_cospoutputs(var%name,var%cles) 652 652 DO iff=1, 3 … … 657 657 !$OMP END MASTER 658 658 ELSE 659 !Et sinon on.... écrit659 !Et sinon on.... écrit 660 660 IF (SIZE(field)/=klon) & 661 661 CALL abort_physic('iophy::histwrite2d_cosp','Field first DIMENSION not equal to klon',1) … … 742 742 nom=var%name 743 743 END IF 744 ! On regarde si on est dans la phase de d éfinition ou d'écriture:744 ! On regarde si on est dans la phase de définition ou d'écriture: 745 745 IF(.NOT.cosp_varsdefined) THEN 746 !Si phase de d éfinition.... on définit746 !Si phase de définition.... on définit 747 747 !$OMP MASTER 748 748 CALL conf_cospoutputs(var%name,var%cles) … … 754 754 !$OMP END MASTER 755 755 ELSE 756 !Et sinon on.... écrit756 !Et sinon on.... écrit 757 757 IF (SIZE(field,1)/=klon) & 758 758 CALL abort_physic('iophy::histwrite3d','Field first DIMENSION not equal to klon',1) … … 826 826 827 827 IF(cosp_varsdefined) THEN 828 !Et sinon on.... écrit828 !Et sinon on.... écrit 829 829 IF (SIZE(field,1)/=klon) & 830 830 CALL abort_physic('iophy::histwrite3d','Field first DIMENSION not equal to klon',1) -
LMDZ6/branches/Amaury_dev/libf/phylmd/cosp2/cosp_read_otputkeys.F90
r5082 r5095 657 657 if (Lproftemp) cfg%out_list(i) = 'proftemp' !TIBO 658 658 659 if (i >78) then659 if (i.gt.78) then 660 660 print *, 'COSP_IO: wrong number of output diagnostics' 661 661 print *, i,78 -
LMDZ6/branches/Amaury_dev/libf/phylmd/cosp2/cosp_stats.F90
r5082 r5095 203 203 do j=1,Nlevels 204 204 sc_ratio = beta_tot(pr,i,j)/beta_mol(pr,j) 205 if ((sc_ratio <= s_att) .and. (flag_sat ==0)) flag_sat = j206 if (Ze_tot(pr,i,j) <-30.) then !radar can't detect cloud207 if ( (sc_ratio > s_cld) .or. (flag_sat ==j) ) then !lidar sense cloud205 if ((sc_ratio .le. s_att) .and. (flag_sat .eq. 0)) flag_sat = j 206 if (Ze_tot(pr,i,j) .lt. -30.) then !radar can't detect cloud 207 if ( (sc_ratio .gt. s_cld) .or. (flag_sat .eq. j) ) then !lidar sense cloud 208 208 lidar_only_freq_cloud(pr,j)=lidar_only_freq_cloud(pr,j)+1. !top->surf 209 209 flag_cld=1 … … 213 213 endif 214 214 enddo !levels 215 if (flag_cld ==1) tcc(pr)=tcc(pr)+1._wp215 if (flag_cld .eq. 1) tcc(pr)=tcc(pr)+1._wp 216 216 enddo !columns 217 217 enddo !points … … 245 245 246 246 do ij=2,Nbins+1 247 hist1D(ij-1) = count(var >= bins(ij-1) .and. var <bins(ij))248 if (count(var == R_GROUND) >=1) hist1D(ij-1)=R_UNDEF247 hist1D(ij-1) = count(var .ge. bins(ij-1) .and. var .lt. bins(ij)) 248 if (count(var .eq. R_GROUND) .ge. 1) hist1D(ij-1)=R_UNDEF 249 249 enddo 250 250 … … 278 278 do ij=2,nbin1+1 279 279 do ik=2,nbin2+1 280 jointHist(ij-1,ik-1)=count(var1 >= bin1(ij-1) .and. var1 <bin1(ij) .and. &281 var2 >= bin2(ik-1) .and. var2 < bin2(ik))280 jointHist(ij-1,ik-1)=count(var1 .ge. bin1(ij-1) .and. var1 .lt. bin1(ij) .and. & 281 var2 .ge. bin2(ik-1) .and. var2 .lt. bin2(ik)) 282 282 enddo 283 283 enddo -
LMDZ6/branches/Amaury_dev/libf/phylmd/cosp2/icarus.F90
r5086 r5095 134 134 ! ########################################################################## 135 135 136 if (debugcol /=0) then136 if (debugcol.ne.0) then 137 137 do j=1,npoints,debugcol 138 138 … … 140 140 do ilev=1,nlev 141 141 acc(ilev,1:ncol)=frac_out(j,1:ncol,ilev)*2 142 where(levmatch(j,1:ncol) ==ilev) acc(ilev,1:ncol)=acc(ilev,1:ncol)+1142 where(levmatch(j,1:ncol) .eq. ilev) acc(ilev,1:ncol)=acc(ilev,1:ncol)+1 143 143 enddo 144 144 … … 155 155 (cchar_realtops(acc(ilev,ibox)+1),ilev=1,nlev),& 156 156 (cchar(acc(ilev,ibox)+1),ilev=1,nlev) 157 END DO157 end do 158 158 close(9) 159 159 … … 224 224 225 225 ! Set tropopause values 226 if (isccp_top_height == 1 .or. isccp_top_height == 3) then226 if (isccp_top_height .eq. 1 .or. isccp_top_height .eq. 3) then 227 227 ptrop(1:npoints) = 5000._wp 228 228 attropmin(1:npoints) = 400._wp … … 232 232 233 233 do ilev=1,nlev 234 where(pfull(1:npoints,ilev) <40000. .and. &235 pfull(1:npoints,ilev) >5000. .and. &236 at(1:npoints,ilev) <attropmin(1:npoints))234 where(pfull(1:npoints,ilev) .lt. 40000. .and. & 235 pfull(1:npoints,ilev) .gt. 5000. .and. & 236 at(1:npoints,ilev) .lt. attropmin(1:npoints)) 237 237 ptrop(1:npoints) = pfull(1:npoints,ilev) 238 238 attropmin(1:npoints) = at(1:npoints,ilev) … … 244 244 do ilev=1,nlev 245 245 atmax(1:npoints) = merge(at(1:npoints,ilev),atmax(1:npoints),& 246 at(1:npoints,ilev) > atmax(1:npoints) .and. ilev >=itrop(1:npoints))246 at(1:npoints,ilev) .gt. atmax(1:npoints) .and. ilev .ge. itrop(1:npoints)) 247 247 enddo 248 248 end if 249 249 250 if (isccp_top_height == 1 .or. isccp_top_height ==3) then250 if (isccp_top_height .eq. 1 .or. isccp_top_height .eq. 3) then 251 251 ! ############################################################################ 252 252 ! Clear-sky radiance calculation … … 308 308 dem(1:npoints,ibox) = merge(dem_wv(1:npoints,ilev), & 309 309 1._wp-(1._wp-demIN(1:npoints,ibox,ilev))*(1._wp-dem_wv(1:npoints,ilev)), & 310 demIN(1:npoints,ibox,ilev) ==0)310 demIN(1:npoints,ibox,ilev) .eq. 0) 311 311 312 312 ! Increase TOA flux emitted from layer … … 322 322 do ibox=1,ncol 323 323 fluxtop(1:npoints,ibox) = fluxtop(1:npoints,ibox) + emsfc_lw*bb(1:npoints)*trans_layers_above(1:npoints,ibox) 324 END DO324 end do 325 325 326 326 ! All Sky brightness temperature … … 348 348 tauir(1:npoints) = tau(1:npoints,ibox)/2.13_wp 349 349 taumin(1:npoints) = -log(max(min(transmax(1:npoints),0.9999999_wp),0.001_wp)) 350 if (isccp_top_height ==1) then350 if (isccp_top_height .eq. 1) then 351 351 do j=1,npoints 352 if (transmax(j) > 0.001 .and. transmax(j) <=0.9999999) then352 if (transmax(j) .gt. 0.001 .and. transmax(j) .le. 0.9999999) then 353 353 fluxtopinit(j) = fluxtop(j,ibox) 354 354 tauir(j) = tau(j,ibox)/2.13_wp … … 357 357 do icycle=1,2 358 358 do j=1,npoints 359 if (tau(j,ibox) > (tauchk)) then360 if (transmax(j) > 0.001 .and. transmax(j) <=0.9999999) then359 if (tau(j,ibox) .gt. (tauchk)) then 360 if (transmax(j) .gt. 0.001 .and. transmax(j) .le. 0.9999999) then 361 361 emcld(j,ibox) = 1._wp - exp(-1._wp * tauir(j) ) 362 362 fluxtop(j,ibox) = fluxtopinit(j) - ((1.-emcld(j,ibox))*fluxtop_clrsky(j)) 363 363 fluxtop(j,ibox)=max(1.E-06_wp,(fluxtop(j,ibox)/emcld(j,ibox))) 364 364 tb(j,ibox)= 1307.27_wp / (log(1._wp + (1._wp/fluxtop(j,ibox)))) 365 if (tb(j,ibox) >260.) then365 if (tb(j,ibox) .gt. 260.) then 366 366 tauir(j) = tau(j,ibox) / 2.56_wp 367 367 end if … … 373 373 374 374 ! Cloud-top temperature 375 where(tau(1:npoints,ibox) >tauchk)375 where(tau(1:npoints,ibox) .gt. tauchk) 376 376 tb(1:npoints,ibox)= 1307.27_wp/ (log(1. + (1._wp/fluxtop(1:npoints,ibox)))) 377 where (isccp_top_height == 1 .and. tauir(1:npoints) <taumin(1:npoints))377 where (isccp_top_height .eq. 1 .and. tauir(1:npoints) .lt. taumin(1:npoints)) 378 378 tb(1:npoints,ibox) = attrop(1:npoints) - 5._wp 379 379 tau(1:npoints,ibox) = 2.13_wp*taumin(1:npoints) … … 382 382 383 383 ! Clear-sky brightness temperature 384 where(tau(1:npoints,ibox) <= tauchk)384 where(tau(1:npoints,ibox) .le. tauchk) 385 385 tb(1:npoints,ibox) = meantbclr(1:npoints) 386 386 endwhere … … 399 399 do ibox=1,ncol 400 400 !segregate according to optical thickness 401 if (isccp_top_height == 1 .or. isccp_top_height == 3) then401 if (isccp_top_height .eq. 1 .or. isccp_top_height .eq. 3) then 402 402 403 403 ! Find level whose temperature most closely matches brightness temperature 404 404 nmatch(1:npoints)=0 405 405 do k1=1,nlev-1 406 ilev = merge(nlev-k1,k1,isccp_top_height_direction == 2)406 ilev = merge(nlev-k1,k1,isccp_top_height_direction .eq. 2) 407 407 do j=1,npoints 408 if (ilev >=itrop(j) .and. &409 ((at(j,ilev) >= tb(j,ibox) .and. &410 at(j,ilev+1) <=tb(j,ibox)) .or. &411 (at(j,ilev) <=tb(j,ibox) .and. &412 at(j,ilev+1) >= tb(j,ibox)))) then408 if (ilev .ge. itrop(j) .and. & 409 ((at(j,ilev) .ge. tb(j,ibox) .and. & 410 at(j,ilev+1) .le. tb(j,ibox)) .or. & 411 (at(j,ilev) .le. tb(j,ibox) .and. & 412 at(j,ilev+1) .ge. tb(j,ibox)))) then 413 413 nmatch(j)=nmatch(j)+1 414 414 match(j,nmatch(j))=ilev … … 418 418 419 419 do j=1,npoints 420 if (nmatch(j) >=1) then420 if (nmatch(j) .ge. 1) then 421 421 k1 = match(j,nmatch(j)) 422 422 k2 = k1 + 1 … … 426 426 logp=logp1+(logp2-logp1)*abs(tb(j,ibox)-at(j,k1))/atd 427 427 ptop(j,ibox) = exp(logp) 428 levmatch(j,ibox) = merge(k1,k2,abs(pfull(j,k1)-ptop(j,ibox)) <abs(pfull(j,k2)-ptop(j,ibox)))428 levmatch(j,ibox) = merge(k1,k2,abs(pfull(j,k1)-ptop(j,ibox)) .lt. abs(pfull(j,k2)-ptop(j,ibox))) 429 429 else 430 if (tb(j,ibox) <=attrop(j)) then430 if (tb(j,ibox) .le. attrop(j)) then 431 431 ptop(j,ibox)=ptrop(j) 432 432 levmatch(j,ibox)=itrop(j) 433 433 end if 434 if (tb(j,ibox) >=atmax(j)) then434 if (tb(j,ibox) .ge. atmax(j)) then 435 435 ptop(j,ibox)=pfull(j,nlev) 436 436 levmatch(j,ibox)=nlev … … 441 441 ptop(1:npoints,ibox)=0. 442 442 do ilev=1,nlev 443 where((ptop(1:npoints,ibox) == 0. ) .and.(frac_out(1:npoints,ibox,ilev) /=0))443 where((ptop(1:npoints,ibox) .eq. 0. ) .and.(frac_out(1:npoints,ibox,ilev) .ne. 0)) 444 444 ptop(1:npoints,ibox)=phalf(1:npoints,ilev) 445 445 levmatch(1:npoints,ibox)=ilev 446 446 endwhere 447 END DO447 end do 448 448 end if 449 where(tau(1:npoints,ibox) <=tauchk)449 where(tau(1:npoints,ibox) .le. tauchk) 450 450 ptop(1:npoints,ibox)=0._wp 451 451 levmatch(1:npoints,ibox)=0._wp … … 460 460 do ibox=1,ncol 461 461 do j=1,npoints 462 if (tau(j,ibox) > (tauchk) .and. ptop(j,ibox) >0.) then463 if (sunlit(j) ==1 .or. isccp_top_height ==3) then462 if (tau(j,ibox) .gt. (tauchk) .and. ptop(j,ibox) .gt. 0.) then 463 if (sunlit(j).eq.1 .or. isccp_top_height .eq. 3) then 464 464 boxtau(j,ibox) = tau(j,ibox) 465 465 boxptop(j,ibox) = ptop(j,ibox)!/100._wp … … 508 508 ! Brightness Temperature 509 509 ! #################################################################################### 510 if (isccp_top_height == 1 .or. isccp_top_height ==3) then510 if (isccp_top_height .eq. 1 .or. isccp_top_height .eq. 3) then 511 511 meantb(1:npoints)=sum(boxttop,2)/ncol 512 512 else … … 535 535 do ilev2=1,7 536 536 do j=1,npoints ! 537 if (sunlit(j) ==1 .or. isccp_top_height == 3) then537 if (sunlit(j).eq.1 .or. isccp_top_height .eq. 3) then 538 538 fq_isccp(j,ilev,ilev2)= 0. 539 539 else … … 546 546 547 547 ! Reset variables need for averaging cloud properties 548 where(sunlit == 1 .or. isccp_top_height ==3)548 where(sunlit .eq. 1 .or. isccp_top_height .eq. 3) 549 549 totalcldarea(1:npoints) = 0._wp 550 550 meanalbedocld(1:npoints) = 0._wp … … 561 561 do j=1,npoints 562 562 ! Subcolumns that are cloudy(true) and not(false) 563 box_cloudy2(1:ncol) = merge(.true.,.false.,boxtau(j,1:ncol) > tauchk .and. boxptop(j,1:ncol) >0.)563 box_cloudy2(1:ncol) = merge(.true.,.false.,boxtau(j,1:ncol) .gt. tauchk .and. boxptop(j,1:ncol) .gt. 0.) 564 564 565 565 ! Compute joint histogram and column quantities for points that are sunlit and cloudy 566 if (sunlit(j) ==1 .or. isccp_top_height == 3) then566 if (sunlit(j) .eq.1 .or. isccp_top_height .eq. 3) then 567 567 ! Joint-histogram 568 568 call hist2D(boxtau(j,1:ncol),boxptop(j,1:ncol),ncol,isccp_histTau,numISCCPTauBins, & … … 572 572 573 573 ! Column cloud area 574 totalcldarea(j) = real(count(box_cloudy2(1:ncol) .and. boxtau(j,1:ncol) >isccp_taumin))/ncol574 totalcldarea(j) = real(count(box_cloudy2(1:ncol) .and. boxtau(j,1:ncol) .gt. isccp_taumin))/ncol 575 575 576 576 ! Subcolumn cloud albedo 577 577 !albedocld(j,1:ncol) = merge((boxtau(j,1:ncol)**0.895_wp)/((boxtau(j,1:ncol)**0.895_wp)+6.82_wp),& 578 578 ! 0._wp,box_cloudy2(1:ncol) .and. boxtau(j,1:ncol) .gt. isccp_taumin) 579 where(box_cloudy2(1:ncol) .and. boxtau(j,1:ncol) >isccp_taumin)579 where(box_cloudy2(1:ncol) .and. boxtau(j,1:ncol) .gt. isccp_taumin) 580 580 albedocld(j,1:ncol) = (boxtau(j,1:ncol)**0.895_wp)/((boxtau(j,1:ncol)**0.895_wp)+6.82_wp) 581 581 elsewhere … … 587 587 588 588 ! Column cloud top pressure 589 meanptop(j) = sum(boxptop(j,1:ncol),box_cloudy2(1:ncol) .and. boxtau(j,1:ncol) >isccp_taumin)/ncol589 meanptop(j) = sum(boxptop(j,1:ncol),box_cloudy2(1:ncol) .and. boxtau(j,1:ncol) .gt. isccp_taumin)/ncol 590 590 endif 591 591 enddo 592 592 593 593 ! Compute mean cloud properties. Set to mssing value in the event that totalcldarea=0 594 where(totalcldarea(1:npoints) >0)594 where(totalcldarea(1:npoints) .gt. 0) 595 595 meanptop(1:npoints) = 100._wp*meanptop(1:npoints)/totalcldarea(1:npoints) 596 596 meanalbedocld(1:npoints) = meanalbedocld(1:npoints)/totalcldarea(1:npoints) … … 609 609 610 610 ! Represent in percent 611 where(totalcldarea /=output_missing_value) totalcldarea = totalcldarea*100._wp612 where(fq_isccp /=output_missing_value) fq_isccp = fq_isccp*100._wp611 where(totalcldarea .ne. output_missing_value) totalcldarea = totalcldarea*100._wp 612 where(fq_isccp .ne. output_missing_value) fq_isccp = fq_isccp*100._wp 613 613 614 614 … … 634 634 varOUT(1:dim1,1:dim2,1:dim3) = 0._wp 635 635 do j=1,dim2 636 where(flag(:,j,:) ==1)636 where(flag(:,j,:) .eq. 1) 637 637 varOUT(:,j,:) = varIN2 638 638 endwhere 639 where(flag(:,j,:) ==2)639 where(flag(:,j,:) .eq. 2) 640 640 varOUT(:,j,:) = varIN1 641 641 endwhere -
LMDZ6/branches/Amaury_dev/libf/phylmd/cosp2/lidar_simulator.F90
r5082 r5095 197 197 ! Computation of the total perpendicular lidar signal (ATBperp for liq+ice) 198 198 ! Upper layer 199 WHERE(tautot(1:npoints,icol,1) >0)199 WHERE(tautot(1:npoints,icol,1) .gt. 0) 200 200 pnorm_perp_tot(1:npoints,icol,1) = (beta_perp_ice(1:npoints,icol,1)+ & 201 201 beta_perp_liq(1:npoints,icol,1)- & … … 217 217 ! Betaperp=beta_mol(:,k)/(1+1/0.0284)) [bodhaine et al. 1999] in the following 218 218 ! equations: 219 WHERE (pnorm(1:npoints,icol,k) ==0)219 WHERE (pnorm(1:npoints,icol,k) .eq. 0) 220 220 pnorm_perp_tot(1:npoints,icol,k)=0._wp 221 221 ELSEWHERE 222 where(tautot_lay(1:npoints) >0.)222 where(tautot_lay(1:npoints) .gt. 0.) 223 223 pnorm_perp_tot(1:npoints,icol,k) = (beta_perp_ice(1:npoints,icol,k)+ & 224 224 beta_perp_liq(1:npoints,icol,k)-(beta_mol(1:npoints,k)/(1._wp+1._wp/ & … … 318 318 do ic = 1, ncol 319 319 pnorm_c = pnormFlip(:,ic,:) 320 where ((pnorm_c < xmax) .and. (betamolFlip(:,1,:) <xmax) .and. &321 (betamolFlip(:,1,:) >0.0 ))320 where ((pnorm_c .lt. xmax) .and. (betamolFlip(:,1,:) .lt. xmax) .and. & 321 (betamolFlip(:,1,:) .gt. 0.0 )) 322 322 x3d_c = pnorm_c/betamolFlip(:,1,:) 323 323 elsewhere … … 333 333 do ic = 1, ncol 334 334 pnorm_c = pnorm(:,ic,:) 335 where ((pnorm_c <xmax) .and. (pmol<xmax) .and. (pmol>0.0 ))335 where ((pnorm_c.lt.xmax) .and. (pmol.lt.xmax) .and. (pmol.gt. 0.0 )) 336 336 x3d_c = pnorm_c/pmol 337 337 elsewhere … … 354 354 enddo 355 355 enddo 356 where(cfad2 /=R_UNDEF) cfad2=cfad2/ncol356 where(cfad2 .ne. R_UNDEF) cfad2=cfad2/ncol 357 357 358 358 endif … … 389 389 do k=2,nlev 390 390 tautot_lay(:) = tau(:,k)-tau(:,k-1) 391 WHERE ( EXP(-2._wp*tau(:,k-1)) >0. )392 WHERE (tautot_lay(:) >0.)391 WHERE ( EXP(-2._wp*tau(:,k-1)) .gt. 0. ) 392 WHERE (tautot_lay(:) .gt. 0.) 393 393 pnorm(:,k) = beta(:,k)*EXP(-2._wp*tau(:,k-1)) /& 394 394 (2._wp*tautot_lay(:))*(1._wp-EXP(-2._wp*tautot_lay(:))) … … 418 418 do k=2,nlev 419 419 tautot_lay(:) = tau(:,k)-tau(:,k-1) 420 WHERE ( EXP(-2._wp*tau(:,k-1)) >0. )421 WHERE (tautot_lay(:) >0.)420 WHERE ( EXP(-2._wp*tau(:,k-1)) .gt. 0. ) 421 WHERE (tautot_lay(:) .gt. 0.) 422 422 beta(:,k) = pnorm(:,k)/ EXP(-2._wp*tau(:,k-1))* & 423 423 (2._wp*tautot_lay(:))/(1._wp-exp(-2._wp*tautot_lay(:))) … … 539 539 do k=1,Nlevels 540 540 ! Cloud detection at subgrid-scale: 541 where ((x(:,:,k) > S_cld) .and. (x(:,:,k) /=undef) )541 where ((x(:,:,k) .gt. S_cld) .and. (x(:,:,k) .ne. undef) ) 542 542 cldy(:,:,k)=1._wp 543 543 elsewhere … … 546 546 547 547 ! Number of usefull sub-columns: 548 where ((x(:,:,k) > S_att) .and. (x(:,:,k) /=undef) )548 where ((x(:,:,k) .gt. S_att) .and. (x(:,:,k) .ne. undef) ) 549 549 srok(:,:,k)=1._wp 550 550 elsewhere … … 566 566 ! Computation of the cloud fraction as a function of the temperature instead 567 567 ! of height, for ice,liquid and all clouds 568 if(srok(ip,ic,k) >0.)then568 if(srok(ip,ic,k).gt.0.)then 569 569 do itemp=1,Ntemp 570 if( (tmp(ip,k) >=tempmod(itemp)).and.(tmp(ip,k)<tempmod(itemp+1)) )then570 if( (tmp(ip,k).ge.tempmod(itemp)).and.(tmp(ip,k).lt.tempmod(itemp+1)) )then 571 571 lidarcldtempind(ip,itemp)=lidarcldtempind(ip,itemp)+1._wp 572 572 endif … … 574 574 endif 575 575 576 if(cldy(ip,ic,k) ==1.)then576 if(cldy(ip,ic,k).eq.1.)then 577 577 do itemp=1,Ntemp 578 if( (tmp(ip,k) >= tempmod(itemp)).and.(tmp(ip,k) <tempmod(itemp+1)) )then578 if( (tmp(ip,k) .ge. tempmod(itemp)).and.(tmp(ip,k) .lt. tempmod(itemp+1)) )then 579 579 lidarcldtemp(ip,itemp,1)=lidarcldtemp(ip,itemp,1)+1._wp 580 580 endif … … 584 584 iz=1 585 585 p1 = pplay(ip,k) 586 if ( p1 >0. .and. p1<(440._wp*100._wp)) then ! high clouds586 if ( p1.gt.0. .and. p1.lt.(440._wp*100._wp)) then ! high clouds 587 587 iz=3 588 else if(p1 >=(440._wp*100._wp) .and. p1<(680._wp*100._wp)) then ! mid clouds588 else if(p1.ge.(440._wp*100._wp) .and. p1.lt.(680._wp*100._wp)) then ! mid clouds 589 589 iz=2 590 590 endif … … 603 603 604 604 ! Grid-box 3D cloud fraction 605 where ( nsub(:,:) >0.0 )605 where ( nsub(:,:).gt.0.0 ) 606 606 lidarcld(:,:) = lidarcld(:,:)/nsub(:,:) 607 607 elsewhere … … 618 618 enddo 619 619 enddo 620 where (nsublayer(:,:) >0.0)620 where (nsublayer(:,:) .gt. 0.0) 621 621 cldlayer(:,:) = cldlayer(:,:)/nsublayer(:,:) 622 622 elsewhere … … 637 637 638 638 ! Avoid zero values 639 if( (cldy(i,ncol,nlev) ==1.) .and. (ATBperp(i,ncol,nlev)>0.) )then639 if( (cldy(i,ncol,nlev).eq.1.) .and. (ATBperp(i,ncol,nlev).gt.0.) )then 640 640 ! Computation of the ATBperp along the phase discrimination line 641 641 ATBperp_tmp = (ATB(i,ncol,nlev)**5)*alpha50 + (ATB(i,ncol,nlev)**4)*beta50 + & … … 645 645 ! 4.1.a) Ice: ATBperp above the phase discrimination line 646 646 ! ######################################################################## 647 if((ATBperp(i,ncol,nlev)-ATBperp_tmp) >=0.)then ! Ice clouds647 if((ATBperp(i,ncol,nlev)-ATBperp_tmp) .ge. 0.)then ! Ice clouds 648 648 649 649 ! ICE with temperature above 273,15°K = Liquid (false ice) 650 if(tmp(i,nlev) >273.15) then ! Temperature above 273,15 K650 if(tmp(i,nlev) .gt. 273.15) then ! Temperature above 273,15 K 651 651 ! Liquid: False ice corrected by the temperature to Liquid 652 652 lidarcldphase(i,nlev,2) = lidarcldphase(i,nlev,2)+1._wp ! False ice detection ==> added to Liquid … … 656 656 ! to classify the phase cloud 657 657 cldlayphase(i,ncol,4,2) = 1. ! tot cloud 658 if (p1 > 0. .and. p1<(440._wp*100._wp)) then ! high cloud658 if (p1 .gt. 0. .and. p1.lt.(440._wp*100._wp)) then ! high cloud 659 659 cldlayphase(i,ncol,3,2) = 1._wp 660 else if(p1 >= (440._wp*100._wp) .and. p1 <(680._wp*100._wp)) then ! mid cloud660 else if(p1 .ge. (440._wp*100._wp) .and. p1 .lt. (680._wp*100._wp)) then ! mid cloud 661 661 cldlayphase(i,ncol,2,2) = 1._wp 662 662 else ! low cloud … … 665 665 cldlayphase(i,ncol,4,5) = 1._wp ! tot cloud 666 666 ! High cloud 667 if (p1 > 0. .and. p1 < (440._wp*100._wp)) then667 if (p1 .gt. 0. .and. p1 .lt. (440._wp*100._wp)) then 668 668 cldlayphase(i,ncol,3,5) = 1._wp 669 669 ! Middle cloud 670 else if(p1 >= (440._wp*100._wp) .and. p1 <(680._wp*100._wp)) then670 else if(p1 .ge. (440._wp*100._wp) .and. p1 .lt. (680._wp*100._wp)) then 671 671 cldlayphase(i,ncol,2,5) = 1._wp 672 672 ! Low cloud … … 680 680 cldlayphase(i,ncol,4,1) = 1._wp ! tot cloud 681 681 ! High cloud 682 if (p1 > 0. .and. p1 < (440._wp*100._wp)) then682 if (p1 .gt. 0. .and. p1 .lt. (440._wp*100._wp)) then 683 683 cldlayphase(i,ncol,3,1) = 1._wp 684 684 ! Middle cloud 685 else if(p1 >= (440._wp*100._wp) .and. p1 < (680._wp*100._wp)) then685 else if(p1 .ge. (440._wp*100._wp) .and. p1 .lt. (680._wp*100._wp)) then 686 686 cldlayphase(i,ncol,2,1) = 1._wp 687 687 ! Low cloud … … 695 695 else 696 696 ! Liquid with temperature above 231,15°K 697 if(tmp(i,nlev) >231.15_wp) then697 if(tmp(i,nlev) .gt. 231.15_wp) then 698 698 lidarcldphase(i,nlev,2) = lidarcldphase(i,nlev,2)+1._wp 699 699 tmpl(i,ncol,nlev) = tmp(i,nlev) 700 700 cldlayphase(i,ncol,4,2) = 1._wp ! tot cloud 701 701 ! High cloud 702 if (p1 > 0. .and. p1 <(440._wp*100._wp)) then702 if (p1 .gt. 0. .and. p1 .lt. (440._wp*100._wp)) then 703 703 cldlayphase(i,ncol,3,2) = 1._wp 704 704 ! Middle cloud 705 else if(p1 >= (440._wp*100._wp) .and. p1 <(680._wp*100._wp)) then705 else if(p1 .ge. (440._wp*100._wp) .and. p1 .lt. (680._wp*100._wp)) then 706 706 cldlayphase(i,ncol,2,2) = 1._wp 707 707 ! Low cloud … … 716 716 cldlayphase(i,ncol,4,4) = 1._wp ! tot cloud 717 717 ! High cloud 718 if (p1 > 0. .and. p1 <(440._wp*100._wp)) then718 if (p1 .gt. 0. .and. p1 .lt. (440._wp*100._wp)) then 719 719 cldlayphase(i,ncol,3,4) = 1._wp 720 720 ! Middle cloud 721 else if(p1 >= (440._wp*100._wp) .and. p1 <(680._wp*100._wp)) then721 else if(p1 .ge. (440._wp*100._wp) .and. p1 .lt. (680._wp*100._wp)) then 722 722 cldlayphase(i,ncol,2,4) = 1._wp 723 723 ! Low cloud … … 727 727 cldlayphase(i,ncol,4,1) = 1._wp ! tot cloud 728 728 ! High cloud 729 if (p1 > 0. .and. p1 <(440._wp*100._wp)) then729 if (p1 .gt. 0. .and. p1 .lt. (440._wp*100._wp)) then 730 730 cldlayphase(i,ncol,3,1) = 1._wp 731 731 ! Middle cloud 732 else if(p1 >= (440._wp*100._wp) .and. p1 <(680._wp*100._wp)) then732 else if(p1 .ge. (440._wp*100._wp) .and. p1 .lt. (680._wp*100._wp)) then 733 733 cldlayphase(i,ncol,2,1) = 1._wp 734 734 ! Low cloud … … 748 748 p1 = pplay(i,nlev) 749 749 750 if((cldy(i,ncol,nlev) == 1.) .and. (ATBperp(i,ncol,nlev) >0.) )then750 if((cldy(i,ncol,nlev) .eq. 1.) .and. (ATBperp(i,ncol,nlev) .gt. 0.) )then 751 751 ! Computation of the ATBperp of the phase discrimination line 752 752 ATBperp_tmp = (ATB(i,ncol,nlev)**5)*alpha50 + (ATB(i,ncol,nlev)**4)*beta50 + & … … 757 757 ! ######################################################################## 758 758 ! ICE with temperature above 273,15°K = Liquid (false ice) 759 if((ATBperp(i,ncol,nlev)-ATBperp_tmp) >=0.)then ! Ice clouds760 if(tmp(i,nlev) >273.15)then759 if((ATBperp(i,ncol,nlev)-ATBperp_tmp) .ge. 0.)then ! Ice clouds 760 if(tmp(i,nlev) .gt. 273.15)then 761 761 lidarcldphase(i,nlev,2) = lidarcldphase(i,nlev,2)+1._wp ! false ice ==> liq 762 762 tmpl(i,ncol,nlev) = tmp(i,nlev) … … 764 764 cldlayphase(i,ncol,4,2) = 1._wp ! tot cloud 765 765 ! High cloud 766 if (p1 > 0. .and. p1 < (440._wp*100._wp)) then766 if (p1 .gt. 0. .and. p1 .lt. (440._wp*100._wp)) then 767 767 cldlayphase(i,ncol,3,2) = 1._wp 768 768 ! Middle cloud 769 else if(p1 >= (440._wp*100._wp) .and. p1 < (680._wp*100._wp)) then769 else if(p1 .ge. (440._wp*100._wp) .and. p1 .lt. (680._wp*100._wp)) then 770 770 cldlayphase(i,ncol,2,2) = 1._wp 771 771 ! Low cloud … … 776 776 cldlayphase(i,ncol,4,5) = 1. ! tot cloud 777 777 ! High cloud 778 if (p1 > 0. .and. p1 <(440._wp*100._wp)) then778 if (p1 .gt. 0. .and. p1 .lt. (440._wp*100._wp)) then 779 779 cldlayphase(i,ncol,3,5) = 1._wp 780 780 ! Middle cloud 781 else if(p1 >= (440._wp*100._wp) .and. p1 <(680._wp*100._wp)) then781 else if(p1 .ge. (440._wp*100._wp) .and. p1 .lt. (680._wp*100._wp)) then 782 782 cldlayphase(i,ncol,2,5) = 1._wp 783 783 ! Low cloud … … 791 791 cldlayphase(i,ncol,4,1) = 1._wp ! tot cloud 792 792 ! High cloud 793 if (p1 > 0. .and. p1 <(440._wp*100._wp)) then793 if (p1 .gt. 0. .and. p1 .lt. (440._wp*100._wp)) then 794 794 cldlayphase(i,ncol,3,1) = 1._wp 795 795 ! Middle cloud 796 else if(p1 >= (440._wp*100._wp) .and. p1 <(680._wp*100._wp)) then796 else if(p1 .ge. (440._wp*100._wp) .and. p1 .lt.(680._wp*100._wp)) then 797 797 cldlayphase(i,ncol,2,1) = 1._wp 798 798 ! Low cloud … … 807 807 else 808 808 ! Liquid with temperature above 231,15°K 809 if(tmp(i,nlev) >231.15)then809 if(tmp(i,nlev) .gt. 231.15)then 810 810 lidarcldphase(i,nlev,2) = lidarcldphase(i,nlev,2)+1._wp 811 811 tmpl(i,ncol,nlev) = tmp(i,nlev) 812 812 cldlayphase(i,ncol,4,2) = 1._wp ! tot cloud 813 813 ! High cloud 814 if (p1 > 0. .and. p1 <(440._wp*100._wp)) then814 if (p1 .gt. 0. .and. p1 .lt. (440._wp*100._wp)) then 815 815 cldlayphase(i,ncol,3,2) = 1._wp 816 816 ! Middle cloud 817 else if(p1 >= (440._wp*100._wp) .and. p1 <(680._wp*100._wp)) then817 else if(p1 .ge. (440._wp*100._wp) .and. p1 .lt. (680._wp*100._wp)) then 818 818 cldlayphase(i,ncol,2,2) = 1._wp 819 819 ! Low cloud … … 828 828 cldlayphase(i,ncol,4,4) = 1._wp ! tot cloud 829 829 ! High cloud 830 if (p1 > 0. .and. p1 <(440._wp*100._wp)) then830 if (p1 .gt. 0. .and. p1 .lt. (440._wp*100._wp)) then 831 831 cldlayphase(i,ncol,3,4) = 1._wp 832 832 ! Middle 833 else if(p1 >= (440._wp*100._wp) .and. p1 <(680._wp*100._wp)) then833 else if(p1 .ge. (440._wp*100._wp) .and. p1 .lt. (680._wp*100._wp)) then 834 834 cldlayphase(i,ncol,2,4) = 1._wp 835 835 ! Low cloud … … 840 840 cldlayphase(i,ncol,4,1) = 1._wp ! tot cloud 841 841 ! High cloud 842 if (p1 > 0. .and. p1 <(440._wp*100._wp)) then842 if (p1 .gt. 0. .and. p1 .lt. (440._wp*100._wp)) then 843 843 cldlayphase(i,ncol,3,1) = 1._wp 844 844 ! Middle cloud 845 else if(p1 >= (440._wp*100._wp) .and. p1 <(680._wp*100._wp)) then845 else if(p1 .ge. (440._wp*100._wp) .and. p1 .lt. (680._wp*100._wp)) then 846 846 cldlayphase(i,ncol,2,1) = 1._wp 847 847 ! Low cloud … … 855 855 856 856 ! Find the level of the highest cloud with SR>30 857 if(x(i,ncol,nlev) >S_cld_att) then ! SR > 30.857 if(x(i,ncol,nlev) .gt. S_cld_att) then ! SR > 30. 858 858 toplvlsat = nlev+1 859 859 goto 99 … … 867 867 ! see Cesana and Chepfer 2013 Sect.III.2 868 868 ! ############################################################################## 869 if(toplvlsat /=0) then869 if(toplvlsat.ne.0) then 870 870 do nlev = toplvlsat,Nlevels 871 871 p1 = pplay(i,nlev) 872 if(cldy(i,ncol,nlev) ==1.)then872 if(cldy(i,ncol,nlev).eq.1.)then 873 873 lidarcldphase(i,nlev,3) = lidarcldphase(i,nlev,3)+1._wp 874 874 tmpu(i,ncol,nlev) = tmp(i,nlev) 875 875 cldlayphase(i,ncol,4,3) = 1._wp ! tot cloud 876 876 ! High cloud 877 if (p1 > 0. .and. p1 <(440._wp*100._wp)) then877 if (p1 .gt. 0. .and. p1 .lt. (440._wp*100._wp)) then 878 878 cldlayphase(i,ncol,3,3) = 1._wp 879 879 ! Middle cloud 880 else if(p1 >= (440._wp*100._wp) .and. p1 <(680._wp*100._wp)) then880 else if(p1 .ge. (440._wp*100._wp) .and. p1 .lt. (680._wp*100._wp)) then 881 881 cldlayphase(i,ncol,2,3) = 1._wp 882 882 ! Low cloud … … 897 897 ! Compute the Ice percentage in cloud = ice/(ice+liq) as a function of the occurrences 898 898 lidarcldphasetmp(:,:) = lidarcldphase(:,:,1)+lidarcldphase(:,:,2); 899 WHERE (lidarcldphasetmp(:,:) >0.)899 WHERE (lidarcldphasetmp(:,:) .gt. 0.) 900 900 lidarcldphase(:,:,6)=lidarcldphase(:,:,1)/lidarcldphasetmp(:,:) 901 901 ELSEWHERE … … 905 905 ! Compute Phase 3D Cloud Fraction 906 906 !WHERE (nsub(:,Nlevels:1:-1) .gt. 0.0 ) 907 WHERE (nsub(:,:) > 0.0 )907 WHERE (nsub(:,:) .gt. 0.0 ) 908 908 lidarcldphase(:,:,1)=lidarcldphase(:,:,1)/nsub(:,:) 909 909 lidarcldphase(:,:,2)=lidarcldphase(:,:,2)/nsub(:,:) … … 938 938 ! Compute the Ice percentage in cloud = ice/(ice+liq) 939 939 cldlayerphasetmp(:,:)=cldlayerphase(:,:,1)+cldlayerphase(:,:,2) 940 WHERE (cldlayerphasetmp(:,:) >0.)940 WHERE (cldlayerphasetmp(:,:).gt. 0.) 941 941 cldlayerphase(:,:,6)=cldlayerphase(:,:,1)/cldlayerphasetmp(:,:) 942 942 ELSEWHERE … … 945 945 946 946 do i=1,Nphase-1 947 WHERE ( cldlayerphasesum(:,:) >0.0 )947 WHERE ( cldlayerphasesum(:,:).gt.0.0 ) 948 948 cldlayerphase(:,:,i) = (cldlayerphase(:,:,i)/cldlayerphasesum(:,:)) * cldlayer(:,:) 949 949 ENDWHERE … … 954 954 checkcldlayerphase=0. 955 955 checkcldlayerphase2=0. 956 if (cldlayerphasesum(i,iz) >0.0 )then956 if (cldlayerphasesum(i,iz) .gt. 0.0 )then 957 957 do ic=1,Nphase-3 958 958 checkcldlayerphase = checkcldlayerphase+cldlayerphase(i,iz,ic) 959 959 enddo 960 960 checkcldlayerphase2 = cldlayer(i,iz)-checkcldlayerphase 961 if((checkcldlayerphase2 > 0.01) .or. (checkcldlayerphase2 <-0.01) ) print *, checkcldlayerphase,cldlayer(i,iz)961 if((checkcldlayerphase2 .gt. 0.01) .or. (checkcldlayerphase2 .lt. -0.01) ) print *, checkcldlayerphase,cldlayer(i,iz) 962 962 endif 963 963 enddo … … 965 965 966 966 do i=1,Nphase-1 967 WHERE (nsublayer(:,:) ==0.0)967 WHERE (nsublayer(:,:) .eq. 0.0) 968 968 cldlayerphase(:,:,i) = undef 969 969 ENDWHERE … … 975 975 do i=1,Npoints 976 976 do itemp=1,Ntemp 977 if(tmpi(i,ncol,nlev) >0.)then978 if((tmpi(i,ncol,nlev) >= tempmod(itemp)) .and. (tmpi(i,ncol,nlev) <tempmod(itemp+1)) )then977 if(tmpi(i,ncol,nlev).gt.0.)then 978 if((tmpi(i,ncol,nlev) .ge. tempmod(itemp)) .and. (tmpi(i,ncol,nlev) .lt. tempmod(itemp+1)) )then 979 979 lidarcldtemp(i,itemp,2)=lidarcldtemp(i,itemp,2)+1._wp 980 980 endif 981 elseif(tmpl(i,ncol,nlev) >0.)then982 if((tmpl(i,ncol,nlev) >= tempmod(itemp)) .and. (tmpl(i,ncol,nlev) <tempmod(itemp+1)) )then981 elseif(tmpl(i,ncol,nlev) .gt. 0.)then 982 if((tmpl(i,ncol,nlev) .ge. tempmod(itemp)) .and. (tmpl(i,ncol,nlev) .lt. tempmod(itemp+1)) )then 983 983 lidarcldtemp(i,itemp,3)=lidarcldtemp(i,itemp,3)+1._wp 984 984 endif 985 elseif(tmpu(i,ncol,nlev) >0.)then986 if((tmpu(i,ncol,nlev) >= tempmod(itemp)) .and. (tmpu(i,ncol,nlev) <tempmod(itemp+1)) )then985 elseif(tmpu(i,ncol,nlev) .gt. 0.)then 986 if((tmpu(i,ncol,nlev) .ge. tempmod(itemp)) .and. (tmpu(i,ncol,nlev) .lt. tempmod(itemp+1)) )then 987 987 lidarcldtemp(i,itemp,4)=lidarcldtemp(i,itemp,4)+1._wp 988 988 endif … … 1007 1007 ! Compute the Ice percentage in cloud = ice/(ice+liq) 1008 1008 sumlidarcldtemp(:,:)=lidarcldtemp(:,:,2)+lidarcldtemp(:,:,3) 1009 WHERE(sumlidarcldtemp(:,:) >0.)1009 WHERE(sumlidarcldtemp(:,:) .gt. 0.) 1010 1010 lidarcldtemp(:,:,5)=lidarcldtemp(:,:,2)/sumlidarcldtemp(:,:) 1011 1011 ELSEWHERE … … 1014 1014 1015 1015 do i=1,4 1016 WHERE(lidarcldtempind(:,:) >0.)1016 WHERE(lidarcldtempind(:,:) .gt. 0.) 1017 1017 lidarcldtemp(:,:,i) = lidarcldtemp(:,:,i)/lidarcldtempind(:,:) 1018 1018 ELSEWHERE -
LMDZ6/branches/Amaury_dev/libf/phylmd/cosp2/math_lib.F90
r5086 r5095 209 209 exit 210 210 end if 211 END DO211 end do 212 212 213 213 if (lerror) then … … 244 244 end if 245 245 ilo = ilo + 1 246 END DO246 end do 247 247 248 248 ilo = max ( 2, ilo ) … … 254 254 end if 255 255 ihi = ihi - 1 256 END DO256 end do 257 257 258 258 ihi = min ( ihi, ntab - 1 ) … … 305 305 syl = x2 306 306 307 END DO307 end do 308 308 309 309 result = sum1 + ca * ( b**3 - syl**3 ) / 3._wp & -
LMDZ6/branches/Amaury_dev/libf/phylmd/cosp2/mo_rng.F90
r5082 r5095 96 96 ! so we use sizeof(someInt) to determine wheter it is on 32 bit. 97 97 !if ( i2_16*i2_16 .le. huge32 ) then 98 if (digits(testInt) <=31) then98 if (digits(testInt) .le. 31) then 99 99 !if (sizeof(testInt) .eq. 4) then 100 100 r=r+1 -
LMDZ6/branches/Amaury_dev/libf/phylmd/cosp2/modis_simulator.F90
r5086 r5095 222 222 retrievedTau(i) = R_UNDEF 223 223 end if 224 END DO224 end do 225 225 where((retrievedSize(1:nSubCols) < 0.).and.(retrievedSize(1:nSubCols) /= R_UNDEF)) & 226 226 retrievedSize(1:nSubCols) = 1.0e-06_wp*re_fill … … 455 455 end if 456 456 if(totalTau >= tauLimit) exit 457 END DO457 end do 458 458 459 459 if (totalTau > 0._wp) then … … 489 489 end if 490 490 if(totalTau >= tauLimit) exit 491 END DO491 end do 492 492 493 493 if (totalTau > 0._wp) then … … 715 715 do i = 1, size(cloudIndicies) 716 716 call two_stream(tau(cloudIndicies(i)), g(cloudIndicies(i)), w0(cloudIndicies(i)), Refl(i), Trans(i)) 717 END DO717 end do 718 718 719 719 call adding_doubling(count(tau(1:nLevels) > 0),Refl(:), Trans(:), Refl_tot, Trans_tot) … … 897 897 Refl_cumulative(i) = Refl_cumulative(i-1) + Refl(i)*(Tran_cumulative(i-1)**2)/(1._wp - Refl_cumulative(i-1) * Refl(i)) 898 898 Tran_cumulative(i) = (Tran_cumulative(i-1)*Tran(i)) / (1._wp - Refl_cumulative(i-1) * Refl(i)) 899 END DO899 end do 900 900 901 901 Refl_tot = Refl_cumulative(size(Refl)) -
LMDZ6/branches/Amaury_dev/libf/phylmd/cosp2/mrgrnk.F90
r5081 r5095 68 68 IRNGT (1) = 1 69 69 Return 70 Case Default 71 Continue 70 72 End Select 71 73 ! … … 266 268 IRNGT (1) = 1 267 269 Return 270 Case Default 271 Continue 268 272 End Select 269 273 ! … … 463 467 IRNGT (1) = 1 464 468 Return 469 Case Default 470 Continue 465 471 End Select 466 472 ! -
LMDZ6/branches/Amaury_dev/libf/phylmd/cosp2/optics_lib.F90
r5086 r5095 539 539 if (alam < cutice) then 540 540 ! Region from 0.045 microns to 167.0 microns - no temperature depend 541 do i=2,nwl 542 if(alam < wl(i)) continue 543 enddo 541 544 x1 = log(wl(i-1)) 542 545 x2 = log(wl(i)) … … 555 558 if(tk < temref(4)) tk=temref(4) 556 559 do i=2,4 557 if(tk >=temref(i)) go to 12560 if(tk.ge.temref(i)) go to 12 558 561 enddo 559 562 12 lt1 = i 560 563 lt2 = i-1 561 564 do i=2,nwlt 562 if(alam <=wlt(i)) go to 14565 if(alam.le.wlt(i)) go to 14 563 566 enddo 564 567 14 x1 = log(wlt(i-1)) … … 649 652 Complex(wp) :: A1 650 653 651 If ((Dx >Imaxx) .Or. (InP>ImaxNP)) Then654 If ((Dx.Gt.Imaxx) .Or. (InP.Gt.ImaxNP)) Then 652 655 Error = 1 653 656 Return … … 656 659 Ir = 1 / Cm 657 660 Y = Dx * Cm 658 If (Dx <0.02) Then661 If (Dx.Lt.0.02) Then 659 662 NStop = 2 660 663 Else 661 If (Dx <=8.0) Then664 If (Dx.Le.8.0) Then 662 665 NStop = Dx + 4.00*Dx**(1./3.) + 2.0 663 666 Else 664 If (Dx <4200.0) Then667 If (Dx.Lt. 4200.0) Then 665 668 NStop = Dx + 4.05*Dx**(1./3.) + 2.0 666 669 Else … … 670 673 End If 671 674 NmX = Max(Real(NStop),Real(Abs(Y))) + 15. 672 If (Nmx >Itermax) then675 If (Nmx .gt. Itermax) then 673 676 Error = 1 674 677 Return … … 723 726 !ds Dqxt = Tnp1 * Dble(A + B) + Dqxt 724 727 Dqsc = Tnp1 * (A*Conjg(A) + B*Conjg(B)) + Dqsc 725 If (N >1) then728 If (N.Gt.1) then 726 729 Dg = Dg + (dN*dN - 1) * (ANM1*Conjg(A) + BNM1 * Conjg(B)) / dN + TNM1 *(ANM1*Conjg(BNM1)) / (dN*dN - dN) 727 730 !ds Dg = Dg + (dN*dN - 1) * Dble(ANM1*Conjg(A) + BNM1 * Conjg(B)) / dN + TNM1 * Dble(ANM1*Conjg(BNM1)) / (dN*dN - dN) … … 732 735 AMB = A2 * (A - B) 733 736 Do I = 1,Inp2 734 If (I >Inp) Then737 If (I.GT.Inp) Then 735 738 S(I) = -Pi1(I) 736 739 Else … … 753 756 End Do 754 757 755 If (Dg >0) Dg = 2 * Dg / Dqsc758 If (Dg .GT.0) Dg = 2 * Dg / Dqsc 756 759 Dqsc = 2 * Dqsc / Dx**2 757 760 Dqxt = 2 * Dqxt / Dx**2 -
LMDZ6/branches/Amaury_dev/libf/phylmd/cosp2/parasol.F90
r5093 r5095 81 81 ! Lum_norm=f(PARASOL_SZA,tau_cloud) derived from adding-doubling calculations 82 82 ! valid ONLY ABOVE OCEAN (albedo_sfce=5%) 83 ! valid only in one viewing direction (theta_v=30 °, phi_s-phi_v=320°)83 ! valid only in one viewing direction (theta_v=30�, phi_s-phi_v=320�) 84 84 ! based on adding-doubling radiative transfer computation 85 85 ! for PARASOL_TAU values (0 to 100) and for PARASOL_SZA values (0 to 80) … … 97 97 98 98 ! Relative fraction of the opt. thick due to liquid or ice clouds 99 WHERE (tautot_S(1:npoints) >0.)99 WHERE (tautot_S(1:npoints) .gt. 0.) 100 100 frac_taucol_liq(1:npoints) = tautot_S_liq(1:npoints) / tautot_S(1:npoints) 101 101 frac_taucol_ice(1:npoints) = tautot_S_ice(1:npoints) / tautot_S(1:npoints) … … 118 118 DO it=1,PARASOL_NREFL 119 119 DO ny=1,PARASOL_NTAU-1 120 WHERE (tautot_S(1:npoints) >=PARASOL_TAU(ny).and. &121 tautot_S(1:npoints) <=PARASOL_TAU(ny+1))120 WHERE (tautot_S(1:npoints) .ge. PARASOL_TAU(ny).and. & 121 tautot_S(1:npoints) .le. PARASOL_TAU(ny+1)) 122 122 rlumA_mod(1:npoints,it) = aA(it,ny)*tautot_S(1:npoints) + bA(it,ny) 123 123 rlumB_mod(1:npoints,it) = aB(it,ny)*tautot_S(1:npoints) + bB(it,ny) -
LMDZ6/branches/Amaury_dev/libf/phylmd/cosp2/phys_cosp2.F90
r5082 r5095 257 257 cfg%Lrttov_sim,cfg%Lstats 258 258 259 if (overlaplmdz /=overlap) then259 if (overlaplmdz.ne.overlap) then 260 260 print*,'Attention overlaplmdz different de overlap lu dans namelist ' 261 261 endif … … 265 265 266 266 !!! Ici on modifie les cles logiques pour les outputs selon les champs actives dans les .xml 267 if ((itap >1).and.(first_write))then267 if ((itap.gt.1).and.(first_write))then 268 268 269 269 IF (using_xios) call read_xiosfieldactive(cfg) … … 331 331 332 332 do ip = 1, Npoints 333 if (fracTerLic(ip) >=0.5) then333 if (fracTerLic(ip).ge.0.5) then 334 334 gbx%land(ip) = 1. 335 335 else -
LMDZ6/branches/Amaury_dev/libf/phylmd/cosp2/prec_scops.F90
r5082 r5095 64 64 65 65 cv_col = scops_ccfrac*ncol 66 if (cv_col ==0) cv_col=166 if (cv_col .eq. 0) cv_col=1 67 67 68 68 do ilev=1,nlev … … 81 81 flag_cv=0 82 82 do ilev=1,nlev 83 if (frac_out(j,ibox,ilev) == 1) then83 if (frac_out(j,ibox,ilev) .eq. 1) then 84 84 flag_ls=1 85 85 endif 86 if (frac_out(j,ibox,ilev) == 2) then86 if (frac_out(j,ibox,ilev) .eq. 2) then 87 87 flag_cv=1 88 88 endif 89 89 enddo !loop over nlev 90 if (flag_ls ==1) then90 if (flag_ls .eq. 1) then 91 91 frac_out_ls(j,ibox)=1 92 92 endif 93 if (flag_cv ==1) then93 if (flag_cv .eq. 1) then 94 94 frac_out_cv(j,ibox)=1 95 95 endif … … 102 102 flag_cv=0 103 103 104 if (ls_p_rate(j,1) > 0.) then104 if (ls_p_rate(j,1) .gt. 0.) then 105 105 do ibox=1,ncol ! possibility ONE 106 if (frac_out(j,ibox,1) == 1) then106 if (frac_out(j,ibox,1) .eq. 1) then 107 107 prec_frac(j,ibox,1) = 1 108 108 flag_ls=1 109 109 endif 110 110 enddo ! loop over ncol 111 if (flag_ls ==0) then ! possibility THREE111 if (flag_ls .eq. 0) then ! possibility THREE 112 112 do ibox=1,ncol 113 if (frac_out(j,ibox,2) == 1) then113 if (frac_out(j,ibox,2) .eq. 1) then 114 114 prec_frac(j,ibox,1) = 1 115 115 flag_ls=1 … … 117 117 enddo ! loop over ncol 118 118 endif 119 if (flag_ls ==0) then ! possibility Four120 do ibox=1,ncol 121 if (frac_out_ls(j,ibox) == 1) then119 if (flag_ls .eq. 0) then ! possibility Four 120 do ibox=1,ncol 121 if (frac_out_ls(j,ibox) .eq. 1) then 122 122 prec_frac(j,ibox,1) = 1 123 123 flag_ls=1 … … 125 125 enddo ! loop over ncol 126 126 endif 127 if (flag_ls ==0) then ! possibility Five127 if (flag_ls .eq. 0) then ! possibility Five 128 128 do ibox=1,ncol 129 129 ! prec_frac(j,1:ncol,1) = 1 … … 134 134 ! There is large scale precipitation 135 135 136 if (cv_p_rate(j,1) > 0.) then136 if (cv_p_rate(j,1) .gt. 0.) then 137 137 do ibox=1,ncol ! possibility ONE 138 if (frac_out(j,ibox,1) == 2) then139 if (prec_frac(j,ibox,1) ==0) then138 if (frac_out(j,ibox,1) .eq. 2) then 139 if (prec_frac(j,ibox,1) .eq. 0) then 140 140 prec_frac(j,ibox,1) = 2 141 141 else … … 145 145 endif 146 146 enddo ! loop over ncol 147 if (flag_cv ==0) then ! possibility THREE148 do ibox=1,ncol 149 if (frac_out(j,ibox,2) == 2) then150 if (prec_frac(j,ibox,1) ==0) then147 if (flag_cv .eq. 0) then ! possibility THREE 148 do ibox=1,ncol 149 if (frac_out(j,ibox,2) .eq. 2) then 150 if (prec_frac(j,ibox,1) .eq. 0) then 151 151 prec_frac(j,ibox,1) = 2 152 152 else … … 157 157 enddo ! loop over ncol 158 158 endif 159 if (flag_cv ==0) then ! possibility Four160 do ibox=1,ncol 161 if (frac_out_cv(j,ibox) == 1) then162 if (prec_frac(j,ibox,1) ==0) then159 if (flag_cv .eq. 0) then ! possibility Four 160 do ibox=1,ncol 161 if (frac_out_cv(j,ibox) .eq. 1) then 162 if (prec_frac(j,ibox,1) .eq. 0) then 163 163 prec_frac(j,ibox,1) = 2 164 164 else … … 169 169 enddo ! loop over ncol 170 170 endif 171 if (flag_cv ==0) then ! possibility Five171 if (flag_cv .eq. 0) then ! possibility Five 172 172 do ibox=1,cv_col 173 if (prec_frac(j,ibox,1) ==0) then173 if (prec_frac(j,ibox,1) .eq. 0) then 174 174 prec_frac(j,ibox,1) = 2 175 175 else … … 192 192 flag_cv=0 193 193 194 if (ls_p_rate(j,ilev) > 0.) then194 if (ls_p_rate(j,ilev) .gt. 0.) then 195 195 do ibox=1,ncol ! possibility ONE&TWO 196 if ((frac_out(j,ibox,ilev) == 1) .or. ((prec_frac(j,ibox,ilev-1) ==1) &197 .or. (prec_frac(j,ibox,ilev-1) == 3))) then196 if ((frac_out(j,ibox,ilev) .eq. 1) .or. ((prec_frac(j,ibox,ilev-1) .eq. 1) & 197 .or. (prec_frac(j,ibox,ilev-1) .eq. 3))) then 198 198 prec_frac(j,ibox,ilev) = 1 199 199 flag_ls=1 200 200 endif 201 201 enddo ! loop over ncol 202 if ((flag_ls == 0) .and. (ilev <nlev)) then ! possibility THREE203 do ibox=1,ncol 204 if (frac_out(j,ibox,ilev+1) == 1) then202 if ((flag_ls .eq. 0) .and. (ilev .lt. nlev)) then ! possibility THREE 203 do ibox=1,ncol 204 if (frac_out(j,ibox,ilev+1) .eq. 1) then 205 205 prec_frac(j,ibox,ilev) = 1 206 206 flag_ls=1 … … 208 208 enddo ! loop over ncol 209 209 endif 210 if (flag_ls ==0) then ! possibility Four211 do ibox=1,ncol 212 if (frac_out_ls(j,ibox) == 1) then210 if (flag_ls .eq. 0) then ! possibility Four 211 do ibox=1,ncol 212 if (frac_out_ls(j,ibox) .eq. 1) then 213 213 prec_frac(j,ibox,ilev) = 1 214 214 flag_ls=1 … … 216 216 enddo ! loop over ncol 217 217 endif 218 if (flag_ls ==0) then ! possibility Five218 if (flag_ls .eq. 0) then ! possibility Five 219 219 do ibox=1,ncol 220 220 ! prec_frac(j,1:ncol,ilev) = 1 … … 224 224 endif ! There is large scale precipitation 225 225 226 if (cv_p_rate(j,ilev) > 0.) then226 if (cv_p_rate(j,ilev) .gt. 0.) then 227 227 do ibox=1,ncol ! possibility ONE&TWO 228 if ((frac_out(j,ibox,ilev) == 2) .or. ((prec_frac(j,ibox,ilev-1) ==2) &229 .or. (prec_frac(j,ibox,ilev-1) == 3))) then230 if (prec_frac(j,ibox,ilev) ==0) then228 if ((frac_out(j,ibox,ilev) .eq. 2) .or. ((prec_frac(j,ibox,ilev-1) .eq. 2) & 229 .or. (prec_frac(j,ibox,ilev-1) .eq. 3))) then 230 if (prec_frac(j,ibox,ilev) .eq. 0) then 231 231 prec_frac(j,ibox,ilev) = 2 232 232 else … … 236 236 endif 237 237 enddo ! loop over ncol 238 if ((flag_cv == 0) .and. (ilev <nlev)) then ! possibility THREE239 do ibox=1,ncol 240 if (frac_out(j,ibox,ilev+1) == 2) then241 if (prec_frac(j,ibox,ilev) ==0) then238 if ((flag_cv .eq. 0) .and. (ilev .lt. nlev)) then ! possibility THREE 239 do ibox=1,ncol 240 if (frac_out(j,ibox,ilev+1) .eq. 2) then 241 if (prec_frac(j,ibox,ilev) .eq. 0) then 242 242 prec_frac(j,ibox,ilev) = 2 243 243 else … … 248 248 enddo ! loop over ncol 249 249 endif 250 if (flag_cv ==0) then ! possibility Four251 do ibox=1,ncol 252 if (frac_out_cv(j,ibox) == 1) then253 if (prec_frac(j,ibox,ilev) ==0) then250 if (flag_cv .eq. 0) then ! possibility Four 251 do ibox=1,ncol 252 if (frac_out_cv(j,ibox) .eq. 1) then 253 if (prec_frac(j,ibox,ilev) .eq. 0) then 254 254 prec_frac(j,ibox,ilev) = 2 255 255 else … … 260 260 enddo ! loop over ncol 261 261 endif 262 if (flag_cv == 0) then ! possibility Five262 if (flag_cv .eq. 0) then ! possibility Five 263 263 do ibox=1,cv_col 264 if (prec_frac(j,ibox,ilev) ==0) then264 if (prec_frac(j,ibox,ilev) .eq. 0) then 265 265 prec_frac(j,ibox,ilev) = 2 266 266 else -
LMDZ6/branches/Amaury_dev/libf/phylmd/cosp2/quickbeam.F90
r5082 r5095 182 182 183 183 ! Attenuation due to gaseous absorption between radar and volume 184 if ((rcfg%use_gas_abs == 1) .or. (rcfg%use_gas_abs == 2 .and. pr ==1)) then184 if ((rcfg%use_gas_abs == 1) .or. (rcfg%use_gas_abs == 2 .and. pr .eq. 1)) then 185 185 if (d_gate==1) then 186 186 if (k>1) then … … 270 270 enddo 271 271 enddo 272 where(cfad_ze /=R_UNDEF) cfad_ze = cfad_ze/Ncolumns272 where(cfad_ze .ne. R_UNDEF) cfad_ze = cfad_ze/Ncolumns 273 273 274 274 else … … 279 279 enddo 280 280 enddo 281 where(cfad_ze /=R_UNDEF) cfad_ze = cfad_ze/Ncolumns281 where(cfad_ze .ne. R_UNDEF) cfad_ze = cfad_ze/Ncolumns 282 282 endif 283 283 -
LMDZ6/branches/Amaury_dev/libf/phylmd/cosp2/quickbeam_optics.F90
r5086 r5095 160 160 ! Gas attenuation (only need to do this for the first subcolumn (i.e. cmpGases=true) 161 161 if (cmpGases) then 162 if (rcfg%use_gas_abs == 1 .or. (rcfg%use_gas_abs == 2 .and. pr ==1)) then162 if (rcfg%use_gas_abs == 1 .or. (rcfg%use_gas_abs == 2 .and. pr .eq. 1)) then 163 163 g_vol(pr,k) = gases(p_matrix(pr,k),t_matrix(pr,k),sh_matrix(pr,k),rcfg%freq) 164 164 endif … … 195 195 196 196 ! Compute effective radius from number concentration and distribution parameters 197 if (Re_internal ==0) then197 if (Re_internal .eq. 0) then 198 198 call calc_Re(hm_matrix(pr,k,tp),Np_matrix(pr,k,tp),rho_a, & 199 199 sd%dtype(tp),sd%apm(tp),sd%bpm(tp),sd%rho(tp),sd%p1(tp),sd%p2(tp),sd%p3(tp),Re) … … 210 210 ! Index into particle size dimension of scaling tables 211 211 iRe_type=1 212 if(Re >0) then212 if(Re.gt.0) then 213 213 ! Determine index in to scale LUT 214 214 ! Distance between Re points (defined by "base" and "step") for … … 220 220 base = rcfg%base_list(n+1) 221 221 iRe_type=Re/step 222 if (iRe_type <1) iRe_type=1222 if (iRe_type.lt.1) iRe_type=1 223 223 Re=step*(iRe_type+0.5_wp) ! set value of Re to closest value allowed in LUT. 224 224 iRe_type=iRe_type+base-int(n*Re_BIN_LENGTH/step) 225 225 226 226 ! Make sure iRe_type is within bounds 227 if (iRe_type >=nRe_types) then227 if (iRe_type.ge.nRe_types) then 228 228 !write(*,*) 'Warning: size of Re exceed value permitted ', & 229 229 ! 'in Look-Up Table (LUT). Will calculate. ' … … 431 431 ! Exponential is same as modified gamma with vu =1 432 432 ! if Np is specified then we will just treat as modified gamma 433 if(dtype == 2 .and. Np >0) then433 if(dtype .eq. 2 .and. Np .gt. 0) then 434 434 local_dtype = 1 435 435 local_p3 = 1 … … 467 467 endif 468 468 469 if( Np ==0 .and. p2+1 > 1E-8) then ! use default value for MEAN diameter as first default469 if( Np.eq.0 .and. p2+1 > 1E-8) then ! use default value for MEAN diameter as first default 470 470 dm = p2 ! by definition, should have units of microns 471 471 D0 = gamma(vu)/gamma(vu+1)*dm 472 472 else ! use value of Np 473 if(Np ==0) then473 if(Np.eq.0) then 474 474 if( abs(p1+1) > 1E-8 ) then ! use default number concentration 475 475 local_Np = p1 ! total number concentration / pa --- units kg^-1 … … 551 551 552 552 ! get rg ... 553 if( Np ==0 .and. (abs(p2+1) > 1E-8) ) then ! use default value of rg553 if( Np.eq.0 .and. (abs(p2+1) > 1E-8) ) then ! use default value of rg 554 554 rg = p2 555 555 else … … 852 852 log_sigma_g = p3 853 853 tmp2 = (bpm*log_sigma_g)*(bpm*log_sigma_g) 854 if(Re <=0) then854 if(Re.le.0) then 855 855 rg = p2 856 856 else … … 1009 1009 call mieint(sizep(i), m0(i), one, dqv, qext(i), dqsc, qbsca(i), & 1010 1010 dg, xs1, xs2, dph, err) 1011 END DO1011 end do 1012 1012 1013 1013 else -
LMDZ6/branches/Amaury_dev/libf/phylmd/cosp2/scops.F90
r5082 r5095 75 75 76 76 ! Test for valid input overlap assumption 77 if (overlap /= 1 .and. overlap /= 2 .and. overlap /=3) then77 if (overlap .ne. 1 .and. overlap .ne. 2 .and. overlap .ne. 3) then 78 78 overlap=default_overlap 79 79 call errorMessage('ERROR(scops): Invalid overlap assumption provided. Using default overlap assumption (max/ran)') … … 92 92 tca(1:npoints,1:nlev) = cc(1:npoints,1:nlev) 93 93 94 if (ncolprint /=0) then94 if (ncolprint.ne.0) then 95 95 write (6,'(a)') 'frac_out_pp_rev:' 96 96 do j=1,npoints,1000 … … 102 102 write (6,'(I3)') ncol 103 103 endif 104 if (ncolprint /=0) then104 if (ncolprint.ne.0) then 105 105 write (6,'(a)') 'last_frac_pp:' 106 106 do j=1,npoints,1000 … … 122 122 123 123 ! Initialise threshold 124 IF (ilev ==1) then124 IF (ilev.eq.1) then 125 125 ! If max overlap 126 IF (overlap ==1) then126 IF (overlap.eq.1) then 127 127 ! Select pixels spread evenly across the gridbox 128 128 threshold(1:npoints,1:ncol)=boxpos(1:npoints,1:ncol) … … 137 137 enddo 138 138 ENDIF 139 IF (ncolprint /=0) then139 IF (ncolprint.ne.0) then 140 140 write (6,'(a)') 'threshold_nsf2:' 141 141 do j=1,npoints,1000 … … 147 147 ENDIF 148 148 149 IF (ncolprint /=0) then149 IF (ncolprint.ne.0) then 150 150 write (6,'(a)') 'ilev:' 151 151 write (6,'(I2)') ilev … … 157 157 !maxocc(1:npoints,ibox) = merge(1,0, conv(1:npoints,ilev) .gt. boxpos(1:npoints,ibox)) 158 158 do j=1,npoints 159 if (boxpos(j,ibox) <=conv(j,ilev)) then159 if (boxpos(j,ibox).le.conv(j,ilev)) then 160 160 maxocc(j,ibox) = 1 161 161 else … … 165 165 166 166 ! Max overlap 167 if (overlap ==1) then167 if (overlap.eq.1) then 168 168 threshold_min(1:npoints,ibox) = conv(1:npoints,ilev) 169 169 maxosc(1:npoints,ibox) = 1 … … 171 171 172 172 ! Random overlap 173 if (overlap ==2) then173 if (overlap.eq.2) then 174 174 threshold_min(1:npoints,ibox) = conv(1:npoints,ilev) 175 175 maxosc(1:npoints,ibox) = 0 176 176 endif 177 177 ! Max/Random overlap 178 if (overlap ==3) then178 if (overlap.eq.3) then 179 179 ! DS2014 START: The bounds on tca are not valid when ilev=1. 180 180 !threshold_min(1:npoints,ibox) = max(conv(1:npoints,ilev),min(tca(1:npoints,ilev-1),tca(1:npoints,ilev))) … … 182 182 ! min(tca(1:npoints,ilev-1),tca(1:npoints,ilev)) .and. & 183 183 ! (threshold(1:npoints,ibox).gt.conv(1:npoints,ilev))) 184 if (ilev /=1) then184 if (ilev .ne. 1) then 185 185 threshold_min(1:npoints,ibox) = max(conv(1:npoints,ilev),min(tca(1:npoints,ilev-1),tca(1:npoints,ilev))) 186 maxosc(1:npoints,ibox) = merge(1,0,threshold(1:npoints,ibox) <&186 maxosc(1:npoints,ibox) = merge(1,0,threshold(1:npoints,ibox) .lt. & 187 187 min(tca(1:npoints,ilev-1),tca(1:npoints,ilev)) .and. & 188 (threshold(1:npoints,ibox) >conv(1:npoints,ilev)))188 (threshold(1:npoints,ibox).gt.conv(1:npoints,ilev))) 189 189 else 190 190 threshold_min(1:npoints,ibox) = max(conv(1:npoints,ilev),min(0._wp,tca(1:npoints,ilev))) 191 maxosc(1:npoints,ibox) = merge(1,0,threshold(1:npoints,ibox) <&191 maxosc(1:npoints,ibox) = merge(1,0,threshold(1:npoints,ibox) .lt. & 192 192 min(0._wp,tca(1:npoints,ilev)) .and. & 193 (threshold(1:npoints,ibox) >conv(1:npoints,ilev)))193 (threshold(1:npoints,ibox).gt.conv(1:npoints,ilev))) 194 194 endif 195 195 endif … … 205 205 206 206 ! Fill frac_out with 1's where tca is greater than the threshold 207 frac_out(1:npoints,ibox,ilev) = merge(1,0,tca(1:npoints,ilev) >threshold(1:npoints,ibox))207 frac_out(1:npoints,ibox,ilev) = merge(1,0,tca(1:npoints,ilev).gt.threshold(1:npoints,ibox)) 208 208 209 209 ! Code to partition boxes into startiform and convective parts goes here 210 where(threshold(1:npoints,ibox) <=conv(1:npoints,ilev) .and. conv(1:npoints,ilev)>0.) frac_out(1:npoints,ibox,ilev)=2210 where(threshold(1:npoints,ibox).le.conv(1:npoints,ilev) .and. conv(1:npoints,ilev).gt.0.) frac_out(1:npoints,ibox,ilev)=2 211 211 ENDDO ! ibox 212 212 213 213 214 214 ! Set last_frac to tca at this level, so as to be tca from last level next time round 215 if (ncolprint /=0) then215 if (ncolprint.ne.0) then 216 216 do j=1,npoints ,1000 217 217 write(6,'(a10)') 'j=' -
LMDZ6/branches/Amaury_dev/libf/phylmd/cospv2/MISR_simulator.F90
r5082 r5095 84 84 do ilev=1,nlev 85 85 ! Define location of "layer top" 86 if(ilev ==1 .or. ilev==nlev) then86 if(ilev.eq.1 .or. ilev.eq.nlev) then 87 87 ztest=zfull(j,ilev) 88 88 else … … 94 94 iMISR_ztop=2 95 95 do loop=2,numMISRHgtBins 96 if ( ztest >1000*misr_histHgt(loop+1) ) then96 if ( ztest .gt. 1000*misr_histHgt(loop+1) ) then 97 97 iMISR_ztop=loop+1 98 98 endif … … 110 110 do ilev=1,nlev 111 111 ! If there a cloud, start the counter and store this height 112 if(thres_crossed_MISR == 0 .and. dtau(j,ibox,ilev) >0.) then112 if(thres_crossed_MISR .eq. 0 .and. dtau(j,ibox,ilev) .gt. 0.) then 113 113 ! First encountered a "cloud" 114 114 thres_crossed_MISR = 1 … … 116 116 endif 117 117 118 if( thres_crossed_MISR < 99 .and. thres_crossed_MISR >0 ) then119 if( dtau(j,ibox,ilev) ==0.) then118 if( thres_crossed_MISR .lt. 99 .and. thres_crossed_MISR .gt. 0 ) then 119 if( dtau(j,ibox,ilev) .eq. 0.) then 120 120 ! We have come to the end of the current cloud layer without yet 121 121 ! selecting a CTH boundary. Restart cloud tau counter … … 129 129 ! current layer cloud top to the current level then MISR will like 130 130 ! see a top below the top of the current layer. 131 if( dtau(j,ibox,ilev) >0 .and. (cloud_dtau-dtau(j,ibox,ilev)) <1) then132 if(dtau(j,ibox,ilev) < 1 .or. ilev==1 .or. ilev==nlev) then131 if( dtau(j,ibox,ilev).gt.0 .and. (cloud_dtau-dtau(j,ibox,ilev)) .lt. 1) then 132 if(dtau(j,ibox,ilev) .lt. 1 .or. ilev.eq.1 .or. ilev.eq.nlev) then 133 133 ! MISR will likely penetrate to some point within this layer ... the middle 134 134 MISR_penetration_height=zfull(j,ilev) … … 142 142 143 143 ! Check for a distinctive water layer 144 if(dtau(j,ibox,ilev) > 1 .and. at(j,ilev) >273 ) then144 if(dtau(j,ibox,ilev) .gt. 1 .and. at(j,ilev) .gt. 273 ) then 145 145 ! Must be a water cloud, take this as CTH level 146 146 thres_crossed_MISR=99 … … 149 149 ! If the total column optical depth is "large" than MISR can't see 150 150 ! anything else. Set current point as CTH level 151 if(sum(dtau(j,ibox,1:ilev)) >5) then151 if(sum(dtau(j,ibox,1:ilev)) .gt. 5) then 152 152 thres_crossed_MISR=99 153 153 endif … … 157 157 ! Check to see if there was a cloud for which we didn't 158 158 ! set a MISR cloud top boundary 159 if( thres_crossed_MISR ==1) then159 if( thres_crossed_MISR .eq. 1) then 160 160 ! If the cloud has a total optical depth of greater 161 161 ! than ~ 0.5 MISR will still likely pick up this cloud 162 162 ! with a height near the true cloud top 163 163 ! otherwise there should be no CTH 164 if(sum(dtau(j,ibox,1:nlev)) >0.5) then164 if(sum(dtau(j,ibox,1:nlev)) .gt. 0.5) then 165 165 ! keep MISR detected CTH 166 elseif(sum(dtau(j,ibox,1:nlev)) >0.2) then166 elseif(sum(dtau(j,ibox,1:nlev)) .gt. 0.2) then 167 167 ! MISR may detect but wont likley have a good height 168 168 box_MISR_ztop(j,ibox)=-1 … … 215 215 ! Fill dark scenes 216 216 do j=1,numMISRHgtBins 217 where(sunlit /=1) dist_model_layertops(1:npoints,j) = R_UNDEF217 where(sunlit .ne. 1) dist_model_layertops(1:npoints,j) = R_UNDEF 218 218 enddo 219 219 … … 257 257 258 258 ! Subcolumns that are cloudy(true) and not(false) 259 box_cloudy(1:ncol) = merge(.true.,.false.,tau(j,1:ncol) >tauchk)259 box_cloudy(1:ncol) = merge(.true.,.false.,tau(j,1:ncol) .gt. tauchk) 260 260 261 261 ! Fill optically thin clouds with fill value 262 262 where(.not. box_cloudy(1:ncol)) tauWRK(j,1:ncol) = -999._wp 263 where(box_MISR_ztopWRK(j,1:ncol) ==0) box_MISR_ztopWRK(j,1:ncol)=-999._wp263 where(box_MISR_ztopWRK(j,1:ncol) .eq. 0) box_MISR_ztopWRK(j,1:ncol)=-999._wp 264 264 265 265 ! Compute joint histogram and column quantities for points that are sunlit and cloudy 266 if (sunlit(j) == 1) then266 if (sunlit(j) .eq. 1) then 267 267 ! Joint histogram 268 268 call hist2D(tauWRK(j,1:ncol),box_MISR_ztopWRK(j,1:ncol),ncol,misr_histTau,numMISRTauBins,& … … 272 272 273 273 ! Column cloud area 274 MISR_cldarea(j)=real(count(box_MISR_ztopWRK(j,1:ncol) /=-999.))/ncol274 MISR_cldarea(j)=real(count(box_MISR_ztopWRK(j,1:ncol) .ne. -999.))/ncol 275 275 276 276 ! Column cloud-top height 277 if ( count(box_MISR_ztopWRK(j,1:ncol) /= -999.) /=0 ) then278 MISR_mean_ztop(j) = sum(box_MISR_ztopWRK(j,1:ncol),box_MISR_ztopWRK(j,1:ncol) /=-999.)/ &279 count(box_MISR_ztopWRK(j,1:ncol) /=-999.)277 if ( count(box_MISR_ztopWRK(j,1:ncol) .ne. -999.) .ne. 0 ) then 278 MISR_mean_ztop(j) = sum(box_MISR_ztopWRK(j,1:ncol),box_MISR_ztopWRK(j,1:ncol) .ne. -999.)/ & 279 count(box_MISR_ztopWRK(j,1:ncol) .ne. -999.) 280 280 else 281 281 MISR_mean_ztop(j) = R_UNDEF -
LMDZ6/branches/Amaury_dev/libf/phylmd/cospv2/cosp.F90
r5086 r5095 480 480 481 481 ! Set flag to deallocate rttov types (only done on final call to simulator) 482 if (size(cospOUT%isccp_meantb) ==stop_idx) lrttov_cleanUp = .true.482 if (size(cospOUT%isccp_meantb) .eq. stop_idx) lrttov_cleanUp = .true. 483 483 484 484 ! ISCCP column … … 687 687 modisIN%w0 => cospIN%ss_alb 688 688 modisIN%Nsunlit = count(cospgridIN%sunlit > 0) 689 if (modisIN%Nsunlit >0) then689 if (modisIN%Nsunlit .gt. 0) then 690 690 allocate(modisIN%sunlit(modisIN%Nsunlit),modisIN%pres(modisIN%Nsunlit,cospIN%Nlevels+1)) 691 691 modisIN%sunlit = pack((/ (i, i = 1, Npoints ) /),mask = cospgridIN%sunlit > 0) 692 692 modisIN%pres = cospgridIN%phalf(int(modisIN%sunlit(:)),:) 693 693 endif 694 if (count(cospgridIN%sunlit <= 0) >0) then694 if (count(cospgridIN%sunlit <= 0) .gt. 0) then 695 695 allocate(modisIN%notSunlit(count(cospgridIN%sunlit <= 0))) 696 696 modisIN%notSunlit = pack((/ (i, i = 1, Npoints ) /),mask = .not. cospgridIN%sunlit > 0) … … 886 886 modisRetrievedCloudTopPressure(i,:), & 887 887 modisRetrievedTau(i,:),modisRetrievedSize(i,:)) 888 END DO888 end do 889 889 endif 890 890 endif … … 2430 2430 !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 2431 2431 if (any([Lisccp_subcolumn, Lisccp_column, Lmisr_subcolumn, Lmisr_column, Lmodis_subcolumn, Lmodis_column])) then 2432 if (any(cospgridIN%sunlit <0)) then2432 if (any(cospgridIN%sunlit .lt. 0)) then 2433 2433 nError=nError+1 2434 2434 errorMessage(nError) = 'ERROR: COSP input variable: cospgridIN%sunlit contains values out of range (0 or 1)' … … 2498 2498 Lcalipso_column, Lcloudsat_column, Lradar_lidar_tcc,Llidar_only_freq_cloud, & 2499 2499 Lcloudsat_tcc, Lcloudsat_tcc2])) then 2500 if (any(cospgridIN%at <0)) then2500 if (any(cospgridIN%at .lt. 0)) then 2501 2501 nError=nError+1 2502 2502 errorMessage(nError) = 'ERROR: COSP input variable: cospgridIN%at contains values out of range (at<0), expected units (K)' … … 2546 2546 endif 2547 2547 if (any([Lisccp_subcolumn, Lisccp_column, Lrttov_column])) then 2548 if (any(cospgridIN%pfull <0)) then2548 if (any(cospgridIN%pfull .lt. 0)) then 2549 2549 nError=nError+1 2550 2550 errorMessage(nError) = 'ERROR: COSP input variable: cospgridIN%pfull contains values out of range' … … 2566 2566 if (any([Lisccp_subcolumn,Lisccp_column,Lmodis_subcolumn,Lmodis_column,Lcalipso_column,Lrttov_column,& 2567 2567 LgrLidar532_column,Latlid_column])) then 2568 if (any(cospgridIN%phalf <0)) then2568 if (any(cospgridIN%phalf .lt. 0)) then 2569 2569 nError=nError+1 2570 2570 errorMessage(nError) = 'ERROR: COSP input variable: cospgridIN%phalf contains values out of range' … … 2648 2648 endif 2649 2649 if (any([Lisccp_subcolumn,Lisccp_column,Lrttov_column])) then 2650 if (any(cospgridIN%qv <0)) then2650 if (any(cospgridIN%qv .lt. 0)) then 2651 2651 nError=nError+1 2652 2652 errorMessage(nError) = 'ERROR: COSP input variable: cospgridIN%qv contains values out of range' … … 2668 2668 if (any([Lmisr_subcolumn,Lmisr_column,Lcloudsat_subcolumn,Lcloudsat_column,Lcalipso_column,Lradar_lidar_tcc,& 2669 2669 Llidar_only_freq_cloud,LgrLidar532_column,Latlid_column,Lcloudsat_tcc, Lcloudsat_tcc2])) then 2670 if (any(cospgridIN%hgt_matrix <-300)) then2670 if (any(cospgridIN%hgt_matrix .lt. -300)) then 2671 2671 nError=nError+1 2672 2672 errorMessage(nError) = 'ERROR: COSP input variable: cospgridIN%hgt_matrix contains values out of range' … … 2714 2714 if (any([Lrttov_column,Lcloudsat_column,Lcalipso_column,Lradar_lidar_tcc,Llidar_only_freq_cloud, & 2715 2715 LgrLidar532_column, Latlid_column, Lcloudsat_tcc, Lcloudsat_tcc2])) then 2716 if (any(cospgridIN%hgt_matrix_half <-300)) then2716 if (any(cospgridIN%hgt_matrix_half .lt. -300)) then 2717 2717 nError=nError+1 2718 2718 errorMessage(nError) = 'ERROR: COSP input variable: cospgridIN%hgt_matrix_half contains values out of range' … … 2753 2753 endif 2754 2754 if (any([Lrttov_column,Lcalipso_column,Lparasol_column])) then 2755 if (any(cospgridIN%land <0)) then2755 if (any(cospgridIN%land .lt. 0)) then 2756 2756 nError=nError+1 2757 2757 errorMessage(nError) = 'ERROR: COSP input variable: cospgridIN%land contains values out of range' … … 2776 2776 endif 2777 2777 if (any([Lisccp_subcolumn,Lisccp_column,Lrttov_column])) then 2778 if (any(cospgridIN%skt <0)) then2778 if (any(cospgridIN%skt .lt. 0)) then 2779 2779 nError=nError+1 2780 2780 errorMessage(nError) = 'ERROR: COSP input variable: cospgridIN%skt contains values out of range' … … 2797 2797 ! RTTOV Inputs 2798 2798 if (Lrttov_column) then 2799 if (cospgridIN%zenang < -90. .OR. cospgridIN%zenang >90) then2799 if (cospgridIN%zenang .lt. -90. .OR. cospgridIN%zenang .gt. 90) then 2800 2800 nError=nError+1 2801 2801 errorMessage(nError) = 'ERROR: COSP input variable: cospgridIN%zenang contains values out of range' … … 2803 2803 if (associated(cospOUT%rttov_tbs)) cospOUT%rttov_tbs(:,:) = R_UNDEF 2804 2804 endif 2805 if (cospgridIN%co2 <0) then2805 if (cospgridIN%co2 .lt. 0) then 2806 2806 nError=nError+1 2807 2807 errorMessage(nError) = 'ERROR: COSP input variable: cospgridIN%co2 contains values out of range' … … 2809 2809 if (associated(cospOUT%rttov_tbs)) cospOUT%rttov_tbs(:,:) = R_UNDEF 2810 2810 endif 2811 if (cospgridIN%ch4 <0) then2811 if (cospgridIN%ch4 .lt. 0) then 2812 2812 nError=nError+1 2813 2813 errorMessage(nError) = 'ERROR: COSP input variable: cospgridIN%ch4 contains values out of range' … … 2815 2815 if (associated(cospOUT%rttov_tbs)) cospOUT%rttov_tbs(:,:) = R_UNDEF 2816 2816 endif 2817 if (cospgridIN%n2o <0) then2817 if (cospgridIN%n2o .lt. 0) then 2818 2818 nError=nError+1 2819 2819 errorMessage(nError) = 'ERROR: COSP input variable: cospgridIN%n2o contains values out of range' … … 2821 2821 if (associated(cospOUT%rttov_tbs)) cospOUT%rttov_tbs(:,:) = R_UNDEF 2822 2822 endif 2823 if (cospgridIN%co <0) then2823 if (cospgridIN%co.lt. 0) then 2824 2824 nError=nError+1 2825 2825 errorMessage(nError) = 'ERROR: COSP input variable: cospgridIN%co contains values out of range' … … 2827 2827 if (associated(cospOUT%rttov_tbs)) cospOUT%rttov_tbs(:,:) = R_UNDEF 2828 2828 endif 2829 if (any(cospgridIN%o3 <0)) then2829 if (any(cospgridIN%o3 .lt. 0)) then 2830 2830 nError=nError+1 2831 2831 errorMessage(nError) = 'ERROR: COSP input variable: cospgridIN%o3 contains values out of range' … … 2833 2833 if (associated(cospOUT%rttov_tbs)) cospOUT%rttov_tbs(:,:) = R_UNDEF 2834 2834 endif 2835 if (any(cospgridIN%emis_sfc < 0. .OR. cospgridIN%emis_sfc >1)) then2835 if (any(cospgridIN%emis_sfc .lt. 0. .OR. cospgridIN%emis_sfc .gt. 1)) then 2836 2836 nError=nError+1 2837 2837 errorMessage(nError) = 'ERROR: COSP input variable: cospgridIN%emis_sfc contains values out of range' … … 2839 2839 if (associated(cospOUT%rttov_tbs)) cospOUT%rttov_tbs(:,:) = R_UNDEF 2840 2840 endif 2841 if (any(cospgridIN%u_sfc < -100. .OR. cospgridIN%u_sfc >100.)) then2841 if (any(cospgridIN%u_sfc .lt. -100. .OR. cospgridIN%u_sfc .gt. 100.)) then 2842 2842 nError=nError+1 2843 2843 errorMessage(nError) = 'ERROR: COSP input variable: cospIN%u_sfc contains values out of range' … … 2845 2845 Lrttov_column = .false. 2846 2846 endif 2847 if (any(cospgridIN%v_sfc < -100. .OR. cospgridIN%v_sfc >100.)) then2847 if (any(cospgridIN%v_sfc .lt. -100. .OR. cospgridIN%v_sfc .gt. 100.)) then 2848 2848 nError=nError+1 2849 2849 errorMessage(nError) = 'ERROR: COSP input variable: cospIN%v_sfc contains values out of range' … … 2851 2851 if (associated(cospOUT%rttov_tbs)) cospOUT%rttov_tbs(:,:) = R_UNDEF 2852 2852 endif 2853 if (any(cospgridIN%lat < -90 .OR. cospgridIN%lat >90)) then2853 if (any(cospgridIN%lat .lt. -90 .OR. cospgridIN%lat .gt. 90)) then 2854 2854 nError=nError+1 2855 2855 errorMessage(nError) = 'ERROR: COSP input variable: cospIN%lat contains values out of range' … … 2861 2861 ! COSP_INPUTS 2862 2862 if (any([Lisccp_subcolumn,Lisccp_column])) then 2863 if (cospIN%emsfc_lw < 0. .OR. cospIN%emsfc_lw >1.) then2863 if (cospIN%emsfc_lw .lt. 0. .OR. cospIN%emsfc_lw .gt. 1.) then 2864 2864 nError=nError+1 2865 2865 errorMessage(nError) = 'ERROR: COSP input variable: cospIN%emsfc_lw contains values out of range' … … 2878 2878 endif 2879 2879 if (any([Lisccp_subcolumn,Lisccp_column,Lmisr_subcolumn,Lmisr_column,Lmodis_subcolumn,Lmodis_column])) then 2880 if (any(cospIN%tau_067 <0)) then2880 if (any(cospIN%tau_067 .lt. 0)) then 2881 2881 nError=nError+1 2882 2882 errorMessage(nError) = 'ERROR: COSP input variable: cospIN%tau_067 contains values out of range' … … 2943 2943 endif 2944 2944 if (any([Lisccp_subcolumn,Lisccp_column])) then 2945 if (any(cospIN%emiss_11 < 0. .OR. cospIN%emiss_11 >1)) then2945 if (any(cospIN%emiss_11 .lt. 0. .OR. cospIN%emiss_11 .gt. 1)) then 2946 2946 nError=nError+1 2947 2947 errorMessage(nError) = 'ERROR: COSP input variable: cospIN%emiss_11 contains values out of range' … … 2960 2960 endif 2961 2961 if (any([Lmodis_subcolumn,Lmodis_column])) then 2962 if (any(cospIN%asym < -1. .OR. cospIN%asym >1)) then2962 if (any(cospIN%asym .lt. -1. .OR. cospIN%asym .gt. 1)) then 2963 2963 nError=nError+1 2964 2964 errorMessage(nError) = 'ERROR: COSP input variable: cospIN%asym contains values out of range' … … 3006 3006 cospOUT%modis_Optical_Thickness_vs_ReffLIQ(:,:,:) = R_UNDEF 3007 3007 endif 3008 if (any(cospIN%ss_alb < 0 .OR. cospIN%ss_alb >1)) then3008 if (any(cospIN%ss_alb .lt. 0 .OR. cospIN%ss_alb .gt. 1)) then 3009 3009 nError=nError+1 3010 3010 errorMessage(nError) = 'ERROR: COSP input variable: cospIN%ss_alb contains values out of range' … … 3054 3054 endif 3055 3055 if (any([Latlid_subcolumn,Latlid_column])) then 3056 if (any(cospIN%betatot_atlid <0)) then3056 if (any(cospIN%betatot_atlid .lt. 0)) then 3057 3057 nError=nError+1 3058 3058 errorMessage(nError) = 'ERROR: COSP input variable: cospIN%betatot_atlid contains values out of range' … … 3065 3065 if (associated(cospOUT%atlid_beta_mol)) cospOUT%atlid_beta_mol(:,:) = R_UNDEF 3066 3066 endif 3067 if (any(cospIN%beta_mol_atlid <0)) then3067 if (any(cospIN%beta_mol_atlid .lt. 0)) then 3068 3068 nError=nError+1 3069 3069 errorMessage(nError) = 'ERROR: COSP input variable: cospIN%beta_mol_atlid contains values out of range' … … 3076 3076 if (associated(cospOUT%atlid_beta_mol)) cospOUT%atlid_beta_mol(:,:) = R_UNDEF 3077 3077 endif 3078 if (any(cospIN%tautot_atlid <0)) then3078 if (any(cospIN%tautot_atlid .lt. 0)) then 3079 3079 nError=nError+1 3080 3080 errorMessage(nError) = 'ERROR: COSP input variable: cospIN%tautot_atlid contains values out of range' … … 3087 3087 if (associated(cospOUT%atlid_beta_mol)) cospOUT%atlid_beta_mol(:,:) = R_UNDEF 3088 3088 endif 3089 if (any(cospIN%tau_mol_atlid <0)) then3089 if (any(cospIN%tau_mol_atlid .lt. 0)) then 3090 3090 nError=nError+1 3091 3091 errorMessage(nError) = 'ERROR: COSP input variable: cospIN%tau_mol_atlid contains values out of range' … … 3101 3101 3102 3102 if (any([LgrLidar532_subcolumn,LgrLidar532_column])) then 3103 if (any(cospIN%betatot_grLidar532 <0)) then3103 if (any(cospIN%betatot_grLidar532 .lt. 0)) then 3104 3104 nError=nError+1 3105 3105 errorMessage(nError) = 'ERROR: COSP input variable: cospIN%betatot_grLidar532 contains values out of range' … … 3112 3112 if (associated(cospOUT%grLidar532_beta_mol)) cospOUT%grLidar532_beta_mol(:,:) = R_UNDEF 3113 3113 endif 3114 if (any(cospIN%beta_mol_grLidar532 <0)) then3114 if (any(cospIN%beta_mol_grLidar532 .lt. 0)) then 3115 3115 nError=nError+1 3116 3116 errorMessage(nError) = 'ERROR: COSP input variable: cospIN%beta_mol_grLidar532 contains values out of range' … … 3123 3123 if (associated(cospOUT%grLidar532_beta_mol)) cospOUT%grLidar532_beta_mol(:,:) = R_UNDEF 3124 3124 endif 3125 if (any(cospIN%tautot_grLidar532 <0)) then3125 if (any(cospIN%tautot_grLidar532 .lt. 0)) then 3126 3126 nError=nError+1 3127 3127 errorMessage(nError) = 'ERROR: COSP input variable: cospIN%tautot_grLidar532 contains values out of range' … … 3134 3134 if (associated(cospOUT%grLidar532_beta_mol)) cospOUT%grLidar532_beta_mol(:,:) = R_UNDEF 3135 3135 endif 3136 if (any(cospIN%tau_mol_grLidar532 <0)) then3136 if (any(cospIN%tau_mol_grLidar532 .lt. 0)) then 3137 3137 nError=nError+1 3138 3138 errorMessage(nError) = 'ERROR: COSP input variable: cospIN%tau_mol_grLidar532 contains values out of range' … … 3148 3148 3149 3149 if (any([Lcalipso_subcolumn,Lcalipso_column])) then 3150 if (any(cospIN%betatot_calipso <0)) then3150 if (any(cospIN%betatot_calipso .lt. 0)) then 3151 3151 nError=nError+1 3152 3152 errorMessage(nError) = 'ERROR: COSP input variable: cospIN%betatot_calipso contains values out of range' … … 3167 3167 if (associated(cospOUT%calipso_cldthinemis)) cospOUT%calipso_cldthinemis(:) = R_UNDEF 3168 3168 endif 3169 if (any(cospIN%betatot_liq_calipso <0)) then3169 if (any(cospIN%betatot_liq_calipso .lt. 0)) then 3170 3170 nError=nError+1 3171 3171 errorMessage(nError) = ('ERROR: COSP input variable: cospIN%betatot_liq_calipso contains values out of range') … … 3186 3186 if (associated(cospOUT%calipso_cldthinemis)) cospOUT%calipso_cldthinemis(:) = R_UNDEF 3187 3187 endif 3188 if (any(cospIN%betatot_ice_calipso <0)) then3188 if (any(cospIN%betatot_ice_calipso .lt. 0)) then 3189 3189 nError=nError+1 3190 3190 errorMessage(nError) = 'ERROR: COSP input variable: cospIN%betatot_ice_calipso contains values out of range' … … 3205 3205 if (associated(cospOUT%calipso_cldthinemis)) cospOUT%calipso_cldthinemis(:) = R_UNDEF 3206 3206 endif 3207 if (any(cospIN%tautot_calipso <0)) then3207 if (any(cospIN%tautot_calipso .lt. 0)) then 3208 3208 nError=nError+1 3209 3209 errorMessage(nError) = 'ERROR: COSP input variable: cospIN%tautot_calipso contains values out of range' … … 3224 3224 if (associated(cospOUT%calipso_cldthinemis)) cospOUT%calipso_cldthinemis(:) = R_UNDEF 3225 3225 endif 3226 if (any(cospIN%tautot_liq_calipso <0)) then3226 if (any(cospIN%tautot_liq_calipso .lt. 0)) then 3227 3227 nError=nError+1 3228 3228 errorMessage(nError) = ('ERROR: COSP input variable: cospIN%tautot_liq_calipso contains values out of range') … … 3243 3243 if (associated(cospOUT%calipso_cldthinemis)) cospOUT%calipso_cldthinemis(:) = R_UNDEF 3244 3244 endif 3245 if (any(cospIN%tautot_ice_calipso <0)) then3245 if (any(cospIN%tautot_ice_calipso .lt. 0)) then 3246 3246 nError=nError+1 3247 3247 errorMessage(nError) = 'ERROR: COSP input variable: cospIN%tautot_ice_calipso contains values out of range' … … 3262 3262 if (associated(cospOUT%calipso_cldthinemis)) cospOUT%calipso_cldthinemis(:) = R_UNDEF 3263 3263 endif 3264 if (any(cospIN%tau_mol_calipso <0)) then3264 if (any(cospIN%tau_mol_calipso .lt. 0)) then 3265 3265 nError=nError+1 3266 3266 errorMessage(nError) = 'ERROR: COSP input variable: cospIN%tau_mol_calipso contains values out of range' … … 3284 3284 if (any([Lcalipso_subcolumn,Lcalipso_column,Lcloudsat_column,Lradar_lidar_tcc, & 3285 3285 Llidar_only_freq_cloud, Lcloudsat_tcc, Lcloudsat_tcc2])) then 3286 if (any(cospIN%beta_mol_calipso <0)) then3286 if (any(cospIN%beta_mol_calipso .lt. 0)) then 3287 3287 nError=nError+1 3288 3288 errorMessage(nError) = 'ERROR: COSP input variable: cospIN%beta_mol_calipso contains values out of range' … … 3315 3315 endif 3316 3316 if (any([Lparasol_subcolumn,Lparasol_column])) then 3317 if (any(cospIN%tautot_S_liq <0)) then3317 if (any(cospIN%tautot_S_liq .lt. 0)) then 3318 3318 nError=nError+1 3319 3319 errorMessage(nError) = 'ERROR: COSP input variable: cospIN%tautot_S_liq contains values out of range' … … 3323 3323 if (associated(cospOUT%parasolGrid_refl)) cospOUT%parasolGrid_refl(:,:) = R_UNDEF 3324 3324 endif 3325 if (any(cospIN%tautot_S_ice <0)) then3325 if (any(cospIN%tautot_S_ice .lt. 0)) then 3326 3326 nError=nError+1 3327 3327 errorMessage(nError) = 'ERROR: COSP input variable: cospIN%tautot_S_ice contains values out of range' … … 3334 3334 if (any([Lcloudsat_subcolumn,Lcloudsat_column,Lradar_lidar_tcc,Llidar_only_freq_cloud, & 3335 3335 Lcloudsat_tcc, Lcloudsat_tcc2])) then 3336 if (any(cospIN%z_vol_cloudsat <0)) then3336 if (any(cospIN%z_vol_cloudsat .lt. 0)) then 3337 3337 nError=nError+1 3338 3338 errorMessage(nError) = 'ERROR: COSP input variable: cospIN%z_vol_cloudsat contains values out of range' … … 3350 3350 if (associated(cospOUT%cloudsat_tcc2)) cospOUT%cloudsat_tcc2(:) = R_UNDEF 3351 3351 endif 3352 if (any(cospIN%kr_vol_cloudsat <0)) then3352 if (any(cospIN%kr_vol_cloudsat .lt. 0)) then 3353 3353 nError=nError+1 3354 3354 errorMessage(nError) = 'ERROR: COSP input variable: cospIN%kr_vol_cloudsat contains values out of range' … … 3366 3366 if (associated(cospOUT%cloudsat_tcc2)) cospOUT%cloudsat_tcc2(:) = R_UNDEF 3367 3367 endif 3368 if (any(cospIN%g_vol_cloudsat <0)) then3368 if (any(cospIN%g_vol_cloudsat .lt. 0)) then 3369 3369 nError=nError+1 3370 3370 errorMessage(nError) = 'ERROR: COSP input variable: cospIN%g_vol_cloudsat contains values out of range' … … 3389 3389 ! ISCCP 3390 3390 if (Lisccp_subcolumn .or. Lisccp_column) then 3391 if (size(cospIN%frac_out,1) /=cospIN%Npoints .OR. &3392 size(cospIN%tau_067,1) /=cospIN%Npoints .OR. &3393 size(cospIN%emiss_11,1) /=cospIN%Npoints .OR. &3394 size(cospgridIN%skt) /=cospIN%Npoints .OR. &3395 size(cospgridIN%qv,1) /=cospIN%Npoints .OR. &3396 size(cospgridIN%at,1) /=cospIN%Npoints .OR. &3397 size(cospgridIN%phalf,1) /=cospIN%Npoints .OR. &3398 size(cospgridIN%sunlit) /=cospIN%Npoints .OR. &3399 size(cospgridIN%pfull,1) /=cospIN%Npoints) then3391 if (size(cospIN%frac_out,1) .ne. cospIN%Npoints .OR. & 3392 size(cospIN%tau_067,1) .ne. cospIN%Npoints .OR. & 3393 size(cospIN%emiss_11,1) .ne. cospIN%Npoints .OR. & 3394 size(cospgridIN%skt) .ne. cospIN%Npoints .OR. & 3395 size(cospgridIN%qv,1) .ne. cospIN%Npoints .OR. & 3396 size(cospgridIN%at,1) .ne. cospIN%Npoints .OR. & 3397 size(cospgridIN%phalf,1) .ne. cospIN%Npoints .OR. & 3398 size(cospgridIN%sunlit) .ne. cospIN%Npoints .OR. & 3399 size(cospgridIN%pfull,1) .ne. cospIN%Npoints) then 3400 3400 Lisccp_subcolumn = .false. 3401 3401 Lisccp_column = .false. … … 3403 3403 errorMessage(nError) = 'ERROR(isccp_simulator): The number of points in the input fields are inconsistent' 3404 3404 endif 3405 if (size(cospIN%frac_out,2) /=cospIN%Ncolumns .OR. &3406 size(cospIN%tau_067,2) /=cospIN%Ncolumns .OR. &3407 size(cospIN%emiss_11,2) /=cospIN%Ncolumns) then3405 if (size(cospIN%frac_out,2) .ne. cospIN%Ncolumns .OR. & 3406 size(cospIN%tau_067,2) .ne. cospIN%Ncolumns .OR. & 3407 size(cospIN%emiss_11,2) .ne. cospIN%Ncolumns) then 3408 3408 Lisccp_subcolumn = .false. 3409 3409 Lisccp_column = .false. … … 3411 3411 errorMessage(nError) = 'ERROR(isccp_simulator): The number of sub-columns in the input fields are inconsistent' 3412 3412 endif 3413 if (size(cospIN%frac_out,3) /=cospIN%Nlevels .OR. &3414 size(cospIN%tau_067,3) /=cospIN%Nlevels .OR. &3415 size(cospIN%emiss_11,3) /=cospIN%Nlevels .OR. &3416 size(cospgridIN%qv,2) /=cospIN%Nlevels .OR. &3417 size(cospgridIN%at,2) /=cospIN%Nlevels .OR. &3418 size(cospgridIN%pfull,2) /=cospIN%Nlevels .OR. &3419 size(cospgridIN%phalf,2) /=cospIN%Nlevels+1) then3413 if (size(cospIN%frac_out,3) .ne. cospIN%Nlevels .OR. & 3414 size(cospIN%tau_067,3) .ne. cospIN%Nlevels .OR. & 3415 size(cospIN%emiss_11,3) .ne. cospIN%Nlevels .OR. & 3416 size(cospgridIN%qv,2) .ne. cospIN%Nlevels .OR. & 3417 size(cospgridIN%at,2) .ne. cospIN%Nlevels .OR. & 3418 size(cospgridIN%pfull,2) .ne. cospIN%Nlevels .OR. & 3419 size(cospgridIN%phalf,2) .ne. cospIN%Nlevels+1) then 3420 3420 Lisccp_subcolumn = .false. 3421 3421 Lisccp_column = .false. … … 3427 3427 ! MISR 3428 3428 if (Lmisr_subcolumn .or. Lmisr_column) then 3429 if (size(cospIN%tau_067,1) /=cospIN%Npoints .OR. &3430 size(cospgridIN%sunlit) /=cospIN%Npoints .OR. &3431 size(cospgridIN%hgt_matrix,1) /=cospIN%Npoints .OR. &3432 size(cospgridIN%at,1) /=cospIN%Npoints) then3429 if (size(cospIN%tau_067,1) .ne. cospIN%Npoints .OR. & 3430 size(cospgridIN%sunlit) .ne. cospIN%Npoints .OR. & 3431 size(cospgridIN%hgt_matrix,1) .ne. cospIN%Npoints .OR. & 3432 size(cospgridIN%at,1) .ne. cospIN%Npoints) then 3433 3433 Lmisr_subcolumn = .false. 3434 3434 Lmisr_column = .false. … … 3436 3436 errorMessage(nError) = 'ERROR(misr_simulator): The number of points in the input fields are inconsistent' 3437 3437 endif 3438 if (size(cospIN%tau_067,2) /=cospIN%Ncolumns) then3438 if (size(cospIN%tau_067,2) .ne. cospIN%Ncolumns) then 3439 3439 Lmisr_subcolumn = .false. 3440 3440 Lmisr_column = .false. … … 3442 3442 errorMessage(nError) = 'ERROR(misr_simulator): The number of sub-columns in the input fields are inconsistent' 3443 3443 endif 3444 if (size(cospIN%tau_067,3) /=cospIN%Nlevels .OR. &3445 size(cospgridIN%hgt_matrix,2) /=cospIN%Nlevels .OR. &3446 size(cospgridIN%at,2) /=cospIN%Nlevels) then3444 if (size(cospIN%tau_067,3) .ne. cospIN%Nlevels .OR. & 3445 size(cospgridIN%hgt_matrix,2) .ne. cospIN%Nlevels .OR. & 3446 size(cospgridIN%at,2) .ne. cospIN%Nlevels) then 3447 3447 Lmisr_subcolumn = .false. 3448 3448 Lmisr_column = .false. … … 3454 3454 ! MODIS 3455 3455 if (Lmodis_subcolumn .or. Lmodis_column) then 3456 if (size(cospIN%fracLiq,1) /=cospIN%Npoints .OR. &3457 size(cospIN%tau_067,1) /=cospIN%Npoints .OR. &3458 size(cospIN%asym,1) /=cospIN%Npoints .OR. &3459 size(cospIN%ss_alb,1) /=cospIN%Npoints) then3456 if (size(cospIN%fracLiq,1) .ne. cospIN%Npoints .OR. & 3457 size(cospIN%tau_067,1) .ne. cospIN%Npoints .OR. & 3458 size(cospIN%asym,1) .ne. cospIN%Npoints .OR. & 3459 size(cospIN%ss_alb,1) .ne. cospIN%Npoints) then 3460 3460 Lmodis_subcolumn = .false. 3461 3461 Lmodis_column = .false. … … 3463 3463 errorMessage(nError) = 'ERROR(modis_simulator): The number of points in the input fields are inconsistent' 3464 3464 endif 3465 if (size(cospIN%fracLiq,2) /=cospIN%Ncolumns .OR. &3466 size(cospIN%tau_067,2) /=cospIN%Ncolumns .OR. &3467 size(cospIN%asym,2) /=cospIN%Ncolumns .OR. &3468 size(cospIN%ss_alb,2) /=cospIN%Ncolumns) then3465 if (size(cospIN%fracLiq,2) .ne. cospIN%Ncolumns .OR. & 3466 size(cospIN%tau_067,2) .ne. cospIN%Ncolumns .OR. & 3467 size(cospIN%asym,2) .ne. cospIN%Ncolumns .OR. & 3468 size(cospIN%ss_alb,2) .ne. cospIN%Ncolumns) then 3469 3469 Lmodis_subcolumn = .false. 3470 3470 Lmodis_column = .false. … … 3472 3472 errorMessage(nError) = 'ERROR(modis_simulator): The number of sub-columns in the input fields are inconsistent' 3473 3473 endif 3474 if (size(cospIN%fracLiq,3) /=cospIN%Nlevels .OR. &3475 size(cospIN%tau_067,3) /=cospIN%Nlevels .OR. &3476 size(cospIN%asym,3) /=cospIN%Nlevels .OR. &3477 size(cospIN%ss_alb,3) /=cospIN%Nlevels) then3474 if (size(cospIN%fracLiq,3) .ne. cospIN%Nlevels .OR. & 3475 size(cospIN%tau_067,3) .ne. cospIN%Nlevels .OR. & 3476 size(cospIN%asym,3) .ne. cospIN%Nlevels .OR. & 3477 size(cospIN%ss_alb,3) .ne. cospIN%Nlevels) then 3478 3478 Lmodis_subcolumn = .false. 3479 3479 Lmodis_column = .false. … … 3485 3485 ! CLOUDSAT 3486 3486 if (Lcloudsat_subcolumn .or. Lcloudsat_column) then 3487 if (size(cospIN%z_vol_cloudsat,1) /=cospIN%Npoints .OR. &3488 size(cospIN%kr_vol_cloudsat,1) /=cospIN%Npoints .OR. &3489 size(cospIN%g_vol_cloudsat,1) /=cospIN%Npoints .OR. &3490 size(cospgridIN%hgt_matrix,1) /=cospIN%Npoints) then3487 if (size(cospIN%z_vol_cloudsat,1) .ne. cospIN%Npoints .OR. & 3488 size(cospIN%kr_vol_cloudsat,1) .ne. cospIN%Npoints .OR. & 3489 size(cospIN%g_vol_cloudsat,1) .ne. cospIN%Npoints .OR. & 3490 size(cospgridIN%hgt_matrix,1) .ne. cospIN%Npoints) then 3491 3491 Lcloudsat_subcolumn = .false. 3492 3492 Lcloudsat_column = .false. … … 3494 3494 errorMessage(nError) = 'ERROR(cloudsat_simulator): The number of points in the input fields are inconsistent' 3495 3495 endif 3496 if (size(cospIN%z_vol_cloudsat,2) /=cospIN%Ncolumns .OR. &3497 size(cospIN%kr_vol_cloudsat,2) /=cospIN%Ncolumns .OR. &3498 size(cospIN%g_vol_cloudsat,2) /=cospIN%Ncolumns) then3496 if (size(cospIN%z_vol_cloudsat,2) .ne. cospIN%Ncolumns .OR. & 3497 size(cospIN%kr_vol_cloudsat,2) .ne. cospIN%Ncolumns .OR. & 3498 size(cospIN%g_vol_cloudsat,2) .ne. cospIN%Ncolumns) then 3499 3499 Lcloudsat_subcolumn = .false. 3500 3500 Lcloudsat_column = .false. … … 3502 3502 errorMessage(nError) = 'ERROR(cloudsat_simulator): The number of sub-columns in the input fields are inconsistent' 3503 3503 endif 3504 if (size(cospIN%z_vol_cloudsat,3) /=cospIN%Nlevels .OR. &3505 size(cospIN%kr_vol_cloudsat,3) /=cospIN%Nlevels .OR. &3506 size(cospIN%g_vol_cloudsat,3) /=cospIN%Nlevels .OR. &3507 size(cospgridIN%hgt_matrix,2) /=cospIN%Nlevels) then3504 if (size(cospIN%z_vol_cloudsat,3) .ne. cospIN%Nlevels .OR. & 3505 size(cospIN%kr_vol_cloudsat,3) .ne. cospIN%Nlevels .OR. & 3506 size(cospIN%g_vol_cloudsat,3) .ne. cospIN%Nlevels .OR. & 3507 size(cospgridIN%hgt_matrix,2) .ne. cospIN%Nlevels) then 3508 3508 Lcloudsat_subcolumn = .false. 3509 3509 Lcloudsat_column = .false. … … 3515 3515 ! GROUND LIDAR @ 532nm 3516 3516 if (LgrLidar532_subcolumn .or. LgrLidar532_column) then 3517 if (size(cospIN%beta_mol_grLidar532,1) /= cospIN%Npoints .OR. &3518 size(cospIN%betatot_grLidar532,1) /=cospIN%Npoints .OR. &3519 size(cospIN%tau_mol_grLidar532,1) /=cospIN%Npoints .OR. &3520 size(cospIN%tautot_grLidar532,1) /=cospIN%Npoints) then3517 if (size(cospIN%beta_mol_grLidar532,1) .ne. cospIN%Npoints .OR. & 3518 size(cospIN%betatot_grLidar532,1) .ne. cospIN%Npoints .OR. & 3519 size(cospIN%tau_mol_grLidar532,1) .ne. cospIN%Npoints .OR. & 3520 size(cospIN%tautot_grLidar532,1) .ne. cospIN%Npoints) then 3521 3521 LgrLidar532_subcolumn = .false. 3522 3522 LgrLidar532_column = .false. … … 3524 3524 errorMessage(nError) = 'ERROR(grLidar532_simulator): The number of points in the input fields are inconsistent' 3525 3525 endif 3526 if (size(cospIN%betatot_grLidar532,2) /= cospIN%Ncolumns .OR. &3527 size(cospIN%tautot_grLidar532,2) /= cospIN%Ncolumns) then3526 if (size(cospIN%betatot_grLidar532,2) .ne. cospIN%Ncolumns .OR. & 3527 size(cospIN%tautot_grLidar532,2) .ne. cospIN%Ncolumns) then 3528 3528 LgrLidar532_subcolumn = .false. 3529 3529 LgrLidar532_column = .false. … … 3531 3531 errorMessage(nError) = 'ERROR(grLidar532_simulator): The number of sub-columns in the input fields are inconsistent' 3532 3532 endif 3533 if (size(cospIN%beta_mol_grLidar532,2) /=cospIN%Nlevels .OR. &3534 size(cospIN%betatot_grLidar532,3) /=cospIN%Nlevels .OR. &3535 size(cospIN%tau_mol_grLidar532,2) /=cospIN%Nlevels .OR. &3536 size(cospIN%tautot_grLidar532,3) /=cospIN%Nlevels) then3533 if (size(cospIN%beta_mol_grLidar532,2) .ne. cospIN%Nlevels .OR. & 3534 size(cospIN%betatot_grLidar532,3) .ne. cospIN%Nlevels .OR. & 3535 size(cospIN%tau_mol_grLidar532,2) .ne. cospIN%Nlevels .OR. & 3536 size(cospIN%tautot_grLidar532,3) .ne. cospIN%Nlevels) then 3537 3537 LgrLidar532_subcolumn = .false. 3538 3538 LgrLidar532_column = .false. … … 3544 3544 ! ATLID 3545 3545 if (Latlid_subcolumn .or. Latlid_column) then 3546 if (size(cospIN%beta_mol_atlid,1) /=cospIN%Npoints .OR. &3547 size(cospIN%betatot_atlid,1) /=cospIN%Npoints .OR. &3548 size(cospIN%tau_mol_atlid,1) /= cospIN%Npoints .OR. &3549 size(cospIN%tautot_atlid,1) /= cospIN%Npoints) then3546 if (size(cospIN%beta_mol_atlid,1) .ne. cospIN%Npoints .OR. & 3547 size(cospIN%betatot_atlid,1) .ne. cospIN%Npoints .OR. & 3548 size(cospIN%tau_mol_atlid,1) .ne. cospIN%Npoints .OR. & 3549 size(cospIN%tautot_atlid,1) .ne. cospIN%Npoints) then 3550 3550 Latlid_subcolumn = .false. 3551 3551 Latlid_column = .false. … … 3553 3553 errorMessage(nError) = 'ERROR(atlid_simulator): The number of points in the input fields are inconsistent' 3554 3554 endif 3555 if (size(cospIN%betatot_atlid,2) /=cospIN%Ncolumns .OR. &3556 size(cospIN%tautot_atlid,2) /= cospIN%Ncolumns) then3555 if (size(cospIN%betatot_atlid,2) .ne. cospIN%Ncolumns .OR. & 3556 size(cospIN%tautot_atlid,2) .ne. cospIN%Ncolumns) then 3557 3557 Latlid_subcolumn = .false. 3558 3558 Latlid_column = .false. … … 3560 3560 errorMessage(nError) = 'ERROR(atlid_simulator): The number of sub-columns in the input fields are inconsistent' 3561 3561 endif 3562 if (size(cospIN%beta_mol_atlid,2) /=cospIN%Nlevels .OR. &3563 size(cospIN%betatot_atlid,3) /= cospIN%Nlevels .OR. &3564 size(cospIN%tau_mol_atlid,2) /=cospIN%Nlevels .OR. &3565 size(cospIN%tautot_atlid,3) /= cospIN%Nlevels) then3562 if (size(cospIN%beta_mol_atlid,2) .ne. cospIN%Nlevels .OR. & 3563 size(cospIN%betatot_atlid,3) .ne. cospIN%Nlevels .OR. & 3564 size(cospIN%tau_mol_atlid,2) .ne. cospIN%Nlevels .OR. & 3565 size(cospIN%tautot_atlid,3) .ne. cospIN%Nlevels) then 3566 3566 Latlid_subcolumn = .false. 3567 3567 Latlid_column = .false. … … 3573 3573 ! CALIPSO 3574 3574 if (Lcalipso_subcolumn .or. Lcalipso_column) then 3575 if (size(cospIN%beta_mol_calipso,1) /=cospIN%Npoints .OR. &3576 size(cospIN%betatot_calipso,1) /=cospIN%Npoints .OR. &3577 size(cospIN%betatot_liq_calipso,1) /=cospIN%Npoints .OR. &3578 size(cospIN%betatot_ice_calipso,1) /=cospIN%Npoints .OR. &3579 size(cospIN%tau_mol_calipso,1) /=cospIN%Npoints .OR. &3580 size(cospIN%tautot_calipso,1) /=cospIN%Npoints .OR. &3581 size(cospIN%tautot_liq_calipso,1) /=cospIN%Npoints .OR. &3582 size(cospIN%tautot_ice_calipso,1) /=cospIN%Npoints) then3575 if (size(cospIN%beta_mol_calipso,1) .ne. cospIN%Npoints .OR. & 3576 size(cospIN%betatot_calipso,1) .ne. cospIN%Npoints .OR. & 3577 size(cospIN%betatot_liq_calipso,1) .ne. cospIN%Npoints .OR. & 3578 size(cospIN%betatot_ice_calipso,1) .ne. cospIN%Npoints .OR. & 3579 size(cospIN%tau_mol_calipso,1) .ne. cospIN%Npoints .OR. & 3580 size(cospIN%tautot_calipso,1) .ne. cospIN%Npoints .OR. & 3581 size(cospIN%tautot_liq_calipso,1) .ne. cospIN%Npoints .OR. & 3582 size(cospIN%tautot_ice_calipso,1) .ne. cospIN%Npoints) then 3583 3583 Lcalipso_subcolumn = .false. 3584 3584 Lcalipso_column = .false. … … 3586 3586 errorMessage(nError) = 'ERROR(calipso_simulator): The number of points in the input fields are inconsistent' 3587 3587 endif 3588 if (size(cospIN%betatot_calipso,2) /=cospIN%Ncolumns .OR. &3589 size(cospIN%betatot_liq_calipso,2) /=cospIN%Ncolumns .OR. &3590 size(cospIN%betatot_ice_calipso,2) /=cospIN%Ncolumns .OR. &3591 size(cospIN%tautot_calipso,2) /=cospIN%Ncolumns .OR. &3592 size(cospIN%tautot_liq_calipso,2) /=cospIN%Ncolumns .OR. &3593 size(cospIN%tautot_ice_calipso,2) /=cospIN%Ncolumns) then3588 if (size(cospIN%betatot_calipso,2) .ne. cospIN%Ncolumns .OR. & 3589 size(cospIN%betatot_liq_calipso,2) .ne. cospIN%Ncolumns .OR. & 3590 size(cospIN%betatot_ice_calipso,2) .ne. cospIN%Ncolumns .OR. & 3591 size(cospIN%tautot_calipso,2) .ne. cospIN%Ncolumns .OR. & 3592 size(cospIN%tautot_liq_calipso,2) .ne. cospIN%Ncolumns .OR. & 3593 size(cospIN%tautot_ice_calipso,2) .ne. cospIN%Ncolumns) then 3594 3594 Lcalipso_subcolumn = .false. 3595 3595 Lcalipso_column = .false. … … 3597 3597 errorMessage(nError) = 'ERROR(calipso_simulator): The number of sub-columns in the input fields are inconsistent' 3598 3598 endif 3599 if (size(cospIN%beta_mol_calipso,2) /=cospIN%Nlevels .OR. &3600 size(cospIN%betatot_calipso,3) /=cospIN%Nlevels .OR. &3601 size(cospIN%betatot_liq_calipso,3) /=cospIN%Nlevels .OR. &3602 size(cospIN%betatot_ice_calipso,3) /=cospIN%Nlevels .OR. &3603 size(cospIN%tau_mol_calipso,2) /=cospIN%Nlevels .OR. &3604 size(cospIN%tautot_calipso,3) /=cospIN%Nlevels .OR. &3605 size(cospIN%tautot_liq_calipso,3) /=cospIN%Nlevels .OR. &3606 size(cospIN%tautot_ice_calipso,3) /=cospIN%Nlevels) then3599 if (size(cospIN%beta_mol_calipso,2) .ne. cospIN%Nlevels .OR. & 3600 size(cospIN%betatot_calipso,3) .ne. cospIN%Nlevels .OR. & 3601 size(cospIN%betatot_liq_calipso,3) .ne. cospIN%Nlevels .OR. & 3602 size(cospIN%betatot_ice_calipso,3) .ne. cospIN%Nlevels .OR. & 3603 size(cospIN%tau_mol_calipso,2) .ne. cospIN%Nlevels .OR. & 3604 size(cospIN%tautot_calipso,3) .ne. cospIN%Nlevels .OR. & 3605 size(cospIN%tautot_liq_calipso,3) .ne. cospIN%Nlevels .OR. & 3606 size(cospIN%tautot_ice_calipso,3) .ne. cospIN%Nlevels) then 3607 3607 Lcalipso_subcolumn = .false. 3608 3608 Lcalipso_column = .false. … … 3614 3614 ! PARASOL 3615 3615 if (Lparasol_subcolumn .or. Lparasol_column) then 3616 if (size(cospIN%tautot_S_liq,1) /=cospIN%Npoints .OR. &3617 size(cospIN%tautot_S_ice,1) /=cospIN%Npoints) then3616 if (size(cospIN%tautot_S_liq,1) .ne. cospIN%Npoints .OR. & 3617 size(cospIN%tautot_S_ice,1) .ne. cospIN%Npoints) then 3618 3618 Lparasol_subcolumn = .false. 3619 3619 Lparasol_column = .false. … … 3621 3621 errorMessage(nError) = 'ERROR(parasol_simulator): The number of points in the input fields are inconsistent' 3622 3622 endif 3623 if (size(cospIN%tautot_S_liq,2) /=cospIN%Ncolumns .OR. &3624 size(cospIN%tautot_S_ice,2) /=cospIN%Ncolumns) then3623 if (size(cospIN%tautot_S_liq,2) .ne. cospIN%Ncolumns .OR. & 3624 size(cospIN%tautot_S_ice,2) .ne. cospIN%Ncolumns) then 3625 3625 Lparasol_subcolumn = .false. 3626 3626 Lparasol_column = .false. … … 3632 3632 ! RTTOV 3633 3633 if (Lrttov_column) then 3634 if (size(cospgridIN%pfull,1) /=cospIN%Npoints .OR. &3635 size(cospgridIN%at,1) /=cospIN%Npoints .OR. &3636 size(cospgridIN%qv,1) /=cospIN%Npoints .OR. &3637 size(cospgridIN%hgt_matrix_half,1) /=cospIN%Npoints .OR. &3638 size(cospgridIN%u_sfc) /=cospIN%Npoints .OR. &3639 size(cospgridIN%v_sfc) /=cospIN%Npoints .OR. &3640 size(cospgridIN%skt) /=cospIN%Npoints .OR. &3641 size(cospgridIN%phalf,1) /=cospIN%Npoints .OR. &3642 size(cospgridIN%qv,1) /=cospIN%Npoints .OR. &3643 size(cospgridIN%land) /=cospIN%Npoints .OR. &3644 size(cospgridIN%lat) /=cospIN%Npoints) then3634 if (size(cospgridIN%pfull,1) .ne. cospIN%Npoints .OR. & 3635 size(cospgridIN%at,1) .ne. cospIN%Npoints .OR. & 3636 size(cospgridIN%qv,1) .ne. cospIN%Npoints .OR. & 3637 size(cospgridIN%hgt_matrix_half,1) .ne. cospIN%Npoints .OR. & 3638 size(cospgridIN%u_sfc) .ne. cospIN%Npoints .OR. & 3639 size(cospgridIN%v_sfc) .ne. cospIN%Npoints .OR. & 3640 size(cospgridIN%skt) .ne. cospIN%Npoints .OR. & 3641 size(cospgridIN%phalf,1) .ne. cospIN%Npoints .OR. & 3642 size(cospgridIN%qv,1) .ne. cospIN%Npoints .OR. & 3643 size(cospgridIN%land) .ne. cospIN%Npoints .OR. & 3644 size(cospgridIN%lat) .ne. cospIN%Npoints) then 3645 3645 Lrttov_column = .false. 3646 3646 nError=nError+1 3647 3647 errorMessage(nError) = 'ERROR(rttov_simulator): The number of points in the input fields are inconsistent' 3648 3648 endif 3649 if (size(cospgridIN%pfull,2) /=cospIN%Nlevels .OR. &3650 size(cospgridIN%at,2) /=cospIN%Nlevels .OR. &3651 size(cospgridIN%qv,2) /=cospIN%Nlevels .OR. &3652 size(cospgridIN%hgt_matrix_half,2) /=cospIN%Nlevels+1 .OR. &3653 size(cospgridIN%phalf,2) /=cospIN%Nlevels+1 .OR. &3654 size(cospgridIN%qv,2) /=cospIN%Nlevels) then3649 if (size(cospgridIN%pfull,2) .ne. cospIN%Nlevels .OR. & 3650 size(cospgridIN%at,2) .ne. cospIN%Nlevels .OR. & 3651 size(cospgridIN%qv,2) .ne. cospIN%Nlevels .OR. & 3652 size(cospgridIN%hgt_matrix_half,2) .ne. cospIN%Nlevels+1 .OR. & 3653 size(cospgridIN%phalf,2) .ne. cospIN%Nlevels+1 .OR. & 3654 size(cospgridIN%qv,2) .ne. cospIN%Nlevels) then 3655 3655 Lrttov_column = .false. 3656 3656 nError=nError+1 -
LMDZ6/branches/Amaury_dev/libf/phylmd/cospv2/cosp_optics.F90
r5087 r5095 72 72 varOUT(1:dim1,1:dim2,1:dim3) = 0._wp 73 73 do j=1,dim2 74 where(flag(:,j,:) ==1)74 where(flag(:,j,:) .eq. 1) 75 75 varOUT(:,j,:) = varIN2 76 76 endwhere 77 where(flag(:,j,:) ==2)77 where(flag(:,j,:) .eq. 2) 78 78 varOUT(:,j,:) = varIN1 79 79 endwhere … … 96 96 97 97 varOUT(1:dim1,1:dim2,1:dim3) = 0._wp 98 where(flag(:,:,:) ==1)98 where(flag(:,:,:) .eq. 1) 99 99 varOUT(:,:,:) = varIN2 100 100 endwhere 101 where(flag(:,:,:) ==2)101 where(flag(:,:,:) .eq. 2) 102 102 varOUT(:,:,:) = varIN1 103 103 endwhere … … 295 295 296 296 ! Which LIDAR frequency are we using? 297 if (lidar_freq ==355) then297 if (lidar_freq .eq. 355) then 298 298 Cmol = Cmol_355nm 299 299 rdiffm = rdiffm_355nm 300 300 endif 301 if (lidar_freq ==532) then301 if (lidar_freq .eq. 532) then 302 302 Cmol = Cmol_532nm 303 303 rdiffm = rdiffm_532nm … … 336 336 337 337 ! LS and CONV Ice water coefficients 338 if (ice_type ==0) then338 if (ice_type .eq. 0) then 339 339 polpart(INDX_LSICE,1:5) = polpartLSICE0 340 340 polpart(INDX_CVICE,1:5) = polpartCVICE0 341 341 endif 342 if (ice_type ==1) then342 if (ice_type .eq. 1) then 343 343 polpart(INDX_LSICE,1:5) = polpartLSICE1 344 344 polpart(INDX_CVICE,1:5) = polpartCVICE1 … … 393 393 ! Polynomials kp_lidar derived from Mie theory 394 394 do i = 1, npart 395 where (rad_part(1:npoints,1:nlev,i) >0.0)395 where (rad_part(1:npoints,1:nlev,i) .gt. 0.0) 396 396 kp_part(1:npoints,1:nlev,i) = & 397 397 polpart(i,1)*(rad_part(1:npoints,1:nlev,i)*1e6)**4 & … … 426 426 ! Alpha of particles in each subcolumn: 427 427 do i = 1, npart 428 where (rad_part(1:npoints,1:nlev,i) >0.0)428 where (rad_part(1:npoints,1:nlev,i) .gt. 0.0) 429 429 alpha_part(1:npoints,1:nlev,i) = 3._wp/4._wp * Qscat & 430 430 * rhoair(1:npoints,1:nlev) * qpart(1:npoints,1:nlev,i) & … … 440 440 ! Optical thickness of each layer (particles) 441 441 tau_part(1:npoints,1:nlev,i) = tau_part(1:npoints,1:nlev,i) & 442 * (zheight(1:npoints,1:nlev)-zheight(1:npoints,2:nlev+1) )442 & * (zheight(1:npoints,1:nlev)-zheight(1:npoints,2:nlev+1) ) 443 443 ! Optical thickness from TOA to layer k (particles) 444 444 do k=zi,zf,zinc -
LMDZ6/branches/Amaury_dev/libf/phylmd/cospv2/cosp_stats.F90
r5082 r5095 210 210 ! look for j_1km from bottom to top 211 211 j = 1 212 do while (Ze_tot(pr,i,j) ==R_GROUND)212 do while (Ze_tot(pr,i,j) .eq. R_GROUND) 213 213 j = j+1 214 214 enddo … … 217 217 do j=1,Nlevels 218 218 sc_ratio = beta_tot(pr,i,j)/beta_mol(pr,j) 219 if ((sc_ratio <= s_att) .and. (flag_sat ==0)) flag_sat = j220 if (Ze_tot(pr,i,j) <-30.) then !radar can't detect cloud221 if ( (sc_ratio > s_cld) .or. (flag_sat ==j) ) then !lidar sense cloud219 if ((sc_ratio .le. s_att) .and. (flag_sat .eq. 0)) flag_sat = j 220 if (Ze_tot(pr,i,j) .lt. -30.) then !radar can't detect cloud 221 if ( (sc_ratio .gt. s_cld) .or. (flag_sat .eq. j) ) then !lidar sense cloud 222 222 lidar_only_freq_cloud(pr,j)=lidar_only_freq_cloud(pr,j)+1. !top->surf 223 223 flag_cld=1 … … 226 226 flag_cld=1 227 227 flag_radarcld=1 228 if (j > j_1km) flag_radarcld_no1km=1228 if (j .gt. j_1km) flag_radarcld_no1km=1 229 229 endif 230 230 enddo !levels 231 if (flag_cld ==1) tcc(pr)=tcc(pr)+1._wp232 if (flag_radarcld ==1) radar_tcc(pr)=radar_tcc(pr)+1.233 if (flag_radarcld_no1km == 1) radar_tcc2(pr)=radar_tcc2(pr)+1.231 if (flag_cld .eq. 1) tcc(pr)=tcc(pr)+1._wp 232 if (flag_radarcld .eq. 1) radar_tcc(pr)=radar_tcc(pr)+1. 233 if (flag_radarcld_no1km .eq. 1) radar_tcc2(pr)=radar_tcc2(pr)+1. 234 234 enddo !columns 235 235 enddo !points … … 267 267 268 268 do ij=2,Nbins+1 269 hist1D(ij-1) = count(var >= bins(ij-1) .and. var <bins(ij))270 if (count(var == R_GROUND) >=1) hist1D(ij-1)=R_UNDEF269 hist1D(ij-1) = count(var .ge. bins(ij-1) .and. var .lt. bins(ij)) 270 if (count(var .eq. R_GROUND) .ge. 1) hist1D(ij-1)=R_UNDEF 271 271 enddo 272 272 … … 300 300 do ij=2,nbin1+1 301 301 do ik=2,nbin2+1 302 jointHist(ij-1,ik-1)=count(var1 >= bin1(ij-1) .and. var1 <bin1(ij) .and. &303 var2 >= bin2(ik-1) .and. var2 < bin2(ik))302 jointHist(ij-1,ik-1)=count(var1 .ge. bin1(ij-1) .and. var1 .lt. bin1(ij) .and. & 303 var2 .ge. bin2(ik-1) .and. var2 .lt. bin2(ik)) 304 304 enddo 305 305 enddo -
LMDZ6/branches/Amaury_dev/libf/phylmd/cospv2/icarus.F90
r5086 r5095 134 134 ! ########################################################################## 135 135 136 if (debugcol /=0) then136 if (debugcol.ne.0) then 137 137 do j=1,npoints,debugcol 138 138 … … 140 140 do ilev=1,nlev 141 141 acc(ilev,1:ncol)=frac_out(j,1:ncol,ilev)*2 142 where(levmatch(j,1:ncol) ==ilev) acc(ilev,1:ncol)=acc(ilev,1:ncol)+1142 where(levmatch(j,1:ncol) .eq. ilev) acc(ilev,1:ncol)=acc(ilev,1:ncol)+1 143 143 enddo 144 144 … … 155 155 (cchar_realtops(acc(ilev,ibox)+1),ilev=1,nlev),& 156 156 (cchar(acc(ilev,ibox)+1),ilev=1,nlev) 157 END DO157 end do 158 158 close(9) 159 159 … … 224 224 225 225 ! Set tropopause values 226 if (isccp_top_height == 1 .or. isccp_top_height == 3) then226 if (isccp_top_height .eq. 1 .or. isccp_top_height .eq. 3) then 227 227 ptrop(1:npoints) = 5000._wp 228 228 attropmin(1:npoints) = 400._wp … … 232 232 233 233 do ilev=1,nlev 234 where(pfull(1:npoints,ilev) <40000. .and. &235 pfull(1:npoints,ilev) >5000. .and. &236 at(1:npoints,ilev) <attropmin(1:npoints))234 where(pfull(1:npoints,ilev) .lt. 40000. .and. & 235 pfull(1:npoints,ilev) .gt. 5000. .and. & 236 at(1:npoints,ilev) .lt. attropmin(1:npoints)) 237 237 ptrop(1:npoints) = pfull(1:npoints,ilev) 238 238 attropmin(1:npoints) = at(1:npoints,ilev) … … 244 244 do ilev=1,nlev 245 245 atmax(1:npoints) = merge(at(1:npoints,ilev),atmax(1:npoints),& 246 at(1:npoints,ilev) > atmax(1:npoints) .and. ilev >=itrop(1:npoints))246 at(1:npoints,ilev) .gt. atmax(1:npoints) .and. ilev .ge. itrop(1:npoints)) 247 247 enddo 248 248 end if 249 249 250 if (isccp_top_height == 1 .or. isccp_top_height ==3) then250 if (isccp_top_height .eq. 1 .or. isccp_top_height .eq. 3) then 251 251 ! ############################################################################ 252 252 ! Clear-sky radiance calculation … … 308 308 dem(1:npoints,ibox) = merge(dem_wv(1:npoints,ilev), & 309 309 1._wp-(1._wp-demIN(1:npoints,ibox,ilev))*(1._wp-dem_wv(1:npoints,ilev)), & 310 demIN(1:npoints,ibox,ilev) ==0)310 demIN(1:npoints,ibox,ilev) .eq. 0) 311 311 312 312 ! Increase TOA flux emitted from layer … … 322 322 do ibox=1,ncol 323 323 fluxtop(1:npoints,ibox) = fluxtop(1:npoints,ibox) + emsfc_lw*bb(1:npoints)*trans_layers_above(1:npoints,ibox) 324 END DO324 end do 325 325 326 326 ! All Sky brightness temperature … … 348 348 tauir(1:npoints) = tau(1:npoints,ibox)/2.13_wp 349 349 taumin(1:npoints) = -log(max(min(transmax(1:npoints),0.9999999_wp),0.001_wp)) 350 if (isccp_top_height ==1) then350 if (isccp_top_height .eq. 1) then 351 351 do j=1,npoints 352 if (transmax(j) > 0.001 .and. transmax(j) <=0.9999999) then352 if (transmax(j) .gt. 0.001 .and. transmax(j) .le. 0.9999999) then 353 353 fluxtopinit(j) = fluxtop(j,ibox) 354 354 tauir(j) = tau(j,ibox)/2.13_wp … … 357 357 do icycle=1,2 358 358 do j=1,npoints 359 if (tau(j,ibox) > (tauchk)) then360 if (transmax(j) > 0.001 .and. transmax(j) <=0.9999999) then359 if (tau(j,ibox) .gt. (tauchk)) then 360 if (transmax(j) .gt. 0.001 .and. transmax(j) .le. 0.9999999) then 361 361 emcld(j,ibox) = 1._wp - exp(-1._wp * tauir(j) ) 362 362 fluxtop(j,ibox) = fluxtopinit(j) - ((1.-emcld(j,ibox))*fluxtop_clrsky(j)) 363 363 fluxtop(j,ibox)=max(1.E-06_wp,(fluxtop(j,ibox)/emcld(j,ibox))) 364 364 tb(j,ibox)= 1307.27_wp / (log(1._wp + (1._wp/fluxtop(j,ibox)))) 365 if (tb(j,ibox) >260.) then365 if (tb(j,ibox) .gt. 260.) then 366 366 tauir(j) = tau(j,ibox) / 2.56_wp 367 367 end if … … 373 373 374 374 ! Cloud-top temperature 375 where(tau(1:npoints,ibox) >tauchk)375 where(tau(1:npoints,ibox) .gt. tauchk) 376 376 tb(1:npoints,ibox)= 1307.27_wp/ (log(1. + (1._wp/fluxtop(1:npoints,ibox)))) 377 where (isccp_top_height == 1 .and. tauir(1:npoints) <taumin(1:npoints))377 where (isccp_top_height .eq. 1 .and. tauir(1:npoints) .lt. taumin(1:npoints)) 378 378 tb(1:npoints,ibox) = attrop(1:npoints) - 5._wp 379 379 tau(1:npoints,ibox) = 2.13_wp*taumin(1:npoints) … … 382 382 383 383 ! Clear-sky brightness temperature 384 where(tau(1:npoints,ibox) <= tauchk)384 where(tau(1:npoints,ibox) .le. tauchk) 385 385 tb(1:npoints,ibox) = meantbclr(1:npoints) 386 386 endwhere … … 399 399 do ibox=1,ncol 400 400 !segregate according to optical thickness 401 if (isccp_top_height == 1 .or. isccp_top_height == 3) then401 if (isccp_top_height .eq. 1 .or. isccp_top_height .eq. 3) then 402 402 403 403 ! Find level whose temperature most closely matches brightness temperature 404 404 nmatch(1:npoints)=0 405 405 do k1=1,nlev-1 406 ilev = merge(nlev-k1,k1,isccp_top_height_direction == 2)406 ilev = merge(nlev-k1,k1,isccp_top_height_direction .eq. 2) 407 407 do j=1,npoints 408 if (ilev >=itrop(j) .and. &409 ((at(j,ilev) >= tb(j,ibox) .and. &410 at(j,ilev+1) <=tb(j,ibox)) .or. &411 (at(j,ilev) <=tb(j,ibox) .and. &412 at(j,ilev+1) >= tb(j,ibox)))) then408 if (ilev .ge. itrop(j) .and. & 409 ((at(j,ilev) .ge. tb(j,ibox) .and. & 410 at(j,ilev+1) .le. tb(j,ibox)) .or. & 411 (at(j,ilev) .le. tb(j,ibox) .and. & 412 at(j,ilev+1) .ge. tb(j,ibox)))) then 413 413 nmatch(j)=nmatch(j)+1 414 414 match(j,nmatch(j))=ilev … … 418 418 419 419 do j=1,npoints 420 if (nmatch(j) >=1) then420 if (nmatch(j) .ge. 1) then 421 421 k1 = match(j,nmatch(j)) 422 422 k2 = k1 + 1 … … 426 426 logp=logp1+(logp2-logp1)*abs(tb(j,ibox)-at(j,k1))/atd 427 427 ptop(j,ibox) = exp(logp) 428 levmatch(j,ibox) = merge(k1,k2,abs(pfull(j,k1)-ptop(j,ibox)) <abs(pfull(j,k2)-ptop(j,ibox)))428 levmatch(j,ibox) = merge(k1,k2,abs(pfull(j,k1)-ptop(j,ibox)) .lt. abs(pfull(j,k2)-ptop(j,ibox))) 429 429 else 430 if (tb(j,ibox) <=attrop(j)) then430 if (tb(j,ibox) .le. attrop(j)) then 431 431 ptop(j,ibox)=ptrop(j) 432 432 levmatch(j,ibox)=itrop(j) 433 433 end if 434 if (tb(j,ibox) >=atmax(j)) then434 if (tb(j,ibox) .ge. atmax(j)) then 435 435 ptop(j,ibox)=pfull(j,nlev) 436 436 levmatch(j,ibox)=nlev … … 441 441 ptop(1:npoints,ibox)=0. 442 442 do ilev=1,nlev 443 where((ptop(1:npoints,ibox) == 0. ) .and.(frac_out(1:npoints,ibox,ilev) /=0))443 where((ptop(1:npoints,ibox) .eq. 0. ) .and.(frac_out(1:npoints,ibox,ilev) .ne. 0)) 444 444 ptop(1:npoints,ibox)=phalf(1:npoints,ilev) 445 445 levmatch(1:npoints,ibox)=ilev 446 446 endwhere 447 END DO447 end do 448 448 end if 449 where(tau(1:npoints,ibox) <=tauchk)449 where(tau(1:npoints,ibox) .le. tauchk) 450 450 ptop(1:npoints,ibox)=0._wp 451 451 levmatch(1:npoints,ibox)=0._wp … … 460 460 do ibox=1,ncol 461 461 do j=1,npoints 462 if (tau(j,ibox) > (tauchk) .and. ptop(j,ibox) >0.) then463 if (sunlit(j) ==1 .or. isccp_top_height ==3) then462 if (tau(j,ibox) .gt. (tauchk) .and. ptop(j,ibox) .gt. 0.) then 463 if (sunlit(j).eq.1 .or. isccp_top_height .eq. 3) then 464 464 boxtau(j,ibox) = tau(j,ibox) 465 465 boxptop(j,ibox) = ptop(j,ibox)!/100._wp … … 508 508 ! Brightness Temperature 509 509 ! #################################################################################### 510 if (isccp_top_height == 1 .or. isccp_top_height ==3) then510 if (isccp_top_height .eq. 1 .or. isccp_top_height .eq. 3) then 511 511 meantb(1:npoints)=sum(boxttop,2)/ncol 512 512 else … … 535 535 do ilev2=1,7 536 536 do j=1,npoints ! 537 if (sunlit(j) ==1 .or. isccp_top_height == 3) then537 if (sunlit(j).eq.1 .or. isccp_top_height .eq. 3) then 538 538 fq_isccp(j,ilev,ilev2)= 0. 539 539 else … … 546 546 547 547 ! Reset variables need for averaging cloud properties 548 where(sunlit == 1 .or. isccp_top_height ==3)548 where(sunlit .eq. 1 .or. isccp_top_height .eq. 3) 549 549 totalcldarea(1:npoints) = 0._wp 550 550 meanalbedocld(1:npoints) = 0._wp … … 561 561 do j=1,npoints 562 562 ! Subcolumns that are cloudy(true) and not(false) 563 box_cloudy2(1:ncol) = merge(.true.,.false.,boxtau(j,1:ncol) > tauchk .and. boxptop(j,1:ncol) >0.)563 box_cloudy2(1:ncol) = merge(.true.,.false.,boxtau(j,1:ncol) .gt. tauchk .and. boxptop(j,1:ncol) .gt. 0.) 564 564 565 565 ! Compute joint histogram and column quantities for points that are sunlit and cloudy 566 if (sunlit(j) ==1 .or. isccp_top_height == 3) then566 if (sunlit(j) .eq.1 .or. isccp_top_height .eq. 3) then 567 567 ! Joint-histogram 568 568 call hist2D(boxtau(j,1:ncol),boxptop(j,1:ncol),ncol,isccp_histTau,numISCCPTauBins, & … … 572 572 573 573 ! Column cloud area 574 totalcldarea(j) = real(count(box_cloudy2(1:ncol) .and. boxtau(j,1:ncol) >isccp_taumin))/ncol574 totalcldarea(j) = real(count(box_cloudy2(1:ncol) .and. boxtau(j,1:ncol) .gt. isccp_taumin))/ncol 575 575 576 576 ! Subcolumn cloud albedo 577 577 !albedocld(j,1:ncol) = merge((boxtau(j,1:ncol)**0.895_wp)/((boxtau(j,1:ncol)**0.895_wp)+6.82_wp),& 578 578 ! 0._wp,box_cloudy2(1:ncol) .and. boxtau(j,1:ncol) .gt. isccp_taumin) 579 where(box_cloudy2(1:ncol) .and. boxtau(j,1:ncol) >isccp_taumin)579 where(box_cloudy2(1:ncol) .and. boxtau(j,1:ncol) .gt. isccp_taumin) 580 580 albedocld(j,1:ncol) = (boxtau(j,1:ncol)**0.895_wp)/((boxtau(j,1:ncol)**0.895_wp)+6.82_wp) 581 581 elsewhere … … 587 587 588 588 ! Column cloud top pressure 589 meanptop(j) = sum(boxptop(j,1:ncol),box_cloudy2(1:ncol) .and. boxtau(j,1:ncol) >isccp_taumin)/ncol589 meanptop(j) = sum(boxptop(j,1:ncol),box_cloudy2(1:ncol) .and. boxtau(j,1:ncol) .gt. isccp_taumin)/ncol 590 590 endif 591 591 enddo 592 592 593 593 ! Compute mean cloud properties. Set to mssing value in the event that totalcldarea=0 594 where(totalcldarea(1:npoints) >0)594 where(totalcldarea(1:npoints) .gt. 0) 595 595 meanptop(1:npoints) = 100._wp*meanptop(1:npoints)/totalcldarea(1:npoints) 596 596 meanalbedocld(1:npoints) = meanalbedocld(1:npoints)/totalcldarea(1:npoints) … … 609 609 610 610 ! Represent in percent 611 where(totalcldarea /=output_missing_value) totalcldarea = totalcldarea*100._wp612 where(fq_isccp /=output_missing_value) fq_isccp = fq_isccp*100._wp611 where(totalcldarea .ne. output_missing_value) totalcldarea = totalcldarea*100._wp 612 where(fq_isccp .ne. output_missing_value) fq_isccp = fq_isccp*100._wp 613 613 614 614 … … 634 634 varOUT(1:dim1,1:dim2,1:dim3) = 0._wp 635 635 do j=1,dim2 636 where(flag(:,j,:) ==1)636 where(flag(:,j,:) .eq. 1) 637 637 varOUT(:,j,:) = varIN2 638 638 endwhere 639 where(flag(:,j,:) ==2)639 where(flag(:,j,:) .eq. 2) 640 640 varOUT(:,j,:) = varIN1 641 641 endwhere -
LMDZ6/branches/Amaury_dev/libf/phylmd/cospv2/lidar_simulator.F90
r5082 r5095 231 231 ! Computation of the total perpendicular lidar signal (ATBperp for liq+ice) 232 232 ! Upper layer 233 WHERE(tautot(1:npoints,icol,1) >0)233 WHERE(tautot(1:npoints,icol,1) .gt. 0) 234 234 pnorm_perp_tot(1:npoints,icol,1) = (beta_perp_ice(1:npoints,icol,1)+ & 235 235 beta_perp_liq(1:npoints,icol,1)- & … … 251 251 ! Betaperp=beta_mol(:,k)/(1+1/0.0284)) [bodhaine et al. 1999] in the following 252 252 ! equations: 253 WHERE (pnorm(1:npoints,icol,k) ==0)253 WHERE (pnorm(1:npoints,icol,k) .eq. 0) 254 254 pnorm_perp_tot(1:npoints,icol,k)=0._wp 255 255 ELSEWHERE 256 where(tautot_lay(1:npoints) >0.)256 where(tautot_lay(1:npoints) .gt. 0.) 257 257 pnorm_perp_tot(1:npoints,icol,k) = (beta_perp_ice(1:npoints,icol,k)+ & 258 258 beta_perp_liq(1:npoints,icol,k)-(beta_mol(1:npoints,k)/(1._wp+1._wp/ & … … 358 358 latlid = .false. 359 359 lgrlidar532 = .false. 360 if (platform =='calipso') lcalipso=.true.361 if (platform =='atlid') latlid=.true.362 if (platform =='grlidar532') lgrlidar532=.true.360 if (platform .eq. 'calipso') lcalipso=.true. 361 if (platform .eq. 'atlid') latlid=.true. 362 if (platform .eq. 'grlidar532') lgrlidar532=.true. 363 363 364 364 ! Vertically regrid input data … … 400 400 do ic = 1, ncol 401 401 pnorm_c = pnormFlip(:,ic,:) 402 where ((pnorm_c < xmax) .and. (betamolFlip(:,1,:) <xmax) .and. &403 (betamolFlip(:,1,:) >0.0 ))402 where ((pnorm_c .lt. xmax) .and. (betamolFlip(:,1,:) .lt. xmax) .and. & 403 (betamolFlip(:,1,:) .gt. 0.0 )) 404 404 x3d_c = pnorm_c/betamolFlip(:,1,:) 405 405 elsewhere … … 429 429 do ic = 1, ncol 430 430 pnorm_c = pnorm(:,ic,:) 431 where ((pnorm_c <xmax) .and. (pmol<xmax) .and. (pmol>0.0 ))431 where ((pnorm_c.lt.xmax) .and. (pmol.lt.xmax) .and. (pmol.gt. 0.0 )) 432 432 x3d_c = pnorm_c/pmol 433 433 elsewhere … … 463 463 enddo 464 464 enddo 465 where(cfad2 /=R_UNDEF) cfad2=cfad2/ncol465 where(cfad2 .ne. R_UNDEF) cfad2=cfad2/ncol 466 466 endif 467 467 … … 501 501 do k=2,nlev 502 502 tautot_lay(:) = tau(:,k)-tau(:,k-1) 503 WHERE (tautot_lay(:) >0.)503 WHERE (tautot_lay(:) .gt. 0.) 504 504 pnorm(:,k) = beta(:,k)*EXP(-2._wp*tau(:,k-1)) /& 505 505 (2._wp*tautot_lay(:))*(1._wp-EXP(-2._wp*tautot_lay(:))) … … 529 529 do k=2,nlev 530 530 tautot_lay(:) = tau(:,k)-tau(:,k-1) 531 WHERE ( EXP(-2._wp*tau(:,k-1)) >epsrealwp )532 WHERE (tautot_lay(:) >0.)531 WHERE ( EXP(-2._wp*tau(:,k-1)) .gt. epsrealwp ) 532 WHERE (tautot_lay(:) .gt. 0.) 533 533 beta(:,k) = pnorm(:,k)/ EXP(-2._wp*tau(:,k-1))* & 534 534 (2._wp*tautot_lay(:))/(1._wp-exp(-2._wp*tautot_lay(:))) … … 650 650 do k=1,Nlevels 651 651 ! Cloud detection at subgrid-scale: 652 where ((x(:,:,k) > S_cld) .and. (x(:,:,k) /=undef) )652 where ((x(:,:,k) .gt. S_cld) .and. (x(:,:,k) .ne. undef) ) 653 653 cldy(:,:,k)=1._wp 654 654 elsewhere … … 657 657 658 658 ! Number of usefull sub-columns: 659 where ((x(:,:,k) > S_att) .and. (x(:,:,k) /=undef) )659 where ((x(:,:,k) .gt. S_att) .and. (x(:,:,k) .ne. undef) ) 660 660 srok(:,:,k)=1._wp 661 661 elsewhere … … 677 677 ! Computation of the cloud fraction as a function of the temperature instead 678 678 ! of height, for ice,liquid and all clouds 679 if(srok(ip,ic,k) >0.)then679 if(srok(ip,ic,k).gt.0.)then 680 680 do itemp=1,Ntemp 681 if( (tmp(ip,k) >=tempmod(itemp)).and.(tmp(ip,k)<tempmod(itemp+1)) )then681 if( (tmp(ip,k).ge.tempmod(itemp)).and.(tmp(ip,k).lt.tempmod(itemp+1)) )then 682 682 lidarcldtempind(ip,itemp)=lidarcldtempind(ip,itemp)+1._wp 683 683 endif … … 685 685 endif 686 686 687 if(cldy(ip,ic,k) ==1.)then687 if(cldy(ip,ic,k).eq.1.)then 688 688 do itemp=1,Ntemp 689 if( (tmp(ip,k) >= tempmod(itemp)).and.(tmp(ip,k) <tempmod(itemp+1)) )then689 if( (tmp(ip,k) .ge. tempmod(itemp)).and.(tmp(ip,k) .lt. tempmod(itemp+1)) )then 690 690 lidarcldtemp(ip,itemp,1)=lidarcldtemp(ip,itemp,1)+1._wp 691 691 endif … … 695 695 iz=1 696 696 p1 = pplay(ip,k) 697 if ( p1 >0. .and. p1<(440._wp*100._wp)) then ! high clouds697 if ( p1.gt.0. .and. p1.lt.(440._wp*100._wp)) then ! high clouds 698 698 iz=3 699 else if(p1 >=(440._wp*100._wp) .and. p1<(680._wp*100._wp)) then ! mid clouds699 else if(p1.ge.(440._wp*100._wp) .and. p1.lt.(680._wp*100._wp)) then ! mid clouds 700 700 iz=2 701 701 endif … … 714 714 715 715 ! Grid-box 3D cloud fraction 716 where ( nsub(:,:) >0.0 )716 where ( nsub(:,:).gt.0.0 ) 717 717 lidarcld(:,:) = lidarcld(:,:)/nsub(:,:) 718 718 elsewhere … … 729 729 enddo 730 730 enddo 731 where (nsublayer(:,:) >0.0)731 where (nsublayer(:,:) .gt. 0.0) 732 732 cldlayer(:,:) = cldlayer(:,:)/nsublayer(:,:) 733 733 elsewhere … … 748 748 749 749 ! Avoid zero values 750 if( (cldy(i,ncol,nlev) ==1.) .and. (ATBperp(i,ncol,nlev)>0.) )then750 if( (cldy(i,ncol,nlev).eq.1.) .and. (ATBperp(i,ncol,nlev).gt.0.) )then 751 751 ! Computation of the ATBperp along the phase discrimination line 752 752 ATBperp_tmp = (ATB(i,ncol,nlev)**5)*alpha50 + (ATB(i,ncol,nlev)**4)*beta50 + & … … 756 756 ! 4.1.a) Ice: ATBperp above the phase discrimination line 757 757 ! ######################################################################## 758 if((ATBperp(i,ncol,nlev)-ATBperp_tmp) >=0.)then ! Ice clouds758 if((ATBperp(i,ncol,nlev)-ATBperp_tmp) .ge. 0.)then ! Ice clouds 759 759 760 760 ! ICE with temperature above 273,15°K = Liquid (false ice) 761 if(tmp(i,nlev) >273.15) then ! Temperature above 273,15 K761 if(tmp(i,nlev) .gt. 273.15) then ! Temperature above 273,15 K 762 762 ! Liquid: False ice corrected by the temperature to Liquid 763 763 lidarcldphase(i,nlev,2) = lidarcldphase(i,nlev,2)+1._wp ! False ice detection ==> added to Liquid … … 767 767 ! to classify the phase cloud 768 768 cldlayphase(i,ncol,4,2) = 1. ! tot cloud 769 if (p1 > 0. .and. p1<(440._wp*100._wp)) then ! high cloud769 if (p1 .gt. 0. .and. p1.lt.(440._wp*100._wp)) then ! high cloud 770 770 cldlayphase(i,ncol,3,2) = 1._wp 771 else if(p1 >= (440._wp*100._wp) .and. p1 <(680._wp*100._wp)) then ! mid cloud771 else if(p1 .ge. (440._wp*100._wp) .and. p1 .lt. (680._wp*100._wp)) then ! mid cloud 772 772 cldlayphase(i,ncol,2,2) = 1._wp 773 773 else ! low cloud … … 776 776 cldlayphase(i,ncol,4,5) = 1._wp ! tot cloud 777 777 ! High cloud 778 if (p1 > 0. .and. p1 < (440._wp*100._wp)) then778 if (p1 .gt. 0. .and. p1 .lt. (440._wp*100._wp)) then 779 779 cldlayphase(i,ncol,3,5) = 1._wp 780 780 ! Middle cloud 781 else if(p1 >= (440._wp*100._wp) .and. p1 <(680._wp*100._wp)) then781 else if(p1 .ge. (440._wp*100._wp) .and. p1 .lt. (680._wp*100._wp)) then 782 782 cldlayphase(i,ncol,2,5) = 1._wp 783 783 ! Low cloud … … 791 791 cldlayphase(i,ncol,4,1) = 1._wp ! tot cloud 792 792 ! High cloud 793 if (p1 > 0. .and. p1 < (440._wp*100._wp)) then793 if (p1 .gt. 0. .and. p1 .lt. (440._wp*100._wp)) then 794 794 cldlayphase(i,ncol,3,1) = 1._wp 795 795 ! Middle cloud 796 else if(p1 >= (440._wp*100._wp) .and. p1 < (680._wp*100._wp)) then796 else if(p1 .ge. (440._wp*100._wp) .and. p1 .lt. (680._wp*100._wp)) then 797 797 cldlayphase(i,ncol,2,1) = 1._wp 798 798 ! Low cloud … … 806 806 else 807 807 ! Liquid with temperature above 231,15°K 808 if(tmp(i,nlev) >231.15_wp) then808 if(tmp(i,nlev) .gt. 231.15_wp) then 809 809 lidarcldphase(i,nlev,2) = lidarcldphase(i,nlev,2)+1._wp 810 810 tmpl(i,ncol,nlev) = tmp(i,nlev) 811 811 cldlayphase(i,ncol,4,2) = 1._wp ! tot cloud 812 812 ! High cloud 813 if (p1 > 0. .and. p1 <(440._wp*100._wp)) then813 if (p1 .gt. 0. .and. p1 .lt. (440._wp*100._wp)) then 814 814 cldlayphase(i,ncol,3,2) = 1._wp 815 815 ! Middle cloud 816 else if(p1 >= (440._wp*100._wp) .and. p1 <(680._wp*100._wp)) then816 else if(p1 .ge. (440._wp*100._wp) .and. p1 .lt. (680._wp*100._wp)) then 817 817 cldlayphase(i,ncol,2,2) = 1._wp 818 818 ! Low cloud … … 827 827 cldlayphase(i,ncol,4,4) = 1._wp ! tot cloud 828 828 ! High cloud 829 if (p1 > 0. .and. p1 <(440._wp*100._wp)) then829 if (p1 .gt. 0. .and. p1 .lt. (440._wp*100._wp)) then 830 830 cldlayphase(i,ncol,3,4) = 1._wp 831 831 ! Middle cloud 832 else if(p1 >= (440._wp*100._wp) .and. p1 <(680._wp*100._wp)) then832 else if(p1 .ge. (440._wp*100._wp) .and. p1 .lt. (680._wp*100._wp)) then 833 833 cldlayphase(i,ncol,2,4) = 1._wp 834 834 ! Low cloud … … 838 838 cldlayphase(i,ncol,4,1) = 1._wp ! tot cloud 839 839 ! High cloud 840 if (p1 > 0. .and. p1 <(440._wp*100._wp)) then840 if (p1 .gt. 0. .and. p1 .lt. (440._wp*100._wp)) then 841 841 cldlayphase(i,ncol,3,1) = 1._wp 842 842 ! Middle cloud 843 else if(p1 >= (440._wp*100._wp) .and. p1 <(680._wp*100._wp)) then843 else if(p1 .ge. (440._wp*100._wp) .and. p1 .lt. (680._wp*100._wp)) then 844 844 cldlayphase(i,ncol,2,1) = 1._wp 845 845 ! Low cloud … … 859 859 p1 = pplay(i,nlev) 860 860 861 if((cldy(i,ncol,nlev) == 1.) .and. (ATBperp(i,ncol,nlev) >0.) )then861 if((cldy(i,ncol,nlev) .eq. 1.) .and. (ATBperp(i,ncol,nlev) .gt. 0.) )then 862 862 ! Computation of the ATBperp of the phase discrimination line 863 863 ATBperp_tmp = (ATB(i,ncol,nlev)**5)*alpha50 + (ATB(i,ncol,nlev)**4)*beta50 + & … … 868 868 ! ######################################################################## 869 869 ! ICE with temperature above 273,15°K = Liquid (false ice) 870 if((ATBperp(i,ncol,nlev)-ATBperp_tmp) >=0.)then ! Ice clouds871 if(tmp(i,nlev) >273.15)then870 if((ATBperp(i,ncol,nlev)-ATBperp_tmp) .ge. 0.)then ! Ice clouds 871 if(tmp(i,nlev) .gt. 273.15)then 872 872 lidarcldphase(i,nlev,2) = lidarcldphase(i,nlev,2)+1._wp ! false ice ==> liq 873 873 tmpl(i,ncol,nlev) = tmp(i,nlev) … … 875 875 cldlayphase(i,ncol,4,2) = 1._wp ! tot cloud 876 876 ! High cloud 877 if (p1 > 0. .and. p1 < (440._wp*100._wp)) then877 if (p1 .gt. 0. .and. p1 .lt. (440._wp*100._wp)) then 878 878 cldlayphase(i,ncol,3,2) = 1._wp 879 879 ! Middle cloud 880 else if(p1 >= (440._wp*100._wp) .and. p1 < (680._wp*100._wp)) then880 else if(p1 .ge. (440._wp*100._wp) .and. p1 .lt. (680._wp*100._wp)) then 881 881 cldlayphase(i,ncol,2,2) = 1._wp 882 882 ! Low cloud … … 887 887 cldlayphase(i,ncol,4,5) = 1. ! tot cloud 888 888 ! High cloud 889 if (p1 > 0. .and. p1 <(440._wp*100._wp)) then889 if (p1 .gt. 0. .and. p1 .lt. (440._wp*100._wp)) then 890 890 cldlayphase(i,ncol,3,5) = 1._wp 891 891 ! Middle cloud 892 else if(p1 >= (440._wp*100._wp) .and. p1 <(680._wp*100._wp)) then892 else if(p1 .ge. (440._wp*100._wp) .and. p1 .lt. (680._wp*100._wp)) then 893 893 cldlayphase(i,ncol,2,5) = 1._wp 894 894 ! Low cloud … … 902 902 cldlayphase(i,ncol,4,1) = 1._wp ! tot cloud 903 903 ! High cloud 904 if (p1 > 0. .and. p1 <(440._wp*100._wp)) then904 if (p1 .gt. 0. .and. p1 .lt. (440._wp*100._wp)) then 905 905 cldlayphase(i,ncol,3,1) = 1._wp 906 906 ! Middle cloud 907 else if(p1 >= (440._wp*100._wp) .and. p1 <(680._wp*100._wp)) then907 else if(p1 .ge. (440._wp*100._wp) .and. p1 .lt.(680._wp*100._wp)) then 908 908 cldlayphase(i,ncol,2,1) = 1._wp 909 909 ! Low cloud … … 918 918 else 919 919 ! Liquid with temperature above 231,15°K 920 if(tmp(i,nlev) >231.15)then920 if(tmp(i,nlev) .gt. 231.15)then 921 921 lidarcldphase(i,nlev,2) = lidarcldphase(i,nlev,2)+1._wp 922 922 tmpl(i,ncol,nlev) = tmp(i,nlev) 923 923 cldlayphase(i,ncol,4,2) = 1._wp ! tot cloud 924 924 ! High cloud 925 if (p1 > 0. .and. p1 <(440._wp*100._wp)) then925 if (p1 .gt. 0. .and. p1 .lt. (440._wp*100._wp)) then 926 926 cldlayphase(i,ncol,3,2) = 1._wp 927 927 ! Middle cloud 928 else if(p1 >= (440._wp*100._wp) .and. p1 <(680._wp*100._wp)) then928 else if(p1 .ge. (440._wp*100._wp) .and. p1 .lt. (680._wp*100._wp)) then 929 929 cldlayphase(i,ncol,2,2) = 1._wp 930 930 ! Low cloud … … 939 939 cldlayphase(i,ncol,4,4) = 1._wp ! tot cloud 940 940 ! High cloud 941 if (p1 > 0. .and. p1 <(440._wp*100._wp)) then941 if (p1 .gt. 0. .and. p1 .lt. (440._wp*100._wp)) then 942 942 cldlayphase(i,ncol,3,4) = 1._wp 943 943 ! Middle 944 else if(p1 >= (440._wp*100._wp) .and. p1 <(680._wp*100._wp)) then944 else if(p1 .ge. (440._wp*100._wp) .and. p1 .lt. (680._wp*100._wp)) then 945 945 cldlayphase(i,ncol,2,4) = 1._wp 946 946 ! Low cloud … … 951 951 cldlayphase(i,ncol,4,1) = 1._wp ! tot cloud 952 952 ! High cloud 953 if (p1 > 0. .and. p1 <(440._wp*100._wp)) then953 if (p1 .gt. 0. .and. p1 .lt. (440._wp*100._wp)) then 954 954 cldlayphase(i,ncol,3,1) = 1._wp 955 955 ! Middle cloud 956 else if(p1 >= (440._wp*100._wp) .and. p1 <(680._wp*100._wp)) then956 else if(p1 .ge. (440._wp*100._wp) .and. p1 .lt. (680._wp*100._wp)) then 957 957 cldlayphase(i,ncol,2,1) = 1._wp 958 958 ! Low cloud … … 966 966 967 967 ! Find the level of the highest cloud with SR>30 968 if(x(i,ncol,nlev) >S_cld_att) then ! SR > 30.968 if(x(i,ncol,nlev) .gt. S_cld_att) then ! SR > 30. 969 969 toplvlsat = nlev+1 970 970 goto 99 … … 978 978 ! see Cesana and Chepfer 2013 Sect.III.2 979 979 ! ############################################################################## 980 if(toplvlsat /=0) then980 if(toplvlsat.ne.0) then 981 981 do nlev = toplvlsat,Nlevels 982 982 p1 = pplay(i,nlev) 983 if(cldy(i,ncol,nlev) ==1.)then983 if(cldy(i,ncol,nlev).eq.1.)then 984 984 lidarcldphase(i,nlev,3) = lidarcldphase(i,nlev,3)+1._wp 985 985 tmpu(i,ncol,nlev) = tmp(i,nlev) 986 986 cldlayphase(i,ncol,4,3) = 1._wp ! tot cloud 987 987 ! High cloud 988 if (p1 > 0. .and. p1 <(440._wp*100._wp)) then988 if (p1 .gt. 0. .and. p1 .lt. (440._wp*100._wp)) then 989 989 cldlayphase(i,ncol,3,3) = 1._wp 990 990 ! Middle cloud 991 else if(p1 >= (440._wp*100._wp) .and. p1 <(680._wp*100._wp)) then991 else if(p1 .ge. (440._wp*100._wp) .and. p1 .lt. (680._wp*100._wp)) then 992 992 cldlayphase(i,ncol,2,3) = 1._wp 993 993 ! Low cloud … … 1008 1008 ! Compute the Ice percentage in cloud = ice/(ice+liq) as a function of the occurrences 1009 1009 lidarcldphasetmp(:,:) = lidarcldphase(:,:,1)+lidarcldphase(:,:,2); 1010 WHERE (lidarcldphasetmp(:,:) >0.)1010 WHERE (lidarcldphasetmp(:,:) .gt. 0.) 1011 1011 lidarcldphase(:,:,6)=lidarcldphase(:,:,1)/lidarcldphasetmp(:,:) 1012 1012 ELSEWHERE … … 1016 1016 ! Compute Phase 3D Cloud Fraction 1017 1017 !WHERE (nsub(:,Nlevels:1:-1) .gt. 0.0 ) 1018 WHERE (nsub(:,:) > 0.0 )1018 WHERE (nsub(:,:) .gt. 0.0 ) 1019 1019 lidarcldphase(:,:,1)=lidarcldphase(:,:,1)/nsub(:,:) 1020 1020 lidarcldphase(:,:,2)=lidarcldphase(:,:,2)/nsub(:,:) … … 1049 1049 ! Compute the Ice percentage in cloud = ice/(ice+liq) 1050 1050 cldlayerphasetmp(:,:)=cldlayerphase(:,:,1)+cldlayerphase(:,:,2) 1051 WHERE (cldlayerphasetmp(:,:) >0.)1051 WHERE (cldlayerphasetmp(:,:).gt. 0.) 1052 1052 cldlayerphase(:,:,6)=cldlayerphase(:,:,1)/cldlayerphasetmp(:,:) 1053 1053 ELSEWHERE … … 1056 1056 1057 1057 do i=1,Nphase-1 1058 WHERE ( cldlayerphasesum(:,:) >0.0 )1058 WHERE ( cldlayerphasesum(:,:).gt.0.0 ) 1059 1059 cldlayerphase(:,:,i) = (cldlayerphase(:,:,i)/cldlayerphasesum(:,:)) * cldlayer(:,:) 1060 1060 ENDWHERE … … 1065 1065 checkcldlayerphase=0. 1066 1066 checkcldlayerphase2=0. 1067 if (cldlayerphasesum(i,iz) >0.0 )then1067 if (cldlayerphasesum(i,iz) .gt. 0.0 )then 1068 1068 do ic=1,Nphase-3 1069 1069 checkcldlayerphase = checkcldlayerphase+cldlayerphase(i,iz,ic) 1070 1070 enddo 1071 1071 checkcldlayerphase2 = cldlayer(i,iz)-checkcldlayerphase 1072 if((checkcldlayerphase2 > 0.01) .or. (checkcldlayerphase2 <-0.01) ) print *, checkcldlayerphase,cldlayer(i,iz)1072 if((checkcldlayerphase2 .gt. 0.01) .or. (checkcldlayerphase2 .lt. -0.01) ) print *, checkcldlayerphase,cldlayer(i,iz) 1073 1073 endif 1074 1074 enddo … … 1076 1076 1077 1077 do i=1,Nphase-1 1078 WHERE (nsublayer(:,:) ==0.0)1078 WHERE (nsublayer(:,:) .eq. 0.0) 1079 1079 cldlayerphase(:,:,i) = undef 1080 1080 ENDWHERE … … 1086 1086 do i=1,Npoints 1087 1087 do itemp=1,Ntemp 1088 if(tmpi(i,ncol,nlev) >0.)then1089 if((tmpi(i,ncol,nlev) >= tempmod(itemp)) .and. (tmpi(i,ncol,nlev) <tempmod(itemp+1)) )then1088 if(tmpi(i,ncol,nlev).gt.0.)then 1089 if((tmpi(i,ncol,nlev) .ge. tempmod(itemp)) .and. (tmpi(i,ncol,nlev) .lt. tempmod(itemp+1)) )then 1090 1090 lidarcldtemp(i,itemp,2)=lidarcldtemp(i,itemp,2)+1._wp 1091 1091 endif 1092 elseif(tmpl(i,ncol,nlev) >0.)then1093 if((tmpl(i,ncol,nlev) >= tempmod(itemp)) .and. (tmpl(i,ncol,nlev) <tempmod(itemp+1)) )then1092 elseif(tmpl(i,ncol,nlev) .gt. 0.)then 1093 if((tmpl(i,ncol,nlev) .ge. tempmod(itemp)) .and. (tmpl(i,ncol,nlev) .lt. tempmod(itemp+1)) )then 1094 1094 lidarcldtemp(i,itemp,3)=lidarcldtemp(i,itemp,3)+1._wp 1095 1095 endif 1096 elseif(tmpu(i,ncol,nlev) >0.)then1097 if((tmpu(i,ncol,nlev) >= tempmod(itemp)) .and. (tmpu(i,ncol,nlev) <tempmod(itemp+1)) )then1096 elseif(tmpu(i,ncol,nlev) .gt. 0.)then 1097 if((tmpu(i,ncol,nlev) .ge. tempmod(itemp)) .and. (tmpu(i,ncol,nlev) .lt. tempmod(itemp+1)) )then 1098 1098 lidarcldtemp(i,itemp,4)=lidarcldtemp(i,itemp,4)+1._wp 1099 1099 endif … … 1118 1118 ! Compute the Ice percentage in cloud = ice/(ice+liq) 1119 1119 sumlidarcldtemp(:,:)=lidarcldtemp(:,:,2)+lidarcldtemp(:,:,3) 1120 WHERE(sumlidarcldtemp(:,:) >0.)1120 WHERE(sumlidarcldtemp(:,:) .gt. 0.) 1121 1121 lidarcldtemp(:,:,5)=lidarcldtemp(:,:,2)/sumlidarcldtemp(:,:) 1122 1122 ELSEWHERE … … 1125 1125 1126 1126 do i=1,4 1127 WHERE(lidarcldtempind(:,:) >0.)1127 WHERE(lidarcldtempind(:,:) .gt. 0.) 1128 1128 lidarcldtemp(:,:,i) = lidarcldtemp(:,:,i)/lidarcldtempind(:,:) 1129 1129 ELSEWHERE … … 1193 1193 do k=1,Nlevels 1194 1194 ! Cloud detection at subgrid-scale: 1195 where ((x(:,:,k) > S_cld) .and. (x(:,:,k) /=undef) )1195 where ((x(:,:,k) .gt. S_cld) .and. (x(:,:,k) .ne. undef) ) 1196 1196 cldy(:,:,k)=1._wp 1197 1197 elsewhere … … 1200 1200 1201 1201 ! Number of usefull sub-columns: 1202 where ((x(:,:,k) > S_att) .and. (x(:,:,k) /=undef) )1202 where ((x(:,:,k) .gt. S_att) .and. (x(:,:,k) .ne. undef) ) 1203 1203 srok(:,:,k)=1._wp 1204 1204 elsewhere … … 1216 1216 iz=1 1217 1217 p1 = pplay(ip,k) 1218 if ( p1 >0. .and. p1<(440._wp*100._wp)) then ! high clouds1218 if ( p1.gt.0. .and. p1.lt.(440._wp*100._wp)) then ! high clouds 1219 1219 iz=3 1220 else if(p1 >=(440._wp*100._wp) .and. p1<(680._wp*100._wp)) then ! mid clouds1220 else if(p1.ge.(440._wp*100._wp) .and. p1.lt.(680._wp*100._wp)) then ! mid clouds 1221 1221 iz=2 1222 1222 endif … … 1235 1235 1236 1236 ! Grid-box 3D cloud fraction 1237 where ( nsub(:,:) >0.0 )1237 where ( nsub(:,:).gt.0.0 ) 1238 1238 lidarcld(:,:) = lidarcld(:,:)/nsub(:,:) 1239 1239 elsewhere … … 1250 1250 enddo 1251 1251 enddo 1252 where (nsublayer(:,:) >0.0)1252 where (nsublayer(:,:) .gt. 0.0) 1253 1253 cldlayer(:,:) = cldlayer(:,:)/nsublayer(:,:) 1254 1254 elsewhere … … 1344 1344 do k=1,Nlevels 1345 1345 ! Cloud detection at subgrid-scale: 1346 where ( (x(:,:,k) > S_cld) .and. (x(:,:,k) /=undef) )1346 where ( (x(:,:,k) .gt. S_cld) .and. (x(:,:,k) .ne. undef) ) 1347 1347 cldy(:,:,k)=1._wp 1348 1348 elsewhere … … 1350 1350 endwhere 1351 1351 ! Fully attenuated layer detection at subgrid-scale: 1352 where ( (x(:,:,k) < S_att_opaq) .and. (x(:,:,k) >= 0.) .and. (x(:,:,k) /=undef) ) !DEBUG1352 where ( (x(:,:,k) .lt. S_att_opaq) .and. (x(:,:,k) .ge. 0.) .and. (x(:,:,k) .ne. undef) ) !DEBUG 1353 1353 cldyopaq(:,:,k)=1._wp 1354 1354 elsewhere … … 1358 1358 1359 1359 ! Number of usefull sub-column layers: 1360 where ( (x(:,:,k) > S_att) .and. (x(:,:,k) /=undef) )1360 where ( (x(:,:,k) .gt. S_att) .and. (x(:,:,k) .ne. undef) ) 1361 1361 srok(:,:,k)=1._wp 1362 1362 elsewhere … … 1364 1364 endwhere 1365 1365 ! Number of usefull sub-columns layers for z_opaque 3D fraction: 1366 where ( (x(:,:,k) >= 0.) .and. (x(:,:,k) /=undef) ) !DEBUG1366 where ( (x(:,:,k) .ge. 0.) .and. (x(:,:,k) .ne. undef) ) !DEBUG 1367 1367 srokopaq(:,:,k)=1._wp 1368 1368 elsewhere … … 1397 1397 1398 1398 ! Declaring non-opaque cloudy profiles as thin cloud profiles 1399 if ( cldlay(ip,ic,4) > 0. .and. cldlay(ip,ic,1) ==0. ) then1399 if ( cldlay(ip,ic,4).gt. 0. .and. cldlay(ip,ic,1) .eq. 0. ) then 1400 1400 cldlay(ip,ic,2) = 1._wp 1401 1401 endif … … 1404 1404 1405 1405 ! Opaque cloud profiles 1406 if ( cldlay(ip,ic,1) ==1. ) then1406 if ( cldlay(ip,ic,1) .eq. 1. ) then 1407 1407 zopac = 0._wp 1408 1408 z_top = 0._wp … … 1410 1410 ! Declaring z_opaque altitude and opaque cloud fraction for 3D and 2D variables 1411 1411 ! From SFC-2-TOA ( actually from vgrid_z(SFC+1) = vgrid_z(Nlevels-1) ) 1412 if ( cldy(ip,ic,Nlevels-k) == 1. .and. zopac ==0. ) then1412 if ( cldy(ip,ic,Nlevels-k) .eq. 1. .and. zopac .eq. 0. ) then 1413 1413 lidarcldtype(ip,Nlevels-k + 1,3) = lidarcldtype(ip,Nlevels-k + 1,3) + 1._wp 1414 1414 cldlay(ip,ic,3) = vgrid_z(Nlevels-k+1) ! z_opaque altitude … … 1416 1416 zopac = Nlevels-k+1 ! z_opaque vertical index on vgrid_z 1417 1417 endif 1418 if ( cldy(ip,ic,Nlevels-k) ==1. ) then1418 if ( cldy(ip,ic,Nlevels-k) .eq. 1. ) then 1419 1419 lidarcldtype(ip,Nlevels-k ,1) = lidarcldtype(ip,Nlevels-k ,1) + 1._wp 1420 1420 z_top = Nlevels-k ! top cloud layer vertical index on vgrid_z … … 1423 1423 ! Summing opaque cloud mean temperatures and altitudes 1424 1424 ! as defined in Vaillant de Guelis et al. 2017a, AMT 1425 if (zopac /= 0) then1425 if (zopac .ne. 0) then 1426 1426 cldtypetemp(ip,1) = cldtypetemp(ip,1) + ( tmp(ip,zopac) + tmp(ip,z_top) )/2. 1427 1427 cldtypetemp(ip,3) = cldtypetemp(ip,3) + tmp(ip,zopac) ! z_opaque … … 1435 1435 1436 1436 ! Thin cloud profiles 1437 if ( cldlay(ip,ic,2) ==1. ) then1437 if ( cldlay(ip,ic,2) .eq. 1. ) then 1438 1438 topcloud = 0._wp 1439 1439 z_top = 0._wp … … 1442 1442 ! Declaring thin cloud fraction for 3D variable 1443 1443 ! From TOA-2-SFC 1444 if ( cldy(ip,ic,k) == 1. .and. topcloud ==1. ) then1444 if ( cldy(ip,ic,k) .eq. 1. .and. topcloud .eq. 1. ) then 1445 1445 lidarcldtype(ip,k,2) = lidarcldtype(ip,k,2) + 1._wp 1446 1446 z_base = k ! bottom cloud layer 1447 1447 endif 1448 if ( cldy(ip,ic,k) == 1. .and. topcloud ==0. ) then1448 if ( cldy(ip,ic,k) .eq. 1. .and. topcloud .eq. 0. ) then 1449 1449 lidarcldtype(ip,k,2) = lidarcldtype(ip,k,2) + 1._wp 1450 1450 z_top = k ! top cloud layer … … 1458 1458 cloudemis = 0._wp 1459 1459 do k=z_base+1,Nlevels 1460 if ( (x(ip,ic,k) > S_att_opaq) .and. (x(ip,ic,k) < 1.0) .and. (x(ip,ic,k) /=undef) ) then1460 if ( (x(ip,ic,k) .gt. S_att_opaq) .and. (x(ip,ic,k) .lt. 1.0) .and. (x(ip,ic,k) .ne. undef) ) then 1461 1461 srmean = srmean + x(ip,ic,k) 1462 1462 srcount = srcount + 1. … … 1464 1464 enddo 1465 1465 ! If clear sky layers exist below bottom cloud layer 1466 if ( srcount >0. ) then1466 if ( srcount .gt. 0. ) then 1467 1467 trans2 = srmean/srcount ! thin cloud transmittance**2 1468 1468 tau_app = -(log(trans2))/2. ! apparent cloud optical depth … … 1484 1484 1485 1485 ! 3D cloud types fraction (opaque=1 and thin=2 clouds) 1486 where ( nsub(:,:) >0. )1486 where ( nsub(:,:) .gt. 0. ) 1487 1487 lidarcldtype(:,:,1) = lidarcldtype(:,:,1)/nsub(:,:) 1488 1488 lidarcldtype(:,:,2) = lidarcldtype(:,:,2)/nsub(:,:) … … 1492 1492 endwhere 1493 1493 ! 3D z_opaque fraction (=3) 1494 where ( nsubopaq(:,:) >0. )1494 where ( nsubopaq(:,:) .gt. 0. ) 1495 1495 lidarcldtype(:,:,3) = lidarcldtype(:,:,3)/nsubopaq(:,:) 1496 1496 elsewhere … … 1502 1502 do ip = 1, Npoints 1503 1503 do k = 2, Nlevels 1504 if ( (lidarcldtype(ip,k,3) /= undef) .and. (lidarcldtype(ip,k-1,4) /=undef) ) then1504 if ( (lidarcldtype(ip,k,3) .ne. undef) .and. (lidarcldtype(ip,k-1,4) .ne. undef) ) then 1505 1505 lidarcldtype(ip,k,4) = lidarcldtype(ip,k,3) + lidarcldtype(ip,k-1,4) 1506 1506 else … … 1520 1520 1521 1521 ! Mean temperature and altitude 1522 where (cldtype(:,1) >0.)1522 where (cldtype(:,1) .gt. 0.) 1523 1523 cldtypetemp(:,1) = cldtypetemp(:,1)/cldtype(:,1) ! opaque cloud temp 1524 1524 cldtypetemp(:,3) = cldtypetemp(:,3)/cldtype(:,1) ! z_opaque … … 1534 1534 endwhere 1535 1535 1536 where (cldtype(:,2) >0.) ! thin cloud1536 where (cldtype(:,2) .gt. 0.) ! thin cloud 1537 1537 cldtypetemp(:,2) = cldtypetemp(:,2)/cldtype(:,2) 1538 1538 cldtypemeanz(:,2) = cldtypemeanz(:,2)/cldtype(:,2) … … 1545 1545 1546 1546 ! Mean thin cloud emissivity 1547 where (count_emis(:) >0.) ! thin cloud1547 where (count_emis(:) .gt. 0.) ! thin cloud 1548 1548 cldthinemis(:) = cldthinemis(:)/count_emis(:) 1549 1549 elsewhere … … 1551 1551 endwhere 1552 1552 1553 where (nsublayer(:,:) >0.)1553 where (nsublayer(:,:) .gt. 0.) 1554 1554 cldtype(:,:) = cldtype(:,:)/nsublayer(:,:) 1555 1555 elsewhere -
LMDZ6/branches/Amaury_dev/libf/phylmd/cospv2/lmdz_cosp_interface.F90
r5082 r5095 275 275 cfg%Lisccp, cfg%Lmisr, cfg%Lmodis, cfg%Lrttov 276 276 277 if (overlaplmdz /=overlap) then277 if (overlaplmdz.ne.overlap) then 278 278 print*,'Attention overlaplmdz different de overlap lu dans namelist ' 279 279 endif … … 282 282 print*,'On passe par using_xios' 283 283 ELSE 284 if (cosp_init_flag ==0) then284 if (cosp_init_flag .eq. 0) then 285 285 286 286 ! Initialize the distributional parameters for hydrometeors in radar simulator. … … 311 311 312 312 !!! Ici on modifie les cles logiques pour les outputs selon les champs actives dans les .xml 313 if ((itap >=1).and.(first_write))then313 if ((itap.ge.1).and.(first_write))then 314 314 IF (using_xios) call read_xiosfieldactive(cfg) 315 315 first_write=.false. 316 316 317 if (cosp_init_flag ==0) then317 if (cosp_init_flag .eq. 0) then 318 318 319 319 ! Initialize the distributional parameters for hydrometeors in radar simulator. … … 384 384 ! 3) Masque terre/mer a partir de la variable fracTerLic 385 385 do ip = 1, Npoints 386 if (fracTerLic(ip) >=0.5) then386 if (fracTerLic(ip).ge.0.5) then 387 387 land(ip) = 1. 388 388 else … … 424 424 425 425 426 if (cosp_init_flag ==1) then ! cosp_init_flag = 1426 if (cosp_init_flag .eq. 1) then ! cosp_init_flag = 1 427 427 428 428 !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% … … 538 538 endif ! debut_cosp 539 539 540 if (cosp_init_flag ==1) then540 if (cosp_init_flag .eq. 1) then 541 541 542 542 !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -
LMDZ6/branches/Amaury_dev/libf/phylmd/cospv2/lmdz_cosp_output_write_mod.F90
r5093 r5095 669 669 CHARACTER(LEN=20) :: typeecrit 670 670 671 ! ug On r écupère le type écrit de la structure:672 ! Assez moche, à refaire si meilleure méthode...671 ! ug On récupère le type écrit de la structure: 672 ! Assez moche, Ã| refaire si meilleure méthode... 673 673 IF (INDEX(var%cosp_typeecrit(iff), "once") > 0) THEN 674 674 typeecrit = 'once' … … 730 730 731 731 ! Axe vertical 732 IF (nvertsave ==nvertp(iff)) THEN732 IF (nvertsave.eq.nvertp(iff)) THEN 733 733 klevs=PARASOL_NREFL 734 734 nam_axvert="sza" 735 ELSE IF (nvertsave ==nvertisccp(iff)) THEN735 ELSE IF (nvertsave.eq.nvertisccp(iff)) THEN 736 736 klevs=7 737 737 nam_axvert="pressure2" 738 ELSE IF (nvertsave ==nvertcol(iff)) THEN738 ELSE IF (nvertsave.eq.nvertcol(iff)) THEN 739 739 klevs=Ncolout 740 740 nam_axvert="column" 741 ELSE IF (nvertsave ==nverttemp(iff)) THEN741 ELSE IF (nvertsave.eq.nverttemp(iff)) THEN 742 742 klevs=LIDAR_NTEMP 743 743 nam_axvert="temp" 744 ELSE IF (nvertsave ==nvertmisr(iff)) THEN744 ELSE IF (nvertsave.eq.nvertmisr(iff)) THEN 745 745 klevs=numMISRHgtBins 746 746 nam_axvert="cth16" 747 ELSE IF (nvertsave ==nvertReffIce(iff)) THEN747 ELSE IF (nvertsave.eq.nvertReffIce(iff)) THEN 748 748 klevs= numMODISReffIceBins 749 749 nam_axvert="ReffIce" 750 ELSE IF (nvertsave ==nvertReffLiq(iff)) THEN750 ELSE IF (nvertsave.eq.nvertReffLiq(iff)) THEN 751 751 klevs= numMODISReffLiqBins 752 752 nam_axvert="ReffLiq" … … 765 765 END IF 766 766 767 ! ug On r écupère le type écrit de la structure:768 ! Assez moche, à refaire si meilleure méthode...767 ! ug On récupère le type écrit de la structure: 768 ! Assez moche, Ã| refaire si meilleure méthode... 769 769 IF (INDEX(var%cosp_typeecrit(iff), "once") > 0) THEN 770 770 typeecrit = 'once' … … 827 827 IF (prt_level >= 9) WRITE(lunout,*)'Begin histrwrite2d ',var%name 828 828 829 ! On regarde si on est dans la phase de d éfinition ou d'écriture:829 ! On regarde si on est dans la phase de définition ou d'écriture: 830 830 IF(.NOT.cosp_varsdefined) THEN 831 831 !$OMP MASTER 832 832 print*,'var, cosp_varsdefined dans cosp_varsdefined ',var%name, cosp_varsdefined 833 !Si phase de d éfinition.... on définit833 !Si phase de définition.... on définit 834 834 CALL conf_cospoutputs(var%name,var%cles) 835 835 DO iff=1, 3 … … 840 840 !$OMP END MASTER 841 841 ELSE 842 !Et sinon on.... écrit842 !Et sinon on.... écrit 843 843 IF (SIZE(field)/=klon) & 844 844 CALL abort_physic('iophy::histwrite2d_cosp','Field first DIMENSION not equal to klon',1) … … 921 921 nom=var%name 922 922 END IF 923 ! On regarde si on est dans la phase de d éfinition ou d'écriture:923 ! On regarde si on est dans la phase de définition ou d'écriture: 924 924 IF(.NOT.cosp_varsdefined) THEN 925 !Si phase de d éfinition.... on définit925 !Si phase de définition.... on définit 926 926 !$OMP MASTER 927 927 CALL conf_cospoutputs(var%name,var%cles) … … 933 933 !$OMP END MASTER 934 934 ELSE 935 !Et sinon on.... écrit935 !Et sinon on.... écrit 936 936 IF (SIZE(field,1)/=klon) & 937 937 CALL abort_physic('iophy::histwrite3d','Field first DIMENSION not equal to klon',1) … … 1000 1000 1001 1001 IF(cosp_varsdefined) THEN 1002 !Et sinon on.... écrit1002 !Et sinon on.... écrit 1003 1003 IF (SIZE(field,1)/=klon) & 1004 1004 CALL abort_physic('iophy::histwrite3d','Field first DIMENSION not equal to klon',1) -
LMDZ6/branches/Amaury_dev/libf/phylmd/cospv2/lmdz_cosp_read_outputkeys.F90
r5082 r5095 896 896 ! i = i+1 !si on laisse, 108 au lieu de 107 897 897 898 if (i >107) then898 if (i.gt.107) then 899 899 print *, 'COSP_IO: wrong number of output diagnostics' 900 900 print *, i,107 -
LMDZ6/branches/Amaury_dev/libf/phylmd/cospv2/lmdz_cosp_subsample_and_optics_mod.F90
r5086 r5095 98 98 logical :: cmpGases=.true. 99 99 100 if (Ncolumns >1) then100 if (Ncolumns .gt. 1) then 101 101 !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 102 102 ! Generate subcolumns for clouds (SCOPS) and precipitation type (PREC_SCOPS) … … 107 107 seed = int(cospstateIN%phalf(:,Nlevels+1)) ! In case of NPoints=1 108 108 ! *NOTE* Chunking will change the seed 109 if (NPoints >1) seed=int((cospstateIN%phalf(:,Nlevels+1)-minval(cospstateIN%phalf(:,Nlevels+1)))/ &109 if (NPoints .gt. 1) seed=int((cospstateIN%phalf(:,Nlevels+1)-minval(cospstateIN%phalf(:,Nlevels+1)))/ & 110 110 (maxval(cospstateIN%phalf(:,Nlevels+1))-minval(cospstateIN%phalf(:,Nlevels+1)))*100000) + 1 111 111 call init_rng(rngs, seed) … … 145 145 do k=1,nLevels 146 146 do i=1,nColumns 147 if (cospIN%frac_out(j,i,k) ==1) frac_ls(j,k) = frac_ls(j,k)+1._wp148 if (cospIN%frac_out(j,i,k) ==2) frac_cv(j,k) = frac_cv(j,k)+1._wp149 if (frac_prec(j,i,k) ==1) prec_ls(j,k) = prec_ls(j,k)+1._wp150 if (frac_prec(j,i,k) ==2) prec_cv(j,k) = prec_cv(j,k)+1._wp151 if (frac_prec(j,i,k) ==3) prec_cv(j,k) = prec_cv(j,k)+1._wp152 if (frac_prec(j,i,k) ==3) prec_ls(j,k) = prec_ls(j,k)+1._wp147 if (cospIN%frac_out(j,i,k) .eq. 1) frac_ls(j,k) = frac_ls(j,k)+1._wp 148 if (cospIN%frac_out(j,i,k) .eq. 2) frac_cv(j,k) = frac_cv(j,k)+1._wp 149 if (frac_prec(j,i,k) .eq. 1) prec_ls(j,k) = prec_ls(j,k)+1._wp 150 if (frac_prec(j,i,k) .eq. 2) prec_cv(j,k) = prec_cv(j,k)+1._wp 151 if (frac_prec(j,i,k) .eq. 3) prec_cv(j,k) = prec_cv(j,k)+1._wp 152 if (frac_prec(j,i,k) .eq. 3) prec_ls(j,k) = prec_ls(j,k)+1._wp 153 153 enddo 154 154 frac_ls(j,k)=frac_ls(j,k)/nColumns … … 217 217 do j=1,nPoints 218 218 ! In-cloud mixing ratios. 219 if (frac_ls(j,k) /=0.) then219 if (frac_ls(j,k) .ne. 0.) then 220 220 mr_hydro(j,:,k,I_LSCLIQ) = mr_hydro(j,:,k,I_LSCLIQ)/frac_ls(j,k) 221 221 mr_hydro(j,:,k,I_LSCICE) = mr_hydro(j,:,k,I_LSCICE)/frac_ls(j,k) 222 222 endif 223 if (frac_cv(j,k) /=0.) then223 if (frac_cv(j,k) .ne. 0.) then 224 224 mr_hydro(j,:,k,I_CVCLIQ) = mr_hydro(j,:,k,I_CVCLIQ)/frac_cv(j,k) 225 225 mr_hydro(j,:,k,I_CVCICE) = mr_hydro(j,:,k,I_CVCICE)/frac_cv(j,k) … … 227 227 ! Precipitation 228 228 if (use_precipitation_fluxes) then 229 if (prec_ls(j,k) /=0.) then229 if (prec_ls(j,k) .ne. 0.) then 230 230 fl_lsrain(j,k) = fl_lsrainIN(j,k)/prec_ls(j,k) 231 231 fl_lssnow(j,k) = fl_lssnowIN(j,k)/prec_ls(j,k) 232 232 fl_lsgrpl(j,k) = fl_lsgrplIN(j,k)/prec_ls(j,k) 233 233 endif 234 if (prec_cv(j,k) /=0.) then234 if (prec_cv(j,k) .ne. 0.) then 235 235 fl_ccrain(j,k) = fl_ccrainIN(j,k)/prec_cv(j,k) 236 236 fl_ccsnow(j,k) = fl_ccsnowIN(j,k)/prec_cv(j,k) 237 237 endif 238 238 else 239 if (prec_ls(j,k) /=0.) then239 if (prec_ls(j,k) .ne. 0.) then 240 240 mr_hydro(j,:,k,I_LSRAIN) = mr_hydro(j,:,k,I_LSRAIN)/prec_ls(j,k) 241 241 mr_hydro(j,:,k,I_LSSNOW) = mr_hydro(j,:,k,I_LSSNOW)/prec_ls(j,k) 242 242 mr_hydro(j,:,k,I_LSGRPL) = mr_hydro(j,:,k,I_LSGRPL)/prec_ls(j,k) 243 243 endif 244 if (prec_cv(j,k) /=0.) then244 if (prec_cv(j,k) .ne. 0.) then 245 245 mr_hydro(j,:,k,I_CVRAIN) = mr_hydro(j,:,k,I_CVRAIN)/prec_cv(j,k) 246 246 mr_hydro(j,:,k,I_CVSNOW) = mr_hydro(j,:,k,I_CVSNOW)/prec_cv(j,k) … … 361 361 do i=1,nPoints 362 362 do j=1,nLevels 363 if (cospIN%rcfg_cloudsat%use_gas_abs == 1 .or. (cospIN%rcfg_cloudsat%use_gas_abs == 2 .and. j ==1)) then363 if (cospIN%rcfg_cloudsat%use_gas_abs == 1 .or. (cospIN%rcfg_cloudsat%use_gas_abs == 2 .and. j .eq. 1)) then 364 364 g_vol(i,j) = gases(cospstateIN%pfull(i,j), cospstateIN%at(i,j),cospstateIN%qv(i,j),cospIN%rcfg_cloudsat%freq) 365 365 endif 366 366 cospIN%g_vol_cloudsat(i,:,j)=g_vol(i,j) 367 END DO368 END DO367 end do 368 end do 369 369 370 370 ! Loop over all subcolumns … … 379 379 380 380 ! At each model level, what fraction of the precipitation is frozen? 381 where(mr_hydro(:,k,:,I_LSRAIN) > 0 .or. mr_hydro(:,k,:,I_LSSNOW) >0 .or. &382 mr_hydro(:,k,:,I_CVRAIN) > 0 .or. mr_hydro(:,k,:,I_CVSNOW) >0 .or. &383 mr_hydro(:,k,:,I_LSGRPL) >0)381 where(mr_hydro(:,k,:,I_LSRAIN) .gt. 0 .or. mr_hydro(:,k,:,I_LSSNOW) .gt. 0 .or. & 382 mr_hydro(:,k,:,I_CVRAIN) .gt. 0 .or. mr_hydro(:,k,:,I_CVSNOW) .gt. 0 .or. & 383 mr_hydro(:,k,:,I_LSGRPL) .gt. 0) 384 384 fracPrecipIce(:,k,:) = (mr_hydro(:,k,:,I_LSSNOW) + mr_hydro(:,k,:,I_CVSNOW) + & 385 385 mr_hydro(:,k,:,I_LSGRPL)) / & -
LMDZ6/branches/Amaury_dev/libf/phylmd/cospv2/math_lib.F90
r5086 r5095 209 209 exit 210 210 end if 211 END DO211 end do 212 212 213 213 if (lerror) then … … 244 244 end if 245 245 ilo = ilo + 1 246 END DO246 end do 247 247 248 248 ilo = max ( 2, ilo ) … … 254 254 end if 255 255 ihi = ihi - 1 256 END DO256 end do 257 257 258 258 ihi = min ( ihi, ntab - 1 ) … … 305 305 syl = x2 306 306 307 END DO307 end do 308 308 309 309 result = sum1 + ca * ( b**3 - syl**3 ) / 3._wp & -
LMDZ6/branches/Amaury_dev/libf/phylmd/cospv2/mo_rng.F90
r5082 r5095 96 96 ! so we use sizeof(someInt) to determine wheter it is on 32 bit. 97 97 !if ( i2_16*i2_16 .le. huge32 ) then 98 if (digits(testInt) <=31) then98 if (digits(testInt) .le. 31) then 99 99 !if (sizeof(testInt) .eq. 4) then 100 100 r=r+1 -
LMDZ6/branches/Amaury_dev/libf/phylmd/cospv2/modis_simulator.F90
r5086 r5095 222 222 retrievedTau(i) = R_UNDEF 223 223 end if 224 END DO224 end do 225 225 where((retrievedSize(1:nSubCols) < 0.).and.(retrievedSize(1:nSubCols) /= R_UNDEF)) & 226 226 retrievedSize(1:nSubCols) = 1.0e-06_wp*re_fill … … 455 455 end if 456 456 if(totalTau >= tauLimit) exit 457 END DO457 end do 458 458 459 459 if (totalTau > 0._wp) then … … 489 489 end if 490 490 if(totalTau >= tauLimit) exit 491 END DO491 end do 492 492 493 493 if (totalTau > 0._wp) then … … 715 715 do i = 1, size(cloudIndicies) 716 716 call two_stream(tau(cloudIndicies(i)), g(cloudIndicies(i)), w0(cloudIndicies(i)), Refl(i), Trans(i)) 717 END DO717 end do 718 718 719 719 call adding_doubling(count(tau(1:nLevels) > 0),Refl(:), Trans(:), Refl_tot, Trans_tot) … … 897 897 Refl_cumulative(i) = Refl_cumulative(i-1) + Refl(i)*(Tran_cumulative(i-1)**2)/(1._wp - Refl_cumulative(i-1) * Refl(i)) 898 898 Tran_cumulative(i) = (Tran_cumulative(i-1)*Tran(i)) / (1._wp - Refl_cumulative(i-1) * Refl(i)) 899 END DO899 end do 900 900 901 901 Refl_tot = Refl_cumulative(size(Refl)) -
LMDZ6/branches/Amaury_dev/libf/phylmd/cospv2/mrgrnk.F90
r5081 r5095 68 68 IRNGT (1) = 1 69 69 Return 70 Case Default 71 Continue 70 72 End Select 71 73 ! … … 266 268 IRNGT (1) = 1 267 269 Return 270 Case Default 271 Continue 268 272 End Select 269 273 ! … … 463 467 IRNGT (1) = 1 464 468 Return 469 Case Default 470 Continue 465 471 End Select 466 472 ! -
LMDZ6/branches/Amaury_dev/libf/phylmd/cospv2/optics_lib.F90
r5086 r5095 539 539 if (alam < cutice) then 540 540 ! Region from 0.045 microns to 167.0 microns - no temperature depend 541 do i=2,nwl 542 if(alam < wl(i)) continue 543 enddo 541 544 x1 = log(wl(i-1)) 542 545 x2 = log(wl(i)) … … 555 558 if(tk < temref(4)) tk=temref(4) 556 559 do i=2,4 557 if(tk >=temref(i)) go to 12560 if(tk.ge.temref(i)) go to 12 558 561 enddo 559 562 12 lt1 = i 560 563 lt2 = i-1 561 564 do i=2,nwlt 562 if(alam <=wlt(i)) go to 14565 if(alam.le.wlt(i)) go to 14 563 566 enddo 564 567 14 x1 = log(wlt(i-1)) … … 649 652 Complex(wp) :: A1 650 653 651 If ((Dx >Imaxx) .Or. (InP>ImaxNP)) Then654 If ((Dx.Gt.Imaxx) .Or. (InP.Gt.ImaxNP)) Then 652 655 Error = 1 653 656 Return … … 656 659 Ir = 1 / Cm 657 660 Y = Dx * Cm 658 If (Dx <0.02) Then661 If (Dx.Lt.0.02) Then 659 662 NStop = 2 660 663 Else 661 If (Dx <=8.0) Then664 If (Dx.Le.8.0) Then 662 665 NStop = Dx + 4.00*Dx**(1./3.) + 2.0 663 666 Else 664 If (Dx <4200.0) Then667 If (Dx.Lt. 4200.0) Then 665 668 NStop = Dx + 4.05*Dx**(1./3.) + 2.0 666 669 Else … … 670 673 End If 671 674 NmX = Max(Real(NStop),Real(Abs(Y))) + 15. 672 If (Nmx >Itermax) then675 If (Nmx .gt. Itermax) then 673 676 Error = 1 674 677 Return … … 723 726 !ds Dqxt = Tnp1 * Dble(A + B) + Dqxt 724 727 Dqsc = Tnp1 * (A*Conjg(A) + B*Conjg(B)) + Dqsc 725 If (N >1) then728 If (N.Gt.1) then 726 729 Dg = Dg + (dN*dN - 1) * (ANM1*Conjg(A) + BNM1 * Conjg(B)) / dN + TNM1 *(ANM1*Conjg(BNM1)) / (dN*dN - dN) 727 730 !ds Dg = Dg + (dN*dN - 1) * Dble(ANM1*Conjg(A) + BNM1 * Conjg(B)) / dN + TNM1 * Dble(ANM1*Conjg(BNM1)) / (dN*dN - dN) … … 732 735 AMB = A2 * (A - B) 733 736 Do I = 1,Inp2 734 If (I >Inp) Then737 If (I.GT.Inp) Then 735 738 S(I) = -Pi1(I) 736 739 Else … … 753 756 End Do 754 757 755 If (Dg >0) Dg = 2 * Dg / Dqsc758 If (Dg .GT.0) Dg = 2 * Dg / Dqsc 756 759 Dqsc = 2 * Dqsc / Dx**2 757 760 Dqxt = 2 * Dqxt / Dx**2 -
LMDZ6/branches/Amaury_dev/libf/phylmd/cospv2/parasol.F90
r5093 r5095 81 81 ! Lum_norm=f(PARASOL_SZA,tau_cloud) derived from adding-doubling calculations 82 82 ! valid ONLY ABOVE OCEAN (albedo_sfce=5%) 83 ! valid only in one viewing direction (theta_v=30 °, phi_s-phi_v=320°)83 ! valid only in one viewing direction (theta_v=30�, phi_s-phi_v=320�) 84 84 ! based on adding-doubling radiative transfer computation 85 85 ! for PARASOL_TAU values (0 to 100) and for PARASOL_SZA values (0 to 80) … … 97 97 98 98 ! Relative fraction of the opt. thick due to liquid or ice clouds 99 WHERE (tautot_S(1:npoints) >0.)99 WHERE (tautot_S(1:npoints) .gt. 0.) 100 100 frac_taucol_liq(1:npoints) = tautot_S_liq(1:npoints) / tautot_S(1:npoints) 101 101 frac_taucol_ice(1:npoints) = tautot_S_ice(1:npoints) / tautot_S(1:npoints) … … 118 118 DO it=1,PARASOL_NREFL 119 119 DO ny=1,PARASOL_NTAU-1 120 WHERE (tautot_S(1:npoints) >=PARASOL_TAU(ny).and. &121 tautot_S(1:npoints) <=PARASOL_TAU(ny+1))120 WHERE (tautot_S(1:npoints) .ge. PARASOL_TAU(ny).and. & 121 tautot_S(1:npoints) .le. PARASOL_TAU(ny+1)) 122 122 rlumA_mod(1:npoints,it) = aA(it,ny)*tautot_S(1:npoints) + bA(it,ny) 123 123 rlumB_mod(1:npoints,it) = aB(it,ny)*tautot_S(1:npoints) + bB(it,ny) -
LMDZ6/branches/Amaury_dev/libf/phylmd/cospv2/prec_scops.F90
r5082 r5095 64 64 65 65 cv_col = scops_ccfrac*ncol 66 if (cv_col ==0) cv_col=166 if (cv_col .eq. 0) cv_col=1 67 67 68 68 do ilev=1,nlev … … 81 81 flag_cv=0 82 82 do ilev=1,nlev 83 if (frac_out(j,ibox,ilev) == 1) then83 if (frac_out(j,ibox,ilev) .eq. 1) then 84 84 flag_ls=1 85 85 endif 86 if (frac_out(j,ibox,ilev) == 2) then86 if (frac_out(j,ibox,ilev) .eq. 2) then 87 87 flag_cv=1 88 88 endif 89 89 enddo !loop over nlev 90 if (flag_ls ==1) then90 if (flag_ls .eq. 1) then 91 91 frac_out_ls(j,ibox)=1 92 92 endif 93 if (flag_cv ==1) then93 if (flag_cv .eq. 1) then 94 94 frac_out_cv(j,ibox)=1 95 95 endif … … 102 102 flag_cv=0 103 103 104 if (ls_p_rate(j,1) > 0.) then104 if (ls_p_rate(j,1) .gt. 0.) then 105 105 do ibox=1,ncol ! possibility ONE 106 if (frac_out(j,ibox,1) == 1) then106 if (frac_out(j,ibox,1) .eq. 1) then 107 107 prec_frac(j,ibox,1) = 1 108 108 flag_ls=1 109 109 endif 110 110 enddo ! loop over ncol 111 if (flag_ls ==0) then ! possibility THREE111 if (flag_ls .eq. 0) then ! possibility THREE 112 112 do ibox=1,ncol 113 if (frac_out(j,ibox,2) == 1) then113 if (frac_out(j,ibox,2) .eq. 1) then 114 114 prec_frac(j,ibox,1) = 1 115 115 flag_ls=1 … … 117 117 enddo ! loop over ncol 118 118 endif 119 if (flag_ls ==0) then ! possibility Four120 do ibox=1,ncol 121 if (frac_out_ls(j,ibox) == 1) then119 if (flag_ls .eq. 0) then ! possibility Four 120 do ibox=1,ncol 121 if (frac_out_ls(j,ibox) .eq. 1) then 122 122 prec_frac(j,ibox,1) = 1 123 123 flag_ls=1 … … 125 125 enddo ! loop over ncol 126 126 endif 127 if (flag_ls ==0) then ! possibility Five127 if (flag_ls .eq. 0) then ! possibility Five 128 128 do ibox=1,ncol 129 129 ! prec_frac(j,1:ncol,1) = 1 … … 134 134 ! There is large scale precipitation 135 135 136 if (cv_p_rate(j,1) > 0.) then136 if (cv_p_rate(j,1) .gt. 0.) then 137 137 do ibox=1,ncol ! possibility ONE 138 if (frac_out(j,ibox,1) == 2) then139 if (prec_frac(j,ibox,1) ==0) then138 if (frac_out(j,ibox,1) .eq. 2) then 139 if (prec_frac(j,ibox,1) .eq. 0) then 140 140 prec_frac(j,ibox,1) = 2 141 141 else … … 145 145 endif 146 146 enddo ! loop over ncol 147 if (flag_cv ==0) then ! possibility THREE148 do ibox=1,ncol 149 if (frac_out(j,ibox,2) == 2) then150 if (prec_frac(j,ibox,1) ==0) then147 if (flag_cv .eq. 0) then ! possibility THREE 148 do ibox=1,ncol 149 if (frac_out(j,ibox,2) .eq. 2) then 150 if (prec_frac(j,ibox,1) .eq. 0) then 151 151 prec_frac(j,ibox,1) = 2 152 152 else … … 157 157 enddo ! loop over ncol 158 158 endif 159 if (flag_cv ==0) then ! possibility Four160 do ibox=1,ncol 161 if (frac_out_cv(j,ibox) == 1) then162 if (prec_frac(j,ibox,1) ==0) then159 if (flag_cv .eq. 0) then ! possibility Four 160 do ibox=1,ncol 161 if (frac_out_cv(j,ibox) .eq. 1) then 162 if (prec_frac(j,ibox,1) .eq. 0) then 163 163 prec_frac(j,ibox,1) = 2 164 164 else … … 169 169 enddo ! loop over ncol 170 170 endif 171 if (flag_cv ==0) then ! possibility Five171 if (flag_cv .eq. 0) then ! possibility Five 172 172 do ibox=1,cv_col 173 if (prec_frac(j,ibox,1) ==0) then173 if (prec_frac(j,ibox,1) .eq. 0) then 174 174 prec_frac(j,ibox,1) = 2 175 175 else … … 192 192 flag_cv=0 193 193 194 if (ls_p_rate(j,ilev) > 0.) then194 if (ls_p_rate(j,ilev) .gt. 0.) then 195 195 do ibox=1,ncol ! possibility ONE&TWO 196 if ((frac_out(j,ibox,ilev) == 1) .or. ((prec_frac(j,ibox,ilev-1) ==1) &197 .or. (prec_frac(j,ibox,ilev-1) == 3))) then196 if ((frac_out(j,ibox,ilev) .eq. 1) .or. ((prec_frac(j,ibox,ilev-1) .eq. 1) & 197 .or. (prec_frac(j,ibox,ilev-1) .eq. 3))) then 198 198 prec_frac(j,ibox,ilev) = 1 199 199 flag_ls=1 200 200 endif 201 201 enddo ! loop over ncol 202 if ((flag_ls == 0) .and. (ilev <nlev)) then ! possibility THREE203 do ibox=1,ncol 204 if (frac_out(j,ibox,ilev+1) == 1) then202 if ((flag_ls .eq. 0) .and. (ilev .lt. nlev)) then ! possibility THREE 203 do ibox=1,ncol 204 if (frac_out(j,ibox,ilev+1) .eq. 1) then 205 205 prec_frac(j,ibox,ilev) = 1 206 206 flag_ls=1 … … 208 208 enddo ! loop over ncol 209 209 endif 210 if (flag_ls ==0) then ! possibility Four211 do ibox=1,ncol 212 if (frac_out_ls(j,ibox) == 1) then210 if (flag_ls .eq. 0) then ! possibility Four 211 do ibox=1,ncol 212 if (frac_out_ls(j,ibox) .eq. 1) then 213 213 prec_frac(j,ibox,ilev) = 1 214 214 flag_ls=1 … … 216 216 enddo ! loop over ncol 217 217 endif 218 if (flag_ls ==0) then ! possibility Five218 if (flag_ls .eq. 0) then ! possibility Five 219 219 do ibox=1,ncol 220 220 ! prec_frac(j,1:ncol,ilev) = 1 … … 224 224 endif ! There is large scale precipitation 225 225 226 if (cv_p_rate(j,ilev) > 0.) then226 if (cv_p_rate(j,ilev) .gt. 0.) then 227 227 do ibox=1,ncol ! possibility ONE&TWO 228 if ((frac_out(j,ibox,ilev) == 2) .or. ((prec_frac(j,ibox,ilev-1) ==2) &229 .or. (prec_frac(j,ibox,ilev-1) == 3))) then230 if (prec_frac(j,ibox,ilev) ==0) then228 if ((frac_out(j,ibox,ilev) .eq. 2) .or. ((prec_frac(j,ibox,ilev-1) .eq. 2) & 229 .or. (prec_frac(j,ibox,ilev-1) .eq. 3))) then 230 if (prec_frac(j,ibox,ilev) .eq. 0) then 231 231 prec_frac(j,ibox,ilev) = 2 232 232 else … … 236 236 endif 237 237 enddo ! loop over ncol 238 if ((flag_cv == 0) .and. (ilev <nlev)) then ! possibility THREE239 do ibox=1,ncol 240 if (frac_out(j,ibox,ilev+1) == 2) then241 if (prec_frac(j,ibox,ilev) ==0) then238 if ((flag_cv .eq. 0) .and. (ilev .lt. nlev)) then ! possibility THREE 239 do ibox=1,ncol 240 if (frac_out(j,ibox,ilev+1) .eq. 2) then 241 if (prec_frac(j,ibox,ilev) .eq. 0) then 242 242 prec_frac(j,ibox,ilev) = 2 243 243 else … … 248 248 enddo ! loop over ncol 249 249 endif 250 if (flag_cv ==0) then ! possibility Four251 do ibox=1,ncol 252 if (frac_out_cv(j,ibox) == 1) then253 if (prec_frac(j,ibox,ilev) ==0) then250 if (flag_cv .eq. 0) then ! possibility Four 251 do ibox=1,ncol 252 if (frac_out_cv(j,ibox) .eq. 1) then 253 if (prec_frac(j,ibox,ilev) .eq. 0) then 254 254 prec_frac(j,ibox,ilev) = 2 255 255 else … … 260 260 enddo ! loop over ncol 261 261 endif 262 if (flag_cv == 0) then ! possibility Five262 if (flag_cv .eq. 0) then ! possibility Five 263 263 do ibox=1,cv_col 264 if (prec_frac(j,ibox,ilev) ==0) then264 if (prec_frac(j,ibox,ilev) .eq. 0) then 265 265 prec_frac(j,ibox,ilev) = 2 266 266 else -
LMDZ6/branches/Amaury_dev/libf/phylmd/cospv2/quickbeam.F90
r5081 r5095 179 179 180 180 ! Attenuation due to gaseous absorption between radar and volume 181 if ((rcfg%use_gas_abs == 1) .or. (rcfg%use_gas_abs == 2 .and. pr ==1)) then181 if ((rcfg%use_gas_abs == 1) .or. (rcfg%use_gas_abs == 2 .and. pr .eq. 1)) then 182 182 if (d_gate==1) then 183 183 if (k>1) then … … 272 272 273 273 ! Which platforms to create diagnostics for? 274 if (platform =='cloudsat') lcloudsat=.true.274 if (platform .eq. 'cloudsat') lcloudsat=.true. 275 275 276 276 ! Create Cloudsat diagnostics. … … 289 289 enddo 290 290 enddo 291 where(cfad_ze /=R_UNDEF) cfad_ze = cfad_ze/Ncolumns291 where(cfad_ze .ne. R_UNDEF) cfad_ze = cfad_ze/Ncolumns 292 292 293 293 ! Compute cloudsat near-surface precipitation diagnostics … … 306 306 enddo 307 307 enddo 308 where(cfad_ze /=R_UNDEF) cfad_ze = cfad_ze/Ncolumns308 where(cfad_ze .ne. R_UNDEF) cfad_ze = cfad_ze/Ncolumns 309 309 endif 310 310 endif … … 402 402 do pr=1,Ncolumns 403 403 ! 1) Compute the PIA in all profiles containing hydrometeors 404 if ( (Ze_non_out(i,pr,cloudsat_preclvl) >-100) .and. (Ze_out(i,pr,cloudsat_preclvl)>-100) ) then405 if ( (Ze_non_out(i,pr,cloudsat_preclvl) <100) .and. (Ze_out(i,pr,cloudsat_preclvl)<100) ) then404 if ( (Ze_non_out(i,pr,cloudsat_preclvl).gt.-100) .and. (Ze_out(i,pr,cloudsat_preclvl).gt.-100) ) then 405 if ( (Ze_non_out(i,pr,cloudsat_preclvl).lt.100) .and. (Ze_out(i,pr,cloudsat_preclvl).lt.100) ) then 406 406 cloudsat_precip_pia(i,pr) = Ze_non_out(i,pr,cloudsat_preclvl) - Ze_out(i,pr,cloudsat_preclvl) 407 407 endif … … 412 412 ! 2a) Oceanic points. 413 413 ! ################################################################################ 414 if (land(i) ==0) then414 if (land(i) .eq. 0) then 415 415 ! print*, 'aaa i, pr, fracPrecipIce(i,pr) : ', i, pr, fracPrecipIce(i,pr) !Artem 416 416 ! Snow 417 if(fracPrecipIce(i,pr) >0.9) then418 if(Ze_non_out(i,pr,cloudsat_preclvl) >Zenonbinval(2)) then417 if(fracPrecipIce(i,pr).gt.0.9) then 418 if(Ze_non_out(i,pr,cloudsat_preclvl).gt.Zenonbinval(2)) then 419 419 cloudsat_pflag(i,pr) = pClass_Snow2 ! TSL: Snow certain 420 420 endif 421 if(Ze_non_out(i,pr,cloudsat_preclvl) >Zenonbinval(4).and. &422 Ze_non_out(i,pr,cloudsat_preclvl) <=Zenonbinval(2)) then421 if(Ze_non_out(i,pr,cloudsat_preclvl).gt.Zenonbinval(4).and. & 422 Ze_non_out(i,pr,cloudsat_preclvl).le.Zenonbinval(2)) then 423 423 cloudsat_pflag(i,pr) = pClass_Snow1 ! TSL: Snow possible 424 424 endif … … 426 426 427 427 ! Mixed 428 if(fracPrecipIce(i,pr) >0.1.and.fracPrecipIce(i,pr)<=0.9) then429 if(Ze_non_out(i,pr,cloudsat_preclvl) >Zenonbinval(2)) then428 if(fracPrecipIce(i,pr).gt.0.1.and.fracPrecipIce(i,pr).le.0.9) then 429 if(Ze_non_out(i,pr,cloudsat_preclvl).gt.Zenonbinval(2)) then 430 430 cloudsat_pflag(i,pr) = pClass_Mixed2 ! TSL: Mixed certain 431 431 endif 432 if(Ze_non_out(i,pr,cloudsat_preclvl) >Zenonbinval(4).and. &433 Ze_non_out(i,pr,cloudsat_preclvl) <=Zenonbinval(2)) then432 if(Ze_non_out(i,pr,cloudsat_preclvl).gt.Zenonbinval(4).and. & 433 Ze_non_out(i,pr,cloudsat_preclvl).le.Zenonbinval(2)) then 434 434 cloudsat_pflag(i,pr) = pClass_Mixed1 ! TSL: Mixed possible 435 435 endif … … 437 437 438 438 ! Rain 439 if(fracPrecipIce(i,pr) <=0.1) then440 if(Ze_non_out(i,pr,cloudsat_preclvl) >Zenonbinval(1)) then439 if(fracPrecipIce(i,pr).le.0.1) then 440 if(Ze_non_out(i,pr,cloudsat_preclvl).gt.Zenonbinval(1)) then 441 441 cloudsat_pflag(i,pr) = pClass_Rain3 ! TSL: Rain certain 442 442 endif 443 if(Ze_non_out(i,pr,cloudsat_preclvl) >Zenonbinval(3).and. &444 Ze_non_out(i,pr,cloudsat_preclvl) <=Zenonbinval(1)) then443 if(Ze_non_out(i,pr,cloudsat_preclvl).gt.Zenonbinval(3).and. & 444 Ze_non_out(i,pr,cloudsat_preclvl).le.Zenonbinval(1)) then 445 445 cloudsat_pflag(i,pr) = pClass_Rain2 ! TSL: Rain probable 446 446 endif 447 if(Ze_non_out(i,pr,cloudsat_preclvl) >Zenonbinval(4).and. &448 Ze_non_out(i,pr,cloudsat_preclvl) <=Zenonbinval(3)) then447 if(Ze_non_out(i,pr,cloudsat_preclvl).gt.Zenonbinval(4).and. & 448 Ze_non_out(i,pr,cloudsat_preclvl).le.Zenonbinval(3)) then 449 449 cloudsat_pflag(i,pr) = pClass_Rain1 ! TSL: Rain possible 450 450 endif 451 if(cloudsat_precip_pia(i,pr) >40) then451 if(cloudsat_precip_pia(i,pr).gt.40) then 452 452 cloudsat_pflag(i,pr) = pClass_Rain4 ! TSL: Heavy Rain 453 453 endif … … 455 455 456 456 ! No precipitation 457 if(Ze_non_out(i,pr,cloudsat_preclvl) <=-15) then457 if(Ze_non_out(i,pr,cloudsat_preclvl).le.-15) then 458 458 cloudsat_pflag(i,pr) = pClass_noPrecip ! TSL: Not Raining 459 459 endif … … 463 463 ! 2b) Land points. 464 464 ! ################################################################################ 465 if (land(i) ==1) then465 if (land(i) .eq. 1) then 466 466 ! Find Zmax, the maximum reflectivity value in the attenuated profile (Ze_out); 467 467 Zmax=maxval(Ze_out(i,pr,:)) 468 468 469 469 ! Snow (T<273) 470 if(t2m(i) <273._wp) then471 if(Ze_out(i,pr,cloudsat_preclvl) >Zbinvallnd(5)) then470 if(t2m(i) .lt. 273._wp) then 471 if(Ze_out(i,pr,cloudsat_preclvl) .gt. Zbinvallnd(5)) then 472 472 cloudsat_pflag(i,pr) = pClass_Snow2 ! JEK: Snow certain 473 473 endif 474 if(Ze_out(i,pr,cloudsat_preclvl) >Zbinvallnd(6) .and. &475 Ze_out(i,pr,cloudsat_preclvl) <=Zbinvallnd(5)) then474 if(Ze_out(i,pr,cloudsat_preclvl) .gt. Zbinvallnd(6) .and. & 475 Ze_out(i,pr,cloudsat_preclvl).le.Zbinvallnd(5)) then 476 476 cloudsat_pflag(i,pr) = pClass_Snow1 ! JEK: Snow possible 477 477 endif … … 479 479 480 480 ! Mized phase (273<T<275) 481 if(t2m(i) >= 273._wp .and. t2m(i) <=275._wp) then482 if ((Zmax > Zbinvallnd(1) .and. cloudsat_precip_pia(i,pr)>30) .or. &483 (Ze_out(i,pr,cloudsat_preclvl) >Zbinvallnd(4))) then481 if(t2m(i) .ge. 273._wp .and. t2m(i) .le. 275._wp) then 482 if ((Zmax .gt. Zbinvallnd(1) .and. cloudsat_precip_pia(i,pr).gt.30) .or. & 483 (Ze_out(i,pr,cloudsat_preclvl) .gt. Zbinvallnd(4))) then 484 484 cloudsat_pflag(i,pr) = pClass_Mixed2 ! JEK: Mixed certain 485 485 endif 486 if ((Ze_out(i,pr,cloudsat_preclvl) >Zbinvallnd(6) .and. &487 Ze_out(i,pr,cloudsat_preclvl) <=Zbinvallnd(4)) .and. &488 (Zmax >Zbinvallnd(5)) ) then486 if ((Ze_out(i,pr,cloudsat_preclvl) .gt. Zbinvallnd(6) .and. & 487 Ze_out(i,pr,cloudsat_preclvl) .le. Zbinvallnd(4)) .and. & 488 (Zmax .gt. Zbinvallnd(5)) ) then 489 489 cloudsat_pflag(i,pr) = pClass_Mixed1 ! JEK: Mixed possible 490 490 endif … … 492 492 493 493 ! Rain (T>275) 494 if(t2m(i) >275) then495 if ((Zmax > Zbinvallnd(1) .and. cloudsat_precip_pia(i,pr)>30) .or. &496 (Ze_out(i,pr,cloudsat_preclvl) >Zbinvallnd(2))) then494 if(t2m(i) .gt. 275) then 495 if ((Zmax .gt. Zbinvallnd(1) .and. cloudsat_precip_pia(i,pr).gt.30) .or. & 496 (Ze_out(i,pr,cloudsat_preclvl) .gt. Zbinvallnd(2))) then 497 497 cloudsat_pflag(i,pr) = pClass_Rain3 ! JEK: Rain certain 498 498 endif 499 if((Ze_out(i,pr,cloudsat_preclvl) >Zbinvallnd(6)) .and. &500 (Zmax >Zbinvallnd(3))) then499 if((Ze_out(i,pr,cloudsat_preclvl) .gt. Zbinvallnd(6)) .and. & 500 (Zmax .gt. Zbinvallnd(3))) then 501 501 cloudsat_pflag(i,pr) = pClass_Rain2 ! JEK: Rain probable 502 502 endif 503 if((Ze_out(i,pr,cloudsat_preclvl) >Zbinvallnd(6)) .and. &504 (Zmax <Zbinvallnd(3))) then503 if((Ze_out(i,pr,cloudsat_preclvl) .gt. Zbinvallnd(6)) .and. & 504 (Zmax.lt.Zbinvallnd(3))) then 505 505 cloudsat_pflag(i,pr) = pClass_Rain1 ! JEK: Rain possible 506 506 endif 507 if(cloudsat_precip_pia(i,pr) >40) then507 if(cloudsat_precip_pia(i,pr).gt.40) then 508 508 cloudsat_pflag(i,pr) = pClass_Rain4 ! JEK: Heavy Rain 509 509 endif … … 511 511 512 512 ! No precipitation 513 if(Ze_out(i,pr,cloudsat_preclvl) <=-15) then513 if(Ze_out(i,pr,cloudsat_preclvl).le.-15) then 514 514 cloudsat_pflag(i,pr) = pClass_noPrecip ! JEK: Not Precipitating 515 515 endif … … 526 526 ! Gridmean precipitation fraction for each precipitation type 527 527 do k=1,nCloudsatPrecipClass 528 if (any(cloudsat_pflag(i,:) ==k-1)) then529 cloudsat_precip_cover(i,k) = count(cloudsat_pflag(i,:) ==k-1)528 if (any(cloudsat_pflag(i,:) .eq. k-1)) then 529 cloudsat_precip_cover(i,k) = count(cloudsat_pflag(i,:) .eq. k-1) 530 530 endif 531 531 enddo -
LMDZ6/branches/Amaury_dev/libf/phylmd/cospv2/quickbeam_optics.F90
r5086 r5095 172 172 173 173 ! Compute effective radius from number concentration and distribution parameters 174 if (Re_internal ==0) then174 if (Re_internal .eq. 0) then 175 175 call calc_Re(hm_matrix(pr,k,tp),Np_matrix(pr,k,tp),rho_a, & 176 176 sd%dtype(tp),sd%apm(tp),sd%bpm(tp),sd%rho(tp),sd%p1(tp),sd%p2(tp),sd%p3(tp),Re) … … 187 187 ! Index into particle size dimension of scaling tables 188 188 iRe_type=1 189 if(Re >0) then189 if(Re.gt.0) then 190 190 ! Determine index in to scale LUT 191 191 ! Distance between Re points (defined by "base" and "step") for … … 197 197 base = rcfg%base_list(n+1) 198 198 iRe_type=Re/step 199 if (iRe_type <1) iRe_type=1199 if (iRe_type.lt.1) iRe_type=1 200 200 Re=step*(iRe_type+0.5_wp) ! set value of Re to closest value allowed in LUT. 201 201 iRe_type=iRe_type+base-int(n*Re_BIN_LENGTH/step) 202 202 203 203 ! Make sure iRe_type is within bounds 204 if (iRe_type >=nRe_types) then204 if (iRe_type.ge.nRe_types) then 205 205 !write(*,*) 'Warning: size of Re exceed value permitted ', & 206 206 ! 'in Look-Up Table (LUT). Will calculate. ' … … 405 405 ! Exponential is same as modified gamma with vu =1 406 406 ! if Np is specified then we will just treat as modified gamma 407 if(dtype == 2 .and. Np >0) then407 if(dtype .eq. 2 .and. Np .gt. 0) then 408 408 local_dtype = 1 409 409 local_p3 = 1 … … 441 441 endif 442 442 443 if( Np ==0 .and. p2+1 > 1E-8) then ! use default value for MEAN diameter as first default443 if( Np.eq.0 .and. p2+1 > 1E-8) then ! use default value for MEAN diameter as first default 444 444 dm = p2 ! by definition, should have units of microns 445 445 D0 = gamma(vu)/gamma(vu+1)*dm 446 446 else ! use value of Np 447 if(Np ==0) then447 if(Np.eq.0) then 448 448 if( abs(p1+1) > 1E-8 ) then ! use default number concentration 449 449 local_Np = p1 ! total number concentration / pa --- units kg^-1 … … 525 525 526 526 ! get rg ... 527 if( Np ==0 .and. (abs(p2+1) > 1E-8) ) then ! use default value of rg527 if( Np.eq.0 .and. (abs(p2+1) > 1E-8) ) then ! use default value of rg 528 528 rg = p2 529 529 else … … 826 826 log_sigma_g = p3 827 827 tmp2 = (bpm*log_sigma_g)*(bpm*log_sigma_g) 828 if(Re <=0) then828 if(Re.le.0) then 829 829 rg = p2 830 830 else … … 983 983 call mieint(sizep(i), m0(i), one, dqv, qext(i), dqsc, qbsca(i), & 984 984 dg, xs1, xs2, dph, err) 985 END DO985 end do 986 986 987 987 else -
LMDZ6/branches/Amaury_dev/libf/phylmd/cospv2/scops.F90
r5081 r5095 75 75 76 76 ! Test for valid input overlap assumption 77 if (overlap /= 1 .and. overlap /= 2 .and. overlap /=3) then77 if (overlap .ne. 1 .and. overlap .ne. 2 .and. overlap .ne. 3) then 78 78 overlap=default_overlap 79 79 call errorMessage('ERROR(scops): Invalid overlap assumption provided. Using default overlap assumption (max/ran)') … … 92 92 tca(1:npoints,1:nlev) = cc(1:npoints,1:nlev) 93 93 94 if (ncolprint /=0) then94 if (ncolprint.ne.0) then 95 95 write (6,'(a)') 'frac_out_pp_rev:' 96 96 do j=1,npoints,1000 … … 102 102 write (6,'(I3)') ncol 103 103 endif 104 if (ncolprint /=0) then104 if (ncolprint.ne.0) then 105 105 write (6,'(a)') 'last_frac_pp:' 106 106 do j=1,npoints,1000 … … 122 122 123 123 ! Initialise threshold 124 IF (ilev ==1) then124 IF (ilev.eq.1) then 125 125 ! If max overlap 126 IF (overlap ==1) then126 IF (overlap.eq.1) then 127 127 ! Select pixels spread evenly across the gridbox 128 128 threshold(1:npoints,1:ncol)=boxpos(1:npoints,1:ncol) … … 137 137 enddo 138 138 ENDIF 139 IF (ncolprint /=0) then139 IF (ncolprint.ne.0) then 140 140 write (6,'(a)') 'threshold_nsf2:' 141 141 do j=1,npoints,1000 … … 147 147 ENDIF 148 148 149 IF (ncolprint /=0) then149 IF (ncolprint.ne.0) then 150 150 write (6,'(a)') 'ilev:' 151 151 write (6,'(I2)') ilev … … 157 157 !maxocc(1:npoints,ibox) = merge(1,0, conv(1:npoints,ilev) .gt. boxpos(1:npoints,ibox)) 158 158 do j=1,npoints 159 if (boxpos(j,ibox) <=conv(j,ilev)) then159 if (boxpos(j,ibox).le.conv(j,ilev)) then 160 160 maxocc(j,ibox) = 1 161 161 else … … 165 165 166 166 ! Max overlap 167 if (overlap ==1) then167 if (overlap.eq.1) then 168 168 threshold_min(1:npoints,ibox) = conv(1:npoints,ilev) 169 169 maxosc(1:npoints,ibox) = 1 … … 171 171 172 172 ! Random overlap 173 if (overlap ==2) then173 if (overlap.eq.2) then 174 174 threshold_min(1:npoints,ibox) = conv(1:npoints,ilev) 175 175 maxosc(1:npoints,ibox) = 0 176 176 endif 177 177 ! Max/Random overlap 178 if (overlap ==3) then178 if (overlap.eq.3) then 179 179 ! DS2014 START: The bounds on tca are not valid when ilev=1. 180 180 !threshold_min(1:npoints,ibox) = max(conv(1:npoints,ilev),min(tca(1:npoints,ilev-1),tca(1:npoints,ilev))) … … 182 182 ! min(tca(1:npoints,ilev-1),tca(1:npoints,ilev)) .and. & 183 183 ! (threshold(1:npoints,ibox).gt.conv(1:npoints,ilev))) 184 if (ilev /=1) then184 if (ilev .ne. 1) then 185 185 threshold_min(1:npoints,ibox) = max(conv(1:npoints,ilev),min(tca(1:npoints,ilev-1),tca(1:npoints,ilev))) 186 maxosc(1:npoints,ibox) = merge(1,0,threshold(1:npoints,ibox) <&186 maxosc(1:npoints,ibox) = merge(1,0,threshold(1:npoints,ibox) .lt. & 187 187 min(tca(1:npoints,ilev-1),tca(1:npoints,ilev)) .and. & 188 (threshold(1:npoints,ibox) >conv(1:npoints,ilev)))188 (threshold(1:npoints,ibox).gt.conv(1:npoints,ilev))) 189 189 else 190 190 threshold_min(1:npoints,ibox) = max(conv(1:npoints,ilev),min(0._wp,tca(1:npoints,ilev))) 191 maxosc(1:npoints,ibox) = merge(1,0,threshold(1:npoints,ibox) <&191 maxosc(1:npoints,ibox) = merge(1,0,threshold(1:npoints,ibox) .lt. & 192 192 min(0._wp,tca(1:npoints,ilev)) .and. & 193 (threshold(1:npoints,ibox) >conv(1:npoints,ilev)))193 (threshold(1:npoints,ibox).gt.conv(1:npoints,ilev))) 194 194 endif 195 195 endif … … 205 205 206 206 ! Fill frac_out with 1's where tca is greater than the threshold 207 frac_out(1:npoints,ibox,ilev) = merge(1,0,tca(1:npoints,ilev) >threshold(1:npoints,ibox))207 frac_out(1:npoints,ibox,ilev) = merge(1,0,tca(1:npoints,ilev).gt.threshold(1:npoints,ibox)) 208 208 209 209 ! Code to partition boxes into startiform and convective parts goes here 210 where(threshold(1:npoints,ibox) <=conv(1:npoints,ilev) .and. conv(1:npoints,ilev)>0.) frac_out(1:npoints,ibox,ilev)=2210 where(threshold(1:npoints,ibox).le.conv(1:npoints,ilev) .and. conv(1:npoints,ilev).gt.0.) frac_out(1:npoints,ibox,ilev)=2 211 211 ENDDO ! ibox 212 212 213 213 214 214 ! Set last_frac to tca at this level, so as to be tca from last level next time round 215 if (ncolprint /=0) then215 if (ncolprint.ne.0) then 216 216 do j=1,npoints ,1000 217 217 write(6,'(a10)') 'j='
Note: See TracChangeset
for help on using the changeset viewer.