source: LMDZ5/branches/IPSLCM6.0.10/libf/phylmd/rrtm/sugfl.F90 @ 5407

Last change on this file since 5407 was 1999, checked in by Laurent Fairhead, 11 years ago

Merged trunk changes r1920:1997 into testing branch

  • Property copyright set to
    Name of program: LMDZ
    Creation date: 1984
    Version: LMDZ5
    License: CeCILL version 2
    Holder: Laboratoire de m\'et\'eorologie dynamique, CNRS, UMR 8539
    See the license file in the root directory
File size: 28.1 KB
Line 
1SUBROUTINE SUGFL
2
3USE PARKIND1  ,ONLY : JPIM     ,JPRB
4USE YOMHOOK   ,ONLY : LHOOK,   DR_HOOK
5
6USE YOMLUN , ONLY :  NULOUT
7USE YOM_YGFL , ONLY : YGFL,YGFLC,YL, YI, YA, YS, YR, YG, YTKE,&
8 & YO3, YSRC, YEXT, YQ, YCVGQ, JPGFL,YQVA, &
9 & YL_NL, YI_NL, YA_NL, YO3_NL, YSRC_NL, YEXT_NL, YQ_NL,YQVA_NL, &
10 & YS_NL, YR_NL, YG_NL, YTKE_NL,YCVGQ_NL,NGFL_EXT,&
11 & YCPF , YSPF ,YCPF_NL, YSPF_NL, YAERO, YAERO_NL, NAERO, YGRG, YGRG_NL, NGRG,&
12 & YSDSAT, YCVV, YSDSAT_NL, YCVV_NL, YFORC, YFORC_NL, NGFL_FORC,&
13 & YEZDIAG, YEZDIAG_NL, NGFL_EZDIAG, &
14 & YGHG, YGHG_NL, NGHG, YTRAC, YTRAC_NL, NTRAC, &
15 & YUOM     ,YUAL     ,YDOM     ,YDAL     ,YUEN     ,YUNEBH, &
16 & YUOM_NL  ,YUAL_NL  ,YDOM_NL  ,YDAL_NL  ,YUEN_NL  ,YUNEBH_NL
17USE GFL_SUBS ,ONLY : DEFINE_GFL_COMP
18USE YOMDIM , ONLY : LADER
19USE YOMCST   , ONLY : RV       ,RCPV     ,RCW      ,RCS
20USE YOMGRB , ONLY : NGRBQ, NGRBO3, NGRBCLWC, NGRBCIWC,&
21 & NGRBCC, NGRB149
22USE YOMCT0   , ONLY : LFPART2,NCONF
23USE YOMFA  , ONLY : YFAQ     ,YFAL     ,YFAI     ,YFAO3    ,&
24 & YFAS     ,YFAR     ,YFAG     ,YFATKE   ,&
25 & YFACPF, YFASPF, YFACLF,YFASRC, YFACVGQ, YFASDSAT, YFACVV ,&
26 & YFAQVA, &
27 & YFAUOM, YFAUAL, YFADOM, YFADAL, YFAUEN, YFAUNEBH
28
29!**** *SUGFL*  - Initialize definition of unified_treatment grid_point fields
30
31!     Purpose.
32!     --------
33!           Initialize definition of unified_treatment fields (GFL)
34!           The GFL ordering in this routine is the ordering for "t" and
35!           "t+dt" values of the GFL in grid-point arrays (GFL and GFLT1),
36!           and also the ordering in the spectral array SPGFL.
37
38!**   Interface.
39!     ----------
40!        *CALL* *SUGFL
41
42!        Explicit arguments :
43!        --------------------
44
45!        Implicit arguments :
46!        --------------------
47!        MODULE YOM_YGFL
48
49!     Method.
50!     -------
51!        See documentation
52
53!     Externals.
54!     ----------
55!        None
56
57!     Reference.
58!     ----------
59!        ECMWF Research Department documentation of the IFS
60
61!     Author.
62!     -------
63!        Mats Hamrud  *ECMWF*
64
65!     Modifications.
66!     --------------
67!        Original : 2002-03-11
68!        M.Hamrud : 2002-08-01 Extensive mods
69!        R. El Khatib : 2003-08-19 ARPEGE field names
70!        M.Hamrud      01-Oct-2003 CY28 Cleaning
71!        M. Tudor : 2003-10-17 introduce YCPF and YSPF in GFL
72!        A. Untch : 2005-03-11 introduce aerosols
73!        J. Flemming : 2005-04-11 replace aerosols with GRG
74!        Y. Seity  : 2004-11-16 AROME GFL fields
75!        C. Fischer: 23-May-2005 No Ozone in the Meteo-France control variable
76!        Y. Bouteloup: 13-Oct-2005 introduce YCVGQ (Moisture convergence for French physics)
77!        J. Haseler : 2005-10-11 introduce LTRAJIO
78!        JJMorcrette  20060512 GEMS variables in cy31
79!        S. Serrar    20060907 tracers used for diagnostics only (in GFL between GHG and GRG)
80!        A. Alias : 2006-10-13 introduction of YSDSAT and YCVV
81!        B. Sass :  HIRLAM pseudo-prognostic field YQVA
82!        M. Bellus : 27-Sep-2006 introduce YUOM, YUAL, YDOM, YDAL, YUEN and
83!                    YUNEBH (ALARO-0 prognostic convection) + spotted/corrected bug
84!                    in index incrementation after YO3
85!     ------------------------------------------------------------------
86
87IMPLICIT NONE
88
89INTEGER(KIND=JPIM) :: JGFL,IGFLPTR,INCR
90LOGICAL   :: LLDERS,LLT1,LL5
91REAL(KIND=JPRB) :: ZHOOK_HANDLE
92
93!-------------------------------------------------------------------------
94
95#include "abor1.intfb.h"
96
97!-------------------------------------------------------------------------
98
99IF (LHOOK) CALL DR_HOOK('SUGFL',0,ZHOOK_HANDLE)
100
101!-------------------------------------------------------------------------
102
103IF( .NOT.LFPART2) THEN
104
105!      1.   CASE LFPART2=F
106!
107!      1.1  Initial settings.
108
109  YGFL%NUMFLDS=0
110
111  LL5=NCONF/100 == 1.OR.NCONF == 801.OR.NCONF == 601.OR. &
112   & NCONF == 401.OR.NCONF == 501 
113  LLT1=.TRUE.
114  ! All gridpoint fields have to be set up before the spectral ones
115  !  (i.e. part 1.2 SHOULD be done before part 1.3)
116  LLDERS=.FALSE.
117  ! * Simple GFL variables:
118  !   (order should be the same in parts 1.1, 1.2 and 1.3).
119  INCR=0
120  YQ    => YGFLC(JPGFL-INCR)
121  INCR=INCR+1
122  YL    => YGFLC(JPGFL-INCR)
123  INCR=INCR+1
124  YI    => YGFLC(JPGFL-INCR)
125  INCR=INCR+1
126  YS    => YGFLC(JPGFL-INCR)
127  INCR=INCR+1
128  YR    => YGFLC(JPGFL-INCR)
129  INCR=INCR+1
130  YG    => YGFLC(JPGFL-INCR)
131  INCR=INCR+1
132  YTKE  => YGFLC(JPGFL-INCR)
133  INCR=INCR+1
134  YA    => YGFLC(JPGFL-INCR)
135  INCR=INCR+1
136  YO3   => YGFLC(JPGFL-INCR)
137  INCR=INCR+1
138  YCPF  => YGFLC(JPGFL-INCR)
139  INCR=INCR+1
140  YSPF  => YGFLC(JPGFL-INCR)
141  INCR=INCR+1
142  YSRC  => YGFLC(JPGFL-INCR)
143  INCR=INCR+1
144  YCVGQ => YGFLC(JPGFL-INCR)
145  INCR=INCR+1
146  YSDSAT => YGFLC(JPGFL-INCR)
147  INCR=INCR+1
148  YCVV  => YGFLC(JPGFL-INCR)
149  INCR=INCR+1
150  YQVA  => YGFLC(JPGFL-INCR)
151  INCR=INCR+1
152  YUOM => YGFLC(JPGFL-INCR)
153  INCR=INCR+1
154  YUAL => YGFLC(JPGFL-INCR)
155  INCR=INCR+1
156  YDOM => YGFLC(JPGFL-INCR)
157  INCR=INCR+1
158  YDAL => YGFLC(JPGFL-INCR)
159  INCR=INCR+1
160  YUEN => YGFLC(JPGFL-INCR)
161  INCR=INCR+1
162  YUNEBH => YGFLC(JPGFL-INCR)
163  INCR=INCR+1
164  ! * Groups of multiple GFL variables:
165  !   (order should be the same in parts 1.1, 1.2 and 1.3).
166  IF (NGFL_EXT == 0) THEN
167    YEXT => YGFLC(JPGFL-INCR:JPGFL-INCR)
168    INCR=INCR+1
169  ENDIF
170  IF (NGFL_FORC == 0) THEN
171    YFORC => YGFLC(JPGFL-INCR:JPGFL-INCR)
172    INCR=INCR+1
173  ENDIF
174  IF (NGFL_EZDIAG == 0) THEN
175    YEZDIAG => YGFLC(JPGFL-INCR:JPGFL-INCR)
176    INCR=INCR+1
177  ENDIF
178  IF (NGHG == 0) THEN
179    YGHG => YGFLC(JPGFL-INCR:JPGFL-INCR)
180    INCR=INCR+1
181  ENDIF
182  IF (NTRAC == 0) THEN
183    YTRAC => YGFLC(JPGFL-INCR:JPGFL-INCR)
184    INCR=INCR+1
185  ENDIF
186  IF (NGRG == 0) THEN
187    YGRG => YGFLC(JPGFL-INCR:JPGFL-INCR)
188    INCR=INCR+1
189  ENDIF
190  IF (NAERO == 0) THEN
191    YAERO => YGFLC(JPGFL-INCR:JPGFL-INCR)
192    INCR=INCR+1
193  ENDIF
194
195!      1.2  Grid-point GFL.
196
197  IF(YQ_NL%LGP) THEN
198    IGFLPTR=YGFL%NUMFLDS+1
199    YQ=>YGFLC(IGFLPTR)
200    CALL DEFINE_GFL_COMP(YDGFLC=YQ ,CDNAME=YFAQ%CLNAME,KGRIB=NGRBQ,LDGP=.TRUE.,&
201     & KREQIN=YQ_NL%NREQIN, &
202     & PREFVALI=YQ_NL%REFVALI,LDREQOUT=YQ_NL%LREQOUT,LDERS=LLDERS,LD5=LL5,&
203     & LDT1=LLT1,LDGPINGP=YQ_NL%LGPINGP, &
204     & LDTRAJIO=YQ_NL%LTRAJIO,LDTHERMACT=.TRUE.,PR=RV,PRCP=RCPV)
205  ENDIF
206  IF(YL_NL%LGP) THEN
207    IGFLPTR=YGFL%NUMFLDS+1
208    YL=>YGFLC(IGFLPTR)
209    CALL DEFINE_GFL_COMP(YDGFLC=YL ,CDNAME=YFAL%CLNAME,KGRIB=NGRBCLWC, &
210     & LDGP=.TRUE.,KREQIN=YL_NL%NREQIN, &
211     & PREFVALI=YL_NL%REFVALI,LDREQOUT=YL_NL%LREQOUT,LDERS=LLDERS,LD5=LL5, &
212     & LDT1=LLT1,LDTHERMACT=.TRUE.,PR=0.0_JPRB,PRCP=RCW)
213  ENDIF
214  IF(YI_NL%LGP) THEN
215    IGFLPTR=YGFL%NUMFLDS+1
216    YI=>YGFLC(IGFLPTR)
217    CALL DEFINE_GFL_COMP(YDGFLC=YI ,CDNAME=YFAI%CLNAME,KGRIB=NGRBCIWC,&
218     & LDGP=.TRUE.,KREQIN=YI_NL%NREQIN, &
219     & PREFVALI=YI_NL%REFVALI,LDREQOUT=YI_NL%LREQOUT,LDERS=LLDERS,LD5=LL5, &
220     & LDT1=LLT1,LDTHERMACT=.TRUE.,PR=0.0_JPRB,PRCP=RCS)
221  ENDIF
222  IF(YS_NL%LGP) THEN
223    IGFLPTR=YGFL%NUMFLDS+1
224    YS=>YGFLC(IGFLPTR)
225    CALL DEFINE_GFL_COMP(YDGFLC=YS ,CDNAME=YFAS%CLNAME,KGRIB=NGRB149, &
226     & LDGP=.TRUE.,KREQIN=YS_NL%NREQIN, &
227     & PREFVALI=YS_NL%REFVALI,LDREQOUT=YS_NL%LREQOUT,LDERS=LLDERS,LD5=LL5, &
228     & LDT1=LLT1,LDTHERMACT=.TRUE.,PR=0.0_JPRB,PRCP=RCS)
229  ENDIF
230  IF(YR_NL%LGP) THEN
231    IGFLPTR=YGFL%NUMFLDS+1
232    YR=>YGFLC(IGFLPTR)
233    CALL DEFINE_GFL_COMP(YDGFLC=YR ,CDNAME=YFAR%CLNAME,KGRIB=NGRB149,&
234     & LDGP=.TRUE.,KREQIN=YR_NL%NREQIN, &
235     & PREFVALI=YR_NL%REFVALI,LDREQOUT=YR_NL%LREQOUT,LDERS=LLDERS,LD5=LL5, &
236     & LDT1=LLT1,LDTHERMACT=.TRUE.,PR=0.0_JPRB,PRCP=RCW)
237  ENDIF
238  IF(YG_NL%LGP) THEN
239    IGFLPTR=YGFL%NUMFLDS+1
240    YG=>YGFLC(IGFLPTR)
241    CALL DEFINE_GFL_COMP(YDGFLC=YG ,CDNAME=YFAG%CLNAME,KGRIB=NGRB149,&
242     & LDGP=.TRUE.,KREQIN=YG_NL%NREQIN, &
243     & PREFVALI=YG_NL%REFVALI,LDREQOUT=YG_NL%LREQOUT,LDERS=LLDERS,LD5=LL5, &
244     & LDT1=LLT1,LDTHERMACT=.TRUE.,PR=0.0_JPRB,PRCP=RCS)
245  ENDIF
246  IF(YTKE_NL%LGP) THEN
247    IGFLPTR=YGFL%NUMFLDS+1
248    YTKE=>YGFLC(IGFLPTR)
249    CALL DEFINE_GFL_COMP(YDGFLC=YTKE ,CDNAME=YFATKE%CLNAME,KGRIB=NGRB149,&
250     & LDGP=.TRUE.,KREQIN=YTKE_NL%NREQIN, &
251     & PREFVALI=YTKE_NL%REFVALI,LDREQOUT=YTKE_NL%LREQOUT,LDERS=LLDERS,LD5=LL5,&
252     & LDT1=LLT1)
253  ENDIF
254  IF(YA_NL%LGP)THEN
255    IGFLPTR=YGFL%NUMFLDS+1
256    YA=>YGFLC(IGFLPTR)
257    CALL DEFINE_GFL_COMP(YDGFLC=YA ,CDNAME=YFACLF%CLNAME,KGRIB=NGRBCC,&
258     & LDGP=.TRUE.,KREQIN=YA_NL%NREQIN, &
259     & PREFVALI=YA_NL%REFVALI,LDREQOUT=YA_NL%LREQOUT,LDERS=LLDERS,LD5=LL5,&
260     & LDT1=LLT1)
261  ENDIF
262  IF(YO3_NL%LGP)THEN
263    IGFLPTR=YGFL%NUMFLDS+1
264    YO3=>YGFLC(IGFLPTR)
265    CALL DEFINE_GFL_COMP(YDGFLC=YO3,CDNAME=YFAO3%CLNAME,KGRIB=NGRBO3,&
266     & LDGP=.TRUE.,KREQIN=YO3_NL%NREQIN, &
267     & PREFVALI=YO3_NL%REFVALI,LDREQOUT=YO3_NL%LREQOUT,LDERS=LLDERS,LD5=LL5,&
268     & LDT1=LLT1,LDGPINGP=YO3_NL%LGPINGP, &
269     & LDTRAJIO=YO3_NL%LTRAJIO)
270  ENDIF
271  IF(YCPF_NL%LGP)THEN
272    IGFLPTR=YGFL%NUMFLDS+1
273    YCPF=>YGFLC(IGFLPTR)
274    CALL DEFINE_GFL_COMP(YDGFLC=YCPF,CDNAME=YFACPF%CLNAME,&
275     & KGRIB=YCPF_NL%IGRBCODE,LDGP=.TRUE., &
276     & KREQIN=YCPF_NL%NREQIN,PREFVALI= YCPF_NL%REFVALI,&
277     & LDREQOUT=YCPF_NL%LREQOUT,LDERS=.FALSE.,LD5=LL5, &
278     & LDT1=LLT1,LDGPINGP=.TRUE.)
279  ENDIF
280  IF(YSPF_NL%LGP)THEN
281    IGFLPTR=YGFL%NUMFLDS+1
282    YSPF=>YGFLC(IGFLPTR)
283    CALL DEFINE_GFL_COMP(YDGFLC=YSPF,CDNAME=YFASPF%CLNAME,&
284     & KGRIB=YSPF_NL%IGRBCODE,LDGP=.TRUE., &
285     & KREQIN=YSPF_NL%NREQIN, PREFVALI=YSPF_NL%REFVALI,&
286     & LDREQOUT=YSPF_NL%LREQOUT,LDERS=.FALSE.,LD5=LL5, &
287     & LDT1=LLT1,LDGPINGP=.TRUE.)
288  ENDIF
289  IF(YSRC_NL%LGP) THEN
290    IGFLPTR=YGFL%NUMFLDS+1
291    YSRC=>YGFLC(IGFLPTR)
292    CALL DEFINE_GFL_COMP(YDGFLC=YSRC ,CDNAME=YFASRC%CLNAME,KGRIB=NGRB149,&
293     & LDGP=.TRUE.,KREQIN=YSRC_NL%NREQIN, &
294     & PREFVALI=YSRC_NL%REFVALI,LDREQOUT=YSRC_NL%LREQOUT,LDERS=LLDERS,&
295     & LD5=LL5,LDT1=LLT1)
296  ENDIF
297  IF(YCVGQ_NL%LGP) THEN
298    IGFLPTR=YGFL%NUMFLDS+1
299    YCVGQ=>YGFLC(IGFLPTR)
300    CALL DEFINE_GFL_COMP(YDGFLC=YCVGQ ,CDNAME=YFACVGQ%CLNAME,KGRIB=NGRB149,&
301     & LDGP=.TRUE.,KREQIN=YCVGQ_NL%NREQIN, &
302     & PREFVALI=YCVGQ_NL%REFVALI, LDREQOUT=YCVGQ_NL%LREQOUT,LDERS=LLDERS,&
303     & LD5=LL5,LDT1=LLT1)
304  ENDIF
305  IF(YSDSAT_NL%LGP) THEN
306    IGFLPTR=YGFL%NUMFLDS+1
307    YSDSAT=>YGFLC(IGFLPTR)
308    CALL DEFINE_GFL_COMP(YDGFLC=YSDSAT,CDNAME=YFASDSAT%CLNAME,KGRIB=NGRB149,&
309     & LDGP=.TRUE.,KREQIN=YSDSAT_NL%NREQIN, &
310     & PREFVALI=YSDSAT_NL%REFVALI, LDREQOUT=YSDSAT_NL%LREQOUT,LDERS=LLDERS,&
311     & LD5=LL5,LDT1=LLT1)
312  ENDIF
313  IF(YCVV_NL%LGP) THEN
314    IGFLPTR=YGFL%NUMFLDS+1
315    YCVV=>YGFLC(IGFLPTR)
316    CALL DEFINE_GFL_COMP(YDGFLC=YCVV,CDNAME=YFACVV%CLNAME,KGRIB=NGRB149,&
317     & LDGP=.TRUE.,KREQIN=YCVV_NL%NREQIN, &
318     & PREFVALI=YCVV_NL%REFVALI, LDREQOUT=YCVV_NL%LREQOUT,LDERS=LLDERS,&
319     & LD5=LL5,LDT1=LLT1)
320  ENDIF
321  IF(YQVA_NL%LGP) THEN
322    IGFLPTR=YGFL%NUMFLDS+1
323    YQVA=>YGFLC(IGFLPTR)
324    CALL DEFINE_GFL_COMP(YDGFLC=YQVA,CDNAME=YFAQVA%CLNAME,&
325     & KGRIB=YQVA_NL%IGRBCODE,LDGP=.TRUE., &
326     & KREQIN=YQVA_NL%NREQIN, PREFVALI=YQVA_NL%REFVALI,&
327     & LDREQOUT=YQVA_NL%LREQOUT,LDERS=.FALSE.,LD5=LL5, &
328     & LDT1=LLT1,LDGPINGP=.TRUE.)
329  ENDIF
330  IF(YUOM_NL%LGP)THEN
331    IGFLPTR=YGFL%NUMFLDS+1
332    YUOM=>YGFLC(IGFLPTR)
333    CALL DEFINE_GFL_COMP(YDGFLC=YUOM,CDNAME=YFAUOM%CLNAME,&
334     & KGRIB=YUOM_NL%IGRBCODE,LDGP=.TRUE., &
335     & KREQIN=YUOM_NL%NREQIN,&
336     & PREFVALI=YUOM_NL%REFVALI,LDREQOUT=YUOM_NL%LREQOUT,&
337     & LDERS=.FALSE.,LD5=LL5,LDT1=LLT1,LDGPINGP=.TRUE.)
338  ENDIF
339  IF(YUAL_NL%LGP)THEN
340    IGFLPTR=YGFL%NUMFLDS+1
341    YUAL=>YGFLC(IGFLPTR)
342    CALL DEFINE_GFL_COMP(YDGFLC=YUAL,CDNAME=YFAUAL%CLNAME,&
343     & KGRIB=YUAL_NL%IGRBCODE,LDGP=.TRUE., &
344     & KREQIN=YUAL_NL%NREQIN,&
345     & PREFVALI=YUAL_NL%REFVALI,LDREQOUT=YUAL_NL%LREQOUT,&
346     & LDERS=.FALSE.,LD5=LL5,LDT1=LLT1,LDGPINGP=.TRUE.)
347  ENDIF
348  IF(YDOM_NL%LGP)THEN
349    IGFLPTR=YGFL%NUMFLDS+1
350    YDOM=>YGFLC(IGFLPTR)
351    CALL DEFINE_GFL_COMP(YDGFLC=YDOM,CDNAME=YFADOM%CLNAME,&
352     & KGRIB=YDOM_NL%IGRBCODE,LDGP=.TRUE., &
353     & KREQIN=YDOM_NL%NREQIN,&
354     & PREFVALI=YDOM_NL%REFVALI,LDREQOUT=YDOM_NL%LREQOUT,&
355     & LDERS=.FALSE.,LD5=LL5,LDT1=LLT1,LDGPINGP=.TRUE.)
356  ENDIF
357  IF(YDAL_NL%LGP)THEN
358    IGFLPTR=YGFL%NUMFLDS+1
359    YDAL=>YGFLC(IGFLPTR)
360    CALL DEFINE_GFL_COMP(YDGFLC=YDAL,CDNAME=YFADAL%CLNAME,&
361     & KGRIB=YDAL_NL%IGRBCODE,LDGP=.TRUE., &
362     & KREQIN=YDAL_NL%NREQIN,&
363     & PREFVALI=YDAL_NL%REFVALI,LDREQOUT=YDAL_NL%LREQOUT,&
364     & LDERS=.FALSE.,LD5=LL5,LDT1=LLT1,LDGPINGP=.TRUE.)
365  ENDIF
366  IF(YUEN_NL%LGP)THEN
367    IGFLPTR=YGFL%NUMFLDS+1
368    YUEN=>YGFLC(IGFLPTR)
369    CALL DEFINE_GFL_COMP(YDGFLC=YUEN,CDNAME=YFAUEN%CLNAME,&
370     & KGRIB=YUEN_NL%IGRBCODE,LDGP=.TRUE., &
371     & KREQIN=YUEN_NL%NREQIN,&
372     & PREFVALI=YUEN_NL%REFVALI,LDREQOUT=YUEN_NL%LREQOUT,&
373     & LDERS=.FALSE.,LD5=LL5,LDT1=LLT1,LDGPINGP=.TRUE.)
374  ENDIF
375  IF(YUNEBH_NL%LGP)THEN
376    IGFLPTR=YGFL%NUMFLDS+1
377    YUNEBH=>YGFLC(IGFLPTR)
378    CALL DEFINE_GFL_COMP(YDGFLC=YUNEBH,CDNAME=YFAUNEBH%CLNAME,&
379     & KGRIB=YUNEBH_NL%IGRBCODE,LDGP=.TRUE., &
380     & KREQIN=YUNEBH_NL%NREQIN,&
381     & PREFVALI=YUNEBH_NL%REFVALI,LDREQOUT=YUNEBH_NL%LREQOUT,&
382     & LDERS=.FALSE.,LD5=LL5,LDT1=LLT1,LDGPINGP=.TRUE.)
383  ENDIF
384
385  ! Extra GFL variables
386  ! - do a preliminary test to see if, when there are extra-GFL and when at
387  !   least one of them is a grid-point one, there is no extra-GFL which is
388  !   a spectral one (not allowed):
389  !   in this case all the extra-GFL must be grid-point ones.
390  IF (NGFL_EXT > 1) THEN
391   IF(ANY(YEXT_NL(1:NGFL_EXT)%LGP)) THEN
392    DO JGFL=1,NGFL_EXT
393      IF (YEXT_NL(JGFL)%LSP) CALL ABOR1&
394       & ('SUGFL:EXTRA GFL FIELDS HAVE TO BE ALL EITHER SPECTRAL OR GRIDPOINT')
395    ENDDO
396   ENDIF
397  ENDIF
398  ! - define the GFL components (all the extra-GFL are grid-point ones).
399  DO JGFL=1,NGFL_EXT
400    IF(YEXT_NL(JGFL)%LGP) THEN
401      IF(JGFL == 1) THEN
402        IGFLPTR=YGFL%NUMFLDS+1
403        YEXT=>YGFLC(IGFLPTR:IGFLPTR+NGFL_EXT-1)
404      ENDIF
405      CALL DEFINE_GFL_COMP(YDGFLC=YEXT(JGFL),CDNAME=YEXT_NL(JGFL)%CNAME ,&
406       & KGRIB=YEXT_NL(JGFL)%IGRBCODE,LDGP=.TRUE.,KREQIN=YEXT_NL(JGFL)%NREQIN,&
407       & PREFVALI=YEXT_NL(JGFL)%REFVALI, LDREQOUT=YEXT_NL(JGFL)%LREQOUT ,&
408       & LDERS=LLDERS, LD5=LL5, LDT1=LLT1,LDGPINGP=YEXT_NL(JGFL)%LGPINGP, &
409       & LDTRAJIO=YEXT_NL(JGFL)%LTRAJIO)
410    ENDIF
411  ENDDO
412
413  ! Forcings
414  DO JGFL=1,NGFL_FORC
415    IF(YFORC_NL(JGFL)%LGP) THEN
416      IF(JGFL == 1) THEN
417        IGFLPTR=YGFL%NUMFLDS+1
418        YFORC=>YGFLC(IGFLPTR:IGFLPTR+NGFL_FORC-1)
419      ENDIF
420      CALL DEFINE_GFL_COMP(YDGFLC=YFORC(JGFL),CDNAME=YFORC_NL(JGFL)%CNAME ,&
421       & KGRIB=YFORC_NL(JGFL)%IGRBCODE,LDGP=.TRUE.,KREQIN=YFORC_NL(JGFL)%NREQIN,&
422       & PREFVALI=YFORC_NL(JGFL)%REFVALI, LDREQOUT=YFORC_NL(JGFL)%LREQOUT ,&
423       & LDERS=LLDERS, LD5=LL5, LDT1=LLT1,LDGPINGP=YFORC_NL(JGFL)%LGPINGP, &
424       & LDTRAJIO=YFORC_NL(JGFL)%LTRAJIO)
425    ENDIF
426  ENDDO
427
428  ! Easy diagnostics
429  DO JGFL=1,NGFL_EZDIAG
430    IF(YEZDIAG_NL(JGFL)%LGP) THEN
431      IF(JGFL == 1) THEN
432        IGFLPTR=YGFL%NUMFLDS+1
433        YEZDIAG=>YGFLC(IGFLPTR:IGFLPTR+NGFL_EZDIAG-1)
434      ENDIF
435      CALL DEFINE_GFL_COMP(YDGFLC=YEZDIAG(JGFL),CDNAME=YEZDIAG_NL(JGFL)%CNAME ,&
436       & KGRIB=YEZDIAG_NL(JGFL)%IGRBCODE,LDGP=.TRUE.,KREQIN=YEZDIAG_NL(JGFL)%NREQIN,&
437       & PREFVALI=YEZDIAG_NL(JGFL)%REFVALI, LDREQOUT=YEZDIAG_NL(JGFL)%LREQOUT ,&
438       & LDERS=LLDERS, LD5=LL5, LDT1=LLT1,LDGPINGP=YEZDIAG_NL(JGFL)%LGPINGP, &
439       & LDTRAJIO=YEZDIAG_NL(JGFL)%LTRAJIO)
440    ENDIF
441  ENDDO
442
443!-- Greenhouse Gases
444  DO JGFL=1,NGHG
445    IF(YGHG_NL(JGFL)%LGP) THEN
446      IF(JGFL == 1) THEN
447        IGFLPTR=YGFL%NUMFLDS+1
448        YGHG=>YGFLC(IGFLPTR:IGFLPTR+NGHG-1)
449      ENDIF
450      CALL DEFINE_GFL_COMP(YDGFLC=YGHG(JGFL),CDNAME=YGHG_NL(JGFL)%CNAME ,&
451       & KGRIB=YGHG_NL(JGFL)%IGRBCODE, LDGP=.TRUE.,  KREQIN=YGHG_NL(JGFL)%NREQIN ,&
452       & PREFVALI=YGHG_NL(JGFL)%REFVALI, LDREQOUT=YGHG_NL(JGFL)%LREQOUT ,&
453       & LDERS=LLDERS, LD5=LL5, LDT1=LLT1,LDGPINGP=YGHG_NL(JGFL)%LGPINGP, &
454       & LDTRAJIO=YGHG_NL(JGFL)%LTRAJIO)
455    ENDIF
456  ENDDO
457
458!--  Diagnostic tracers
459  DO JGFL=1,NTRAC
460    IF(YTRAC_NL(JGFL)%LGP) THEN
461      IF(JGFL == 1) THEN
462        IGFLPTR=YGFL%NUMFLDS+1
463        YTRAC=>YGFLC(IGFLPTR:IGFLPTR+NTRAC-1)
464      ENDIF
465      CALL DEFINE_GFL_COMP(YDGFLC=YTRAC(JGFL),CDNAME=YTRAC_NL(JGFL)%CNAME ,&
466       & KGRIB=YTRAC_NL(JGFL)%IGRBCODE, LDGP=.TRUE.,  KREQIN=YTRAC_NL(JGFL)%NREQIN ,&
467       & PREFVALI=YTRAC_NL(JGFL)%REFVALI, LDREQOUT=YTRAC_NL(JGFL)%LREQOUT ,&
468       & LDERS=LLDERS, LD5=LL5, LDT1=LLT1,LDGPINGP=YTRAC_NL(JGFL)%LGPINGP, &
469       & LDTRAJIO=YTRAC_NL(JGFL)%LTRAJIO)
470    ENDIF
471  ENDDO
472
473!-- Reactive Gases
474  DO JGFL=1,NGRG
475    IF(YGRG_NL(JGFL)%LGP) THEN
476      IF(JGFL == 1) THEN
477        IGFLPTR=YGFL%NUMFLDS+1
478        YGRG=>YGFLC(IGFLPTR:IGFLPTR+NGRG-1)
479      ENDIF
480      CALL DEFINE_GFL_COMP(YDGFLC=YGRG(JGFL),CDNAME=YGRG_NL(JGFL)%CNAME ,&
481       & KGRIB=YGRG_NL(JGFL)%IGRBCODE, LDGP=.TRUE.,  KREQIN=YGRG_NL(JGFL)%NREQIN ,&
482       & PREFVALI=YGRG_NL(JGFL)%REFVALI, LDREQOUT=YGRG_NL(JGFL)%LREQOUT ,&
483       & LDERS=LLDERS, LD5=LL5, LDT1=LLT1,LDGPINGP=YGRG_NL(JGFL)%LGPINGP, &
484       & LDTRAJIO=YGRG_NL(JGFL)%LTRAJIO)
485    ENDIF
486  ENDDO
487   
488!-- Aerosols
489  DO JGFL=1,NAERO
490    IF(YAERO_NL(JGFL)%LGP) THEN
491      IF(JGFL == 1) THEN
492        IGFLPTR=YGFL%NUMFLDS+1
493        YAERO=>YGFLC(IGFLPTR:IGFLPTR+NAERO-1)
494      ENDIF
495      CALL DEFINE_GFL_COMP(YDGFLC=YAERO(JGFL),CDNAME=YAERO_NL(JGFL)%CNAME ,&
496       & KGRIB=YAERO_NL(JGFL)%IGRBCODE, LDGP=.TRUE.,  KREQIN=YAERO_NL(JGFL)%NREQIN ,&
497       & PREFVALI=YAERO_NL(JGFL)%REFVALI, LDREQOUT=YAERO_NL(JGFL)%LREQOUT ,&
498       & LDERS=LLDERS, LD5=LL5, LDT1=LLT1,LDGPINGP=YAERO_NL(JGFL)%LGPINGP, &
499       & LDTRAJIO=YAERO_NL(JGFL)%LTRAJIO)
500    ENDIF
501  ENDDO
502
503!      1.3  Spectral GFL.
504 
505  IF(YQ_NL%LSP) THEN
506    IGFLPTR=YGFL%NUMFLDS+1
507    YQ=>YGFLC(IGFLPTR)
508    CALL DEFINE_GFL_COMP(YDGFLC=YQ ,CDNAME=YFAQ%CLNAME,KGRIB=NGRBQ,&
509     & LDGP=.FALSE.,KREQIN=YQ_NL%NREQIN, &
510     & PREFVALI=YQ_NL%REFVALI, LDREQOUT=YQ_NL%LREQOUT, LDERS=LADER,LD5=LL5, &
511     & LDT1=LLT1,LDTHERMACT=.TRUE.,PR=RV,PRCP=RCPV)
512  ENDIF
513  IF(YL_NL%LSP) THEN
514    IGFLPTR=YGFL%NUMFLDS+1
515    YL=>YGFLC(IGFLPTR)
516    CALL DEFINE_GFL_COMP(YDGFLC=YL ,CDNAME=YFAL%CLNAME,KGRIB=NGRBCLWC,&
517     & LDGP=.FALSE.,KREQIN=YL_NL%NREQIN, &
518     & PREFVALI=YL_NL%REFVALI, LDREQOUT=YL_NL%LREQOUT, LDERS=LADER,LD5=LL5, &
519     & LDT1=LLT1,LDTHERMACT=.TRUE.,PR=0.0_JPRB,PRCP=RCW)
520  ENDIF
521  IF(YI_NL%LSP)THEN
522    IGFLPTR=YGFL%NUMFLDS+1
523    YI=>YGFLC(IGFLPTR)
524    CALL DEFINE_GFL_COMP(YDGFLC=YI ,CDNAME=YFAI%CLNAME,KGRIB=NGRBCIWC,&
525     & LDGP=.FALSE.,KREQIN=YI_NL%NREQIN, &
526     & PREFVALI=YI_NL%REFVALI, LDREQOUT=YI_NL%LREQOUT, LDERS=LADER,LD5=LL5, &
527     & LDT1=LLT1,LDTHERMACT=.TRUE.,PR=0.0_JPRB,PRCP=RCS)
528  ENDIF
529  IF(YS_NL%LSP)THEN
530    CALL ABOR1('SUGFL: spectral snow not coded ')
531  ENDIF
532  IF(YR_NL%LSP)THEN
533    CALL ABOR1('SUGFL: spectral rain not coded ')
534  ENDIF
535  IF(YG_NL%LSP)THEN
536    CALL ABOR1('SUGFL: spectral graupels not coded ')
537  ENDIF
538  IF(YTKE_NL%LSP)THEN
539    CALL ABOR1('SUGFL: spectral TKE not coded ')
540  ENDIF
541  IF(YA_NL%LSP)THEN
542    IGFLPTR=YGFL%NUMFLDS+1
543    YA=>YGFLC(IGFLPTR)
544    CALL DEFINE_GFL_COMP(YDGFLC=YA ,CDNAME=YFACLF%CLNAME,KGRIB=NGRBCC,&
545     & LDGP=.FALSE.,KREQIN=YA_NL%NREQIN, &
546     & PREFVALI=YA_NL%REFVALI, LDREQOUT=YA_NL%LREQOUT, LDERS=LADER,LD5=LL5,&
547     & LDT1=LLT1)
548  ENDIF
549  IF(YO3_NL%LSP)THEN
550    IGFLPTR=YGFL%NUMFLDS+1
551    YO3=>YGFLC(IGFLPTR)
552    CALL DEFINE_GFL_COMP(YDGFLC=YO3,CDNAME=YFAO3%CLNAME,KGRIB=NGRBO3,&
553     & LDGP=.FALSE.,KREQIN=YO3_NL%NREQIN, &
554     & PREFVALI=YO3_NL%REFVALI, LDREQOUT=YO3_NL%LREQOUT, LDERS=LADER,LD5=LL5,&
555     & LDT1=LLT1)
556  ENDIF
557  IF(YCPF_NL%LSP)THEN
558    IGFLPTR=YGFL%NUMFLDS+1
559    YCPF=>YGFLC(IGFLPTR)
560    CALL DEFINE_GFL_COMP(YDGFLC=YCPF,CDNAME=YFACPF%CLNAME,&
561     & KGRIB=YCPF_NL%IGRBCODE, LDGP=.FALSE., &
562     & KREQIN=YCPF_NL%NREQIN,PREFVALI=YCPF_NL%REFVALI,LDREQOUT=YCPF_NL%LREQOUT,&
563     & LDERS=.FALSE.,LD5=.FALSE., &
564     & LDT1=LLT1)
565  ENDIF
566  IF(YSPF_NL%LSP)THEN
567    IGFLPTR=YGFL%NUMFLDS+1
568    YSPF=>YGFLC(IGFLPTR)
569    CALL DEFINE_GFL_COMP(YDGFLC=YSPF,CDNAME=YFASPF%CLNAME,&
570     & KGRIB=YSPF_NL%IGRBCODE,LDGP= .FALSE., &
571     & KREQIN=YSPF_NL%NREQIN,PREFVALI=YSPF_NL%REFVALI,LDREQOUT=YSPF_NL%LREQOUT,&
572     & LDERS=.FALSE.,LD5=.FALSE., &
573     & LDT1=LLT1)
574  ENDIF
575  IF(YSRC_NL%LSP)THEN
576    CALL ABOR1('SUGFL: spectral SRC not coded ')
577  ENDIF
578  IF(YCVGQ_NL%LSP)THEN
579    IGFLPTR=YGFL%NUMFLDS+1
580    YCVGQ=>YGFLC(IGFLPTR)
581    CALL DEFINE_GFL_COMP(YDGFLC=YCVGQ,CDNAME=YFACVGQ%CLNAME,&
582     & KGRIB=YCVGQ_NL%IGRBCODE,LDGP= .FALSE., &
583     & KREQIN=YCVGQ_NL%NREQIN,PREFVALI=YCVGQ_NL%REFVALI,&
584     & LDREQOUT=YCVGQ_NL%LREQOUT,LDERS= .TRUE.,LD5=.FALSE., &
585     & LDT1=LLT1)
586  ENDIF
587  IF(YSDSAT_NL%LSP)THEN
588    CALL ABOR1('SUGFL: spectral SDSAT not coded ')
589  ENDIF
590  IF(YCVV_NL%LSP)THEN
591    CALL ABOR1('SUGFL: spectral CVV not coded ')
592  ENDIF
593  IF(YQVA_NL%LSP) THEN
594    IGFLPTR=YGFL%NUMFLDS+1
595    YQVA=>YGFLC(IGFLPTR)
596    CALL DEFINE_GFL_COMP(YDGFLC=YQVA,CDNAME=YFAQVA%CLNAME,&
597     & KGRIB=YQVA_NL%IGRBCODE, LDGP=.FALSE., &
598     & KREQIN=YQVA_NL%NREQIN,PREFVALI=YQVA_NL%REFVALI,LDREQOUT=YQVA_NL%LREQOUT,&
599     & LDERS=.FALSE.,LD5=.FALSE., &
600     & LDT1=LLT1)
601  ENDIF
602  IF(YUOM_NL%LSP)THEN
603    CALL ABOR1('SUGFL: spectral UOM not coded ')
604    ! ----------------------------------------------------------------------
605    ! what is below must be checked when UOM will be coded!
606    IGFLPTR=YGFL%NUMFLDS+1
607    YUOM=>YGFLC(IGFLPTR)
608    CALL DEFINE_GFL_COMP(YDGFLC=YUOM,CDNAME=YFAUOM%CLNAME,&
609     & KGRIB=YUOM_NL%IGRBCODE,LDGP=.FALSE., &
610     & KREQIN=YUOM_NL%NREQIN,&
611     & PREFVALI=YUOM_NL%REFVALI,LDREQOUT=YUOM_NL%LREQOUT,&
612     & LDERS=.FALSE.,LD5=.FALSE.,LDT1=LLT1)
613    ! ----------------------------------------------------------------------
614  ENDIF
615  IF(YUAL_NL%LSP)THEN
616    CALL ABOR1('SUGFL: spectral UAL not coded ')
617    ! ----------------------------------------------------------------------
618    ! what is below must be checked when UAL will be coded!
619    IGFLPTR=YGFL%NUMFLDS+1
620    YUAL=>YGFLC(IGFLPTR)
621    CALL DEFINE_GFL_COMP(YDGFLC=YUAL,CDNAME=YFAUAL%CLNAME,&
622     & KGRIB=YUAL_NL%IGRBCODE,LDGP=.FALSE., &
623     & KREQIN=YUAL_NL%NREQIN,&
624     & PREFVALI=YUAL_NL%REFVALI,LDREQOUT=YUAL_NL%LREQOUT,&
625     & LDERS=.FALSE.,LD5=.FALSE.,LDT1=LLT1)
626    ! ----------------------------------------------------------------------
627  ENDIF
628  IF(YDOM_NL%LSP)THEN
629    CALL ABOR1('SUGFL: spectral DOM not coded ')
630    ! ----------------------------------------------------------------------
631    ! what is below must be checked when DOM will be coded!
632    IGFLPTR=YGFL%NUMFLDS+1
633    YDOM=>YGFLC(IGFLPTR)
634    CALL DEFINE_GFL_COMP(YDGFLC=YDOM,CDNAME=YFADOM%CLNAME,&
635     & KGRIB=YDOM_NL%IGRBCODE,LDGP=.FALSE., &
636     & KREQIN=YDOM_NL%NREQIN,&
637     & PREFVALI=YDOM_NL%REFVALI,LDREQOUT=YDOM_NL%LREQOUT,&
638     & LDERS=.FALSE.,LD5=.FALSE.,LDT1=LLT1)
639    ! ----------------------------------------------------------------------
640  ENDIF
641  IF(YDAL_NL%LSP)THEN
642    CALL ABOR1('SUGFL: spectral DAL not coded ')
643    ! ----------------------------------------------------------------------
644    ! what is below must be checked when DAL will be coded!
645    IGFLPTR=YGFL%NUMFLDS+1
646    YDAL=>YGFLC(IGFLPTR)
647    CALL DEFINE_GFL_COMP(YDGFLC=YDAL,CDNAME=YFADAL%CLNAME,&
648     & KGRIB=YDAL_NL%IGRBCODE,LDGP=.FALSE., &
649     & KREQIN=YDAL_NL%NREQIN,&
650     & PREFVALI=YDAL_NL%REFVALI,LDREQOUT=YDOM_NL%LREQOUT,&
651     & LDERS=.FALSE.,LD5=.FALSE.,LDT1=LLT1)
652    ! ----------------------------------------------------------------------
653  ENDIF
654  IF(YUEN_NL%LSP)THEN
655    CALL ABOR1('SUGFL: spectral UEN not coded ')
656    ! ----------------------------------------------------------------------
657    ! what is below must be checked when UEN will be coded!
658    IGFLPTR=YGFL%NUMFLDS+1
659    YUEN=>YGFLC(IGFLPTR)
660    CALL DEFINE_GFL_COMP(YDGFLC=YUEN,CDNAME=YFAUEN%CLNAME,&
661     & KGRIB=YUEN_NL%IGRBCODE,LDGP=.FALSE., &
662     & KREQIN=YUEN_NL%NREQIN,&
663     & PREFVALI=YUEN_NL%REFVALI,LDREQOUT=YUEN_NL%LREQOUT,&
664     & LDERS=.FALSE.,LD5=.FALSE.,LDT1=LLT1)
665    ! ----------------------------------------------------------------------
666  ENDIF
667  IF(YUNEBH_NL%LSP)THEN
668    CALL ABOR1('SUGFL: spectral UNEBH not coded ')
669    ! ----------------------------------------------------------------------
670    ! what is below must be checked when UNEBH will be coded!
671    IGFLPTR=YGFL%NUMFLDS+1
672    YUNEBH=>YGFLC(IGFLPTR)
673    CALL DEFINE_GFL_COMP(YDGFLC=YUNEBH,CDNAME=YFAUNEBH%CLNAME,&
674     & KGRIB=YUNEBH_NL%IGRBCODE,LDGP=.FALSE., &
675     & KREQIN=YUNEBH_NL%NREQIN,&
676     & PREFVALI=YUNEBH_NL%REFVALI,LDREQOUT=YUNEBH_NL%LREQOUT,&
677     & LDERS=.FALSE.,LD5=.FALSE.,LDT1=LLT1)
678    ! ----------------------------------------------------------------------
679  ENDIF
680
681  ! Extra GFL variables (assumed to be all spectral in this piece of code)
682  DO JGFL=1,NGFL_EXT
683    IF(YEXT_NL(JGFL)%LSP) THEN
684      IF(JGFL == 1) THEN
685        IGFLPTR=YGFL%NUMFLDS+1
686        YEXT=>YGFLC(IGFLPTR:IGFLPTR+NGFL_EXT-1)
687      ENDIF
688      CALL DEFINE_GFL_COMP(YDGFLC=YEXT(JGFL),CDNAME=YEXT_NL(JGFL)%CNAME ,&
689       & KGRIB=YEXT_NL(JGFL)%IGRBCODE,LDGP=.FALSE.,KREQIN=YEXT_NL(JGFL)%NREQIN,&
690       & PREFVALI=YEXT_NL(JGFL)%REFVALI, LDREQOUT=YEXT_NL(JGFL)%LREQOUT ,&
691       & LDERS=LADER, LD5=LL5, LDT1=LLT1)
692    ENDIF
693  ENDDO
694
695  ! Forcings
696  DO JGFL=1,NGFL_FORC
697    IF(YFORC_NL(JGFL)%LSP) THEN
698      CALL ABOR1('SUGFL: FORCINGS HAVE TO BE GRIDPOINT FIELDS')
699      ! ----------------------------------------------------------------------
700      ! what is below must be checked when spectral forcings will be coded!
701      IF(JGFL == 1) THEN
702        IGFLPTR=YGFL%NUMFLDS+1
703        YFORC=>YGFLC(IGFLPTR:IGFLPTR+NGFL_FORC-1)
704      ENDIF
705      CALL DEFINE_GFL_COMP(YDGFLC=YFORC(JGFL),CDNAME=YFORC_NL(JGFL)%CNAME,&
706       & KGRIB=YFORC_NL(JGFL)%IGRBCODE,LDGP=.FALSE.,KREQIN=YFORC_NL(JGFL)%NREQIN,&
707       & PREFVALI=YFORC_NL(JGFL)%REFVALI, LDREQOUT=YFORC_NL(JGFL)%LREQOUT, &
708       & LDERS=.FALSE.,LD5=.FALSE.,LDT1=.FALSE.)
709      ! ----------------------------------------------------------------------
710    ENDIF
711  ENDDO
712
713  ! Easy diagnostics
714  DO JGFL=1,NGFL_EZDIAG
715    IF(YEZDIAG_NL(JGFL)%LSP) THEN
716      CALL ABOR1('SUGFL: EZDIAG HAVE TO BE GRIDPOINT FIELDS')
717      ! ----------------------------------------------------------------------
718      ! what is below must be checked when spectral easy diag. will be coded!
719      IF(JGFL == 1) THEN
720        IGFLPTR=YGFL%NUMFLDS+1
721        YEZDIAG=>YGFLC(IGFLPTR:IGFLPTR+NGFL_EZDIAG-1)
722      ENDIF
723      CALL DEFINE_GFL_COMP(YDGFLC=YEZDIAG(JGFL),CDNAME=YEZDIAG_NL(JGFL)%CNAME,&
724       & KGRIB=YEZDIAG_NL(JGFL)%IGRBCODE,LDGP=.FALSE.,&
725       & KREQIN=YEZDIAG_NL(JGFL)%NREQIN,&
726       & PREFVALI=YEZDIAG_NL(JGFL)%REFVALI, LDREQOUT=YEZDIAG_NL(JGFL)%LREQOUT, &
727       & LDERS=.FALSE.,LD5=.FALSE.,LDT1=.FALSE.)
728      ! ----------------------------------------------------------------------
729    ENDIF
730  ENDDO
731
732!Greenhouse Gases
733  DO JGFL=1,NGHG
734    IF(YGHG_NL(JGFL)%LSP) THEN
735      IF(JGFL == 1) THEN
736        IGFLPTR=YGFL%NUMFLDS+1
737        YGHG=>YGFLC(IGFLPTR:IGFLPTR+NGHG-1)
738      ENDIF
739      CALL DEFINE_GFL_COMP(YDGFLC=YGHG(JGFL),CDNAME=YGHG_NL(JGFL)%CNAME ,&
740       & KGRIB=YGHG_NL(JGFL)%IGRBCODE, LDGP=.FALSE.,  KREQIN=YGHG_NL(JGFL)%NREQIN ,&
741       & PREFVALI=YGHG_NL(JGFL)%REFVALI, LDREQOUT=YGHG_NL(JGFL)%LREQOUT ,&
742       & LDERS=LADER, LD5=LL5, LDT1=LLT1)
743    ENDIF
744  ENDDO
745
746!Diagnostic tracers
747  DO JGFL=1,NTRAC
748    IF(YTRAC_NL(JGFL)%LSP) THEN
749      IF(JGFL == 1) THEN
750        IGFLPTR=YGFL%NUMFLDS+1
751        YTRAC=>YGFLC(IGFLPTR:IGFLPTR+NTRAC-1)
752      ENDIF
753      CALL DEFINE_GFL_COMP(YDGFLC=YTRAC(JGFL),CDNAME=YTRAC_NL(JGFL)%CNAME ,&
754       & KGRIB=YTRAC_NL(JGFL)%IGRBCODE, LDGP=.FALSE.,  KREQIN=YTRAC_NL(JGFL)%NREQIN ,&
755       & PREFVALI=YTRAC_NL(JGFL)%REFVALI, LDREQOUT=YTRAC_NL(JGFL)%LREQOUT ,&
756       & LDERS=LADER, LD5=LL5, LDT1=LLT1)
757    ENDIF
758  ENDDO
759
760!Reactive Gases
761  DO JGFL=1,NGRG
762    IF(YGRG_NL(JGFL)%LSP) THEN
763      IF(JGFL == 1) THEN
764        IGFLPTR=YGFL%NUMFLDS+1
765        YGRG=>YGFLC(IGFLPTR:IGFLPTR+NGRG-1)
766      ENDIF
767      CALL DEFINE_GFL_COMP(YDGFLC=YGRG(JGFL),CDNAME=YGRG_NL(JGFL)%CNAME ,&
768       & KGRIB=YGRG_NL(JGFL)%IGRBCODE, LDGP=.FALSE.,  KREQIN=YGRG_NL(JGFL)%NREQIN ,&
769       & PREFVALI=YGRG_NL(JGFL)%REFVALI, LDREQOUT=YGRG_NL(JGFL)%LREQOUT ,&
770       & LDERS=LADER, LD5=LL5, LDT1=LLT1)
771    ENDIF
772  ENDDO
773
774!Aerosols
775  DO JGFL=1,NAERO
776    IF(YAERO_NL(JGFL)%LSP) THEN
777      IF(JGFL == 1) THEN
778        IGFLPTR=YGFL%NUMFLDS+1
779        YAERO=>YGFLC(IGFLPTR:IGFLPTR+NAERO-1)
780      ENDIF
781      CALL DEFINE_GFL_COMP(YDGFLC=YAERO(JGFL),CDNAME=YAERO_NL(JGFL)%CNAME ,&
782       & KGRIB=YAERO_NL(JGFL)%IGRBCODE, LDGP=.FALSE.,  KREQIN=YAERO_NL(JGFL)%NREQIN ,&
783       & PREFVALI=YAERO_NL(JGFL)%REFVALI, LDREQOUT=YAERO_NL(JGFL)%LREQOUT ,&
784       & LDERS=LADER, LD5=LL5, LDT1=LLT1)
785    ENDIF
786  ENDDO
787
788ELSE
789
790!      2.   CASE LFPART2=T
791
792  WRITE(NULOUT,*) ' SUGFL, LFPART2, YGFL%NUMFLDS=',YGFL%NUMFLDS
793ENDIF
794
795!-------------------------------------------------------------------------
796
797IF (LHOOK) CALL DR_HOOK('SUGFL',1,ZHOOK_HANDLE)
798END SUBROUTINE SUGFL
Note: See TracBrowser for help on using the repository browser.