lundi 8 octobre 2018

conversion of OR logical operator from c++ to fortran

what would be the conversion of following c++ logical operator into fortran f90 ? if (vx is present or vy is present). here vx and vy are components of velocity

if(vx || vy){
vT=sqrt(vx*vx + vy*vy);
}

I have tried following

if(vx .or. vy) then
vT = sqrt(vx*vx + vy*vy)
end if

but i am getting error: operands of logical operator '.or.' at (1) are REAL(8)/REAL(8). Can anyone guide me here?

Aucun commentaire:

Enregistrer un commentaire