Changeset 1454 for trunk/LMDZ.TITAN/Tools/tem.F90
- Timestamp:
- Jun 16, 2015, 7:01:30 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LMDZ.TITAN/Tools/tem.F90
r816 r1454 37 37 integer,dimension(3) :: datashape3d ! shape of 3D datasets 38 38 39 real :: miss_val =9.99e+33! special "missing value" to specify missing data40 real,parameter :: miss_val_def= 9.99e+33 ! default value for "missing value"39 real :: miss_val ! special "missing value" to specify missing data 40 real,parameter :: miss_val_def=-9.99e+33 ! default value for "missing value" 41 41 real :: pi 42 42 real,dimension(:),allocatable :: lon ! longitude 43 43 integer lonlength ! # of grid points along longitude 44 44 real,dimension(:),allocatable :: lat ! latitude 45 real,dimension(:),allocatable :: latrad ! latitude in radian45 real,dimension(:),allocatable :: coslat ! cos of latitude 46 46 integer latlength ! # of grid points along latitude 47 47 real,dimension(:),allocatable :: plev ! Pressure levels (Pa) … … 107 107 108 108 pi = 2.*asin(1.) 109 miss_val = miss_val_def 109 110 110 111 write(*,*) "" … … 145 146 if (ierr.ne.NF_NOERR) stop "Error: Failed reading lat" 146 147 147 allocate(latrad(latlength)) 148 latrad = lat*pi/180. 148 allocate(coslat(latlength)) 149 ! Beware of rounding problems at poles... 150 coslat(:) = max(0.,cos(lat(:)*pi/180.)) 149 151 150 152 ! Lat, lon pressure intervals 151 deltalat = abs(lat rad(2)-latrad(1))153 deltalat = abs(lat(2)-lat(1))*pi/180. 152 154 deltalon = abs(lon(2)-lon(1))*pi/180. 153 155 … … 196 198 197 199 text="temp" 198 call get_var4d(infid,lonlength,latlength,altlength,timelength,text,temp, ierr1,ierr2)200 call get_var4d(infid,lonlength,latlength,altlength,timelength,text,temp,miss_val,ierr1,ierr2) 199 201 if (ierr1.ne.NF_NOERR) then 200 202 write(*,*) " looking for t instead... " 201 203 text="t" 202 call get_var4d(infid,lonlength,latlength,altlength,timelength,text,temp, ierr1,ierr2)204 call get_var4d(infid,lonlength,latlength,altlength,timelength,text,temp,miss_val,ierr1,ierr2) 203 205 if (ierr1.ne.NF_NOERR) stop "Error: Failed to get temperature ID" 204 206 endif … … 214 216 ! zonal wind vitu (in m/s) 215 217 text="vitu" 216 call get_var4d(infid,lonlength,latlength,altlength,timelength,text,vitu, ierr1,ierr2)218 call get_var4d(infid,lonlength,latlength,altlength,timelength,text,vitu,miss_val,ierr1,ierr2) 217 219 if (ierr1.ne.NF_NOERR) stop "Error: Failed to get vitu ID" 218 220 if (ierr2.ne.NF_NOERR) stop "Error: Failed reading zonal wind" … … 220 222 ! meridional wind vitv (in m/s) 221 223 text="vitv" 222 call get_var4d(infid,lonlength,latlength,altlength,timelength,text,vitv, ierr1,ierr2)224 call get_var4d(infid,lonlength,latlength,altlength,timelength,text,vitv,miss_val,ierr1,ierr2) 223 225 if (ierr1.ne.NF_NOERR) stop "Error: Failed to get vitv ID" 224 226 if (ierr2.ne.NF_NOERR) stop "Error: Failed reading meridional wind" … … 226 228 ! vertical wind vitw (in Pa/s) 227 229 text="vitw" 228 call get_var4d(infid,lonlength,latlength,altlength,timelength,text,vitw, ierr1,ierr2)230 call get_var4d(infid,lonlength,latlength,altlength,timelength,text,vitw,miss_val,ierr1,ierr2) 229 231 if (ierr1.ne.NF_NOERR) stop "Error: Failed to get vitw ID" 230 232 if (ierr2.ne.NF_NOERR) stop "Error: Failed reading vertical wind" … … 238 240 239 241 ! text="zareoid" 240 ! call get_var4d(infid,lonlength,latlength,altlength,timelength,text,za, ierr1,ierr2)242 ! call get_var4d(infid,lonlength,latlength,altlength,timelength,text,za,miss_val,ierr1,ierr2) 241 243 ! if (ierr1.ne.NF_NOERR) stop "Error: Failed to get za ID" 242 244 ! if (ierr2.ne.NF_NOERR) stop "Error: Failed reading zareoid" … … 312 314 grav(lonlength+1,:,:,:) = grav(1,:,:,:) 313 315 314 call cellmass(infid,latlength,lonlength+1,altlength,timelength, &315 lmdflag,deltalon,deltalat,latrad,plev,ps,grav,rayon, &316 call cellmass(infid,latlength,lonlength+1,altlength,timelength,lmdflag, & 317 miss_val,deltalon,deltalat,coslat,plev,ps,grav,rayon, & 316 318 dmass ) 317 319 … … 359 361 call moyzon(lonlength,latlength,altlength,miss_val,u3d,ubar) 360 362 361 call epflux(lonlength+1,latlength,altlength,miss_val,lat rad,rbar &363 call epflux(lonlength+1,latlength,altlength,miss_val,lat,rbar & 362 364 ,teta,u3d,v3d,w3d,plev & 363 365 ,epy2d,epz2d,div2d,vtem2d,wtem2d,ammc2d & … … 376 378 ! rsurg: r*dp/g = dm/(r cos(lat) dlon dlat) !!! 377 379 rsurg(ilon,ilat,ilev) = dmass(ilon,ilat,ilev,itim) & 378 / (r3d(ilon,ilat,ilev)*cos (latrad(ilat))*deltalon*deltalat)380 / (r3d(ilon,ilat,ilev)*coslat(ilat)*deltalon*deltalat) 379 381 else 380 382 rsurg(ilon,ilat,ilev) = miss_val … … 391 393 (rsurgbar(ilat,ilev).ne.miss_val) ) then 392 394 vm(ilat,ilev) = vtem2d(ilat,ilev) & 393 * 2.*pi*rsurgbar(ilat,ilev)*cos (latrad(ilat))395 * 2.*pi*rsurgbar(ilat,ilev)*coslat(ilat) 394 396 else 395 397 vm(ilat,ilev) = miss_val
Note: See TracChangeset
for help on using the changeset viewer.