diff --git a/build/Makefile b/build/Makefile index 1ec31c0d2a..e3d4172904 100644 --- a/build/Makefile +++ b/build/Makefile @@ -26,7 +26,7 @@ VPATH += $(DRIVER) # Makefile.conf needs to define $(F90), $(F90FLAGS), $(NC_LIB), $(NC_INC) include Makefile.conf F90FLAGS += $(NC_INC) -LDFLAGS += $(NC_LIB) -lnetcdff -lnetcdf +LDFLAGS += $(NC_LIB) -lnetcdff LDFLAGS += -L. -lcosp -lsubcol @@ -43,15 +43,11 @@ LDFLAGS += -L. -lcosp -lsubcol # # The COSP library # -COSP_OBJS = cosp.o cosp_config.o cosp_stats.o \ - cosp_constants.o cosp_errorHandling.o cosp_kinds.o \ - cosp_isccp_interface.o icarus.o \ - cosp_misr_interface.o MISR_simulator.o \ - cosp_modis_interface.o modis_simulator.o \ - cosp_parasol_interface.o parasol.o \ - cosp_calipso_interface.o lidar_simulator.o \ - cosp_cloudsat_interface.o quickbeam.o \ - cosp_rttov_interfaceSTUB.o cosp_rttovSTUB.o +COSP_OBJS = cosp.o cosp_config.o cosp_stats.o cosp_constants.o cosp_errorHandling.o cosp_kinds.o \ + cosp_isccp_interface.o icarus.o cosp_misr_interface.o MISR_simulator.o \ + cosp_modis_interface.o modis_simulator.o cosp_parasol_interface.o parasol.o \ + cosp_calipso_interface.o lidar_simulator.o cosp_cloudsat_interface.o quickbeam.o \ + cosp_rttov_interfaceSTUB.o cosp_rttovSTUB.o cosp_grLidar532_interface.o cosp_atlid_interface.o LIBRARY = libcosp.a @@ -74,29 +70,31 @@ driver_COSP1.4: mv cosp1_test ../driver/run # 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_rttov_interfaceSTUB.o \ - quickbeam.o MISR_simulator.o lidar_simulator.o parasol.o icarus.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_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 -MISR_simulator.o : cosp_kinds.o cosp_config.o cosp_stats.o -cosp_modis_interface.o : cosp_kinds.o cosp_config.o modis_simulator.o -modis_simulator.o : cosp_kinds.o cosp_config.o cosp_stats.o -cosp_parasol_interface.o : cosp_kinds.o -parasol.o : cosp_kinds.o cosp_config.o cosp_constants.o -cosp_calipso_interface.o : cosp_kinds.o lidar_simulator.o -lidar_simulator.o : cosp_kinds.o cosp_config.o cosp_stats.o -cosp_cloudsat_interface.o : cosp_kinds.o cosp_config.o quickbeam.o -quickbeam.o : cosp_kinds.o cosp_stats.o -cosp_rttov_interfaceSTUB.o: cosp_kinds.o cosp_config.o cosp_rttovSTUB.o -cosp_rttovSTUB.o : cosp_kinds.o cosp_config.o cosp_constants.o +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_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_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 +MISR_simulator.o : cosp_kinds.o cosp_config.o cosp_stats.o +cosp_modis_interface.o : cosp_kinds.o cosp_config.o modis_simulator.o +modis_simulator.o : cosp_kinds.o cosp_config.o cosp_stats.o +cosp_parasol_interface.o : cosp_kinds.o +parasol.o : cosp_kinds.o cosp_config.o cosp_constants.o +cosp_calipso_interface.o : cosp_kinds.o lidar_simulator.o +lidar_simulator.o : cosp_kinds.o cosp_config.o cosp_stats.o +cosp_grLidar532_interface.o : cosp_kinds.o +cosp_atlid_interface.o : cosp_kinds.o +cosp_cloudsat_interface.o : cosp_kinds.o cosp_config.o quickbeam.o +quickbeam.o : cosp_kinds.o cosp_stats.o +cosp_rttov_interfaceSTUB.o : cosp_kinds.o cosp_config.o cosp_rttovSTUB.o +cosp_rttovSTUB.o : cosp_kinds.o cosp_config.o cosp_constants.o # Example subcolumn generaton and mapping to optical properties, following COSP 1.4 SUBCOL_OBJS = mo_rng.o scops.o prec_scops.o cosp_utils.o cosp_optics.o quickbeam_optics.o array_lib.o math_lib.o mrgrnk.o optics_lib.o cosp_errorHandling.o diff --git a/build/Makefile.conf b/build/Makefile.conf index a23625cc79..1a7d8633cb 100644 --- a/build/Makefile.conf +++ b/build/Makefile.conf @@ -1,6 +1,9 @@ F90 = ifort F90FLAGS = -O3 -F90_LIB = /usr/local/ifort +#F90_LIB = /usr/local/ifort +F90_LIB = /homedata/gcesana/local/ifort NC_INC = -I$(F90_LIB)/include -NC_LIB = -L$(F90_LIB)/lib \ No newline at end of file +NC_LIB = -L$(F90_LIB)/lib +NCDF_INC = /opt/netcdf43/ifort/include +NCDF_LIB = /opt/netcdf43/ifort/lib diff --git a/driver/run/cosp2_output_nl.txt b/driver/run/cosp2_output_nl.txt index 179f27c7b6..27e3abb9e8 100644 --- a/driver/run/cosp2_output_nl.txt +++ b/driver/run/cosp2_output_nl.txt @@ -58,6 +58,41 @@ Lcllcalipsoun=.true., Lclmcalipsoun=.true., Lcltcalipsoun=.true., + ! CALIPSO OPAQ diagnostics + Lclopaquecalipso=.true., + Lclthincalipso=.true., + Lclzopaquecalipso=.true., + Lclcalipsoopaque=.true., + Lclcalipsothin=.true., + Lclcalipsozopaque=.true., + Lclcalipsoopacity=.true., + Lclopaquetemp=.true., + Lclthintemp=.true., + Lclzopaquetemp=.true., + Lclopaquemeanz=.true., + Lclthinmeanz=.true., + Lclthinemis=.true., + Lclopaquemeanzse=.true., + Lclthinmeanzse=.true., + Lclzopaquecalipsose=.true., + ! GROUND LIDAR diagnostics + LlidarBetaMol532gr=.true., + LcfadLidarsr532gr=.true., + Latb532gr=.true., + LclgrLidar532=.true., + LclhgrLidar532=.true., + LcllgrLidar532=.true., + LclmgrLidar532=.true., + LcltgrLidar532=.true., + ! ATLID diagnostics + LlidarBetaMol355=.true., + LcfadLidarsr355=.true., + Latb355=.true., + Lclatlid=.true., + Lclhatlid=.true., + Lcllatlid=.true., + Lclmatlid=.true., + Lcltatlid=.true., !- ISCCP Lalbisccp=.true., Lboxptopisccp=.true., diff --git a/driver/src/cosp2_io.f90 b/driver/src/cosp2_io.f90 index 5a7c93e8cd..dc7e435253 100644 --- a/driver/src/cosp2_io.f90 +++ b/driver/src/cosp2_io.f90 @@ -7,7 +7,7 @@ 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 + calipso_binCenters, grLidar532_binCenters, atlid_binCenters implicit none contains @@ -469,6 +469,369 @@ subroutine write_cosp2_output(Npoints, Ncolumns, Nlevels, lev, lon, lat, cospOUT if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) endif + !OPAQ diagnostics + if (associated(cospOUT%calipso_cldtype)) then + ! Opaque cloud cover + status = nf90_def_var(fileID,"clopaquecalipso",nf90_float, (/dimID(1)/),varID(91)) + if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) + status = nf90_put_att(fileID,varID(91),"long_name","CALIPSO Opaque Cloud Cover") + if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) + status = nf90_put_att(fileID,varID(91),"units", "%") + if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) + status = nf90_put_att(fileID,varID(91),"standard_name", "opaque_cloud_cover") + if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) + ! Thin cloud cover + status = nf90_def_var(fileID,"clthincalipso",nf90_float, (/dimID(1)/),varID(92)) + if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) + status = nf90_put_att(fileID,varID(92),"long_name","CALIPSO Thin Cloud Cover") + if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) + status = nf90_put_att(fileID,varID(92),"units", "%") + if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) + status = nf90_put_att(fileID,varID(92),"standard_name", "thin_cloud_cover") + if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) + ! z_opaque altitude + status = nf90_def_var(fileID,"clzopaquecalipso",nf90_float, (/dimID(1)/),varID(93)) + if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) + status = nf90_put_att(fileID,varID(93),"long_name","CALIPSO z_opaque Altitude") + if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) + status = nf90_put_att(fileID,varID(93),"units", "m") + if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) + status = nf90_put_att(fileID,varID(93),"standard_name", "z_opaque") + if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) + endif + !3D cloud fractions + if (associated(cospOUT%calipso_lidarcldtype)) then + ! Opaque profiles cloud fraction + status = nf90_def_var(fileID,"clcalipsoopaque",nf90_float, (/dimID(1),dimID(4)/),varID(94)) + if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) + status = nf90_put_att(fileID,varID(94),"long_name","CALIPSO Opaque Cloud Fraction") + if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) + status = nf90_put_att(fileID,varID(94),"units", "%") + if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) + status = nf90_put_att(fileID,varID(94),"standard_name", "opaque_cloud_area_fraction_in_atmosphere_layer") + if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) + ! Non-Opaque profiles cloud fraction + status = nf90_def_var(fileID,"clcalipsothin",nf90_float, (/dimID(1),dimID(4)/),varID(95)) + if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) + status = nf90_put_att(fileID,varID(95),"long_name","CALIPSO Thin Cloud Fraction") + if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) + status = nf90_put_att(fileID,varID(95),"units", "%") + if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) + status = nf90_put_att(fileID,varID(95),"standard_name", "thin_cloud_area_fraction_in_atmosphere_layer") + if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) + ! z_opaque fraction + status = nf90_def_var(fileID,"clcalipsozopaque",nf90_float, (/dimID(1),dimID(4)/),varID(96)) + if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) + status = nf90_put_att(fileID,varID(96),"long_name","CALIPSO z_opaque Fraction") + if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) + status = nf90_put_att(fileID,varID(96),"units", "%") + if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) + status = nf90_put_att(fileID,varID(96),"standard_name", "z_opaque_fraction_in_atmosphere_layer") + if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) + ! Lidar opacity fraction + status = nf90_def_var(fileID,"clcalipsoopacity",nf90_float, (/dimID(1),dimID(4)/),varID(97)) + if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) + status = nf90_put_att(fileID,varID(97),"long_name","CALIPSO opacity Fraction") + if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) + status = nf90_put_att(fileID,varID(97),"units", "%") + if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) + status = nf90_put_att(fileID,varID(97),"standard_name", "opacity_fraction_in_atmosphere_layer") + if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) + endif + if (associated(cospOUT%calipso_cldtypetemp)) then + ! Opaque cloud temperature + status = nf90_def_var(fileID,"clopaquetemp",nf90_float, (/dimID(1)/),varID(98)) + if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) + status = nf90_put_att(fileID,varID(98),"long_name","CALIPSO Opaque Cloud Temperature") + if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) + status = nf90_put_att(fileID,varID(98),"units", "K") + if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) + status = nf90_put_att(fileID,varID(98),"standard_name", "opaque_cloud_temperature") + if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) + ! Thin cloud temperature + status = nf90_def_var(fileID,"clthintemp",nf90_float, (/dimID(1)/),varID(99)) + if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) + status = nf90_put_att(fileID,varID(99),"long_name","CALIPSO Thin Cloud Temperature") + if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) + status = nf90_put_att(fileID,varID(99),"units", "K") + if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) + status = nf90_put_att(fileID,varID(99),"standard_name", "thin_cloud_temperature") + if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) + ! z_opaque temperature + status = nf90_def_var(fileID,"clzopaquetemp",nf90_float, (/dimID(1)/),varID(100)) + if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) + status = nf90_put_att(fileID,varID(100),"long_name","CALIPSO z_opaque Temperature") + if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) + status = nf90_put_att(fileID,varID(100),"units", "K") + if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) + status = nf90_put_att(fileID,varID(100),"standard_name", "z_opaque_temperature") + if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) + endif + if (associated(cospOUT%calipso_cldtypemeanz)) then + ! Opaque cloud temperature + status = nf90_def_var(fileID,"clopaquemeanz",nf90_float, (/dimID(1)/),varID(101)) + if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) + status = nf90_put_att(fileID,varID(101),"long_name","CALIPSO Opaque Cloud Altitude") + if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) + status = nf90_put_att(fileID,varID(101),"units", "m") + if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) + status = nf90_put_att(fileID,varID(101),"standard_name", "opaque_cloud_altitude") + if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) + ! Thin cloud temperature + status = nf90_def_var(fileID,"clthinmeanz",nf90_float, (/dimID(1)/),varID(102)) + if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) + status = nf90_put_att(fileID,varID(102),"long_name","CALIPSO Thin Cloud Altitude") + if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) + status = nf90_put_att(fileID,varID(102),"units", "m") + if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) + status = nf90_put_att(fileID,varID(102),"standard_name", "thin_cloud_altitude") + if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) + endif + if (associated(cospOUT%calipso_cldthinemis)) then + ! Thin cloud emissivity + status = nf90_def_var(fileID,"clthinemis",nf90_float, (/dimID(1)/),varID(103)) + if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) + status = nf90_put_att(fileID,varID(103),"long_name","CALIPSO Thin Cloud Emissivity") + if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) + status = nf90_put_att(fileID,varID(103),"units", "1") + if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) + status = nf90_put_att(fileID,varID(103),"standard_name", "thin_cloud_emissivity") + if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) + endif + if (associated(cospOUT%calipso_cldtypemeanzse)) then + ! Opaque cloud altitude with respect to Surface Elevation + status = nf90_def_var(fileID,"clopaquemeanzse",nf90_float, (/dimID(1)/),varID(104)) + if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) + status = nf90_put_att(fileID,varID(104),"long_name","CALIPSO Opaque Cloud Altitude with respect to SE") + if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) + status = nf90_put_att(fileID,varID(104),"units", "m") + if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) + status = nf90_put_att(fileID,varID(104),"standard_name", "opaque_cloud_altitude_se") + if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) + ! Thin cloud + status = nf90_def_var(fileID,"clthinmeanzse",nf90_float, (/dimID(1)/),varID(105)) + if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) + status = nf90_put_att(fileID,varID(105),"long_name","CALIPSO Thin Cloud Altitude with respect to SE") + if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) + status = nf90_put_att(fileID,varID(105),"units", "m") + if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) + status = nf90_put_att(fileID,varID(105),"standard_name", "thin_cloud_altitude_se") + if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) + ! z_opaque + status = nf90_def_var(fileID,"clzopaquecalipsose",nf90_float, (/dimID(1)/),varID(106)) + if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) + status = nf90_put_att(fileID,varID(106),"long_name","CALIPSO z_opaque Altitude with respect to SE") + if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) + status = nf90_put_att(fileID,varID(106),"units", "m") + if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) + status = nf90_put_att(fileID,varID(106),"standard_name", "z_opaque_se") + if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) + endif + + !GROUND LIDAR simulator output + if (associated(cospOUT%grLidar532_cldlayer)) then + ! Low-level cloud cover + status = nf90_def_var(fileID,"cllgrLidar532",nf90_float, (/dimID(1)/),varID(107)) + if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) + status = nf90_put_att(fileID,varID(107),"long_name","GROUND LIDAR Low Level Cloud Cover") + if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) + status = nf90_put_att(fileID,varID(107),"units", "%") + if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) + status = nf90_put_att(fileID,varID(107),"standard_name", "grLidar532_low_cloud_cover") + if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) + ! Mid-level cloud cover + status = nf90_def_var(fileID,"clmgrLidar532",nf90_float, (/dimID(1)/),varID(108)) + if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) + status = nf90_put_att(fileID,varID(108),"long_name","GROUND LIDAR Mid Level Cloud Cover") + if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) + status = nf90_put_att(fileID,varID(108),"units", "%") + if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) + status = nf90_put_att(fileID,varID(108),"standard_name", "grLidar532_mid_cloud_cover") + if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) + ! High-level cloud cover + status = nf90_def_var(fileID,"clhgrLidar532",nf90_float, (/dimID(1)/),varID(109)) + if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) + status = nf90_put_att(fileID,varID(109),"long_name","GROUND LIDAR High Level Cloud Cover") + if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) + status = nf90_put_att(fileID,varID(109),"units", "%") + if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) + status = nf90_put_att(fileID,varID(109),"standard_name", "grLidar532_high_cloud_cover") + if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) + ! Total cloud cover + status = nf90_def_var(fileID,"cltgrLidar532",nf90_float, (/dimID(1)/),varID(110)) + if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) + status = nf90_put_att(fileID,varID(110),"long_name","GROUND LIDAR Total Cloud Cover") + if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) + status = nf90_put_att(fileID,varID(110),"units", "%") + if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) + status = nf90_put_att(fileID,varID(110),"standard_name", "grLidar532_total_cloud_cover") + if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) + endif + !3D cloud fraction + if (associated(cospOUT%grLidar532_lidarcld)) then + status = nf90_def_var(fileID,"clgrLidar532",nf90_float, (/dimID(1),dimID(4)/),varID(111)) + if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) + status = nf90_put_att(fileID,varID(111),"long_name","GROUND LIDAR Cloud Fraction") + if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) + status = nf90_put_att(fileID,varID(111),"units", "%") + if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) + status = nf90_put_att(fileID,varID(111),"standard_name", "grLidar532_cloud_area_fraction_in_atmosphere_layer") + if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) + endif + !Molecular backscatter + if (associated(cospOUT%grLidar532_beta_mol)) then + status = nf90_def_var(fileID,"lidarBetaMol532gr",nf90_float, (/dimID(1),dimID(3)/),varID(112)) + if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) + status = nf90_put_att(fileID,varID(112),"long_name","GROUND LIDAR Molecular Backscatter Coefficient (532nm)") + if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) + status = nf90_put_att(fileID,varID(112),"units", "m-1 sr-1") + if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) + status = nf90_put_att(fileID,varID(112),"standard_name", "grLidar532_volume_attenuated_backwards_scattering_function_in_air_assuming_no_aerosol_or_cloud") + if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) + endif + !Height-Intensity histogram (SR) + if (associated(cospOUT%grLidar532_cfad_sr)) then + status = nf90_def_var(fileID,"cfadLidarsr532gr",nf90_float, (/dimID(1),dimID(12),dimID(4)/),varID(113)) + if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) + status = nf90_put_att(fileID,varID(113),"long_name","GROUND LIDAR Scattering Ratio CFAD") + if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) + status = nf90_put_att(fileID,varID(113),"units", "1") + if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) + status = nf90_put_att(fileID,varID(113),"standard_name", "grLidar532_histogram_of_backscattering_ratio_over_height_above_reference_ellipsoid") + if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) + endif + if (associated(cospOUT%grLidar532_beta_tot)) then + status = nf90_def_var(fileID,"atb532gr",nf90_float, (/dimID(1),dimID(2),dimID(3)/),varID(114)) + if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) + status = nf90_put_att(fileID,varID(114),"long_name","GROUND LIDAR Attenuated Total Backscatter (532nm)") + if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) + status = nf90_put_att(fileID,varID(114),"units", "m-1 sr-1") + if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) + status = nf90_put_att(fileID,varID(114),"standard_name", "volume_attenuated_backwards_scattering_function_in_air") + if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) + endif + + if (associated(cospOUT%grLidar532_srbval) .or. associated(cospOUT%grLidar532_cfad_sr)) then + status = nf90_def_var(fileID,"SR_BINS_GR",nf90_float, (/dimID(12)/),varID(115)) + if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) + status = nf90_put_att(fileID,varID(115),"long_name","GROUND LIDAR Backscattering Ratio (SR) Bin Centers") + if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) + status = nf90_put_att(fileID,varID(115),"units", "1") + if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) + status = nf90_put_att(fileID,varID(115),"standard_name", "backscattering_ratio") + if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) + status = nf90_def_var(fileID,"SR_EDGES_GR",nf90_float, (/dimID(6),dimID(12)/),varID(116)) + if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) + status = nf90_put_att(fileID,varID(116),"long_name","GROUND LIDAR Backscattering Ratio (SR) Bin Bounds") + if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) + status = nf90_put_att(fileID,varID(116),"units", "1") + if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) + status = nf90_put_att(fileID,varID(116),"standard_name", "backscattering_ratio") + if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) + endif + + !ATLID simulator output + if (associated(cospOUT%atlid_cldlayer)) then + ! Low-level cloud cover + status = nf90_def_var(fileID,"cllatlid",nf90_float, (/dimID(1)/),varID(117)) + if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) + status = nf90_put_att(fileID,varID(117),"long_name","ATLID Low Level Cloud Cover") + if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) + status = nf90_put_att(fileID,varID(117),"units", "%") + if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) + status = nf90_put_att(fileID,varID(117),"standard_name", "atlid_low_cloud_cover") + if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) + ! Mid-level cloud cover + status = nf90_def_var(fileID,"clmatlid",nf90_float, (/dimID(1)/),varID(118)) + if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) + status = nf90_put_att(fileID,varID(118),"long_name","ATLID Mid Level Cloud Cover") + if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) + status = nf90_put_att(fileID,varID(118),"units", "%") + if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) + status = nf90_put_att(fileID,varID(118),"standard_name", "atlid_mid_cloud_cover") + if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) + ! High-level cloud cover + status = nf90_def_var(fileID,"clhatlid",nf90_float, (/dimID(1)/),varID(119)) + if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) + status = nf90_put_att(fileID,varID(119),"long_name","ATLID High Level Cloud Cover") + if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) + status = nf90_put_att(fileID,varID(119),"units", "%") + if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) + status = nf90_put_att(fileID,varID(119),"standard_name", "atlid_high_cloud_cover") + if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) + ! Total cloud cover + status = nf90_def_var(fileID,"cltatlid",nf90_float, (/dimID(1)/),varID(120)) + if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) + status = nf90_put_att(fileID,varID(120),"long_name","ATLID Total Cloud Cover") + if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) + status = nf90_put_att(fileID,varID(120),"units", "%") + if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) + status = nf90_put_att(fileID,varID(120),"standard_name", "atlid_total_cloud_cover") + if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) + endif + !3D cloud fraction + if (associated(cospOUT%atlid_lidarcld)) then + status = nf90_def_var(fileID,"clatlid",nf90_float, (/dimID(1),dimID(4)/),varID(121)) + if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) + status = nf90_put_att(fileID,varID(121),"long_name","ATLID Cloud Fraction") + if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) + status = nf90_put_att(fileID,varID(121),"units", "%") + if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) + status = nf90_put_att(fileID,varID(121),"standard_name", "atlid_cloud_area_fraction_in_atmosphere_layer") + if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) + endif + !Molecular backscatter + if (associated(cospOUT%atlid_beta_mol)) then + status = nf90_def_var(fileID,"lidarBetaMol355",nf90_float, (/dimID(1),dimID(3)/),varID(122)) + if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) + status = nf90_put_att(fileID,varID(122),"long_name","ATLID Molecular Backscatter Coefficient (355nm)") + if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) + status = nf90_put_att(fileID,varID(122),"units", "m-1 sr-1") + if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) + status = nf90_put_att(fileID,varID(122),"standard_name", "atlid_volume_attenuated_backwards_scattering_function_in_air_assuming_no_aerosol_or_cloud") + if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) + endif + !Height-Intensity histogram (SR) + if (associated(cospOUT%atlid_cfad_sr)) then + status = nf90_def_var(fileID,"cfadLidarsr355",nf90_float, (/dimID(1),dimID(12),dimID(4)/),varID(123)) + if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) + status = nf90_put_att(fileID,varID(123),"long_name","ATLID Scattering Ratio CFAD") + if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) + status = nf90_put_att(fileID,varID(123),"units", "1") + if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) + status = nf90_put_att(fileID,varID(123),"standard_name", "atlid_histogram_of_backscattering_ratio_over_height_above_reference_ellipsoid") + if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) + endif + if (associated(cospOUT%atlid_beta_tot)) then + status = nf90_def_var(fileID,"atb355",nf90_float, (/dimID(1),dimID(2),dimID(3)/),varID(124)) + if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) + status = nf90_put_att(fileID,varID(124),"long_name","ATLID Attenuated Total Backscatter (355nm)") + if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) + status = nf90_put_att(fileID,varID(124),"units", "m-1 sr-1") + if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) + status = nf90_put_att(fileID,varID(124),"standard_name", "volume_attenuated_backwards_scattering_function_in_air") + if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) + endif + + if (associated(cospOUT%atlid_srbval) .or. associated(cospOUT%atlid_cfad_sr)) then + status = nf90_def_var(fileID,"SR_BINS_ATLID",nf90_float, (/dimID(12)/),varID(125)) + if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) + status = nf90_put_att(fileID,varID(125),"long_name","ATLID Backscattering Ratio (SR) Bin Centers") + if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) + status = nf90_put_att(fileID,varID(125),"units", "1") + if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) + status = nf90_put_att(fileID,varID(125),"standard_name", "backscattering_ratio") + if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) + status = nf90_def_var(fileID,"SR_EDGES_ATLID",nf90_float, (/dimID(6),dimID(12)/),varID(126)) + if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) + status = nf90_put_att(fileID,varID(126),"long_name","ATLID Backscattering Ratio (SR) Bin Bounds") + if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) + status = nf90_put_att(fileID,varID(126),"units", "1") + if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) + status = nf90_put_att(fileID,varID(126),"standard_name", "backscattering_ratio") + if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) + endif + ! PARASOL simulator output if (associated(cospOUT%parasolPix_refl)) then status = nf90_def_var(fileID,"parasolPix_refl",nf90_float, (/dimID(1),dimID(2),dimID(13)/),varID(20)) @@ -1023,7 +1386,127 @@ subroutine write_cosp2_output(Npoints, Ncolumns, Nlevels, lev, lon, lat, cospOUT status = nf90_put_var(fileID,varID(81),calipso_binCenters) if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) endif - + + !OPAQ diagnostics + if (associated(cospOUT%calipso_cldtype)) then + status = nf90_put_var(fileID,varID(91),cospOUT%calipso_cldtype(:,1)) + if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) + status = nf90_put_var(fileID,varID(92),cospOUT%calipso_cldtype(:,2)) + if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) + status = nf90_put_var(fileID,varID(93),cospOUT%calipso_cldtype(:,3)) + if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) + endif + if (associated(cospOUT%calipso_lidarcldtype)) then + status = nf90_put_var(fileID,varID(94),cospOUT%calipso_lidarcldtype(:,:,1)) + if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) + status = nf90_put_var(fileID,varID(95),cospOUT%calipso_lidarcldtype(:,:,2)) + if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) + status = nf90_put_var(fileID,varID(96),cospOUT%calipso_lidarcldtype(:,:,3)) + if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) + status = nf90_put_var(fileID,varID(97),cospOUT%calipso_lidarcldtype(:,:,4)) + if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) + endif + if (associated(cospOUT%calipso_cldtypetemp)) then + status = nf90_put_var(fileID,varID(98),cospOUT%calipso_cldtypetemp(:,1)) + if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) + status = nf90_put_var(fileID,varID(99),cospOUT%calipso_cldtypetemp(:,2)) + if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) + status = nf90_put_var(fileID,varID(100),cospOUT%calipso_cldtypetemp(:,3)) + if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) + endif + if (associated(cospOUT%calipso_cldtypemeanz)) then + status = nf90_put_var(fileID,varID(101),cospOUT%calipso_cldtypemeanz(:,1)) + if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) + status = nf90_put_var(fileID,varID(102),cospOUT%calipso_cldtypemeanz(:,2)) + if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) + endif + if (associated(cospOUT%calipso_cldthinemis)) then + status = nf90_put_var(fileID,varID(103),cospOUT%calipso_cldthinemis) + if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) + endif + if (associated(cospOUT%calipso_cldtypemeanzse)) then + status = nf90_put_var(fileID,varID(104),cospOUT%calipso_cldtypemeanzse(:,1)) + if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) + status = nf90_put_var(fileID,varID(105),cospOUT%calipso_cldtypemeanzse(:,2)) + if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) + status = nf90_put_var(fileID,varID(106),cospOUT%calipso_cldtypemeanzse(:,3)) + if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) + endif + + ! GROUND LIDAR simulator output + if (associated(cospOUT%grLidar532_cldlayer)) then + status = nf90_put_var(fileID,varID(107),cospOUT%grLidar532_cldlayer(:,1)) + if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) + status = nf90_put_var(fileID,varID(108),cospOUT%grLidar532_cldlayer(:,2)) + if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) + status = nf90_put_var(fileID,varID(109),cospOUT%grLidar532_cldlayer(:,3)) + if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) + status = nf90_put_var(fileID,varID(110),cospOUT%grLidar532_cldlayer(:,4)) + if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) + endif + if (associated(cospOUT%grLidar532_lidarcld)) then + status = nf90_put_var(fileID,varID(111),cospOUT%grLidar532_lidarcld) + if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) + endif + if (associated(cospOUT%grLidar532_beta_mol)) then + status = nf90_put_var(fileID,varID(112),cospOUT%grLidar532_beta_mol) + if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) + endif + if (associated(cospOUT%grLidar532_cfad_sr)) then + status = nf90_put_var(fileID,varID(113),cospOUT%grLidar532_cfad_sr) + if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) + endif + if (associated(cospOUT%grLidar532_beta_tot)) then + status = nf90_put_var(fileID,varID(114),cospOUT%grLidar532_beta_tot) + if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) + endif + + if (associated(cospOUT%grLidar532_srbval)) then + status = nf90_put_var(fileID,varID(116),reshape([cospOUT%grLidar532_srbval(1:SR_BINS),cospOUT%grLidar532_srbval(2:SR_BINS+1)],(/2,SR_BINS/))) + if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) + endif + if (associated(cospOUT%grLidar532_srbval) .or. associated(cospOUT%grLidar532_cfad_sr)) then + status = nf90_put_var(fileID,varID(115),grLidar532_binCenters) + if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) + endif + + ! ATLID simulator output + if (associated(cospOUT%atlid_cldlayer)) then + status = nf90_put_var(fileID,varID(117),cospOUT%atlid_cldlayer(:,1)) + if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) + status = nf90_put_var(fileID,varID(118),cospOUT%atlid_cldlayer(:,2)) + if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) + status = nf90_put_var(fileID,varID(119),cospOUT%atlid_cldlayer(:,3)) + if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) + status = nf90_put_var(fileID,varID(120),cospOUT%atlid_cldlayer(:,4)) + if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) + endif + if (associated(cospOUT%atlid_lidarcld)) then + status = nf90_put_var(fileID,varID(121),cospOUT%atlid_lidarcld) + if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) + endif + if (associated(cospOUT%atlid_beta_mol)) then + status = nf90_put_var(fileID,varID(122),cospOUT%atlid_beta_mol) + if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) + endif + if (associated(cospOUT%atlid_cfad_sr)) then + status = nf90_put_var(fileID,varID(123),cospOUT%atlid_cfad_sr) + if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) + endif + if (associated(cospOUT%atlid_beta_tot)) then + status = nf90_put_var(fileID,varID(124),cospOUT%atlid_beta_tot) + if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) + endif + + if (associated(cospOUT%atlid_srbval)) then + status = nf90_put_var(fileID,varID(126),reshape([cospOUT%atlid_srbval(1:SR_BINS),cospOUT%atlid_srbval(2:SR_BINS+1)],(/2,SR_BINS/))) + if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) + endif + if (associated(cospOUT%atlid_srbval) .or. associated(cospOUT%atlid_cfad_sr)) then + status = nf90_put_var(fileID,varID(125),atlid_binCenters) + if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status)) + endif + ! PARASOL simulator output if (associated(cospOUT%parasolPix_refl)) then status = nf90_put_var(fileID,varID(20),cospOUT%parasolPix_refl) @@ -1242,7 +1725,7 @@ SUBROUTINE NC_READ_INPUT_FILE(fname,Npnts,Nl,Nhydro,lon,lat,p,ph,z,zh,T,qv,rh,tc mr_lsliq,mr_lsice,mr_ccliq,mr_ccice,fl_lsrain,fl_lssnow, & fl_lsgrpl,fl_ccrain,fl_ccsnow,Reff,dtau_s,dtau_c,dem_s, & dem_c,skt,landmask,mr_ozone,u_wind,v_wind,sunlit, & - emsfc_lw,mode,Nlon,Nlat) + emsfc_lw,mode,Nlon,Nlat,surfelev) ! Arguments character(len=512),intent(in) :: fname ! File name @@ -1252,7 +1735,7 @@ SUBROUTINE NC_READ_INPUT_FILE(fname,Npnts,Nl,Nhydro,lon,lat,p,ph,z,zh,T,qv,rh,tc mr_lsliq,mr_lsice,mr_ccliq,mr_ccice,fl_lsrain,fl_lssnow,fl_lsgrpl, & fl_ccrain,fl_ccsnow,dtau_s,dtau_c,dem_s,dem_c,mr_ozone real(wp),dimension(Npnts,Nl,Nhydro),intent(out) :: Reff - real(wp),dimension(Npnts),intent(out) :: skt,landmask,u_wind,v_wind,sunlit + real(wp),dimension(Npnts),intent(out) :: skt,landmask,u_wind,v_wind,sunlit,surfelev real(wp),intent(out) :: emsfc_lw integer,intent(out) :: mode,Nlon,Nlat @@ -1563,6 +2046,12 @@ SUBROUTINE NC_READ_INPUT_FILE(fname,Npnts,Nl,Nhydro,lon,lat,p,ph,z,zh,T,qv,rh,tc else call map_ll_to_point(Na,Nb,Npoints,x2=x2,y1=skt) endif + case ('orography') + if (Lpoint) then + surfelev(1:Npoints) = x1(1:Npoints) + else + call map_ll_to_point(Na,Nb,Npoints,x2=x2,y1=surfelev) + endif case ('landmask') if (Lpoint) then landmask(1:Npoints) = x1(1:Npoints) diff --git a/driver/src/cosp2_test.f90 b/driver/src/cosp2_test.f90 index a2c10ae431..4bc0457db4 100644 --- a/driver/src/cosp2_test.f90 +++ b/driver/src/cosp2_test.f90 @@ -28,10 +28,12 @@ ! ! History ! 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 ! %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% program cosp2_test use cosp_kinds, only: wp - USE MOD_COSP_CONFIG, ONLY: R_UNDEF,PARASOL_NREFL,LIDAR_NCAT,SR_BINS, & + USE MOD_COSP_CONFIG, ONLY: R_UNDEF,PARASOL_NREFL,LIDAR_NCAT,LIDAR_NTYPE,SR_BINS, & N_HYDRO,RTTOV_MAX_CHANNELS,numMISRHgtBins, & DBZE_BINS,LIDAR_NTEMP,calipso_histBsct, & numMODISTauBins,numMODISPresBins, & @@ -41,7 +43,9 @@ program cosp2_test modis_histTauEdges,tau_binEdges, & modis_histTauCenters,tau_binCenters,ntauV1p4, & tau_binBoundsV1p4,tau_binEdgesV1p4, tau_binCentersV1p4, & - Nlvgrid_local => Nlvgrid + grLidar532_histBsct,atlid_histBsct, & + Nlvgrid_local => Nlvgrid, & + vgrid_z_local => vgrid_z use cosp_phys_constants, only: amw,amd,amO3,amCO2,amCH4,amN2O,amCO use mod_cosp_io, only: nc_read_input_file,write_cosp2_output USE mod_quickbeam_optics,only: size_distribution,hydro_class_init,quickbeam_optics, & @@ -72,6 +76,7 @@ program cosp2_test lon, & ! Longitude (deg) lat, & ! Latitude (deg) skt, & ! Skin temperature (K) + surfelev, & ! Surface Elevation (m) landmask, & ! Land/sea mask (0/1) u_wind, & ! U-component of wind (m/s) v_wind, & ! V-component of wind (m/s) @@ -125,6 +130,8 @@ program cosp2_test rttov_satellite, & ! RTTOV: Satellite rttov_instrument, & ! RTTOV: Instrument rttov_Nchannels ! RTTOV: Number of channels to be computed + real(wp),dimension(:),allocatable :: & + vgrid_z ! mid-level altitude of the vertical grid real(wp) :: & ! cloudsat_radar_freq, & ! CloudSat radar frequency (GHz) cloudsat_k2, & ! |K|^2, -1=use frequency dependent default @@ -164,10 +171,16 @@ program cosp2_test logical :: Lcfaddbze94,Ldbze94,Latb532,LcfadLidarsr532,Lclcalipso,Lclhcalipso, & Lcllcalipso,Lclmcalipso,Lcltcalipso,LparasolRefl,Lclcalipsoliq, & Lclcalipsoice,Lclcalipsoun,Lclcalipsotmp,Lclcalipsotmpliq,Lclcalipsotmpice, & - Lclcalipsotmpun,Lclhcalipsoliq,Lcllcalipsoliq,Lclmcalipsoliq, & - Lcltcalipsoliq,Lclhcalipsoice,Lcllcalipsoice,Lclmcalipsoice,Lcltcalipsoice, & - Lclhcalipsoun,Lcllcalipsoun,Lclmcalipsoun,Lcltcalipsoun,Lalbisccp, & - Lboxptopisccp,Lboxtauisccp,Lpctisccp,Lclisccp,Ltauisccp,Lcltisccp, & + Lclcalipsotmpun,Lclhcalipsoliq,Lcllcalipsoliq,Lclmcalipsoliq,Lcltcalipsoliq,& + Lclhcalipsoice,Lcllcalipsoice,Lclmcalipsoice,Lcltcalipsoice,Lclhcalipsoun, & + Lcllcalipsoun,Lclmcalipsoun,Lcltcalipsoun,Lclopaquecalipso,Lclthincalipso, & + Lclzopaquecalipso,Lclcalipsoopaque,Lclcalipsothin,Lclcalipsozopaque, & + Lclcalipsoopacity,Lclopaquetemp,Lclthintemp,Lclzopaquetemp,Lclopaquemeanz, & + Lclthinmeanz,Lclthinemis,Lclopaquemeanzse,Lclthinmeanzse,Lclzopaquecalipsose,& + LlidarBetaMol532gr,LcfadLidarsr532gr,Latb532gr,LclgrLidar532,LclhgrLidar532,& + LcllgrLidar532,LclmgrLidar532,LcltgrLidar532,LlidarBetaMol355, & + LcfadLidarsr355,Latb355,Lclatlid,Lclhatlid,Lcllatlid,Lclmatlid,Lcltatlid, & + Lalbisccp,Lboxptopisccp,Lboxtauisccp,Lpctisccp,Lclisccp,Ltauisccp,Lcltisccp,& Lmeantbisccp,Lmeantbclrisccp,LclMISR,Lclcalipso2,Lcltlidarradar,Lfracout, & LlidarBetaMol532,Lcltmodis,Lclwmodis,Lclimodis,Lclhmodis,Lclmmodis, & Lcllmodis,Ltautmodis,Ltauwmodis,Ltauimodis,Ltautlogmodis,Ltauwlogmodis, & @@ -179,7 +192,15 @@ program cosp2_test Lclcalipsotmpliq,Lclcalipsotmpice,Lclcalipsotmpun,Lclhcalipsoliq, & Lcllcalipsoliq,Lclmcalipsoliq,Lcltcalipsoliq,Lclhcalipsoice, & Lcllcalipsoice,Lclmcalipsoice,Lcltcalipsoice,Lclhcalipsoun, & - Lcllcalipsoun,Lclmcalipsoun,Lcltcalipsoun,Lalbisccp,Lboxptopisccp,& + Lcllcalipsoun,Lclmcalipsoun,Lcltcalipsoun,Lclopaquecalipso, & + Lclthincalipso,Lclzopaquecalipso,Lclcalipsoopaque,Lclcalipsothin, & + Lclcalipsozopaque,Lclcalipsoopacity,Lclopaquetemp,Lclthintemp, & + Lclzopaquetemp,Lclopaquemeanz,Lclthinmeanz,Lclthinemis, & + Lclopaquemeanzse,Lclthinmeanzse,Lclzopaquecalipsose, & + LlidarBetaMol532gr,LcfadLidarsr532gr,Latb532gr,LclgrLidar532, & + LclhgrLidar532,LcllgrLidar532,LclmgrLidar532,LcltgrLidar532, & + LlidarBetaMol355,LcfadLidarsr355,Latb355,Lclatlid, & + Lclhatlid,Lcllatlid,Lclmatlid,Lcltatlid,Lalbisccp,Lboxptopisccp, & Lboxtauisccp,Lpctisccp,Lclisccp,Ltauisccp,Lcltisccp,Lmeantbisccp, & Lmeantbclrisccp,LclMISR,Lclcalipso2,Lcltlidarradar,Lfracout, & LlidarBetaMol532,Lcltmodis,Lclwmodis,Lclimodis,Lclhmodis, & @@ -189,15 +210,17 @@ program cosp2_test ! Local variables logical :: & - lsingle = .true., & ! True if using MMF_v3_single_moment CLOUDSAT microphysical scheme (default) - ldouble = .false., & ! True if using MMF_v3.5_two_moment CLOUDSAT microphysical scheme - lisccp = .false. ,& ! Local on/off switch for simulators (used by initialization) - lmodis = .false., & ! - lmisr = .false., & ! - lcalipso = .false., & ! - lcloudsat = .false., & ! - lrttov = .false., & ! - lparasol = .false. ! + lsingle = .true., & ! True if using MMF_v3_single_moment CLOUDSAT microphysical scheme (default) + ldouble = .false., & ! True if using MMF_v3.5_two_moment CLOUDSAT microphysical scheme + lisccp = .false. ,& ! Local on/off switch for simulators (used by initialization) + lmodis = .false., & ! + lmisr = .false., & ! + lcalipso = .false., & ! + lgrLidar532 = .false., & ! + latlid = .false., & ! + lcloudsat = .false., & ! + lrttov = .false., & ! + lparasol = .false. ! type(size_distribution) :: & sd ! Hydrometeor description type(radar_cfg) :: & @@ -247,10 +270,10 @@ program cosp2_test ! Fields used solely for output integer,parameter :: & - n_out_list = 63, & ! Number of possible output variables - N3D = 8, & ! Number of 3D output variables - N2D = 14, & ! Number of 2D output variables - N1D = 40 ! Number of 1D output variables + n_out_list = 86, & ! Number of possible output variables + N3D = 9, & ! Number of 3D output variables + N2D = 20, & ! Number of 2D output variables + N1D = 56 ! Number of 1D output variables character(len=32),dimension(n_out_list) :: out_list ! List of output variable names integer :: lon_axid,time_axid,height_axid,height_mlev_axid,grid_id,lonvar_id, & latvar_id,column_axid,sza_axid,temp_axid,channel_axid,dbze_axid,sratio_axid,& @@ -285,14 +308,14 @@ program cosp2_test dtau_s(Npoints,Nlevels),dtau_c(Npoints,Nlevels),dem_s(Npoints,Nlevels), & dem_c(Npoints,Nlevels),skt(Npoints),landmask(Npoints), & mr_ozone(Npoints,Nlevels),u_wind(Npoints),v_wind(Npoints),sunlit(Npoints), & - frac_out(Npoints,Ncolumns,Nlevels)) + frac_out(Npoints,Ncolumns,Nlevels),surfelev(Npoints)) fileIN = trim(dinput)//trim(finput) call nc_read_input_file(fileIN,Npoints,Nlevels,N_HYDRO,lon,lat,p,ph,zlev,zlev_half, & T,sh,rh,tca,cca,mr_lsliq,mr_lsice,mr_ccliq,mr_ccice,fl_lsrain, & fl_lssnow,fl_lsgrpl,fl_ccrain,fl_ccsnow,Reff,dtau_s,dtau_c, & dem_s,dem_c,skt,landmask,mr_ozone,u_wind,v_wind,sunlit, & - emsfc_lw,geomode,Nlon,Nlat) + emsfc_lw,geomode,Nlon,Nlat,surfelev) call cpu_time(driver_time(2)) !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -312,7 +335,20 @@ program cosp2_test Lclhcalipsoliq .or. Lclhcalipsoice .or. Lclhcalipsoun .or. Lclmcalipsoliq .or. & Lclmcalipsoice .or. Lclmcalipsoun .or. Lcllcalipsoliq .or. Lcllcalipsoice .or. & Lcllcalipsoun .or. LlidarBetaMol532 .or. LcfadLidarsr532 .or. Lcltlidarradar .or. & - Lcltlidarradar) lcalipso = .true. + Lcltlidarradar .or. Lclopaquecalipso .or. Lclthincalipso .or. Lclzopaquecalipso & + .or. Lclcalipsoopaque .or. Lclcalipsothin .or. Lclcalipsozopaque .or. & + Lclcalipsoopacity .or. Lclopaquetemp .or. Lclthintemp .or. Lclzopaquetemp .or. & + Lclopaquemeanz .or. Lclthinmeanz .or. Lclthinemis .or. Lclopaquemeanzse .or. & + Lclthinmeanzse .or. Lclzopaquecalipsose) Lcalipso = .true. + + if (LlidarBetaMol532gr .or. LcfadLidarsr532gr .or. Latb532gr .or. LclgrLidar532 .or. & + LclhgrLidar532 .or. LcllgrLidar532 .or. LclmgrLidar532 .or. LcltgrLidar532) & + LgrLidar532 = .true. + + if (LlidarBetaMol355 .or. LcfadLidarsr355 .or. Latb355 .or. Lclatlid .or. & + Lclhatlid .or. Lcllatlid .or. Lclmatlid .or. Lcltatlid) & + Latlid = .true. + if (LcfadDbze94 .or. Ldbze94 .or. Lcltlidarradar) Lcloudsat = .true. if (Lparasolrefl) Lparasol = .true. if (Ltbrttov) Lrttov = .true. @@ -343,11 +379,10 @@ program cosp2_test call hydro_class_init(lsingle,ldouble,sd) ! Initialize COSP simulator - call COSP_INIT(Lisccp, Lmodis, Lmisr, Lcloudsat, Lcalipso, 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 COSP_INIT(Lisccp, Lmodis, Lmisr, Lcloudsat, Lcalipso, LgrLidar532, Latlid, & + 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)) !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -360,12 +395,19 @@ program cosp2_test Lcltmodis, Lclwmodis, Lclimodis, Lclhmodis, Lclmmodis, Lcllmodis, Ltautmodis, & Ltauwmodis, Ltauimodis, Ltautlogmodis, Ltauwlogmodis, Ltauilogmodis, & Lreffclwmodis, Lreffclimodis, Lpctmodis, Llwpmodis, Liwpmodis, Lclmodis, Latb532, & - LlidarBetaMol532, LcfadLidarsr532, Lclcalipso2, Lclcalipso, Lclhcalipso, & - Lcllcalipso, Lclmcalipso, Lcltcalipso, Lcltlidarradar, Lclcalipsoliq, & + Latb532gr, Latb355, LlidarBetaMol532, LlidarBetaMol532gr, LlidarBetaMol355, & + LcfadLidarsr532, LcfadLidarsr532gr, LcfadLidarsr355, Lclcalipso2, & + Lclcalipso, LclgrLidar532, Lclatlid, Lclhcalipso, Lcllcalipso, Lclmcalipso, & + Lcltcalipso, LclhgrLidar532, LcllgrLidar532, LclmgrLidar532, LcltgrLidar532, & + Lclhatlid, Lcllatlid, Lclmatlid, Lcltatlid, Lcltlidarradar, Lclcalipsoliq, & Lclcalipsoice, Lclcalipsoun, Lclcalipsotmp, Lclcalipsotmpliq, Lclcalipsotmpice, & Lclcalipsotmpun, Lcltcalipsoliq, Lcltcalipsoice, Lcltcalipsoun, Lclhcalipsoliq, & Lclhcalipsoice, Lclhcalipsoun, Lclmcalipsoliq, Lclmcalipsoice, Lclmcalipsoun, & - Lcllcalipsoliq, Lcllcalipsoice, Lcllcalipsoun, LcfadDbze94, Ldbze94, Lparasolrefl,& + Lcllcalipsoliq, Lcllcalipsoice, Lcllcalipsoun, Lclopaquecalipso, Lclthincalipso, & + Lclzopaquecalipso, Lclcalipsoopaque, Lclcalipsothin, Lclcalipsozopaque, & + Lclcalipsoopacity, Lclopaquetemp, Lclthintemp, Lclzopaquetemp, Lclopaquemeanz, & + Lclthinmeanz, Lclthinemis, Lclopaquemeanzse, Lclthinmeanzse, Lclzopaquecalipsose, & + LcfadDbze94, Ldbze94, Lparasolrefl, & Ltbrttov, Npoints, Ncolumns, Nlevels, Nlvgrid_local, rttov_Nchannels, cospOUT) !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -415,6 +457,7 @@ program cosp2_test cospstateIN%hgt_matrix = zlev(start_idx:end_idx,Nlevels:1:-1) ! km cospstateIN%sunlit = sunlit(start_idx:end_idx) ! 0-1 cospstateIN%skt = skt(start_idx:end_idx) ! K + cospstateIN%surfelev = surfelev(start_idx:end_idx) ! m cospstateIN%land = landmask(start_idx:end_idx) ! 0-1 (*note* model specific) cospstateIN%qv = sh(start_idx:end_idx,Nlevels:1:-1) ! kg/kg cospstateIN%at = T(start_idx:end_idx,Nlevels:1:-1) ! K @@ -735,13 +778,32 @@ subroutine subsample_and_optics(nPoints, nLevels, nColumns, nHydro, overlap, ! LIDAR Polarized optics !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% if (Lcalipso) then - call lidar_optics(nPoints, nColumns, nLevels, 4, lidar_ice_type, & - mr_hydro(:,:,:,I_LSCLIQ), mr_hydro(:,:,:,I_LSCICE), mr_hydro(:,:,:,I_CVCLIQ), & - mr_hydro(:,:,:,I_CVCICE), ReffIN(:,:,I_LSCLIQ), ReffIN(:,:,I_LSCICE), & - ReffIN(:,:,I_CVCLIQ), ReffIN(:,:,I_CVCICE), cospstateIN%pfull, cospstateIN%phalf, & - cospstateIN%at, cospIN%beta_mol, cospIN%betatot, cospIN%tau_mol, cospIN%tautot, & - cospIN%tautot_S_liq, cospIN%tautot_S_ice, cospIN%betatot_ice, cospIN%betatot_liq, & - cospIN%tautot_ice, cospIN%tautot_liq) + call lidar_optics(nPoints, nColumns, nLevels, 4, lidar_ice_type, 532, .false., & + mr_hydro(:,:,:,I_LSCLIQ), mr_hydro(:,:,:,I_LSCICE), mr_hydro(:,:,:,I_CVCLIQ), & + mr_hydro(:,:,:,I_CVCICE), ReffIN(:,:,I_LSCLIQ), ReffIN(:,:,I_LSCICE), & + ReffIN(:,:,I_CVCLIQ), ReffIN(:,:,I_CVCICE), cospstateIN%pfull, & + cospstateIN%phalf, cospstateIN%at, cospIN%beta_mol_calipso, & + cospIN%betatot_calipso, cospIN%tau_mol_calipso, cospIN%tautot_calipso, & + cospIN%tautot_S_liq, cospIN%tautot_S_ice, cospIN%betatot_ice_calipso, & + cospIN%betatot_liq_calipso, cospIN%tautot_ice_calipso, cospIN%tautot_liq_calipso) + endif + + if (LgrLidar532) then + call lidar_optics(nPoints, nColumns, nLevels, 4, lidar_ice_type, 532, .true., & + mr_hydro(:,:,:,I_LSCLIQ), mr_hydro(:,:,:,I_LSCICE), mr_hydro(:,:,:,I_CVCLIQ), & + mr_hydro(:,:,:,I_CVCICE), ReffIN(:,:,I_LSCLIQ), ReffIN(:,:,I_LSCICE), & + ReffIN(:,:,I_CVCLIQ), ReffIN(:,:,I_CVCICE), cospstateIN%pfull, & + cospstateIN%phalf, cospstateIN%at, cospIN%beta_mol_grLidar532, & + cospIN%betatot_grLidar532, cospIN%tau_mol_grLidar532, cospIN%tautot_grLidar532) + endif + + if (Latlid) then + call lidar_optics(nPoints, nColumns, nLevels, 4, lidar_ice_type, 355, .false., & + mr_hydro(:,:,:,I_LSCLIQ), mr_hydro(:,:,:,I_LSCICE), mr_hydro(:,:,:,I_CVCLIQ), & + mr_hydro(:,:,:,I_CVCICE), ReffIN(:,:,I_LSCLIQ), ReffIN(:,:,I_LSCICE), & + ReffIN(:,:,I_CVCLIQ), ReffIN(:,:,I_CVCICE), cospstateIN%pfull, & + cospstateIN%phalf, cospstateIN%at, cospIN%beta_mol_atlid, cospIN%betatot_atlid,& + cospIN%tau_mol_atlid, cospIN%tautot_atlid) endif !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -835,18 +897,32 @@ subroutine construct_cospIN(npoints,ncolumns,nlevels,y) y%emiss_11(npoints, ncolumns,nlevels)) endif if (Lcalipso) then - allocate(y%betatot(npoints, ncolumns,nlevels),& - y%betatot_ice(npoints, ncolumns,nlevels),& - y%betatot_liq(npoints, ncolumns,nlevels),& - y%tautot(npoints, ncolumns,nlevels),& - y%tautot_ice(npoints, ncolumns,nlevels),& - y%tautot_liq(npoints, ncolumns,nlevels),& - y%beta_mol(npoints, nlevels),& - y%tau_mol(npoints, nlevels),& + allocate(y%betatot_calipso(npoints, ncolumns,nlevels),& + y%betatot_ice_calipso(npoints, ncolumns,nlevels),& + y%betatot_liq_calipso(npoints, ncolumns,nlevels),& + y%tautot_calipso(npoints, ncolumns,nlevels),& + y%tautot_ice_calipso(npoints, ncolumns,nlevels),& + y%tautot_liq_calipso(npoints, ncolumns,nlevels),& + y%beta_mol_calipso(npoints, nlevels),& + y%tau_mol_calipso(npoints, nlevels),& y%tautot_S_ice(npoints, ncolumns ),& - y%tautot_S_liq(npoints, ncolumns)) + y%tautot_S_liq(npoints, ncolumns )) + endif + if (LgrLidar532) then + allocate(y%beta_mol_grLidar532(npoints, nlevels),& + y%betatot_grLidar532(npoints, ncolumns,nlevels),& + y%tau_mol_grLidar532(npoints, nlevels),& + y%tautot_grLidar532(npoints, ncolumns,nlevels)) endif + + if (Latlid) then + allocate(y%beta_mol_atlid(npoints, nlevels),& + y%betatot_atlid(npoints, ncolumns,nlevels),& + y%tau_mol_atlid(npoints, nlevels),& + y%tautot_atlid(npoints, ncolumns,nlevels)) + endif + if (Lcloudsat) then allocate(y%z_vol_cloudsat(npoints, ncolumns,nlevels),& y%kr_vol_cloudsat(npoints,ncolumns,nlevels),& @@ -877,7 +953,7 @@ subroutine construct_cospstateIN(npoints,nlevels,nchan,y) y%pfull(npoints,nlevels),y%phalf(npoints,nlevels+1),y%qv(npoints,nlevels), & y%o3(npoints,nlevels),y%hgt_matrix(npoints,nlevels),y%u_sfc(npoints), & y%v_sfc(npoints),y%lat(npoints),y%lon(nPoints),y%emis_sfc(nchan), & - y%cloudIce(nPoints,nLevels),y%cloudLiq(nPoints,nLevels), & + y%cloudIce(nPoints,nLevels),y%cloudLiq(nPoints,nLevels),y%surfelev(npoints),& y%fl_snow(nPoints,nLevels),y%fl_rain(nPoints,nLevels),y%seaice(npoints), & y%tca(nPoints,nLevels),y%hgt_matrix_half(npoints,nlevels+1)) @@ -895,18 +971,27 @@ subroutine construct_cosp_outputs(Lpctisccp,Lclisccp,& Lcllmodis,Ltautmodis,Ltauwmodis,Ltauimodis, & Ltautlogmodis,Ltauwlogmodis,Ltauilogmodis, & Lreffclwmodis,Lreffclimodis,Lpctmodis,Llwpmodis, & - Liwpmodis,Lclmodis,Latb532,LlidarBetaMol532, & - LcfadLidarsr532,Lclcalipso2, & - Lclcalipso,Lclhcalipso,Lcllcalipso,Lclmcalipso, & - Lcltcalipso,Lcltlidarradar,Lclcalipsoliq, & + Liwpmodis,Lclmodis,Latb532,Latb532gr,Latb355, & + LlidarBetaMol532,LlidarBetaMol532gr,LlidarBetaMol355,& + LcfadLidarsr532,LcfadLidarsr532gr,LcfadLidarsr355, & + Lclcalipso2,Lclcalipso,LclgrLidar532,Lclatlid, & + Lclhcalipso,Lcllcalipso,Lclmcalipso,Lcltcalipso, & + LclhgrLidar532,LcllgrLidar532,LclmgrLidar532, & + LcltgrLidar532,Lclhatlid,Lcllatlid,Lclmatlid, & + Lcltatlid,Lcltlidarradar,Lclcalipsoliq, & Lclcalipsoice,Lclcalipsoun,Lclcalipsotmp, & Lclcalipsotmpliq,Lclcalipsotmpice,Lclcalipsotmpun, & Lcltcalipsoliq,Lcltcalipsoice,Lcltcalipsoun, & Lclhcalipsoliq,Lclhcalipsoice,Lclhcalipsoun, & Lclmcalipsoliq,Lclmcalipsoice,Lclmcalipsoun, & Lcllcalipsoliq,Lcllcalipsoice,Lcllcalipsoun, & - LcfadDbze94,Ldbze94,Lparasolrefl,Ltbrttov, & - Npoints,Ncolumns,Nlevels,Nlvgrid,Nchan,x) + Lclopaquecalipso,Lclthincalipso,Lclzopaquecalipso, & + Lclcalipsoopaque,Lclcalipsothin,Lclcalipsozopaque, & + Lclcalipsoopacity,Lclopaquetemp,Lclthintemp, & + Lclzopaquetemp,Lclopaquemeanz,Lclthinmeanz, & + Lclthinemis,Lclopaquemeanzse,Lclthinmeanzse, & + Lclzopaquecalipsose,LcfadDbze94,Ldbze94,Lparasolrefl,& + Ltbrttov,Npoints,Ncolumns,Nlevels,Nlvgrid,Nchan,x) ! Inputs logical,intent(in) :: & Lpctisccp, & ! ISCCP mean cloud top pressure @@ -938,14 +1023,30 @@ subroutine construct_cosp_outputs(Lpctisccp,Lclisccp,& Liwpmodis, & ! MODIS cloud ice water path Lclmodis, & ! MODIS cloud area fraction Latb532, & ! CALIPSO attenuated total backscatter (532nm) + Latb532gr, & ! GROUND LIDAR @ 532NM attenuated total backscatter (532nm) + Latb355, & ! ATLID attenuated total backscatter (355nm) LlidarBetaMol532, & ! CALIPSO molecular backscatter (532nm) + LlidarBetaMol532gr,&! GROUND LIDAR @ 532NM molecular backscatter (532nm) + LlidarBetaMol355, & ! ATLID molecular backscatter (355nm) LcfadLidarsr532, & ! CALIPSO scattering ratio CFAD + LcfadLidarsr532gr,& ! GROUND LIDAR @ 532NM scattering ratio CFAD + LcfadLidarsr355, & ! ATLID scattering ratio CFAD Lclcalipso2, & ! CALIPSO cloud fraction undetected by cloudsat Lclcalipso, & ! CALIPSO cloud area fraction + LclgrLidar532, & ! GROUND LIDAR @ 532NM cloud area fraction + Lclatlid, & ! ATLID cloud area fraction Lclhcalipso, & ! CALIPSO high-level cloud fraction Lcllcalipso, & ! CALIPSO low-level cloud fraction Lclmcalipso, & ! CALIPSO mid-level cloud fraction Lcltcalipso, & ! CALIPSO total cloud fraction + LclhgrLidar532, & ! GROUND LIDAR @ 532NM high-level cloud fraction + LcllgrLidar532, & ! GROUND LIDAR @ 532NM low-level cloud fraction + LclmgrLidar532, & ! GROUND LIDAR @ 532NM mid-level cloud fraction + LcltgrLidar532, & ! GROUND LIDAR @ 532NM total cloud fraction + Lclhatlid, & ! ATLID high-level cloud fraction + Lcllatlid, & ! ATLID low-level cloud fraction + Lclmatlid, & ! ATLID mid-level cloud fraction + Lcltatlid, & ! ATLID total cloud fraction Lcltlidarradar, & ! CALIPSO-CLOUDSAT total cloud fraction Lclcalipsoliq, & ! CALIPSO liquid cloud area fraction Lclcalipsoice, & ! CALIPSO ice cloud area fraction @@ -966,6 +1067,22 @@ subroutine construct_cosp_outputs(Lpctisccp,Lclisccp,& Lcllcalipsoliq, & ! CALIPSO low-level liquid cloud fraction Lcllcalipsoice, & ! CALIPSO low-level ice cloud fraction Lcllcalipsoun, & ! CALIPSO low-level undetected cloud fraction + Lclopaquecalipso, & ! CALIPSO opaque cloud cover (2D Map) + Lclthincalipso, & ! CALIPSO thin cloud cover (2D Map) + Lclzopaquecalipso,& ! CALIPSO z_opaque altitude (opaque clouds only, 2D Map) + Lclcalipsoopaque, & ! CALIPSO opaque cloud profiles 3D fraction + Lclcalipsothin, & ! CALIPSO thin cloud profiles 3D fraction + Lclcalipsozopaque,& ! CALIPSO z_opaque 3D fraction + Lclcalipsoopacity,& ! CALIPSO opacity 3D fraction + Lclopaquetemp, & ! CALIPSO opaque cloud temperature + Lclthintemp, & ! CALIPSO thin cloud temperature + Lclzopaquetemp, & ! CALIPSO z_opaque temperature + Lclopaquemeanz, & ! CALIPSO opaque cloud altitude + Lclthinmeanz, & ! CALIPSO thin cloud altitude + Lclthinemis, & ! CALIPSO thin cloud emissivity + Lclopaquemeanzse, & ! CALIPSO opaque cloud altitude with respect to SE + Lclthinmeanzse, & ! CALIPSO thin cloud altitude with respect to SE + Lclzopaquecalipsose,& ! CALIPSO z_opaque altitude with respect to SE LcfadDbze94, & ! CLOUDSAT radar reflectivity CFAD Ldbze94, & ! CLOUDSAT radar reflectivity LparasolRefl, & ! PARASOL reflectance @@ -1052,6 +1169,24 @@ subroutine construct_cosp_outputs(Lpctisccp,Lclisccp,& Lclmcalipsoun .or. Lclhcalipsoun .or. Lcltcalipsoun) then allocate(x%calipso_cldlayerphase(Npoints,LIDAR_NCAT,6)) endif + if (Lclopaquecalipso .or. Lclthincalipso .or. Lclzopaquecalipso) then + allocate(x%calipso_cldtype(Npoints,LIDAR_NTYPE)) + endif + if (Lclopaquetemp .or. Lclthintemp .or. Lclzopaquetemp) then + allocate(x%calipso_cldtypetemp(Npoints,LIDAR_NTYPE)) + endif + if (Lclopaquemeanz .or. Lclthinmeanz) then + allocate(x%calipso_cldtypemeanz(Npoints,2)) + endif + if (Lclopaquemeanzse .or. Lclthinmeanzse .or. Lclzopaquecalipsose) then + allocate(x%calipso_cldtypemeanzse(Npoints,3)) + endif + if (Lclthinemis) then + allocate(x%calipso_cldthinemis(Npoints)) + endif + if (Lclcalipsoopaque .or. Lclcalipsothin .or. Lclcalipsozopaque .or. Lclcalipsoopacity) then + allocate(x%calipso_lidarcldtype(Npoints,Nlvgrid,LIDAR_NTYPE+1)) + endif ! These 2 outputs are part of the calipso output type, but are not controlled by an ! logical switch in the output namelist, so if all other fields are on, then allocate if (LlidarBetaMol532 .or. Latb532 .or. LcfadLidarsr532 .or. Lclcalipso .or. & @@ -1064,7 +1199,31 @@ subroutine construct_cosp_outputs(Lpctisccp,Lclisccp,& Lcllcalipsoun .or. Lclmcalipsoun .or. Lclhcalipsoun .or. Lcltcalipsoun) then allocate(x%calipso_tau_tot(Npoints,Ncolumns,Nlevels)) allocate(x%calipso_temp_tot(Npoints,Nlevels)) + endif + + ! GROUND LIDAR @ 532NM simulator + if (LlidarBetaMol532gr) allocate(x%grLidar532_beta_mol(Npoints,Nlevels)) + if (Latb532gr) allocate(x%grLidar532_beta_tot(Npoints,Ncolumns,Nlevels)) + if (LcfadLidarsr532gr) then + allocate(x%grLidar532_srbval(SR_BINS+1)) + allocate(x%grLidar532_cfad_sr(Npoints,SR_BINS,Nlvgrid)) + endif + if (LclgrLidar532) allocate(x%grLidar532_lidarcld(Npoints,Nlvgrid)) + if (LclhgrLidar532 .or. LclmgrLidar532 .or. LcllgrLidar532 .or. LcltgrLidar532) then + allocate(x%grLidar532_cldlayer(Npoints,LIDAR_NCAT)) + endif + + ! ATLID simulator + if (LlidarBetaMol355) allocate(x%atlid_beta_mol(Npoints,Nlevels)) + if (Latb355) allocate(x%atlid_beta_tot(Npoints,Ncolumns,Nlevels)) + if (LcfadLidarsr355) then + allocate(x%atlid_srbval(SR_BINS+1)) + allocate(x%atlid_cfad_sr(Npoints,SR_BINS,Nlvgrid)) endif + if (Lclatlid) allocate(x%atlid_lidarcld(Npoints,Nlvgrid)) + if (Lclhatlid .or. Lclmatlid .or. Lcllatlid .or. Lcltatlid) then + allocate(x%atlid_cldlayer(Npoints,LIDAR_NCAT)) + endif ! PARASOL if (Lparasolrefl) then @@ -1091,25 +1250,33 @@ end subroutine construct_cosp_outputs subroutine destroy_cospIN(y) type(cosp_optical_inputs),intent(inout) :: y - if (allocated(y%tau_067)) deallocate(y%tau_067) - if (allocated(y%emiss_11)) deallocate(y%emiss_11) - if (allocated(y%frac_out)) deallocate(y%frac_out) - if (allocated(y%beta_mol)) deallocate(y%beta_mol) - if (allocated(y%tau_mol)) deallocate(y%tau_mol) - if (allocated(y%betatot)) deallocate(y%betatot) - if (allocated(y%betatot_ice)) deallocate(y%betatot_ice) - if (allocated(y%betatot_liq)) deallocate(y%betatot_liq) - if (allocated(y%tautot)) deallocate(y%tautot) - if (allocated(y%tautot_ice)) deallocate(y%tautot_ice) - if (allocated(y%tautot_liq)) deallocate(y%tautot_liq) - if (allocated(y%tautot_S_liq)) deallocate(y%tautot_S_liq) - if (allocated(y%tautot_S_ice)) deallocate(y%tautot_S_ice) - if (allocated(y%z_vol_cloudsat)) deallocate(y%z_vol_cloudsat) - if (allocated(y%kr_vol_cloudsat)) deallocate(y%kr_vol_cloudsat) - if (allocated(y%g_vol_cloudsat)) deallocate(y%g_vol_cloudsat) - if (allocated(y%asym)) deallocate(y%asym) - if (allocated(y%ss_alb)) deallocate(y%ss_alb) - if (allocated(y%fracLiq)) deallocate(y%fracLiq) + if (allocated(y%tau_067)) deallocate(y%tau_067) + if (allocated(y%emiss_11)) deallocate(y%emiss_11) + if (allocated(y%frac_out)) deallocate(y%frac_out) + if (allocated(y%beta_mol_calipso)) deallocate(y%beta_mol_calipso) + if (allocated(y%tau_mol_calipso)) deallocate(y%tau_mol_calipso) + if (allocated(y%betatot_calipso)) deallocate(y%betatot_calipso) + if (allocated(y%betatot_ice_calipso)) deallocate(y%betatot_ice_calipso) + if (allocated(y%betatot_liq_calipso)) deallocate(y%betatot_liq_calipso) + if (allocated(y%tautot_calipso)) deallocate(y%tautot_calipso) + if (allocated(y%tautot_ice_calipso)) deallocate(y%tautot_ice_calipso) + if (allocated(y%tautot_liq_calipso)) deallocate(y%tautot_liq_calipso) + if (allocated(y%tautot_S_liq)) deallocate(y%tautot_S_liq) + if (allocated(y%tautot_S_ice)) deallocate(y%tautot_S_ice) + if (allocated(y%z_vol_cloudsat)) deallocate(y%z_vol_cloudsat) + if (allocated(y%kr_vol_cloudsat)) deallocate(y%kr_vol_cloudsat) + if (allocated(y%g_vol_cloudsat)) deallocate(y%g_vol_cloudsat) + if (allocated(y%asym)) deallocate(y%asym) + if (allocated(y%ss_alb)) deallocate(y%ss_alb) + if (allocated(y%fracLiq)) deallocate(y%fracLiq) + if (allocated(y%beta_mol_grLidar532)) deallocate(y%beta_mol_grLidar532) + if (allocated(y%betatot_grLidar532)) deallocate(y%betatot_grLidar532) + if (allocated(y%tau_mol_grLidar532)) deallocate(y%tau_mol_grLidar532) + if (allocated(y%tautot_grLidar532)) deallocate(y%tautot_grLidar532) + if (allocated(y%beta_mol_atlid)) deallocate(y%beta_mol_atlid) + if (allocated(y%betatot_atlid)) deallocate(y%betatot_atlid) + if (allocated(y%tau_mol_atlid)) deallocate(y%tau_mol_atlid) + if (allocated(y%tautot_atlid)) deallocate(y%tautot_atlid) end subroutine destroy_cospIN !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -1139,6 +1306,7 @@ subroutine destroy_cospstateIN(y) if (allocated(y%fl_snow)) deallocate(y%fl_snow) if (allocated(y%tca)) deallocate(y%tca) if (allocated(y%hgt_matrix_half)) deallocate(y%hgt_matrix_half) + if (allocated(y%surfelev)) deallocate(y%surfelev) end subroutine destroy_cospstateIN @@ -1173,6 +1341,10 @@ subroutine destroy_cosp_outputs(y) deallocate(y%calipso_lidarcldphase) nullify(y%calipso_lidarcldphase) endif + if (associated(y%calipso_lidarcldtype)) then + deallocate(y%calipso_lidarcldtype) + nullify(y%calipso_lidarcldtype) + endif if (associated(y%calipso_cldlayerphase)) then deallocate(y%calipso_cldlayerphase) nullify(y%calipso_cldlayerphase) @@ -1185,6 +1357,26 @@ subroutine destroy_cosp_outputs(y) deallocate(y%calipso_cldlayer) nullify(y%calipso_cldlayer) endif + if (associated(y%calipso_cldtype)) then + deallocate(y%calipso_cldtype) + nullify(y%calipso_cldtype) + endif + if (associated(y%calipso_cldtypetemp)) then + deallocate(y%calipso_cldtypetemp) + nullify(y%calipso_cldtypetemp) + endif + if (associated(y%calipso_cldtypemeanz)) then + deallocate(y%calipso_cldtypemeanz) + nullify(y%calipso_cldtypemeanz) + endif + if (associated(y%calipso_cldtypemeanzse)) then + deallocate(y%calipso_cldtypemeanzse) + nullify(y%calipso_cldtypemeanzse) + endif + if (associated(y%calipso_cldthinemis)) then + deallocate(y%calipso_cldthinemis) + nullify(y%calipso_cldthinemis) + endif if (associated(y%calipso_lidarcld)) then deallocate(y%calipso_lidarcld) nullify(y%calipso_lidarcld) @@ -1197,6 +1389,54 @@ subroutine destroy_cosp_outputs(y) deallocate(y%calipso_cfad_sr) nullify(y%calipso_cfad_sr) endif + if (associated(y%grLidar532_beta_mol)) then + deallocate(y%grLidar532_beta_mol) + nullify(y%grLidar532_beta_mol) + endif + if (associated(y%grLidar532_beta_tot)) then + deallocate(y%grLidar532_beta_tot) + nullify(y%grLidar532_beta_tot) + endif + if (associated(y%grLidar532_cldlayer)) then + deallocate(y%grLidar532_cldlayer) + nullify(y%grLidar532_cldlayer) + endif + if (associated(y%grLidar532_lidarcld)) then + deallocate(y%grLidar532_lidarcld) + nullify(y%grLidar532_lidarcld) + endif + if (associated(y%grLidar532_cfad_sr)) then + deallocate(y%grLidar532_cfad_sr) + nullify(y%grLidar532_cfad_sr) + endif + if (associated(y%grLidar532_srbval)) then + deallocate(y%grLidar532_srbval) + nullify(y%grLidar532_srbval) + endif + if (associated(y%atlid_beta_mol)) then + deallocate(y%atlid_beta_mol) + nullify(y%atlid_beta_mol) + endif + if (associated(y%atlid_beta_tot)) then + deallocate(y%atlid_beta_tot) + nullify(y%atlid_beta_tot) + endif + if (associated(y%atlid_cldlayer)) then + deallocate(y%atlid_cldlayer) + nullify(y%atlid_cldlayer) + endif + if (associated(y%atlid_lidarcld)) then + deallocate(y%atlid_lidarcld) + nullify(y%atlid_lidarcld) + endif + if (associated(y%atlid_cfad_sr)) then + deallocate(y%atlid_cfad_sr) + nullify(y%atlid_cfad_sr) + endif + if (associated(y%atlid_srbval)) then + deallocate(y%atlid_srbval) + nullify(y%atlid_srbval) + endif if (associated(y%parasolPix_refl)) then deallocate(y%parasolPix_refl) nullify(y%parasolPix_refl) diff --git a/src/cosp.F90 b/src/cosp.F90 index bdbf01a064..bc9237d0ca 100644 --- a/src/cosp.F90 +++ b/src/cosp.F90 @@ -28,13 +28,15 @@ ! ! History: ! May 2015- D. Swales - Original version +! Mar 2018- R. Guzman - Added OPAQ diagnostics and GLID simulator +! Apr 2018- R. Guzman - Added ATLID simulator ! ! %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% MODULE MOD_COSP USE COSP_KINDS, ONLY: wp - USE MOD_COSP_CONFIG, ONLY: R_UNDEF,PARASOL_NREFL,LIDAR_NCAT,SR_BINS, & + USE MOD_COSP_CONFIG, ONLY: R_UNDEF,PARASOL_NREFL,LIDAR_NCAT,LIDAR_NTYPE, SR_BINS,& N_HYDRO,RTTOV_MAX_CHANNELS,numMISRHgtBins, & DBZE_BINS,LIDAR_NTEMP,calipso_histBsct, & use_vgrid,Nlvgrid,vgrid_zu,vgrid_zl,vgrid_z, & @@ -43,22 +45,25 @@ MODULE MOD_COSP numISCCPTauBins,numISCCPPresBins,numMISRTauBins,& ntau,modis_histTau,tau_binBounds, & modis_histTauEdges,tau_binEdges, & - modis_histTauCenters,tau_binCenters - USE MOD_COSP_MODIS_INTERFACE, ONLY: cosp_modis_init, modis_IN - USE MOD_COSP_RTTOV_INTERFACE, ONLY: cosp_rttov_init, rttov_IN - USE MOD_COSP_MISR_INTERFACE, ONLY: cosp_misr_init, misr_IN - USE MOD_COSP_ISCCP_INTERFACE, ONLY: cosp_isccp_init, isccp_IN - USE MOD_COSP_CALIPSO_INTERFACE, ONLY: cosp_calipso_init, calipso_IN - USE MOD_COSP_PARASOL_INTERFACE, ONLY: cosp_parasol_init, parasol_in - USE MOD_COSP_CLOUDSAT_INTERFACE, ONLY: cosp_cloudsat_init, cloudsat_IN - USE quickbeam, ONLY: quickbeam_subcolumn, quickbeam_column, radar_cfg - USE MOD_ICARUS, ONLY: icarus_subcolumn, icarus_column - USE MOD_MISR_SIMULATOR, ONLY: misr_subcolumn, misr_column - USE MOD_LIDAR_SIMULATOR, ONLY: lidar_subcolumn, lidar_column - 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 + modis_histTauCenters,tau_binCenters, & + grLidar532_histBsct,atlid_histBsct + USE MOD_COSP_MODIS_INTERFACE, ONLY: cosp_modis_init, modis_IN + USE MOD_COSP_RTTOV_INTERFACE, ONLY: cosp_rttov_init, rttov_IN + USE MOD_COSP_MISR_INTERFACE, ONLY: cosp_misr_init, misr_IN + USE MOD_COSP_ISCCP_INTERFACE, ONLY: cosp_isccp_init, isccp_IN + USE MOD_COSP_CALIPSO_INTERFACE, ONLY: cosp_calipso_init, calipso_IN + USE MOD_COSP_ATLID_INTERFACE, ONLY: cosp_atlid_init, atlid_IN + USE MOD_COSP_GRLIDAR532_INTERFACE, ONLY: cosp_grLidar532_init, grLidar532_IN + USE MOD_COSP_PARASOL_INTERFACE, ONLY: cosp_parasol_init, parasol_in + USE MOD_COSP_CLOUDSAT_INTERFACE, ONLY: cosp_cloudsat_init, cloudsat_IN + USE quickbeam, ONLY: quickbeam_subcolumn, quickbeam_column, radar_cfg + USE MOD_ICARUS, ONLY: icarus_subcolumn, icarus_column + USE MOD_MISR_SIMULATOR, ONLY: misr_subcolumn, misr_column + USE MOD_LIDAR_SIMULATOR, ONLY: lidar_subcolumn, lidar_column + 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 IMPLICIT NONE @@ -86,7 +91,8 @@ MODULE MOD_COSP real(wp),allocatable,dimension(:) :: & land, & ! Land/Sea mask (0-1) - skt ! Surface temperature (K) + skt, & ! Surface temperature (K) + surfelev ! Surface Elevation (m) ! Fields used ONLY by RTTOV integer :: & month ! Month for surface emissivty atlas (1-12) @@ -120,33 +126,41 @@ MODULE MOD_COSP Npoints, & ! Number of gridpoints. Ncolumns, & ! Number of columns. Nlevels, & ! Number of levels. - Npart, & ! Number of cloud meteors for LIDAR simulator. + Npart, & ! Number of cloud meteors for LIDAR simulators. Nrefl ! Number of reflectances for PARASOL simulator real(wp) :: & - emsfc_lw ! 11 micron surface emissivity + emsfc_lw ! Surface emissivity @ 11micron real(wp),allocatable,dimension(:,:,:) :: & frac_out, & ! Cloud fraction - tau_067, & ! Optical depth - fracLiq, & ! Cloud fraction - emiss_11, & ! Emissivity - asym, & ! Assymetry parameter - ss_alb, & ! Single-scattering albedo - betatot, & ! Backscatter coefficient for polarized optics (total) - betatot_ice, & ! Backscatter coefficient for polarized optics (ice) - betatot_liq, & ! Backscatter coefficient for polarized optics (liquid) - tautot, & ! Optical thickess integrated from top (total) - tautot_ice, & ! Optical thickess integrated from top (ice) - tautot_liq, & ! Optical thickess integrated from top (liquid) + tau_067, & ! Optical depth @ 0.67micron + emiss_11, & ! Emissivity @ 11 micron + fracLiq, & ! Fraction of optical-depth due to liquid (MODIS) + asym, & ! Assymetry parameter @ 3.7micron (MODIS) + ss_alb, & ! Single-scattering albedo @ 3.7micron (MODIS) + betatot_calipso, & ! Lidar backscatter coefficient (calipso @ 532nm) + betatot_grLidar532, & ! Lidar backscatter coefficient (ground-lidar @ 532nm) + betatot_atlid, & ! Lidar backscatter coefficient (atlid @ 355nm) + betatot_ice_calipso, & ! Lidar backscatter coefficient ICE (calipso @ 532nm) + betatot_liq_calipso, & ! Lidar backscatter coefficient LIQUID (calipso @ 532nm) + tautot_calipso, & ! Lidar Optical thickness (calipso @ 532nm) + tautot_grLidar532, & ! Lidar Optical thickness (ground-lidar @ 532nm) + tautot_atlid, & ! Lidar Optical thickness (atlid @ 355nm) + tautot_ice_calipso, & ! Lidar Ice Optical thickness (calipso @ 532nm) + tautot_liq_calipso, & ! Lidar Liquid Optical thickness (calipso @ 532nm) z_vol_cloudsat, & ! Effective reflectivity factor (mm^6/m^3) kr_vol_cloudsat, & ! Attenuation coefficient hydro (dB/km) g_vol_cloudsat ! Attenuation coefficient gases (dB/km) real(wp),allocatable,dimension(:,:) :: & - beta_mol, & ! Molecular backscatter coefficient - tau_mol, & ! Molecular optical depth - tautot_S_liq, & ! Liquid water optical thickness, from TOA to SFC - tautot_S_ice ! Ice water optical thickness, from TOA to SFC + beta_mol_calipso, & ! Lidar molecular backscatter coefficient (calipso @ 532nm) + beta_mol_grLidar532, & ! Lidar molecular backscatter coefficient (ground-lidar @ 532nm) + beta_mol_atlid, & ! Lidar molecular backscatter coefficient (atlid @ 355nm) + tau_mol_calipso, & ! Lidar molecular optical depth (calipso @ 532nm) + tau_mol_grLidar532, & ! Lidar molecular optical depth (ground-lidar @ 532nm) + tau_mol_atlid, & ! Lidar molecular optical depth (atlid @ 355nm) + tautot_S_liq, & ! Parasol Liquid water optical thickness, from TOA to SFC + tautot_S_ice ! Parasol Ice water optical thickness, from TOA to SFC type(radar_cfg) :: & - rcfg_cloudsat ! Radar comfiguration information (CLOUDSAT) + rcfg_cloudsat ! Radar configuration information (CLOUDSAT) end type cosp_optical_inputs ! ###################################################################################### @@ -160,17 +174,46 @@ MODULE MOD_COSP calipso_beta_tot => null(), & ! Total backscattered signal calipso_tau_tot => null(), & ! Optical thickness integrated from top to level z calipso_lidarcldphase => null(), & ! 3D "lidar" phase cloud fraction + calipso_lidarcldtype => null(), & ! 3D "lidar" OPAQ type fraction calipso_cldlayerphase => null(), & ! low, mid, high-level lidar phase cloud cover calipso_lidarcldtmp => null(), & ! 3D "lidar" phase cloud temperature calipso_cfad_sr => null() ! CFAD of scattering ratio real(wp), dimension(:,:),pointer :: & - calipso_lidarcld => null(), & ! 3D "lidar" cloud fraction + calipso_lidarcld => null(), & ! 3D "lidar" cloud fraction calipso_cldlayer => null(), & ! low, mid, high-level, total lidar cloud cover + calipso_cldtype => null(), & ! opaque and thin lidar cloud cover + z_opaque altitude + calipso_cldtypetemp => null(), & ! opaque and thin cloud temperature + calipso_cldtypemeanz => null(), & ! opaque and thin cloud altitude + calipso_cldtypemeanzse => null(),& ! same as just above with respect to SE calipso_beta_mol => null(), & ! Molecular backscatter calipso_temp_tot => null() real(wp), dimension(:),pointer :: & + calipso_cldthinemis => null(), & ! thin cloud emissivity calipso_srbval => null() ! SR bins in cfad_sr + ! GROUND LIDAR outputs + real(wp),dimension(:,:,:),pointer :: & + grLidar532_beta_tot => null(), & ! Total GROUND LIDAR backscattered signal + grLidar532_cfad_sr => null() ! CFAD of GROUND LIDAR scattering ratio + real(wp), dimension(:,:),pointer :: & + grLidar532_lidarcld => null(), & ! 3D GROUND "lidar" cloud fraction + grLidar532_cldlayer => null(), & ! low, mid, high-level, total GROUND lidar cloud cover + grLidar532_beta_mol => null() ! GROUND LIDAR Molecular backscatter + real(wp), dimension(:),pointer :: & + grLidar532_srbval => null() ! SR bins in cfad_sr + + ! ATLID outputs + real(wp),dimension(:,:,:),pointer :: & + atlid_beta_tot => null(), & ! Total ATLID backscattered signal + atlid_cfad_sr => null() ! CFAD of ATLID scattering ratio + real(wp), dimension(:,:),pointer :: & + atlid_lidarcld => null(), & ! 3D ATLID cloud fraction + atlid_cldlayer => null(), & ! low, mid, high-level, total ATLID cloud cover + atlid_beta_mol => null() ! ATLID Molecular backscatter + real(wp), dimension(:),pointer :: & + atlid_srbval => null() ! SR bins in cfad_sr + + ! PARASOL outputs real(wp),dimension(:,:,:),pointer :: & parasolPix_refl => null() ! PARASOL reflectances (subcolumn) @@ -254,6 +297,8 @@ function COSP_SIMULATOR(cospIN,cospgridIN,cospOUT,start_idx,stop_idx,debug) type(isccp_IN) :: isccpIN ! Input to the ISCCP simulator type(misr_IN) :: misrIN ! Input to the LIDAR simulator type(calipso_IN) :: calipsoIN ! Input to the LIDAR simulator + type(grLidar532_IN) :: grLidar532IN ! Input to the GROUND LIDAR simulator + type(atlid_IN) :: atlidIN ! Input to the ATLID simulator type(parasol_IN) :: parasolIN ! Input to the PARASOL simulator type(cloudsat_IN) :: cloudsatIN ! Input to the CLOUDSAT radar simulator type(modis_IN) :: modisIN ! Input to the MODIS simulator @@ -271,26 +316,32 @@ function COSP_SIMULATOR(cospIN,cospgridIN,cospOUT,start_idx,stop_idx,debug) integer,target :: & Npoints logical :: & - Lisccp_subcolumn, & ! On/Off switch for subcolumn ISCCP simulator - Lmisr_subcolumn, & ! On/Off switch for subcolumn MISR simulator - Lcalipso_subcolumn, & ! On/Off switch for subcolumn CALIPSO simulator - Lparasol_subcolumn, & ! On/Off switch for subcolumn PARASOL simulator - Lcloudsat_subcolumn, & ! On/Off switch for subcolumn CLOUDSAT simulator - Lmodis_subcolumn, & ! On/Off switch for subcolumn MODIS simulator - Lrttov_subcolumn, & ! On/Off switch for subcolumn RTTOV simulator - Lisccp_column, & ! On/Off switch for column ISCCP simulator - Lmisr_column, & ! On/Off switch for column MISR simulator - Lcalipso_column, & ! On/Off switch for column CALIPSO simulator - Lparasol_column, & ! On/Off switch for column PARASOL simulator - Lcloudsat_column, & ! On/Off switch for column CLOUDSAT simulator - Lmodis_column, & ! On/Off switch for column MODIS simulator - Lrttov_column, & ! On/Off switch for column RTTOV simulator (not used) - Lradar_lidar_tcc, & ! On/Off switch from joint Calipso/Cloudsat product + Lisccp_subcolumn, & ! On/Off switch for subcolumn ISCCP simulator + Lmisr_subcolumn, & ! On/Off switch for subcolumn MISR simulator + Lcalipso_subcolumn, & ! On/Off switch for subcolumn CALIPSO simulator + LgrLidar532_subcolumn,& ! On/Off switch for subcolumn GROUND LIDAR simulator + Latlid_subcolumn, & ! On/Off switch for subcolumn ATLID simulator + Lparasol_subcolumn, & ! On/Off switch for subcolumn PARASOL simulator + Lcloudsat_subcolumn, & ! On/Off switch for subcolumn CLOUDSAT simulator + Lmodis_subcolumn, & ! On/Off switch for subcolumn MODIS simulator + Lrttov_subcolumn, & ! On/Off switch for subcolumn RTTOV simulator + Lisccp_column, & ! On/Off switch for column ISCCP simulator + Lmisr_column, & ! On/Off switch for column MISR simulator + Lcalipso_column, & ! On/Off switch for column CALIPSO simulator + LgrLidar532_column, & ! On/Off switch for column GROUND LIDAR simulator + Latlid_column, & ! On/Off switch for column ATLID simulator + Lparasol_column, & ! On/Off switch for column PARASOL simulator + Lcloudsat_column, & ! On/Off switch for column CLOUDSAT simulator + Lmodis_column, & ! On/Off switch for column MODIS simulator + Lrttov_column, & ! On/Off switch for column RTTOV simulator (not used) + Lradar_lidar_tcc, & ! On/Off switch from joint Calipso/Cloudsat product Llidar_only_freq_cloud ! On/Off switch from joint Calipso/Cloudsat product logical :: & - ok_lidar_cfad = .false., & - lrttov_cleanUp = .false. - + ok_lidar_cfad = .false., & + ok_lidar_cfad_grLidar532 = .false., & + ok_lidar_cfad_atlid = .false., & + lrttov_cleanUp = .false. + integer, dimension(:,:),allocatable :: & modisRetrievedPhase,isccpLEVMATCH real(wp), dimension(:), allocatable :: & @@ -303,12 +354,15 @@ function COSP_SIMULATOR(cospIN,cospgridIN,cospOUT,start_idx,stop_idx,debug) REAL(WP), dimension(:,:),allocatable :: & modisRetrievedCloudTopPressure,modisRetrievedTau,modisRetrievedSize, & misr_boxtau,misr_boxztop,misr_dist_model_layertops,isccp_boxtau, & - isccp_boxttop,isccp_boxptop,calipso_beta_mol,lidar_only_freq_cloud + isccp_boxttop,isccp_boxptop,calipso_beta_mol,lidar_only_freq_cloud, & + grLidar532_beta_mol,atlid_beta_mol REAL(WP), dimension(:,:,:),allocatable :: & modisJointHistogram,modisJointHistogramIce,modisJointHistogramLiq, & - calipso_beta_tot,calipso_betaperp_tot, cloudsatDBZe,parasolPix_refl + calipso_beta_tot,calipso_betaperp_tot, cloudsatDBZe,parasolPix_refl, & + grLidar532_beta_tot,atlid_beta_tot real(wp),dimension(:),allocatable,target :: & - out1D_1,out1D_2,out1D_3,out1D_4,out1D_5,out1D_6 + out1D_1,out1D_2,out1D_3,out1D_4,out1D_5,out1D_6,out1D_7,out1D_8, & + out1D_9,out1D_10,out1D_11,out1D_12 real(wp),dimension(:,:,:),allocatable :: & betamol_in,betamolFlip,pnormFlip,ze_totFlip @@ -337,6 +391,8 @@ function COSP_SIMULATOR(cospIN,cospgridIN,cospOUT,start_idx,stop_idx,debug) Lisccp_subcolumn = .false. Lmisr_subcolumn = .false. Lcalipso_subcolumn = .false. + LgrLidar532_subcolumn = .false. + Latlid_subcolumn = .false. Lparasol_subcolumn = .false. Lcloudsat_subcolumn = .false. Lmodis_subcolumn = .false. @@ -344,6 +400,8 @@ function COSP_SIMULATOR(cospIN,cospgridIN,cospOUT,start_idx,stop_idx,debug) Lisccp_column = .false. Lmisr_column = .false. Lcalipso_column = .false. + LgrLidar532_column = .false. + Latlid_column = .false. Lparasol_column = .false. Lcloudsat_column = .false. Lmodis_column = .false. @@ -392,6 +450,16 @@ function COSP_SIMULATOR(cospIN,cospgridIN,cospOUT,start_idx,stop_idx,debug) associated(cospOUT%calipso_beta_tot)) & Lcalipso_subcolumn = .true. + ! GROUND LIDAR subcolumn + if (associated(cospOUT%grLidar532_beta_mol) .or. & + associated(cospOUT%grLidar532_beta_tot)) & + LgrLidar532_subcolumn = .true. + + ! ATLID subcolumn + if (associated(cospOUT%atlid_beta_mol) .or. & + associated(cospOUT%atlid_beta_tot)) & + Latlid_subcolumn = .true. + ! PARASOL subcolumn if (associated(cospOUT%parasolPix_refl)) & Lparasol_subcolumn = .true. @@ -426,13 +494,35 @@ function COSP_SIMULATOR(cospIN,cospgridIN,cospOUT,start_idx,stop_idx,debug) if (associated(cospOUT%calipso_cfad_sr) .or. & associated(cospOUT%calipso_lidarcld) .or. & associated(cospOUT%calipso_lidarcldphase) .or. & + associated(cospOUT%calipso_lidarcldtype) .or. & associated(cospOUT%calipso_cldlayer) .or. & + associated(cospOUT%calipso_cldtype) .or. & + associated(cospOUT%calipso_cldtypetemp) .or. & + associated(cospOUT%calipso_cldtypemeanz) .or. & + associated(cospOUT%calipso_cldtypemeanzse) .or. & + associated(cospOUT%calipso_cldthinemis) .or. & associated(cospOUT%calipso_cldlayerphase) .or. & associated(cospOUT%calipso_lidarcldtmp)) then Lcalipso_column = .true. Lcalipso_subcolumn = .true. endif + ! GROUND LIDAR column + if (associated(cospOUT%grLidar532_cfad_sr) .or. & + associated(cospOUT%grLidar532_lidarcld) .or. & + associated(cospOUT%grLidar532_cldlayer)) then + LgrLidar532_column = .true. + LgrLidar532_subcolumn = .true. + endif + + ! ATLID column + if (associated(cospOUT%atlid_cfad_sr) .or. & + associated(cospOUT%atlid_lidarcld) .or. & + associated(cospOUT%atlid_cldlayer)) then + Latlid_column = .true. + Latlid_subcolumn = .true. + endif + ! PARASOL column if (associated(cospOUT%parasolGrid_refl)) then Lparasol_column = .true. @@ -483,12 +573,12 @@ function COSP_SIMULATOR(cospIN,cospgridIN,cospOUT,start_idx,stop_idx,debug) ! Enforce bounds on input fields. If input field is out-of-bounds, report error ! and turn off simulator !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - call cosp_errorCheck(cospgridIN,cospIN,Lisccp_subcolumn,Lisccp_column, & - Lmisr_subcolumn,Lmisr_column,Lmodis_subcolumn,Lmodis_column, & - Lcloudsat_subcolumn,Lcloudsat_column,Lcalipso_subcolumn, & - Lcalipso_column,Lrttov_subcolumn,Lrttov_column, & - Lparasol_subcolumn,Lparasol_column,Lradar_lidar_tcc, & - Llidar_only_freq_cloud,cospOUT,cosp_simulator,nError) + call cosp_errorCheck(cospgridIN, cospIN, Lisccp_subcolumn, Lisccp_column, & + Lmisr_subcolumn, Lmisr_column, Lmodis_subcolumn, Lmodis_column, & + Lcloudsat_subcolumn, Lcloudsat_column, Lcalipso_subcolumn, Lcalipso_column, & + Latlid_subcolumn, Latlid_column, LgrLidar532_subcolumn, LgrLidar532_column, & + Lrttov_subcolumn, Lrttov_column, Lparasol_subcolumn, Lparasol_column, & + Lradar_lidar_tcc, Llidar_only_freq_cloud, cospOUT, cosp_simulator, nError) !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ! 3) Populate instrument simulator inputs @@ -523,16 +613,36 @@ function COSP_SIMULATOR(cospIN,cospgridIN,cospOUT,start_idx,stop_idx,debug) calipsoIN%Npoints => Npoints calipsoIN%Ncolumns => cospIN%Ncolumns calipsoIN%Nlevels => cospIN%Nlevels - calipsoIN%beta_mol => cospIN%beta_mol - calipsoIN%betatot => cospIN%betatot - calipsoIN%betatot_liq => cospIN%betatot_liq - calipsoIN%betatot_ice => cospIN%betatot_ice - calipsoIN%tau_mol => cospIN%tau_mol - calipsoIN%tautot => cospIN%tautot - calipsoIN%tautot_liq => cospIN%tautot_liq - calipsoIN%tautot_ice => cospIN%tautot_ice + calipsoIN%beta_mol => cospIN%beta_mol_calipso + calipsoIN%betatot => cospIN%betatot_calipso + calipsoIN%betatot_liq => cospIN%betatot_liq_calipso + calipsoIN%betatot_ice => cospIN%betatot_ice_calipso + calipsoIN%tau_mol => cospIN%tau_mol_calipso + calipsoIN%tautot => cospIN%tautot_calipso + calipsoIN%tautot_liq => cospIN%tautot_liq_calipso + calipsoIN%tautot_ice => cospIN%tautot_ice_calipso + endif + + if (LgrLidar532_subcolumn) then + grLidar532IN%Npoints => Npoints + grLidar532IN%Ncolumns => cospIN%Ncolumns + grLidar532IN%Nlevels => cospIN%Nlevels + grLidar532IN%beta_mol => cospIN%beta_mol_grLidar532 + grLidar532IN%betatot => cospIN%betatot_grLidar532 + grLidar532IN%tau_mol => cospIN%tau_mol_grLidar532 + grLidar532IN%tautot => cospIN%tautot_grLidar532 endif - + + if (Latlid_subcolumn) then + atlidIN%Npoints => Npoints + atlidIN%Ncolumns => cospIN%Ncolumns + atlidIN%Nlevels => cospIN%Nlevels + atlidIN%beta_mol_atlid => cospIN%beta_mol_atlid + atlidIN%betatot_atlid => cospIN%betatot_atlid + atlidIN%tau_mol_atlid => cospIN%tau_mol_atlid + atlidIN%tautot_atlid => cospIN%tautot_atlid + endif + if (Lparasol_subcolumn) then parasolIN%Npoints => Npoints parasolIN%Nlevels => cospIN%Nlevels @@ -661,12 +771,11 @@ function COSP_SIMULATOR(cospIN,cospgridIN,cospOUT,start_idx,stop_idx,debug) calipso_beta_tot(calipsoIN%Npoints,calipsoIN%Ncolumns,calipsoIN%Nlevels),& calipso_betaperp_tot(calipsoIN%Npoints,calipsoIN%Ncolumns,calipsoIN%Nlevels)) ! Call simulator - call lidar_subcolumn(calipsoIN%npoints,calipsoIN%ncolumns,calipsoIN%nlevels, & - calipsoIN%beta_mol,calipsoIN%tau_mol, & - calipsoIN%betatot,calipsoIN%tautot,calipsoIN%betatot_ice, & - calipsoIN%tautot_ice,calipsoIN%betatot_liq, & - calipsoIN%tautot_liq,calipso_beta_mol(:,:), & - calipso_beta_tot(:,:,:),calipso_betaperp_tot(:,:,:)) + call lidar_subcolumn(calipsoIN%npoints, calipsoIN%ncolumns, calipsoIN%nlevels, .false., & + calipsoIN%beta_mol, calipsoIN%tau_mol, calipsoIN%betatot, calipsoIN%tautot, & + calipso_beta_mol(:,:), calipso_beta_tot(:,:,:), calipsoIN%betatot_ice, & + calipsoIN%tautot_ice, calipsoIN%betatot_liq, calipsoIN%tautot_liq, & + calipso_betaperp_tot(:,:,:)) ! Store output (if requested) if (associated(cospOUT%calipso_beta_mol)) & cospOUT%calipso_beta_mol(ij:ik,calipsoIN%Nlevels:1:-1) = calipso_beta_mol @@ -674,7 +783,38 @@ function COSP_SIMULATOR(cospIN,cospgridIN,cospOUT,start_idx,stop_idx,debug) cospOUT%calipso_beta_tot(ij:ik,:,calipsoIN%Nlevels:1:-1) = calipso_beta_tot if (associated(cospOUT%calipso_betaperp_tot)) & cospOUT%calipso_betaperp_tot(ij:ik,:,:) = calipso_betaperp_tot + endif + ! GROUND LIDAR subcolumn simulator + if (LgrLidar532_subcolumn) then + ! Allocate space for local variables + allocate(grLidar532_beta_mol(grLidar532IN%Npoints,grLidar532IN%Nlevels), & + grLidar532_beta_tot(grLidar532IN%Npoints,grLidar532IN%Ncolumns,grLidar532IN%Nlevels)) + ! Call simulator + call lidar_subcolumn(grLidar532IN%npoints, grLidar532IN%ncolumns, grLidar532IN%nlevels,& + .true., grLidar532IN%beta_mol, grLidar532IN%tau_mol, grLidar532IN%betatot,& + grLidar532IN%tautot, grLidar532_beta_mol(:,:), grLidar532_beta_tot(:,:,:)) + ! Store output (if requested) + if (associated(cospOUT%grLidar532_beta_mol)) & + cospOUT%grLidar532_beta_mol(ij:ik,grLidar532IN%Nlevels:1:-1) = grLidar532_beta_mol + if (associated(cospOUT%grLidar532_beta_tot)) & + cospOUT%grLidar532_beta_tot(ij:ik,:,grLidar532IN%Nlevels:1:-1) = grLidar532_beta_tot + endif + + ! ATLID subcolumn simulator + if (Latlid_subcolumn) then + ! Allocate space for local variables + allocate(atlid_beta_mol(atlidIN%Npoints,atlidIN%Nlevels), & + atlid_beta_tot(atlidIN%Npoints,atlidIN%Ncolumns,atlidIN%Nlevels)) + ! Call simulator + call lidar_subcolumn(atlidIN%npoints, atlidIN%ncolumns, atlidIN%nlevels,& + .false., atlidIN%beta_mol_atlid, atlidIN%tau_mol_atlid, atlidIN%betatot_atlid,& + atlidIN%tautot_atlid, atlid_beta_mol(:,:), atlid_beta_tot(:,:,:)) + ! Store output (if requested) + if (associated(cospOUT%atlid_beta_mol)) & + cospOUT%atlid_beta_mol(ij:ik,atlidIN%Nlevels:1:-1) = atlid_beta_mol + if (associated(cospOUT%atlid_beta_tot)) & + cospOUT%atlid_beta_tot(ij:ik,:,atlidIN%Nlevels:1:-1) = atlid_beta_tot endif ! PARASOL subcolumn simulator @@ -878,23 +1018,48 @@ function COSP_SIMULATOR(cospIN,cospgridIN,cospOUT,start_idx,stop_idx,debug) if (.not. associated(cospOUT%calipso_lidarcldtmp)) then allocate(out1D_6(Npoints*40*5)) cospOUT%calipso_lidarcldtmp(ij:ik,1:40,1:5) => out1D_6 + endif + if (.not. associated(cospOUT%calipso_lidarcldtype)) then + allocate(out1D_7(Npoints*Nlvgrid*4)) + cospOUT%calipso_lidarcldtype(ij:ik,1:Nlvgrid,1:4) => out1D_7 + endif + if (.not. associated(cospOUT%calipso_cldtype)) then + allocate(out1D_8(Npoints*LIDAR_NTYPE)) + cospOUT%calipso_cldtype(ij:ik,1:LIDAR_NTYPE) => out1D_8 + endif + if (.not. associated(cospOUT%calipso_cldtypetemp)) then + allocate(out1D_9(Npoints*LIDAR_NTYPE)) + cospOUT%calipso_cldtypetemp(ij:ik,1:LIDAR_NTYPE) => out1D_9 + endif + if (.not. associated(cospOUT%calipso_cldtypemeanz)) then + allocate(out1D_10(Npoints*2)) + cospOUT%calipso_cldtypemeanz(ij:ik,1:2) => out1D_10 + endif + if (.not. associated(cospOUT%calipso_cldtypemeanzse)) then + allocate(out1D_12(Npoints*3)) + cospOUT%calipso_cldtypemeanzse(ij:ik,1:3) => out1D_12 + endif + if (.not. associated(cospOUT%calipso_cldthinemis)) then + allocate(out1D_11(Npoints)) + cospOUT%calipso_cldthinemis(ij:ik) => out1D_11 endif - + ! Call simulator ok_lidar_cfad=.true. - call lidar_column(calipsoIN%Npoints,calipsoIN%Ncolumns,calipsoIN%Nlevels, & - Nlvgrid,SR_BINS,cospgridIN%at(:,:), & - calipso_beta_tot(:,:,:),calipso_betaperp_tot(:,:,:), & - calipso_beta_mol(:,:), & - cospgridIN%phalf(:,2:calipsoIN%Nlevels+1),ok_lidar_cfad, & - LIDAR_NCAT,cospOUT%calipso_cfad_sr(ij:ik,:,:), & - cospOUT%calipso_lidarcld(ij:ik,:), & - cospOUT%calipso_lidarcldphase(ij:ik,:,:), & - cospOUT%calipso_cldlayer(ij:ik,:), & - cospgridIN%hgt_matrix,cospgridIN%hgt_matrix_half, & - cospOUT%calipso_cldlayerphase(ij:ik,:,:), & - cospOUT%calipso_lidarcldtmp(ij:ik,:,:)) - if (associated(cospOUT%calipso_srbval)) cospOUT%calipso_srbval = calipso_histBsct + call lidar_column(calipsoIN%Npoints, calipsoIN%Ncolumns, calipsoIN%Nlevels, & + Nlvgrid, SR_BINS, LIDAR_NTYPE, 'calipso',calipso_beta_tot(:,:,:), calipso_beta_mol(:,:),& + cospgridIN%phalf(:,2:calipsoIN%Nlevels),cospgridIN%hgt_matrix, & + cospgridIN%hgt_matrix_half, vgrid_z(:), ok_lidar_cfad, LIDAR_NCAT, & + cospOUT%calipso_cfad_sr(ij:ik,:,:), cospOUT%calipso_lidarcld(ij:ik,:), & + cospOUT%calipso_cldlayer(ij:ik,:), & + cospgridIN%at(:,:), calipso_betaperp_tot(:,:,:), cospgridIN%surfelev, & + cospOUT%calipso_lidarcldphase(ij:ik,:,:), & + cospOUT%calipso_lidarcldtype(ij:ik,:,:), cospOUT%calipso_cldtype(ij:ik,:), & + cospOUT%calipso_cldtypetemp(ij:ik,:), cospOUT%calipso_cldtypemeanz(ij:ik,:), & + cospOUT%calipso_cldtypemeanzse(ij:ik,:), cospOUT%calipso_cldthinemis(ij:ik), & + cospOUT%calipso_cldlayerphase(ij:ik,:,:), cospOUT%calipso_lidarcldtmp(ij:ik,:,:)) + + if (associated(cospOUT%calipso_srbval)) cospOUT%calipso_srbval = calipso_histBsct ! Free up memory (if necessary) if (allocated(out1D_1)) then @@ -921,6 +1086,117 @@ function COSP_SIMULATOR(cospIN,cospgridIN,cospOUT,start_idx,stop_idx,debug) deallocate(out1D_6) nullify(cospOUT%calipso_lidarcldtmp) endif + if (allocated(out1D_7)) then + deallocate(out1D_7) + nullify(cospOUT%calipso_lidarcldtype) + endif + if (allocated(out1D_8)) then + deallocate(out1D_8) + nullify(cospOUT%calipso_cldtype) + endif + if (allocated(out1D_9)) then + deallocate(out1D_9) + nullify(cospOUT%calipso_cldtypetemp) + endif + if (allocated(out1D_10)) then + deallocate(out1D_10) + nullify(cospOUT%calipso_cldtypemeanz) + endif + if (allocated(out1D_12)) then + deallocate(out1D_12) + nullify(cospOUT%calipso_cldtypemeanzse) + endif + if (allocated(out1D_11)) then + deallocate(out1D_11) + nullify(cospOUT%calipso_cldthinemis) + endif + + endif + + ! GROUND LIDAR Simulator + if (LgrLidar532_column) then + ! Check to see which outputs are requested. If not requested, use a local dummy array + if (.not. associated(cospOUT%grLidar532_cfad_sr)) then + allocate(out1D_1(Npoints*SR_BINS*Nlvgrid)) + cospOUT%grLidar532_cfad_sr(ij:ik,1:SR_BINS,1:Nlvgrid) => out1D_1 + endif + if (.not. associated(cospOUT%grLidar532_lidarcld)) then + allocate(out1D_2(Npoints*Nlvgrid)) + cospOUT%grLidar532_lidarcld(ij:ik,1:Nlvgrid) => out1D_2 + endif + if (.not. associated(cospOUT%grLidar532_cldlayer)) then + allocate(out1D_3(Npoints*LIDAR_NCAT)) + cospOUT%grLidar532_cldlayer(ij:ik,1:LIDAR_NCAT) => out1D_3 + endif + + ! Call simulator + ok_lidar_cfad_grLidar532=.true. + call lidar_column(grLidar532IN%Npoints, grLidar532IN%Ncolumns, grLidar532IN%Nlevels, & + Nlvgrid, SR_BINS, LIDAR_NTYPE, 'grlidar532',grLidar532_beta_tot(:,:,:), grLidar532_beta_mol(:,:),& + cospgridIN%phalf(:,2:grLidar532IN%Nlevels),cospgridIN%hgt_matrix, & + cospgridIN%hgt_matrix_half, vgrid_z(:), ok_lidar_cfad_grLidar532, LIDAR_NCAT, & + cospOUT%grLidar532_cfad_sr(ij:ik,:,:), cospOUT%grLidar532_lidarcld(ij:ik,:), & + cospOUT%grLidar532_cldlayer(ij:ik,:)) + + if (associated(cospOUT%grLidar532_srbval)) cospOUT%grLidar532_srbval = grLidar532_histBsct + + ! Free up memory (if necessary) + if (allocated(out1D_1)) then + deallocate(out1D_1) + nullify(cospOUT%grLidar532_cfad_sr) + endif + if (allocated(out1D_2)) then + deallocate(out1D_2) + nullify(cospOUT%grLidar532_lidarcld) + endif + if (allocated(out1D_3)) then + deallocate(out1D_3) + nullify(cospOUT%grLidar532_cldlayer) + endif + + endif + + ! ATLID Simulator + if (Latlid_column) then + ! Check to see which outputs are requested. If not requested, use a local dummy array + if (.not. associated(cospOUT%atlid_cfad_sr)) then + allocate(out1D_1(Npoints*SR_BINS*Nlvgrid)) + cospOUT%atlid_cfad_sr(ij:ik,1:SR_BINS,1:Nlvgrid) => out1D_1 + endif + if (.not. associated(cospOUT%atlid_lidarcld)) then + allocate(out1D_2(Npoints*Nlvgrid)) + cospOUT%atlid_lidarcld(ij:ik,1:Nlvgrid) => out1D_2 + endif + if (.not. associated(cospOUT%atlid_cldlayer)) then + allocate(out1D_3(Npoints*LIDAR_NCAT)) + cospOUT%atlid_cldlayer(ij:ik,1:LIDAR_NCAT) => out1D_3 + endif + + ! Call simulator + ok_lidar_cfad_atlid=.true. + call lidar_column(atlidIN%Npoints, atlidIN%Ncolumns, atlidIN%Nlevels, & + Nlvgrid, SR_BINS, LIDAR_NTYPE, 'atlid',atlid_beta_tot(:,:,:), & + atlid_beta_mol(:,:), cospgridIN%phalf(:,2:atlidIN%Nlevels), & + cospgridIN%hgt_matrix, cospgridIN%hgt_matrix_half, vgrid_z(:), & + ok_lidar_cfad_atlid, LIDAR_NCAT, cospOUT%atlid_cfad_sr(ij:ik,:,:), & + cospOUT%atlid_lidarcld(ij:ik,:), cospOUT%atlid_cldlayer(ij:ik,:)) + + if (associated(cospOUT%atlid_srbval)) cospOUT%atlid_srbval = atlid_histBsct + + ! Free up memory (if necessary) + if (allocated(out1D_1)) then + deallocate(out1D_1) + nullify(cospOUT%atlid_cfad_sr) + endif + if (allocated(out1D_2)) then + deallocate(out1D_2) + nullify(cospOUT%atlid_lidarcld) + endif + if (allocated(out1D_3)) then + deallocate(out1D_3) + nullify(cospOUT%atlid_cldlayer) + endif + endif ! PARASOL @@ -1271,11 +1547,22 @@ function COSP_SIMULATOR(cospIN,cospgridIN,cospOUT,start_idx,stop_idx,debug) calipsoIN%tau_mol,calipsoIN%tautot,calipsoIN%tautot_liq,calipsoIN%tautot_ice) endif + if (LgrLidar532_subcolumn) then + nullify(grLidar532IN%Npoints,grLidar532IN%Ncolumns,grLidar532IN%Nlevels,grLidar532IN%beta_mol, & + grLidar532IN%betatot,grLidar532IN%tau_mol,grLidar532IN%tautot) + endif + + if (Latlid_subcolumn) then + nullify(atlidIN%Npoints,atlidIN%Ncolumns,atlidIN%Nlevels,atlidIN%beta_mol_atlid, & + atlidIN%betatot_atlid,atlidIN%tau_mol_atlid,atlidIN%tautot_atlid) + endif + if (Lparasol_subcolumn) then nullify(parasolIN%Npoints,parasolIN%Nlevels,parasolIN%Ncolumns,parasolIN%Nrefl, & parasolIN%tautot_S_liq,parasolIN%tautot_S_ice) endif + if (Lcloudsat_subcolumn) then nullify(cloudsatIN%Npoints,cloudsatIN%Nlevels,cloudsatIN%Ncolumns,cloudsatIN%rcfg,& cloudsatIN%kr_vol,cloudsatIN%g_vol,cloudsatIN%z_vol,cloudsatIN%hgt_matrix) @@ -1290,7 +1577,11 @@ function COSP_SIMULATOR(cospIN,cospgridIN,cospOUT,start_idx,stop_idx,debug) endif if (allocated(calipso_beta_tot)) deallocate(calipso_beta_tot) + if (allocated(grLidar532_beta_tot)) deallocate(grLidar532_beta_tot) + if (allocated(atlid_beta_tot)) deallocate(atlid_beta_tot) if (allocated(calipso_beta_mol)) deallocate(calipso_beta_mol) + if (allocated(grLidar532_beta_mol)) deallocate(grLidar532_beta_mol) + if (allocated(atlid_beta_mol)) deallocate(atlid_beta_mol) if (allocated(calipso_betaperp_tot)) deallocate(calipso_betaperp_tot) if (allocated(cloudsatDBZe)) deallocate(cloudsatDBZe) if (allocated(lidar_only_freq_cloud)) deallocate(lidar_only_freq_cloud) @@ -1300,13 +1591,13 @@ end function COSP_SIMULATOR ! ###################################################################################### ! SUBROUTINE cosp_init ! ###################################################################################### - SUBROUTINE COSP_INIT(Lisccp, Lmodis, Lmisr, Lcloudsat, Lcalipso, Lparasol, Lrttov, & + SUBROUTINE COSP_INIT(Lisccp, Lmodis, Lmisr, Lcloudsat, Lcalipso, LgrLidar532, Latlid, Lparasol, Lrttov, & cloudsat_radar_freq, cloudsat_k2, cloudsat_use_gas_abs, cloudsat_do_ray, & isccp_top_height, isccp_top_height_direction, surface_radar, rcfg, lusevgrid, & luseCSATvgrid, Nvgrid, Nlevels, cloudsat_micro_scheme) ! INPUTS - logical,intent(in) :: Lisccp,Lmodis,Lmisr,Lcloudsat,Lcalipso,Lparasol,Lrttov + logical,intent(in) :: Lisccp,Lmodis,Lmisr,Lcloudsat,Lcalipso,LgrLidar532,Latlid,Lparasol,Lrttov integer,intent(in) :: & cloudsat_use_gas_abs, & ! cloudsat_do_ray, & ! @@ -1370,6 +1661,8 @@ SUBROUTINE COSP_INIT(Lisccp, Lmodis, Lmisr, Lcloudsat, Lcalipso, Lparasol, Lrtto cloudsat_use_gas_abs,cloudsat_do_ray,R_UNDEF,N_HYDRO, surface_radar, & rcfg,cloudsat_micro_scheme) if (Lcalipso) call cosp_calipso_init() + if (LgrLidar532) call cosp_grLidar532_init() + if (Latlid) call cosp_atlid_init() if (Lparasol) call cosp_parasol_init() linitialization = .FALSE. @@ -1387,7 +1680,8 @@ end subroutine cosp_cleanUp !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% subroutine cosp_errorCheck(cospgridIN, cospIN, Lisccp_subcolumn, Lisccp_column, & Lmisr_subcolumn, Lmisr_column, Lmodis_subcolumn, Lmodis_column, Lcloudsat_subcolumn, & - Lcloudsat_column, Lcalipso_subcolumn, Lcalipso_column, Lrttov_subcolumn, & + Lcloudsat_column, Lcalipso_subcolumn, Lcalipso_column, Latlid_subcolumn, & + Latlid_column, LgrLidar532_subcolumn, LgrLidar532_column, Lrttov_subcolumn, & Lrttov_column, Lparasol_subcolumn, Lparasol_column, Lradar_lidar_tcc, & Llidar_only_freq_cloud, cospOUT, errorMessage, nError) @@ -1409,6 +1703,10 @@ subroutine cosp_errorCheck(cospgridIN, cospIN, Lisccp_subcolumn, Lisccp_column, Lcloudsat_column, & ! CLOUDSAT column simulator on/off switch Lcalipso_subcolumn, & ! CALIPSO subcolumn simulator on/off switch Lcalipso_column, & ! CALIPSO column simulator on/off switch + Latlid_subcolumn, & ! EarthCare subcolumn simulator on/off switch + Latlid_column, & ! EarthCare column simulator on/off switch + LgrLidar532_subcolumn, & ! Ground Lidar subcolumn simulator on/off switch + LgrLidar532_column, & ! Ground Lidar column simulator on/off switch Lparasol_subcolumn, & ! PARASOL subcolumn simulator on/off switch Lparasol_column, & ! PARASOL column simulator on/off switch Lrttov_subcolumn, & ! RTTOV subcolumn simulator on/off switch @@ -1496,7 +1794,7 @@ subroutine cosp_errorCheck(cospgridIN, cospIN, Lisccp_subcolumn, Lisccp_column, alloc_status = .true. if (.not. allocated(cospIN%tau_067)) then nError=nError+1 - errorMessage(nError) = 'ERROR: COSP input variable (MISR simulator): cospgridIN%tau_067 has not been allocated' + errorMessage(nError) = 'ERROR: COSP input variable (MISR simulator): cospIN%tau_067 has not been allocated' alloc_status = .false. endif if (.not. allocated(cospgridIN%sunlit)) then @@ -1523,52 +1821,164 @@ subroutine cosp_errorCheck(cospgridIN, cospIN, Lisccp_subcolumn, Lisccp_column, if (associated(cospOUT%misr_cldarea)) cospOUT%misr_cldarea(:) = R_UNDEF endif endif + + ! EarthCare Lidar simulator. + if (Latlid_subcolumn .or. Latlid_column) then + alloc_status = .true. + if (.not. allocated(cospIN%beta_mol_atlid)) then + nError=nError+1 + errorMessage(nError) = 'ERROR: COSP input variable (EarthCare Lidar simulator): cospIN%beta_mol_atlid has not been allocated' + alloc_status = .false. + endif + if (.not. allocated(cospIN%betatot_atlid)) then + nError=nError+1 + errorMessage(nError) = 'ERROR: COSP input variable (EarthCare Lidar simulator): cospIN%betatot_atlid has not been allocated' + alloc_status = .false. + endif + if (.not. allocated(cospIN%tau_mol_atlid)) then + nError=nError+1 + errorMessage(nError) = 'ERROR: COSP input variable (EarthCare Lidar simulator): cospIN%tau_mol_atlid has not been allocated' + alloc_status = .false. + endif + if (.not. allocated(cospIN%tautot_atlid)) then + nError=nError+1 + errorMessage(nError) = 'ERROR: COSP input variable (EarthCare Lidar simulator): cospIN%tautot_atlid has not been allocated' + alloc_status = .false. + endif + if (.not. alloc_status) then + Latlid_subcolumn = .false. + Latlid_column = .false. + if (associated(cospOUT%atlid_cfad_sr)) cospOUT%atlid_cfad_sr(:,:,:) = R_UNDEF + if (associated(cospOUT%atlid_lidarcld)) cospOUT%atlid_lidarcld(:,:) = R_UNDEF + if (associated(cospOUT%atlid_cldlayer)) cospOUT%atlid_cldlayer(:,:) = R_UNDEF + if (associated(cospOUT%atlid_beta_mol)) cospOUT%atlid_beta_mol(:,:) = R_UNDEF + if (associated(cospOUT%atlid_beta_tot)) cospOUT%atlid_beta_tot(:,:,:) = R_UNDEF + endif + + ! EarthCare column simulator requires additional inputs not required by the subcolumn simulator. + alloc_status = .true. + if (.not. allocated(cospgridIN%hgt_matrix)) then + nError=nError+1 + errorMessage(nError) = 'ERROR: COSP input variable (EarthCare Lidar simulator): cospgridIN%hgt_matrix has not been allocated' + alloc_status = .false. + endif + if (.not. allocated(cospgridIN%hgt_matrix_half)) then + nError=nError+1 + errorMessage(nError) = 'ERROR: COSP input variable (EarthCare Lidar simulator): cospgridIN%hgt_matrix_half has not been allocated' + alloc_status = .false. + endif + if (.not. allocated(cospgridIN%phalf)) then + nError=nError+1 + errorMessage(nError) = 'ERROR: COSP input variable (EarthCare Lidar simulator): cospgridIN%phalf has not been allocated' + alloc_status = .false. + endif + if (.not. alloc_status) then + Latlid_column = .false. + if (associated(cospOUT%atlid_cfad_sr)) cospOUT%atlid_cfad_sr(:,:,:) = R_UNDEF + endif + endif + + ! Ground Lidar simulator. + if (LgrLidar532_subcolumn .or. LgrLidar532_column) then + alloc_status = .true. + if (.not. allocated(cospIN%beta_mol_grLidar532)) then + nError=nError+1 + errorMessage(nError) = 'ERROR: COSP input variable (Ground Lidar simulator): cospIN%beta_mol_grLidar532 has not been allocated' + alloc_status = .false. + endif + if (.not. allocated(cospIN%betatot_grLidar532)) then + nError=nError+1 + errorMessage(nError) = 'ERROR: COSP input variable (Ground Lidar simulator): cospIN%betatot_grLidar532 has not been allocated' + alloc_status = .false. + endif + if (.not. allocated(cospIN%tau_mol_grLidar532)) then + nError=nError+1 + errorMessage(nError) = 'ERROR: COSP input variable (Ground Lidar simulator): cospIN%tau_mol_grLidar532 has not been allocated' + alloc_status = .false. + endif + if (.not. allocated(cospIN%tautot_grLidar532)) then + nError=nError+1 + errorMessage(nError) = 'ERROR: COSP input variable (Ground Lidar simulator): cospIN%tautot_grLidar532 has not been allocated' + alloc_status = .false. + endif + if (.not. alloc_status) then + LgrLidar532_subcolumn = .false. + LgrLidar532_column = .false. + if (associated(cospOUT%grLidar532_cfad_sr)) cospOUT%grLidar532_cfad_sr(:,:,:) = R_UNDEF + if (associated(cospOUT%grLidar532_lidarcld)) cospOUT%grLidar532_lidarcld(:,:) = R_UNDEF + if (associated(cospOUT%grLidar532_cldlayer)) cospOUT%grLidar532_cldlayer(:,:) = R_UNDEF + if (associated(cospOUT%grLidar532_beta_mol)) cospOUT%grLidar532_beta_mol(:,:) = R_UNDEF + if (associated(cospOUT%grLidar532_beta_tot)) cospOUT%grLidar532_beta_tot(:,:,:) = R_UNDEF + endif + + ! Ground Lidar column simulator requires additional inputs not required by the subcolumn simulator. + alloc_status = .true. + if (.not. allocated(cospgridIN%hgt_matrix)) then + nError=nError+1 + errorMessage(nError) = 'ERROR: COSP input variable (Ground Lidar simulator): cospgridIN%hgt_matrix has not been allocated' + alloc_status = .false. + endif + if (.not. allocated(cospgridIN%hgt_matrix_half)) then + nError=nError+1 + errorMessage(nError) = 'ERROR: COSP input variable (Ground Lidar simulator): cospgridIN%hgt_matrix_half has not been allocated' + alloc_status = .false. + endif + if (.not. allocated(cospgridIN%phalf)) then + nError=nError+1 + errorMessage(nError) = 'ERROR: COSP input variable (Ground Lidar simulator): cospgridIN%phalf has not been allocated' + alloc_status = .false. + endif + if (.not. alloc_status) then + LgrLidar532_column = .false. + if (associated(cospOUT%grLidar532_cfad_sr)) cospOUT%grLidar532_cfad_sr(:,:,:) = R_UNDEF + endif + endif ! Calipso Lidar simulator if (Lcalipso_subcolumn .or. Lcalipso_column) then alloc_status = .true. - if (.not. allocated(cospIN%beta_mol)) then + if (.not. allocated(cospIN%beta_mol_calipso)) then nError=nError+1 - errorMessage(nError) = 'ERROR: COSP input variable (Calipso Lidar simulator): cospgridIN%beta_mol has not been allocated' + errorMessage(nError) = 'ERROR: COSP input variable (Calipso Lidar simulator): cospIN%beta_mol_calipso has not been allocated' alloc_status = .false. endif - if (.not. allocated(cospIN%betatot)) then + if (.not. allocated(cospIN%betatot_calipso)) then nError=nError+1 - errorMessage(nError) = 'ERROR: COSP input variable (Calipso Lidar simulator): cospgridIN%betatot has not been allocated' + errorMessage(nError) = 'ERROR: COSP input variable (Calipso Lidar simulator): cospIN%betatot_calipso has not been allocated' alloc_status = .false. endif - if (.not. allocated(cospIN%betatot_liq)) then + if (.not. allocated(cospIN%betatot_liq_calipso)) then nError=nError+1 errorMessage(nError) = 'ERROR: COSP input variable (Calipso Lidar simulator):'//& - ' cospgridIN%betatot_liq has not been allocated' + ' cospIN%betatot_liq_calipso has not been allocated' alloc_status = .false. endif - if (.not. allocated(cospIN%betatot_ice)) then + if (.not. allocated(cospIN%betatot_ice_calipso)) then nError=nError+1 errorMessage(nError) = 'ERROR: COSP input variable (Calipso Lidar simulator):'//& - ' cospgridIN%betatot_ice has not been allocated' + ' cospIN%betatot_ice_calipso has not been allocated' alloc_status = .false. endif - if (.not. allocated(cospIN%tau_mol)) then + if (.not. allocated(cospIN%tau_mol_calipso)) then nError=nError+1 - errorMessage(nError) = 'ERROR: COSP input variable (Calipso Lidar simulator): cospgridIN%tau_mol has not been allocated' + errorMessage(nError) = 'ERROR: COSP input variable (Calipso Lidar simulator): cospIN%tau_mol_calipso has not been allocated' alloc_status = .false. endif - if (.not. allocated(cospIN%tautot)) then + if (.not. allocated(cospIN%tautot_calipso)) then nError=nError+1 - errorMessage(nError) = 'ERROR: COSP input variable (Calipso Lidar simulator): cospgridIN%tautot has not been allocated' + errorMessage(nError) = 'ERROR: COSP input variable (Calipso Lidar simulator): cospIN%tautot_calipso has not been allocated' alloc_status = .false. endif - if (.not. allocated(cospIN%tautot_liq)) then + if (.not. allocated(cospIN%tautot_liq_calipso)) then nError=nError+1 errorMessage(nError) = 'ERROR: COSP input variable (Calipso Lidar simulator):'//& - ' cospgridIN%tautot_liq has not been allocated' + ' cospIN%tautot_liq has not been allocated' alloc_status = .false. endif - if (.not. allocated(cospIN%tautot_ice)) then + if (.not. allocated(cospIN%tautot_ice_calipso)) then nError=nError+1 errorMessage(nError) = 'ERROR: COSP input variable (Calipso Lidar simulator):'//& - ' cospgridIN%tautot_ice has not been allocated' + ' cospIN%tautot_ice has not been allocated' alloc_status = .false. endif if (.not. alloc_status) then @@ -2001,6 +2411,7 @@ subroutine cosp_errorCheck(cospgridIN, cospIN, Lisccp_subcolumn, Lisccp_column, cospOUT%modis_Optical_Thickness_vs_ReffLIQ(:,:,:) = R_UNDEF endif endif + if (any([Lisccp_subcolumn, Lisccp_column, Lmisr_subcolumn, Lmisr_column, Lrttov_column,& Lcalipso_column, Lcloudsat_column, Lradar_lidar_tcc,Llidar_only_freq_cloud])) then if (any(cospgridIN%at .lt. 0)) then @@ -2035,6 +2446,12 @@ subroutine cosp_errorCheck(cospgridIN, cospIN, Lisccp_subcolumn, Lisccp_column, if (associated(cospOUT%calipso_cldlayer)) cospOUT%calipso_cldlayer(:,:) = R_UNDEF if (associated(cospOUT%calipso_cldlayerphase)) cospOUT%calipso_cldlayerphase(:,:,:) = R_UNDEF if (associated(cospOUT%calipso_lidarcldtmp)) cospOUT%calipso_lidarcldtmp(:,:,:) = R_UNDEF + if (associated(cospOUT%calipso_lidarcldtype)) cospOUT%calipso_lidarcldtype(:,:,:) = R_UNDEF + if (associated(cospOUT%calipso_cldtype)) cospOUT%calipso_cldtype(:,:) = R_UNDEF + if (associated(cospOUT%calipso_cldtypetemp)) cospOUT%calipso_cldtypetemp(:,:) = R_UNDEF + if (associated(cospOUT%calipso_cldtypemeanz)) cospOUT%calipso_cldtypemeanz(:,:) = R_UNDEF + if (associated(cospOUT%calipso_cldtypemeanzse)) cospOUT%calipso_cldtypemeanzse(:,:) = R_UNDEF + if (associated(cospOUT%calipso_cldthinemis)) cospOUT%calipso_cldthinemis(:) = R_UNDEF if (associated(cospOUT%cloudsat_cfad_ze)) cospOUT%cloudsat_cfad_ze(:,:,:) = R_UNDEF if (associated(cospOUT%lidar_only_freq_cloud)) cospOUT%lidar_only_freq_cloud(:,:) = R_UNDEF if (associated(cospOUT%radar_lidar_tcc)) cospOUT%radar_lidar_tcc(:) = R_UNDEF @@ -2059,7 +2476,8 @@ subroutine cosp_errorCheck(cospgridIN, cospIN, Lisccp_subcolumn, Lisccp_column, if (associated(cospOUT%isccp_fq)) cospOUT%isccp_fq(:,:,:) = R_UNDEF endif endif - if (any([Lisccp_subcolumn,Lisccp_column,Lmodis_subcolumn,Lmodis_column,Lcalipso_column,Lrttov_column])) then + if (any([Lisccp_subcolumn,Lisccp_column,Lmodis_subcolumn,Lmodis_column,Lcalipso_column,Lrttov_column,& + LgrLidar532_column,Latlid_column])) then if (any(cospgridIN%phalf .lt. 0)) then nError=nError+1 errorMessage(nError) = 'ERROR: COSP input variable: cospgridIN%phalf contains values out of range' @@ -2069,6 +2487,8 @@ subroutine cosp_errorCheck(cospgridIN, cospIN, Lisccp_subcolumn, Lisccp_column, Lmodis_column = .false. Lcalipso_column = .false. Lrttov_column = .false. + Latlid_column = .false. + LgrLidar532_column = .false. if (associated(cospOUT%rttov_tbs)) cospOUT%rttov_tbs(:,:) = R_UNDEF if (associated(cospOUT%isccp_totalcldarea)) cospOUT%isccp_totalcldarea(:) = R_UNDEF if (associated(cospOUT%isccp_meantb)) cospOUT%isccp_meantb(:) = R_UNDEF @@ -2125,6 +2545,18 @@ subroutine cosp_errorCheck(cospgridIN, cospIN, Lisccp_subcolumn, Lisccp_column, if (associated(cospOUT%calipso_cldlayer)) cospOUT%calipso_cldlayer(:,:) = R_UNDEF if (associated(cospOUT%calipso_cldlayerphase)) cospOUT%calipso_cldlayerphase(:,:,:) = R_UNDEF if (associated(cospOUT%calipso_lidarcldtmp)) cospOUT%calipso_lidarcldtmp(:,:,:) = R_UNDEF + if (associated(cospOUT%atlid_cfad_sr)) cospOUT%atlid_cfad_sr(:,:,:) = R_UNDEF + if (associated(cospOUT%atlid_lidarcld)) cospOUT%atlid_lidarcld(:,:) = R_UNDEF + if (associated(cospOUT%atlid_cldlayer)) cospOUT%atlid_cldlayer(:,:) = R_UNDEF + if (associated(cospOUT%grLidar532_cfad_sr)) cospOUT%grLidar532_cfad_sr(:,:,:) = R_UNDEF + if (associated(cospOUT%grLidar532_lidarcld)) cospOUT%grLidar532_lidarcld(:,:) = R_UNDEF + if (associated(cospOUT%grLidar532_cldlayer)) cospOUT%grLidar532_cldlayer(:,:) = R_UNDEF + if (associated(cospOUT%calipso_lidarcldtype)) cospOUT%calipso_lidarcldtype(:,:,:) = R_UNDEF + if (associated(cospOUT%calipso_cldtype)) cospOUT%calipso_cldtype(:,:) = R_UNDEF + if (associated(cospOUT%calipso_cldtypetemp)) cospOUT%calipso_cldtypetemp(:,:) = R_UNDEF + if (associated(cospOUT%calipso_cldtypemeanz)) cospOUT%calipso_cldtypemeanz(:,:) = R_UNDEF + if (associated(cospOUT%calipso_cldtypemeanzse)) cospOUT%calipso_cldtypemeanzse(:,:) = R_UNDEF + if (associated(cospOUT%calipso_cldthinemis)) cospOUT%calipso_cldthinemis(:) = R_UNDEF endif endif if (any([Lisccp_subcolumn,Lisccp_column,Lrttov_column])) then @@ -2147,7 +2579,7 @@ subroutine cosp_errorCheck(cospgridIN, cospIN, Lisccp_subcolumn, Lisccp_column, endif endif if (any([Lmisr_subcolumn,Lmisr_column,Lcloudsat_subcolumn,Lcloudsat_column,Lcalipso_column,Lradar_lidar_tcc,& - Llidar_only_freq_cloud])) then + Llidar_only_freq_cloud,LgrLidar532_column,Latlid_column])) then if (any(cospgridIN%hgt_matrix .lt. -300)) then nError=nError+1 errorMessage(nError) = 'ERROR: COSP input variable: cospgridIN%hgt_matrix contains values out of range' @@ -2156,8 +2588,10 @@ subroutine cosp_errorCheck(cospgridIN, cospIN, Lisccp_subcolumn, Lisccp_column, Lcloudsat_subcolumn = .false. Lcloudsat_column = .false. Lcalipso_column = .false. - Lradar_lidar_tcc = .false. + Lradar_lidar_tcc = .false. Llidar_only_freq_cloud = .false. + Latlid_column = .false. + LgrLidar532_column = .false. if (associated(cospOUT%misr_fq)) cospOUT%misr_fq(:,:,:) = R_UNDEF if (associated(cospOUT%misr_dist_model_layertops)) cospOUT%misr_dist_model_layertops(:,:) = R_UNDEF if (associated(cospOUT%misr_meanztop)) cospOUT%misr_meanztop(:) = R_UNDEF @@ -2172,9 +2606,22 @@ subroutine cosp_errorCheck(cospgridIN, cospIN, Lisccp_subcolumn, Lisccp_column, if (associated(cospOUT%cloudsat_Ze_tot)) cospOUT%cloudsat_Ze_tot(:,:,:) = R_UNDEF if (associated(cospOUT%lidar_only_freq_cloud)) cospOUT%lidar_only_freq_cloud(:,:) = R_UNDEF if (associated(cospOUT%radar_lidar_tcc)) cospOUT%radar_lidar_tcc(:) = R_UNDEF - endif - endif - if (any([Lrttov_column,Lcloudsat_column,Lcalipso_column,Lradar_lidar_tcc,Llidar_only_freq_cloud])) then + if (associated(cospOUT%atlid_cfad_sr)) cospOUT%atlid_cfad_sr(:,:,:) = R_UNDEF + if (associated(cospOUT%atlid_lidarcld)) cospOUT%atlid_lidarcld(:,:) = R_UNDEF + if (associated(cospOUT%atlid_cldlayer)) cospOUT%atlid_cldlayer(:,:) = R_UNDEF + if (associated(cospOUT%grLidar532_cfad_sr)) cospOUT%grLidar532_cfad_sr(:,:,:) = R_UNDEF + if (associated(cospOUT%grLidar532_lidarcld)) cospOUT%grLidar532_lidarcld(:,:) = R_UNDEF + if (associated(cospOUT%grLidar532_cldlayer)) cospOUT%grLidar532_cldlayer(:,:) = R_UNDEF + if (associated(cospOUT%calipso_lidarcldtype)) cospOUT%calipso_lidarcldtype(:,:,:) = R_UNDEF + if (associated(cospOUT%calipso_cldtype)) cospOUT%calipso_cldtype(:,:) = R_UNDEF + if (associated(cospOUT%calipso_cldtypetemp)) cospOUT%calipso_cldtypetemp(:,:) = R_UNDEF + if (associated(cospOUT%calipso_cldtypemeanz)) cospOUT%calipso_cldtypemeanz(:,:) = R_UNDEF + if (associated(cospOUT%calipso_cldtypemeanzse)) cospOUT%calipso_cldtypemeanzse(:,:) = R_UNDEF + if (associated(cospOUT%calipso_cldthinemis)) cospOUT%calipso_cldthinemis(:) = R_UNDEF + endif + endif + if (any([Lrttov_column,Lcloudsat_column,Lcalipso_column,Lradar_lidar_tcc,Llidar_only_freq_cloud, & + LgrLidar532_column, Latlid_column])) then if (any(cospgridIN%hgt_matrix_half .lt. -300)) then nError=nError+1 errorMessage(nError) = 'ERROR: COSP input variable: cospgridIN%hgt_matrix_half contains values out of range' @@ -2183,6 +2630,9 @@ subroutine cosp_errorCheck(cospgridIN, cospIN, Lisccp_subcolumn, Lisccp_column, Lcalipso_column = .false. Lradar_lidar_tcc = .false. Llidar_only_freq_cloud = .false. + Latlid_column = .false. + LgrLidar532_column = .false. + if (associated(cospOUT%rttov_tbs)) cospOUT%rttov_tbs(:,:) = R_UNDEF if (associated(cospOUT%calipso_cfad_sr)) cospOUT%calipso_cfad_sr(:,:,:) = R_UNDEF if (associated(cospOUT%calipso_lidarcld)) cospOUT%calipso_lidarcld(:,:) = R_UNDEF @@ -2193,6 +2643,18 @@ subroutine cosp_errorCheck(cospgridIN, cospIN, Lisccp_subcolumn, Lisccp_column, if (associated(cospOUT%cloudsat_cfad_ze)) cospOUT%cloudsat_cfad_ze(:,:,:) = R_UNDEF if (associated(cospOUT%lidar_only_freq_cloud)) cospOUT%lidar_only_freq_cloud(:,:) = R_UNDEF if (associated(cospOUT%radar_lidar_tcc)) cospOUT%radar_lidar_tcc(:) = R_UNDEF + if (associated(cospOUT%atlid_cfad_sr)) cospOUT%atlid_cfad_sr(:,:,:) = R_UNDEF + if (associated(cospOUT%atlid_lidarcld)) cospOUT%atlid_lidarcld(:,:) = R_UNDEF + if (associated(cospOUT%atlid_cldlayer)) cospOUT%atlid_cldlayer(:,:) = R_UNDEF + if (associated(cospOUT%grLidar532_cfad_sr)) cospOUT%grLidar532_cfad_sr(:,:,:) = R_UNDEF + if (associated(cospOUT%grLidar532_lidarcld)) cospOUT%grLidar532_lidarcld(:,:) = R_UNDEF + if (associated(cospOUT%grLidar532_cldlayer)) cospOUT%grLidar532_cldlayer(:,:) = R_UNDEF + if (associated(cospOUT%calipso_lidarcldtype)) cospOUT%calipso_lidarcldtype(:,:,:) = R_UNDEF + if (associated(cospOUT%calipso_cldtype)) cospOUT%calipso_cldtype(:,:) = R_UNDEF + if (associated(cospOUT%calipso_cldtypetemp)) cospOUT%calipso_cldtypetemp(:,:) = R_UNDEF + if (associated(cospOUT%calipso_cldtypemeanz)) cospOUT%calipso_cldtypemeanz(:,:) = R_UNDEF + if (associated(cospOUT%calipso_cldtypemeanzse)) cospOUT%calipso_cldtypemeanzse(:,:) = R_UNDEF + if (associated(cospOUT%calipso_cldthinemis)) cospOUT%calipso_cldthinemis(:) = R_UNDEF endif endif if (any([Lrttov_column,Lcalipso_column,Lparasol_column])) then @@ -2209,6 +2671,12 @@ subroutine cosp_errorCheck(cospgridIN, cospIN, Lisccp_subcolumn, Lisccp_column, if (associated(cospOUT%calipso_cldlayer)) cospOUT%calipso_cldlayer(:,:) = R_UNDEF if (associated(cospOUT%calipso_cldlayerphase)) cospOUT%calipso_cldlayerphase(:,:,:) = R_UNDEF if (associated(cospOUT%calipso_lidarcldtmp)) cospOUT%calipso_lidarcldtmp(:,:,:) = R_UNDEF + if (associated(cospOUT%calipso_lidarcldtype)) cospOUT%calipso_lidarcldtype(:,:,:) = R_UNDEF + if (associated(cospOUT%calipso_cldtype)) cospOUT%calipso_cldtype(:,:) = R_UNDEF + if (associated(cospOUT%calipso_cldtypetemp)) cospOUT%calipso_cldtypetemp(:,:) = R_UNDEF + if (associated(cospOUT%calipso_cldtypemeanz)) cospOUT%calipso_cldtypemeanz(:,:) = R_UNDEF + if (associated(cospOUT%calipso_cldtypemeanzse)) cospOUT%calipso_cldtypemeanzse(:,:) = R_UNDEF + if (associated(cospOUT%calipso_cldthinemis)) cospOUT%calipso_cldthinemis(:) = R_UNDEF if (associated(cospOUT%parasolGrid_refl)) cospOUT%parasolGrid_refl(:,:) = R_UNDEF endif endif @@ -2490,10 +2958,104 @@ subroutine cosp_errorCheck(cospgridIN, cospIN, Lisccp_subcolumn, Lisccp_column, cospOUT%modis_Optical_Thickness_vs_ReffLIQ(:,:,:) = R_UNDEF endif endif + if (any([Latlid_subcolumn,Latlid_column])) then + if (any(cospIN%betatot_atlid .lt. 0)) then + nError=nError+1 + errorMessage(nError) = 'ERROR: COSP input variable: cospIN%betatot_atlid contains values out of range' + Latlid_subcolumn = .false. + Latlid_column = .false. + if (associated(cospOUT%atlid_cfad_sr)) cospOUT%atlid_cfad_sr(:,:,:) = R_UNDEF + if (associated(cospOUT%atlid_lidarcld)) cospOUT%atlid_lidarcld(:,:) = R_UNDEF + if (associated(cospOUT%atlid_cldlayer)) cospOUT%atlid_cldlayer(:,:) = R_UNDEF + if (associated(cospOUT%atlid_beta_tot)) cospOUT%atlid_beta_tot(:,:,:) = R_UNDEF + if (associated(cospOUT%atlid_beta_mol)) cospOUT%atlid_beta_mol(:,:) = R_UNDEF + endif + if (any(cospIN%beta_mol_atlid .lt. 0)) then + nError=nError+1 + errorMessage(nError) = 'ERROR: COSP input variable: cospIN%beta_mol_atlid contains values out of range' + Latlid_subcolumn = .false. + Latlid_column = .false. + if (associated(cospOUT%atlid_cfad_sr)) cospOUT%atlid_cfad_sr(:,:,:) = R_UNDEF + if (associated(cospOUT%atlid_lidarcld)) cospOUT%atlid_lidarcld(:,:) = R_UNDEF + if (associated(cospOUT%atlid_cldlayer)) cospOUT%atlid_cldlayer(:,:) = R_UNDEF + if (associated(cospOUT%atlid_beta_tot)) cospOUT%atlid_beta_tot(:,:,:) = R_UNDEF + if (associated(cospOUT%atlid_beta_mol)) cospOUT%atlid_beta_mol(:,:) = R_UNDEF + endif + if (any(cospIN%tautot_atlid .lt. 0)) then + nError=nError+1 + errorMessage(nError) = 'ERROR: COSP input variable: cospIN%tautot_atlid contains values out of range' + Latlid_subcolumn = .false. + Latlid_column = .false. + if (associated(cospOUT%atlid_cfad_sr)) cospOUT%atlid_cfad_sr(:,:,:) = R_UNDEF + if (associated(cospOUT%atlid_lidarcld)) cospOUT%atlid_lidarcld(:,:) = R_UNDEF + if (associated(cospOUT%atlid_cldlayer)) cospOUT%atlid_cldlayer(:,:) = R_UNDEF + if (associated(cospOUT%atlid_beta_tot)) cospOUT%atlid_beta_tot(:,:,:) = R_UNDEF + if (associated(cospOUT%atlid_beta_mol)) cospOUT%atlid_beta_mol(:,:) = R_UNDEF + endif + if (any(cospIN%tau_mol_atlid .lt. 0)) then + nError=nError+1 + errorMessage(nError) = 'ERROR: COSP input variable: cospIN%tau_mol_atlid contains values out of range' + Latlid_subcolumn = .false. + Latlid_column = .false. + if (associated(cospOUT%atlid_cfad_sr)) cospOUT%atlid_cfad_sr(:,:,:) = R_UNDEF + if (associated(cospOUT%atlid_lidarcld)) cospOUT%atlid_lidarcld(:,:) = R_UNDEF + if (associated(cospOUT%atlid_cldlayer)) cospOUT%atlid_cldlayer(:,:) = R_UNDEF + if (associated(cospOUT%atlid_beta_tot)) cospOUT%atlid_beta_tot(:,:,:) = R_UNDEF + if (associated(cospOUT%atlid_beta_mol)) cospOUT%atlid_beta_mol(:,:) = R_UNDEF + endif + endif + + if (any([LgrLidar532_subcolumn,LgrLidar532_column])) then + if (any(cospIN%betatot_grLidar532 .lt. 0)) then + nError=nError+1 + errorMessage(nError) = 'ERROR: COSP input variable: cospIN%betatot_grLidar532 contains values out of range' + LgrLidar532_subcolumn = .false. + LgrLidar532_column = .false. + if (associated(cospOUT%grLidar532_cfad_sr)) cospOUT%grLidar532_cfad_sr(:,:,:) = R_UNDEF + if (associated(cospOUT%grLidar532_lidarcld)) cospOUT%grLidar532_lidarcld(:,:) = R_UNDEF + if (associated(cospOUT%grLidar532_cldlayer)) cospOUT%grLidar532_cldlayer(:,:) = R_UNDEF + if (associated(cospOUT%grLidar532_beta_tot)) cospOUT%grLidar532_beta_tot(:,:,:) = R_UNDEF + if (associated(cospOUT%grLidar532_beta_mol)) cospOUT%grLidar532_beta_mol(:,:) = R_UNDEF + endif + if (any(cospIN%beta_mol_grLidar532 .lt. 0)) then + nError=nError+1 + errorMessage(nError) = 'ERROR: COSP input variable: cospIN%beta_mol_grLidar532 contains values out of range' + LgrLidar532_subcolumn = .false. + LgrLidar532_column = .false. + if (associated(cospOUT%grLidar532_cfad_sr)) cospOUT%grLidar532_cfad_sr(:,:,:) = R_UNDEF + if (associated(cospOUT%grLidar532_lidarcld)) cospOUT%grLidar532_lidarcld(:,:) = R_UNDEF + if (associated(cospOUT%grLidar532_cldlayer)) cospOUT%grLidar532_cldlayer(:,:) = R_UNDEF + if (associated(cospOUT%grLidar532_beta_tot)) cospOUT%grLidar532_beta_tot(:,:,:) = R_UNDEF + if (associated(cospOUT%grLidar532_beta_mol)) cospOUT%grLidar532_beta_mol(:,:) = R_UNDEF + endif + if (any(cospIN%tautot_grLidar532 .lt. 0)) then + nError=nError+1 + errorMessage(nError) = 'ERROR: COSP input variable: cospIN%tautot_grLidar532 contains values out of range' + LgrLidar532_subcolumn = .false. + LgrLidar532_column = .false. + if (associated(cospOUT%grLidar532_cfad_sr)) cospOUT%grLidar532_cfad_sr(:,:,:) = R_UNDEF + if (associated(cospOUT%grLidar532_lidarcld)) cospOUT%grLidar532_lidarcld(:,:) = R_UNDEF + if (associated(cospOUT%grLidar532_cldlayer)) cospOUT%grLidar532_cldlayer(:,:) = R_UNDEF + if (associated(cospOUT%grLidar532_beta_tot)) cospOUT%grLidar532_beta_tot(:,:,:) = R_UNDEF + if (associated(cospOUT%grLidar532_beta_mol)) cospOUT%grLidar532_beta_mol(:,:) = R_UNDEF + endif + if (any(cospIN%tau_mol_grLidar532 .lt. 0)) then + nError=nError+1 + errorMessage(nError) = 'ERROR: COSP input variable: cospIN%tau_mol_grLidar532 contains values out of range' + LgrLidar532_subcolumn = .false. + LgrLidar532_column = .false. + if (associated(cospOUT%grLidar532_cfad_sr)) cospOUT%grLidar532_cfad_sr(:,:,:) = R_UNDEF + if (associated(cospOUT%grLidar532_lidarcld)) cospOUT%grLidar532_lidarcld(:,:) = R_UNDEF + if (associated(cospOUT%grLidar532_cldlayer)) cospOUT%grLidar532_cldlayer(:,:) = R_UNDEF + if (associated(cospOUT%grLidar532_beta_tot)) cospOUT%grLidar532_beta_tot(:,:,:) = R_UNDEF + if (associated(cospOUT%grLidar532_beta_mol)) cospOUT%grLidar532_beta_mol(:,:) = R_UNDEF + endif + endif + if (any([Lcalipso_subcolumn,Lcalipso_column])) then - if (any(cospIN%betatot .lt. 0)) then + if (any(cospIN%betatot_calipso .lt. 0)) then nError=nError+1 - errorMessage(nError) = 'ERROR: COSP input variable: cospIN%betatot contains values out of range' + errorMessage(nError) = 'ERROR: COSP input variable: cospIN%betatot_calipso contains values out of range' Lcalipso_subcolumn = .false. Lcalipso_column = .false. if (associated(cospOUT%calipso_cfad_sr)) cospOUT%calipso_cfad_sr(:,:,:) = R_UNDEF @@ -2503,10 +3065,16 @@ subroutine cosp_errorCheck(cospgridIN, cospIN, Lisccp_subcolumn, Lisccp_column, if (associated(cospOUT%calipso_cldlayerphase)) cospOUT%calipso_cldlayerphase(:,:,:) = R_UNDEF if (associated(cospOUT%calipso_lidarcldtmp)) cospOUT%calipso_lidarcldtmp(:,:,:) = R_UNDEF if (associated(cospOUT%calipso_srbval)) cospOUT%calipso_srbval(:) = R_UNDEF + if (associated(cospOUT%calipso_lidarcldtype)) cospOUT%calipso_lidarcldtype(:,:,:) = R_UNDEF + if (associated(cospOUT%calipso_cldtype)) cospOUT%calipso_cldtype(:,:) = R_UNDEF + if (associated(cospOUT%calipso_cldtypetemp)) cospOUT%calipso_cldtypetemp(:,:) = R_UNDEF + if (associated(cospOUT%calipso_cldtypemeanz)) cospOUT%calipso_cldtypemeanz(:,:) = R_UNDEF + if (associated(cospOUT%calipso_cldtypemeanzse)) cospOUT%calipso_cldtypemeanzse(:,:) = R_UNDEF + if (associated(cospOUT%calipso_cldthinemis)) cospOUT%calipso_cldthinemis(:) = R_UNDEF endif - if (any(cospIN%betatot_liq .lt. 0)) then + if (any(cospIN%betatot_liq_calipso .lt. 0)) then nError=nError+1 - errorMessage(nError) = ('ERROR: COSP input variable: cospIN%betatot_liq contains values out of range') + errorMessage(nError) = ('ERROR: COSP input variable: cospIN%betatot_liq_calipso contains values out of range') Lcalipso_subcolumn = .false. Lcalipso_column = .false. if (associated(cospOUT%calipso_cfad_sr)) cospOUT%calipso_cfad_sr(:,:,:) = R_UNDEF @@ -2516,10 +3084,16 @@ subroutine cosp_errorCheck(cospgridIN, cospIN, Lisccp_subcolumn, Lisccp_column, if (associated(cospOUT%calipso_cldlayerphase)) cospOUT%calipso_cldlayerphase(:,:,:) = R_UNDEF if (associated(cospOUT%calipso_lidarcldtmp)) cospOUT%calipso_lidarcldtmp(:,:,:) = R_UNDEF if (associated(cospOUT%calipso_srbval)) cospOUT%calipso_srbval(:) = R_UNDEF + if (associated(cospOUT%calipso_lidarcldtype)) cospOUT%calipso_lidarcldtype(:,:,:) = R_UNDEF + if (associated(cospOUT%calipso_cldtype)) cospOUT%calipso_cldtype(:,:) = R_UNDEF + if (associated(cospOUT%calipso_cldtypetemp)) cospOUT%calipso_cldtypetemp(:,:) = R_UNDEF + if (associated(cospOUT%calipso_cldtypemeanz)) cospOUT%calipso_cldtypemeanz(:,:) = R_UNDEF + if (associated(cospOUT%calipso_cldtypemeanzse)) cospOUT%calipso_cldtypemeanzse(:,:) = R_UNDEF + if (associated(cospOUT%calipso_cldthinemis)) cospOUT%calipso_cldthinemis(:) = R_UNDEF endif - if (any(cospIN%betatot_ice .lt. 0)) then + if (any(cospIN%betatot_ice_calipso .lt. 0)) then nError=nError+1 - errorMessage(nError) = 'ERROR: COSP input variable: cospIN%betatot_ice contains values out of range' + errorMessage(nError) = 'ERROR: COSP input variable: cospIN%betatot_ice_calipso contains values out of range' Lcalipso_subcolumn = .false. Lcalipso_column = .false. if (associated(cospOUT%calipso_cfad_sr)) cospOUT%calipso_cfad_sr(:,:,:) = R_UNDEF @@ -2529,10 +3103,16 @@ subroutine cosp_errorCheck(cospgridIN, cospIN, Lisccp_subcolumn, Lisccp_column, if (associated(cospOUT%calipso_cldlayerphase)) cospOUT%calipso_cldlayerphase(:,:,:) = R_UNDEF if (associated(cospOUT%calipso_lidarcldtmp)) cospOUT%calipso_lidarcldtmp(:,:,:) = R_UNDEF if (associated(cospOUT%calipso_srbval)) cospOUT%calipso_srbval(:) = R_UNDEF + if (associated(cospOUT%calipso_lidarcldtype)) cospOUT%calipso_lidarcldtype(:,:,:) = R_UNDEF + if (associated(cospOUT%calipso_cldtype)) cospOUT%calipso_cldtype(:,:) = R_UNDEF + if (associated(cospOUT%calipso_cldtypetemp)) cospOUT%calipso_cldtypetemp(:,:) = R_UNDEF + if (associated(cospOUT%calipso_cldtypemeanz)) cospOUT%calipso_cldtypemeanz(:,:) = R_UNDEF + if (associated(cospOUT%calipso_cldtypemeanzse)) cospOUT%calipso_cldtypemeanzse(:,:) = R_UNDEF + if (associated(cospOUT%calipso_cldthinemis)) cospOUT%calipso_cldthinemis(:) = R_UNDEF endif - if (any(cospIN%tautot .lt. 0)) then + if (any(cospIN%tautot_calipso .lt. 0)) then nError=nError+1 - errorMessage(nError) = 'ERROR: COSP input variable: cospIN%tautot contains values out of range' + errorMessage(nError) = 'ERROR: COSP input variable: cospIN%tautot_calipso contains values out of range' Lcalipso_subcolumn = .false. Lcalipso_column = .false. if (associated(cospOUT%calipso_cfad_sr)) cospOUT%calipso_cfad_sr(:,:,:) = R_UNDEF @@ -2542,10 +3122,16 @@ subroutine cosp_errorCheck(cospgridIN, cospIN, Lisccp_subcolumn, Lisccp_column, if (associated(cospOUT%calipso_cldlayerphase)) cospOUT%calipso_cldlayerphase(:,:,:) = R_UNDEF if (associated(cospOUT%calipso_lidarcldtmp)) cospOUT%calipso_lidarcldtmp(:,:,:) = R_UNDEF if (associated(cospOUT%calipso_srbval)) cospOUT%calipso_srbval(:) = R_UNDEF + if (associated(cospOUT%calipso_lidarcldtype)) cospOUT%calipso_lidarcldtype(:,:,:) = R_UNDEF + if (associated(cospOUT%calipso_cldtype)) cospOUT%calipso_cldtype(:,:) = R_UNDEF + if (associated(cospOUT%calipso_cldtypetemp)) cospOUT%calipso_cldtypetemp(:,:) = R_UNDEF + if (associated(cospOUT%calipso_cldtypemeanz)) cospOUT%calipso_cldtypemeanz(:,:) = R_UNDEF + if (associated(cospOUT%calipso_cldtypemeanzse)) cospOUT%calipso_cldtypemeanzse(:,:) = R_UNDEF + if (associated(cospOUT%calipso_cldthinemis)) cospOUT%calipso_cldthinemis(:) = R_UNDEF endif - if (any(cospIN%tautot_liq .lt. 0)) then + if (any(cospIN%tautot_liq_calipso .lt. 0)) then nError=nError+1 - errorMessage(nError) = ('ERROR: COSP input variable: cospIN%tautot_liq contains values out of range') + errorMessage(nError) = ('ERROR: COSP input variable: cospIN%tautot_liq_calipso contains values out of range') Lcalipso_subcolumn = .false. Lcalipso_column = .false. if (associated(cospOUT%calipso_cfad_sr)) cospOUT%calipso_cfad_sr(:,:,:) = R_UNDEF @@ -2555,10 +3141,16 @@ subroutine cosp_errorCheck(cospgridIN, cospIN, Lisccp_subcolumn, Lisccp_column, if (associated(cospOUT%calipso_cldlayerphase)) cospOUT%calipso_cldlayerphase(:,:,:) = R_UNDEF if (associated(cospOUT%calipso_lidarcldtmp)) cospOUT%calipso_lidarcldtmp(:,:,:) = R_UNDEF if (associated(cospOUT%calipso_srbval)) cospOUT%calipso_srbval(:) = R_UNDEF + if (associated(cospOUT%calipso_lidarcldtype)) cospOUT%calipso_lidarcldtype(:,:,:) = R_UNDEF + if (associated(cospOUT%calipso_cldtype)) cospOUT%calipso_cldtype(:,:) = R_UNDEF + if (associated(cospOUT%calipso_cldtypetemp)) cospOUT%calipso_cldtypetemp(:,:) = R_UNDEF + if (associated(cospOUT%calipso_cldtypemeanz)) cospOUT%calipso_cldtypemeanz(:,:) = R_UNDEF + if (associated(cospOUT%calipso_cldtypemeanzse)) cospOUT%calipso_cldtypemeanzse(:,:) = R_UNDEF + if (associated(cospOUT%calipso_cldthinemis)) cospOUT%calipso_cldthinemis(:) = R_UNDEF endif - if (any(cospIN%tautot_ice .lt. 0)) then + if (any(cospIN%tautot_ice_calipso .lt. 0)) then nError=nError+1 - errorMessage(nError) = 'ERROR: COSP input variable: cospIN%tautot_ice contains values out of range' + errorMessage(nError) = 'ERROR: COSP input variable: cospIN%tautot_ice_calipso contains values out of range' Lcalipso_subcolumn = .false. Lcalipso_column = .false. if (associated(cospOUT%calipso_cfad_sr)) cospOUT%calipso_cfad_sr(:,:,:) = R_UNDEF @@ -2568,10 +3160,16 @@ subroutine cosp_errorCheck(cospgridIN, cospIN, Lisccp_subcolumn, Lisccp_column, if (associated(cospOUT%calipso_cldlayerphase)) cospOUT%calipso_cldlayerphase(:,:,:) = R_UNDEF if (associated(cospOUT%calipso_lidarcldtmp)) cospOUT%calipso_lidarcldtmp(:,:,:) = R_UNDEF if (associated(cospOUT%calipso_srbval)) cospOUT%calipso_srbval(:) = R_UNDEF + if (associated(cospOUT%calipso_lidarcldtype)) cospOUT%calipso_lidarcldtype(:,:,:) = R_UNDEF + if (associated(cospOUT%calipso_cldtype)) cospOUT%calipso_cldtype(:,:) = R_UNDEF + if (associated(cospOUT%calipso_cldtypetemp)) cospOUT%calipso_cldtypetemp(:,:) = R_UNDEF + if (associated(cospOUT%calipso_cldtypemeanz)) cospOUT%calipso_cldtypemeanz(:,:) = R_UNDEF + if (associated(cospOUT%calipso_cldtypemeanzse)) cospOUT%calipso_cldtypemeanzse(:,:) = R_UNDEF + if (associated(cospOUT%calipso_cldthinemis)) cospOUT%calipso_cldthinemis(:) = R_UNDEF endif - if (any(cospIN%tau_mol .lt. 0)) then + if (any(cospIN%tau_mol_calipso .lt. 0)) then nError=nError+1 - errorMessage(nError) = 'ERROR: COSP input variable: cospIN%tau_mol contains values out of range' + errorMessage(nError) = 'ERROR: COSP input variable: cospIN%tau_mol_calipso contains values out of range' Lcalipso_subcolumn = .false. Lcalipso_column = .false. if (associated(cospOUT%calipso_cfad_sr)) cospOUT%calipso_cfad_sr(:,:,:) = R_UNDEF @@ -2581,12 +3179,18 @@ subroutine cosp_errorCheck(cospgridIN, cospIN, Lisccp_subcolumn, Lisccp_column, if (associated(cospOUT%calipso_cldlayerphase)) cospOUT%calipso_cldlayerphase(:,:,:) = R_UNDEF if (associated(cospOUT%calipso_lidarcldtmp)) cospOUT%calipso_lidarcldtmp(:,:,:) = R_UNDEF if (associated(cospOUT%calipso_srbval)) cospOUT%calipso_srbval(:) = R_UNDEF + if (associated(cospOUT%calipso_lidarcldtype)) cospOUT%calipso_lidarcldtype(:,:,:) = R_UNDEF + if (associated(cospOUT%calipso_cldtype)) cospOUT%calipso_cldtype(:,:) = R_UNDEF + if (associated(cospOUT%calipso_cldtypetemp)) cospOUT%calipso_cldtypetemp(:,:) = R_UNDEF + if (associated(cospOUT%calipso_cldtypemeanz)) cospOUT%calipso_cldtypemeanz(:,:) = R_UNDEF + if (associated(cospOUT%calipso_cldtypemeanzse)) cospOUT%calipso_cldtypemeanzse(:,:) = R_UNDEF + if (associated(cospOUT%calipso_cldthinemis)) cospOUT%calipso_cldthinemis(:) = R_UNDEF endif endif if (any([Lcalipso_subcolumn,Lcalipso_column,Lcloudsat_column,Lradar_lidar_tcc,Llidar_only_freq_cloud])) then - if (any(cospIN%beta_mol .lt. 0)) then + if (any(cospIN%beta_mol_calipso .lt. 0)) then nError=nError+1 - errorMessage(nError) = 'ERROR: COSP input variable: cospIN%beta_mol contains values out of range' + errorMessage(nError) = 'ERROR: COSP input variable: cospIN%beta_mol_calipso contains values out of range' Lcalipso_subcolumn = .false. Lcalipso_column = .false. Lcloudsat_column = .false. @@ -2602,6 +3206,12 @@ subroutine cosp_errorCheck(cospgridIN, cospIN, Lisccp_subcolumn, Lisccp_column, if (associated(cospOUT%cloudsat_cfad_ze)) cospOUT%cloudsat_cfad_ze(:,:,:) = R_UNDEF if (associated(cospOUT%lidar_only_freq_cloud)) cospOUT%lidar_only_freq_cloud(:,:) = R_UNDEF if (associated(cospOUT%radar_lidar_tcc)) cospOUT%radar_lidar_tcc(:) = R_UNDEF + if (associated(cospOUT%calipso_lidarcldtype)) cospOUT%calipso_lidarcldtype(:,:,:) = R_UNDEF + if (associated(cospOUT%calipso_cldtype)) cospOUT%calipso_cldtype(:,:) = R_UNDEF + if (associated(cospOUT%calipso_cldtypetemp)) cospOUT%calipso_cldtypetemp(:,:) = R_UNDEF + if (associated(cospOUT%calipso_cldtypemeanz)) cospOUT%calipso_cldtypemeanz(:,:) = R_UNDEF + if (associated(cospOUT%calipso_cldtypemeanzse)) cospOUT%calipso_cldtypemeanzse(:,:) = R_UNDEF + if (associated(cospOUT%calipso_cldthinemis)) cospOUT%calipso_cldthinemis(:) = R_UNDEF endif endif if (any([Lparasol_subcolumn,Lparasol_column])) then @@ -2789,41 +3399,95 @@ subroutine cosp_errorCheck(cospgridIN, cospIN, Lisccp_subcolumn, Lisccp_column, errorMessage(nError) = 'ERROR(cloudsat_simulator): The number of levels in the input fields are inconsistent' endif endif + + ! GROUND LIDAR @ 532nm + if (size(cospIN%beta_mol_grLidar532,1) .ne. cospIN%Npoints .OR. & + size(cospIN%betatot_grLidar532,1) .ne. cospIN%Npoints .OR. & + size(cospIN%tau_mol_grLidar532,1) .ne. cospIN%Npoints .OR. & + size(cospIN%tautot_grLidar532,1) .ne. cospIN%Npoints) then + LgrLidar532_subcolumn = .false. + LgrLidar532_column = .false. + nError=nError+1 + errorMessage(nError) = 'ERROR(grLidar532_simulator): The number of points in the input fields are inconsistent' + endif + if (size(cospIN%betatot_grLidar532,2) .ne. cospIN%Ncolumns .OR. & + size(cospIN%tautot_grLidar532,2) .ne. cospIN%Ncolumns) then + LgrLidar532_subcolumn = .false. + LgrLidar532_column = .false. + nError=nError+1 + errorMessage(nError) = 'ERROR(grLidar532_simulator): The number of sub-columns in the input fields are inconsistent' + endif + if (size(cospIN%beta_mol_grLidar532,2) .ne. cospIN%Nlevels .OR. & + size(cospIN%betatot_grLidar532,3) .ne. cospIN%Nlevels .OR. & + size(cospIN%tau_mol_grLidar532,2) .ne. cospIN%Nlevels .OR. & + size(cospIN%tautot_grLidar532,3) .ne. cospIN%Nlevels) then + LgrLidar532_subcolumn = .false. + LgrLidar532_column = .false. + nError=nError+1 + errorMessage(nError) = 'ERROR(grLidar532_simulator): The number of levels in the input fields are inconsistent' + endif + ! ATLID + if (size(cospIN%beta_mol_atlid,1) .ne. cospIN%Npoints .OR. & + size(cospIN%betatot_atlid,1) .ne. cospIN%Npoints .OR. & + size(cospIN%tau_mol_atlid,1) .ne. cospIN%Npoints .OR. & + size(cospIN%tautot_atlid,1) .ne. cospIN%Npoints) then + Latlid_subcolumn = .false. + Latlid_column = .false. + nError=nError+1 + errorMessage(nError) = 'ERROR(atlid_simulator): The number of points in the input fields are inconsistent' + endif + if (size(cospIN%betatot_atlid,2) .ne. cospIN%Ncolumns .OR. & + size(cospIN%tautot_atlid,2) .ne. cospIN%Ncolumns) then + Latlid_subcolumn = .false. + Latlid_column = .false. + nError=nError+1 + errorMessage(nError) = 'ERROR(atlid_simulator): The number of sub-columns in the input fields are inconsistent' + endif + if (size(cospIN%beta_mol_atlid,2) .ne. cospIN%Nlevels .OR. & + size(cospIN%betatot_atlid,3) .ne. cospIN%Nlevels .OR. & + size(cospIN%tau_mol_atlid,2) .ne. cospIN%Nlevels .OR. & + size(cospIN%tautot_atlid,3) .ne. cospIN%Nlevels) then + Latlid_subcolumn = .false. + Latlid_column = .false. + nError=nError+1 + errorMessage(nError) = 'ERROR(atlid_simulator): The number of levels in the input fields are inconsistent' + endif + ! CALIPSO if (Lcalipso_subcolumn .or. Lcalipso_column) then - if (size(cospIN%beta_mol,1) .ne. cospIN%Npoints .OR. & - size(cospIN%betatot,1) .ne. cospIN%Npoints .OR. & - size(cospIN%betatot_liq,1) .ne. cospIN%Npoints .OR. & - size(cospIN%betatot_ice,1) .ne. cospIN%Npoints .OR. & - size(cospIN%tau_mol,1) .ne. cospIN%Npoints .OR. & - size(cospIN%tautot,1) .ne. cospIN%Npoints .OR. & - size(cospIN%tautot_liq,1) .ne. cospIN%Npoints .OR. & - size(cospIN%tautot_ice,1) .ne. cospIN%Npoints) then + if (size(cospIN%beta_mol_calipso,1) .ne. cospIN%Npoints .OR. & + size(cospIN%betatot_calipso,1) .ne. cospIN%Npoints .OR. & + size(cospIN%betatot_liq_calipso,1) .ne. cospIN%Npoints .OR. & + size(cospIN%betatot_ice_calipso,1) .ne. cospIN%Npoints .OR. & + size(cospIN%tau_mol_calipso,1) .ne. cospIN%Npoints .OR. & + size(cospIN%tautot_calipso,1) .ne. cospIN%Npoints .OR. & + size(cospIN%tautot_liq_calipso,1) .ne. cospIN%Npoints .OR. & + size(cospIN%tautot_ice_calipso,1) .ne. cospIN%Npoints) then Lcalipso_subcolumn = .false. Lcalipso_column = .false. nError=nError+1 errorMessage(nError) = 'ERROR(calipso_simulator): The number of points in the input fields are inconsistent' endif - if (size(cospIN%betatot,2) .ne. cospIN%Ncolumns .OR. & - size(cospIN%betatot_liq,2) .ne. cospIN%Ncolumns .OR. & - size(cospIN%betatot_ice,2) .ne. cospIN%Ncolumns .OR. & - size(cospIN%tautot,2) .ne. cospIN%Ncolumns .OR. & - size(cospIN%tautot_liq,2) .ne. cospIN%Ncolumns .OR. & - size(cospIN%tautot_ice,2) .ne. cospIN%Ncolumns) then + if (size(cospIN%betatot_calipso,2) .ne. cospIN%Ncolumns .OR. & + size(cospIN%betatot_liq_calipso,2) .ne. cospIN%Ncolumns .OR. & + size(cospIN%betatot_ice_calipso,2) .ne. cospIN%Ncolumns .OR. & + size(cospIN%tautot_calipso,2) .ne. cospIN%Ncolumns .OR. & + size(cospIN%tautot_liq_calipso,2) .ne. cospIN%Ncolumns .OR. & + size(cospIN%tautot_ice_calipso,2) .ne. cospIN%Ncolumns) then Lcalipso_subcolumn = .false. Lcalipso_column = .false. nError=nError+1 errorMessage(nError) = 'ERROR(calipso_simulator): The number of sub-columns in the input fields are inconsistent' endif - if (size(cospIN%beta_mol,2) .ne. cospIN%Nlevels .OR. & - size(cospIN%betatot,3) .ne. cospIN%Nlevels .OR. & - size(cospIN%betatot_liq,3) .ne. cospIN%Nlevels .OR. & - size(cospIN%betatot_ice,3) .ne. cospIN%Nlevels .OR. & - size(cospIN%tau_mol,2) .ne. cospIN%Nlevels .OR. & - size(cospIN%tautot,3) .ne. cospIN%Nlevels .OR. & - size(cospIN%tautot_liq,3) .ne. cospIN%Nlevels .OR. & - size(cospIN%tautot_ice,3) .ne. cospIN%Nlevels) then + if (size(cospIN%beta_mol_calipso,2) .ne. cospIN%Nlevels .OR. & + size(cospIN%betatot_calipso,3) .ne. cospIN%Nlevels .OR. & + size(cospIN%betatot_liq_calipso,3) .ne. cospIN%Nlevels .OR. & + size(cospIN%betatot_ice_calipso,3) .ne. cospIN%Nlevels .OR. & + size(cospIN%tau_mol_calipso,2) .ne. cospIN%Nlevels .OR. & + size(cospIN%tautot_calipso,3) .ne. cospIN%Nlevels .OR. & + size(cospIN%tautot_liq_calipso,3) .ne. cospIN%Nlevels .OR. & + size(cospIN%tautot_ice_calipso,3) .ne. cospIN%Nlevels) then Lcalipso_subcolumn = .false. Lcalipso_column = .false. nError=nError+1 diff --git a/src/cosp_config.F90 b/src/cosp_config.F90 index 4fd18a69da..48a1e634b0 100644 --- a/src/cosp_config.F90 +++ b/src/cosp_config.F90 @@ -36,6 +36,9 @@ ! June 2015- D. Swales - Moved hydrometeor class variables to hydro_class_init in ! the module quickbeam_optics. ! 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 +! ! %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% MODULE MOD_COSP_CONFIG @@ -151,8 +154,7 @@ MODULE MOD_COSP_CONFIG integer,parameter :: & RTTOV_MAX_CHANNELS = 20 character(len=256),parameter :: & - rttovDir = '/Projects/Clouds/dswales/RTTOV/rttov_11.3/' - + rttovDir = '/homedata/rguzman/CALIPSO/RTTOV/rttov_11.3/' ! #################################################################################### ! Constants used by the PARASOL simulator. ! #################################################################################### @@ -307,7 +309,8 @@ MODULE MOD_COSP_CONFIG integer,parameter :: & LIDAR_NTEMP = 40, & - LIDAR_NCAT = 4 ! Number of categories for cloudtop heights (high/mid/low/tot) + LIDAR_NCAT = 4, & ! Number of categories for cloudtop heights (high/mid/low/tot) + LIDAR_NTYPE = 3 ! Number of categories for OPAQ (opaque/thin cloud + z_opaque) real(wp),parameter,dimension(LIDAR_NTEMP) :: & LIDAR_PHASE_TEMP= & (/-91.5,-88.5,-85.5,-82.5,-79.5,-76.5,-73.5,-70.5,-67.5,-64.5, & @@ -326,6 +329,48 @@ MODULE MOD_COSP_CONFIG 12., 15., 15., 18., 18., 21., 21., 24., 24., 100. /), & shape=(/2,40/)) + ! #################################################################################### + ! Parameters used by the GROUND LIDAR simulator + ! #################################################################################### + ! GROUND LIDAR backscatter histogram bins +! real(wp),parameter :: & +! S_cld = 5.0, & ! Threshold for cloud detection +! S_att = 0.01, & ! +! S_cld_att = 30. ! Threshold for undefined cloud phase detection + real(wp),parameter,dimension(SR_BINS+1) :: & + grLidar532_histBsct = (/-1.,0.01,1.2,3.0,5.0,7.0,10.0,15.0,20.0,25.0,30.0,40.0,50.0, & + 60.0,80.0,999./) ! Backscatter histogram bins + real(wp),parameter,dimension(2,SR_BINS) :: & + grLidar532_binEdges = reshape(source=(/grLidar532_histBsct(1),((grLidar532_histBsct(k), & + l=1,2),k=2,SR_BINS),grLidar532_histBsct(SR_BINS+1)/), & + shape = (/2,SR_BINS/)) + real(wp),parameter,dimension(SR_BINS) :: & + grLidar532_binCenters = (grLidar532_binEdges(1,:)+grLidar532_binEdges(2,:))/2._wp + +! integer,parameter :: & +! LIDAR_NCAT = 4 ! Number of categories for cloudtop heights (high/mid/low/tot) + + ! #################################################################################### + ! Parameters used by the ATLID LIDAR simulator + ! #################################################################################### + ! ATLID LIDAR backscatter histogram bins + real(wp),parameter :: & + S_cld_atlid = 1.74, & ! Threshold for cloud detection + S_att_atlid = 0.01, & ! + S_cld_att_atlid = 6.67 ! Threshold for undefined cloud phase detection + real(wp),parameter,dimension(SR_BINS+1) :: & + atlid_histBsct = (/-1.,0.01,1.03,1.38,1.74,2.07,2.62,3.65,4.63,5.63,6.67,8.8,11.25, & + 13.2,17.2,999./) ! Backscatter histogram bins + real(wp),parameter,dimension(2,SR_BINS) :: & + atlid_binEdges = reshape(source=(/atlid_histBsct(1),((atlid_histBsct(k), & + l=1,2),k=2,SR_BINS),atlid_histBsct(SR_BINS+1)/), & + shape = (/2,SR_BINS/)) + real(wp),parameter,dimension(SR_BINS) :: & + atlid_binCenters = (atlid_binEdges(1,:)+atlid_binEdges(2,:))/2._wp + +! integer,parameter :: & +! LIDAR_NCAT = 4 ! Number of categories for cloudtop heights (high/mid/low/tot) + ! #################################################################################### ! New vertical grid used by CALIPSO and CLOUDSAT L3 (set up during initialization) ! #################################################################################### diff --git a/src/simulator/actsim/lidar_simulator.F90 b/src/simulator/actsim/lidar_simulator.F90 index 51f381e706..5905fc6083 100644 --- a/src/simulator/actsim/lidar_simulator.F90 +++ b/src/simulator/actsim/lidar_simulator.F90 @@ -66,11 +66,22 @@ ! in a climate model using CALIPSO-GOCCP, J. Geophys. Res., doi: 10.1002/jgrd.50376 ! ! May 2015 - D. Swales - Modified for COSPv2.0 +! +! Mar 2018 - R. Guzman - Added OPAQ subroutines +! References OPAQ: +! +! Guzman et al. (2017): Direct atmosphere opacity observations from CALIPSO provide +! new constraints on cloud-radiation interactions. JGR-Atmospheres, DOI: 10.1002/2016JD025946 +! Vaillant de Guelis et al. (2017a): The link between outgoing longwave radiation and +! the altitude at which a spaceborne lidar beam is fully attenuated. AMT, 10, 4659-4685, +! https://doi.org/10.5194/amt-10-4659-2017 +! ! %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% module mod_lidar_simulator USE COSP_KINDS, ONLY: wp USE MOD_COSP_CONFIG, ONLY: SR_BINS,S_CLD,S_ATT,S_CLD_ATT,R_UNDEF,calipso_histBsct, & - use_vgrid,vgrid_zl,vgrid_zu + use_vgrid,vgrid_zl,vgrid_zu,vgrid_z,atlid_histBsct, & + grLidar532_histBsct,S_CLD_ATLID,S_ATT_ATLID,S_CLD_ATT_ATLID USE MOD_COSP_STATS, ONLY: COSP_CHANGE_VERTICAL_GRID,hist1d implicit none @@ -92,22 +103,25 @@ module mod_lidar_simulator ! Inputs with a vertical dimensions (nlev) should ordered in along the vertical ! dimension from TOA-2-SFC, for example: varIN(nlev) is varIN @ SFC. ! ###################################################################################### - subroutine lidar_subcolumn(npoints,ncolumns,nlev,beta_mol,tau_mol,betatot,tautot, & - betatot_ice,tautot_ice,betatot_liq,tautot_liq, & - pmol,pnorm,pnorm_perp_tot) + subroutine lidar_subcolumn(npoints, ncolumns, nlev, lground, beta_mol, tau_mol, & + betatot, tautot, pmol, pnorm, betatot_ice, tautot_ice, betatot_liq, tautot_liq, & + pnorm_perp_tot) ! INPUTS INTEGER,intent(in) :: & npoints, & ! Number of gridpoints ncolumns, & ! Number of subcolumns nlev ! Number of levels + logical,intent(in) :: & + lground ! True for ground-based lidar simulator REAL(WP),intent(in),dimension(npoints,nlev) :: & beta_mol, & ! Molecular backscatter coefficient tau_mol ! Molecular optical depth - REAL(WP),intent(in),dimension(npoints,ncolumns,nlev) :: & betatot, & ! - tautot, & ! Optical thickess integrated from top + tautot ! Optical thickess integrated from top + ! Optional Inputs + REAL(WP),intent(in),dimension(npoints,ncolumns,nlev),optional :: & betatot_ice, & ! Backscatter coefficient for ice particles betatot_liq, & ! Backscatter coefficient for liquid particles tautot_ice, & ! Total optical thickness of ice @@ -117,11 +131,14 @@ subroutine lidar_subcolumn(npoints,ncolumns,nlev,beta_mol,tau_mol,betatot,tautot REAL(WP),intent(out),dimension(npoints,nlev) :: & pmol ! Molecular attenuated backscatter lidar signal power(m^-1.sr^-1) REAL(WP),intent(out),dimension(npoints,ncolumns,nlev) :: & - pnorm, & ! Molecular backscatter signal power (m^-1.sr^-1) + pnorm ! Molecular backscatter signal power (m^-1.sr^-1) + ! Optional outputs + REAL(WP),intent(out),dimension(npoints,ncolumns,nlev),optional :: & pnorm_perp_tot ! Perpendicular lidar backscattered signal power ! LOCAL VARIABLES - INTEGER :: k,icol + INTEGER :: k,icol,zi,zf,zinc + logical :: lphaseoptics REAL(WP),dimension(npoints) :: & tautot_lay ! REAL(WP),dimension(npoints,ncolumns,nlev) :: & @@ -130,13 +147,29 @@ subroutine lidar_subcolumn(npoints,ncolumns,nlev,beta_mol,tau_mol,betatot,tautot pnorm_perp_ice, & ! Perpendicular lidar backscattered signal power for ice pnorm_perp_liq, & ! Perpendicular lidar backscattered signal power for liq beta_perp_ice, & ! Perpendicular backscatter coefficient for ice - beta_perp_liq ! Perpendicular backscatter coefficient for liquid + beta_perp_liq ! Perpendicular backscatter coefficient for liquid + + ! Phase optics? + lphaseoptics=.false. + if (present(betatot_ice) .and. present(betatot_liq) .and. present(tautot_liq) .and. & + present(tautot_ice)) lphaseoptics=.true. + + ! Is this lidar spaceborne (default) or ground-based? + if (lground) then + zi = nlev + zf = 1 + zinc = -1 + else + zi = 1 + zf = nlev + zinc = 1 + endif ! #################################################################################### ! *) Molecular signal ! #################################################################################### - call cmp_backsignal(nlev,npoints,beta_mol(1:npoints,1:nlev),& - tau_mol(1:npoints,1:nlev),pmol(1:npoints,1:nlev)) + call cmp_backsignal(nlev,npoints,beta_mol(1:npoints,zi:zf:zinc),& + tau_mol(1:npoints,zi:zf:zinc),pmol(1:npoints,zi:zf:zinc)) ! #################################################################################### ! PLANE PARRALLEL FIELDS @@ -145,102 +178,106 @@ subroutine lidar_subcolumn(npoints,ncolumns,nlev,beta_mol,tau_mol,betatot,tautot ! ################################################################################# ! *) Total Backscatter signal ! ################################################################################# - call cmp_backsignal(nlev,npoints,betatot(1:npoints,icol,1:nlev),& - tautot(1:npoints,icol,1:nlev),pnorm(1:npoints,icol,1:nlev)) + call cmp_backsignal(nlev,npoints,betatot(1:npoints,icol,zi:zf:zinc),& + tautot(1:npoints,icol,zi:zf:zinc),pnorm(1:npoints,icol,zi:zf:zinc)) + ! ################################################################################# ! *) Ice/Liq Backscatter signal ! ################################################################################# - ! Computation of the ice and liquid lidar backscattered signal (ATBice and ATBliq) - ! Ice only - call cmp_backsignal(nlev,npoints,betatot_ice(1:npoints,icol,1:nlev),& - tautot_ice(1:npoints,icol,1:nlev),& - pnorm_ice(1:npoints,icol,1:nlev)) - ! Liquid only - call cmp_backsignal(nlev,npoints,betatot_liq(1:npoints,icol,1:nlev),& - tautot_liq(1:npoints,icol,1:nlev),& - pnorm_liq(1:npoints,icol,1:nlev)) + if (lphaseoptics) then + ! Computation of the ice and liquid lidar backscattered signal (ATBice and ATBliq) + ! Ice only + call cmp_backsignal(nlev,npoints,betatot_ice(1:npoints,icol,zi:zf:zinc),& + tautot_ice(1:npoints,icol,zi:zf:zinc), pnorm_ice(1:npoints,icol,zi:zf:zinc)) + ! Liquid only + call cmp_backsignal(nlev,npoints,betatot_liq(1:npoints,icol,zi:zf:zinc),& + tautot_liq(1:npoints,icol,zi:zf:zinc), pnorm_liq(1:npoints,icol,zi:zf:zinc)) + endif enddo ! #################################################################################### - ! PERDENDICULAR FIELDS + ! PERDENDICULAR FIELDS (Only needed if distinguishing by phase (ice/liquid)) ! #################################################################################### - do icol=1,ncolumns - - ! ################################################################################# - ! *) Ice/Liq Perpendicular Backscatter signal - ! ################################################################################# - ! Computation of ATBperp,ice/liq from ATBice/liq including the multiple scattering - ! contribution (Cesana and Chepfer 2013, JGR) - do k=1,nlev - ! Ice particles - pnorm_perp_ice(1:npoints,icol,k) = Alpha * pnorm_ice(1:npoints,icol,k) - - ! Liquid particles - pnorm_perp_liq(1:npoints,icol,k) = 1000._wp*Beta*pnorm_liq(1:npoints,icol,k)**2+& - Gamma*pnorm_liq(1:npoints,icol,k) - enddo - - ! ################################################################################# - ! *) Computation of beta_perp_ice/liq using the lidar equation - ! ################################################################################# - ! Ice only - call cmp_beta(nlev,npoints,pnorm_perp_ice(1:npoints,icol,1:nlev),& - tautot_ice(1:npoints,icol,1:nlev),beta_perp_ice(1:npoints,icol,1:nlev)) - - ! Liquid only - call cmp_beta(nlev,npoints,pnorm_perp_liq(1:npoints,icol,1:nlev),& - tautot_liq(1:npoints,icol,1:nlev),beta_perp_liq(1:npoints,icol,1:nlev)) - - ! ################################################################################# - ! *) Perpendicular Backscatter signal - ! ################################################################################# - ! Computation of the total perpendicular lidar signal (ATBperp for liq+ice) - ! Upper layer - WHERE(tautot(1:npoints,icol,1) .gt. 0) - pnorm_perp_tot(1:npoints,icol,1) = (beta_perp_ice(1:npoints,icol,1)+ & - beta_perp_liq(1:npoints,icol,1)- & - (beta_mol(1:npoints,1)/(1._wp+1._wp/0.0284_wp))) / & - (2._wp*tautot(1:npoints,icol,1))* & - (1._wp-exp(-2._wp*tautot(1:npoints,icol,1))) - ELSEWHERE - pnorm_perp_tot(1:npoints,icol,1) = 0._wp - ENDWHERE + if (lphaseoptics) then + do icol=1,ncolumns + ! ################################################################################# + ! *) Ice/Liq Perpendicular Backscatter signal + ! ################################################################################# + ! Computation of ATBperp,ice/liq from ATBice/liq including the multiple scattering + ! contribution (Cesana and Chepfer 2013, JGR) + do k=1,nlev + ! Ice particles + pnorm_perp_ice(1:npoints,icol,k) = Alpha * pnorm_ice(1:npoints,icol,k) - ! Other layers - do k=2,nlev - ! Optical thickness of layer k - tautot_lay(1:npoints) = tautot(1:npoints,icol,k)-tautot(1:npoints,icol,k-1) - - ! The perpendicular component of the molecular backscattered signal (Betaperp) - ! has been taken into account two times (once for liquid and once for ice). - ! We remove one contribution using - ! Betaperp=beta_mol(:,k)/(1+1/0.0284)) [bodhaine et al. 1999] in the following - ! equations: - WHERE (pnorm(1:npoints,icol,k) .eq. 0) - pnorm_perp_tot(1:npoints,icol,k)=0._wp + ! Liquid particles + pnorm_perp_liq(1:npoints,icol,k) = 1000._wp*Beta*pnorm_liq(1:npoints,icol,k)**2+& + Gamma*pnorm_liq(1:npoints,icol,k) + enddo + + ! ################################################################################# + ! *) Computation of beta_perp_ice/liq using the lidar equation + ! ################################################################################# + ! Ice only + call cmp_beta(nlev,npoints,pnorm_perp_ice(1:npoints,icol,zi:zf:zinc),& + tautot_ice(1:npoints,icol,zi:zf:zinc),beta_perp_ice(1:npoints,icol,zi:zf:zinc)) + + ! Liquid only + call cmp_beta(nlev,npoints,pnorm_perp_liq(1:npoints,icol,zi:zf:zinc),& + tautot_liq(1:npoints,icol,zi:zf:zinc),beta_perp_liq(1:npoints,icol,zi:zf:zinc)) + + ! ################################################################################# + ! *) Perpendicular Backscatter signal + ! ################################################################################# + ! Computation of the total perpendicular lidar signal (ATBperp for liq+ice) + ! Upper layer + WHERE(tautot(1:npoints,icol,1) .gt. 0) + pnorm_perp_tot(1:npoints,icol,1) = (beta_perp_ice(1:npoints,icol,1)+ & + beta_perp_liq(1:npoints,icol,1)- & + (beta_mol(1:npoints,1)/(1._wp+1._wp/0.0284_wp))) / & + (2._wp*tautot(1:npoints,icol,1))* & + (1._wp-exp(-2._wp*tautot(1:npoints,icol,1))) ELSEWHERE - where(tautot_lay(1:npoints) .gt. 0.) - pnorm_perp_tot(1:npoints,icol,k) = (beta_perp_ice(1:npoints,icol,k)+ & - beta_perp_liq(1:npoints,icol,k)-(beta_mol(1:npoints,k)/(1._wp+1._wp/ & - 0.0284_wp)))*EXP(-2._wp*tautot(1:npoints,icol,k-1))/ & - (2._wp*tautot_lay(1:npoints))* (1._wp-EXP(-2._wp*tautot_lay(1:npoints))) - elsewhere - pnorm_perp_tot(1:npoints,icol,k) = (beta_perp_ice(1:npoints,icol,k)+ & - beta_perp_liq(1:npoints,icol,k)-(beta_mol(1:npoints,k)/(1._wp+1._wp/ & - 0.0284_wp)))*EXP(-2._wp*tautot(1:npoints,icol,k-1)) - endwhere + pnorm_perp_tot(1:npoints,icol,1) = 0._wp ENDWHERE - END DO - enddo + + ! Other layers + do k=2,nlev + ! Optical thickness of layer k + tautot_lay(1:npoints) = tautot(1:npoints,icol,k)-tautot(1:npoints,icol,k-1) + + ! The perpendicular component of the molecular backscattered signal (Betaperp) + ! has been taken into account two times (once for liquid and once for ice). + ! We remove one contribution using + ! Betaperp=beta_mol(:,k)/(1+1/0.0284)) [bodhaine et al. 1999] in the following + ! equations: + WHERE (pnorm(1:npoints,icol,k) .eq. 0) + pnorm_perp_tot(1:npoints,icol,k)=0._wp + ELSEWHERE + where(tautot_lay(1:npoints) .gt. 0.) + pnorm_perp_tot(1:npoints,icol,k) = (beta_perp_ice(1:npoints,icol,k)+ & + beta_perp_liq(1:npoints,icol,k)-(beta_mol(1:npoints,k)/(1._wp+1._wp/ & + 0.0284_wp)))*EXP(-2._wp*tautot(1:npoints,icol,k-1))/ & + (2._wp*tautot_lay(1:npoints))* (1._wp-EXP(-2._wp*tautot_lay(1:npoints))) + elsewhere + pnorm_perp_tot(1:npoints,icol,k) = (beta_perp_ice(1:npoints,icol,k)+ & + beta_perp_liq(1:npoints,icol,k)-(beta_mol(1:npoints,k)/(1._wp+1._wp/ & + 0.0284_wp)))*EXP(-2._wp*tautot(1:npoints,icol,k-1)) + endwhere + ENDWHERE + END DO + enddo + end if end subroutine lidar_subcolumn ! ###################################################################################### ! SUBROUTINE lidar_column ! ###################################################################################### - subroutine lidar_column(npoints,ncol,nlevels,llm,max_bin,tmp, pnorm, & - pnorm_perp, pmol, pplay, ok_lidar_cfad, ncat, cfad2, & - lidarcld, lidarcldphase, cldlayer, zlev, zlev_half, & - cldlayerphase, lidarcldtmp) + subroutine lidar_column(npoints, ncol, nlevels, llm, max_bin, ntype, platform, pnorm, pmol, & + pplay, zlev, zlev_half, vgrid_z, ok_lidar_cfad, ncat, cfad2, lidarcld, cldlayer, & + ! Optional stuff below + tmp, pnorm_perp, surfelev, lidarcldphase, lidarcldtype, cldtype, cldtypetemp, & + cldtypemeanz, cldtypemeanzse, cldthinemis, cldlayerphase, lidarcldtmp) + integer,parameter :: & nphase = 6 ! Number of cloud layer phase types @@ -251,37 +288,60 @@ subroutine lidar_column(npoints,ncol,nlevels,llm,max_bin,tmp, pnorm, nlevels, & ! Number of vertical layers (OLD grid) llm, & ! Number of vertical layers (NEW grid) max_bin, & ! Number of bins for SR CFADs - ncat ! Number of cloud layer types (low,mid,high,total) + ncat, & ! Number of cloud layer types (low,mid,high,total) + ntype ! Number of OPAQ products (opaque/thin cloud + z_opaque) + character(len=*),intent(in) :: & + platform ! Name of platform (e.g. calipso,atlid,grLidar532) real(wp),intent(in),dimension(npoints,ncol,Nlevels) :: & - pnorm, & ! Lidar ATB - pnorm_perp ! Lidar perpendicular ATB + pnorm ! Lidar ATB real(wp),intent(in),dimension(npoints,Nlevels) :: & pmol, & ! Molecular ATB - pplay, & ! Pressure on model levels (Pa) - tmp ! Temperature at each levels + pplay ! Pressure on model levels (Pa) logical,intent(in) :: & ok_lidar_cfad ! True if lidar CFAD diagnostics need to be computed real(wp),intent(in),dimension(npoints,nlevels) :: & zlev ! Model full levels real(wp),intent(in),dimension(npoints,nlevels+1) :: & zlev_half ! Model half levels - + real(wp),intent(in),dimension(llm) :: & + vgrid_z ! mid-level altitude of the output vertical grid + ! Optional Inputs + real(wp),intent(in),dimension(npoints,ncol,Nlevels),optional :: & + pnorm_perp ! Lidar perpendicular ATB + real(wp),intent(in),dimension(npoints),optional :: & + surfelev ! Surface Elevation (m) + real(wp),intent(in),dimension(npoints,Nlevels),optional :: & + tmp ! Temperature at each levels + ! Outputs real(wp),intent(inout),dimension(npoints,llm) :: & lidarcld ! 3D "lidar" cloud fraction real(wp),intent(inout),dimension(npoints,ncat) :: & cldlayer ! "lidar" cloud layer fraction (low, mid, high, total) - real(wp),intent(inout),dimension(npoints,llm,nphase) :: & + real(wp),intent(inout),dimension(npoints,max_bin,llm) :: & + cfad2 ! CFADs of SR + ! Optional Outputs + real(wp),intent(out),dimension(npoints,ntype),optional :: & + cldtype, & ! "lidar" OPAQ type covers (opaque/thin cloud + z_opaque) + cldtypetemp ! Opaque and thin clouds + z_opaque temperature + real(wp),intent(out),dimension(npoints,2),optional :: & + cldtypemeanz ! Opaque and thin clouds altitude + real(wp),intent(out),dimension(npoints,3),optional :: & + cldtypemeanzse ! Opaque, thin clouds and z_opaque altitude with respect to SE + real(wp),intent(out),dimension(npoints),optional :: & + cldthinemis ! Thin clouds emissivity computed from SR + real(wp),intent(out),dimension(npoints,llm,nphase),optional :: & lidarcldphase ! 3D "lidar" phase cloud fraction - real(wp),intent(inout),dimension(npoints,40,5) :: & + real(wp),intent(out),dimension(npoints,llm,ntype+1),optional :: & + lidarcldtype ! 3D "lidar" OPAQ type fraction + real(wp),intent(out),dimension(npoints,40,5),optional :: & lidarcldtmp ! 3D "lidar" phase cloud fraction as a function of temp - real(wp),intent(inout),dimension(npoints,ncat,nphase) :: & + real(wp),intent(out),dimension(npoints,ncat,nphase),optional :: & cldlayerphase ! "lidar" phase low mid high cloud fraction - real(wp),intent(inout),dimension(npoints,max_bin,llm) :: & - cfad2 ! CFADs of SR ! Local Variables integer :: ic,i,j + logical :: lcalipso,latlid,lgrlidar532 real(wp),dimension(npoints,ncol,llm) :: & x3d real(wp),dimension(npoints,llm) :: & @@ -291,12 +351,18 @@ subroutine lidar_column(npoints,ncol,nlevels,llm,max_bin,tmp, pnorm, real(wp),dimension(npoints,1,Nlevels) :: t_in,ph_in,betamol_in real(wp),dimension(npoints,ncol,llm) :: pnormFlip,pnorm_perpFlip real(wp),dimension(npoints,1,llm) :: tmpFlip,pplayFlip,betamolFlip - + real(wp),dimension(SR_BINS+1) :: histBsct + + ! Which lidar platform? + lcalipso = .false. + latlid = .false. + lgrlidar532 = .false. + if (platform .eq. 'calipso') lcalipso=.true. + if (platform .eq. 'atlid') latlid=.true. + if (platform .eq. 'grlidar532') lgrlidar532=.true. + ! Vertically regrid input data if (use_vgrid) then - t_in(:,1,:)=tmp(:,nlevels:1:-1) - call cosp_change_vertical_grid(Npoints,1,Nlevels,zlev(:,nlevels:1:-1),zlev_half(:,nlevels:1:-1),& - t_in,llm,vgrid_zl(llm:1:-1),vgrid_zu(llm:1:-1),tmpFlip(:,1,llm:1:-1)) ph_in(:,1,:) = pplay(:,nlevels:1:-1) call cosp_change_vertical_grid(Npoints,1,Nlevels,zlev(:,nlevels:1:-1),zlev_half(:,nlevels:1:-1),& ph_in,llm,vgrid_zl(llm:1:-1),vgrid_zu(llm:1:-1),pplayFlip(:,1,llm:1:-1)) @@ -305,14 +371,30 @@ subroutine lidar_column(npoints,ncol,nlevels,llm,max_bin,tmp, pnorm, betamol_in,llm,vgrid_zl(llm:1:-1),vgrid_zu(llm:1:-1),betamolFlip(:,1,llm:1:-1)) call cosp_change_vertical_grid(Npoints,Ncol,Nlevels,zlev(:,nlevels:1:-1),zlev_half(:,nlevels:1:-1),& pnorm(:,:,nlevels:1:-1),llm,vgrid_zl(llm:1:-1),vgrid_zu(llm:1:-1),pnormFlip(:,:,llm:1:-1)) - call cosp_change_vertical_grid(Npoints,Ncol,Nlevels,zlev(:,nlevels:1:-1),zlev_half(:,nlevels:1:-1),& - pnorm_perp(:,:,nlevels:1:-1),llm,vgrid_zl(llm:1:-1),vgrid_zu(llm:1:-1),pnorm_perpFlip(:,:,llm:1:-1)) + if (lcalipso) then + t_in(:,1,:)=tmp(:,nlevels:1:-1) + call cosp_change_vertical_grid(Npoints,1,Nlevels,zlev(:,nlevels:1:-1),zlev_half(:,nlevels:1:-1),& + t_in,llm,vgrid_zl(llm:1:-1),vgrid_zu(llm:1:-1),tmpFlip(:,1,llm:1:-1)) + call cosp_change_vertical_grid(Npoints,Ncol,Nlevels,zlev(:,nlevels:1:-1),zlev_half(:,nlevels:1:-1),& + pnorm_perp(:,:,nlevels:1:-1),llm,vgrid_zl(llm:1:-1),vgrid_zu(llm:1:-1),pnorm_perpFlip(:,:,llm:1:-1)) + endif endif ! Initialization (The histogram bins, are set up during initialization and the ! maximum value is used as the upper bounds.) - xmax = maxval(calipso_histBsct) - + if (lcalipso) then + xmax = maxval(calipso_histBsct) + histBsct = calipso_histBsct + endif + if (latlid) then + xmax = maxval(atlid_histBsct) + histBsct = atlid_histBsct + endif + if (lgrlidar532) then + xmax = maxval(grLidar532_histBsct) + histBsct = grLidar532_histBsct + endif + ! Compute LIDAR scattering ratio if (use_vgrid) then do ic = 1, ncol @@ -325,10 +407,24 @@ subroutine lidar_column(npoints,ncol,nlevels,llm,max_bin,tmp, pnorm, end where x3d(:,ic,:) = x3d_c enddo - ! Diagnose cloud fractions for subcolumn lidar scattering ratios - CALL COSP_CLDFRAC(npoints,ncol,llm,ncat,nphase,tmpFlip,x3d,pnormFlip, & - pnorm_perpFlip,pplayFlip,S_att,S_cld,S_cld_att,R_UNDEF, & - lidarcld,cldlayer,lidarcldphase,cldlayerphase,lidarcldtmp) + if (lcalipso) then + ! Diagnose cloud fractions for subcolumn lidar scattering ratios + CALL COSP_CLDFRAC(npoints,ncol,llm,ncat,nphase,tmpFlip,x3d,pnormFlip,pnorm_perpFlip,& + pplayFlip,S_att,S_cld,S_cld_att,R_UNDEF,lidarcld,cldlayer,lidarcldphase,& + cldlayerphase,lidarcldtmp) + + ! Calipso opaque cloud diagnostics + CALL COSP_OPAQ(npoints,ncol,llm,ntype,tmpFlip,x3d,S_att,S_cld,R_UNDEF,lidarcldtype, & + cldtype,cldtypetemp,cldtypemeanz,cldtypemeanzse,cldthinemis,vgrid_z,surfelev) + endif + if (latlid) then + CALL COSP_CLDFRAC_NOPHASE(npoints,ncol,llm,ncat,x3d,pnormFlip,pplayFlip, & + S_att_atlid,S_cld_atlid,S_cld_att_atlid,R_UNDEF,lidarcld,cldlayer) + endif + if (lgrLidar532) then + CALL COSP_CLDFRAC_NOPHASE(npoints,ncol,llm,ncat,x3d,pnormFlip,pplayFlip, & + S_att,S_cld,S_cld_att,R_UNDEF,lidarcld,cldlayer) + endif else do ic = 1, ncol pnorm_c = pnorm(:,ic,:) @@ -339,10 +435,23 @@ subroutine lidar_column(npoints,ncol,nlevels,llm,max_bin,tmp, pnorm, end where x3d(:,ic,:) = x3d_c enddo - ! Diagnose cloud fractions for subcolumn lidar scattering ratios - CALL COSP_CLDFRAC(npoints,ncol,nlevels,ncat,nphase,tmp,x3d,pnorm,pnorm_perp,pplay,& - S_att,S_cld,S_cld_att,R_UNDEF,lidarcld,cldlayer,lidarcldphase, & - cldlayerphase,lidarcldtmp) + if (lcalipso) then + ! Diagnose cloud fractions for subcolumn lidar scattering ratios + CALL COSP_CLDFRAC(npoints,ncol,nlevels,ncat,nphase,tmp,x3d,pnorm,pnorm_perp,pplay,& + S_att,S_cld,S_cld_att,R_UNDEF,lidarcld,cldlayer,lidarcldphase, & + cldlayerphase,lidarcldtmp) + ! Calipso opaque cloud diagnostics + CALL COSP_OPAQ(npoints,ncol,nlevels,ntype,tmp,x3d,S_att,S_cld,R_UNDEF,lidarcldtype, & + cldtype,cldtypetemp,cldtypemeanz,cldtypemeanzse,cldthinemis,vgrid_z,surfelev) + endif + if (latlid) then + CALL COSP_CLDFRAC_NOPHASE(npoints,ncol,nlevels,ncat,x3d,pnorm,pplay, & + S_att_atlid,S_cld_atlid,S_cld_att_atlid, R_UNDEF,lidarcld,cldlayer) + endif + if (lgrlidar532) then + CALL COSP_CLDFRAC_NOPHASE(npoints,ncol,nlevels,ncat,x3d,pnorm,pplay, & + S_att,S_cld,S_cld_att,R_UNDEF,lidarcld,cldlayer) + endif endif ! CFADs @@ -350,20 +459,23 @@ subroutine lidar_column(npoints,ncol,nlevels,llm,max_bin,tmp, pnorm, ! CFADs of subgrid-scale lidar scattering ratios do i=1,Npoints do j=1,llm - cfad2(i,:,j) = hist1D(ncol,x3d(i,:,j),SR_BINS,calipso_histBsct) + cfad2(i,:,j) = hist1D(ncol,x3d(i,:,j),SR_BINS,histBsct) enddo enddo where(cfad2 .ne. R_UNDEF) cfad2=cfad2/ncol - endif ! Unit conversions where(lidarcld /= R_UNDEF) lidarcld = lidarcld*100._wp where(cldlayer /= R_UNDEF) cldlayer = cldlayer*100._wp - where(cldlayerphase /= R_UNDEF) cldlayerphase = cldlayerphase*100._wp - where(lidarcldphase /= R_UNDEF) lidarcldphase = lidarcldphase*100._wp - where(lidarcldtmp /= R_UNDEF) lidarcldtmp = lidarcldtmp*100._wp - + if (lcalipso) then + where(cldtype(:,1) /= R_UNDEF) cldtype(:,1) = cldtype(:,1)*100._wp + where(cldtype(:,2) /= R_UNDEF) cldtype(:,2) = cldtype(:,2)*100._wp + where(cldlayerphase /= R_UNDEF) cldlayerphase = cldlayerphase*100._wp + where(lidarcldphase /= R_UNDEF) lidarcldphase = lidarcldphase*100._wp + where(lidarcldtype /= R_UNDEF) lidarcldtype = lidarcldtype*100._wp + where(lidarcldtmp /= R_UNDEF) lidarcldtmp = lidarcldtmp*100._wp + endif end subroutine lidar_column ! ###################################################################################### @@ -1021,5 +1133,425 @@ SUBROUTINE COSP_CLDFRAC(Npoints,Ncolumns,Nlevels,Ncat,Nphase,tmp,x,ATB,ATBperp, RETURN END SUBROUTINE COSP_CLDFRAC + + ! #################################################################################### + ! SUBROUTINE cosp_cldfrac_nophase + ! Conventions: Ncat must be equal to 4 + ! #################################################################################### + SUBROUTINE COSP_CLDFRAC_NOPHASE(Npoints,Ncolumns,Nlevels,Ncat,x,ATB,pplay, & + S_att,S_cld,S_cld_att,undef,lidarcld,cldlayer) + + ! Inputs + integer,intent(in) :: & + Npoints, & ! Number of gridpoints + Ncolumns, & ! Number of subcolumns + Nlevels, & ! Number of vertical levels + Ncat ! Number of cloud layer types + real(wp),intent(in) :: & + S_att, & ! + S_cld, & ! + S_cld_att,& ! New threshold for undefine cloud phase detection + undef ! Undefined value + real(wp),intent(in),dimension(Npoints,Ncolumns,Nlevels) :: & + x, & ! + ATB ! 3D attenuated backscatter + real(wp),intent(in),dimension(Npoints,Nlevels) :: & + pplay ! Pressure + + ! Outputs + real(wp),intent(out),dimension(Npoints,Nlevels) :: & + lidarcld ! 3D cloud fraction + real(wp),intent(out),dimension(Npoints,Ncat) :: & + cldlayer ! Low, middle, high, total cloud fractions + + ! Local variables + integer :: & + ip, k, iz, ic, ncol, nlev, i + real(wp) :: & + p1 + real(wp),dimension(Npoints,Nlevels) :: & + nsub + real(wp),dimension(Npoints,Ncolumns,Ncat) :: & + cldlay,nsublay + real(wp),dimension(Npoints,Ncat) :: & + nsublayer + real(wp),dimension(Npoints,Ncolumns,Nlevels) :: & + cldy, & ! + srok ! + + ! #################################################################################### + ! 1) Initialize + ! #################################################################################### + lidarcld = 0._wp + nsub = 0._wp + cldlay = 0._wp + nsublay = 0._wp + + ! #################################################################################### + ! 2) Cloud detection + ! #################################################################################### + do k=1,Nlevels + ! Cloud detection at subgrid-scale: + where ((x(:,:,k) .gt. S_cld) .and. (x(:,:,k) .ne. undef) ) + cldy(:,:,k)=1._wp + elsewhere + cldy(:,:,k)=0._wp + endwhere + + ! Number of usefull sub-columns: + where ((x(:,:,k) .gt. S_att) .and. (x(:,:,k) .ne. undef) ) + srok(:,:,k)=1._wp + elsewhere + srok(:,:,k)=0._wp + endwhere + enddo + + ! #################################################################################### + ! 3) Grid-box 3D cloud fraction and layered cloud fractions(ISCCP pressure categories) + ! #################################################################################### + do k=1,Nlevels + do ic = 1, Ncolumns + do ip = 1, Npoints + + iz=1 + p1 = pplay(ip,k) + if ( p1.gt.0. .and. p1.lt.(440._wp*100._wp)) then ! high clouds + iz=3 + else if(p1.ge.(440._wp*100._wp) .and. p1.lt.(680._wp*100._wp)) then ! mid clouds + iz=2 + endif + + cldlay(ip,ic,iz) = MAX(cldlay(ip,ic,iz),cldy(ip,ic,k)) + cldlay(ip,ic,4) = MAX(cldlay(ip,ic,4),cldy(ip,ic,k)) + lidarcld(ip,k) = lidarcld(ip,k) + cldy(ip,ic,k) + + nsublay(ip,ic,iz) = MAX(nsublay(ip,ic,iz),srok(ip,ic,k)) + nsublay(ip,ic,4) = MAX(nsublay(ip,ic,4),srok(ip,ic,k)) + nsub(ip,k) = nsub(ip,k) + srok(ip,ic,k) + + enddo + enddo + enddo + + ! Grid-box 3D cloud fraction + where ( nsub(:,:).gt.0.0 ) + lidarcld(:,:) = lidarcld(:,:)/nsub(:,:) + elsewhere + lidarcld(:,:) = undef + endwhere + + ! Layered cloud fractions + cldlayer = 0._wp + nsublayer = 0._wp + do iz = 1, Ncat + do ic = 1, Ncolumns + cldlayer(:,iz) = cldlayer(:,iz) + cldlay(:,ic,iz) + nsublayer(:,iz) = nsublayer(:,iz) + nsublay(:,ic,iz) + enddo + enddo + where (nsublayer(:,:) .gt. 0.0) + cldlayer(:,:) = cldlayer(:,:)/nsublayer(:,:) + elsewhere + cldlayer(:,:) = undef + endwhere + + RETURN + END SUBROUTINE COSP_CLDFRAC_NOPHASE + + ! #################################################################################### + ! SUBROUTINE cosp_opaq + ! Conventions: Ntype must be equal to 3 + ! #################################################################################### + SUBROUTINE COSP_OPAQ(Npoints,Ncolumns,Nlevels,Ntype,tmp,x,S_att,S_cld,undef,lidarcldtype, & + cldtype,cldtypetemp,cldtypemeanz,cldtypemeanzse,cldthinemis,vgrid_z, & + surfelev) + + ! Local parameter + real(wp),parameter :: & + S_att_opaq = 0.06_wp, & ! Fully Attenuated threshold (Guzman et al. 2017, JGR-Atmospheres) + eta = 0.6_wp ! Multiple-scattering factor (Vaillant de Guelis et al. 2017a, AMT) + + ! Inputs + integer,intent(in) :: & + Npoints, & ! Number of gridpoints + Ncolumns, & ! Number of subcolumns + Nlevels, & ! Number of vertical levels + Ntype ! Number of OPAQ cloud types (opaque, thin clouds and z_opaque) + real(wp),intent(in) :: & + S_att, & ! Fully Attenuated legacy threshold + S_cld, & ! Cloud detection threshold + undef ! Undefined value + real(wp),intent(in),dimension(Nlevels) :: & + vgrid_z ! mid-level vertical profile altitude (subcolumns) + real(wp),intent(in),dimension(Npoints,Ncolumns,Nlevels) :: & + x ! SR profiles (subcolumns) + real(wp),intent(in),dimension(Npoints,Nlevels) :: & + tmp ! Temperature profiles + real(wp),intent(in),dimension(Npoints) :: & + surfelev ! Surface Elevation (SE) + + ! Outputs + real(wp),intent(out),dimension(Npoints,Nlevels,Ntype+1) :: & + lidarcldtype ! 3D OPAQ product fraction (opaque clouds, thin clouds, z_opaque, opacity) + real(wp),intent(out),dimension(Npoints,Ntype) :: & + cldtype, & ! Opaque/thin cloud covers + z_opaque altitude + cldtypetemp ! Opaque and thin clouds + z_opaque temperature + real(wp),intent(out),dimension(Npoints,2) :: & + cldtypemeanz ! Opaque and thin clouds altitude + real(wp),intent(out),dimension(Npoints,3) :: & + cldtypemeanzse ! Opaque, thin clouds and z_opaque altitude with respect to SE + real(wp),intent(out),dimension(Npoints) :: & + cldthinemis ! Thin clouds emissivity + + ! Local variables + integer :: & + ip, k, zopac, ic, iz, z_top, z_base, topcloud + real(wp) :: & + srmean, srcount, trans2, tau_app, tau_vis, tau_ir, cloudemis + real(wp),dimension(Npoints) :: & + count_emis + real(wp),dimension(Npoints,Nlevels) :: & + nsub, nsubopaq + real(wp),dimension(Npoints,Ncolumns,Ntype+1) :: & ! Opaque, thin, z_opaque and all cloud cover + cldlay, nsublay + real(wp),dimension(Npoints,Ntype) :: & + nsublayer + real(wp),dimension(Npoints,Ncolumns,Nlevels) :: & + cldy, & ! + cldyopaq, & ! + srok, & ! + srokopaq ! + + ! #################################################################################### + ! 1) Initialize + ! #################################################################################### + cldtype(:,:) = 0._wp + cldtypetemp(:,:) = 0._wp + cldtypemeanz(:,:) = 0._wp + cldtypemeanzse(:,:) = 0._wp + cldthinemis(:) = 0._wp + count_emis(:) = 0._wp + lidarcldtype(:,:,:) = 0._wp + nsub = 0._wp + nsubopaq = 0._wp + cldlay = 0._wp + nsublay = 0._wp + nsublayer = 0._wp + + ! #################################################################################### + ! 2) Cloud detection and Fully attenuated layer detection + ! #################################################################################### + do k=1,Nlevels + ! Cloud detection at subgrid-scale: + where ( (x(:,:,k) .gt. S_cld) .and. (x(:,:,k) .ne. undef) ) + cldy(:,:,k)=1._wp + elsewhere + cldy(:,:,k)=0._wp + endwhere + ! Fully attenuated layer detection at subgrid-scale: + where ( (x(:,:,k) .lt. S_att_opaq) .and. (x(:,:,k) .gt. 0.) .and. (x(:,:,k) .ne. undef) ) !DEBUG + cldyopaq(:,:,k)=1._wp + elsewhere + cldyopaq(:,:,k)=0._wp + endwhere + + + ! Number of usefull sub-column layers: + where ( (x(:,:,k) .gt. S_att) .and. (x(:,:,k) .ne. undef) ) + srok(:,:,k)=1._wp + elsewhere + srok(:,:,k)=0._wp + endwhere + ! Number of usefull sub-columns layers for z_opaque 3D fraction: + where ( (x(:,:,k) .gt. 0.) .and. (x(:,:,k) .ne. undef) ) !DEBUG + srokopaq(:,:,k)=1._wp + elsewhere + srokopaq(:,:,k)=0._wp + endwhere + enddo + + ! #################################################################################### + ! 3) Grid-box 3D OPAQ product fraction and cloud type cover (opaque/thin) + mean z_opaque + ! #################################################################################### + + do k=1,Nlevels + do ic = 1, Ncolumns + do ip = 1, Npoints + + cldlay(ip,ic,1) = MAX(cldlay(ip,ic,1),cldyopaq(ip,ic,k)) ! Opaque cloud + cldlay(ip,ic,4) = MAX(cldlay(ip,ic,4),cldy(ip,ic,k)) ! All cloud + + nsublay(ip,ic,1) = MAX(nsublay(ip,ic,1),srok(ip,ic,k)) + nsublay(ip,ic,2) = MAX(nsublay(ip,ic,2),srok(ip,ic,k)) +! nsublay(ip,ic,4) = MAX(nsublay(ip,ic,4),srok(ip,ic,k)) + nsub(ip,k) = nsub(ip,k) + srok(ip,ic,k) + nsubopaq(ip,k) = nsubopaq(ip,k) + srokopaq(ip,ic,k) + + enddo + enddo + enddo + +! OPAQ variables + do ic = 1, Ncolumns + do ip = 1, Npoints + + ! Declaring non-opaque cloudy profiles as thin cloud profiles + if ( cldlay(ip,ic,4).gt. 0. .and. cldlay(ip,ic,1) .eq. 0. ) then + cldlay(ip,ic,2) = 1._wp + endif + + ! Filling in 3D and 2D variables + + ! Opaque cloud profiles + if ( cldlay(ip,ic,1) .eq. 1. ) then + zopac = 0._wp + z_top = 0._wp + do k=1,Nlevels-1 + ! Declaring z_opaque altitude and opaque cloud fraction for 3D and 2D variables + ! From SFC-2-TOA ( actually from vgrid_z(SFC+1) = vgrid_z(Nlevels-1) ) + if ( cldy(ip,ic,Nlevels-k) .eq. 1. .and. zopac .eq. 0. ) then + lidarcldtype(ip,Nlevels-k + 1,3) = lidarcldtype(ip,Nlevels-k + 1,3) + 1._wp + cldlay(ip,ic,3) = vgrid_z(Nlevels-k+1) ! z_opaque altitude + nsublay(ip,ic,3) = 1._wp + zopac = Nlevels-k+1 ! z_opaque vertical index on vgrid_z + endif + if ( cldy(ip,ic,Nlevels-k) .eq. 1. ) then + lidarcldtype(ip,Nlevels-k ,1) = lidarcldtype(ip,Nlevels-k ,1) + 1._wp + z_top = Nlevels-k ! top cloud layer vertical index on vgrid_z + endif + enddo + ! Summing opaque cloud mean temperatures and altitudes + ! as defined in Vaillant de Guelis et al. 2017a, AMT + cldtypetemp(ip,1) = cldtypetemp(ip,1) + ( tmp(ip,zopac) + tmp(ip,z_top) )/2. + cldtypetemp(ip,3) = cldtypetemp(ip,3) + tmp(ip,zopac) ! z_opaque + cldtypemeanz(ip,1) = cldtypemeanz(ip,1) + ( vgrid_z(zopac) + vgrid_z(z_top) )/2. + cldtypemeanzse(ip,1) = cldtypemeanzse(ip,1) + (( vgrid_z(zopac) + vgrid_z(z_top) )/2.) - surfelev(ip) + cldtypemeanzse(ip,3) = cldtypemeanzse(ip,3) + ( vgrid_z(zopac) - surfelev(ip) ) + endif + + ! Thin cloud profiles + if ( cldlay(ip,ic,2) .eq. 1. ) then + topcloud = 0._wp + z_top = 0._wp + z_base = 0._wp + do k=1,Nlevels + ! Declaring thin cloud fraction for 3D variable + ! From TOA-2-SFC + if ( cldy(ip,ic,k) .eq. 1. .and. topcloud .eq. 1. ) then + lidarcldtype(ip,k,2) = lidarcldtype(ip,k,2) + 1._wp + z_base = k ! bottom cloud layer + endif + if ( cldy(ip,ic,k) .eq. 1. .and. topcloud .eq. 0. ) then + lidarcldtype(ip,k,2) = lidarcldtype(ip,k,2) + 1._wp + z_top = k ! top cloud layer + z_base = k ! bottom cloud layer + topcloud = 1._wp + endif + enddo + ! Computing mean emissivity using layers below the bottom cloud layer to the surface + srmean = 0._wp + srcount = 0._wp + cloudemis = 0._wp + do k=z_base+1,Nlevels + if ( (x(ip,ic,k) .gt. S_att_opaq) .and. (x(ip,ic,k) .lt. 1.0) .and. (x(ip,ic,k) .ne. undef) ) then + srmean = srmean + x(ip,ic,k) + srcount = srcount + 1. + endif + enddo + ! If clear sky layers exist below bottom cloud layer + if ( srcount .gt. 0. ) then + trans2 = srmean/srcount ! thin cloud transmittance**2 + tau_app = -(log(trans2))/2. ! apparent cloud optical depth + tau_vis = tau_app/eta ! cloud visible optical depth (multiple scat.) + tau_ir = tau_vis/2. ! approx. relation between visible and IR ODs + cloudemis = 1. - exp(-tau_ir) ! no diffusion in IR considered : emis = 1-T + count_emis(ip) = count_emis(ip) + 1. + endif + ! Summing thin cloud mean temperatures and altitudes + ! as defined in Vaillant de Guelis et al. 2017a, AMT + cldtypetemp(ip,2) = cldtypetemp(ip,2) + ( tmp(ip,z_base) + tmp(ip,z_top) )/2. + cldtypemeanz(ip,2) = cldtypemeanz(ip,2) + ( vgrid_z(z_base) + vgrid_z(z_top) )/2. + cldtypemeanzse(ip,2) = cldtypemeanzse(ip,2) + (( vgrid_z(z_base) + vgrid_z(z_top) )/2.) - surfelev(ip) + cldthinemis(ip) = cldthinemis(ip) + cloudemis + endif + + enddo + enddo + + ! 3D cloud types fraction (opaque=1 and thin=2 clouds) + where ( nsub(:,:) .gt. 0. ) + lidarcldtype(:,:,1) = lidarcldtype(:,:,1)/nsub(:,:) + lidarcldtype(:,:,2) = lidarcldtype(:,:,2)/nsub(:,:) + elsewhere + lidarcldtype(:,:,1) = undef + lidarcldtype(:,:,2) = undef + endwhere + ! 3D z_opaque fraction (=3) + where ( nsubopaq(:,:) .gt. 0. ) + lidarcldtype(:,:,3) = lidarcldtype(:,:,3)/nsubopaq(:,:) + elsewhere + lidarcldtype(:,:,3) = undef + lidarcldtype(:,:,4) = undef !declaring undef for opacity as well + endwhere + ! 3D opacity fraction (=4) !Summing z_opaque fraction from TOA(k=1) to SFC(k=Nlevels) + lidarcldtype(:,1,4) = lidarcldtype(:,1,3) !top layer equal to 3D z_opaque fraction + do ip = 1, Npoints + do k = 2, Nlevels + if ( (lidarcldtype(ip,k,3) .ne. undef) .and. (lidarcldtype(ip,k-1,4) .ne. undef) ) then + lidarcldtype(ip,k,4) = lidarcldtype(ip,k,3) + lidarcldtype(ip,k-1,4) + else + lidarcldtype(ip,k,4) = undef + endif + enddo + enddo + + ! Layered cloud types (opaque, thin and z_opaque 2D variables) + + do iz = 1, Ntype + do ic = 1, Ncolumns + cldtype(:,iz) = cldtype(:,iz) + cldlay(:,ic,iz) + nsublayer(:,iz) = nsublayer(:,iz) + nsublay(:,ic,iz) + enddo + enddo + + ! Mean temperature and altitude + where (cldtype(:,1) .gt. 0.) + cldtypetemp(:,1) = cldtypetemp(:,1)/cldtype(:,1) ! opaque cloud temp + cldtypetemp(:,3) = cldtypetemp(:,3)/cldtype(:,1) ! z_opaque + cldtypemeanz(:,1) = cldtypemeanz(:,1)/cldtype(:,1) ! opaque cloud alt + cldtypemeanzse(:,1) = cldtypemeanzse(:,1)/cldtype(:,1) ! opaque cloud alt - SE + cldtypemeanzse(:,3) = cldtypemeanzse(:,3)/cldtype(:,1) ! z_opaque - SE + elsewhere + cldtypetemp(:,1) = undef + cldtypetemp(:,3) = undef + cldtypemeanz(:,1) = undef + cldtypemeanzse(:,1) = undef + cldtypemeanzse(:,3) = undef + endwhere + + where (cldtype(:,2) .gt. 0.) ! thin cloud + cldtypetemp(:,2) = cldtypetemp(:,2)/cldtype(:,2) + cldtypemeanz(:,2) = cldtypemeanz(:,2)/cldtype(:,2) + cldtypemeanzse(:,2) = cldtypemeanzse(:,2)/cldtype(:,2) + elsewhere + cldtypetemp(:,2) = undef + cldtypemeanz(:,2) = undef + cldtypemeanzse(:,2) = undef + endwhere + + ! Mean thin cloud emissivity + where (count_emis(:) .gt. 0.) ! thin cloud + cldthinemis(:) = cldthinemis(:)/count_emis(:) + elsewhere + cldthinemis(:) = undef + endwhere + + where (nsublayer(:,:) .gt. 0.) + cldtype(:,:) = cldtype(:,:)/nsublayer(:,:) + elsewhere + cldtype(:,:) = undef + endwhere + + END SUBROUTINE COSP_OPAQ end module mod_lidar_simulator diff --git a/src/simulator/cosp_atlid_interface.F90 b/src/simulator/cosp_atlid_interface.F90 new file mode 100644 index 0000000000..c18bd54492 --- /dev/null +++ b/src/simulator/cosp_atlid_interface.F90 @@ -0,0 +1,66 @@ +! %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +! Copyright (c) 2015, Regents of the University of Colorado +! All rights reserved. +! +! Redistribution and use in source and binary forms, with or without modification, are +! permitted provided that the following conditions are met: +! +! 1. Redistributions of source code must retain the above copyright notice, this list of +! conditions and the following disclaimer. +! +! 2. Redistributions in binary form must reproduce the above copyright notice, this list +! of conditions and the following disclaimer in the documentation and/or other +! materials provided with the distribution. +! +! 3. Neither the name of the copyright holder nor the names of its contributors may be +! used to endorse or promote products derived from this software without specific prior +! written permission. +! +! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY +! EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +! MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL +! THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +! SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT +! OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +! INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +! LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +! OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +! +! History +! Apr 2018 - R. Guzman - Original version +! %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +MODULE MOD_COSP_ATLID_INTERFACE + USE COSP_KINDS, ONLY: wp + IMPLICIT NONE + + !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + ! TYPE atlid_in + !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + type atlid_IN + integer,pointer :: & + Npoints, & ! Number of gridpoints. + Ncolumns, & ! Number of columns. + Nlevels ! Number of levels. + + real(wp),dimension(:,:),pointer :: & + beta_mol_atlid, & ! Molecular backscatter coefficient + tau_mol_atlid ! Molecular optical depth + real(wp),dimension(:,:,:),pointer :: & + betatot_atlid, & ! + tautot_atlid ! Optical thickess integrated from top + real(wp),dimension(:,:,:,:),pointer :: & + taupart_atlid + end type atlid_IN + +CONTAINS + !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + ! SUBROUTINE cosp_atlid_init + !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + subroutine cosp_atlid_init() + + end subroutine cosp_atlid_init + + ! %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + ! END MODULE + ! %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +END MODULE MOD_COSP_ATLID_INTERFACE diff --git a/src/simulator/cosp_calipso_interface.F90 b/src/simulator/cosp_calipso_interface.F90 index e0d630d1d1..7e50fb1743 100644 --- a/src/simulator/cosp_calipso_interface.F90 +++ b/src/simulator/cosp_calipso_interface.F90 @@ -28,6 +28,7 @@ ! ! History ! May 2015 - D. Swales - Original version +! Jul 2017 - R. Guzman - Added Ground LIDar variables (GLID) ! %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% MODULE MOD_COSP_CALIPSO_INTERFACE USE COSP_KINDS, ONLY: wp diff --git a/src/simulator/cosp_grLidar532_interface.F90 b/src/simulator/cosp_grLidar532_interface.F90 new file mode 100644 index 0000000000..0bdd73f280 --- /dev/null +++ b/src/simulator/cosp_grLidar532_interface.F90 @@ -0,0 +1,62 @@ +! %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +! Copyright (c) 2015, Regents of the University of Colorado +! All rights reserved. +! +! Redistribution and use in source and binary forms, with or without modification, are +! permitted provided that the following conditions are met: +! +! 1. Redistributions of source code must retain the above copyright notice, this list of +! conditions and the following disclaimer. +! +! 2. Redistributions in binary form must reproduce the above copyright notice, this list +! of conditions and the following disclaimer in the documentation and/or other +! materials provided with the distribution. +! +! 3. Neither the name of the copyright holder nor the names of its contributors may be +! used to endorse or promote products derived from this software without specific prior +! written permission. +! +! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY +! EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +! MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL +! THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +! SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT +! OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +! INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +! LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +! OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +! +! History +! Apr 2018 - R. Guzman - Original version +! %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +MODULE MOD_COSP_GRLIDAR532_INTERFACE + USE COSP_KINDS, ONLY: wp + IMPLICIT NONE + + !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + ! TYPE grLidar532_in + !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + type grLidar532_IN + integer,pointer :: & + Npoints, & ! Number of gridpoints. + Ncolumns, & ! Number of columns. + Nlevels ! Number of levels. + real(wp),dimension(:,:),pointer :: & + beta_mol, & + tau_mol + real(wp),dimension(:,:,:),pointer :: & + betatot, & + tautot + end type grLidar532_IN +contains + !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + ! SUBROUTINE cosp_grLidar532_init + !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + subroutine cosp_grLidar532_init() + + end subroutine cosp_grLidar532_init + + ! %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + ! END MODULE + ! %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +END MODULE MOD_COSP_GRLIDAR532_INTERFACE diff --git a/subsample_and_optics_example/optics/cosp_optics.F90 b/subsample_and_optics_example/optics/cosp_optics.F90 index fb00cd3b6f..c5312e8e6b 100644 --- a/subsample_and_optics_example/optics/cosp_optics.F90 +++ b/subsample_and_optics_example/optics/cosp_optics.F90 @@ -28,6 +28,8 @@ ! ! History: ! 05/01/15 Dustin Swales - Original version +! 04/04/18 Rodrigo Guzman- Added CALIOP-like Ground LIDar routines (GLID) +! 10/04/18 Rodrigo Guzman- Added ATLID-like (EarthCare) lidar routines (ATLID) ! ! %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% module cosp_optics @@ -200,11 +202,11 @@ end subroutine modis_optics ! ###################################################################################### ! SUBROUTINE lidar_optics ! ###################################################################################### - subroutine lidar_optics(npoints,ncolumns,nlev,npart,ice_type,q_lsliq, q_lsice, & - q_cvliq, q_cvice,ls_radliq,ls_radice,cv_radliq,cv_radice, & - pres,presf,temp,beta_mol,betatot,tau_mol,tautot, & - tautot_S_liq,tautot_S_ice,betatot_ice,betatot_liq, & - tautot_ice,tautot_liq) + subroutine lidar_optics(npoints, ncolumns, nlev, npart, ice_type, lidar_freq, lground, & + q_lsliq, q_lsice, q_cvliq, q_cvice, ls_radliq, ls_radice, cv_radliq, cv_radice, & + pres, presf, temp, beta_mol, betatot, tau_mol, tautot, tautot_S_liq, tautot_S_ice,& + betatot_ice, betatot_liq, tautot_ice, tautot_liq) + ! #################################################################################### ! NOTE: Using "grav" from cosp_constants.f90, instead of grav=9.81, introduces ! changes of up to 2% in atb532 adn 0.003% in parasolRefl and lidarBetaMol532. @@ -217,7 +219,10 @@ subroutine lidar_optics(npoints,ncolumns,nlev,npart,ice_type,q_lsliq, q_lsice, ncolumns, & ! Number of subcolumns nlev, & ! Number of levels npart, & ! Number of cloud meteors (stratiform_liq, stratiform_ice, conv_liq, conv_ice). - ice_type ! Ice particle shape hypothesis (0 for spheres, 1 for non-spherical) + ice_type, & ! Ice particle shape hypothesis (0 for spheres, 1 for non-spherical) + lidar_freq ! Lidar frequency (nm). Use to change between lidar platforms + logical,intent(in) :: & + lground ! True for ground-based lidar REAL(WP),intent(in),dimension(npoints,nlev) :: & temp, & ! Temperature of layer k pres, & ! Pressure at full levels @@ -237,37 +242,41 @@ subroutine lidar_optics(npoints,ncolumns,nlev,npart,ice_type,q_lsliq, q_lsice, REAL(WP),intent(out),dimension(npoints,ncolumns,nlev) :: & betatot, & ! tautot ! Optical thickess integrated from top - REAL(WP),intent(out),dimension(npoints,ncolumns,nlev) :: & - betatot_ice, & ! Backscatter coefficient for ice particles - betatot_liq, & ! Backscatter coefficient for liquid particles - tautot_ice, & ! Total optical thickness of ice - tautot_liq ! Total optical thickness of liq REAL(WP),intent(out),dimension(npoints,nlev) :: & beta_mol, & ! Molecular backscatter coefficient tau_mol ! Molecular optical depth - REAL(WP),intent(out),dimension(npoints,ncolumns) :: & + ! OUTPUTS (optional) + REAL(WP),optional,intent(out),dimension(npoints,ncolumns) :: & tautot_S_liq, & ! TOA optical depth for liquid tautot_S_ice ! TOA optical depth for ice + REAL(WP),optional,intent(out),dimension(npoints,ncolumns,nlev) :: & + betatot_ice, & ! Backscatter coefficient for ice particles + betatot_liq, & ! Backscatter coefficient for liquid particles + tautot_ice, & ! Total optical thickness of ice + tautot_liq ! Total optical thickness of liq ! LOCAL VARIABLES - REAL(WP),dimension(npart) :: rhopart - REAL(WP),dimension(npart,5) :: polpart - REAL(WP),dimension(npoints,nlev) :: rhoair,alpha_mol - REAL(WP),dimension(npoints,nlev+1) :: zheight - REAL(WP),dimension(npoints,nlev,npart) :: rad_part,kp_part,qpart - REAL(WP),dimension(npoints,ncolumns,nlev,npart) :: alpha_part,tau_part - INTEGER :: i,k,icol + REAL(WP),dimension(npart) :: rhopart + REAL(WP),dimension(npart,5) :: polpart + REAL(WP),dimension(npoints,nlev) :: rhoair,alpha_mol + REAL(WP),dimension(npoints,nlev+1) :: zheight + REAL(WP),dimension(npoints,nlev,npart) :: rad_part,kp_part,qpart,alpha_part,tau_part + real(wp) :: Cmol,rdiffm + logical :: lparasol,lphaseoptics + INTEGER :: i,k,icol,zi,zf,zinc,zoffset ! Local data REAL(WP),PARAMETER :: rhoice = 0.5e+03 ! Density of ice (kg/m3) - REAL(WP),PARAMETER :: Cmol = 6.2446e-32 ! Wavelength dependent - REAL(WP),PARAMETER :: rdiffm = 0.7_wp ! Multiple scattering correction parameter + REAL(WP),PARAMETER :: Cmol_532nm = 6.2446e-32 ! Wavelength dependent + REAL(WP),PARAMETER :: Cmol_355nm = 3.2662e-31! Wavelength dependent + REAL(WP),PARAMETER :: rdiffm_532nm = 0.7_wp ! Multiple scattering correction parameter + REAL(WP),PARAMETER :: rdiffm_355nm = 0.6_wp ! Multiple scattering correction parameter REAL(WP),PARAMETER :: Qscat = 2.0_wp ! Particle scattering efficiency at 532 nm ! Local indicies for large-scale and convective ice and liquid - INTEGER,PARAMETER :: INDX_LSLIQ = 1 - INTEGER,PARAMETER :: INDX_LSICE = 2 - INTEGER,PARAMETER :: INDX_CVLIQ = 3 - INTEGER,PARAMETER :: INDX_CVICE = 4 + INTEGER,PARAMETER :: INDX_LSLIQ = 1 + INTEGER,PARAMETER :: INDX_LSICE = 2 + INTEGER,PARAMETER :: INDX_CVLIQ = 3 + INTEGER,PARAMETER :: INDX_CVICE = 4 ! Polarized optics parameterization ! Polynomial coefficients for spherical liq/ice particles derived from Mie theory. @@ -283,16 +292,48 @@ subroutine lidar_optics(npoints,ncolumns,nlev,npart,ice_type,q_lsliq, q_lsice, polpartCVICE1 = (/ 1.3615e-8_wp, -2.04206e-6_wp, 7.51799e-5_wp, 0.00078213_wp, 0.0182131_wp/), & polpartLSICE1 = (/ 1.3615e-8_wp, -2.04206e-6_wp, 7.51799e-5_wp, 0.00078213_wp, 0.0182131_wp/) ! ############################################################################## + + ! Which LIDAR frequency are we using? + if (lidar_freq .eq. 355) then + Cmol = Cmol_355nm + rdiffm = rdiffm_355nm + endif + if (lidar_freq .eq. 532) then + Cmol = Cmol_532nm + rdiffm = rdiffm_532nm + endif + + ! Do we need to generate optical inputs for Parasol simulator? + lparasol = .false. + if (present(tautot_S_liq) .and. present(tautot_S_ice)) lparasol = .true. + + ! Are optical-depths and backscatter coefficients for ice and liquid requested? + lphaseoptics=.false. + if (present(betatot_ice) .and. present(betatot_liq) .and. present(tautot_liq) .and. & + present(tautot_ice)) lphaseoptics=.true. + + ! Is this lidar spaceborne (default) or ground-based (lground=.true.)? + zi = 2 + zf = nlev + zinc = 1 + zoffset = -1 + if (lground) then + zi = nlev-1 + zf = 1 + zinc = -1 + zoffset = 1 + endif ! Liquid/ice particles - rhopart(INDX_LSLIQ) = rholiq - rhopart(INDX_LSICE) = rhoice - rhopart(INDX_CVLIQ) = rholiq - rhopart(INDX_CVICE) = rhoice + rhopart(INDX_LSLIQ) = rholiq + rhopart(INDX_LSICE) = rhoice + rhopart(INDX_CVLIQ) = rholiq + rhopart(INDX_CVICE) = rhoice ! LS and CONV Liquid water coefficients - polpart(INDX_LSLIQ,1:5) = polpartLSLIQ - polpart(INDX_CVLIQ,1:5) = polpartCVLIQ + polpart(INDX_LSLIQ,1:5) = polpartLSLIQ + polpart(INDX_CVLIQ,1:5) = polpartCVLIQ + ! LS and CONV Ice water coefficients if (ice_type .eq. 0) then polpart(INDX_LSICE,1:5) = polpartLSICE0 @@ -304,12 +345,12 @@ subroutine lidar_optics(npoints,ncolumns,nlev,npart,ice_type,q_lsliq, q_lsice, endif ! Effective radius particles: - rad_part(1:npoints,1:nlev,INDX_LSLIQ) = ls_radliq(1:npoints,1:nlev) - rad_part(1:npoints,1:nlev,INDX_LSICE) = ls_radice(1:npoints,1:nlev) - rad_part(1:npoints,1:nlev,INDX_CVLIQ) = cv_radliq(1:npoints,1:nlev) - rad_part(1:npoints,1:nlev,INDX_CVICE) = cv_radice(1:npoints,1:nlev) - rad_part(1:npoints,1:nlev,1:npart) = MAX(rad_part(1:npoints,1:nlev,1:npart),0._wp) - rad_part(1:npoints,1:nlev,1:npart) = MIN(rad_part(1:npoints,1:nlev,1:npart),70.0e-6_wp) + rad_part(1:npoints,1:nlev,INDX_LSLIQ) = ls_radliq(1:npoints,1:nlev) + rad_part(1:npoints,1:nlev,INDX_LSICE) = ls_radice(1:npoints,1:nlev) + rad_part(1:npoints,1:nlev,INDX_CVLIQ) = cv_radliq(1:npoints,1:nlev) + rad_part(1:npoints,1:nlev,INDX_CVICE) = cv_radice(1:npoints,1:nlev) + rad_part(1:npoints,1:nlev,1:npart) = MAX(rad_part(1:npoints,1:nlev,1:npart),0._wp) + rad_part(1:npoints,1:nlev,1:npart) = MIN(rad_part(1:npoints,1:nlev,1:npart),70.0e-6_wp) ! Density (clear-sky air) rhoair(1:npoints,1:nlev) = pres(1:npoints,1:nlev)/(rd*temp(1:npoints,1:nlev)) @@ -331,19 +372,21 @@ subroutine lidar_optics(npoints,ncolumns,nlev,npart,ice_type,q_lsliq, q_lsice, ! Optical thickness of each layer (molecular) tau_mol(1:npoints,1:nlev) = alpha_mol(1:npoints,1:nlev)*(zheight(1:npoints,1:nlev)-& zheight(1:npoints,2:nlev+1)) - + ! Optical thickness from TOA to layer k (molecular) - DO k = 2,nlev - tau_mol(1:npoints,k) = tau_mol(1:npoints,k) + tau_mol(1:npoints,k-1) - ENDDO - + DO k = zi,zf,zinc + tau_mol(1:npoints,k) = tau_mol(1:npoints,k) + tau_mol(1:npoints,k+zoffset) + ENDDO + betatot (1:npoints,1:ncolumns,1:nlev) = spread(beta_mol(1:npoints,1:nlev), dim=2, NCOPIES=ncolumns) tautot (1:npoints,1:ncolumns,1:nlev) = spread(tau_mol (1:npoints,1:nlev), dim=2, NCOPIES=ncolumns) - betatot_liq(1:npoints,1:ncolumns,1:nlev) = betatot(1:npoints,1:ncolumns,1:nlev) - betatot_ice(1:npoints,1:ncolumns,1:nlev) = betatot(1:npoints,1:ncolumns,1:nlev) - tautot_liq (1:npoints,1:ncolumns,1:nlev) = tautot(1:npoints,1:ncolumns,1:nlev) - tautot_ice (1:npoints,1:ncolumns,1:nlev) = tautot(1:npoints,1:ncolumns,1:nlev) - + if (lphaseoptics) then + betatot_liq(1:npoints,1:ncolumns,1:nlev) = betatot(1:npoints,1:ncolumns,1:nlev) + betatot_ice(1:npoints,1:ncolumns,1:nlev) = betatot(1:npoints,1:ncolumns,1:nlev) + tautot_liq (1:npoints,1:ncolumns,1:nlev) = tautot(1:npoints,1:ncolumns,1:nlev) + tautot_ice (1:npoints,1:ncolumns,1:nlev) = tautot(1:npoints,1:ncolumns,1:nlev) + endif + ! ############################################################################## ! *) Particles alpha, beta and optical thickness ! ############################################################################## @@ -359,84 +402,91 @@ subroutine lidar_optics(npoints,ncolumns,nlev,npart,ice_type,q_lsliq, q_lsice, elsewhere kp_part(1:npoints,1:nlev,i) = 0._wp endwhere - enddo - + enddo + + ! Initialize (if necessary) + if (lparasol) then + tautot_S_liq(1:npoints,1:ncolumns) = 0._wp + tautot_S_ice(1:npoints,1:ncolumns) = 0._wp + endif + ! Loop over all subcolumns do icol=1,ncolumns ! ############################################################################## ! Mixing ratio particles in each subcolum ! ############################################################################## - qpart(1:npoints,1:nlev,INDX_LSLIQ) = q_lsliq(1:npoints,icol,1:nlev) - qpart(1:npoints,1:nlev,INDX_LSICE) = q_lsice(1:npoints,icol,1:nlev) - qpart(1:npoints,1:nlev,INDX_CVLIQ) = q_cvliq(1:npoints,icol,1:nlev) - qpart(1:npoints,1:nlev,INDX_CVICE) = q_cvice(1:npoints,icol,1:nlev) - + qpart(1:npoints,1:nlev,INDX_LSLIQ) = q_lsliq(1:npoints,icol,1:nlev) + qpart(1:npoints,1:nlev,INDX_LSICE) = q_lsice(1:npoints,icol,1:nlev) + qpart(1:npoints,1:nlev,INDX_CVLIQ) = q_cvliq(1:npoints,icol,1:nlev) + qpart(1:npoints,1:nlev,INDX_CVICE) = q_cvice(1:npoints,icol,1:nlev) + ! ############################################################################## ! Alpha and optical thickness (particles) ! ############################################################################## ! Alpha of particles in each subcolumn: do i = 1, npart where (rad_part(1:npoints,1:nlev,i) .gt. 0.0) - alpha_part(1:npoints,icol,1:nlev,i) = 3._wp/4._wp * Qscat & + alpha_part(1:npoints,1:nlev,i) = 3._wp/4._wp * Qscat & * rhoair(1:npoints,1:nlev) * qpart(1:npoints,1:nlev,i) & / (rhopart(i) * rad_part(1:npoints,1:nlev,i) ) elsewhere - alpha_part(1:npoints,icol,1:nlev,i) = 0._wp + alpha_part(1:npoints,1:nlev,i) = 0._wp endwhere enddo ! Optical thicknes - tau_part(1:npoints,icol,1:nlev,1:npart) = rdiffm * alpha_part(1:npoints,icol,1:nlev,1:npart) + tau_part(1:npoints,1:nlev,1:npart) = rdiffm * alpha_part(1:npoints,1:nlev,1:npart) do i = 1, npart ! Optical thickness of each layer (particles) - tau_part(1:npoints,icol,1:nlev,i) = tau_part(1:npoints,icol,1:nlev,i) & + tau_part(1:npoints,1:nlev,i) = tau_part(1:npoints,1:nlev,i) & & * (zheight(1:npoints,1:nlev)-zheight(1:npoints,2:nlev+1) ) ! Optical thickness from TOA to layer k (particles) - do k=2,nlev - tau_part(1:npoints,icol,k,i) = tau_part(1:npoints,icol,k,i) + tau_part(1:npoints,icol,k-1,i) + do k=zi,zf,zinc + tau_part(1:npoints,k,i) = tau_part(1:npoints,k,i) + tau_part(1:npoints,k+zoffset,i) enddo enddo - + ! ############################################################################## ! Beta and optical thickness (total=molecular + particules) ! ############################################################################## DO i = 1, npart betatot(1:npoints,icol,1:nlev) = betatot(1:npoints,icol,1:nlev) + & - kp_part(1:npoints,1:nlev,i)*alpha_part(1:npoints,icol,1:nlev,i) + kp_part(1:npoints,1:nlev,i)*alpha_part(1:npoints,1:nlev,i) tautot(1:npoints,icol,1:nlev) = tautot(1:npoints,icol,1:nlev) + & - tau_part(1:npoints,icol,1:nlev,i) + tau_part(1:npoints,1:nlev,i) ENDDO ! ############################################################################## ! Beta and optical thickness (liquid/ice) ! ############################################################################## - ! Ice - betatot_ice(1:npoints,icol,1:nlev) = betatot_ice(1:npoints,icol,1:nlev)+ & - kp_part(1:npoints,1:nlev,INDX_LSICE)*alpha_part(1:npoints,icol,1:nlev,INDX_LSICE)+ & - kp_part(1:npoints,1:nlev,INDX_CVICE)*alpha_part(1:npoints,icol,1:nlev,INDX_CVICE) - tautot_ice(1:npoints,icol,1:nlev) = tautot_ice(1:npoints,icol,1:nlev) + & - tau_part(1:npoints,icol,1:nlev,INDX_LSICE) + & - tau_part(1:npoints,icol,1:nlev,INDX_CVICE) - - ! Liquid - betatot_liq(1:npoints,icol,1:nlev) = betatot_liq(1:npoints,icol,1:nlev)+ & - kp_part(1:npoints,1:nlev,INDX_LSLIQ)*alpha_part(1:npoints,icol,1:nlev,INDX_LSLIQ)+ & - kp_part(1:npoints,1:nlev,INDX_CVLIQ)*alpha_part(1:npoints,icol,1:nlev,INDX_CVLIQ) - tautot_liq(1:npoints,icol,1:nlev) = tautot_liq(1:npoints,icol,1:nlev) + & - tau_part(1:npoints,icol,1:nlev,INDX_LSLIQ) + & - tau_part(1:npoints,icol,1:nlev,INDX_CVLIQ) - enddo - - ! ############################################################################## - ! Optical depths used by the PARASOL simulator - ! ############################################################################## - tautot_S_liq(1:npoints,1:ncolumns) = 0._wp - tautot_S_ice(1:npoints,1:ncolumns) = 0._wp - do icol=1,ncolumns - tautot_S_liq(1:npoints,icol) = tautot_S_liq(1:npoints,icol)+tau_part(1:npoints,icol,nlev,1)+tau_part(1:npoints,icol,nlev,3) - tautot_S_ice(1:npoints,icol) = tautot_S_ice(1:npoints,icol)+tau_part(1:npoints,icol,nlev,2)+tau_part(1:npoints,icol,nlev,4) + if (lphaseoptics) then + ! Ice + betatot_ice(1:npoints,icol,1:nlev) = betatot_ice(1:npoints,icol,1:nlev)+ & + kp_part(1:npoints,1:nlev,INDX_LSICE)*alpha_part(1:npoints,1:nlev,INDX_LSICE)+ & + kp_part(1:npoints,1:nlev,INDX_CVICE)*alpha_part(1:npoints,1:nlev,INDX_CVICE) + tautot_ice(1:npoints,icol,1:nlev) = tautot_ice(1:npoints,icol,1:nlev) + & + tau_part(1:npoints,1:nlev,INDX_LSICE) + & + tau_part(1:npoints,1:nlev,INDX_CVICE) + + ! Liquid + betatot_liq(1:npoints,icol,1:nlev) = betatot_liq(1:npoints,icol,1:nlev)+ & + kp_part(1:npoints,1:nlev,INDX_LSLIQ)*alpha_part(1:npoints,1:nlev,INDX_LSLIQ)+ & + kp_part(1:npoints,1:nlev,INDX_CVLIQ)*alpha_part(1:npoints,1:nlev,INDX_CVLIQ) + tautot_liq(1:npoints,icol,1:nlev) = tautot_liq(1:npoints,icol,1:nlev) + & + tau_part(1:npoints,1:nlev,INDX_LSLIQ) + & + tau_part(1:npoints,1:nlev,INDX_CVLIQ) + endif + + ! ############################################################################## + ! Optical depths used by the PARASOL simulator + ! ############################################################################## + if (lparasol) then + tautot_S_liq(:,icol) = tau_part(:,nlev,1)+tau_part(:,nlev,3) + tautot_S_ice(:,icol) = tau_part(:,nlev,2)+tau_part(:,nlev,4) + endif enddo end subroutine lidar_optics + end module cosp_optics