Changeset 2955 for LMDZ5/trunk/libf/phylmd/cosp
- Timestamp:
- Jul 17, 2017, 5:52:31 PM (7 years ago)
- Location:
- LMDZ5/trunk/libf/phylmd/cosp
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
LMDZ5/trunk/libf/phylmd/cosp/cosp_constants.F90
r2713 r2955 54 54 55 55 ! Number of possible output variables 56 integer,parameter :: N_OUT_LIST = 6557 integer,parameter :: N3D = 1 058 integer,parameter :: N2D = 1 459 integer,parameter :: N1D = 4 056 integer,parameter :: N_OUT_LIST = 74 !OPAQ 65+7 !TIBO 72+2 57 integer,parameter :: N3D = 11 !TIBO 10+1 58 integer,parameter :: N2D = 19 !OPAQ 14+4 !TIBO 18+1 59 integer,parameter :: N1D = 43 !OPAQ 40+3 60 60 61 61 ! Value for forward model result from a level that is under the ground … … 96 96 ! Other constants 97 97 integer,parameter :: LIDAR_NCAT = 4 98 integer,parameter :: LIDAR_NTYPE = 3 !OPAQ 98 99 integer,parameter :: PARASOL_NREFL = 5 ! parasol 99 100 real,parameter,dimension(PARASOL_NREFL) :: PARASOL_SZA = (/0.0, 20.0, 40.0, 60.0, 80.0/) -
LMDZ5/trunk/libf/phylmd/cosp/cosp_output_mod.F90
r2944 r2955 103 103 "clcalipsotmp", "Lidar Cloud Fraction", "%", (/ ('', i=1, 3) /)) 104 104 105 TYPE(ctrl_outcosp), SAVE :: o_clopaquecalipso = ctrl_outcosp((/ .TRUE., .TRUE., .TRUE. /), & !OPAQ 106 "clopaquecalipso", "Lidar Opaque Cloud Fraction", "%", (/ ('', i=1, 3) /)) !OPAQ 107 TYPE(ctrl_outcosp), SAVE :: o_clthincalipso = ctrl_outcosp((/ .TRUE., .TRUE., .TRUE. /), & !OPAQ 108 "clthincalipso", "Lidar Thin Cloud Fraction", "%", (/ ('', i=1, 3) /)) !OPAQ 109 TYPE(ctrl_outcosp), SAVE :: o_clzopaquecalipso = ctrl_outcosp((/ .TRUE., .TRUE., .TRUE. /), & !OPAQ 110 "clzopaquecalipso", "Lidar mean opacity altitude", "m", (/ ('', i=1, 3) /)) !OPAQ 111 TYPE(ctrl_outcosp), SAVE :: o_clcalipsoopaque = ctrl_outcosp((/ .TRUE., .TRUE., .TRUE. /), & !OPAQ 112 "clcalipsoopaque", "Lidar Opaque profile Cloud Fraction", "%", (/ ('', i=1, 3) /)) !OPAQ 113 TYPE(ctrl_outcosp), SAVE :: o_clcalipsothin = ctrl_outcosp((/ .TRUE., .TRUE., .TRUE. /), & !OPAQ 114 "clcalipsothin", "Lidar Thin profile Cloud Fraction", "%", (/ ('', i=1, 3) /)) !OPAQ 115 TYPE(ctrl_outcosp), SAVE :: o_clcalipsozopaque = ctrl_outcosp((/ .TRUE., .TRUE., .TRUE. /), & !OPAQ 116 "clcalipsozopaque", "Lidar z_opaque Fraction", "%", (/ ('', i=1, 3) /)) !OPAQ 117 TYPE(ctrl_outcosp), SAVE :: o_clcalipsoopacity = ctrl_outcosp((/ .TRUE., .TRUE., .TRUE. /), & !OPAQ 118 "clcalipsoopacity", "Lidar opacity Fraction", "%", (/ ('', i=1, 3) /)) !OPAQ 119 120 TYPE(ctrl_outcosp), SAVE :: o_proftemp = ctrl_outcosp((/ .TRUE., .TRUE., .TRUE. /), & !TIBO 121 "proftemp", "Temperature profiles (40 lev)", "K", (/ ('', i=1, 3) /)) !TIBO 122 TYPE(ctrl_outcosp), SAVE :: o_profSR = ctrl_outcosp((/ .TRUE., .TRUE., .TRUE. /), & !TIBO 123 "profSR", "Lidar Scattering Ratio profiles (532 nm)", "1", (/ ('', i=1, 3) /)) !TIBO 124 105 125 ! Radar Cloudsat 106 126 TYPE(ctrl_outcosp), SAVE :: o_cfadDbze94 = ctrl_outcosp((/ .TRUE., .TRUE., .TRUE. /), & … … 376 396 CALL histvert(cosp_nidfiles(iff),"pressure2","pressure","mb",7,ISCCP_PC,nvertisccp(iff),"down") 377 397 378 CALL histvert(cosp_nidfiles(iff),"column","column","count",Ncolumns,column_ax (1:Ncolumns),nvertcol(iff))398 CALL histvert(cosp_nidfiles(iff),"column","column","count",Ncolumns,column_ax,nvertcol(iff)) !DBUG 379 399 380 400 CALL histvert(cosp_nidfiles(iff),"temp","temperature","C",LIDAR_NTEMP,LIDAR_PHASE_TEMP,nverttemp(iff)) -
LMDZ5/trunk/libf/phylmd/cosp/cosp_output_write_mod.F90
r2867 r2955 104 104 stlidar%lidarcld(ip,k)=missing_val 105 105 endif 106 if(stlidar%proftemp(ip,k).eq.R_UNDEF)then !TIBO 107 stlidar%proftemp(ip,k)=missing_val !TIBO 108 endif !TIBO 106 109 enddo 107 110 … … 113 116 enddo 114 117 enddo 115 enddo 118 119 do ii= 1,Ncolumns !TIBO 120 do ip = 1,Npoints !TIBO 121 ! if(stlidar%profSR(ip,ii,k).eq.R_UNDEF)then !TIBO 122 ! stlidar%profSR(ip,ii,k)=missing_val !TIBO 123 if(stlidar%profSR(ip,k,ii).eq.R_UNDEF)then !TIBO2 124 stlidar%profSR(ip,k,ii)=missing_val !TIBO2 125 endif !TIBO 126 enddo !TIBO 127 enddo !TIBO 128 enddo 116 129 117 130 do ip = 1,Npoints … … 138 151 enddo 139 152 153 do k = 1,LIDAR_NTYPE !OPAQ 154 do ip = 1,Npoints !OPAQ 155 if(stlidar%cldtype(ip,k).eq.R_UNDEF)then !OPAQ 156 stlidar%cldtype(ip,k)=missing_val !OPAQ 157 endif !OPAQ 158 enddo !OPAQ 159 enddo !OPAQ 160 140 161 ! AI 11 / 2015 141 162 … … 144 165 where(stlidar%cldlayerphase == R_UNDEF) stlidar%cldlayerphase = missing_val 145 166 where(stlidar%lidarcldphase == R_UNDEF) stlidar%lidarcldphase = missing_val 167 where(stlidar%lidarcldtype == R_UNDEF) stlidar%lidarcldtype = missing_val !OPAQ 146 168 where(stlidar%lidarcldtmp == R_UNDEF) stlidar%lidarcldtmp = missing_val 147 169 … … 176 198 CALL histwrite3d_cosp(o_clcalipsotmpun,stlidar%lidarcldtmp(:,:,4),nverttemp) 177 199 200 CALL histwrite2d_cosp(o_clopaquecalipso,stlidar%cldtype(:,1)) !OPAQ 201 CALL histwrite2d_cosp(o_clthincalipso,stlidar%cldtype(:,2)) !OPAQ 202 CALL histwrite2d_cosp(o_clzopaquecalipso,stlidar%cldtype(:,3)) !OPAQ 203 204 CALL histwrite3d_cosp(o_clcalipsoopaque,stlidar%lidarcldtype(:,:,1),nvert) !OPAQ 205 CALL histwrite3d_cosp(o_clcalipsothin,stlidar%lidarcldtype(:,:,2),nvert) !OPAQ 206 CALL histwrite3d_cosp(o_clcalipsozopaque,stlidar%lidarcldtype(:,:,3),nvert) !OPAQ 207 CALL histwrite3d_cosp(o_clcalipsoopacity,stlidar%lidarcldtype(:,:,4),nvert) !OPAQ 208 209 CALL histwrite3d_cosp(o_proftemp,stlidar%proftemp,nvert) !TIBO 210 178 211 #ifdef CPP_XIOS 179 212 CALL histwrite4d_cosp(o_cfad_lidarsr532,stlidar%cfad_sr) 213 CALL histwrite4d_cosp(o_profSR,stlidar%profSR) !TIBO 180 214 #else 181 215 do icl=1,SR_BINS 182 216 CALL histwrite3d_cosp(o_cfad_lidarsr532,stlidar%cfad_sr(:,icl,:),nvert,icl) 183 217 enddo 184 #endif 185 186 CALL histwrite3d_cosp(o_parasol_refl,stlidar%parasolrefl,nvertp) 218 do icl=1,Ncolumns !TIBO 219 CALL histwrite3d_cosp(o_profSR,stlidar%profSR(:,icl,:),nvert,icl) !TIBO 220 enddo !TIBO 221 CALL histwrite3d_cosp(o_parasol_refl,stlidar%parasolrefl,nvertp) 222 #endif 223 187 224 do k=1,PARASOL_NREFL 188 225 do ip=1, Npoints -
LMDZ5/trunk/libf/phylmd/cosp/cosp_stats.F90
r2428 r2955 121 121 Nlr,vgrid%zl,vgrid%zu,temp_out) 122 122 temp_c(:,:) = temp_out(:,1,:) 123 stlidar%proftemp = temp_c !TIBO 124 where (stlidar%proftemp < 150.) stlidar%proftemp = R_UNDEF !TIBO 125 where (stlidar%proftemp > 350.) stlidar%proftemp = R_UNDEF !TIBO 123 126 124 127 call cosp_change_vertical_grid(Npoints,1,Nlevels,gbx%zlev,gbx%zlev_half,ph_in, & … … 131 134 ,LIDAR_UNDEF,ok_lidar_cfad & 132 135 ,stlidar%cfad_sr,stlidar%srbval & 133 ,LIDAR_NCAT,stlidar%lidarcld,stlidar%lidarcldphase & 134 ,stlidar%cldlayer,stlidar%cldlayerphase,stlidar%lidarcldtmp & 135 ,stlidar%parasolrefl) 136 ,LIDAR_NCAT,LIDAR_NTYPE,stlidar%lidarcld,stlidar%lidarcldtype & !OPAQ 137 ,stlidar%lidarcldphase,stlidar%cldlayer,stlidar%cldtype & !OPAQ 138 ,stlidar%cldlayerphase,stlidar%lidarcldtmp & !OPAQ 139 ,stlidar%parasolrefl,vgrid%z,stlidar%profSR) !OPAQ !TIBO 136 140 endif 137 141 … … 140 144 temp_c,betatot_out,betaperptot_out,betamol_c,Ze_out, & 141 145 stradar%lidar_only_freq_cloud,stradar%radar_lidar_tcc) 142 deallocate(temp_ out,temp_c,betaperptot_out)146 deallocate(temp_in,temp_out,temp_c,betaperptot_out) !TIBO +temp_in 143 147 144 148 ! Deallocate arrays at coarse resolution … … 154 158 ,LIDAR_UNDEF,ok_lidar_cfad & 155 159 ,stlidar%cfad_sr,stlidar%srbval & 156 ,LIDAR_NCAT,stlidar%lidarcld,stlidar%lidarcldphase,stlidar%cldlayer,stlidar%cldlayerphase & 157 ,stlidar%lidarcldtmp,stlidar%parasolrefl) 160 ,LIDAR_NCAT,LIDAR_NTYPE,stlidar%lidarcld,stlidar%lidarcldtype & !OPAQ 161 ,stlidar%lidarcldphase,stlidar%cldlayer,stlidar%cldtype & !OPAQ 162 ,stlidar%cldlayerphase,stlidar%lidarcldtmp & !OPAQ 163 ,stlidar%parasolrefl,vgrid%z,stlidar%profSR) !OPAQ !TIBO 158 164 !++++++++++++ Lidar-only cloud amount and lidar&radar total cloud mount ++++++++++++++++ 159 165 if (cfg%Lradar_sim.and.cfg%Llidar_sim) call cosp_lidar_only_cloud(Npoints,Ncolumns,Nlr, & … … 163 169 ! Replace undef 164 170 where (stlidar%cfad_sr == LIDAR_UNDEF) stlidar%cfad_sr = R_UNDEF 171 where (stlidar%profSR == LIDAR_UNDEF) stlidar%profSR = R_UNDEF !TIBO 165 172 where (stlidar%lidarcld == LIDAR_UNDEF) stlidar%lidarcld = R_UNDEF 173 where (stlidar%lidarcldtype == LIDAR_UNDEF) stlidar%lidarcldtype = R_UNDEF !OPAQ 166 174 where (stlidar%cldlayer == LIDAR_UNDEF) stlidar%cldlayer = R_UNDEF 175 where (stlidar%cldtype == LIDAR_UNDEF) stlidar%cldtype = R_UNDEF !OPAQ 167 176 where (stlidar%parasolrefl == LIDAR_UNDEF) stlidar%parasolrefl = R_UNDEF 168 177 where (stlidar%cldlayerphase == LIDAR_UNDEF) stlidar%cldlayerphase = R_UNDEF -
LMDZ5/trunk/libf/phylmd/cosp/cosp_types.F90
r2713 r2955 51 51 Lcltmodis,Lclwmodis,Lclimodis,Lclhmodis,Lclmmodis,Lcllmodis,Ltautmodis,Ltauwmodis,Ltauimodis,Ltautlogmodis, & 52 52 Ltauwlogmodis,Ltauilogmodis,Lreffclwmodis,Lreffclimodis,Lpctmodis,Llwpmodis, & 53 Liwpmodis,Lclmodis,Lcrimodis,Lcrlmodis 53 Liwpmodis,Lclmodis,Lcrimodis,Lcrlmodis,Lclopaquecalipso,Lclthincalipso, & !OPAQ (2) 54 Lclzopaquecalipso,Lclcalipsoopaque,Lclcalipsothin,Lclcalipsozopaque, & !OPAQ (4) 55 Lclcalipsoopacity,LprofSR,Lproftemp !OPAQ (1) !TIBO (2) 54 56 55 57 character(len=32) :: out_list(N_OUT_LIST) … … 199 201 ! Arrays with dimensions (Npoints,Nlevels) 200 202 real, dimension(:,:),pointer :: lidarcld ! 3D "lidar" cloud fraction 203 real, dimension(:,:),pointer :: proftemp ! Temperature profiles 40 levs !TIBO 201 204 ! Arrays with dimensions (Npoints,LIDAR_NCAT) 202 205 real, dimension(:,:),pointer :: cldlayer ! low, mid, high-level, total lidar cloud cover 203 ! Arrays with dimensions (Npoints,Nlevels,Nphase) 206 ! Arrays with dimensions (Npoints,LIDAR_NTYPE) !OPAQ 207 real, dimension(:,:),pointer :: cldtype ! opaque and thin cloud covers, z_opaque !OPAQ 208 ! Arrays with dimensions (Npoints,Nlevels,Nphase) 204 209 real, dimension(:,:,:),pointer :: lidarcldphase ! 3D "lidar" phase cloud fraction 205 ! Arrays with dimensions (Npoints,LIDAR_NCAT,Nphase) 210 ! Arrays with dimensions (Npoints,Nlevels,LIDAR_NTYPE+1) !OPAQ 211 real, dimension(:,:,:),pointer :: lidarcldtype ! 3D "lidar" OPAQ type fraction + opacity !OPAQ 212 ! Arrays with dimensions (Npoints,LIDAR_NCAT,Nphase) 206 213 real, dimension(:,:,:),pointer :: cldlayerphase ! low, mid, high-level lidar phase cloud cover 207 214 ! Arrays with dimensions (Npoints,Ntemps,Nphase) … … 209 216 ! Arrays with dimensions (Npoints,PARASOL_NREFL) 210 217 real, dimension(:,:),pointer :: parasolrefl ! mean parasol reflectance 218 ! ! Arrays with dimensions (Npoints,Ncolumns,Nlevels) !TIBO 219 ! real, dimension(:,:,:),pointer :: profSR ! subcolumns for each day !TIBO 220 ! Arrays with dimensions (Npoints,Nlevels,Ncolumns) !TIBO2 221 real, dimension(:,:,:),pointer :: profSR ! subcolumns for each day !TIBO2 211 222 212 223 END TYPE COSP_LIDARSTATS … … 803 814 allocate(x%lidarcldphase(i,k,6),x%lidarcldtmp(i,LIDAR_NTEMP,5),& 804 815 x%cldlayerphase(i,LIDAR_NCAT,6)) 816 allocate(x%lidarcldtype(i,k,LIDAR_NTYPE+1),x%cldtype(i,LIDAR_NTYPE)) !OPAQ 817 ! allocate(x%profSR(i,j,k),x%proftemp(i,k)) !TIBO 818 allocate(x%profSR(i,k,j),x%proftemp(i,k)) !TIBO2 805 819 ! --- Initialise to zero --- 806 820 x%srbval = 0.0 … … 812 826 x%cldlayerphase = 0.0 813 827 x%lidarcldtmp = 0.0 828 x%lidarcldtype = 0.0 !OPAQ 829 x%cldtype = 0.0 !OPAQ 830 x%profSR = 0.0 !TIBO 831 x%proftemp = 0.0 !TIBO 814 832 815 833 END SUBROUTINE CONSTRUCT_COSP_LIDARSTATS … … 823 841 deallocate(x%srbval, x%cfad_sr, x%lidarcld, x%cldlayer, x%parasolrefl) 824 842 deallocate(x%cldlayerphase, x%lidarcldtmp, x%lidarcldphase) 843 deallocate(x%lidarcldtype, x%cldtype) !OPAQ 844 deallocate(x%profSR, x%proftemp) !TIBO 825 845 END SUBROUTINE FREE_COSP_LIDARSTATS 826 846 … … 1367 1387 y%cldlayerphase(iy(1):iy(2),:,:) = x%cldlayerphase(ix(1):ix(2),:,:) 1368 1388 y%lidarcldtmp(iy(1):iy(2),:,:) = x%lidarcldtmp(ix(1):ix(2),:,:) 1389 y%lidarcldtype(iy(1):iy(2),:,:) = x%lidarcldtype(ix(1):ix(2),:,:) !OPAQ 1390 y%cldtype(iy(1):iy(2),:) = x%cldtype(ix(1):ix(2),:) !OPAQ 1391 y%profSR(iy(1):iy(2),:,:) = x%profSR(ix(1):ix(2),:,:) !TIBO 1392 y%proftemp(iy(1):iy(2),:) = x%proftemp(ix(1):ix(2),:) !TIBO 1369 1393 END SUBROUTINE COSP_LIDARSTATS_CPSECTION 1370 1394 !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% … … 1599 1623 ! Arrays with dimensions (Npoints,SR_BINS,Nlevels) 1600 1624 print *, 'shape(x%cfad_sr): ',shape(x%cfad_sr) 1625 ! ! Arrays with dimensions (Npoints,Ncolumns,Nlevels) !TIBO 1626 ! print *, 'shape(x%profSR): ',shape(x%profSR) !TIBO 1627 ! Arrays with dimensions (Npoints,Nlevels,Ncolumns) !TIBO2 1628 print *, 'shape(x%profSR): ',shape(x%profSR) !TIBO2 1601 1629 ! Arrays with dimensions (Npoints,Nlevels) 1602 1630 print *, 'shape(x%lidarcld): ',shape(x%lidarcld) 1631 print *, 'shape(x%proftemp): ',shape(x%proftemp) !TIBO 1603 1632 ! Arrays with dimensions (Npoints,LIDAR_NCAT) 1604 1633 print *, 'shape(x%cldlayer): ',shape(x%cldlayer) 1634 ! Arrays with dimensions (Npoints,LIDAR_NTYPE) !OPAQ 1635 print *, 'shape(x%cldtype): ',shape(x%cldtype) !OPAQ 1605 1636 ! Arrays with dimensions (Npoints,PARASOL_NREFL) 1606 1637 print *, 'shape(x%parasolrefl): ',shape(x%parasolrefl) 1607 1638 ! Arrays with dimensions (Npoints,Nlevels,Nphase) 1608 1639 print *, 'shape(x%lidarcldphase): ',shape(x%lidarcldphase) 1640 ! Arrays with dimensions (Npoints,Nlevels,LIDAR_NTYPE+1) !OPAQ 1641 print *, 'shape(x%lidarcldtype): ',shape(x%lidarcldtype) !OPAQ 1609 1642 ! Arrays with dimensions (Npoints,LIDAR_NCAT,Nphase) 1610 1643 print *, 'shape(x%cldlayerphase): ',shape(x%cldlayerphase) -
LMDZ5/trunk/libf/phylmd/cosp/lmd_ipsl_stats.F90
r2428 r2955 36 36 SUBROUTINE diag_lidar(npoints,ncol,llm,max_bin,nrefl & 37 37 ,tmp,pnorm,pnorm_perp,pmol,refl,land,pplay,undef,ok_lidar_cfad & 38 ,cfad2,srbval,ncat, lidarcld,lidarcldphase,cldlayer,cldlayerphase &39 , lidarcldtmp,parasolrefl)38 ,cfad2,srbval,ncat,ntype,lidarcld,lidarcldtype,lidarcldphase,cldlayer & !OPAQ 39 ,cldtype,cldlayerphase,lidarcldtmp,parasolrefl,vgrid_z,profSR) !OPAQ !TIBO 40 40 ! 41 41 ! ----------------------------------------------------------------------------------- … … 82 82 integer max_bin ! nb of bins for SR CFADs 83 83 integer ncat ! nb of cloud layer types (low,mid,high,total) 84 integer ntype ! nb of OPAQ products (opaque and thin clouds, z_opaque) !OPAQ 84 85 integer nrefl ! nb of solar zenith angles for parasol reflectances 85 86 … … 93 94 real tmp(npoints,llm) ! temp at each levels 94 95 real pnorm_perp(npoints,ncol,llm) ! lidar perpendicular ATB 96 real vgrid_z(llm) ! mid-level altitude of the output vertical grid !OPAQ 95 97 96 98 ! c outputs : 97 99 real lidarcld(npoints,llm) ! 3D "lidar" cloud fraction 100 real lidarcldtype(npoints,llm,ntype+1) ! 3D "lidar" OPAQ type fraction + opacity !OPAQ 98 101 real sub(npoints,llm) ! 3D "lidar" indice 99 102 real cldlayer(npoints,ncat) ! "lidar" cloud layer fraction (low, mid, high, total) 103 real cldtype(npoints,ntype) ! "lidar" OPAQ type covers (opaque/thin cloud + z_opaque) !OPAQ 100 104 101 105 real cfad2(npoints,max_bin,llm) ! CFADs of SR 102 106 real srbval(max_bin) ! SR bins in CFADs 103 107 real parasolrefl(npoints,nrefl)! grid-averaged parasol reflectance 108 ! real profSR(npoints,ncol,llm) ! tableau avec les subcolumns SR !TIBO 109 real profSR(npoints,llm,ncol) ! tableau avec les subcolumns SR !TIBO2 104 110 105 111 ! c threshold for cloud detection : … … 110 116 real S_att 111 117 parameter (S_att = 0.01) 118 ! parameter (S_att = 0.06) !OPAQ ! Threshold for "surface detection" equivalent 112 119 113 120 ! c local variables : … … 147 154 end where 148 155 x3d(:,ic,:) = x3d_c 156 ! profSR(:,ic,:) = x3d(:,ic,:) !TIBO 157 profSR(:,:,ic) = x3d(:,ic,:) !TIBO2 149 158 enddo 150 159 … … 157 166 tmp,x3d,pnorm,pnorm_perp,pplay, S_att,S_cld,S_cld_att,undef,lidarcld, & 158 167 cldlayer,lidarcldphase,sub,cldlayerphase,lidarcldtmp) 168 169 CALL COSP_OPAQ(npoints,ncol,llm,ntype,x3d,S_cld,undef,lidarcldtype, & !OPAQ 170 cldtype,vgrid_z) !OPAQ 159 171 160 172 ! c ------------------------------------------------------- … … 983 995 ! --------------------------------------------------------------- 984 996 997 ! BEGINNING OF OPAQ CHANGES 998 ! #################################################################################### 999 ! SUBROUTINE cosp_opaq 1000 ! Conventions: Ntype must be equal to 3 (opaque cloud, thin cloud, z_opaque) 1001 ! #################################################################################### 1002 SUBROUTINE COSP_OPAQ(Npoints,Ncolumns,Nlevels,Ntype,x,S_cld,undef,lidarcldtype, & 1003 cldtype,vgrid_z) 1004 1005 IMPLICIT NONE 1006 ! Input arguments 1007 integer Npoints,Ncolumns,Nlevels,Ntype 1008 real x(Npoints,Ncolumns,Nlevels) 1009 real S_cld 1010 real undef 1011 real vgrid_z(Nlevels) 1012 ! Output : 1013 real lidarcldtype(Npoints,Nlevels,Ntype+1) ! 3D "lidar" OPAQ type + opacity fraction 1014 real cldtype(Npoints,Ntype) ! opaque and thin cloud covers, z_opaque 1015 ! Local variables 1016 integer ip, k, iz, ic, zopac 1017 real p1 1018 real cldy(Npoints,Ncolumns,Nlevels) 1019 real cldyopaq(Npoints,Ncolumns,Nlevels) 1020 real srok(Npoints,Ncolumns,Nlevels) 1021 real srokopaq(Npoints,Ncolumns,Nlevels) 1022 real cldlay(Npoints,Ncolumns,Ntype+1) ! opaque, thin, z_opaque and all cloud cover 1023 real nsublay(Npoints,Ncolumns,Ntype+1) ! opaque, thin, z_opaque and all cloud cover 1024 real nsublayer(Npoints,Ntype) 1025 real nsub(Npoints,Nlevels) 1026 real nsubopaq(Npoints,Nlevels) 1027 real S_att_opaq 1028 real S_att 1029 1030 ! #################################################################################### 1031 ! 1) Initialize 1032 ! #################################################################################### 1033 cldtype = 0.0 1034 lidarcldtype = 0.0 1035 nsub = 0.0 1036 nsubopaq = 0.0 1037 cldlay = 0.0 1038 nsublay = 0.0 1039 nsublayer = 0.0 1040 S_att_opaq = 0.06 ! Fully Attenuated threshold, from Guzman et al. 2017, JGR-A 1041 S_att = 0.01 1042 1043 ! #################################################################################### 1044 ! 2) Cloud detection and Fully attenuated layer detection 1045 ! #################################################################################### 1046 do k=1,Nlevels 1047 ! Cloud detection at subgrid-scale: 1048 where ( (x(:,:,k) .gt. S_cld) .and. (x(:,:,k) .ne. undef) ) 1049 cldy(:,:,k)=1.0 1050 elsewhere 1051 cldy(:,:,k)=0.0 1052 endwhere 1053 ! Fully attenuated layer detection at subgrid-scale: 1054 where ( (x(:,:,k) .gt. 0.0) .and. (x(:,:,k) .lt. S_att_opaq) .and. (x(:,:,k) .ne. undef) ) 1055 cldyopaq(:,:,k)=1.0 1056 elsewhere 1057 cldyopaq(:,:,k)=0.0 1058 endwhere 1059 1060 ! Number of useful sub-column layers: 1061 where ( (x(:,:,k) .gt. S_att) .and. (x(:,:,k) .ne. undef) ) 1062 srok(:,:,k)=1.0 1063 elsewhere 1064 srok(:,:,k)=0.0 1065 endwhere 1066 ! Number of useful sub-columns layers for z_opaque 3D fraction: 1067 where ( (x(:,:,k) .gt. 0.0) .and. (x(:,:,k) .ne. undef) ) 1068 srokopaq(:,:,k)=1.0 1069 elsewhere 1070 srokopaq(:,:,k)=0.0 1071 endwhere 1072 enddo 1073 1074 ! #################################################################################### 1075 ! 3) Grid-box 3D OPAQ product fraction and cloud type cover (opaque/thin) + mean z_opaque 1076 ! #################################################################################### 1077 1078 do k= Nlevels,1,-1 1079 do ic = 1, Ncolumns 1080 do ip = 1, Npoints 1081 1082 cldlay(ip,ic,1) = MAX(cldlay(ip,ic,1),cldyopaq(ip,ic,k)) ! Opaque clouds 1083 cldlay(ip,ic,4) = MAX(cldlay(ip,ic,4),cldy(ip,ic,k)) ! All clouds 1084 1085 nsublay(ip,ic,1) = MAX(nsublay(ip,ic,1),srok(ip,ic,k)) 1086 nsublay(ip,ic,2) = MAX(nsublay(ip,ic,2),srok(ip,ic,k)) 1087 ! nsublay(ip,ic,4) = MAX(nsublay(ip,ic,4),srok(ip,ic,k)) 1088 nsub(ip,k) = nsub(ip,k) + srok(ip,ic,k) 1089 nsubopaq(ip,k) = nsubopaq(ip,k) + srokopaq(ip,ic,k) 1090 1091 enddo 1092 enddo 1093 enddo 1094 1095 ! OPAQ variables 1096 do ic = 1, Ncolumns 1097 do ip = 1, Npoints 1098 1099 ! Declaring non-opaque cloudy profiles as thin cloud profiles 1100 if ( (cldlay(ip,ic,4) .eq. 1.0) .and. (cldlay(ip,ic,1) .eq. 0.0) ) then 1101 cldlay(ip,ic,2) = 1.0 1102 endif 1103 1104 ! Filling in 3D and 2D variables 1105 1106 ! Opaque cloud profiles 1107 if ( cldlay(ip,ic,1) .eq. 1.0 ) then 1108 zopac = 0.0 1109 do k=2,Nlevels 1110 ! Declaring opaque cloud fraction and z_opaque altitude for 3D and 2D variables 1111 if ( (cldy(ip,ic,k) .eq. 1.0) .and. (zopac .eq. 0.0) ) then 1112 lidarcldtype(ip,k-1,3) = lidarcldtype(ip,k-1,3) + 1.0 1113 cldlay(ip,ic,3) = vgrid_z(k-1) !z_opaque altitude 1114 nsublay(ip,ic,3) = 1.0 1115 zopac = 1.0 1116 endif 1117 if ( cldy(ip,ic,k) .eq. 1.0 ) then 1118 lidarcldtype(ip,k,1) = lidarcldtype(ip,k,1) + 1.0 1119 endif 1120 enddo 1121 endif 1122 1123 ! Thin cloud profiles 1124 if ( cldlay(ip,ic,2) .eq. 1.0 ) then 1125 do k=1,Nlevels 1126 ! Declaring thin cloud fraction for 3D variable 1127 if ( cldy(ip,ic,k) .eq. 1.0 ) then 1128 lidarcldtype(ip,k,2) = lidarcldtype(ip,k,2) + 1.0 1129 endif 1130 enddo 1131 endif 1132 1133 enddo 1134 enddo 1135 1136 ! 3D cloud types fraction (opaque=1 and thin=2) 1137 where ( nsub(:,:) .gt. 0.0 ) 1138 lidarcldtype(:,:,1) = lidarcldtype(:,:,1)/nsub(:,:) 1139 lidarcldtype(:,:,2) = lidarcldtype(:,:,2)/nsub(:,:) 1140 elsewhere 1141 lidarcldtype(:,:,1) = undef 1142 lidarcldtype(:,:,2) = undef 1143 endwhere 1144 ! 3D z_opaque fraction (=3) 1145 where ( nsubopaq(:,:) .gt. 0.0 ) 1146 lidarcldtype(:,:,3) = lidarcldtype(:,:,3)/nsubopaq(:,:) 1147 elsewhere 1148 lidarcldtype(:,:,3) = undef 1149 endwhere 1150 ! 3D opacity fraction (=4) !Summing z_opaque fraction from TOA(k=Nlevels) to SFC(k=1) 1151 lidarcldtype(:,Nlevels,4) = lidarcldtype(:,Nlevels,3) 1152 do ip = 1, Npoints 1153 do k = Nlevels-1, 1, -1 1154 if ( lidarcldtype(ip,k,3) .ne. undef ) then 1155 lidarcldtype(ip,k,4) = lidarcldtype(ip,k+1,4) + lidarcldtype(ip,k,3) 1156 endif 1157 enddo 1158 enddo 1159 where ( nsubopaq(:,:) .eq. 0.0 ) 1160 lidarcldtype(:,:,4) = undef 1161 endwhere 1162 1163 ! Layered cloud types (opaque, thin and z_opaque 2D variables) 1164 1165 do iz = 1, Ntype 1166 do ic = 1, Ncolumns 1167 cldtype(:,iz) = cldtype(:,iz) + cldlay(:,ic,iz) 1168 nsublayer(:,iz) = nsublayer(:,iz) + nsublay(:,ic,iz) 1169 enddo 1170 enddo 1171 where (nsublayer(:,:) .gt. 0.0) 1172 cldtype(:,:) = cldtype(:,:)/nsublayer(:,:) 1173 elsewhere 1174 cldtype(:,:) = undef 1175 endwhere 1176 1177 END SUBROUTINE COSP_OPAQ 1178 ! END OF OPAQ CHANGES 1179 985 1180 986 1181 END MODULE MOD_LMD_IPSL_STATS -
LMDZ5/trunk/libf/phylmd/cosp/read_cosp_output_nl.F90
r2713 r2955 41 41 Lcltmodis,Lclwmodis,Lclimodis,Lclhmodis,Lclmmodis,Lcllmodis,Ltautmodis,Ltauwmodis,Ltauimodis,Ltautlogmodis, & 42 42 Ltauwlogmodis,Ltauilogmodis,Lreffclwmodis,Lreffclimodis,Lpctmodis,Llwpmodis, & 43 Liwpmodis,Lclmodis,Lcrimodis,Lcrlmodis 43 Liwpmodis,Lclmodis,Lcrimodis,Lcrlmodis,Lclopaquecalipso,Lclthincalipso, & !OPAQ (2) 44 Lclzopaquecalipso,Lclcalipsoopaque,Lclcalipsothin,Lclcalipsozopaque,Lclcalipsoopacity, & !OPAQ (5) 45 LprofSR,Lproftemp !TIBO (2) 44 46 45 47 namelist/COSP_OUTPUT/Lradar_sim,Llidar_sim,Lisccp_sim,Lmodis_sim,Lmisr_sim,Lrttov_sim, & … … 57 59 Lcltmodis,Lclwmodis,Lclimodis,Lclhmodis,Lclmmodis,Lcllmodis,Ltautmodis,Ltauwmodis,Ltauimodis,Ltautlogmodis, & 58 60 Ltauwlogmodis,Ltauilogmodis,Lreffclwmodis,Lreffclimodis,Lpctmodis,Llwpmodis, & 59 Liwpmodis,Lclmodis,Lcrimodis,Lcrlmodis 61 Liwpmodis,Lclmodis,Lcrimodis,Lcrlmodis,Lclopaquecalipso,Lclthincalipso, & !OPAQ (2) 62 Lclzopaquecalipso,Lclcalipsoopaque,Lclcalipsothin,Lclcalipsozopaque,Lclcalipsoopacity, & !OPAQ (5) 63 LprofSR,Lproftemp !TIBO (2) 60 64 61 65 do i=1,N_OUT_LIST … … 139 143 CALL bcast(Lcrimodis) 140 144 CALL bcast(Lcrlmodis) 145 CALL bcast(Lclopaquecalipso) !OPAQ 146 CALL bcast(Lclthincalipso) !OPAQ 147 CALL bcast(Lclzopaquecalipso) !OPAQ 148 CALL bcast(Lclcalipsoopaque) !OPAQ 149 CALL bcast(Lclcalipsothin) !OPAQ 150 CALL bcast(Lclcalipsozopaque) !OPAQ 151 CALL bcast(Lclcalipsoopacity) !OPAQ 152 CALL bcast(LprofSR) !TIBO 153 CALL bcast(Lproftemp) !TIBO 141 154 142 155 !$OMP BARRIER … … 185 198 Lclmcalipsoun = .false. 186 199 Lcltcalipsoun = .false. 187 endif 200 Lclopaquecalipso = .false. !OPAQ 201 Lclthincalipso = .false. !OPAQ 202 Lclzopaquecalipso = .false. !OPAQ 203 Lclcalipsoopaque = .false. !OPAQ 204 Lclcalipsothin = .false. !OPAQ 205 Lclcalipsozopaque = .false. !OPAQ 206 Lclcalipsoopacity = .false. !OPAQ 207 LprofSR = .false. !TIBO 208 Lproftemp = .false. !TIBO 209 endif 210 188 211 if (.not.Lisccp_sim) then 189 212 Lalbisccp = .false. … … 390 413 i = i+1 391 414 if (Lcrlmodis) cfg%out_list(i) = 'crlmodis' 415 416 i = i+1 !OPAQ 417 if (Lclopaquecalipso) cfg%out_list(i) = 'clopaquecalipso' !OPAQ 418 i = i+1 !OPAQ 419 if (Lclthincalipso) cfg%out_list(i) = 'clthincalipso' !OPAQ 420 i = i+1 !OPAQ 421 if (Lclzopaquecalipso) cfg%out_list(i) = 'clzopaquecalipso' !OPAQ 422 i = i+1 !OPAQ 423 if (Lclcalipsoopaque) cfg%out_list(i) = 'clcalipsoopaque' !OPAQ 424 i = i+1 !OPAQ 425 if (Lclcalipsothin) cfg%out_list(i) = 'clcalipsothin' !OPAQ 426 i = i+1 !OPAQ 427 if (Lclcalipsozopaque) cfg%out_list(i) = 'clcalipsozopaque' !OPAQ 428 i = i+1 !OPAQ 429 if (Lclcalipsoopacity) cfg%out_list(i) = 'clcalipsoopacity' !OPAQ 430 i = i+1 !TIBO 431 if (LprofSR) cfg%out_list(i) = 'profSR' !TIBO 432 i = i+1 !TIBO 433 if (Lproftemp) cfg%out_list(i) = 'proftemp' !TIBO 392 434 393 435 if (i /= N_OUT_LIST) then … … 441 483 cfg%Lcltlidarradar = Lcltlidarradar 442 484 cfg%LparasolRefl = LparasolRefl 485 cfg%Lclopaquecalipso = Lclopaquecalipso !OPAQ 486 cfg%Lclthincalipso = Lclthincalipso !OPAQ 487 cfg%Lclzopaquecalipso = Lclzopaquecalipso !OPAQ 488 cfg%Lclcalipsoopaque = Lclcalipsoopaque !OPAQ 489 cfg%Lclcalipsothin = Lclcalipsothin !OPAQ 490 cfg%Lclcalipsozopaque = Lclcalipsozopaque !OPAQ 491 cfg%Lclcalipsoopacity = Lclcalipsoopacity !OPAQ 492 cfg%LprofSR = LprofSR !TIBO 493 cfg%Lproftemp = Lproftemp !TIBO 443 494 ! MISR simulator 444 495 cfg%LclMISR = LclMISR
Note: See TracChangeset
for help on using the changeset viewer.