9 |
|
|
10 |
contains |
contains |
11 |
|
|
12 |
SUBROUTINE physiq(nq, firstcal, lafin, rdayvrai, gmtime, pdtphys, paprs, & |
SUBROUTINE physiq(lafin, rdayvrai, gmtime, pdtphys, paprs, & |
13 |
pplay, pphi, pphis, u, v, t, qx, omega, d_u, d_v, & |
pplay, pphi, pphis, u, v, t, qx, omega, d_u, d_v, & |
14 |
d_t, d_qx, d_ps, dudyn, PVteta) |
d_t, d_qx, d_ps, dudyn, PVteta) |
15 |
|
|
16 |
! From phylmd/physiq.F, v 1.22 2006/02/20 09:38:28 |
! From phylmd/physiq.F, version 1.22 2006/02/20 09:38:28 |
17 |
|
|
18 |
! Author : Z.X. Li (LMD/CNRS), date: 1993/08/18 |
! Author : Z.X. Li (LMD/CNRS), date: 1993/08/18 |
19 |
|
|
23 |
!AA - stockage des moyennes des champs necessaires |
!AA - stockage des moyennes des champs necessaires |
24 |
!AA en mode traceur off-line |
!AA en mode traceur off-line |
25 |
|
|
26 |
USE ioipsl, only: ymds2ju, histwrite, histsync |
use abort_gcm_m, only: abort_gcm |
27 |
use dimens_m, only: jjm, iim, llm |
USE calendar, only: ymds2ju |
|
use indicesol, only: nbsrf, is_ter, is_lic, is_sic, is_oce, & |
|
|
clnsurf, epsfra |
|
|
use dimphy, only: klon, nbtr |
|
|
use conf_gcm_m, only: raz_date, offline |
|
|
use dimsoil, only: nsoilmx |
|
|
use temps, only: itau_phy, day_ref, annee_ref |
|
28 |
use clesphys, only: ecrit_hf, ecrit_ins, ecrit_mth, & |
use clesphys, only: ecrit_hf, ecrit_ins, ecrit_mth, & |
29 |
cdmmax, cdhmax, & |
cdmmax, cdhmax, & |
30 |
co2_ppm, ecrit_reg, ecrit_tra, ksta, ksta_ter, & |
co2_ppm, ecrit_reg, ecrit_tra, ksta, ksta_ter, & |
31 |
ok_kzmin |
ok_kzmin |
32 |
use clesphys2, only: iflag_con, ok_orolf, ok_orodr, nbapp_rad, & |
use clesphys2, only: iflag_con, ok_orolf, ok_orodr, nbapp_rad, & |
33 |
cycle_diurne, new_oliq, soil_model |
cycle_diurne, new_oliq, soil_model |
34 |
use iniprint, only: prt_level |
use clmain_m, only: clmain |
|
use abort_gcm_m, only: abort_gcm |
|
|
use YOMCST, only: rcpd, rtt, rlvtt, rg, ra, rsigma, retv, romega |
|
35 |
use comgeomphy |
use comgeomphy |
36 |
|
use conf_gcm_m, only: raz_date, offline |
37 |
|
use conf_phys_m, only: conf_phys |
38 |
use ctherm |
use ctherm |
39 |
use phytrac_m, only: phytrac |
use dimens_m, only: jjm, iim, llm, nqmx |
40 |
|
use dimphy, only: klon, nbtr |
41 |
|
use dimsoil, only: nsoilmx |
42 |
|
use hgardfou_m, only: hgardfou |
43 |
|
USE histcom, only: histsync |
44 |
|
USE histwrite_m, only: histwrite |
45 |
|
use indicesol, only: nbsrf, is_ter, is_lic, is_sic, is_oce, & |
46 |
|
clnsurf, epsfra |
47 |
|
use ini_histhf_m, only: ini_histhf |
48 |
|
use ini_histday_m, only: ini_histday |
49 |
|
use ini_histins_m, only: ini_histins |
50 |
|
use iniprint, only: prt_level |
51 |
use oasis_m |
use oasis_m |
|
use radepsi |
|
|
use radopt |
|
|
use yoethf |
|
|
use ini_hist, only: ini_histhf, ini_histday, ini_histins |
|
52 |
use orbite_m, only: orbite, zenang |
use orbite_m, only: orbite, zenang |
53 |
|
use ozonecm_m, only: ozonecm |
54 |
use phyetat0_m, only: phyetat0, rlat, rlon |
use phyetat0_m, only: phyetat0, rlat, rlon |
|
use hgardfou_m, only: hgardfou |
|
|
use conf_phys_m, only: conf_phys |
|
55 |
use phyredem_m, only: phyredem |
use phyredem_m, only: phyredem |
56 |
|
use phystokenc_m, only: phystokenc |
57 |
|
use phytrac_m, only: phytrac |
58 |
use qcheck_m, only: qcheck |
use qcheck_m, only: qcheck |
59 |
use ozonecm_m, only: ozonecm |
use radepsi |
60 |
|
use radopt |
61 |
|
use temps, only: itau_phy, day_ref, annee_ref |
62 |
|
use yoethf_m |
63 |
|
use SUPHEC_M, only: rcpd, rtt, rlvtt, rg, ra, rsigma, retv, romega |
64 |
|
|
65 |
! Declaration des constantes et des fonctions thermodynamiques : |
! Declaration des constantes et des fonctions thermodynamiques : |
66 |
use fcttre, only: thermcep, foeew, qsats, qsatl |
use fcttre, only: thermcep, foeew, qsats, qsatl |
67 |
|
|
68 |
! Variables argument: |
! Variables argument: |
69 |
|
|
|
INTEGER, intent(in):: nq ! nombre de traceurs (y compris vapeur d'eau) |
|
|
|
|
70 |
REAL, intent(in):: rdayvrai |
REAL, intent(in):: rdayvrai |
71 |
! (elapsed time since January 1st 0h of the starting year, in days) |
! (elapsed time since January 1st 0h of the starting year, in days) |
72 |
|
|
73 |
REAL, intent(in):: gmtime ! heure de la journée en fraction de jour |
REAL, intent(in):: gmtime ! heure de la journée en fraction de jour |
74 |
REAL, intent(in):: pdtphys ! pas d'integration pour la physique (seconde) |
REAL, intent(in):: pdtphys ! pas d'integration pour la physique (seconde) |
|
LOGICAL, intent(in):: firstcal ! first call to "calfis" |
|
75 |
logical, intent(in):: lafin ! dernier passage |
logical, intent(in):: lafin ! dernier passage |
76 |
|
|
77 |
REAL, intent(in):: paprs(klon, llm+1) |
REAL, intent(in):: paprs(klon, llm+1) |
86 |
REAL pphis(klon) ! input geopotentiel du sol |
REAL pphis(klon) ! input geopotentiel du sol |
87 |
|
|
88 |
REAL u(klon, llm) ! input vitesse dans la direction X (de O a E) en m/s |
REAL u(klon, llm) ! input vitesse dans la direction X (de O a E) en m/s |
89 |
REAL v(klon, llm) ! input vitesse Y (de S a N) en m/s |
REAL, intent(in):: v(klon, llm) ! vitesse Y (de S a N) en m/s |
90 |
REAL t(klon, llm) ! input temperature (K) |
REAL t(klon, llm) ! input temperature (K) |
91 |
|
|
92 |
REAL, intent(in):: qx(klon, llm, nq) |
REAL, intent(in):: qx(klon, llm, nqmx) |
93 |
! (humidite specifique (kg/kg) et fractions massiques des autres traceurs) |
! (humidité spécifique et fractions massiques des autres traceurs) |
94 |
|
|
95 |
REAL omega(klon, llm) ! input vitesse verticale en Pa/s |
REAL omega(klon, llm) ! input vitesse verticale en Pa/s |
96 |
REAL d_u(klon, llm) ! output tendance physique de "u" (m/s/s) |
REAL d_u(klon, llm) ! output tendance physique de "u" (m/s/s) |
97 |
REAL d_v(klon, llm) ! output tendance physique de "v" (m/s/s) |
REAL d_v(klon, llm) ! output tendance physique de "v" (m/s/s) |
98 |
REAL d_t(klon, llm) ! output tendance physique de "t" (K/s) |
REAL d_t(klon, llm) ! output tendance physique de "t" (K/s) |
99 |
REAL d_qx(klon, llm, nq) ! output tendance physique de "qx" (kg/kg/s) |
REAL d_qx(klon, llm, nqmx) ! output tendance physique de "qx" (kg/kg/s) |
100 |
REAL d_ps(klon) ! output tendance physique de la pression au sol |
REAL d_ps(klon) ! output tendance physique de la pression au sol |
101 |
|
|
102 |
|
LOGICAL:: firstcal = .true. |
103 |
|
|
104 |
INTEGER nbteta |
INTEGER nbteta |
105 |
PARAMETER(nbteta=3) |
PARAMETER(nbteta=3) |
106 |
|
|
405 |
|
|
406 |
EXTERNAL alboc ! calculer l'albedo sur ocean |
EXTERNAL alboc ! calculer l'albedo sur ocean |
407 |
EXTERNAL ajsec ! ajustement sec |
EXTERNAL ajsec ! ajustement sec |
|
EXTERNAL clmain ! couche limite |
|
408 |
!KE43 |
!KE43 |
409 |
EXTERNAL conema3 ! convect4.3 |
EXTERNAL conema3 ! convect4.3 |
410 |
EXTERNAL fisrtilp ! schema de condensation a grande echelle (pluie) |
EXTERNAL fisrtilp ! schema de condensation a grande echelle (pluie) |
702 |
END DO |
END DO |
703 |
END IF |
END IF |
704 |
ok_sync=.TRUE. |
ok_sync=.TRUE. |
705 |
IF (nq < 2) THEN |
IF (nqmx < 2) THEN |
706 |
abort_message = 'eaux vapeur et liquide sont indispensables' |
abort_message = 'eaux vapeur et liquide sont indispensables' |
707 |
CALL abort_gcm(modname, abort_message, 1) |
CALL abort_gcm(modname, abort_message, 1) |
708 |
ENDIF |
ENDIF |
836 |
! Initialisation des sorties |
! Initialisation des sorties |
837 |
|
|
838 |
call ini_histhf(pdtphys, nid_hf, nid_hf3d) |
call ini_histhf(pdtphys, nid_hf, nid_hf3d) |
839 |
call ini_histday(pdtphys, ok_journe, nid_day, nq) |
call ini_histday(pdtphys, ok_journe, nid_day, nqmx) |
840 |
call ini_histins(pdtphys, ok_instan, nid_ins) |
call ini_histins(pdtphys, ok_instan, nid_ins) |
841 |
CALL ymds2ju(annee_ref, 1, int(day_ref), 0., date0) |
CALL ymds2ju(annee_ref, 1, int(day_ref), 0., date0) |
842 |
!XXXPB Positionner date0 pour initialisation de ORCHIDEE |
!XXXPB Positionner date0 pour initialisation de ORCHIDEE |
855 |
d_v(i, k) = 0.0 |
d_v(i, k) = 0.0 |
856 |
ENDDO |
ENDDO |
857 |
ENDDO |
ENDDO |
858 |
DO iq = 1, nq |
DO iq = 1, nqmx |
859 |
DO k = 1, llm |
DO k = 1, llm |
860 |
DO i = 1, klon |
DO i = 1, klon |
861 |
d_qx(i, k, iq) = 0.0 |
d_qx(i, k, iq) = 0.0 |
878 |
qs_seri(i, k) = 0. |
qs_seri(i, k) = 0. |
879 |
ENDDO |
ENDDO |
880 |
ENDDO |
ENDDO |
881 |
IF (nq >= 3) THEN |
IF (nqmx >= 3) THEN |
882 |
tr_seri(:, :, :nq-2) = qx(:, :, 3:nq) |
tr_seri(:, :, :nqmx-2) = qx(:, :, 3:nqmx) |
883 |
ELSE |
ELSE |
884 |
tr_seri(:, :, 1) = 0. |
tr_seri(:, :, 1) = 0. |
885 |
ENDIF |
ENDIF |
951 |
! Mettre en action les conditions aux limites (albedo, sst, etc.). |
! Mettre en action les conditions aux limites (albedo, sst, etc.). |
952 |
! Prescrire l'ozone et calculer l'albedo sur l'ocean. |
! Prescrire l'ozone et calculer l'albedo sur l'ocean. |
953 |
|
|
954 |
if (nq >= 5) then |
if (nqmx >= 5) then |
955 |
wo = qx(:, :, 5) * zmasse / dobson_u / 1e3 |
wo = qx(:, :, 5) * zmasse / dobson_u / 1e3 |
956 |
else IF (MOD(itap - 1, lmt_pas) == 0) THEN |
else IF (MOD(itap - 1, lmt_pas) == 0) THEN |
957 |
wo = ozonecm(REAL(julien), paprs) |
wo = ozonecm(REAL(julien), paprs) |
1035 |
|
|
1036 |
fder = dlw |
fder = dlw |
1037 |
|
|
1038 |
CALL clmain(pdtphys, itap, date0, pctsrf, pctsrf_new, & |
! Couche limite: |
1039 |
t_seri, q_seri, u_seri, v_seri, & |
|
1040 |
julien, rmu0, co2_ppm, & |
CALL clmain(pdtphys, itap, date0, pctsrf, pctsrf_new, t_seri, q_seri, & |
1041 |
ok_veget, ocean, npas, nexca, ftsol, & |
u_seri, v_seri, julien, rmu0, co2_ppm, ok_veget, ocean, npas, nexca, & |
1042 |
soil_model, cdmmax, cdhmax, & |
ftsol, soil_model, cdmmax, cdhmax, ksta, ksta_ter, ok_kzmin, ftsoil, & |
1043 |
ksta, ksta_ter, ok_kzmin, ftsoil, qsol, & |
qsol, paprs, pplay, fsnow, fqsurf, fevap, falbe, falblw, fluxlat, & |
1044 |
paprs, pplay, fsnow, fqsurf, fevap, falbe, falblw, & |
rain_fall, snow_fall, fsolsw, fsollw, sollwdown, fder, rlon, rlat, & |
1045 |
fluxlat, rain_fall, snow_fall, & |
cuphy, cvphy, frugs, firstcal, lafin, agesno, rugoro, d_t_vdf, & |
1046 |
fsolsw, fsollw, sollwdown, fder, & |
d_q_vdf, d_u_vdf, d_v_vdf, d_ts, fluxt, fluxq, fluxu, fluxv, cdragh, & |
1047 |
rlon, rlat, cuphy, cvphy, frugs, & |
cdragm, q2, dsens, devap, ycoefh, yu1, yv1, t2m, q2m, u10m, v10m, & |
1048 |
firstcal, lafin, agesno, rugoro, & |
pblh, capCL, oliqCL, cteiCL, pblT, therm, trmb1, trmb2, trmb3, plcl, & |
1049 |
d_t_vdf, d_q_vdf, d_u_vdf, d_v_vdf, d_ts, & |
fqcalving, ffonte, run_off_lic_0, fluxo, fluxg, tslab, seaice) |
|
fluxt, fluxq, fluxu, fluxv, cdragh, cdragm, & |
|
|
q2, dsens, devap, & |
|
|
ycoefh, yu1, yv1, t2m, q2m, u10m, v10m, & |
|
|
pblh, capCL, oliqCL, cteiCL, pblT, & |
|
|
therm, trmb1, trmb2, trmb3, plcl, & |
|
|
fqcalving, ffonte, run_off_lic_0, & |
|
|
fluxo, fluxg, tslab, seaice) |
|
1050 |
|
|
1051 |
!XXX Incrementation des flux |
! Incrémentation des flux |
1052 |
|
|
1053 |
zxfluxt=0. |
zxfluxt=0. |
1054 |
zxfluxq=0. |
zxfluxq=0. |
1794 |
, d_h_vcol, d_qt, d_qw, d_ql, d_qs, d_ec) |
, d_h_vcol, d_qt, d_qw, d_ql, d_qs, d_ec) |
1795 |
END IF |
END IF |
1796 |
|
|
1797 |
!AA Installation de l'interface online-offline pour traceurs |
! Calcul des tendances traceurs |
1798 |
|
call phytrac(rnpb, itap, lmt_pas, julien, gmtime, firstcal, lafin, & |
1799 |
! Calcul des tendances traceurs |
nqmx-2, pdtphys, u, t, paprs, pplay, pmfu, pmfd, pen_u, pde_u, & |
1800 |
|
pen_d, pde_d, ycoefh, fm_therm, entr_therm, yu1, yv1, ftsol, pctsrf, & |
1801 |
call phytrac(rnpb, itap, lmt_pas, julien, gmtime, firstcal, lafin, nq-2, & |
frac_impa, frac_nucl, pphis, pphi, albsol, rhcl, cldfra, rneb, & |
1802 |
pdtphys, u, v, t, paprs, pplay, pmfu, pmfd, pen_u, pde_u, pen_d, & |
diafra, cldliq, pmflxr, pmflxs, prfl, psfl, da, phi, mp, upwd, dnwd, & |
1803 |
pde_d, ycoefh, fm_therm, entr_therm, yu1, yv1, ftsol, pctsrf, & |
tr_seri, zmasse) |
|
frac_impa, frac_nucl, pphis, pphi, albsol, rhcl, cldfra, & |
|
|
rneb, diafra, cldliq, itop_con, ibas_con, pmflxr, pmflxs, prfl, & |
|
|
psfl, da, phi, mp, upwd, dnwd, tr_seri, zmasse) |
|
1804 |
|
|
1805 |
IF (offline) THEN |
IF (offline) THEN |
1806 |
|
call phystokenc(pdtphys, rlon, rlat, t, pmfu, pmfd, pen_u, pde_u, & |
1807 |
print*, 'Attention on met a 0 les thermiques pour phystoke' |
pen_d, pde_d, fm_therm, entr_therm, ycoefh, yu1, yv1, ftsol, & |
1808 |
call phystokenc(pdtphys, rlon, rlat, & |
pctsrf, frac_impa, frac_nucl, pphis, airephy, pdtphys, itap) |
|
t, pmfu, pmfd, pen_u, pde_u, pen_d, pde_d, & |
|
|
fm_therm, entr_therm, & |
|
|
ycoefh, yu1, yv1, ftsol, pctsrf, & |
|
|
frac_impa, frac_nucl, & |
|
|
pphis, airephy, pdtphys, itap) |
|
|
|
|
1809 |
ENDIF |
ENDIF |
1810 |
|
|
1811 |
! Calculer le transport de l'eau et de l'energie (diagnostique) |
! Calculer le transport de l'eau et de l'energie (diagnostique) |
1812 |
|
CALL transp(paprs, zxtsol, t_seri, q_seri, u_seri, v_seri, zphi, ve, vq, & |
1813 |
|
ue, uq) |
1814 |
|
|
1815 |
CALL transp (paprs, zxtsol, & |
! diag. bilKP |
|
t_seri, q_seri, u_seri, v_seri, zphi, & |
|
|
ve, vq, ue, uq) |
|
|
|
|
|
!IM diag. bilKP |
|
1816 |
|
|
1817 |
CALL transp_lay (paprs, zxtsol, & |
CALL transp_lay (paprs, zxtsol, & |
1818 |
t_seri, q_seri, u_seri, v_seri, zphi, & |
t_seri, q_seri, u_seri, v_seri, zphi, & |
1872 |
ENDDO |
ENDDO |
1873 |
ENDDO |
ENDDO |
1874 |
|
|
1875 |
IF (nq >= 3) THEN |
IF (nqmx >= 3) THEN |
1876 |
DO iq = 3, nq |
DO iq = 3, nqmx |
1877 |
DO k = 1, llm |
DO k = 1, llm |
1878 |
DO i = 1, klon |
DO i = 1, klon |
1879 |
d_qx(i, k, iq) = (tr_seri(i, k, iq-2) - qx(i, k, iq)) / pdtphys |
d_qx(i, k, iq) = (tr_seri(i, k, iq-2) - qx(i, k, iq)) / pdtphys |
1907 |
t_ancien, q_ancien, rnebcon, ratqs, clwcon, run_off_lic_0) |
t_ancien, q_ancien, rnebcon, ratqs, clwcon, run_off_lic_0) |
1908 |
ENDIF |
ENDIF |
1909 |
|
|
1910 |
|
firstcal = .FALSE. |
1911 |
|
|
1912 |
contains |
contains |
1913 |
|
|
1914 |
subroutine write_histday |
subroutine write_histday |
1915 |
|
|
1916 |
use grid_change, only: gr_phy_write_3d |
use gr_phy_write_3d_m, only: gr_phy_write_3d |
1917 |
integer itau_w ! pas de temps ecriture |
integer itau_w ! pas de temps ecriture |
1918 |
|
|
1919 |
!------------------------------------------------ |
!------------------------------------------------ |
1920 |
|
|
1921 |
if (ok_journe) THEN |
if (ok_journe) THEN |
1922 |
itau_w = itau_phy + itap |
itau_w = itau_phy + itap |
1923 |
if (nq <= 4) then |
if (nqmx <= 4) then |
1924 |
call histwrite(nid_day, "Sigma_O3_Royer", itau_w, & |
call histwrite(nid_day, "Sigma_O3_Royer", itau_w, & |
1925 |
gr_phy_write_3d(wo) * 1e3) |
gr_phy_write_3d(wo) * 1e3) |
1926 |
! (convert "wo" from kDU to DU) |
! (convert "wo" from kDU to DU) |