4 |
|
|
5 |
contains |
contains |
6 |
|
|
7 |
SUBROUTINE physiq(lafin, rdayvrai, time, dtphys, paprs, play, pphi, pphis, & |
SUBROUTINE physiq(lafin, dayvrai, time, dtphys, paprs, play, pphi, pphis, & |
8 |
u, v, t, qx, omega, d_u, d_v, d_t, d_qx) |
u, v, t, qx, omega, d_u, d_v, d_t, d_qx) |
9 |
|
|
10 |
! From phylmd/physiq.F, version 1.22 2006/02/20 09:38:28 |
! From phylmd/physiq.F, version 1.22 2006/02/20 09:38:28 |
25 |
ok_orodr, ok_orolf |
ok_orodr, ok_orolf |
26 |
USE clmain_m, ONLY: clmain |
USE clmain_m, ONLY: clmain |
27 |
use clouds_gno_m, only: clouds_gno |
use clouds_gno_m, only: clouds_gno |
28 |
USE comgeomphy, ONLY: airephy, cuphy, cvphy |
USE comgeomphy, ONLY: airephy |
29 |
USE concvl_m, ONLY: concvl |
USE concvl_m, ONLY: concvl |
30 |
USE conf_gcm_m, ONLY: offline, raz_date |
USE conf_gcm_m, ONLY: offline, raz_date |
31 |
USE conf_phys_m, ONLY: conf_phys |
USE conf_phys_m, ONLY: conf_phys |
38 |
USE dimphy, ONLY: klon |
USE dimphy, ONLY: klon |
39 |
USE dimsoil, ONLY: nsoilmx |
USE dimsoil, ONLY: nsoilmx |
40 |
use drag_noro_m, only: drag_noro |
use drag_noro_m, only: drag_noro |
41 |
|
use dynetat0_m, only: day_ref, annee_ref |
42 |
USE fcttre, ONLY: foeew, qsatl, qsats, thermcep |
USE fcttre, ONLY: foeew, qsatl, qsats, thermcep |
43 |
use fisrtilp_m, only: fisrtilp |
use fisrtilp_m, only: fisrtilp |
44 |
USE hgardfou_m, ONLY: hgardfou |
USE hgardfou_m, ONLY: hgardfou |
58 |
use readsulfate_preind_m, only: readsulfate_preind |
use readsulfate_preind_m, only: readsulfate_preind |
59 |
use sugwd_m, only: sugwd |
use sugwd_m, only: sugwd |
60 |
USE suphec_m, ONLY: ra, rcpd, retv, rg, rlvtt, romega, rsigma, rtt |
USE suphec_m, ONLY: ra, rcpd, retv, rg, rlvtt, romega, rsigma, rtt |
61 |
USE temps, ONLY: annee_ref, day_ref, itau_phy |
USE temps, ONLY: itau_phy |
62 |
use unit_nml_m, only: unit_nml |
use unit_nml_m, only: unit_nml |
63 |
USE ymds2ju_m, ONLY: ymds2ju |
USE ymds2ju_m, ONLY: ymds2ju |
64 |
USE yoethf_m, ONLY: r2es, rvtmp2 |
USE yoethf_m, ONLY: r2es, rvtmp2 |
66 |
|
|
67 |
logical, intent(in):: lafin ! dernier passage |
logical, intent(in):: lafin ! dernier passage |
68 |
|
|
69 |
REAL, intent(in):: rdayvrai |
integer, intent(in):: dayvrai |
70 |
! (elapsed time since January 1st 0h of the starting year, in days) |
! current day number, based at value 1 on January 1st of annee_ref |
71 |
|
|
72 |
REAL, intent(in):: time ! heure de la journ\'ee en fraction de jour |
REAL, intent(in):: time ! heure de la journ\'ee en fraction de jour |
73 |
REAL, intent(in):: dtphys ! pas d'integration pour la physique (seconde) |
REAL, intent(in):: dtphys ! pas d'integration pour la physique (seconde) |
503 |
REAL ue_lay(klon, llm) ! transport zonal de l'energie a chaque niveau vert. |
REAL ue_lay(klon, llm) ! transport zonal de l'energie a chaque niveau vert. |
504 |
REAL uq_lay(klon, llm) ! transport zonal de l'eau a chaque niveau vert. |
REAL uq_lay(klon, llm) ! transport zonal de l'eau a chaque niveau vert. |
505 |
|
|
|
REAL zsto |
|
506 |
real date0 |
real date0 |
507 |
|
|
508 |
! Variables li\'ees au bilan d'\'energie et d'enthalpie : |
! Variables li\'ees au bilan d'\'energie et d'enthalpie : |
680 |
! Initialisation des sorties |
! Initialisation des sorties |
681 |
|
|
682 |
call ini_histins(dtphys, ok_instan, nid_ins) |
call ini_histins(dtphys, ok_instan, nid_ins) |
683 |
CALL ymds2ju(annee_ref, 1, int(day_ref), 0., date0) |
CALL ymds2ju(annee_ref, 1, day_ref, 0., date0) |
684 |
! Positionner date0 pour initialisation de ORCHIDEE |
! Positionner date0 pour initialisation de ORCHIDEE |
685 |
print *, 'physiq date0: ', date0 |
print *, 'physiq date0: ', date0 |
686 |
ENDIF test_firstcal |
ENDIF test_firstcal |
740 |
|
|
741 |
! Incrémenter le compteur de la physique |
! Incrémenter le compteur de la physique |
742 |
itap = itap + 1 |
itap = itap + 1 |
743 |
julien = MOD(NINT(rdayvrai), 360) |
julien = MOD(dayvrai, 360) |
744 |
if (julien == 0) julien = 360 |
if (julien == 0) julien = 360 |
745 |
|
|
746 |
forall (k = 1: llm) zmasse(:, k) = (paprs(:, k) - paprs(:, k + 1)) / rg |
forall (k = 1: llm) zmasse(:, k) = (paprs(:, k) - paprs(:, k + 1)) / rg |
1228 |
! Introduce the aerosol direct and first indirect radiative forcings: |
! Introduce the aerosol direct and first indirect radiative forcings: |
1229 |
IF (ok_ade .OR. ok_aie) THEN |
IF (ok_ade .OR. ok_aie) THEN |
1230 |
! Get sulfate aerosol distribution : |
! Get sulfate aerosol distribution : |
1231 |
CALL readsulfate(rdayvrai, firstcal, sulfate) |
CALL readsulfate(dayvrai, time, firstcal, sulfate) |
1232 |
CALL readsulfate_preind(rdayvrai, firstcal, sulfate_pi) |
CALL readsulfate_preind(dayvrai, time, firstcal, sulfate_pi) |
1233 |
|
|
1234 |
CALL aeropt(play, paprs, t_seri, sulfate, rhcl, tau_ae, piz_ae, cg_ae, & |
CALL aeropt(play, paprs, t_seri, sulfate, rhcl, tau_ae, piz_ae, cg_ae, & |
1235 |
aerindex) |
aerindex) |
1324 |
ENDDO |
ENDDO |
1325 |
|
|
1326 |
CALL drag_noro(klon, llm, dtphys, paprs, play, zmea, zstd, zsig, zgam, & |
CALL drag_noro(klon, llm, dtphys, paprs, play, zmea, zstd, zsig, zgam, & |
1327 |
zthe, zpic, zval, igwd, idx, itest, t_seri, u_seri, v_seri, & |
zthe, zpic, zval, itest, t_seri, u_seri, v_seri, zulow, zvlow, & |
1328 |
zulow, zvlow, zustrdr, zvstrdr, d_t_oro, d_u_oro, d_v_oro) |
zustrdr, zvstrdr, d_t_oro, d_u_oro, d_v_oro) |
1329 |
|
|
1330 |
! ajout des tendances |
! ajout des tendances |
1331 |
DO k = 1, llm |
DO k = 1, llm |
1474 |
! Si c'est la fin, il faut conserver l'etat de redemarrage |
! Si c'est la fin, il faut conserver l'etat de redemarrage |
1475 |
IF (lafin) THEN |
IF (lafin) THEN |
1476 |
itau_phy = itau_phy + itap |
itau_phy = itau_phy + itap |
1477 |
CALL phyredem("restartphy.nc", rlat, rlon, pctsrf, ftsol, ftsoil, & |
CALL phyredem("restartphy.nc", pctsrf, ftsol, ftsoil, tslab, seaice, & |
1478 |
tslab, seaice, fqsurf, qsol, fsnow, falbe, falblw, fevap, & |
fqsurf, qsol, fsnow, falbe, falblw, fevap, rain_fall, snow_fall, & |
1479 |
rain_fall, snow_fall, solsw, sollw, dlw, radsol, frugs, & |
solsw, sollw, dlw, radsol, frugs, agesno, zmea, zstd, zsig, zgam, & |
1480 |
agesno, zmea, zstd, zsig, zgam, zthe, zpic, zval, t_ancien, & |
zthe, zpic, zval, t_ancien, q_ancien, rnebcon, ratqs, clwcon, & |
1481 |
q_ancien, rnebcon, ratqs, clwcon, run_off_lic_0, sig1, w01) |
run_off_lic_0, sig1, w01) |
1482 |
ENDIF |
ENDIF |
1483 |
|
|
1484 |
firstcal = .FALSE. |
firstcal = .FALSE. |
1493 |
USE histsync_m, ONLY: histsync |
USE histsync_m, ONLY: histsync |
1494 |
USE histwrite_m, ONLY: histwrite |
USE histwrite_m, ONLY: histwrite |
1495 |
|
|
1496 |
real zout |
integer i, itau_w ! pas de temps ecriture |
|
integer itau_w ! pas de temps ecriture |
|
1497 |
REAL zx_tmp_2d(iim, jjm + 1), zx_tmp_3d(iim, jjm + 1, llm) |
REAL zx_tmp_2d(iim, jjm + 1), zx_tmp_3d(iim, jjm + 1, llm) |
1498 |
|
|
1499 |
!-------------------------------------------------- |
!-------------------------------------------------- |
1501 |
IF (ok_instan) THEN |
IF (ok_instan) THEN |
1502 |
! Champs 2D: |
! Champs 2D: |
1503 |
|
|
|
zsto = dtphys * ecrit_ins |
|
|
zout = dtphys * ecrit_ins |
|
1504 |
itau_w = itau_phy + itap |
itau_w = itau_phy + itap |
1505 |
|
|
|
i = NINT(zout/zsto) |
|
1506 |
CALL gr_fi_ecrit(1, klon, iim, jjm + 1, pphis, zx_tmp_2d) |
CALL gr_fi_ecrit(1, klon, iim, jjm + 1, pphis, zx_tmp_2d) |
1507 |
CALL histwrite(nid_ins, "phis", itau_w, zx_tmp_2d) |
CALL histwrite(nid_ins, "phis", itau_w, zx_tmp_2d) |
1508 |
|
|
|
i = NINT(zout/zsto) |
|
1509 |
CALL gr_fi_ecrit(1, klon, iim, jjm + 1, airephy, zx_tmp_2d) |
CALL gr_fi_ecrit(1, klon, iim, jjm + 1, airephy, zx_tmp_2d) |
1510 |
CALL histwrite(nid_ins, "aire", itau_w, zx_tmp_2d) |
CALL histwrite(nid_ins, "aire", itau_w, zx_tmp_2d) |
1511 |
|
|