2 !
$Id: 1Dconv.h 2310 2015-06-24 10:04:31Z fairhead $
10 !ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
12 ! pouvoir calculer la convergence et le cisaillement dans la
physiq
13 !cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
34 !======================================================================
35 ! methode: on va chercher les donnees
du mesoNH
de meteo france, on y
36 ! a acces a tout pas detemps grace a la routine rdgrads qui
37 ! est une boucle lisant dans ces fichiers.
38 ! Puis on interpole ces donnes
sur les 11 niveaux
du gcm et
40 !----------------------------------------------------------------------
43 !
dt :pas
de temps
du meso_NH (en secondes)
44 !----------------------------------------------------------------------
47 !----------------------------------------------------------------------
49 !
itap :compteur
de la physique(le nombre
de ces pas est
50 ! fixe dans la subroutine calcul_ini_gcm
de interpo
53 !
ht :convergence horizontale
de temperature(K/s)
54 !
hq :
" " d humidite (kg/kg/s)
55 !
hw :vitesse verticale moyenne (m/s**2)
56 !
hu :convergence horizontale
d impulsion le
long de x
58 !
hv : idem le
long de y.
59 !
Ts : Temperature
de surface (K)
60 !
imp_fcg:
var. logical .eq. T si forcage en impulsion
62 !
Tp_fcg:
var. logical .eq. T si forcage donne en Temp potentielle
63 ! Turb_fcg:
var. logical .eq. T si forcage turbulent present dans
fichier
64 !----------------------------------------------------------------------
79 !----------------------------------------------------------------------
81 ! est faite entre les pas
de temps before et after,
sur les variables
82 ! definies
sur la grille
du SCM; on atteint exactement les valeurs Meso
83 ! aux milieux des pas
de temps Meso)
84 ! time0 :date initiale en secondes
85 !
time :temps associe a chaque pas
du SCM
86 ! pas :numero
du pas
du meso_NH (on lit en pas : le premier pas
87 ! des donnees est duplique)
88 ! pasprev :numero
du pas
de lecture precedent
89 ! htaft :advection horizontale
de temp. au pas
de temps after
90 ! hqaft :
" " d humidite
"
91 ! hwaft :vitesse verticalle moyenne au pas de temps after
92 ! huaft,hvaft :advection horizontale d impulsion au pas de temps after
93 ! tsaft : surface temperature 'after time step'
94 ! htbef :idem htaft, mais pour le pas de temps before
97 ! hubef,hvbef : idem huaft,hvaft, mais pour before
98 ! tsbef : surface temperature 'before time step'
99 !----------------------------------------------------------------------
100 integer time0,pas,pasprev
101 save time0,pas,pasprev
103 real htaft(100),hqaft(100),hwaft(100),huaft(100),hvaft(100)
104 real hthturbaft(100),hqturbaft(100)
106 save htaft,hqaft,hwaft,huaft,hvaft,hthturbaft,hqturbaft
107 real htbef(100),hqbef(100),hwbef(100),hubef(100),hvbef(100)
108 real hthturbbef(100),hqturbbef(100)
110 save htbef,hqbef,hwbef,hubef,hvbef,hthturbbef,hqturbbef
116 !----------------------------------------------------------------------
117 ! variables arguments de la subroutine rdgrads
118 !---------------------------------------------------------------------
119 integer icompt,icomp1 !compteurs de rdgrads
120 real z(100) ! altitude (grille Meso)
121 real ht_mes(100) !convergence horizontale de temperature
123 real hq_mes(100) !convergence horizontale d humidite
125 real hw_mes(100) !vitesse verticale moyenne
127 real hu_mes(100),hv_mes(100) !convergence horizontale d impulsion
129 real hthturb_mes(100) !tendance horizontale de T_pot, due aux
131 real hqturb_mes(100) !tendance horizontale d humidite, due aux
134 !---------------------------------------------------------------------
135 ! variable argument de la subroutine copie
136 !---------------------------------------------------------------------
137 ! SB real pplay(100) !pression en milieu de couche du gcm
138 ! SB !argument de la physique
139 !---------------------------------------------------------------------
140 ! variables destinees a la lecture du pas de temps du fichier de donnees
141 !---------------------------------------------------------------------
142 character*80 aaa,atemps,spaces,apasmax
144 !---------------------------------------------------------------------
145 ! procedures appelees
146 external rdgrads !lire en iterant dans forcing.dat
147 !---------------------------------------------------------------------
148 print*,'le pas itap est:',itap
149 !*** on determine le pas du meso_NH correspondant au nouvel itap ***
150 !*** pour aller chercher les champs dans rdgrads ***
152 time=time0+itap*dtime
153 !c temps=int(time/dt+1)
154 !c pas=min(temps,pasmax)
155 temps = 1 + int((dt + 2*time)/(2*dt))
156 pas=min(temps,pasmax-1)
157 print*,'le pas Meso est:',pas
160 !===================================================================
162 !*** on remplit les champs before avec les champs after du pas ***
163 !*** precedent en format gcm ***
164 if(pas.gt.pasprev)then
171 hThTurbbef(i)=hThTurbaft(i)
172 hqTurbbef(i)=hqTurbaft(i)
178 IF (ts_fcg) icomp1 = icomp1 + 1
179 IF (imp_fcg) icomp1 = icomp1 + nblvlm*2
180 IF (Turb_fcg) icomp1 = icomp1 + nblvlm*2
182 print *, 'imp_fcg,ts_fcg,Turb_fcg,pas,nblvlm,icompt'
183 print *, imp_fcg,ts_fcg,Turb_fcg,pas,nblvlm,icompt
184 print*,'le pas pas est:',pas
185 !*** on va chercher les nouveaux champs after dans toga.dat ***
186 !*** champs en format meso_NH ***
187 open(99,FILE=file_fordat,FORM='UNFORMATTED', &
188 & ACCESS='DIRECT',RECL=8)
189 call rdgrads(99,icompt,nblvlm,z,ht_mes,hq_mes,hw_mes &
190 & ,hu_mes,hv_mes,hthturb_mes,hqturb_mes &
191 & ,ts_fcg,ts_subr,imp_fcg,Turb_fcg)
195 ! (le forcage est donne en temperature potentielle)
197 ht_mes(i) = ht_mes(i)*(hplaym(i)/1000.)**rkappa
202 hThTurb_mes(i) = hThTurb_mes(i)*(hplaym(i)/1000.)**rkappa
206 print*,'ht_mes ',(ht_mes(i),i=1,nblvlm)
207 print*,'hq_mes ',(hq_mes(i),i=1,nblvlm)
208 print*,'hw_mes ',(hw_mes(i),i=1,nblvlm)
210 print*,'hu_mes ',(hu_mes(i),i=1,nblvlm)
211 print*,'hv_mes ',(hv_mes(i),i=1,nblvlm)
214 print*,'hThTurb_mes ',(hThTurb_mes(i),i=1,nblvlm)
215 print*,'hqTurb_mes ',(hqTurb_mes(i),i=1,nblvlm)
217 IF (ts_fcg) print*,'ts_subr', ts_subr
218 !*** on interpole les champs meso_NH sur les niveaux de pression***
219 !*** gcm . on obtient le nouveau champ after ***
221 if (JM(k) .eq. 0) then
222 htaft(k)= ht_mes(jm(k)+1)
223 hqaft(k)= hq_mes(jm(k)+1)
224 hwaft(k)= hw_mes(jm(k)+1)
226 huaft(k)= hu_mes(jm(k)+1)
227 hvaft(k)= hv_mes(jm(k)+1)
230 hThTurbaft(k)= hThTurb_mes(jm(k)+1)
231 hqTurbaft(k)= hqTurb_mes(jm(k)+1)
234 htaft(k)=coef1(k)*ht_mes(jm(k))+coef2(k)*ht_mes(jm(k)+1)
235 hqaft(k)=coef1(k)*hq_mes(jm(k))+coef2(k)*hq_mes(jm(k)+1)
236 hwaft(k)=coef1(k)*hw_mes(jm(k))+coef2(k)*hw_mes(jm(k)+1)
238 huaft(k)=coef1(k)*hu_mes(jm(k))+coef2(k)*hu_mes(jm(k)+1)
239 hvaft(k)=coef1(k)*hv_mes(jm(k))+coef2(k)*hv_mes(jm(k)+1)
242 hThTurbaft(k)=coef1(k)*hThTurb_mes(jm(k)) &
243 & +coef2(k)*hThTurb_mes(jm(k)+1)
244 hqTurbaft(k) =coef1(k)*hqTurb_mes(jm(k)) &
245 & +coef2(k)*hqTurb_mes(jm(k)+1)
251 else ! pas.gt.pasprev
252 print*,'timebef est:',timebef
253 endif ! pas.gt.pasprev fin du bloc relatif au passage au pas
254 !de temps (meso) suivant
255 !*** si on atteint le pas max des donnees experimentales ,on ***
256 !*** on conserve les derniers champs calcules ***
257 if(temps.ge.pasmax)then
264 hThTurb(ll)=hThTurbaft(ll)
265 hqTurb(ll)=hqTurbaft(ll)
268 else ! temps.ge.pasmax
269 !*** on interpole sur les pas de temps de 10mn du gcm a partir ***
270 !** des pas de temps de 1h du meso_NH ***
272 ht(j)=((timeaft-time)*htbef(j)+(time-timebef)*htaft(j))/dt
273 hq(j)=((timeaft-time)*hqbef(j)+(time-timebef)*hqaft(j))/dt
274 hw(j)=((timeaft-time)*hwbef(j)+(time-timebef)*hwaft(j))/dt
276 hu(j)=((timeaft-time)*hubef(j)+(time-timebef)*huaft(j))/dt
277 hv(j)=((timeaft-time)*hvbef(j)+(time-timebef)*hvaft(j))/dt
280 hThTurb(j)=((timeaft-time)*hThTurbbef(j) &
281 & +(time-timebef)*hThTurbaft(j))/dt
282 hqTurb(j)= ((timeaft-time)*hqTurbbef(j) &
283 & +(time-timebef)*hqTurbaft(j))/dt
286 ts_subr = ((timeaft-time)*tsbef + (time-timebef)*tsaft)/dt
287 endif ! temps.ge.pasmax
289 print *,' time,timebef,timeaft',time,timebef,timeaft
290 print *,' ht,htbef,htaft,hthturb,hthturbbef,hthturbaft'
292 print *, j,ht(j),htbef(j),htaft(j), &
293 & hthturb(j),hthturbbef(j),hthturbaft(j)
295 print *,' hq,hqbef,hqaft,hqturb,hqturbbef,hqturbaft'
297 print *, j,hq(j),hqbef(j),hqaft(j), &
298 & hqturb(j),hqturbbef(j),hqturbaft(j)
301 !-------------------------------------------------------------------
303 IF (Ts_fcg) Ts = Ts_subr
306 !-----------------------------------------------------------------------
307 ! on sort les champs de "convergence
" pour l instant initial 'in'
308 ! ceci se passe au pas temps itap=0 de la physique
309 !-----------------------------------------------------------------------
310 entry get_uvd2(itap,dtime,file_forctl,file_fordat, &
311 & ht,hq,hw,hu,hv,hThTurb,hqTurb,ts, &
312 & imp_fcg,ts_fcg,Tp_fcg,Turb_fcg)
313 print*,'le pas itap est:',itap
315 !===================================================================
317 write(*,'(a)') 'OPEN '//file_forctl
318 open(97,FILE=file_forctl,FORM='FORMATTED')
322 read(97,1000,end=999) string
324 if (string .eq. 'TDEF') go to 50
327 !-------------------------------------------------------------------
328 ! *** on lit le pas de temps dans le fichier de donnees ***
329 ! *** "forcing.ctl
" et pasmax ***
330 !-------------------------------------------------------------------
336 call getsch(aaa,' ',' ',5,atemps,nch)
337 print*,'atemps est',atemps
338 atemps=atemps(1:nch-2)
339 print*,'atemps',atemps
342 print*,'le pas de temps dt',dt
343 call getsch(aaa,' ',' ',2,apasmax,nch)
344 apasmax=apasmax(1:nch)
347 print*,'pasmax est',pasmax
349 !------------------------------------------------------------------
350 ! *** on lit le pas de temps initial de la simulation ***
351 !------------------------------------------------------------------
354 !c time0=dt*(pasprev-1)
360 write(*,'(a)') 'OPEN '//file_fordat
361 open(99,FILE=file_fordat,FORM='UNFORMATTED', &
362 & ACCESS='DIRECT',RECL=8)
364 IF (ts_fcg) icomp1 = icomp1 + 1
365 IF (imp_fcg) icomp1 = icomp1 + nblvlm*2
366 IF (Turb_fcg) icomp1 = icomp1 + nblvlm*2
367 icompt = icomp1*(in-1)
368 call rdgrads(99,icompt,nblvlm,z,ht_mes,hq_mes,hw_mes &
369 & ,hu_mes,hv_mes,hthturb_mes,hqturb_mes &
370 & ,ts_fcg,ts_subr,imp_fcg,Turb_fcg)
371 print *, 'get_uvd : rdgrads ->'
374 ! following commented out because we have temperature already in ARM case
375 ! (otherwise this is the potential temperature )
376 !------------------------------------------------------------------------
379 ht_mes(i) = ht_mes(i)*(hplaym(i)/1000.)**rkappa
382 print*,'ht_mes ',(ht_mes(i),i=1,nblvlm)
383 print*,'hq_mes ',(hq_mes(i),i=1,nblvlm)
384 print*,'hw_mes ',(hw_mes(i),i=1,nblvlm)
386 print*,'hu_mes ',(hu_mes(i),i=1,nblvlm)
387 print*,'hv_mes ',(hv_mes(i),i=1,nblvlm)
391 print*,'hThTurb_mes ',(hThTurb_mes(i),i=1,nblvlm)
392 print*,'hqTurb ', (hqTurb_mes(i),i=1,nblvlm)
394 !----------------------------------------------------------------------
395 ! on a obtenu des champs initiaux sur les niveaux du meso_NH
396 ! on interpole sur les niveaux du gcm(niveau pression bien sur!)
397 !-----------------------------------------------------------------------
399 if (JM(k) .eq. 0) then
400 !FKC bug? ne faut il pas convertir tsol en tendance ????
401 !RT bug taken care of by removing the stuff
402 htaft(k)= ht_mes(jm(k)+1)
403 hqaft(k)= hq_mes(jm(k)+1)
404 hwaft(k)= hw_mes(jm(k)+1)
406 huaft(k)= hu_mes(jm(k)+1)
407 hvaft(k)= hv_mes(jm(k)+1)
410 hThTurbaft(k)= hThTurb_mes(jm(k)+1)
411 hqTurbaft(k)= hqTurb_mes(jm(k)+1)
414 htaft(k)=coef1(k)*ht_mes(jm(k))+coef2(k)*ht_mes(jm(k)+1)
415 hqaft(k)=coef1(k)*hq_mes(jm(k))+coef2(k)*hq_mes(jm(k)+1)
416 hwaft(k)=coef1(k)*hw_mes(jm(k))+coef2(k)*hw_mes(jm(k)+1)
418 huaft(k)=coef1(k)*hu_mes(jm(k))+coef2(k)*hu_mes(jm(k)+1)
419 hvaft(k)=coef1(k)*hv_mes(jm(k))+coef2(k)*hv_mes(jm(k)+1)
422 hThTurbaft(k)=coef1(k)*hThTurb_mes(jm(k)) &
423 & +coef2(k)*hThTurb_mes(jm(k)+1)
424 hqTurbaft(k) =coef1(k)*hqTurb_mes(jm(k)) &
425 & +coef2(k)*hqTurb_mes(jm(k)+1)
430 ! valeurs initiales des champs de convergence
440 hThTurb(k)=hThTurbaft(k)
441 hqTurb(k) =hqTurbaft(k)
448 !-------------------------------------------------------------------
451 100 IF (Ts_fcg) Ts = Ts_subr
455 stop 'erreur lecture, file forcing.ctl'
458 SUBROUTINE advect_tvl(dtime,zt,zq,vu_f,vv_f,t_f,q_f &
463 #include "dimensions.h
"
467 real dtime, fact, du, dv, cx, cy, alx, aly
468 real zt(klev), zq(klev,3)
469 real vu_f(klev), vv_f(klev), t_f(klev), q_f(klev,3)
471 real d_t_adv(klev), d_q_adv(klev,3)
473 ! Velocity of moving cell
474 data cx,cy /12., -2./
476 ! Dimensions of moving cell
477 data alx,aly /100000.,150000./
480 du = abs(vu_f(k)-cx)/alx
481 dv = abs(vv_f(k)-cy)/aly
482 fact = dtime *(du+dv-du*dv*dtime)
483 d_t_adv(k) = fact * (t_f(k)-zt(k))
484 d_q_adv(k,1) = fact * (q_f(k,1)-zq(k,1))
485 d_q_adv(k,2) = fact * (q_f(k,2)-zq(k,2))
486 d_q_adv(k,3) = fact * (q_f(k,3)-zq(k,3))
492 SUBROUTINE copie(klevgcm,playgcm,psolgcm,file_forctl)
495 !cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
496 ! cette routine remplit les COMMON com1_phys_gcss et com2_phys_gcss.h
497 !ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
499 INTEGER klev !nombre de niveau de pression du GCM
500 REAL play(100) !pression en Pa au milieu de chaque couche GCM
502 REAL coef1(100) !coefficient d interpolation
503 REAL coef2(100) !coefficient d interpolation
505 INTEGER nblvlm !nombre de niveau de pression du mesoNH
506 REAL playm(100) !pression en Pa au milieu de chaque couche Meso-NH
507 REAL hplaym(100)!pression en hecto-Pa des milieux de couche Meso-NH
509 COMMON/com1_phys_gcss/play,coef1,coef2,JM,klev
510 COMMON/com2_phys_gcss/playm,hplaym,nblvlm
513 real playgcm(klevgcm) ! pression en milieu de couche du gcm
515 character*80 file_forctl
519 !---------------------------------------------------------------------
520 ! pression au milieu des couches du gcm dans la physiq
521 ! (SB: remplace le call conv_lipress_gcm(playgcm) )
522 !---------------------------------------------------------------------
526 print*,'la pression gcm est:',play(k)
529 !----------------------------------------------------------------------
530 ! lecture du descripteur des donnees Meso-NH (forcing.ctl):
531 ! -> nb niveaux du meso.NH (nblvlm) + pressions meso.NH
532 ! (on remplit le COMMON com2_phys_gcss)
533 !----------------------------------------------------------------------
535 call mesolupbis(file_forctl)
537 print*,'la valeur de nblvlm est:',nblvlm
539 !----------------------------------------------------------------------
540 ! etude de la correspondance entre les niveaux meso.NH et GCM;
541 ! calcul des coefficients d interpolation coef1 et coef2
542 ! (on remplit le COMMON com1_phys_gcss)
543 !----------------------------------------------------------------------
545 call corresbis(psolgcm)
547 !---------------------------------------------------------
548 ! TEST sur le remplissage de com1_phys_gcss et com2_phys_gcss:
549 !---------------------------------------------------------
552 write(*,*) 'TESTS com1_phys_gcss et com2_phys_gcss dans copie.F'
553 write(*,*) '--------------------------------------'
554 write(*,*) 'GCM: nb niveaux:',klev,' et pression, coeffs:'
556 write(*,*) play(k), coef1(k), coef2(k)
558 write(*,*) 'MESO-NH: nb niveaux:',nblvlm,' et pression:'
560 write(*,*) playm(k), hplaym(k)
565 SUBROUTINE mesolupbis(file_forctl)
568 !ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
570 ! Lecture descripteur des donnees MESO-NH (forcing.ctl):
571 ! -------------------------------------------------------
573 ! Cette subroutine lit dans le fichier de controle "essai.ctl
"
574 ! et affiche le nombre de niveaux du Meso-NH ainsi que les valeurs
575 ! des pressions en milieu de couche du Meso-NH (en Pa puis en hPa).
576 !ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
578 INTEGER nblvlm !nombre de niveau de pression du mesoNH
579 REAL playm(100) !pression en Pa milieu de chaque couche Meso-NH
580 REAL hplaym(100) !pression en hPa des milieux de couche Meso-NH
581 COMMON/com2_phys_gcss/playm,hplaym,nblvlm
583 INTEGER i,lu,mlz,mlzh
585 character*80 file_forctl
588 character*80 aaa,anblvl,spaces
592 open(lu,file=file_forctl,form='formatted')
595 read(lu,1000,end=999) a
596 if (a .eq. 'ZDEF') go to 100
600 print*,' DESCRIPTION DES 2 MODELES : '
606 call getsch(aaa,' ',' ',2,anblvl,nch)
607 read(anblvl,*) nblvlm
610 print*,'nbre de niveaux de pression Meso-NH :',nblvlm
612 print*,'pression en Pa de chaque couche du meso-NH :'
614 read(lu,*) (playm(mlz),mlz=1,nblvlm)
615 ! Si la pression est en HPa, la multiplier par 100
616 if (playm(1) .lt. 10000.) then
618 playm(mlz) = playm(mlz)*100.
621 print*,(playm(mlz),mlz=1,nblvlm)
628 hplaym(mlzh)=playm(mlzh)/100.
631 print*,'pression en hPa de chaque couche du meso-NH: '
632 print*,(hplaym(mlzh),mlzh=1,nblvlm)
637 999 stop 'erreur lecture des niveaux pression des donnees'
640 SUBROUTINE rdgrads(itape,icount,nl,z,ht,hq,hw,hu,hv,hthtur,hqtur, &
641 & ts_fcg,ts,imp_fcg,Turb_fcg)
643 INTEGER itape,icount,icomp, nl
644 real z(nl),ht(nl),hq(nl),hw(nl),hu(nl),hv(nl)
645 real hthtur(nl),hqtur(nl)
650 LOGICAL imp_fcg,ts_fcg,Turb_fcg
657 read(itape,rec=icomp)z(k)
658 print *,'icomp,k,z(k) ',icomp,k,z(k)
662 read(itape,rec=icomp)hT(k)
667 read(itape,rec=icomp)hQ(k)
673 read(itape,rec=icomp)hThTur(k)
677 read(itape,rec=icomp)hqTur(k)
680 print *,' apres lecture hthtur, hqtur'
686 read(itape,rec=icomp)hu(k)
690 read(itape,rec=icomp)hv(k)
697 read(itape,rec=icomp)hw(k)
702 read(itape,rec=icomp)ts
705 print *,' rdgrads ->'
710 SUBROUTINE corresbis(psol)
713 !cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
714 ! Cette subroutine calcule et affiche les valeurs des coefficients
715 ! d interpolation qui serviront dans la formule d interpolation elle-
717 !ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
719 INTEGER klev !nombre de niveau de pression du GCM
720 REAL play(100) !pression en Pa au milieu de chaque couche GCM
722 REAL coef1(100) !coefficient d interpolation
723 REAL coef2(100) !coefficient d interpolation
725 INTEGER nblvlm !nombre de niveau de pression du mesoNH
726 REAL playm(100) !pression en Pa milieu de chaque couche Meso-NH
727 REAL hplaym(100)!pression en hPa des milieux de couche Meso-NH
729 COMMON/com1_phys_gcss/play,coef1,coef2,JM,klev
730 COMMON/com2_phys_gcss/playm,hplaym,nblvlm
739 if (val .gt. playm(1)) then
742 coef1(1)=(playm(mlz+1)-val)/(playm(mlz+1)-psol)
743 coef2(1)=(val-psol)/(playm(mlz+1)-psol)
744 else if (val .gt. playm(nblvlm)) then
746 if ( val .le. playm(mlz).and. val .gt. playm(mlz+1))then
748 coef1(k)=(playm(mlz+1)-val)/(playm(mlz+1)-playm(mlz))
749 coef2(k)=(val-playm(mlz))/(playm(mlz+1)-playm(mlz))
759 !c if (play(klev) .le. playm(nblvlm)) then
762 !c coef1(klev)=(playm(mlz+1)-val)
763 !c * /(playm(mlz+1)-playm(mlz))
764 !c coef2(klev)=(val-playm(mlz))
765 !c * /(playm(mlz+1)-playm(mlz))
769 print*,' INTERPOLATION : '
771 print*,'correspondance de 9 niveaux du GCM sur les 53 du meso-NH:'
772 print*,(JM(k),k=1,klev)
773 print*,'correspondance de 9 niveaux du GCM sur les 53 du meso-NH:'
774 print*,(JM(k),k=1,klev)
776 print*,'vals du premier coef d"interpolation pour les 9 niveaux:
'
777 print*,(coef1(k),k=1,klev)
779 print*,'valeurs
du deuxieme coef
d"interpolation pour les 9 niveaux:'
780 print*,(coef2(k),k=1,klev)
784 SUBROUTINE GETSCH(STR,DEL,TRM,NTH,SST,NCH)
785 !***************************************************************
792 !***************************************************************
793 !* Return in SST the character string found between the NTH-1 and NTH
794 !* occurence of the delimiter 'DEL' but before the terminator 'TRM' in
795 !* the input string 'STR'. If TRM=DEL then STR is considered unlimited.
796 !* NCH=Length of the string returned in SST or =-1 if NTH is <1 or if
797 !* NTH is greater than the number of delimiters in STR.
798 IMPLICIT INTEGER (A-Z)
799 CHARACTER STR*(*),DEL*1,TRM*1,SST*(*)
806 LENGTH=INDEX(STR,TRM)-1
807 IF(LENGTH.LT.0) LENGTH=LEN(STR)
809 !* Find beginning and end of the NTH DEL-limited substring in STR
812 IF(END.EQ.LENGTH) RETURN
814 END=BEG+INDEX(STR(BEG:LENGTH),DEL)-2
815 IF(END.EQ.BEG-2) END=LENGTH
816 !* PRINT *,'NTH,LENGTH,N,BEG,END=',NTH,LENGTH,N,BEG,END
819 IF(NCH.GT.0) SST=STR(BEG:END)
822 CHARACTER*(*) FUNCTION SPACES(STR,NSPACE)
824 ! CERN PROGLIB# M433 SPACES .VERSION KERNFOR 4.14 860211
825 ! ORIG. 6/05/86 M.GOOSSENS/DD
827 !- The function value SPACES returns the character string STR with
828 !- leading blanks removed and each occurence of one or more blanks
829 !- replaced by NSPACE blanks inside the string STR
835 IF (NSPACE.LT.0) NSPACE = 0
838 100 INONBL = INDEXC(STR(IBLANK:),' ')
839 IF (INONBL.EQ.0) THEN
840 SPACES(ISPACE:) = STR(IBLANK:)
843 INONBL = INONBL + IBLANK - 1
844 IBLANK = INDEX(STR(INONBL:),' ')
845 IF (IBLANK.EQ.0) THEN
846 SPACES(ISPACE:) = STR(INONBL:)
849 IBLANK = IBLANK + INONBL - 1
850 SPACES(ISPACE:) = STR(INONBL:IBLANK-1)
851 ISPACE = ISPACE + IBLANK - INONBL + NSPACE
852 IF (ISPACE.LE.LENSPA) GO TO 100
854 FUNCTION INDEXC(STR,SSTR)
856 ! CERN PROGLIB# M433 INDEXC .VERSION KERNFOR 4.14 860211
857 ! ORIG. 26/03/86 M.GOOSSENS/DD
859 !- Find the leftmost position where substring SSTR does not match
860 !- string STR scanning forward
862 CHARACTER*(*) STR,SSTR
867 DO 10 I=1,LENS-LENSS+1
868 IF (STR(I:I+LENSS-1).NE.SSTR) THEN
!$Id Turb_fcg!implicit none!ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc!cette routine permet d obtenir hq et ainsi de!pouvoir calculer la convergence et le cisaillement dans la physiq!cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc INTEGER klev REAL in CHARACTER file_fordat COMMON com1_phys_gcss klev COMMON com2_phys_gcss on y!a acces a tout pas detemps grace a la routine rdgrads qui!est une boucle lisant dans ces fichiers!Puis on interpole ces donnes sur les niveaux du gcm et!et sur les pas de temps de ce meme gcm dt save pasmax
!$Id Turb_fcg!implicit none!ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc!cette routine permet d obtenir hq et ainsi de!pouvoir calculer la convergence et le cisaillement dans la physiq!cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc INTEGER klev REAL in CHARACTER file_fordat COMMON com1_phys_gcss JM
!$Id klon initialisation mois suivants day_rain itap
!$Id ok_orolf LOGICAL ok_limitvrai LOGICAL ok_all_xml INTEGER iflag_ener_conserv REAL solaire REAL(kind=8) RCO2
c c $Id c c calculs statistiques distribution nuage ftion du regime dynamique c c Ce calcul doit etre fait a partir de valeurs mensuelles CALL nbregdyn DO kmaxm1 DO l
!$Id calend INTEGER itaufin INTEGER itau_phy INTEGER day_ref REAL dt
INTERFACE SUBROUTINE JPRB INTEGER(KIND=JPIM)
!$Id Turb_fcg_gcssold get_uvd hqturb_gcssold endif!large scale forcing
!$Header!integer nvarmx s s s fichier
!$Id Turb_fcg!implicit none!ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc!cette routine permet d obtenir hq et ainsi de!pouvoir calculer la convergence et le cisaillement dans la physiq!cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc INTEGER klev REAL in CHARACTER file_fordat COMMON com1_phys_gcss klev COMMON com2_phys_gcss nblvlm
!$Id klon initialisation mois suivants day_rain itap ENDIF!Calcul fin de nday_rain calcul nday_rain itap DO i
!$Id Turb_fcg!implicit none!ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc!cette routine permet d obtenir u_convg
subroutine pression(ngrid, ap, bp, ps, p)
!$Header!integer nvarmx s s s var
!$Id Turb_fcg!implicit none!ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc!cette routine permet d obtenir v_convg
subroutine physiq(nlon, nlev, debut, lafin, jD_cur, jH_cur, pdtphys, paprs, pplay, pphi, pphis, presnivs, u, v, rot, t, qx, flxmass_w, d_u, d_v, d_t, d_qx, d_ps, dudyn)
!$Id Turb_fcg!implicit none!ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc!cette routine permet d obtenir hq et ainsi de!pouvoir calculer la convergence et le cisaillement dans la physiq!cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc INTEGER klev REAL j
!$Id Turb_fcg!implicit none!ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc!cette routine permet d obtenir hq et ainsi de!pouvoir calculer la convergence et le cisaillement dans la physiq!cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc INTEGER klev REAL k
!$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
c c zjulian c cym CALL iim cym klev iim cym jjmp1 cym On stoke le fichier bilKP instantanne sur
!$Id Turb_fcg!implicit none!ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc!cette routine permet d obtenir hq et ainsi de!pouvoir calculer la convergence et le cisaillement dans la physiq!cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc INTEGER klev REAL in CHARACTER file_fordat COMMON com1_phys_gcss klev COMMON com2_phys_gcss playm
!$Id Turb_fcg!implicit none!ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc!cette routine permet d obtenir hq et ainsi de!pouvoir calculer la convergence et le cisaillement dans la physiq!cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc INTEGER klev REAL ll
!$Id Turb_fcg!implicit none!ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc!cette routine permet d obtenir hq et ainsi de!pouvoir calculer la convergence et le cisaillement dans la physiq!cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc INTEGER klev REAL in CHARACTER file_fordat COMMON com1_phys_gcss coef1
real, dimension(:,:), pointer, save du
nsplit_thermals!nrlmd le iflag_clos_bl tau_trig_deep real::s_trig!fin nrlmd le fact_thermals_ed_dz integer
!$Id Turb_fcg!implicit none!ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc!cette routine permet d obtenir hq et ainsi de!pouvoir calculer la convergence et le cisaillement dans la physiq!cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc INTEGER klev REAL in CHARACTER file_fordat COMMON com1_phys_gcss play
!$Id Turb_fcg!implicit none!ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc!cette routine permet d obtenir hq et ainsi de!pouvoir calculer la convergence et le cisaillement dans la physiq!cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc INTEGER klev REAL in CHARACTER file_fordat COMMON com1_phys_gcss klev COMMON com2_phys_gcss hplaym
real(kind=8), dimension(2, 3), parameter d
!$Id Turb_fcg!implicit none!ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc!cette routine permet d obtenir hq et ainsi de!pouvoir calculer la convergence et le cisaillement dans la physiq!cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc INTEGER klev REAL in CHARACTER file_fordat COMMON com1_phys_gcss coef2
!IM for NMC files!real nfiles!real nfiles!real nfiles!real nlevSTD3 real nlevSTD3 real nlevSTD3 real nlevSTD3 real nlevSTD8 real nlevSTD8 real nlevSTD8 real nlevSTD8 real