- Timestamp:
- Dec 14, 2015, 11:43:09 AM (9 years ago)
- Location:
- LMDZ5/branches/testing
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
LMDZ5/branches/testing
- Property svn:mergeinfo changed
/LMDZ5/trunk merged: 2293-2295,2297,2299-2302,2305-2313,2315,2317-2380,2382-2396
- Property svn:mergeinfo changed
-
LMDZ5/branches/testing/libf/phylmd/regr_lat_time_coefoz_m.F90
r1910 r2408 40 40 ! when we regrid in pressure). 41 41 42 use mod_grid_phy_lmdz, ONLY : nbp_lat 42 43 use regr1_step_av_m, only: regr1_step_av 43 44 use regr3_lint_m, only: regr3_lint … … 45 46 nf95_put_var, nf95_gw_var 46 47 use netcdf, only: nf90_nowrite, nf90_get_var 48 use nrtype, only: pi 49 use regular_lonlat_mod, only: boundslat_reg, south 47 50 48 51 ! Variables local to the procedure: 49 50 include "dimensions.h"51 ! (for "jjm")52 include "paramet.h"53 include "comgeom2.h"54 ! (for "rlatv")55 include "comconst.h"56 ! (for "pi")57 52 58 53 integer ncid_in, ncid_out ! NetCDF IDs for input and output files … … 164 159 call nf95_inq_varid(ncid_in, "latitude", varid) 165 160 call nf95_gw_var(ncid_in, varid, latitude) 166 ! Convert from degrees to rad, because " rlatv" is in rad:161 ! Convert from degrees to rad, because "boundslat_reg" is in rad: 167 162 latitude = latitude / 180. * pi 168 163 n_lat = size(latitude) … … 200 195 201 196 allocate(o3_par_in(n_lat, n_plev, 12)) 202 allocate(v_regr_lat( jjm + 1, n_plev, 0:13))203 allocate(o3_par_out( jjm + 1, n_plev, 360))197 allocate(v_regr_lat(nbp_lat, n_plev, 0:13)) 198 allocate(o3_par_out(nbp_lat, n_plev, 360)) 204 199 205 200 do i_v = 1, n_o3_param … … 214 209 ! We average with respect to sine of latitude, which is 215 210 ! equivalent to weighting by cosine of latitude: 216 v_regr_lat( jjm+1:1:-1, :, 1:12) = regr1_step_av(o3_par_in, &217 xs=sin(lat_in_edg), xt=sin((/- pi / 2, rlatv(jjm:1:-1), pi / 2/)))211 v_regr_lat(nbp_lat:1:-1, :, 1:12) = regr1_step_av(o3_par_in, & 212 xs=sin(lat_in_edg), xt=sin((/- pi / 2, boundslat_reg(nbp_lat-1:1:-1,south), pi / 2/))) 218 213 ! (invert order of indices in "v_regr_lat" because "rlatu" is 219 214 ! in descending order) … … 229 224 ! Write to file: 230 225 call nf95_put_var(ncid_out, varid_out(i_v), & 231 o3_par_out( jjm+1:1:-1, :, :))226 o3_par_out(nbp_lat:1:-1, :, :)) 232 227 ! (The order of "rlatu" is inverted in the output file) 233 228 end do … … 246 241 ! dimensions and variables, and writes one of the coordinate variables. 247 242 243 use mod_grid_phy_lmdz, ONLY : nbp_lat 248 244 use assert_eq_m, only: assert_eq 249 245 … … 251 247 nf95_put_att, nf95_enddef, nf95_copy_att, nf95_put_var 252 248 use netcdf, only: nf90_clobber, nf90_float, nf90_copy_att, nf90_global 249 use nrtype, only: pi 250 use regular_lonlat_mod, only : lat_reg 253 251 254 252 integer, intent(in):: ncid_in, varid_in(:), n_plev … … 257 255 258 256 ! Variables local to the procedure: 259 260 include "dimensions.h"261 ! (for "jjm")262 include "paramet.h"263 include "comgeom2.h"264 ! (for "rlatu")265 include "comconst.h"266 ! (for "pi")267 257 268 258 integer ncerr … … 282 272 call nf95_def_dim(ncid_out, "time", 360, dimid_time) 283 273 call nf95_def_dim(ncid_out, "plev", n_plev, dimid_plev) 284 call nf95_def_dim(ncid_out, "rlatu", jjm + 1, dimid_rlatu)274 call nf95_def_dim(ncid_out, "rlatu", nbp_lat, dimid_rlatu) 285 275 286 276 ! Define coordinate variables: … … 332 322 333 323 ! Write one of the coordinate variables: 334 call nf95_put_var(ncid_out, varid_rlatu, rlatu(jjm+1:1:-1) / pi * 180.)324 call nf95_put_var(ncid_out, varid_rlatu, lat_reg(nbp_lat:1:-1) / pi * 180.) 335 325 ! (convert from rad to degrees and sort in ascending order) 336 326
Note: See TracChangeset
for help on using the changeset viewer.