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

devel : temporary hack to use both cellset and read_metric

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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) 
Note: See TracChangeset for help on using the changeset viewer.