Changeset 993 for codes


Ignore:
Timestamp:
11/15/19 11:03:17 (5 years ago)
Author:
rpennel
Message:

devel : temporary hack to use both cellset and read_metric

Location:
codes/icosagcm/devel/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • codes/icosagcm/devel/src/icosa_init.f90

    r992 r993  
    4545  !$OMP PARALLEL   
    4646    CALL switch_omp_no_distrib_level 
     47 
     48    ! RPNL 2019/11 Temp hack to use read_metric and devel cellset structure 
     49    CALL allocate_geometry 
     50    CALL compute_geometry 
     51 
    4752    CALL read_metric 
    4853    CALL compute_geometry 
  • codes/icosagcm/devel/src/output/set_bounds.f90

    r880 r993  
    3232    cells%ncell = n 
    3333     
    34     ! now set bounds 
    35     ALLOCATE(cells%ij(n), cells%lon(n), cells%lat(n), cells%ind_glo(n)) 
    36     ALLOCATE(cells%bnds_lon(0:5,n), cells%bnds_lat(0:5,n)) 
     34    IF ( .NOT. ALLOCATED(cells%ij) ) THEN  
     35        ! now set bounds 
     36        ALLOCATE(cells%ij(n), cells%lon(n), cells%lat(n), cells%ind_glo(n)) 
     37        ALLOCATE(cells%bnds_lon(0:5,n), cells%bnds_lat(0:5,n)) 
     38    END IF 
    3739 
    3840    n=0 
     
    7476    cells%ncell = n 
    7577 
    76     ! now set bounds 
    77     ALLOCATE(cells%ind_glo(n)) ! not set but must be allocated 
    78     ALLOCATE(cells%ij(n), cells%lon(n), cells%lat(n)) 
    79     ALLOCATE(cells%bnds_lon(0:2,n), cells%bnds_lat(0:2,n)) 
     78    IF ( .NOT. ALLOCATED( cells%ind_glo ) ) THEN  
     79        ! now set bounds 
     80        ALLOCATE(cells%ind_glo(n)) ! not set but must be allocated 
     81        ALLOCATE(cells%ij(n), cells%lon(n), cells%lat(n)) 
     82        ALLOCATE(cells%bnds_lon(0:2,n), cells%bnds_lat(0:2,n)) 
     83    END IF 
    8084 
    8185    n=0 
     
    138142    cells%ncell = n 
    139143 
    140     ! now set bounds 
    141     ALLOCATE(cells%ij(n), cells%lon(n), cells%lat(n), cells%ind_glo(n)) 
    142     ALLOCATE(cells%sgn(n)) ! flip sign when reading/writing 
    143     ALLOCATE(cells%bnds_lon(2,n), cells%bnds_lat(2,n)) 
     144    IF ( .NOT. ALLOCATED( cells%ij ) ) THEN  
     145        ! now set bounds 
     146        ALLOCATE(cells%ij(n), cells%lon(n), cells%lat(n), cells%ind_glo(n)) 
     147        ALLOCATE(cells%sgn(n)) ! flip sign when reading/writing 
     148        ALLOCATE(cells%bnds_lon(2,n), cells%bnds_lat(2,n)) 
     149    END IF  
    144150 
    145151    CALL swap_dimensions(ind) 
  • codes/icosagcm/devel/src/sphere/compute_geometry.f90

    r880 r993  
    123123    CALL update_circumcenters 
    124124 
    125     DO ind=1,ndomain 
    126       IF (.NOT. assigned_domain(ind)  .OR. .NOT. is_omp_level_master ) CYCLE 
    127       d=>domain(ind) 
    128       CALL swap_dimensions(ind) 
    129       CALL swap_geometry(ind) 
    130       DO j=jj_begin,jj_end 
    131         DO i=ii_begin,ii_end 
    132           n=(j-1)*iim+i 
    133           DO k=0,5 
    134             x1(:) = xyz_v(n+z_pos(k+1),:) 
    135             x2(:) = d%vertex(:,k,i,j)  
    136             IF (norm(x1-x2)>1e-10) THEN 
    137               PRINT*,"vertex diff ",ind,i,j,k 
    138               PRINT*,x1 
    139               PRINT*,x2 
    140             ENDIF 
    141           ENDDO 
    142         ENDDO 
    143       ENDDO 
    144     ENDDO 
     125!ym you get discrepency if you try to read metric from file, vertex are not saved in file 
     126!    DO ind=1,ndomain 
     127!      IF (.NOT. assigned_domain(ind)  .OR. .NOT. is_omp_level_master ) CYCLE 
     128!      d=>domain(ind) 
     129!      CALL swap_dimensions(ind) 
     130!      CALL swap_geometry(ind) 
     131!      DO j=jj_begin,jj_end 
     132!        DO i=ii_begin,ii_end 
     133!          n=(j-1)*iim+i 
     134!          DO k=0,5 
     135!            x1(:) = xyz_v(n+z_pos(k+1),:) 
     136!            x2(:) = d%vertex(:,k,i,j)  
     137!            IF (norm(x1-x2)>1e-10) THEN 
     138!              PRINT*,"vertex diff ",ind,i,j,k 
     139!              PRINT*,x1 
     140!              PRINT*,x2 
     141!            ENDIF 
     142!          ENDDO 
     143!        ENDDO 
     144!      ENDDO 
     145!   ENDDO 
    145146     
    146147     
     
    539540    USE init_unstructured_mod, ONLY : read_local_mesh 
    540541    USE set_bounds_mod, ONLY : set_bounds 
    541     CALL allocate_geometry 
     542 
     543!        CALL allocate_geometry  
    542544 
    543545    SELECT CASE(grid_type) 
Note: See TracChangeset for help on using the changeset viewer.