10 SUBROUTINE physiq (nlon,nlev, &
11 & debut,lafin,jd_cur, jh_cur,
pdtphys, &
15 & d_u, d_v, d_t, d_qx, d_ps &
23 USE ioipsl
, only : getin,
histvert,histdef,histend,
ymds2ju,ju2ymds,histsync
47 #include "dimensions.h"
88 integer,
parameter :: jjmp1=jjm+1-1/jjm
89 integer,
parameter :: iip1=
iim+1
95 INTEGER,
PARAMETER :: ivap = 1
96 INTEGER,
PARAMETER :: iliq = 2
97 INTEGER,
PARAMETER :: iice = 3
98 INTEGER,
PARAMETER :: icin = 4
99 INTEGER,
PARAMETER :: isnow = 5
100 INTEGER,
PARAMETER :: irain = 6
101 INTEGER,
PARAMETER :: itke = 7
102 INTEGER,
PARAMETER :: itked = 8
108 integer,
intent(in) :: nlon
109 integer,
intent(in) :: nlev
110 real,
intent(in) :: jD_cur
111 real,
intent(in) :: jH_cur
112 logical,
intent(in) :: debut
113 logical,
intent(in) :: lafin
114 real,
intent(in) :: pdtphys
115 real,
intent(in) :: paprs(
klon,
klev+1)
118 real,
intent(in) :: pphis(
klon)
119 real,
intent(in) :: ppresnivs(
klev)
126 real,
intent(in) :: flxmass_w(
klon,
klev)
131 real,
intent(out) :: d_ps(
klon)
132 real,
intent(in) :: dudyn(
iim+1,jjmp1,
klev)
137 integer,
save :: itau=0
141 logical,
save :: first=.
true.
151 integer,
save :: nid_hist
154 integer,
save :: iwrite_phys
156 integer :: iwrite_phys_omp
174 logical :: FlagSV = .
true.
175 logical :: FlagSV_Veg = .
true.
176 logical :: FlagSV_SNo = .
true.
177 logical :: FlagSV_BSn = .
false.
178 logical :: FlagSV_KzT = .
true.
179 logical :: FlagSV_SWD = .
true.
181 logical :: FlagSV_SBC = .
false.
182 logical :: FlagSV_UBC = .
false.
183 logical :: FlagAT = .
true.
184 character(len=1) :: TypeAT =
'e'
185 logical :: FlagAT_TKE = .
true.
186 logical :: FlagCM = .
true.
188 logical :: FlagCM_UpD = .
false.
189 logical :: FlagCP = .
true.
190 logical :: FlagRT = .
true.
191 logical :: FlagS0_SLO = .
false.
192 logical :: FlagS0_MtM = .
false.
193 logical :: Flag_O = .
true.
195 logical :: FlagVR = .
false.
207 real :: dt0_CP = 600.
208 real :: dt0_RT = 900.
210 real(kind=real8),
dimension(klon) :: dx___HOST
211 real(kind=real8),
dimension(klon) :: dy___HOST
212 real :: DD_AxX = 90.00
213 real,
dimension(klevp1) :: s_HOST
214 real,
dimension(klon) :: sh___HOST
215 real(kind=real8),
dimension(klon) :: sh_a_HOST
216 real(kind=real8),
dimension(klon) :: slopxHOST
217 real(kind=real8),
dimension(klon) :: slopyHOST
218 real(kind=real8),
dimension(klon) :: slopeHOST
219 real(kind=real8),
allocatable :: MMaskHOST(:,:)
220 real,
dimension(klon) :: lonh_HOST
221 real,
dimension(klon) :: latr_HOST
223 real,
dimension(klon,klevp1) :: pkta_HOST
224 real,
dimension(klon) :: psa__HOST
225 real,
dimension(klon,klevp1) :: gZa__HOST
226 real,
dimension(klon,klevp1) :: gZam_HOST
227 real,
dimension(klon,klev) :: Ua___HOST
228 real,
dimension(klon,klev) :: Va___HOST
229 real,
dimension(klon,klev) :: Wa___HOST
230 real,
dimension(klon,klevp1) :: qv___HOST
231 real,
dimension(klon,klev) :: qw___HOST
233 real,
dimension(klon,klev) :: qi___HOST
234 real,
dimension(klon,klev) :: CIN__HOST
235 real,
dimension(klon,klev) :: CF___HOST
237 real,
dimension(klon,klev) :: qs___HOST
238 real,
dimension(klon,klev) :: qr___HOST
239 real,
dimension(klon,klev) :: TKE__HOST
240 real,
dimension(klon,klev) :: eps__HOST
241 real,
dimension(klon,klev) :: dpkt___dt
242 real,
dimension(klon,klev) :: dua____dt
243 real,
dimension(klon,klev) :: dva____dt
244 real,
dimension(klon,klev) :: dqv____dt
245 real,
dimension(klon,klev) :: dqw____dt
247 real,
dimension(klon,klev) :: dqi____dt
248 real,
dimension(klon,klev) :: dCi____dt
249 real,
dimension(klon,klev) :: dCF____dt
250 real,
dimension(klon,klev) :: dqs____dt
251 real,
dimension(klon,klev) :: dqr____dt
276 integer,
save :: it0EXP
277 integer,
save :: it0RUN
284 integer :: ixq1,i0x0,mxqq
285 integer :: jyq1,j0y0,myqq
292 integer,
parameter :: n0pt=1
293 integer,
dimension(n0pt) :: IOi0SV
294 integer,
dimension(n0pt) :: IOj0SV
295 real,
dimension(klon) :: sst__HOST
313 integer,
save :: annee_ref
323 real,
dimension(klon) :: Ts___HOST
324 real,
dimension(klon) :: pkt_DY_surf_tmp
325 real,
dimension(klon) :: qv_HOST_surf_tmp
328 real,
dimension(klon,klev) :: cldfra
348 call getin(
"iwrite_phys",iwrite_phys_omp)
351 iwrite_phys=iwrite_phys_omp
352 t_ops=pdtphys*iwrite_phys
353 t_wrt=pdtphys*iwrite_phys
366 call histbeg_phy(
"histins.nc",itau0,jd_cur,dtime,nhori,nid_hist)
371 call histvert(nid_hist,
"presnivs",
"Vertical levels",
"Pa",
klev, &
372 ppresnivs,zvertid,
'down')
374 call histdef(nid_hist,
'temperature',
'Atmospheric temperature',
'K', &
376 'inst(X)',t_ops,t_wrt)
377 call histdef(nid_hist,
'pplay',
'atmospheric pressure',
'K', &
379 'inst(X)',t_ops,t_wrt)
380 call histdef(nid_hist,
'ps',
'Surface Pressure',
'Pa', &
381 iim,jj_nb,nhori,1,1,1,zvertid,32, &
382 'inst(X)',t_ops,t_wrt)
383 call histdef(nid_hist,
'qx_vap',
'specific humidity',
'kg/kg', &
385 'inst(X)',t_ops,t_wrt)
386 call histdef(nid_hist,
'qx_liq',
'atmospheric liquid water content',
'kg/kg', &
388 'inst(X)',t_ops,t_wrt)
389 call histdef(nid_hist,
'qx_ice',
'atmospheric ice content',
'kg/kg', &
391 'inst(X)',t_ops,t_wrt)
392 call histdef(nid_hist,
'u',
'Eastward Zonal Wind',
'm/s', &
394 'inst(X)',t_ops,t_wrt)
395 call histdef(nid_hist,
'v',
'Northward Meridional Wind',
'm/s', &
397 'inst(X)',t_ops,t_wrt)
398 call histdef(nid_hist,
'lonh',
'longitude',
'Hours', &
399 iim,jj_nb,nhori,1,1,1,zvertid,32, &
400 'inst(X)',t_ops,t_wrt)
401 call histdef(nid_hist,
'latr',
'latitude',
'radian', &
402 iim,jj_nb,nhori,1,1,1,zvertid,32, &
403 'inst(X)',t_ops,t_wrt)
404 call histdef(nid_hist,
'sst',
'Prescribed SST',
'K', &
405 iim,jj_nb,nhori,1,1,1,zvertid,32, &
406 'inst(X)',t_ops,t_wrt)
408 call histdef(nid_hist,
'd_t',
'Atmospheric temperature trends after MAR physics',
'K/s', &
410 'inst(X)',t_ops,t_wrt)
411 call histdef(nid_hist,
'd_u',
'Eastward Zonal Wind trend',
'm/s/s', &
413 'inst(X)',t_ops,t_wrt)
414 call histdef(nid_hist,
'd_v',
'Northward Meridional Wind trend',
'm/s/s', &
416 'inst(X)',t_ops,t_wrt)
418 call histdef(nid_hist,
'snow',
'snowfall convectif + stratiform',
'm', &
419 iim,jj_nb,nhori,1,1,1,zvertid,32, &
420 'inst(X)',t_ops,t_wrt)
421 call histdef(nid_hist,
'rain',
'rainfall convectif + stratiform',
'm', &
422 iim,jj_nb,nhori,1,1,1,zvertid,32, &
423 'inst(X)',t_ops,t_wrt)
424 call histdef(nid_hist,
'snowCP',
'snowfall convective',
'm', &
425 iim,jj_nb,nhori,1,1,1,zvertid,32, &
426 'inst(X)',t_ops,t_wrt)
427 call histdef(nid_hist,
'rainCP',
'rainfall convective',
'm', &
428 iim,jj_nb,nhori,1,1,1,zvertid,32, &
429 'inst(X)',t_ops,t_wrt)
430 call histdef(nid_hist,
'nebulosity',
'CF___HOST',
'-', &
432 'inst(X)',t_ops,t_wrt)
434 call histend(nid_hist)
465 print*,
'dans physiq.F90 :'
469 print*,
'On initialise les tendances à zéro:'
479 ALLOCATE(mmaskhost(
klon,m_azim))
487 dt0dyn=daysec/
REAL(day_step)
517 IF (ap(k) .NE. 0)
THEN
518 CALL abort_gcm(
'',
'MAR physic can be applied only with sigma levels, check vertical resolution in disvert.F90',1)
520 s_host(i)=0.5*(
bp(k)+
bp(k+1))
555 hour_h=int(secondes)/3600
556 minu_h=(int(secondes)-hour_h*3600)/60
558 sec__h=int(secondes)-(hour_h*3600)-(minu_h*60)
560 print*,
'CONTROL du temps avant d appeler la physique'
561 print*,
'zjulian=',zjulian
562 print*,
'annee_ref=',annee_ref
563 print*,
'jD_cur=',jd_cur
564 print*,
'jH_cur=',jh_cur
565 print*,
'Year_H=',year_h
566 print*,
'Mon__H',mon__h
567 print*,
'Day__H',day__h
568 print*,
'secondes=',secondes
569 print*,
'Hour_H=',hour_h
570 print*,
'minu_H=',minu_h
571 print*,
'sec__H=',sec__h
601 IF (it0run.LE.1)
THEN
603 print*,
'it0RUN=0; On appelle les routines d initialisation de la physique de MAR'
641 print*,
'Appel de PHY INI'
654 print*,
'Initialisation en dur des variables topo pour une aquaplanete'
662 mmaskhost(:,:) = 0.00
690 print*,
'Calcul de Ts___HOST dans la physique'
691 print*,
'Initialisation de la temperature de surface avec les SST aquaplanète'
693 ts___host(i)=273.+27.*(1-sin(1.5*
latitude(i))**2)
704 print*,
'Avant PHY SISVAT INP'
705 print*,
'MAXVAL(Ts___HOST(:)=)',maxval(ts___host(:))
706 print*,
'MINVAL(Ts___HOST(:)=)',minval(ts___host(:))
707 print*,
'Appel de PHY SISVAT INP'
712 print*,
'Apres PHY SISVAT INP'
713 print*,
'MAXVAL(Ts___HOST(:)=)',maxval(ts___host(:))
714 print*,
'MINVAL(Ts___HOST(:)=)',minval(ts___host(:))
726 IF (.NOT. flagrt .OR. &
727 & .NOT. flagat .OR. &
731 print*,
'Appel de PHY SISVAT UBC'
738 print*,
'Apres PHY_SISVAT_UBC'
748 print*,
'Calcul des inputs de MAR à partir de LMDZ'
758 pkt_dy_surf_tmp(:)=t(:,1) / (pplay(:,1)/1000) ** kap
763 pkta_host(:,
klev+1)=pkt_dy_surf_tmp(:)
766 pkta_host(:,i) = t(:,k) / (pplay(:,k)/1000) ** kap
770 psa__host(:)=(paprs(:,1)-paprs(:,
klev+1))/1000.
777 gza__host(:,i)=pphi(:,k)
779 gza__host(:,
klev+1)=pphis(:)
783 gzam_host(:,k+1)=0.5*(gza__host(:,k+1)+gza__host(:,k))
785 gzam_host(:,1)=1.5*gza__host(:,1)-0.5*gza__host(:,2)
788 ua___host(:,i)=u(:,k)
789 va___host(:,i)=v(:,k)
796 wa___host(:,i)=flxmass_w(:,k) /
cell_area(:) * (gzam_host(:,i+1) - gzam_host(:,i))/(paprs(:,k+1)-paprs(:,k))
804 dpkt___dt(:,i)=d_t(:,k) / (pplay(:,k)/1000) ** kap
805 dua____dt(:,i)=d_u(:,k)
806 dva____dt(:,i)=d_v(:,k)
814 qv___host(:,i)=qx(:,k,ivap)
815 qw___host(:,i)=qx(:,k,iliq)
816 qi___host(:,i)=qx(:,k,iice)
817 cin__host(:,i)=qx(:,k,icin)
818 qs___host(:,i)=qx(:,k,isnow)
819 qr___host(:,i)=qx(:,k,irain)
820 tke__host(:,i)=qx(:,k,itke)
821 eps__host(:,i)=qx(:,k,itked)
829 qv_host_surf_tmp(:)=qv___host(:,
klev)
833 qv___host(:,
klev+1)=qv_host_surf_tmp(:)
839 dqv____dt(:,i)=d_qx(:,k,ivap)
840 dqw____dt(:,i)=d_qx(:,k,iliq)
841 dqi____dt(:,i)=d_qx(:,k,iice)
842 dci____dt(:,i)=d_qx(:,k,icin)
843 dqs____dt(:,i)=d_qx(:,k,isnow)
844 dqr____dt(:,i)=d_qx(:,k,irain)
854 print*,
'Calcul des SST en aquaplanète pour MAR comme dans le cas n°101 de LMDZ'
857 sst__host(i)=273.+27.*(1-sin(1.5*
latitude(i))**2)
867 print*,
'Control variables LMDZ entree de la physique'
868 print*,
'MAXVAL(pplay(:,klev))=',maxval(pplay(:,
klev))
869 print*,
'MINVAL(pplay(:,klev))=',minval(pplay(:,
klev))
870 print*,
'MAXVAL(t(:,klev))=',maxval(t(:,
klev))
871 print*,
'MINVAL(t(:,klev))=',minval(t(:,
klev))
872 print*,
'MAXVAL(pplay(:,1))=',maxval(pplay(:,1))
873 print*,
'MINVAL(pplay(:,1))=',minval(pplay(:,1))
874 print*,
'MAXVAL(t(:,1))=',maxval(t(:,1))
875 print*,
'MINVAL(t(:,1))=',minval(t(:,1))
876 print*,
'MAXVAL(pplay)=',maxval(pplay)
877 print*,
'MINVAL(pplay)=',minval(pplay)
878 print*,
'MAXVAL(t)=',maxval(t)
879 print*,
'MINVAL(t)=',minval(t)
880 print*,
'MAXVAL(pphis)=',maxval(pphis)
881 print*,
'MINVAL(pphis)=',minval(pphis)
883 print*,
'CONTROL variables MAR entree de la physique'
884 print*,
'MAXVAL(pkta_HOST)=',maxval(pkta_host)
885 print*,
'MAXVAL(psa__HOST)=',maxval(psa__host)
886 print*,
'MAXVAL(gZa__HOST)=',maxval(gza__host)
887 print*,
'MAXVAL(gZam_HOST)=',maxval(gzam_host)
888 print*,
'MAXVAL(Ua___HOST)=',maxval(ua___host)
889 print*,
'MAXVAL(Va___HOST)=',maxval(va___host)
890 print*,
'MAXVAL(qv___HOST)=',maxval(qv___host)
891 print*,
'MINVAL(pkta_HOST)=',minval(pkta_host)
892 print*,
'MINVAL(psa__HOST)=',minval(psa__host)
893 print*,
'MINVAL(gZa__HOST)=',minval(gza__host)
894 print*,
'MINVAL(gZam_HOST)=',minval(gzam_host)
895 print*,
'MINVAL(Ua___HOST)=',minval(ua___host)
896 print*,
'MINVAL(Va___HOST)=',minval(va___host)
897 print*,
'MINVAL(qv___HOST)=',minval(qv___host)
898 print*,
'Control iterations:'
899 print*,
'it0RUN=',it0run
900 print*,
'it0EXP=',it0exp
909 IF (isnan(va___host(i,k)))
THEN
911 print*,
'Attention : NaN at'
913 print*,
'latitude=',
latitude(i)*180/rpi
925 print*,
'Appel de PHY MAR'
1031 & ,year_h,mon__h,day__h,hour_h,minu_h,sec__h &
1032 & ,ixq1 ,i0x0 ,mxqq &
1033 & ,jyq1 ,j0y0 ,myqq &
1039 & ,ioi0sv,ioj0sv,n0pt)
1046 print*,
'On est sorti de PHY_MAR, on peut actualiser les variables pour LMDZ'
1053 d_u(:,k)=dua____dt(:,i)
1054 d_v(:,k)=dva____dt(:,i)
1055 d_t(:,k)=dpkt___dt(:,i)*(pplay(:,k)/1000) ** kap
1057 d_qx(:,k,ivap)=dqv____dt(:,i)
1058 d_qx(:,k,iliq)=dqw____dt(:,i)
1059 d_qx(:,k,iice)=dqi____dt(:,i)
1060 d_qx(:,k,icin)=dci____dt(:,i)
1061 d_qx(:,k,isnow)=dqs____dt(:,i)
1062 d_qx(:,k,irain)=dqr____dt(:,i)
1064 cldfra(:,k)=cf___host(:,i)
1075 DEALLOCATE(mmaskhost)
1077 print*,
'Control des tendances aprés la physique de MAR'
1079 print*,
'maxval(d_u)=',maxval(d_u)
1080 print*,
'maxval(d_v)=',maxval(d_v)
1081 print*,
'maxval(d_t)=',maxval(d_t)
1082 print*,
'maxval(paprs(:,1))=',maxval(paprs(:,1))
1083 print*,
'minval(d_u)=',minval(d_u)
1084 print*,
'minval(d_v)=',minval(d_v)
1085 print*,
'minval(d_t)=',minval(d_t)
1086 print*,
'minval(paprs(:,1))=',minval(paprs(:,1))
1087 print*,
'Test snowCM'
1088 print*,
'MAXVAL(snowCM)=',maxval(
snowcm)
1089 print*,
'MAXVAL(rainCM)=',maxval(
raincm)
1090 print*,
'maxval(cldfra)=',maxval(cldfra)
1091 print*,
'minval(cldfra)=',minval(cldfra)
1097 print*,
'On ecrit les variables dans un fichier netcdf instantané'
1105 if (modulo(itau,iwrite_phys)==0)
then
1141 print*,
'Fin de physiq.f90'
real(kind=real8), save diraxx
!$Id zjulian!correction pour l heure initiale!jyg!jyg CALL ymds2ju(annee_ref, 1, day_ref, hour, zjulian)!jyg CALL histbeg_phy("histrac"
real(kind=real8), dimension(:), allocatable, save raincp
real(kind=real8), dimension(:,:), allocatable, save qv__dy
real, dimension(:), allocatable, save longitude
real(kind=real8), save dxhost
real(kind=real8), save varsst
real(kind=real8), dimension(:), allocatable, save raincm
subroutine abort_gcm(modname, message, ierr)
real(kind=real8), dimension(:), allocatable, save snowcp
!$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
subroutine phy________ini
!$Id zjulian!correction pour l heure initiale!jyg!jyg CALL nid_tra CALL histvert(nid_tra,"presnivs","Vertical levels","Pa", klev, presnivs, nvert,"down") zsto
subroutine physiq(nlon, nlev, debut, lafin, jD_cur, jH_cur, pdtphys, paprs, pplay, pphi, pphis, presnivs, u, v, rot, t, qx, flxmass_w, d_u, d_v, d_t, d_qx, d_ps, dudyn)
real(kind=real8), dimension(:), allocatable, save hlatsv_gpt
!$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 pplay
!$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 &zphi geo500!IM on interpole a chaque pas de temps le paprs
subroutine histbeg_phy(name, itau0, zjulian, dtime, nhori, nid_day)
real(kind=real8), dimension(:), allocatable, save hsensv_gpt
!$Id Turb_fcg_gcssold get_uvd hqturb_gcssold endif!large scale llm day day1 day day1 *dt_toga endif!time annee_ref dt_toga u_toga vq_toga w_prof vq_prof llm u(l)
!$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
real(kind=real8), dimension(:), allocatable, save snowcm
!$Id zjulian!correction pour l heure initiale!jyg!jyg CALL pdtphys
real(kind=real8), save rcp
c c zjulian c cym CALL iim cym klev iim
subroutine phys_state_var_init()
real(kind=real8), dimension(:,:), allocatable, save pkt_dy
subroutine phyetat0(fichnom)
real(kind=real8), dimension(:), allocatable, save uqs_sv_gpt
subroutine phy_sisvat_ubc(FlagRT, FlagAT, FlagCM, FlagCP)
subroutine phy_sisvat_inp(FlagSV_SBC, TsHOST, kcolq)
real, dimension(:), allocatable, save cell_area
real(kind=real8), dimension(:), allocatable, save uts_sv_gpt
real, dimension(:), allocatable, save latitude