7 ok_mensuelcosp,ok_journecosp,ok_hfcosp, &
8 ecrit_mth,ecrit_day,ecrit_hf, &
10 ref_liq,ref_ice,fracterlic,u_wind,v_wind,
phis,phi,ph,p,skt,t, &
11 sh,rh,tca,cca,mr_lsliq,mr_lsice,fl_lsraini,fl_lssnowi, &
12 fl_ccraini,fl_ccsnowi,mr_ozone,dtau_s,dem_s)
82 character(len=64),
PARAMETER :: cosp_input_nl=
'cosp_input_nl.txt'
83 character(len=64),
PARAMETER :: cosp_output_nl=
'cosp_output_nl.txt'
84 character(len=512),
save :: finput
85 character(len=512),
save :: cmor_nl
86 integer,
save :: isccp_topheight,isccp_topheight_direction,overlap
87 integer,
save :: ncolumns
89 integer,
parameter :: ncolmax=100
90 integer,
save :: npoints
92 integer,
save :: nlevels
93 Integer :: nptslmdz,nlevlmdz
95 integer,
save :: npoints_it
109 integer ::
t0,t1,count_rate,count_max
110 integer :: nlon,nlat,geomode
111 real,
save :: radar_freq,k2,
zenang,co2,ch4,n2o,co,emsfc_lw
113 integer,
dimension(RTTOV_MAX_CHANNELS),
save :: channels
114 real,
dimension(RTTOV_MAX_CHANNELS),
save :: surfem
115 integer,
save :: surface_radar,use_mie_tables,use_gas_abs,do_ray,melt_lay
116 integer,
save :: nprmts_max_hydro,naero,nprmts_max_aero,lidar_ice_type
117 integer,
save :: platform,satellite,instrument,nchannels
118 logical,
save :: use_vgrid,csat_vgrid,use_precipitation_fluxes,use_reff
123 logical :: ok_mensuelcosp,ok_journecosp,ok_hfcosp
125 integer,
save :: nid_day_cosp,nid_mth_cosp,nid_hf_cosp
127 logical,
save :: debut_cosp=.true.
129 integer :: itau_wcosp
130 character(len=2) :: str2
131 real,
dimension(Ncolmax) :: column_ax
132 character(len=10),
save,
dimension(Ncolmax) :: chcol
134 integer,
save :: nlevout
137 include
"dimensions.h"
141 integer :: overlaplmdz
142 real,
dimension(Nptslmdz,Nlevlmdz) ::
height,phi,p,ph,t,sh,rh,tca,cca,mr_lsliq,mr_lsice,mr_ccliq,mr_ccice, &
143 fl_lsrain,fl_lssnow,fl_ccrain,fl_ccsnow,fl_lsgrpl, &
144 zlev,zlev_half,mr_ozone,radliq,radice,dtau_s,dem_s,ref_liq,ref_ice
145 real,
dimension(Nptslmdz,Nlevlmdz) :: fl_lsraini,fl_lssnowi,fl_ccraini,fl_ccsnowi
146 real,
dimension(Nptslmdz) ::
lon,lat,skt,fracterlic,u_wind,v_wind,
phis
147 real,
dimension(Nlevlmdz) ::
presnivs
149 real ::
dtime,freq_cosp
150 logical,
parameter :: lcosp=.
false.
153 namelist/cosp_input/cmor_nl,overlap,isccp_topheight,isccp_topheight_direction, &
154 npoints_it,ncolumns,nlevels,use_vgrid,nlr,csat_vgrid,finput, &
155 radar_freq,surface_radar,use_mie_tables, &
156 use_gas_abs,do_ray,melt_lay,k2,nprmts_max_hydro,naero,nprmts_max_aero, &
157 lidar_ice_type,use_precipitation_fluxes,use_reff, &
158 platform,satellite,instrument,nchannels, &
159 channels,surfem,
zenang,co2,ch4,n2o,co
176 write(str2,
'(i2.2)')
ii
178 column_ax(
ii) =
real(
ii)
184 if (overlaplmdz.ne.overlap)
then
185 print*,
'Attention overlaplmdz different de overlap lu dans namelist '
187 print*,
'Fin lecture Namelists, debut_cosp =',debut_cosp
189 print*,
' Cles sorties cosp :'
190 print*,
' Lradar_sim,Llidar_sim,Lisccp_sim,Lmisr_sim,Lrttov_sim', &
191 cfg%Lradar_sim,cfg%Llidar_sim,cfg%Lisccp_sim,cfg%Lmisr_sim,cfg%Lrttov_sim
195 print*,
'Debut phys_cosp itap,dtime,freq_cosp,ecrit_mth,ecrit_day,ecrit_hf ', &
196 itap,
dtime,freq_cosp,ecrit_mth,ecrit_day,ecrit_hf
206 print *,
'Allocating memory for gridbox type...'
208 call
construct_cosp_gridbox(dble(itap),radar_freq,surface_radar,use_mie_tables,use_gas_abs,do_ray,melt_lay,k2, &
209 npoints,nlevels,ncolumns,n_hydro,nprmts_max_hydro,naero,nprmts_max_aero,npoints_it, &
210 lidar_ice_type,isccp_topheight,isccp_topheight_direction,overlap,emsfc_lw, &
211 use_precipitation_fluxes,use_reff, &
212 platform,satellite,instrument,nchannels,
zenang, &
213 channels(1:nchannels),surfem(1:nchannels),co2,ch4,n2o,co,gbx)
219 print *,
'Populating input structure...'
227 zlev_half(:,1) =
phis(:)/9.81
230 zlev_half(ip,
k) = phi(ip,
k)/9.81 + &
231 (phi(ip,
k)-phi(ip,
k-1))/9.81 * (ph(ip,
k)-p(ip,
k)) / (p(ip,
k)-p(ip,
k-1))
234 gbx%zlev_half = zlev_half
245 if (fracterlic(ip).ge.0.5)
then
251 gbx%mr_ozone = mr_ozone
261 gbx%mr_hydro(:,:,i_lscliq) = mr_lsliq
262 gbx%mr_hydro(:,:,i_lscice) = mr_lsice
263 gbx%mr_hydro(:,:,i_cvcliq) = mr_ccliq
264 gbx%mr_hydro(:,:,i_cvcice) = mr_ccice
266 fl_lsrain = fl_lsraini + fl_ccraini
267 fl_lssnow = fl_lssnowi + fl_ccsnowi
268 gbx%rain_ls = fl_lsrain
269 gbx%snow_ls = fl_lssnow
274 gbx%grpl_ls = fl_lsgrpl
275 gbx%rain_cv = fl_ccrain
276 gbx%snow_cv = fl_ccsnow
278 gbx%Reff(:,:,i_lscliq) = ref_liq*1e-6
279 gbx%Reff(:,:,i_lscice) = ref_ice*1e-6
280 gbx%Reff(:,:,i_cvcliq) = ref_liq*1e-6
281 gbx%Reff(:,:,i_cvcice) = ref_ice*1e-6
295 print *,
'Defining new vertical grid...'
301 nlevout = vgrid%Nlvgrid
304 column_ax(
ii) =
real(
ii)
307 if (ok_mensuelcosp)
then
308 include
"ini_histmthCOSP.h"
310 if (ok_journecosp)
then
311 include
"ini_histdayCOSP.h"
314 include
"ini_histhfCOSP.h"
323 print *,
'Allocating memory for other types...'
334 print *,
'Calling simulator...'
335 call
cosp(overlap,ncolumns,cfg,vgrid,gbx,sgx,sgradar,sglidar,isccp,misr,stradar,stlidar)
348 if(stlidar%lidarcld(ip,
k).eq.r_undef)
then
349 stlidar%lidarcld(ip,
k)=0.
356 if(stlidar%cfad_sr(ip,
ii,
k).eq.r_undef)
then
357 stlidar%cfad_sr(ip,
ii,
k)=0.
365 if(sglidar%beta_mol(ip,
k).eq.r_undef)
then
366 sglidar%beta_mol(ip,
k)=0.
370 if(sglidar%beta_tot(ip,
ii,
k).eq.r_undef)
then
371 sglidar%beta_tot(ip,
ii,
k)=0.
380 if(stlidar%cldlayer(ip,
k).eq.r_undef)
then
381 stlidar%cldlayer(ip,
k)=0.
389 if(isccp%totalcldarea(ip).eq.-1.e+30)
then
390 isccp%totalcldarea(ip)=0.
392 if(isccp%meanptop(ip).eq.-1.e+30)
then
393 isccp%meanptop(ip)=0.
395 if(isccp%meantaucld(ip).eq.-1.e+30)
then
396 isccp%meantaucld(ip)=0.
398 if(isccp%meanalbedocld(ip).eq.-1.e+30)
then
399 isccp%meanalbedocld(ip)=0.
401 if(isccp%meantb(ip).eq.-1.e+30)
then
404 if(isccp%meantbclr(ip).eq.-1.e+30)
then
405 isccp%meantbclr(ip)=0.
410 if(isccp%fq_isccp(ip,
ii,
k).eq.-1.e+30)
then
411 isccp%fq_isccp(ip,
ii,
k)=0.
417 if(isccp%boxtau(ip,
ii).eq.-1.e+30)
then
418 isccp%boxtau(ip,
ii)=0.
423 if(isccp%boxptop(ip,
ii).eq.-1.e+30)
then
424 isccp%boxptop(ip,
ii)=0.
429 if (ok_mensuelcosp)
then
430 include
"write_histmthCOSP.h"
432 if (ok_journecosp)
then
433 include
"write_histdayCOSP.h"
436 include
"write_histhfCOSP.h"
442 print *,
'Deallocating memory...'
463 OPEN(10,file=cosp_input_nl,status=
'old')
464 READ(10,nml=cosp_input)
469 CALL
bcast(isccp_topheight)
470 CALL
bcast(isccp_topheight_direction)
471 CALL
bcast(npoints_it)
474 CALL
bcast(use_vgrid)
476 CALL
bcast(csat_vgrid)
478 CALL
bcast(radar_freq)
479 CALL
bcast(surface_radar)
480 CALL
bcast(use_mie_tables)
481 CALL
bcast(use_gas_abs)
485 CALL
bcast(nprmts_max_hydro)
487 CALL
bcast(nprmts_max_aero)
488 CALL
bcast(lidar_ice_type)
489 CALL
bcast(use_precipitation_fluxes)
492 CALL
bcast(satellite)
493 CALL
bcast(instrument)
494 CALL
bcast(nchannels)