Ignore:
Timestamp:
10/20/14 23:42:26 (10 years ago)
Author:
dubos
Message:

Partial etat0 cleanup (removed calls to xyz2lonlat)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • codes/icosagcm/trunk/src/etat0_heldsz.f90

    r186 r286  
    66  TYPE(t_field),POINTER :: f_theta_eq(:) 
    77  TYPE(t_field),POINTER :: f_theta(:) 
    8   TYPE(t_field),POINTER :: f_clat(:) ! FIXME, duplication 
    98 
    109  REAL(rstd),ALLOCATABLE,SAVE :: knewt_t(:),kfrict(:) 
     
    6564    REAL(rstd),POINTER :: u(:,:) 
    6665    REAL(rstd),POINTER :: q(:,:,:) 
    67     REAL(rstd),POINTER :: clat(:)  
    6866    REAL(rstd),POINTER :: theta_eq(:,:)  
    6967    REAL(rstd),POINTER :: theta(:,:)  
     
    7876 
    7977       theta_eq=f_theta_eq(ind)  
    80        clat=f_clat(ind)  
    81        CALL compute_Teq(clat,theta_eq) ! FIXME : already done by Init_Teq 
     78       CALL compute_Teq(lat_i,theta_eq) ! FIXME : already done by Init_Teq 
    8279 
    8380       ps=f_ps(ind) 
     
    111108       CALL allocate_field(f_theta,field_t,type_real,llm) 
    112109       CALL allocate_field(f_theta_eq,field_t,type_real,llm) 
    113        CALL allocate_field(f_clat,field_t,type_real) 
    114110       ALLOCATE(knewt_t(llm)); ALLOCATE( kfrict(llm))  
    115111 
     
    147143          CALL swap_dimensions(ind) 
    148144          CALL swap_geometry(ind) 
    149           clat=f_clat(ind) 
    150145          theta_eq=f_theta_eq(ind) 
    151           CALL compute_Teq(clat,theta_eq) 
     146          CALL compute_Teq(lat_i,theta_eq) 
    152147       ENDDO 
    153148 
     
    159154  END SUBROUTINE init_Teq 
    160155 
    161   SUBROUTINE compute_Teq(clat,theta_eq) 
     156  SUBROUTINE compute_Teq(lat,theta_eq) 
    162157    USE icosa 
    163158    USE disvert_mod 
    164159    IMPLICIT NONE   
    165     REAL(rstd),INTENT(OUT) :: clat(iim*jjm) 
     160    REAL(rstd),INTENT(IN) :: lat(iim*jjm) 
    166161    REAL(rstd),INTENT(OUT) :: theta_eq(iim*jjm,llm)  
    167162 
    168     REAL(rstd) :: lon, lat, r, zsig, ddsin, tetastrat, tetajl 
    169     REAL(rstd) :: slat(iim*jjm)  
     163    REAL(rstd) :: r, zsig, ddsin, tetastrat, tetajl 
    170164    INTEGER :: i,j,l,ij 
    171  
    172     DO j=jj_begin-1,jj_end+1 
    173        DO i=ii_begin-1,ii_end+1 
    174           ij=(j-1)*iim+i 
    175           CALL xyz2lonlat(xyz_i(ij,:),lon,lat) 
    176           clat(ij)=cos(lat)  
    177           slat(ij)=sin(lat)  
    178        ENDDO 
    179     ENDDO 
    180165 
    181166    DO l=1,llm 
     
    185170          DO i=ii_begin-1,ii_end+1 
    186171             ij=(j-1)*iim+i 
    187              ddsin=slat(ij)  
     172             ddsin=SIN(lat(ij))  
    188173             tetajl=teta0-delt_y*ddsin*ddsin+eps*ddsin & 
    189174                  -delt_z*(1.-ddsin*ddsin)*log(zsig) 
     
    244229       theta_eq=f_theta_eq(ind)  
    245230       theta=f_theta(ind)  
    246        clat=f_clat(ind)  
    247        CALL compute_heldsz(ps,theta_eq,clat, theta_rhodz,u, theta)  
     231       CALL compute_heldsz(ps,theta_eq,lat_i, theta_rhodz,u, theta)  
    248232    ENDDO 
    249233  END SUBROUTINE held_suarez 
    250234 
    251   SUBROUTINE compute_heldsz(ps,theta_eq,clat, theta_rhodz,u, theta)  
     235  SUBROUTINE compute_heldsz(ps,theta_eq,lat, theta_rhodz,u, theta)  
    252236    USE icosa 
    253237    USE theta2theta_rhodz_mod 
     
    255239    REAL(rstd),INTENT(IN)    :: ps(iim*jjm)  
    256240    REAL(rstd),INTENT(IN)    :: theta_eq(iim*jjm,llm)  
    257     REAL(rstd),INTENT(IN)    :: clat(iim*jjm)  
     241    REAL(rstd),INTENT(IN)    :: lat(iim*jjm)  
    258242    REAL(rstd),INTENT(INOUT) :: theta_rhodz(iim*jjm,llm) 
    259243    REAL(rstd),INTENT(INOUT) :: u(3*iim*jjm,llm) 
     
    268252             ij=(j-1)*iim+i 
    269253             theta(ij,l)=theta(ij,l) - dt*(theta(ij,l)-theta_eq(ij,l))* & 
    270                   (knewt_g+knewt_t(l)*clat(ij)**4 ) 
     254                  (knewt_g+knewt_t(l)*COS(lat(ij))**4 ) 
    271255          ENDDO 
    272256       ENDDO 
Note: See TracChangeset for help on using the changeset viewer.