source: trunk/LMDZ.VENUS/libf/phyvenus/phyetat0.F90 @ 1521

Last change on this file since 1521 was 1443, checked in by emillour, 10 years ago

Titan and Venus GCMs:
Follow-up to the changes in dynamics/physics interface: ener.h, logic.h, serre.h and temps.h are now modules.
EM

File size: 9.0 KB
Line 
1!
2! $Id $
3!
4subroutine phyetat0(fichnom)
5! Load initial state for the physics
6! and do some resulting initializations
7
8      USE dimphy
9      USE mod_grid_phy_lmdz
10      USE mod_phys_lmdz_para
11      USE iophy
12      USE phys_state_var_mod
13      USE iostart
14      USE infotrac
15      USE comgeomphy,  only: rlatd,rlond
16      USE control_mod, only: raz_date
17      USE temps_mod, only: itau_phy
18
19implicit none
20!======================================================================
21! Auteur(s) Z.X. Li (LMD/CNRS) date: 19930818
22! Objet: Lecture de l'etat initial pour la physique
23!======================================================================
24#include "dimensions.h"
25#include "netcdf.inc"
26#include "dimsoil.h"
27#include "clesphys.h"
28#include "tabcontrol.h"
29!======================================================================
30
31character(len=*),intent(in) :: fichnom ! input file name
32REAL    :: xmin, xmax
33LOGICAL :: found
34REAL    :: tab_cntrl(length)
35integer :: i,isoil
36CHARACTER(len=2) :: str2
37
38! les variables globales lues dans le fichier restart
39
40! open physics initial state file:
41call open_startphy(fichnom)
42
43!
44! Lecture des parametres de controle:
45!
46      CALL get_var("controle",tab_cntrl,found)
47      IF (.not.found) THEN
48         PRINT*, 'phyetat0: Le champ <controle> est absent'
49         CALL abort
50      ENDIF
51       
52      DO i = 1, length
53           tabcntr0( i ) = tab_cntrl( i )
54      ENDDO
55
56
57      dtime        = tab_cntrl(1)
58      radpas       = tab_cntrl(2)
59
60      itau_phy = tab_cntrl(15)
61
62! Attention si raz_date est active :
63! il faut remettre a zero itau_phy apres phyetat0 !
64      IF (raz_date.eq.1) THEN
65        itau_phy=0
66      ENDIF
67
68! read latitudes
69call get_field("latitude",rlatd,found)
70      IF (.not.found) THEN
71         PRINT*, 'phyetat0: Le champ <latitude> est absent'
72         CALL abort
73      ENDIF
74
75! read longitudes
76call get_field("longitude",rlond,found)
77      IF (.not.found) THEN
78         PRINT*, 'phyetat0: Le champ <longitude> est absent'
79         CALL abort
80      ENDIF
81
82! read in other variables here ...
83
84! Lecture des temperatures du sol:
85
86       CALL get_field("TS",ftsol(:),found)
87      IF (.not.found) THEN
88         PRINT*, 'phyetat0: Le champ <TS> est absent'
89         PRINT*, "phyetat0: Lecture echouee pour <TS>"
90         CALL abort
91      ELSE
92         PRINT*, 'phyetat0: Le champ <TS> est present'
93         xmin = 1.0E+20
94         xmax = -1.0E+20
95         DO i = 1, klon
96            xmin = MIN(ftsol(i),xmin)
97            xmax = MAX(ftsol(i),xmax)
98         ENDDO
99         PRINT*,'Temperature du sol <TS>', xmin, xmax
100      ENDIF
101
102
103! Lecture des temperatures du sol profond:
104
105      DO isoil=1, nsoilmx
106      IF (isoil.GT.99) THEN
107         PRINT*, "Trop de couches"
108         CALL abort
109      ENDIF
110      WRITE(str2,'(i2.2)') isoil
111      CALL get_field('Tsoil'//str2,ftsoil(:,isoil),found)
112      IF (.not.found) THEN
113         PRINT*, "phyetat0: Le champ <Tsoil"//str2//"> est absent"
114         PRINT*, "          Il prend donc la valeur de surface"
115         DO i=1, klon
116             ftsoil(i,isoil)=ftsol(i)
117         ENDDO
118      ENDIF
119      ENDDO
120
121! Lecture de albedo au sol:
122
123      CALL get_field("ALBE", falbe,found)
124      IF (.not.found) THEN
125         PRINT*, 'phyetat0: Le champ <ALBE> est absent'
126         PRINT*, "phyetat0: Lecture echouee pour <ALBE>"
127         CALL abort
128      ELSE
129         xmin = 1.0E+20
130         xmax = -1.0E+20
131         DO i = 1, klon
132            xmin = MIN(falbe(i),xmin)
133            xmax = MAX(falbe(i),xmax)
134         ENDDO
135         PRINT*,'Albedo du sol <ALBE>', xmin, xmax
136      ENDIF
137
138! Lecture rayonnement solaire au sol:
139
140      CALL get_field("solsw",solsw,found)
141      IF (.not.found) THEN
142         PRINT*, 'phyetat0: Le champ <solsw> est absent'
143         PRINT*, 'mis a zero'
144         solsw = 0.
145      ENDIF
146      xmin = 1.0E+20
147      xmax = -1.0E+20
148      DO i = 1, klon
149         xmin = MIN(solsw(i),xmin)
150         xmax = MAX(solsw(i),xmax)
151      ENDDO
152      PRINT*,'Rayonnement solaire au sol solsw:', xmin, xmax
153
154! Lecture rayonnement IR au sol:
155
156      CALL get_field("sollw",sollw,found)
157      IF (.not.found) THEN
158         PRINT*, 'phyetat0: Le champ <sollw> est absent'
159         PRINT*, 'mis a zero'
160         sollw = 0.
161      ENDIF
162      xmin = 1.0E+20
163      xmax = -1.0E+20
164      DO i = 1, klon
165         xmin = MIN(sollw(i),xmin)
166         xmax = MAX(sollw(i),xmax)
167      ENDDO
168      PRINT*,'Rayonnement IR au sol sollw:', xmin, xmax
169
170! Lecture derive des flux:
171
172      CALL get_field("fder",fder,found)
173      IF (.not.found) THEN
174         PRINT*, 'phyetat0: Le champ <fder> est absent'
175         PRINT*, 'mis a zero'
176         fder = 0.
177      ENDIF
178      xmin = 1.0E+20
179      xmax = -1.0E+20
180      DO i = 1, klon
181         xmin = MIN(fder(i),xmin)
182         xmax = MAX(fder(i),xmax)
183      ENDDO
184      PRINT*,'Derive des flux fder:', xmin, xmax
185
186! Lecture derive flux IR:
187
188      CALL get_field("dlw",dlw,found)
189      IF (.not.found) THEN
190         PRINT*, 'phyetat0: Le champ <dlw> est absent'
191         PRINT*, 'mis a zero'
192         dlw = 0.
193      ENDIF
194      xmin = 1.0E+20
195      xmax = -1.0E+20
196      DO i = 1, klon
197         xmin = MIN(dlw(i),xmin)
198         xmax = MAX(dlw(i),xmax)
199      ENDDO
200      PRINT*,'Derive flux IR dlw:', xmin, xmax
201
202! Lecture rayonnement IR vers le bas au sol:
203
204      CALL get_field("sollwdown",sollwdown,found)
205      IF (.not.found) THEN
206         PRINT*, 'phyetat0: Le champ <sollwdown> est absent'
207         PRINT*, 'mis a zero'
208         sollwdown = 0.
209      ENDIF
210      xmin = 1.0E+20
211      xmax = -1.0E+20
212      DO i = 1, klon
213         xmin = MIN(sollwdown(i),xmin)
214         xmax = MAX(sollwdown(i),xmax)
215      ENDDO
216      PRINT*,'Flux IR vers le bas au sol sollwdown:', xmin, xmax
217
218! Lecture du rayonnement net au sol:
219
220      CALL get_field("RADS",radsol,found)
221      IF (.not.found) THEN
222         PRINT*, 'phyetat0: Le champ <RADS> est absent'
223         CALL abort
224      ENDIF
225      xmin = 1.0E+20
226      xmax = -1.0E+20
227      DO i = 1, klon
228         xmin = MIN(radsol(i),xmin)
229         xmax = MAX(radsol(i),xmax)
230      ENDDO
231      PRINT*,'Rayonnement net au sol radsol:', xmin, xmax
232
233! Lecture de l'orographie sous-maille:
234
235      CALL get_field("ZMEA",zmea,found)
236      IF (.not.found) THEN
237         PRINT*, 'phyetat0: Le champ <ZMEA> est absent'
238         PRINT*, 'mis a zero'
239         zmea=0.
240      ENDIF
241      xmin = 1.0E+20
242      xmax = -1.0E+20
243      DO i = 1, klon
244         xmin = MIN(zmea(i),xmin)
245         xmax = MAX(zmea(i),xmax)
246      ENDDO
247      PRINT*,'OROGRAPHIE SOUS-MAILLE zmea:', xmin, xmax
248
249      CALL get_field("ZSTD",zstd,found)
250      IF (.not.found) THEN
251         PRINT*, 'phyetat0: Le champ <ZSTD> est absent'
252         PRINT*, 'mis a zero'
253         zstd=0.
254      ENDIF
255      xmin = 1.0E+20
256      xmax = -1.0E+20
257      DO i = 1, klon
258         xmin = MIN(zstd(i),xmin)
259         xmax = MAX(zstd(i),xmax)
260      ENDDO
261      PRINT*,'OROGRAPHIE SOUS-MAILLE zstd:', xmin, xmax
262
263      CALL get_field("ZSIG",zsig,found)
264      IF (.not.found) THEN
265         PRINT*, 'phyetat0: Le champ <ZSIG> est absent'
266         PRINT*, 'mis a zero'
267         zsig=0.
268      ENDIF
269      xmin = 1.0E+20
270      xmax = -1.0E+20
271      DO i = 1, klon
272         xmin = MIN(zsig(i),xmin)
273         xmax = MAX(zsig(i),xmax)
274      ENDDO
275      PRINT*,'OROGRAPHIE SOUS-MAILLE zsig:', xmin, xmax
276
277      CALL get_field("ZGAM",zgam,found)
278      IF (.not.found) THEN
279         PRINT*, 'phyetat0: Le champ <ZGAM> est absent'
280         PRINT*, 'mis a zero'
281         zgam=0.
282      ENDIF
283      xmin = 1.0E+20
284      xmax = -1.0E+20
285      DO i = 1, klon
286         xmin = MIN(zgam(i),xmin)
287         xmax = MAX(zgam(i),xmax)
288      ENDDO
289      PRINT*,'OROGRAPHIE SOUS-MAILLE zgam:', xmin, xmax
290
291      CALL get_field("ZTHE",zthe,found)
292      IF (.not.found) THEN
293         PRINT*, 'phyetat0: Le champ <ZTHE> est absent'
294         PRINT*, 'mis a zero'
295         zthe=0.
296      ENDIF
297      xmin = 1.0E+20
298      xmax = -1.0E+20
299      DO i = 1, klon
300         xmin = MIN(zthe(i),xmin)
301         xmax = MAX(zthe(i),xmax)
302      ENDDO
303      PRINT*,'OROGRAPHIE SOUS-MAILLE zthe:', xmin, xmax
304
305      CALL get_field("ZPIC",zpic,found)
306      IF (.not.found) THEN
307         PRINT*, 'phyetat0: Le champ <ZPIC> est absent'
308         PRINT*, 'mis a zero'
309         zpic=0.
310      ENDIF
311      xmin = 1.0E+20
312      xmax = -1.0E+20
313      DO i = 1, klon
314         xmin = MIN(zpic(i),xmin)
315         xmax = MAX(zpic(i),xmax)
316      ENDDO
317      PRINT*,'OROGRAPHIE SOUS-MAILLE zpic:', xmin, xmax
318
319      CALL get_field("ZVAL",zval,found)
320      IF (.not.found) THEN
321         PRINT*, 'phyetat0: Le champ <ZVAL> est absent'
322         PRINT*, 'mis a zero'
323         zval=0.
324      ENDIF
325      xmin = 1.0E+20
326      xmax = -1.0E+20
327      DO i = 1, klon
328         xmin = MIN(zval(i),xmin)
329         xmax = MAX(zval(i),xmax)
330      ENDDO
331      PRINT*,'OROGRAPHIE SOUS-MAILLE zval:', xmin, xmax
332
333! Lecture de TANCIEN:
334
335      ancien_ok = .TRUE.
336
337      CALL get_field("TANCIEN",t_ancien,found)
338      IF (.not.found) THEN
339         PRINT*, "phyetat0: Le champ <TANCIEN> est absent"
340         PRINT*, "Depart legerement fausse. Mais je continue"
341         ancien_ok = .FALSE.
342      ENDIF
343
344! close file
345call close_startphy
346
347! do some more initializations
348call init_iophy_new(rlatd,rlond)
349
350end subroutine phyetat0
Note: See TracBrowser for help on using the repository browser.