Changeset 1046 for LMDZ4/trunk/libf/dyn3dpar/read_reanalyse.F
- Timestamp:
- Nov 6, 2008, 5:39:24 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
LMDZ4/trunk/libf/dyn3dpar/read_reanalyse.F
r764 r1046 26 26 #include "guide.h" 27 27 28 29 28 c arguments 30 29 c --------- 31 30 integer nlevnc 32 integer timestep,mode ,l31 integer timestep,mode 33 32 34 33 real psi(iip1,jjp1) … … 37 36 real masse(iip1,jjp1,llm),pk(iip1,jjp1,llm) 38 37 39 40 38 c local 41 39 c ----- 42 40 integer ncidu,varidu,ncidv,varidv,ncidt,varidt,ncidps,varidps 43 41 integer ncidpl 44 integer varidpl,ncidQ,varidQ 45 save ncidpl,ncidu,varidu,ncidv,varidv,ncidt,varidt,ncidps,varidps 42 integer varidpl,ncidQ,varidQ,varidap,varidbp 43 save ncidu,varidu,ncidv,varidv,ncidt,varidt,ncidps,varidps 44 save ncidpl,varidap,varidbp 46 45 save varidpl,ncidQ,varidQ 47 46 … … 49 48 real*4 tnc(iip1,jjp1,nlevnc),psnc(iip1,jjp1) 50 49 real*4 Qnc(iip1,jjp1,nlevnc) 51 real*4 pl(nlevnc),presnc(iip1,jjp1,nlevnc) 50 real*4 plnc(iip1,jjp1,nlevnc) 51 real*4 apnc(nlevnc),bpnc(nlevnc) 52 52 53 53 integer start(4),count(4),status 54 integer i,j,l 54 55 55 56 real rcode … … 60 61 data first/.true./ 61 62 62 63 64 63 c ----------------------------------------------------------------- 65 64 c Initialisation de la lecture des fichiers … … 68 67 ncidpl=-99 69 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 70 79 71 80 c Vent zonal … … 82 91 varidv=NCVID(ncidv,'VWND',rcode) 83 92 print*,'ncidv,varidv',ncidv,varidv 84 if (ncidpl.eq.-99) ncidpl=ncidu 85 endif 86 93 if (ncidpl.eq.-99) ncidpl=ncidv 94 endif 87 95 88 96 c Temperature … … 91 99 varidt=NCVID(ncidt,'AIR',rcode) 92 100 print*,'ncidt,varidt',ncidt,varidt 93 if (ncidpl.eq.-99) ncidpl=ncid u94 endif 95 101 if (ncidpl.eq.-99) ncidpl=ncidt 102 endif 103 96 104 c Humidite 97 105 if (guide_Q) then … … 99 107 varidQ=NCVID(ncidQ,'RH',rcode) 100 108 print*,'ncidQ,varidQ',ncidQ,varidQ 101 if (ncidpl.eq.-99) ncidpl=ncid u102 endif 103 109 if (ncidpl.eq.-99) ncidpl=ncidQ 110 endif 111 104 112 c Pression de surface 105 if ( guide_P) then113 if ((guide_P).OR.(guide_modele)) then 106 114 ncidps=NCOPN('ps.nc',NCNOWRIT,rcode) 107 115 varidps=NCVID(ncidps,'SP',rcode) 108 116 print*,'ncidps,varidps',ncidps,varidps 109 117 endif 110 111 c Coordonnee vertcale 112 if (ncep) then 118 119 c Coordonnee verticale 120 if (.not.guide_modele) then 121 if (ncep) then 113 122 print*,'Vous etes entrain de lire des donnees NCEP' 114 123 varidpl=NCVID(ncidpl,'LEVEL',rcode) … … 116 125 print*,'Vous etes entrain de lire des donnees ECMWF' 117 126 varidpl=NCVID(ncidpl,'PRESSURE',rcode) 127 endif 128 print*,'ncidpl,varidpl',ncidpl,varidpl 118 129 endif 119 130 print*,'ncidu,varidpl',ncidu,varidpl 120 131 121 132 endif 122 123 133 print*,'ok1' 124 134 … … 126 136 c lecture des champs u, v, T, ps 127 137 c ----------------------------------------------------------------- 128 129 c niveaux de pression130 c -------------------131 132 print*,'WARNING!!! Il n y a pas de test de coherence'133 print*,'sur le nombre de niveaux verticaux dans le fichier nc'134 #ifdef NC_DOUBLE135 status=NF_GET_VARA_DOUBLE(ncidpl,varidpl,1,nlevnc,pl)136 #else137 status=NF_GET_VARA_REAL(ncidpl,varidpl,1,nlevnc,pl)138 #endif139 140 c passage en pascal141 pl(:)=100.*pl(:)142 c passage des presions sur une grille 3D143 do l=1,nlevnc144 presnc(:,:,l)=pl(l)145 enddo146 if(first) then147 do l=1,nlevnc148 print*,'PL(',l,')=',pl(l)149 enddo150 endif151 152 138 153 139 c dimensions pour les champs scalaires et le vent zonal … … 163 149 count(3)=nlevnc 164 150 count(4)=1 165 166 151 167 152 c mise a zero des tableaux … … 171 156 tnc(:,:,:)=0. 172 157 Qnc(:,:,:)=0. 158 plnc(:,:,:)=0. 173 159 174 160 c Vent zonal … … 183 169 status=NF_GET_VARA_REAL(ncidu,varidu,start,count,unc) 184 170 #endif 185 c call dump2d(iip1,jjp1,unc,'VENT NCEP ') 186 c call dump2d(iip1,40,unc(1,1,nlevnc),'VENT NCEP ') 187 print*,'WARNING!!! Correction bidon pour palier a un ' 188 print*,'probleme dans la creation des fichiers nc' 189 call correctbid(iim,jjp1*nlevnc,unc) 190 call dump2d(iip1,jjp1,unc,'UNC COUCHE 1 ') 171 print*,'WARNING!!! Correction bidon pour palier a un ' 172 print*,'probleme dans la creation des fichiers nc' 173 call correctbid(iim,jjp1*nlevnc,unc) 174 call dump2d(iip1,jjp1,unc,'UNC COUCHE 1 ') 191 175 endif 192 176 … … 242 226 c Pression de surface 243 227 c ------------------- 244 245 if ( guide_P)then228 psnc(:,:)=0. 229 if ((guide_P).OR.(guide_modele)) then 246 230 #ifdef NC_DOUBLE 247 231 status=NF_GET_VARA_DOUBLE(ncidps,varidps,start,count,psnc) … … 253 237 endif 254 238 255 239 c Calcul de la pression aux differents niveaux 240 c -------------------------------------------- 241 if (guide_modele) then 242 #ifdef NC_DOUBLE 243 status=NF_GET_VARA_DOUBLE(ncidpl,varidap,1,nlevnc,apnc) 244 status=NF_GET_VARA_DOUBLE(ncidpl,varidbp,1,nlevnc,bpnc) 245 #else 246 status=NF_GET_VARA_REAL(ncidpl,varidap,1,nlevnc,apnc) 247 status=NF_GET_VARA_REAL(ncidpl,varidbp,1,nlevnc,bpnc) 248 #endif 249 else 250 #ifdef NC_DOUBLE 251 status=NF_GET_VARA_DOUBLE(ncidpl,varidpl,1,nlevnc,apnc) 252 #else 253 status=NF_GET_VARA_REAL(ncidpl,varidpl,1,nlevnc,apnc) 254 #endif 255 c conversion en Pascals 256 apnc=apnc*100. 257 bpnc(:)=0. 258 endif 259 do i=1,iip1 260 do j=1,jjp1 261 do l=1,nlevnc 262 plnc(i,j,l)=apnc(l)+bpnc(l)*psnc(i,j) 263 enddo 264 enddo 265 enddo 266 if (first) then 267 print*,'Verification ordre niveaux verticaux' 268 print*,'LMDZ :' 269 do l=1,llm 270 print*,'PL(',l,')=',(ap(l)+ap(l+1))/2. 271 $ +psi(1,jjp1)*(bp(l)+bp(l+1))/2. 272 enddo 273 print*,'Fichiers guidage' 274 do l=1,nlevnc 275 print*,'PL(',l,')=',plnc(1,1,l) 276 enddo 277 if (guide_u) then 278 do l=1,nlevnc 279 print*,'U(',l,')=',unc(1,1,l) 280 enddo 281 endif 282 if (guide_T) then 283 do l=1,nlevnc 284 print*,'T(',l,')=',tnc(1,1,l) 285 enddo 286 endif 287 print *,'inversion de l''ordre: ok_invertp=',ok_invertp 288 endif 256 289 257 290 c ----------------------------------------------------------------- 258 291 c Interpollation verticale sur les niveaux modele 259 292 c ----------------------------------------------------------------- 260 call reanalyse2nat(nlevnc,psi,unc,vnc,tnc,Qnc,psnc,pl ,u,v,t,Q293 call reanalyse2nat(nlevnc,psi,unc,vnc,tnc,Qnc,psnc,plnc,u,v,t,Q 261 294 s ,ps,masse,pk) 262 295 … … 288 321 c=========================================================================== 289 322 subroutine reanalyse2nat(nlevnc,psi 290 s ,unc,vnc,tnc,qnc,psnc,pl ,u,v,t,q323 s ,unc,vnc,tnc,qnc,psnc,plnc,u,v,t,q 291 324 s ,ps,masse,pk) 292 325 c=========================================================================== … … 311 344 real t(iip1,jjp1,llm),ps(iip1,jjp1),q(iip1,jjp1,llm) 312 345 313 real pl (nlevnc)346 real plnc(iip1,jjp1,nlevnc) 314 347 real unc(iip1,jjp1,nlevnc),vnc(iip1,jjm,nlevnc) 315 348 real tnc(iip1,jjp1,nlevnc),psnc(iip1,jjp1) … … 396 429 397 430 c ----------------------------------------------------------------- 398 call pres2lev(unc,zu,nlevnc,llm,pl ,plunc,iip1,jjp1)399 call pres2lev(vnc,zv,nlevnc,llm,pl ,plvnc,iip1,jjm)400 call pres2lev(tnc,zt,nlevnc,llm,pl ,plsnc,iip1,jjp1)401 call pres2lev(qnc,zq,nlevnc,llm,pl ,plsnc,iip1,jjp1)431 call pres2lev(unc,zu,nlevnc,llm,plnc,plunc,iip1,jjp1,ok_invertp) 432 call pres2lev(vnc,zv,nlevnc,llm,plnc,plvnc,iip1,jjm,ok_invertp ) 433 call pres2lev(tnc,zt,nlevnc,llm,plnc,plsnc,iip1,jjp1,ok_invertp) 434 call pres2lev(qnc,zq,nlevnc,llm,plnc,plsnc,iip1,jjp1,ok_invertp) 402 435 403 436 c call dump2d(iip1,jjp1,ps,'PS ') … … 500 533 c Humidite relative -> specifique 501 534 c ------------------------------- 502 if ( 1.eq.0) then535 if (guide_hr) then 503 536 c FINALEMENT ON GUIDE EN HUMIDITE RELATIVE 504 537 print*,'calcul de unskap' … … 513 546 q(:,:,:)=qsat(:,:,:)*rh(:,:,:) 514 547 print*,'calcul de q OK' 515 548 call dump2d(iip1,jjp1,q,'HUMIDITE SPECIFIQUE COUCHE 1 ') 516 549 call dump2d(iip1,jjp1,pres,'PRESSION PREMIERE COUCHE ') 550 else 551 q(:,:,:)=rh(:,:,:) 552 print*,'calcul de q OK' 517 553 call dump2d(iip1,jjp1,q,'HUMIDITE SPECIFIQUE COUCHE 1 ') 518 endif 519 554 endif 520 555 521 556 return
Note: See TracChangeset
for help on using the changeset viewer.