--- trunk/libf/phylmd/Mobidic/regr_lat_time_coefoz.f90 2008/03/31 12:51:21 8 +++ trunk/libf/phylmd/Mobidic/regr_lat_time_coefoz.f90 2011/07/01 15:00:48 47 @@ -6,7 +6,7 @@ implicit none private - public read_regr_lat_time_write_coefoz + public regr_lat_time_coefoz contains @@ -39,10 +39,9 @@ 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 netcdf95, only: nf95_open, nf95_get_coord, nf95_close, & + use nr_util, only: pi + use l_util, only: regr1_step_av, regr3_lint + 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 @@ -98,7 +97,7 @@ ! (name of NetCDF primary variable in the output file) integer varid_in(n_o3_param), varid_out(n_o3_param), varid_plev, varid_time - integer ncerr + integer ncerr, varid ! (for NetCDF) real, parameter:: tmidmonth(0:13) = (/(-15. + 30. * j, j = 0, 13)/) @@ -113,7 +112,7 @@ !--------------------------------- - print *, "Call sequence information: regr_coefoz" + print *, "Call sequence information: regr_lat_time_coefoz" ! Names of ozone parameters: i_v = 0 @@ -127,7 +126,7 @@ name_out(i_v) = "a2" i_v = i_v + 1 - name_in(i_v) = "r" + name_in(i_v) = "tro3" name_out(i_v) = "r_Mob" i_v = i_v + 1 @@ -150,11 +149,12 @@ name_in(i_v) = "R_Het" name_out(i_v) = "R_Het" - call nf95_open("coefoz_v2_3.nc", nf90_nowrite, ncid_in) + call nf95_open("coefoz.nc", nf90_nowrite, ncid_in) ! Get coordinates from the input file: - call nf95_get_coord(ncid_in, "latitude", latitude) + call nf95_inq_varid(ncid_in, "latitude", varid) + call nf95_gw_var(ncid_in, varid, latitude) ! Convert from degrees to rad, because "rlatv" is in rad: latitude = latitude / 180. * pi n_lat = size(latitude) @@ -170,7 +170,8 @@ lat_in_edg(n_lat + 1) = pi / 2 deallocate(latitude) ! pointer - call nf95_get_coord(ncid_in, "plev", plev) + call nf95_inq_varid(ncid_in, "plev", varid) + call nf95_gw_var(ncid_in, varid, plev) n_plev = size(plev) ! (We only need the pressure coordinate to copy it to the output file.) @@ -238,8 +239,7 @@ use dimens_m, only: jjm use comgeom, only: rlatu - use comconst, only: pi - use nrutil, only: assert_eq + use nr_util, only: assert_eq, pi use netcdf95, only: nf95_create, nf95_def_dim, nf95_def_var, & nf95_put_att, nf95_enddef, nf95_copy_att, nf95_put_var