Changeset 3798 for LMDZ6/branches/Ocean_skin/libf/phylmd/cospv2
- Timestamp:
- Jan 11, 2021, 11:24:08 PM (3 years ago)
- Location:
- LMDZ6/branches/Ocean_skin
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
LMDZ6/branches/Ocean_skin
-
LMDZ6/branches/Ocean_skin/libf/phylmd/cospv2/cosp_config.F90
r3491 r3798 63 63 N_HYDRO = 9 ! Number of hydrometeor classes used by quickbeam radar simulator. 64 64 65 ! Mode debug ou prod (AI 0302018) 66 logical :: ok_debug_cosp = .true. 65 67 ! #################################################################################### 66 68 ! Joint histogram bin-boundaries -
LMDZ6/branches/Ocean_skin/libf/phylmd/cospv2/cosp_utils.F90
r3491 r3798 56 56 integer :: i,j,k 57 57 real(wp) :: sigma,one_over_xip1,xi,rho0,rho,lambda_x,gamma_4_3_2,delta 58 59 real(wp) :: seuil 60 61 if (ok_debug_cosp) then 62 seuil=1.e-15 63 else 64 seuil=0.0 65 endif 66 67 58 68 59 69 mxratio = 0.0 … … 75 85 mxratio(i,j,k)=mxratio(i,j,k)/rho 76 86 ! Compute effective radius 77 if ((reff(i,j,k) <= 0._wp).and.(flux(i,k) /= 0._wp)) then 87 ! if ((reff(i,j,k) <= 0._wp).and.(flux(i,k) /= 0._wp)) then 88 if ((reff(i,j,k) <= 0._wp).and.(flux(i,k) > seuil)) then 78 89 lambda_x = (a_x*c_x*((rho0/rho)**g_x)*n_ax*gamma1/flux(i,k))**(1._wp/delta) 79 90 reff(i,j,k) = gamma_4_3_2/lambda_x -
LMDZ6/branches/Ocean_skin/libf/phylmd/cospv2/lmdz_cosp_interface.F90
r3511 r3798 74 74 75 75 !!! Modules faisant partie du code source de COSPv2 76 use cosp_kinds, 77 use MOD_COSP_CONFIG, 78 79 use mod_quickbeam_optics, 80 81 use quickbeam, 82 use mod_cosp, 83 84 76 use cosp_kinds, only: wp 77 use MOD_COSP_CONFIG, only: N_HYDRO,RTTOV_MAX_CHANNELS, & 78 niv_sorties, vgrid_z_in 79 use mod_quickbeam_optics, only: size_distribution,hydro_class_init, & 80 quickbeam_optics_init 81 use quickbeam, only: radar_cfg 82 use mod_cosp, only: cosp_init,cosp_optical_inputs, & 83 cosp_column_inputs,cosp_outputs, & 84 cosp_simulator 85 85 86 86 … … 94 94 95 95 ! Local variables 96 character(len=64),PARAMETER :: cosp_input_nl = 'cosp _input_nl.txt'97 character(len=64),PARAMETER :: cosp_output_nl = 'cosp _output_nl.txt'96 character(len=64),PARAMETER :: cosp_input_nl = 'cospv2_input_nl.txt' 97 character(len=64),PARAMETER :: cosp_output_nl = 'cospv2_output_nl.txt' 98 98 99 99 integer, save :: isccp_topheight, isccp_topheight_direction, overlap … … 198 198 199 199 ! Parametres qui sont lus a partir du fichier "cosp_input_nl.txt" 200 namelist/COSP_INPUT/overlap, isccp_topheight, isccp_topheight_direction, 201 npoints_it, ncolumns, use_vgrid_in, csat_vgrid_in, 202 cloudsat_radar_freq, surface_radar, use_mie_tables, 203 cloudsat_use_gas_abs, cloudsat_do_ray, melt_lay, cloudsat_k2, 204 cloudsat_micro_scheme, lidar_ice_type, use_precipitation_fluxes, 200 namelist/COSP_INPUT/overlap, isccp_topheight, isccp_topheight_direction, & 201 npoints_it, ncolumns, use_vgrid_in, csat_vgrid_in, & 202 cloudsat_radar_freq, surface_radar, use_mie_tables, & 203 cloudsat_use_gas_abs, cloudsat_do_ray, melt_lay, cloudsat_k2, & 204 cloudsat_micro_scheme, lidar_ice_type, use_precipitation_fluxes, & 205 205 rttov_platform, rttov_satellite, rttov_Instrument, rttov_Nchannels, & 206 206 rttov_Channels, rttov_Surfem, rttov_ZenAng, co2, ch4, n2o, co … … 215 215 !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 216 216 217 218 217 print*,'Entree lmdz_cosp_interface' !phys_cosp2' 218 if (debut_cosp) then 219 219 NPoints=Nptslmdz 220 220 Nlevels=Nlevlmdz … … 261 261 print*,'ok read cosp_input_nl' 262 262 263 264 !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%265 !266 ! 2) Initialisation de COSPv2267 !268 ! Il y a 2 options possibles pour ecrire les sorties : XIOS ou sorties standard269 !270 ! Si le modele a ete compile AVEC l'option xios, le programme passe par les271 ! bouts de code delimites par "#ifdef CPP_XIOS" et "#else". Dans ce cas,272 ! l'initialisation de COSP se fait au deuxieme appel de cette interface.273 !274 ! Si le modele a ete compile SANS l'option xios, le programme passe par les275 ! bouts de code delimites par "#else" et "#endif". Dans ce cas,276 ! l'initialisation de COSP se fait au premier appel de cette interface.277 !278 !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%279 280 263 ! Clefs Outputs initialisation 281 264 #ifdef CPP_XIOS … … 286 269 287 270 print*,' Cles des differents simulateurs cosp a itap :',itap 288 print*,'cfg%Lcloudsat, cfg%Lcalipso, cfg%LgrLidar532, cfg%Latlid, cfg%Lparasol, &271 print*,'cfg%Lcloudsat, cfg%Lcalipso, cfg%LgrLidar532, cfg%Latlid, cfg%Lparasol, & 289 272 cfg%Lisccp, cfg%Lmisr, cfg%Lmodis, cfg%Lrttov', & 290 273 cfg%Lcloudsat, cfg%Lcalipso, cfg%LgrLidar532, cfg%Latlid, cfg%Lparasol, & 291 274 cfg%Lisccp, cfg%Lmisr, cfg%Lmodis, cfg%Lrttov 292 275 293 276 if (overlaplmdz.ne.overlap) then … … 309 292 call quickbeam_optics_init() 310 293 311 print*,' just before call COSP_INIT, cosp_init_flag =', cosp_init_flag294 print*,' just before call COSP_INIT, cosp_init_flag =', cosp_init_flag 312 295 call COSP_INIT(cfg%Lisccp, cfg%Lmodis, cfg%Lmisr, cfg%Lcloudsat, cfg%Lcalipso, & 313 314 315 316 317 318 cosp_init_flag = 1296 cfg%LgrLidar532, cfg%Latlid, cfg%Lparasol, cfg%Lrttov, & 297 cloudsat_radar_freq, cloudsat_k2, cloudsat_use_gas_abs, & 298 cloudsat_do_ray, isccp_topheight, isccp_topheight_direction, & 299 surface_radar, rcfg_cloudsat, use_vgrid_in, csat_vgrid_in, & 300 niv_sorties, Nlevels, cloudsat_micro_scheme) 301 cosp_init_flag = 1 319 302 print*,' just after call COSP_INIT, cosp_init_flag =', cosp_init_flag 320 303 endif 321 304 #endif 322 305 323 306 print*,'Fin lecture Namelists, debut_cosp =',debut_cosp 324 307 325 308 endif ! debut_cosp … … 327 310 328 311 !!! Ici on modifie les cles logiques pour les outputs selon les champs actives dans les .xml 329 if ((itap.g t.1).and.(first_write))then312 if ((itap.ge.1).and.(first_write))then 330 313 #ifdef CPP_XIOS 331 314 call read_xiosfieldactive(cfg) … … 344 327 call quickbeam_optics_init() 345 328 346 print*,' just before call COSP_INIT, cosp_init_flag =', cosp_init_flag329 print*,' just before call COSP_INIT, cosp_init_flag =', cosp_init_flag 347 330 call COSP_INIT(cfg%Lisccp, cfg%Lmodis, cfg%Lmisr, cfg%Lcloudsat, cfg%Lcalipso, & 348 349 350 351 352 353 cosp_init_flag = 1331 cfg%LgrLidar532, cfg%Latlid, cfg%Lparasol, cfg%Lrttov, & 332 cloudsat_radar_freq, cloudsat_k2, cloudsat_use_gas_abs, & 333 cloudsat_do_ray, isccp_topheight, isccp_topheight_direction, & 334 surface_radar, rcfg_cloudsat, use_vgrid_in, csat_vgrid_in, & 335 niv_sorties, Nlevels, cloudsat_micro_scheme) 336 cosp_init_flag = 1 354 337 print*,' just after call COSP_INIT, cosp_init_flag =', cosp_init_flag 355 338 endif ! cosp_init_flag … … 573 556 print *, 'Calling write output' 574 557 call lmdz_cosp_output_write(Nlevlmdz, Npoints, Ncolumns, itap, dtime, freq_COSP, & 575 558 missing_val, cfg, niv_sorties, cospOUT) 576 559 577 560 !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -
LMDZ6/branches/Ocean_skin/libf/phylmd/cospv2/lmdz_cosp_output_write_mod.F90
r3491 r3798 30 30 31 31 SUBROUTINE lmdz_cosp_output_write(Nlevlmdz, Npoints, Ncolumns, itap, dtime, freq_COSP, missing_cosp, & 32 32 cfg, Nlvgrid, cospOUT) 33 33 34 34 … … 41 41 use mod_cosp, only: cosp_outputs 42 42 43 #ifdef CPP_XIOS44 43 USE wxios, only: wxios_closedef 45 44 USE xios, only: xios_update_calendar, xios_field_is_active 46 #endif47 45 IMPLICIT NONE 48 46 !!! Variables d'entree … … 62 60 ! Variables locals intermidiaires pour inverser les axes des champs 4D 63 61 ! Compatibilite avec sorties CMIP 64 real, dimension(Npoints,Nl evout,SR_BINS) :: tmp_fi4da_cfadL, tmp_fi4da_cfadLgr, tmp_fi4da_cfadLatlid65 real, dimension(Npoints,Nl evout,CLOUDSAT_DBZE_BINS) :: tmp_fi4da_cfadR62 real, dimension(Npoints,Nlvgrid,SR_BINS) :: tmp_fi4da_cfadL, tmp_fi4da_cfadLgr, tmp_fi4da_cfadLatlid 63 real, dimension(Npoints,Nlvgrid,CLOUDSAT_DBZE_BINS) :: tmp_fi4da_cfadR 66 64 real, dimension(Npoints,numMISRHgtBins,7) :: tmp_fi4da_misr 67 65 68 #ifdef CPP_XIOS69 66 missing_val=missing_cosp 70 #else71 missing_val=0.72 #endif73 67 74 68 Nlevout = Nlvgrid … … 90 84 ok_sync = .TRUE. 91 85 92 !DO iinit=1, iinitend93 ! AI sept 2014 cette boucle supprimee94 ! On n'ecrit pas quand itap=1 (cosp)95 96 ! if (prt_level >= 10) then97 ! WRITE(lunout,*)'DO iinit=1, iinitend ',iinitend98 ! endif99 100 !!#ifdef CPP_XIOS101 ! !$OMP MASTER102 !IF (cosp_varsdefined) THEN103 ! if (prt_level >= 10) then104 ! WRITE(lunout,*)'Apell xios_update_calendar cosp_varsdefined iinitend ', &105 ! cosp_varsdefined,iinitend106 ! endif107 ! CALL xios_update_calendar(itau_wcosp)108 !ENDIF109 ! !$OMP END MASTER110 ! !$OMP BARRIER111 !!#endif112 113 86 !!!! Sorties Calipso 114 87 if (cfg%Lcalipso) then 115 !!! AI 02 2018116 ! Traitement missing_val117 !!! where(stlidar%lidarcld == R_UNDEF) stlidar%lidarcld = missing_val118 !!! where(sglidar%beta_mol == R_UNDEF) sglidar%beta_mol = missing_val119 !!! where(sglidar%beta_tot == R_UNDEF) sglidar%beta_tot = missing_val120 !!! where(stlidar%cldlayer == R_UNDEF) stlidar%cldlayer = missing_val121 ! where(stlidar%cldtype == R_UNDEF) stlidar%cldtype = missing_val !OPAQ122 !!! where(stlidar%cfad_sr == R_UNDEF) stlidar%cfad_sr = missing_val123 ! AI 11 / 2015124 !!! where(stlidar%parasolrefl == R_UNDEF) stlidar%parasolrefl = missing_val125 !!! where(stlidar%lidarcldtmp == R_UNDEF) stlidar%lidarcldtmp = missing_val126 !!! where(stlidar%cldlayerphase == R_UNDEF) stlidar%cldlayerphase = missing_val127 !!! where(stlidar%lidarcldphase == R_UNDEF) stlidar%lidarcldphase = missing_val128 ! where(stlidar%lidarcldtype == R_UNDEF) stlidar%lidarcldtype = missing_val !OPAQ129 !!! where(stlidar%lidarcldtmp == R_UNDEF) stlidar%lidarcldtmp = missing_val130 131 !!! missing values pour toutes les valeurs R_UNDEF des variables de CALIPSO132 ! where(cospOUT%calipso_betaperp_tot == R_UNDEF) cospOUT%calipso_betaperp_tot = missing_val133 where(cospOUT%calipso_beta_tot == R_UNDEF) cospOUT%calipso_beta_tot = missing_val134 where(cospOUT%calipso_tau_tot == R_UNDEF) cospOUT%calipso_tau_tot = missing_val135 where(cospOUT%calipso_lidarcldphase == R_UNDEF) cospOUT%calipso_lidarcldphase = missing_val136 where(cospOUT%calipso_lidarcldtype == R_UNDEF) cospOUT%calipso_lidarcldtype = missing_val137 where(cospOUT%calipso_cldlayerphase == R_UNDEF) cospOUT%calipso_cldlayerphase = missing_val138 where(cospOUT%calipso_lidarcldtmp == R_UNDEF) cospOUT%calipso_lidarcldtmp = missing_val139 where(cospOUT%calipso_cfad_sr == R_UNDEF) cospOUT%calipso_cfad_sr = missing_val140 where(cospOUT%calipso_lidarcld == R_UNDEF) cospOUT%calipso_lidarcld = missing_val141 where(cospOUT%calipso_cldlayer == R_UNDEF) cospOUT%calipso_cldlayer = missing_val142 where(cospOUT%calipso_cldtype == R_UNDEF) cospOUT%calipso_cldtype = missing_val143 where(cospOUT%calipso_cldtypetemp == R_UNDEF) cospOUT%calipso_cldtypetemp = missing_val144 where(cospOUT%calipso_cldtypemeanz == R_UNDEF) cospOUT%calipso_cldtypemeanz = missing_val145 where(cospOUT%calipso_cldtypemeanzse == R_UNDEF) cospOUT%calipso_cldtypemeanzse = missing_val146 where(cospOUT%calipso_beta_mol == R_UNDEF) cospOUT%calipso_beta_mol = missing_val147 where(cospOUT%calipso_temp_tot == R_UNDEF) cospOUT%calipso_temp_tot = missing_val148 where(cospOUT%calipso_cldthinemis == R_UNDEF) cospOUT%calipso_cldthinemis = missing_val149 where(cospOUT%calipso_srbval == R_UNDEF) cospOUT%calipso_srbval = missing_val150 151 88 152 89 ! print*,'Appel histwrite2d_cosp' 153 if (cfg%Lcllcalipso) CALL histwrite2d_cosp(o_cllcalipso,cospOUT%calipso_cldlayer(:,1)) 154 if (cfg%Lclhcalipso) CALL histwrite2d_cosp(o_clhcalipso,cospOUT%calipso_cldlayer(:,3)) 155 if (cfg%Lclmcalipso) CALL histwrite2d_cosp(o_clmcalipso,cospOUT%calipso_cldlayer(:,2)) 156 if (cfg%Lcltcalipso) CALL histwrite2d_cosp(o_cltcalipso,cospOUT%calipso_cldlayer(:,4)) 157 if (cfg%Lclcalipso) CALL histwrite3d_cosp(o_clcalipso,cospOUT%calipso_lidarcld,nvert) 158 if (cfg%Lclcalipsotmp) CALL histwrite3d_cosp(o_clcalipsotmp,cospOUT%calipso_lidarcldtmp(:,:,1),nverttemp) 159 160 if (cfg%Lcllcalipsoice) CALL histwrite2d_cosp(o_cllcalipsoice,cospOUT%calipso_cldlayerphase(:,1,1)) 161 if (cfg%Lclhcalipsoice) CALL histwrite2d_cosp(o_clhcalipsoice,cospOUT%calipso_cldlayerphase(:,3,1)) 162 if (cfg%Lclmcalipsoice) CALL histwrite2d_cosp(o_clmcalipsoice,cospOUT%calipso_cldlayerphase(:,2,1)) 163 if (cfg%Lcltcalipsoice) CALL histwrite2d_cosp(o_cltcalipsoice,cospOUT%calipso_cldlayerphase(:,4,1)) 164 if (cfg%Lclcalipsoice) CALL histwrite3d_cosp(o_clcalipsoice,cospOUT%calipso_lidarcldphase(:,:,1),nvert) 165 if (cfg%Lclcalipsotmpice) CALL histwrite3d_cosp(o_clcalipsotmpice,cospOUT%calipso_lidarcldtmp(:,:,2),nverttemp) 166 167 if (cfg%Lcllcalipsoliq) CALL histwrite2d_cosp(o_cllcalipsoliq,cospOUT%calipso_cldlayerphase(:,1,2)) 168 if (cfg%Lclhcalipsoliq) CALL histwrite2d_cosp(o_clhcalipsoliq,cospOUT%calipso_cldlayerphase(:,3,2)) 169 if (cfg%Lclmcalipsoliq) CALL histwrite2d_cosp(o_clmcalipsoliq,cospOUT%calipso_cldlayerphase(:,2,2)) 170 if (cfg%Lcltcalipsoliq) CALL histwrite2d_cosp(o_cltcalipsoliq,cospOUT%calipso_cldlayerphase(:,4,2)) 171 if (cfg%Lclcalipsoliq) CALL histwrite3d_cosp(o_clcalipsoliq,cospOUT%calipso_lidarcldphase(:,:,2),nvert) 172 if (cfg%Lclcalipsotmpliq) CALL histwrite3d_cosp(o_clcalipsotmpliq,cospOUT%calipso_lidarcldtmp(:,:,3),nverttemp) 173 174 if (cfg%Lcllcalipsoun) CALL histwrite2d_cosp(o_cllcalipsoun,cospOUT%calipso_cldlayerphase(:,1,3)) 175 if (cfg%Lclhcalipsoun) CALL histwrite2d_cosp(o_clhcalipsoun,cospOUT%calipso_cldlayerphase(:,3,3)) 176 if (cfg%Lclmcalipsoun) CALL histwrite2d_cosp(o_clmcalipsoun,cospOUT%calipso_cldlayerphase(:,2,3)) 177 if (cfg%Lcltcalipsoun) CALL histwrite2d_cosp(o_cltcalipsoun,cospOUT%calipso_cldlayerphase(:,4,3)) 178 if (cfg%Lclcalipsoun) CALL histwrite3d_cosp(o_clcalipsoun,cospOUT%calipso_lidarcldphase(:,:,3),nvert) 179 if (cfg%Lclcalipsotmpun) CALL histwrite3d_cosp(o_clcalipsotmpun,cospOUT%calipso_lidarcldtmp(:,:,4),nverttemp) 180 181 if (cfg%Lclopaquecalipso) CALL histwrite2d_cosp(o_clopaquecalipso,cospOUT%calipso_cldtype(:,1)) 182 if (cfg%Lclthincalipso) CALL histwrite2d_cosp(o_clthincalipso,cospOUT%calipso_cldtype(:,2)) 183 if (cfg%Lclzopaquecalipso) CALL histwrite2d_cosp(o_clzopaquecalipso,cospOUT%calipso_cldtype(:,3)) 184 if (cfg%Lclcalipsoopaque) CALL histwrite3d_cosp(o_clcalipsoopaque,cospOUT%calipso_lidarcldtype(:,:,1),nvert) 185 if (cfg%Lclcalipsothin) CALL histwrite3d_cosp(o_clcalipsothin,cospOUT%calipso_lidarcldtype(:,:,2),nvert) 186 if (cfg%Lclcalipsozopaque) CALL histwrite3d_cosp(o_clcalipsozopaque,cospOUT%calipso_lidarcldtype(:,:,3),nvert) 187 if (cfg%Lclcalipsoopacity) CALL histwrite3d_cosp(o_clcalipsoopacity,cospOUT%calipso_lidarcldtype(:,:,4),nvert) 188 189 if (cfg%Lclopaquetemp) CALL histwrite2d_cosp(o_clopaquetemp,cospOUT%calipso_cldtypetemp(:,1)) 190 if (cfg%Lclthintemp) CALL histwrite2d_cosp(o_clthintemp,cospOUT%calipso_cldtypetemp(:,2)) 191 if (cfg%Lclzopaquetemp) CALL histwrite2d_cosp(o_clzopaquetemp,cospOUT%calipso_cldtypetemp(:,3)) 192 if (cfg%Lclopaquemeanz) CALL histwrite2d_cosp(o_clopaquemeanz,cospOUT%calipso_cldtypemeanz(:,1)) 193 if (cfg%Lclthinmeanz) CALL histwrite2d_cosp(o_clthinmeanz,cospOUT%calipso_cldtypemeanz(:,2)) 194 if (cfg%Lclthinemis) CALL histwrite2d_cosp(o_clthinemis,cospOUT%calipso_cldthinemis) 195 if (cfg%Lclopaquemeanzse) CALL histwrite2d_cosp(o_clopaquemeanzse,cospOUT%calipso_cldtypemeanzse(:,1)) 196 if (cfg%Lclthinmeanzse) CALL histwrite2d_cosp(o_clthinmeanzse,cospOUT%calipso_cldtypemeanzse(:,2)) 197 if (cfg%Lclzopaquecalipsose) CALL histwrite2d_cosp(o_clzopaquecalipsose,cospOUT%calipso_cldtypemeanzse(:,3)) 198 199 200 #ifdef CPP_XIOS 201 do icl=1,SR_BINS 202 tmp_fi4da_cfadL(:,:,icl)=cospOUT%calipso_cfad_sr(:,icl,:) 203 enddo 90 if (cfg%Lcllcalipso) then 91 where(cospOUT%calipso_cldlayer(:,1) == R_UNDEF) cospOUT%calipso_cldlayer(:,1) = missing_val 92 CALL histwrite2d_cosp(o_cllcalipso,cospOUT%calipso_cldlayer(:,1)) 93 endif 94 if (cfg%Lclhcalipso) then 95 where(cospOUT%calipso_cldlayer(:,3) == R_UNDEF) cospOUT%calipso_cldlayer(:,3) = missing_val 96 CALL histwrite2d_cosp(o_clhcalipso,cospOUT%calipso_cldlayer(:,3)) 97 endif 98 if (cfg%Lclmcalipso) then 99 where(cospOUT%calipso_cldlayer(:,2) == R_UNDEF) cospOUT%calipso_cldlayer(:,2) = missing_val 100 CALL histwrite2d_cosp(o_clmcalipso,cospOUT%calipso_cldlayer(:,2)) 101 endif 102 if (cfg%Lcltcalipso) then 103 where(cospOUT%calipso_cldlayer(:,4) == R_UNDEF) cospOUT%calipso_cldlayer(:,4) = missing_val 104 CALL histwrite2d_cosp(o_cltcalipso,cospOUT%calipso_cldlayer(:,4)) 105 endif 106 if (cfg%Lclcalipso) then 107 where(cospOUT%calipso_lidarcld == R_UNDEF) cospOUT%calipso_lidarcld = missing_val 108 CALL histwrite3d_cosp(o_clcalipso,cospOUT%calipso_lidarcld,nvert) 109 endif 110 if (cfg%Lclcalipsotmp) then 111 where(cospOUT%calipso_lidarcldtmp(:,:,1) == R_UNDEF) cospOUT%calipso_lidarcldtmp(:,:,1) = missing_val 112 CALL histwrite3d_cosp(o_clcalipsotmp,cospOUT%calipso_lidarcldtmp(:,:,1),nverttemp) 113 endif 114 115 if (cfg%Lcllcalipsoice) then 116 where(cospOUT%calipso_cldlayerphase(:,1,1) == R_UNDEF) cospOUT%calipso_cldlayerphase(:,1,1) = missing_val 117 CALL histwrite2d_cosp(o_cllcalipsoice,cospOUT%calipso_cldlayerphase(:,1,1)) 118 endif 119 if (cfg%Lclhcalipsoice) then 120 where(cospOUT%calipso_cldlayerphase(:,3,1) == R_UNDEF) cospOUT%calipso_cldlayerphase(:,3,1) = missing_val 121 CALL histwrite2d_cosp(o_clhcalipsoice,cospOUT%calipso_cldlayerphase(:,3,1)) 122 endif 123 if (cfg%Lclmcalipsoice) then 124 where(cospOUT%calipso_cldlayerphase(:,2,1) == R_UNDEF) cospOUT%calipso_cldlayerphase(:,2,1) = missing_val 125 CALL histwrite2d_cosp(o_clmcalipsoice,cospOUT%calipso_cldlayerphase(:,2,1)) 126 endif 127 if (cfg%Lcltcalipsoice) then 128 where(cospOUT%calipso_cldlayerphase(:,4,1) == R_UNDEF) cospOUT%calipso_cldlayerphase(:,4,1) = missing_val 129 CALL histwrite2d_cosp(o_cltcalipsoice,cospOUT%calipso_cldlayerphase(:,4,1)) 130 endif 131 if (cfg%Lclcalipsoice) then 132 where(cospOUT%calipso_lidarcldphase(:,:,1) == R_UNDEF) cospOUT%calipso_lidarcldphase(:,:,1) = missing_val 133 CALL histwrite3d_cosp(o_clcalipsoice,cospOUT%calipso_lidarcldphase(:,:,1),nvert) 134 endif 135 if (cfg%Lclcalipsotmpice) then 136 where(cospOUT%calipso_lidarcldtmp(:,:,2) == R_UNDEF) cospOUT%calipso_lidarcldtmp(:,:,2) = missing_val 137 CALL histwrite3d_cosp(o_clcalipsotmpice,cospOUT%calipso_lidarcldtmp(:,:,2),nverttemp) 138 endif 139 140 if (cfg%Lcllcalipsoliq) then 141 where(cospOUT%calipso_cldlayerphase(:,1,2) == R_UNDEF) cospOUT%calipso_cldlayerphase(:,1,2) = missing_val 142 CALL histwrite2d_cosp(o_cllcalipsoliq,cospOUT%calipso_cldlayerphase(:,1,2)) 143 endif 144 if (cfg%Lclhcalipsoliq) then 145 where(cospOUT%calipso_cldlayerphase(:,3,2) == R_UNDEF) cospOUT%calipso_cldlayerphase(:,3,2) = missing_val 146 CALL histwrite2d_cosp(o_clhcalipsoliq,cospOUT%calipso_cldlayerphase(:,3,2)) 147 endif 148 if (cfg%Lclmcalipsoliq) then 149 where(cospOUT%calipso_cldlayerphase(:,2,2) == R_UNDEF) cospOUT%calipso_cldlayerphase(:,2,2) = missing_val 150 CALL histwrite2d_cosp(o_clmcalipsoliq,cospOUT%calipso_cldlayerphase(:,2,2)) 151 endif 152 if (cfg%Lcltcalipsoliq) then 153 where(cospOUT%calipso_cldlayerphase(:,4,2) == R_UNDEF) cospOUT%calipso_cldlayerphase(:,4,2) = missing_val 154 CALL histwrite2d_cosp(o_cltcalipsoliq,cospOUT%calipso_cldlayerphase(:,4,2)) 155 endif 156 if (cfg%Lclcalipsoliq) then 157 where(cospOUT%calipso_lidarcldphase(:,:,2) == R_UNDEF) cospOUT%calipso_lidarcldphase(:,:,2) = missing_val 158 CALL histwrite3d_cosp(o_clcalipsoliq,cospOUT%calipso_lidarcldphase(:,:,2),nvert) 159 endif 160 if (cfg%Lclcalipsotmpliq) then 161 where(cospOUT%calipso_lidarcldtmp(:,:,3) == R_UNDEF) cospOUT%calipso_lidarcldtmp(:,:,3) = missing_val 162 CALL histwrite3d_cosp(o_clcalipsotmpliq,cospOUT%calipso_lidarcldtmp(:,:,3),nverttemp) 163 endif 164 if (cfg%Lcllcalipsoun) then 165 where(cospOUT%calipso_cldlayerphase(:,1,3) == R_UNDEF) cospOUT%calipso_cldlayerphase(:,1,3) = missing_val 166 CALL histwrite2d_cosp(o_cllcalipsoun,cospOUT%calipso_cldlayerphase(:,1,3)) 167 endif 168 if (cfg%Lclhcalipsoun) then 169 where(cospOUT%calipso_cldlayerphase(:,3,3) == R_UNDEF) cospOUT%calipso_cldlayerphase(:,3,3) = missing_val 170 CALL histwrite2d_cosp(o_clhcalipsoun,cospOUT%calipso_cldlayerphase(:,3,3)) 171 endif 172 if (cfg%Lclmcalipsoun) then 173 where(cospOUT%calipso_cldlayerphase(:,2,3) == R_UNDEF) cospOUT%calipso_cldlayerphase(:,2,3) = missing_val 174 CALL histwrite2d_cosp(o_clmcalipsoun,cospOUT%calipso_cldlayerphase(:,2,3)) 175 endif 176 if (cfg%Lcltcalipsoun) then 177 where(cospOUT%calipso_cldlayerphase(:,4,3) == R_UNDEF) cospOUT%calipso_cldlayerphase(:,4,3) = missing_val 178 CALL histwrite2d_cosp(o_cltcalipsoun,cospOUT%calipso_cldlayerphase(:,4,3)) 179 endif 180 if (cfg%Lclcalipsoun) then 181 where(cospOUT%calipso_lidarcldphase(:,:,3) == R_UNDEF) cospOUT%calipso_lidarcldphase(:,:,3) = missing_val 182 CALL histwrite3d_cosp(o_clcalipsoun,cospOUT%calipso_lidarcldphase(:,:,3),nvert) 183 endif 184 if (cfg%Lclcalipsotmpun) then 185 where(cospOUT%calipso_lidarcldtmp(:,:,4) == R_UNDEF) cospOUT%calipso_lidarcldtmp(:,:,4) = missing_val 186 CALL histwrite3d_cosp(o_clcalipsotmpun,cospOUT%calipso_lidarcldtmp(:,:,4),nverttemp) 187 endif 188 189 if (cfg%Lclopaquecalipso) then 190 where(cospOUT%calipso_cldtype(:,1) == R_UNDEF) cospOUT%calipso_cldtype(:,1) = missing_val 191 CALL histwrite2d_cosp(o_clopaquecalipso,cospOUT%calipso_cldtype(:,1)) 192 endif 193 if (cfg%Lclthincalipso) then 194 where(cospOUT%calipso_cldtype(:,2) == R_UNDEF) cospOUT%calipso_cldtype(:,2) = missing_val 195 CALL histwrite2d_cosp(o_clthincalipso,cospOUT%calipso_cldtype(:,2)) 196 endif 197 if (cfg%Lclzopaquecalipso) then 198 where(cospOUT%calipso_cldtype(:,3) == R_UNDEF) cospOUT%calipso_cldtype(:,3) = missing_val 199 CALL histwrite2d_cosp(o_clzopaquecalipso,cospOUT%calipso_cldtype(:,3)) 200 endif 201 if (cfg%Lclcalipsoopaque) then 202 where(cospOUT%calipso_lidarcldtype(:,:,1) == R_UNDEF) cospOUT%calipso_lidarcldtype(:,:,1) = missing_val 203 CALL histwrite3d_cosp(o_clcalipsoopaque,cospOUT%calipso_lidarcldtype(:,:,1),nvert) 204 endif 205 if (cfg%Lclcalipsothin) then 206 where(cospOUT%calipso_lidarcldtype(:,:,2) == R_UNDEF) cospOUT%calipso_lidarcldtype(:,:,2) = missing_val 207 CALL histwrite3d_cosp(o_clcalipsothin,cospOUT%calipso_lidarcldtype(:,:,2),nvert) 208 endif 209 if (cfg%Lclcalipsozopaque) then 210 where(cospOUT%calipso_lidarcldtype(:,:,3) == R_UNDEF) cospOUT%calipso_lidarcldtype(:,:,3) = missing_val 211 CALL histwrite3d_cosp(o_clcalipsozopaque,cospOUT%calipso_lidarcldtype(:,:,3),nvert) 212 endif 213 if (cfg%Lclcalipsoopacity) then 214 where(cospOUT%calipso_lidarcldtype(:,:,4) == R_UNDEF) cospOUT%calipso_lidarcldtype(:,:,4) = missing_val 215 CALL histwrite3d_cosp(o_clcalipsoopacity,cospOUT%calipso_lidarcldtype(:,:,4),nvert) 216 endif 217 218 if (cfg%Lclopaquetemp) then 219 where(cospOUT%calipso_cldtypetemp(:,1) == R_UNDEF) cospOUT%calipso_cldtypetemp(:,1) = missing_val 220 CALL histwrite2d_cosp(o_clopaquetemp,cospOUT%calipso_cldtypetemp(:,1)) 221 endif 222 if (cfg%Lclthintemp) then 223 where(cospOUT%calipso_cldtypetemp(:,2) == R_UNDEF) cospOUT%calipso_cldtypetemp(:,2) = missing_val 224 CALL histwrite2d_cosp(o_clthintemp,cospOUT%calipso_cldtypetemp(:,2)) 225 endif 226 if (cfg%Lclzopaquetemp) then 227 where(cospOUT%calipso_cldtypetemp(:,3) == R_UNDEF) cospOUT%calipso_cldtypetemp(:,3) = missing_val 228 CALL histwrite2d_cosp(o_clzopaquetemp,cospOUT%calipso_cldtypetemp(:,3)) 229 endif 230 if (cfg%Lclopaquemeanz) then 231 where(cospOUT%calipso_cldtypemeanz(:,1) == R_UNDEF) cospOUT%calipso_cldtypemeanz(:,1) = missing_val 232 CALL histwrite2d_cosp(o_clopaquemeanz,cospOUT%calipso_cldtypemeanz(:,1)) 233 endif 234 if (cfg%Lclthinmeanz) then 235 where(cospOUT%calipso_cldtypemeanz(:,2) == R_UNDEF) cospOUT%calipso_cldtypemeanz(:,2) = missing_val 236 CALL histwrite2d_cosp(o_clthinmeanz,cospOUT%calipso_cldtypemeanz(:,2)) 237 endif 238 if (cfg%Lclthinemis) then 239 where(cospOUT%calipso_cldthinemis == R_UNDEF) cospOUT%calipso_cldthinemis = missing_val 240 CALL histwrite2d_cosp(o_clthinemis,cospOUT%calipso_cldthinemis) 241 endif 242 if (cfg%Lclopaquemeanzse) then 243 where(cospOUT%calipso_cldtypemeanzse(:,1) == R_UNDEF) cospOUT%calipso_cldtypemeanzse(:,1) = missing_val 244 CALL histwrite2d_cosp(o_clopaquemeanzse,cospOUT%calipso_cldtypemeanzse(:,1)) 245 endif 246 if (cfg%Lclthinmeanzse) then 247 where(cospOUT%calipso_cldtypemeanzse(:,2) == R_UNDEF) cospOUT%calipso_cldtypemeanzse(:,2) = missing_val 248 CALL histwrite2d_cosp(o_clthinmeanzse,cospOUT%calipso_cldtypemeanzse(:,2)) 249 endif 250 if (cfg%Lclzopaquecalipsose) then 251 where(cospOUT%calipso_cldtypemeanzse(:,3) == R_UNDEF) cospOUT%calipso_cldtypemeanzse(:,3) = missing_val 252 CALL histwrite2d_cosp(o_clzopaquecalipsose,cospOUT%calipso_cldtypemeanzse(:,3)) 253 endif 254 255 256 if (cfg%LcfadLidarsr532) then 257 where(cospOUT%calipso_cfad_sr == R_UNDEF) cospOUT%calipso_cfad_sr = missing_val 258 259 do icl=1,SR_BINS 260 do k=1,Nlvgrid 261 do ip=1,Npoints 262 tmp_fi4da_cfadL(ip,k,icl)=cospOUT%calipso_cfad_sr(ip,icl,k) 263 enddo 264 enddo 265 enddo 204 266 ! if (cfg%LcfadLidarsr532) CALL histwrite4d_cosp(o_cfad_lidarsr532,stlidar%cfad_sr) 205 if (cfg%LcfadLidarsr532) CALL histwrite4d_cosp(o_cfadLidarsr532,tmp_fi4da_cfadL) !!! "_" enleve 206 #else 207 if (cfg%LcfadLidarsr532) then 208 do icl=1,SR_BINS 209 CALL histwrite3d_cosp(o_cfadLidarsr532,cospOUT%calipso_cfad_sr(:,icl,:),nvert,icl) !!! "_" enleve 210 enddo 211 endif 212 #endif 213 214 #ifdef CPP_XIOS 215 if (cfg%Latb532) CALL histwrite4d_cosp(o_atb532,cospOUT%calipso_beta_tot) 216 #else 267 CALL histwrite4d_cosp(o_cfadLidarsr532,tmp_fi4da_cfadL) !!! "_" enleve 268 endif 269 217 270 if (cfg%Latb532) then 218 do icl=1,Ncolumns219 CALL histwrite3d_cosp(o_atb532,cospOUT%calipso_beta_tot(:,icl,:),nvertmcosp,icl)220 enddo221 endif222 #endif 223 224 if (cfg%LlidarBetaMol532) CALL histwrite3d_cosp(o_lidarBetaMol532,cospOUT%calipso_beta_mol,nvertmcosp)271 where(cospOUT%calipso_beta_tot == R_UNDEF) cospOUT%calipso_beta_tot = missing_val 272 CALL histwrite4d_cosp(o_atb532,cospOUT%calipso_beta_tot) 273 endif 274 if (cfg%LlidarBetaMol532) then 275 where(cospOUT%calipso_beta_mol == R_UNDEF) cospOUT%calipso_beta_mol = missing_val 276 CALL histwrite3d_cosp(o_lidarBetaMol532,cospOUT%calipso_beta_mol,nvertmcosp) 277 endif 225 278 226 279 endif !Calipso … … 229 282 !!!! Sorties Ground Lidar 230 283 if (cfg%LgrLidar532) then 231 232 where(cospOUT%grLidar532_beta_tot == R_UNDEF) cospOUT%grLidar532_beta_tot = missing_val 233 where(cospOUT%grLidar532_cfad_sr == R_UNDEF) cospOUT%grLidar532_cfad_sr = missing_val 234 where(cospOUT%grLidar532_lidarcld == R_UNDEF) cospOUT%grLidar532_lidarcld = missing_val 235 where(cospOUT%grLidar532_cldlayer == R_UNDEF) cospOUT%grLidar532_cldlayer = missing_val 236 where(cospOUT%grLidar532_beta_mol == R_UNDEF) cospOUT%grLidar532_beta_mol = missing_val 237 where(cospOUT%grLidar532_srbval == R_UNDEF) cospOUT%grLidar532_srbval = missing_val 238 239 if (cfg%LcllgrLidar532) CALL histwrite2d_cosp(o_cllgrLidar532,cospOUT%grLidar532_cldlayer(:,1)) 240 if (cfg%LclmgrLidar532) CALL histwrite2d_cosp(o_clmgrLidar532,cospOUT%grLidar532_cldlayer(:,2)) 241 if (cfg%LclhgrLidar532) CALL histwrite2d_cosp(o_clhgrLidar532,cospOUT%grLidar532_cldlayer(:,3)) 242 if (cfg%LcltgrLidar532) CALL histwrite2d_cosp(o_cltgrLidar532,cospOUT%grLidar532_cldlayer(:,4)) 243 244 if (cfg%LclgrLidar532) CALL histwrite3d_cosp(o_clgrLidar532,cospOUT%grLidar532_lidarcld,nvert) 245 if (cfg%LlidarBetaMol532gr) CALL histwrite3d_cosp(o_lidarBetaMol532gr,cospOUT%grLidar532_beta_mol,nvertmcosp) 246 247 #ifdef CPP_XIOS 248 do icl=1,SR_BINS 249 tmp_fi4da_cfadLgr(:,:,icl)=cospOUT%grLidar532_cfad_sr(:,icl,:) 250 enddo 251 if (cfg%LcfadLidarsr532gr) CALL histwrite4d_cosp(o_cfadLidarsr532gr,tmp_fi4da_cfadLgr) 252 #else 284 ! AI juin 2020 Voir a quoi correspond ce champs 285 ! where(cospOUT%grLidar532_srbval == R_UNDEF) cospOUT%grLidar532_srbval = missing_val 286 287 if (cfg%LcllgrLidar532) then 288 where(cospOUT%grLidar532_cldlayer(:,1) == R_UNDEF) cospOUT%grLidar532_cldlayer(:,1) = missing_val 289 CALL histwrite2d_cosp(o_cllgrLidar532,cospOUT%grLidar532_cldlayer(:,1)) 290 endif 291 if (cfg%LclmgrLidar532) then 292 where(cospOUT%grLidar532_cldlayer(:,2) == R_UNDEF) cospOUT%grLidar532_cldlayer(:,2) = missing_val 293 CALL histwrite2d_cosp(o_clmgrLidar532,cospOUT%grLidar532_cldlayer(:,2)) 294 endif 295 if (cfg%LclhgrLidar532) then 296 where(cospOUT%grLidar532_cldlayer(:,3) == R_UNDEF) cospOUT%grLidar532_cldlayer(:,3) = missing_val 297 CALL histwrite2d_cosp(o_clhgrLidar532,cospOUT%grLidar532_cldlayer(:,3)) 298 endif 299 if (cfg%LcltgrLidar532) then 300 where(cospOUT%grLidar532_cldlayer(:,4) == R_UNDEF) cospOUT%grLidar532_cldlayer(:,4) = missing_val 301 CALL histwrite2d_cosp(o_cltgrLidar532,cospOUT%grLidar532_cldlayer(:,4)) 302 endif 303 304 if (cfg%LclgrLidar532) then 305 where(cospOUT%grLidar532_lidarcld == R_UNDEF) cospOUT%grLidar532_lidarcld = missing_val 306 CALL histwrite3d_cosp(o_clgrLidar532,cospOUT%grLidar532_lidarcld,nvert) 307 endif 308 if (cfg%LlidarBetaMol532gr) then 309 where(cospOUT%grLidar532_beta_mol == R_UNDEF) cospOUT%grLidar532_beta_mol = missing_val 310 CALL histwrite3d_cosp(o_lidarBetaMol532gr,cospOUT%grLidar532_beta_mol,nvertmcosp) 311 endif 253 312 if (cfg%LcfadLidarsr532gr) then 313 where(cospOUT%grLidar532_cfad_sr == R_UNDEF) cospOUT%grLidar532_cfad_sr = missing_val 254 314 do icl=1,SR_BINS 255 CALL histwrite3d_cosp(o_cfadLidarsr532gr,cospOUT%grLidar532_cfad_sr(:,icl,:),nvert,icl) 315 do k=1,Nlvgrid 316 do ip=1,Npoints 317 tmp_fi4da_cfadLgr(ip,k,icl)=cospOUT%grLidar532_cfad_sr(ip,icl,k) 318 enddo 319 enddo 256 320 enddo 257 endif 258 #endif 259 260 #ifdef CPP_XIOS 261 if (cfg%Latb532gr) CALL histwrite4d_cosp(o_atb532gr,cospOUT%grLidar532_beta_tot) 262 #else 263 if (cfg%Latb532gr) then 264 do icl=1,Ncolumns 265 CALL histwrite3d_cosp(o_atb532gr,cospOUT%grLidar532_beta_tot(:,icl,:),nvertmcosp,icl) 266 enddo 267 endif 268 #endif 269 321 CALL histwrite4d_cosp(o_cfadLidarsr532gr,tmp_fi4da_cfadLgr) 322 endif 323 324 if (cfg%Latb532gr) then 325 where(cospOUT%grLidar532_beta_tot == R_UNDEF) cospOUT%grLidar532_beta_tot = missing_val 326 CALL histwrite4d_cosp(o_atb532gr,cospOUT%grLidar532_beta_tot) 327 endif 270 328 endif ! Ground Lidar 532 nm 271 329 … … 273 331 !!!! Sorties Atlid 274 332 if (cfg%Latlid) then 275 276 where(cospOUT%atlid_beta_tot == R_UNDEF) cospOUT%atlid_beta_tot = missing_val 277 where(cospOUT%atlid_cfad_sr == R_UNDEF) cospOUT%atlid_cfad_sr = missing_val 278 where(cospOUT%atlid_lidarcld == R_UNDEF) cospOUT%atlid_lidarcld = missing_val 279 where(cospOUT%atlid_cldlayer == R_UNDEF) cospOUT%atlid_cldlayer = missing_val 280 where(cospOUT%atlid_beta_mol == R_UNDEF) cospOUT%atlid_beta_mol = missing_val 281 where(cospOUT%atlid_srbval == R_UNDEF) cospOUT%atlid_srbval = missing_val 282 283 if (cfg%Lcllatlid) CALL histwrite2d_cosp(o_cllatlid,cospOUT%atlid_cldlayer(:,1)) 284 if (cfg%Lclmatlid) CALL histwrite2d_cosp(o_clmatlid,cospOUT%atlid_cldlayer(:,2)) 285 if (cfg%Lclhatlid) CALL histwrite2d_cosp(o_clhatlid,cospOUT%atlid_cldlayer(:,3)) 286 if (cfg%Lcltatlid) CALL histwrite2d_cosp(o_cltatlid,cospOUT%atlid_cldlayer(:,4)) 287 288 if (cfg%Lclatlid) CALL histwrite3d_cosp(o_clatlid,cospOUT%atlid_lidarcld,nvert) 289 if (cfg%LlidarBetaMol355) CALL histwrite3d_cosp(o_lidarBetaMol355,cospOUT%atlid_beta_mol,nvertmcosp) 290 291 #ifdef CPP_XIOS 292 do icl=1,SR_BINS 293 tmp_fi4da_cfadLatlid(:,:,icl)=cospOUT%atlid_cfad_sr(:,icl,:) 294 enddo 295 if (cfg%LcfadLidarsr355) CALL histwrite4d_cosp(o_cfadlidarsr355,tmp_fi4da_cfadLatlid) 296 #else 333 ! AI juin 2020 Voir a quoi correspond ce champs 334 ! where(cospOUT%atlid_srbval == R_UNDEF) cospOUT%atlid_srbval = missing_val 335 336 if (cfg%Lcllatlid) then 337 where(cospOUT%atlid_cldlayer(:,1) == R_UNDEF) cospOUT%atlid_cldlayer(:,1) = missing_val 338 CALL histwrite2d_cosp(o_cllatlid,cospOUT%atlid_cldlayer(:,1)) 339 endif 340 if (cfg%Lclmatlid) then 341 where(cospOUT%atlid_cldlayer(:,2) == R_UNDEF) cospOUT%atlid_cldlayer(:,2) = missing_val 342 CALL histwrite2d_cosp(o_clmatlid,cospOUT%atlid_cldlayer(:,2)) 343 endif 344 if (cfg%Lclhatlid) then 345 where(cospOUT%atlid_cldlayer(:,3) == R_UNDEF) cospOUT%atlid_cldlayer(:,3) = missing_val 346 CALL histwrite2d_cosp(o_clhatlid,cospOUT%atlid_cldlayer(:,3)) 347 endif 348 if (cfg%Lcltatlid) then 349 where(cospOUT%atlid_cldlayer(:,4) == R_UNDEF) cospOUT%atlid_cldlayer(:,4) = missing_val 350 CALL histwrite2d_cosp(o_cltatlid,cospOUT%atlid_cldlayer(:,4)) 351 endif 352 if (cfg%Lclatlid) then 353 where(cospOUT%atlid_lidarcld == R_UNDEF) cospOUT%atlid_lidarcld = missing_val 354 CALL histwrite3d_cosp(o_clatlid,cospOUT%atlid_lidarcld,nvert) 355 endif 356 if (cfg%LlidarBetaMol355) then 357 where(cospOUT%atlid_beta_mol == R_UNDEF) cospOUT%atlid_beta_mol = missing_val 358 CALL histwrite3d_cosp(o_lidarBetaMol355,cospOUT%atlid_beta_mol,nvertmcosp) 359 endif 297 360 if (cfg%LcfadLidarsr355) then 361 where(cospOUT%atlid_cfad_sr == R_UNDEF) cospOUT%atlid_cfad_sr = missing_val 298 362 do icl=1,SR_BINS 299 CALL histwrite3d_cosp(o_cfadlidarsr355,cospOUT%atlid_cfad_sr(:,icl,:),nvert,icl) 363 do k=1,Nlvgrid 364 do ip=1,Npoints 365 tmp_fi4da_cfadLatlid(ip,k,icl)=cospOUT%atlid_cfad_sr(ip,icl,k) 366 enddo 367 enddo 300 368 enddo 301 endif 302 #endif 303 304 #ifdef CPP_XIOS 305 if (cfg%Latb355) CALL histwrite4d_cosp(o_atb355,cospOUT%atlid_beta_tot) 306 #else 307 if (cfg%Latb355) then 308 do icl=1,Ncolumns 309 CALL histwrite3d_cosp(o_atb355,cospOUT%atlid_beta_tot(:,icl,:),nvertmcosp,icl) 310 enddo 311 endif 312 #endif 313 369 CALL histwrite4d_cosp(o_cfadlidarsr355,tmp_fi4da_cfadLatlid) 370 endif 371 372 if (cfg%Latb355) then 373 where(cospOUT%atlid_beta_tot == R_UNDEF) cospOUT%atlid_beta_tot = missing_val 374 CALL histwrite4d_cosp(o_atb355,cospOUT%atlid_beta_tot) 375 endif 314 376 endif ! Atlid 315 377 … … 317 379 if (cfg%Lparasol) then 318 380 if (cfg%LparasolRefl) then 319 ! Ces 2 diagnostics sont controles par la clef logique "LparasolRefl" 320 321 !!! if (cfg%LparasolRefl) CALL histwrite3d_cosp(o_parasolrefl,cospOUT%parasolrefl,nvertp) 381 where(cospOUT%parasolGrid_refl == R_UNDEF) cospOUT%parasolGrid_refl = missing_val 382 where(cospOUT%parasolPix_refl == R_UNDEF) cospOUT%parasolPix_refl = missing_val 322 383 CALL histwrite3d_cosp(o_parasolGrid_refl,cospOUT%parasolGrid_refl,nvertp) 323 324 #ifdef CPP_XIOS325 384 CALL histwrite4d_cosp(o_parasolPix_refl,cospOUT%parasolPix_refl) 326 #else 327 do icl=1,Ncolumns 328 CALL histwrite3d_cosp(o_parasolPix_refl,cospOUT%parasolPix_refl(:,icl,:),nvertp,icl) 329 enddo 330 #endif 331 332 endif ! LparasolRefl 333 endif ! Parasol 385 endif ! LparasolRefl 386 endif ! Parasol 334 387 335 388 ! if (cfg%LparasolRefl) then … … 353 406 !!! Sorties CloudSat 354 407 if (cfg%Lcloudsat) then 355 356 where(cospOUT%cloudsat_Ze_tot == R_UNDEF) cospOUT%cloudsat_Ze_tot = missing_val 357 where(cospOUT%cloudsat_cfad_ze == R_UNDEF) cospOUT%cloudsat_cfad_ze = missing_val 358 where(cospOUT%cloudsat_precip_cover == R_UNDEF) cospOUT%cloudsat_precip_cover = missing_val 359 where(cospOUT%cloudsat_pia == R_UNDEF) cospOUT%cloudsat_pia = missing_val 360 361 if (cfg%Lptradarflag0) CALL histwrite2d_cosp(o_ptradarflag0,cospOUT%cloudsat_precip_cover(:,1)) 362 if (cfg%Lptradarflag1) CALL histwrite2d_cosp(o_ptradarflag1,cospOUT%cloudsat_precip_cover(:,2)) 363 if (cfg%Lptradarflag2) CALL histwrite2d_cosp(o_ptradarflag2,cospOUT%cloudsat_precip_cover(:,3)) 364 if (cfg%Lptradarflag3) CALL histwrite2d_cosp(o_ptradarflag3,cospOUT%cloudsat_precip_cover(:,4)) 365 if (cfg%Lptradarflag4) CALL histwrite2d_cosp(o_ptradarflag4,cospOUT%cloudsat_precip_cover(:,5)) 366 if (cfg%Lptradarflag5) CALL histwrite2d_cosp(o_ptradarflag5,cospOUT%cloudsat_precip_cover(:,6)) 367 if (cfg%Lptradarflag6) CALL histwrite2d_cosp(o_ptradarflag6,cospOUT%cloudsat_precip_cover(:,7)) 368 if (cfg%Lptradarflag7) CALL histwrite2d_cosp(o_ptradarflag7,cospOUT%cloudsat_precip_cover(:,8)) 369 if (cfg%Lptradarflag8) CALL histwrite2d_cosp(o_ptradarflag8,cospOUT%cloudsat_precip_cover(:,9)) 370 if (cfg%Lptradarflag9) CALL histwrite2d_cosp(o_ptradarflag9,cospOUT%cloudsat_precip_cover(:,10)) 371 if (cfg%Lradarpia) CALL histwrite2d_cosp(o_radarpia,cospOUT%cloudsat_pia) 372 373 #ifdef CPP_XIOS 374 do icl=1,CLOUDSAT_DBZE_BINS 375 tmp_fi4da_cfadR(:,:,icl)=cospOUT%cloudsat_cfad_ze(:,icl,:) 376 enddo 377 if (cfg%Ldbze94) CALL histwrite4d_cosp(o_dbze94,cospOUT%cloudsat_Ze_tot) 378 ! if (cfg%LcfadDbze94) CALL histwrite4d_cosp(o_cfadDbze94,stradar%cfad_ze) 379 if (cfg%LcfadDbze94) CALL histwrite4d_cosp(o_cfadDbze94,tmp_fi4da_cfadR) 380 #else 408 ! AI juin 2020 voir a quoi correspond ce champs 409 ! where(cospOUT%cloudsat_pia == R_UNDEF) cospOUT%cloudsat_pia = missing_val 410 411 if (cfg%Lptradarflag0) then 412 where(cospOUT%cloudsat_precip_cover(:,1) == R_UNDEF) cospOUT%cloudsat_precip_cover(:,1) = missing_val 413 CALL histwrite2d_cosp(o_ptradarflag0,cospOUT%cloudsat_precip_cover(:,1)) 414 endif 415 if (cfg%Lptradarflag1) then 416 where(cospOUT%cloudsat_precip_cover(:,2) == R_UNDEF) cospOUT%cloudsat_precip_cover(:,2) = missing_val 417 CALL histwrite2d_cosp(o_ptradarflag1,cospOUT%cloudsat_precip_cover(:,2)) 418 endif 419 if (cfg%Lptradarflag2) then 420 where(cospOUT%cloudsat_precip_cover(:,3) == R_UNDEF) cospOUT%cloudsat_precip_cover(:,3) = missing_val 421 CALL histwrite2d_cosp(o_ptradarflag2,cospOUT%cloudsat_precip_cover(:,3)) 422 endif 423 if (cfg%Lptradarflag3) then 424 where(cospOUT%cloudsat_precip_cover(:,4) == R_UNDEF) cospOUT%cloudsat_precip_cover(:,4) = missing_val 425 CALL histwrite2d_cosp(o_ptradarflag3,cospOUT%cloudsat_precip_cover(:,4)) 426 endif 427 if (cfg%Lptradarflag4) then 428 where(cospOUT%cloudsat_precip_cover(:,5) == R_UNDEF) cospOUT%cloudsat_precip_cover(:,5) = missing_val 429 CALL histwrite2d_cosp(o_ptradarflag3,cospOUT%cloudsat_precip_cover(:,5)) 430 endif 431 if (cfg%Lptradarflag5) then 432 where(cospOUT%cloudsat_precip_cover(:,6) == R_UNDEF) cospOUT%cloudsat_precip_cover(:,6) = missing_val 433 CALL histwrite2d_cosp(o_ptradarflag3,cospOUT%cloudsat_precip_cover(:,6)) 434 endif 435 if (cfg%Lptradarflag6) then 436 where(cospOUT%cloudsat_precip_cover(:,7) == R_UNDEF) cospOUT%cloudsat_precip_cover(:,7) = missing_val 437 CALL histwrite2d_cosp(o_ptradarflag3,cospOUT%cloudsat_precip_cover(:,7)) 438 endif 439 if (cfg%Lptradarflag7) then 440 where(cospOUT%cloudsat_precip_cover(:,8) == R_UNDEF) cospOUT%cloudsat_precip_cover(:,8) = missing_val 441 CALL histwrite2d_cosp(o_ptradarflag3,cospOUT%cloudsat_precip_cover(:,8)) 442 endif 443 if (cfg%Lptradarflag8) then 444 where(cospOUT%cloudsat_precip_cover(:,9) == R_UNDEF) cospOUT%cloudsat_precip_cover(:,9) = missing_val 445 CALL histwrite2d_cosp(o_ptradarflag3,cospOUT%cloudsat_precip_cover(:,9)) 446 endif 447 if (cfg%Lptradarflag9) then 448 where(cospOUT%cloudsat_precip_cover(:,10) == R_UNDEF) cospOUT%cloudsat_precip_cover(:,10) = missing_val 449 CALL histwrite2d_cosp(o_ptradarflag3,cospOUT%cloudsat_precip_cover(:,10)) 450 endif 451 381 452 if (cfg%Ldbze94) then 382 do icl=1,Ncolumns 383 CALL histwrite3d_cosp(o_dbze94,cospOUT%cloudsat_Ze_tot(:,icl,:),nvert,icl) 384 enddo 385 endif 386 if (cfg%LcfadDbze94) then 387 do icl=1,CLOUDSAT_DBZE_BINS 388 CALL histwrite3d_cosp(o_cfadDbze94,cospOUT%cloudsat_cfad_ze(:,icl,:),nvert,icl) 389 enddo 390 endif 391 #endif 453 where(cospOUT%cloudsat_Ze_tot == R_UNDEF) cospOUT%cloudsat_Ze_tot = missing_val 454 CALL histwrite4d_cosp(o_dbze94,cospOUT%cloudsat_Ze_tot) 455 endif 456 if (cfg%LcfadDbze94) then 457 where(cospOUT%cloudsat_cfad_ze == R_UNDEF) cospOUT%cloudsat_cfad_ze = missing_val 458 do icl=1,CLOUDSAT_DBZE_BINS 459 do k=1,Nlvgrid 460 do ip=1,Npoints 461 tmp_fi4da_cfadR(ip,k,icl)=cospOUT%cloudsat_cfad_ze(ip,icl,k) 462 enddo 463 enddo 464 enddo 465 CALL histwrite4d_cosp(o_cfadDbze94,tmp_fi4da_cfadR) 466 endif 392 467 endif 393 468 ! endif pour CloudSat … … 396 471 !!! Sorties combinees Cloudsat et Calipso 397 472 if (cfg%Lcalipso .and. cfg%Lcloudsat) then 398 where(cospOUT%lidar_only_freq_cloud == R_UNDEF) & 473 474 if (cfg%Lclcalipso2) then 475 where(cospOUT%lidar_only_freq_cloud == R_UNDEF) & 399 476 cospOUT%lidar_only_freq_cloud = missing_val 400 where(cospOUT%cloudsat_tcc == R_UNDEF) & 477 CALL histwrite3d_cosp(o_clcalipso2,cospOUT%lidar_only_freq_cloud,nvert) 478 endif 479 if (cfg%Lcloudsat_tcc) then 480 where(cospOUT%cloudsat_tcc == R_UNDEF) & 401 481 cospOUT%cloudsat_tcc = missing_val 402 where(cospOUT%cloudsat_tcc2 == R_UNDEF) & 482 CALL histwrite2d_cosp(o_cloudsat_tcc,cospOUT%cloudsat_tcc) 483 endif 484 if (cfg%Lcloudsat_tcc2) then 485 where(cospOUT%cloudsat_tcc2 == R_UNDEF) & 403 486 cospOUT%cloudsat_tcc2 = missing_val 404 where(cospOUT%radar_lidar_tcc == R_UNDEF) &405 cospOUT%radar_lidar_tcc = missing_val406 407 if (cfg%Lclcalipso2) CALL histwrite3d_cosp(o_clcalipso2,cospOUT%lidar_only_freq_cloud,nvert)408 if (cfg%Lcloudsat_tcc) CALL histwrite2d_cosp(o_cloudsat_tcc,cospOUT%cloudsat_tcc)409 if (cfg%Lcloudsat_tcc2) CALL histwrite2d_cosp(o_cloudsat_tcc2,cospOUT%cloudsat_tcc2)410 if (cfg%Lcltlidarradar) CALL histwrite2d_cosp(o_cltlidarradar,cospOUT%radar_lidar_tcc)487 CALL histwrite2d_cosp(o_cloudsat_tcc2,cospOUT%cloudsat_tcc2) 488 endif 489 if (cfg%Lcltlidarradar) then 490 where(cospOUT%radar_lidar_tcc == R_UNDEF) & 491 cospOUT%radar_lidar_tcc = missing_val 492 CALL histwrite2d_cosp(o_cltlidarradar,cospOUT%radar_lidar_tcc) 493 endif 411 494 endif 412 495 … … 425 508 426 509 ! CALL histwrite2d_cosp(o_sunlit,gbx%sunlit) 427 #ifdef CPP_XIOS428 510 if (cfg%Lclisccp) CALL histwrite4d_cosp(o_clisccp,cospOUT%isccp_fq) 429 #else430 if (cfg%Lclisccp) then431 do icl=1,7432 CALL histwrite3d_cosp(o_clisccp,cospOUT%isccp_fq(:,icl,:),nvertisccp,icl)433 enddo434 endif435 #endif436 511 437 512 if (cfg%Lboxtauisccp) CALL histwrite3d_cosp(o_boxtauisccp,cospOUT%isccp_boxtau,nvertcol) … … 456 531 where(cospOUT%misr_cldarea == R_UNDEF) cospOUT%misr_cldarea = missing_val 457 532 458 #ifdef CPP_XIOS459 533 do icl=1,numMISRHgtBins 460 tmp_fi4da_misr(:,icl,:)=cospOUT%misr_fq(:,:,icl) 534 do k=1,Nlvgrid 535 do ip=1,Npoints 536 tmp_fi4da_misr(ip,icl,k)=cospOUT%misr_fq(ip,k,icl) 537 enddo 538 enddo 461 539 enddo 462 540 ! if (cfg%LclMISR) CALL histwrite4d_cosp(o_clMISR,misr%fq_MISR) 463 541 ! if (cfg%LclMISR) CALL histwrite4d_cosp(o_clMISR,tmp_fi4da_misr) 464 542 CALL histwrite4d_cosp(o_misr_fq,tmp_fi4da_misr) 465 #else466 do icl=1,7467 CALL histwrite3d_cosp(o_misr_fq,cospOUT%misr_fq(:,icl,:),nvertmisr,icl)468 enddo469 #endif470 543 471 544 CALL histwrite2d_cosp(o_misr_meanztop,cospOUT%misr_meanztop) … … 540 613 cospOUT%modis_Optical_thickness_vs_ReffLIQ = missing_val 541 614 542 #ifdef CPP_XIOS543 615 CALL histwrite4d_cosp(o_modis_ot_vs_ctp,cospOUT%modis_Optical_Thickness_vs_Cloud_Top_Pressure) 544 616 CALL histwrite4d_cosp(o_modis_ot_vs_reffice,cospOUT%modis_Optical_Thickness_vs_ReffICE) 545 617 CALL histwrite4d_cosp(o_modis_ot_vs_reffliq,cospOUT%modis_Optical_thickness_vs_ReffLIQ) 546 #else 547 do icl=1,7 548 CALL histwrite3d_cosp(o_modis_ot_vs_ctp, & 549 cospOUT%modis_Optical_Thickness_vs_Cloud_Top_Pressure(:,icl,:),nvertisccp,icl) 550 CALL histwrite3d_cosp(o_modis_ot_vs_reffice, & 551 cospOUT%modis_Optical_Thickness_vs_ReffICE(:,icl,:),nvertReffIce,icl) 552 CALL histwrite3d_cosp(o_modis_ot_vs_reffliq, & 553 cospOUT%modis_Optical_thickness_vs_ReffLIQ(:,icl,:),nvertReffLiq,icl) 554 enddo 555 #endif 556 557 !#ifdef CPP_XIOS 558 ! if (cfg%Lclmodis) CALL histwrite4d_cosp(o_crimodis,modis%Optical_Thickness_vs_ReffIce) 559 ! if (cfg%Lclmodis) CALL histwrite4d_cosp(o_crlmodis,modis%Optical_Thickness_vs_ReffLiq) 560 !#else 561 ! if (cfg%Lclmodis) then 562 ! do icl=1,7 563 ! CALL histwrite3d_cosp(o_crimodis, & 564 ! modis%Optical_Thickness_vs_ReffIce(:,icl,:),nvertReffIce,icl) 565 ! enddo 566 ! endif 567 ! if (cfg%Lclmodis) then 568 ! do icl=1,7 569 ! CALL histwrite3d_cosp(o_crlmodis, & 570 ! modis%Optical_Thickness_vs_ReffLiq(:,icl,:),nvertReffLiq,icl) 571 ! enddo 572 ! endif 573 !#endif 618 574 619 endif ! Lclmodis 575 620 … … 579 624 IF(.NOT.cosp_varsdefined) THEN 580 625 !$OMP MASTER 581 #ifndef CPP_IOIPSL_NO_OUTPUT582 DO iff=1,3583 IF (cosp_outfilekeys(iff)) THEN584 CALL histend(cosp_nidfiles(iff))585 ENDIF ! cosp_outfilekeys586 ENDDO ! iff587 #endif588 626 ! Fermeture dans phys_output_write 589 !#ifdef CPP_XIOS627 !#ifdef 1 590 628 !On finalise l'initialisation: 591 629 !CALL wxios_closedef() … … 599 637 IF(cosp_varsdefined) THEN 600 638 ! On synchronise les fichiers pour IOIPSL 601 #ifndef CPP_IOIPSL_NO_OUTPUT602 !$OMP MASTER603 DO iff=1,3604 IF (ok_sync .AND. cosp_outfilekeys(iff)) THEN605 CALL histsync(cosp_nidfiles(iff))606 ENDIF607 END DO608 !$OMP END MASTER609 #endif610 639 ENDIF !cosp_varsdefined 611 640 … … 628 657 USE mod_grid_phy_lmdz, ONLY: nbp_lon 629 658 USE print_control_mod, ONLY: lunout,prt_level 630 #ifdef CPP_XIOS631 659 USE wxios 632 #endif633 660 634 661 IMPLICIT NONE … … 662 689 ENDIF 663 690 664 #ifdef CPP_XIOS665 691 IF (.not. ok_all_xml) then 666 692 IF ( var%cles(iff) ) THEN … … 672 698 ENDIF 673 699 ENDIF 674 #endif 675 676 #ifndef CPP_IOIPSL_NO_OUTPUT 677 IF ( var%cles(iff) ) THEN 678 CALL histdef (cosp_nidfiles(iff), var%name, var%description, var%unit, & 679 nbp_lon,jj_nb,nhoricosp(iff), 1,1,1, -99, 32, & 680 typeecrit, zstophym,zoutm_cosp(iff)) 681 ENDIF 682 #endif 700 683 701 684 702 END SUBROUTINE histdef2d_cosp … … 693 711 USE print_control_mod, ONLY: lunout,prt_level 694 712 695 #ifdef CPP_XIOS696 713 USE wxios 697 #endif698 714 699 715 … … 769 785 ENDIF 770 786 771 #ifdef CPP_XIOS772 787 IF (.not. ok_all_xml) then 773 788 IF ( var%cles(iff) ) THEN … … 779 794 ENDIF 780 795 ENDIF 781 #endif 782 783 #ifndef CPP_IOIPSL_NO_OUTPUT 784 IF ( var%cles(iff) ) THEN 785 CALL histdef (cosp_nidfiles(iff), nom, var%description, var%unit, & 786 nbp_lon, jj_nb, nhoricosp(iff), klevs, 1, & 787 klevs, nvertsave, 32, typeecrit, & 788 zstophym, zoutm_cosp(iff)) 789 ENDIF 790 #endif 796 791 797 792 798 END SUBROUTINE histdef3d_cosp … … 801 807 USE print_control_mod, ONLY: lunout,prt_level 802 808 803 #ifdef CPP_XIOS804 809 USE xios, only: xios_send_field 805 #endif806 810 807 811 IMPLICIT NONE … … 826 830 IF(.NOT.cosp_varsdefined) THEN 827 831 !$OMP MASTER 832 print*,'var, cosp_varsdefined dans cosp_varsdefined ',var%name, cosp_varsdefined 828 833 !Si phase de définition.... on définit 829 834 CALL conf_cospoutputs(var%name,var%cles) … … 848 853 IF (var%cles(iff) .AND. cosp_outfilekeys(iff)) THEN 849 854 ALLOCATE(index2d(nbp_lon*jj_nb)) 850 #ifndef CPP_IOIPSL_NO_OUTPUT851 CALL histwrite(cosp_nidfiles(iff),var%name,itau_iocosp,Field2d,nbp_lon*jj_nb,index2d)852 #endif853 855 deallocate(index2d) 854 #ifdef CPP_XIOS855 856 IF (.not. ok_all_xml) then 856 857 if (firstx) then … … 862 863 endif 863 864 ENDIF 864 #endif865 865 ENDIF 866 866 ENDDO 867 867 868 #ifdef CPP_XIOS869 868 IF (ok_all_xml) THEN 870 869 if (prt_level >= 1) then … … 873 872 CALL xios_send_field(var%name, Field2d) 874 873 ENDIF 875 #endif876 874 877 875 !$OMP END MASTER … … 891 889 USE print_control_mod, ONLY: lunout,prt_level 892 890 893 #ifdef CPP_XIOS894 891 USE xios, only: xios_send_field 895 #endif896 892 897 893 … … 952 948 IF (var%cles(iff) .AND. cosp_outfilekeys(iff)) THEN 953 949 ALLOCATE(index3d(nbp_lon*jj_nb*nlev)) 954 #ifndef CPP_IOIPSL_NO_OUTPUT 955 CALL histwrite(cosp_nidfiles(iff),nom,itau_iocosp,Field3d,nbp_lon*jj_nb*nlev,index3d) 956 #endif 957 958 #ifdef CPP_XIOS 950 959 951 IF (.not. ok_all_xml) then 960 952 IF (firstx) THEN … … 964 956 ENDIF 965 957 ENDIF 966 #endif967 958 deallocate(index3d) 968 959 ENDIF 969 960 ENDDO 970 #ifdef CPP_XIOS971 961 IF (ok_all_xml) THEN 972 962 CALL xios_send_field(nom, Field3d(:,:,1:nlev)) 973 963 IF (prt_level >= 1) WRITE(lunout,*)'xios_send_field ',var%name 974 964 ENDIF 975 #endif976 965 977 966 !$OMP END MASTER … … 991 980 USE print_control_mod, ONLY: lunout,prt_level 992 981 993 #ifdef CPP_XIOS994 982 USE xios, only: xios_send_field 995 #endif996 983 997 984 … … 1023 1010 CALL grid1Dto2D_mpi(buffer_omp,field4d) 1024 1011 1025 #ifdef CPP_XIOS1026 1012 ! IF (ok_all_xml) THEN 1027 1013 CALL xios_send_field(var%name, Field4d(:,:,1:nlev,1:nlev2)) 1028 1014 IF (prt_level >= 1) WRITE(lunout,*)'xios_send_field ',var%name 1029 1015 ! ENDIF 1030 #endif1031 1016 1032 1017 !$OMP END MASTER
Note: See TracChangeset
for help on using the changeset viewer.