source: trunk/LMDZ.TITAN/libf/phytitan/phyetat0.F90 @ 1525

Last change on this file since 1525 was 1525, checked in by emillour, 9 years ago

All GCMs:
More on enforcing dynamics/physics separation: get rid of references to "control_mod" from physics packages.
EM

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