Ignore:
Timestamp:
07/29/14 10:10:51 (10 years ago)
Author:
ymipsl
Message:

Implement restartability for dynamico

YM

File:
1 edited

Legend:

Unmodified
Added
Removed
  • codes/icosagcm/branches/SATURN_DYNAMICO/ICOSAGCM/src/wind.f90

    r221 r260  
    2424  END SUBROUTINE un2ulonlat 
    2525 
     26  SUBROUTINE ulonlat2un(f_ulon, f_ulat,f_u) 
     27  USE icosa 
     28  IMPLICIT NONE 
     29    TYPE(t_field), POINTER :: f_ulon(:), f_ulat(:) ! IN : velocity reconstructed at hexagons 
     30    TYPE(t_field), POINTER :: f_u(:) ! OUT  : normal velocity components on edges 
     31     
     32    REAL(rstd),POINTER :: u(:,:),  ulon(:,:), ulat(:,:) 
     33    INTEGER :: ind 
     34 
     35    DO ind=1,ndomain 
     36       IF (.NOT. assigned_domain(ind)) CYCLE 
     37       CALL swap_dimensions(ind) 
     38       CALL swap_geometry(ind) 
     39       u=f_u(ind) 
     40       ulon=f_ulon(ind) 
     41       ulat=f_ulat(ind) 
     42       CALL compute_ulonlat2un(ulon, ulat,u) 
     43    END DO 
     44 
     45  END SUBROUTINE ulonlat2un 
    2646  
    2747  SUBROUTINE compute_wind_centered(ue,ucenter) 
     
    298318 END SUBROUTINE compute_wind_centered_lonlat_compound 
    299319 
     320 SUBROUTINE compute_wind_centered_from_wind_lonlat_centered(ulon, ulat,uc) 
     321  USE icosa   
     322     
     323  IMPLICIT NONE 
     324  REAL(rstd) :: ulon(iim*jjm,llm) 
     325  REAL(rstd) :: ulat(iim*jjm,llm) 
     326  REAL(rstd) :: uc(iim*jjm,3,llm) 
     327 
     328  INTEGER :: i,j,ij,l      
     329     
     330   
     331    DO l=1,llm 
     332      DO j=jj_begin,jj_end 
     333        DO i=ii_begin,ii_end 
     334          ij=(j-1)*iim+i 
     335          uc(ij,:,l)=ulon(ij,l)*elon_i(ij,:)+ulat(ij,l)*elat_i(ij,:) 
     336        ENDDO 
     337      ENDDO 
     338    ENDDO 
     339  
     340 END SUBROUTINE compute_wind_centered_from_wind_lonlat_centered 
     341 
     342 
     343 
     344 SUBROUTINE compute_wind_perp_from_wind_centered(uc,un) 
     345  USE icosa   
     346     
     347  IMPLICIT NONE 
     348  REAL(rstd),INTENT(IN)   :: uc(iim*jjm,3,llm) 
     349  REAL(rstd),INTENT(OUT)  :: un(3*iim*jjm,llm) 
     350 
     351  INTEGER :: i,j,ij,l      
     352     
     353   
     354    DO l=1,llm 
     355      DO j=jj_begin,jj_end 
     356        DO i=ii_begin,ii_end 
     357          ij=(j-1)*iim+i 
     358          un(ij+u_right,l) = sum(0.5*(uc(ij,:,l) + uc(ij+t_right,:,l))*ep_e(ij+u_right,:)) 
     359          un(ij+u_lup,l) = sum(0.5*(uc(ij,:,l) + uc(ij+t_lup,:,l))*ep_e(ij+u_lup,:)) 
     360          un(ij+u_ldown,l) = sum(0.5*(uc(ij,:,l) + uc(ij+t_ldown,:,l))*ep_e(ij+u_ldown,:)) 
     361         ENDDO 
     362      ENDDO 
     363    ENDDO 
     364  
     365 END SUBROUTINE compute_wind_perp_from_wind_centered 
     366 
     367 
    300368 SUBROUTINE compute_un2ulonlat(un, ulon, ulat) 
    301369  USE icosa   
     
    313381 END SUBROUTINE compute_un2ulonlat 
    314382 
     383 SUBROUTINE compute_ulonlat2un(ulon, ulat,un) 
     384  USE icosa   
     385     
     386  IMPLICIT NONE 
     387  REAL(rstd),INTENT(IN) :: ulon(iim*jjm,llm) 
     388  REAL(rstd),INTENT(IN) :: ulat(iim*jjm,llm) 
     389  REAL(rstd),INTENT(OUT)  :: un(3*iim*jjm,llm) 
     390 
     391  REAL(rstd)             :: uc(iim*jjm,3,llm) 
     392     
     393    CALL compute_wind_centered_from_wind_lonlat_centered(ulon, ulat, uc)   
     394    CALL compute_wind_perp_from_wind_centered(uc, un) 
     395  
     396 END SUBROUTINE compute_ulonlat2un 
     397 
     398 
    315399END MODULE wind_mod 
Note: See TracChangeset for help on using the changeset viewer.