12 |
|
|
13 |
! From phylmd/phyredem.F, version 1.3 2005/05/25 13:10:09 |
! From phylmd/phyredem.F, version 1.3 2005/05/25 13:10:09 |
14 |
! Author: Z. X. Li (LMD/CNRS) |
! Author: Z. X. Li (LMD/CNRS) |
15 |
! Date: 19930818 |
! Date: 1993/08/18 |
16 |
! Objet : écriture de l'état de démarrage ou redémarrage pour la physique |
! Objet : écriture de l'état de démarrage ou redémarrage pour la physique |
17 |
|
|
18 |
USE dimphy, ONLY: klev, klon, zmasq |
USE dimphy, ONLY: klev, klon, zmasq |
23 |
nf95_def_var, nf95_enddef, nf95_redef, nf95_put_var, nf95_close |
nf95_def_var, nf95_enddef, nf95_redef, nf95_put_var, nf95_close |
24 |
USE temps, ONLY: itau_phy |
USE temps, ONLY: itau_phy |
25 |
|
|
26 |
CHARACTER(len=*) fichnom |
CHARACTER(len=*), INTENT(IN):: fichnom |
27 |
REAL, INTENT(IN):: rlat(klon), rlon(klon) |
REAL, INTENT(IN):: rlat(klon), rlon(klon) |
28 |
REAL pctsrf(klon, nbsrf) |
REAL, INTENT(IN):: pctsrf(klon, nbsrf) |
29 |
REAL tsol(klon, nbsrf) |
REAL, INTENT(IN):: tsol(:, :) ! (klon, nbsrf) |
30 |
REAL tsoil(klon, nsoilmx, nbsrf) |
REAL, INTENT(IN):: tsoil(:, :, :) ! (klon, nsoilmx, nbsrf) |
31 |
REAL tslab(klon), seaice(klon) !IM "slab" ocean |
REAL, INTENT(IN):: tslab(:), seaice(:) ! (klon) slab ocean |
32 |
REAL qsurf(klon, nbsrf) |
REAL, INTENT(IN):: qsurf(:, :) ! (klon, nbsrf) |
33 |
REAL, intent(in):: qsol(klon) |
REAL, intent(in):: qsol(:) ! (klon) |
34 |
REAL snow(klon, nbsrf) |
REAL, INTENT(IN):: snow(klon, nbsrf) |
35 |
REAL albedo(klon, nbsrf) |
REAL, INTENT(IN):: albedo(klon, nbsrf) |
36 |
REAL alblw(klon, nbsrf) |
REAL, INTENT(IN):: alblw(klon, nbsrf) |
37 |
REAL evap(klon, nbsrf) |
REAL, INTENT(IN):: evap(klon, nbsrf) |
38 |
REAL, INTENT(IN):: rain_fall(klon) |
REAL, INTENT(IN):: rain_fall(klon) |
39 |
REAL snow_fall(klon) |
REAL, INTENT(IN):: snow_fall(klon) |
40 |
REAL solsw(klon) |
REAL, INTENT(IN):: solsw(klon) |
41 |
REAL, INTENT(IN):: sollw(klon) |
REAL, INTENT(IN):: sollw(klon) |
42 |
REAL fder(klon) |
REAL, INTENT(IN):: fder(klon) |
43 |
REAL radsol(klon) |
REAL, INTENT(IN):: radsol(klon) |
44 |
REAL frugs(klon, nbsrf) |
REAL, INTENT(IN):: frugs(klon, nbsrf) |
45 |
REAL agesno(klon, nbsrf) |
REAL, INTENT(IN):: agesno(klon, nbsrf) |
46 |
REAL zmea(klon) |
REAL, INTENT(IN):: zmea(klon) |
47 |
REAL, intent(in):: zstd(klon) |
REAL, intent(in):: zstd(klon) |
48 |
REAL, intent(in):: zsig(klon) |
REAL, intent(in):: zsig(klon) |
49 |
REAL zgam(klon) |
REAL, intent(in):: zgam(klon) |
50 |
REAL zthe(klon) |
REAL, intent(in):: zthe(klon) |
51 |
REAL zpic(klon) |
REAL, intent(in):: zpic(klon) |
52 |
REAL zval(klon) |
REAL, intent(in):: zval(klon) |
53 |
REAL t_ancien(klon, klev), q_ancien(klon, klev) |
REAL, intent(in):: t_ancien(klon, klev), q_ancien(klon, klev) |
54 |
REAL rnebcon(klon, klev), ratqs(klon, klev), clwcon(klon, klev) |
REAL, intent(in):: rnebcon(klon, klev), ratqs(klon, klev) |
55 |
REAL run_off_lic_0(klon) |
REAL, intent(in):: clwcon(klon, klev) |
56 |
|
REAL, intent(in):: run_off_lic_0(klon) |
57 |
real, intent(in):: sig1(klon, klev) ! section adiabatic updraft |
real, intent(in):: sig1(klon, klev) ! section adiabatic updraft |
58 |
|
|
59 |
real, intent(in):: w01(klon, klev) |
real, intent(in):: w01(klon, klev) |
62 |
! Local: |
! Local: |
63 |
|
|
64 |
INTEGER ncid, idim2, idim3 |
INTEGER ncid, idim2, idim3 |
65 |
integer varid, varid_run_off_lic_0, varid_sig1, varid_w01 |
integer varid, varid_run_off_lic_0, varid_sig1, varid_w01, varid_rlon |
66 |
|
integer varid_rlat, varid_zmasq, varid_fter, varid_flic, varid_foce |
67 |
|
integer varid_fsic |
68 |
INTEGER isoil, nsrf |
INTEGER isoil, nsrf |
69 |
CHARACTER(len=7) str7 |
CHARACTER(len=7) str7 |
70 |
CHARACTER(len=2) str2 |
CHARACTER(len=2) str2 |
81 |
call nf95_def_dim(ncid, 'points_physiques', klon, idim2) |
call nf95_def_dim(ncid, 'points_physiques', klon, idim2) |
82 |
call nf95_def_dim(ncid, 'klev', klev, idim3) |
call nf95_def_dim(ncid, 'klev', klev, idim3) |
83 |
|
|
84 |
call nf95_def_var(ncid, 'longitude', nf90_float, idim2, varid) |
call nf95_def_var(ncid, 'longitude', nf90_float, idim2, varid_rlon) |
85 |
call nf95_put_att(ncid, varid, 'title', & |
call nf95_def_var(ncid, 'latitude', nf90_float, idim2, varid_rlat) |
|
'Longitudes de la grille physique') |
|
|
call nf95_enddef(ncid) |
|
|
call nf95_put_var(ncid, varid, rlon) |
|
86 |
|
|
87 |
call nf95_redef(ncid) |
call nf95_def_var(ncid, 'masque', nf90_float, idim2, varid_zmasq) |
88 |
call nf95_def_var(ncid, 'latitude', nf90_float, idim2, varid) |
call nf95_put_att(ncid, varid_zmasq, 'title', 'masque terre mer') |
|
call nf95_put_att(ncid, varid, 'title', & |
|
|
'Latitudes de la grille physique') |
|
|
call nf95_enddef(ncid) |
|
|
call nf95_put_var(ncid, varid, rlat) |
|
89 |
|
|
90 |
! PB ajout du masque terre/mer |
! Fractions de chaque sous-surface |
91 |
|
|
92 |
call nf95_redef(ncid) |
call nf95_def_var(ncid, 'FTER', nf90_float, idim2, varid_fter) |
93 |
call nf95_def_var(ncid, 'masque', nf90_float, idim2, varid) |
call nf95_put_att(ncid, varid_fter, 'title', 'fraction de continent') |
|
call nf95_put_att(ncid, varid, 'title', 'masque terre mer') |
|
|
call nf95_enddef(ncid) |
|
|
call nf95_put_var(ncid, varid, zmasq) |
|
|
! BP ajout des fraction de chaque sous-surface |
|
94 |
|
|
95 |
! 1. fraction de terre |
call nf95_def_var(ncid, 'FLIC', nf90_float, idim2, varid_flic) |
96 |
|
call nf95_put_att(ncid, varid_flic, 'title', 'fraction glace de terre') |
97 |
|
|
98 |
call nf95_redef(ncid) |
call nf95_def_var(ncid, 'FOCE', nf90_float, idim2, varid_foce) |
99 |
call nf95_def_var(ncid, 'FTER', nf90_float, idim2, varid) |
call nf95_put_att(ncid, varid_foce, 'title', 'fraction ocean') |
|
call nf95_put_att(ncid, varid, 'title', 'fraction de continent') |
|
|
call nf95_enddef(ncid) |
|
|
call nf95_put_var(ncid, varid, pctsrf(:, is_ter)) |
|
100 |
|
|
101 |
! 2. Fraction de glace de terre |
call nf95_def_var(ncid, 'FSIC', nf90_float, idim2, varid_fsic) |
102 |
|
call nf95_put_att(ncid, varid_fsic, 'title', 'fraction glace mer') |
103 |
|
|
|
call nf95_redef(ncid) |
|
|
call nf95_def_var(ncid, 'FLIC', nf90_float, idim2, varid) |
|
|
call nf95_put_att(ncid, varid, 'title', 'fraction glace de terre') |
|
104 |
call nf95_enddef(ncid) |
call nf95_enddef(ncid) |
|
call nf95_put_var(ncid, varid, pctsrf(:, is_lic)) |
|
|
|
|
|
! 3. fraction ocean |
|
105 |
|
|
106 |
call nf95_redef(ncid) |
call nf95_put_var(ncid, varid_rlon, rlon) |
107 |
call nf95_def_var(ncid, 'FOCE', nf90_float, idim2, varid) |
call nf95_put_var(ncid, varid_rlat, rlat) |
108 |
call nf95_put_att(ncid, varid, 'title', 'fraction ocean') |
call nf95_put_var(ncid, varid_zmasq, zmasq) |
109 |
call nf95_enddef(ncid) |
call nf95_put_var(ncid, varid_fter, pctsrf(:, is_ter)) |
110 |
call nf95_put_var(ncid, varid, pctsrf(:, is_oce)) |
call nf95_put_var(ncid, varid_flic, pctsrf(:, is_lic)) |
111 |
|
call nf95_put_var(ncid, varid_foce, pctsrf(:, is_oce)) |
112 |
! 4. Fraction glace de mer |
call nf95_put_var(ncid, varid_fsic, pctsrf(:, is_sic)) |
|
|
|
|
call nf95_redef(ncid) |
|
|
call nf95_def_var(ncid, 'FSIC', nf90_float, idim2, varid) |
|
|
call nf95_put_att(ncid, varid, 'title', 'fraction glace mer') |
|
|
call nf95_enddef(ncid) |
|
|
call nf95_put_var(ncid, varid, pctsrf(:, is_sic)) |
|
113 |
|
|
114 |
DO nsrf = 1, nbsrf |
DO nsrf = 1, nbsrf |
115 |
IF (nsrf<=99) THEN |
IF (nsrf<=99) THEN |