- Timestamp:
- Apr 22, 2015, 6:28:50 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
dynamico_lmdz/aquaplanet/LMDZ5/libf/phylmd/regr_lat_time_coefoz_m.F90
r3816 r3819 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 … … 51 52 ! Variables local to the procedure: 52 53 53 include "dimensions.h"54 ! (for "jjm")55 56 54 integer ncid_in, ncid_out ! NetCDF IDs for input and output files 57 55 integer n_plev ! number of pressure levels in the input data … … 73 71 ! level "plev(l)". "month" is between 1 and 12.) 74 72 75 real, allocatable:: v_regr_lat(:, :, :) ! ( jjm + 1, n_plev, 0:13)73 real, allocatable:: v_regr_lat(:, :, :) ! (nbp_lat, n_plev, 0:13) 76 74 ! (mean of a variable "v" over a latitude interval) 77 75 ! (First dimension is latitude interval. 78 76 ! The latitude interval for "v_regr_lat(j,:, :)" contains "rlatu(j)". 79 ! If "j" is between 2 and " jjm" then the interval is:77 ! If "j" is between 2 and "nbp_lat-1" then the interval is: 80 78 ! [rlatv(j), rlatv(j-1)] 81 ! If "j" is 1 or " jjm + 1" then the interval is:79 ! If "j" is 1 or "nbp_lat" then the interval is: 82 80 ! [rlatv(1), pi / 2] 83 81 ! or: 84 ! [- pi / 2, rlatv( jjm)]82 ! [- pi / 2, rlatv(nbp_lat-1)] 85 83 ! respectively. 86 84 ! "v_regr_lat(:, l, :)" is for pressure level "plev(l)". 87 85 ! Last dimension is month number.) 88 86 89 real, allocatable:: o3_par_out(:, :, :) ! ( jjm + 1, n_plev, 360)87 real, allocatable:: o3_par_out(:, :, :) ! (nbp_lat, n_plev, 360) 90 88 ! (regridded ozone parameter) 91 89 ! ("o3_par_out(j, l, day)" is at latitude "rlatu(j)", pressure … … 198 196 199 197 allocate(o3_par_in(n_lat, n_plev, 12)) 200 allocate(v_regr_lat( jjm + 1, n_plev, 0:13))201 allocate(o3_par_out( jjm + 1, n_plev, 360))198 allocate(v_regr_lat(nbp_lat, n_plev, 0:13)) 199 allocate(o3_par_out(nbp_lat, n_plev, 360)) 202 200 203 201 do i_v = 1, n_o3_param … … 212 210 ! We average with respect to sine of latitude, which is 213 211 ! equivalent to weighting by cosine of latitude: 214 v_regr_lat( jjm+1:1:-1, :, 1:12) = regr1_step_av(o3_par_in, &215 xs=sin(lat_in_edg), xt=sin((/- pi / 2, rlatv( jjm:1:-1), pi / 2/)))212 v_regr_lat(nbp_lat:1:-1, :, 1:12) = regr1_step_av(o3_par_in, & 213 xs=sin(lat_in_edg), xt=sin((/- pi / 2, rlatv(nbp_lat-1:1:-1), pi / 2/))) 216 214 ! (invert order of indices in "v_regr_lat" because "rlatu" is 217 215 ! in descending order) … … 227 225 ! Write to file: 228 226 call nf95_put_var(ncid_out, varid_out(i_v), & 229 o3_par_out( jjm+1:1:-1, :, :))227 o3_par_out(nbp_lat:1:-1, :, :)) 230 228 ! (The order of "rlatu" is inverted in the output file) 231 229 end do … … 244 242 ! dimensions and variables, and writes one of the coordinate variables. 245 243 244 use mod_grid_phy_lmdz, ONLY : nbp_lat 246 245 use assert_eq_m, only: assert_eq 247 246 … … 260 259 ! Variables local to the procedure: 261 260 262 include "dimensions.h"263 ! (for "jjm")264 261 265 262 integer ncerr … … 279 276 call nf95_def_dim(ncid_out, "time", 360, dimid_time) 280 277 call nf95_def_dim(ncid_out, "plev", n_plev, dimid_plev) 281 call nf95_def_dim(ncid_out, "rlatu", jjm + 1, dimid_rlatu)278 call nf95_def_dim(ncid_out, "rlatu", nbp_lat, dimid_rlatu) 282 279 283 280 ! Define coordinate variables: … … 329 326 330 327 ! Write one of the coordinate variables: 331 call nf95_put_var(ncid_out, varid_rlatu, rlatu( jjm+1:1:-1) / pi * 180.)328 call nf95_put_var(ncid_out, varid_rlatu, rlatu(nbp_lat:1:-1) / pi * 180.) 332 329 ! (convert from rad to degrees and sort in ascending order) 333 330
Note: See TracChangeset
for help on using the changeset viewer.