Changeset 975 for trunk/LMDZ.VENUS/Tools


Ignore:
Timestamp:
May 29, 2013, 12:17:13 PM (12 years ago)
Author:
slebonnois
Message:

SL: small bug in the tool for stream function computation (Venus and Titan)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/LMDZ.VENUS/Tools/psi.F90

    r816 r975  
    4545real,dimension(:,:,:),allocatable :: ps ! surface pressure
    4646real,dimension(:,:,:,:),allocatable :: vitv ! meridional wind (in m/s)
     47real,dimension(:,:,:,:),allocatable :: za   ! areoid levels (m)
    4748
    4849real,dimension(:,:,:,:),allocatable :: rayon ! distance to center (m)
     
    166167! 2.1.4 Altitude above areoide
    167168!===============================================================================
    168 ! Only needed if g(z) on Titan...
    169 
    170 !allocate(za(lonlength,latlength,altlength,timelength))
    171 
    172 !text="zareoid"
    173 !call get_var4d(infid,lonlength,latlength,altlength,timelength,text,za,ierr1,ierr2)
    174 !if (ierr1.ne.NF_NOERR) stop "Error: Failed to get za ID"
    175 !if (ierr2.ne.NF_NOERR) stop "Error: Failed reading zareoid"
     169
     170allocate(za(lonlength,latlength,altlength,timelength))
     171
     172text="zareoid"
     173call get_var4d(infid,lonlength,latlength,altlength,timelength,text,za,ierr1,ierr2)
     174if (ierr1.ne.NF_NOERR) stop "Error: Failed to get za ID"
     175if (ierr2.ne.NF_NOERR) stop "Error: Failed reading zareoid"
    176176
    177177!===============================================================================
     
    191191  do ilev=1,altlength
    192192! Need to be consistent with GCM computations
    193 !    if (za(ilon,ilat,ilev,itim).ne.miss_val) then
     193    if (za(ilon,ilat,ilev,itim).ne.miss_val) then
    194194     rayon(ilon,ilat,ilev,itim) = a0
    195195!     rayon(ilon,ilat,ilev,itim) = za(ilon,ilat,ilev,itim) + a0
    196196      grav(ilon,ilat,ilev,itim) = g0*a0*a0 &
    197197                 /(rayon(ilon,ilat,ilev,itim)*rayon(ilon,ilat,ilev,itim))
    198 !    else
    199 !     rayon(ilon,ilat,ilev,itim) = miss_val
    200 !      grav(ilon,ilat,ilev,itim) = miss_val
    201 !    endif
     198    else
     199     rayon(ilon,ilat,ilev,itim) = miss_val
     200      grav(ilon,ilat,ilev,itim) = miss_val
     201    endif
    202202  enddo
    203203 enddo
     
    220220 do ilev=1,altlength
    221221  do ilon=1,lonlength
    222     if (rayon(ilon,ilat,ilev,itim).ne.miss_val) then
     222    if (dmass(ilon,ilat,ilev,itim).ne.miss_val) then
    223223      vm(ilon,ilat,ilev,itim) = vitv(ilon,ilat,ilev,itim)  &
    224224                              * dmass(ilon,ilat,ilev,itim) &
     
    235235  psi(ilat,altlength,itim) = 0.
    236236  do ilon=1,lonlength
    237     if (rayon(ilon,ilat,altlength,itim).ne.miss_val) then
     237    if (vm(ilon,ilat,altlength,itim).ne.miss_val) then
    238238      psi(ilat,altlength,itim) = psi(ilat,altlength,itim) &
    239239           + vm(ilon,ilat,altlength,itim)
     
    243243  psi(ilat,ilev,itim) = psi(ilat,ilev+1,itim)
    244244  do ilon=1,lonlength
    245     if (rayon(ilon,ilat,ilev,itim).ne.miss_val) then
     245    if (vm(ilon,ilat,ilev,itim).ne.miss_val) then
    246246      psi(ilat,ilev,itim) = psi(ilat,ilev,itim) &
    247247           + vm(ilon,ilat,ilev,itim)
Note: See TracChangeset for help on using the changeset viewer.