Changeset 1046 for LMDZ4/trunk/libf/dyn3d/read_reanalyse.F
- Timestamp:
- Nov 6, 2008, 5:39:24 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
LMDZ4/trunk/libf/dyn3d/read_reanalyse.F
r618 r1046 29 29 c --------- 30 30 integer nlevnc 31 integer timestep,mode ,l31 integer timestep,mode 32 32 33 33 real psi(iip1,jjp1) … … 41 41 integer ncidu,varidu,ncidv,varidv,ncidt,varidt,ncidps,varidps 42 42 integer ncidpl 43 integer varidpl,ncidQ,varidQ 43 integer varidpl,ncidQ,varidQ,varidap,varidbp 44 44 save ncidu,varidu,ncidv,varidv,ncidt,varidt,ncidps,varidps 45 save ncidpl 45 save ncidpl,varidap,varidbp 46 46 save varidpl,ncidQ,varidQ 47 47 … … 49 49 real*4 tnc(iip1,jjp1,nlevnc),psnc(iip1,jjp1) 50 50 real*4 Qnc(iip1,jjp1,nlevnc) 51 real*4 pl(nlevnc) 51 real*4 plnc(iip1,jjp1,nlevnc) 52 real*4 apnc(nlevnc),bpnc(nlevnc) 52 53 53 54 integer start(4),count(4),status 55 integer i,j,l 54 56 55 57 real rcode … … 59 61 data first/.true./ 60 62 61 62 63 63 c ----------------------------------------------------------------- 64 64 c Initialisation de la lecture des fichiers … … 67 67 ncidpl=-99 68 68 print*,'Intitialisation de read reanalsye' 69 70 c Niveaux de pression si non constants 71 if (guide_modele) then 72 print *,'Vous êtes entrain de lire des données sur 73 . niveaux modèle' 74 ncidpl=NCOPN('apbp.nc',NCNOWRIT,rcode) 75 varidap=NCVID(ncidpl,'AP',rcode) 76 varidbp=NCVID(ncidpl,'BP',rcode) 77 print*,'ncidpl,varidap',ncidpl,varidap 78 endif 69 79 70 80 c Vent zonal … … 101 111 102 112 c Pression de surface 103 if ( guide_P) then113 if ((guide_P).OR.(guide_modele)) then 104 114 ncidps=NCOPN('ps.nc',NCNOWRIT,rcode) 105 115 varidps=NCVID(ncidps,'SP',rcode) … … 108 118 109 119 c Coordonnee verticale 110 if (ncep) then 120 if (.not.guide_modele) then 121 if (ncep) then 111 122 print*,'Vous etes entrain de lire des donnees NCEP' 112 123 varidpl=NCVID(ncidpl,'LEVEL',rcode) 113 else124 else 114 125 print*,'Vous etes entrain de lire des donnees ECMWF' 115 126 varidpl=NCVID(ncidpl,'PRESSURE',rcode) 116 endif 117 print*,'ncidu,varidpl',ncidu,varidpl 127 endif 128 print*,'ncidpl,varidpl',ncidpl,varidpl 129 endif 130 ! endif (first) 118 131 endif 119 132 print*,'ok1' 120 133 121 c Niveaux de pression122 print*,'WARNING!!! Il n y a pas de test de coherence'123 print*,'sur le nombre de niveaux verticaux dans le fichier nc'124 #ifdef NC_DOUBLE125 status=NF_GET_VARA_DOUBLE(ncidpl,varidpl,1,nlevnc,pl)126 #else127 status=NF_GET_VARA_REAL(ncidpl,varidpl,1,nlevnc,pl)128 #endif129 c passage en pascal130 pl(:)=100.*pl(:)131 if (first) then132 do l=1,nlevnc133 print*,'PL(',l,')=',pl(l)134 enddo135 endif136 134 137 135 c ----------------------------------------------------------------- … … 158 156 tnc(:,:,:)=0. 159 157 Qnc(:,:,:)=0. 158 plnc(:,:,:)=0. 160 159 161 160 c Vent zonal … … 169 168 status=NF_GET_VARA_REAL(ncidu,varidu,start,count,unc) 170 169 #endif 171 c call dump2d(iip1,jjp1,unc,'VENT NCEP ')172 c call dump2d(iip1,40,unc(1,1,nlevnc),'VENT NCEP ')173 170 print*,'WARNING!!! Correction bidon pour palier a un ' 174 171 print*,'probleme dans la creation des fichiers nc' … … 228 225 c Pression de surface 229 226 c ------------------- 230 231 if ( guide_P)then227 psnc(:,:)=0. 228 if ((guide_P).OR.(guide_modele)) then 232 229 #ifdef NC_DOUBLE 233 230 status=NF_GET_VARA_DOUBLE(ncidps,varidps,start,count,psnc) … … 239 236 endif 240 237 241 238 c Calcul de la pression aux differents niveaux 239 c -------------------------------------------- 240 if (guide_modele) then 241 #ifdef NC_DOUBLE 242 status=NF_GET_VARA_DOUBLE(ncidpl,varidap,1,nlevnc,apnc) 243 status=NF_GET_VARA_DOUBLE(ncidpl,varidbp,1,nlevnc,bpnc) 244 #else 245 status=NF_GET_VARA_REAL(ncidpl,varidap,1,nlevnc,apnc) 246 status=NF_GET_VARA_REAL(ncidpl,varidbp,1,nlevnc,bpnc) 247 #endif 248 else 249 #ifdef NC_DOUBLE 250 status=NF_GET_VARA_DOUBLE(ncidpl,varidpl,1,nlevnc,apnc) 251 #else 252 status=NF_GET_VARA_REAL(ncidpl,varidpl,1,nlevnc,apnc) 253 #endif 254 c conversion en Pascals 255 apnc=apnc*100. 256 bpnc(:)=0. 257 endif 258 do i=1,iip1 259 do j=1,jjp1 260 do l=1,nlevnc 261 plnc(i,j,l)=apnc(l)+bpnc(l)*psnc(i,j) 262 enddo 263 enddo 264 enddo 265 if (first) then 266 print*,'Verification ordre niveaux verticaux' 267 print*,'LMDZ :' 268 do l=1,llm 269 print*,'PL(',l,')=',(ap(l)+ap(l+1))/2. 270 $ +psi(1,jjp1)*(bp(l)+bp(l+1))/2. 271 enddo 272 print*,'Fichiers guidage' 273 do l=1,nlevnc 274 print*,'PL(',l,')=',plnc(1,1,l) 275 enddo 276 if (guide_u) then 277 do l=1,nlevnc 278 print*,'U(',l,')=',unc(1,1,l) 279 enddo 280 endif 281 if (guide_T) then 282 do l=1,nlevnc 283 print*,'T(',l,')=',tnc(1,1,l) 284 enddo 285 endif 286 print *,'inversion de l''ordre: ok_invertp=',ok_invertp 287 endif 242 288 243 289 c ----------------------------------------------------------------- 244 290 c Interpollation verticale sur les niveaux modele 245 291 c ----------------------------------------------------------------- 246 call reanalyse2nat(nlevnc,psi,unc,vnc,tnc,Qnc,psnc,pl ,u,v,t,Q292 call reanalyse2nat(nlevnc,psi,unc,vnc,tnc,Qnc,psnc,plnc,u,v,t,Q 247 293 s ,ps,masse,pk) 248 294 … … 274 320 c=========================================================================== 275 321 subroutine reanalyse2nat(nlevnc,psi 276 s ,unc,vnc,tnc,qnc,psnc,pl ,u,v,t,q322 s ,unc,vnc,tnc,qnc,psnc,plnc,u,v,t,q 277 323 s ,ps,masse,pk) 278 324 c=========================================================================== … … 297 343 real t(iip1,jjp1,llm),ps(iip1,jjp1),q(iip1,jjp1,llm) 298 344 299 real pl (nlevnc)345 real plnc(iip1,jjp1,nlevnc) 300 346 real unc(iip1,jjp1,nlevnc),vnc(iip1,jjm,nlevnc) 301 347 real tnc(iip1,jjp1,nlevnc),psnc(iip1,jjp1) … … 382 428 383 429 c ----------------------------------------------------------------- 384 call pres2lev(unc,zu,nlevnc,llm,pl ,plunc,iip1,jjp1)385 call pres2lev(vnc,zv,nlevnc,llm,pl ,plvnc,iip1,jjm)386 call pres2lev(tnc,zt,nlevnc,llm,pl ,plsnc,iip1,jjp1)387 call pres2lev(qnc,zq,nlevnc,llm,pl ,plsnc,iip1,jjp1)430 call pres2lev(unc,zu,nlevnc,llm,plnc,plunc,iip1,jjp1,ok_invertp) 431 call pres2lev(vnc,zv,nlevnc,llm,plnc,plvnc,iip1,jjm,ok_invertp ) 432 call pres2lev(tnc,zt,nlevnc,llm,plnc,plsnc,iip1,jjp1,ok_invertp) 433 call pres2lev(qnc,zq,nlevnc,llm,plnc,plsnc,iip1,jjp1,ok_invertp) 388 434 389 435 c call dump2d(iip1,jjp1,ps,'PS ') … … 486 532 c Humidite relative -> specifique 487 533 c ------------------------------- 488 if ( 1.eq.0) then534 if (guide_hr) then 489 535 c FINALEMENT ON GUIDE EN HUMIDITE RELATIVE 490 536 print*,'calcul de unskap' … … 499 545 q(:,:,:)=qsat(:,:,:)*rh(:,:,:) 500 546 print*,'calcul de q OK' 501 547 call dump2d(iip1,jjp1,q,'HUMIDITE SPECIFIQUE COUCHE 1 ') 502 548 call dump2d(iip1,jjp1,pres,'PRESSION PREMIERE COUCHE ') 549 else 550 q(:,:,:)=rh(:,:,:) 551 print*,'calcul de q OK' 503 552 call dump2d(iip1,jjp1,q,'HUMIDITE SPECIFIQUE COUCHE 1 ') 504 endif 505 553 endif 506 554 507 555 return
Note: See TracChangeset
for help on using the changeset viewer.