[3358] | 1 | ! %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
---|
| 2 | ! Copyright (c) 2015, Regents of the University of Colorado |
---|
| 3 | ! All rights reserved. |
---|
| 4 | ! |
---|
| 5 | ! Redistribution and use in source and binary forms, with or without modification, are |
---|
| 6 | ! permitted provided that the following conditions are met: |
---|
| 7 | ! |
---|
| 8 | ! 1. Redistributions of source code must retain the above copyright notice, this list of |
---|
| 9 | ! conditions and the following disclaimer. |
---|
| 10 | ! |
---|
| 11 | ! 2. Redistributions in binary form must reproduce the above copyright notice, this list |
---|
| 12 | ! of conditions and the following disclaimer in the documentation and/or other |
---|
| 13 | ! materials provided with the distribution. |
---|
| 14 | ! |
---|
| 15 | ! 3. Neither the name of the copyright holder nor the names of its contributors may be |
---|
| 16 | ! used to endorse or promote products derived from this software without specific prior |
---|
| 17 | ! written permission. |
---|
| 18 | ! |
---|
| 19 | ! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY |
---|
| 20 | ! EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF |
---|
| 21 | ! MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL |
---|
| 22 | ! THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
---|
| 23 | ! SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT |
---|
| 24 | ! OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
---|
| 25 | ! INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT |
---|
| 26 | ! LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
---|
| 27 | ! OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
---|
| 28 | ! |
---|
| 29 | ! History: |
---|
| 30 | ! May 2015- D. Swales - Original version |
---|
| 31 | ! |
---|
| 32 | ! %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
---|
| 33 | |
---|
| 34 | |
---|
| 35 | MODULE MOD_COSP |
---|
| 36 | USE COSP_KINDS, ONLY: wp |
---|
| 37 | USE MOD_COSP_CONFIG, ONLY: R_UNDEF,PARASOL_NREFL,LIDAR_NCAT,SR_BINS, & |
---|
| 38 | N_HYDRO,RTTOV_MAX_CHANNELS,numMISRHgtBins, & |
---|
| 39 | DBZE_BINS,LIDAR_NTEMP,calipso_histBsct, & |
---|
| 40 | use_vgrid,Nlvgrid,vgrid_zu,vgrid_zl,vgrid_z, & |
---|
| 41 | numMODISTauBins,numMODISPresBins, & |
---|
| 42 | numMODISReffIceBins,numMODISReffLiqBins, & |
---|
| 43 | numISCCPTauBins,numISCCPPresBins,numMISRTauBins,& |
---|
| 44 | ntau,modis_histTau,tau_binBounds, & |
---|
| 45 | modis_histTauEdges,tau_binEdges, & |
---|
| 46 | modis_histTauCenters,tau_binCenters |
---|
| 47 | USE MOD_COSP_MODIS_INTERFACE, ONLY: cosp_modis_init, modis_IN |
---|
| 48 | ! USE MOD_COSP_RTTOV_INTERFACE, ONLY: cosp_rttov_init, rttov_IN |
---|
| 49 | USE MOD_COSP_MISR_INTERFACE, ONLY: cosp_misr_init, misr_IN |
---|
| 50 | USE MOD_COSP_ISCCP_INTERFACE, ONLY: cosp_isccp_init, isccp_IN |
---|
| 51 | USE MOD_COSP_CALIPSO_INTERFACE, ONLY: cosp_calipso_init, calipso_IN |
---|
| 52 | USE MOD_COSP_PARASOL_INTERFACE, ONLY: cosp_parasol_init, parasol_in |
---|
| 53 | USE MOD_COSP_CLOUDSAT_INTERFACE, ONLY: cosp_cloudsat_init, cloudsat_IN |
---|
| 54 | USE quickbeam, ONLY: quickbeam_subcolumn, quickbeam_column, radar_cfg |
---|
| 55 | USE MOD_ICARUS, ONLY: icarus_subcolumn, icarus_column |
---|
| 56 | USE MOD_MISR_SIMULATOR, ONLY: misr_subcolumn, misr_column |
---|
| 57 | USE MOD_LIDAR_SIMULATOR, ONLY: lidar_subcolumn, lidar_column |
---|
| 58 | USE MOD_MODIS_SIM, ONLY: modis_subcolumn, modis_column |
---|
| 59 | USE MOD_PARASOL, ONLY: parasol_subcolumn, parasol_column |
---|
| 60 | ! use mod_cosp_rttov, ONLY: rttov_column |
---|
| 61 | USE MOD_COSP_STATS, ONLY: COSP_LIDAR_ONLY_CLOUD,COSP_CHANGE_VERTICAL_GRID |
---|
| 62 | |
---|
| 63 | IMPLICIT NONE |
---|
| 64 | |
---|
| 65 | logical :: linitialization ! Initialization flag |
---|
| 66 | |
---|
| 67 | ! ###################################################################################### |
---|
| 68 | ! TYPE cosp_column_inputs |
---|
| 69 | ! ###################################################################################### |
---|
| 70 | type cosp_column_inputs |
---|
| 71 | integer :: & |
---|
| 72 | Npoints, & ! Number of gridpoints. |
---|
| 73 | Ncolumns, & ! Number of columns. |
---|
| 74 | Nlevels ! Number of levels. |
---|
| 75 | |
---|
| 76 | integer,allocatable,dimension(:) :: & |
---|
| 77 | sunlit ! Sunlit flag (0-1) |
---|
| 78 | |
---|
| 79 | real(wp),allocatable,dimension(:,:) :: & |
---|
| 80 | at, & ! Temperature (K) |
---|
| 81 | pfull, & ! Pressure (Pa) |
---|
| 82 | phalf, & ! Pressure at half-levels (Pa) |
---|
| 83 | qv, & ! Specific humidity (kg/kg) |
---|
| 84 | hgt_matrix, & ! Height of hydrometeors (km) |
---|
| 85 | hgt_matrix_half ! Height of hydrometeors at half levels (km) |
---|
| 86 | |
---|
| 87 | real(wp),allocatable,dimension(:) :: & |
---|
| 88 | land, & ! Land/Sea mask (0-1) |
---|
| 89 | skt ! Surface temperature (K) |
---|
| 90 | ! Fields used ONLY by RTTOV |
---|
| 91 | integer :: & |
---|
| 92 | month ! Month for surface emissivty atlas (1-12) |
---|
| 93 | real(wp) :: & |
---|
| 94 | zenang, & ! Satellite zenith angle for RTTOV (deg) |
---|
| 95 | co2, & ! CO2 (kg/kg) |
---|
| 96 | ch4, & ! Methane (kg/kg) |
---|
| 97 | n2o, & ! N2O (kg/kg) |
---|
| 98 | co ! CO (kg/kg) |
---|
| 99 | real(wp),allocatable,dimension(:) :: & |
---|
| 100 | emis_sfc, & ! Surface emissivity (1) |
---|
| 101 | u_sfc, & ! Surface u-wind (m/s) |
---|
| 102 | v_sfc, & ! Surface v-wind (m/s) |
---|
| 103 | seaice, & ! Sea-ice fraction (0-1) |
---|
| 104 | lat, & ! Latitude (deg) |
---|
| 105 | lon ! Longitude (deg) |
---|
| 106 | real(wp),allocatable,dimension(:,:) :: & |
---|
| 107 | o3, & ! Ozone (kg/kg) |
---|
| 108 | tca, & ! Total column cloud fraction (0-1) |
---|
| 109 | cloudIce, & ! Cloud ice water mixing ratio (kg/kg) |
---|
| 110 | cloudLiq, & ! Cloud liquid water mixing ratio (kg/kg) |
---|
| 111 | fl_rain, & ! Precipitation (rain) flux (kg/m2/s) |
---|
| 112 | fl_snow ! Precipitation (snow) flux (kg/m2/s) |
---|
| 113 | end type cosp_column_inputs |
---|
| 114 | |
---|
| 115 | ! ###################################################################################### |
---|
| 116 | ! TYPE cosp_optical_inputs |
---|
| 117 | ! ###################################################################################### |
---|
| 118 | type cosp_optical_inputs |
---|
| 119 | integer :: & |
---|
| 120 | Npoints, & ! Number of gridpoints. |
---|
| 121 | Ncolumns, & ! Number of columns. |
---|
| 122 | Nlevels, & ! Number of levels. |
---|
| 123 | Npart, & ! Number of cloud meteors for LIDAR simulator. |
---|
| 124 | Nrefl ! Number of reflectances for PARASOL simulator |
---|
| 125 | real(wp) :: & |
---|
| 126 | emsfc_lw ! 11 micron surface emissivity |
---|
| 127 | real(wp),allocatable,dimension(:,:,:) :: & |
---|
| 128 | frac_out, & ! Cloud fraction |
---|
| 129 | tau_067, & ! Optical depth |
---|
| 130 | fracLiq, & ! Cloud fraction |
---|
| 131 | emiss_11, & ! Emissivity |
---|
| 132 | asym, & ! Assymetry parameter |
---|
| 133 | ss_alb, & ! Single-scattering albedo |
---|
| 134 | betatot, & ! Backscatter coefficient for polarized optics (total) |
---|
| 135 | betatot_ice, & ! Backscatter coefficient for polarized optics (ice) |
---|
| 136 | betatot_liq, & ! Backscatter coefficient for polarized optics (liquid) |
---|
| 137 | tautot, & ! Optical thickess integrated from top (total) |
---|
| 138 | tautot_ice, & ! Optical thickess integrated from top (ice) |
---|
| 139 | tautot_liq, & ! Optical thickess integrated from top (liquid) |
---|
| 140 | z_vol_cloudsat, & ! Effective reflectivity factor (mm^6/m^3) |
---|
| 141 | kr_vol_cloudsat, & ! Attenuation coefficient hydro (dB/km) |
---|
| 142 | g_vol_cloudsat ! Attenuation coefficient gases (dB/km) |
---|
| 143 | real(wp),allocatable,dimension(:,:) :: & |
---|
| 144 | beta_mol, & ! Molecular backscatter coefficient |
---|
| 145 | tau_mol, & ! Molecular optical depth |
---|
| 146 | tautot_S_liq, & ! Liquid water optical thickness, from TOA to SFC |
---|
| 147 | tautot_S_ice ! Ice water optical thickness, from TOA to SFC |
---|
| 148 | type(radar_cfg) :: & |
---|
| 149 | rcfg_cloudsat ! Radar comfiguration information (CLOUDSAT) |
---|
| 150 | end type cosp_optical_inputs |
---|
| 151 | |
---|
| 152 | ! ###################################################################################### |
---|
| 153 | ! TYPE cosp_outputs |
---|
| 154 | ! ###################################################################################### |
---|
| 155 | type cosp_outputs |
---|
| 156 | |
---|
| 157 | ! CALIPSO outputs |
---|
| 158 | real(wp),dimension(:,:,:),pointer :: & |
---|
| 159 | calipso_betaperp_tot => null(), & ! Total backscattered signal |
---|
| 160 | calipso_beta_tot => null(), & ! Total backscattered signal |
---|
| 161 | calipso_tau_tot => null(), & ! Optical thickness integrated from top to level z |
---|
| 162 | calipso_lidarcldphase => null(), & ! 3D "lidar" phase cloud fraction |
---|
| 163 | calipso_cldlayerphase => null(), & ! low, mid, high-level lidar phase cloud cover |
---|
| 164 | calipso_lidarcldtmp => null(), & ! 3D "lidar" phase cloud temperature |
---|
| 165 | calipso_cfad_sr => null() ! CFAD of scattering ratio |
---|
| 166 | real(wp), dimension(:,:),pointer :: & |
---|
| 167 | calipso_lidarcld => null(), & ! 3D "lidar" cloud fraction |
---|
| 168 | calipso_cldlayer => null(), & ! low, mid, high-level, total lidar cloud cover |
---|
| 169 | calipso_beta_mol => null(), & ! Molecular backscatter |
---|
| 170 | calipso_temp_tot => null() |
---|
| 171 | real(wp), dimension(:),pointer :: & |
---|
| 172 | calipso_srbval => null() ! SR bins in cfad_sr |
---|
| 173 | |
---|
| 174 | ! PARASOL outputs |
---|
| 175 | real(wp),dimension(:,:,:),pointer :: & |
---|
| 176 | parasolPix_refl => null() ! PARASOL reflectances (subcolumn) |
---|
| 177 | real(wp),dimension(:,:),pointer :: & |
---|
| 178 | parasolGrid_refl => null() ! PARASOOL reflectances (column) |
---|
| 179 | |
---|
| 180 | ! CLOUDSAT outputs |
---|
| 181 | real(wp),dimension(:,:,:),pointer :: & |
---|
| 182 | cloudsat_Ze_tot => null(), & ! Effective reflectivity factor (Npoints,Ncolumns,Nlevels) |
---|
| 183 | cloudsat_cfad_ze => null() ! Ze CFAD(Npoints,dBZe_bins,Nlevels) |
---|
| 184 | real(wp), dimension(:,:),pointer :: & |
---|
| 185 | lidar_only_freq_cloud => null() ! (Npoints,Nlevels) |
---|
| 186 | real(wp),dimension(:),pointer :: & |
---|
| 187 | radar_lidar_tcc => null() ! Radar&lidar total cloud amount, grid-box scale (Npoints) |
---|
| 188 | |
---|
| 189 | ! ISCCP outputs |
---|
| 190 | real(wp),dimension(:),pointer :: & |
---|
| 191 | isccp_totalcldarea => null(), & ! The fraction of model grid box columns with cloud |
---|
| 192 | ! somewhere in them. (%) |
---|
| 193 | isccp_meantb => null(), & ! Mean all-sky 10.5 micron brightness temperature. (K) |
---|
| 194 | isccp_meantbclr => null(), & ! Mean clear-sky 10.5 micron brightness temperature. (K) |
---|
| 195 | isccp_meanptop => null(), & ! Mean cloud top pressure (mb). |
---|
| 196 | isccp_meantaucld => null(), & ! Mean optical thickness. (1) |
---|
| 197 | isccp_meanalbedocld => null() ! Mean cloud albedo. (1) |
---|
| 198 | real(wp),dimension(:,:),pointer ::& |
---|
| 199 | isccp_boxtau => null(), & ! Optical thickness in each column. (1) |
---|
| 200 | isccp_boxptop => null() ! Cloud top pressure in each column. (mb) |
---|
| 201 | real(wp),dimension(:,:,:),pointer :: & |
---|
| 202 | isccp_fq => null() ! The fraction of the model grid box covered by each of |
---|
| 203 | ! the 49 ISCCP D level cloud types. (%) |
---|
| 204 | |
---|
| 205 | ! MISR outptus |
---|
| 206 | real(wp),dimension(:,:,:),pointer :: & ! |
---|
| 207 | misr_fq => null() ! Fraction of the model grid box covered by each of the MISR |
---|
| 208 | ! cloud types |
---|
| 209 | real(wp),dimension(:,:),pointer :: & ! |
---|
| 210 | misr_dist_model_layertops => null() ! |
---|
| 211 | real(wp),dimension(:),pointer :: & ! |
---|
| 212 | misr_meanztop => null(), & ! Mean MISR cloud top height |
---|
| 213 | misr_cldarea => null() ! Mean MISR cloud cover area |
---|
| 214 | |
---|
| 215 | ! MODIS outptus |
---|
| 216 | real(wp),pointer,dimension(:) :: & ! |
---|
| 217 | modis_Cloud_Fraction_Total_Mean => null(), & ! L3 MODIS retrieved cloud fraction (total) |
---|
| 218 | modis_Cloud_Fraction_Water_Mean => null(), & ! L3 MODIS retrieved cloud fraction (liq) |
---|
| 219 | modis_Cloud_Fraction_Ice_Mean => null(), & ! L3 MODIS retrieved cloud fraction (ice) |
---|
| 220 | modis_Cloud_Fraction_High_Mean => null(), & ! L3 MODIS retrieved cloud fraction (high) |
---|
| 221 | modis_Cloud_Fraction_Mid_Mean => null(), & ! L3 MODIS retrieved cloud fraction (middle) |
---|
| 222 | modis_Cloud_Fraction_Low_Mean => null(), & ! L3 MODIS retrieved cloud fraction (low ) |
---|
| 223 | modis_Optical_Thickness_Total_Mean => null(), & ! L3 MODIS retrieved optical thickness (tot) |
---|
| 224 | modis_Optical_Thickness_Water_Mean => null(), & ! L3 MODIS retrieved optical thickness (liq) |
---|
| 225 | modis_Optical_Thickness_Ice_Mean => null(), & ! L3 MODIS retrieved optical thickness (ice) |
---|
| 226 | modis_Optical_Thickness_Total_LogMean => null(), & ! L3 MODIS retrieved log10 optical thickness |
---|
| 227 | modis_Optical_Thickness_Water_LogMean => null(), & ! L3 MODIS retrieved log10 optical thickness |
---|
| 228 | modis_Optical_Thickness_Ice_LogMean => null(), & ! L3 MODIS retrieved log10 optical thickness |
---|
| 229 | modis_Cloud_Particle_Size_Water_Mean => null(), & ! L3 MODIS retrieved particle size (liquid) |
---|
| 230 | modis_Cloud_Particle_Size_Ice_Mean => null(), & ! L3 MODIS retrieved particle size (ice) |
---|
| 231 | modis_Cloud_Top_Pressure_Total_Mean => null(), & ! L3 MODIS retrieved cloud top pressure |
---|
| 232 | modis_Liquid_Water_Path_Mean => null(), & ! L3 MODIS retrieved liquid water path |
---|
| 233 | modis_Ice_Water_Path_Mean => null() ! L3 MODIS retrieved ice water path |
---|
| 234 | real(wp),pointer,dimension(:,:,:) :: & |
---|
| 235 | modis_Optical_Thickness_vs_Cloud_Top_Pressure => null(), & ! Tau/Pressure joint histogram |
---|
| 236 | modis_Optical_Thickness_vs_ReffICE => null(), & ! Tau/ReffICE joint histogram |
---|
| 237 | modis_Optical_Thickness_vs_ReffLIQ => null() ! Tau/ReffLIQ joint histogram |
---|
| 238 | |
---|
| 239 | ! RTTOV outputs |
---|
| 240 | real(wp),pointer :: & |
---|
| 241 | rttov_tbs(:,:) => null() ! Brightness Temperature |
---|
| 242 | |
---|
| 243 | end type cosp_outputs |
---|
| 244 | |
---|
| 245 | CONTAINS |
---|
| 246 | ! ###################################################################################### |
---|
| 247 | ! FUNCTION cosp_simulator |
---|
| 248 | ! ###################################################################################### |
---|
| 249 | function COSP_SIMULATOR(cospIN,cospgridIN,cospOUT,start_idx,stop_idx,debug) |
---|
| 250 | type(cosp_optical_inputs),intent(in),target :: cospIN ! Optical inputs to COSP simulator |
---|
| 251 | type(cosp_column_inputs), intent(in),target :: cospgridIN ! Host model inputs to COSP |
---|
| 252 | |
---|
| 253 | ! Inputs into the simulators |
---|
| 254 | type(isccp_IN) :: isccpIN ! Input to the ISCCP simulator |
---|
| 255 | type(misr_IN) :: misrIN ! Input to the LIDAR simulator |
---|
| 256 | type(calipso_IN) :: calipsoIN ! Input to the LIDAR simulator |
---|
| 257 | type(parasol_IN) :: parasolIN ! Input to the PARASOL simulator |
---|
| 258 | type(cloudsat_IN) :: cloudsatIN ! Input to the CLOUDSAT radar simulator |
---|
| 259 | type(modis_IN) :: modisIN ! Input to the MODIS simulator |
---|
| 260 | ! type(rttov_IN) :: rttovIN ! Input to the RTTOV simulator |
---|
| 261 | integer,optional :: start_idx,stop_idx |
---|
| 262 | logical,optional :: debug |
---|
| 263 | |
---|
| 264 | ! Outputs from the simulators (nested simulator output structure) |
---|
| 265 | type(cosp_outputs), intent(inout) :: cospOUT |
---|
| 266 | character(len=256),dimension(100) :: cosp_simulator |
---|
| 267 | |
---|
| 268 | ! Local variables |
---|
| 269 | integer :: & |
---|
| 270 | i,icol,ij,ik,nError |
---|
| 271 | integer,target :: & |
---|
| 272 | Npoints |
---|
| 273 | logical :: & |
---|
| 274 | Lisccp_subcolumn, & ! On/Off switch for subcolumn ISCCP simulator |
---|
| 275 | Lmisr_subcolumn, & ! On/Off switch for subcolumn MISR simulator |
---|
| 276 | Lcalipso_subcolumn, & ! On/Off switch for subcolumn CALIPSO simulator |
---|
| 277 | Lparasol_subcolumn, & ! On/Off switch for subcolumn PARASOL simulator |
---|
| 278 | Lcloudsat_subcolumn, & ! On/Off switch for subcolumn CLOUDSAT simulator |
---|
| 279 | Lmodis_subcolumn, & ! On/Off switch for subcolumn MODIS simulator |
---|
| 280 | Lrttov_subcolumn, & ! On/Off switch for subcolumn RTTOV simulator |
---|
| 281 | Lisccp_column, & ! On/Off switch for column ISCCP simulator |
---|
| 282 | Lmisr_column, & ! On/Off switch for column MISR simulator |
---|
| 283 | Lcalipso_column, & ! On/Off switch for column CALIPSO simulator |
---|
| 284 | Lparasol_column, & ! On/Off switch for column PARASOL simulator |
---|
| 285 | Lcloudsat_column, & ! On/Off switch for column CLOUDSAT simulator |
---|
| 286 | Lmodis_column, & ! On/Off switch for column MODIS simulator |
---|
| 287 | Lrttov_column, & ! On/Off switch for column RTTOV simulator (not used) |
---|
| 288 | Lradar_lidar_tcc, & ! On/Off switch from joint Calipso/Cloudsat product |
---|
| 289 | Llidar_only_freq_cloud ! On/Off switch from joint Calipso/Cloudsat product |
---|
| 290 | logical :: & |
---|
| 291 | ok_lidar_cfad = .false., & |
---|
| 292 | lrttov_cleanUp = .false. |
---|
| 293 | |
---|
| 294 | integer, dimension(:,:),allocatable :: & |
---|
| 295 | modisRetrievedPhase,isccpLEVMATCH |
---|
| 296 | real(wp), dimension(:), allocatable :: & |
---|
| 297 | modisCfTotal,modisCfLiquid,modisMeanIceWaterPath, isccp_meantbclr, & |
---|
| 298 | modisCfIce, modisCfHigh, modisCfMid, modisCfLow,modisMeanTauTotal, & |
---|
| 299 | modisMeanTauLiquid, modisMeanTauIce, modisMeanLogTauTotal, & |
---|
| 300 | modisMeanLogTauLiquid, modisMeanLogTauIce, modisMeanSizeLiquid, & |
---|
| 301 | modisMeanSizeIce, modisMeanCloudTopPressure, modisMeanLiquidWaterPath, & |
---|
| 302 | radar_lidar_tcc |
---|
| 303 | REAL(WP), dimension(:,:),allocatable :: & |
---|
| 304 | modisRetrievedCloudTopPressure,modisRetrievedTau,modisRetrievedSize, & |
---|
| 305 | misr_boxtau,misr_boxztop,misr_dist_model_layertops,isccp_boxtau, & |
---|
| 306 | isccp_boxttop,isccp_boxptop,calipso_beta_mol,lidar_only_freq_cloud |
---|
| 307 | REAL(WP), dimension(:,:,:),allocatable :: & |
---|
| 308 | modisJointHistogram,modisJointHistogramIce,modisJointHistogramLiq, & |
---|
| 309 | calipso_beta_tot,calipso_betaperp_tot, cloudsatDBZe,parasolPix_refl |
---|
| 310 | real(wp),dimension(:),allocatable,target :: & |
---|
| 311 | out1D_1,out1D_2,out1D_3,out1D_4,out1D_5,out1D_6 |
---|
| 312 | real(wp),dimension(:,:,:),allocatable :: & |
---|
| 313 | betamol_in,betamolFlip,pnormFlip,ze_totFlip |
---|
| 314 | |
---|
| 315 | ! Initialize error reporting for output |
---|
| 316 | cosp_simulator(:)='' |
---|
| 317 | |
---|
| 318 | !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
---|
| 319 | ! 1) Determine if using full inputs or subset |
---|
| 320 | !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
---|
| 321 | if (present(start_idx) .and. present(stop_idx)) then |
---|
| 322 | ij=start_idx |
---|
| 323 | ik=stop_idx |
---|
| 324 | else |
---|
| 325 | ij=1 |
---|
| 326 | ik=cospIN%Npoints |
---|
| 327 | endif |
---|
| 328 | Npoints = ik-ij+1 |
---|
| 329 | |
---|
| 330 | !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
---|
| 331 | ! 2a) Determine which simulators to run and which statistics to compute |
---|
| 332 | ! - If any of the subcolumn fields are allocated, then run the subcolumn simulators. |
---|
| 333 | ! - If any of the column fields are allocated, then compute the statistics for that |
---|
| 334 | ! simulator, but only save the requested fields. |
---|
| 335 | !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
---|
| 336 | ! Start with all simulators and joint-diagnostics off |
---|
| 337 | Lisccp_subcolumn = .false. |
---|
| 338 | Lmisr_subcolumn = .false. |
---|
| 339 | Lcalipso_subcolumn = .false. |
---|
| 340 | Lparasol_subcolumn = .false. |
---|
| 341 | Lcloudsat_subcolumn = .false. |
---|
| 342 | Lmodis_subcolumn = .false. |
---|
| 343 | Lrttov_subcolumn = .false. |
---|
| 344 | Lisccp_column = .false. |
---|
| 345 | Lmisr_column = .false. |
---|
| 346 | Lcalipso_column = .false. |
---|
| 347 | Lparasol_column = .false. |
---|
| 348 | Lcloudsat_column = .false. |
---|
| 349 | Lmodis_column = .false. |
---|
| 350 | Lrttov_column = .false. |
---|
| 351 | Lradar_lidar_tcc = .false. |
---|
| 352 | Llidar_only_freq_cloud = .false. |
---|
| 353 | |
---|
| 354 | ! CLOUDSAT subcolumn |
---|
| 355 | if (associated(cospOUT%cloudsat_Ze_tot)) Lcloudsat_subcolumn = .true. |
---|
| 356 | |
---|
| 357 | ! MODIS subcolumn |
---|
| 358 | if (associated(cospOUT%modis_Cloud_Fraction_Water_Mean) .or. & |
---|
| 359 | associated(cospOUT%modis_Cloud_Fraction_Total_Mean) .or. & |
---|
| 360 | associated(cospOUT%modis_Cloud_Fraction_Ice_Mean) .or. & |
---|
| 361 | associated(cospOUT%modis_Cloud_Fraction_High_Mean) .or. & |
---|
| 362 | associated(cospOUT%modis_Cloud_Fraction_Mid_Mean) .or. & |
---|
| 363 | associated(cospOUT%modis_Cloud_Fraction_Low_Mean) .or. & |
---|
| 364 | associated(cospOUT%modis_Optical_Thickness_Total_Mean) .or. & |
---|
| 365 | associated(cospOUT%modis_Optical_Thickness_Water_Mean) .or. & |
---|
| 366 | associated(cospOUT%modis_Optical_Thickness_Ice_Mean) .or. & |
---|
| 367 | associated(cospOUT%modis_Optical_Thickness_Total_LogMean) .or. & |
---|
| 368 | associated(cospOUT%modis_Optical_Thickness_Water_LogMean) .or. & |
---|
| 369 | associated(cospOUT%modis_Optical_Thickness_Ice_LogMean) .or. & |
---|
| 370 | associated(cospOUT%modis_Cloud_Particle_Size_Water_Mean) .or. & |
---|
| 371 | associated(cospOUT%modis_Cloud_Particle_Size_Ice_Mean) .or. & |
---|
| 372 | associated(cospOUT%modis_Cloud_Top_Pressure_Total_Mean) .or. & |
---|
| 373 | associated(cospOUT%modis_Liquid_Water_Path_Mean) .or. & |
---|
| 374 | associated(cospOUT%modis_Ice_Water_Path_Mean) .or. & |
---|
| 375 | associated(cospOUT%modis_Optical_Thickness_vs_Cloud_Top_Pressure)) & |
---|
| 376 | Lmodis_subcolumn = .true. |
---|
| 377 | |
---|
| 378 | ! ISCCP subcolumn |
---|
| 379 | if (associated(cospOUT%isccp_boxtau) .or. & |
---|
| 380 | associated(cospOUT%isccp_boxptop)) & |
---|
| 381 | Lisccp_subcolumn = .true. |
---|
| 382 | |
---|
| 383 | ! MISR subcolumn |
---|
| 384 | if (associated(cospOUT%misr_dist_model_layertops)) & |
---|
| 385 | Lmisr_subcolumn = .true. |
---|
| 386 | |
---|
| 387 | ! CALIPOSO subcolumn |
---|
| 388 | if (associated(cospOUT%calipso_tau_tot) .or. & |
---|
| 389 | associated(cospOUT%calipso_beta_mol) .or. & |
---|
| 390 | associated(cospOUT%calipso_temp_tot) .or. & |
---|
| 391 | associated(cospOUT%calipso_betaperp_tot) .or. & |
---|
| 392 | associated(cospOUT%calipso_beta_tot)) & |
---|
| 393 | Lcalipso_subcolumn = .true. |
---|
| 394 | |
---|
| 395 | ! PARASOL subcolumn |
---|
| 396 | if (associated(cospOUT%parasolPix_refl)) & |
---|
| 397 | Lparasol_subcolumn = .true. |
---|
| 398 | |
---|
| 399 | ! RTTOV column |
---|
| 400 | if (associated(cospOUT%rttov_tbs)) & |
---|
| 401 | Lrttov_column = .true. |
---|
| 402 | |
---|
| 403 | ! Set flag to deallocate rttov types (only done on final call to simulator) |
---|
| 404 | if (size(cospOUT%isccp_meantb) .eq. stop_idx) lrttov_cleanUp = .true. |
---|
| 405 | |
---|
| 406 | ! ISCCP column |
---|
| 407 | if (associated(cospOUT%isccp_fq) .or. & |
---|
| 408 | associated(cospOUT%isccp_meanalbedocld) .or. & |
---|
| 409 | associated(cospOUT%isccp_meanptop) .or. & |
---|
| 410 | associated(cospOUT%isccp_meantaucld) .or. & |
---|
| 411 | associated(cospOUT%isccp_totalcldarea) .or. & |
---|
| 412 | associated(cospOUT%isccp_meantb)) then |
---|
| 413 | Lisccp_column = .true. |
---|
| 414 | Lisccp_subcolumn = .true. |
---|
| 415 | endif |
---|
| 416 | |
---|
| 417 | ! MISR column |
---|
| 418 | if (associated(cospOUT%misr_cldarea) .or. & |
---|
| 419 | associated(cospOUT%misr_meanztop) .or. & |
---|
| 420 | associated(cospOUT%misr_fq)) then |
---|
| 421 | Lmisr_column = .true. |
---|
| 422 | Lmisr_subcolumn = .true. |
---|
| 423 | endif |
---|
| 424 | |
---|
| 425 | ! CALIPSO column |
---|
| 426 | if (associated(cospOUT%calipso_cfad_sr) .or. & |
---|
| 427 | associated(cospOUT%calipso_lidarcld) .or. & |
---|
| 428 | associated(cospOUT%calipso_lidarcldphase) .or. & |
---|
| 429 | associated(cospOUT%calipso_cldlayer) .or. & |
---|
| 430 | associated(cospOUT%calipso_cldlayerphase) .or. & |
---|
| 431 | associated(cospOUT%calipso_lidarcldtmp)) then |
---|
| 432 | Lcalipso_column = .true. |
---|
| 433 | Lcalipso_subcolumn = .true. |
---|
| 434 | endif |
---|
| 435 | |
---|
| 436 | ! PARASOL column |
---|
| 437 | if (associated(cospOUT%parasolGrid_refl)) then |
---|
| 438 | Lparasol_column = .true. |
---|
| 439 | Lparasol_subcolumn = .true. |
---|
| 440 | endif |
---|
| 441 | |
---|
| 442 | ! CLOUDSAT column |
---|
| 443 | if (associated(cospOUT%cloudsat_cfad_ze)) then |
---|
| 444 | Lcloudsat_column = .true. |
---|
| 445 | Lcloudsat_subcolumn = .true. |
---|
| 446 | endif |
---|
| 447 | |
---|
| 448 | ! MODIS column |
---|
| 449 | if (associated(cospOUT%modis_Cloud_Fraction_Total_Mean) .or. & |
---|
| 450 | associated(cospOUT%modis_Cloud_Fraction_Water_Mean) .or. & |
---|
| 451 | associated(cospOUT%modis_Cloud_Fraction_Ice_Mean) .or. & |
---|
| 452 | associated(cospOUT%modis_Cloud_Fraction_High_Mean) .or. & |
---|
| 453 | associated(cospOUT%modis_Cloud_Fraction_Mid_Mean) .or. & |
---|
| 454 | associated(cospOUT%modis_Cloud_Fraction_Low_Mean) .or. & |
---|
| 455 | associated(cospOUT%modis_Optical_Thickness_Total_Mean) .or. & |
---|
| 456 | associated(cospOUT%modis_Optical_Thickness_Water_Mean) .or. & |
---|
| 457 | associated(cospOUT%modis_Optical_Thickness_Ice_Mean) .or. & |
---|
| 458 | associated(cospOUT%modis_Optical_Thickness_Total_LogMean) .or. & |
---|
| 459 | associated(cospOUT%modis_Optical_Thickness_Water_LogMean) .or. & |
---|
| 460 | associated(cospOUT%modis_Optical_Thickness_Ice_LogMean) .or. & |
---|
| 461 | associated(cospOUT%modis_Cloud_Particle_Size_Water_Mean) .or. & |
---|
| 462 | associated(cospOUT%modis_Cloud_Particle_Size_Ice_Mean) .or. & |
---|
| 463 | associated(cospOUT%modis_Cloud_Top_Pressure_Total_Mean) .or. & |
---|
| 464 | associated(cospOUT%modis_Liquid_Water_Path_Mean) .or. & |
---|
| 465 | associated(cospOUT%modis_Ice_Water_Path_Mean) .or. & |
---|
| 466 | associated(cospOUT%modis_Optical_Thickness_vs_Cloud_Top_Pressure)) then |
---|
| 467 | Lmodis_column = .true. |
---|
| 468 | Lmodis_subcolumn = .true. |
---|
| 469 | endif |
---|
| 470 | |
---|
| 471 | ! Joint simulator products |
---|
| 472 | if (associated(cospOUT%lidar_only_freq_cloud) .or. associated(cospOUT%radar_lidar_tcc)) then |
---|
| 473 | Lcalipso_column = .true. |
---|
| 474 | Lcalipso_subcolumn = .true. |
---|
| 475 | Lcloudsat_column = .true. |
---|
| 476 | Lcloudsat_subcolumn = .true. |
---|
| 477 | Lradar_lidar_tcc = .true. |
---|
| 478 | Llidar_only_freq_cloud = .true. |
---|
| 479 | endif |
---|
| 480 | |
---|
| 481 | !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
---|
| 482 | ! 2b) Error Checking |
---|
| 483 | ! Enforce bounds on input fields. If input field is out-of-bounds, report error |
---|
| 484 | ! and turn off simulator |
---|
| 485 | !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
---|
| 486 | call cosp_errorCheck(cospgridIN,cospIN,Lisccp_subcolumn,Lisccp_column, & |
---|
| 487 | Lmisr_subcolumn,Lmisr_column,Lmodis_subcolumn,Lmodis_column, & |
---|
| 488 | Lcloudsat_subcolumn,Lcloudsat_column,Lcalipso_subcolumn, & |
---|
| 489 | Lcalipso_column,Lrttov_subcolumn,Lrttov_column, & |
---|
| 490 | Lparasol_subcolumn,Lparasol_column,Lradar_lidar_tcc, & |
---|
| 491 | Llidar_only_freq_cloud,cospOUT,cosp_simulator,nError) |
---|
| 492 | |
---|
| 493 | !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
---|
| 494 | ! 3) Populate instrument simulator inputs |
---|
| 495 | !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
---|
| 496 | if (Lisccp_subcolumn .or. Lmodis_subcolumn) then |
---|
| 497 | isccpIN%Npoints => Npoints |
---|
| 498 | isccpIN%Ncolumns => cospIN%Ncolumns |
---|
| 499 | isccpIN%Nlevels => cospIN%Nlevels |
---|
| 500 | isccpIN%emsfc_lw => cospIN%emsfc_lw |
---|
| 501 | isccpIN%skt => cospgridIN%skt |
---|
| 502 | isccpIN%qv => cospgridIN%qv |
---|
| 503 | isccpIN%at => cospgridIN%at |
---|
| 504 | isccpIN%frac_out => cospIN%frac_out |
---|
| 505 | isccpIN%dtau => cospIN%tau_067 |
---|
| 506 | isccpIN%dem => cospIN%emiss_11 |
---|
| 507 | isccpIN%phalf => cospgridIN%phalf |
---|
| 508 | isccpIN%sunlit => cospgridIN%sunlit |
---|
| 509 | isccpIN%pfull => cospgridIN%pfull |
---|
| 510 | endif |
---|
| 511 | |
---|
| 512 | if (Lmisr_subcolumn) then |
---|
| 513 | misrIN%Npoints => Npoints |
---|
| 514 | misrIN%Ncolumns => cospIN%Ncolumns |
---|
| 515 | misrIN%Nlevels => cospIN%Nlevels |
---|
| 516 | misrIN%dtau => cospIN%tau_067 |
---|
| 517 | misrIN%sunlit => cospgridIN%sunlit |
---|
| 518 | misrIN%zfull => cospgridIN%hgt_matrix |
---|
| 519 | misrIN%at => cospgridIN%at |
---|
| 520 | endif |
---|
| 521 | |
---|
| 522 | if (Lcalipso_subcolumn) then |
---|
| 523 | calipsoIN%Npoints => Npoints |
---|
| 524 | calipsoIN%Ncolumns => cospIN%Ncolumns |
---|
| 525 | calipsoIN%Nlevels => cospIN%Nlevels |
---|
| 526 | calipsoIN%beta_mol => cospIN%beta_mol |
---|
| 527 | calipsoIN%betatot => cospIN%betatot |
---|
| 528 | calipsoIN%betatot_liq => cospIN%betatot_liq |
---|
| 529 | calipsoIN%betatot_ice => cospIN%betatot_ice |
---|
| 530 | calipsoIN%tau_mol => cospIN%tau_mol |
---|
| 531 | calipsoIN%tautot => cospIN%tautot |
---|
| 532 | calipsoIN%tautot_liq => cospIN%tautot_liq |
---|
| 533 | calipsoIN%tautot_ice => cospIN%tautot_ice |
---|
| 534 | endif |
---|
| 535 | |
---|
| 536 | if (Lparasol_subcolumn) then |
---|
| 537 | parasolIN%Npoints => Npoints |
---|
| 538 | parasolIN%Nlevels => cospIN%Nlevels |
---|
| 539 | parasolIN%Ncolumns => cospIN%Ncolumns |
---|
| 540 | parasolIN%Nrefl => cospIN%Nrefl |
---|
| 541 | parasolIN%tautot_S_liq => cospIN%tautot_S_liq |
---|
| 542 | parasolIN%tautot_S_ice => cospIN%tautot_S_ice |
---|
| 543 | endif |
---|
| 544 | |
---|
| 545 | if (Lcloudsat_subcolumn) then |
---|
| 546 | cloudsatIN%Npoints => Npoints |
---|
| 547 | cloudsatIN%Nlevels => cospIN%Nlevels |
---|
| 548 | cloudsatIN%Ncolumns => cospIN%Ncolumns |
---|
| 549 | cloudsatIN%z_vol => cospIN%z_vol_cloudsat |
---|
| 550 | cloudsatIN%kr_vol => cospIN%kr_vol_cloudsat |
---|
| 551 | cloudsatIN%g_vol => cospIN%g_vol_cloudsat |
---|
| 552 | cloudsatIN%rcfg => cospIN%rcfg_cloudsat |
---|
| 553 | cloudsatIN%hgt_matrix => cospgridIN%hgt_matrix |
---|
| 554 | endif |
---|
| 555 | |
---|
| 556 | if (Lmodis_subcolumn) then |
---|
| 557 | modisIN%Ncolumns => cospIN%Ncolumns |
---|
| 558 | modisIN%Nlevels => cospIN%Nlevels |
---|
| 559 | modisIN%Npoints => Npoints |
---|
| 560 | modisIN%liqFrac => cospIN%fracLiq |
---|
| 561 | modisIN%tau => cospIN%tau_067 |
---|
| 562 | modisIN%g => cospIN%asym |
---|
| 563 | modisIN%w0 => cospIN%ss_alb |
---|
| 564 | modisIN%Nsunlit = count(cospgridIN%sunlit > 0) |
---|
| 565 | if (modisIN%Nsunlit .gt. 0) then |
---|
| 566 | allocate(modisIN%sunlit(modisIN%Nsunlit),modisIN%pres(modisIN%Nsunlit,cospIN%Nlevels+1)) |
---|
| 567 | modisIN%sunlit = pack((/ (i, i = 1, Npoints ) /),mask = cospgridIN%sunlit > 0) |
---|
| 568 | modisIN%pres = cospgridIN%phalf(int(modisIN%sunlit(:)),:) |
---|
| 569 | endif |
---|
| 570 | if (count(cospgridIN%sunlit <= 0) .gt. 0) then |
---|
| 571 | allocate(modisIN%notSunlit(count(cospgridIN%sunlit <= 0))) |
---|
| 572 | modisIN%notSunlit = pack((/ (i, i = 1, Npoints ) /),mask = .not. cospgridIN%sunlit > 0) |
---|
| 573 | endif |
---|
| 574 | endif |
---|
| 575 | |
---|
| 576 | ! if (Lrttov_column) then |
---|
| 577 | ! rttovIN%nPoints => Npoints |
---|
| 578 | ! rttovIN%nLevels => cospIN%nLevels |
---|
| 579 | ! rttovIN%nSubCols => cospIN%nColumns |
---|
| 580 | ! rttovIN%zenang => cospgridIN%zenang |
---|
| 581 | ! rttovIN%co2 => cospgridIN%co2 |
---|
| 582 | ! rttovIN%ch4 => cospgridIN%ch4 |
---|
| 583 | ! rttovIN%n2o => cospgridIN%n2o |
---|
| 584 | ! rttovIN%co => cospgridIN%co |
---|
| 585 | ! rttovIN%surfem => cospgridIN%emis_sfc |
---|
| 586 | ! rttovIN%h_surf => cospgridIN%hgt_matrix_half(:,cospIN%Nlevels+1) |
---|
| 587 | ! rttovIN%u_surf => cospgridIN%u_sfc |
---|
| 588 | ! rttovIN%v_surf => cospgridIN%v_sfc |
---|
| 589 | ! rttovIN%t_skin => cospgridIN%skt |
---|
| 590 | ! rttovIN%p_surf => cospgridIN%phalf(:,cospIN%Nlevels+1) |
---|
| 591 | ! rttovIN%q2m => cospgridIN%qv(:,cospIN%Nlevels) |
---|
| 592 | ! rttovIN%t2m => cospgridIN%at(:,cospIN%Nlevels) |
---|
| 593 | ! rttovIN%lsmask => cospgridIN%land |
---|
| 594 | ! rttovIN%latitude => cospgridIN%lat |
---|
| 595 | ! rttovIN%longitude => cospgridIN%lon |
---|
| 596 | ! rttovIN%seaice => cospgridIN%seaice |
---|
| 597 | ! rttovIN%p => cospgridIN%pfull |
---|
| 598 | ! rttovIN%ph => cospgridIN%phalf |
---|
| 599 | ! rttovIN%t => cospgridIN%at |
---|
| 600 | ! rttovIN%q => cospgridIN%qv |
---|
| 601 | ! rttovIN%o3 => cospgridIN%o3 |
---|
| 602 | ! ! Below only needed for all-sky RTTOV calculation |
---|
| 603 | ! rttovIN%month => cospgridIN%month |
---|
| 604 | ! rttovIN%tca => cospgridIN%tca |
---|
| 605 | ! rttovIN%cldIce => cospgridIN%cloudIce |
---|
| 606 | ! rttovIN%cldLiq => cospgridIN%cloudLiq |
---|
| 607 | ! rttovIN%fl_rain => cospgridIN%fl_rain |
---|
| 608 | ! rttovIN%fl_snow => cospgridIN%fl_snow |
---|
| 609 | ! endif |
---|
| 610 | |
---|
| 611 | !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
---|
| 612 | ! 4) Call subcolumn simulators |
---|
| 613 | !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
---|
| 614 | |
---|
| 615 | ! ISCCP (icarus) subcolumn simulator |
---|
| 616 | if (Lisccp_subcolumn .or. Lmodis_subcolumn) then |
---|
| 617 | ! Allocate space for local variables |
---|
| 618 | allocate(isccpLEVMATCH(Npoints,isccpIN%Ncolumns), & |
---|
| 619 | isccp_boxttop(Npoints,isccpIN%Ncolumns), & |
---|
| 620 | isccp_boxptop(Npoints,isccpIN%Ncolumns), & |
---|
| 621 | isccp_boxtau(Npoints,isccpIN%Ncolumns), isccp_meantbclr(Npoints)) |
---|
| 622 | ! Call simulator |
---|
| 623 | call icarus_subcolumn(isccpIN%npoints,isccpIN%ncolumns,isccpIN%nlevels, & |
---|
| 624 | isccpIN%sunlit,isccpIN%dtau,isccpIN%dem,isccpIN%skt, & |
---|
| 625 | isccpIN%emsfc_lw,isccpIN%qv,isccpIN%at,isccpIN%pfull, & |
---|
| 626 | isccpIN%phalf,isccpIN%frac_out,isccpLEVMATCH, & |
---|
| 627 | isccp_boxtau(:,:),isccp_boxptop(:,:), & |
---|
| 628 | isccp_boxttop(:,:),isccp_meantbclr(:)) |
---|
| 629 | ! Store output (if requested) |
---|
| 630 | if (associated(cospOUT%isccp_boxtau)) then |
---|
| 631 | cospOUT%isccp_boxtau(ij:ik,:) = isccp_boxtau |
---|
| 632 | endif |
---|
| 633 | if (associated(cospOUT%isccp_boxptop)) then |
---|
| 634 | cospOUT%isccp_boxptop(ij:ik,:) = isccp_boxptop |
---|
| 635 | endif |
---|
| 636 | if (associated(cospOUT%isccp_meantbclr)) then |
---|
| 637 | cospOUT%isccp_meantbclr(ij:ik) = isccp_meantbclr |
---|
| 638 | endif |
---|
| 639 | endif |
---|
| 640 | |
---|
| 641 | ! MISR subcolumn simulator |
---|
| 642 | if (Lmisr_subcolumn) then |
---|
| 643 | ! Allocate space for local variables |
---|
| 644 | allocate(misr_boxztop(Npoints,misrIN%Ncolumns), & |
---|
| 645 | misr_boxtau(Npoints,misrIN%Ncolumns), & |
---|
| 646 | misr_dist_model_layertops(Npoints,numMISRHgtBins)) |
---|
| 647 | ! Call simulator |
---|
| 648 | call misr_subcolumn(misrIN%Npoints,misrIN%Ncolumns,misrIN%Nlevels,misrIN%dtau, & |
---|
| 649 | misrIN%zfull,misrIN%at,misrIN%sunlit,misr_boxtau, & |
---|
| 650 | misr_dist_model_layertops,misr_boxztop) |
---|
| 651 | ! Store output (if requested) |
---|
| 652 | if (associated(cospOUT%misr_dist_model_layertops)) then |
---|
| 653 | cospOUT%misr_dist_model_layertops(ij:ik,:) = misr_dist_model_layertops |
---|
| 654 | endif |
---|
| 655 | endif |
---|
| 656 | |
---|
| 657 | ! Calipso subcolumn simulator |
---|
| 658 | if (Lcalipso_subcolumn) then |
---|
| 659 | ! Allocate space for local variables |
---|
| 660 | allocate(calipso_beta_mol(calipsoIN%Npoints,calipsoIN%Nlevels), & |
---|
| 661 | calipso_beta_tot(calipsoIN%Npoints,calipsoIN%Ncolumns,calipsoIN%Nlevels),& |
---|
| 662 | calipso_betaperp_tot(calipsoIN%Npoints,calipsoIN%Ncolumns,calipsoIN%Nlevels)) |
---|
| 663 | ! Call simulator |
---|
| 664 | call lidar_subcolumn(calipsoIN%npoints,calipsoIN%ncolumns,calipsoIN%nlevels, & |
---|
| 665 | calipsoIN%beta_mol,calipsoIN%tau_mol, & |
---|
| 666 | calipsoIN%betatot,calipsoIN%tautot,calipsoIN%betatot_ice, & |
---|
| 667 | calipsoIN%tautot_ice,calipsoIN%betatot_liq, & |
---|
| 668 | calipsoIN%tautot_liq,calipso_beta_mol(:,:), & |
---|
| 669 | calipso_beta_tot(:,:,:),calipso_betaperp_tot(:,:,:)) |
---|
| 670 | ! Store output (if requested) |
---|
| 671 | if (associated(cospOUT%calipso_beta_mol)) & |
---|
| 672 | cospOUT%calipso_beta_mol(ij:ik,calipsoIN%Nlevels:1:-1) = calipso_beta_mol |
---|
| 673 | if (associated(cospOUT%calipso_beta_tot)) & |
---|
| 674 | cospOUT%calipso_beta_tot(ij:ik,:,calipsoIN%Nlevels:1:-1) = calipso_beta_tot |
---|
| 675 | if (associated(cospOUT%calipso_betaperp_tot)) & |
---|
| 676 | cospOUT%calipso_betaperp_tot(ij:ik,:,:) = calipso_betaperp_tot |
---|
| 677 | |
---|
| 678 | endif |
---|
| 679 | |
---|
| 680 | ! PARASOL subcolumn simulator |
---|
| 681 | if (Lparasol_subcolumn) then |
---|
| 682 | ! Allocate space for local variables |
---|
| 683 | allocate(parasolPix_refl(parasolIN%Npoints,parasolIN%Ncolumns,PARASOL_NREFL)) |
---|
| 684 | ! Call simulator |
---|
| 685 | do icol=1,parasolIN%Ncolumns |
---|
| 686 | call parasol_subcolumn(parasolIN%npoints, PARASOL_NREFL, & |
---|
| 687 | parasolIN%tautot_S_liq(1:parasolIN%Npoints,icol), & |
---|
| 688 | parasolIN%tautot_S_ice(1:parasolIN%Npoints,icol), & |
---|
| 689 | parasolPix_refl(:,icol,1:PARASOL_NREFL)) |
---|
| 690 | ! Store output (if requested) |
---|
| 691 | if (associated(cospOUT%parasolPix_refl)) then |
---|
| 692 | cospOUT%parasolPix_refl(ij:ik,icol,1:PARASOL_NREFL) = & |
---|
| 693 | parasolPix_refl(:,icol,1:PARASOL_NREFL) |
---|
| 694 | endif |
---|
| 695 | enddo |
---|
| 696 | endif |
---|
| 697 | |
---|
| 698 | ! Cloudsat (quickbeam) subcolumn simulator |
---|
| 699 | if (Lcloudsat_subcolumn) then |
---|
| 700 | ! Allocate space for local variables |
---|
| 701 | allocate(cloudsatDBZe(cloudsatIN%Npoints,cloudsatIN%Ncolumns,cloudsatIN%Nlevels)) |
---|
| 702 | do icol=1,cloudsatIN%ncolumns |
---|
| 703 | call quickbeam_subcolumn(cloudsatIN%rcfg,cloudsatIN%Npoints,cloudsatIN%Nlevels,& |
---|
| 704 | cloudsatIN%hgt_matrix/1000._wp, & |
---|
| 705 | cloudsatIN%z_vol(:,icol,:), & |
---|
| 706 | cloudsatIN%kr_vol(:,icol,:), & |
---|
| 707 | cloudsatIN%g_vol(:,1,:),cloudsatDBze(:,icol,:)) |
---|
| 708 | enddo |
---|
| 709 | ! Store output (if requested) |
---|
| 710 | if (associated(cospOUT%cloudsat_Ze_tot)) then |
---|
| 711 | cospOUT%cloudsat_Ze_tot(ij:ik,:,:) = cloudsatDBZe(:,:,cloudsatIN%Nlevels:1:-1) |
---|
| 712 | endif |
---|
| 713 | endif |
---|
| 714 | |
---|
| 715 | if (Lmodis_subcolumn) then |
---|
| 716 | if(modisiN%nSunlit > 0) then |
---|
| 717 | ! Allocate space for local variables |
---|
| 718 | allocate(modisRetrievedTau(modisIN%nSunlit,modisIN%nColumns), & |
---|
| 719 | modisRetrievedSize(modisIN%nSunlit,modisIN%nColumns), & |
---|
| 720 | modisRetrievedPhase(modisIN%nSunlit,modisIN%nColumns), & |
---|
| 721 | modisRetrievedCloudTopPressure(modisIN%nSunlit,modisIN%nColumns)) |
---|
| 722 | ! Call simulator |
---|
| 723 | do i = 1, modisIN%nSunlit |
---|
| 724 | call modis_subcolumn(modisIN%Ncolumns,modisIN%Nlevels,modisIN%pres(i,:), & |
---|
| 725 | modisIN%tau(int(modisIN%sunlit(i)),:,:), & |
---|
| 726 | modisIN%liqFrac(int(modisIN%sunlit(i)),:,:), & |
---|
| 727 | modisIN%g(int(modisIN%sunlit(i)),:,:), & |
---|
| 728 | modisIN%w0(int(modisIN%sunlit(i)),:,:), & |
---|
| 729 | isccp_boxptop(int(modisIN%sunlit(i)),:), & |
---|
| 730 | modisRetrievedPhase(i,:), & |
---|
| 731 | modisRetrievedCloudTopPressure(i,:), & |
---|
| 732 | modisRetrievedTau(i,:),modisRetrievedSize(i,:)) |
---|
| 733 | end do |
---|
| 734 | endif |
---|
| 735 | endif |
---|
| 736 | |
---|
| 737 | !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
---|
| 738 | ! 5) Call column simulators |
---|
| 739 | !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
---|
| 740 | |
---|
| 741 | ! ISCCP |
---|
| 742 | if (Lisccp_column) then |
---|
| 743 | ! Check to see which outputs are requested. If not requested, use a local dummy array |
---|
| 744 | if(.not. associated(cospOUT%isccp_meanalbedocld)) then |
---|
| 745 | allocate(out1D_1(Npoints)) |
---|
| 746 | cospOUT%isccp_meanalbedocld(ij:ik) => out1D_1 |
---|
| 747 | endif |
---|
| 748 | if(.not. associated(cospOUT%isccp_meanptop)) then |
---|
| 749 | allocate(out1D_2(Npoints)) |
---|
| 750 | cospOUT%isccp_meanptop(ij:ik) => out1D_2 |
---|
| 751 | endif |
---|
| 752 | if(.not. associated(cospOUT%isccp_meantaucld)) then |
---|
| 753 | allocate(out1D_3(Npoints)) |
---|
| 754 | cospOUT%isccp_meantaucld(ij:ik) => out1D_3 |
---|
| 755 | endif |
---|
| 756 | if(.not. associated(cospOUT%isccp_totalcldarea)) then |
---|
| 757 | allocate(out1D_4(Npoints)) |
---|
| 758 | cospOUT%isccp_totalcldarea(ij:ik) => out1D_4 |
---|
| 759 | endif |
---|
| 760 | if(.not. associated(cospOUT%isccp_meantb)) then |
---|
| 761 | allocate(out1D_5(Npoints)) |
---|
| 762 | cospOUT%isccp_meantb(ij:ik) => out1D_5 |
---|
| 763 | endif |
---|
| 764 | if(.not. associated(cospOUT%isccp_fq)) then |
---|
| 765 | allocate(out1D_6(Npoints*numISCCPTauBins*numISCCPPresBins)) |
---|
| 766 | cospOUT%isccp_fq(ij:ik,1:numISCCPTauBins,1:numISCCPPresBins) => out1D_6 |
---|
| 767 | endif |
---|
| 768 | |
---|
| 769 | ! Call simulator |
---|
| 770 | call icarus_column(isccpIN%npoints, isccpIN%ncolumns,isccp_boxtau(:,:), & |
---|
| 771 | isccp_boxptop(:,:)/100._wp, isccpIN%sunlit,isccp_boxttop, & |
---|
| 772 | cospOUT%isccp_fq(ij:ik,:,:), & |
---|
| 773 | cospOUT%isccp_meanalbedocld(ij:ik), & |
---|
| 774 | cospOUT%isccp_meanptop(ij:ik),cospOUT%isccp_meantaucld(ij:ik), & |
---|
| 775 | cospOUT%isccp_totalcldarea(ij:ik),cospOUT%isccp_meantb(ij:ik)) |
---|
| 776 | cospOUT%isccp_fq(ij:ik,:,:) = cospOUT%isccp_fq(ij:ik,:,7:1:-1) |
---|
| 777 | |
---|
| 778 | ! Check if there is any value slightly greater than 1 |
---|
| 779 | where ((cospOUT%isccp_totalcldarea > 1.0-1.e-5) .and. & |
---|
| 780 | (cospOUT%isccp_totalcldarea < 1.0+1.e-5)) |
---|
| 781 | cospOUT%isccp_totalcldarea = 1.0 |
---|
| 782 | endwhere |
---|
| 783 | |
---|
| 784 | ! Clear up memory (if necessary) |
---|
| 785 | if (allocated(isccp_boxttop)) deallocate(isccp_boxttop) |
---|
| 786 | if (allocated(isccp_boxptop)) deallocate(isccp_boxptop) |
---|
| 787 | if (allocated(isccp_boxtau)) deallocate(isccp_boxtau) |
---|
| 788 | if (allocated(isccp_meantbclr)) deallocate(isccp_meantbclr) |
---|
| 789 | if (allocated(isccpLEVMATCH)) deallocate(isccpLEVMATCH) |
---|
| 790 | if (allocated(out1D_1)) then |
---|
| 791 | deallocate(out1D_1) |
---|
| 792 | nullify(cospOUT%isccp_meanalbedocld) |
---|
| 793 | endif |
---|
| 794 | if (allocated(out1D_2)) then |
---|
| 795 | deallocate(out1D_2) |
---|
| 796 | nullify(cospOUT%isccp_meanptop) |
---|
| 797 | endif |
---|
| 798 | if (allocated(out1D_3)) then |
---|
| 799 | deallocate(out1D_3) |
---|
| 800 | nullify(cospOUT%isccp_meantaucld) |
---|
| 801 | endif |
---|
| 802 | if (allocated(out1D_4)) then |
---|
| 803 | deallocate(out1D_4) |
---|
| 804 | nullify(cospOUT%isccp_totalcldarea) |
---|
| 805 | endif |
---|
| 806 | if (allocated(out1D_5)) then |
---|
| 807 | deallocate(out1D_5) |
---|
| 808 | nullify(cospOUT%isccp_meantb) |
---|
| 809 | endif |
---|
| 810 | if (allocated(out1D_6)) then |
---|
| 811 | deallocate(out1D_6) |
---|
| 812 | nullify(cospOUT%isccp_fq) |
---|
| 813 | endif |
---|
| 814 | endif |
---|
| 815 | |
---|
| 816 | ! MISR |
---|
| 817 | if (Lmisr_column) then |
---|
| 818 | ! Check to see which outputs are requested. If not requested, use a local dummy array |
---|
| 819 | if (.not. associated(cospOUT%misr_cldarea)) then |
---|
| 820 | allocate(out1D_1(Npoints)) |
---|
| 821 | cospOUT%misr_cldarea(ij:ik) => out1D_1 |
---|
| 822 | endif |
---|
| 823 | if (.not. associated(cospOUT%misr_meanztop)) then |
---|
| 824 | allocate(out1D_2(Npoints)) |
---|
| 825 | cospOUT%misr_meanztop(ij:ik) => out1D_2 |
---|
| 826 | endif |
---|
| 827 | if (.not. associated(cospOUT%misr_fq)) then |
---|
| 828 | allocate(out1D_3(Npoints*numMISRTauBins*numMISRHgtBins)) |
---|
| 829 | cospOUT%misr_fq(ij:ik,1:numMISRTauBins,1:numMISRHgtBins) => out1D_3 |
---|
| 830 | endif |
---|
| 831 | |
---|
| 832 | ! Call simulator |
---|
| 833 | call misr_column(misrIN%Npoints,misrIN%Ncolumns,misr_boxztop,misrIN%sunlit,& |
---|
| 834 | misr_boxtau,cospOUT%misr_cldarea(ij:ik), & |
---|
| 835 | cospOUT%misr_meanztop(ij:ik),cospOUT%misr_fq(ij:ik,:,:)) |
---|
| 836 | |
---|
| 837 | ! Clear up memory |
---|
| 838 | if (allocated(misr_boxtau)) deallocate(misr_boxtau) |
---|
| 839 | if (allocated(misr_boxztop)) deallocate(misr_boxztop) |
---|
| 840 | if (allocated(misr_dist_model_layertops)) deallocate(misr_dist_model_layertops) |
---|
| 841 | if (allocated(out1D_1)) then |
---|
| 842 | deallocate(out1D_1) |
---|
| 843 | nullify(cospOUT%misr_cldarea) |
---|
| 844 | endif |
---|
| 845 | if (allocated(out1D_2)) then |
---|
| 846 | deallocate(out1D_2) |
---|
| 847 | nullify(cospOUT%misr_meanztop) |
---|
| 848 | endif |
---|
| 849 | if (allocated(out1D_3)) then |
---|
| 850 | deallocate(out1D_3) |
---|
| 851 | nullify(cospOUT%misr_fq) |
---|
| 852 | endif |
---|
| 853 | endif |
---|
| 854 | |
---|
| 855 | ! CALIPSO LIDAR Simulator |
---|
| 856 | if (Lcalipso_column) then |
---|
| 857 | ! Check to see which outputs are requested. If not requested, use a local dummy array |
---|
| 858 | if (.not. associated(cospOUT%calipso_cfad_sr)) then |
---|
| 859 | allocate(out1D_1(Npoints*SR_BINS*Nlvgrid)) |
---|
| 860 | cospOUT%calipso_cfad_sr(ij:ik,1:SR_BINS,1:Nlvgrid) => out1D_1 |
---|
| 861 | endif |
---|
| 862 | if (.not. associated(cospOUT%calipso_lidarcld)) then |
---|
| 863 | allocate(out1D_2(Npoints*Nlvgrid)) |
---|
| 864 | cospOUT%calipso_lidarcld(ij:ik,1:Nlvgrid) => out1D_2 |
---|
| 865 | endif |
---|
| 866 | if (.not. associated(cospOUT%calipso_lidarcldphase)) then |
---|
| 867 | allocate(out1D_3(Npoints*Nlvgrid*6)) |
---|
| 868 | cospOUT%calipso_lidarcldphase(ij:ik,1:Nlvgrid,1:6) => out1D_3 |
---|
| 869 | endif |
---|
| 870 | if (.not. associated(cospOUT%calipso_cldlayer)) then |
---|
| 871 | allocate(out1D_4(Npoints*LIDAR_NCAT)) |
---|
| 872 | cospOUT%calipso_cldlayer(ij:ik,1:LIDAR_NCAT) => out1D_4 |
---|
| 873 | endif |
---|
| 874 | if (.not. associated(cospOUT%calipso_cldlayerphase)) then |
---|
| 875 | allocate(out1D_5(Npoints*LIDAR_NCAT*6)) |
---|
| 876 | cospOUT%calipso_cldlayerphase(ij:ik,1:LIDAR_NCAT,1:6) => out1D_5 |
---|
| 877 | endif |
---|
| 878 | if (.not. associated(cospOUT%calipso_lidarcldtmp)) then |
---|
| 879 | allocate(out1D_6(Npoints*40*5)) |
---|
| 880 | cospOUT%calipso_lidarcldtmp(ij:ik,1:40,1:5) => out1D_6 |
---|
| 881 | endif |
---|
| 882 | |
---|
| 883 | ! Call simulator |
---|
| 884 | ok_lidar_cfad=.true. |
---|
| 885 | call lidar_column(calipsoIN%Npoints,calipsoIN%Ncolumns,calipsoIN%Nlevels, & |
---|
| 886 | Nlvgrid,SR_BINS,cospgridIN%at(:,:), & |
---|
| 887 | calipso_beta_tot(:,:,:),calipso_betaperp_tot(:,:,:), & |
---|
| 888 | calipso_beta_mol(:,:), & |
---|
| 889 | cospgridIN%phalf(:,2:calipsoIN%Nlevels),ok_lidar_cfad, & |
---|
| 890 | LIDAR_NCAT,cospOUT%calipso_cfad_sr(ij:ik,:,:), & |
---|
| 891 | cospOUT%calipso_lidarcld(ij:ik,:), & |
---|
| 892 | cospOUT%calipso_lidarcldphase(ij:ik,:,:), & |
---|
| 893 | cospOUT%calipso_cldlayer(ij:ik,:), & |
---|
| 894 | cospgridIN%hgt_matrix,cospgridIN%hgt_matrix_half, & |
---|
| 895 | cospOUT%calipso_cldlayerphase(ij:ik,:,:), & |
---|
| 896 | cospOUT%calipso_lidarcldtmp(ij:ik,:,:)) |
---|
| 897 | if (associated(cospOUT%calipso_srbval)) cospOUT%calipso_srbval = calipso_histBsct |
---|
| 898 | |
---|
| 899 | ! Free up memory (if necessary) |
---|
| 900 | if (allocated(out1D_1)) then |
---|
| 901 | deallocate(out1D_1) |
---|
| 902 | nullify(cospOUT%calipso_cfad_sr) |
---|
| 903 | endif |
---|
| 904 | if (allocated(out1D_2)) then |
---|
| 905 | deallocate(out1D_2) |
---|
| 906 | nullify(cospOUT%calipso_lidarcld) |
---|
| 907 | endif |
---|
| 908 | if (allocated(out1D_3)) then |
---|
| 909 | deallocate(out1D_3) |
---|
| 910 | nullify(cospOUT%calipso_lidarcldphase) |
---|
| 911 | endif |
---|
| 912 | if (allocated(out1D_4)) then |
---|
| 913 | deallocate(out1D_4) |
---|
| 914 | nullify(cospOUT%calipso_cldlayer) |
---|
| 915 | endif |
---|
| 916 | if (allocated(out1D_5)) then |
---|
| 917 | deallocate(out1D_5) |
---|
| 918 | nullify(cospOUT%calipso_cldlayerphase) |
---|
| 919 | endif |
---|
| 920 | if (allocated(out1D_6)) then |
---|
| 921 | deallocate(out1D_6) |
---|
| 922 | nullify(cospOUT%calipso_lidarcldtmp) |
---|
| 923 | endif |
---|
| 924 | endif |
---|
| 925 | |
---|
| 926 | ! PARASOL |
---|
| 927 | if (Lparasol_column) then |
---|
| 928 | call parasol_column(parasolIN%Npoints,PARASOL_NREFL,parasolIN%Ncolumns, & |
---|
| 929 | cospgridIN%land(:),parasolPix_refl(:,:,:), & |
---|
| 930 | cospOUT%parasolGrid_refl(ij:ik,:)) |
---|
| 931 | if (allocated(parasolPix_refl)) deallocate(parasolPix_refl) |
---|
| 932 | endif |
---|
| 933 | |
---|
| 934 | ! CLOUDSAT |
---|
| 935 | if (Lcloudsat_column) then |
---|
| 936 | ! Check to see which outputs are requested. If not requested, use a local dummy array |
---|
| 937 | if (.not. associated(cospOUT%cloudsat_cfad_ze)) then |
---|
| 938 | allocate(out1D_1(Npoints*DBZE_BINS*Nlvgrid)) |
---|
| 939 | cospOUT%cloudsat_cfad_ze(ij:ik,1:DBZE_BINS,1:Nlvgrid) => out1D_1 |
---|
| 940 | endif |
---|
| 941 | |
---|
| 942 | ! Call simulator |
---|
| 943 | call quickbeam_column(cloudsatIN%Npoints,cloudsatIN%Ncolumns,cloudsatIN%Nlevels, & |
---|
| 944 | Nlvgrid,cloudsatDBZe,cospgridIN%hgt_matrix, & |
---|
| 945 | cospgridIN%hgt_matrix_half,cospOUT%cloudsat_cfad_ze(ij:ik,:,:)) |
---|
| 946 | ! Free up memory (if necessary) |
---|
| 947 | if (allocated(out1D_1)) then |
---|
| 948 | deallocate(out1D_1) |
---|
| 949 | nullify(cospOUT%cloudsat_cfad_ze) |
---|
| 950 | endif |
---|
| 951 | endif |
---|
| 952 | |
---|
| 953 | ! MODIS |
---|
| 954 | if (Lmodis_column) then |
---|
| 955 | if(modisiN%nSunlit > 0) then |
---|
| 956 | ! Allocate space for local variables |
---|
| 957 | allocate(modisCftotal(modisIN%nSunlit), modisCfLiquid(modisIN%nSunlit), & |
---|
| 958 | modisCfIce(modisIN%nSunlit),modisCfHigh(modisIN%nSunlit), & |
---|
| 959 | modisCfMid(modisIN%nSunlit),modisCfLow(modisIN%nSunlit), & |
---|
| 960 | modisMeanTauTotal(modisIN%nSunlit), & |
---|
| 961 | modisMeanTauLiquid(modisIN%nSunlit),modisMeanTauIce(modisIN%nSunlit), & |
---|
| 962 | modisMeanLogTauTotal(modisIN%nSunlit), & |
---|
| 963 | modisMeanLogTauLiquid(modisIN%nSunlit), & |
---|
| 964 | modisMeanLogTauIce(modisIN%nSunlit), & |
---|
| 965 | modisMeanSizeLiquid(modisIN%nSunlit), & |
---|
| 966 | modisMeanSizeIce(modisIN%nSunlit), & |
---|
| 967 | modisMeanCloudTopPressure(modisIN%nSunlit), & |
---|
| 968 | modisMeanLiquidWaterPath(modisIN%nSunlit), & |
---|
| 969 | modisMeanIceWaterPath(modisIN%nSunlit), & |
---|
| 970 | modisJointHistogram(modisIN%nSunlit,numMODISTauBins,numMODISPresBins),& |
---|
| 971 | modisJointHistogramIce(modisIN%nSunlit,numModisTauBins,numMODISReffIceBins),& |
---|
| 972 | modisJointHistogramLiq(modisIN%nSunlit,numModisTauBins,numMODISReffLiqBins)) |
---|
| 973 | ! Call simulator |
---|
| 974 | call modis_column(modisIN%nSunlit, modisIN%Ncolumns,modisRetrievedPhase, & |
---|
| 975 | modisRetrievedCloudTopPressure,modisRetrievedTau, & |
---|
| 976 | modisRetrievedSize, modisCfTotal, modisCfLiquid, modisCfIce,& |
---|
| 977 | modisCfHigh, modisCfMid, modisCfLow, modisMeanTauTotal, & |
---|
| 978 | modisMeanTauLiquid, modisMeanTauIce, modisMeanLogTauTotal, & |
---|
| 979 | modisMeanLogTauLiquid, modisMeanLogTauIce, & |
---|
| 980 | modisMeanSizeLiquid, modisMeanSizeIce, & |
---|
| 981 | modisMeanCloudTopPressure, modisMeanLiquidWaterPath, & |
---|
| 982 | modisMeanIceWaterPath, modisJointHistogram, & |
---|
| 983 | modisJointHistogramIce,modisJointHistogramLiq) |
---|
| 984 | ! Store data (if requested) |
---|
| 985 | if (associated(cospOUT%modis_Cloud_Fraction_Total_Mean)) then |
---|
| 986 | cospOUT%modis_Cloud_Fraction_Total_Mean(ij+int(modisIN%sunlit(:))-1) = & |
---|
| 987 | modisCfTotal |
---|
| 988 | endif |
---|
| 989 | if (associated(cospOUT%modis_Cloud_Fraction_Water_Mean)) then |
---|
| 990 | cospOUT%modis_Cloud_Fraction_Water_Mean(ij+int(modisIN%sunlit(:))-1) = & |
---|
| 991 | modisCfLiquid |
---|
| 992 | endif |
---|
| 993 | if (associated(cospOUT%modis_Cloud_Fraction_Ice_Mean)) then |
---|
| 994 | cospOUT%modis_Cloud_Fraction_Ice_Mean(ij+int(modisIN%sunlit(:))-1) = & |
---|
| 995 | modisCfIce |
---|
| 996 | endif |
---|
| 997 | if (associated(cospOUT%modis_Cloud_Fraction_High_Mean)) then |
---|
| 998 | cospOUT%modis_Cloud_Fraction_High_Mean(ij+int(modisIN%sunlit(:))-1) = & |
---|
| 999 | modisCfHigh |
---|
| 1000 | endif |
---|
| 1001 | if (associated(cospOUT%modis_Cloud_Fraction_Mid_Mean)) then |
---|
| 1002 | cospOUT%modis_Cloud_Fraction_Mid_Mean(ij+int(modisIN%sunlit(:))-1) = & |
---|
| 1003 | modisCfMid |
---|
| 1004 | endif |
---|
| 1005 | if (associated(cospOUT%modis_Cloud_Fraction_Low_Mean)) then |
---|
| 1006 | cospOUT%modis_Cloud_Fraction_Low_Mean(ij+int(modisIN%sunlit(:))-1) = & |
---|
| 1007 | modisCfLow |
---|
| 1008 | endif |
---|
| 1009 | if (associated(cospOUT%modis_Optical_Thickness_Total_Mean)) then |
---|
| 1010 | cospOUT%modis_Optical_Thickness_Total_Mean(ij+int(modisIN%sunlit(:))-1) = & |
---|
| 1011 | modisMeanTauTotal |
---|
| 1012 | endif |
---|
| 1013 | if (associated(cospOUT%modis_Optical_Thickness_Water_Mean)) then |
---|
| 1014 | cospOUT%modis_Optical_Thickness_Water_Mean(ij+int(modisIN%sunlit(:))-1) = & |
---|
| 1015 | modisMeanTauLiquid |
---|
| 1016 | endif |
---|
| 1017 | if (associated(cospOUT%modis_Optical_Thickness_Ice_Mean)) then |
---|
| 1018 | cospOUT%modis_Optical_Thickness_Ice_Mean(ij+int(modisIN%sunlit(:))-1) = & |
---|
| 1019 | modisMeanTauIce |
---|
| 1020 | endif |
---|
| 1021 | if (associated(cospOUT%modis_Optical_Thickness_Total_LogMean)) then |
---|
| 1022 | cospOUT%modis_Optical_Thickness_Total_LogMean(ij+int(modisIN%sunlit(:))-1)= & |
---|
| 1023 | modisMeanLogTauTotal |
---|
| 1024 | endif |
---|
| 1025 | if (associated(cospOUT%modis_Optical_Thickness_Water_LogMean)) then |
---|
| 1026 | cospOUT%modis_Optical_Thickness_Water_LogMean(ij+int(modisIN%sunlit(:))-1) = & |
---|
| 1027 | modisMeanLogTauLiquid |
---|
| 1028 | endif |
---|
| 1029 | if (associated(cospOUT%modis_Optical_Thickness_Ice_LogMean)) then |
---|
| 1030 | cospOUT%modis_Optical_Thickness_Ice_LogMean(ij+int(modisIN%sunlit(:))-1) = & |
---|
| 1031 | modisMeanLogTauIce |
---|
| 1032 | endif |
---|
| 1033 | if (associated(cospOUT%modis_Cloud_Particle_Size_Water_Mean)) then |
---|
| 1034 | cospOUT%modis_Cloud_Particle_Size_Water_Mean(ij+int(modisIN%sunlit(:))-1) = & |
---|
| 1035 | modisMeanSizeLiquid |
---|
| 1036 | endif |
---|
| 1037 | if (associated(cospOUT%modis_Cloud_Particle_Size_Ice_Mean)) then |
---|
| 1038 | cospOUT%modis_Cloud_Particle_Size_Ice_Mean(ij+int(modisIN%sunlit(:))-1) = & |
---|
| 1039 | modisMeanSizeIce |
---|
| 1040 | endif |
---|
| 1041 | if (associated(cospOUT%modis_Cloud_Top_Pressure_Total_Mean)) then |
---|
| 1042 | cospOUT%modis_Cloud_Top_Pressure_Total_Mean(ij+int(modisIN%sunlit(:))-1) = & |
---|
| 1043 | modisMeanCloudTopPressure |
---|
| 1044 | endif |
---|
| 1045 | if (associated(cospOUT%modis_Liquid_Water_Path_Mean)) then |
---|
| 1046 | cospOUT%modis_Liquid_Water_Path_Mean(ij+int(modisIN%sunlit(:))-1) = & |
---|
| 1047 | modisMeanLiquidWaterPath |
---|
| 1048 | endif |
---|
| 1049 | if (associated(cospOUT%modis_Ice_Water_Path_Mean)) then |
---|
| 1050 | cospOUT%modis_Ice_Water_Path_Mean(ij+int(modisIN%sunlit(:))-1) = & |
---|
| 1051 | modisMeanIceWaterPath |
---|
| 1052 | endif |
---|
| 1053 | if (associated(cospOUT%modis_Optical_Thickness_vs_Cloud_Top_Pressure)) then |
---|
| 1054 | cospOUT%modis_Optical_Thickness_vs_Cloud_Top_Pressure(ij+ & |
---|
| 1055 | int(modisIN%sunlit(:))-1, 1:numModisTauBins, :) = modisJointHistogram(:, :, :) |
---|
| 1056 | ! Reorder pressure bins in joint histogram to go from surface to TOA |
---|
| 1057 | cospOUT%modis_Optical_Thickness_vs_Cloud_Top_Pressure(ij:ik,:,:) = & |
---|
| 1058 | cospOUT%modis_Optical_Thickness_vs_Cloud_Top_Pressure(ij:ik,:,numMODISPresBins:1:-1) |
---|
| 1059 | endif |
---|
| 1060 | if (associated(cospOUT%modis_Optical_Thickness_vs_ReffIce)) then |
---|
| 1061 | cospOUT%modis_Optical_Thickness_vs_ReffIce(ij+int(modisIN%sunlit(:))-1, 1:numMODISTauBins,:) = & |
---|
| 1062 | modisJointHistogramIce(:,:,:) |
---|
| 1063 | endif |
---|
| 1064 | if (associated(cospOUT%modis_Optical_Thickness_vs_ReffLiq)) then |
---|
| 1065 | cospOUT%modis_Optical_Thickness_vs_ReffLiq(ij+int(modisIN%sunlit(:))-1, 1:numMODISTauBins,:) = & |
---|
| 1066 | modisJointHistogramLiq(:,:,:) |
---|
| 1067 | endif |
---|
| 1068 | |
---|
| 1069 | if(modisIN%nSunlit < modisIN%Npoints) then |
---|
| 1070 | ! Where it's night and we haven't done the retrievals the values are undefined |
---|
| 1071 | if (associated(cospOUT%modis_Cloud_Fraction_Total_Mean)) & |
---|
| 1072 | cospOUT%modis_Cloud_Fraction_Total_Mean(ij+int(modisIN%notSunlit(:))-1) = R_UNDEF |
---|
| 1073 | if (associated(cospOUT%modis_Cloud_Fraction_Water_Mean)) & |
---|
| 1074 | cospOUT%modis_Cloud_Fraction_Water_Mean(ij+int(modisIN%notSunlit(:))-1) = R_UNDEF |
---|
| 1075 | if (associated(cospOUT%modis_Cloud_Fraction_Ice_Mean)) & |
---|
| 1076 | cospOUT%modis_Cloud_Fraction_Ice_Mean(ij+int(modisIN%notSunlit(:))-1) = R_UNDEF |
---|
| 1077 | if (associated(cospOUT%modis_Cloud_Fraction_High_Mean)) & |
---|
| 1078 | cospOUT%modis_Cloud_Fraction_High_Mean(ij+int(modisIN%notSunlit(:))-1) = R_UNDEF |
---|
| 1079 | if (associated(cospOUT%modis_Cloud_Fraction_Mid_Mean)) & |
---|
| 1080 | cospOUT%modis_Cloud_Fraction_Mid_Mean(ij+int(modisIN%notSunlit(:))-1) = R_UNDEF |
---|
| 1081 | if (associated(cospOUT%modis_Cloud_Fraction_Low_Mean)) & |
---|
| 1082 | cospOUT%modis_Cloud_Fraction_Low_Mean(ij+int(modisIN%notSunlit(:))-1) = R_UNDEF |
---|
| 1083 | if (associated(cospOUT%modis_Optical_Thickness_Total_Mean)) & |
---|
| 1084 | cospOUT%modis_Optical_Thickness_Total_Mean(ij+int(modisIN%notSunlit(:))-1) = R_UNDEF |
---|
| 1085 | if (associated(cospOUT%modis_Optical_Thickness_Water_Mean)) & |
---|
| 1086 | cospOUT%modis_Optical_Thickness_Water_Mean(ij+int(modisIN%notSunlit(:))-1) = R_UNDEF |
---|
| 1087 | if (associated(cospOUT%modis_Optical_Thickness_Ice_Mean)) & |
---|
| 1088 | cospOUT%modis_Optical_Thickness_Ice_Mean(ij+int(modisIN%notSunlit(:))-1) = R_UNDEF |
---|
| 1089 | if (associated(cospOUT%modis_Optical_Thickness_Total_LogMean)) & |
---|
| 1090 | cospOUT%modis_Optical_Thickness_Total_LogMean(ij+int(modisIN%notSunlit(:))-1) = R_UNDEF |
---|
| 1091 | if (associated(cospOUT%modis_Optical_Thickness_Water_LogMean)) & |
---|
| 1092 | cospOUT%modis_Optical_Thickness_Water_LogMean(ij+int(modisIN%notSunlit(:))-1) = R_UNDEF |
---|
| 1093 | if (associated(cospOUT%modis_Optical_Thickness_Ice_LogMean)) & |
---|
| 1094 | cospOUT%modis_Optical_Thickness_Ice_LogMean(ij+int(modisIN%notSunlit(:))-1) = R_UNDEF |
---|
| 1095 | if (associated(cospOUT%modis_Cloud_Particle_Size_Water_Mean)) & |
---|
| 1096 | cospOUT%modis_Cloud_Particle_Size_Water_Mean(ij+int(modisIN%notSunlit(:))-1) = R_UNDEF |
---|
| 1097 | if (associated(cospOUT%modis_Cloud_Particle_Size_Ice_Mean)) & |
---|
| 1098 | cospOUT%modis_Cloud_Particle_Size_Ice_Mean(ij+int(modisIN%notSunlit(:))-1) = R_UNDEF |
---|
| 1099 | if (associated(cospOUT%modis_Cloud_Top_Pressure_Total_Mean)) & |
---|
| 1100 | cospOUT%modis_Cloud_Top_Pressure_Total_Mean(ij+int(modisIN%notSunlit(:))-1) = R_UNDEF |
---|
| 1101 | if (associated(cospOUT%modis_Liquid_Water_Path_Mean)) & |
---|
| 1102 | cospOUT%modis_Liquid_Water_Path_Mean(ij+int(modisIN%notSunlit(:))-1) = R_UNDEF |
---|
| 1103 | if (associated(cospOUT%modis_Ice_Water_Path_Mean)) & |
---|
| 1104 | cospOUT%modis_Ice_Water_Path_Mean(ij+int(modisIN%notSunlit(:))-1) = R_UNDEF |
---|
| 1105 | if (associated(cospOUT%modis_Optical_Thickness_vs_Cloud_Top_Pressure)) & |
---|
| 1106 | cospOUT%modis_Optical_Thickness_vs_Cloud_Top_Pressure(ij+int(modisIN%notSunlit(:))-1, :, :) = R_UNDEF |
---|
| 1107 | end if |
---|
| 1108 | else |
---|
| 1109 | ! It's nightime everywhere - everything is undefined |
---|
| 1110 | if (associated(cospOUT%modis_Cloud_Fraction_Total_Mean)) & |
---|
| 1111 | cospOUT%modis_Cloud_Fraction_Total_Mean(ij:ik) = R_UNDEF |
---|
| 1112 | if (associated(cospOUT%modis_Cloud_Fraction_Water_Mean)) & |
---|
| 1113 | cospOUT%modis_Cloud_Fraction_Water_Mean(ij:ik) = R_UNDEF |
---|
| 1114 | if (associated(cospOUT%modis_Cloud_Fraction_Ice_Mean)) & |
---|
| 1115 | cospOUT%modis_Cloud_Fraction_Ice_Mean(ij:ik) = R_UNDEF |
---|
| 1116 | if (associated(cospOUT%modis_Cloud_Fraction_High_Mean)) & |
---|
| 1117 | cospOUT%modis_Cloud_Fraction_High_Mean(ij:ik) = R_UNDEF |
---|
| 1118 | if (associated(cospOUT%modis_Cloud_Fraction_Mid_Mean)) & |
---|
| 1119 | cospOUT%modis_Cloud_Fraction_Mid_Mean(ij:ik) = R_UNDEF |
---|
| 1120 | if (associated(cospOUT%modis_Cloud_Fraction_Low_Mean)) & |
---|
| 1121 | cospOUT%modis_Cloud_Fraction_Low_Mean(ij:ik) = R_UNDEF |
---|
| 1122 | if (associated(cospOUT%modis_Optical_Thickness_Total_Mean)) & |
---|
| 1123 | cospOUT%modis_Optical_Thickness_Total_Mean(ij:ik) = R_UNDEF |
---|
| 1124 | if (associated(cospOUT%modis_Optical_Thickness_Water_Mean)) & |
---|
| 1125 | cospOUT%modis_Optical_Thickness_Water_Mean(ij:ik) = R_UNDEF |
---|
| 1126 | if (associated(cospOUT%modis_Optical_Thickness_Ice_Mean)) & |
---|
| 1127 | cospOUT%modis_Optical_Thickness_Ice_Mean(ij:ik) = R_UNDEF |
---|
| 1128 | if (associated(cospOUT%modis_Optical_Thickness_Total_LogMean)) & |
---|
| 1129 | cospOUT%modis_Optical_Thickness_Total_LogMean(ij:ik) = R_UNDEF |
---|
| 1130 | if (associated(cospOUT%modis_Optical_Thickness_Water_LogMean)) & |
---|
| 1131 | cospOUT%modis_Optical_Thickness_Water_LogMean(ij:ik) = R_UNDEF |
---|
| 1132 | if (associated(cospOUT%modis_Optical_Thickness_Ice_LogMean)) & |
---|
| 1133 | cospOUT%modis_Optical_Thickness_Ice_LogMean(ij:ik) = R_UNDEF |
---|
| 1134 | if (associated(cospOUT%modis_Cloud_Particle_Size_Water_Mean)) & |
---|
| 1135 | cospOUT%modis_Cloud_Particle_Size_Water_Mean(ij:ik) = R_UNDEF |
---|
| 1136 | if (associated(cospOUT%modis_Cloud_Particle_Size_Ice_Mean)) & |
---|
| 1137 | cospOUT%modis_Cloud_Particle_Size_Ice_Mean(ij:ik) = R_UNDEF |
---|
| 1138 | if (associated(cospOUT%modis_Cloud_Top_Pressure_Total_Mean)) & |
---|
| 1139 | cospOUT%modis_Cloud_Top_Pressure_Total_Mean(ij:ik) = R_UNDEF |
---|
| 1140 | if (associated(cospOUT%modis_Liquid_Water_Path_Mean)) & |
---|
| 1141 | cospOUT%modis_Liquid_Water_Path_Mean(ij:ik) = R_UNDEF |
---|
| 1142 | if (associated(cospOUT%modis_Ice_Water_Path_Mean)) & |
---|
| 1143 | cospOUT%modis_Ice_Water_Path_Mean(ij:ik) = R_UNDEF |
---|
| 1144 | if (associated(cospOUT%modis_Optical_Thickness_vs_Cloud_Top_Pressure)) & |
---|
| 1145 | cospOUT%modis_Optical_Thickness_vs_Cloud_Top_Pressure(ij:ik, :, :) = R_UNDEF |
---|
| 1146 | endif |
---|
| 1147 | ! Free up memory (if necessary) |
---|
| 1148 | if (allocated(modisRetrievedTau)) deallocate(modisRetrievedTau) |
---|
| 1149 | if (allocated(modisRetrievedSize)) deallocate(modisRetrievedSize) |
---|
| 1150 | if (allocated(modisRetrievedPhase)) deallocate(modisRetrievedPhase) |
---|
| 1151 | if (allocated(modisRetrievedCloudTopPressure)) deallocate(modisRetrievedCloudTopPressure) |
---|
| 1152 | if (allocated(modisCftotal)) deallocate(modisCftotal) |
---|
| 1153 | if (allocated(modisCfLiquid)) deallocate(modisCfLiquid) |
---|
| 1154 | if (allocated(modisCfIce)) deallocate(modisCfIce) |
---|
| 1155 | if (allocated(modisCfHigh)) deallocate(modisCfHigh) |
---|
| 1156 | if (allocated(modisCfMid)) deallocate(modisCfMid) |
---|
| 1157 | if (allocated(modisCfLow)) deallocate(modisCfLow) |
---|
| 1158 | if (allocated(modisMeanTauTotal)) deallocate(modisMeanTauTotal) |
---|
| 1159 | if (allocated(modisMeanTauLiquid)) deallocate(modisMeanTauLiquid) |
---|
| 1160 | if (allocated(modisMeanTauIce)) deallocate(modisMeanTauIce) |
---|
| 1161 | if (allocated(modisMeanLogTauTotal)) deallocate(modisMeanLogTauTotal) |
---|
| 1162 | if (allocated(modisMeanLogTauLiquid)) deallocate(modisMeanLogTauLiquid) |
---|
| 1163 | if (allocated(modisMeanLogTauIce)) deallocate(modisMeanLogTauIce) |
---|
| 1164 | if (allocated(modisMeanSizeLiquid)) deallocate(modisMeanSizeLiquid) |
---|
| 1165 | if (allocated(modisMeanSizeIce)) deallocate(modisMeanSizeIce) |
---|
| 1166 | if (allocated(modisMeanCloudTopPressure)) deallocate(modisMeanCloudTopPressure) |
---|
| 1167 | if (allocated(modisMeanLiquidWaterPath)) deallocate(modisMeanLiquidWaterPath) |
---|
| 1168 | if (allocated(modisMeanIceWaterPath)) deallocate(modisMeanIceWaterPath) |
---|
| 1169 | if (allocated(modisJointHistogram)) deallocate(modisJointHistogram) |
---|
| 1170 | if (allocated(modisJointHistogramIce)) deallocate(modisJointHistogramIce) |
---|
| 1171 | if (allocated(modisJointHistogramLiq)) deallocate(modisJointHistogramLiq) |
---|
| 1172 | if (allocated(isccp_boxttop)) deallocate(isccp_boxttop) |
---|
| 1173 | if (allocated(isccp_boxptop)) deallocate(isccp_boxptop) |
---|
| 1174 | if (allocated(isccp_boxtau)) deallocate(isccp_boxtau) |
---|
| 1175 | if (allocated(isccp_meantbclr)) deallocate(isccp_meantbclr) |
---|
| 1176 | if (allocated(isccpLEVMATCH)) deallocate(isccpLEVMATCH) |
---|
| 1177 | endif |
---|
| 1178 | |
---|
| 1179 | ! RTTOV |
---|
| 1180 | ! if (lrttov_column) then |
---|
| 1181 | ! call rttov_column(rttovIN%nPoints,rttovIN%nLevels,rttovIN%nSubCols,rttovIN%q, & |
---|
| 1182 | ! rttovIN%p,rttovIN%t,rttovIN%o3,rttovIN%ph,rttovIN%h_surf, & |
---|
| 1183 | ! rttovIN%u_surf,rttovIN%v_surf,rttovIN%p_surf,rttovIN%t_skin, & |
---|
| 1184 | ! rttovIN%t2m,rttovIN%q2m,rttovIN%lsmask,rttovIN%longitude, & |
---|
| 1185 | ! rttovIN%latitude,rttovIN%seaice,rttovIN%co2,rttovIN%ch4, & |
---|
| 1186 | ! rttovIN%n2o,rttovIN%co,rttovIN%zenang,lrttov_cleanUp, & |
---|
| 1187 | ! cospOUT%rttov_tbs(ij:ik,:),cosp_simulator(nError+1), & |
---|
| 1188 | ! ! Optional arguments for surface emissivity calculation |
---|
| 1189 | ! month=rttovIN%month) |
---|
| 1190 | ! ! Optional arguments to rttov for all-sky calculation |
---|
| 1191 | ! ! rttovIN%month, rttovIN%tca,rttovIN%cldIce,rttovIN%cldLiq, & |
---|
| 1192 | ! ! rttovIN%fl_rain,rttovIN%fl_snow) |
---|
| 1193 | ! endif |
---|
| 1194 | |
---|
| 1195 | !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
---|
| 1196 | ! 6) Compute multi-instrument products |
---|
| 1197 | !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
---|
| 1198 | |
---|
| 1199 | ! CLOUDSAT/CALIPSO products |
---|
| 1200 | if (Lradar_lidar_tcc .or. Llidar_only_freq_cloud) then |
---|
| 1201 | |
---|
| 1202 | if (use_vgrid) then |
---|
| 1203 | allocate(lidar_only_freq_cloud(cloudsatIN%Npoints,Nlvgrid), & |
---|
| 1204 | radar_lidar_tcc(cloudsatIN%Npoints)) |
---|
| 1205 | allocate(betamol_in(cloudsatIN%Npoints,1,cloudsatIN%Nlevels), & |
---|
| 1206 | betamolFlip(cloudsatIN%Npoints,1,Nlvgrid), & |
---|
| 1207 | pnormFlip(cloudsatIN%Npoints,cloudsatIN%Ncolumns,Nlvgrid), & |
---|
| 1208 | Ze_totFlip(cloudsatIN%Npoints,cloudsatIN%Ncolumns,Nlvgrid)) |
---|
| 1209 | |
---|
| 1210 | betamol_in(:,1,:) = calipso_beta_mol(:,cloudsatIN%Nlevels:1:-1) |
---|
| 1211 | call cosp_change_vertical_grid(cloudsatIN%Npoints,1,cloudsatIN%Nlevels, & |
---|
| 1212 | cospgridIN%hgt_matrix(:,cloudsatIN%Nlevels:1:-1), & |
---|
| 1213 | cospgridIN%hgt_matrix_half(:,cloudsatIN%Nlevels:1:-1),betamol_in, & |
---|
| 1214 | Nlvgrid,vgrid_zl(Nlvgrid:1:-1),vgrid_zu(Nlvgrid:1:-1), & |
---|
| 1215 | betamolFlip(:,1,Nlvgrid:1:-1)) |
---|
| 1216 | |
---|
| 1217 | call cosp_change_vertical_grid(cloudsatIN%Npoints,cloudsatIN%Ncolumns, & |
---|
| 1218 | cloudsatIN%Nlevels,cospgridIN%hgt_matrix(:,cloudsatIN%Nlevels:1:-1), & |
---|
| 1219 | cospgridIN%hgt_matrix_half(:,cloudsatIN%Nlevels:1:-1), & |
---|
| 1220 | calipso_beta_tot(:,:,cloudsatIN%Nlevels:1:-1),Nlvgrid, & |
---|
| 1221 | vgrid_zl(Nlvgrid:1:-1),vgrid_zu(Nlvgrid:1:-1),pnormFlip(:,:,Nlvgrid:1:-1)) |
---|
| 1222 | |
---|
| 1223 | call cosp_change_vertical_grid(cloudsatIN%Npoints,cloudsatIN%Ncolumns, & |
---|
| 1224 | cloudsatIN%Nlevels,cospgridIN%hgt_matrix(:,cloudsatIN%Nlevels:1:-1), & |
---|
| 1225 | cospgridIN%hgt_matrix_half(:,cloudsatIN%Nlevels:1:-1), & |
---|
| 1226 | cloudsatDBZe(:,:,cloudsatIN%Nlevels:1:-1),Nlvgrid,vgrid_zl(Nlvgrid:1:-1), & |
---|
| 1227 | vgrid_zu(Nlvgrid:1:-1),Ze_totFlip(:,:,Nlvgrid:1:-1),log_units=.true.) |
---|
| 1228 | |
---|
| 1229 | call cosp_lidar_only_cloud(cloudsatIN%Npoints,cloudsatIN%Ncolumns, & |
---|
| 1230 | Nlvgrid,pnormFlip,betamolFlip,Ze_totFlip, & |
---|
| 1231 | lidar_only_freq_cloud,radar_lidar_tcc) |
---|
| 1232 | |
---|
| 1233 | deallocate(betamol_in,betamolFlip,pnormFlip,ze_totFlip) |
---|
| 1234 | else |
---|
| 1235 | allocate(lidar_only_freq_cloud(cloudsatIN%Npoints,cloudsatIN%Nlevels), & |
---|
| 1236 | radar_lidar_tcc(cloudsatIN%Npoints)) |
---|
| 1237 | call cosp_lidar_only_cloud(cloudsatIN%Npoints,cloudsatIN%Ncolumns, & |
---|
| 1238 | cospIN%Nlevels,calipso_beta_tot(:,:,cloudsatIN%Nlevels:1:-1), & |
---|
| 1239 | calipso_beta_mol(:,cloudsatIN%Nlevels:1:-1), & |
---|
| 1240 | cloudsatDBZe(:,:,cloudsatIN%Nlevels:1:-1),lidar_only_freq_cloud, & |
---|
| 1241 | radar_lidar_tcc) |
---|
| 1242 | endif |
---|
| 1243 | |
---|
| 1244 | ! Store, when necessary |
---|
| 1245 | if (associated(cospOUT%lidar_only_freq_cloud)) then |
---|
| 1246 | cospOUT%lidar_only_freq_cloud(ij:ik,:) = lidar_only_freq_cloud |
---|
| 1247 | endif |
---|
| 1248 | if (associated(cospOUT%radar_lidar_tcc)) then |
---|
| 1249 | cospOUT%radar_lidar_tcc(ij:ik) = radar_lidar_tcc |
---|
| 1250 | endif |
---|
| 1251 | |
---|
| 1252 | endif |
---|
| 1253 | |
---|
| 1254 | !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
---|
| 1255 | ! 7) Cleanup |
---|
| 1256 | !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
---|
| 1257 | if (Lisccp_subcolumn .or. Lmodis_subcolumn) then |
---|
| 1258 | nullify(isccpIN%Npoints,isccpIN%Ncolumns,isccpIN%Nlevels,isccpIN%emsfc_lw, & |
---|
| 1259 | isccpIN%skt,isccpIN%qv,isccpIN%at,isccpIN%frac_out,isccpIN%dtau, & |
---|
| 1260 | isccpIN%dem,isccpIN%phalf,isccpIN%sunlit,isccpIN%pfull) |
---|
| 1261 | endif |
---|
| 1262 | |
---|
| 1263 | if (Lmisr_subcolumn) then |
---|
| 1264 | nullify(misrIN%Npoints,misrIN%Ncolumns,misrIN%Nlevels,misrIN%dtau,misrIN%sunlit, & |
---|
| 1265 | misrIN%zfull,misrIN%at) |
---|
| 1266 | endif |
---|
| 1267 | |
---|
| 1268 | if (Lcalipso_subcolumn) then |
---|
| 1269 | nullify(calipsoIN%Npoints,calipsoIN%Ncolumns,calipsoIN%Nlevels,calipsoIN%beta_mol,& |
---|
| 1270 | calipsoIN%betatot,calipsoIN%betatot_liq,calipsoIN%betatot_ice, & |
---|
| 1271 | calipsoIN%tau_mol,calipsoIN%tautot,calipsoIN%tautot_liq,calipsoIN%tautot_ice) |
---|
| 1272 | endif |
---|
| 1273 | |
---|
| 1274 | if (Lparasol_subcolumn) then |
---|
| 1275 | nullify(parasolIN%Npoints,parasolIN%Nlevels,parasolIN%Ncolumns,parasolIN%Nrefl, & |
---|
| 1276 | parasolIN%tautot_S_liq,parasolIN%tautot_S_ice) |
---|
| 1277 | endif |
---|
| 1278 | |
---|
| 1279 | if (Lcloudsat_subcolumn) then |
---|
| 1280 | nullify(cloudsatIN%Npoints,cloudsatIN%Nlevels,cloudsatIN%Ncolumns,cloudsatIN%rcfg,& |
---|
| 1281 | cloudsatIN%kr_vol,cloudsatIN%g_vol,cloudsatIN%z_vol,cloudsatIN%hgt_matrix) |
---|
| 1282 | endif |
---|
| 1283 | |
---|
| 1284 | if (Lmodis_subcolumn) then |
---|
| 1285 | nullify(modisIN%Npoints,modisIN%Ncolumns,modisIN%Nlevels,modisIN%tau,modisIN%g, & |
---|
| 1286 | modisIN%liqFrac,modisIN%w0) |
---|
| 1287 | if (allocated(modisIN%sunlit)) deallocate(modisIN%sunlit) |
---|
| 1288 | if (allocated(modisIN%notSunlit)) deallocate(modisIN%notSunlit) |
---|
| 1289 | if (allocated(modisIN%pres)) deallocate(modisIN%pres) |
---|
| 1290 | endif |
---|
| 1291 | |
---|
| 1292 | if (allocated(calipso_beta_tot)) deallocate(calipso_beta_tot) |
---|
| 1293 | if (allocated(calipso_beta_mol)) deallocate(calipso_beta_mol) |
---|
| 1294 | if (allocated(calipso_betaperp_tot)) deallocate(calipso_betaperp_tot) |
---|
| 1295 | if (allocated(cloudsatDBZe)) deallocate(cloudsatDBZe) |
---|
| 1296 | if (allocated(lidar_only_freq_cloud)) deallocate(lidar_only_freq_cloud) |
---|
| 1297 | if (allocated(radar_lidar_tcc)) deallocate(radar_lidar_tcc) |
---|
| 1298 | |
---|
| 1299 | end function COSP_SIMULATOR |
---|
| 1300 | ! ###################################################################################### |
---|
| 1301 | ! SUBROUTINE cosp_init |
---|
| 1302 | ! ###################################################################################### |
---|
| 1303 | SUBROUTINE COSP_INIT(Lisccp,Lmodis,Lmisr,Lcloudsat,Lcalipso,Lparasol,Lrttov, & |
---|
| 1304 | Npoints,Nlevels,cloudsat_radar_freq,cloudsat_k2, & |
---|
| 1305 | cloudsat_use_gas_abs,cloudsat_do_ray,isccp_top_height, & |
---|
| 1306 | isccp_top_height_direction,surface_radar,rcfg,rttov_Nchannels, & |
---|
| 1307 | rttov_Channels,rttov_platform,rttov_satellite,rttov_instrument, & |
---|
| 1308 | lusevgrid,luseCSATvgrid,Nvgrid,cloudsat_micro_scheme,cospOUT) |
---|
| 1309 | |
---|
| 1310 | ! INPUTS |
---|
| 1311 | logical,intent(in) :: Lisccp,Lmodis,Lmisr,Lcloudsat,Lcalipso,Lparasol,Lrttov |
---|
| 1312 | integer,intent(in) :: & |
---|
| 1313 | cloudsat_use_gas_abs, & ! |
---|
| 1314 | cloudsat_do_ray, & ! |
---|
| 1315 | isccp_top_height, & ! |
---|
| 1316 | isccp_top_height_direction, & ! |
---|
| 1317 | Npoints, & ! |
---|
| 1318 | Nlevels, & ! |
---|
| 1319 | Nvgrid, & ! Number of levels for new L3 grid |
---|
| 1320 | surface_radar, & ! |
---|
| 1321 | rttov_Nchannels, & ! Number of RTTOV channels |
---|
| 1322 | rttov_platform, & ! RTTOV platform |
---|
| 1323 | rttov_satellite, & ! RTTOV satellite |
---|
| 1324 | rttov_instrument ! RTTOV instrument |
---|
| 1325 | integer,intent(in),dimension(RTTOV_MAX_CHANNELS) :: & |
---|
| 1326 | rttov_channels ! RTTOV channels |
---|
| 1327 | real(wp),intent(in) :: & |
---|
| 1328 | cloudsat_radar_freq, & ! |
---|
| 1329 | cloudsat_k2 ! |
---|
| 1330 | logical,intent(in) :: & |
---|
| 1331 | lusevgrid, & ! Switch to use different vertical grid |
---|
| 1332 | luseCSATvgrid ! Switch to use CLOUDSAT grid spacing for new |
---|
| 1333 | ! vertical grid |
---|
| 1334 | character(len=64),intent(in) :: & |
---|
| 1335 | cloudsat_micro_scheme ! Microphysical scheme used by CLOUDSAT |
---|
| 1336 | type(cosp_outputs),intent(inout) :: cospOUT |
---|
| 1337 | |
---|
| 1338 | ! OUTPUTS |
---|
| 1339 | type(radar_cfg) :: rcfg |
---|
| 1340 | |
---|
| 1341 | ! Local variables |
---|
| 1342 | integer :: i |
---|
| 1343 | real(wp) :: zstep |
---|
| 1344 | |
---|
| 1345 | ! Initialize MODIS optical-depth bin boundaries for joint-histogram. (defined in cosp_config.F90) |
---|
| 1346 | if (.not. allocated(modis_histTau)) then |
---|
| 1347 | allocate(modis_histTau(ntau+1),modis_histTauEdges(2,ntau),modis_histTauCenters(ntau)) |
---|
| 1348 | numMODISTauBins = ntau |
---|
| 1349 | modis_histTau = tau_binBounds |
---|
| 1350 | modis_histTauEdges = tau_binEdges |
---|
| 1351 | modis_histTauCenters = tau_binCenters |
---|
| 1352 | endif |
---|
| 1353 | |
---|
| 1354 | ! Set up vertical grid used by CALIPSO and CLOUDSAT L3 |
---|
| 1355 | use_vgrid = lusevgrid |
---|
| 1356 | |
---|
| 1357 | if (use_vgrid) then |
---|
| 1358 | Nlvgrid = Nvgrid |
---|
[3372] | 1359 | if (.not. allocated(vgrid_zl)) allocate(vgrid_zl(Nlvgrid)) |
---|
| 1360 | if (.not. allocated(vgrid_zu)) allocate(vgrid_zu(Nlvgrid)) |
---|
| 1361 | if (.not. allocated(vgrid_z)) allocate(vgrid_z(Nlvgrid)) |
---|
| 1362 | |
---|
[3358] | 1363 | print*,'allocation vgrid_zl zu z dans COSP_INIT' |
---|
[3372] | 1364 | ! allocate(vgrid_zl(Nlvgrid),vgrid_zu(Nlvgrid),vgrid_z(Nlvgrid)) |
---|
[3358] | 1365 | ! CloudSat grid requested |
---|
| 1366 | if (luseCSATvgrid) zstep = 480._wp |
---|
| 1367 | ! Other grid requested. Constant vertical spacing with top at 20 km |
---|
| 1368 | if (.not. luseCSATvgrid) zstep = 20000._wp/Nvgrid |
---|
| 1369 | do i=1,Nvgrid |
---|
| 1370 | vgrid_zl(Nlvgrid-i+1) = (i-1)*zstep |
---|
| 1371 | vgrid_zu(Nlvgrid-i+1) = i*zstep |
---|
| 1372 | enddo |
---|
| 1373 | vgrid_z = (vgrid_zl+vgrid_zu)/2._wp |
---|
| 1374 | else |
---|
| 1375 | Nlvgrid = Nlevels |
---|
[3372] | 1376 | if (.not. allocated(vgrid_zl)) allocate(vgrid_zl(Nlvgrid)) |
---|
| 1377 | if (.not. allocated(vgrid_zu)) allocate(vgrid_zu(Nlvgrid)) |
---|
| 1378 | if (.not. allocated(vgrid_z)) allocate(vgrid_z(Nlvgrid)) |
---|
[3358] | 1379 | endif |
---|
| 1380 | |
---|
| 1381 | ! Initialize simulators |
---|
| 1382 | if (Lisccp) call cosp_isccp_init(isccp_top_height,isccp_top_height_direction) |
---|
| 1383 | if (Lmodis) call cosp_modis_init() |
---|
| 1384 | if (Lmisr) call cosp_misr_init() |
---|
| 1385 | !if (Lrttov) call cosp_rttov_init(rttov_Nchannels,rttov_platform,rttov_satellite, & |
---|
| 1386 | ! rttov_instrument,rttov_channels) |
---|
| 1387 | ! if (Lrttov) call cosp_rttov_init() |
---|
| 1388 | if (Lcloudsat) call cosp_cloudsat_init(cloudsat_radar_freq,cloudsat_k2, & |
---|
| 1389 | cloudsat_use_gas_abs,cloudsat_do_ray,R_UNDEF,N_HYDRO, surface_radar, & |
---|
| 1390 | rcfg,cloudsat_micro_scheme) |
---|
| 1391 | if (Lcalipso) call cosp_calipso_init() |
---|
| 1392 | if (Lparasol) call cosp_parasol_init() |
---|
| 1393 | |
---|
| 1394 | linitialization = .FALSE. |
---|
| 1395 | END SUBROUTINE COSP_INIT |
---|
| 1396 | |
---|
| 1397 | !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
---|
| 1398 | ! SUBROUTINE cosp_cleanUp |
---|
| 1399 | !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
---|
| 1400 | subroutine cosp_cleanUp() |
---|
[3372] | 1401 | if (allocated(vgrid_zl)) deallocate(vgrid_zl) |
---|
| 1402 | if (allocated(vgrid_zu)) deallocate(vgrid_zu) |
---|
| 1403 | if (allocated(vgrid_z)) deallocate(vgrid_z) |
---|
[3358] | 1404 | end subroutine cosp_cleanUp |
---|
| 1405 | |
---|
| 1406 | !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
---|
| 1407 | ! SUBROUTINE cosp_errorCheck |
---|
| 1408 | !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
---|
| 1409 | subroutine cosp_errorCheck(cospgridIN,cospIN,Lisccp_subcolumn,Lisccp_column,Lmisr_subcolumn,Lmisr_column, & |
---|
| 1410 | Lmodis_subcolumn,Lmodis_column,Lcloudsat_subcolumn,Lcloudsat_column,Lcalipso_subcolumn, & |
---|
| 1411 | Lcalipso_column,Lrttov_subcolumn,Lrttov_column,Lparasol_subcolumn,Lparasol_column, & |
---|
| 1412 | Lradar_lidar_tcc,Llidar_only_freq_cloud,cospOUT,errorMessage,nError) |
---|
| 1413 | ! Inputs |
---|
| 1414 | type(cosp_column_inputs),intent(in) :: & |
---|
| 1415 | cospgridIN ! Model grid inputs to COSP |
---|
| 1416 | type(cosp_optical_inputs),intent(in) :: & |
---|
| 1417 | cospIN ! Derived (optical) input to COSP |
---|
| 1418 | |
---|
| 1419 | ! Outputs |
---|
| 1420 | logical,intent(inout) :: & |
---|
| 1421 | Lisccp_subcolumn, & ! ISCCP subcolumn simulator on/off switch |
---|
| 1422 | Lisccp_column, & ! ISCCP column simulator on/off switch |
---|
| 1423 | Lmisr_subcolumn, & ! MISR subcolumn simulator on/off switch |
---|
| 1424 | Lmisr_column, & ! MISR column simulator on/off switch |
---|
| 1425 | Lmodis_subcolumn, & ! MODIS subcolumn simulator on/off switch |
---|
| 1426 | Lmodis_column, & ! MODIS column simulator on/off switch |
---|
| 1427 | Lcloudsat_subcolumn, & ! CLOUDSAT subcolumn simulator on/off switch |
---|
| 1428 | Lcloudsat_column, & ! CLOUDSAT column simulator on/off switch |
---|
| 1429 | Lcalipso_subcolumn, & ! CALIPSO subcolumn simulator on/off switch |
---|
| 1430 | Lcalipso_column, & ! CALIPSO column simulator on/off switch |
---|
| 1431 | Lparasol_subcolumn, & ! PARASOL subcolumn simulator on/off switch |
---|
| 1432 | Lparasol_column, & ! PARASOL column simulator on/off switch |
---|
| 1433 | Lrttov_subcolumn, & ! RTTOV subcolumn simulator on/off switch |
---|
| 1434 | Lrttov_column, & ! RTTOV column simulator on/off switch |
---|
| 1435 | Lradar_lidar_tcc, & ! On/Off switch for joint Calipso/Cloudsat product |
---|
| 1436 | Llidar_only_freq_cloud ! On/Off switch for joint Calipso/Cloudsat product |
---|
| 1437 | type(cosp_outputs),intent(inout) :: & |
---|
| 1438 | cospOUT ! COSP Outputs |
---|
| 1439 | character(len=256),dimension(100) :: errorMessage |
---|
| 1440 | integer,intent(out) :: nError |
---|
| 1441 | |
---|
| 1442 | ! Local variables |
---|
| 1443 | character(len=100) :: parasolErrorMessage |
---|
| 1444 | |
---|
| 1445 | nError = 0 |
---|
| 1446 | !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
---|
| 1447 | ! PART 1: Check input array values for out-of-bounds values. When an out-of-bound value |
---|
| 1448 | ! is encountered, COSP outputs that are dependent on that input are filled with |
---|
| 1449 | ! an undefined value (set in cosp_config.f90) and if necessary, that simulator |
---|
| 1450 | ! is turned off. |
---|
| 1451 | !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
---|
| 1452 | if (any(cospgridIN%sunlit .lt. 0)) then |
---|
| 1453 | nError=nError+1 |
---|
| 1454 | errorMessage(nError) = 'ERROR: COSP input variable: cospgridIN%sunlit contains values out of range (0 or 1)' |
---|
| 1455 | Lisccp_subcolumn = .false. |
---|
| 1456 | Lisccp_column = .false. |
---|
| 1457 | Lmisr_subcolumn = .false. |
---|
| 1458 | Lmisr_column = .false. |
---|
| 1459 | Lmodis_subcolumn = .false. |
---|
| 1460 | Lmodis_column = .false. |
---|
| 1461 | if (associated(cospOUT%isccp_totalcldarea)) cospOUT%isccp_totalcldarea(:) = R_UNDEF |
---|
| 1462 | if (associated(cospOUT%isccp_meantb)) cospOUT%isccp_meantb(:) = R_UNDEF |
---|
| 1463 | if (associated(cospOUT%isccp_meantbclr)) cospOUT%isccp_meantbclr(:) = R_UNDEF |
---|
| 1464 | if (associated(cospOUT%isccp_meanptop)) cospOUT%isccp_meanptop(:) = R_UNDEF |
---|
| 1465 | if (associated(cospOUT%isccp_meantaucld)) cospOUT%isccp_meantaucld(:) = R_UNDEF |
---|
| 1466 | if (associated(cospOUT%isccp_meanalbedocld)) cospOUT%isccp_meanalbedocld(:) = R_UNDEF |
---|
| 1467 | if (associated(cospOUT%isccp_boxtau)) cospOUT%isccp_boxtau(:,:) = R_UNDEF |
---|
| 1468 | if (associated(cospOUT%isccp_boxptop)) cospOUT%isccp_boxptop(:,:) = R_UNDEF |
---|
| 1469 | if (associated(cospOUT%isccp_fq)) cospOUT%isccp_fq(:,:,:) = R_UNDEF |
---|
| 1470 | if (associated(cospOUT%misr_fq)) cospOUT%misr_fq(:,:,:) = R_UNDEF |
---|
| 1471 | if (associated(cospOUT%misr_dist_model_layertops)) cospOUT%misr_dist_model_layertops(:,:) = R_UNDEF |
---|
| 1472 | if (associated(cospOUT%misr_meanztop)) cospOUT%misr_meanztop(:) = R_UNDEF |
---|
| 1473 | if (associated(cospOUT%misr_cldarea)) cospOUT%misr_cldarea(:) = R_UNDEF |
---|
| 1474 | if (associated(cospOUT%modis_Cloud_Fraction_Total_Mean)) & |
---|
| 1475 | cospOUT%modis_Cloud_Fraction_Total_Mean(:) = R_UNDEF |
---|
| 1476 | if (associated(cospOUT%modis_Cloud_Fraction_Water_Mean)) & |
---|
| 1477 | cospOUT%modis_Cloud_Fraction_Water_Mean(:) = R_UNDEF |
---|
| 1478 | if (associated(cospOUT%modis_Cloud_Fraction_Ice_Mean)) & |
---|
| 1479 | cospOUT%modis_Cloud_Fraction_Ice_Mean(:) = R_UNDEF |
---|
| 1480 | if (associated(cospOUT%modis_Cloud_Fraction_High_Mean)) & |
---|
| 1481 | cospOUT%modis_Cloud_Fraction_High_Mean(:) = R_UNDEF |
---|
| 1482 | if (associated(cospOUT%modis_Cloud_Fraction_Mid_Mean)) & |
---|
| 1483 | cospOUT%modis_Cloud_Fraction_Mid_Mean(:) = R_UNDEF |
---|
| 1484 | if (associated(cospOUT%modis_Cloud_Fraction_Low_Mean)) & |
---|
| 1485 | cospOUT%modis_Cloud_Fraction_Low_Mean(:) = R_UNDEF |
---|
| 1486 | if (associated(cospOUT%modis_Optical_Thickness_Total_Mean)) & |
---|
| 1487 | cospOUT%modis_Optical_Thickness_Total_Mean(:) = R_UNDEF |
---|
| 1488 | if (associated(cospOUT%modis_Optical_Thickness_Water_Mean)) & |
---|
| 1489 | cospOUT%modis_Optical_Thickness_Water_Mean(:) = R_UNDEF |
---|
| 1490 | if (associated(cospOUT%modis_Optical_Thickness_Ice_Mean)) & |
---|
| 1491 | cospOUT%modis_Optical_Thickness_Ice_Mean(:) = R_UNDEF |
---|
| 1492 | if (associated(cospOUT%modis_Optical_Thickness_Total_LogMean)) & |
---|
| 1493 | cospOUT%modis_Optical_Thickness_Total_LogMean(:) = R_UNDEF |
---|
| 1494 | if (associated(cospOUT%modis_Optical_Thickness_Water_LogMean)) & |
---|
| 1495 | cospOUT%modis_Optical_Thickness_Water_LogMean(:) = R_UNDEF |
---|
| 1496 | if (associated(cospOUT%modis_Optical_Thickness_Ice_LogMean)) & |
---|
| 1497 | cospOUT%modis_Optical_Thickness_Ice_LogMean(:) = R_UNDEF |
---|
| 1498 | if (associated(cospOUT%modis_Cloud_Particle_Size_Water_Mean)) & |
---|
| 1499 | cospOUT%modis_Cloud_Particle_Size_Water_Mean(:) = R_UNDEF |
---|
| 1500 | if (associated(cospOUT%modis_Cloud_Particle_Size_Ice_Mean)) & |
---|
| 1501 | cospOUT%modis_Cloud_Particle_Size_Ice_Mean(:) = R_UNDEF |
---|
| 1502 | if (associated(cospOUT%modis_Cloud_Top_Pressure_Total_Mean)) & |
---|
| 1503 | cospOUT%modis_Cloud_Top_Pressure_Total_Mean(:) = R_UNDEF |
---|
| 1504 | if (associated(cospOUT%modis_Liquid_Water_Path_Mean)) & |
---|
| 1505 | cospOUT%modis_Liquid_Water_Path_Mean(:) = R_UNDEF |
---|
| 1506 | if (associated(cospOUT%modis_Ice_Water_Path_Mean)) & |
---|
| 1507 | cospOUT%modis_Ice_Water_Path_Mean(:) = R_UNDEF |
---|
| 1508 | if (associated(cospOUT%modis_Optical_Thickness_vs_Cloud_Top_Pressure)) & |
---|
| 1509 | cospOUT%modis_Optical_Thickness_vs_Cloud_Top_Pressure(:,:,:) = R_UNDEF |
---|
| 1510 | if (associated(cospOUT%modis_Optical_Thickness_vs_ReffICE)) & |
---|
| 1511 | cospOUT%modis_Optical_Thickness_vs_ReffICE(:,:,:) = R_UNDEF |
---|
| 1512 | if (associated(cospOUT%modis_Optical_Thickness_vs_ReffLIQ)) & |
---|
| 1513 | cospOUT%modis_Optical_Thickness_vs_ReffLIQ(:,:,:) = R_UNDEF |
---|
| 1514 | endif |
---|
| 1515 | if (any(cospgridIN%at .lt. 0)) then |
---|
| 1516 | nError=nError+1 |
---|
| 1517 | errorMessage(nError) = 'ERROR: COSP input variable: cospgridIN%at contains values out of range (at<0), expected units (K)' |
---|
| 1518 | Lisccp_subcolumn = .false. |
---|
| 1519 | Lisccp_column = .false. |
---|
| 1520 | Lmisr_subcolumn = .false. |
---|
| 1521 | Lmisr_column = .false. |
---|
| 1522 | Lrttov_subcolumn = .false. |
---|
| 1523 | Lcalipso_column = .false. |
---|
| 1524 | Lcloudsat_column = .false. |
---|
| 1525 | Lradar_lidar_tcc = .false. |
---|
| 1526 | Llidar_only_freq_cloud = .false. |
---|
| 1527 | if (associated(cospOUT%rttov_tbs)) cospOUT%rttov_tbs(:,:) = R_UNDEF |
---|
| 1528 | if (associated(cospOUT%isccp_totalcldarea)) cospOUT%isccp_totalcldarea(:) = R_UNDEF |
---|
| 1529 | if (associated(cospOUT%isccp_meantb)) cospOUT%isccp_meantb(:) = R_UNDEF |
---|
| 1530 | if (associated(cospOUT%isccp_meantbclr)) cospOUT%isccp_meantbclr(:) = R_UNDEF |
---|
| 1531 | if (associated(cospOUT%isccp_meanptop)) cospOUT%isccp_meanptop(:) = R_UNDEF |
---|
| 1532 | if (associated(cospOUT%isccp_meantaucld)) cospOUT%isccp_meantaucld(:) = R_UNDEF |
---|
| 1533 | if (associated(cospOUT%isccp_meanalbedocld)) cospOUT%isccp_meanalbedocld(:) = R_UNDEF |
---|
| 1534 | if (associated(cospOUT%isccp_boxtau)) cospOUT%isccp_boxtau(:,:) = R_UNDEF |
---|
| 1535 | if (associated(cospOUT%isccp_boxptop)) cospOUT%isccp_boxptop(:,:) = R_UNDEF |
---|
| 1536 | if (associated(cospOUT%isccp_fq)) cospOUT%isccp_fq(:,:,:) = R_UNDEF |
---|
| 1537 | if (associated(cospOUT%misr_fq)) cospOUT%misr_fq(:,:,:) = R_UNDEF |
---|
| 1538 | if (associated(cospOUT%misr_dist_model_layertops)) cospOUT%misr_dist_model_layertops(:,:) = R_UNDEF |
---|
| 1539 | if (associated(cospOUT%misr_meanztop)) cospOUT%misr_meanztop(:) = R_UNDEF |
---|
| 1540 | if (associated(cospOUT%misr_cldarea)) cospOUT%misr_cldarea(:) = R_UNDEF |
---|
| 1541 | if (associated(cospOUT%calipso_cfad_sr)) cospOUT%calipso_cfad_sr(:,:,:) = R_UNDEF |
---|
| 1542 | if (associated(cospOUT%calipso_lidarcld)) cospOUT%calipso_lidarcld(:,:) = R_UNDEF |
---|
| 1543 | if (associated(cospOUT%calipso_lidarcldphase)) cospOUT%calipso_lidarcldphase(:,:,:) = R_UNDEF |
---|
| 1544 | if (associated(cospOUT%calipso_cldlayer)) cospOUT%calipso_cldlayer(:,:) = R_UNDEF |
---|
| 1545 | if (associated(cospOUT%calipso_cldlayerphase)) cospOUT%calipso_cldlayerphase(:,:,:) = R_UNDEF |
---|
| 1546 | if (associated(cospOUT%calipso_lidarcldtmp)) cospOUT%calipso_lidarcldtmp(:,:,:) = R_UNDEF |
---|
| 1547 | if (associated(cospOUT%cloudsat_cfad_ze)) cospOUT%cloudsat_cfad_ze(:,:,:) = R_UNDEF |
---|
| 1548 | if (associated(cospOUT%lidar_only_freq_cloud)) cospOUT%lidar_only_freq_cloud(:,:) = R_UNDEF |
---|
| 1549 | if (associated(cospOUT%radar_lidar_tcc)) cospOUT%radar_lidar_tcc(:) = R_UNDEF |
---|
| 1550 | endif |
---|
| 1551 | if (any(cospgridIN%pfull .lt. 0)) then |
---|
| 1552 | nError=nError+1 |
---|
| 1553 | errorMessage(nError) = 'ERROR: COSP input variable: cospgridIN%pfull contains values out of range' |
---|
| 1554 | Lisccp_subcolumn = .false. |
---|
| 1555 | Lisccp_column = .false. |
---|
| 1556 | Lrttov_subcolumn = .false. |
---|
| 1557 | if (associated(cospOUT%rttov_tbs)) cospOUT%rttov_tbs(:,:) = R_UNDEF |
---|
| 1558 | if (associated(cospOUT%isccp_totalcldarea)) cospOUT%isccp_totalcldarea(:) = R_UNDEF |
---|
| 1559 | if (associated(cospOUT%isccp_meantb)) cospOUT%isccp_meantb(:) = R_UNDEF |
---|
| 1560 | if (associated(cospOUT%isccp_meantbclr)) cospOUT%isccp_meantbclr(:) = R_UNDEF |
---|
| 1561 | if (associated(cospOUT%isccp_meanptop)) cospOUT%isccp_meanptop(:) = R_UNDEF |
---|
| 1562 | if (associated(cospOUT%isccp_meantaucld)) cospOUT%isccp_meantaucld(:) = R_UNDEF |
---|
| 1563 | if (associated(cospOUT%isccp_meanalbedocld)) cospOUT%isccp_meanalbedocld(:) = R_UNDEF |
---|
| 1564 | if (associated(cospOUT%isccp_boxtau)) cospOUT%isccp_boxtau(:,:) = R_UNDEF |
---|
| 1565 | if (associated(cospOUT%isccp_boxptop)) cospOUT%isccp_boxptop(:,:) = R_UNDEF |
---|
| 1566 | if (associated(cospOUT%isccp_fq)) cospOUT%isccp_fq(:,:,:) = R_UNDEF |
---|
| 1567 | endif |
---|
| 1568 | if (any(cospgridIN%phalf .lt. 0)) then |
---|
| 1569 | nError=nError+1 |
---|
| 1570 | errorMessage(nError) = 'ERROR: COSP input variable: cospgridIN%phalf contains values out of range' |
---|
| 1571 | Lisccp_subcolumn = .false. |
---|
| 1572 | Lisccp_column = .false. |
---|
| 1573 | Lrttov_subcolumn = .false. |
---|
| 1574 | Lmodis_subcolumn = .false. |
---|
| 1575 | Lmodis_column = .false. |
---|
| 1576 | Lcalipso_column = .false. |
---|
| 1577 | if (associated(cospOUT%rttov_tbs)) cospOUT%rttov_tbs(:,:) = R_UNDEF |
---|
| 1578 | if (associated(cospOUT%isccp_totalcldarea)) cospOUT%isccp_totalcldarea(:) = R_UNDEF |
---|
| 1579 | if (associated(cospOUT%isccp_meantb)) cospOUT%isccp_meantb(:) = R_UNDEF |
---|
| 1580 | if (associated(cospOUT%isccp_meantbclr)) cospOUT%isccp_meantbclr(:) = R_UNDEF |
---|
| 1581 | if (associated(cospOUT%isccp_meanptop)) cospOUT%isccp_meanptop(:) = R_UNDEF |
---|
| 1582 | if (associated(cospOUT%isccp_meantaucld)) cospOUT%isccp_meantaucld(:) = R_UNDEF |
---|
| 1583 | if (associated(cospOUT%isccp_meanalbedocld)) cospOUT%isccp_meanalbedocld(:) = R_UNDEF |
---|
| 1584 | if (associated(cospOUT%isccp_boxtau)) cospOUT%isccp_boxtau(:,:) = R_UNDEF |
---|
| 1585 | if (associated(cospOUT%isccp_boxptop)) cospOUT%isccp_boxptop(:,:) = R_UNDEF |
---|
| 1586 | if (associated(cospOUT%isccp_fq)) cospOUT%isccp_fq(:,:,:) = R_UNDEF |
---|
| 1587 | if (associated(cospOUT%modis_Cloud_Fraction_Total_Mean)) & |
---|
| 1588 | cospOUT%modis_Cloud_Fraction_Total_Mean(:) = R_UNDEF |
---|
| 1589 | if (associated(cospOUT%modis_Cloud_Fraction_Water_Mean)) & |
---|
| 1590 | cospOUT%modis_Cloud_Fraction_Water_Mean(:) = R_UNDEF |
---|
| 1591 | if (associated(cospOUT%modis_Cloud_Fraction_Ice_Mean)) & |
---|
| 1592 | cospOUT%modis_Cloud_Fraction_Ice_Mean(:) = R_UNDEF |
---|
| 1593 | if (associated(cospOUT%modis_Cloud_Fraction_High_Mean)) & |
---|
| 1594 | cospOUT%modis_Cloud_Fraction_High_Mean(:) = R_UNDEF |
---|
| 1595 | if (associated(cospOUT%modis_Cloud_Fraction_Mid_Mean)) & |
---|
| 1596 | cospOUT%modis_Cloud_Fraction_Mid_Mean(:) = R_UNDEF |
---|
| 1597 | if (associated(cospOUT%modis_Cloud_Fraction_Low_Mean)) & |
---|
| 1598 | cospOUT%modis_Cloud_Fraction_Low_Mean(:) = R_UNDEF |
---|
| 1599 | if (associated(cospOUT%modis_Optical_Thickness_Total_Mean)) & |
---|
| 1600 | cospOUT%modis_Optical_Thickness_Total_Mean(:) = R_UNDEF |
---|
| 1601 | if (associated(cospOUT%modis_Optical_Thickness_Water_Mean)) & |
---|
| 1602 | cospOUT%modis_Optical_Thickness_Water_Mean(:) = R_UNDEF |
---|
| 1603 | if (associated(cospOUT%modis_Optical_Thickness_Ice_Mean)) & |
---|
| 1604 | cospOUT%modis_Optical_Thickness_Ice_Mean(:) = R_UNDEF |
---|
| 1605 | if (associated(cospOUT%modis_Optical_Thickness_Total_LogMean)) & |
---|
| 1606 | cospOUT%modis_Optical_Thickness_Total_LogMean(:) = R_UNDEF |
---|
| 1607 | if (associated(cospOUT%modis_Optical_Thickness_Water_LogMean)) & |
---|
| 1608 | cospOUT%modis_Optical_Thickness_Water_LogMean(:) = R_UNDEF |
---|
| 1609 | if (associated(cospOUT%modis_Optical_Thickness_Ice_LogMean)) & |
---|
| 1610 | cospOUT%modis_Optical_Thickness_Ice_LogMean(:) = R_UNDEF |
---|
| 1611 | if (associated(cospOUT%modis_Cloud_Particle_Size_Water_Mean)) & |
---|
| 1612 | cospOUT%modis_Cloud_Particle_Size_Water_Mean(:) = R_UNDEF |
---|
| 1613 | if (associated(cospOUT%modis_Cloud_Particle_Size_Ice_Mean)) & |
---|
| 1614 | cospOUT%modis_Cloud_Particle_Size_Ice_Mean(:) = R_UNDEF |
---|
| 1615 | if (associated(cospOUT%modis_Cloud_Top_Pressure_Total_Mean)) & |
---|
| 1616 | cospOUT%modis_Cloud_Top_Pressure_Total_Mean(:) = R_UNDEF |
---|
| 1617 | if (associated(cospOUT%modis_Liquid_Water_Path_Mean)) & |
---|
| 1618 | cospOUT%modis_Liquid_Water_Path_Mean(:) = R_UNDEF |
---|
| 1619 | if (associated(cospOUT%modis_Ice_Water_Path_Mean)) & |
---|
| 1620 | cospOUT%modis_Ice_Water_Path_Mean(:) = R_UNDEF |
---|
| 1621 | if (associated(cospOUT%modis_Optical_Thickness_vs_Cloud_Top_Pressure)) & |
---|
| 1622 | cospOUT%modis_Optical_Thickness_vs_Cloud_Top_Pressure(:,:,:) = R_UNDEF |
---|
| 1623 | if (associated(cospOUT%modis_Optical_Thickness_vs_ReffICE)) & |
---|
| 1624 | cospOUT%modis_Optical_Thickness_vs_ReffICE(:,:,:) = R_UNDEF |
---|
| 1625 | if (associated(cospOUT%modis_Optical_Thickness_vs_ReffLIQ)) & |
---|
| 1626 | cospOUT%modis_Optical_Thickness_vs_ReffLIQ(:,:,:) = R_UNDEF |
---|
| 1627 | if (associated(cospOUT%calipso_cfad_sr)) cospOUT%calipso_cfad_sr(:,:,:) = R_UNDEF |
---|
| 1628 | if (associated(cospOUT%calipso_lidarcld)) cospOUT%calipso_lidarcld(:,:) = R_UNDEF |
---|
| 1629 | if (associated(cospOUT%calipso_lidarcldphase)) cospOUT%calipso_lidarcldphase(:,:,:) = R_UNDEF |
---|
| 1630 | if (associated(cospOUT%calipso_cldlayer)) cospOUT%calipso_cldlayer(:,:) = R_UNDEF |
---|
| 1631 | if (associated(cospOUT%calipso_cldlayerphase)) cospOUT%calipso_cldlayerphase(:,:,:) = R_UNDEF |
---|
| 1632 | if (associated(cospOUT%calipso_lidarcldtmp)) cospOUT%calipso_lidarcldtmp(:,:,:) = R_UNDEF |
---|
| 1633 | endif |
---|
| 1634 | if (any(cospgridIN%qv .lt. 0)) then |
---|
| 1635 | nError=nError+1 |
---|
| 1636 | errorMessage(nError) = 'ERROR: COSP input variable: cospgridIN%qv contains values out of range' |
---|
| 1637 | Lisccp_subcolumn = .false. |
---|
| 1638 | Lisccp_column = .false. |
---|
| 1639 | Lrttov_subcolumn = .false. |
---|
| 1640 | if (associated(cospOUT%rttov_tbs)) cospOUT%rttov_tbs(:,:) = R_UNDEF |
---|
| 1641 | if (associated(cospOUT%isccp_totalcldarea)) cospOUT%isccp_totalcldarea(:) = R_UNDEF |
---|
| 1642 | if (associated(cospOUT%isccp_meantb)) cospOUT%isccp_meantb(:) = R_UNDEF |
---|
| 1643 | if (associated(cospOUT%isccp_meantbclr)) cospOUT%isccp_meantbclr(:) = R_UNDEF |
---|
| 1644 | if (associated(cospOUT%isccp_meanptop)) cospOUT%isccp_meanptop(:) = R_UNDEF |
---|
| 1645 | if (associated(cospOUT%isccp_meantaucld)) cospOUT%isccp_meantaucld(:) = R_UNDEF |
---|
| 1646 | if (associated(cospOUT%isccp_meanalbedocld)) cospOUT%isccp_meanalbedocld(:) = R_UNDEF |
---|
| 1647 | if (associated(cospOUT%isccp_boxtau)) cospOUT%isccp_boxtau(:,:) = R_UNDEF |
---|
| 1648 | if (associated(cospOUT%isccp_boxptop)) cospOUT%isccp_boxptop(:,:) = R_UNDEF |
---|
| 1649 | if (associated(cospOUT%isccp_fq)) cospOUT%isccp_fq(:,:,:) = R_UNDEF |
---|
| 1650 | endif |
---|
| 1651 | if (any(cospgridIN%hgt_matrix .lt. -300)) then |
---|
| 1652 | nError=nError+1 |
---|
| 1653 | errorMessage(nError) = 'ERROR: COSP input variable: cospgridIN%hgt_matrix contains values out of range' |
---|
| 1654 | Lmisr_subcolumn = .false. |
---|
| 1655 | Lmisr_column = .false. |
---|
| 1656 | Lcloudsat_subcolumn = .false. |
---|
| 1657 | Lcloudsat_column = .false. |
---|
| 1658 | Lcalipso_column = .false. |
---|
| 1659 | Lradar_lidar_tcc = .false. |
---|
| 1660 | Llidar_only_freq_cloud = .false. |
---|
| 1661 | if (associated(cospOUT%misr_fq)) cospOUT%misr_fq(:,:,:) = R_UNDEF |
---|
| 1662 | if (associated(cospOUT%misr_dist_model_layertops)) cospOUT%misr_dist_model_layertops(:,:) = R_UNDEF |
---|
| 1663 | if (associated(cospOUT%misr_meanztop)) cospOUT%misr_meanztop(:) = R_UNDEF |
---|
| 1664 | if (associated(cospOUT%misr_cldarea)) cospOUT%misr_cldarea(:) = R_UNDEF |
---|
| 1665 | if (associated(cospOUT%calipso_cfad_sr)) cospOUT%calipso_cfad_sr(:,:,:) = R_UNDEF |
---|
| 1666 | if (associated(cospOUT%calipso_lidarcld)) cospOUT%calipso_lidarcld(:,:) = R_UNDEF |
---|
| 1667 | if (associated(cospOUT%calipso_lidarcldphase)) cospOUT%calipso_lidarcldphase(:,:,:) = R_UNDEF |
---|
| 1668 | if (associated(cospOUT%calipso_cldlayer)) cospOUT%calipso_cldlayer(:,:) = R_UNDEF |
---|
| 1669 | if (associated(cospOUT%calipso_cldlayerphase)) cospOUT%calipso_cldlayerphase(:,:,:) = R_UNDEF |
---|
| 1670 | if (associated(cospOUT%calipso_lidarcldtmp)) cospOUT%calipso_lidarcldtmp(:,:,:) = R_UNDEF |
---|
| 1671 | if (associated(cospOUT%cloudsat_cfad_ze)) cospOUT%cloudsat_cfad_ze(:,:,:) = R_UNDEF |
---|
| 1672 | if (associated(cospOUT%cloudsat_Ze_tot)) cospOUT%cloudsat_Ze_tot(:,:,:) = R_UNDEF |
---|
| 1673 | if (associated(cospOUT%lidar_only_freq_cloud)) cospOUT%lidar_only_freq_cloud(:,:) = R_UNDEF |
---|
| 1674 | if (associated(cospOUT%radar_lidar_tcc)) cospOUT%radar_lidar_tcc(:) = R_UNDEF |
---|
| 1675 | endif |
---|
| 1676 | if (any(cospgridIN%hgt_matrix_half .lt. -300)) then |
---|
| 1677 | nError=nError+1 |
---|
| 1678 | errorMessage(nError) = 'ERROR: COSP input variable: cospgridIN%hgt_matrix_half contains values out of range' |
---|
| 1679 | Lrttov_subcolumn = .false. |
---|
| 1680 | Lcloudsat_column = .false. |
---|
| 1681 | Lcalipso_column = .false. |
---|
| 1682 | Lradar_lidar_tcc = .false. |
---|
| 1683 | Llidar_only_freq_cloud = .false. |
---|
| 1684 | if (associated(cospOUT%rttov_tbs)) cospOUT%rttov_tbs(:,:) = R_UNDEF |
---|
| 1685 | if (associated(cospOUT%calipso_cfad_sr)) cospOUT%calipso_cfad_sr(:,:,:) = R_UNDEF |
---|
| 1686 | if (associated(cospOUT%calipso_lidarcld)) cospOUT%calipso_lidarcld(:,:) = R_UNDEF |
---|
| 1687 | if (associated(cospOUT%calipso_lidarcldphase)) cospOUT%calipso_lidarcldphase(:,:,:) = R_UNDEF |
---|
| 1688 | if (associated(cospOUT%calipso_cldlayer)) cospOUT%calipso_cldlayer(:,:) = R_UNDEF |
---|
| 1689 | if (associated(cospOUT%calipso_cldlayerphase)) cospOUT%calipso_cldlayerphase(:,:,:) = R_UNDEF |
---|
| 1690 | if (associated(cospOUT%calipso_lidarcldtmp)) cospOUT%calipso_lidarcldtmp(:,:,:) = R_UNDEF |
---|
| 1691 | if (associated(cospOUT%cloudsat_cfad_ze)) cospOUT%cloudsat_cfad_ze(:,:,:) = R_UNDEF |
---|
| 1692 | if (associated(cospOUT%lidar_only_freq_cloud)) cospOUT%lidar_only_freq_cloud(:,:) = R_UNDEF |
---|
| 1693 | if (associated(cospOUT%radar_lidar_tcc)) cospOUT%radar_lidar_tcc(:) = R_UNDEF |
---|
| 1694 | endif |
---|
| 1695 | if (any(cospgridIN%land .lt. 0)) then |
---|
| 1696 | nError=nError+1 |
---|
| 1697 | errorMessage(nError) = 'ERROR: COSP input variable: cospgridIN%land contains values out of range' |
---|
| 1698 | Lrttov_subcolumn = .false. |
---|
| 1699 | Lcalipso_column = .false. |
---|
| 1700 | Lparasol_column = .false. |
---|
| 1701 | if (associated(cospOUT%rttov_tbs)) cospOUT%rttov_tbs(:,:) = R_UNDEF |
---|
| 1702 | if (associated(cospOUT%calipso_cfad_sr)) cospOUT%calipso_cfad_sr(:,:,:) = R_UNDEF |
---|
| 1703 | if (associated(cospOUT%calipso_lidarcld)) cospOUT%calipso_lidarcld(:,:) = R_UNDEF |
---|
| 1704 | if (associated(cospOUT%calipso_lidarcldphase)) cospOUT%calipso_lidarcldphase(:,:,:) = R_UNDEF |
---|
| 1705 | if (associated(cospOUT%calipso_cldlayer)) cospOUT%calipso_cldlayer(:,:) = R_UNDEF |
---|
| 1706 | if (associated(cospOUT%calipso_cldlayerphase)) cospOUT%calipso_cldlayerphase(:,:,:) = R_UNDEF |
---|
| 1707 | if (associated(cospOUT%calipso_lidarcldtmp)) cospOUT%calipso_lidarcldtmp(:,:,:) = R_UNDEF |
---|
| 1708 | if (associated(cospOUT%parasolGrid_refl)) cospOUT%parasolGrid_refl(:,:) = R_UNDEF |
---|
| 1709 | endif |
---|
| 1710 | if (any(cospgridIN%skt .lt. 0)) then |
---|
| 1711 | nError=nError+1 |
---|
| 1712 | errorMessage(nError) = 'ERROR: COSP input variable: cospgridIN%skt contains values out of range' |
---|
| 1713 | Lisccp_subcolumn = .false. |
---|
| 1714 | Lisccp_column = .false. |
---|
| 1715 | Lrttov_subcolumn = .false. |
---|
| 1716 | if (associated(cospOUT%rttov_tbs)) cospOUT%rttov_tbs(:,:) = R_UNDEF |
---|
| 1717 | if (associated(cospOUT%isccp_totalcldarea)) cospOUT%isccp_totalcldarea(:) = R_UNDEF |
---|
| 1718 | if (associated(cospOUT%isccp_meantb)) cospOUT%isccp_meantb(:) = R_UNDEF |
---|
| 1719 | if (associated(cospOUT%isccp_meantbclr)) cospOUT%isccp_meantbclr(:) = R_UNDEF |
---|
| 1720 | if (associated(cospOUT%isccp_meanptop)) cospOUT%isccp_meanptop(:) = R_UNDEF |
---|
| 1721 | if (associated(cospOUT%isccp_meantaucld)) cospOUT%isccp_meantaucld(:) = R_UNDEF |
---|
| 1722 | if (associated(cospOUT%isccp_meanalbedocld)) cospOUT%isccp_meanalbedocld(:) = R_UNDEF |
---|
| 1723 | if (associated(cospOUT%isccp_boxtau)) cospOUT%isccp_boxtau(:,:) = R_UNDEF |
---|
| 1724 | if (associated(cospOUT%isccp_boxptop)) cospOUT%isccp_boxptop(:,:) = R_UNDEF |
---|
| 1725 | if (associated(cospOUT%isccp_fq)) cospOUT%isccp_fq(:,:,:) = R_UNDEF |
---|
| 1726 | endif |
---|
| 1727 | |
---|
| 1728 | ! RTTOV Inputs |
---|
| 1729 | if (cospgridIN%zenang .lt. -90. .OR. cospgridIN%zenang .gt. 90) then |
---|
| 1730 | nError=nError+1 |
---|
| 1731 | errorMessage(nError) = 'ERROR: COSP input variable: cospgridIN%zenang contains values out of range' |
---|
| 1732 | Lrttov_subcolumn = .false. |
---|
| 1733 | if (associated(cospOUT%rttov_tbs)) cospOUT%rttov_tbs(:,:) = R_UNDEF |
---|
| 1734 | endif |
---|
| 1735 | if (cospgridIN%co2 .lt. 0) then |
---|
| 1736 | nError=nError+1 |
---|
| 1737 | errorMessage(nError) = 'ERROR: COSP input variable: cospgridIN%co2 contains values out of range' |
---|
| 1738 | Lrttov_subcolumn = .false. |
---|
| 1739 | if (associated(cospOUT%rttov_tbs)) cospOUT%rttov_tbs(:,:) = R_UNDEF |
---|
| 1740 | endif |
---|
| 1741 | if (cospgridIN%ch4 .lt. 0) then |
---|
| 1742 | nError=nError+1 |
---|
| 1743 | errorMessage(nError) = 'ERROR: COSP input variable: cospgridIN%ch4 contains values out of range' |
---|
| 1744 | Lrttov_subcolumn = .false. |
---|
| 1745 | if (associated(cospOUT%rttov_tbs)) cospOUT%rttov_tbs(:,:) = R_UNDEF |
---|
| 1746 | endif |
---|
| 1747 | if (cospgridIN%n2o .lt. 0) then |
---|
| 1748 | nError=nError+1 |
---|
| 1749 | errorMessage(nError) = 'ERROR: COSP input variable: cospgridIN%n2o contains values out of range' |
---|
| 1750 | Lrttov_subcolumn = .false. |
---|
| 1751 | if (associated(cospOUT%rttov_tbs)) cospOUT%rttov_tbs(:,:) = R_UNDEF |
---|
| 1752 | endif |
---|
| 1753 | if (cospgridIN%co.lt. 0) then |
---|
| 1754 | nError=nError+1 |
---|
| 1755 | errorMessage(nError) = 'ERROR: COSP input variable: cospgridIN%co contains values out of range' |
---|
| 1756 | Lrttov_subcolumn = .false. |
---|
| 1757 | if (associated(cospOUT%rttov_tbs)) cospOUT%rttov_tbs(:,:) = R_UNDEF |
---|
| 1758 | endif |
---|
| 1759 | if (any(cospgridIN%o3 .lt. 0)) then |
---|
| 1760 | nError=nError+1 |
---|
| 1761 | errorMessage(nError) = 'ERROR: COSP input variable: cospgridIN%o3 contains values out of range' |
---|
| 1762 | Lrttov_subcolumn = .false. |
---|
| 1763 | if (associated(cospOUT%rttov_tbs)) cospOUT%rttov_tbs(:,:) = R_UNDEF |
---|
| 1764 | endif |
---|
| 1765 | if (any(cospgridIN%emis_sfc .lt. 0. .OR. cospgridIN%emis_sfc .gt. 1)) then |
---|
| 1766 | nError=nError+1 |
---|
| 1767 | errorMessage(nError) = 'ERROR: COSP input variable: cospgridIN%emis_sfc contains values out of range' |
---|
| 1768 | Lrttov_subcolumn = .false. |
---|
| 1769 | if (associated(cospOUT%rttov_tbs)) cospOUT%rttov_tbs(:,:) = R_UNDEF |
---|
| 1770 | endif |
---|
| 1771 | if (any(cospgridIN%u_sfc .lt. -100. .OR. cospgridIN%u_sfc .gt. 100.)) then |
---|
| 1772 | nError=nError+1 |
---|
| 1773 | errorMessage(nError) = 'ERROR: COSP input variable: cospIN%u_sfc contains values out of range' |
---|
| 1774 | if (associated(cospOUT%rttov_tbs)) cospOUT%rttov_tbs(:,:) = R_UNDEF |
---|
| 1775 | Lrttov_subcolumn = .false. |
---|
| 1776 | endif |
---|
| 1777 | if (any(cospgridIN%v_sfc .lt. -100. .OR. cospgridIN%v_sfc .gt. 100.)) then |
---|
| 1778 | nError=nError+1 |
---|
| 1779 | errorMessage(nError) = 'ERROR: COSP input variable: cospIN%v_sfc contains values out of range' |
---|
| 1780 | Lrttov_subcolumn = .false. |
---|
| 1781 | if (associated(cospOUT%rttov_tbs)) cospOUT%rttov_tbs(:,:) = R_UNDEF |
---|
| 1782 | endif |
---|
| 1783 | if (any(cospgridIN%lat .lt. -90 .OR. cospgridIN%lat .gt. 90)) then |
---|
| 1784 | nError=nError+1 |
---|
| 1785 | errorMessage(nError) = 'ERROR: COSP input variable: cospIN%lat contains values out of range' |
---|
| 1786 | Lrttov_subcolumn = .false. |
---|
| 1787 | if (associated(cospOUT%rttov_tbs)) cospOUT%rttov_tbs(:,:) = R_UNDEF |
---|
| 1788 | endif |
---|
| 1789 | |
---|
| 1790 | ! COSP_INPUTS |
---|
| 1791 | if (cospIN%emsfc_lw .lt. 0. .OR. cospIN%emsfc_lw .gt. 1.) then |
---|
| 1792 | nError=nError+1 |
---|
| 1793 | errorMessage(nError) = 'ERROR: COSP input variable: cospIN%emsfc_lw contains values out of range' |
---|
| 1794 | Lisccp_subcolumn = .false. |
---|
| 1795 | Lisccp_column = .false. |
---|
| 1796 | if (associated(cospOUT%isccp_totalcldarea)) cospOUT%isccp_totalcldarea(:) = R_UNDEF |
---|
| 1797 | if (associated(cospOUT%isccp_meantb)) cospOUT%isccp_meantb(:) = R_UNDEF |
---|
| 1798 | if (associated(cospOUT%isccp_meantbclr)) cospOUT%isccp_meantbclr(:) = R_UNDEF |
---|
| 1799 | if (associated(cospOUT%isccp_meanptop)) cospOUT%isccp_meanptop(:) = R_UNDEF |
---|
| 1800 | if (associated(cospOUT%isccp_meantaucld)) cospOUT%isccp_meantaucld(:) = R_UNDEF |
---|
| 1801 | if (associated(cospOUT%isccp_meanalbedocld)) cospOUT%isccp_meanalbedocld(:) = R_UNDEF |
---|
| 1802 | if (associated(cospOUT%isccp_boxtau)) cospOUT%isccp_boxtau(:,:) = R_UNDEF |
---|
| 1803 | if (associated(cospOUT%isccp_boxptop)) cospOUT%isccp_boxptop(:,:) = R_UNDEF |
---|
| 1804 | if (associated(cospOUT%isccp_fq)) cospOUT%isccp_fq(:,:,:) = R_UNDEF |
---|
| 1805 | |
---|
| 1806 | endif |
---|
| 1807 | if (any(cospIN%tau_067 .lt. 0)) then |
---|
| 1808 | nError=nError+1 |
---|
| 1809 | errorMessage(nError) = 'ERROR: COSP input variable: cospIN%tau_067 contains values out of range' |
---|
| 1810 | Lisccp_subcolumn = .false. |
---|
| 1811 | Lisccp_column = .false. |
---|
| 1812 | Lmisr_subcolumn = .false. |
---|
| 1813 | Lmisr_column = .false. |
---|
| 1814 | Lmodis_subcolumn = .false. |
---|
| 1815 | Lmodis_column = .false. |
---|
| 1816 | |
---|
| 1817 | if (associated(cospOUT%isccp_totalcldarea)) cospOUT%isccp_totalcldarea(:) = R_UNDEF |
---|
| 1818 | if (associated(cospOUT%isccp_meantb)) cospOUT%isccp_meantb(:) = R_UNDEF |
---|
| 1819 | if (associated(cospOUT%isccp_meantbclr)) cospOUT%isccp_meantbclr(:) = R_UNDEF |
---|
| 1820 | if (associated(cospOUT%isccp_meanptop)) cospOUT%isccp_meanptop(:) = R_UNDEF |
---|
| 1821 | if (associated(cospOUT%isccp_meantaucld)) cospOUT%isccp_meantaucld(:) = R_UNDEF |
---|
| 1822 | if (associated(cospOUT%isccp_meanalbedocld)) cospOUT%isccp_meanalbedocld(:) = R_UNDEF |
---|
| 1823 | if (associated(cospOUT%isccp_boxtau)) cospOUT%isccp_boxtau(:,:) = R_UNDEF |
---|
| 1824 | if (associated(cospOUT%isccp_boxptop)) cospOUT%isccp_boxptop(:,:) = R_UNDEF |
---|
| 1825 | if (associated(cospOUT%isccp_fq)) cospOUT%isccp_fq(:,:,:) = R_UNDEF |
---|
| 1826 | if (associated(cospOUT%misr_fq)) cospOUT%misr_fq(:,:,:) = R_UNDEF |
---|
| 1827 | if (associated(cospOUT%misr_dist_model_layertops)) cospOUT%misr_dist_model_layertops(:,:) = R_UNDEF |
---|
| 1828 | if (associated(cospOUT%misr_meanztop)) cospOUT%misr_meanztop(:) = R_UNDEF |
---|
| 1829 | if (associated(cospOUT%misr_cldarea)) cospOUT%misr_cldarea(:) = R_UNDEF |
---|
| 1830 | if (associated(cospOUT%modis_Cloud_Fraction_Total_Mean)) & |
---|
| 1831 | cospOUT%modis_Cloud_Fraction_Total_Mean(:) = R_UNDEF |
---|
| 1832 | if (associated(cospOUT%modis_Cloud_Fraction_Water_Mean)) & |
---|
| 1833 | cospOUT%modis_Cloud_Fraction_Water_Mean(:) = R_UNDEF |
---|
| 1834 | if (associated(cospOUT%modis_Cloud_Fraction_Ice_Mean)) & |
---|
| 1835 | cospOUT%modis_Cloud_Fraction_Ice_Mean(:) = R_UNDEF |
---|
| 1836 | if (associated(cospOUT%modis_Cloud_Fraction_High_Mean)) & |
---|
| 1837 | cospOUT%modis_Cloud_Fraction_High_Mean(:) = R_UNDEF |
---|
| 1838 | if (associated(cospOUT%modis_Cloud_Fraction_Mid_Mean)) & |
---|
| 1839 | cospOUT%modis_Cloud_Fraction_Mid_Mean(:) = R_UNDEF |
---|
| 1840 | if (associated(cospOUT%modis_Cloud_Fraction_Low_Mean)) & |
---|
| 1841 | cospOUT%modis_Cloud_Fraction_Low_Mean(:) = R_UNDEF |
---|
| 1842 | if (associated(cospOUT%modis_Optical_Thickness_Total_Mean)) & |
---|
| 1843 | cospOUT%modis_Optical_Thickness_Total_Mean(:) = R_UNDEF |
---|
| 1844 | if (associated(cospOUT%modis_Optical_Thickness_Water_Mean)) & |
---|
| 1845 | cospOUT%modis_Optical_Thickness_Water_Mean(:) = R_UNDEF |
---|
| 1846 | if (associated(cospOUT%modis_Optical_Thickness_Ice_Mean)) & |
---|
| 1847 | cospOUT%modis_Optical_Thickness_Ice_Mean(:) = R_UNDEF |
---|
| 1848 | if (associated(cospOUT%modis_Optical_Thickness_Total_LogMean)) & |
---|
| 1849 | cospOUT%modis_Optical_Thickness_Total_LogMean(:) = R_UNDEF |
---|
| 1850 | if (associated(cospOUT%modis_Optical_Thickness_Water_LogMean)) & |
---|
| 1851 | cospOUT%modis_Optical_Thickness_Water_LogMean(:) = R_UNDEF |
---|
| 1852 | if (associated(cospOUT%modis_Optical_Thickness_Ice_LogMean)) & |
---|
| 1853 | cospOUT%modis_Optical_Thickness_Ice_LogMean(:) = R_UNDEF |
---|
| 1854 | if (associated(cospOUT%modis_Cloud_Particle_Size_Water_Mean)) & |
---|
| 1855 | cospOUT%modis_Cloud_Particle_Size_Water_Mean(:) = R_UNDEF |
---|
| 1856 | if (associated(cospOUT%modis_Cloud_Particle_Size_Ice_Mean)) & |
---|
| 1857 | cospOUT%modis_Cloud_Particle_Size_Ice_Mean(:) = R_UNDEF |
---|
| 1858 | if (associated(cospOUT%modis_Cloud_Top_Pressure_Total_Mean)) & |
---|
| 1859 | cospOUT%modis_Cloud_Top_Pressure_Total_Mean(:) = R_UNDEF |
---|
| 1860 | if (associated(cospOUT%modis_Liquid_Water_Path_Mean)) & |
---|
| 1861 | cospOUT%modis_Liquid_Water_Path_Mean(:) = R_UNDEF |
---|
| 1862 | if (associated(cospOUT%modis_Ice_Water_Path_Mean)) & |
---|
| 1863 | cospOUT%modis_Ice_Water_Path_Mean(:) = R_UNDEF |
---|
| 1864 | if (associated(cospOUT%modis_Optical_Thickness_vs_Cloud_Top_Pressure)) & |
---|
| 1865 | cospOUT%modis_Optical_Thickness_vs_Cloud_Top_Pressure(:,:,:) = R_UNDEF |
---|
| 1866 | if (associated(cospOUT%modis_Optical_Thickness_vs_ReffICE)) & |
---|
| 1867 | cospOUT%modis_Optical_Thickness_vs_ReffICE(:,:,:) = R_UNDEF |
---|
| 1868 | if (associated(cospOUT%modis_Optical_Thickness_vs_ReffLIQ)) & |
---|
| 1869 | cospOUT%modis_Optical_Thickness_vs_ReffLIQ(:,:,:) = R_UNDEF |
---|
| 1870 | |
---|
| 1871 | endif |
---|
| 1872 | if (any(cospIN%emiss_11 .lt. 0. .OR. cospIN%emiss_11 .gt. 1)) then |
---|
| 1873 | nError=nError+1 |
---|
| 1874 | errorMessage(nError) = 'ERROR: COSP input variable: cospIN%emiss_11 contains values out of range' |
---|
| 1875 | Lisccp_subcolumn = .false. |
---|
| 1876 | Lisccp_column = .false. |
---|
| 1877 | if (associated(cospOUT%isccp_totalcldarea)) cospOUT%isccp_totalcldarea(:) = R_UNDEF |
---|
| 1878 | if (associated(cospOUT%isccp_meantb)) cospOUT%isccp_meantb(:) = R_UNDEF |
---|
| 1879 | if (associated(cospOUT%isccp_meantbclr)) cospOUT%isccp_meantbclr(:) = R_UNDEF |
---|
| 1880 | if (associated(cospOUT%isccp_meanptop)) cospOUT%isccp_meanptop(:) = R_UNDEF |
---|
| 1881 | if (associated(cospOUT%isccp_meantaucld)) cospOUT%isccp_meantaucld(:) = R_UNDEF |
---|
| 1882 | if (associated(cospOUT%isccp_meanalbedocld)) cospOUT%isccp_meanalbedocld(:) = R_UNDEF |
---|
| 1883 | if (associated(cospOUT%isccp_boxtau)) cospOUT%isccp_boxtau(:,:) = R_UNDEF |
---|
| 1884 | if (associated(cospOUT%isccp_boxptop)) cospOUT%isccp_boxptop(:,:) = R_UNDEF |
---|
| 1885 | if (associated(cospOUT%isccp_fq)) cospOUT%isccp_fq(:,:,:) = R_UNDEF |
---|
| 1886 | |
---|
| 1887 | endif |
---|
| 1888 | if (any(cospIN%asym .lt. -1. .OR. cospIN%asym .gt. 1)) then |
---|
| 1889 | nError=nError+1 |
---|
| 1890 | errorMessage(nError) = 'ERROR: COSP input variable: cospIN%asym contains values out of range' |
---|
| 1891 | Lmodis_subcolumn = .false. |
---|
| 1892 | Lmodis_column = .false. |
---|
| 1893 | if (associated(cospOUT%modis_Cloud_Fraction_Total_Mean)) & |
---|
| 1894 | cospOUT%modis_Cloud_Fraction_Total_Mean(:) = R_UNDEF |
---|
| 1895 | if (associated(cospOUT%modis_Cloud_Fraction_Water_Mean)) & |
---|
| 1896 | cospOUT%modis_Cloud_Fraction_Water_Mean(:) = R_UNDEF |
---|
| 1897 | if (associated(cospOUT%modis_Cloud_Fraction_Ice_Mean)) & |
---|
| 1898 | cospOUT%modis_Cloud_Fraction_Ice_Mean(:) = R_UNDEF |
---|
| 1899 | if (associated(cospOUT%modis_Cloud_Fraction_High_Mean)) & |
---|
| 1900 | cospOUT%modis_Cloud_Fraction_High_Mean(:) = R_UNDEF |
---|
| 1901 | if (associated(cospOUT%modis_Cloud_Fraction_Mid_Mean)) & |
---|
| 1902 | cospOUT%modis_Cloud_Fraction_Mid_Mean(:) = R_UNDEF |
---|
| 1903 | if (associated(cospOUT%modis_Cloud_Fraction_Low_Mean)) & |
---|
| 1904 | cospOUT%modis_Cloud_Fraction_Low_Mean(:) = R_UNDEF |
---|
| 1905 | if (associated(cospOUT%modis_Optical_Thickness_Total_Mean)) & |
---|
| 1906 | cospOUT%modis_Optical_Thickness_Total_Mean(:) = R_UNDEF |
---|
| 1907 | if (associated(cospOUT%modis_Optical_Thickness_Water_Mean)) & |
---|
| 1908 | cospOUT%modis_Optical_Thickness_Water_Mean(:) = R_UNDEF |
---|
| 1909 | if (associated(cospOUT%modis_Optical_Thickness_Ice_Mean)) & |
---|
| 1910 | cospOUT%modis_Optical_Thickness_Ice_Mean(:) = R_UNDEF |
---|
| 1911 | if (associated(cospOUT%modis_Optical_Thickness_Total_LogMean)) & |
---|
| 1912 | cospOUT%modis_Optical_Thickness_Total_LogMean(:) = R_UNDEF |
---|
| 1913 | if (associated(cospOUT%modis_Optical_Thickness_Water_LogMean)) & |
---|
| 1914 | cospOUT%modis_Optical_Thickness_Water_LogMean(:) = R_UNDEF |
---|
| 1915 | if (associated(cospOUT%modis_Optical_Thickness_Ice_LogMean)) & |
---|
| 1916 | cospOUT%modis_Optical_Thickness_Ice_LogMean(:) = R_UNDEF |
---|
| 1917 | if (associated(cospOUT%modis_Cloud_Particle_Size_Water_Mean)) & |
---|
| 1918 | cospOUT%modis_Cloud_Particle_Size_Water_Mean(:) = R_UNDEF |
---|
| 1919 | if (associated(cospOUT%modis_Cloud_Particle_Size_Ice_Mean)) & |
---|
| 1920 | cospOUT%modis_Cloud_Particle_Size_Ice_Mean(:) = R_UNDEF |
---|
| 1921 | if (associated(cospOUT%modis_Cloud_Top_Pressure_Total_Mean)) & |
---|
| 1922 | cospOUT%modis_Cloud_Top_Pressure_Total_Mean(:) = R_UNDEF |
---|
| 1923 | if (associated(cospOUT%modis_Liquid_Water_Path_Mean)) & |
---|
| 1924 | cospOUT%modis_Liquid_Water_Path_Mean(:) = R_UNDEF |
---|
| 1925 | if (associated(cospOUT%modis_Ice_Water_Path_Mean)) & |
---|
| 1926 | cospOUT%modis_Ice_Water_Path_Mean(:) = R_UNDEF |
---|
| 1927 | if (associated(cospOUT%modis_Optical_Thickness_vs_Cloud_Top_Pressure)) & |
---|
| 1928 | cospOUT%modis_Optical_Thickness_vs_Cloud_Top_Pressure(:,:,:) = R_UNDEF |
---|
| 1929 | if (associated(cospOUT%modis_Optical_Thickness_vs_ReffICE)) & |
---|
| 1930 | cospOUT%modis_Optical_Thickness_vs_ReffICE(:,:,:) = R_UNDEF |
---|
| 1931 | if (associated(cospOUT%modis_Optical_Thickness_vs_ReffLIQ)) & |
---|
| 1932 | cospOUT%modis_Optical_Thickness_vs_ReffLIQ(:,:,:) = R_UNDEF |
---|
| 1933 | endif |
---|
| 1934 | if (any(cospIN%ss_alb .lt. 0 .OR. cospIN%ss_alb .gt. 1)) then |
---|
| 1935 | nError=nError+1 |
---|
| 1936 | errorMessage(nError) = 'ERROR: COSP input variable: cospIN%ss_alb contains values out of range' |
---|
| 1937 | Lmodis_subcolumn = .false. |
---|
| 1938 | Lmodis_column = .false. |
---|
| 1939 | if (associated(cospOUT%modis_Cloud_Fraction_Total_Mean)) & |
---|
| 1940 | cospOUT%modis_Cloud_Fraction_Total_Mean(:) = R_UNDEF |
---|
| 1941 | if (associated(cospOUT%modis_Cloud_Fraction_Water_Mean)) & |
---|
| 1942 | cospOUT%modis_Cloud_Fraction_Water_Mean(:) = R_UNDEF |
---|
| 1943 | if (associated(cospOUT%modis_Cloud_Fraction_Ice_Mean)) & |
---|
| 1944 | cospOUT%modis_Cloud_Fraction_Ice_Mean(:) = R_UNDEF |
---|
| 1945 | if (associated(cospOUT%modis_Cloud_Fraction_High_Mean)) & |
---|
| 1946 | cospOUT%modis_Cloud_Fraction_High_Mean(:) = R_UNDEF |
---|
| 1947 | if (associated(cospOUT%modis_Cloud_Fraction_Mid_Mean)) & |
---|
| 1948 | cospOUT%modis_Cloud_Fraction_Mid_Mean(:) = R_UNDEF |
---|
| 1949 | if (associated(cospOUT%modis_Cloud_Fraction_Low_Mean)) & |
---|
| 1950 | cospOUT%modis_Cloud_Fraction_Low_Mean(:) = R_UNDEF |
---|
| 1951 | if (associated(cospOUT%modis_Optical_Thickness_Total_Mean)) & |
---|
| 1952 | cospOUT%modis_Optical_Thickness_Total_Mean(:) = R_UNDEF |
---|
| 1953 | if (associated(cospOUT%modis_Optical_Thickness_Water_Mean)) & |
---|
| 1954 | cospOUT%modis_Optical_Thickness_Water_Mean(:) = R_UNDEF |
---|
| 1955 | if (associated(cospOUT%modis_Optical_Thickness_Ice_Mean)) & |
---|
| 1956 | cospOUT%modis_Optical_Thickness_Ice_Mean(:) = R_UNDEF |
---|
| 1957 | if (associated(cospOUT%modis_Optical_Thickness_Total_LogMean)) & |
---|
| 1958 | cospOUT%modis_Optical_Thickness_Total_LogMean(:) = R_UNDEF |
---|
| 1959 | if (associated(cospOUT%modis_Optical_Thickness_Water_LogMean)) & |
---|
| 1960 | cospOUT%modis_Optical_Thickness_Water_LogMean(:) = R_UNDEF |
---|
| 1961 | if (associated(cospOUT%modis_Optical_Thickness_Ice_LogMean)) & |
---|
| 1962 | cospOUT%modis_Optical_Thickness_Ice_LogMean(:) = R_UNDEF |
---|
| 1963 | if (associated(cospOUT%modis_Cloud_Particle_Size_Water_Mean)) & |
---|
| 1964 | cospOUT%modis_Cloud_Particle_Size_Water_Mean(:) = R_UNDEF |
---|
| 1965 | if (associated(cospOUT%modis_Cloud_Particle_Size_Ice_Mean)) & |
---|
| 1966 | cospOUT%modis_Cloud_Particle_Size_Ice_Mean(:) = R_UNDEF |
---|
| 1967 | if (associated(cospOUT%modis_Cloud_Top_Pressure_Total_Mean)) & |
---|
| 1968 | cospOUT%modis_Cloud_Top_Pressure_Total_Mean(:) = R_UNDEF |
---|
| 1969 | if (associated(cospOUT%modis_Liquid_Water_Path_Mean)) & |
---|
| 1970 | cospOUT%modis_Liquid_Water_Path_Mean(:) = R_UNDEF |
---|
| 1971 | if (associated(cospOUT%modis_Ice_Water_Path_Mean)) & |
---|
| 1972 | cospOUT%modis_Ice_Water_Path_Mean(:) = R_UNDEF |
---|
| 1973 | if (associated(cospOUT%modis_Optical_Thickness_vs_Cloud_Top_Pressure)) & |
---|
| 1974 | cospOUT%modis_Optical_Thickness_vs_Cloud_Top_Pressure(:,:,:) = R_UNDEF |
---|
| 1975 | if (associated(cospOUT%modis_Optical_Thickness_vs_ReffICE)) & |
---|
| 1976 | cospOUT%modis_Optical_Thickness_vs_ReffICE(:,:,:) = R_UNDEF |
---|
| 1977 | if (associated(cospOUT%modis_Optical_Thickness_vs_ReffLIQ)) & |
---|
| 1978 | cospOUT%modis_Optical_Thickness_vs_ReffLIQ(:,:,:) = R_UNDEF |
---|
| 1979 | endif |
---|
| 1980 | if (any(cospIN%betatot .lt. 0)) then |
---|
| 1981 | nError=nError+1 |
---|
| 1982 | errorMessage(nError) = 'ERROR: COSP input variable: cospIN%betatot contains values out of range' |
---|
| 1983 | Lcalipso_subcolumn = .false. |
---|
| 1984 | Lcalipso_column = .false. |
---|
| 1985 | if (associated(cospOUT%calipso_cfad_sr)) cospOUT%calipso_cfad_sr(:,:,:) = R_UNDEF |
---|
| 1986 | if (associated(cospOUT%calipso_lidarcld)) cospOUT%calipso_lidarcld(:,:) = R_UNDEF |
---|
| 1987 | if (associated(cospOUT%calipso_lidarcldphase)) cospOUT%calipso_lidarcldphase(:,:,:) = R_UNDEF |
---|
| 1988 | if (associated(cospOUT%calipso_cldlayer)) cospOUT%calipso_cldlayer(:,:) = R_UNDEF |
---|
| 1989 | if (associated(cospOUT%calipso_cldlayerphase)) cospOUT%calipso_cldlayerphase(:,:,:) = R_UNDEF |
---|
| 1990 | if (associated(cospOUT%calipso_lidarcldtmp)) cospOUT%calipso_lidarcldtmp(:,:,:) = R_UNDEF |
---|
| 1991 | if (associated(cospOUT%calipso_srbval)) cospOUT%calipso_srbval(:) = R_UNDEF |
---|
| 1992 | endif |
---|
| 1993 | if (any(cospIN%betatot_liq .lt. 0)) then |
---|
| 1994 | nError=nError+1 |
---|
| 1995 | errorMessage(nError) = ('ERROR: COSP input variable: cospIN%betatot_liq contains values out of range') |
---|
| 1996 | Lcalipso_subcolumn = .false. |
---|
| 1997 | Lcalipso_column = .false. |
---|
| 1998 | if (associated(cospOUT%calipso_cfad_sr)) cospOUT%calipso_cfad_sr(:,:,:) = R_UNDEF |
---|
| 1999 | if (associated(cospOUT%calipso_lidarcld)) cospOUT%calipso_lidarcld(:,:) = R_UNDEF |
---|
| 2000 | if (associated(cospOUT%calipso_lidarcldphase)) cospOUT%calipso_lidarcldphase(:,:,:) = R_UNDEF |
---|
| 2001 | if (associated(cospOUT%calipso_cldlayer)) cospOUT%calipso_cldlayer(:,:) = R_UNDEF |
---|
| 2002 | if (associated(cospOUT%calipso_cldlayerphase)) cospOUT%calipso_cldlayerphase(:,:,:) = R_UNDEF |
---|
| 2003 | if (associated(cospOUT%calipso_lidarcldtmp)) cospOUT%calipso_lidarcldtmp(:,:,:) = R_UNDEF |
---|
| 2004 | if (associated(cospOUT%calipso_srbval)) cospOUT%calipso_srbval(:) = R_UNDEF |
---|
| 2005 | endif |
---|
| 2006 | if (any(cospIN%betatot_ice .lt. 0)) then |
---|
| 2007 | nError=nError+1 |
---|
| 2008 | errorMessage(nError) = 'ERROR: COSP input variable: cospIN%betatot_ice contains values out of range' |
---|
| 2009 | Lcalipso_subcolumn = .false. |
---|
| 2010 | Lcalipso_column = .false. |
---|
| 2011 | if (associated(cospOUT%calipso_cfad_sr)) cospOUT%calipso_cfad_sr(:,:,:) = R_UNDEF |
---|
| 2012 | if (associated(cospOUT%calipso_lidarcld)) cospOUT%calipso_lidarcld(:,:) = R_UNDEF |
---|
| 2013 | if (associated(cospOUT%calipso_lidarcldphase)) cospOUT%calipso_lidarcldphase(:,:,:) = R_UNDEF |
---|
| 2014 | if (associated(cospOUT%calipso_cldlayer)) cospOUT%calipso_cldlayer(:,:) = R_UNDEF |
---|
| 2015 | if (associated(cospOUT%calipso_cldlayerphase)) cospOUT%calipso_cldlayerphase(:,:,:) = R_UNDEF |
---|
| 2016 | if (associated(cospOUT%calipso_lidarcldtmp)) cospOUT%calipso_lidarcldtmp(:,:,:) = R_UNDEF |
---|
| 2017 | if (associated(cospOUT%calipso_srbval)) cospOUT%calipso_srbval(:) = R_UNDEF |
---|
| 2018 | endif |
---|
| 2019 | if (any(cospIN%beta_mol .lt. 0)) then |
---|
| 2020 | nError=nError+1 |
---|
| 2021 | errorMessage(nError) = 'ERROR: COSP input variable: cospIN%beta_mol contains values out of range' |
---|
| 2022 | Lcalipso_subcolumn = .false. |
---|
| 2023 | Lcalipso_column = .false. |
---|
| 2024 | Lcloudsat_column = .false. |
---|
| 2025 | Lradar_lidar_tcc = .false. |
---|
| 2026 | Llidar_only_freq_cloud = .false. |
---|
| 2027 | if (associated(cospOUT%calipso_cfad_sr)) cospOUT%calipso_cfad_sr(:,:,:) = R_UNDEF |
---|
| 2028 | if (associated(cospOUT%calipso_lidarcld)) cospOUT%calipso_lidarcld(:,:) = R_UNDEF |
---|
| 2029 | if (associated(cospOUT%calipso_lidarcldphase)) cospOUT%calipso_lidarcldphase(:,:,:) = R_UNDEF |
---|
| 2030 | if (associated(cospOUT%calipso_cldlayer)) cospOUT%calipso_cldlayer(:,:) = R_UNDEF |
---|
| 2031 | if (associated(cospOUT%calipso_cldlayerphase)) cospOUT%calipso_cldlayerphase(:,:,:) = R_UNDEF |
---|
| 2032 | if (associated(cospOUT%calipso_lidarcldtmp)) cospOUT%calipso_lidarcldtmp(:,:,:) = R_UNDEF |
---|
| 2033 | if (associated(cospOUT%calipso_srbval)) cospOUT%calipso_srbval(:) = R_UNDEF |
---|
| 2034 | if (associated(cospOUT%cloudsat_cfad_ze)) cospOUT%cloudsat_cfad_ze(:,:,:) = R_UNDEF |
---|
| 2035 | if (associated(cospOUT%lidar_only_freq_cloud)) cospOUT%lidar_only_freq_cloud(:,:) = R_UNDEF |
---|
| 2036 | if (associated(cospOUT%radar_lidar_tcc)) cospOUT%radar_lidar_tcc(:) = R_UNDEF |
---|
| 2037 | endif |
---|
| 2038 | if (any(cospIN%tautot .lt. 0)) then |
---|
| 2039 | nError=nError+1 |
---|
| 2040 | errorMessage(nError) = 'ERROR: COSP input variable: cospIN%tautot contains values out of range' |
---|
| 2041 | Lcalipso_subcolumn = .false. |
---|
| 2042 | Lcalipso_column = .false. |
---|
| 2043 | if (associated(cospOUT%calipso_cfad_sr)) cospOUT%calipso_cfad_sr(:,:,:) = R_UNDEF |
---|
| 2044 | if (associated(cospOUT%calipso_lidarcld)) cospOUT%calipso_lidarcld(:,:) = R_UNDEF |
---|
| 2045 | if (associated(cospOUT%calipso_lidarcldphase)) cospOUT%calipso_lidarcldphase(:,:,:) = R_UNDEF |
---|
| 2046 | if (associated(cospOUT%calipso_cldlayer)) cospOUT%calipso_cldlayer(:,:) = R_UNDEF |
---|
| 2047 | if (associated(cospOUT%calipso_cldlayerphase)) cospOUT%calipso_cldlayerphase(:,:,:) = R_UNDEF |
---|
| 2048 | if (associated(cospOUT%calipso_lidarcldtmp)) cospOUT%calipso_lidarcldtmp(:,:,:) = R_UNDEF |
---|
| 2049 | if (associated(cospOUT%calipso_srbval)) cospOUT%calipso_srbval(:) = R_UNDEF |
---|
| 2050 | endif |
---|
| 2051 | if (any(cospIN%tautot_liq .lt. 0)) then |
---|
| 2052 | nError=nError+1 |
---|
| 2053 | errorMessage(nError) = ('ERROR: COSP input variable: cospIN%tautot_liq contains values out of range') |
---|
| 2054 | Lcalipso_subcolumn = .false. |
---|
| 2055 | Lcalipso_column = .false. |
---|
| 2056 | if (associated(cospOUT%calipso_cfad_sr)) cospOUT%calipso_cfad_sr(:,:,:) = R_UNDEF |
---|
| 2057 | if (associated(cospOUT%calipso_lidarcld)) cospOUT%calipso_lidarcld(:,:) = R_UNDEF |
---|
| 2058 | if (associated(cospOUT%calipso_lidarcldphase)) cospOUT%calipso_lidarcldphase(:,:,:) = R_UNDEF |
---|
| 2059 | if (associated(cospOUT%calipso_cldlayer)) cospOUT%calipso_cldlayer(:,:) = R_UNDEF |
---|
| 2060 | if (associated(cospOUT%calipso_cldlayerphase)) cospOUT%calipso_cldlayerphase(:,:,:) = R_UNDEF |
---|
| 2061 | if (associated(cospOUT%calipso_lidarcldtmp)) cospOUT%calipso_lidarcldtmp(:,:,:) = R_UNDEF |
---|
| 2062 | if (associated(cospOUT%calipso_srbval)) cospOUT%calipso_srbval(:) = R_UNDEF |
---|
| 2063 | endif |
---|
| 2064 | if (any(cospIN%tautot_ice .lt. 0)) then |
---|
| 2065 | nError=nError+1 |
---|
| 2066 | errorMessage(nError) = 'ERROR: COSP input variable: cospIN%tautot_ice contains values out of range' |
---|
| 2067 | Lcalipso_subcolumn = .false. |
---|
| 2068 | Lcalipso_column = .false. |
---|
| 2069 | if (associated(cospOUT%calipso_cfad_sr)) cospOUT%calipso_cfad_sr(:,:,:) = R_UNDEF |
---|
| 2070 | if (associated(cospOUT%calipso_lidarcld)) cospOUT%calipso_lidarcld(:,:) = R_UNDEF |
---|
| 2071 | if (associated(cospOUT%calipso_lidarcldphase)) cospOUT%calipso_lidarcldphase(:,:,:) = R_UNDEF |
---|
| 2072 | if (associated(cospOUT%calipso_cldlayer)) cospOUT%calipso_cldlayer(:,:) = R_UNDEF |
---|
| 2073 | if (associated(cospOUT%calipso_cldlayerphase)) cospOUT%calipso_cldlayerphase(:,:,:) = R_UNDEF |
---|
| 2074 | if (associated(cospOUT%calipso_lidarcldtmp)) cospOUT%calipso_lidarcldtmp(:,:,:) = R_UNDEF |
---|
| 2075 | if (associated(cospOUT%calipso_srbval)) cospOUT%calipso_srbval(:) = R_UNDEF |
---|
| 2076 | endif |
---|
| 2077 | if (any(cospIN%tau_mol .lt. 0)) then |
---|
| 2078 | nError=nError+1 |
---|
| 2079 | errorMessage(nError) = 'ERROR: COSP input variable: cospIN%tau_mol contains values out of range' |
---|
| 2080 | Lcalipso_subcolumn = .false. |
---|
| 2081 | Lcalipso_column = .false. |
---|
| 2082 | if (associated(cospOUT%calipso_cfad_sr)) cospOUT%calipso_cfad_sr(:,:,:) = R_UNDEF |
---|
| 2083 | if (associated(cospOUT%calipso_lidarcld)) cospOUT%calipso_lidarcld(:,:) = R_UNDEF |
---|
| 2084 | if (associated(cospOUT%calipso_lidarcldphase)) cospOUT%calipso_lidarcldphase(:,:,:) = R_UNDEF |
---|
| 2085 | if (associated(cospOUT%calipso_cldlayer)) cospOUT%calipso_cldlayer(:,:) = R_UNDEF |
---|
| 2086 | if (associated(cospOUT%calipso_cldlayerphase)) cospOUT%calipso_cldlayerphase(:,:,:) = R_UNDEF |
---|
| 2087 | if (associated(cospOUT%calipso_lidarcldtmp)) cospOUT%calipso_lidarcldtmp(:,:,:) = R_UNDEF |
---|
| 2088 | if (associated(cospOUT%calipso_srbval)) cospOUT%calipso_srbval(:) = R_UNDEF |
---|
| 2089 | endif |
---|
| 2090 | if (any(cospIN%tautot_S_liq .lt. 0)) then |
---|
| 2091 | nError=nError+1 |
---|
| 2092 | errorMessage(nError) = 'ERROR: COSP input variable: cospIN%tautot_S_liq contains values out of range' |
---|
| 2093 | Lparasol_subcolumn = .false. |
---|
| 2094 | Lparasol_column = .false. |
---|
| 2095 | if (associated(cospOUT%parasolPix_refl)) cospOUT%parasolPix_refl(:,:,:) = R_UNDEF |
---|
| 2096 | if (associated(cospOUT%parasolGrid_refl)) cospOUT%parasolGrid_refl(:,:) = R_UNDEF |
---|
| 2097 | endif |
---|
| 2098 | if (any(cospIN%tautot_S_ice .lt. 0)) then |
---|
| 2099 | nError=nError+1 |
---|
| 2100 | errorMessage(nError) = 'ERROR: COSP input variable: cospIN%tautot_S_ice contains values out of range' |
---|
| 2101 | Lparasol_subcolumn = .false. |
---|
| 2102 | Lparasol_column = .false. |
---|
| 2103 | if (associated(cospOUT%parasolPix_refl)) cospOUT%parasolPix_refl(:,:,:) = R_UNDEF |
---|
| 2104 | if (associated(cospOUT%parasolGrid_refl)) cospOUT%parasolGrid_refl(:,:) = R_UNDEF |
---|
| 2105 | endif |
---|
| 2106 | if (any(cospIN%z_vol_cloudsat .lt. 0)) then |
---|
| 2107 | nError=nError+1 |
---|
| 2108 | errorMessage(nError) = 'ERROR: COSP input variable: cospIN%z_vol_cloudsat contains values out of range' |
---|
| 2109 | Lcloudsat_subcolumn = .false. |
---|
| 2110 | Lcloudsat_column = .false. |
---|
| 2111 | Lradar_lidar_tcc = .false. |
---|
| 2112 | Llidar_only_freq_cloud = .false. |
---|
| 2113 | if (associated(cospOUT%cloudsat_cfad_ze)) cospOUT%cloudsat_cfad_ze(:,:,:) = R_UNDEF |
---|
| 2114 | if (associated(cospOUT%cloudsat_Ze_tot)) cospOUT%cloudsat_Ze_tot(:,:,:) = R_UNDEF |
---|
| 2115 | if (associated(cospOUT%lidar_only_freq_cloud)) cospOUT%lidar_only_freq_cloud(:,:) = R_UNDEF |
---|
| 2116 | if (associated(cospOUT%radar_lidar_tcc)) cospOUT%radar_lidar_tcc(:) = R_UNDEF |
---|
| 2117 | endif |
---|
| 2118 | if (any(cospIN%kr_vol_cloudsat .lt. 0)) then |
---|
| 2119 | nError=nError+1 |
---|
| 2120 | errorMessage(nError) = 'ERROR: COSP input variable: cospIN%kr_vol_cloudsat contains values out of range' |
---|
| 2121 | Lcloudsat_subcolumn = .false. |
---|
| 2122 | Lcloudsat_column = .false. |
---|
| 2123 | Lradar_lidar_tcc = .false. |
---|
| 2124 | Llidar_only_freq_cloud = .false. |
---|
| 2125 | if (associated(cospOUT%cloudsat_cfad_ze)) cospOUT%cloudsat_cfad_ze(:,:,:) = R_UNDEF |
---|
| 2126 | if (associated(cospOUT%cloudsat_Ze_tot)) cospOUT%cloudsat_Ze_tot(:,:,:) = R_UNDEF |
---|
| 2127 | if (associated(cospOUT%lidar_only_freq_cloud)) cospOUT%lidar_only_freq_cloud(:,:) = R_UNDEF |
---|
| 2128 | if (associated(cospOUT%radar_lidar_tcc)) cospOUT%radar_lidar_tcc(:) = R_UNDEF |
---|
| 2129 | endif |
---|
| 2130 | if (any(cospIN%g_vol_cloudsat .lt. 0)) then |
---|
| 2131 | nError=nError+1 |
---|
| 2132 | errorMessage(nError) = 'ERROR: COSP input variable: cospIN%g_vol_cloudsat contains values out of range' |
---|
| 2133 | Lcloudsat_subcolumn = .false. |
---|
| 2134 | Lcloudsat_column = .false. |
---|
| 2135 | Lradar_lidar_tcc = .false. |
---|
| 2136 | Llidar_only_freq_cloud = .false. |
---|
| 2137 | if (associated(cospOUT%cloudsat_cfad_ze)) cospOUT%cloudsat_cfad_ze(:,:,:) = R_UNDEF |
---|
| 2138 | if (associated(cospOUT%cloudsat_Ze_tot)) cospOUT%cloudsat_Ze_tot(:,:,:) = R_UNDEF |
---|
| 2139 | if (associated(cospOUT%lidar_only_freq_cloud)) cospOUT%lidar_only_freq_cloud(:,:) = R_UNDEF |
---|
| 2140 | if (associated(cospOUT%radar_lidar_tcc)) cospOUT%radar_lidar_tcc(:) = R_UNDEF |
---|
| 2141 | endif |
---|
| 2142 | !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
---|
| 2143 | ! Part 2: Check input fields array size for consistency. This needs to be done for each |
---|
| 2144 | ! simulator |
---|
| 2145 | !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
---|
| 2146 | ! ISCCP |
---|
| 2147 | if (size(cospIN%frac_out,1) .ne. cospIN%Npoints .OR. & |
---|
| 2148 | size(cospIN%tau_067,1) .ne. cospIN%Npoints .OR. & |
---|
| 2149 | size(cospIN%emiss_11,1) .ne. cospIN%Npoints .OR. & |
---|
| 2150 | size(cospgridIN%skt) .ne. cospIN%Npoints .OR. & |
---|
| 2151 | size(cospgridIN%qv,1) .ne. cospIN%Npoints .OR. & |
---|
| 2152 | size(cospgridIN%at,1) .ne. cospIN%Npoints .OR. & |
---|
| 2153 | size(cospgridIN%phalf,1) .ne. cospIN%Npoints .OR. & |
---|
| 2154 | size(cospgridIN%sunlit) .ne. cospIN%Npoints .OR. & |
---|
| 2155 | size(cospgridIN%pfull,1) .ne. cospIN%Npoints) then |
---|
| 2156 | Lisccp_subcolumn = .false. |
---|
| 2157 | Lisccp_column = .false. |
---|
| 2158 | nError=nError+1 |
---|
| 2159 | errorMessage(nError) = 'ERROR(isccp_simulator): The number of points in the input fields are inconsistent' |
---|
| 2160 | endif |
---|
| 2161 | if (size(cospIN%frac_out,2) .ne. cospIN%Ncolumns .OR. & |
---|
| 2162 | size(cospIN%tau_067,2) .ne. cospIN%Ncolumns .OR. & |
---|
| 2163 | size(cospIN%emiss_11,2) .ne. cospIN%Ncolumns) then |
---|
| 2164 | Lisccp_subcolumn = .false. |
---|
| 2165 | Lisccp_column = .false. |
---|
| 2166 | nError=nError+1 |
---|
| 2167 | errorMessage(nError) = 'ERROR(isccp_simulator): The number of sub-columns in the input fields are inconsistent' |
---|
| 2168 | endif |
---|
| 2169 | if (size(cospIN%frac_out,3) .ne. cospIN%Nlevels .OR. & |
---|
| 2170 | size(cospIN%tau_067,3) .ne. cospIN%Nlevels .OR. & |
---|
| 2171 | size(cospIN%emiss_11,3) .ne. cospIN%Nlevels .OR. & |
---|
| 2172 | size(cospgridIN%qv,2) .ne. cospIN%Nlevels .OR. & |
---|
| 2173 | size(cospgridIN%at,2) .ne. cospIN%Nlevels .OR. & |
---|
| 2174 | size(cospgridIN%pfull,2) .ne. cospIN%Nlevels .OR. & |
---|
| 2175 | size(cospgridIN%phalf,2) .ne. cospIN%Nlevels+1) then |
---|
| 2176 | Lisccp_subcolumn = .false. |
---|
| 2177 | Lisccp_column = .false. |
---|
| 2178 | nError=nError+1 |
---|
| 2179 | errorMessage(nError) = 'ERROR(isccp_simulator): The number of levels in the input fields are inconsistent' |
---|
| 2180 | endif |
---|
| 2181 | |
---|
| 2182 | ! MISR |
---|
| 2183 | if (size(cospIN%tau_067,1) .ne. cospIN%Npoints .OR. & |
---|
| 2184 | size(cospgridIN%sunlit) .ne. cospIN%Npoints .OR. & |
---|
| 2185 | size(cospgridIN%hgt_matrix,1) .ne. cospIN%Npoints .OR. & |
---|
| 2186 | size(cospgridIN%at,1) .ne. cospIN%Npoints) then |
---|
| 2187 | Lmisr_subcolumn = .false. |
---|
| 2188 | Lmisr_column = .false. |
---|
| 2189 | nError=nError+1 |
---|
| 2190 | errorMessage(nError) = 'ERROR(misr_simulator): The number of points in the input fields are inconsistent' |
---|
| 2191 | endif |
---|
| 2192 | if (size(cospIN%tau_067,2) .ne. cospIN%Ncolumns) then |
---|
| 2193 | Lmisr_subcolumn = .false. |
---|
| 2194 | Lmisr_column = .false. |
---|
| 2195 | nError=nError+1 |
---|
| 2196 | errorMessage(nError) = 'ERROR(misr_simulator): The number of sub-columns in the input fields are inconsistent' |
---|
| 2197 | endif |
---|
| 2198 | if (size(cospIN%tau_067,3) .ne. cospIN%Nlevels .OR. & |
---|
| 2199 | size(cospgridIN%hgt_matrix,2) .ne. cospIN%Nlevels .OR. & |
---|
| 2200 | size(cospgridIN%at,2) .ne. cospIN%Nlevels) then |
---|
| 2201 | Lmisr_subcolumn = .false. |
---|
| 2202 | Lmisr_column = .false. |
---|
| 2203 | nError=nError+1 |
---|
| 2204 | errorMessage(nError) = 'ERROR(misr_simulator): The number of levels in the input fields are inconsistent' |
---|
| 2205 | endif |
---|
| 2206 | |
---|
| 2207 | ! MODIS |
---|
| 2208 | if (size(cospIN%fracLiq,1) .ne. cospIN%Npoints .OR. & |
---|
| 2209 | size(cospIN%tau_067,1) .ne. cospIN%Npoints .OR. & |
---|
| 2210 | size(cospIN%asym,1) .ne. cospIN%Npoints .OR. & |
---|
| 2211 | size(cospIN%ss_alb,1) .ne. cospIN%Npoints) then |
---|
| 2212 | Lmodis_subcolumn = .false. |
---|
| 2213 | Lmodis_column = .false. |
---|
| 2214 | nError=nError+1 |
---|
| 2215 | errorMessage(nError) = 'ERROR(modis_simulator): The number of points in the input fields are inconsistent' |
---|
| 2216 | endif |
---|
| 2217 | if (size(cospIN%fracLiq,2) .ne. cospIN%Ncolumns .OR. & |
---|
| 2218 | size(cospIN%tau_067,2) .ne. cospIN%Ncolumns .OR. & |
---|
| 2219 | size(cospIN%asym,2) .ne. cospIN%Ncolumns .OR. & |
---|
| 2220 | size(cospIN%ss_alb,2) .ne. cospIN%Ncolumns) then |
---|
| 2221 | Lmodis_subcolumn = .false. |
---|
| 2222 | Lmodis_column = .false. |
---|
| 2223 | nError=nError+1 |
---|
| 2224 | errorMessage(nError) = 'ERROR(modis_simulator): The number of sub-columns in the input fields are inconsistent' |
---|
| 2225 | endif |
---|
| 2226 | if (size(cospIN%fracLiq,3) .ne. cospIN%Nlevels .OR. & |
---|
| 2227 | size(cospIN%tau_067,3) .ne. cospIN%Nlevels .OR. & |
---|
| 2228 | size(cospIN%asym,3) .ne. cospIN%Nlevels .OR. & |
---|
| 2229 | size(cospIN%ss_alb,3) .ne. cospIN%Nlevels) then |
---|
| 2230 | Lmodis_subcolumn = .false. |
---|
| 2231 | Lmodis_column = .false. |
---|
| 2232 | nError=nError+1 |
---|
| 2233 | errorMessage(nError) = 'ERROR(modis_simulator): The number of levels in the input fields are inconsistent' |
---|
| 2234 | endif |
---|
| 2235 | |
---|
| 2236 | ! CLOUDSAT |
---|
| 2237 | if (size(cospIN%z_vol_cloudsat,1) .ne. cospIN%Npoints .OR. & |
---|
| 2238 | size(cospIN%kr_vol_cloudsat,1) .ne. cospIN%Npoints .OR. & |
---|
| 2239 | size(cospIN%g_vol_cloudsat,1) .ne. cospIN%Npoints .OR. & |
---|
| 2240 | size(cospgridIN%hgt_matrix,1) .ne. cospIN%Npoints) then |
---|
| 2241 | Lcloudsat_subcolumn = .false. |
---|
| 2242 | Lcloudsat_column = .false. |
---|
| 2243 | nError=nError+1 |
---|
| 2244 | errorMessage(nError) = 'ERROR(cloudsat_simulator): The number of points in the input fields are inconsistent' |
---|
| 2245 | endif |
---|
| 2246 | if (size(cospIN%z_vol_cloudsat,2) .ne. cospIN%Ncolumns .OR. & |
---|
| 2247 | size(cospIN%kr_vol_cloudsat,2) .ne. cospIN%Ncolumns .OR. & |
---|
| 2248 | size(cospIN%g_vol_cloudsat,2) .ne. cospIN%Ncolumns) then |
---|
| 2249 | Lcloudsat_subcolumn = .false. |
---|
| 2250 | Lcloudsat_column = .false. |
---|
| 2251 | nError=nError+1 |
---|
| 2252 | errorMessage(nError) = 'ERROR(cloudsat_simulator): The number of sub-columns in the input fields are inconsistent' |
---|
| 2253 | endif |
---|
| 2254 | if (size(cospIN%z_vol_cloudsat,3) .ne. cospIN%Nlevels .OR. & |
---|
| 2255 | size(cospIN%kr_vol_cloudsat,3) .ne. cospIN%Nlevels .OR. & |
---|
| 2256 | size(cospIN%g_vol_cloudsat,3) .ne. cospIN%Nlevels .OR. & |
---|
| 2257 | size(cospgridIN%hgt_matrix,2) .ne. cospIN%Nlevels) then |
---|
| 2258 | Lcloudsat_subcolumn = .false. |
---|
| 2259 | Lcloudsat_column = .false. |
---|
| 2260 | nError=nError+1 |
---|
| 2261 | errorMessage(nError) = 'ERROR(cloudsat_simulator): The number of levels in the input fields are inconsistent' |
---|
| 2262 | endif |
---|
| 2263 | |
---|
| 2264 | ! CALIPSO |
---|
| 2265 | if (size(cospIN%beta_mol,1) .ne. cospIN%Npoints .OR. & |
---|
| 2266 | size(cospIN%betatot,1) .ne. cospIN%Npoints .OR. & |
---|
| 2267 | size(cospIN%betatot_liq,1) .ne. cospIN%Npoints .OR. & |
---|
| 2268 | size(cospIN%betatot_ice,1) .ne. cospIN%Npoints .OR. & |
---|
| 2269 | size(cospIN%tau_mol,1) .ne. cospIN%Npoints .OR. & |
---|
| 2270 | size(cospIN%tautot,1) .ne. cospIN%Npoints .OR. & |
---|
| 2271 | size(cospIN%tautot_liq,1) .ne. cospIN%Npoints .OR. & |
---|
| 2272 | size(cospIN%tautot_ice,1) .ne. cospIN%Npoints) then |
---|
| 2273 | Lcalipso_subcolumn = .false. |
---|
| 2274 | Lcalipso_column = .false. |
---|
| 2275 | nError=nError+1 |
---|
| 2276 | errorMessage(nError) = 'ERROR(calipso_simulator): The number of points in the input fields are inconsistent' |
---|
| 2277 | endif |
---|
| 2278 | if (size(cospIN%betatot,2) .ne. cospIN%Ncolumns .OR. & |
---|
| 2279 | size(cospIN%betatot_liq,2) .ne. cospIN%Ncolumns .OR. & |
---|
| 2280 | size(cospIN%betatot_ice,2) .ne. cospIN%Ncolumns .OR. & |
---|
| 2281 | size(cospIN%tautot,2) .ne. cospIN%Ncolumns .OR. & |
---|
| 2282 | size(cospIN%tautot_liq,2) .ne. cospIN%Ncolumns .OR. & |
---|
| 2283 | size(cospIN%tautot_ice,2) .ne. cospIN%Ncolumns) then |
---|
| 2284 | Lcalipso_subcolumn = .false. |
---|
| 2285 | Lcalipso_column = .false. |
---|
| 2286 | nError=nError+1 |
---|
| 2287 | errorMessage(nError) = 'ERROR(calipso_simulator): The number of sub-columns in the input fields are inconsistent' |
---|
| 2288 | endif |
---|
| 2289 | if (size(cospIN%beta_mol,2) .ne. cospIN%Nlevels .OR. & |
---|
| 2290 | size(cospIN%betatot,3) .ne. cospIN%Nlevels .OR. & |
---|
| 2291 | size(cospIN%betatot_liq,3) .ne. cospIN%Nlevels .OR. & |
---|
| 2292 | size(cospIN%betatot_ice,3) .ne. cospIN%Nlevels .OR. & |
---|
| 2293 | size(cospIN%tau_mol,2) .ne. cospIN%Nlevels .OR. & |
---|
| 2294 | size(cospIN%tautot,3) .ne. cospIN%Nlevels .OR. & |
---|
| 2295 | size(cospIN%tautot_liq,3) .ne. cospIN%Nlevels .OR. & |
---|
| 2296 | size(cospIN%tautot_ice,3) .ne. cospIN%Nlevels) then |
---|
| 2297 | Lcalipso_subcolumn = .false. |
---|
| 2298 | Lcalipso_column = .false. |
---|
| 2299 | nError=nError+1 |
---|
| 2300 | errorMessage(nError) = 'ERROR(calipso_simulator): The number of levels in the input fields are inconsistent' |
---|
| 2301 | endif |
---|
| 2302 | |
---|
| 2303 | ! PARASOL |
---|
| 2304 | if (size(cospIN%tautot_S_liq,1) .ne. cospIN%Npoints .OR. & |
---|
| 2305 | size(cospIN%tautot_S_ice,1) .ne. cospIN%Npoints) then |
---|
| 2306 | Lparasol_subcolumn = .false. |
---|
| 2307 | Lparasol_column = .false. |
---|
| 2308 | nError=nError+1 |
---|
| 2309 | errorMessage(nError) = 'ERROR(parasol_simulator): The number of points in the input fields are inconsistent' |
---|
| 2310 | endif |
---|
| 2311 | if (size(cospIN%tautot_S_liq,2) .ne. cospIN%Ncolumns .OR. & |
---|
| 2312 | size(cospIN%tautot_S_ice,2) .ne. cospIN%Ncolumns) then |
---|
| 2313 | Lparasol_subcolumn = .false. |
---|
| 2314 | Lparasol_column = .false. |
---|
| 2315 | nError=nError+1 |
---|
| 2316 | errorMessage(nError) = 'ERROR(parasol_simulator): The number of levels in the input fields are inconsistent' |
---|
| 2317 | endif |
---|
| 2318 | |
---|
| 2319 | ! RTTOV |
---|
| 2320 | if (size(cospgridIN%pfull,1) .ne. cospIN%Npoints .OR. & |
---|
| 2321 | size(cospgridIN%at,1) .ne. cospIN%Npoints .OR. & |
---|
| 2322 | size(cospgridIN%qv,1) .ne. cospIN%Npoints .OR. & |
---|
| 2323 | size(cospgridIN%hgt_matrix_half,1) .ne. cospIN%Npoints .OR. & |
---|
| 2324 | size(cospgridIN%u_sfc) .ne. cospIN%Npoints .OR. & |
---|
| 2325 | size(cospgridIN%v_sfc) .ne. cospIN%Npoints .OR. & |
---|
| 2326 | size(cospgridIN%skt) .ne. cospIN%Npoints .OR. & |
---|
| 2327 | size(cospgridIN%phalf,1) .ne. cospIN%Npoints .OR. & |
---|
| 2328 | size(cospgridIN%qv,1) .ne. cospIN%Npoints .OR. & |
---|
| 2329 | size(cospgridIN%land) .ne. cospIN%Npoints .OR. & |
---|
| 2330 | size(cospgridIN%lat) .ne. cospIN%Npoints) then |
---|
| 2331 | Lrttov_subcolumn = .false. |
---|
| 2332 | Lrttov_column = .false. |
---|
| 2333 | nError=nError+1 |
---|
| 2334 | errorMessage(nError) = 'ERROR(rttov_simulator): The number of points in the input fields are inconsistent' |
---|
| 2335 | endif |
---|
| 2336 | if (size(cospgridIN%pfull,2) .ne. cospIN%Nlevels .OR. & |
---|
| 2337 | size(cospgridIN%at,2) .ne. cospIN%Nlevels .OR. & |
---|
| 2338 | size(cospgridIN%qv,2) .ne. cospIN%Nlevels .OR. & |
---|
| 2339 | size(cospgridIN%hgt_matrix_half,2) .ne. cospIN%Nlevels+1 .OR. & |
---|
| 2340 | size(cospgridIN%phalf,2) .ne. cospIN%Nlevels+1 .OR. & |
---|
| 2341 | size(cospgridIN%qv,2) .ne. cospIN%Nlevels) then |
---|
| 2342 | Lrttov_subcolumn = .false. |
---|
| 2343 | Lrttov_column = .false. |
---|
| 2344 | nError=nError+1 |
---|
| 2345 | errorMessage(nError) = 'ERROR(rttov_simulator): The number of levels in the input fields are inconsistent' |
---|
| 2346 | endif |
---|
| 2347 | |
---|
| 2348 | end subroutine cosp_errorCheck |
---|
| 2349 | |
---|
| 2350 | !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
---|
| 2351 | ! END MODULE |
---|
| 2352 | !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
---|
| 2353 | END MODULE MOD_COSP |
---|