Ignore:
Timestamp:
02/22/19 18:09:12 (5 years ago)
Author:
adurocher
Message:

trunk+devel : fixed cross product

File:
1 edited

Legend:

Unmodified
Added
Removed
  • codes/icosagcm/trunk/src/sphere/vector.f90

    r810 r811  
    2323   END FUNCTION dot_product 
    2424    
    25    FUNCTION cross_product(V1,V2) 
     25   FUNCTION cross_product(Va,Vb) 
    2626   IMPLICIT NONE 
    2727     REAL(rstd)     ::cross_product(3) 
    28      REAL(rstd),INTENT(IN) :: V1(3) 
    29      REAL(rstd),INTENT(IN) :: V2(3) 
     28     REAL(rstd),INTENT(IN) :: Va(3) 
     29     REAL(rstd),INTENT(IN) :: Vb(3) 
     30     REAL(rstd) :: V1(3),V2(3) 
     31     V1=.5*(Va+Vb) 
     32     V2=Vb-Va 
    3033     cross_product(1)=V1(2)*V2(3)-V1(3)*V2(2) 
    3134     cross_product(2)=V1(3)*V2(1)-V1(1)*V2(3) 
     
    3336   END FUNCTION cross_product 
    3437 
    35    SUBROUTINE cross_product2(Va,Vb,cross_product) 
     38   SUBROUTINE cross_product2(V1,V2,cross_product_res) 
    3639   IMPLICIT NONE 
    37      REAL(rstd),INTENT(OUT):: cross_product(3) 
    38      REAL(rstd),INTENT(IN) :: Va(3), Vb(3) 
    39      REAL(rstd) :: V1(3),V2(3) 
    40      V1=.5*(Va+Vb) 
    41      V2=Va-Vb 
    42      cross_product(1)=V1(2)*V2(3)-V1(3)*V2(2) 
    43      cross_product(2)=V1(3)*V2(1)-V1(1)*V2(3) 
    44      cross_product(3)=V1(1)*V2(2)-V1(2)*V2(1) 
     40     REAL(rstd),INTENT(OUT):: cross_product_res(3) 
     41     REAL(rstd),INTENT(IN) :: V1(3), V2(3) 
     42     cross_product_res=cross_product(V1,V2) 
    4543   END SUBROUTINE cross_product2 
    4644 
Note: See TracChangeset for help on using the changeset viewer.