--- trunk/libf/phylmd/Mobidic/regr_pr_o3.f90 2011/09/23 12:28:01 52 +++ trunk/Sources/phylmd/Mobidic/regr_pr_o3.f 2015/04/29 15:47:56 134 @@ -4,7 +4,7 @@ contains - subroutine regr_pr_o3(o3_mob_regr) + subroutine regr_pr_o3(p3d, o3_mob_regr) ! "regr_pr_o3" stands for "regrid pressure ozone". ! This procedure reads Mobidic ozone mole fraction from @@ -22,15 +22,19 @@ ! We assume that, in the input file, the pressure levels are in ! hPa and strictly increasing. - use conf_gcm_m, only: dayref use dimens_m, only: iim, jjm, llm + use dynetat0_m, only: day_ref + use grid_change, only: dyn_phy + use netcdf, only: nf90_nowrite, nf90_get_var use netcdf95, only: nf95_open, nf95_close, nf95_inq_varid, handle_err, & nf95_gw_var - use netcdf, only: nf90_nowrite, nf90_get_var use nr_util, only: assert - use grid_change, only: dyn_phy - use numer_rec, only: regr1_step_av - use pressure_var, only: p3d + use numer_rec_95, only: regr1_step_av + + REAL, intent(in):: p3d(:, :, :) ! (iim + 1, jjm + 1, llm+1) + ! pressure at layer interfaces, in Pa + ! ("p3d(i, j, l)" is at longitude "rlonv(i)", latitude "rlatu(j)", + ! for interface "l") real, intent(out):: o3_mob_regr(:, :, :) ! (iim + 1, jjm + 1, llm) ! (ozone mole fraction from Mobidic adapted to the LMDZ grid) @@ -51,13 +55,17 @@ integer i, j real, allocatable:: r_mob(:, :)! (jjm + 1, n_plev) - ! (ozone mole fraction from Mobidic at day "dayref") + ! (ozone mole fraction from Mobidic at day "day_ref") ! (r_mob(j, k) is at latitude "rlatu(j)" and pressure level "plev(k)".) !------------------------------------------------------------ print *, "Call sequence information: regr_pr_o3" - call assert(shape(o3_mob_regr) == (/iim + 1, jjm + 1, llm/), "regr_pr_o3") + + call assert(shape(o3_mob_regr) == (/iim + 1, jjm + 1, llm/), & + "regr_pr_o3 o3_mob_regr") + call assert(shape(p3d) == (/iim + 1, jjm + 1, llm + 1/), & + "regr_pr_o3 p3d") call nf95_open("coefoz_LMDZ.nc", nf90_nowrite, ncid) @@ -82,7 +90,7 @@ allocate(r_mob(jjm + 1, n_plev)) ! Get data at the right day from the input file: - ncerr = nf90_get_var(ncid, varid, r_mob, start=(/1, 1, dayref/)) + ncerr = nf90_get_var(ncid, varid, r_mob, start=(/1, 1, day_ref/)) call handle_err("nf90_get_var r_Mob", ncerr) ! Latitudes are in increasing order in the input file while ! "rlatu" is in decreasing order so we need to invert order: