From e2463e931e5bfbdb2917f2e1683206d5def78367 Mon Sep 17 00:00:00 2001 From: POLCHER Jan <jan.polcher@lmd.jussieu.fr> Date: Fri, 5 Jun 2020 07:50:15 +0200 Subject: [PATCH] Correct the global indicing of the grid so that it matches the one of ORCHIDEE. --- F90subroutines/routing_reg.f90 | 4 ---- Interface.py | 2 +- ModelGrid.py | 4 ++-- Partition.py | 4 ++-- 4 files changed, 5 insertions(+), 9 deletions(-) diff --git a/F90subroutines/routing_reg.f90 b/F90subroutines/routing_reg.f90 index 52464f9..e569b5b 100644 --- a/F90subroutines/routing_reg.f90 +++ b/F90subroutines/routing_reg.f90 @@ -2090,7 +2090,6 @@ SUBROUTINE routing_reg_linkup(nbpt, neighbours, nwbas, ijdimmax, inflowmax, basi IF ( outflow_basin(sp,sb) == bop ) THEN found = 1 solved(sp,1) = solved(sp,1) + 1 - WRITE(numout,*) sp,sb,"flow in the same grid, basin:",bop ELSE WRITE(*,*) sp, sb, "flows in the same grid but has an error !" ENDIF @@ -2526,9 +2525,6 @@ SUBROUTINE routing_reg_fetch(nbpt, gridarea, contfrac, nwbas, nbcore, corepts, b ! ENDDO ! - WRITE(numout,*) 'The smallest FETCH :', MINVAL(fetch_basin) - WRITE(numout,*) 'The largest FETCH :', MAXVAL(fetch_basin) - ! ! nboutflow = 0 outflow_uparea(:) = zero diff --git a/Interface.py b/Interface.py index 4d32f1c..bb2d1e9 100644 --- a/Interface.py +++ b/Interface.py @@ -628,7 +628,7 @@ class HydroGraph : var[np.isnan(var)] = NCFillValue elif orig_type == "int": var[np.isnan(var)] = RPP.IntFillValue - var[var>=np.abs(RPP.IntFillValue)] = NCFillValue + var[var==RPP.IntFillValue] = NCFillValue if part.rank == 0: ncvar = outnf.createVariable(name, vtyp, coord, fill_value=NCFillValue) diff --git a/ModelGrid.py b/ModelGrid.py index f5e3269..f80ab8f 100644 --- a/ModelGrid.py +++ b/ModelGrid.py @@ -53,7 +53,7 @@ def gatherland(lon, lat, land, indP, indFi, indFj) : # neighbours = [get_neighbours(i,j,ni,nj,land, coord, lon, lat) for j,i in indP_land] # - return nbland, coord,neighbours,indP_land,indF_land + return nbland, coord, neighbours, indP_land, indF_land # def get_neighbours(i,j, ni, nj, land, coord, lon, lat): nn = [[j+r[0], i +r[1]] for r in rose] @@ -224,7 +224,7 @@ class ModelGrid : griddesc, self.lon_full, self.lat_full, self.res_lon, self.res_lat = getcoordinates(geo, istart, ni, jstart, nj) self.nj,self.ni = self.lon_full.shape # - # Extract the land/ea mask. + # Extract the land/sea mask. # self.land = getland(geo, istart, ni, jstart, nj) ind=np.reshape(np.array(range(self.land.shape[0]*self.land.shape[1])),self.land.shape) diff --git a/Partition.py b/Partition.py index db43384..9865586 100644 --- a/Partition.py +++ b/Partition.py @@ -294,8 +294,8 @@ def landindexmap(istart, ni, jstart, nj, land) : gindland=np.zeros((gnj,gni), dtype=np.int32) gindland[:,:]=-1 n=0 - for i in range(gni) : - for j in range(gnj) : + for j in range(gnj) : + for i in range(gni) : if (land[j,i] > 0 ) : gindland[j,i] = n n += 1 -- GitLab