Ignore:
Timestamp:
12/24/16 02:33:07 (7 years ago)
Author:
dubos
Message:

Fixed RK2.5 - cleanup to follow

File:
1 edited

Legend:

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

    r487 r519  
    2626    REAL(rstd),POINTER :: u(:,:) , um1(:,:), um2(:,:), du(:,:) 
    2727    REAL(rstd),POINTER :: rhodz(:,:), mass(:,:), massm1(:,:), massm2(:,:), dmass(:,:) 
    28     REAL(rstd),POINTER :: theta_rhodz(:,:) , theta_rhodzm1(:,:), theta_rhodzm2(:,:), dtheta_rhodz(:,:) 
     28    REAL(rstd),POINTER :: theta_rhodz(:,:,:) , theta_rhodzm1(:,:,:), theta_rhodzm2(:,:,:), dtheta_rhodz(:,:,:) 
    2929    REAL(rstd),POINTER :: hflux(:,:),wflux(:,:),hfluxt(:,:),wfluxt(:,:) 
    3030    LOGICAL :: fluxt_zero(ndomain) ! set to .TRUE. to start accumulating fluxes in time 
    3131    INTEGER :: it,stage 
     32     
     33    CALL legacy_to_DEC(f_ps, f_u) 
    3234    DO stage=1,nb_stage 
    3335       !       CALL checksum(f_ps) 
     
    5355       END SELECT 
    5456    END DO 
     57    CALL DEC_to_legacy(f_ps, f_u) 
    5558 
    5659  CONTAINS 
     
    142145                  um1(ij+u_lup,l)=u(ij+u_lup,l) 
    143146                  um1(ij+u_ldown,l)=u(ij+u_ldown,l) 
    144                   theta_rhodzm1(ij,l)=theta_rhodz(ij,l) 
     147                  theta_rhodzm1(ij,l,1)=theta_rhodz(ij,l,1) 
    145148               ENDDO 
    146149            ENDDO 
     
    153156               u(ij+u_lup,l)=um1(ij+u_lup,l)+tau*du(ij+u_lup,l) 
    154157               u(ij+u_ldown,l)=um1(ij+u_ldown,l)+tau*du(ij+u_ldown,l) 
    155                theta_rhodz(ij,l)=theta_rhodzm1(ij,l)+tau*dtheta_rhodz(ij,l) 
     158               theta_rhodz(ij,l,1)=theta_rhodzm1(ij,l,1)+tau*dtheta_rhodz(ij,l,1) 
    156159            ENDDO 
    157160         ENDDO 
     
    188191 
    189192         IF (stage==1) THEN 
    190             psm1(:)=ps(:) ; um1(:,:)=u(:,:) ; theta_rhodzm1(:,:)=theta_rhodz(:,:) 
     193            psm1(:)=ps(:) ; um1(:,:)=u(:,:) ; theta_rhodzm1(:,:,:)=theta_rhodz(:,:,:) 
    191194            ps(:)=psm1(:)+tau*dps(:) 
    192195            u(:,:)=um1(:,:)+tau*du(:,:) 
    193             theta_rhodz(:,:)=theta_rhodzm1(:,:)+tau*dtheta_rhodz(:,:) 
     196            theta_rhodz(:,:,:)=theta_rhodzm1(:,:,:)+tau*dtheta_rhodz(:,:,:) 
    194197 
    195198         ELSE IF (stage==2) THEN 
     
    197200            ps(:)=psm1(:)+tau*dps(:) 
    198201            u(:,:)=um1(:,:)+tau*du(:,:) 
    199             theta_rhodz(:,:)=theta_rhodzm1(:,:)+tau*dtheta_rhodz(:,:) 
    200  
    201             psm2(:)=psm1(:) ; theta_rhodzm2(:,:)=theta_rhodzm1(:,:) ; um2(:,:)=um1(:,:)  
    202             psm1(:)=ps(:) ; theta_rhodzm1(:,:)=theta_rhodz(:,:) ; um1(:,:)=u(:,:)  
     202            theta_rhodz(:,:,:)=theta_rhodzm1(:,:,:)+tau*dtheta_rhodz(:,:,:) 
     203 
     204            psm2(:)=psm1(:) ; theta_rhodzm2(:,:,:)=theta_rhodzm1(:,:,:) ; um2(:,:)=um1(:,:)  
     205            psm1(:)=ps(:) ; theta_rhodzm1(:,:,:)=theta_rhodz(:,:,:) ; um1(:,:)=u(:,:)  
    203206 
    204207         ELSE  
     
    206209            ps(:)=psm2(:)+2*tau*dps(:) 
    207210            u(:,:)=um2(:,:)+2*tau*du(:,:) 
    208             theta_rhodz(:,:)=theta_rhodzm2(:,:)+2*tau*dtheta_rhodz(:,:) 
    209  
    210             psm2(:)=psm1(:) ; theta_rhodzm2(:,:)=theta_rhodzm1(:,:) ; um2(:,:)=um1(:,:)  
    211             psm1(:)=ps(:) ; theta_rhodzm1(:,:)=theta_rhodz(:,:) ; um1(:,:)=u(:,:)  
     211            theta_rhodz(:,:,:)=theta_rhodzm2(:,:,:)+2*tau*dtheta_rhodz(:,:,:) 
     212 
     213            psm2(:)=psm1(:) ; theta_rhodzm2(:,:,:)=theta_rhodzm1(:,:,:) ; um2(:,:)=um1(:,:)  
     214            psm1(:)=ps(:) ; theta_rhodzm1(:,:,:)=theta_rhodz(:,:,:) ; um1(:,:)=u(:,:)  
    212215 
    213216         ENDIF 
Note: See TracChangeset for help on using the changeset viewer.