[198] | 1 | c $Header |
---|
| 2 | subroutine read_fstoke0(irec, |
---|
| 3 | . zrec,zim,zjm,zlm,rlonu_dy,rlonv_dy,rlatu_dy,rlatv_dy, |
---|
| 4 | . airedy,phis, |
---|
| 5 | . masse,pbaru,pbarv,w,teta,phi) |
---|
| 6 | |
---|
| 7 | IMPLICIT NONE |
---|
| 8 | |
---|
| 9 | #include "netcdf.inc" |
---|
| 10 | #include "dimensions.h" |
---|
| 11 | #include "paramet.h" |
---|
| 12 | #include "comgeom.h" |
---|
| 13 | #include "comvert.h" |
---|
| 14 | |
---|
| 15 | integer nlevnc,irec |
---|
| 16 | parameter (nlevnc=19) |
---|
| 17 | integer mode,l |
---|
| 18 | |
---|
| 19 | real*4 pbaru(iip1,jjp1,llm),pbarv(iip1,jjm,llm) |
---|
| 20 | real*4 teta(iip1,jjp1,llm),phis(iip1,jjp1),phi(iip1,jjp1,llm) |
---|
| 21 | real*4 masse(iip1,jjp1,llm),w(iip1,jjp1,llm) |
---|
| 22 | real*4 airedy(iip1,jjp1) |
---|
| 23 | real*4 rlonu_dy(iip1,jjp1),rlonv_dy(iip1,jjm), |
---|
| 24 | . rlatu_dy(iip1,jjp1),rlatv_dy(iip1,jjm) |
---|
| 25 | integer*4 ncrec,ncim,ncjm,nclm |
---|
| 26 | real zrec,zim,zjm,zlm |
---|
| 27 | integer*4 xid,yid,zid,tid |
---|
| 28 | real*4 zdtvr,ziadvtrac |
---|
| 29 | real adv(1), dtv(1) |
---|
| 30 | |
---|
| 31 | integer ncidf,ncidfv |
---|
| 32 | integer varidpu,varidpv,varidt,varidw,varidps,varidph,varidai |
---|
| 33 | integer varidpl,varidm |
---|
| 34 | integer varidnlo,varidnla,varidnlov,varidnlav |
---|
| 35 | save ncidf,ncidfv |
---|
| 36 | save varidpu,varidpv,varidt,varidw,varidps,varidph,varidai |
---|
| 37 | save varidpl,varidm |
---|
| 38 | save varidnlo,varidnla,varidnlov,varidnlav |
---|
| 39 | |
---|
| 40 | real*4 pl(nlevnc) |
---|
| 41 | |
---|
| 42 | integer start(4),count(4),status |
---|
| 43 | |
---|
| 44 | real rcode |
---|
| 45 | |
---|
| 46 | character namedim |
---|
| 47 | |
---|
| 48 | c --------------------------------------------- |
---|
| 49 | c Initialisation de la lecture des fichiers |
---|
| 50 | c --------------------------------------------- |
---|
| 51 | |
---|
| 52 | if (irec .eq. 0) then |
---|
| 53 | |
---|
| 54 | ncidf=NCOPN('fluxstoke.nc',NCNOWRIT,rcode) |
---|
| 55 | |
---|
| 56 | varidps=NCVID(ncidf,'phis',rcode) |
---|
| 57 | print*,'ncidf,varidps',ncidf,varidps |
---|
| 58 | |
---|
| 59 | varidpl=NCVID(ncidf,'sig_s',rcode) |
---|
| 60 | print*,'ncidf,varidpl',ncidf,varidpl |
---|
| 61 | |
---|
| 62 | varidnlo=NCVID(ncidf,'nav_lon',rcode) |
---|
| 63 | print*,'ncidf,varidnlo',ncidf,varidnlo |
---|
| 64 | |
---|
| 65 | varidnla=NCVID(ncidf,'nav_lat',rcode) |
---|
| 66 | print*,'ncidf,varidnla',ncidf,varidnla |
---|
| 67 | |
---|
| 68 | varidai=NCVID(ncidf,'aire',rcode) |
---|
| 69 | print*,'ncidf,varidai',ncidf,varidai |
---|
| 70 | |
---|
| 71 | varidm=NCVID(ncidf,'masse',rcode) |
---|
| 72 | print*,'ncidf,varidm',ncidf,varidm |
---|
| 73 | |
---|
| 74 | varidpu=NCVID(ncidf,'pbaru',rcode) |
---|
| 75 | print*,'ncidf,varidpu',ncidf,varidpu |
---|
| 76 | |
---|
| 77 | varidw=NCVID(ncidf,'w',rcode) |
---|
| 78 | print*,'ncidf,varidw',ncidf,varidw |
---|
| 79 | |
---|
| 80 | varidt=NCVID(ncidf,'teta',rcode) |
---|
| 81 | print*,'ncidf,varidt',ncidf,varidt |
---|
| 82 | |
---|
| 83 | varidph=NCVID(ncidf,'phi',rcode) |
---|
| 84 | print*,'ncidf,varidph',ncidf,varidph |
---|
| 85 | |
---|
| 86 | ncidfv=NCOPN('fluxstokev.nc',NCNOWRIT,rcode) |
---|
| 87 | |
---|
| 88 | varidpv=NCVID(ncidfv,'pbarv',rcode) |
---|
| 89 | print*,'ncidfv,varidpv',ncidfv,varidpv |
---|
| 90 | |
---|
| 91 | varidnlov=NCVID(ncidfv,'nav_lon',rcode) |
---|
| 92 | print*,'ncidf,varidnlov',ncidf,varidnlov |
---|
| 93 | |
---|
| 94 | varidnlav=NCVID(ncidfv,'nav_lat',rcode) |
---|
| 95 | print*,'ncidfv,varidnlav',ncidfv,varidnlav |
---|
| 96 | |
---|
| 97 | |
---|
| 98 | c ID pour les dimensions |
---|
| 99 | |
---|
| 100 | status = nf_inq_dimid(ncidf,'y',yid) |
---|
| 101 | status = nf_inq_dimid(ncidf,'x',xid) |
---|
| 102 | status = nf_inq_dimid(ncidf,'sig_s',zid) |
---|
| 103 | status = nf_inq_dimid(ncidf,'time_counter',tid) |
---|
| 104 | |
---|
| 105 | c lecture des dimensions |
---|
| 106 | |
---|
| 107 | status = nf_inq_dim(ncidf,yid,namedim,ncjm) |
---|
| 108 | status = nf_inq_dim(ncidf,xid,namedim,ncim) |
---|
| 109 | status = nf_inq_dim(ncidf,zid,namedim,nclm) |
---|
| 110 | status = nf_inq_dim(ncidf,tid,namedim,ncrec) |
---|
| 111 | |
---|
| 112 | zjm=ncjm |
---|
| 113 | zim=ncim |
---|
| 114 | zlm=nclm |
---|
| 115 | zrec=ncrec |
---|
| 116 | |
---|
| 117 | write(*,*) 'read_fstoke : zrec = ', zrec |
---|
| 118 | write(*,*) 'read_fstoke : zlm = ', zlm |
---|
| 119 | write(*,*) 'read_fstoke : zim = ', zim |
---|
| 120 | write(*,*) 'read_fstoke : zjm = ', zjm |
---|
| 121 | |
---|
| 122 | c niveaux de pression |
---|
| 123 | |
---|
| 124 | status=NF_GET_VARA_REAL(ncidf,varidpl,1,zlm,pl) |
---|
| 125 | |
---|
| 126 | c rlonu,rlonv,rlatu,rlatv |
---|
| 127 | |
---|
| 128 | start(1)=1 |
---|
| 129 | start(2)=1 |
---|
| 130 | start(3)=1 |
---|
| 131 | start(4)=0 |
---|
| 132 | |
---|
| 133 | count(1)=zim |
---|
| 134 | count(2)=zjm |
---|
| 135 | count(3)=1 |
---|
| 136 | count(4)=0 |
---|
| 137 | |
---|
| 138 | status=NF_GET_VARA_REAL(ncidf,varidnlo,start,count,rlonu_dy) |
---|
| 139 | status=NF_GET_VARA_REAL(ncidf,varidnla,start,count,rlatu_dy) |
---|
| 140 | |
---|
| 141 | start(1)=1 |
---|
| 142 | start(2)=1 |
---|
| 143 | start(3)=1 |
---|
| 144 | start(4)=0 |
---|
| 145 | |
---|
| 146 | count(1)=zim |
---|
| 147 | count(2)=zjm-1 |
---|
| 148 | count(3)=1 |
---|
| 149 | count(4)=0 |
---|
| 150 | |
---|
| 151 | status=NF_GET_VARA_REAL(ncidfv,varidnlov,start,count,rlonv_dy) |
---|
| 152 | status=NF_GET_VARA_REAL(ncidfv,varidnlav,start,count,rlatv_dy) |
---|
| 153 | |
---|
| 154 | c Lecture de phis et aire |
---|
| 155 | |
---|
| 156 | start(1)=1 |
---|
| 157 | start(2)=1 |
---|
| 158 | start(3)=1 |
---|
| 159 | start(4)=0 |
---|
| 160 | |
---|
| 161 | count(1)=zim |
---|
| 162 | count(2)=zjm |
---|
| 163 | count(3)=1 |
---|
| 164 | count(4)=0 |
---|
| 165 | |
---|
| 166 | c phis |
---|
| 167 | status=NF_GET_VARA_REAL(ncidf,varidps,start,count,phis) |
---|
| 168 | |
---|
| 169 | c aire |
---|
| 170 | status=NF_GET_VARA_REAL(ncidf,varidai,start,count,airedy) |
---|
| 171 | |
---|
| 172 | else |
---|
| 173 | |
---|
| 174 | print*,'ok1' |
---|
| 175 | |
---|
| 176 | c --------------------- |
---|
| 177 | c lecture des champs |
---|
| 178 | c --------------------- |
---|
| 179 | |
---|
| 180 | print*,'WARNING!!! Il n y a pas de test de coherence' |
---|
| 181 | print*,'sur le nombre de niveaux verticaux dans le fichier nc' |
---|
| 182 | |
---|
| 183 | start(1)=1 |
---|
| 184 | start(2)=1 |
---|
| 185 | start(3)=1 |
---|
| 186 | start(4)=irec |
---|
| 187 | |
---|
| 188 | count(1)=zim |
---|
| 189 | count(2)=zjm |
---|
| 190 | count(3)=zlm |
---|
| 191 | count(4)=1 |
---|
| 192 | |
---|
| 193 | c masse |
---|
| 194 | PRINT*,'LECTURE DE masse' |
---|
| 195 | status=NF_GET_VARA_REAL(ncidf,varidm,start,count,masse) |
---|
| 196 | |
---|
| 197 | c pbaru |
---|
| 198 | status=NF_GET_VARA_REAL(ncidf,varidpu,start,count,pbaru) |
---|
| 199 | |
---|
| 200 | c w |
---|
| 201 | status=NF_GET_VARA_REAL(ncidf,varidw,start,count,w) |
---|
| 202 | |
---|
| 203 | c teta |
---|
| 204 | status=NF_GET_VARA_REAL(ncidf,varidt,start,count,teta) |
---|
| 205 | |
---|
| 206 | c phi |
---|
| 207 | status=NF_GET_VARA_REAL(ncidf,varidph,start,count,phi) |
---|
| 208 | |
---|
| 209 | count(2) = zjm-1 |
---|
| 210 | |
---|
| 211 | c pbarv |
---|
| 212 | status=NF_GET_VARA_REAL(ncidfv,varidpv,start,count,pbarv) |
---|
| 213 | |
---|
| 214 | start(3)=irec |
---|
| 215 | start(4)=0 |
---|
| 216 | count(2)=jjp1 |
---|
| 217 | count(3)=1 |
---|
| 218 | count(4)=0 |
---|
| 219 | |
---|
| 220 | endif |
---|
| 221 | |
---|
| 222 | return |
---|
| 223 | end |
---|
| 224 | |
---|