Changeset 5082 for LMDZ6/branches/Amaury_dev/libf/phylmd/cospv2
- Timestamp:
- Jul 19, 2024, 5:41:58 PM (4 months ago)
- Location:
- LMDZ6/branches/Amaury_dev/libf/phylmd/cospv2
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
LMDZ6/branches/Amaury_dev/libf/phylmd/cospv2/MISR_simulator.F90
r3491 r5082 84 84 do ilev=1,nlev 85 85 ! Define location of "layer top" 86 if(ilev .eq.1 .or. ilev.eq.nlev) then86 if(ilev==1 .or. ilev==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 .gt.1000*misr_histHgt(loop+1) ) then96 if ( ztest > 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 .eq. 0 .and. dtau(j,ibox,ilev) .gt.0.) then112 if(thres_crossed_MISR == 0 .and. dtau(j,ibox,ilev) > 0.) then 113 113 ! First encountered a "cloud" 114 114 thres_crossed_MISR = 1 … … 116 116 endif 117 117 118 if( thres_crossed_MISR .lt. 99 .and. thres_crossed_MISR .gt.0 ) then119 if( dtau(j,ibox,ilev) .eq.0.) then118 if( thres_crossed_MISR < 99 .and. thres_crossed_MISR > 0 ) then 119 if( dtau(j,ibox,ilev) == 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) .gt.0 .and. (cloud_dtau-dtau(j,ibox,ilev)) .lt.1) then132 if(dtau(j,ibox,ilev) .lt. 1 .or. ilev.eq.1 .or. ilev.eq.nlev) then131 if( dtau(j,ibox,ilev)>0 .and. (cloud_dtau-dtau(j,ibox,ilev)) < 1) then 132 if(dtau(j,ibox,ilev) < 1 .or. ilev==1 .or. ilev==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) .gt. 1 .and. at(j,ilev) .gt.273 ) then144 if(dtau(j,ibox,ilev) > 1 .and. at(j,ilev) > 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)) .gt.5) then151 if(sum(dtau(j,ibox,1:ilev)) > 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 .eq.1) then159 if( thres_crossed_MISR == 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)) .gt.0.5) then164 if(sum(dtau(j,ibox,1:nlev)) > 0.5) then 165 165 ! keep MISR detected CTH 166 elseif(sum(dtau(j,ibox,1:nlev)) .gt.0.2) then166 elseif(sum(dtau(j,ibox,1:nlev)) > 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 .ne.1) dist_model_layertops(1:npoints,j) = R_UNDEF217 where(sunlit /= 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) .gt.tauchk)259 box_cloudy(1:ncol) = merge(.true.,.false.,tau(j,1:ncol) > 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) .eq.0) box_MISR_ztopWRK(j,1:ncol)=-999._wp263 where(box_MISR_ztopWRK(j,1:ncol) == 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) .eq. 1) then266 if (sunlit(j) == 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) .ne.-999.))/ncol274 MISR_cldarea(j)=real(count(box_MISR_ztopWRK(j,1:ncol) /= -999.))/ncol 275 275 276 276 ! Column cloud-top height 277 if ( count(box_MISR_ztopWRK(j,1:ncol) .ne. -999.) .ne.0 ) then278 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.)277 if ( count(box_MISR_ztopWRK(j,1:ncol) /= -999.) /= 0 ) then 278 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.) 280 280 else 281 281 MISR_mean_ztop(j) = R_UNDEF -
LMDZ6/branches/Amaury_dev/libf/phylmd/cospv2/cosp.F90
r3491 r5082 480 480 481 481 ! Set flag to deallocate rttov types (only done on final call to simulator) 482 if (size(cospOUT%isccp_meantb) .eq.stop_idx) lrttov_cleanUp = .true.482 if (size(cospOUT%isccp_meantb) == 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 .gt.0) then689 if (modisIN%Nsunlit > 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) .gt.0) then694 if (count(cospgridIN%sunlit <= 0) > 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) … … 2430 2430 !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 2431 2431 if (any([Lisccp_subcolumn, Lisccp_column, Lmisr_subcolumn, Lmisr_column, Lmodis_subcolumn, Lmodis_column])) then 2432 if (any(cospgridIN%sunlit .lt.0)) then2432 if (any(cospgridIN%sunlit < 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 .lt.0)) then2500 if (any(cospgridIN%at < 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 .lt.0)) then2548 if (any(cospgridIN%pfull < 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 .lt.0)) then2568 if (any(cospgridIN%phalf < 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 .lt.0)) then2650 if (any(cospgridIN%qv < 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 .lt.-300)) then2670 if (any(cospgridIN%hgt_matrix < -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 .lt.-300)) then2716 if (any(cospgridIN%hgt_matrix_half < -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 .lt.0)) then2755 if (any(cospgridIN%land < 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 .lt.0)) then2778 if (any(cospgridIN%skt < 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 .lt. -90. .OR. cospgridIN%zenang .gt.90) then2799 if (cospgridIN%zenang < -90. .OR. cospgridIN%zenang > 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 .lt.0) then2805 if (cospgridIN%co2 < 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 .lt.0) then2811 if (cospgridIN%ch4 < 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 .lt.0) then2817 if (cospgridIN%n2o < 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 .lt.0) then2823 if (cospgridIN%co< 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 .lt.0)) then2829 if (any(cospgridIN%o3 < 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 .lt. 0. .OR. cospgridIN%emis_sfc .gt.1)) then2835 if (any(cospgridIN%emis_sfc < 0. .OR. cospgridIN%emis_sfc > 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 .lt. -100. .OR. cospgridIN%u_sfc .gt.100.)) then2841 if (any(cospgridIN%u_sfc < -100. .OR. cospgridIN%u_sfc > 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 .lt. -100. .OR. cospgridIN%v_sfc .gt.100.)) then2847 if (any(cospgridIN%v_sfc < -100. .OR. cospgridIN%v_sfc > 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 .lt. -90 .OR. cospgridIN%lat .gt.90)) then2853 if (any(cospgridIN%lat < -90 .OR. cospgridIN%lat > 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 .lt. 0. .OR. cospIN%emsfc_lw .gt.1.) then2863 if (cospIN%emsfc_lw < 0. .OR. cospIN%emsfc_lw > 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 .lt.0)) then2880 if (any(cospIN%tau_067 < 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 .lt. 0. .OR. cospIN%emiss_11 .gt.1)) then2945 if (any(cospIN%emiss_11 < 0. .OR. cospIN%emiss_11 > 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 .lt. -1. .OR. cospIN%asym .gt.1)) then2962 if (any(cospIN%asym < -1. .OR. cospIN%asym > 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 .lt. 0 .OR. cospIN%ss_alb .gt.1)) then3008 if (any(cospIN%ss_alb < 0 .OR. cospIN%ss_alb > 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 .lt.0)) then3056 if (any(cospIN%betatot_atlid < 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 .lt.0)) then3067 if (any(cospIN%beta_mol_atlid < 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 .lt.0)) then3078 if (any(cospIN%tautot_atlid < 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 .lt.0)) then3089 if (any(cospIN%tau_mol_atlid < 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 .lt.0)) then3103 if (any(cospIN%betatot_grLidar532 < 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 .lt.0)) then3114 if (any(cospIN%beta_mol_grLidar532 < 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 .lt.0)) then3125 if (any(cospIN%tautot_grLidar532 < 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 .lt.0)) then3136 if (any(cospIN%tau_mol_grLidar532 < 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 .lt.0)) then3150 if (any(cospIN%betatot_calipso < 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 .lt.0)) then3169 if (any(cospIN%betatot_liq_calipso < 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 .lt.0)) then3188 if (any(cospIN%betatot_ice_calipso < 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 .lt.0)) then3207 if (any(cospIN%tautot_calipso < 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 .lt.0)) then3226 if (any(cospIN%tautot_liq_calipso < 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 .lt.0)) then3245 if (any(cospIN%tautot_ice_calipso < 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 .lt.0)) then3264 if (any(cospIN%tau_mol_calipso < 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 .lt.0)) then3286 if (any(cospIN%beta_mol_calipso < 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 .lt.0)) then3317 if (any(cospIN%tautot_S_liq < 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 .lt.0)) then3325 if (any(cospIN%tautot_S_ice < 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 .lt.0)) then3336 if (any(cospIN%z_vol_cloudsat < 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 .lt.0)) then3352 if (any(cospIN%kr_vol_cloudsat < 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 .lt.0)) then3368 if (any(cospIN%g_vol_cloudsat < 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) .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) then3391 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) 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) .ne.cospIN%Ncolumns .OR. &3406 size(cospIN%tau_067,2) .ne.cospIN%Ncolumns .OR. &3407 size(cospIN%emiss_11,2) .ne.cospIN%Ncolumns) then3405 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) 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) .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) then3413 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) 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) .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) then3429 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) 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) .ne.cospIN%Ncolumns) then3438 if (size(cospIN%tau_067,2) /= 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) .ne.cospIN%Nlevels .OR. &3445 size(cospgridIN%hgt_matrix,2) .ne.cospIN%Nlevels .OR. &3446 size(cospgridIN%at,2) .ne.cospIN%Nlevels) then3444 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) 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) .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) then3456 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) 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) .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) then3465 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) 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) .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) then3474 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) 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) .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) then3487 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) 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) .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) then3496 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) 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) .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) then3504 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) 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) .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) then3517 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) 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) .ne. cospIN%Ncolumns .OR. &3527 size(cospIN%tautot_grLidar532,2) .ne. cospIN%Ncolumns) then3526 if (size(cospIN%betatot_grLidar532,2) /= cospIN%Ncolumns .OR. & 3527 size(cospIN%tautot_grLidar532,2) /= 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) .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) then3533 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) 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) .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) then3546 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) 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) .ne.cospIN%Ncolumns .OR. &3556 size(cospIN%tautot_atlid,2) .ne. cospIN%Ncolumns) then3555 if (size(cospIN%betatot_atlid,2) /= cospIN%Ncolumns .OR. & 3556 size(cospIN%tautot_atlid,2) /= 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) .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) then3562 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) 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) .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) then3575 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) 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) .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) then3588 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) 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) .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) then3599 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) 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) .ne.cospIN%Npoints .OR. &3617 size(cospIN%tautot_S_ice,1) .ne.cospIN%Npoints) then3616 if (size(cospIN%tautot_S_liq,1) /= cospIN%Npoints .OR. & 3617 size(cospIN%tautot_S_ice,1) /= 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) .ne.cospIN%Ncolumns .OR. &3624 size(cospIN%tautot_S_ice,2) .ne.cospIN%Ncolumns) then3623 if (size(cospIN%tautot_S_liq,2) /= cospIN%Ncolumns .OR. & 3624 size(cospIN%tautot_S_ice,2) /= 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) .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) then3634 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) 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) .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) then3649 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) then 3655 3655 Lrttov_column = .false. 3656 3656 nError=nError+1 -
LMDZ6/branches/Amaury_dev/libf/phylmd/cospv2/cosp_stats.F90
r3491 r5082 210 210 ! look for j_1km from bottom to top 211 211 j = 1 212 do while (Ze_tot(pr,i,j) .eq.R_GROUND)212 do while (Ze_tot(pr,i,j) == 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 .le. s_att) .and. (flag_sat .eq.0)) flag_sat = j220 if (Ze_tot(pr,i,j) .lt.-30.) then !radar can't detect cloud221 if ( (sc_ratio .gt. s_cld) .or. (flag_sat .eq.j) ) then !lidar sense cloud219 if ((sc_ratio <= s_att) .and. (flag_sat == 0)) flag_sat = j 220 if (Ze_tot(pr,i,j) < -30.) then !radar can't detect cloud 221 if ( (sc_ratio > s_cld) .or. (flag_sat == 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 .gt. j_1km) flag_radarcld_no1km=1228 if (j > j_1km) flag_radarcld_no1km=1 229 229 endif 230 230 enddo !levels 231 if (flag_cld .eq.1) tcc(pr)=tcc(pr)+1._wp232 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.231 if (flag_cld == 1) tcc(pr)=tcc(pr)+1._wp 232 if (flag_radarcld == 1) radar_tcc(pr)=radar_tcc(pr)+1. 233 if (flag_radarcld_no1km == 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 .ge. bins(ij-1) .and. var .lt.bins(ij))270 if (count(var .eq. R_GROUND) .ge.1) hist1D(ij-1)=R_UNDEF269 hist1D(ij-1) = count(var >= bins(ij-1) .and. var < bins(ij)) 270 if (count(var == R_GROUND) >= 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 .ge. bin1(ij-1) .and. var1 .lt.bin1(ij) .and. &303 var2 .ge. bin2(ik-1) .and. var2 .lt. bin2(ik))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)) 304 304 enddo 305 305 enddo -
LMDZ6/branches/Amaury_dev/libf/phylmd/cospv2/icarus.F90
r3491 r5082 134 134 ! ########################################################################## 135 135 136 if (debugcol .ne.0) then136 if (debugcol/=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) .eq.ilev) acc(ilev,1:ncol)=acc(ilev,1:ncol)+1142 where(levmatch(j,1:ncol) == ilev) acc(ilev,1:ncol)=acc(ilev,1:ncol)+1 143 143 enddo 144 144 … … 224 224 225 225 ! Set tropopause values 226 if (isccp_top_height .eq. 1 .or. isccp_top_height .eq. 3) then226 if (isccp_top_height == 1 .or. isccp_top_height == 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) .lt.40000. .and. &235 pfull(1:npoints,ilev) .gt.5000. .and. &236 at(1:npoints,ilev) .lt.attropmin(1:npoints))234 where(pfull(1:npoints,ilev) < 40000. .and. & 235 pfull(1:npoints,ilev) > 5000. .and. & 236 at(1:npoints,ilev) < 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) .gt. atmax(1:npoints) .and. ilev .ge.itrop(1:npoints))246 at(1:npoints,ilev) > atmax(1:npoints) .and. ilev >= itrop(1:npoints)) 247 247 enddo 248 248 end if 249 249 250 if (isccp_top_height .eq. 1 .or. isccp_top_height .eq.3) then250 if (isccp_top_height == 1 .or. isccp_top_height == 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) .eq.0)310 demIN(1:npoints,ibox,ilev) == 0) 311 311 312 312 ! Increase TOA flux emitted from layer … … 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 .eq.1) then350 if (isccp_top_height == 1) then 351 351 do j=1,npoints 352 if (transmax(j) .gt. 0.001 .and. transmax(j) .le.0.9999999) then352 if (transmax(j) > 0.001 .and. transmax(j) <= 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) .gt. (tauchk)) then360 if (transmax(j) .gt. 0.001 .and. transmax(j) .le.0.9999999) then359 if (tau(j,ibox) > (tauchk)) then 360 if (transmax(j) > 0.001 .and. transmax(j) <= 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) .gt.260.) then365 if (tb(j,ibox) > 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) .gt.tauchk)375 where(tau(1:npoints,ibox) > tauchk) 376 376 tb(1:npoints,ibox)= 1307.27_wp/ (log(1. + (1._wp/fluxtop(1:npoints,ibox)))) 377 where (isccp_top_height .eq. 1 .and. tauir(1:npoints) .lt.taumin(1:npoints))377 where (isccp_top_height == 1 .and. tauir(1:npoints) < 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) .le. tauchk)384 where(tau(1:npoints,ibox) <= 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 .eq. 1 .or. isccp_top_height .eq. 3) then401 if (isccp_top_height == 1 .or. isccp_top_height == 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 .eq. 2)406 ilev = merge(nlev-k1,k1,isccp_top_height_direction == 2) 407 407 do j=1,npoints 408 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)))) then408 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)))) 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) .ge.1) then420 if (nmatch(j) >= 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)) .lt.abs(pfull(j,k2)-ptop(j,ibox)))428 levmatch(j,ibox) = merge(k1,k2,abs(pfull(j,k1)-ptop(j,ibox)) < abs(pfull(j,k2)-ptop(j,ibox))) 429 429 else 430 if (tb(j,ibox) .le.attrop(j)) then430 if (tb(j,ibox) <= 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) .ge.atmax(j)) then434 if (tb(j,ibox) >= 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) .eq. 0. ) .and.(frac_out(1:npoints,ibox,ilev) .ne.0))443 where((ptop(1:npoints,ibox) == 0. ) .and.(frac_out(1:npoints,ibox,ilev) /= 0)) 444 444 ptop(1:npoints,ibox)=phalf(1:npoints,ilev) 445 445 levmatch(1:npoints,ibox)=ilev … … 447 447 end do 448 448 end if 449 where(tau(1:npoints,ibox) .le.tauchk)449 where(tau(1:npoints,ibox) <= 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) .gt. (tauchk) .and. ptop(j,ibox) .gt.0.) then463 if (sunlit(j) .eq.1 .or. isccp_top_height .eq.3) then462 if (tau(j,ibox) > (tauchk) .and. ptop(j,ibox) > 0.) then 463 if (sunlit(j)==1 .or. isccp_top_height == 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 .eq. 1 .or. isccp_top_height .eq.3) then510 if (isccp_top_height == 1 .or. isccp_top_height == 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) .eq.1 .or. isccp_top_height .eq. 3) then537 if (sunlit(j)==1 .or. isccp_top_height == 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 .eq. 1 .or. isccp_top_height .eq.3)548 where(sunlit == 1 .or. isccp_top_height == 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) .gt. tauchk .and. boxptop(j,1:ncol) .gt.0.)563 box_cloudy2(1:ncol) = merge(.true.,.false.,boxtau(j,1:ncol) > tauchk .and. boxptop(j,1:ncol) > 0.) 564 564 565 565 ! Compute joint histogram and column quantities for points that are sunlit and cloudy 566 if (sunlit(j) .eq.1 .or. isccp_top_height .eq. 3) then566 if (sunlit(j) ==1 .or. isccp_top_height == 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) .gt.isccp_taumin))/ncol574 totalcldarea(j) = real(count(box_cloudy2(1:ncol) .and. boxtau(j,1:ncol) > 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) .gt.isccp_taumin)579 where(box_cloudy2(1:ncol) .and. boxtau(j,1:ncol) > 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) .gt.isccp_taumin)/ncol589 meanptop(j) = sum(boxptop(j,1:ncol),box_cloudy2(1:ncol) .and. boxtau(j,1:ncol) > 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) .gt.0)594 where(totalcldarea(1:npoints) > 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 .ne.output_missing_value) totalcldarea = totalcldarea*100._wp612 where(fq_isccp .ne.output_missing_value) fq_isccp = fq_isccp*100._wp611 where(totalcldarea /= output_missing_value) totalcldarea = totalcldarea*100._wp 612 where(fq_isccp /= 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,:) .eq.1)636 where(flag(:,j,:) == 1) 637 637 varOUT(:,j,:) = varIN2 638 638 endwhere 639 where(flag(:,j,:) .eq.2)639 where(flag(:,j,:) == 2) 640 640 varOUT(:,j,:) = varIN1 641 641 endwhere -
LMDZ6/branches/Amaury_dev/libf/phylmd/cospv2/lidar_simulator.F90
r3491 r5082 231 231 ! Computation of the total perpendicular lidar signal (ATBperp for liq+ice) 232 232 ! Upper layer 233 WHERE(tautot(1:npoints,icol,1) .gt.0)233 WHERE(tautot(1:npoints,icol,1) > 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) .eq.0)253 WHERE (pnorm(1:npoints,icol,k) == 0) 254 254 pnorm_perp_tot(1:npoints,icol,k)=0._wp 255 255 ELSEWHERE 256 where(tautot_lay(1:npoints) .gt.0.)256 where(tautot_lay(1:npoints) > 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 .eq.'calipso') lcalipso=.true.361 if (platform .eq.'atlid') latlid=.true.362 if (platform .eq.'grlidar532') lgrlidar532=.true.360 if (platform == 'calipso') lcalipso=.true. 361 if (platform == 'atlid') latlid=.true. 362 if (platform == '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 .lt. xmax) .and. (betamolFlip(:,1,:) .lt.xmax) .and. &403 (betamolFlip(:,1,:) .gt.0.0 ))402 where ((pnorm_c < xmax) .and. (betamolFlip(:,1,:) < xmax) .and. & 403 (betamolFlip(:,1,:) > 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 .lt.xmax) .and. (pmol.lt.xmax) .and. (pmol.gt.0.0 ))431 where ((pnorm_c<xmax) .and. (pmol<xmax) .and. (pmol> 0.0 )) 432 432 x3d_c = pnorm_c/pmol 433 433 elsewhere … … 463 463 enddo 464 464 enddo 465 where(cfad2 .ne.R_UNDEF) cfad2=cfad2/ncol465 where(cfad2 /= 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(:) .gt.0.)503 WHERE (tautot_lay(:) > 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)) .gt.epsrealwp )532 WHERE (tautot_lay(:) .gt.0.)531 WHERE ( EXP(-2._wp*tau(:,k-1)) > epsrealwp ) 532 WHERE (tautot_lay(:) > 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) .gt. S_cld) .and. (x(:,:,k) .ne.undef) )652 where ((x(:,:,k) > S_cld) .and. (x(:,:,k) /= undef) ) 653 653 cldy(:,:,k)=1._wp 654 654 elsewhere … … 657 657 658 658 ! Number of usefull sub-columns: 659 where ((x(:,:,k) .gt. S_att) .and. (x(:,:,k) .ne.undef) )659 where ((x(:,:,k) > S_att) .and. (x(:,:,k) /= 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) .gt.0.)then679 if(srok(ip,ic,k)>0.)then 680 680 do itemp=1,Ntemp 681 if( (tmp(ip,k) .ge.tempmod(itemp)).and.(tmp(ip,k).lt.tempmod(itemp+1)) )then681 if( (tmp(ip,k)>=tempmod(itemp)).and.(tmp(ip,k)<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) .eq.1.)then687 if(cldy(ip,ic,k)==1.)then 688 688 do itemp=1,Ntemp 689 if( (tmp(ip,k) .ge. tempmod(itemp)).and.(tmp(ip,k) .lt.tempmod(itemp+1)) )then689 if( (tmp(ip,k) >= tempmod(itemp)).and.(tmp(ip,k) < 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 .gt.0. .and. p1.lt.(440._wp*100._wp)) then ! high clouds697 if ( p1>0. .and. p1<(440._wp*100._wp)) then ! high clouds 698 698 iz=3 699 else if(p1 .ge.(440._wp*100._wp) .and. p1.lt.(680._wp*100._wp)) then ! mid clouds699 else if(p1>=(440._wp*100._wp) .and. p1<(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(:,:) .gt.0.0 )716 where ( nsub(:,:)>0.0 ) 717 717 lidarcld(:,:) = lidarcld(:,:)/nsub(:,:) 718 718 elsewhere … … 729 729 enddo 730 730 enddo 731 where (nsublayer(:,:) .gt.0.0)731 where (nsublayer(:,:) > 0.0) 732 732 cldlayer(:,:) = cldlayer(:,:)/nsublayer(:,:) 733 733 elsewhere … … 748 748 749 749 ! Avoid zero values 750 if( (cldy(i,ncol,nlev) .eq.1.) .and. (ATBperp(i,ncol,nlev).gt.0.) )then750 if( (cldy(i,ncol,nlev)==1.) .and. (ATBperp(i,ncol,nlev)>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) .ge.0.)then ! Ice clouds758 if((ATBperp(i,ncol,nlev)-ATBperp_tmp) >= 0.)then ! Ice clouds 759 759 760 760 ! ICE with temperature above 273,15°K = Liquid (false ice) 761 if(tmp(i,nlev) .gt.273.15) then ! Temperature above 273,15 K761 if(tmp(i,nlev) > 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 .gt. 0. .and. p1.lt.(440._wp*100._wp)) then ! high cloud769 if (p1 > 0. .and. p1<(440._wp*100._wp)) then ! high cloud 770 770 cldlayphase(i,ncol,3,2) = 1._wp 771 else if(p1 .ge. (440._wp*100._wp) .and. p1 .lt.(680._wp*100._wp)) then ! mid cloud771 else if(p1 >= (440._wp*100._wp) .and. p1 < (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 .gt. 0. .and. p1 .lt. (440._wp*100._wp)) then778 if (p1 > 0. .and. p1 < (440._wp*100._wp)) then 779 779 cldlayphase(i,ncol,3,5) = 1._wp 780 780 ! Middle cloud 781 else if(p1 .ge. (440._wp*100._wp) .and. p1 .lt.(680._wp*100._wp)) then781 else if(p1 >= (440._wp*100._wp) .and. p1 < (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 .gt. 0. .and. p1 .lt. (440._wp*100._wp)) then793 if (p1 > 0. .and. p1 < (440._wp*100._wp)) then 794 794 cldlayphase(i,ncol,3,1) = 1._wp 795 795 ! Middle cloud 796 else if(p1 .ge. (440._wp*100._wp) .and. p1 .lt. (680._wp*100._wp)) then796 else if(p1 >= (440._wp*100._wp) .and. p1 < (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) .gt.231.15_wp) then808 if(tmp(i,nlev) > 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 .gt. 0. .and. p1 .lt.(440._wp*100._wp)) then813 if (p1 > 0. .and. p1 < (440._wp*100._wp)) then 814 814 cldlayphase(i,ncol,3,2) = 1._wp 815 815 ! Middle cloud 816 else if(p1 .ge. (440._wp*100._wp) .and. p1 .lt.(680._wp*100._wp)) then816 else if(p1 >= (440._wp*100._wp) .and. p1 < (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 .gt. 0. .and. p1 .lt.(440._wp*100._wp)) then829 if (p1 > 0. .and. p1 < (440._wp*100._wp)) then 830 830 cldlayphase(i,ncol,3,4) = 1._wp 831 831 ! Middle cloud 832 else if(p1 .ge. (440._wp*100._wp) .and. p1 .lt.(680._wp*100._wp)) then832 else if(p1 >= (440._wp*100._wp) .and. p1 < (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 .gt. 0. .and. p1 .lt.(440._wp*100._wp)) then840 if (p1 > 0. .and. p1 < (440._wp*100._wp)) then 841 841 cldlayphase(i,ncol,3,1) = 1._wp 842 842 ! Middle cloud 843 else if(p1 .ge. (440._wp*100._wp) .and. p1 .lt.(680._wp*100._wp)) then843 else if(p1 >= (440._wp*100._wp) .and. p1 < (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) .eq. 1.) .and. (ATBperp(i,ncol,nlev) .gt.0.) )then861 if((cldy(i,ncol,nlev) == 1.) .and. (ATBperp(i,ncol,nlev) > 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) .ge.0.)then ! Ice clouds871 if(tmp(i,nlev) .gt.273.15)then870 if((ATBperp(i,ncol,nlev)-ATBperp_tmp) >= 0.)then ! Ice clouds 871 if(tmp(i,nlev) > 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 .gt. 0. .and. p1 .lt. (440._wp*100._wp)) then877 if (p1 > 0. .and. p1 < (440._wp*100._wp)) then 878 878 cldlayphase(i,ncol,3,2) = 1._wp 879 879 ! Middle cloud 880 else if(p1 .ge. (440._wp*100._wp) .and. p1 .lt. (680._wp*100._wp)) then880 else if(p1 >= (440._wp*100._wp) .and. p1 < (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 .gt. 0. .and. p1 .lt.(440._wp*100._wp)) then889 if (p1 > 0. .and. p1 < (440._wp*100._wp)) then 890 890 cldlayphase(i,ncol,3,5) = 1._wp 891 891 ! Middle cloud 892 else if(p1 .ge. (440._wp*100._wp) .and. p1 .lt.(680._wp*100._wp)) then892 else if(p1 >= (440._wp*100._wp) .and. p1 < (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 .gt. 0. .and. p1 .lt.(440._wp*100._wp)) then904 if (p1 > 0. .and. p1 < (440._wp*100._wp)) then 905 905 cldlayphase(i,ncol,3,1) = 1._wp 906 906 ! Middle cloud 907 else if(p1 .ge. (440._wp*100._wp) .and. p1 .lt.(680._wp*100._wp)) then907 else if(p1 >= (440._wp*100._wp) .and. p1 <(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) .gt.231.15)then920 if(tmp(i,nlev) > 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 .gt. 0. .and. p1 .lt.(440._wp*100._wp)) then925 if (p1 > 0. .and. p1 < (440._wp*100._wp)) then 926 926 cldlayphase(i,ncol,3,2) = 1._wp 927 927 ! Middle cloud 928 else if(p1 .ge. (440._wp*100._wp) .and. p1 .lt.(680._wp*100._wp)) then928 else if(p1 >= (440._wp*100._wp) .and. p1 < (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 .gt. 0. .and. p1 .lt.(440._wp*100._wp)) then941 if (p1 > 0. .and. p1 < (440._wp*100._wp)) then 942 942 cldlayphase(i,ncol,3,4) = 1._wp 943 943 ! Middle 944 else if(p1 .ge. (440._wp*100._wp) .and. p1 .lt.(680._wp*100._wp)) then944 else if(p1 >= (440._wp*100._wp) .and. p1 < (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 .gt. 0. .and. p1 .lt.(440._wp*100._wp)) then953 if (p1 > 0. .and. p1 < (440._wp*100._wp)) then 954 954 cldlayphase(i,ncol,3,1) = 1._wp 955 955 ! Middle cloud 956 else if(p1 .ge. (440._wp*100._wp) .and. p1 .lt.(680._wp*100._wp)) then956 else if(p1 >= (440._wp*100._wp) .and. p1 < (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) .gt.S_cld_att) then ! SR > 30.968 if(x(i,ncol,nlev) > 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 .ne.0) then980 if(toplvlsat/=0) then 981 981 do nlev = toplvlsat,Nlevels 982 982 p1 = pplay(i,nlev) 983 if(cldy(i,ncol,nlev) .eq.1.)then983 if(cldy(i,ncol,nlev)==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 .gt. 0. .and. p1 .lt.(440._wp*100._wp)) then988 if (p1 > 0. .and. p1 < (440._wp*100._wp)) then 989 989 cldlayphase(i,ncol,3,3) = 1._wp 990 990 ! Middle cloud 991 else if(p1 .ge. (440._wp*100._wp) .and. p1 .lt.(680._wp*100._wp)) then991 else if(p1 >= (440._wp*100._wp) .and. p1 < (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(:,:) .gt.0.)1010 WHERE (lidarcldphasetmp(:,:) > 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(:,:) .gt. 0.0 )1018 WHERE (nsub(:,:) > 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(:,:) .gt.0.)1051 WHERE (cldlayerphasetmp(:,:)> 0.) 1052 1052 cldlayerphase(:,:,6)=cldlayerphase(:,:,1)/cldlayerphasetmp(:,:) 1053 1053 ELSEWHERE … … 1056 1056 1057 1057 do i=1,Nphase-1 1058 WHERE ( cldlayerphasesum(:,:) .gt.0.0 )1058 WHERE ( cldlayerphasesum(:,:)>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) .gt.0.0 )then1067 if (cldlayerphasesum(i,iz) > 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 .gt. 0.01) .or. (checkcldlayerphase2 .lt.-0.01) ) print *, checkcldlayerphase,cldlayer(i,iz)1072 if((checkcldlayerphase2 > 0.01) .or. (checkcldlayerphase2 < -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(:,:) .eq.0.0)1078 WHERE (nsublayer(:,:) == 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) .gt.0.)then1089 if((tmpi(i,ncol,nlev) .ge. tempmod(itemp)) .and. (tmpi(i,ncol,nlev) .lt.tempmod(itemp+1)) )then1088 if(tmpi(i,ncol,nlev)>0.)then 1089 if((tmpi(i,ncol,nlev) >= tempmod(itemp)) .and. (tmpi(i,ncol,nlev) < 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) .gt.0.)then1093 if((tmpl(i,ncol,nlev) .ge. tempmod(itemp)) .and. (tmpl(i,ncol,nlev) .lt.tempmod(itemp+1)) )then1092 elseif(tmpl(i,ncol,nlev) > 0.)then 1093 if((tmpl(i,ncol,nlev) >= tempmod(itemp)) .and. (tmpl(i,ncol,nlev) < 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) .gt.0.)then1097 if((tmpu(i,ncol,nlev) .ge. tempmod(itemp)) .and. (tmpu(i,ncol,nlev) .lt.tempmod(itemp+1)) )then1096 elseif(tmpu(i,ncol,nlev) > 0.)then 1097 if((tmpu(i,ncol,nlev) >= tempmod(itemp)) .and. (tmpu(i,ncol,nlev) < 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(:,:) .gt.0.)1120 WHERE(sumlidarcldtemp(:,:) > 0.) 1121 1121 lidarcldtemp(:,:,5)=lidarcldtemp(:,:,2)/sumlidarcldtemp(:,:) 1122 1122 ELSEWHERE … … 1125 1125 1126 1126 do i=1,4 1127 WHERE(lidarcldtempind(:,:) .gt.0.)1127 WHERE(lidarcldtempind(:,:) > 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) .gt. S_cld) .and. (x(:,:,k) .ne.undef) )1195 where ((x(:,:,k) > S_cld) .and. (x(:,:,k) /= undef) ) 1196 1196 cldy(:,:,k)=1._wp 1197 1197 elsewhere … … 1200 1200 1201 1201 ! Number of usefull sub-columns: 1202 where ((x(:,:,k) .gt. S_att) .and. (x(:,:,k) .ne.undef) )1202 where ((x(:,:,k) > S_att) .and. (x(:,:,k) /= undef) ) 1203 1203 srok(:,:,k)=1._wp 1204 1204 elsewhere … … 1216 1216 iz=1 1217 1217 p1 = pplay(ip,k) 1218 if ( p1 .gt.0. .and. p1.lt.(440._wp*100._wp)) then ! high clouds1218 if ( p1>0. .and. p1<(440._wp*100._wp)) then ! high clouds 1219 1219 iz=3 1220 else if(p1 .ge.(440._wp*100._wp) .and. p1.lt.(680._wp*100._wp)) then ! mid clouds1220 else if(p1>=(440._wp*100._wp) .and. p1<(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(:,:) .gt.0.0 )1237 where ( nsub(:,:)>0.0 ) 1238 1238 lidarcld(:,:) = lidarcld(:,:)/nsub(:,:) 1239 1239 elsewhere … … 1250 1250 enddo 1251 1251 enddo 1252 where (nsublayer(:,:) .gt.0.0)1252 where (nsublayer(:,:) > 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) .gt. S_cld) .and. (x(:,:,k) .ne.undef) )1346 where ( (x(:,:,k) > S_cld) .and. (x(:,:,k) /= 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) .lt. S_att_opaq) .and. (x(:,:,k) .ge. 0.) .and. (x(:,:,k) .ne.undef) ) !DEBUG1352 where ( (x(:,:,k) < S_att_opaq) .and. (x(:,:,k) >= 0.) .and. (x(:,:,k) /= 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) .gt. S_att) .and. (x(:,:,k) .ne.undef) )1360 where ( (x(:,:,k) > S_att) .and. (x(:,:,k) /= 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) .ge. 0.) .and. (x(:,:,k) .ne.undef) ) !DEBUG1366 where ( (x(:,:,k) >= 0.) .and. (x(:,:,k) /= 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) .gt. 0. .and. cldlay(ip,ic,1) .eq.0. ) then1399 if ( cldlay(ip,ic,4)> 0. .and. cldlay(ip,ic,1) == 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) .eq.1. ) then1406 if ( cldlay(ip,ic,1) == 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) .eq. 1. .and. zopac .eq.0. ) then1412 if ( cldy(ip,ic,Nlevels-k) == 1. .and. zopac == 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) .eq.1. ) then1418 if ( cldy(ip,ic,Nlevels-k) == 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 .ne. 0) then1425 if (zopac /= 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) .eq.1. ) then1437 if ( cldlay(ip,ic,2) == 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) .eq. 1. .and. topcloud .eq.1. ) then1444 if ( cldy(ip,ic,k) == 1. .and. topcloud == 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) .eq. 1. .and. topcloud .eq.0. ) then1448 if ( cldy(ip,ic,k) == 1. .and. topcloud == 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) .gt. S_att_opaq) .and. (x(ip,ic,k) .lt. 1.0) .and. (x(ip,ic,k) .ne.undef) ) then1460 if ( (x(ip,ic,k) > S_att_opaq) .and. (x(ip,ic,k) < 1.0) .and. (x(ip,ic,k) /= 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 .gt.0. ) then1466 if ( srcount > 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(:,:) .gt.0. )1486 where ( nsub(:,:) > 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(:,:) .gt.0. )1494 where ( nsubopaq(:,:) > 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) .ne. undef) .and. (lidarcldtype(ip,k-1,4) .ne.undef) ) then1504 if ( (lidarcldtype(ip,k,3) /= undef) .and. (lidarcldtype(ip,k-1,4) /= 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) .gt.0.)1522 where (cldtype(:,1) > 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) .gt.0.) ! thin cloud1536 where (cldtype(:,2) > 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(:) .gt.0.) ! thin cloud1547 where (count_emis(:) > 0.) ! thin cloud 1548 1548 cldthinemis(:) = cldthinemis(:)/count_emis(:) 1549 1549 elsewhere … … 1551 1551 endwhere 1552 1552 1553 where (nsublayer(:,:) .gt.0.)1553 where (nsublayer(:,:) > 0.) 1554 1554 cldtype(:,:) = cldtype(:,:)/nsublayer(:,:) 1555 1555 elsewhere -
LMDZ6/branches/Amaury_dev/libf/phylmd/cospv2/lmdz_cosp_interface.F90
r4619 r5082 275 275 cfg%Lisccp, cfg%Lmisr, cfg%Lmodis, cfg%Lrttov 276 276 277 if (overlaplmdz .ne.overlap) then277 if (overlaplmdz/=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 .eq.0) then284 if (cosp_init_flag == 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 .ge.1).and.(first_write))then313 if ((itap>=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 .eq.0) then317 if (cosp_init_flag == 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) .ge.0.5) then386 if (fracTerLic(ip)>=0.5) then 387 387 land(ip) = 1. 388 388 else … … 424 424 425 425 426 if (cosp_init_flag .eq.1) then ! cosp_init_flag = 1426 if (cosp_init_flag == 1) then ! cosp_init_flag = 1 427 427 428 428 !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% … … 538 538 endif ! debut_cosp 539 539 540 if (cosp_init_flag .eq.1) then540 if (cosp_init_flag == 1) then 541 541 542 542 !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -
LMDZ6/branches/Amaury_dev/libf/phylmd/cospv2/lmdz_cosp_output_write_mod.F90
r4619 r5082 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 .eq.nvertp(iff)) THEN732 IF (nvertsave==nvertp(iff)) THEN 733 733 klevs=PARASOL_NREFL 734 734 nam_axvert="sza" 735 ELSE IF (nvertsave .eq.nvertisccp(iff)) THEN735 ELSE IF (nvertsave==nvertisccp(iff)) THEN 736 736 klevs=7 737 737 nam_axvert="pressure2" 738 ELSE IF (nvertsave .eq.nvertcol(iff)) THEN738 ELSE IF (nvertsave==nvertcol(iff)) THEN 739 739 klevs=Ncolout 740 740 nam_axvert="column" 741 ELSE IF (nvertsave .eq.nverttemp(iff)) THEN741 ELSE IF (nvertsave==nverttemp(iff)) THEN 742 742 klevs=LIDAR_NTEMP 743 743 nam_axvert="temp" 744 ELSE IF (nvertsave .eq.nvertmisr(iff)) THEN744 ELSE IF (nvertsave==nvertmisr(iff)) THEN 745 745 klevs=numMISRHgtBins 746 746 nam_axvert="cth16" 747 ELSE IF (nvertsave .eq.nvertReffIce(iff)) THEN747 ELSE IF (nvertsave==nvertReffIce(iff)) THEN 748 748 klevs= numMODISReffIceBins 749 749 nam_axvert="ReffIce" 750 ELSE IF (nvertsave .eq.nvertReffLiq(iff)) THEN750 ELSE IF (nvertsave==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
r4619 r5082 896 896 ! i = i+1 !si on laisse, 108 au lieu de 107 897 897 898 if (i .gt.107) then898 if (i>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
r3491 r5082 98 98 logical :: cmpGases=.true. 99 99 100 if (Ncolumns .gt.1) then100 if (Ncolumns > 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 .gt.1) seed=int((cospstateIN%phalf(:,Nlevels+1)-minval(cospstateIN%phalf(:,Nlevels+1)))/ &109 if (NPoints > 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) .eq.1) frac_ls(j,k) = frac_ls(j,k)+1._wp148 if (cospIN%frac_out(j,i,k) .eq.2) frac_cv(j,k) = frac_cv(j,k)+1._wp149 if (frac_prec(j,i,k) .eq.1) prec_ls(j,k) = prec_ls(j,k)+1._wp150 if (frac_prec(j,i,k) .eq.2) prec_cv(j,k) = prec_cv(j,k)+1._wp151 if (frac_prec(j,i,k) .eq.3) prec_cv(j,k) = prec_cv(j,k)+1._wp152 if (frac_prec(j,i,k) .eq.3) prec_ls(j,k) = prec_ls(j,k)+1._wp147 if (cospIN%frac_out(j,i,k) == 1) frac_ls(j,k) = frac_ls(j,k)+1._wp 148 if (cospIN%frac_out(j,i,k) == 2) frac_cv(j,k) = frac_cv(j,k)+1._wp 149 if (frac_prec(j,i,k) == 1) prec_ls(j,k) = prec_ls(j,k)+1._wp 150 if (frac_prec(j,i,k) == 2) prec_cv(j,k) = prec_cv(j,k)+1._wp 151 if (frac_prec(j,i,k) == 3) prec_cv(j,k) = prec_cv(j,k)+1._wp 152 if (frac_prec(j,i,k) == 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) .ne.0.) then219 if (frac_ls(j,k) /= 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) .ne.0.) then223 if (frac_cv(j,k) /= 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) .ne.0.) then229 if (prec_ls(j,k) /= 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) .ne.0.) then234 if (prec_cv(j,k) /= 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) .ne.0.) then239 if (prec_ls(j,k) /= 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) .ne.0.) then244 if (prec_cv(j,k) /= 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 .eq.1)) then363 if (cospIN%rcfg_cloudsat%use_gas_abs == 1 .or. (cospIN%rcfg_cloudsat%use_gas_abs == 2 .and. j == 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 … … 379 379 380 380 ! At each model level, what fraction of the precipitation is frozen? 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)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) 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/mo_rng.F90
r3491 r5082 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) .le.31) then98 if (digits(testInt) <= 31) then 99 99 !if (sizeof(testInt) .eq. 4) then 100 100 r=r+1 -
LMDZ6/branches/Amaury_dev/libf/phylmd/cospv2/parasol.F90
r3491 r5082 97 97 98 98 ! Relative fraction of the opt. thick due to liquid or ice clouds 99 WHERE (tautot_S(1:npoints) .gt.0.)99 WHERE (tautot_S(1:npoints) > 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) .ge.PARASOL_TAU(ny).and. &121 tautot_S(1:npoints) .le.PARASOL_TAU(ny+1))120 WHERE (tautot_S(1:npoints) >= PARASOL_TAU(ny).and. & 121 tautot_S(1:npoints) <= 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
r3491 r5082 64 64 65 65 cv_col = scops_ccfrac*ncol 66 if (cv_col .eq.0) cv_col=166 if (cv_col == 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) .eq. 1) then83 if (frac_out(j,ibox,ilev) == 1) then 84 84 flag_ls=1 85 85 endif 86 if (frac_out(j,ibox,ilev) .eq. 2) then86 if (frac_out(j,ibox,ilev) == 2) then 87 87 flag_cv=1 88 88 endif 89 89 enddo !loop over nlev 90 if (flag_ls .eq.1) then90 if (flag_ls == 1) then 91 91 frac_out_ls(j,ibox)=1 92 92 endif 93 if (flag_cv .eq.1) then93 if (flag_cv == 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) .gt. 0.) then104 if (ls_p_rate(j,1) > 0.) then 105 105 do ibox=1,ncol ! possibility ONE 106 if (frac_out(j,ibox,1) .eq. 1) then106 if (frac_out(j,ibox,1) == 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 .eq.0) then ! possibility THREE111 if (flag_ls == 0) then ! possibility THREE 112 112 do ibox=1,ncol 113 if (frac_out(j,ibox,2) .eq. 1) then113 if (frac_out(j,ibox,2) == 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 .eq.0) then ! possibility Four120 do ibox=1,ncol 121 if (frac_out_ls(j,ibox) .eq. 1) then119 if (flag_ls == 0) then ! possibility Four 120 do ibox=1,ncol 121 if (frac_out_ls(j,ibox) == 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 .eq.0) then ! possibility Five127 if (flag_ls == 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) .gt. 0.) then136 if (cv_p_rate(j,1) > 0.) then 137 137 do ibox=1,ncol ! possibility ONE 138 if (frac_out(j,ibox,1) .eq. 2) then139 if (prec_frac(j,ibox,1) .eq.0) then138 if (frac_out(j,ibox,1) == 2) then 139 if (prec_frac(j,ibox,1) == 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 .eq.0) then ! possibility THREE148 do ibox=1,ncol 149 if (frac_out(j,ibox,2) .eq. 2) then150 if (prec_frac(j,ibox,1) .eq.0) then147 if (flag_cv == 0) then ! possibility THREE 148 do ibox=1,ncol 149 if (frac_out(j,ibox,2) == 2) then 150 if (prec_frac(j,ibox,1) == 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 .eq.0) then ! possibility Four160 do ibox=1,ncol 161 if (frac_out_cv(j,ibox) .eq. 1) then162 if (prec_frac(j,ibox,1) .eq.0) then159 if (flag_cv == 0) then ! possibility Four 160 do ibox=1,ncol 161 if (frac_out_cv(j,ibox) == 1) then 162 if (prec_frac(j,ibox,1) == 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 .eq.0) then ! possibility Five171 if (flag_cv == 0) then ! possibility Five 172 172 do ibox=1,cv_col 173 if (prec_frac(j,ibox,1) .eq.0) then173 if (prec_frac(j,ibox,1) == 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) .gt. 0.) then194 if (ls_p_rate(j,ilev) > 0.) then 195 195 do ibox=1,ncol ! possibility ONE&TWO 196 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))) then196 if ((frac_out(j,ibox,ilev) == 1) .or. ((prec_frac(j,ibox,ilev-1) == 1) & 197 .or. (prec_frac(j,ibox,ilev-1) == 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 .eq. 0) .and. (ilev .lt.nlev)) then ! possibility THREE203 do ibox=1,ncol 204 if (frac_out(j,ibox,ilev+1) .eq. 1) then202 if ((flag_ls == 0) .and. (ilev < nlev)) then ! possibility THREE 203 do ibox=1,ncol 204 if (frac_out(j,ibox,ilev+1) == 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 .eq.0) then ! possibility Four211 do ibox=1,ncol 212 if (frac_out_ls(j,ibox) .eq. 1) then210 if (flag_ls == 0) then ! possibility Four 211 do ibox=1,ncol 212 if (frac_out_ls(j,ibox) == 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 .eq.0) then ! possibility Five218 if (flag_ls == 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) .gt. 0.) then226 if (cv_p_rate(j,ilev) > 0.) then 227 227 do ibox=1,ncol ! possibility ONE&TWO 228 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))) then230 if (prec_frac(j,ibox,ilev) .eq.0) then228 if ((frac_out(j,ibox,ilev) == 2) .or. ((prec_frac(j,ibox,ilev-1) == 2) & 229 .or. (prec_frac(j,ibox,ilev-1) == 3))) then 230 if (prec_frac(j,ibox,ilev) == 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 .eq. 0) .and. (ilev .lt.nlev)) then ! possibility THREE239 do ibox=1,ncol 240 if (frac_out(j,ibox,ilev+1) .eq. 2) then241 if (prec_frac(j,ibox,ilev) .eq.0) then238 if ((flag_cv == 0) .and. (ilev < nlev)) then ! possibility THREE 239 do ibox=1,ncol 240 if (frac_out(j,ibox,ilev+1) == 2) then 241 if (prec_frac(j,ibox,ilev) == 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 .eq.0) then ! possibility Four251 do ibox=1,ncol 252 if (frac_out_cv(j,ibox) .eq. 1) then253 if (prec_frac(j,ibox,ilev) .eq.0) then250 if (flag_cv == 0) then ! possibility Four 251 do ibox=1,ncol 252 if (frac_out_cv(j,ibox) == 1) then 253 if (prec_frac(j,ibox,ilev) == 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 .eq. 0) then ! possibility Five262 if (flag_cv == 0) then ! possibility Five 263 263 do ibox=1,cv_col 264 if (prec_frac(j,ibox,ilev) .eq.0) then264 if (prec_frac(j,ibox,ilev) == 0) then 265 265 prec_frac(j,ibox,ilev) = 2 266 266 else
Note: See TracChangeset
for help on using the changeset viewer.