LMDZ
suecradi15.F90
Go to the documentation of this file.
1 !OPTIONS XOPT(NOEVAL)
2 SUBROUTINE suecradi15
3 
4 !**** *SUECRADI15* - INITIALIZE DATA STRUCTURES FOR RADIATION INTERPOL.
5 !**** FROZEN VERSION (CYCLE 15) OF SUECRADI
6 
7 ! PURPOSE.
8 ! --------
9 ! INITIALIZE DATA STRUCTURES FOR RADIATION INTERPOLATION
10 
11 !** INTERFACE.
12 ! ----------
13 ! CALL *SUECRADI15* FROM *SUECRAD15*
14 ! ---------- ---------
15 
16 ! EXPLICIT ARGUMENTS :
17 ! --------------------
18 ! NONE
19 
20 ! IMPLICIT ARGUMENTS :
21 ! --------------------
22 
23 ! METHOD.
24 ! -------
25 ! SEE DOCUMENTATION
26 
27 ! EXTERNALS.
28 ! ----------
29 ! NONE
30 
31 ! REFERENCE.
32 ! ----------
33 ! ECMWF Research Department documentation of the IFS
34 
35 ! AUTHOR.
36 ! -------
37 ! 96-11: Ph. Dandin. Meteo-France
38 ! ORIGINAL BY GEORGE MOZDZYNSKI 95-03-13
39 
40 ! MODIFICATIONS.
41 ! --------------
42 ! M.Hamrud 01-Oct-2003 CY28 Cleaning
43 
44 ! ------------------------------------------------------------------
45 
46 USE parkind1 ,ONLY : jpim ,jprb
47 USE yomhook ,ONLY : lhook, dr_hook
48 
49 USE parrint , ONLY : jpradcw ,jpradce
50 USE yomdim , ONLY : ndgsag ,ndgsal ,ndgeng ,ndgenl ,ndlon
51 USE yomct0 , ONLY : n_regions_ns ,n_regions_ew
52 USE yomlun , ONLY : nulout
53 USE yomgem , ONLY : nloen ,nloeng
54 USE yomrad15 , ONLY : naer15 ,nflux15 ,nmode15 ,nrad15 ,&
58 USE yommp , ONLY : lsplit ,my_region_ns ,my_region_ew ,nsta ,&
60  & lsplitlat
65 
66 IMPLICIT NONE
67 
68 #include "namrad15.h"
69 
70 INTEGER(KIND=JPIM) :: ILWA (2*n_regions_ew)
71 INTEGER(KIND=JPIM) :: ILWB (2*n_regions_ew)
72 INTEGER(KIND=JPIM) :: ILWBI(2*n_regions_ew)
73 INTEGER(KIND=JPIM) :: ILEA (2*n_regions_ew)
74 INTEGER(KIND=JPIM) :: ILEB (2*n_regions_ew)
75 INTEGER(KIND=JPIM) :: ILEBI(2*n_regions_ew)
76 INTEGER(KIND=JPIM) :: ISTA(ndgenl,2*n_regions_ew)
77 INTEGER(KIND=JPIM) :: IONL(ndgenl,2*n_regions_ew)
78 CHARACTER (LEN = 14) :: CLDBG
79 
80 INTEGER(KIND=JPIM) :: IAO, IAOFF, IB, IB1, IB2, IB3, IB4, IB5,&
81  & IB6, ICNEED, ICTAKE, IGL, IJBXBOFF, IJBXSETA, &
82  & ILE, ILEN, ILONS, ILW, IMAX, IMAXC, IMAXT, &
83  & IOTHBOFF, IOTHSETA, IPROCB, IRINT, IUNIT, &
84  & JA, JB, JBE, JBW, JBX, JF, JGL, JGLGLO, JL
85 
86 LOGICAL :: LLMESS, LLMYSETAISWEST
87 REAL(KIND=JPRB) :: ZHOOK_HANDLE
88 
89 #include "abor1.intfb.h"
90 
91 ! ----------------------------------------------------------------
92 
93 IF (lhook) CALL dr_hook('SUECRADI15',0,zhook_handle)
94 llmess=.false.
95 iunit=0
96 ALLOCATE(nrirint(ndgsag:ndgeng))
97 WRITE(nulout,9990) 'NRIRINT ',SIZE(nrirint),shape(nrirint)
98 ALLOCATE(nrimax(ndgsag:ndgeng,2*n_regions_ew))
99 WRITE(nulout,9990) 'NRIMAX',SIZE(nrimax),shape(nrimax)
100 IF( llmess )THEN
101  ALLOCATE(nrfrstoff(ndgsag:ndgeng,2*n_regions_ew))
102  WRITE(nulout,9990) 'NRFRSTOFF',SIZE(nrfrstoff),shape(nrfrstoff)
103  ALLOCATE(nrlastoff(ndgsag:ndgeng,2*n_regions_ew))
104  WRITE(nulout,9990) 'NRLASTOFF',SIZE(nrlastoff),shape(nrlastoff)
105  ALLOCATE(nrimax(ndgsag:ndgeng,2*n_regions_ew))
106  WRITE(nulout,9990) 'NRIMAX',SIZE(nrimax),shape(nrimax)
107  ALLOCATE(nrcneedw(ndgsag:ndgeng,2*n_regions_ew))
108  WRITE(nulout,9990) 'NRCNEEDW',SIZE(nrcneedw),shape(nrcneedw)
109  ALLOCATE(nrcneede(ndgsag:ndgeng,2*n_regions_ew))
110  WRITE(nulout,9990) 'NRCNEEDE',SIZE(nrcneede),shape(nrcneede)
111  ALLOCATE(nrcsndw(ndgsag:ndgeng,n_regions_ew,-1:1))
112  WRITE(nulout,9990) 'NRCSNDW',SIZE(nrcsndw),shape(nrcsndw)
113  ALLOCATE(nrcsnde(ndgsag:ndgeng,n_regions_ew,-1:1))
114  WRITE(nulout,9990) 'NRCSNDE',SIZE(nrcsnde),shape(nrcsnde)
115  ALLOCATE(nrcrcvw(ndgsag:ndgeng,n_regions_ew,-1:1))
116  WRITE(nulout,9990) 'NRCRCVW',SIZE(nrcrcvw),shape(nrcrcvw)
117  ALLOCATE(nrcrcve(ndgsag:ndgeng,n_regions_ew,-1:1))
118  WRITE(nulout,9990) 'NRCRCVE',SIZE(nrcrcve),shape(nrcrcve)
119  ALLOCATE(nrcsndt(n_regions_ew,-1:1))
120  WRITE(nulout,9990) 'NRCSNDT',SIZE(nrcsndt),shape(nrcsndt)
121  ALLOCATE(nrcrcvt(n_regions_ew,-1:1))
122  WRITE(nulout,9990) 'NRCRCVT',SIZE(nrcrcvt),shape(nrcrcvt)
123  ALLOCATE(nrcrcvwo(ndgsag:ndgeng,n_regions_ew,-1:1))
124  WRITE(nulout,9990) 'NRCRCVWO',SIZE(nrcrcvwo),shape(nrcrcvwo)
125  ALLOCATE(nrcrcveo(ndgsag:ndgeng,n_regions_ew,-1:1))
126  WRITE(nulout,9990) 'NRCRCVEO',SIZE(nrcrcveo),shape(nrcrcveo)
127 ENDIF
128 9990 FORMAT(1x,'ARRAY ',a10,' ALLOCATED ',8i8)
129 
130 IF( llmess )THEN
131 
132  IF( nrint15 > 1.AND. (nradf2c15 == 1.OR. nradc2f15 == 1))THEN
133  IF( lsplit .AND. n_regions_ns > 1 )THEN
134  WRITE(nulout,'("SUECRAD: FFT INTERPOLATION UNSUPPORTED",&
135  & " WITH LSPLIT")')
136  CALL abor1('FFT INTERPOLATION UNSUPPORTED WITH LSPLIT')
137  ENDIF
138  IF( n_regions_ew > 1 )THEN
139  WRITE(nulout,'("SUECRAD: FFT INTERPOLATION UNSUPPORTED",&
140  & " WITH N_REGIONS_EW > 1")')
141  CALL abor1('FFT INTERPOLATION UNSUPPORTED WITH N_REGIONS_EW > 1')
142  ENDIF
143  ENDIF
144 
145 ! INITIALISE GENERAL DATA STRUCTURES REQUIRED FOR RAD. INTERPOLATION
146 
147  DO jgl=ndgsag,ndgeng
148  nrirint(jgl)=0
149  ENDDO
150  DO jb=1,2*n_regions_ew
151  DO jgl=ndgsag,ndgeng
152  nrfrstoff(jgl,jb)=0
153  nrlastoff(jgl,jb)=0
154  nrimax(jgl,jb)=0
155  nrcneedw(jgl,jb)=0
156  nrcneede(jgl,jb)=0
157  ENDDO
158  ENDDO
159  nrimaxt=0
160  DO ja=-1,1
161  DO jb=1,n_regions_ew
162  DO jgl=ndgsag,ndgeng
163  nrcsndw(jgl,jb,ja)=0
164  nrcsnde(jgl,jb,ja)=0
165  nrcrcvw(jgl,jb,ja)=0
166  nrcrcve(jgl,jb,ja)=0
167  nrcrcvwo(jgl,jb,ja)=0
168  nrcrcveo(jgl,jb,ja)=0
169  ENDDO
170  ENDDO
171  ENDDO
172  DO ja=-1,1
173  DO jb=1,n_regions_ew
174  nrcsndt(jb,ja)=0
175  nrcrcvt(jb,ja)=0
176  ENDDO
177  ENDDO
178 
179  DO jb=1,2*n_regions_ew
180  DO jgl=1,ndgenl
181  ista(jgl,jb)=0
182  ionl(jgl,jb)=0
183  ENDDO
184  ENDDO
185  DO jb=1,n_regions_ew
186  DO jgl=1,ndgenl
187  igl=nptrfrstlat(my_region_ns)-1+jgl
188  ista(jgl,jb)=nsta(igl,jb)
189  ionl(jgl,jb)=nonl(igl,jb)
190  ENDDO
191  ENDDO
192  IF( lsplitlat(nfrstlat(my_region_ns)) )THEN
193  llmysetaiswest=.false.
194  DO jb=1,n_regions_ew
195  IF( nsta(nptrfrstlat(my_region_ns),jb) == 1 )THEN
196  llmysetaiswest=.true.
197  ENDIF
198  ENDDO
199  IF( llmysetaiswest )THEN
200  DO jb=1,n_regions_ew
202  ista(1,jb+n_regions_ew)=nsta(igl,jb)
203  ionl(1,jb+n_regions_ew)=nonl(igl,jb)
204  ENDDO
205  ELSE
206  DO jb=1,n_regions_ew
208  ista(1,jb+n_regions_ew)=nsta(igl,jb)
209  ionl(1,jb+n_regions_ew)=nonl(igl,jb)
210  ENDDO
211  ENDIF
212  ENDIF
213  IF( lsplitlat(nlstlat(my_region_ns)) )THEN
214  llmysetaiswest=.false.
215  DO jb=1,n_regions_ew
216  IF( nsta(nptrlstlat(my_region_ns),jb) == 1 )THEN
217  llmysetaiswest=.true.
218  ENDIF
219  ENDDO
220  IF( llmysetaiswest )THEN
221  DO jb=1,n_regions_ew
223  ista(ndgenl,jb+n_regions_ew)=nsta(igl,jb)
224  ionl(ndgenl,jb+n_regions_ew)=nonl(igl,jb)
225  ENDDO
226  ELSE
227  DO jb=1,n_regions_ew
229  ista(ndgenl,jb+n_regions_ew)=nsta(igl,jb)
230  ionl(ndgenl,jb+n_regions_ew)=nonl(igl,jb)
231  ENDDO
232  ENDIF
233  ENDIF
234 
235 ELSE
236 
237  ilen=ndgeng-ndgsag+1
238  DO jgl=ndgsag,ndgeng
239  nrirint(jgl)=0
240  nrimax(jgl,1)=0
241  ENDDO
242 
243 ENDIF
244 
245 imaxc=ndlon/nrint15+6
246 imaxc=imaxc+(1-mod(imaxc,2))
247 
248 IF( llmess )THEN
249  IF( lodbgradi )THEN
250  iunit=10
251  WRITE(cldbg,'("debug_a",I3.3,"b",I3.3)')my_region_ns,my_region_ew
252  OPEN(unit=iunit,file=cldbg)
253  WRITE(iunit,'("SUECRADI: MY_REGION_NS=",I4," MY_REGION_EW=",I4)')my_region_ns,my_region_ew
254  WRITE(iunit,'("SUECRADI: NDGSAL=",I4," NDGENL=",I4)') ndgsal,ndgenl
255  WRITE(iunit,'("SUECRADI: ")')
256  ENDIF
257 ENDIF
258 
259 ! LOOP OVER OUR PARTITION LATITUDES, TO INITIALISE SIMPLE ITEMS
260 
261 IF( llmess )THEN
262 
263  imaxt=0
264 
265  DO jgl=1,ndgenl
266 
267  jglglo=nfrstlat(my_region_ns)+jgl-1
268  ilons=nloeng(jglglo)
269 
270  irint=1
271  DO jf=1,nrint15
272  IF( mod(ilons,jf) == 0.AND.ilons/jf <= imaxc )THEN
273  irint=jf
274  GO TO 220
275  ENDIF
276  ENDDO
277  220 CONTINUE
278  nrirint(jgl)=irint
279 
280  IF( lodbgradi )THEN
281  WRITE(iunit,'("SUECRADI: JGLGLO=",I4," JGL=",I4,&
282  & " NLOENG=",I4," NRIRINT=",I1," LSPLITLAT=",L2)')&
283  & jglglo,jgl,nloeng(jglglo),nrirint(jgl),lsplitlat(jglglo)
284  ENDIF
285 
286  IF( lsplitlat(jglglo) )THEN
287  iprocb=2*n_regions_ew
288  ELSE
289  iprocb=n_regions_ew
290  ENDIF
291 
292  DO jb=1,iprocb
293  IF( ionl(jgl,jb) == 0 ) GOTO 250
294  nrfrstoff(jgl,jb)=mod(irint-mod(ista(jgl,jb)-1,irint),irint)
295  nrlastoff(jgl,jb)=&
296  & mod(irint-mod(ista(jgl,jb)+ionl(jgl,jb)-2,irint),&
297  & irint)
298  imax=0
299  DO jl=1+nrfrstoff(jgl,jb),ionl(jgl,jb),irint
300  imax=imax+1
301  ENDDO
302  nrimax(jgl,jb)=imax
303  IF( nrfrstoff(jgl,jb) == 0 )THEN
304  nrcneedw(jgl,jb)=jpradcw-1
305  ELSE
306  nrcneedw(jgl,jb)=jpradcw
307  ENDIF
308  IF( nrlastoff(jgl,jb) == 0 )THEN
309  nrcneede(jgl,jb)=jpradce-1
310  ELSE
311  nrcneede(jgl,jb)=jpradce
312  ENDIF
313  IF( lodbgradi )THEN
314  WRITE(iunit,'("SUECRADI: JB=",I4," ISTA=",I4,&
315  & " IONL=",I4," NRFRSTOFF=",I1," NRIMAX=",I3,&
316  & " NRLASTOFF=",I1," CNEEDW=",I1," CNEEDE=",I1)')&
317  & jb,ista(jgl,jb),ionl(jgl,jb),nrfrstoff(jgl,jb),&
318  & nrimax(jgl,jb),nrlastoff(jgl,jb),&
319  & nrcneedw(jgl,jb),nrcneede(jgl,jb)
320  ENDIF
321  250 continue
322  ENDDO
323 
324  IF( lodbgradi )THEN
325  WRITE(iunit,'("SUECRADI: ")')
326  ENDIF
327 
328  imaxt=imaxt+nrimax(jgl,my_region_ew)
329 
330  ENDDO
331 
332  nrimaxt=imaxt
333  IF( lodbgradi )THEN
334  WRITE(iunit,'("SUECRADI: NRIMAXT=",I6)') nrimaxt
335  ENDIF
336 
337 ELSE
338 
339  DO jgl=ndgsag,ndgeng
340 
341  ilons=nloen(jgl)
342 
343  irint=1
344  DO jf=1,nrint15
345  IF( mod(ilons,jf) == 0.AND.ilons/jf <= imaxc )THEN
346  irint=jf
347  GO TO 221
348  ENDIF
349  ENDDO
350  221 CONTINUE
351 
352  nrirint(jgl)=irint
353  nrimax(jgl,1)=ilons/irint
354 
355  ENDDO
356 
357 ENDIF
358 
359 IF( llmess )THEN
360 
361 ! NOW LOOP OVER OUR PARTITION LATITUDES, TO DETERMINE SEND AND RECEIVE
362 ! INFORMATION
363 
364  DO jgl=1,ndgenl
365 
366 ! TEST IF WE HAVE ANY FINE POINTS
367 ! IF WE HAVEN'T, THEN WE DON'T HAVE TO SEND OR RECEIVE ANYTHING
368 
369  IF( ionl(jgl,my_region_ew) == 0 ) GOTO 700
370  jglglo=nfrstlat(my_region_ns)+jgl-1
371 
372 ! TEST IF CURRENT LATITUDE IS SPLIT ACROSS SET A's
373 ! TO SET IPROCB TO THE MAXIMUM NUMBER OF SETB's WE MUST CONSIDER IN
374 ! THE FOLLOWING CODE FOR THIS LATITUDE
375 
376  IF( lsplitlat(jglglo) )THEN
377  iprocb=2*n_regions_ew
378  ELSE
379  iprocb=n_regions_ew
380  ENDIF
381 
382 ! NOW CONSIDER EACH PARTITION (ON THIS LATITUDE) IN TURN TO SEE WHO
383 ! WILL BE SENDING TO AND RECEIVING FROM IT, AND OBVIOUSLY NOTING
384 ! PERTINENT INFO IF OUR PARTITION IS SENDING OR RECEIVING
385 
386  DO jbx=1,iprocb
387 
388 ! LET'S START BY BUILDING UP A LIST OF WESTERLY AND EASTERLY PARTITIONS
389 ! CONTAINING ONE OR MORE FINE POINTS, SO THAT WE CAN SUBSEQUENTLY IGNORE
390 ! ISSUES ABOUT WHETHER THIS IS A SPLIT LATITUDE AND THAT THE EARTH IS
391 ! ROUND. ALSO THE PARTITION BEING CONSIDERED (JBX) ALWAYS APPEARS AT THE
392 ! END OF EACH OF THESE LISTS, BECAUSE JBX MAY NEED TO 'LOGICALLY'
393 ! SEND/RECEIVE COURSE POINTS TO/FROM ITS OWN PARTITION FOR THIS LATITUDE
394 
395  ilw=0
396  ile=0
397  IF( lsplitlat(jglglo) )THEN
398 
399 ! DETERMINE WHETHER THE SET A SHARING THIS LATITUDE IS (ABOVE,LEFT) OR
400 ! (BELOW,RIGHT). WE DETERMINE THIS BY TESTING IF ANY SETB ON THIS
401 ! LATITUDE
402 ! STARTS AT 1.
403 
404  iaoff=-1
405  DO jb=1,n_regions_ew
406  IF( ista(jgl,jb) == 1 )THEN
407  iaoff=1
408  GOTO 411
409  ENDIF
410  ENDDO
411  411 CONTINUE
412  IF( jbx <= n_regions_ew )THEN
413  ijbxseta=my_region_ns
414  iothseta=my_region_ns+iaoff
415  ijbxboff=0
416  iothboff=n_regions_ew
417  ELSE
418  ijbxseta=my_region_ns+iaoff
419  iothseta=my_region_ns
420  ijbxboff=n_regions_ew
421  iothboff=0
422  ENDIF
423 ! INITIALISE WEST LIST, SPLIT LAT
424  IF( jbx <= n_regions_ew )THEN
425  ib1=jbx-1
426  ib2=1
427  ib3=2*n_regions_ew
428  ib4=n_regions_ew+1
429  ib5=n_regions_ew
430  ib6=jbx
431  ELSE
432  ib1=jbx-1
433  ib2=n_regions_ew+1
434  ib3=n_regions_ew
435  ib4=1
436  ib5=2*n_regions_ew
437  ib6=jbx
438  ENDIF
439  DO jb=ib1,ib2,-1
440  IF( ionl(jgl,jb) > 0 )THEN
441  ilw=ilw+1
442  ilwa(ilw)=ijbxseta
443  ilwb(ilw)=jb-ijbxboff
444  ilwbi(ilw)=jb
445  ENDIF
446  ENDDO
447  DO jb=ib3,ib4,-1
448  IF( ionl(jgl,jb) > 0 )THEN
449  ilw=ilw+1
450  ilwa(ilw)=iothseta
451  ilwb(ilw)=jb-iothboff
452  ilwbi(ilw)=jb
453  ENDIF
454  ENDDO
455  DO jb=ib5,ib6,-1
456  IF( ionl(jgl,jb) > 0 )THEN
457  ilw=ilw+1
458  ilwa(ilw)=ijbxseta
459  ilwb(ilw)=jb-ijbxboff
460  ilwbi(ilw)=jb
461  ENDIF
462  ENDDO
463 ! INITIALISE EAST LIST, SPLIT LAT
464  IF( jbx <= n_regions_ew )THEN
465  ib1=jbx+1
466  ib2=n_regions_ew
467  ib3=n_regions_ew+1
468  ib4=2*n_regions_ew
469  ib5=1
470  ib6=jbx
471  ELSE
472  ib1=jbx+1
473  ib2=2*n_regions_ew
474  ib3=1
475  ib4=n_regions_ew
476  ib5=n_regions_ew+1
477  ib6=jbx
478  ENDIF
479  DO jb=ib1,ib2
480  IF( ionl(jgl,jb) > 0 )THEN
481  ile=ile+1
482  ilea(ile)=ijbxseta
483  ileb(ile)=jb-ijbxboff
484  ilebi(ile)=jb
485  ENDIF
486  ENDDO
487  DO jb=ib3,ib4
488  IF( ionl(jgl,jb) > 0 )THEN
489  ile=ile+1
490  ilea(ile)=iothseta
491  ileb(ile)=jb-iothboff
492  ilebi(ile)=jb
493  ENDIF
494  ENDDO
495  DO jb=ib5,ib6
496  IF( ionl(jgl,jb) > 0 )THEN
497  ile=ile+1
498  ilea(ile)=ijbxseta
499  ileb(ile)=jb-ijbxboff
500  ilebi(ile)=jb
501  ENDIF
502  ENDDO
503  ELSE
504  iaoff=0
505 ! INITIALISE WEST LIST, NOT SPLIT LAT
506  DO jb=jbx-1,1,-1
507  IF( ionl(jgl,jb) > 0 )THEN
508  ilw=ilw+1
509  ilwa(ilw)=my_region_ns
510  ilwb(ilw)=jb
511  ilwbi(ilw)=jb
512  ENDIF
513  ENDDO
514  DO jb=n_regions_ew,jbx,-1
515  IF( ionl(jgl,jb) > 0 )THEN
516  ilw=ilw+1
517  ilwa(ilw)=my_region_ns
518  ilwb(ilw)=jb
519  ilwbi(ilw)=jb
520  ENDIF
521  ENDDO
522 ! INITIALISE EAST LIST, NOT SPLIT LAT
523  DO jb=jbx+1,n_regions_ew
524  IF( ionl(jgl,jb) > 0 )THEN
525  ile=ile+1
526  ilea(ile)=my_region_ns
527  ileb(ile)=jb
528  ilebi(ile)=jb
529  ENDIF
530  ENDDO
531  DO jb=1,jbx
532  IF( ionl(jgl,jb) > 0 )THEN
533  ile=ile+1
534  ilea(ile)=my_region_ns
535  ileb(ile)=jb
536  ilebi(ile)=jb
537  ENDIF
538  ENDDO
539  ENDIF
540  IF( ilw > 2*n_regions_ew .OR. ile > 2*n_regions_ew )THEN
541  WRITE(nulout,.OR.'("SUECRAD: ILW > 2*N_REGIONS_EW ",&
542  & "ILE > 2*N_REGIONS_EW, ILW=",I6," ILE=",I6)') ilw,ile
543  CALL abor1('SUECRADI:ILW/E > 2*N_REGIONS_EW')
544  ENDIF
545 
546 ! DETERMINE FOR PARTITION JBX THOSE PARTITIONS THAT IT HAS TO RECEIVE
547 ! COURSE POINTS FROM.
548 ! DO THIS BY SEARCHING DOWN THE WESTERN LIST OF PARTITIONS FIRST AND
549 ! THEN FOR THE EASTERN LIST OF PARTITIONS.
550 ! THE SEND AND RECEIVE INFO FOR THIS (MY_REGION_NS,MY_REGION_EW) IS DETERMINED BY
551 ! SIMPLY NOTING WHETHER (MY_REGION_NS,MY_REGION_EW) IS A SENDER OR RECEIVER IN THE
552 ! ABOVE LIST SEARCH PROCESS.
553 
554  icneed=nrcneedw(jgl,jbx)
555 
556  DO jbw=1,ilw
557  IF( icneed == 0 ) GOTO 541
558 
559 ! DOES THIS PARTITION HAVE ANY COURSE POINTS
560 
561  IF( nrimax(jgl,ilwbi(jbw)) > 0 )THEN
562 
563 ! YES, IT DOES
564 ! THEN TEST IF IT HAS ENOUGH TO SATISFY OUR NEED
565 
566  IF( nrimax(jgl,ilwbi(jbw)) >= icneed )THEN
567  ictake=icneed
568  ELSE
569  ictake=nrimax(jgl,ilwbi(jbw))
570  ENDIF
571  IF( my_region_ns == ilwa(jbw).AND.my_region_ew == ilwb(jbw) )THEN
572 ! WE (MY_REGION_NS,MY_REGION_EW) ARE THE SENDER (SENDING EAST COURSE POINTS)
573  IF( jbx <= n_regions_ew )THEN
574  ib =jbx
575  iao=0
576  ELSE
577  ib =jbx-n_regions_ew
578  iao=iaoff
579  ENDIF
580  nrcsnde(jgl,ib,iao)=ictake
581  nrcsndt(ib,iao)=nrcsndt(ib,iao)+ictake
582  ENDIF
583  IF( jbx == my_region_ew )THEN
584 ! WE (MY_REGION_NS,MY_REGION_EW) ARE THE RECEIVER
585  ib =ilwb(jbw)
586  iao=ilwa(jbw)-my_region_ns
587  nrcrcvw(jgl,ib,iao)=ictake
588  nrcrcvwo(jgl,ib,iao)=icneed-ictake
589  nrcrcvt(ib,iao)=nrcrcvt(ib,iao)+ictake
590  ENDIF
591  icneed=icneed-ictake
592  ENDIF
593  ENDDO
594 
595  541 CONTINUE
596 
597  icneed=nrcneede(jgl,jbx)
598 
599  DO jbe=1,ile
600  IF( icneed == 0 ) GOTO 551
601 
602 ! DOES THIS PARTITION HAVE ANY COURSE POINTS
603 
604  IF( nrimax(jgl,ilebi(jbe)) > 0 )THEN
605 
606 ! YES, IT DOES
607 ! THEN TEST IF IT HAS ENOUGH TO SATISFY OUR NEED
608 
609  IF( nrimax(jgl,ilebi(jbe)) >= icneed )THEN
610  ictake=icneed
611  ELSE
612  ictake=nrimax(jgl,ilebi(jbe))
613  ENDIF
614  IF( my_region_ns == ilea(jbe).AND.my_region_ew == ileb(jbe) )THEN
615 ! WE (MY_REGION_NS,MY_REGION_EW) ARE THE SENDER (SENDING WEST COURSE POINTS)
616  IF( jbx <= n_regions_ew )THEN
617  ib =jbx
618  iao=0
619  ELSE
620  ib =jbx-n_regions_ew
621  iao=iaoff
622  ENDIF
623  nrcsndw(jgl,ib,iao)=ictake
624  nrcsndt(ib,iao)=nrcsndt(ib,iao)+ictake
625  ENDIF
626  IF( jbx == my_region_ew )THEN
627 ! WE (MY_REGION_NS,MY_REGION_EW) ARE THE RECEIVER
628  ib =ileb(jbe)
629  iao=ilea(jbe)-my_region_ns
630  nrcrcve(jgl,ib,iao)=ictake
631  nrcrcveo(jgl,ib,iao)=nrcneedw(jgl,jbx)+nrcneede(jgl,jbx)-icneed
632  nrcrcvt(ib,iao)=nrcrcvt(ib,iao)+ictake
633  ENDIF
634  icneed=icneed-ictake
635  ENDIF
636  ENDDO
637 
638  551 CONTINUE
639 
640  ENDDO
641 
642 ! END OF JBX LOOP OVER PARTITIONS
643 
644  700 continue
645  ENDDO
646 
647 ! END OF JGL LOOP OVER LATITUDES
648 
649 ! WRITE OUT SEND/RECEIVE TABLES IF DEBUGGING
650 
651  IF( lodbgradi )THEN
652  DO ja=-1,1
653  WRITE(iunit,'("SUECRADI: ")')
654  DO jb=1,n_regions_ew
655  IF( nrcsndt(jb,ja) > 0.OR. nrcrcvt(jb,ja) > 0 )THEN
656  WRITE(iunit,'("SUECRADI: SETA=",I4," SETB=",I4,&
657  & " NRCSNDT=",I6," NRCRCVT=",I6)')&
658  & ja+my_region_ns,jb,nrcsndt(jb,ja),nrcrcvt(jb,ja)
659  ENDIF
660  ENDDO
661  ENDDO
662 
663  WRITE(iunit,'("SUECRADI: ")')
664 
665  DO ja=-1,1
666  WRITE(iunit,'("SUECRADI: ")')
667  DO jb=1,n_regions_ew
668  DO jgl=1,ndgenl
669  jglglo=nfrstlat(my_region_ns)+jgl-1
670  IF( nrcsndw(jgl,jb,ja) > 0.OR.&
671  & nrcsnde(jgl,jb,ja) > 0.OR.&
672  & nrcrcvw(jgl,jb,ja) > 0.OR.&
673  & nrcrcve(jgl,jb,ja) > 0 )THEN
674  WRITE(iunit,'("SUECRADI: JGLGLO=",I4," JGL=",I4,&
675  & " SETA=",I4," SETB=",I4,&
676  & " CSNDW=",I6," CSNDE=",I6,&
677  & " CRCVW=",I6," CRCVE=",I6,&
678  & " CRCVWO=",I1," CRCVEO=",I1)')&
679  & jglglo,jgl,ja+my_region_ns,jb,&
680  & nrcsndw(jgl,jb,ja),nrcsnde(jgl,jb,ja),&
681  & nrcrcvw(jgl,jb,ja),nrcrcve(jgl,jb,ja),&
682  & nrcrcvwo(jgl,jb,ja),nrcrcveo(jgl,jb,ja)
683  ENDIF
684  ENDDO
685  ENDDO
686  ENDDO
687  IF( .NOT.lodbgradl )THEN
688  CLOSE(unit=iunit)
689  ENDIF
690  ENDIF
691 
692 ENDIF
693 
694 ! ------------------------------------------------------------------
695 
696 IF (lhook) CALL dr_hook('SUECRADI15',1,zhook_handle)
697 END SUBROUTINE suecradi15
integer(kind=jpim) nradf2c15
Definition: yomrad15.F90:26
logical lradaer15
Definition: yomrad15.F90:31
integer(kind=jpim), dimension(:,:,:), allocatable nrcsndw
Definition: yomprad.F90:139
integer(kind=jpim), dimension(:,:), allocatable nrcneedw
Definition: yomprad.F90:137
integer(kind=jpim) nradpla15
Definition: yomrad15.F90:20
logical leradhs15
Definition: yomrad15.F90:29
integer(kind=jpim), dimension(:,:), allocatable nrcrcvt
Definition: yomprad.F90:144
integer(kind=jpim), dimension(:), allocatable, target nloeng
Definition: yomgem.F90:102
integer(kind=jpim) nradfr15
Definition: yomrad15.F90:18
logical lerad6h15
Definition: yomrad15.F90:28
integer(kind=jpim), dimension(:), allocatable, target nlstlat
Definition: yommp.F90:351
integer(kind=jpim) nflux15
Definition: yomrad15.F90:15
integer(kind=jpim) nrint15
Definition: yomrad15.F90:21
integer(kind=jpim) nrimaxt
Definition: yomprad.F90:131
logical lodbgradl
Definition: yomprad.F90:119
subroutine abor1(CDTEXT)
Definition: abor1.F90:2
integer(kind=jpim), dimension(:,:,:), allocatable nrcrcveo
Definition: yomprad.F90:146
integer(kind=jpim) naer15
Definition: yomrad15.F90:14
Definition: yomct0.F90:1
integer(kind=jpim) n_regions_ew
Definition: yomct0.F90:446
integer imax
Definition: iotd.h:1
integer(kind=jpim) ndgsal
Definition: yomdim.F90:68
integer(kind=jpim) ndlon
Definition: yomdim.F90:79
logical, dimension(:), allocatable lsplitlat
Definition: yommp.F90:357
Definition: yomgem.F90:1
integer(kind=jpim), dimension(:,:), allocatable nrlastoff
Definition: yomprad.F90:129
!$Id itapm1 ENDIF!IM on interpole les champs sur les niveaux STD de pression!IM a chaque pas de temps de la physique c!positionnement de l argument logique a false c!pour ne pas recalculer deux fois la meme chose!c!a cet effet un appel a plevel_new a ete deplace c!a la fin de la serie d appels c!la boucle DO nlevSTD a ete internalisee c!dans d ou la creation de cette routine c c!CALL false
Definition: calcul_STDlev.h:26
integer(kind=jpim) nrproma15
Definition: yomrad15.F90:25
integer(kind=jpim), dimension(:,:), allocatable nrcneede
Definition: yomprad.F90:138
integer, parameter jprb
Definition: parkind1.F90:31
integer(kind=jpim), dimension(:,:,:), allocatable nrcsnde
Definition: yomprad.F90:140
integer(kind=jpim) n_regions_ns
Definition: yomct0.F90:445
integer(kind=jpim) nrad15
Definition: yomrad15.F90:17
logical lnewaer15
Definition: yomrad15.F90:32
integer(kind=jpim), dimension(:,:,:), allocatable nrcrcvw
Definition: yomprad.F90:141
integer(kind=jpim) ndgenl
Definition: yomdim.F90:72
integer(kind=jpim), parameter jpradce
Definition: parrint.F90:12
Definition: yomdim.F90:1
!$Header!c c INCLUDE fxyprim h c c c Fonctions in line c c REAL fyprim REAL rj c c il faut la calculer avant d appeler ces fonctions c c c Fonctions a changer selon x(x) et y(y) choisis.c-----------------------------------------------------------------c c.....ici
integer(kind=jpim) my_region_ns
Definition: yommp.F90:86
Definition: yommp.F90:1
Definition: yomlun.F90:1
!$Id itapm1 ENDIF!IM on interpole les champs sur les niveaux STD de pression!IM a chaque pas de temps de la physique c!positionnement de l argument logique a false c!pour ne pas recalculer deux fois la meme chose!c!a cet effet un appel a plevel_new a ete deplace c!a la fin de la serie d appels c!la boucle DO nlevSTD a ete internalisee c!dans d ou la creation de cette routine c c!CALL ulevSTD CALL &zphi philevSTD CALL &zx_rh rhlevSTD!DO klev DO klon klev DO klon klev DO klon klev DO klon klev DO klon klev DO klon klev DO klon klev DO klon klev DO klon klev DO klon du jour ou toutes les read_climoz CALL true
integer(kind=jpim), dimension(:), allocatable nloen
Definition: yomgem.F90:101
integer(kind=jpim), dimension(:,:), allocatable, target nsta
Definition: yommp.F90:345
integer(kind=jpim) nradpfr15
Definition: yomrad15.F90:19
integer(kind=jpim), dimension(:), allocatable nptrlstlat
Definition: yommp.F90:348
integer(kind=jpim), dimension(:,:), allocatable, target nonl
Definition: yommp.F90:346
integer(kind=jpim), parameter jpradcw
Definition: parrint.F90:11
logical lhook
Definition: yomhook.F90:12
integer(kind=jpim) nradc2f15
Definition: yomrad15.F90:27
integer(kind=jpim), dimension(:,:,:), allocatable nrcrcve
Definition: yomprad.F90:142
subroutine dr_hook(CDNAME, KSWITCH, PKEY)
Definition: yomhook.F90:17
logical lodbgradi
Definition: yomprad.F90:118
integer(kind=jpim) novlp15
Definition: yomrad15.F90:24
integer(kind=jpim) ndgsag
Definition: yomdim.F90:67
integer(kind=jpim), dimension(:), allocatable, target nptrfrstlat
Definition: yommp.F90:347
integer, parameter jpim
Definition: parkind1.F90:13
logical lsplit
Definition: yommp.F90:70
integer(kind=jpim) nmode15
Definition: yomrad15.F90:16
subroutine suecradi15
Definition: suecradi15.F90:3
integer(kind=jpim) my_region_ew
Definition: yommp.F90:87
integer(kind=jpim) ndgeng
Definition: yomdim.F90:71
integer(kind=jpim), dimension(:), allocatable, target nfrstlat
Definition: yommp.F90:350
!$Header!integer nvarmx s s unit
Definition: gradsdef.h:20
integer(kind=jpim), dimension(:,:), allocatable nrimax
Definition: yomprad.F90:130
integer(kind=jpim), dimension(:,:,:), allocatable nrcrcvwo
Definition: yomprad.F90:145
integer(kind=jpim), dimension(:,:), allocatable nrcsndt
Definition: yomprad.F90:143
integer(kind=jpim), dimension(:), allocatable nrirint
Definition: yomprad.F90:127
integer(kind=jpim), dimension(:,:), allocatable nrfrstoff
Definition: yomprad.F90:128