--- trunk/libf/phylmd/Mobidic/regr_lat_time_coefoz.f90 2009/12/14 15:25:16 23 +++ trunk/Sources/phylmd/Mobidic/regr_lat_time_coefoz.f 2016/03/11 18:58:19 179 @@ -1,6 +1,5 @@ module regr_lat_time_coefoz_m - ! This module is clean: no C preprocessor directive, no include line. ! Author: Lionel GUEZ implicit none @@ -38,10 +37,9 @@ ! not use values of the input time coordinate). use dimens_m, only: jjm - use comgeom, only: rlatv - use comconst, only: pi - use regr1_step_av_m, only: regr1_step_av - use regr3_lint_m, only: regr3_lint + use dynetat0_m, only: rlatv + use nr_util, only: pi + use numer_rec_95, only: regr3_lint, regr1_conserv, slopes use netcdf95, only: nf95_open, nf95_gw_var, nf95_close, & nf95_inq_varid, handle_err, nf95_put_var use netcdf, only: nf90_nowrite, nf90_get_var @@ -206,8 +204,10 @@ ! Regrid in latitude: ! We average with respect to sine of latitude, which is ! equivalent to weighting by cosine of latitude: - v_regr_lat(jjm+1:1:-1, :, 1:12) = regr1_step_av(o3_par_in, & - xs=sin(lat_in_edg), xt=sin((/- pi / 2, rlatv(jjm:1:-1), pi / 2/))) + call regr1_conserv(o3_par_in, & + xs = sin(lat_in_edg), xt = (/- 1., sin(rlatv(jjm:1:-1)), 1./), & + slope = slopes(o3_par_in, sin(lat_in_edg)), & + vt = v_regr_lat(jjm + 1:1:- 1, :, 1:12)) ! (invert order of indices in "v_regr_lat" because "rlatu" is ! decreasing) @@ -239,13 +239,11 @@ ! dimensions and variables, and writes one of the coordinate variables. use dimens_m, only: jjm - use comgeom, only: rlatu - use comconst, only: pi - use numer_rec, only: assert_eq - + use dynetat0_m, only: rlatu + use netcdf, only: nf90_clobber, nf90_float, nf90_copy_att, nf90_global use netcdf95, only: nf95_create, nf95_def_dim, nf95_def_var, & nf95_put_att, nf95_enddef, nf95_copy_att, nf95_put_var - use netcdf, only: nf90_clobber, nf90_float, nf90_copy_att, nf90_global + use nr_util, only: assert_eq, pi integer, intent(in):: ncid_in, varid_in(:), n_plev character(len=*), intent(in):: name_out(:) ! of NetCDF variables