Changeset 2440
- Timestamp:
- Feb 9, 2016, 3:45:31 PM (9 years ago)
- Location:
- LMDZ5/trunk/libf
- Files:
-
- 2 added
- 5 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
LMDZ5/trunk/libf/obsolete/LIST.txt
r2321 r2440 6 6 phylmd/mkstat.F90 2320 7 7 phylmd/inistats.F90 2320 8 misc/regr1_step_av_m.F90 2439 -
LMDZ5/trunk/libf/phylmd/regr_lat_time_climoz_m.F90
r2346 r2440 67 67 68 68 use mod_grid_phy_lmdz, ONLY : nbp_lat 69 use regr1_ step_av_m, only: regr1_step_av69 use regr1_conserv_m, only: regr1_conserv 70 70 use regr3_lint_m, only: regr3_lint 71 71 use netcdf95, only: handle_err, nf95_close, nf95_get_att, nf95_gw_var, & … … 76 76 use regular_lonlat_mod, only : boundslat_reg, south 77 77 use nrtype, only: pi 78 use slopes_m, only: slopes 78 79 79 80 integer, intent(in):: read_climoz ! read ozone climatology … … 92 93 ! (of input data, converted to rad, sorted in strictly ascending order) 93 94 94 real, allocatable:: lat_in_edg(:)95 ! ( edges of latitude intervals for input data, in rad, in strictly95 real, allocatable:: sin_lat_in_edg(:) 96 ! (sine of edges of latitude intervals for input data, in rad, in strictly 96 97 ! ascending order) 97 98 … … 115 116 116 117 real, allocatable:: o3_regr_lat(:, :, :, :) 117 ! ( jjm + 1, n_plev, 0:13, read_climoz)118 ! (nbp_lat, n_plev, 0:13, read_climoz) 118 119 ! mean of "o3_in" over a latitude interval of LMDZ 119 120 ! First dimension is latitude interval. 120 121 ! The latitude interval for "o3_regr_lat(j,:, :, :)" contains "rlatu(j)". 121 ! If "j" is between 2 and " jjm" then the interval is:122 ! If "j" is between 2 and "nbp_lat - 1" then the interval is: 122 123 ! [rlatv(j), rlatv(j-1)] 123 ! If "j" is 1 or " jjm + 1" then the interval is:124 ! If "j" is 1 or "nbp_lat" then the interval is: 124 125 ! [rlatv(1), pi / 2] 125 126 ! or: 126 ! [- pi / 2, rlatv( jjm)]127 ! [- pi / 2, rlatv(nbp_lat - 1)] 127 128 ! respectively. 128 129 ! "o3_regr_lat(:, k, :, :)" is for pressure level "plev(k)". … … 132 133 133 134 real, allocatable:: o3_out(:, :, :, :) 134 ! ( jjm + 1, n_plev, 360, read_climoz)135 ! (nbp_lat, n_plev, 360, read_climoz) 135 136 ! regridded ozone climatology 136 137 ! "o3_out(j, k, l, :)" is at latitude "rlatu(j)", pressure … … 175 176 latitude = latitude / 180. * pi 176 177 n_lat = size(latitude) 177 ! We need to supply the latitudes to "regr1_ step_av" in178 ! We need to supply the latitudes to "regr1_conserv" in 178 179 ! ascending order, so invert order if necessary: 179 180 desc_lat = latitude(1) > latitude(n_lat) … … 181 182 182 183 ! Compute edges of latitude intervals: 183 allocate(lat_in_edg(n_lat + 1)) 184 lat_in_edg(1) = - pi / 2 185 forall (j = 2:n_lat) lat_in_edg(j) = (latitude(j - 1) + latitude(j)) / 2 186 lat_in_edg(n_lat + 1) = pi / 2 184 allocate(sin_lat_in_edg(n_lat + 1)) 185 sin_lat_in_edg(1) = - 1. 186 forall (j = 2:n_lat) sin_lat_in_edg(j) = sin((latitude(j - 1) & 187 + latitude(j)) / 2.) 188 sin_lat_in_edg(n_lat + 1) = 1. 187 189 deallocate(latitude) ! pointer 188 190 … … 292 294 print *, & 293 295 "Found 12 months in ozone climatologies, assuming periodicity..." 294 o3_regr_lat(nbp_lat:1:-1, :, 1:12, :) = regr1_step_av(o3_in, & 295 xs=sin(lat_in_edg), xt=sin((/- pi / 2, boundslat_reg(nbp_lat-1:1:-1,south), pi / 2/))) 296 call regr1_conserv(o3_in, xs = sin_lat_in_edg, & 297 xt = (/- 1., sin(boundslat_reg(nbp_lat - 1:1:- 1, south)), 1./), & 298 vt = o3_regr_lat(nbp_lat:1:- 1, :, 1:12, :), & 299 slope = slopes(o3_in, sin_lat_in_edg)) 296 300 ! (invert order of indices in "o3_regr_lat" because "rlatu" is 297 301 ! in descending order) … … 303 307 else 304 308 print *, "Using 14 months in ozone climatologies..." 305 o3_regr_lat(nbp_lat:1:-1, :, :, :) = regr1_step_av(o3_in, & 306 xs=sin(lat_in_edg), xt=sin((/- pi / 2, boundslat_reg(nbp_lat-1:1:-1,south), pi / 2/))) 309 call regr1_conserv(o3_in, xs = sin_lat_in_edg, & 310 xt = (/- 1., sin(boundslat_reg(nbp_lat - 1:1:- 1, south)), 1./), & 311 vt = o3_regr_lat(nbp_lat:1:- 1, :, :, :), & 312 slope = slopes(o3_in, sin_lat_in_edg)) 307 313 ! (invert order of indices in "o3_regr_lat" because "rlatu" is 308 314 ! in descending order) -
LMDZ5/trunk/libf/phylmd/regr_lat_time_coefoz_m.F90
r2346 r2440 41 41 42 42 use mod_grid_phy_lmdz, ONLY : nbp_lat 43 use regr1_ step_av_m, only: regr1_step_av43 use regr1_conserv_m, only: regr1_conserv 44 44 use regr3_lint_m, only: regr3_lint 45 45 use netcdf95, only: nf95_open, nf95_close, nf95_inq_varid, handle_err, & … … 162 162 latitude = latitude / 180. * pi 163 163 n_lat = size(latitude) 164 ! We need to supply the latitudes to "regr1_ step_av" in164 ! We need to supply the latitudes to "regr1_conserv" in 165 165 ! ascending order, so invert order if necessary: 166 166 desc_lat = latitude(1) > latitude(n_lat) … … 209 209 ! We average with respect to sine of latitude, which is 210 210 ! equivalent to weighting by cosine of latitude: 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/))) 211 call regr1_conserv(o3_par_in, xs = sin(lat_in_edg), & 212 xt = (/-1., sin((/boundslat_reg(nbp_lat-1:1:-1,south)/)), 1./), & 213 vt = v_regr_lat(nbp_lat:1:-1, :, 1:12)) 213 214 ! (invert order of indices in "v_regr_lat" because "rlatu" is 214 215 ! in descending order) -
LMDZ5/trunk/libf/phylmd/regr_pr_av_m.F90
r2346 r2440 26 26 27 27 ! The target vertical LMDZ grid is the grid of layer boundaries. 28 ! Regridding in pressure is done by averaging a step function of pressure.28 ! Regridding in pressure is conservative, second order. 29 29 30 30 ! All the fields are regridded as a single multi-dimensional array … … 38 38 use assert_m, only: assert 39 39 use assert_eq_m, only: assert_eq 40 use regr1_step_av_m, only: regr1_step_av 40 use regr1_conserv_m, only: regr1_conserv 41 use slopes_m, only: slopes 41 42 use mod_phys_lmdz_mpi_data, only: is_mpi_root 42 43 use mod_grid_phy_lmdz, only: nbp_lon, nbp_lat, nbp_lev … … 83 84 !-------------------------------------------- 84 85 85 call assert(size(v3, 1) == klon, size(v3, 2) == nbp_lev, "regr_pr_av v3 klon") 86 call assert(size(v3, 1) == klon, size(v3, 2) == nbp_lev, & 87 "regr_pr_av v3 klon") 86 88 n_var = assert_eq(size(name), size(v3, 3), "regr_pr_av v3 n_var") 87 89 call assert(shape(paprs) == (/klon, nbp_lev+1/), "regr_pr_av paprs") … … 112 114 ! Regrid in pressure at each horizontal position: 113 115 do i = 1, klon 114 v3(i, nbp_lev:1:-1, :) = regr1_step_av(v2(i, :, :), press_in_edg, & 115 paprs(i, nbp_lev+1:1:-1)) 116 call regr1_conserv(v2(i, :, :), press_in_edg, & 117 paprs(i, nbp_lev + 1:1:-1), v3(i, nbp_lev:1:-1, :), & 118 slopes(v2(i, :, :), press_in_edg)) 116 119 ! (invert order of indices because "paprs" is in descending order) 117 120 end do -
LMDZ5/trunk/libf/phylmd/regr_pr_o3_m.F90
r2346 r2440 28 28 use netcdf, only: nf90_nowrite, nf90_get_var 29 29 use assert_m, only: assert 30 use regr1_ step_av_m, only: regr1_step_av30 use regr1_conserv_m, only: regr1_conserv 31 31 use press_coefoz_m, only: press_in_edg 32 32 use time_phylmdz_mod, only: day_ref … … 75 75 ! Poles: 76 76 do j = 1, nbp_lat, nbp_lat-1 77 o3_mob_regr(1, j, nbp_lev:1:-1)&78 = regr1_step_av(r_mob(j, :), press_in_edg, p3d(1, j, nbp_lev+1:1:-1))77 call regr1_conserv(r_mob(j, :), press_in_edg, & 78 p3d(1, j, nbp_lev + 1:1:-1), o3_mob_regr(1, j, nbp_lev:1:-1)) 79 79 ! (invert order of indices because "p3d" is in descending order) 80 80 end do … … 83 83 do j = 2, nbp_lat-1 84 84 do i = 1, nbp_lon 85 o3_mob_regr(i, j, nbp_lev:1:-1) & 86 = regr1_step_av(r_mob(j, :), press_in_edg, & 87 p3d(i, j, nbp_lev+1:1:-1)) 88 ! (invert order of indices because "p3d" is in descending order) 85 call regr1_conserv(r_mob(j, :), press_in_edg, & 86 p3d(i, j, nbp_lev + 1:1:-1), o3_mob_regr(i, j, nbp_lev:1:-1)) 87 ! (invert order of indices because "p3d" is in descending order) 89 88 end do 90 89 end do
Note: See TracChangeset
for help on using the changeset viewer.