Ignore:
Timestamp:
Jul 24, 2017, 3:56:41 PM (7 years ago)
Author:
dcugnet
Message:

Fix a bug in the longitude interpolation of ozone, leading for some
resolutions to a too small margin to ensure inetrpolation without
any extrapolation.
Also, minor fix in regular_lonlat_mod.F90 routine to ensure that

boundslon_reg(i,east)>boundslon_reg(i,west).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • LMDZ5/trunk/libf/phylmd/regr_horiz_time_climoz_m.F90

    r2788 r2963  
    179179  IF(l3D) THEN
    180180    !--- Compute input edges longitudes vector (no end point yet)
    181     ALLOCATE(v1(nlon_in))
     181    ALLOCATE(v1(nlon_in+1))
    182182    v1(1)=(lon_in(nlon_in)+lon_in(1))/2.-pi
    183183    FORALL(i=2:nlon_in) v1(i)=(lon_in(i-1)+lon_in(i))/2.
     184    v1(nlon_in+1)=v1(1)+2.*pi
    184185    DEALLOCATE(lon_in)
    185186
    186     !--- Shift input longitudes vector until it contains first output point boundslon_reg(1,east)
    187     v1=v1+2*pi*REAL(FLOOR((boundslon_reg(1,east)-v1(1))/(2.*pi)))
    188 
    189     !--- Ensure first input longitudes interval contains first output point boundslon_reg(1,east)
    190     dx1=locate(v1,boundslon_reg(1,east))-1
     187    !--- Shift input longitudes vector until it contains first output point boundslon_reg(1,west)
     188    v1=v1+2*pi*REAL(FLOOR((boundslon_reg(1,west)-v1(1))/(2.*pi)))
     189
     190    !--- Ensure first input longitudes interval contains first output point boundslon_reg(1,west)
     191    dx1=locate(v1,boundslon_reg(1,west))-1
    191192    v1=CSHIFT(v1,SHIFT=dx1,DIM=1); v1(nlon_in-dx1+1:)=v1(nlon_in-dx1+1:)+2.*pi
    192193
    193     !--- Extend input longitudes vector until last interval contains boundslon_reg(nlat_ou,west)
    194     dx2=0; DO WHILE(v1(1+dx2)+2.*pi<boundslon_reg(nlat_ou,west)); dx2=dx2+1; END DO
     194    !--- Extend input longitudes vector until last interval contains boundslon_reg(nlat_ou,east)
     195    dx2=0; DO WHILE(v1(1+dx2)+2.*pi<boundslon_reg(nlon_ou,east)); dx2=dx2+1; END DO
    195196
    196197    !--- Final edges longitudes vector (with margin and end point)
    197     ALLOCATE(lon_in_edge(nlon_in+dx2+1)); lon_in_edge=[v1,v1(1:1+dx2)+2.*pi]
     198    ALLOCATE(lon_in_edge(nlon_in+dx2+1)); lon_in_edge=[v1,v1(2:1+dx2)+2.*pi]
    198199    DEALLOCATE(v1)
    199200  END IF
     
    330331    ALLOCATE(o3_regr_lon(nlon_ou, nlat_in, nlev_in, ie-ib+1, read_climoz))
    331332    CALL regr_conserv(1, o3_in3, xs = lon_in_edge,                             &
    332                         xt = [boundslon_reg(1,east),boundslon_reg(:,west)],    &
     333                        xt = [boundslon_reg(1,west),boundslon_reg(:,east)],    &
    333334                        vt = o3_regr_lon, slope = slopes(1,o3_in3, lon_in_edge))
    334335    DEALLOCATE(o3_in3)
Note: See TracChangeset for help on using the changeset viewer.