19 SUBROUTINE cosp_output_write(Nlevlmdz, Npoints, Ncolumns, itap, dtime, freq_COSP, &
20 cfg, gbx, vgrid, sglidar, stlidar, isccp)
27 USE wxios
, only: wxios_closedef
28 USE xios
, only: xios_update_calendar
32 integer :: itap, Nlevlmdz, Ncolumns, Npoints
33 real :: freq_COSP, dtime
34 type(cosp_config) :: cfg
35 type(cosp_gridbox) :: gbx
36 type(cosp_sglidar) :: sglidar
37 type(cosp_isccp) :: isccp
38 type(cosp_lidarstats) :: stlidar
39 type(cosp_vgrid) :: vgrid
45 real,
dimension(Npoints,PARASOL_NREFL) :: parasolcrefl, Ncref
53 WRITE(
lunout,*)
'itau_wcosp, itap, start_time, day_step_phy =', &
70 WRITE(
lunout,*)
'DO iinit=1, iinitend ',iinitend
86 if (cfg%Llidar_sim)
then
91 if(stlidar%lidarcld(ip,
k).eq.r_undef)
then
98 if(stlidar%cfad_sr(ip,ii,
k).eq.r_undef)
then
107 if(sglidar%beta_mol(ip,
k).eq.r_undef)
then
112 if(sglidar%beta_tot(ip,ii,
k).eq.r_undef)
then
122 if(stlidar%cldlayer(ip,
k).eq.r_undef)
then
128 print*,
'Appel histwrite2d_cosp'
143 if (stlidar%cldlayer(ip,4).gt.0.01)
then
144 parasolcrefl(ip,
k)=(stlidar%parasolrefl(ip,
k)-0.03*(1.-stlidar%cldlayer(ip,4)))/ &
145 stlidar%cldlayer(ip,4)
148 parasolcrefl(ip,
k)=0.
162 if (cfg%Lisccp_sim)
then
166 if(isccp%totalcldarea(ip).eq.-1.e+30)
then
169 if(isccp%meanptop(ip).eq.-1.e+30)
then
172 if(isccp%meantaucld(ip).eq.-1.e+30)
then
175 if(isccp%meanalbedocld(ip).eq.-1.e+30)
then
178 if(isccp%meantb(ip).eq.-1.e+30)
then
181 if(isccp%meantbclr(ip).eq.-1.e+30)
then
187 if(isccp%fq_isccp(ip,ii,
k).eq.-1.e+30)
then
194 if(isccp%boxtau(ip,ii).eq.-1.e+30)
then
200 if(isccp%boxptop(ip,ii).eq.-1.e+30)
then
222 #ifndef CPP_IOIPSL_NO_OUTPUT
242 #ifndef CPP_IOIPSL_NO_OUTPUT
258 INTEGER,
INTENT(IN) :: ito
282 CHARACTER(LEN=20) :: typeecrit
286 IF (index(var%cosp_typeecrit(iff),
"once") > 0)
THEN
288 ELSE IF(index(var%cosp_typeecrit(iff),
"t_min") > 0)
THEN
289 typeecrit =
't_min(X)'
290 ELSE IF(index(var%cosp_typeecrit(iff),
"t_max") > 0)
THEN
291 typeecrit =
't_max(X)'
292 ELSE IF(index(var%cosp_typeecrit(iff),
"inst") > 0)
THEN
293 typeecrit =
'inst(X)'
298 IF (typeecrit==
'inst(X)'.OR.typeecrit==
'once')
THEN
305 IF (.not. ok_all_xml)
then
306 IF ( var%cles(iff) )
THEN
308 WRITE(
lunout,*)
'Appel wxios_add_field_to_file var%name =',var%name
311 var%description, var%unit, 1, typeecrit)
316 #ifndef CPP_IOIPSL_NO_OUTPUT
317 IF ( var%cles(iff) )
THEN
318 CALL histdef (
cosp_nidfiles(iff), var%name, var%description, var%unit, &
343 INTEGER :: iff, klevs
344 INTEGER,
INTENT(IN),
OPTIONAL :: ncols
345 INTEGER,
INTENT(IN) :: nvertsave
349 CHARACTER(LEN=20) :: typeecrit, nomi
350 CHARACTER(LEN=20) :: nom
351 character(len=2) :: str2
352 CHARACTER(len=20) :: nam_axvert
355 IF (nvertsave.eq.
nvertp(iff))
THEN
360 nam_axvert=
"pressure2"
361 ELSE IF (nvertsave.eq.
nvertcol(iff))
THEN
366 nam_axvert=
"presnivs"
370 IF (
PRESENT(ncols))
THEN
371 write(str2,
'(i2.2)')ncols
373 nom=
"c"//str2//
"_"//nomi
380 IF (index(var%cosp_typeecrit(iff),
"once") > 0)
THEN
382 ELSE IF(index(var%cosp_typeecrit(iff),
"t_min") > 0)
THEN
383 typeecrit =
't_min(X)'
384 ELSE IF(index(var%cosp_typeecrit(iff),
"t_max") > 0)
THEN
385 typeecrit =
't_max(X)'
386 ELSE IF(index(var%cosp_typeecrit(iff),
"inst") > 0)
THEN
387 typeecrit =
'inst(X)'
392 IF (typeecrit==
'inst(X)'.OR.typeecrit==
'once')
THEN
399 IF (.not. ok_all_xml)
then
400 IF ( var%cles(iff) )
THEN
402 WRITE(
lunout,*)
'Appel wxios_add_field_to_file 3d nom variable nam_axvert = ',nom, nam_axvert
405 var%description, var%unit, 1, typeecrit, nam_axvert)
410 #ifndef CPP_IOIPSL_NO_OUTPUT
411 IF ( var%cles(iff) )
THEN
412 CALL histdef (
cosp_nidfiles(iff), nom, var%description, var%unit, &
414 klevs, nvertsave, 32, typeecrit, &
430 USE xios
, only: xios_send_field
437 REAL,
DIMENSION(:),
INTENT(IN) :: field
441 REAL,
DIMENSION(klon_mpi) :: buffer_omp
442 INTEGER,
allocatable,
DIMENSION(:) :: index2d
444 CHARACTER(LEN=20) :: nomi, nom
445 character(len=2) :: str2
446 LOGICAL,
SAVE :: firstx
464 IF (
SIZE(field)/=
klon) &
465 CALL abort_physic(
'iophy::histwrite2d_cosp',
'Field first DIMENSION not equal to klon',1)
467 CALL gather_omp(field,buffer_omp)
469 CALL grid1dto2d_mpi(buffer_omp,field2d)
475 ALLOCATE(index2d(
nbp_lon*jj_nb))
476 #ifndef CPP_IOIPSL_NO_OUTPUT
481 IF (.not. ok_all_xml)
then
484 WRITE(
lunout,*)
'xios_send_field variable ',var%name
486 CALL xios_send_field(var%name, field2d)
497 WRITE(
lunout,*)
'xios_send_field variable ',var%name
499 CALL xios_send_field(var%name, field2d)
519 USE xios
, only: xios_send_field
527 REAL,
DIMENSION(:,:),
INTENT(IN) :: field
528 INTEGER,
INTENT(IN),
OPTIONAL :: ncols
529 INTEGER,
DIMENSION(3),
INTENT(IN) :: nverts
533 REAL,
DIMENSION(klon_mpi,SIZE(field,2)) :: buffer_omp
534 REAL :: Field3d(
nbp_lon,jj_nb,size(field,2))
535 INTEGER :: ip, n, nlev
536 INTEGER,
ALLOCATABLE,
DIMENSION(:) :: index3d
537 CHARACTER(LEN=20) :: nomi, nom
538 character(len=2) :: str2
539 LOGICAL,
SAVE :: firstx
545 IF (
PRESENT(ncols))
THEN
546 write(str2,
'(i2.2)')ncols
548 nom=
"c"//str2//
"_"//nomi
565 IF (
SIZE(field,1)/=
klon) &
566 CALL abort_physic(
'iophy::histwrite3d',
'Field first DIMENSION not equal to klon',1)
570 CALL gather_omp(field,buffer_omp)
572 CALL grid1dto2d_mpi(buffer_omp,field3d)
578 ALLOCATE(index3d(
nbp_lon*jj_nb*nlev))
579 #ifndef CPP_IOIPSL_NO_OUTPUT
584 IF (.not. ok_all_xml)
then
586 CALL xios_send_field(nom, field3d(:,:,1:nlev))
597 CALL xios_send_field(nom, field3d(:,:,1:nlev))
615 CHARACTER(LEN=20) :: nam_var, nnam_var
616 LOGICAL,
DIMENSION(3) :: cles_var
619 CALL getin(
'cles_'//nam_var,cles_var)
620 CALL getin(
'name_'//nam_var,nam_var)
621 IF(
prt_level>10)
WRITE(
lunout,*)
'nam_var cles_var ',nam_var,cles_var(:)
type(ctrl_outcosp), save o_parasol_crefl
subroutine histwrite2d_cosp(var, field)
type(ctrl_outcosp), save o_clcalipso
type(ctrl_outcosp), save o_cltcalipso
real, save cosp_fill_value
integer, dimension(3), save nvertmcosp
type(ctrl_outcosp), save o_ctpisccp
integer, dimension(3), save nvert
integer, save day_step_phy
logical, save cosp_varsdefined
integer, dimension(3), save nvertcol
subroutine conf_cospoutputs(nam_var, cles_var)
type(ctrl_outcosp), save o_cllcalipso
c c $Id c c calculs statistiques distribution nuage ftion du regime dynamique c c Ce calcul doit etre fait a partir de valeurs mensuelles CALL nbregdyn DO k
integer, dimension(3), save nvertisccp
type(ctrl_outcosp), save o_sunlit
!$Id itapm1 ENDIF!IM on interpole les champs sur les niveaux STD de pression!IM a chaque pas de temps de la physique c!positionnement de l argument logique a false c!pour ne pas recalculer deux fois la meme chose!c!a cet effet un appel a plevel_new a ete deplace c!a la fin de la serie d appels c!la boucle DO nlevSTD a ete internalisee c!dans d ou la creation de cette routine c c!CALL false
logical, dimension(3), save cosp_outfilekeys
character(len=20), dimension(3), save cosp_outfiletypes
type(ctrl_outcosp), save o_cfad_lidarsr532
type(ctrl_outcosp), save o_clhcalipso
real, dimension(3), save zoutm_cosp
integer, dimension(3), save nhoricosp
subroutine cosp_output_write(Nlevlmdz, Npoints, Ncolumns, itap, dtime, freq_COSP, cfg, gbx, vgrid, sglidar, stlidar, isccp)
!FH On elimine toutes les clefs physiques dans la dynamique prt_level
subroutine histwrite3d_cosp(var, field, nverts, ncols)
type(ctrl_outcosp), save o_meantbclrisccp
type(ctrl_outcosp), save o_atb532
integer, dimension(3), save cosp_nidfiles
type(ctrl_outcosp), save o_beta_mol532
subroutine histdef3d_cosp(iff, var, nvertsave, ncols)
type(ctrl_outcosp), save o_tauisccp
real, save zdtimemoy_cosp
!$Id itapm1 ENDIF!IM on interpole les champs sur les niveaux STD de pression!IM a chaque pas de temps de la physique c!positionnement de l argument logique a false c!pour ne pas recalculer deux fois la meme chose!c!a cet effet un appel a plevel_new a ete deplace c!a la fin de la serie d appels c!la boucle DO nlevSTD a ete internalisee c!dans d ou la creation de cette routine c c!CALL ulevSTD CALL &zphi philevSTD CALL &zx_rh rhlevSTD!DO klev DO klon klev DO klon klev DO klon klev DO klon klev DO klon klev DO klon klev DO klon klev DO klon klev DO klon klev DO klon du jour ou toutes les read_climoz CALL true
subroutine set_itau_iocosp(ito)
type(ctrl_outcosp), save o_meantbisccp
type(ctrl_outcosp), save o_clmcalipso
subroutine histdef2d_cosp(iff, var)
integer, dimension(3), save nvertp
type(ctrl_outcosp), save o_ncrefl
type(ctrl_outcosp), save o_albisccp
subroutine abort_physic(modname, message, ierr)
type(ctrl_outcosp), save o_boxtauisccp
character(len=20), dimension(3), save cosp_outfilenames
type(ctrl_outcosp), save o_tclisccp
type(ctrl_outcosp), save o_boxptopisccp
!$Header!gestion des impressions de sorties et de débogage la sortie standard prt_level COMMON comprint lunout
type(ctrl_outcosp), save o_clisccp2
type(ctrl_outcosp), save o_parasol_refl
integer, save itau_iocosp