Ignore:
Timestamp:
08/03/18 16:53:37 (6 years ago)
Author:
dubos
Message:

devel : backported from trunk commits r607,r648,r649,r667,r668,r669,r706

File:
1 edited

Legend:

Unmodified
Added
Removed
  • codes/icosagcm/devel/src/diagnostics/wind.F90

    r612 r714  
    1212CONTAINS 
    1313 
    14   SUBROUTINE un2ulonlat(f_u, f_ulon, f_ulat) 
     14  SUBROUTINE un2ulonlat(f_u, f_ulon, f_ulat, scale_) 
    1515    TYPE(t_field), POINTER :: f_u(:) ! IN  : normal velocity components on edges 
    1616    TYPE(t_field), POINTER :: f_ulon(:), f_ulat(:) ! OUT : velocity reconstructed at hexagons     
    17     REAL(rstd),POINTER :: u(:,:),  ulon(:,:), ulat(:,:) 
     17    REAL(rstd),POINTER     :: u(:,:),  ulon(:,:), ulat(:,:) 
     18    REAL(rstd), OPTIONAL   :: scale_  
     19    REAL(rstd)             :: scale 
    1820    INTEGER :: ind 
    19  
     21    scale = MERGE(scale_, 1., PRESENT(scale_)) 
    2022    DO ind=1,ndomain 
    2123       IF (.NOT. assigned_domain(ind)) CYCLE 
     
    2527       ulon=f_ulon(ind) 
    2628       ulat=f_ulat(ind) 
    27        CALL compute_un2ulonlat(u,ulon, ulat) 
     29       CALL compute_un2ulonlat(u,ulon, ulat, scale) 
    2830    END DO 
    2931 
     
    4951  END SUBROUTINE ulonlat2un 
    5052  
    51   SUBROUTINE compute_wind_centered(ue,ucenter) 
     53  SUBROUTINE compute_wind_centered(ue,ucenter,scale_) 
    5254  REAL(rstd) :: ue(3*iim*jjm,llm) 
    5355  REAL(rstd) :: ucenter(iim*jjm,llm,3) 
     56  REAL(rstd), INTENT(IN), OPTIONAL :: scale_ 
    5457  INTEGER :: ij,l 
    55   REAL(rstd), PARAMETER :: scale=1. 
    56   REAL(rstd) :: fac, ue_le, cx,cy,cz, ux,uy,uz 
     58  REAL(rstd) :: scale,fac, ue_le, cx,cy,cz, ux,uy,uz 
     59  scale = MERGE(scale_, 1., PRESENT(scale_)) 
    5760#include "../kernels_hex/wind_centered.k90" 
    5861 END SUBROUTINE compute_wind_centered 
     
    328331 
    329332 
    330  SUBROUTINE compute_un2ulonlat(un, ulon, ulat) 
     333 SUBROUTINE compute_un2ulonlat(un, ulon, ulat, scale) 
    331334  REAL(rstd),INTENT(IN)  :: un(3*iim*jjm,llm) 
    332335  REAL(rstd),INTENT(OUT) :: ulon(iim*jjm,llm) 
    333336  REAL(rstd),INTENT(OUT) :: ulat(iim*jjm,llm) 
    334  
    335337  REAL(rstd)             :: uc(iim*jjm,llm,3) 
    336      
    337   CALL compute_wind_centered(un,uc 
     338  REAL(rstd)             :: scale 
     339  CALL compute_wind_centered(un,uc,scale) 
    338340  CALL compute_wind_centered_lonlat_compound(uc, ulon, ulat) 
    339341  
Note: See TracChangeset for help on using the changeset viewer.