/[lmdze]/trunk/phylmd/phyredem.f
ViewVC logotype

Annotation of /trunk/phylmd/phyredem.f

Parent Directory Parent Directory | Revision Log Revision Log


Revision 157 - (hide annotations)
Mon Jul 20 16:01:49 2015 UTC (8 years, 10 months ago) by guez
Original Path: trunk/Sources/phylmd/phyredem.f
File size: 6713 byte(s)
Just encapsulated SUBROUTINE vlsplt in a module and cleaned it.

In procedure vlx, local variables dxqu and adxqu only need indices
iip2:ip1jm. Otherwise, just cleaned vlx.

Procedures dynredem0 and dynredem1 no longer have argument fichnom,
they just operate on a file named "restart.nc". The programming
guideline here is that gcm should not be more complex than it needs by
itself, other programs (ce0l etc.) just have to adapt to gcm. So ce0l
now creates files "restart.nc" and "restartphy.nc".

In order to facilitate decentralizing the writing of "restartphy.nc",
created a procedure phyredem0 out of phyredem. phyredem0 creates the
NetCDF header of "restartphy.nc" while phyredem writes the NetCDF
variables. As the global attribute itau_phy needs to be filled in
phyredem0, at the beginnig of the run, we must compute its value
instead of just using itap. So we have a dummy argument lmt_pas of
phyredem0. Also, the ncid of "startphy.nc" is upgraded from local
variable of phyetat0 to dummy argument. phyetat0 no longer closes
"startphy.nc".

Following the same decentralizing objective, the ncid of "restart.nc"
is upgraded from local variable of dynredem0 to module variable of
dynredem0_m. "restart.nc" is not closed at the end of dynredem0 nor
opened at the beginning of dynredem1.

In procedure etat0, instead of creating many vectors of size klon
which will be filled with zeroes, just create one array null_array.

In procedure phytrac, instead of writing trs(: 1) to a text file,
write it to "restartphy.nc" (following LMDZ). This is better because
now trs(: 1) is next to its coordinates. We can write to
"restartphy.nc" from phytrac directly, and not add trs(: 1) to the
long list of variables in physiq, thanks to the decentralizing of
"restartphy.nc".

In procedure phyetat0, we no longer write to standard output the
minimum and maximum values of read arrays. It is ok to check input and
abort on invalid values but just printing statistics on input seems too
much useless computation and out of place clutter.

1 guez 15 module phyredem_m
2 guez 3
3 guez 15 IMPLICIT NONE
4 guez 3
5 guez 15 contains
6 guez 3
7 guez 157 SUBROUTINE phyredem(pctsrf, tsol, tsoil, tslab, seaice, qsurf, qsol, snow, &
8     albedo, evap, rain_fall, snow_fall, solsw, sollw, fder, radsol, frugs, &
9     agesno, zmea, zstd, zsig, zgam, zthe, zpic, zval, t_ancien, q_ancien, &
10     rnebcon, ratqs, clwcon, run_off_lic_0, sig1, w01)
11 guez 3
12 guez 138 ! From phylmd/phyredem.F, version 1.3, 2005/05/25 13:10:09
13 guez 72 ! Author: Z. X. Li (LMD/CNRS)
14 guez 73 ! Date: 1993/08/18
15 guez 12
16 guez 138 ! Objet : \'ecriture de l'\'etat de d\'emarrage ou red\'emarrage
17     ! pour la physique
18    
19 guez 72 USE dimphy, ONLY: klev, klon, zmasq
20     USE indicesol, ONLY: is_lic, is_oce, is_sic, is_ter, nbsrf
21 guez 157 USE netcdf95, ONLY: nf95_inq_varid, nf95_put_var, nf95_close
22     use phyredem0_m, only: ncid_restartphy
23 guez 12
24 guez 138 REAL, INTENT(IN):: pctsrf(:, :) ! (klon, nbsrf)
25 guez 99 REAL, INTENT(IN):: tsol(:, :) ! (klon, nbsrf)
26     REAL, INTENT(IN):: tsoil(:, :, :) ! (klon, nsoilmx, nbsrf)
27     REAL, INTENT(IN):: tslab(:), seaice(:) ! (klon) slab ocean
28     REAL, INTENT(IN):: qsurf(:, :) ! (klon, nbsrf)
29 guez 101
30 guez 99 REAL, intent(in):: qsol(:) ! (klon)
31 guez 101 ! column-density of water in soil, in kg m-2
32    
33 guez 99 REAL, INTENT(IN):: snow(klon, nbsrf)
34     REAL, INTENT(IN):: albedo(klon, nbsrf)
35     REAL, INTENT(IN):: evap(klon, nbsrf)
36 guez 62 REAL, INTENT(IN):: rain_fall(klon)
37 guez 99 REAL, INTENT(IN):: snow_fall(klon)
38     REAL, INTENT(IN):: solsw(klon)
39 guez 72 REAL, INTENT(IN):: sollw(klon)
40 guez 99 REAL, INTENT(IN):: fder(klon)
41     REAL, INTENT(IN):: radsol(klon)
42     REAL, INTENT(IN):: frugs(klon, nbsrf)
43     REAL, INTENT(IN):: agesno(klon, nbsrf)
44 guez 78 REAL, INTENT(IN):: zmea(klon)
45 guez 15 REAL, intent(in):: zstd(klon)
46     REAL, intent(in):: zsig(klon)
47 guez 99 REAL, intent(in):: zgam(klon)
48     REAL, intent(in):: zthe(klon)
49     REAL, intent(in):: zpic(klon)
50     REAL, intent(in):: zval(klon)
51     REAL, intent(in):: t_ancien(klon, klev), q_ancien(klon, klev)
52     REAL, intent(in):: rnebcon(klon, klev), ratqs(klon, klev)
53     REAL, intent(in):: clwcon(klon, klev)
54     REAL, intent(in):: run_off_lic_0(klon)
55 guez 72 real, intent(in):: sig1(klon, klev) ! section adiabatic updraft
56 guez 12
57 guez 72 real, intent(in):: w01(klon, klev)
58     ! vertical velocity within adiabatic updraft
59 guez 12
60 guez 72 ! Local:
61 guez 157 integer varid
62 guez 12
63 guez 15 !------------------------------------------------------------
64 guez 12
65 guez 15 PRINT *, 'Call sequence information: phyredem'
66 guez 12
67 guez 157 call nf95_inq_varid(ncid_restartphy, "masque", varid)
68     call nf95_put_var(ncid_restartphy, varid, zmasq)
69 guez 12
70 guez 157 call nf95_inq_varid(ncid_restartphy, "FTER", varid)
71     call nf95_put_var(ncid_restartphy, varid, pctsrf(:, is_ter))
72 guez 12
73 guez 157 call nf95_inq_varid(ncid_restartphy, "FLIC", varid)
74     call nf95_put_var(ncid_restartphy, varid, pctsrf(:, is_lic))
75 guez 12
76 guez 157 call nf95_inq_varid(ncid_restartphy, "FOCE", varid)
77     call nf95_put_var(ncid_restartphy, varid, pctsrf(:, is_oce))
78 guez 12
79 guez 157 call nf95_inq_varid(ncid_restartphy, "FSIC", varid)
80     call nf95_put_var(ncid_restartphy, varid, pctsrf(:, is_sic))
81 guez 12
82 guez 157 call nf95_inq_varid(ncid_restartphy, "TS", varid)
83     call nf95_put_var(ncid_restartphy, varid, tsol)
84 guez 12
85 guez 157 call nf95_inq_varid(ncid_restartphy, "Tsoil", varid)
86     call nf95_put_var(ncid_restartphy, varid, tsoil)
87 guez 12
88 guez 157 call nf95_inq_varid(ncid_restartphy, "TSLAB", varid)
89     call nf95_put_var(ncid_restartphy, varid, tslab)
90 guez 12
91 guez 157 call nf95_inq_varid(ncid_restartphy, "SEAICE", varid)
92     call nf95_put_var(ncid_restartphy, varid, seaice)
93 guez 12
94 guez 157 call nf95_inq_varid(ncid_restartphy, "QS", varid)
95     call nf95_put_var(ncid_restartphy, varid, qsurf)
96 guez 140
97 guez 157 call nf95_inq_varid(ncid_restartphy, "QSOL", varid)
98     call nf95_put_var(ncid_restartphy, varid, qsol)
99 guez 140
100 guez 157 call nf95_inq_varid(ncid_restartphy, "ALBE", varid)
101     call nf95_put_var(ncid_restartphy, varid, albedo)
102 guez 12
103 guez 157 call nf95_inq_varid(ncid_restartphy, "EVAP", varid)
104     call nf95_put_var(ncid_restartphy, varid, evap)
105 guez 12
106 guez 157 call nf95_inq_varid(ncid_restartphy, "SNOW", varid)
107     call nf95_put_var(ncid_restartphy, varid, snow)
108 guez 12
109 guez 157 call nf95_inq_varid(ncid_restartphy, "RADS", varid)
110     call nf95_put_var(ncid_restartphy, varid, radsol)
111 guez 12
112 guez 157 call nf95_inq_varid(ncid_restartphy, "solsw", varid)
113     call nf95_put_var(ncid_restartphy, varid, solsw)
114 guez 12
115 guez 157 call nf95_inq_varid(ncid_restartphy, "sollw", varid)
116     call nf95_put_var(ncid_restartphy, varid, sollw)
117 guez 12
118 guez 157 call nf95_inq_varid(ncid_restartphy, "fder", varid)
119     call nf95_put_var(ncid_restartphy, varid, fder)
120 guez 12
121 guez 157 call nf95_inq_varid(ncid_restartphy, "rain_f", varid)
122     call nf95_put_var(ncid_restartphy, varid, rain_fall)
123 guez 12
124 guez 157 call nf95_inq_varid(ncid_restartphy, "snow_f", varid)
125     call nf95_put_var(ncid_restartphy, varid, snow_fall)
126 guez 12
127 guez 157 call nf95_inq_varid(ncid_restartphy, "RUG", varid)
128     call nf95_put_var(ncid_restartphy, varid, frugs)
129 guez 12
130 guez 157 call nf95_inq_varid(ncid_restartphy, "AGESNO", varid)
131     call nf95_put_var(ncid_restartphy, varid, agesno)
132 guez 12
133 guez 157 call nf95_inq_varid(ncid_restartphy, "ZMEA", varid)
134     call nf95_put_var(ncid_restartphy, varid, zmea)
135 guez 12
136 guez 157 call nf95_inq_varid(ncid_restartphy, "ZSTD", varid)
137     call nf95_put_var(ncid_restartphy, varid, zstd)
138 guez 12
139 guez 157 call nf95_inq_varid(ncid_restartphy, "ZSIG", varid)
140     call nf95_put_var(ncid_restartphy, varid, zsig)
141 guez 12
142 guez 157 call nf95_inq_varid(ncid_restartphy, "ZGAM", varid)
143     call nf95_put_var(ncid_restartphy, varid, zgam)
144 guez 12
145 guez 157 call nf95_inq_varid(ncid_restartphy, "ZTHE", varid)
146     call nf95_put_var(ncid_restartphy, varid, zthe)
147 guez 12
148 guez 157 call nf95_inq_varid(ncid_restartphy, "ZPIC", varid)
149     call nf95_put_var(ncid_restartphy, varid, zpic)
150 guez 12
151 guez 157 call nf95_inq_varid(ncid_restartphy, "ZVAL", varid)
152     call nf95_put_var(ncid_restartphy, varid, zval)
153 guez 12
154 guez 157 call nf95_inq_varid(ncid_restartphy, "TANCIEN", varid)
155     call nf95_put_var(ncid_restartphy, varid, t_ancien)
156 guez 12
157 guez 157 call nf95_inq_varid(ncid_restartphy, "QANCIEN", varid)
158     call nf95_put_var(ncid_restartphy, varid, q_ancien)
159 guez 15
160 guez 157 call nf95_inq_varid(ncid_restartphy, "RUGMER", varid)
161     call nf95_put_var(ncid_restartphy, varid, frugs(:, is_oce))
162 guez 15
163 guez 157 call nf95_inq_varid(ncid_restartphy, "CLWCON", varid)
164     call nf95_put_var(ncid_restartphy, varid, clwcon(:, 1))
165 guez 15
166 guez 157 call nf95_inq_varid(ncid_restartphy, "RNEBCON", varid)
167     call nf95_put_var(ncid_restartphy, varid, rnebcon(:, 1))
168 guez 15
169 guez 157 call nf95_inq_varid(ncid_restartphy, "RATQS", varid)
170     call nf95_put_var(ncid_restartphy, varid, ratqs(:, 1))
171 guez 72
172 guez 157 call nf95_inq_varid(ncid_restartphy, "RUNOFFLIC0", varid)
173     call nf95_put_var(ncid_restartphy, varid, run_off_lic_0)
174 guez 72
175 guez 157 call nf95_inq_varid(ncid_restartphy, "sig1", varid)
176     call nf95_put_var(ncid_restartphy, varid, sig1)
177 guez 72
178 guez 157 call nf95_inq_varid(ncid_restartphy, "w01", varid)
179     call nf95_put_var(ncid_restartphy, varid, w01)
180    
181     call nf95_close(ncid_restartphy)
182    
183 guez 15 END SUBROUTINE phyredem
184    
185     end module phyredem_m

  ViewVC Help
Powered by ViewVC 1.1.21