--- trunk/libf/phylmd/ini_histins.f90 2012/10/02 15:50:56 67 +++ trunk/Sources/phylmd/ini_histins.f 2016/05/09 19:56:28 191 @@ -2,59 +2,51 @@ implicit none + integer, save:: nid_ins + contains - subroutine ini_histins(dtime, ok_instan, nid_ins) + subroutine ini_histins(dtime) ! From phylmd/ini_histins.h, v 1.2 2005/05/25 13:10:09 - use dimens_m, only: iim, jjm, llm + use clesphys, only: ecrit_ins, ok_instan + use clesphys2, only: conv_emanuel + use dimens_m, only: iim, jjm, llm, nqmx use dimphy, only: klon - use temps, only: itau_phy, day_ref, annee_ref - use clesphys, only: ecrit_ins - use indicesol, only: nbsrf, clnsurf - USE calendar, only: ymds2ju + use disvert_m, only: presnivs + use dynetat0_m, only: day_ref, annee_ref, rlatu, rlonv USE histbeg_totreg_m, ONLY : histbeg_totreg USE histdef_m, ONLY : histdef USE histend_m, ONLY : histend USE histvert_m, ONLY : histvert - use phyetat0_m, only: rlon, rlat - use disvert_m, only: presnivs + use indicesol, only: nbsrf, clnsurf + use iniadvtrac_m, only: tname, ttext + use nr_util, only: pi + use phyetat0_m, only: itau_phy + USE ymds2ju_m, only: ymds2ju REAL, intent(in):: dtime ! pas temporel de la physique (s) - logical, intent(in):: ok_instan - integer, intent(out):: nid_ins - REAL zx_lon(iim, jjm + 1), zx_lat(iim, jjm + 1) + ! Local: real zjulian, zsto, zout - integer i, nhori, nvert, idayref, nsrf + integer nhori, nvert, nsrf, iq, it !------------------------------------------------------------------- IF (ok_instan) THEN - zsto = dtime * ecrit_ins zout = dtime * ecrit_ins - - idayref = day_ref - CALL ymds2ju(annee_ref, 1, idayref, 0.0, zjulian) - - CALL gr_fi_ecrit(1, klon, iim, (jjm + 1), rlon, zx_lon) - DO i = 1, iim - zx_lon(i, 1) = rlon(i+1) - zx_lon(i, (jjm + 1)) = rlon(i+1) - ENDDO - CALL gr_fi_ecrit(1, klon, iim, (jjm + 1), rlat, zx_lat) - CALL histbeg_totreg("histins", zx_lon(:, 1), zx_lat(1, :), 1, iim, 1, & - jjm + 1, itau_phy, zjulian, dtime, nhori, nid_ins) + CALL ymds2ju(annee_ref, 1, day_ref, 0.0, zjulian) + CALL histbeg_totreg("histins", rlonv(:iim) / pi * 180., & + rlatu / pi * 180., 1, iim, & + 1, jjm + 1, itau_phy, zjulian, dtime, nhori, nid_ins) write(*, *)'Inst ', itau_phy, zjulian CALL histvert(nid_ins, "presnivs", "Vertical levels", "mb", & presnivs/100., nvert) - CALL histdef(nid_ins, "phis", "Surface geop. height", "-", & iim, (jjm + 1), nhori, 1, 1, 1, -99, & "once", zsto, zout) - CALL histdef(nid_ins, "aire", "Grid area", "-", & iim, (jjm + 1), nhori, 1, 1, 1, -99, & "once", zsto, zout) @@ -217,12 +209,7 @@ CALL histdef(nid_ins, "albs", "Surface albedo", "-", & iim, (jjm + 1), nhori, 1, 1, 1, -99, & "inst(X)", zsto, zout) - CALL histdef(nid_ins, "albslw", "Surface albedo LW", "-", & - iim, (jjm + 1), nhori, 1, 1, 1, -99, & - "inst(X)", zsto, zout) - !IM cf. AM 081204 BEG - ! HBTM2 CALL histdef(nid_ins, "s_pblh", "Boundary Layer Height", "m", & iim, (jjm + 1), nhori, 1, 1, 1, -99, & "inst(X)", zsto, zout) @@ -264,7 +251,8 @@ iim, (jjm + 1), nhori, 1, 1, 1, -99, & "inst(X)", zsto, zout) - !IM cf. AM 081204 END + if (conv_emanuel) CALL histdef(nid_ins, "ptop", "cloud top pressure", & + "Pa", iim, jjm + 1, nhori, 1, 1, 1, -99, "inst(X)", zsto, zout) ! Champs 3D: @@ -296,6 +284,40 @@ iim, (jjm + 1), nhori, llm, 1, llm, nvert, & "inst(X)", zsto, zout) + CALL histdef(nid_ins, "zmasse", "column density of air in cell", & + "kg m-2", iim, jjm + 1, nhori, llm, 1, llm, nvert, "inst(X)", & + zsto, zout) + + CALL histdef(nid_ins, "rhum", "Relative humidity", & + "", iim, jjm + 1, nhori, llm, 1, llm, nvert, "inst(X)", & + zsto, zout) + + DO it = 1, nqmx - 2 + ! champ 2D + iq=it+2 + CALL histdef(nid_ins, tname(iq), ttext(iq), "U/kga", iim, jjm+1, & + nhori, llm, 1, llm, nvert, "inst(X)", zsto, zout) + CALL histdef(nid_ins, "fl"//tname(iq), "Flux "//ttext(iq), & + "U/m2/s", iim, jjm+1, nhori, llm, 1, llm, nvert, & + "inst(X)", zsto, zout) + + !---Ajout Olivia + CALL histdef(nid_ins, "d_tr_th_"//tname(iq), & + "tendance thermique"// ttext(iq), "?", & + iim, jjm+1, nhori, llm, 1, llm, nvert, & + "inst(X)", zsto, zout) + CALL histdef(nid_ins, "d_tr_cv_"//tname(iq), & + "tendance convection"// ttext(iq), "?", & + iim, jjm+1, nhori, llm, 1, llm, nvert, & + "inst(X)", zsto, zout) + CALL histdef(nid_ins, "d_tr_cl_"//tname(iq), & + "tendance couche limite"// ttext(iq), "?", & + iim, jjm+1, nhori, llm, 1, llm, nvert, & + "inst(X)", zsto, zout) + !---fin Olivia + + ENDDO + CALL histend(nid_ins) ENDIF