# [ferret_users] Conditional with more than one variable

Dear fellows,

I am trying to calculate the velocity integrated over an area, but I need it to be in the intersection of 3 variables and I can't do it.

Previously, I was able to do it with just 1 variable (density), but when I put the three of them together, something bad happens.

I believe is an error of syntax but I can't figure out the right way to do it.

Here is part of the code:

use temp_salt_out.nc    !d=1
use u_v_out.nc            !d=2
use temp_salt_nov.nc    !d=3
use u_v_nov.nc            !d=4
use temp_salt_dez.nc    !d=5
use u_v_dez.nc            !d=6

set mem/size=100

! Some corrections of the data
let temp_out  = (temperature[d=1]*0.000732)+294-273.15
let salt_out  = (salinity[d=1]*0.00153)+(-0.00153)
let dens_out=rho_un(salinity[d=1],temperature[d=1],0)-1000
let u_out  = (u[d=2]*0.00061)+(0)
let v_out  = (v[d=2]*0.00061)+(0)

! The condition part for temperature, salinity and depth
let u_acas_out = if (temp_out ge 6 and temp_out le 20 and salt_out ge 34.6 and salt_out le 36 and dens_out ge 25.5 and dens_out le 27.2) then u_out

! Calculate the integrated velocity.
let tr_u_out_430=u_acas_out[x=-43,y=-24:-23@din,z=@din]/1e6

Is there anyway to make this work? Any thoughts?

Regards!

--
Lívia Sancho

Oceanógrafa, MSc
+55 (21) 9 8574-0843
+55 (21) 9 8211-5158

Mestrado no Programa de Engenharia Civil (PEC/COPPE - UFRJ)
Área de Petróleo e Gás

Universidade Federal do Rio de Janeiro
Laboratório de Métodos Computacionais em Engenharia
http://www.lamce.coppe.ufrj.br/
E-mail: sancho@xxxxxxxxxxxxxxxxxxx
Tel: +55 (21) 3938-8419

Currículo Lattes