/[lmdze]/trunk/Sources/phylmd/phyredem0.f
ViewVC logotype

Contents of /trunk/Sources/phylmd/phyredem0.f

Parent Directory Parent Directory | Revision Log Revision Log


Revision 157 - (show annotations)
Mon Jul 20 16:01:49 2015 UTC (8 years, 10 months ago) by guez
File size: 7775 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 module phyredem0_m
2
3 IMPLICIT NONE
4
5 INTEGER ncid_restartphy
6
7 contains
8
9 SUBROUTINE phyredem0(lmt_pas)
10
11 ! From phylmd/phyredem.F, version 1.3, 2005/05/25 13:10:09
12 ! Author: Z. X. Li (LMD/CNRS)
13 ! Date: 1993/08/18
14
15 ! Objet : \'ecriture de l'\'etat de d\'emarrage ou red\'emarrage
16 ! pour la physique
17
18 use conf_gcm_m, only: nday
19 USE dimphy, ONLY: klev, klon
20 USE dimsoil, ONLY: nsoilmx
21 USE indicesol, ONLY: nbsrf
22 USE netcdf, ONLY: nf90_clobber, nf90_global, nf90_float
23 USE netcdf95, ONLY: nf95_create, nf95_put_att, nf95_def_dim, &
24 nf95_def_var, nf95_enddef, nf95_put_var
25 use phyetat0_m, only: rlat, rlon
26 USE temps, ONLY: itau_phy
27
28 INTEGER, intent(in):: lmt_pas ! number of time steps of "physics" per day
29
30 ! Local:
31
32 INTEGER idim2, idim3, dimid_nbsrf, dimid_nsoilmx
33 integer varid, varid_rlon, varid_rlat
34
35 !------------------------------------------------------------
36
37 PRINT *, 'Call sequence information: phyredem0'
38 CALL nf95_create("restartphy.nc", nf90_clobber, ncid_restartphy)
39
40 call nf95_put_att(ncid_restartphy, nf90_global, 'title', &
41 'start file for the physics code')
42 call nf95_put_att(ncid_restartphy, nf90_global, "itau_phy", &
43 itau_phy + nday * lmt_pas)
44
45 call nf95_def_dim(ncid_restartphy, 'points_physiques', klon, idim2)
46 call nf95_def_dim(ncid_restartphy, 'klev', klev, idim3)
47 call nf95_def_dim(ncid_restartphy, 'nbsrf', nbsrf, dimid_nbsrf)
48 call nf95_def_dim(ncid_restartphy, 'nsoilmx', nsoilmx, dimid_nsoilmx)
49
50 call nf95_def_var(ncid_restartphy, 'longitude', nf90_float, idim2, &
51 varid_rlon)
52 call nf95_def_var(ncid_restartphy, 'latitude', nf90_float, idim2, &
53 varid_rlat)
54
55 call nf95_def_var(ncid_restartphy, 'masque', nf90_float, idim2, varid)
56 call nf95_put_att(ncid_restartphy, varid, 'title', 'masque terre mer')
57
58 ! Fractions de chaque sous-surface
59
60 call nf95_def_var(ncid_restartphy, 'FTER', nf90_float, idim2, varid)
61 call nf95_put_att(ncid_restartphy, varid, 'title', 'fraction de continent')
62
63 call nf95_def_var(ncid_restartphy, 'FLIC', nf90_float, idim2, varid)
64 call nf95_put_att(ncid_restartphy, varid, 'title', &
65 'fraction glace de terre')
66
67 call nf95_def_var(ncid_restartphy, 'FOCE', nf90_float, idim2, varid)
68 call nf95_put_att(ncid_restartphy, varid, 'title', 'fraction ocean')
69
70 call nf95_def_var(ncid_restartphy, 'FSIC', nf90_float, idim2, varid)
71 call nf95_put_att(ncid_restartphy, varid, 'title', 'fraction glace mer')
72
73 call nf95_def_var(ncid_restartphy, 'TS', nf90_float, &
74 (/idim2, dimid_nbsrf/), varid)
75 call nf95_put_att(ncid_restartphy, varid, 'title', 'surface temperature')
76
77 call nf95_def_var(ncid_restartphy, 'Tsoil', nf90_float, &
78 (/idim2, dimid_nsoilmx, dimid_nbsrf/), varid)
79 call nf95_put_att(ncid_restartphy, varid, 'title', 'soil temperature')
80
81 call nf95_def_var(ncid_restartphy, 'TSLAB', nf90_float, idim2, varid)
82 call nf95_put_att(ncid_restartphy, varid, 'title', &
83 'Ecart de la SST (pour slab-ocean)')
84
85 call nf95_def_var(ncid_restartphy, 'SEAICE', nf90_float, idim2, varid)
86 call nf95_put_att(ncid_restartphy, varid, 'title', &
87 'Glace de mer kg/m2 (pour slab-ocean)')
88
89 call nf95_def_var(ncid_restartphy, 'QS', nf90_float, &
90 (/idim2, dimid_nbsrf/), varid)
91 call nf95_put_att(ncid_restartphy, varid, 'title', 'Humidite de surface')
92
93 call nf95_def_var(ncid_restartphy, 'QSOL', nf90_float, idim2, varid)
94 call nf95_put_att(ncid_restartphy, varid, 'title', 'Eau dans le sol (mm)')
95
96 call nf95_def_var(ncid_restartphy, 'ALBE', nf90_float, &
97 (/idim2, dimid_nbsrf/), varid)
98 call nf95_put_att(ncid_restartphy, varid, 'title', 'albedo de surface')
99
100 call nf95_def_var(ncid_restartphy, 'EVAP', nf90_float, &
101 (/idim2, dimid_nbsrf/), varid)
102 call nf95_put_att(ncid_restartphy, varid, 'title', 'Evaporation de surface')
103
104 call nf95_def_var(ncid_restartphy, 'SNOW', nf90_float, &
105 (/idim2, dimid_nbsrf/), varid)
106 call nf95_put_att(ncid_restartphy, varid, 'title', 'Neige de surface')
107
108 call nf95_def_var(ncid_restartphy, 'RADS', nf90_float, idim2, varid)
109 call nf95_put_att(ncid_restartphy, varid, 'title', &
110 'Rayonnement net a la surface')
111
112 call nf95_def_var(ncid_restartphy, 'solsw', nf90_float, idim2, varid)
113 call nf95_put_att(ncid_restartphy, varid, 'title', &
114 'Rayonnement solaire a la surface')
115
116 call nf95_def_var(ncid_restartphy, 'sollw', nf90_float, idim2, varid)
117 call nf95_put_att(ncid_restartphy, varid, 'title', &
118 'Rayonnement IF a la surface')
119
120 call nf95_def_var(ncid_restartphy, 'fder', nf90_float, idim2, varid)
121 call nf95_put_att(ncid_restartphy, varid, 'title', 'Derive de flux')
122
123 call nf95_def_var(ncid_restartphy, 'rain_f', nf90_float, idim2, varid)
124 call nf95_put_att(ncid_restartphy, varid, 'title', 'precipitation liquide')
125
126 call nf95_def_var(ncid_restartphy, 'snow_f', nf90_float, idim2, varid)
127 call nf95_put_att(ncid_restartphy, varid, 'title', 'precipitation solide')
128
129 call nf95_def_var(ncid_restartphy, 'RUG', nf90_float, &
130 (/idim2, dimid_nbsrf/), varid)
131 call nf95_put_att(ncid_restartphy, varid, 'title', 'rugosite de surface')
132
133 call nf95_def_var(ncid_restartphy, 'AGESNO', nf90_float, &
134 (/idim2, dimid_nbsrf/), varid)
135 call nf95_put_att(ncid_restartphy, varid, 'title', &
136 'Age de la neige surface')
137
138 call nf95_def_var(ncid_restartphy, 'ZMEA', nf90_float, idim2, varid)
139 call nf95_def_var(ncid_restartphy, 'ZSTD', nf90_float, idim2, varid)
140 call nf95_def_var(ncid_restartphy, 'ZSIG', nf90_float, idim2, varid)
141 call nf95_def_var(ncid_restartphy, 'ZGAM', nf90_float, idim2, varid)
142 call nf95_def_var(ncid_restartphy, 'ZTHE', nf90_float, idim2, varid)
143 call nf95_def_var(ncid_restartphy, 'ZPIC', nf90_float, idim2, varid)
144 call nf95_def_var(ncid_restartphy, 'ZVAL', nf90_float, idim2, varid)
145 call nf95_def_var(ncid_restartphy, 'TANCIEN', nf90_float, &
146 (/idim2, idim3/), varid)
147 call nf95_def_var(ncid_restartphy, 'QANCIEN', nf90_float, &
148 (/idim2, idim3/), varid)
149
150 call nf95_def_var(ncid_restartphy, 'RUGMER', nf90_float, idim2, varid)
151 call nf95_put_att(ncid_restartphy, varid, 'title', &
152 'Longueur de rugosite sur mer')
153
154 call nf95_def_var(ncid_restartphy, 'CLWCON', nf90_float, idim2, varid)
155 call nf95_put_att(ncid_restartphy, varid, 'title', 'Eau liquide convective')
156
157 call nf95_def_var(ncid_restartphy, 'RNEBCON', nf90_float, idim2, varid)
158 call nf95_put_att(ncid_restartphy, varid, 'title', 'Nebulosite convective')
159
160 call nf95_def_var(ncid_restartphy, 'RATQS', nf90_float, idim2, varid)
161 call nf95_put_att(ncid_restartphy, varid, 'title', 'Ratqs')
162
163 call nf95_def_var(ncid_restartphy, 'RUNOFFLIC0', nf90_float, idim2, varid)
164 call nf95_put_att(ncid_restartphy, varid, 'title', 'Runofflic0')
165
166 call nf95_def_var(ncid_restartphy, 'sig1', nf90_float, (/idim2, idim3/), &
167 varid)
168 call nf95_put_att(ncid_restartphy, varid, 'long_name', &
169 'section adiabatic updraft')
170
171 call nf95_def_var(ncid_restartphy, 'w01', nf90_float, (/idim2, idim3/), &
172 varid)
173 call nf95_put_att(ncid_restartphy, varid, 'long_name', &
174 'vertical velocity within adiabatic updraft')
175
176 call nf95_def_var(ncid_restartphy, 'trs', nf90_float, idim2, varid)
177 call nf95_put_att(ncid_restartphy, varid, 'long_name', &
178 'radon concentation in soil')
179
180 call nf95_enddef(ncid_restartphy)
181
182 call nf95_put_var(ncid_restartphy, varid_rlon, rlon)
183 call nf95_put_var(ncid_restartphy, varid_rlat, rlat)
184
185 END SUBROUTINE phyredem0
186
187 end module phyredem0_m

  ViewVC Help
Powered by ViewVC 1.1.21