--- trunk/libf/dyn3d/etat0.f90 2008/02/27 13:16:39 3 +++ trunk/libf/dyn3d/etat0.f90 2008/07/21 16:05:07 12 @@ -36,16 +36,16 @@ use serre, only: alphax use dimsoil, only: nsoilmx use temps, only: itau_dyn, itau_phy, annee_ref, day_ref, dt - use clesphys, only: ok_orodr, nbapp_rad + use clesphys2, only: ok_orodr, nbapp_rad use grid_atob, only: grille_m use grid_change, only: init_dyn_phy, dyn_phy use q_sat_m, only: q_sat use exner_hyb_m, only: exner_hyb - use regr_coefoz_m, only: regr_coefoz use advtrac_m, only: iniadvtrac - use netcdf95, only: nf95_open, nf95_close, nf95_inq_varid, nf90_nowrite, & - nf90_get_var, handle_err - use pressure_m, only: pls, p3d + use pressure_var, only: pls, p3d + use dynredem0_m, only: dynredem0 + use regr_lat_time_coefoz_m, only: regr_lat_time_coefoz + use regr_pr_o3_m, only: regr_pr_o3 ! Variables local to the procedure: @@ -95,7 +95,6 @@ REAL flic_tmp(iim + 1, jjm + 1) !fraction land ice temporary INTEGER l, ji - INTEGER nq REAL pk(iim + 1, jjm + 1, llm) ! fonction d'Exner aux milieux des couches real pks(iim + 1, jjm + 1) @@ -106,7 +105,6 @@ REAL w(ip1jmp1, llm) REAL phystep INTEGER radpas - integer ncid, varid, ncerr, month !--------------------------------- @@ -186,28 +184,13 @@ q3d(:, :, :, 2:4) = 0. ! liquid water, radon and lead - ! Ozone: - - ! Compute ozone parameters on the LMDZ grid: - call regr_coefoz - - ! Find the month containing the day number "dayref": - month = (dayref - 1) / 30 + 1 - print *, "month = ", month - - call nf95_open("coefoz_LMDZ.nc", nf90_nowrite, ncid) - - ! Get data at the right month from the input file: - call nf95_inq_varid(ncid, "r_Mob", varid) - ncerr = nf90_get_var(ncid, varid, q3d(:, :, :, 5), & - start=(/1, 1, 1, month/)) - call handle_err("nf90_get_var r_Mob", ncerr) - - call nf95_close(ncid) - ! Latitudes are in increasing order in the input file while - ! "rlatu" is in decreasing order so we need to invert order. Also, we - ! compute mass fraction from mole fraction: - q3d(:, :, :, 5) = q3d(:, jjm+1:1:-1, :, 5) * 48. / 29. + if (nqmx >= 5) then + ! Ozone: + call regr_lat_time_coefoz + call regr_pr_o3(q3d(:, :, :, 5)) + ! Convert from mole fraction to mass fraction: + q3d(:, :, :, 5) = q3d(:, :, :, 5) * 48. / 29. + end if tsol(:) = pack(tsol_2d, dyn_phy) qsol(:) = pack(qsol_2d, dyn_phy) @@ -305,7 +288,7 @@ END forall ! Initialisation pour traceurs: - call iniadvtrac(nq) + call iniadvtrac ! Ecriture: CALL inidissip(lstardis, nitergdiv, nitergrot, niterh, tetagdiv, & tetagrot, tetatemp) @@ -317,8 +300,8 @@ CALL geopot(ip1jmp1, tpot, pk , pks, phis , phi) CALL caldyn0(0, uvent, vvent, tpot, psol, masse, pk, phis, phi, w, & pbaru, pbarv, 0) - CALL dynredem0("start.nc", dayref, phis, nqmx) - CALL dynredem1("start.nc", 0., vvent, uvent, tpot, q3d, nqmx, masse, psol) + CALL dynredem0("start.nc", dayref, phis) + CALL dynredem1("start.nc", 0., vvent, uvent, tpot, q3d, masse, psol) ! Ecriture état initial physique: print *, 'dtvr = ', dtvr @@ -370,7 +353,7 @@ ratqs = 0. run_off_lic_0 = 0. - call phyredem("startphy.nc", phystep, radpas, latfi, lonfi, pctsrf, & + call phyredem("startphy.nc", radpas, latfi, lonfi, pctsrf, & tsolsrf, tsoil, tslab, seaice, qsolsrf, qsol, snsrf, albe, alblw, & evap, rain_fall, snow_fall, solsw, sollw, fder, radsol, frugs, & agesno, zmea, zstd, zsig, zgam, zthe, zpic, zval, rugsrel, &