diff --git a/build/Makefile b/build/Makefile index e3d4172904..069274ad45 100644 --- a/build/Makefile +++ b/build/Makefile @@ -72,13 +72,14 @@ driver_COSP1.4: # Dependencies for libary cosp.o : cosp_kinds.o cosp_modis_interface.o cosp_constants.o cosp_rttov_interfaceSTUB.o \ cosp_misr_interface.o cosp_isccp_interface.o cosp_calipso_interface.o \ - cosp_cloudsat_interface.o cosp_stats.o cosp_parasol_interface.o cosp_rttovSTUB.o \ + cosp_cloudsat_interface.o cosp_stats.o \ + cosp_parasol_interface.o cosp_rttovSTUB.o \ cosp_rttov_interfaceSTUB.o quickbeam.o MISR_simulator.o lidar_simulator.o \ parasol.o icarus.o cosp_grLidar532_interface.o cosp_atlid_interface.o cosp_constants.o : cosp_kinds.o cosp_config.o : cosp_kinds.o cosp_errorHandling.o : cosp_kinds.o -cosp_stats.o : cosp_kinds.o cosp_config.o +cosp_stats.o : cosp_kinds.o cosp_config.o cosp_constants.o cosp_isccp_interface.o : cosp_kinds.o icarus.o icarus.o : cosp_kinds.o cosp_constants.o cosp_stats.o cosp_misr_interface.o : cosp_kinds.o diff --git a/driver/run/cosp2_output_nl.txt b/driver/run/cosp2_output_nl.txt old mode 100644 new mode 100755 index 2b918b8564..7f39228c71 --- a/driver/run/cosp2_output_nl.txt +++ b/driver/run/cosp2_output_nl.txt @@ -145,5 +145,8 @@ Lptradarflag7=.true., Lptradarflag8=.true., Lptradarflag9=.true., - Lradarpia=.true. + Lradarpia=.true., + !- CloudSat+MODIS joint diagnostics + Lwr_occfreq=.true., + Lcfodd=.true. / diff --git a/driver/src/cosp2_io.f90 b/driver/src/cosp2_io.f90 index eb202a3fcd..289e1cb43f 100644 --- a/driver/src/cosp2_io.f90 +++ b/driver/src/cosp2_io.f90 @@ -7,7 +7,9 @@ module mod_cosp_io tau_binEdges,npres, pres_binBounds, pres_binCenters, pres_binEdges, nhgt, & hgt_binBounds, hgt_binCenters, hgt_binEdges, reffLIQ_binCenters,vgrid_z, & reffICE_binCenters, reffLIQ_binCenters, cloudsat_binCenters, PARASOL_SZA, & - calipso_binCenters, grLidar532_binCenters, atlid_binCenters + calipso_binCenters, grLidar532_binCenters, atlid_binCenters, & + CFODD_NDBZE, CFODD_HISTDBZE, CFODD_HISTDBZEcenters, & + CFODD_NICOD, CFODD_HISTICOD, CFODD_HISTICODcenters implicit none contains @@ -73,6 +75,10 @@ subroutine write_cosp2_output(Npoints, Ncolumns, Nlevels, lev, lon, lat, cospOUT if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) status = nf90_def_dim(fileID,"REICE_MODIS",numMODISReffIceBins,dimID(16)) if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) + status = nf90_def_dim(fileID,"CFODD_NDBZE",CFODD_NDBZE,dimID(17)) + if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) + status = nf90_def_dim(fileID,"CFODD_NICOD",CFODD_NICOD,dimID(18)) + if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) ! --------------------------------------------------------------------------------------- ! Define varaibles @@ -1339,7 +1345,77 @@ subroutine write_cosp2_output(Npoints, Ncolumns, Nlevels, lev, lon, lat, cospOUT status = nf90_put_att(fileID,varID(139),"standard_name", "cloud_area_fraction") if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) endif - + ! warm-rain occurrence frequency diagnostics + if (associated(cospOUT%wr_occfreq_ntotal)) then + status = nf90_def_var(fileID,"npdfcld",nf90_float, (/dimID(1)/),varID(140)) + if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) + status = nf90_put_att(fileID,varID(140),"long_name","# of Non-Precipitating Clouds") + if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) + status = nf90_put_att(fileID,varID(140),"units", "1") + if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) + status = nf90_put_att(fileID,varID(140),"standard_name", "number_of_slwc_nonprecip") + if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) + status = nf90_def_var(fileID,"npdfdrz",nf90_float, (/dimID(1)/),varID(141)) + if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) + status = nf90_put_att(fileID,varID(141),"long_name","# of Drizzling Clouds") + if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) + status = nf90_put_att(fileID,varID(141),"units", "1") + if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) + status = nf90_put_att(fileID,varID(141),"standard_name", "number_of_slwc_drizzle") + if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) + status = nf90_def_var(fileID,"npdfrain",nf90_float, (/dimID(1)/),varID(142)) + if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) + status = nf90_put_att(fileID,varID(142),"long_name","# of Precipitating Clouds") + if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) + status = nf90_put_att(fileID,varID(142),"units", "1") + if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) + status = nf90_put_att(fileID,varID(142),"standard_name", "number_of_slwc_precip") + if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) + endif + ! Contoured Frequency by Optical Depth Diagram (CFODD) + if (associated(cospOUT%cfodd_ntotal)) then + status = nf90_def_var(fileID,"ncfodd1",nf90_float, (/dimID(1),dimID(17),dimID(18)/),varID(143)) + if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) + status = nf90_put_att(fileID,varID(143),"long_name","# of CFODD (05 < Reff < 12 micron)") + if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) + status = nf90_put_att(fileID,varID(143),"units", "1") + if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) + status = nf90_put_att(fileID,varID(143),"standard_name", "cfodd_reff_small") + if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) + status = nf90_def_var(fileID,"ncfodd2",nf90_float, (/dimID(1),dimID(17),dimID(18)/),varID(144)) + if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) + status = nf90_put_att(fileID,varID(144),"long_name","# of CFODD (12 < Reff < 18 micron)") + if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) + status = nf90_put_att(fileID,varID(144),"units", "1") + if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) + status = nf90_put_att(fileID,varID(144),"standard_name", "cfodd_reff_medium") + if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) + status = nf90_def_var(fileID,"ncfodd3",nf90_float, (/dimID(1),dimID(17),dimID(18)/),varID(145)) + if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) + status = nf90_put_att(fileID,varID(145),"long_name","# of CFODD (18 < Reff < 35 micron)") + if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) + status = nf90_put_att(fileID,varID(145),"units", "1") + if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) + status = nf90_put_att(fileID,varID(145),"standard_name", "cfodd_reff_large") + if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) + !! axes for CFODD + status = nf90_def_var(fileID,"CFODD_NDBZE",nf90_float,(/dimID(17)/),varID(146)) + if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) + status = nf90_put_att(fileID,varID(146),"long_name","CloudSat+MODIS dBZe vs ICOD joint PDF X-axis") + if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) + status = nf90_put_att(fileID,varID(146),"units", "dBZ") + if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) + status = nf90_put_att(fileID,varID(146),"standard_name", "cloudsat_quivalent_reflectivity_factor") + if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) + status = nf90_def_var(fileID,"CFODD_NICOD",nf90_float,(/dimID(18)/),varID(147)) + if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) + status = nf90_put_att(fileID,varID(147),"long_name","CloudSat+MODIS dBZe vs ICOD joint PDF Y-axis") + if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) + status = nf90_put_att(fileID,varID(147),"units", "none") + if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) + status = nf90_put_att(fileID,varID(147),"standard_name", "modis_in-cloud_optical_depth") + if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) + endif ! --------------------------------------------------------------------------------------- ! Exit define mode @@ -1794,6 +1870,30 @@ subroutine write_cosp2_output(Npoints, Ncolumns, Nlevels, lev, lon, lat, cospOUT if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) endif + ! Cloudsat+MODIS Joint simulators output + !! warm-rain occurrence frequency diagnostics + if (associated(cospOUT%wr_occfreq_ntotal)) then + status = nf90_put_var(fileID,varID(140),cospOUT%wr_occfreq_ntotal(:,1)) + if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) + status = nf90_put_var(fileID,varID(141),cospOUT%wr_occfreq_ntotal(:,2)) + if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) + status = nf90_put_var(fileID,varID(142),cospOUT%wr_occfreq_ntotal(:,3)) + if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) + endif + !! Contoured Frequency by Optical Depth Diagram (CFODD) + if (associated(cospOUT%cfodd_ntotal)) then + status = nf90_put_var(fileID,varID(143),cospOUT%cfodd_ntotal(:,:,:,1)) + if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) + status = nf90_put_var(fileID,varID(144),cospOUT%cfodd_ntotal(:,:,:,2)) + if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) + status = nf90_put_var(fileID,varID(145),cospOUT%cfodd_ntotal(:,:,:,3)) + if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) + status = nf90_put_var(fileID,varID(146),CFODD_HISTDBZEcenters) + if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) + status = nf90_put_var(fileID,varID(147),CFODD_HISTICODcenters) + if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) + endif + ! Close file status = nf90_close(fileID) diff --git a/driver/src/cosp2_test.f90 b/driver/src/cosp2_test.f90 old mode 100644 new mode 100755 index 239d003e67..be5b794177 --- a/driver/src/cosp2_test.f90 +++ b/driver/src/cosp2_test.f90 @@ -30,12 +30,19 @@ ! March 2016 - D. Swales - Original version ! April 2018 - R. Guzman - Added OPAQ diagnostics and Ground LIDar (GLID) simulator ! April 2018 - R. Guzman - Added ATLID simulator +! Nov 2018 - T. Michibata - Added CloudSat+MODIS Warmrain Diagnostics ! %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% program cosp2_test use cosp_kinds, only: wp USE MOD_COSP_CONFIG, ONLY: R_UNDEF,PARASOL_NREFL,LIDAR_NCAT,LIDAR_NTYPE,SR_BINS, & N_HYDRO,RTTOV_MAX_CHANNELS,numMISRHgtBins, & - cloudsat_DBZE_BINS,LIDAR_NTEMP,calipso_histBsct, & + cloudsat_DBZE_BINS,LIDAR_NTEMP,calipso_histBsct, & + CFODD_NDBZE, CFODD_NICOD, & + CFODD_BNDRE, CFODD_NCLASS, & + CFODD_DBZE_MIN, CFODD_DBZE_MAX, & + CFODD_ICOD_MIN, CFODD_ICOD_MAX, & + CFODD_DBZE_WIDTH, CFODD_ICOD_WIDTH, & + WR_NREGIME, & numMODISTauBins,numMODISPresBins, & numMODISReffIceBins,numMODISReffLiqBins, & numISCCPTauBins,numISCCPPresBins,numMISRTauBins, & @@ -189,7 +196,8 @@ program cosp2_test Ltauilogmodis,Lreffclwmodis,Lreffclimodis,Lpctmodis,Llwpmodis,Liwpmodis, & Lclmodis,Ltbrttov,Lptradarflag0,Lptradarflag1,Lptradarflag2,Lptradarflag3, & Lptradarflag4,Lptradarflag5,Lptradarflag6,Lptradarflag7,Lptradarflag8, & - Lptradarflag9,Lradarpia + Lptradarflag9,Lradarpia, & + Lwr_occfreq, Lcfodd namelist/COSP_OUTPUT/Lcfaddbze94,Ldbze94,Latb532,LcfadLidarsr532,Lclcalipso, & Lclhcalipso,Lcllcalipso,Lclmcalipso,Lcltcalipso,LparasolRefl, & Lclcalipsoliq,Lclcalipsoice,Lclcalipsoun,Lclcalipsotmp, & @@ -214,7 +222,8 @@ program cosp2_test Lreffclimodis,Lpctmodis,Llwpmodis,Liwpmodis,Lclmodis,Ltbrttov, & Lptradarflag0,Lptradarflag1,Lptradarflag2,Lptradarflag3, & Lptradarflag4,Lptradarflag5,Lptradarflag6,Lptradarflag7, & - Lptradarflag8,Lptradarflag9,Lradarpia + Lptradarflag8,Lptradarflag9,Lradarpia, & + Lwr_occfreq, Lcfodd ! Local variables logical :: & @@ -382,7 +391,8 @@ program cosp2_test ! Initialize COSP simulator call COSP_INIT(Lisccp, Lmodis, Lmisr, Lcloudsat, Lcalipso, LgrLidar532, Latlid, & - Lparasol, Lrttov, cloudsat_radar_freq, cloudsat_k2, cloudsat_use_gas_abs, & + Lparasol, Lrttov, & + cloudsat_radar_freq, cloudsat_k2, cloudsat_use_gas_abs, & cloudsat_do_ray, isccp_topheight, isccp_topheight_direction, surface_radar, & rcfg_cloudsat, use_vgrid, csat_vgrid, Nlvgrid, Nlevels, cloudsat_micro_scheme) call cpu_time(driver_time(3)) @@ -411,8 +421,9 @@ program cosp2_test Lclcalipsoopacity, Lclopaquetemp, Lclthintemp, Lclzopaquetemp, Lclopaquemeanz, & Lclthinmeanz, Lclthinemis, Lclopaquemeanzse, Lclthinmeanzse, Lclzopaquecalipsose, & LcfadDbze94, Ldbze94, Lparasolrefl, & - Ltbrttov, Lptradarflag0,Lptradarflag1,Lptradarflag2,Lptradarflag3,Lptradarflag4, & - Lptradarflag5,Lptradarflag6,Lptradarflag7,Lptradarflag8,Lptradarflag9,Lradarpia,& + Ltbrttov, Lptradarflag0,Lptradarflag1,Lptradarflag2,Lptradarflag3,Lptradarflag4, & + Lptradarflag5,Lptradarflag6,Lptradarflag7,Lptradarflag8,Lptradarflag9,Lradarpia, & + Lwr_occfreq, Lcfodd, & Npoints, Ncolumns, Nlevels, Nlvgrid_local, rttov_Nchannels, cospOUT) !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -1037,10 +1048,11 @@ subroutine construct_cosp_outputs(Lpctisccp,Lclisccp,& Lclzopaquetemp,Lclopaquemeanz,Lclthinmeanz, & Lclthinemis,Lclopaquemeanzse,Lclthinmeanzse, & Lclzopaquecalipsose,LcfadDbze94,Ldbze94,Lparasolrefl,& - Ltbrttov, Lptradarflag0,Lptradarflag1,Lptradarflag2, & + Ltbrttov, Lptradarflag0,Lptradarflag1,Lptradarflag2, & Lptradarflag3,Lptradarflag4,Lptradarflag5, & Lptradarflag6,Lptradarflag7,Lptradarflag8, & - Lptradarflag9,Lradarpia,Npoints,Ncolumns,Nlevels,Nlvgrid,Nchan,x) + Lptradarflag9,Lradarpia,Lwr_occfreq,Lcfodd, & + Npoints,Ncolumns,Nlevels,Nlvgrid,Nchan,x) ! Inputs logical,intent(in) :: & Lpctisccp, & ! ISCCP mean cloud top pressure @@ -1148,7 +1160,9 @@ subroutine construct_cosp_outputs(Lpctisccp,Lclisccp,& Lptradarflag7, & ! CLOUDSAT Lptradarflag8, & ! CLOUDSAT Lptradarflag9, & ! CLOUDSAT - Lradarpia ! CLOUDSAT + Lradarpia, & ! CLOUDSAT + Lwr_occfreq, & ! CloudSat+MODIS joint diagnostics + Lcfodd ! CloudSat+MODIS joint diagnostics integer,intent(in) :: & Npoints, & ! Number of sampled points @@ -1311,7 +1325,11 @@ subroutine construct_cosp_outputs(Lpctisccp,Lclisccp,& ! RTTOV if (Ltbrttov) allocate(x%rttov_tbs(Npoints,Nchan)) - + + ! Joint MODIS/CloudSat Statistics + if (Lwr_occfreq) allocate(x%wr_occfreq_ntotal(Npoints,WR_NREGIME)) + if (Lcfodd) allocate(x%cfodd_ntotal(Npoints,CFODD_NDBZE,CFODD_NICOD,CFODD_NCLASS)) + end subroutine construct_cosp_outputs !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -1690,7 +1708,15 @@ subroutine destroy_cosp_outputs(y) deallocate(y%modis_Optical_thickness_vs_ReffICE) nullify(y%modis_Optical_thickness_vs_ReffICE) endif - + if (associated(y%cfodd_ntotal)) then + deallocate(y%cfodd_ntotal) + nullify(y%cfodd_ntotal) + endif + if (associated(y%wr_occfreq_ntotal)) then + deallocate(y%wr_occfreq_ntotal) + nullify(y%wr_occfreq_ntotal) + endif + end subroutine destroy_cosp_outputs end program cosp2_test diff --git a/src/cosp.F90 b/src/cosp.F90 old mode 100644 new mode 100755 index 92580f65ff..caccf62cbf --- a/src/cosp.F90 +++ b/src/cosp.F90 @@ -30,6 +30,7 @@ ! May 2015- D. Swales - Original version ! Mar 2018- R. Guzman - Added OPAQ diagnostics and GLID simulator ! Apr 2018- R. Guzman - Added ATLID simulator +! Nov 2018- T. Michibata - Added CloudSat+MODIS Warmrain Diagnostics ! ! %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -39,7 +40,9 @@ MODULE MOD_COSP USE MOD_COSP_CONFIG, ONLY: R_UNDEF,PARASOL_NREFL,LIDAR_NCAT,LIDAR_NTYPE, SR_BINS,& N_HYDRO,RTTOV_MAX_CHANNELS,numMISRHgtBins, & cloudsat_DBZE_BINS,LIDAR_NTEMP,calipso_histBsct,& - use_vgrid,Nlvgrid,vgrid_zu,vgrid_zl,vgrid_z, & + use_vgrid,Nlvgrid,vgrid_zu,vgrid_zl,vgrid_z,dz, & + WR_NREGIME, CFODD_NCLASS, & + CFODD_NDBZE, CFODD_NICOD, & numMODISTauBins,numMODISPresBins, & numMODISReffIceBins,numMODISReffLiqBins, & numISCCPTauBins,numISCCPPresBins,numMISRTauBins,& @@ -63,7 +66,8 @@ MODULE MOD_COSP USE MOD_MODIS_SIM, ONLY: modis_subcolumn, modis_column USE MOD_PARASOL, ONLY: parasol_subcolumn, parasol_column use mod_cosp_rttov, ONLY: rttov_column - USE MOD_COSP_STATS, ONLY: COSP_LIDAR_ONLY_CLOUD,COSP_CHANGE_VERTICAL_GRID + USE MOD_COSP_STATS, ONLY: COSP_LIDAR_ONLY_CLOUD,COSP_CHANGE_VERTICAL_GRID, & + COSP_DIAG_WARMRAIN IMPLICIT NONE @@ -288,6 +292,12 @@ MODULE MOD_COSP real(wp),pointer :: & rttov_tbs(:,:) => null() ! Brightness Temperature + ! Joint CloudSat+MODIS simulators outputs + real(wp),dimension(:,:,:,:),pointer :: & + cfodd_ntotal => null() ! # of CFODD (Npoints,CFODD_NDBZE,CFODD_NICOD,CFODD_NCLASS) + real(wp),dimension(:,:), pointer :: & + wr_occfreq_ntotal => null() ! # of nonprecip/drizzle/precip (Npoints,WR_NREGIME) + end type cosp_outputs CONTAINS @@ -318,6 +328,7 @@ function COSP_SIMULATOR(cospIN,cospgridIN,cospOUT,start_idx,stop_idx,debug) ! Local variables integer :: & i,icol,ij,ik,nError + integer :: k integer,target :: & Npoints logical :: & @@ -348,7 +359,7 @@ function COSP_SIMULATOR(cospIN,cospgridIN,cospOUT,start_idx,stop_idx,debug) ok_lidar_cfad_grLidar532 = .false., & ok_lidar_cfad_atlid = .false., & lrttov_cleanUp = .false. - + integer, dimension(:,:),allocatable :: & modisRetrievedPhase,isccpLEVMATCH real(wp), dimension(:), allocatable :: & @@ -372,6 +383,13 @@ function COSP_SIMULATOR(cospIN,cospgridIN,cospOUT,start_idx,stop_idx,debug) out1D_9,out1D_10,out1D_11,out1D_12 real(wp),dimension(:,:,:),allocatable :: & betamol_in,betamoli,pnormi,ze_toti,ze_noni + real(wp),dimension(:,:,:),allocatable :: & + t_in,tmpFlip,ze_totFlip + real(wp), allocatable :: & + zlev (:,:), & ! altitude (used only when use_vgrid=.true.) + delz (:,:), & ! delta Z + cfodd_ntotal (:,:,:,:), & ! # of total samples for CFODD (Npoints,CFODD_NDBZE,CFODD_NICOD,CFODD_NCLASS) + wr_occfreq_ntotal(:,:) ! # of warm-rain (nonprecip/drizzle/precip) (Npoints,WR_NREGIME) ! Initialize error reporting for output cosp_simulator(:)='' @@ -580,6 +598,14 @@ function COSP_SIMULATOR(cospIN,cospgridIN,cospOUT,start_idx,stop_idx,debug) Lcloudsat_tcc2 = .true. endif + ! CloudSat+MODIS joint simulator product + if ( associated(cospOUT%cfodd_ntotal) .or. associated(cospOUT%wr_occfreq_ntotal) ) then + Lmodis_column = .true. + Lmodis_subcolumn = .true. + Lcloudsat_column = .true. + Lcloudsat_subcolumn = .true. + endif + !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ! 2b) Error Checking ! Enforce bounds on input fields. If input field is out-of-bounds, report error @@ -1570,6 +1596,91 @@ function COSP_SIMULATOR(cospIN,cospgridIN,cospOUT,start_idx,stop_idx,debug) endif endif + ! CloudSat/MODIS joint products (CFODDs and Occurrence Frequency of Warm Clouds) + allocate( cfodd_ntotal (cloudsatIN%Npoints, CFODD_NDBZE, CFODD_NICOD, CFODD_NCLASS) ) + allocate( wr_occfreq_ntotal(cloudsatIN%Npoints, WR_NREGIME) ) + + if ( use_vgrid ) then + !! interporation for fixed vertical grid: + allocate( zlev(cloudsatIN%Npoints,Nlvgrid), & + delz(cloudsatIN%Npoints,Nlvgrid), & + t_in(cloudsatIN%Npoints,1,cloudsatIN%Nlevels), & + tmpFlip(cloudsatIN%Npoints,1,Nlvgrid), & + Ze_totFlip(cloudsatIN%Npoints,cloudsatIN%Ncolumns,Nlvgrid) ) + do k = 1, Nlvgrid + zlev(:,k) = vgrid_zu(k) + delz(:,k) = dz(k) + enddo + t_in(:,1,:) = cospgridIN%at(:,:) + call cosp_change_vertical_grid ( & + cloudsatIN%Npoints, 1, cloudsatIN%Nlevels, & + cospgridIN%hgt_matrix(:,cloudsatIN%Nlevels:1:-1), & + cospgridIN%hgt_matrix_half(:,cloudsatIN%Nlevels:1:-1), & + t_in(:,:,cloudsatIN%Nlevels:1:-1), Nlvgrid, & + vgrid_zl(Nlvgrid:1:-1), vgrid_zu(Nlvgrid:1:-1), & + tmpFlip(:,:,Nlvgrid:1:-1) ) + call cosp_change_vertical_grid ( & + cloudsatIN%Npoints, cloudsatIN%Ncolumns, cloudsatIN%Nlevels, & + cospgridIN%hgt_matrix(:,cloudsatIN%Nlevels:1:-1), & + cospgridIN%hgt_matrix_half(:,cloudsatIN%Nlevels:1:-1), & + cloudsatDBZe(:,:,cloudsatIN%Nlevels:1:-1), Nlvgrid, & + vgrid_zl(Nlvgrid:1:-1), vgrid_zu(Nlvgrid:1:-1), & + Ze_totFlip(:,:,Nlvgrid:1:-1), log_units=.true. ) + call cosp_diag_warmrain( cloudsatIN%Npoints, cloudsatIN%Ncolumns, & !! in + Nlvgrid, & !! in + tmpFlip, & !! in + zlev, & !! in + delz, & !! in + cospOUT%modis_Liquid_Water_Path_Mean, & !! in + cospOUT%modis_Optical_Thickness_Water_Mean, & !! in + cospOUT%modis_Cloud_Particle_Size_Water_Mean, & !! in + cospOUT%modis_Cloud_Fraction_Water_Mean, & !! in + cospOUT%modis_Ice_Water_Path_Mean, & !! in + cospOUT%modis_Optical_Thickness_Ice_Mean, & !! in + cospOUT%modis_Cloud_Particle_Size_Ice_Mean, & !! in + cospOUT%modis_Cloud_Fraction_Ice_Mean, & !! in + cospIN%frac_out, & !! in + Ze_totFlip, & !! in + cfodd_ntotal, & !! inout + wr_occfreq_ntotal ) !! inout + deallocate( zlev, delz, t_in, tmpFlip, ze_totFlip ) + else ! do not use vgrid interporation ---------------------------------------! + !! original model grid + allocate( delz(cloudsatIN%Npoints,cospIN%Nlevels) ) + do k = 1, cospIN%Nlevels-1 + delz(:,k) = cospgridIN%hgt_matrix_half(:,k+1) & + - cospgridIN%hgt_matrix_half(:,k) + enddo + delz(:,cospIN%Nlevels) = 2.0*( cospgridIN%hgt_matrix(:,cospIN%Nlevels) & + - cospgridIN%hgt_matrix_half(:,cospIN%Nlevels) ) + call cosp_diag_warmrain( cloudsatIN%Npoints, cloudsatIN%Ncolumns, & !! in + cospIN%Nlevels, & !! in + cospgridIN%at, & !! in + cospgridIN%hgt_matrix, & !! in + delz, & !! in + cospOUT%modis_Liquid_Water_Path_Mean, & !! in + cospOUT%modis_Optical_Thickness_Water_Mean, & !! in + cospOUT%modis_Cloud_Particle_Size_Water_Mean, & !! in + cospOUT%modis_Cloud_Fraction_Water_Mean, & !! in + cospOUT%modis_Ice_Water_Path_Mean, & !! in + cospOUT%modis_Optical_Thickness_Ice_Mean, & !! in + cospOUT%modis_Cloud_Particle_Size_Ice_Mean, & !! in + cospOUT%modis_Cloud_Fraction_Ice_Mean, & !! in + cospIN%frac_out, & !! in + cospOUT%cloudsat_Ze_tot, & !! in + cfodd_ntotal, & !! inout + wr_occfreq_ntotal ) !! inout + deallocate( delz ) + endif !! use_vgrid or not + + ! Store, when necessary + if ( associated(cospOUT%cfodd_ntotal) ) then + cospOUT%cfodd_ntotal(ij:ik,:,:,:) = cfodd_ntotal + endif + if ( associated(cospOUT%wr_occfreq_ntotal) ) then + cospOUT%wr_occfreq_ntotal(ij:ik,:) = wr_occfreq_ntotal + endif + !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ! 7) Cleanup !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -1631,6 +1742,8 @@ function COSP_SIMULATOR(cospIN,cospgridIN,cospOUT,start_idx,stop_idx,debug) if (allocated(radar_lidar_tcc)) deallocate(radar_lidar_tcc) if (allocated(cloudsat_tcc)) deallocate(cloudsat_tcc) if (allocated(cloudsat_tcc2)) deallocate(cloudsat_tcc2) + if (allocated(cfodd_ntotal)) deallocate(cfodd_ntotal) + if (allocated(wr_occfreq_ntotal)) deallocate(wr_occfreq_ntotal) end function COSP_SIMULATOR ! ###################################################################################### @@ -1682,7 +1795,7 @@ SUBROUTINE COSP_INIT(Lisccp, Lmodis, Lmisr, Lcloudsat, Lcalipso, LgrLidar532, La if (use_vgrid) then Nlvgrid = Nvgrid - allocate(vgrid_zl(Nlvgrid),vgrid_zu(Nlvgrid),vgrid_z(Nlvgrid)) + allocate(vgrid_zl(Nlvgrid),vgrid_zu(Nlvgrid),vgrid_z(Nlvgrid),dz(Nlvgrid)) ! CloudSat grid requested if (luseCSATvgrid) zstep = 480._wp ! Other grid requested. Constant vertical spacing with top at 20 km @@ -1692,9 +1805,10 @@ SUBROUTINE COSP_INIT(Lisccp, Lmodis, Lmisr, Lcloudsat, Lcalipso, LgrLidar532, La vgrid_zu(Nlvgrid-i+1) = i*zstep enddo vgrid_z = (vgrid_zl+vgrid_zu)/2._wp + dz = zstep else Nlvgrid = Nlevels - allocate(vgrid_zl(Nlvgrid),vgrid_zu(Nlvgrid),vgrid_z(Nlvgrid)) + allocate(vgrid_zl(Nlvgrid),vgrid_zu(Nlvgrid),vgrid_z(Nlvgrid),dz(Nlvgrid)) endif ! Initialize simulators @@ -1717,7 +1831,7 @@ END SUBROUTINE COSP_INIT ! SUBROUTINE cosp_cleanUp !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% subroutine cosp_cleanUp() - deallocate(vgrid_zl,vgrid_zu,vgrid_z) + deallocate(vgrid_zl,vgrid_zu,vgrid_z,dz) end subroutine cosp_cleanUp !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/src/cosp_config.F90 b/src/cosp_config.F90 old mode 100644 new mode 100755 index e5bbadb4e7..14a9cb7b86 --- a/src/cosp_config.F90 +++ b/src/cosp_config.F90 @@ -38,6 +38,7 @@ ! Mar 2016 - D. Swales - Added scops_ccfrac. Was previously hardcoded in prec_scops.f90. ! Mar 2018 - R. Guzman - Added LIDAR_NTYPE for the OPAQ diagnostics ! Apr 2018 - R. Guzman - Added parameters for GROUND LIDAR and ATLID simulators +! Nov 2018 - T. Michibata - Added CloudSat+MODIS Warmrain Diagnostics ! ! %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -288,7 +289,7 @@ MODULE MOD_COSP_CONFIG shape = (/2,CLOUDSAT_DBZE_BINS/)) real(wp),parameter,dimension(CLOUDSAT_DBZE_BINS) :: & cloudsat_binCenters = (cloudsat_binEdges(1,:)+cloudsat_binEdges(2,:))/2._wp - + ! Parameters for Cloudsat near-surface precipitation diagnostics. ! Precipitation classes. integer, parameter :: & @@ -313,7 +314,53 @@ MODULE MOD_COSP_CONFIG ! Level 39 of Nlvgrid(40) is 480-960m. integer, parameter :: & cloudsat_preclvl = 39 - + + ! #################################################################################### + ! CLOUDSAT and MODIS joint product information (2018.11.22) + ! #################################################################################### + ! @ COSP_DIAG_WARMRAIN: + integer, parameter :: CFODD_NCLASS = 3 ! # of classes for CFODD (classified by MODIS Reff) + integer, parameter :: WR_NREGIME = 3 ! # of warm-rain regimes (non-precip/drizzling/raining) + integer, parameter :: SGCLD_CLR = 0 ! sub-grid cloud ID (fracout): clear-sky + integer, parameter :: SGCLD_ST = 1 ! sub-grid cloud ID (fracout): stratiform + integer, parameter :: SGCLD_CUM = 2 ! sub-grid cloud ID (fracout): cumulus + real(wp),parameter :: CWP_THRESHOLD = 0.00 ! cloud water path threshold + real(wp),parameter :: COT_THRESHOLD = 0.30 ! cloud optical thickness threshold + real(wp),parameter,dimension(CFODD_NCLASS+1) :: & + CFODD_BNDRE = (/5.0e-6, 12.0e-6, 18.0e-6, 35.0e-6/) ! Reff bnds + real(wp),parameter,dimension(2) :: & + CFODD_BNDZE = (/-15.0, 0.0/) ! dBZe bnds (cloud/drizzle/precip) + real(wp),parameter :: CFODD_DBZE_MIN = -30.0 ! Minimum value of CFODD dBZe bin + real(wp),parameter :: CFODD_DBZE_MAX = 20.0 ! Maximum value of CFODD dBZe bin + real(wp),parameter :: CFODD_ICOD_MIN = 0.0 ! Minimum value of CFODD ICOD bin + real(wp),parameter :: CFODD_ICOD_MAX = 60.0 ! Maximum value of CFODD ICOD bin + real(wp),parameter :: CFODD_DBZE_WIDTH = 2.0 ! Bin width (dBZe) + real(wp),parameter :: CFODD_ICOD_WIDTH = 2.0 ! Bin width (ICOD) + integer,parameter :: & + CFODD_NDBZE = INT( (CFODD_DBZE_MAX-CFODD_DBZE_MIN)/CFODD_DBZE_WIDTH ) ! Number of CFODD dBZe bins + integer,parameter :: & + CFODD_NICOD = INT( (CFODD_ICOD_MAX-CFODD_ICOD_MIN)/CFODD_ICOD_WIDTH ) ! Number of CFODD ICOD bins + real(wp),parameter,dimension(CFODD_NDBZE+1) :: & + CFODD_HISTDBZE = (/int(CFODD_DBZE_MIN),(/(i, i=int(CFODD_DBZE_MIN+CFODD_DBZE_WIDTH), & + int(CFODD_DBZE_MIN+(CFODD_NDBZE-1)*CFODD_DBZE_WIDTH), & + int(CFODD_DBZE_WIDTH))/),int(CFODD_DBZE_MAX)/) + real(wp),parameter,dimension(CFODD_NICOD+1) :: & + CFODD_HISTICOD = (/int(CFODD_ICOD_MIN),(/(i, i=int(CFODD_ICOD_MIN+CFODD_ICOD_WIDTH), & + int(CFODD_ICOD_MIN+(CFODD_NICOD-1)*CFODD_ICOD_WIDTH), & + int(CFODD_ICOD_WIDTH))/),int(CFODD_ICOD_MAX)/) + real(wp),parameter,dimension(2,CFODD_NDBZE) :: & + CFODD_HISTDBZEedges = reshape(source=(/CFODD_HISTDBZE(1),((CFODD_HISTDBZE(k), & + l=1,2),k=2,CFODD_NDBZE),CFODD_HISTDBZE(CFODD_NDBZE+1)/), & + shape = (/2,CFODD_NDBZE/)) + real(wp),parameter,dimension(CFODD_NDBZE) :: & + CFODD_HISTDBZEcenters = (CFODD_HISTDBZEedges(1,:)+CFODD_HISTDBZEedges(2,:))/2._wp + real(wp),parameter,dimension(2,CFODD_NICOD) :: & + CFODD_HISTICODedges = reshape(source=(/CFODD_HISTICOD(1),((CFODD_HISTICOD(k), & + l=1,2),k=2,CFODD_NICOD),CFODD_HISTICOD(CFODD_NICOD+1)/), & + shape = (/2,CFODD_NICOD/)) + real(wp),parameter,dimension(CFODD_NICOD) :: & + CFODD_HISTICODcenters = (CFODD_HISTICODedges(1,:)+CFODD_HISTICODedges(2,:))/2._wp + ! #################################################################################### ! Parameters used by the CALIPSO LIDAR simulator ! #################################################################################### @@ -404,6 +451,7 @@ MODULE MOD_COSP_CONFIG real(wp),dimension(:),allocatable :: & vgrid_zl, & ! New grid bottoms vgrid_zu, & ! New grid tops - vgrid_z ! New grid center + vgrid_z, & ! New grid center + dz ! dZ END MODULE MOD_COSP_CONFIG diff --git a/src/cosp_constants.F90 b/src/cosp_constants.F90 old mode 100644 new mode 100755 diff --git a/src/cosp_stats.F90 b/src/cosp_stats.F90 old mode 100644 new mode 100755 index 7545acb0a9..068b9ea150 --- a/src/cosp_stats.F90 +++ b/src/cosp_stats.F90 @@ -36,10 +36,24 @@ ! Jan 2013 - G. Cesana - Added betaperp and temperature arguments ! - Added phase 3D/3Dtemperature/Map output variables in diag_lidar ! May 2015 - D. Swales - Modified for cosp2.0 +! Nov 2018 - T. Michibata - Added CloudSat+MODIS Warmrain Diagnostics ! %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% MODULE MOD_COSP_STATS USE COSP_KINDS, ONLY: wp - USE MOD_COSP_CONFIG, ONLY: R_UNDEF,R_GROUND + USE MOD_COSP_CONFIG, & + ONLY: R_UNDEF, R_GROUND, & + SGCLD_CLR, SGCLD_ST, & + SGCLD_CUM, & + CWP_THRESHOLD, COT_THRESHOLD, & + CFODD_NDBZE, CFODD_NICOD, & + CFODD_BNDRE, CFODD_BNDZE, & + CFODD_NCLASS, & + CFODD_DBZE_MIN, CFODD_DBZE_MAX, & + CFODD_ICOD_MIN, CFODD_ICOD_MAX, & + CFODD_DBZE_WIDTH, CFODD_ICOD_WIDTH, & + CFODD_HISTDBZE, CFODD_HISTICOD, & + WR_NREGIME + USE COSP_PHYS_CONSTANTS, ONLY: tmelt IMPLICIT NONE CONTAINS @@ -247,6 +261,183 @@ SUBROUTINE COSP_LIDAR_ONLY_CLOUD(Npoints, Ncolumns, Nlevels, beta_tot, beta_mol, END SUBROUTINE COSP_LIDAR_ONLY_CLOUD + !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + !----------------------- SUBROUTINE COSP_DIAG_WARMRAIN ------------------------ + ! (c) 2018, Research Institute for Applied Mechanics (RIAM), Kyushu Univ. + ! All rights reserved. + ! * Purpose: 1) Diagnose Contoured Frequency by Optical Depth Diagram (CFODD) + ! from CloudSat Radar and MODIS retrievals. + ! 2) Diagnose Warm-Rain Occurrence Frequency (nonprecip/drizzle/rain) + ! from CloudSat Radar. + ! * History: 2018.01.25 (T.Michibata): Test run + ! 2018.05.17 (T.Michibata): update for COSP2 + ! 2018.09.19 (T.Michibata): modified I/O + ! 2018.11.22 (T.Michibata): minor revisions + ! * References: Suzuki et al. (JAS'10, JAS'11, JGR'13, GRL'13, JAS'15) + ! Jing et al. (JGR'17); Jing and Suzuki (GRL'18) + ! Kay et al. (JGR'18) + ! Michibata et al. (ACP'14) + ! * Contact: Takuro Michibata (RIAM, Kyushu University, Japan). + ! E-mail: michibata@riam.kyushu-u.ac.jp + !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + SUBROUTINE COSP_DIAG_WARMRAIN( Npoints, Ncolumns, Nlevels, & !! in + temp, zlev, delz, & !! in + lwp, liqcot, liqreff, liqcfrc, & !! in + iwp, icecot, icereff, icecfrc, & !! in + fracout, dbze, & !! in + cfodd_ntotal, & !! inout + wr_occfreq_ntotal ) !! inout + + ! Inputs + integer, intent(in) :: & + Npoints, & ! Number of horizontal gridpoints + Ncolumns, & ! Number of subcolumns + Nlevels ! Number of vertical layers + real(wp), dimension(Npoints), intent(in) :: & + lwp, & ! MODIS LWP [kg m-2] + liqcot, & ! MODIS liq. COT + liqreff, & ! MODIS liq. Reff [m] + liqcfrc ! MODIS liq. cloud fraction + real(wp), dimension(Npoints), intent(in) :: & + iwp, & ! MODIS IWP [kg m-2] + icecot, & ! MODIS ice COT + icereff, & ! MODIS ice Reff [m] + icecfrc ! MODIS ice cloud fraction + real(wp), dimension(Npoints,Nlevels), intent(in) :: & + zlev, & ! altitude [m] for model level + delz ! delta Z [m] (= zlevm(k+1)-zlemv(k)) + real(wp), dimension(Npoints,1,Nlevels),intent(in) :: & + temp ! temperature [K] + real(wp), dimension(Npoints,Ncolumns,Nlevels),intent(in) :: & + fracout, & ! SCOPS subcolumn retrieval + dbze ! Radar reflectivity [dBZe] + + ! Outputs + real(wp),dimension(Npoints,CFODD_NDBZE,CFODD_NICOD,CFODD_NCLASS),intent(inout) :: & + cfodd_ntotal ! # of CFODD samples for each ICOD/dBZe bin + real(wp),dimension(Npoints,WR_NREGIME),intent(inout) :: & + wr_occfreq_ntotal ! # of SLWC samples + + ! Local variables + integer :: i, j, k + integer :: ix, iy + integer :: kctop, kcbtm + integer :: icls + integer :: iregime + real :: cmxdbz + real(wp) :: diagcgt !! diagnosed cloud geometric thickness [m] + real(wp) :: diagdbze !! diagnosed dBZe + real(wp) :: diagicod !! diagnosed in-cloud optical depth + real(wp) :: cbtmh !! diagnosed in-cloud optical depth + real(wp), dimension(Npoints,Ncolumns,Nlevels) :: icod !! in-cloud optical depth (ICOD) + logical :: octop, ocbtm, oslwc + + + !! initialize + cfodd_ntotal(:,:,:,:) = 0._wp + wr_occfreq_ntotal(:,:) = 0._wp + icod(:,:,:) = 0._wp + + do i = 1, Npoints + !! check by MODIS retrieval + if ( lwp(i) .le. CWP_THRESHOLD .or. & + & liqcot(i) .le. COT_THRESHOLD .or. & + & liqreff(i) .lt. CFODD_BNDRE(1) .or. & + & liqreff(i) .gt. CFODD_BNDRE(4) .or. & + & iwp(i) .gt. CWP_THRESHOLD .or. & !! exclude ice cloud + & icecot(i) .gt. COT_THRESHOLD .or. & !! exclude ice cloud + & icereff(i) .gt. CFODD_BNDRE(1) ) then !! exclude ice cloud + cycle + else + !! retrieve the CFODD array based on Reff + icls = 0 + if ( liqreff(i) .ge. CFODD_BNDRE(1) .and. liqreff(i) .lt. CFODD_BNDRE(2) ) then + icls = 1 + elseif( liqreff(i) .ge. CFODD_BNDRE(2) .and. liqreff(i) .lt. CFODD_BNDRE(3) ) then + icls = 2 + elseif( liqreff(i) .ge. CFODD_BNDRE(3) .and. liqreff(i) .le. CFODD_BNDRE(4) ) then + icls = 3 + endif + endif + + !CDIR NOLOOPCHG + do j = 1, Ncolumns, 1 + octop = .true. !! initialize + ocbtm = .true. !! initialize + kcbtm = 0 !! initialize + kctop = 0 !! initialize + !CDIR NOLOOPCHG + do k = Nlevels, 1, -1 !! scan from cloud-bottom to cloud-top + if ( dbze(i,j,k) .eq. R_GROUND .or. & + dbze(i,j,k) .eq. R_UNDEF ) cycle + if ( ocbtm .and. & + & fracout(i,j,k) .ne. SGCLD_CLR .and. & + & dbze(i,j,k) .ge. CFODD_DBZE_MIN ) then + ocbtm = .false. !! cloud bottom detected + kcbtm = k + kctop = k + endif + if ( octop .and. & !! scan cloud-top + & .not. ocbtm .and. & !! cloud-bottom already detected + & fracout(i,j,k) .ne. SGCLD_CLR .and. & !! exclude clear sky + & dbze(i,j,k) .ge. CFODD_DBZE_MIN ) then + kctop = k !! update + endif + enddo !! k loop + if( ocbtm ) cycle !! cloud wasn't detected in this subcolumn + !! check SLWC? + if( temp(i,1,kctop) .lt. tmelt ) cycle !! return to the j (subcolumn) loop + oslwc = .true. + cmxdbz = CFODD_DBZE_MIN !! initialized + + !CDIR NOLOOPCHG + do k = kcbtm, kctop, -1 + cmxdbz = max( cmxdbz, dbze(i,j,k) ) !! column maximum dBZe update + if ( fracout(i,j,k) .eq. SGCLD_CLR .or. & + & fracout(i,j,k) .eq. SGCLD_CUM .or. & + & dbze (i,j,k) .lt. CFODD_DBZE_MIN ) then + oslwc = .false. + endif + enddo + if ( .not. oslwc ) cycle !! return to the j (subcolumn) loop + + !! warm-rain occurrence frequency + iregime = 0 + if( cmxdbz .lt. CFODD_BNDZE(1) ) then + iregime = 1 !! non-precipitating + elseif( cmxdbz .ge. CFODD_BNDZE(1) .and. cmxdbz .lt. CFODD_BNDZE(2) ) then + iregime = 2 !! drizzling + elseif( cmxdbz .ge. CFODD_BNDZE(2) ) then + iregime = 3 !! raining + endif + wr_occfreq_ntotal(i,iregime) = wr_occfreq_ntotal(i,iregime) + 1._wp + + !! retrievals of ICOD and dBZe bin for CFODD plane + diagcgt = zlev(i,kctop) - zlev(i,kcbtm) + cbtmh = zlev(i,kcbtm) + !CDIR NOLOOPCHG + do k = kcbtm, kctop, -1 + if( k .eq. kcbtm ) then + diagicod = liqcot(i) + else + diagicod = liqcot(i) * ( 1._wp - ( (zlev(i,k)-cbtmh)/diagcgt)**(5._wp/3._wp) ) + endif + icod(i,j,k) = min( diagicod, CFODD_ICOD_MAX ) + enddo + + enddo ! j (Ncolumns) + + !! # of samples for CFODD (joint 2d-histogram dBZe vs ICOD) + call hist2d( dbze(i,1:Ncolumns,1:Nlevels), icod(i,1:Ncolumns,1:Nlevels), & + & Ncolumns*Nlevels, & + & CFODD_HISTDBZE, CFODD_NDBZE, CFODD_HISTICOD, CFODD_NICOD, & + & cfodd_ntotal( i, 1:CFODD_NDBZE, 1:CFODD_NICOD, icls ) ) + + enddo ! i (Npoints) + + RETURN + END SUBROUTINE COSP_DIAG_WARMRAIN + ! ###################################################################################### ! FUNCTION hist1D ! ######################################################################################