Branches/Assimilation/Implementation: diff_ORCHIDEE_OL_Assimil-ORCHIDEE_OL_1_9_5_2.diff

File diff_ORCHIDEE_OL_Assimil-ORCHIDEE_OL_1_9_5_2.diff, 39.7 KB (added by mmaipsl, 11 years ago)

Liste des différences entre le driver du TAG 1.9.5.2 et le driver pour l'assimilation

Line 
1diff -w --ignore-all-space --ignore-case --recursive --exclude='cvs_diff*' --exclude='*.flc' --exclude='*.bak' --exclude='*.svn*' --exclude='*.lst' --exclude='i.*.L' --exclude='*~' --exclude=Entries --exclude=Tag --exclude=CVS --exclude Makefile ORCHIDEE_OL/AA_make /login/PROG/IPSL/CODE/svn_orchidee_06/tags/ORCHIDEE_1_9_5_2/ORCHIDEE_OL/AA_make
22c2
3< #- $Id: AA_make,v 1.35 2010/10/11 13:22:42 ssipsl Exp $
4---
5> #- $Id: AA_make 92 2011-02-08 13:41:26Z martial.mancip $
610d9
7< CPPSMODS1 = $(MODS1:%.f90=$(CPPDIR)/%.f90)
817,20d15
9< tangeant: $(CPPDIR)/readdim2.f90 $(CPPDIR)/weather.f90
10<       $(M_K) all_libsCPP
11<       @echo CPP orchidee_ol is OK
12<
13127,150d121
14<
15< all_libsCPP:
16<       -cp -p ../IOIPSL/src/*.f90 ./TANGEANT/
17<       $(M_K) libparallelCPP
18<       $(M_K) libparametersCPP
19<       $(M_K) liborglobCPP
20<       $(M_K) libstomateCPP
21<       $(M_K) libsechibaCPP
22<
23< libparametersCPP:
24<       (cd ../ORCHIDEE/src_parameters; $(M_K) -f Makefile MakeCPP)
25<
26< libparallelCPP:
27<       (cd ../ORCHIDEE/src_parallel; $(M_K) -f Makefile MakeCPP)
28<
29< liborglobCPP:
30<       (cd ../ORCHIDEE/src_global; $(M_K) -f Makefile MakeCPP)
31<
32< libstomateCPP:
33<       (cd ../ORCHIDEE/src_stomate; $(M_K) -f Makefile MakeCPP)
34<
35< libsechibaCPP:
36<       (cd ../ORCHIDEE/src_sechiba; $(M_K) -f Makefile MakeCPP)
37<
38182,183d152
39< $(CPPDIR)/%.f90: %.f90
40<       $(P_C) $(P_O) -x assembler-with-cpp -DASSIMIL_DECL -DASSIMIL_MOD -DASSIMIL_ALLOC -DASSIMIL_SUB -DASSIMIL_INIT $*.f90 $(CPPDIR)/$*.f90
41diff -w --ignore-all-space --ignore-case --recursive --exclude='cvs_diff*' --exclude='*.flc' --exclude='*.bak' --exclude='*.svn*' --exclude='*.lst' --exclude='i.*.L' --exclude='*~' --exclude=Entries --exclude=Tag --exclude=CVS --exclude Makefile ORCHIDEE_OL/AA_make.ldef /login/PROG/IPSL/CODE/svn_orchidee_06/tags/ORCHIDEE_1_9_5_2/ORCHIDEE_OL/AA_make.ldef
422c2
43< #- $Id: AA_make.ldef,v 1.15 2008/06/30 10:48:17 ssipsl Exp $
44---
45> #- $Id: AA_make.ldef 18 2010-11-29 11:12:17Z mmaipsl $
4611d10
47< CPPDIR = TANGEANT
48Seulement dans /login/PROG/IPSL/CODE/svn_orchidee_06/tags/ORCHIDEE_1_9_5_2/ORCHIDEE_OL: bench_ORCHIDEE
49diff -w --ignore-all-space --ignore-case --recursive --exclude='cvs_diff*' --exclude='*.flc' --exclude='*.bak' --exclude='*.svn*' --exclude='*.lst' --exclude='i.*.L' --exclude='*~' --exclude=Entries --exclude=Tag --exclude=CVS --exclude Makefile ORCHIDEE_OL/dim2_driver.f90 /login/PROG/IPSL/CODE/svn_orchidee_06/tags/ORCHIDEE_1_9_5_2/ORCHIDEE_OL/dim2_driver.f90
502c2,5
51< !- $Header: /ipsl/forge/projets/orchidee/cvs/ORCHIDEE_OL/dim2_driver.f90,v 1.27 2010/12/21 14:28:42 ssipsl Exp $
52---
53> !< $HeadURL: svn://forge.ipsl.jussieu.fr/orchidee/tags/ORCHIDEE_1_9_5_2/ORCHIDEE_OL/dim2_driver.f90 $
54> !< $Date: 2011-07-29 16:40:51 +0200 (ven. 29 juil. 2011) $
55> !< $Author: martial.mancip $
56> !< $Revision: 353 $
57120a124
58>   CALL init_timer
59340c344
60<   itau_fin = tm-1
61---
62>   itau_fin = tm
63361c365
64<         itau_fin = itau_dep+tm-1
65---
66>         itau_fin = itau_dep+tm
67460c464
68<     itau_fin = itau_dep+tm-1
69---
70>     itau_fin = itau_dep+tm
71686,687c690
72<   IF (is_root_prc) &
73<        ALLOCATE(fluxsens_g(iim_g,jjm_g))
74---
75>   Flag=.FALSE.
76688a692
77>      ALLOCATE(fluxsens_g(iim_g,jjm_g))
78693c697,699
79<         fluxsens_g(:,:) = zero
80---
81>         Flag=.TRUE.
82>      ELSE
83>         Flag=.FALSE.
84694a701,702
85>   ELSE
86>      ALLOCATE(fluxsens_g(0,1))
87695a704,705
88>   CALL bcast(Flag)
89>   IF (.NOT. Flag) THEN
90697c707,709
91<   IF (is_root_prc) &
92---
93>   ELSE
94>      fluxsens(:,:) = zero
95>   ENDIF
96700,701d711
97<   IF (is_root_prc) &
98<        ALLOCATE(vevapp_g(iim_g,jjm_g))
99702a713
100>      ALLOCATE(vevapp_g(iim_g,jjm_g))
101707c718,720
102<         vevapp(:,:) = 0.
103---
104>         Flag=.TRUE.
105>      ELSE
106>         Flag=.FALSE.
107708a722,723
108>   ELSE
109>      ALLOCATE(vevapp_g(0,1))
110709a725,726
111>   CALL bcast(Flag)
112>   IF (.NOT. Flag) THEN
113711c728,730
114<   IF (is_root_prc) &
115---
116>   ELSE
117>      vevapp(:,:) = zero
118>   ENDIF
119714,715d732
120<   IF (is_root_prc) &
121<        ALLOCATE(old_zlev_g(iim_g,jjm_g))
122716a734
123>      ALLOCATE(old_zlev_g(iim_g,jjm_g))
124724a743,744
125>   ELSE
126>      ALLOCATE(old_zlev_g(0,1))
127725a746,747
128>   CALL bcast(Flag)
129>   IF ( .NOT. Flag ) THEN
130727c749,751
131<   IF (is_root_prc) &
132---
133>   ELSE
134>      old_zlev(:,:)=zlev_vec(:,:)
135>   ENDIF
136729,730d752
137<   CALL bcast(Flag)
138<   IF ( Flag ) old_zlev(:,:)=zlev_vec(:,:)
139732,733d753
140<   IF (is_root_prc) &
141<        ALLOCATE(old_qair_g(iim_g,jjm_g))
142734a755
143>      ALLOCATE(old_qair_g(iim_g,jjm_g))
144742a764,765
145>   ELSE
146>      ALLOCATE(old_qair_g(0,1))
147743a767,768
148>   CALL bcast(Flag)
149>   IF ( .NOT. Flag ) THEN
150745c770,772
151<   IF (is_root_prc) &
152---
153>   ELSE
154>      old_qair(:,:) = qair_obs(:,:)
155>   ENDIF
156747,748d773
157<   CALL bcast(Flag)
158<   IF (Flag) old_qair(:,:) = qair_obs(:,:)
159750,751d774
160<   IF (is_root_prc) &
161<        ALLOCATE(old_eair_g(iim_g,jjm_g))
162752a776
163>      ALLOCATE(old_eair_g(iim_g,jjm_g))
164760a785,786
165>   ELSE
166>      ALLOCATE(old_eair_g(0,1))
167762,764d787
168<   CALL scatter2D(old_eair_g,old_eair)
169<   IF (is_root_prc) &
170<        DEALLOCATE(old_eair_g)
171766c789,791
172<   IF (Flag) THEN
173---
174>   IF ( .NOT. Flag ) THEN
175>      CALL scatter2D(old_eair_g,old_eair)
176>   ELSE
177772a798
178>   DEALLOCATE(old_eair_g)
179777,778d802
180<   IF (is_root_prc) &
181<        ALLOCATE(for_rau_g(iim_g,jjm_g))
182779a804
183>      ALLOCATE(for_rau_g(iim_g,jjm_g))
184787a813,814
185>   ELSE
186>      ALLOCATE(for_rau_g(0,1))
187789,791d815
188<   CALL scatter2D(for_rau_g,for_rau)
189<   IF (is_root_prc) &
190<        DEALLOCATE(for_rau_g)
191793c817,819
192<   IF (Flag) THEN
193---
194>   IF ( .NOT. Flag ) THEN
195>      CALL scatter2D(for_rau_g,for_rau)
196>   ELSE
197799a826
198>   DEALLOCATE(for_rau_g)
199809,810d835
200<      IF (is_root_prc) &
201<           ALLOCATE(petAcoef_g(iim_g,jjm_g))
202811a837
203>         ALLOCATE(petAcoef_g(iim_g,jjm_g))
204819a846,847
205>      ELSE
206>         ALLOCATE(petAcoef_g(0,1))
207820a849,850
208>      CALL bcast(Flag)
209>      IF ( .NOT. Flag ) THEN
210822c852,854
211<      IF (is_root_prc) &
212---
213>      ELSE
214>         petAcoef(:,:) = zero
215>      ENDIF
216824,825d855
217<      CALL bcast(Flag)
218<      IF (Flag)  petAcoef(:,:) = zero
219827,828d856
220<      IF (is_root_prc) &
221<           ALLOCATE(petBcoef_g(iim_g,jjm_g))
222829a858
223>         ALLOCATE(petBcoef_g(iim_g,jjm_g))
224837a867,868
225>      ELSE
226>         ALLOCATE(petBcoef_g(0,1))
227838a870,871
228>      CALL bcast(Flag)
229>      IF ( .NOT. Flag ) THEN
230840c873,875
231<      IF (is_root_prc) &
232---
233>      ELSE
234>         petBcoef(:,:) = old_eair(:,:)
235>      ENDIF
236842,843d876
237<      CALL bcast(Flag)
238<      IF (Flag) petBcoef(:,:) = old_eair(:,:)
239845,846d877
240<      IF (is_root_prc) &
241<           ALLOCATE(peqAcoef_g(iim_g,jjm_g))
242847a879
243>         ALLOCATE(peqAcoef_g(iim_g,jjm_g))
244855a888,889
245>      ELSE
246>         ALLOCATE(peqAcoef_g(0,1))
247856a891,892
248>      CALL bcast(Flag)
249>      IF ( .NOT. Flag ) THEN
250858c894,896
251<      IF (is_root_prc) &
252---
253>      ELSE
254>         peqAcoef(:,:) = zero
255>      ENDIF
256860,861d897
257<      CALL bcast(Flag)
258<      IF (Flag) peqAcoef(:,:) = zero
259863,864d898
260<      IF (is_root_prc) &
261<           ALLOCATE(peqBcoef_g(iim_g,jjm_g))
262865a900
263>         ALLOCATE(peqBcoef_g(iim_g,jjm_g))
264873a909,910
265>      ELSE
266>         ALLOCATE(peqBcoef_g(0,1))
267874a912,913
268>      CALL bcast(Flag)
269>      IF ( .NOT. Flag ) THEN
270876c915,917
271<      IF (is_root_prc) &
272---
273>      ELSE
274>         peqBcoef(:,:) = old_qair(:,:)
275>      ENDIF
276878,879d918
277<      CALL bcast(Flag)
278<      IF (Flag) peqBcoef(:,:) = old_qair(:,:)
279951c990
280<          WRITE(numout,*) ">> Index of land points =",kindex
281---
282>          WRITE(numout,*) ">> Index of land points =",kindex(1:nbindex)
2831160c1199
284<            WRITE(numout,*) ">> Index of land points =",kindex
285---
286>            WRITE(numout,*) ">> Index of land points =",kindex(1:nbindex)
2871233c1272
288<         IF (is_root_prc) &
289---
290>         IF (is_root_prc) THEN
2911234a1274,1276
292>         ELSE
293>            ALLOCATE(albedo_g(0,1))
294>         ENDIF
2951246d1287
296<         CALL scatter2D(albedo_g,albedo_vis)
2971248c1289,1294
298<         IF (.NOT. Flag) albedo(:,:,1)=albedo_vis(:,:)
299---
300>         IF ( .NOT. Flag ) THEN
301>            CALL scatter2D(albedo_g,albedo_vis)
302>            albedo(:,:,1)=albedo_vis(:,:)
303>         ELSE
304>            albedo_vis(:,:)=albedo(:,:,1)
305>         ENDIF
3061260d1305
307<         CALL scatter2D(albedo_g,albedo_nir)
3081262c1307,1312
309<         IF (.NOT. Flag) albedo(:,:,2)=albedo_nir(:,:)
310---
311>         IF ( .NOT. Flag ) THEN
312>            CALL scatter2D(albedo_g,albedo_nir)
313>            albedo(:,:,2)=albedo_nir(:,:)
314>         ELSE
315>            albedo_nir(:,:)=albedo(:,:,2)
316>         ENDIF
3171264d1313
318<         IF (is_root_prc) &
3191268,1269d1316
320<         IF (is_root_prc) &
321<              ALLOCATE(z0_g(iim_g,jjm_g))
3221270a1318
323>            ALLOCATE(z0_g(iim_g,jjm_g))
3241278a1327,1328
325>         ELSE
326>            ALLOCATE(z0_g(0,1))
3271281,1282c1331,1332
328<         IF (.NOT. Flag) CALL scatter2D(z0_g,z0)
329<         IF (is_root_prc) &
330---
331>         IF (.NOT. Flag) &
332>              CALL scatter2D(z0_g,z0)
3331380c1430
334<          WRITE(numout,*) ">> Index of land points =",kindex
335---
336>          WRITE(numout,*) ">> Index of land points =",kindex(1:nbindex)
3371546c1596
338<   IF (is_root_prc) &
339---
340>   IF (is_root_prc) THEN
3411547a1598,1600
342>   ELSE
343>      ALLOCATE(fluxsens_g(0,1))
344>   ENDIF
3451550d1602
346<   IF (is_root_prc) &
3471554c1606
348<   IF (is_root_prc) &
349---
350>   IF (is_root_prc) THEN
3511555a1608,1610
352>   ELSE
353>      ALLOCATE(vevapp_g(0,1))
354>   ENDIF
3551558d1612
356<   IF (is_root_prc) &
3571562c1616
358<   IF (is_root_prc) &
359---
360>   IF (is_root_prc) THEN
3611563a1618,1620
362>   ELSE
363>      ALLOCATE(old_zlev_g(0,1))
364>   ENDIF
3651566d1622
366<   IF (is_root_prc) &
3671570c1626
368<   IF (is_root_prc) &
369---
370>   IF (is_root_prc) THEN
3711571a1628,1630
372>   ELSE
373>      ALLOCATE(old_qair_g(0,1))
374>   ENDIF
3751574d1632
376<   IF (is_root_prc) &
3771578c1636
378<   IF (is_root_prc) &
379---
380>   IF (is_root_prc) THEN
3811579a1638,1640
382>   ELSE
383>      ALLOCATE(old_eair_g(0,1))
384>   ENDIF
3851582d1642
386<   IF (is_root_prc) &
3871586c1646
388<   IF (is_root_prc) &
389---
390>   IF (is_root_prc) THEN
3911587a1648,1650
392>   ELSE
393>      ALLOCATE(for_rau_g(0,1))
394>   ENDIF
3951590d1652
396<   IF (is_root_prc) &
3971593c1655
398<   IF (is_root_prc) &
399---
400>   IF (is_root_prc) THEN
4011594a1657,1659
402>   ELSE
403>      ALLOCATE(albedo_g(0,1))
404>   ENDIF
4051604d1668
406<   IF (is_root_prc) &
4071607c1671
408<   IF (is_root_prc) &
409---
410>   IF (is_root_prc) THEN
4111608a1673,1675
412>   ELSE
413>      ALLOCATE(z0_g(0,1))
414>   ENDIF
4151612d1678
416<   IF (is_root_prc) &
4171617c1683
418<      IF (is_root_prc) &
419---
420>      IF (is_root_prc) THEN
4211618a1685,1687
422>      ELSE
423>         ALLOCATE(petAcoef_g(0,1))
424>      ENDIF
4251621d1689
426<      IF (is_root_prc) &
4271625c1693
428<      IF (is_root_prc) &
429---
430>      IF (is_root_prc) THEN
4311626a1695,1697
432>      ELSE
433>         ALLOCATE(petBcoef_g(0,1))
434>      ENDIF
4351629d1699
436<      IF (is_root_prc) &
4371633c1703
438<      IF (is_root_prc) &
439---
440>      IF (is_root_prc) THEN
4411634a1705,1707
442>      ELSE
443>         ALLOCATE(peqAcoef_g(0,1))
444>      ENDIF
4451637d1709
446<      IF (is_root_prc) &
4471641c1713
448<      IF (is_root_prc) &
449---
450>      IF (is_root_prc) THEN
4511642a1715,1717
452>      ELSE
453>         ALLOCATE(peqBcoef_g(0,1))
454>      ENDIF
4551645d1719
456<      IF (is_root_prc) &
4571666,1671d1739
458<
459< !=====================================================================
460< !- 6.0 Clear Memory
461< !=====================================================================
462<   CALL sechiba_clear
463<   CALL stomate_clear
464Seulement dans /login/PROG/IPSL/CODE/svn_orchidee_06/tags/ORCHIDEE_1_9_5_2/ORCHIDEE_OL: ENSEMBLE
465Seulement dans /login/PROG/IPSL/CODE/svn_orchidee_06/tags/ORCHIDEE_1_9_5_2/ORCHIDEE_OL: EXP00
466Seulement dans /login/PROG/IPSL/CODE/svn_orchidee_06/tags/ORCHIDEE_1_9_5_2/ORCHIDEE_OL: FLUXNET
467Seulement dans /login/PROG/IPSL/CODE/svn_orchidee_06/tags/ORCHIDEE_1_9_5_2/ORCHIDEE_OL: FORCESOIL
468diff -w --ignore-all-space --ignore-case --recursive --exclude='cvs_diff*' --exclude='*.flc' --exclude='*.bak' --exclude='*.svn*' --exclude='*.lst' --exclude='i.*.L' --exclude='*~' --exclude=Entries --exclude=Tag --exclude=CVS --exclude Makefile ORCHIDEE_OL/forcesoil.f90 /login/PROG/IPSL/CODE/svn_orchidee_06/tags/ORCHIDEE_1_9_5_2/ORCHIDEE_OL/forcesoil.f90
46923c23
470<   CHARACTER(LEN=150) :: sto_restname_in,sto_restname_out,var_name
471---
472>   CHARACTER(LEN=80) :: sto_restname_in,sto_restname_out
47324a25
474>
47526a28
476>
47729d30
478<   INTEGER(i_std)                             :: ier,iret
47933,34c34,39
480<   INTEGER(i_std)                             :: ncfid
481<   REAL(r_std)                                :: dt_force,dt_forcesoil
482---
483>   CHARACTER(LEN=20), SAVE                    :: thecalendar = 'noleap'
484>   !-
485>   CHARACTER(LEN=100) :: Cforcing_name
486>   INTEGER            :: Cforcing_id
487>   INTEGER            :: v_id
488>   REAL(r_std)                                :: dt_forcesoil
48936,38c41
490<   INTEGER,PARAMETER                         :: nparanmax=36
491<   REAL(r_std)                                :: xbid1,xbid2
492<   INTEGER(i_std)                             :: ibid
493---
494>
49539a43,45
496>   INTEGER(i_std),DIMENSION(:),ALLOCATABLE    :: indices_g
497>   REAL(r_std),DIMENSION(:),ALLOCATABLE       :: x_indices_g
498>   REAL(r_std),DIMENSION(:,:),ALLOCATABLE     :: lon, lat
49941,49c47,51
500<   REAL(r_std),DIMENSION(:,:,:,:),ALLOCATABLE :: soilcarbon_input
501<   REAL(r_std),DIMENSION(:,:,:),ALLOCATABLE   :: &
502<        &  carbon,control_moist,control_temp
503<   REAL(r_std),DIMENSION(:,:),ALLOCATABLE     :: &
504<        &  lon,lat,resp_hetero_soil,var_3d
505<   REAL(r_std),DIMENSION(:),ALLOCATABLE       :: &
506<        &  x_indices
507<   REAL(r_std)                                :: time
508<   INTEGER                                   :: i,j,m,iatt,iv
509---
510>
511>
512>   INTEGER                                   :: i,m,iatt,iv,iyear
513>
514>   CHARACTER(LEN=80)                         :: var_name
51558a61
516>   REAL(r_std),DIMENSION(:,:),ALLOCATABLE     :: var_3d
51760,62d62
518<   ! clay fraction
519<   REAL(r_std),ALLOCATABLE,SAVE,DIMENSION(:)  :: clay
520<   !-
52166,68c66,80
522<   CHARACTER(LEN=100) :: Cforcing_name
523<   INTEGER            :: Cforcing_id
524<   INTEGER            :: v_id
525---
526>   ! clay fraction
527>   REAL(r_std),ALLOCATABLE,SAVE,DIMENSION(:)  :: clay_g
528>   REAL(r_std),DIMENSION(:,:,:,:),ALLOCATABLE :: soilcarbon_input_g
529>   REAL(r_std),DIMENSION(:,:,:),ALLOCATABLE   :: control_temp_g
530>   REAL(r_std),DIMENSION(:,:,:),ALLOCATABLE   :: control_moist_g
531>   REAL(r_std),DIMENSION(:,:,:),ALLOCATABLE   :: carbon_g
532>
533>   REAL(r_std),ALLOCATABLE :: clay(:)
534>   REAL(r_std),ALLOCATABLE :: soilcarbon_input(:,:,:,:)
535>   REAL(r_std),ALLOCATABLE :: control_temp(:,:,:)
536>   REAL(r_std),ALLOCATABLE :: control_moist(:,:,:)
537>   REAL(r_std),ALLOCATABLE :: carbon(:,:,:)
538>   REAL(r_std),DIMENSION(:,:),ALLOCATABLE     :: resp_hetero_soil
539>
540>   INTEGER(i_std)                             :: ier,iret
54170,75c82
542<   REAL(r_std),ALLOCATABLE :: clay_loc(:)
543<   REAL(r_std),ALLOCATABLE :: soilcarbon_input_loc(:,:,:,:)
544<   REAL(r_std),ALLOCATABLE :: control_temp_loc(:,:,:)
545<   REAL(r_std),ALLOCATABLE :: control_moist_loc(:,:,:)
546<   REAL(r_std),ALLOCATABLE :: carbon_loc(:,:,:)
547<   INTEGER :: ierr
548---
549>   LOGICAL :: debug
55077a85
551>   CALL init_timer
55278a87,98
553> !---------------------------------------------------------------------
554> !-
555> ! set debug to have more information
556> !-
557>   !Config  Key  = DEBUG_INFO
558>   !Config  Desc = Flag for debug information
559>   !Config  Def  = n
560>   !Config  Help = This option allows to switch on the output of debug
561>   !Config         information without recompiling the code.
562> !-
563>   debug = .FALSE.
564>   CALL getin_p('DEBUG_INFO',debug)
56585,86c105,106
566<      WRITE(*,*) 'STOMATE INPUT RESTART_FILE: ',TRIM(sto_restname_in)
567<      sto_restname_out = 'stomate_restart.nc'
568---
569>      WRITE(numout,*) 'STOMATE INPUT RESTART_FILE: ',TRIM(sto_restname_in)
570>      sto_restname_out = 'stomate_rest_out.nc'
57188c108
572<      WRITE(*,*) 'STOMATE OUTPUT RESTART_FILE: ',TRIM(sto_restname_out)
573---
574>      WRITE(numout,*) 'STOMATE OUTPUT RESTART_FILE: ',TRIM(sto_restname_out)
57590c110
576<      ! We need to know iim, jjm.
577---
578>      ! We need to know iim_g, jjm.
57993,96c113,122
580<      iret = NF90_OPEN (sto_restname_in, NF90_NOWRITE, ncfid)
581<      iret = NF90_INQUIRE_DIMENSION (ncfid,1,len=iim)
582<      iret = NF90_INQUIRE_DIMENSION (ncfid,2,len=jjm)
583<      iret = NF90_CLOSE (ncfid)
584---
585>      iret = NF90_OPEN (sto_restname_in, NF90_NOWRITE, rest_id_sto)
586>      iret = NF90_INQUIRE_DIMENSION (rest_id_sto,1,len=iim_g)
587>      iret = NF90_INQUIRE_DIMENSION (rest_id_sto,2,len=jjm_g)
588>      iret = NF90_INQ_VARID (rest_id_sto, "time", iv)
589>      iret = NF90_GET_ATT (rest_id_sto, iv, 'calendar',thecalendar)
590>      iret = NF90_CLOSE (rest_id_sto)
591>      i=INDEX(thecalendar,ACHAR(0))
592>      IF ( i > 0 ) THEN
593>         thecalendar(i:20)=' '
594>      ENDIF
595100,101c126,127
596<      ALLOCATE (lon(iim,jjm))
597<      ALLOCATE (lat(iim,jjm))
598---
599>      ALLOCATE (lon(iim_g,jjm_g))
600>      ALLOCATE (lat(iim_g,jjm_g))
601107c133
602<           & (sto_restname_in, iim, jjm, lon, lat, llm, lev, &
603---
604>           & (sto_restname_in, iim_g, jjm_g, lon, lat, llm, lev, &
605109a136,138
606>   CALL bcast(date0)
607>   CALL bcast(thecalendar)
608>   WRITE(numout,*) "calendar = ",thecalendar
609113,115c142
610<   CALL bcast(date0)
611< !!! MM : à revoir : choix du calendrier dans forcesoil ?? Il est dans le restart de stomate !
612<   !  CALL ioconf_calendar ('noleap')
613---
614>   CALL ioconf_calendar (thecalendar)
615117d143
616<
617119c145
618<
619---
620>   !
621124c150
622<      Cforcing_name = 'stomate_Cforcing.nc'
623---
624>      Cforcing_name = 'NONE'
625127c153,158
626<      ier = NF90_OPEN (TRIM(Cforcing_name),NF90_NOWRITE,Cforcing_id)
627---
628>      iret = NF90_OPEN (TRIM(Cforcing_name),NF90_NOWRITE,Cforcing_id)
629>      IF (iret /= NF90_NOERR) THEN
630>         CALL ipslerr (3,'forcesoil', &
631>              &        'Could not open file : ', &
632>              &          Cforcing_name,'(Do you have forget it ?)')
633>      ENDIF
634130c161
635<      kjpindex = NINT(x_tmp)
636---
637>      nbp_glo = NINT(x_tmp)
638134,135c165,166
639<      ALLOCATE (indices(kjpindex))
640<      ALLOCATE (clay(kjpindex))
641---
642>      ALLOCATE (indices_g(nbp_glo))
643>      ALLOCATE (clay_g(nbp_glo))
644137c168
645<      ALLOCATE (x_indices(kjpindex),stat=ier)
646---
647>      ALLOCATE (x_indices_g(nbp_glo),stat=ier)
648139,141c170,173
649<      ier = NF90_GET_VAR   (Cforcing_id,v_id,x_indices)
650<      indices(:) = NINT(x_indices(:))
651<      DEALLOCATE (x_indices)
652---
653>      ier = NF90_GET_VAR   (Cforcing_id,v_id,x_indices_g)
654>      indices_g(:) = NINT(x_indices_g(:))
655>      WRITE(numout,*) mpi_rank,"indices globaux : ",indices_g
656>      DEALLOCATE (x_indices_g)
657144c176
658<      ier = NF90_GET_VAR   (Cforcing_id,v_id,clay)
659---
660>      ier = NF90_GET_VAR   (Cforcing_id,v_id,clay_g)
661149c181
662<      WRITE(*,*) 'time step (d): ',dt_forcesoil
663---
664>      WRITE(numout,*) 'time step (d): ',dt_forcesoil
665184,186d215
666<            !----
667<            ALLOCATE( var_3d(kjpindex,vardims(3)), stat=ier)
668<            IF (ier /= 0) STOP 'ALLOCATION PROBLEM'
669192a222,224
670>               ALLOCATE( var_3d(nbp_glo,vardims(3)), stat=ier)
671>               IF (ier /= 0) STOP 'ALLOCATION PROBLEM'
672>               !----
673194,195c226,227
674<                    &        (rest_id_sto, TRIM(varnames(iv)), kjpindex, vardims(3), &
675<                    &         1, itau_dep, .TRUE., var_3d, "gather", kjpindex, indices)
676---
677>                    &        (rest_id_sto, TRIM(varnames(iv)), nbp_glo, vardims(3), &
678>                    &         1, itau_dep, .TRUE., var_3d, "gather", nbp_glo, indices_g)
679204,206c236,237
680<                    &        (rest_id_sto, TRIM(varnames(iv)), kjpindex, vardims(3), &
681<                    &         1, itau_dep, var_3d, 'scatter',  kjpindex, indices)
682<            ENDIF
683---
684>                    &        (rest_id_sto, TRIM(varnames(iv)), nbp_glo, vardims(3), &
685>                    &         1, itau_dep, var_3d, 'scatter',  nbp_glo, indices_g)
686209a241
687>         ENDIF
688214,215c246,247
689<      ALLOCATE(carbon(kjpindex,ncarb,nvm))
690<      carbon(:,:,:) = val_exp
691---
692>      ALLOCATE(carbon_g(nbp_glo,ncarb,nvm))
693>      carbon_g(:,:,:) = val_exp
694221,223c253,255
695<              &    (rest_id_sto, var_name, kjpindex, ncarb , 1, itau_dep, &
696<              &     .TRUE., carbon(:,:,m), 'gather', kjpindex, indices)
697<         IF (ALL(carbon(:,:,m) == val_exp)) carbon(:,:,m) = zero
698---
699>              &    (rest_id_sto, var_name, nbp_glo, ncarb , 1, itau_dep, &
700>              &     .TRUE., carbon_g(:,:,m), 'gather', nbp_glo, indices_g)
701>         IF (ALL(carbon_g(:,:,m) == val_exp)) carbon_g(:,:,m) = zero
702225a258
703>      WRITE(numout,*) "date0 : ",date0, itau_dep
704230a264
705>      write(numout,*) 'Number of years for carbon spinup : ',time_str
706232,233c266,267
707<      CALL tlen2itau(time_str, dt_forcesoil*one_year, date0, itau_len)
708<      write(*,*) 'Number of time steps to do: ',itau_len
709---
710>      CALL tlen2itau(time_str, dt_forcesoil*one_day, date0, itau_len)
711>      write(numout,*) 'Number of time steps to do: ',itau_len
712238,240c272,274
713<      ALLOCATE(soilcarbon_input(kjpindex,ncarb,nvm,nparan))
714<      ALLOCATE(control_temp(kjpindex,nlevs,nparan))
715<      ALLOCATE(control_moist(kjpindex,nlevs,nparan))
716---
717>      ALLOCATE(soilcarbon_input_g(nbp_glo,ncarb,nvm,nparan))
718>      ALLOCATE(control_temp_g(nbp_glo,nlevs,nparan))
719>      ALLOCATE(control_moist_g(nbp_glo,nlevs,nparan))
720243c277
721<      ier = NF90_GET_VAR   (Cforcing_id,v_id,soilcarbon_input)
722---
723>      ier = NF90_GET_VAR   (Cforcing_id,v_id,soilcarbon_input_g)
724245c279
725<      ier = NF90_GET_VAR   (Cforcing_id,v_id,control_moist)
726---
727>      ier = NF90_GET_VAR   (Cforcing_id,v_id,control_moist_g)
728247c281
729<      ier = NF90_GET_VAR   (Cforcing_id,v_id,control_temp)
730---
731>      ier = NF90_GET_VAR   (Cforcing_id,v_id,control_temp_g)
732251,259c285,292
733<      !MM Problem here with dpu which depends on soil type           
734<      DO iv = 1, nbdl-1
735<         ! first 2.0 is dpu
736<         ! second 2.0 is average
737<         diaglev(iv) = 2.0/(2**(nbdl-1) -1) * ( ( 2**(iv-1) -1) + ( 2**(iv) -1) ) / 2.0
738<      ENDDO
739<      diaglev(nbdl) = 2.0
740<      !-
741<      ! For sequential use only, we must initialize data_para :
742---
743>   ENDIF
744>   CALL bcast(nparan)
745>   CALL bcast(dt_forcesoil)
746>   CALL bcast(iim_g)
747>   CALL bcast(jjm_g)
748>   call bcast(nbp_glo)
749>   CALL bcast(itau_dep)
750>   CALL bcast(itau_len)
751260a294
752>   ! We must initialize data_para :
753262c296,297
754<   ENDIF
755---
756>      !
757>   CALL init_data_para(iim_g,jjm_g,nbp_glo,indices_g)
758264,267c299,302
759<   CALL bcast(iim)
760<   CALL bcast(jjm)
761<   call bcast(kjpindex)
762<   CALL init_data_para(iim,jjm,kjpindex,indices)
763---
764>   kjpindex=nbp_loc
765>   jjm=jj_nb
766>   iim=iim_g
767>   IF (debug) WRITE(numout,*) "Local grid : ",kjpindex,iim,jjm
768268a304,312
769>   !---
770>   !--- Create the index table
771>   !---
772>   !--- This job return a LOCAL kindex
773>   !---
774>   ALLOCATE (indices(kjpindex),stat=ier)
775>   CALL scatter(indices_g,indices)
776>   indices(1:kjpindex)=indices(1:kjpindex)-(jj_begin-1)*iim_g
777>   IF (debug) WRITE(numout,*) mpi_rank,"indices locaux = ",indices(1:kjpindex)
778273,279c317,322
779<   CALL bcast(nparan)
780<   ALLOCATE(clay_loc(nbp_loc))
781<   ALLOCATE(soilcarbon_input_loc(nbp_loc,ncarb,nvm,nparan))
782<   ALLOCATE(control_temp_loc(nbp_loc,nlevs,nparan))
783<   ALLOCATE(control_moist_loc(nbp_loc,nlevs,nparan))
784<   ALLOCATE(carbon_loc(nbp_loc,ncarb,nvm))
785<   ALLOCATE(resp_hetero_soil(nbp_loc,nvm))
786---
787>   ALLOCATE(clay(kjpindex))
788>   ALLOCATE(soilcarbon_input(kjpindex,ncarb,nvm,nparan))
789>   ALLOCATE(control_temp(kjpindex,nlevs,nparan))
790>   ALLOCATE(control_moist(kjpindex,nlevs,nparan))
791>   ALLOCATE(carbon(kjpindex,ncarb,nvm))
792>   ALLOCATE(resp_hetero_soil(kjpindex,nvm))
793282,289c325,329
794<   CALL bcast(itau_len)
795<   CALL bcast(nparan)
796<   CALL bcast(dt_forcesoil)
797<   CALL Scatter(clay,clay_loc)
798<   CALL Scatter(soilcarbon_input,soilcarbon_input_loc)
799<   CALL Scatter(control_temp,control_temp_loc)
800<   CALL Scatter(control_moist,control_moist_loc)
801<   CALL Scatter(carbon,carbon_loc)
802---
803>   CALL Scatter(clay_g,clay)
804>   CALL Scatter(soilcarbon_input_g,soilcarbon_input)
805>   CALL Scatter(control_temp_g,control_temp)
806>   CALL Scatter(control_moist_g,control_moist)
807>   CALL Scatter(carbon_g,carbon)
808290a331
809>   iyear=1
810293c334,338
811<      IF (iatt > nparan) iatt = 1
812---
813>      IF (iatt > nparan) THEN
814>         IF (debug) WRITE(numout,*) iyear
815>         iatt = 1
816>         iyear=iyear+1
817>      ENDIF
818295,298c340,343
819<           &    (nbp_loc, dt_forcesoil, clay_loc, &
820<           &     soilcarbon_input_loc(:,:,:,iatt), &
821<           &     control_temp_loc(:,:,iatt), control_moist_loc(:,:,iatt), &
822<           &     carbon_loc, resp_hetero_soil)
823---
824>           &    (kjpindex, dt_forcesoil, clay, &
825>           &     soilcarbon_input(:,:,:,iatt), &
826>           &     control_temp(:,:,iatt), control_moist(:,:,iatt), &
827>           &     carbon, resp_hetero_soil)
828300,301c345,346
829<
830<   CALL Gather(carbon_loc,carbon)
831---
832>   WRITE(numout,*) "End of soilcarbon LOOP."
833>   CALL Gather(carbon,carbon_g)
834311,312c356,357
835<              &    (rest_id_sto, var_name, kjpindex, ncarb , 1, itau_dep, &
836<              &     carbon(:,:,m), 'scatter', kjpindex, indices)
837---
838>              &    (rest_id_sto, var_name, nbp_glo, ncarb , 1, itau_dep, &
839>              &     carbon_g(:,:,m), 'scatter', nbp_glo, indices_g)
840319c364
841<   CALL MPI_FINALIZE(ierr)
842---
843>   CALL MPI_FINALIZE(ier)
844320a366
845>   WRITE(numout,*) "End of forcesoil."
846Seulement dans /login/PROG/IPSL/CODE/svn_orchidee_06/tags/ORCHIDEE_1_9_5_2/ORCHIDEE_OL: getprec.f90
847Seulement dans /login/PROG/IPSL/CODE/svn_orchidee_06/tags/ORCHIDEE_1_9_5_2/ORCHIDEE_OL: OOL_SEC
848Seulement dans /login/PROG/IPSL/CODE/svn_orchidee_06/tags/ORCHIDEE_1_9_5_2/ORCHIDEE_OL: OOL_SEC_STO
849diff -w --ignore-all-space --ignore-case --recursive --exclude='cvs_diff*' --exclude='*.flc' --exclude='*.bak' --exclude='*.svn*' --exclude='*.lst' --exclude='i.*.L' --exclude='*~' --exclude=Entries --exclude=Tag --exclude=CVS --exclude Makefile ORCHIDEE_OL/readdim2.f90 /login/PROG/IPSL/CODE/svn_orchidee_06/tags/ORCHIDEE_1_9_5_2/ORCHIDEE_OL/readdim2.f90
8504c4,7
851< !- $Header: /ipsl/forge/projets/orchidee/cvs/ORCHIDEE_OL/readdim2.f90,v 1.24 2010/12/21 14:28:42 ssipsl Exp $
852---
853> !< $HeadURL: svn://forge.ipsl.jussieu.fr/orchidee/tags/ORCHIDEE_1_9_5_2/ORCHIDEE_OL/readdim2.f90 $
854> !< $Date: 2011-08-01 15:13:21 +0200 (lun. 01 août 2011) $
855> !< $Author: martial.mancip $
856> !< $Revision: 379 $
85715d17
858<    USE netcdf
85920,23c22
860<    PUBLIC  :: forcing_read, forcing_info, forcing_grid, &
861<       !!>ORCHIS
862<       forcing_read_co2, mean_angle, solarang, solarang_lst
863<    !!<ORCHIS
864---
865>    PUBLIC  :: forcing_read, forcing_info, forcing_grid
86633,35d31
867<    !!>ORCHIS
868<    LOGICAL, SAVE                            :: forcing_rad_center
869<    !!<ORCHIS
870101,102c97,98
871<     IF ((.NOT. ALLOCATED(itau)))  ALLOCATE(itau(ttm_full))
872<     IF ((.NOT. ALLOCATED(data_full)))   ALLOCATE(data_full(iim_full, jjm_full),lon_full(iim_full, jjm_full),&
873---
874>     ALLOCATE(itau(ttm_full))
875>     ALLOCATE(data_full(iim_full, jjm_full),lon_full(iim_full, jjm_full),&
876104,105c100,101
877<     IF ((.NOT. ALLOCATED(lev_full)))  ALLOCATE(lev_full(llm_full))
878<     IF ((.NOT. ALLOCATED(fcontfrac))) ALLOCATE(fcontfrac(iim_full,jjm_full))
879---
880>     ALLOCATE(lev_full(llm_full))
881>     ALLOCATE(fcontfrac(iim_full,jjm_full))
882119,132d114
883<
884<     !!>ORCHIS
885<     !-
886<     !Config  Key  = FORCING_RAD_CENTER
887<     !Config  Desc = Are the meteorological fields centered or not on the forcing time steps
888<     !Config  Def  = n
889<     !-
890<     forcing_rad_center = .FALSE.
891<     IF (dt_force .NE. 1800.) THEN
892<         CALL getin_p('FORCING_RAD_CENTER',forcing_rad_center)
893<     ENDIF
894<     WRITE(numout,*) "FORCING_RAD_CENTER : ",forcing_rad_center
895<     !!<ORCHIS
896<
897151a134,137
898>     i=INDEX(calendar_str,ACHAR(0))
899>     IF ( i > 0 ) THEN
900>        calendar_str(i:20)=' '
901>     ENDIF
902272c258
903<        IF ((.NOT. ALLOCATED(i_index)))  ALLOCATE(i_index(iim_full), j_index(jjm_full),j_index_g(jjm_full))
904---
905>        ALLOCATE(i_index(iim_full), j_index(jjm_full),j_index_g(jjm_full))
906281c267
907<           IF ((.NOT. ALLOCATED(tair)))  ALLOCATE(tair(iim_full,jjm_full))
908---
909>           ALLOCATE(tair(iim_full,jjm_full))
910304c290
911<           IF ((.NOT. ALLOCATED(index_l)))  ALLOCATE(index_l(iim_zoom*jjm_zoom))
912---
913>           ALLOCATE(index_l(iim_zoom*jjm_zoom))
914308c294
915<           IF ((.NOT. ALLOCATED(index_l)))  ALLOCATE(index_l(1))
916---
917>           ALLOCATE(index_l(1))
918376,378c362,364
919<        IF ((.NOT. ALLOCATED(lon)))  ALLOCATE(lon(iim_zoom,jjm_zoom))
920<        IF ((.NOT. ALLOCATED(lat)))  ALLOCATE(lat(iim_zoom,jjm_zoom))
921<        IF ((.NOT. ALLOCATED(lev)))  ALLOCATE(lev(llm_full),levuv(llm_full))
922---
923>        ALLOCATE(lon(iim_zoom,jjm_zoom))
924>        ALLOCATE(lat(iim_zoom,jjm_zoom))
925>        ALLOCATE(lev(llm_full),levuv(llm_full))
926705,707d690
927<    !!>ORCHIS
928<    REAL,ALLOCATABLE,DIMENSION(:,:)    :: buf
929<    !!<ORCHIS
930742c725
931<       IF ((.NOT. ALLOCATED(swdown_nm1))) ALLOCATE &
932---
933>      ALLOCATE &
934746c729
935<      IF ((.NOT. ALLOCATED(swdown_n))) ALLOCATE &
936---
937>      ALLOCATE &
938752c735
939<       IF ((.NOT. ALLOCATED(zlev_nm1)))  ALLOCATE &
940---
941>         ALLOCATE &
942759c742
943<     IF ((.NOT. ALLOCATED(mean_sinang))) ALLOCATE &
944---
945>      ALLOCATE &
946840c823
947<         IF ((.NOT. ALLOCATED(tmpdata))) ALLOCATE (tmpdata(iim,jjm))
948---
949>         ALLOCATE (tmpdata(iim,jjm))
9501168,1200d1150
951<
952<           !!>ORCHIS
953<           !! Modification for FORCING_RAD_CENTER data so that the swdown radiation
954<           !! is the value at the beginning of a time window of width equal to dt_force
955<             IF (FORCING_RAD_CENTER) THEN
956<
957<                 !! -- Lecture swdown
958<                 IF (itau_split .EQ. split/2+1) THEN
959<                     ALLOCATE (buf(iim,jjm))
960<                     buf(:,:) = 0.
961<                     
962<                     CALL forcing_just_read (iim, jjm, zlev_n, ttm, itau_read_n+1, itau_read_n+1, &
963<                        &  swdown_n, buf, buf, buf, &
964<                        &  buf, buf, buf, buf, buf, &
965<                        &  buf, buf, buf, buf, buf, buf, buf,buf, &
966<                        &  force_id, wind_N_exists, check)
967<
968<                 ENDIF
969<
970<                 !! -- Compute the correct mean_angle for the hour periods [0-3 ; 3-9; 9-15; 15-21; 21-24]
971<                 IF (itau_split .GE. split/2+1) THEN
972<                     julian = julian_for + (FLOAT(split/2+1-1)/split)*dt_force/one_day
973<                     CALL mean_angle(julian, julian0, dt_force, iim, jjm, lon, lat, &
974<                        &  split,  mean_sinang)               
975<                 ELSE
976<                     julian = julian_for + (FLOAT(-6)/split)*dt_force/one_day
977<                     CALL mean_angle(julian, julian0, dt_force, iim, jjm, lon, lat, &
978<                        &  split, mean_sinang)               
979<                 ENDIF
980<
981<             ENDIF
982<             !!<ORCHIS
983<             
9841699,1951d1648
985<   !!>ORCHIS
986<   !=====================================================================
987<   ! Read the time series of atmospheric CO2 in a NetCDF file
988<   !=====================================================================
989<   SUBROUTINE forcing_read_co2(filename, atmco2, atmco2_ts, year_deb, count_year)
990<     !---------------------------------------------------------------------
991<     !- filename     : name of the file to be opened
992<     !- atmco2       : value of the constant atmco2 value
993<     !- atmco2_ts    : time series of atmospheric CO2 to return
994<     !- year_deb     : The year at which the forcing starts
995<     !- count_year   : Number of years to read
996<     !---------------------------------------------------------------------
997<
998<     USE calendar,  ONLY : ju2ymds
999<
1000<     IMPLICIT NONE
1001<
1002<     !-
1003<     ! ARGUMENTS
1004<     !-
1005<     CHARACTER(LEN=*), INTENT(in)           :: filename
1006<     INTEGER, INTENT(in)                    :: year_deb
1007<     REAL, INTENT(in)                       :: atmco2
1008<     REAL, ALLOCATABLE, DIMENSION(:)        :: atmco2_ts, time
1009<     INTEGER, INTENT(in)                    :: count_year
1010<     !-
1011<     ! LOCAL
1012<     !-
1013<     INTEGER                                :: len, iret, fid
1014<     INTEGER                                :: varid, ndims
1015<     CHARACTER(LEN=250)                     :: name
1016<     CHARACTER(LEN=30)                      :: axname,varname, stryear0
1017<     INTEGER                                :: year_fin, year0
1018<     INTEGER                                :: ind_deb
1019<
1020<     !---------------------------------------------------------------------
1021<
1022<     !! -- Does the file exist? --
1023<     len = LEN_TRIM(filename)
1024<     IF (filename(len-2:len) /= '.nc') THEN
1025<         name=filename(1:len)//'.nc'
1026<     ELSE
1027<         name=filename(1:len)
1028<     ENDIF
1029<     !-
1030<     iret = NF90_OPEN (name, NF90_NOWRITE, fid)
1031<     IF (iret /= NF90_NOERR) THEN
1032<         CALL histerr(3, 'forcing_read_co2','Could not open file :',TRIM(name),' ')
1033<     ENDIF
1034<
1035<
1036<     !! -- If OK, then get the time dimensions --
1037<
1038<     iret = NF90_INQUIRE_DIMENSION (fid, 1, name=axname, len=len)
1039<     CALL strlowercase (axname)
1040<     axname = ADJUSTL(axname)
1041<
1042<     !!WRITE(*,*) '      CB : forcing_read_co2 - getting axname : ',axname,len
1043<
1044<     IF (    (INDEX(axname,'tstep') /= 1) &
1045<        .AND. (INDEX(axname,'time_counter') /= 1) ) THEN
1046<         CALL histerr(3, 'forcing_read_co2','No time dimension','STOP',' ')
1047<
1048<
1049<         !! -- Get the data --
1050<     ELSE     
1051<
1052<         !! Select the time period
1053<         year_fin = year_deb+count_year
1054<
1055<         ! TIME
1056<         ALLOCATE(time(len))
1057<         iret = NF90_INQ_VARID(fid, axname, varid)
1058<         iret = NF90_GET_VAR(fid, varid, time, start = (/1/))
1059<
1060<         iret = NF90_INQUIRE_ATTRIBUTE(fid,nf90_global,name='year0')
1061<         IF ( (iret /= NF90_NOERR) ) THEN
1062<             CALL histerr(3, 'forcing_read_co2',&
1063<                'No information about the start of the atmospheric CO2 time series',&
1064<                'STOP',' ')
1065<         ENDIF
1066<         iret = NF90_GET_ATT(fid,nf90_global,'year0', stryear0)
1067<         READ (stryear0,FMT='(I4)') year0     !! Convert string into integer
1068<
1069<         ind_deb = year_deb-year0+1
1070<
1071<
1072<         !! If the time periods of atmospheric CO2 and forcing files do
1073<         !! not match (this can be the case when the WEATHERGEN is used)
1074<         !! then use a constant value
1075<         IF (    (ind_deb < 0) &
1076<            .OR. (ind_deb+count_year-1 > len) ) THEN
1077<             PRINT*, 'year_deb, year0, year_fin',year_deb, year0, year_fin
1078<             PRINT*, 'year_deb+count_year-1',year_deb+count_year-1
1079<             PRINT*, 'ind_deb, len, count_year',ind_deb, len, count_year
1080<             !CALL histerr(3, 'forcing_read_co2',&
1081<             !   'The time periods of  atmospheric CO2 and forcing data do not match ',&
1082<             !   'STOP',' ')
1083<
1084<             WRITE(*,*) '#### WARNING WARNING WARNING : forcing_read_co2 '
1085<             WRITE(*,*) '#### The time periods of  atmospheric CO2 and forcing data do not match '
1086<             WRITE(*,*) '#### A constant value is considered'
1087<
1088<             !ALLOCATE(atmco2_ts(count_year))
1089<             ALLOCATE(atmco2_ts(1))
1090<             atmco2_ts(:) = atmco2
1091<
1092<         ELSE
1093<
1094<             ! CO2
1095<             iret = NF90_INQ_VARID(fid, 'co2_concentration', varid)
1096<             IF ( (varid == 0).OR.(iret /= NF90_NOERR) ) THEN
1097<                 CALL histerr(3, 'forcing_read_co2','No variable co2_concentration found','STOP',' ')
1098<             ENDIF
1099<             ALLOCATE(atmco2_ts(count_year))
1100<             iret = NF90_GET_VAR(fid, varid, atmco2_ts, start = (/ind_deb/), count = (/count_year/))
1101<
1102<         ENDIF
1103<     ENDIF
1104<
1105<
1106<     iret = NF90_CLOSE (fid)
1107<
1108<   END SUBROUTINE forcing_read_co2
1109<   !=====================================================================
1110<
1111<
1112<
1113<   !=====================================================================
1114<   !- Compute the mean sinus of the solar zenith angle
1115<   !=====================================================================
1116<   SUBROUTINE mean_angle &
1117<      & (julian_for, julian0, dt_force, iim, jjm, lon, lat, &
1118<      &  split, mean_sinang)
1119<     !---------------------------------------------------------------------
1120<     ! Compute the mean angle for the period
1121<     !---------------------------------------------------------------------
1122<     INTEGER, INTENT(IN)              :: split, iim, jjm
1123<     REAL,DIMENSION(:,:),INTENT(IN)   :: lon, lat
1124<     REAL,INTENT(IN)                  :: julian_for, julian0, dt_force
1125<     REAL,DIMENSION(:,:),INTENT(OUT)  :: mean_sinang
1126<     REAL,ALLOCATABLE,DIMENSION(:,:)  :: sinang
1127<     REAL                             :: julian
1128<     INTEGER                          :: is
1129<
1130<     !!REAL :: bsec
1131<     !!INTEGER :: byear, bmonth, bday
1132<
1133<     mean_sinang(:,:) = 0.0
1134<
1135<     ALLOCATE(sinang(iim,jjm))
1136<
1137<     DO is = 1,split
1138<
1139<       julian = julian_for+(FLOAT(is-1)/split)*dt_force/one_day
1140<       CALL solarang (julian, julian0, iim, jjm, lon, lat, sinang)
1141<       mean_sinang(:,:) = mean_sinang(:,:)+sinang(:,:)
1142<
1143<     ENDDO
1144<
1145<     mean_sinang(:,:) = mean_sinang(:,:)/split
1146<   END SUBROUTINE MEAN_ANGLE
1147<   !=====================================================================
1148<
1149<   
1150< !=====================================================================
1151< SUBROUTINE solarang_lst (latime,julian, julian0, iim, jjm, lon, lat, csang)
1152< !---------------------------------------------------------------------
1153< !- This subroutine computes the solar angle according to the method
1154< !- used by GSWP and developed by J.C. Morill.
1155< !- See for further details :
1156< !- http://www.atmo.arizona.edu/~morrill/swrad.html
1157< ! Depends only on local solar time latime
1158< !---------------------------------------------------------------------
1159< !
1160<    USE calendar
1161< !
1162<    IMPLICIT NONE
1163< !-
1164<    INTEGER,INTENT(in) :: iim, jjm
1165<    REAL,INTENT(in)  :: julian, julian0, latime
1166<    REAL,DIMENSION(iim,jjm), INTENT(in)  :: lon, lat
1167<    REAL,DIMENSION(iim,jjm), INTENT(out) :: csang
1168< !-
1169<    REAL :: pi, gamma, dec, decd
1170<    REAL :: et, gmt, le, ls, lcorr,  omega, omegad
1171<    REAL :: llatd, llat
1172<    INTEGER :: igmt, ilon, ilat
1173<    INTEGER,SAVE,ALLOCATABLE :: zone(:), lhour(:)
1174< !
1175<    LOGICAL :: check = .FALSE.
1176< !---------------------------------------------------------------------
1177< !
1178<    pi = 4.*ATAN(1.)
1179<    IF (check) WRITE(numout,*) 'We get the right calendar information'
1180< !-
1181< !- 1) Day angle gamma
1182< !-
1183< !   gamma = 2.*pi*MOD(julian,one_year)/one_year
1184<    gamma = 2.*pi*(julian-julian0)/one_year
1185< !-
1186< !- 2) Solar declination (assumed constant for a 24 hour period)  page 7
1187< !-    in radians
1188< !-
1189<    IF (check) WRITE(numout,*) 'Solar declination'
1190<     !
1191<    dec = ( 0.006918-0.399912*COS(gamma)+0.070257*SIN(gamma) &
1192<   &       -0.006758*COS(2*gamma)+0.000907*SIN(2*gamma)      &
1193<   &       -0.002697*COS(3*gamma)+0.00148*SIN(3*gamma))
1194<
1195<
1196< !--- 5) Hour angle omega  page 15
1197< !---
1198< !--- hour angle is zero at noon, positive in the morning
1199< !--- It ranges from 180 to -180
1200< !---
1201< !--- omegad is omega in degrees, omega is in radians
1202< !---
1203<    DO ilon=1,iim
1204<      omegad = (latime-12.)*(-15.)
1205<      omega  = omegad*pi/180.
1206< !---
1207<      DO ilat=1,jjm
1208< !-----
1209< !----- 6)  Zenith angle  page 15
1210< !-----
1211< !----- csang cosine of zenith angle (radians)
1212< !----- llatd =  local latitude in degrees
1213< !----- llat  =  local latitude in radians
1214< !-----
1215<        llatd = lat(1,ilat)
1216<        llat  = llatd*pi/180.
1217<        csang(ilon,ilat) = &
1218<       &  MAX(0.,SIN(dec)*SIN(llat)+COS(dec)*COS(llat)*COS(omega))
1219<      ENDDO
1220<    ENDDO
1221< !----------------------
1222< END SUBROUTINE solarang_lst
1223< !=====================================================================
1224<
1225< !!>ORCHIS_EK
1226< SUBROUTINE deallocate_forcing_info
1227<
1228<  implicit none
1229<
1230<    DEALLOCATE(itau)
1231<    DEALLOCATE(data_full,lon_full,lat_full)
1232<    DEALLOCATE(lev_full)
1233<    DEALLOCATE(i_index, j_index,j_index_g)
1234<
1235<  END SUBROUTINE deallocate_forcing_info
1236< !! ORCHIS_EK
1237<
1238Seulement dans /login/PROG/IPSL/CODE/svn_orchidee_06/tags/ORCHIDEE_1_9_5_2/ORCHIDEE_OL: SPINUP
1239Seulement dans ORCHIDEE_OL: svn_diff_00
1240Seulement dans ORCHIDEE_OL: svn_diff_HEAD
1241Seulement dans /login/PROG/IPSL/CODE/svn_orchidee_06/tags/ORCHIDEE_1_9_5_2/ORCHIDEE_OL: TESTSTOMATE
1242Seulement dans /login/PROG/IPSL/CODE/svn_orchidee_06/tags/ORCHIDEE_1_9_5_2/ORCHIDEE_OL: teststomate.f90
1243Seulement dans /login/PROG/IPSL/CODE/svn_orchidee_06/tags/ORCHIDEE_1_9_5_2/ORCHIDEE_OL: Utilitaire
1244diff -w --ignore-all-space --ignore-case --recursive --exclude='cvs_diff*' --exclude='*.flc' --exclude='*.bak' --exclude='*.svn*' --exclude='*.lst' --exclude='i.*.L' --exclude='*~' --exclude=Entries --exclude=Tag --exclude=CVS --exclude Makefile ORCHIDEE_OL/weather.f90 /login/PROG/IPSL/CODE/svn_orchidee_06/tags/ORCHIDEE_1_9_5_2/ORCHIDEE_OL/weather.f90
12458d7
1246<   USE calendar
12472065c2064
1248<   CHARACTER(LEN=150) :: stamp
1249---
1250>   CHARACTER(LEN=80) :: stamp